// Image Hover
if (document.images)
{
    pic1on= new Image(87,27);
    pic1on.src="/image/CooperativeButtonOn.jpg";  

    pic1off= new Image(87,27);
    pic1off.src="/image/CooperativeButtonOff.jpg";
    
    pic2on= new Image(57,27);
    pic2on.src="/image/NewsCenterButtonOn.jpg";  

    pic2off= new Image(57,27);
    pic2off.src="/image/NewsCenterButtonOff.jpg";
    
    pic3on= new Image(34,27);
    pic3on.src="/image/CareersButtonOn.jpg";  

    pic3off= new Image(34,27);
    pic3off.src="/image/CareersButtonOff.jpg";
    
    pic4on= new Image(99,43);
    pic4on.src="/image/MyPDECButtonOn.jpg";  

    pic4off= new Image(99,43);
    pic4off.src="/image/MyPDECButtonOff.jpg";
    
    pic5on= new Image(116,43);
    pic5on.src="/image/GrowingGreenButtonOn.jpg";  

    pic5off= new Image(116,43);
    pic5off.src="/image/GrowingGreenButtonOff.jpg";
    
    pic6on= new Image(96,43);
    pic6on.src="/image/CommunityButtonOn.jpg";  

    pic6off= new Image(96,43);
    pic6off.src="/image/CommunityButtonOff.jpg";
	
	pic7on= new Image(105,43);
	pic7on.src="/image/StormCenterButtonOn.jpg";
	
	pic7off= new Image(105,43);
	pic7off.src="/image/StormCenterButtonOff.jpg";

    pic8on= new Image(184,43);
    pic8on.src="/image/EconomicDevelopmentButtonOn.jpg";

    pic8off= new Image(184,43);
    pic8off.src="/image/EconomicDevelopmentButtonOff.jpg";
	
	pic9on= new Image(129,36);
    pic9on.src="/image/CooperativeProfileButtonOn.png";

    pic9off= new Image(129,36);
    pic9off.src="/image/CooperativeProfileButtonOff.png";
	
	pic10on= new Image(67,31);
    pic10on.src="/image/MyPDECMiddleButtonOn.jpg";

    pic10off= new Image(67,31);
    pic10off.src="/image/MyPDECMiddleButtonOff.jpg";
	
	pic11on= new Image(104,31);
    pic11on.src="/image/GrowingGreenMiddleButtonOn.jpg";

    pic11off= new Image(104,31);
    pic11off.src="/image/GrowingGreenMiddleButtonOff.jpg";
	
	pic12on= new Image(84,31);
    pic12on.src="/image/CommunityMiddleButtonOn.jpg";

    pic12off= new Image(84,31);
    pic12off.src="/image/CommunityMiddleButtonOff.jpg";
	
	pic13on= new Image(94,31);
    pic13on.src="/image/StormCenterMiddleButtonOn.jpg";

    pic13off= new Image(94,31);
    pic13off.src="/image/StormCenterMiddleButtonOff.jpg";
	
	pic14on= new Image(151,31);
    pic14on.src="/image/EconomicDevelopmentMiddleButtonOn.jpg";

    pic14off= new Image(151,31);
    pic14off.src="/image/EconomicDevelopmentMiddleButtonOff.jpg";
	
	pic15on= new Image(51,20);
    pic15on.src="/image/SearchButtonOn.jpg";

    pic15off= new Image(51,20);
    pic15off.src="/image/SearchButtonOff.jpg";
	
	pic16on= new Image(73,20);
    pic16on.src="/image/EBillLoginButtonOn.jpg";

    pic16off= new Image(73,20);
    pic16off.src="/image/EBillLoginButtonOff.jpg";
	
	
	// Translation Image Flips
	pic24on= new Image(101,25);
	pic24on.src="/image/Translation-Chinese.png";
	
	pic25on= new Image(101,25);
	pic25on.src="/image/Translation-French.png";
	
	pic26on= new Image(101,25);
	pic26on.src="/image/Translation-German.png";
	
	pic27on= new Image(101,25);
	pic27on.src="/image/Translation-Italian.png";
	
	pic28on= new Image(101,25);
	pic28on.src="/image/Translation-Japanese.png";
	
	pic29on= new Image(101,25);
	pic29on.src="/image/Translation-Korean.png";
	
	pic30on= new Image(101,25);
	pic30on.src="/image/Translation-Russian.png";
	
	pic31on= new Image(101,25);
	pic31on.src="/image/Translation-Spanish.png";
}

function lightup(imgName)
{
    if (document.images)
    {
        imgOn=eval(imgName + "on.src");
        document[imgName].src= imgOn;
    }
}

