function submitForm() {
	document.getElementById("searchform").submit();
}
function popupLink(evt) {
	var pWidth = (this.getAttribute("popupWidth") ? this.getAttribute("popupWidth") : 500);
	var pHeight = (this.getAttribute("popupHeight") ? this.getAttribute("popupHeight") : 300);
	features = "scrollbars=yes,width=" + pWidth + ",height=" + pHeight + ",resizable=1";
   	newWin = window.open(this.href,"news",features);
   	if (newWin.opener==null) {
   		newWin.opener=window;
   	}
	evt.preventDefault();
}
function playLeftAd() {
	var leftAd = window.left_ad || document.left_ad;
	if (leftAd.PercentLoaded() == 100) {
		leftAd.Play();
	} else {
		// not loaded yet, wait 100 ms and try again
		setTimeout("playLeftAd()", 100);
	}
}
function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

jQuery(function () {
	jQuery('#contentleft a.popup').click(popupLink);
	
	var path = readCookie('customerPage');
	if (path != null) {
		jQuery('a:contains(Customer Site)').attr('href', path).attr('target', '');
		jQuery('#searchform').append('<span class="separator">|</span>&nbsp;<a href="' + path + '">Customer Site</a>');
	}
});

