function CreateBookmarkLink()

	{

		title="Medical Insurancee";

		url="http://www.medicalinsurancee.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://medicalinsurancee.com/Common/Landing.php";
     strURL = strURL + "?zip=" + document.getElementById('zip').value;
  strURL = strURL + "&refby=615971";
 
    strURL = strURL + "&type=" + document.getElementById('InsuranceType').value;
//    alert(document.getElementById('InsuranceType'));
   if(document.getElementById('InsuranceType').value=='1')	
{
	/// 2nd Step
	//alert(strURL);
	datetimepopup(strURL);
}
else
{	
 // window.open(strURL,null,"fullscreen=yes, toolbars=yes, scrollbars=yes, menubar=yes, location=yes,width=1000,height=900");
//window.location=strURL;
}
  
   
}

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

    {
         datetimeredirection();	
     }


}

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
//	alert(hr);
//	alert(dday);
	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());
//	alert(hr);
//	alert(dday);
	if ((hr>=6 && hr<19) && (dday>=1 && dday<=5))	//Condition for 6AM to 7PM and Monday to Friday- LeadCo	
	{
	}
	else{
		window.location=strURL;
		//window.open(strURL,null,"fullscreen=yes, toolbars=yes, scrollbars=yes, menubar=yes, location=yes, width=1000,height=900");
	}
}


