/**
 * FIX IE6 IMAGE FLICKER PROBLEM
 *
 */




/* For Philippines Specific: FOR SIGN IN */

function popupPH()
{
	selectBox = document.getElementById('secure_sign_in');
	
	day = new Date();
	id = day.getTime();
	tbar = 0;
	sbar = 0;
	mbar = 0;
    rgn = window.location + '';
    rgn = rgn.substring(rgn.indexOf("//") + 2, rgn.length);
    if (rgn.indexOf("/") != -1) {
        rgn = "https://" + rgn.substring(0, rgn.indexOf("/")) + "/";
    } else {
        rgn = "https://" + rgn.substring(0, rgn.length) + "/";
    }
	
	if (selectBox.selectedIndex == 0)
	{
		url = 'https://www.sunlife.com.ph/' + 'services/sharedsunlink/ss_login.asp';
		
	}else if (selectBox.selectedIndex == 1)
	{
		url = 'https://www.sunlife.com.ph/' + 'b2b/';
		
	}else if (selectBox.selectedIndex == 2)
	{
		url = 'https://www.sunlife.com.ph/' + 'agent/default.asp';
    	tbar = 1;
    	sbar = 1;
    	mbar = 1;
		
	}else
	{
		url = '#';
	}
	
	eval("page" + id + " = window.open(url, '" + id + "', 'toolbar=" + tbar +", scrollbars=1, location=0, statusbar=" + sbar + ", menubar=" + mbar +", resizable=1, width=850, height=600, left = 215, top = 30');");
}






/* For Philippines Specific:  FOR WHAT WOULD YOU LIKE TO DO*/


function jump(menu)
{
	selectBox = document.getElementById('choice');
	if (selectBox.selectedIndex == 1)
	{
	    window.location="http://www.sunlife.com.ph/product_service.asp";
	}
	else if (selectBox.selectedIndex == 2)
	{
	    window.location="http://www.sunlife.com.ph/pre-need_plans.asp";
	}
	else if (selectBox.selectedIndex == 3)
	{
	    window.location="http://www.sunlife.com.ph/mutual_funds.asp";
	}
	else if (selectBox.selectedIndex == 4)
	{
	    window.location="http://www.sunlife.com.ph/where_to_find_us.asp";
	}
	else if (selectBox.selectedIndex == 5)
	{
	    window.location="http://www.sunlife.com.ph/access_forms.asp";
	}
	else if (selectBox.selectedIndex == 6)
	{
	    window.location="http://www.sunlife.com.ph/mutual_funds/forms.asp";
	}
	else if (selectBox.selectedIndex == 7)
	{
	    window.location="http://www.sunlife.com.ph/claims_service/claims_notification.asp";
	}
}



/* For HONK KONG Specific: FOR SIGN IN */

function popupHK()
{
	selectBox = document.getElementById('secure_sign_in');
	
	day = new Date();
	id = day.getTime();
	
	if (selectBox.selectedIndex == 0)
	{
		url = 'https://na1.salesforce.com/secur/login_portal.jsp?orgId=00D30000000KbT8&portalId=060300000002KUS';
		
	}else if (selectBox.selectedIndex == 1)
	{
		url = 'https://new.sunlife.com.hk/index.aspx?login_from=p';
		
	}else if (selectBox.selectedIndex == 2)
	{
		url = 'https://apps.sunlife-hk.com/aes-web/default.asp';
		
	}else
	{
		url = 'https://cs01.cspension.com.hk/slfweb/default.asp?Lang=E';
	}
	
	eval("page" + id + " = window.open(url, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=850,height=600,left = 215,top = 30');");
}


/*For global to set cookie for overlay*/

function setCookie(cookieFlag,url,expiredays)
{
	var exdate=new Date();
	exdate.setDate(exdate.getDate()+expiredays);
	document.cookie='slfglobal'+ "=" +escape(cookieFlag)+'|'+'http://'+escape(url)+
	((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
	
}

/*For hong kong investment layout to set cookie which lasts only for the active session*/
function setCookieForSession()
{
	
	document.cookie='hongkongCookie'+ "=" +escape('accepted');
	document.cookie='enaccepted'+ "=" +escape('true')+ '; path= /;';
	document.cookie='zhaccepted'+ "=" +escape('true')+ '; path= /;';
	window.parent.location.reload();
}
