function routeToEmailServlet(theForm){


	var w = window.open('about:blank','Popup_Window','width=660,height=434,top=243,left=25');
	theForm.target = 'Popup_Window';
	
	//theForm.action = "https://adxlb-fhedev.firsthealth.com/cmsEmail/thankyou.jsp";

	theForm.action = "https://www.firsthealth.com/cmsEmail/thankyou.jsp";

	
	theForm.submit();

}

function routeFromSelectBox(theForm){ 
	var url1 = "";

	for (i=0; i<theForm.elements.length; i++){
		if(theForm.elements[i].type == "select-one"){
			url1 = theForm.elements[i].options[theForm.elements[i].selectedIndex].value;
			theForm.elements[i].selectedIndex = 0;
		}
	}

	if(url1 == ""){
		window.alert("Please select from the list box");
		return false;

	}
 	theForm.action = url1;
 	theForm.submit();
		
}
function routeToExtSite(theForm)
{
  var url1 = "";
  var portal_login = "";
	
  for (i=0; i < document.portalLoginForm.portalLogin.length; i++)
  {
	if (document.portalLoginForm.portalLogin[i].checked)
	{
	  portal_login = document.portalLoginForm.portalLogin[i].value;
	  document.portalLoginForm.portalLogin[i].value = "";
	}
  }	
  var client_ID = document.portalLoginForm.client_ID.value;
  if( (client_ID == null) || (client_ID.length == 0))	     
  {
	window.alert("Please provide valid Client ID");		 
	document.portalLoginForm.client_ID.focus();
	return;
  }

  if(portal_login.indexOf("Talis") != -1)
  {
	url1 = "http://www.talispoint.com/cvty/";
	if(client_ID.toLowerCase() == "cirma")		
	{
		url1 = url1+"cirma";
		theForm.target="_blank";
	}		
	else if(client_ID.toLowerCase() == "sedgwickkaisercampn")			
	{
		url1 = url1+"sekmpn";
		theForm.target="_blank";
	}
	else if(client_ID.toLowerCase() == "sedgwickcampn")			
	{
		url1 = url1+"sedmpn";
		theForm.target="_blank";
	}		
	else if(client_ID.toLowerCase() == "sedgwick")			
	{			
		url1 = url1+"sedgwk";
		theForm.target="_blank";
	}
	else if(client_ID.toLowerCase() == "campn")			
	{			
		url1 = url1+"cvtympn/";
		theForm.target="_blank";
	}
	else if(client_ID.toLowerCase() == "txhcn")			
	{			
		url1 = url1+"cvtyhcn";
		theForm.target="_blank";
	}
	else 
	{
		window.alert("Please provide valid Client ID");		 			
		document.portalLoginForm.client_ID.focus();
		return;			
	}						
  }		
  if(portal_login.indexOf("firsthealth") != -1)
  {					
	document.portalLoginForm.Polnum.value = client_ID;
	url1 = "http://www.firsthealth.com/ppoPortal/servlet/PPOServlet";
	theForm.target="_blank";
  }	
  document.portalLoginForm.action = url1;
  // document.portalLoginForm.submit();	   	   

 }

 function routeAutoToExtSite(theForm) {
	
	var client_ID = document.portalLoginForm.client_ID.value;
	
	if ((client_ID == null) || (client_ID.length == 0)) {
		window.alert("Please provide valid Client ID");
		document.portalLoginForm.client_ID.focus();
		return;
	}
	document.portalLoginForm.Polnum.value = client_ID;
 	document.portalLoginForm.action = "http://www.firsthealth.com/ppoPortal/servlet/PPOServlet";
 	document.portalLoginForm.submit();
}

