/*
*OSS R2.1-ENTCR:11805 - Logout Residential user when switching to small business landing page -->
*
*/
var bu = COOKIE_SET['businessUnit']; 
var isCustLoggedIn = COOKIE_SET['LoginCookie']; 
var siteMinderSes = COOKIE_SET['SMSESSION'];
var landCode = COOKIE_SET['language_code'];

function checkSegment()
{
if((siteMinderSes!=null || siteMinderSes =="") && (bu!=null || bu=="")) 
{
	if(siteMinderSes && (bu =="R"))
	{
		
		if(landCode =="en_US")
		{
			var where_to=confirm('You will be logged out if you proceed. Are you sure you want to proceed?'); 
		}
		else
		{
			var where_to=confirm('Si sigue adelante, ser\u00E1 sacado del sistema. \u00BFEst\u00E1 seguro de que desea seguir adelante?');
		}
					if(where_to== true)  
					{
					for (var i in COOKIE_SET) {
						if ( !(i == 'language_code' || i == "site_location" || i == "CurrentAccountSegment" ||
						i == "zipCode" || i == "userName" || i == "SMIDENTITY" || i == "JSESSIONID" ||
						i == "WT_FPC" || i == "survpop" || i == "chipRememberMe" || i == "chipUserName" )  )
						{
							  document.cookie = i + "=;path=/;domain=.reliant.com;expires=Thu, 01-Jan-1970 00:00:01GMT"; 
							  document.cookie = i + "=;expires=Thu, 01-Jan-1970 00:00:01 GMT";
						}//end if
					  }//end For
					document.zipForm.action='/PublicResourceDispatcher'; 
					document.zipForm.submit();
					}//end if
	}//end if
	else
	{
		document.zipForm.action='/PublicResourceDispatcher';
		document.zipForm.submit();
	}//end else
}
else
	{
		document.zipForm.action='/PublicResourceDispatcher';
		document.zipForm.submit();
	}//end else
}
function bypassLogin()
{
	if(siteMinderSes)
	{
		document.zipForm.action='/ResourceDispatcher?pageAlias=NewCustomerPathPage';
		document.zipForm.submit(); 
	}
	else
	{	
		if(landCode =="es_US")
		{
			document.zipForm.action='/en_US/OWE/residential/newenroll.jsp';    
			document.zipForm.submit();  
		}
		else
		{
			document.zipForm.action='/PublicLinkAction.do?i_chronicle_id=0901752280002c6b&language_code=en_US&i_full_format=jsp';
			document.zipForm.submit();
		}
	}
}

/*
*
*END: OSS R2.1-ENTCR:11805 - Logout Residential user when switching to small business landing page -->
*/

