/**
 * Ajax request to get header content.
 *
 * @access 	public
 * @return	void
 */ 
function getAdjContent(a_strCurrentLocation) {
	new Ajax.Request('/HTMLShell/services/GilletteTopNav.aspx', {
		method: 'get',
		parameters: 'location=' + a_strCurrentLocation,
		onSuccess: function(a_objResponse) {
			Element.update('divNavWrapper', a_objResponse.responseText);
		}
	});


	new Ajax.Request('/HTMLShell/services/HomePage.aspx', {
		method: 'get',
		parameters: 'location=' + a_strCurrentLocation,
		onSuccess: function(a_objResponse) {
			Element.update('divHomeWrapper', a_objResponse.responseText);
		}
	});

	new Ajax.Request('/htmlshell/services/GilletteFooterNav.aspx', {
		method: 'get',
		evalScripts:false,
		parameters: 'location=' + a_strCurrentLocation,
		onSuccess: function(a_objResponse) {
			Element.update('divFooter', a_objResponse.responseText);
		}
	});

    //alert(a_strCurrentLocation);
}

window.onload = function() {  
	getAdjContent(window.location.href);  
} 

/**
 * Navigation handler
 *
 * @access 	public
 * @return	void
 */
var intMaxElements = 6;

function closify(el) {
	for (i=1; i<=intMaxElements; i++) {
		if ($('nv' + i) != null) {
			if (typeof($('nv' + i)) != 'undefined') {
				if (('nv' + i) != el) {
					$('nv' + i).style.display = 'none';
					$('nv' + i + 'a').style.backgroundPosition = '0 -34px';
				}
				
				else {
					$('nv' + i + 'a').style.backgroundPosition = '0 0';
				}
			}
		}
	}
}

document.observe("click", function(e) {
	for (i=1; i<=intMaxElements; i++) {
		if ($('nv' + i) != null) {
			if (typeof($('nv' + i)) != 'undefined') {
				$('nv' + i).style.display = 'none';
				$('nv' + i + 'a').style.backgroundPosition = '0 -34px';
			}
		}
	}
});

/*function closify(el) {
	for (i=1; i<intMaxElements; i++) {
		if ($('nv' + intMaxElements) != null) {
			if (('nv' + intMaxElements) != el) {
				$('nv' + intMaxElements).style.display = 'none';
				$('nv' + intMaxElements + 'a').style.backgroundPosition = '0 -34px';
			}
			
			else {
				$('nv' + intMaxElements + 'a').style.backgroundPosition = '0 0';
			}
		}
	}
}

document.observe("click", function(e) {
	for (i=1; i<intMaxElements; i++) {
		if ($('nv' + intMaxElements) != null) {
			$('nv' + intMaxElements).style.display = 'none';
			$('nv' + intMaxElements + 'a').style.backgroundPosition = '0 -34px';
		}
	}
});*/

var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));