//**************** Univ Nav Boxes ****************
$(document).ready(function() {
// *** Manpower Group of Companies menu ***
	//$('#MpGoC-box').hide();
	//$('#MpGoC-content div').hide();

	$('.MpGoCtoggle').hover(function() {
		$(this).toggleClass("MpGoCtoggle-active");
	});

	$('.MpGoCtoggle').mouseout(function() {
		$(this).removeClass("MpGoCtoggle-active");
	});

	$('.MpGoCtoggle').click(function() {
		$('#MpGoC-content div').hide();
                                $('#MpGoC-intro').show();
		$(this).addClass("MpGoCtoggle-active");
		$('#MpGoC-box').slideToggle('medium');
		return false;
	});

	$('#MpGoC-box').mouseenter(function() {
		$('.MpGoCtoggle').addClass("MpGoCtoggle-active");
	});

	$('#MpGoC-box').mouseleave(function() {
		$('#MpGoC-box').fadeOut('fast');
		$('#MpGoC-content div').hide();
		$('.MpGoCtoggle').removeClass("MpGoCtoggle-active");
	});

	$('#MpGoC-content a').click(function() {
		$('#MpGoC-box').fadeOut('fast');
		$('.MpGoCtoggle').removeClass("MpGoCtoggle-active");
	});

	$('#MpGoC-links a').click(function(){
		$('#MpGoC-intro').hide();
                                var index = $("#MpGoC-links a").index(this);
		$('#MpGoC-content').animate({"marginTop" : -index*300 + "px"}); // multiply by height+top/bottom padding/margin/border
                                $('#MpGoC-content div').show();
	});

// *** Country/Language site change menu ***
	$('#siteChange-box').hide();

	$('.siteChangetoggle').click(function() {
		$('#siteChange-box').slideToggle('medium');
		return false;
	});

	$('.siteChangetoggle').hover(function() {
		$(this).toggleClass("siteChangetoggle-active");
	});

		$('#siteChange-box').mouseenter(function() {
		$('.siteChangetoggle').addClass("siteChangetoggle-active");
	});

	$('.siteChangetoggle').mouseout(function() {
		$(this).removeClass("siteChangetoggle-active");
	});

	$('#siteChange-box').mouseleave(function() {
		$('#siteChange-box').fadeOut('fast');
		$('.siteChangetoggle').removeClass("siteChangetoggle-active");
	});

	$('#siteChange-links a').click(function() {
		$('#siteChange-box').fadeOut('fast');
		$('.siteChangetoggle').removeClass("siteChangetoggle-active");
	});
});



//**************** Dynamic Div height - Content Div Feature Boxes ****************
$(document).ready(function() {
   $('.featureHeight').equalHeights();
});

$(document).ready(function() {
   $('.locSel').equalHeights();
});

//**************** Factoid Dynamic Font Sizing ****************
$(document).ready(function(){
$("#factoidNumber").dynamicFontSize();
});


//****************Jquery Search Input Text onFocus Replacement ****************
$(document).ready(function() {
$('input#searchInputBox').click(function() {
	if ($(this).val()=='Search...') $(this).val('');
	}).blur(function() {
	if ($(this).val()=='') $(this).val('Search...');		
	});
// === Home & Widget - Office Locator ===
$('input#searchLocations.ca').click(function() {
	if ($(this).val()=='Postal Code OR City, Province') $(this).val('');
	}).blur(function() {
	if ($(this).val()=='') $(this).val('Postal Code OR City, Province');		
	});

$('input#searchLocations').click(function() {
	if ($(this).val()=='Zip Code -or- City, State') $(this).val('');
	}).blur(function() {
	if ($(this).val()=='') $(this).val('Zip Code -or- City, State');		
	});

// === Home & Widget - Job Search - Location ===
$('input#location.ca').click(function() {
	if ($(this).val()=='Postal Code OR City, Province') $(this).val('');
	}).blur(function() {
	if ($(this).val()=='') $(this).val('Postal Code OR City, Province');		
	});

$('input#location').click(function() {
	if ($(this).val()=='Zip Code -or- City, State') $(this).val('');
	}).blur(function() {
	if ($(this).val()=='') $(this).val('Zip Code -or- City, State');		
	});

// === Home & Widget - Job Search - Keywords ===
$('input#keywords1').click(function() {
	if ($(this).val()=='Job Title, Industry or Skills') $(this).val('');
	}).blur(function() {
	if ($(this).val()=='') $(this).val('Job Title, Industry or Skills');		
	});
});


//****************Jquery External Links w/Icon****************
     $(document).ready(function() {
        $('.extlinks p a').filter(function() {
          return this.hostname && this.hostname !== location.hostname;
        }).after(' <img src="https://us.manpower.com/us/en/multimedia/new_win.gif" alt="external link"/>');
      });
//****http://www.learningjquery.com/2008/08/quick-tip-dynamically-add-an-icon-for-external-links**



//****************Jquery Parameters for KK accordion****************
$(document).ready(function(){
	// Toggle Single Portlet
	$('a.toggle').click(function(){
			$(this).parent('div').next('div').slideToggle("medium");
			$(this).toggleClass('active');
			return false;
		});
		});

//****************Jquery Parameters for Liquid Canvas Div Renderings****************
$(window).load(function() {
$(".featureContainer").liquidCanvas( "[  glow  border fill ] => roundedRect{radius:10}");
$(".homeMultiFeature").liquidCanvas( "[  glow border fill ] => roundedRect{radius:10}");
$("#fatFooter").liquidCanvas( "[ glow border gradientmm ] => roundedRect{radius:10}");
$(".locSel").liquidCanvas( "[   fill_eee ] => roundedRect{radius:10}");
$("#promo_marqueeSmall").liquidCanvas( "[  gradient_blu ] => roundedRect{radius:5}");
$("#twoColumnContentArea").liquidCanvas( "[  glow border fill ] => roundedRect{radius:10}");
$("#twoColumnContentArea-home").liquidCanvas( "[  glow border fill ] => roundedRect{radius:10}");
$(".factoid").liquidCanvas( "[ glow border gradient_org ] => roundedRect{radius:10}");
$(".featureHeight").liquidCanvas( "[  oneborder gradientmm  ] => roundedRect{radius:10}");
$("#centerPromo").liquidCanvas( "[  oneborder gradientmm  ] => roundedRect{radius:10}");
$("#officeDetail").liquidCanvas( "[  glow border fill ] => roundedRect{radius:10}");
$("#officeFeatures").liquidCanvas( "[  glow border fill ] => roundedRect{radius:10}");
$("#officeOverview").liquidCanvas( "[  glow border fill ] => roundedRect{radius:10}");
$("#soeInner").liquidCanvas( "[  glow border fill ] => roundedRect{radius:10}");
$("#summaryInsertContent").liquidCanvas( "[   oneborder fill ] => roundedRect{radius:10}");
//$(".rightraildiv").liquidCanvas( "[  oneborder gradientmm  ] => roundedRect{radius:10}");
});



//****************Menu Hover Fix for IE****************

sfHover = function() {
	var sfEls = document.getElementById("mainNav").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);

//****************Start misc scripts****************
$(document).ready(function(){
$('a').focus(function() {
 this.blur();
});
});


//****************Target Validation Workaround****************
function externalLinks() {  
 if (!document.getElementsByTagName) return;  
 var anchors = document.getElementsByTagName("a");  
 for (var i=0; i<anchors.length; i++) {  
   var anchor = anchors[i];  
   if (anchor.getAttribute("href") &&  
       anchor.getAttribute("rel") == "external")  
     anchor.target = "_blank";  
 }  
}  
window.onload = externalLinks;








