sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);
//------------------------------------------------------------------------------------------
$(function(){
				// Tabs
				$('#tabs').tabs();				
			});

//------------------------------------------------------------------------------------------
 // Set the initial height 
            var sliderHeight = "103px"; 
     
            $(document).ready(function(){ 
                
                // Set an HTML attribute for the intended open height of the tabs
                $('.ui-tabs-panel ul').each(function () { 
                    var current = $(this); 
                    current.attr("box_h", current.height() + "px"); 
});
                // Set the first tab to the initial height
                $("#tabs-1 ul").css("height", sliderHeight);
                $(".ui-tabs-panel ul").attr("sliderstate", "closed");
                // When a tab is clicked the intended is written to the attribute
                // The tab is then set to the inital height
                $('.ui-tabs-nav li a').click(function(){
                    var forTab = $(this).attr('href');
                    var parentIntendedHeight = $(forTab+" ul").height();
                    if($(forTab+" ul").height() != "103"){
                        $(forTab+" ul").attr("box_h", parentIntendedHeight);
                        $(forTab+" ul").css('height',sliderHeight);
                    }
                    $('.tabClose').hide();
                    $('.tabExpand').show();
                })
                // When the expand button is clicked animate the height of the ul to the set attribute
                $('.tabExpand').click(function(){
                    $(this).toggle();
                    $(this).next('.tabClose').toggle();
                    var browser = $(this).parents('#reveal').siblings('.innerTabContainer').children('.jobsBrowserList');
                    var intendedHeight = browser.attr('box_h');
                    browser.animate({
                        'height' : intendedHeight
                    }, 400)
                })
                // When the close button is clicked animate the height of the ul to the initial height and reset buttons
                $('.tabClose').click(function(){
                    $(this).toggle();
                    $(this).prev('.tabExpand').toggle();
                    var browser = $(this).parents('#reveal').siblings('.innerTabContainer').children('.jobsBrowserList');
                    var intendedHeight = browser.attr('box_h');
                    browser.animate({
                        'height' : sliderHeight
                    }, 400)
                })
            }); 
//------------------------------------------------------------------------------------------
$(document).ready(function(){
	    $("#myController").jFlow({
			controller: ".jFlowControl", // must be class, use . sign
			slideWrapper : "#jFlowSlider", // must be id, use # sign
			slides: "#mySlides",  // the div where all your sliding divs are nested in
			selectedWrapper: "jFlowSelected",  // just pure text, no sign
			width: "100%",  // this is the width for the content-slider
			height: "97px",  // this is the height for the content-slider
			duration: 1800,  // time in miliseconds to transition one slide
			prev: ".jFlowPrev", // must be class, use . sign
			next: ".jFlowNext", // must be class, use . sign
			auto: true	
    });
    
    
				
                $('select#userLevel').selectmenu(); $('select#userLevelWizard').selectmenu(); $('select#Candidate_location').selectmenu(); $('select#Candidate_specialisation').selectmenu(); $('select#Candidate_heared_about_us').selectmenu(); $('select#Candidate_level_id').selectmenu();  $('select#cStatus').selectmenu(); $('select#CandidateSavedSearch_level_id').selectmenu(); $('select#CandidateSavedSearch_practiceid').selectmenu(); $('select#CandidateSavedSearch_typeid').selectmenu(); $('select#CandidateSavedSearch_sectorid').selectmenu(); $('select#CandidateSavedSearch_geoid').selectmenu(); $('select#CandidateSavedSearch_serviceid').selectmenu();  $('select#Diversity_age').selectmenu(); $('select#Diversity_gender').selectmenu(); $('select#Diversity_religion').selectmenu(); $('select#Diversity_orientation').selectmenu(); $('select#Diversity_ethnicity').selectmenu(); $('select#Diversity_disability').selectmenu();
                
                //$('select#JobStreamer_location').selectmenu(); $('select#JobStreamer_area').selectmenu();$('select#JobStreamer_title').selectmenu(); $('select#JobStreamer_type').selectmenu(); $('select#JobStreamer_sector').selectmenu();
                //$('select#Candidate_practiceid').selectmenu(); $('select#Candidate_typeid').selectmenu();  $('select#Candidate_serviceid').selectmenu();  $('select#Candidate_sectorid').selectmenu(); $('select#Candidate_geoid').selectmenu();
                
                
                

                $("#Items1,#Items2,#Items3,#Items4,#Items5").selectBox();
					


});

//------------------------------------------------------------------------------------------
			
			//});			
//------------------------------------------------------------------------------------------

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-2307066-3']);
  _gaq.push(['_trackPageview']);
  _gaq.push(['_trackPageLoadTime']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
  
  
  