function turnoff(imgName)
{
    if (document.images)
    {
        imgOff=eval(imgName + "off.src");
        document[imgName].src= imgOff;
    }
}

// Translation Light Up and Turn Off
function lightupTranslation(imgName,imgDest)
{
    if (document.images)
    {
        imgOn=eval(imgDest + "on.src");
        document[imgName].src= imgOn;
    }
}

function turnoffTranslation(imgName)
{
    if (document.images)
    {
        document[imgName].src= "/image/Translation-English.png";
    }
}


// ********** JQuery Scripting ********** //
jQuery(document).ready(function(){
								
	// Image Crossfade
	jQuery("img.a").hover(
	function() {
		jQuery(this).stop().animate({"opacity": "0"}, 200);
	},
	function() {
		jQuery(this).stop().animate({"opacity": "1"}, 600);
	});
	
	
	// Custom Scrollbars
	jQuery(function()
	{
		jQuery('.jobseekers-content-content').jScrollPane();
		jQuery('.employers-content-content').jScrollPane();
		jQuery('.tmec-content-content').jScrollPane();
		jQuery('.tmjc-content-content').jScrollPane();
		jQuery('.bmec-content-content').jScrollPane();
		jQuery('.bmjc-content-content').jScrollPane();
	});
	
	
	// Dropdown Navigation
	jQuery("div.secondary-nav-button-container").click(function() { //When trigger is clicked...
	
		//Following events are applied to the subnav itself (moving subnav up and down)
		jQuery(this).parent().find("div.search-login-button-dropdown").slideDown('fast').show(); //Drop down the subnav on click
		
		jQuery(this).parent().hover(function() {
		}, function(){
			jQuery(this).parent().find("div.search-login-button-dropdown").slideUp('slow'); //When the mouse hovers out of the subnav, move it back up
		}); 
	});
	
	// Homepage Middle Content Flip
	jQuery(function () {
		var tabs = [];
		var tabContainers = [];
		jQuery('ul.top-middle-button-container a').each(function () {
		  // note that this only compares the pathname, not the entire url
		  // which actually may be required for a more terse solution.
			if (this.pathname.replace(/^\//,'') == window.location.pathname.replace(/^\//,'')) {
				tabs.push(this);
				tabContainers.push(jQuery(this.hash).get(0));
			}
		});
		
		//jQuery("ul.top-middle-button-container li a:first").addClass("selected").show(); //Activate first tab
		//jQuery("ul.top-middle-button-container li a:first").html('<img src="/image/NorthstarMiddleButtonThere.jpg" alt="Northstar" width="180" height="75" />').show();
		jQuery("ul.top-middle-button-container li a:first").parent().find("img.c").css({zIndex: 1000}); //Show first tab content
		jQuery(tabContainers).hide();
		jQuery(".tab-container:first").show();
		
		jQuery(tabs).click(function () {
			// hide all tabs
			jQuery(tabContainers).hide().filter(this.hash).fadeIn(300);
			//jQuery(tabContainers).hide().filter(this.hash).show();
			
			// set up the selected class
			//jQuery(tabs).removeClass('selected');
			jQuery(tabs).parent().find("img.c").css({zIndex: 0});
			//jQuery(this).addClass('selected');
			jQuery(this).parent().find("img.c").css({zIndex: 1000});
			
			return false;
		});
	});
								
});


// Form Element Removable
function RemoveFirstName()
{
	if (document.getElementById("FirstName").value == "First Name")
	{
		document.getElementById("FirstName").value = "";
	}
	else
	{
		
	}
}
function AddFirstName()
{
    if (document.getElementById("FirstName").value != "")
    {
        
    }
    else
    {
        document.getElementById("FirstName").value = "First Name";
    }
}

function RemoveLastName()
{
    if (document.getElementById("LastName").value == "Last Name")
	{
		document.getElementById("LastName").value = "";
	}
	else
	{
		
	}
}
function AddLastName()
{
    if (document.getElementById("LastName").value != "")
    {
        
    }
    else
    {
        document.getElementById("LastName").value = "Last Name";
    }
}

function RemoveEmailAddress()
{
    if (document.getElementById("EmailAddress").value == "Email Address")
	{
		document.getElementById("EmailAddress").value = "";
	}
	else
	{
		
	}
}
function AddEmailAddress()
{
    if (document.getElementById("EmailAddress").value != "")
    {
        
    }
    else
    {
        document.getElementById("EmailAddress").value = "Email Address";
    }
}


// Search Validation
function SearchValidate()
{
    if (document.getElementById("Search").value.length <= 2)
	{
		alert("Search Phrase - Please provide a valid entry");
		return false;
	}
	else
	{
		return true;
	}
}
