function CUNonSecure()
{
	var protoHe = "/consumer/";
	
	prefixHe = parent.location.protocol + '//';
	
	if (prefixHe == "https://")
	{protoHe = "/consumer/";}
	else
	{protoHe = "/";}
	
	location.href= protoHe + "contactus/index.html";
}

function getheader ()
{

	document.write('<div id="master_container"><div id="header"><a href="/index.html"><img src="/resources/images/common/john-hancock-logo.gif" id="main_logo" alt="John Hancock - the future is yours" /></a>');
	document.write('<div id="utility_nav">');
	document.write('<ul><li><a href="/about/news.php">News</a></li>');		
	document.write('<li><a href="/whyworkwithus.html">For Advisers</a></li>');	
	document.write('<li><a href="/careers/index.html">Career Center</a></li>');
	document.write('<li><a onClick="CUNonSecure()" href="#">Contact Us</a></li><li><a href="/forms/index.html">Forms</a></li><li><a href="/sitemap.html">Site Map</a></li></ul></div>');	
	document.write('<div id="header_search">');
	document.write('<form action="http://www.johnhancock.com/results.html" id="headerSearch">');
	document.write('<div><input type="hidden" name="cx" value="008726557499099979329:hv154lrnzbk" />');
	document.write('<input type="hidden" name="cof" value="FORID:11;NB:1" />');
	document.write('<div id="header_search_field_wrap">');
    document.write('<input name="q" type="text" id="header_search_field" /></div>');
	document.write('<input name="" type="image" id="header_search_button" src="/resources/images/buttons/btn_header_search_off.gif" class="hover_down_button" alt="Search" /></div></form></div></div>');
}


/*
function addEvent( obj, type, fn ) {
  if ( obj.attachEvent ) {
    obj['e'+type+fn] = fn;
    obj[type+fn] = function(){obj['e'+type+fn]( window.event );}
    obj.attachEvent( 'on'+type, obj[type+fn] );
  } else
    obj.addEventListener( type, fn, false );
}
function removeEvent( obj, type, fn ) {
  if ( obj.detachEvent ) {
    obj.detachEvent( 'on'+type, obj[type+fn] );
    obj[type+fn] = null;
  } else
    obj.removeEventListener( type, fn, false );
}

addEvent(window, 'load', function(event) {
	//ADD CODE TO CHECK IF SECURE OR NOT
	
	var pn = location.pathname;
	
	var secureArray = new Array()
	secureArray[0] = "/contactus/contactus_long-term_care_retail.html";
	secureArray[1] = "/contactus/contactus_mutual_funds.html";
	secureArray[2] = "/contactus/contactus_annuities.html";
	secureArray[3] = "/contactus/contactus_diversity.html";
	secureArray[4] = "/contactus/contactus_2nd_tier_reporting.html";	
	secureArray[5] = "/contactus/contactus_fixed_products.html";
	secureArray[6] = "/contactus/contactus_long-term_care_group.html"
	secureArray[7] = "/contactus/contactus_life_traditional.html";
	secureArray[8] = "/contactus/contactus_life_variable_non-traditional.html";
	secureArray[9] = "/contactus/contactus_life_estate_protection.html";
	secureArray[10] = "/contactus/contactus_life_corporate_owned.html";
	secureArray[11] = "/contactus/contactus_life_m_group.html";
	
	var isSecure = 0;
	
	for (var i=0; i < secureArray.length; i++)
	{			
		if (secureArray[i] == pn)
		{
			isSecure = 1;
			break;		
		}		
	}
	
        //window.status = isSecure;
        
	var protoHe = "/consumer";
	
	prefixHe = parent.location.protocol + '//';
        
        window.status = prefixHe;
	
	if (prefixHe == "https://")
	{
		//if on secure side and we are not a secure page redirect
		//location.href= protoHe + pn;
                //window.status = protoHe + pn;                
	}	
	
	
 });
*/
/* 
	JavaScript to load favicon dynamically
	Did it this way so we don't have to have one line per page
	since this page is loaded on all pages easy way to do it.
*/
function loadfavicon() {
	var link = document.createElement('link');
    link.type = 'image/x-icon';
    link.rel = 'shortcut icon';
    link.href = '/favicon.ico';
    document.getElementsByTagName('head')[0].appendChild(link);
}
/*
write code to display error if on http://test. or http://integ.
or https://secure-test. or https://secure-integ.
*/
function silentErrorHandler() {        

return true;

}
window.onerror=silentErrorHandler;	
window.onload=loadfavicon;	



