$(document).ready(function(){

	setdisplay();

    function changeSlide(index) {
        var currentslide = $('.slide').eq(index);
        $('.slide').hide();
        currentslide.fadeIn(400);
    }

    $('.slideshow .pagination a').each(function(index){
        $(this).click(function(){
            changeSlide(index);
            $('.slideshow .pagination a').removeClass('selected');
            $(this).addClass('selected');   
            return false;
        });
    });

    changeSlide(0);

    // search label
    $('#search input[type=text]')
    .focus(function(){
        var content = $(this).val();    
        $("#search label").hide();   
    })
    .blur(function(){
        var content = $(this).val();
        if (!content) {
            $("#search label").show();
        } else {
            $("#search label").hide();   
        };
    });

     $('#search label')
    .click(function(){   
        $(this).hide(); 
        $('#search input[type=text]').focus();  
    });


    // empty the search box on refresh
     $('#search input[type=text]').val('');

   
 
    

    // location menu
    $('#location h2 a').toggle(
        function(){
            $('#location h2 a img').attr('src','/images/icon-up-arrow.png').css('right','10px');
            $('#locationmenu').show();
        },
        function(){
            $('#location h2 a img').attr('src','/images/icon-down-arrow.png').css('right','-16px');
            $('#locationmenu').hide();
        }
    );

    // fix select boxes in ie


    // inlcude hide.css
     $('head').append($("<link href='/css/hide.css' rel='stylesheet' type='text/css' media='screen'/>"));


    // print link sends print signal to browser

    $('.print').click(function(){
        //window.print();
    });


    // Handle popup links  
    $('.externallink').attr("target","_blank");  //Enables use of target attribute at maintain html strict validation.

});


$(document).ready(function(){

  

    $('#sidenav .open').click(function(){
        $("#sidenav > ul > li > ul:visible").slideUp();
        $(this).siblings('ul:not(:visible)').slideDown();
        return false;
    });

	//Expand the selected branch
	$('#sidenav .selected').parents('ul').css('display','block');


	$("div.job").hover(
        function() {$(this).css('background', '#e0ece0')},
        function() {$(this).css('background', '')}
        );

	
});




		function goLogin(){
			document.getElementById('commonloginform').style.display='block';
			};

		function goLogout(){
			if (confirm('Are you sure?')==true){
				document.location.href="/login.aspx?signout=true";			
			}
		};



	function setdisplay(){
			if (document.getElementById("whaterofferitems")){
				  document.getElementById("whaterofferitems").className = "";
				  document.getElementById("whaterofferitems").style.display = "block";
			}
		}


