function CreateBookmarkLink()

	{

		title="Health Insurance";

		url="http://www.healthinsurancecc.com/";
		if (window.sidebar)

		{  

			// Mozilla Firefox Bookmark

			window.sidebar.addPanel(title, url,"");

		} else if( window.external )

		{ 

			// IE Favorite

			window.external.AddFavorite( url, title);

		}

		else if(window.opera && window.print)

		{ 

			// Opera Hotlist

			return true; 

		}

	}

	

	function goToCounterPage()

	{		

		window.location.href="mytest.php";

	}


function OpenNewForm(theForm)
{

 var myRef ;
 var strURL = ""; 
 
  strURL = "http://healthinsurancecc.com/Common/Landing.php";
     strURL = strURL + "?zip=" + document.getElementById('zip').value;
  strURL = strURL + "&refby=615406";
 
    strURL = strURL + "&type=" + document.getElementById('InsuranceType').value;
    
   if(document.getElementById('InsuranceType').value=='Health')	
  {
// 2nd Step
	datetimepopup(strURL);
  }
	else
{	
  window.open(strURL,null,"fullscreen=yes, toolbars=yes, scrollbars=yes, menubar=yes, location=yes, width=1000,height=900");
}
}

function redirect(theForm) 
{

           
	var strErr = "";

	if(document.getElementById('zip').value=="")

	{

		strErr = strErr + "Please enter zip code.\n";

		theForm.ZipCode.focus();

	}
     if (strErr != "")

     {

           alert(strErr);

           return false;

     }

     else

    {// 3rd Step
			datetimeredirection();
			//window.location='health_results.html?zipcode='+document.getElementById('zip').value;
     }


}

function ValidateForm(theForm)
{


	var strErr = "";
	if(document.getElementById('InsuranceType').value=="none")
	{
		strErr = strErr + "Please select insurance type.\n";
	}
	if(document.getElementById('zip').value=="")
	{
		strErr = strErr + "Please enter zip code.\n";
		document.getElementById('zip').focus();
	}
	else
        {
           if(document.getElementById('zip').value.length!=5)
         	{
           		strErr = strErr + "Please enter valid zip code.\n";
			document.getElementById('zip').focus();
         	}
        }


     if (strErr != "")

     {

           alert(strErr);

           return false;

     }

     else

    {
     
      OpenNewForm(theForm);
      
     }

}	



function datetimeredirection()
{
	var now = new Date();
	var hr= eval(now.getHours());
	var dday= eval(now.getDay());
	//Condition for 6AM to 7PM and Monday to Friday- LeadCo
	if ((hr>=6 && hr<19) && (dday>=1 && dday<=5))	 
	window.location='health-popup.php?zip_code='+document.getElementById('zip').value;
	//else  
	//window.location='health_results.html?zipcode='+document.getElementById('zip').value;
}

function datetimepopup(strURL)
{
	var now = new Date();
	var hr= eval(now.getHours()); 
	var dday= eval(now.getDay());
	if ((hr>=6 && hr<19) && (dday>=1 && dday<=5))	//Condition for 6AM to 7PM and Monday to Friday- LeadCo	
	{
	}
	else{
		window.location=strURL;
	}
}




function trim(str){



    return((" "+ str).replace(/^\s*([\s\S]*\S+)\s*$|^\s*$/,"$1"));



}
	
