//=======function to get Div for insurance=======================
function getInsurancediv(value)
{

	if(value=="Auto"){  
	 document.getElementById("Auto").style.display="block"
  document.getElementById("Life").style.display="none"
		document.getElementById("Property").style.display="none"
		document.getElementById("Travel").style.display="none"
	}else if(value=="Life"){
			document.getElementById("Auto").style.display="none"
			document.getElementById("Life").style.display="block"
			document.getElementById("Property").style.display="none"
			document.getElementById("Travel").style.display="none"
	}else if(value=="Property"){
			document.getElementById("Auto").style.display="none"
			document.getElementById("Life").style.display="none"
			document.getElementById("Property").style.display="block"
			document.getElementById("Travel").style.display="none"
	}else if(value=="Travel"){
			document.getElementById("Auto").style.display="none"
			document.getElementById("Life").style.display="none"
			document.getElementById("Property").style.display="none"
			document.getElementById("Travel").style.display="block"
	}
}


//=======function to get div=======================
function getdiv(value)
{
	if(value=="Broadband"){
			document.getElementById("brod").style.display="block"
            document.getElementById("pho").style.display="none"
			document.getElementById("tv").style.display="none"
				}
				else if(value=="Broadband/Phone"){
			document.getElementById("brod").style.display="block"
			document.getElementById("pho").style.display="block"
			document.getElementById("tv").style.display="none"
				}
else if(value=="Broadband/Phone/TV"){
			document.getElementById("brod").style.display="block"
			document.getElementById("pho").style.display="block"
			document.getElementById("tv").style.display="block"
				}
}

//=======function to get div=======================
function getdiv1(value)
{
	//alert(value)

	if(value=="Broadband"){

			document.getElementById("brod").style.display="block"
            document.getElementById("pho").style.display="none"
			document.getElementById("tv").style.display="none"
				}
		else if(value=="Broadband/Phone"){
			document.getElementById("brod").style.display="block"
			document.getElementById("pho").style.display="block"
			document.getElementById("tv").style.display="none"
				}
		else if(value=="Broadband/Phone/TV"){

			document.getElementById("brod").style.display="block"
			document.getElementById("pho").style.display="block"
			document.getElementById("tv").style.display="block"
				}


}

function getdiv3(value)
{
	//alert(value)
	if(value=="")
		{
			document.getElementById("brod").style.display="none"
            document.getElementById("pho").style.display="none"
			document.getElementById("tv").style.display="none"
		}
	else if(value=="Broadband"){
			document.getElementById("brod").style.display="block"
            document.getElementById("pho").style.display="none"
			document.getElementById("tv").style.display="none"
				}
				else if(value=="Broadband/Phone"){
			document.getElementById("brod").style.display="block"
			document.getElementById("pho").style.display="block"
			document.getElementById("tv").style.display="none"
				}
else if(value=="Broadband/Phone/TV"){
			document.getElementById("brod").style.display="block"
			document.getElementById("pho").style.display="block"
			document.getElementById("tv").style.display="block"
				}
}
	//====== Function is Used To  Check Valid Email =============

function valid_email(email)
{
		at_position = email.indexOf("@",1)
        if (at_position != -1)
		{
       		at_position = email.indexOf(".",1)
            if (at_position == -1)
            {
                      return false;
            }//if	
	   }//if
       else
       {
            	return false;
       } //else
		return true;
}//email check


// ============= Function to check date before Current Date ======
function isBefore(ent_year,ent_month,ent_day)
{
	
    var mydat=new Date()
	var t_day=mydat.getDate()
	var t_month=mydat.getMonth()+1
	var t_year=mydat.getYear()
	if (t_year < 1000)
	t_year+=1900

	if(t_year>ent_year)//check year
	{
	 return false;
	}else if(t_year==ent_year)//check if year is equal
	{
	   if(t_month>ent_month)//check month
	   {
	    return false;
	   }else if(t_month==ent_month)//check month if equal
	   {
	      if(t_day>ent_day)//check day
	      {
	        return false;
	      }else
	      {
	        return true;
	      }
	   }else
	   {
	     return true;
	   }
   }else
   {
     return true;
   }

}


//===================Function for Hiding Rent Payment=============
function CheckRent(value)
{
	if(value==2)
	    document.getElementById('rent').style.visibility="visible"     
	else
        document.getElementById('rent').style.visibility="hidden"	
}

//==================Function to Hide Current Employer==============

function CheckEmpStatus(value)
{
	if (value==3||value==4||value==5)
		document.getElementById('current_emp').style.visibility="hidden"	    
	else
	    document.getElementById('current_emp').style.visibility="visible"
}

//=================== Function is Used to Check String Value========
function IsString(strString)
 {
   var strValidChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
   var strChar;
   var blnResult = true;

   if (strString.length == 0) return false;


   for (i = 0; i < strString.length && blnResult == true; i++)
      {
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1)
         {
         blnResult = false;
         }
      }
   return blnResult;
}

//=================== Function is Used To Check  Numeric Value========

function IsNumeric1(strString)
{
	var strValidChars = "0123456789";
   var strChar;
   var blnResult = true;

   if (strString.length == 0)
   {
    return false;
   }
   for (i = 0; i < strString.length && blnResult == true; i++)
      {
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1)
         {
         blnResult = false;
         }
      }
   return blnResult;
}

//=================== Function is Used To Check  URl Value========
function isUrl(s) 
	{
	var s_arr = s.split(".");
	if(s_arr.length==3)
		{
		if(s_arr[0]=='www')
			{
			return true;
		}else
			{
			return false;
		}
	}else{
		return false;
	}
}
//========= Function for pop up window  For Loan Detail======
/*function newwindow_Loan(Id)
{ 
 
	window.open("loan_detail.php?name=loan&loan_id="+Id, "newwindow", "height=900,width=900, toolbar=no, menubar=no,scrollbars=yes, resizable=yes,location=center, directories=no, status=no");
}	*/	
function newwindow_Loan(Id)
{ 
 
	window.open("loan_detail.php?name=loan&type=logo&loan_id="+Id, "newwindow", "height=900,width=900, toolbar=no, menubar=no,scrollbars=yes, resizable=yes,location=center, directories=no, status=no");
}

function detailpopup_Loan(Id)
{ 
 
	window.open("loan_detail.php?name=loan&type=detail&loan_id="+Id, "newwindow", "height=900,width=900, toolbar=no, menubar=no,scrollbars=yes, resizable=yes,location=center, directories=no, status=no");
}

//========= Function for pop up window  For Credit Detail======
/*function newwindow_credit(Id)
{ 
	window.open("credit_detail.php?name=credit&c_id="+Id, "newwindow", "height=900,width=900, toolbar=no, menubar=no,scrollbars=yes, resizable=yes,location=center, directories=no, status=no");
}	*/	
function newwindow_credit(Id)
{ 
	window.open("credit_detail.php?name=credit&c_id="+Id, "newwindow", "height=900,width=900, toolbar=no, menubar=no,scrollbars=yes, resizable=yes,location=center, directories=no, status=no");
}	
			
//========= Function for pop up window  For broadband Detail====
function newwindow_broadband(Id1,Id2)
{
	
	window.open("broadband_newwindow.php?name=broadband&product_id="+Id1+"&supplier_id="+Id2, "newwindow", "height=900,width=900, toolbar=no, menubar=no,scrollbars=yes, resizable=yes,location=center, directories=no, status=no");
}	
//========= Function for pop up window  For broadband Apply====
function applypopup_broadband(Id1,Id2)
{
	
	window.open("broadband_applypopup.php?name=broadband&product_id="+Id1+"&supplier_id="+Id2, "newwindow", "height=900,width=900, toolbar=no, menubar=no,scrollbars=yes, resizable=yes,location=center, directories=no, status=no");
}
//========= Function for pop up window  For insurance Apply====
function applypopup_insurance(Id1,type)
{
	
	window.open("apply_propertypopup.php?name=insurance&provider_id="+Id1+"&type="+type, "newwindow", "height=900,width=900, toolbar=no, menubar=no,scrollbars=yes, resizable=yes,location=center, directories=no, status=no");
	document.Atfrmv.action="apply_propertypopup.php?name=insurance&provider_id="+Id1+"&type="+type;
	document.Atfrmv.submit();
	
}


//========= Function for pop up window  For property insurance Apply====
function applyproperty_insurance(Id1,type)
{
	//self.location="apply_propertypopup.php?name=insurance&provider_id="+Id1+"&type="+type;

    window.open("apply_propertypopup.php?name=insurance&provider_id="+Id1+"&type="+type, "newwindow", "height=900,width=900, toolbar=no, menubar=no,scrollbars=yes, resizable=yes,location=center, directories=no, status=no");
	document.frmvss.action = "apply_propertypopup.php?name=insurance&provider_id="+Id1+"&type="+type;
	 document.frmvss.submit();
}

//========= Function for pop up window  For telephone Apply====
function applypopup_telephone(Id1)
{
	window.open("homephone_applypopup.php?name=homephone&hsupplier_id="+Id1, "newwindow", "height=900,width=900, toolbar=no, menubar=no,scrollbars=yes, resizable=yes,location=center, directories=no, status=no");
}
//========= Function for pop up window  For credit module ====
function logopopup_credit(Id1)
{
	window.open("credit_logopopup.php?name=credit&type=icon&c_id="+Id1, "newwindow", "height=900,width=900, toolbar=no, menubar=no,scrollbars=yes, resizable=yes,location=center, directories=no, status=no");
}


function logopopup_creditDetail(Id1)
{
	window.open("credit_logopopup.php?name=credit&type=detail&c_id="+Id1, "newwindow", "height=900,width=900, toolbar=no, menubar=no,scrollbars=yes, resizable=yes,location=center, directories=no, status=no");
}
/*function logopopup_creditDetail(Url)
{
 if (Url.toLowerCase().indexOf('http') <0)
	{
		Url = "http://" + Url;
	}
	window.open(Url, "newwindow", "height=900,width=900, toolbar=no, menubar=no,scrollbars=yes, resizable=yes,location=center, directories=no, status=no");
}*/

//Popup window For Credit Apply
function logopopup_creditAply(Url)
{
	
	if (Url.toLowerCase().indexOf('http') <0)
	{
		Url = "http://" + Url;
	}
	window.open(Url, "newwindow", "height=900,width=900, toolbar=no, menubar=no,scrollbars=yes, resizable=yes,location=center, directories=no, status=no");
}

function logopopup_bankAply(Url)
{
	
	if (Url.toLowerCase().indexOf('http') <0)
	{
		Url = "http://" + Url;
	}
	window.open(Url, "newwindow", "height=900,width=900, toolbar=no, menubar=no,scrollbars=yes, resizable=yes,location=center, directories=no, status=no");
}

function logopopup_LoanAply(Id1)
{
	
	window.open("loan_popup.php?name=loan&loan_id="+Id1, "newwindow", "height=900,width=900, toolbar=no, menubar=no,scrollbars=yes, resizable=yes,location=center, directories=no, status=no");
}



function logopopup_AdditionalPage(Url)
{
	
	if (Url.toLowerCase().indexOf('http') <0)
	{
		Url = "http://" + Url;
	}
	window.open(Url, "newwindow", "height=900,width=900, toolbar=no, menubar=no,scrollbars=yes, resizable=yes,location=center, directories=no, status=no");
}



 //========= Function for pop up window  For HomePhone module ====
function logopopup_homephone(Id1)
{     
	window.open("credit_logopopup.php?name=homephone&type=icon&hsupplier_id="+Id1, "newwindow", "height=900,width=900, toolbar=no, menubar=no,scrollbars=yes, resizable=yes,location=center, directories=no, status=no");

}

function logopopup_homephoneDetail(Id1)
{      
	window.open("credit_logopopup.php?name=homephone&type=detail&hsupplier_id="+Id1, "newwindow", "height=900,width=900, toolbar=no, menubar=no,scrollbars=yes, resizable=yes,location=center, directories=no, status=no");
}


// ============== Function For Popup Window For Mobile Module ======
function logopopup_mobile(Id1)
{
	
	window.open("credit_logopopup.php?name=mobile&type=icon&mobile_id="+Id1, "newwindow", "height=900,width=900, toolbar=no, menubar=no,scrollbars=yes, resizable=yes,location=center, directories=no, status=no");
}

function logopopup_mobileDetail(Id1)
{
	window.open("credit_logopopup.php?name=mobile&type=detail&mobile_id="+Id1, "newwindow", "height=900,width=900, toolbar=no, menubar=no,scrollbars=yes, resizable=yes,location=center, directories=no, status=no");
}



//========= Function for pop up window  For Mortgage module ====

function logopopup_mortgage(Id1)
{
	window.open("credit_logopopup.php?name=mortgage&type=icon&lender_id="+Id1, "newwindow", "height=900,width=900, toolbar=no, menubar=no,scrollbars=yes, resizable=yes,location=center, directories=no, status=no");
}

function logopopup_mortgageDetail(Id1)
{
	window.open("credit_logopopup.php?name=mortgage&type=detail&lender_id="+Id1, "newwindow", "height=900,width=900, toolbar=no, menubar=no,scrollbars=yes, resizable=yes,location=center, directories=no, status=no");
}

//========= Function for pop up window  For Bank Detail  ====
function logopopup_bankDetail(Id1)
{
	window.open("credit_logopopup.php?name=bank&type=detail&bank_id="+Id1, "newwindow", "height=900,width=900, toolbar=no, menubar=no,scrollbars=yes, resizable=yes,location=center, directories=no, status=no");
}
//========= Function for pop up window  For Bank Detail  ====
function logopopup_geDetail(Id1)
{
	window.open("credit_logopopup.php?name=gasele&type=detail&s_id="+Id1, "newwindow", "height=900,width=900, toolbar=no, menubar=no,scrollbars=yes, resizable=yes,location=center, directories=no, status=no");
}

//========= Function for pop up window  For Broadband Detail  ====
function logopopup_broadbandDetail(Id1)
{
	window.open("credit_logopopup.php?name=broadband&type=detail&br_supplier_id="+Id1, "newwindow", "height=900,width=900, toolbar=no, menubar=no,scrollbars=yes, resizable=yes,location=center, directories=no, status=no");
}

function bundleInfo(Id1,Id2)
{
	window.open("bundleDetail.php?name=broadband&br_supplier_id="+Id1+"&bundle_id="+Id2, "newwindow", "height=200,width=400, toolbar=no, menubar=no,scrollbars=yes, resizable=yes,location=center, directories=no, status=no");
}
//========= Function for pop up window  For Mobile Apply====
function applypopup_mobile(Id1)
{	
	window.open("mobile_applypopup.php?name=mobile&mobile_id="+Id1, "newwindow", "height=900,width=900, toolbar=no, menubar=no,scrollbars=yes, resizable=yes,location=center, directories=no, status=no");
}	
//================== Function for pop up window  For Homephone Detail===============
/*function newwindow_homephone(Id)
{ 
	window.open("homephone_newwindow.php?type=planinfo&test=tariff&name=homephone&plan_id="+Id,"newwindow","height=900,width=900, toolbar=no, menubar=no,scrollbars=yes, resizable=yes,location=center, directories=no, status=no");
}	*/	
//================== Function for pop up window  Credit Card Apply button===============
function credit_apply(Id)
{ 
	//window.open("credit_apply.php?name=credit&c_id="+Id, "newwindow", "height=300,width=800, toolbar=no, menubar=no,scrollbars=yes, resizable=yes,location=yes, directories=no, status=no, target=_parent");
   window.open("/apply.php?name=credit&step=1&c_id="+Id, "newwindow", "height=700,width=800, toolbar=no, menubar=no,scrollbars=yes, resizable=yes,location=yes, directories=no, status=no, target=_parent");
}

function mortgage_apply(Id,type)
{ 
	
	window.open("/mortgages/application?lender_id="+Id+"&apply_type="+type, "newwindow", "height=700,width=800, toolbar=no, menubar=no,scrollbars=yes, resizable=yes,location=yes, directories=no, status=no, target=_parent");
  
}

function mortgage_compare()
{ 

	window.open("/mortgages/compare", "newwindow", "height=700,width=800, toolbar=no, menubar=no,scrollbars=yes, resizable=yes,location=yes, directories=no, status=no, target=_parent");
  
}


function mortgage_directapply()
{ 
	
	 window.open("/mortgages/application", "newwindow", "height=700,width=800, toolbar=no, menubar=no,scrollbars=yes, resizable=yes,location=yes, directories=no, status=no, target=_parent");
     //window.open("https://secure.comparevillage.ca/mortgage_application.php?name=mortgage", "newwindow", "height=700,width=800, toolbar=no, menubar=no,scrollbars=yes, resizable=yes,location=yes, directories=no, status=no, target=_parent");  
}


function credit_application(Id,app)
{ 
	window.open("/credit_apply.php?name=credit&c_id="+Id+"&app="+app, "newwindow", "height=300,width=800, toolbar=no, menubar=no,scrollbars=yes, resizable=yes,location=yes, directories=no, status=no, target=_parent");
}

function bank_apply(Id)
{ 
	//window.open("credit_apply.php?name=credit&bank_id="+Id, "newwindow", "height=300,width=800, toolbar=no, menubar=no,scrollbars=yes, resizable=yes,location=yes, directories=no, status=no, target=_parent");
	window.open("/apply.php?name=bank&step=1&bank_id="+Id, "newwindow", "height=700,width=750, toolbar=no, menubar=no,scrollbars=yes, resizable=yes,location=yes, directories=no, status=no, target=_parent");
}

function GE_apply(Id1,Id2)
{ 
	//window.open("credit_apply.php?name=gasele&s_id="+Id1+"&plan_id="+Id2, "newwindow", "height=300,width=800, toolbar=no, menubar=no,scrollbars=yes, resizable=yes,location=yes, directories=no, status=no, target=_parent");
	window.open("/apply.php?name=gasele&step=1&s_id="+Id1+"&plan_id="+Id2, "newwindow", "height=700,width=800, toolbar=no, menubar=no,scrollbars=yes, resizable=yes,location=yes, directories=no, status=no, target=_parent");
}

function loanapply(Id)
{ 
	//window.open("credit_apply.php?name=credit&c_id="+Id, "newwindow", "height=300,width=800, toolbar=no, menubar=no,scrollbars=yes, resizable=yes,location=yes, directories=no, status=no, target=_parent");
   window.open("/apply.php?name=loan&step=1&loan_id="+Id, "newwindow", "height=700,width=800, toolbar=no, menubar=no,scrollbars=yes, resizable=yes,location=yes, directories=no, status=no, target=_parent");
}

function icon_url(Id)
{ 
 
	window.open("/gas_ele_supplier.php?name=gasele&icon_id="+Id,"newwindow", "height=700,width=800, toolbar=no, menubar=no,scrollbars=yes, resizable=yes,location=yes, directories=no, status=no, target=_parent");
}

//========= Icon Popup for Property Insurance
function iconproperty_url(Id)
{ 
  	window.open("/insurance_detail.php?name=insurance&insurance_type=Property&icon_id="+Id,"newwindow", "height=700,width=800, toolbar=no, menubar=no,scrollbars=yes, resizable=yes,location=yes, directories=no, status=no, target=_parent");
}
//========= Icon Popup for Auto Insurance

function iconauto_url(Id)
{ 
  	window.open("/insurance_detail.php?name=insurance&insurance_type=Auto&icon_id="+Id,"newwindow", "height=700,width=800, toolbar=no, menubar=no,scrollbars=yes, resizable=yes,location=yes, directories=no, status=no, target=_parent");
}
//========= Icon Popup for travel Insurance

function icontravel_url(Id)
{ 
  	window.open("/insurance_detail.php?name=insurance&insurance_type=Travel&icon_id="+Id,"newwindow", "height=700,width=800, toolbar=no, menubar=no,scrollbars=yes, resizable=yes,location=yes, directories=no, status=no, target=_parent");
}

function iconbroadband_url(Id)
{ 
  	window.open("broadband.php?name=broadband&icon_id="+Id,"newwindow", "height=700,width=800, toolbar=no, menubar=no,scrollbars=yes, resizable=yes,location=yes, directories=no, status=no, target=_parent");
}
function iconbundle_url(Id)
{ 
  	window.open("/bundles_search.php?name=broadband&icon_id="+Id,"newwindow", "height=700,width=800, toolbar=no, menubar=no,scrollbars=yes, resizable=yes,location=yes, directories=no, status=no, target=_parent");
}
function iconsearch_url(Id)
{ 
  	window.open("/bundles_search.php?name=broadband&icon_id="+Id,"newwindow", "height=700,width=800, toolbar=no, menubar=no,scrollbars=yes, resizable=yes,location=yes, directories=no, status=no, target=_parent");
}
function bankicon_url(Id)
{ 
 
	window.open("/bank.php?name=bank&icon_id="+Id,"newwindow", "height=700,width=800, toolbar=no, menubar=no,scrollbars=yes, resizable=yes,location=yes, directories=no, status=no, target=_parent");
}
function iconmobile_url(Id)
{ 
  	window.open("/mobile.php?name=mobile&icon_id="+Id,"newwindow", "height=700,width=800, toolbar=no, menubar=no,scrollbars=yes, resizable=yes,location=yes, directories=no, status=no, target=_parent");
}

//========= Function for pop up window  For Article ====
function logopopup_article(Id1,Id2)
{
	window.open("/"+Id2+"/article/"+Id1, "newwindow", "height=300,width=500, toolbar=no, menubar=no,scrollbars=yes, resizable=yes,location=center, directories=no, status=no");
}


//=============== Pop up Window for banner ===========//
function newwindow_banner(Id1)
{
	window.open("banner_popup.php?banner_id="+Id1, "newwindow", "height=900,width=900, toolbar=no, menubar=no,scrollbars=yes, resizable=yes,location=center, directories=no, status=no");
}	

function newwindow_bannerUrl(ul)
{     
	window.open("banner_popupUrl.php?burl="+ul, "newwindow", "height=900,width=900, toolbar=no, menubar=no,scrollbars=yes, resizable=yes,location=center, directories=no, status=no");
}	

// ============ Pop up Window For Customer support ===========
function customer_support()
{
 window.open("customer_support.php", "newwindow", "height=500,width=700, toolbar=no, menubar=no,scrollbars=yes, resizable=yes,location=center, directories=no, status=no");
}
// ============ Pop up Window For Newsletter SignUp ===========
function newsletter_signup()
{
 window.open("newsletter_signup.php", "newwindow", "height=500,width=700, toolbar=no, menubar=no,scrollbars=yes, resizable=yes,location=center, directories=no, status=no");
}

 // ============== End Of Function===============================//
// ================ Newsletter Subscriber Email Address =========
function subscriber_email(value)
{  var N_ID=document.mailnewsletterfrm.newsletter_id.value;
	self.location = "display_newsletter.php?action=send&send_to="+value+"&newsletter_id="+N_ID;
}


//========== This Function is Used For Combobox relocation========//

function reload_store(value)
{ 
    if(value != '')
	{
	self.location = "balance_transfer.php?name=credit&cid="+value;
	//var test=document.balancefrm.card1.value;
    //reload_store1(test);
	}

}

function reload_store1(value)
{ 
	//var test=document.balancefrm.card1.value;
	var test=value;
	var test1=document.balancefrm.card.value;
    var balance_transfer=document.balancefrm.bal_to_transfer.value;
	if(test1 != '')
	{
		
	self.location = "balance_transfer.php?name=credit&cuid=new&cfid="+test+"&cid="+test1+"&balance_transfer_amount="+balance_transfer;
	}
	else
	{
	self.location = "balance_transfer.php?name=credit&cuid=new&cfid="+test+"&balance_transfer_amount="+balance_transfer;
	}
}


function reload_combobox(value)
{
  if(value != '')
	{
	self.location = "add_credit_benefit.php?cid="+value;
	
	}

}

function planreload_combobox(value)
{
  if(value != '')
	{
	self.location = "add_plan_benefit.php?plan_id="+value;
	
	}

}

function applymortgage_option(value)
{ 
	
    if(value != '')
	{
	self.location = "add_mortgage.php?apply_type="+value;
	}

}

function applymortgage_option1(value,lender_id)
{ 
	 var action="edit";
		
    if(value != '')
	{
	self.location = "display_mortgage.php?apply_type="+value+"&lender_id="+lender_id+"&action="+action;
	}

}



function apply_option(value)
{ 
	
    if(value != '')
	{
	self.location = "add_credit.php?apply_type="+value;
	}

}


function apply_option1(value,c_id)
{ 
	 var action="edit";
		
    if(value != '')
	{
	self.location = "display_credit.php?apply_type="+value+"&c_id="+c_id+"&action="+action;
	}

}

function apply_bankoption(value)
{ 
   if(value != '')
	{
	self.location = "add_bank.php?apply_type="+value;
	}

}
function apply_loanoption(value)
{ 
   if(value != '')
	{
	self.location = "add_loan.php?apply_type="+value;
	}

}

function apply_bankoption1(value,bank_id)
{ 
	 var action="edit";
		
    if(value != '')
	{
	self.location = "display_bank.php?apply_type="+value+"&bank_id="+bank_id+"&action="+action;
	}

}

function apply_loanoption1(value,bank_id)
{ 
	 var action="edit";
		
    if(value != '')
	{
	self.location = "display_bank.php?apply_type="+value+"&bank_id="+bank_id+"&action="+action;
	}

}

function apply_GEoption(value)
{ 
   if(value != '')
	{
	self.location = "ge_supplier.php?apply_type="+value;
	}

}

function apply_GEoption1(value,s_id)
{ 
	 var action="edit";
		
    if(value != '')
	{
	self.location = "display_ge_supplier.php?apply_type="+value+"&s_id="+s_id+"&action="+action;
	}

}

function loan_apply(value)
{ 
	
    if(value != '')
	{
	self.location = "add_loan.php?applybank_id="+value;
	}

}
function apply_broadbandoption(value)
{ 
   if(value != '')
	{
	self.location = "br_supplier.php?apply_type="+value;
	}

}
function apply_broadbandoption1(value,supplier_id)
{ 
	 var action="edit";
		
    if(value != '')
	{
	self.location = "display_br_supplier.php?apply_type="+value+"&supplier_id="+supplier_id+"&action="+action;
	}

}

// =============== Function For Insurance Provider on admin ===========
function reload_insurance_provider(value)
{ 
    if(value != '')
	{
	self.location = "insurance_feature.php?IProvider_name="+value;
	}

}


//========== This Function is Used For Textbox Enable/Disable========

function disable_text()
{
	document.balancefrm.usual_month_spend.disabled = true; 
}

function enable_text()
{
	document.balancefrm.usual_month_spend.disabled = false; 
}



//========== This Function is Used For Combo Enable/Disable========
function Insert_combo()
{

	var test=document.balancefrm.card.value;

	if(test=="")
	{
	alert("Select  First Credit Card ");
	return false;
	}
	else
	{
			var balance_transfer=document.balancefrm.bal_to_transfer.value;
		if(balance_transfer=="")
		{
		alert("First Enter Balance Transfer Amount");
		document.balancefrm.bal_to_transfer.focus();
		 document.balancefrm.bal_to_transfer.select();
		return false;
		}
	window.location= "balance_transfer.php?name=credit&cuid=new&cid="+test+"&balance_transfer_amount="+balance_transfer;
	return false;
	}
	
	
}

function Delete_combo()
{
	
    var test=document.balancefrm.card.value;
	var balance_transfer=document.balancefrm.bal_to_transfer.value;
	window.location= "balance_transfer.php?name=credit&cuid=del&cid="+test+"&balance_transfer_amount="+balance_transfer;

}


// =========== Popup Function For Mobile Features ============== /

function openNewwindow(Id)
{
	
	window.open("mobile_description.php?Mode=Features&MobileId="+Id, "newwindow", "height=500,width=750, toolbar=no, menubar=no,scrollbars=no, resizable=no,location=no, directories=no, status=no");
}	
//========== This Function is Used For Page Search relocation========

function page_search(value)
{
	if(value != '')
	{
	self.location = "heading_temp.php?page_check="+value;
	
	}

}

//========== This Function is Used For Page Search relocation========

function userApplication_search(value)
{
	if(value != '')
	{
	self.location = "display_app_user.php?pagecheck="+value;
	
	}

}

//================ This Function For Supplier Search ============

function supplier_search(value)
{
	var selectTextId = document.frm.search_name.selectedIndex;
	var selectText=document.frm.search_name[selectTextId].text;
	
 
   var xmlHttp;
  try
    {
    // Firefox, Opera 8.0+, Safari
    xmlHttp=new XMLHttpRequest();
    }
  catch (e)
    {
    // Internet Explorer
		try
		  {
		  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		  }
		 catch (e)
			{
				try
				{
				xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
				}
				catch (e)
				{
				alert("Your browser does not support AJAX!");
				return false;
				}
		   }
     }
	  xmlHttp.onreadystatechange=function()
      {
		  if(xmlHttp.readyState==4)
			{
			 document.getElementById("list").innerHTML =xmlHttp.responseText;
			
			}
	
      }
	  
      xmlHttp.open("GET","display_ge_supplier.php?supply_product="+selectText,true);

      xmlHttp.send(null);
}



// =============== This Function is used for supplier product relocation=========
function reload_product(value)
{
    if(value=="0" || value=='')
	 {
	    var x=document.getElementById("mySelect")
        x.disabled=true;
		return false;
	 }
     else if(value != '')
	 {
	 self.location = "supplier_plan.php?supplier_id="+value;
	
	
	 }

}


function file_search(value)
{
     if(value != '')
	 {
	 self.location = "display_export_import_file.php?FileType="+value;
	 }

}


//============== This Function is used for mortgage Calculator========

function openmtgecalc()
{									
	window.open("template/user_temp/MCalcu.html","","scrollbars,resizable,width=500,height=500")
}



function mortgaga_cal()
{
	if(document.frmcal.mortgage_amount.value=="")
	{
	 alert("Please, Enter Mortgage Amount");
	 document.frmcal.mortgage_amount.focus();
	 return false;
	}
	else
	{
	
	 var mortgage_amount=document.frmcal.mortgage_amount.value;
	}
	 //alert(mortgage_amount);
	if(document.frmcal.amortization_period.value=="")
	{
	 alert("Please, Enter Amortization Period");
	 document.frmcal.amortization_period.focus();
	 return false;
	}
	else
	{
     var amortization_period=document.frmcal.amortization_period.value;
	}
     var selectTextId1 = document.frmcal.year_rate.selectedIndex;
	 var mortgage_year_rate=document.frmcal.year_rate[selectTextId1].text;
      
	 var selectTextId2 = document.frmcal.payment_schedule.selectedIndex;
	 var payment_schedule=document.frmcal.payment_schedule[selectTextId2].text;
     
      var mortgage_year_rate_new=mortgage_year_rate.split(" ");
	  var year=mortgage_year_rate_new[0];
      var rate=mortgage_year_rate_new[3].split("%");
	  var mortgage_rate=rate[0];
	 
	
	  var m_amount=mortgage_amount;
	  var rate_n=rate[0];
	  var am_period=amortization_period;
	  var pay_sch=payment_schedule;
	  var year_n=year;
	  var mon_year= mortgage_year_rate_new[1];
	
 
	  document.frmcal.action = "mortgage_calculator.php?name=mortgage&m_amount="+m_amount+"&rate1="+rate_n+"&am_period="+am_period+"&pay_sch="+pay_sch+"&year="+year_n+"&mon_year="+mon_year+"&id1="+selectTextId1+"&id2="+selectTextId2;
	  document.frmcal.submit();
     
  
}

function custom_mortgaga_cal()
{
	if(document.custfrmcal.mortgage_amount.value=="")
	{
	 alert("Please, Enter Mortgage Amount");
	 document.custfrmcal.mortgage_amount.focus();
	 return false;
	}
	else
	{
	
	 var mortgage_amount=document.custfrmcal.mortgage_amount.value;
	}
	 
	if(document.custfrmcal.mortgage_term.value=="")
	{
	 alert("Please, Enter Mortgage Term");
	 document.custfrmcal.mortgage_term.focus();
	 return false;
	}
	else
	{
	 var year=document.custfrmcal.mortgage_term.value;
	}
      
	if(document.custfrmcal.mortgage_rate.value=="")
	{
	 alert("Please, Enter Mortgage Rate");
	 document.custfrmcal.mortgage_rate.focus();
	 return false;
	}
	else
	{
	 var mortgage_rate=document.custfrmcal.mortgage_rate.value;
	}

	if(document.custfrmcal.amortization_period.value=="")
	{
	 alert("Please, Enter Amortization Period");
	 document.custfrmcal.amortization_period.focus();
	 return false;
	}
	else
	{
     var amortization_period=document.custfrmcal.amortization_period.value;
	}

    
	var selectTextId2 = document.custfrmcal.payment_schedule.selectedIndex;
	var payment_schedule=document.custfrmcal.payment_schedule[selectTextId2].text;


     /*var selectTextId1 = document.frmcal.year_rate.selectedIndex;
	  var mortgage_year_rate=document.frmcal.year_rate[selectTextId1].text;
      var mortgage_year_rate_new=mortgage_year_rate.split(" ");
	  var year=mortgage_year_rate_new[0];
      var rate=mortgage_year_rate_new[3].split("%");
	  var mortgage_rate=rate[0];
	 */
	 
	  var m_amount=mortgage_amount;
	  var rate_n=mortgage_rate;
	  var am_period=amortization_period;
	  var pay_sch=payment_schedule;
	  var year_n=year;
	  //var mon_year= mortgage_year_rate_new[1];
	   var mon_year="year";
     

	  //document.frmcal.action = "custom_calculator.php?name=mortgage&m_amount="+m_amount+"&rate1="+rate_n+"&am_period="+am_period+"&pay_sch="+pay_sch+"&year="+year_n+"&mon_year="+mon_year+"&id1="+selectTextId1+"&id2="+selectTextId2;
	  document.custfrmcal.action = "custom_calculator.php?name=mortgage&m_amount="+m_amount+"&rate1="+rate_n+"&am_period="+am_period+"&pay_sch="+pay_sch+"&year="+year_n+"&mon_year="+mon_year+"&id2="+selectTextId2;
	  document.custfrmcal.submit();
     
  
}

//========== Validation Function for gasele Application  =============//
function validate_GE_appl()
{
	if(document.appl_form1.first_name.value=="")
	{
		alert("Please Enter First Name ");
		document.appl_form1.first_name.select();
		document.appl_form1.first_name.focus();
		return false;
	}
	if(IsNumeric1(document.appl_form1.first_name.value))
	{
		alert("Please Enter Valid First Name ");
		document.appl_form1.first_name.select();
		document.appl_form1.first_name.focus();
		return false;
	}
	if(document.appl_form1.last_name.value=="")
	{
		alert("Please Enter Last Name ");
		document.appl_form1.last_name.select();
		document.appl_form1.last_name.focus();
		return false;
	}
	if(IsNumeric1(document.appl_form1.last_name.value))
	{
		alert("Please Enter Valid Last Name ");
		document.appl_form1.last_name.select();
		document.appl_form1.last_name.focus();
		return false;
	}
	if(document.appl_form1.company_name.value=="")
	{
		alert("Please Enter Company Name ");
		document.appl_form1.company_name.select();
		document.appl_form1.company_name.focus();
		return false;
	}

	if(document.appl_form1.curr_address.value=="")
	{
		alert("Please Enter Mailing Street Address ");
		document.appl_form1.curr_address.select();
		document.appl_form1.curr_address.focus();
		return false;
	}

	if(document.appl_form1.address_from.selectedIndex==0)
	{
		alert("Please Select Month ");
		return false;
	}

	if(document.appl_form1.address_year.value=="")
	{
		alert("Please Enter year ");
		document.appl_form1.address_year.select();
		document.appl_form1.address_year.focus();
		return false;
	}
	if(document.appl_form1.city.value=="")
	{
		alert("Please Enter City ");
		document.appl_form1.city.select();
		document.appl_form1.city.focus();
		return false;
	}

	if(document.appl_form1.province.selectedIndex==0)
	{
		alert("Please Enter province ");
		return false;
	}

	if(document.appl_form1.post_code1.value=="")
	{
		alert("Please Enter Post Code ");
		document.appl_form1.post_code1.select();
		document.appl_form1.post_code1.focus();
		return false;
	}
	if(document.appl_form1.post_code2.value=="")
	{
		alert("Please Enter Post Code ");
		document.appl_form1.post_code2.select();
		document.appl_form1.post_code2.focus();
		return false;
	}

	if(document.appl_form1.phone_num1.value=="")
	{
		alert("Please Enter Phone Number");
		document.appl_form1.phone_num1.select();
		document.appl_form1.phone_num1.focus();
		return false;
	}
	if(document.appl_form1.phone_num2.value=="")
	{
		alert("Please Enter Phone Number");
		document.appl_form1.phone_num2.select();
		document.appl_form1.phone_num2.focus();
		return false;
	}
	if(document.appl_form1.phone_num3.value=="")
	{
		alert("Please Enter Phone Number");
		document.appl_form1.phone_num3.select();
		document.appl_form1.phone_num3.focus();
		return false;
	}
	if(IsString(document.appl_form1.phone_num1.value))
	{
		alert("Please Enter Valid Phone Number");
		document.appl_form1.phone_num1.select();
		document.appl_form1.phone_num1.focus();
		return false;
	}
	if(IsString(document.appl_form1.phone_num2.value))
	{
		alert("Please Enter Valid Phone Number");
		document.appl_form1.phone_num2.select();
		document.appl_form1.phone_num2.focus();
		return false;
	}
	if(IsString(document.appl_form1.phone_num3.value))
	{
		alert("Please Enter Valid Phone Number");
		document.appl_form1.phone_num3.select();
		document.appl_form1.phone_num3.focus();
		return false;
	}
     if(document.appl_form1.email.value=="")
    {
	   alert("Please Enter Email");
	   document.appl_form1.email.select();
	   document.appl_form1.email.focus();
	   return false;
    }
	if(!valid_email(document.appl_form1.email.value))
    {
	   alert("Please Enter Valid Email");
	   document.appl_form1.email.select();
	   document.appl_form1.email.focus();
	   return false;
   }

	if(document.appl_form1.gs_account_num.value=="")
	{
		alert("Please Enter Union Gas Southern Ontario Account Number ");
		document.appl_form1.gs_account_num.select();
		document.appl_form1.gs_account_num.focus();
		return false;
	}

	if(document.appl_form1.annual_usage.value=="")
	{
		alert("Please Enter Annual Usage ");
		document.appl_form1.annual_usage.select();
		document.appl_form1.annual_usage.focus();
		return false;
	}

	if(document.appl_form1.service_street_add.value=="")
	{
		alert("Please Enter Service Street Address ");
		document.appl_form1.service_street_add.select();
		document.appl_form1.service_street_add.focus();
		return false;
	}

	if(document.appl_form1.suite.value=="")
	{
		alert("Please Enter suite ");
		document.appl_form1.suite.select();
		document.appl_form1.suite.focus();
		return false;
	}


	if(document.appl_form1.city2.value=="")
	{
		alert("Please Enter City ");
		document.appl_form1.city2.select();
		document.appl_form1.city2.focus();
		return false;
	}

	if(document.appl_form1.province2.selectedIndex==0)
	{
		alert("Please Enter province ");
		return false;
	}

	if(document.appl_form1.p_code1.value=="")
	{
		alert("Please Enter Post Code ");
		document.appl_form1.p_code1.select();
		document.appl_form1.p_code1.focus();
		return false;
	}
	if(document.appl_form1.p_code2.value=="")
	{
		alert("Please Enter Post Code ");
		document.appl_form1.p_code2.select();
		document.appl_form1.p_code2.focus();
		return false;
	}
	
	if(!document.appl_form1.term.checked)
	{
      alert("You must agree with Term & Conditions");
	  return false;
 	}


}


//========== Validation Function for LOan Application  =============//
function validate_loan_appl()
{
	if(document.appl_form1.applying_for.value=="")
	{
	alert("Please Enter How much are you applying for ?");
	document.appl_form1.applying_for.select();
	document.appl_form1.applying_for.focus();
	return false;
	}
	if(IsString(document.appl_form1.applying_for.value))
	{
	alert("Please Enter Valid How much are you applying for ?");
	document.appl_form1.applying_for.select();
	document.appl_form1.applying_for.focus();
	return false;
	}
	if(document.appl_form1.loan_list.selectedIndex==0)
	{
	alert("Please Select Applying For:");

	return false;
	}

	if(document.appl_form1.first_name.value=="")
	{
	alert("Please Enter First Name ");
	document.appl_form1.first_name.select();
	document.appl_form1.first_name.focus();
	return false;
	}
	if(IsNumeric1(document.appl_form1.first_name.value))
	{
	alert("Please Enter Valid First Name ");
	document.appl_form1.first_name.select();
	document.appl_form1.first_name.focus();
	return false;
	}
	if(document.appl_form1.last_name.value=="")
	{
	alert("Please Enter Last Name ");
	document.appl_form1.last_name.select();
	document.appl_form1.last_name.focus();
	return false;
	}
	if(IsNumeric1(document.appl_form1.last_name.value))
	{
	alert("Please Enter Valid Last Name ");
	document.appl_form1.last_name.select();
	document.appl_form1.last_name.focus();
	return false;
	}
	if(document.appl_form1.dob_month.selectedIndex==0)
	{
	alert("Please Select the Birth Month");

	return false;
	}

	if(document.appl_form1.dob_day.value=="")
	{
	alert("Please Select the Date");
	document.appl_form1.dob_day.select();
	document.appl_form1.dob_day.focus();
	return false;
	}
	if(document.appl_form1.dob_year.value=="")
	{
	alert("Please Enter the Year Of Birth");
	document.appl_form1.dob_year.select();
	document.appl_form1.dob_year.focus();
	return false;
	}

	/*if(document.appl_form1.sin.value=="")
	{
	alert("Please Enter SIN Number");
	document.appl_form1.sin.select();
	document.appl_form1.sin.focus();
	return false;
	}
	if(IsString(document.appl_form1.sin.value))
	{
	alert("Please Enter Valid SIN Number");
	document.appl_form1.sin.select();
	document.appl_form1.sin.focus();
	return false;
	}*/

	if(document.appl_form1.curr_address.value=="")
	{
	alert("Please Enter Current Address ");
	document.appl_form1.curr_address.select();
	document.appl_form1.curr_address.focus();
	return false;
	}
	/*if(document.appl_form1.housing.selectedIndex==0)
	{
	alert("Please Select the Occupancy ");  
	return false;
	}*/
	if(document.appl_form1.address_month.selectedIndex==0)
	{
	alert("Please Select Month ");
	/*document.appl_form1.address_month.select();
	document.appl_form1.address_month.focus();*/
	return false;
	}

	if(document.appl_form1.address_year.value=="")
	{
	alert("Please Enter year ");
	document.appl_form1.address_year.select();
	document.appl_form1.address_year.focus();
	return false;
	}
	if(document.appl_form1.city.value=="")
	{
	alert("Please Enter City ");
	document.appl_form1.city.select();
	document.appl_form1.city.focus();
	return false;
	}

	if(document.appl_form1.province.selectedIndex==0)
	{
	alert("Please Enter province ");
	return false;
	}

	if(document.appl_form1.post_code1.value=="")
	{
	alert("Please Enter Post Code ");
	document.appl_form1.post_code1.select();
	document.appl_form1.post_code1.focus();
	return false;
	}
	if(document.appl_form1.post_code2.value=="")
	{
	alert("Please Enter Post Code ");
	document.appl_form1.post_code2.select();
	document.appl_form1.post_code2.focus();
	return false;
	}
	if(document.appl_form1.phone_num1.value=="")
	{
	alert("Please Enter Phone Number");
	document.appl_form1.phone_num1.select();
	document.appl_form1.phone_num1.focus();
	return false;
	}
	if(document.appl_form1.phone_num2.value=="")
	{
	alert("Please Enter Phone Number");
	document.appl_form1.phone_num2.select();
	document.appl_form1.phone_num2.focus();
	return false;
	}
	if(document.appl_form1.phone_num3.value=="")
	{
	alert("Please Enter Phone Number");
	document.appl_form1.phone_num3.select();
	document.appl_form1.phone_num3.focus();
	return false;
	}
	if(IsString(document.appl_form1.phone_num1.value))
	{
	alert("Please Enter Valid Phone Number");
	document.appl_form1.phone_num1.select();
	document.appl_form1.phone_num1.focus();
	return false;
	}
	if(IsString(document.appl_form1.phone_num2.value))
	{
	alert("Please Enter Valid Phone Number");
	document.appl_form1.phone_num2.select();
	document.appl_form1.phone_num2.focus();
	return false;
	}
	if(IsString(document.appl_form1.phone_num3.value))
	{
	alert("Please Enter Valid Phone Number");
	document.appl_form1.phone_num3.select();
	document.appl_form1.phone_num3.focus();
	return false;
	}
	if(document.appl_form1.email.value=="")
	{
	alert("Please Enter Email");
	document.appl_form1.email.select();
	document.appl_form1.email.focus();
	return false;
	}
	if(!valid_email(document.appl_form1.email.value))
	{
	alert("Please Enter Valid Email");
	document.appl_form1.email.select();
	document.appl_form1.email.focus();
	return false;
	}

	if(document.appl_form1.emp_status.selectedIndex==0)
	{
	alert("Please Select the Employee Status");  
	return false;
	}

	if(document.appl_form1.emp_status.selectedIndex==1 || document.appl_form1.emp_status.selectedIndex==2 || document.appl_form1.emp_status.selectedIndex==3)
	{
	/*if(document.appl_form1.emp_co_name.value=="")
	{
	alert("Please Select the Current Company");
	document.appl_form1.emp_co_name.select();
	document.appl_form1.emp_co_name.focus();
	return false;
	}*/
	}

	if(document.appl_form1.occupation.value=="")
	{
	alert("Please Select the Occupation");
	document.appl_form1.occupation.select();
	document.appl_form1.occupation.focus();
	return false;
	}

	if(document.appl_form1.emp_start_date_month.selectedIndex==0)
	{
	alert("Please Select the Start Date Of Current company");
	 return false;
	}
	if(document.appl_form1.emp_start_date_year.value=="")
	{
	alert("Please enter Year Of Start Date");
	document.appl_form1.emp_start_date_year.select();
	document.appl_form1.emp_start_date_year.focus();
	return false;
	}

	if(document.appl_form1.emp_start_date_month.selectedIndex==0)
	{
	alert("Please Select the Start Date Of Current company");
	 return false;
	}
	if(document.appl_form1.emp_start_date_year.value=="")
	{
	alert("Please enter Year Of Start Date");
	document.appl_form1.emp_start_date_year.select();
	document.appl_form1.emp_start_date_year.focus();
	return false;
	}
	if(document.appl_form1.gross_income.value=="")
	{
	alert("Please Enter Gross Annual Employment Income ");
	document.appl_form1.gross_income.select();
	document.appl_form1.gross_income.focus();
	return false;
	}
	if(IsString(document.appl_form1.gross_income.value))
	{
	alert("Please Enter Valid Gross Annual Employment Income ");
	document.appl_form1.gross_income.select();
	document.appl_form1.gross_income.focus();
	return false;
	}if(document.appl_form1.pre_employment.value=="")
	{
	alert("Please Enter Previous Employer ");
	document.appl_form1.pre_employment.select();
	document.appl_form1.pre_employment.focus();
	return false;
	}

	/*if(document.appl_form1.annual_property.value=="")
	{
	alert("Please Enter Annual Property Tax ");
	document.appl_form1.annual_property.select();
	document.appl_form1.annual_property.focus();
	return false;
	}
	if(IsString(document.appl_form1.annual_property.value))
	{
	alert("Please Enter Valid Annual Property Tax");
	document.appl_form1.annual_property.select();
	document.appl_form1.annual_property.focus();
	return false;
	}
	if(document.appl_form1.study_field.selectedIndex==0)
	{
	alert("Please Select Field of study");  
	return false;
	}
	*/
	if(document.appl_form1.program_name.value=="")
	{
	alert("Please Enter Program name");
	document.appl_form1.program_name.select();
	document.appl_form1.program_name.focus();
	return false;
	}
	/*if(document.appl_form1.grad_date.value=="")
	{
	alert("Please Enter Expected graduation date (mmyyyy)");
	document.appl_form1.grad_date.select();
	document.appl_form1.grad_date.focus();
	return false;
	}*/
	if(IsString(document.appl_form1.property_tax.value))
	{
	alert("Please Enter Valid Expected graduation date (mmyyyy)");
	document.appl_form1.grad_date.select();
	document.appl_form1.grad_date.focus();
	return false;
	}


	if(document.appl_form1.property_reg.value=="")
	{
	alert("Please Enter Under whose name is the property registered? ");
	document.appl_form1.property_reg.select();
	document.appl_form1.property_reg.focus();
	return false;
	}
	if(IsNumeric1(document.appl_form1.property_reg.value))
	{
	alert("Please Enter Under whose name is the property registered? ");
	document.appl_form1.property_reg.select();
	document.appl_form1.property_reg.focus();
	return false;
	}
	if(document.appl_form1.residence.selectedIndex==0)
	{
	alert("Please Select  Do you live at this residence?");  
	return false;
	}
	/*if(document.appl_form1.purches_date.value=="")
	{
	alert("Please Enter Purchase Date (mmyyyy)");
	document.appl_form1.purches_date.select();
	document.appl_form1.purches_date.focus();
	return false;
	}
	if(IsString(document.appl_form1.purches_date.value))
	{
	alert("Please Enter Valid Purchase Date (mmyyyy)");
	document.appl_form1.purches_date.select();
	document.appl_form1.purches_date.focus();
	return false;
	}*/
	if(document.appl_form1.purchase_price.value=="")
	{
	alert("Please Enter Purchase Price");
	document.appl_form1.purchase_price.select();
	document.appl_form1.purchase_price.focus();
	return false;
	}
	if(IsString(document.appl_form1.purchase_price.value))
	{
	alert("Please Enter Valid Purchase Price");
	document.appl_form1.purchase_price.select();
	document.appl_form1.purchase_price.focus();
	return false;
	}
	if(document.appl_form1.estimate_value.value=="")
	{
	alert("Please Enter Estimated Value");
	document.appl_form1.estimate_value.select();
	document.appl_form1.estimate_value.focus();
	return false;
	}
	if(IsString(document.appl_form1.estimate_value.value))
	{
	alert("Please Enter Valid Estimated Value");
	document.appl_form1.estimate_value.select();
	document.appl_form1.estimate_value.focus();
	return false;
	}
	if(document.appl_form1.mortgage_type.selectedIndex==0)
	{
	alert("Please Select Mortgage Type");  
	return false;
	}
	if(document.appl_form1.institution.value=="")
	{
	alert("Please Enter Financial Institution");
	document.appl_form1.institution.select();
	document.appl_form1.institution.focus();
	return false;
	}
	/*if(document.appl_form1.maturity_date.value=="")
	{
	alert("Please Enter Maturity Date(mmyyyy)");
	document.appl_form1.maturity_date.select();
	document.appl_form1.maturity_date.focus();
	return false;
	}
	if(IsString(document.appl_form1.maturity_date.value))
	{
	alert("Please Enter Valid Maturity Date(mmyyyy)");
	document.appl_form1.maturity_date.select();
	document.appl_form1.maturity_date.focus();
	return false;
	} */

	if(document.appl_form1.property_tax.value=="")
	{
	alert("Please Enter Monthly Costs(where applicable): Property Taxes");
	document.appl_form1.property_tax.select();
	document.appl_form1.property_tax.focus();
	return false;
	}
	if(IsString(document.appl_form1.property_tax.value))
	{
	alert("Please Enter Valid Monthly Costs(where applicable): Property Taxes");
	document.appl_form1.property_tax.select();
	document.appl_form1.property_tax.focus();
	return false;
	}
	if(document.appl_form1.heating_cost.value=="")
	{
	alert("Please Enter Heating Costs");
	document.appl_form1.heating_cost.select();
	document.appl_form1.heating_cost.focus();
	return false;
	}
	if(IsString(document.appl_form1.heating_cost.value))
	{
	alert("Please Enter Valid Heating Costs");
	document.appl_form1.heating_cost.select();
	document.appl_form1.heating_cost.focus();
	return false;
	}
	if(document.appl_form1.Condo_fees.value=="")
	{
	alert("Please Enter Condominium Fees");
	document.appl_form1.Condo_fees.select();
	document.appl_form1.Condo_fees.focus();
	return false;
	}
	if(IsString(document.appl_form1.Condo_fees.value))
	{
	alert("Please Enter Valid Condominium Fees");
	document.appl_form1.Condo_fees.select();
	document.appl_form1.Condo_fees.focus();
	return false;
	}

	if(!document.appl_form1.term.checked)
	{
      alert("You must agree with Term & Conditions");
	  return false;
 	}


}



//========== Validation Function for Credit Card Application  =============//
function validate_credit_appl()
{
	

	if(document.appl_form1.first_name.value=="")
	{
		alert("Please Enter First Name ");
		document.appl_form1.first_name.select();
		document.appl_form1.first_name.focus();
		return false;
	}
	if(IsNumeric1(document.appl_form1.first_name.value))
	{
		alert("Please Enter Valid First Name ");
		document.appl_form1.first_name.select();
		document.appl_form1.first_name.focus();
		return false;
	}
	if(document.appl_form1.last_name.value=="")
	{
		alert("Please Enter Last Name ");
		document.appl_form1.last_name.select();
		document.appl_form1.last_name.focus();
		return false;
	}
	if(IsNumeric1(document.appl_form1.last_name.value))
	{
		alert("Please Enter Valid Last Name ");
		document.appl_form1.last_name.select();
		document.appl_form1.last_name.focus();
		return false;
	}
	if(document.appl_form1.dob_month.selectedIndex==0)
	{
		alert("Please Select the Birth Month");
		return false;
	}

	if(document.appl_form1.dob_day.value=="")
	{
		alert("Please Select the Date");
		document.appl_form1.dob_day.select();
		document.appl_form1.dob_day.focus();
		return false;
	}
	if(document.appl_form1.dob_year.value=="")
	{
		alert("Please Enter the Year Of Birth");
		document.appl_form1.dob_year.select();
		document.appl_form1.dob_year.focus();
		return false;
	}
	if(document.appl_form1.phone_num1.value=="")
	{
		alert("Please Enter Phone Number");
		document.appl_form1.phone_num1.select();
		document.appl_form1.phone_num1.focus();
		return false;
	}
	if(document.appl_form1.phone_num2.value=="")
	{
		alert("Please Enter Phone Number");
		document.appl_form1.phone_num2.select();
		document.appl_form1.phone_num2.focus();
		return false;
	}
	if(document.appl_form1.phone_num3.value=="")
	{
		alert("Please Enter Phone Number");
		document.appl_form1.phone_num3.select();
		document.appl_form1.phone_num3.focus();
		return false;
	}
	if(IsString(document.appl_form1.phone_num1.value))
	{
		alert("Please Enter Valid Phone Number");
		document.appl_form1.phone_num1.select();
		document.appl_form1.phone_num1.focus();
		return false;
	}
	if(IsString(document.appl_form1.phone_num2.value))
	{
		alert("Please Enter Valid Phone Number");
		document.appl_form1.phone_num2.select();
		document.appl_form1.phone_num2.focus();
		return false;
	}
	if(IsString(document.appl_form1.phone_num3.value))
	{
		alert("Please Enter Valid Phone Number");
		document.appl_form1.phone_num3.select();
		document.appl_form1.phone_num3.focus();
		return false;
	}
	if(document.appl_form1.email.value=="")
	{
		alert("Please Enter Email");
		document.appl_form1.email.select();
		document.appl_form1.email.focus();
		return false;
	}
	if(!valid_email(document.appl_form1.email.value))
	{
		alert("Please Enter Valid Email");
		document.appl_form1.email.select();
		document.appl_form1.email.focus();
		return false;
	}
	/*if(document.appl_form1.TD_number.value=="")
	{
		alert("Please Enter TD Canada Trust Access Card number:");
		document.appl_form1.TD_number.select();
		document.appl_form1.TD_number.focus();
		return false;
	}
	if(IsString(document.appl_form1.TD_number.value))
	{
		alert("Please Enter Valid TD Canada Trust Access Card number:");
		document.appl_form1.TD_number.select();
		document.appl_form1.TD_number.focus();
		return false;
	}*/

    if(document.appl_form1.identificatin_des.selectedIndex==0)
	{  
		
		alert("Please Select the Identification Description");
		return false;
	}
	if(document.appl_form1.identificatin_no.value=="")
	{
		alert("Please Enter Identification Number");
		document.appl_form1.identificatin_no.select();
		document.appl_form1.identificatin_no.focus();
		return false;
	}
	if(IsString(document.appl_form1.identificatin_no.value))
	{
		alert("Please Enter Valid Identification Number");
		document.appl_form1.identificatin_no.select();
		document.appl_form1.identificatin_no.focus();
		return false;
	}
	if(document.appl_form1.province2.selectedIndex==0)
	{
		alert("Please Select the Province");

	return false;
	}

	if(document.appl_form1.curr_address.value=="")
	{
		alert("Please Enter Current Address ");
		document.appl_form1.curr_address.select();
		document.appl_form1.curr_address.focus();
		return false;
	}
	if(document.appl_form1.address_month.selectedIndex==0)
	{
		alert("Please Select Month ");
		/*document.appl_form1.address_month.select();
		document.appl_form1.address_month.focus();*/
		return false;
	}

	if(document.appl_form1.address_year.value=="")
	{
		alert("Please Enter year ");
		document.appl_form1.address_year.select();
		document.appl_form1.address_year.focus();
		return false;
	}
	if(document.appl_form1.city.value=="")
	{
		alert("Please Enter City ");
		document.appl_form1.city.select();
		document.appl_form1.city.focus();
		return false;
	}

	if(document.appl_form1.province.selectedIndex==0)
	{
		alert("Please Enter province ");
		return false;
	}

	if(document.appl_form1.post_code1.value=="")
	{
		alert("Please Enter Post Code ");
		document.appl_form1.post_code1.select();
		document.appl_form1.post_code1.focus();
		return false;
	}
	if(document.appl_form1.post_code2.value=="")
	{
		alert("Please Enter Post Code ");
		document.appl_form1.post_code2.select();
		document.appl_form1.post_code2.focus();
		return false;
	}

	if(document.appl_form1.emp_status.selectedIndex==0)
	{
		alert("Please Select the Employee Status");  
		return false;
	}

	if(document.appl_form1.emp_status.selectedIndex==1 || document.appl_form1.emp_status.selectedIndex==2 || document.appl_form1.emp_status.selectedIndex==3)
	{
		if(document.appl_form1.emp_co_name.value=="")
		{
			alert("Please Select the Current Company");
			document.appl_form1.emp_co_name.select();
			document.appl_form1.emp_co_name.focus();
			return false;
		}
	}

	if(document.appl_form1.occupation.value=="")
	{
		alert("Please Select the Occupation");
		document.appl_form1.occupation.select();
		document.appl_form1.occupation.focus();
		return false;
	}
     if(IsNumeric1(document.appl_form1.occupation.value))
	{
		alert("Please Enter Valid Occupation ");
		document.appl_form1.occupation.select();
		document.appl_form1.occupation.focus();
		return false;
	}
  
	if(document.appl_form1.emp_start_date_month.selectedIndex==0)
	{
		alert("Please Select the Start Date Of Current company");
		 return false;
	}
	if(document.appl_form1.emp_start_date_year.value=="")
	{
		alert("Please enter Year Of Start Date");
		document.appl_form1.emp_start_date_year.select();
		document.appl_form1.emp_start_date_year.focus();
		return false;
	}

	if(document.appl_form1.emp_start_date_month.selectedIndex==0)
	{
		alert("Please Select the Start Date Of Current company");
		 return false;
	}
	if(document.appl_form1.emp_start_date_year.value=="")
	{
		alert("Please enter Year Of Start Date");
		document.appl_form1.emp_start_date_year.select();
		document.appl_form1.emp_start_date_year.focus();
		return false;
	}



	/*if(document.appl_form1.bus_phone1.value=="")
	{
	alert("Please Enter Business Telephone Number");
	document.appl_form1.bus_phone1.select();
	document.appl_form1.bus_phone1.focus();
	return false;
	}
	if(document.appl_form1.bus_phone2.value=="")
	{
	alert("Please Enter Business Telephone Number");
	document.appl_form1.bus_phone2.select();
	document.appl_form1.bus_phone2.focus();
	return false;
	}
	if(document.appl_form1.bus_phone3.value=="")
	{
	alert("Please Enter Business Telephone Number");
	document.appl_form1.bus_phone3.select();
	document.appl_form1.bus_phone3.focus();
	return false;
	}
	if(IsString(document.appl_form1.bus_phone1.value))
	{
	alert("Please Enter Valid Business Telephone Number");
	document.appl_form1.bus_phone1.select();
	document.appl_form1.bus_phone1.focus();
	return false;
	}
	if(IsString(document.appl_form1.bus_phone2.value))
	{
	alert("Please Enter Valid Business Telephone Number");
	document.appl_form1.bus_phone2.select();
	document.appl_form1.bus_phone2.focus();
	return false;
	}
	if(IsString(document.appl_form1.bus_phone3.value))
	{
	alert("Please Enter Valid Business Telephone Number");
	document.appl_form1.bus_phone3.select();
	document.appl_form1.bus_phone3.focus();
	return false;
	}*/
	if(document.appl_form1.gross_income.value=="")
	{
		alert("Please Enter Gross Annual Employment Income ");
		document.appl_form1.gross_income.select();
		document.appl_form1.gross_income.focus();
		return false;
	}
	if(IsString(document.appl_form1.gross_income.value))
	{
		alert("Please Enter Valid Gross Annual Employment Income ");
		document.appl_form1.gross_income.select();
		document.appl_form1.gross_income.focus();
		return false;
	}if(document.appl_form1.pre_employment.value=="")
	{
		alert("Please Enter Previous Employer ");
		document.appl_form1.pre_employment.select();
		document.appl_form1.pre_employment.focus();
		return false;
	}
	if(IsNumeric1(document.appl_form1.pre_employment.value))
	{
		alert("Please Enter Valid Previous Employer ");
		document.appl_form1.pre_employment.select();
		document.appl_form1.pre_employment.focus();
		return false;
	}
	if(document.appl_form1.housing.selectedIndex==0)
	{
		alert("Please Select the Housing Status");  
		return false;
	}
	if(document.appl_form1.annual_property.value=="")
	{
		alert("Please Enter Annual Property Tax ");
		document.appl_form1.annual_property.select();
		document.appl_form1.annual_property.focus();
		return false;
	}
	if(IsString(document.appl_form1.annual_property.value))
	{
		alert("Please Enter Valid Annual Property Tax");
		document.appl_form1.annual_property.select();
		document.appl_form1.annual_property.focus();
		return false;
	}
	if(document.appl_form1.heating_costs.value=="")
	{
		alert("Please Enter Monthly Heating Costs ");
		document.appl_form1.heating_costs.select();
		document.appl_form1.heating_costs.focus();
		return false;
	}
	if(IsString(document.appl_form1.heating_costs.value))
	{
		alert("Please Enter Valid Monthly Heating Costs");
		document.appl_form1.heating_costs.select();
		document.appl_form1.heating_costs.focus();
		return false;
	}
	if(document.appl_form1.condo_fees.value=="")
	{
		alert("Please Enter Monthly Condo Fees");
		document.appl_form1.condo_fees.select();
		document.appl_form1.condo_fees.focus();
		return false;
	}
	if(IsString(document.appl_form1.condo_fees.value))
	{
		alert("Please Enter Valid Monthly Condo Fees");
		document.appl_form1.condo_fees.select();
		document.appl_form1.condo_fees.focus();
		return false;
	}
	if(document.appl_form1.credit_limit.value=="")
	{
		alert("Please Enter Credit Limit Request");
		document.appl_form1.credit_limit.select();
		document.appl_form1.credit_limit.focus();
		return false;
	}
	if(IsString(document.appl_form1.credit_limit.value))
	{
		alert("Please Enter Valid Credit Limit Request");
		document.appl_form1.credit_limit.select();
		document.appl_form1.credit_limit.focus();
		return false;
	}
	 
if(!document.appl_form1.term.checked)
	{
		alert("You must agree to the Terms & Conditions");
		return false;
	}
	
	



}



//========== Validation Function for Bank Application  =============//
function validate_appl_form1()
{

/*if(document.appl_form1.title.checked==true)
{
alert("Please Select the Title");
return false;
}*/
if(document.appl_form1.first_name.value=="")
{
alert("Please Enter First Name ");
document.appl_form1.first_name.select();
document.appl_form1.first_name.focus();
return false;
}
if(IsNumeric1(document.appl_form1.first_name.value))
{
alert("Please Enter Valid First Name ");
document.appl_form1.first_name.select();
document.appl_form1.first_name.focus();
return false;
}
if(document.appl_form1.last_name.value=="")
{
alert("Please Enter Last Name ");
document.appl_form1.last_name.select();
document.appl_form1.last_name.focus();
return false;
}
if(IsNumeric1(document.appl_form1.last_name.value))
{
alert("Please Enter Valid Last Name ");
document.appl_form1.last_name.select();
document.appl_form1.last_name.focus();
return false;
}
if(document.appl_form1.dob_month.selectedIndex==0)
{
alert("Please Select the Birth Month");

return false;
}

if(document.appl_form1.dob_day.value=="")
{
alert("Please Enter the  Birth Date");
document.appl_form1.dob_day.select();
document.appl_form1.dob_day.focus();
return false;
}
if(IsString(document.appl_form1.dob_day.value))
{
alert("Please Enter Valid the  Birth Date");
document.appl_form1.dob_day.select();
document.appl_form1.dob_day.focus();
return false;
}
if(document.appl_form1.dob_year.value=="")
{
alert("Please Enter the Year Of Birth");
document.appl_form1.dob_year.select();
document.appl_form1.dob_year.focus();
return false;
}
if(IsString(document.appl_form1.dob_year.value))
{
alert("Please Enter Valid the  Year Of Birth");
document.appl_form1.dob_year.select();
document.appl_form1.dob_year.focus();
return false;
}
if(document.appl_form1.curr_address.value=="")
{
alert("Please Enter Residential address");
document.appl_form1.curr_address.select();
document.appl_form1.curr_address.focus();
return false;
}
if(document.appl_form1.address_from.selectedIndex==0)
{
alert("Please Select Month ");
/*document.appl_form1.address_month.select();
document.appl_form1.address_month.focus();*/
return false;
}

if(document.appl_form1.address_year.value=="")
{
alert("Please Enter Year ");
document.appl_form1.address_year.select();
document.appl_form1.address_year.focus();
return false;
}
if(IsString(document.appl_form1.address_year.value))
{
alert("Please Enter Valid the  Year ");
document.appl_form1.address_year.select();
document.appl_form1.address_year.focus();
return false;
}
if(document.appl_form1.city.value=="")
{
alert("Please Enter City ");
document.appl_form1.city.select();
document.appl_form1.city.focus();
return false;
}

if(document.appl_form1.province.selectedIndex==0)
{
alert("Please Enter province ");
return false;
}

if(document.appl_form1.post_code1.value=="")
{
alert("Please Enter Post Code ");
document.appl_form1.post_code1.select();
document.appl_form1.post_code1.focus();
return false;
}
/*if(IsString(document.appl_form1.post_code1.value))
{
alert("Please Enter Valid Post Code");
document.appl_form1.post_code1.select();
document.appl_form1.post_code1.focus();
return false;
}*/
if(document.appl_form1.post_code2.value=="")
{
alert("Please Enter Post Code ");
document.appl_form1.post_code2.select();
document.appl_form1.post_code2.focus();
return false;
}
/*if(IsString(document.appl_form1.post_code2.value))
{
alert("Please Enter Valid Post Code");
document.appl_form1.post_code2.select();
document.appl_form1.post_code2.focus();
return false;
}*/
if(document.appl_form1.residential_status.selectedIndex==0)
{
alert("Please select Current residential status");
return false;
}

if(document.appl_form1.phone_num1.value=="")
{
alert("Please Enter Phone Number");
document.appl_form1.phone_num1.select();
document.appl_form1.phone_num1.focus();
return false;
}
if(document.appl_form1.phone_num2.value=="")
{
alert("Please Enter Phone Number");
document.appl_form1.phone_num2.select();
document.appl_form1.phone_num2.focus();
return false;
}
if(document.appl_form1.phone_num3.value=="")
{
alert("Please Enter Phone Number");
document.appl_form1.phone_num3.select();
document.appl_form1.phone_num3.focus();
return false;
}
if(IsString(document.appl_form1.phone_num1.value))
{
alert("Please Enter Valid Phone Number");
document.appl_form1.phone_num1.select();
document.appl_form1.phone_num1.focus();
return false;
}
if(IsString(document.appl_form1.phone_num2.value))
{
alert("Please Enter Valid Phone Number");
document.appl_form1.phone_num2.select();
document.appl_form1.phone_num2.focus();
return false;
}
if(IsString(document.appl_form1.phone_num3.value))
{
alert("Please Enter Valid Phone Number");
document.appl_form1.phone_num3.select();
document.appl_form1.phone_num3.focus();
return false;
}
if(document.appl_form1.email.value=="")
{
alert("Please Enter Email");
document.appl_form1.email.select();
document.appl_form1.email.focus();
return false;
}
if(!valid_email(document.appl_form1.email.value))
{
alert("Please Enter Valid Email");
document.appl_form1.email.select();
document.appl_form1.email.focus();
return false;
}
if(document.appl_form1.SIN1.value=="")
{
alert("Please Enter SIN Number");
document.appl_form1.SIN1.select();
document.appl_form1.SIN1.focus();
return false;
}
if(IsString(document.appl_form1.SIN1.value))
{
alert("Please Enter Valid SIN Number");
document.appl_form1.SIN1.select();
document.appl_form1.SIN1.focus();
return false;
}
if(document.appl_form1.SIN2.value=="")
{
alert("Please Enter SIN Number");
document.appl_form1.SIN2.select();
document.appl_form1.SIN2.focus();
return false;
}
if(IsString(document.appl_form1.SIN2.value))
{
alert("Please Enter Valid SIN Number");
document.appl_form1.SIN2.select();
document.appl_form1.SIN2.focus();
return false;
}
if(document.appl_form1.SIN3.value=="")
{
alert("Please Enter SIN Number");
document.appl_form1.SIN3.select();
document.appl_form1.SIN3.focus();
return false;
}
if(IsString(document.appl_form1.SIN3.value))
{
alert("Please Enter Valid SIN Number");
document.appl_form1.SIN3.select();
document.appl_form1.SIN3.focus();
return false;
}

if(document.appl_form1.creditcard.selectedIndex==0)
{
alert("Please Select Credit card type");  
return false;
}

if(document.appl_form1.card_number.value=="")
{
alert("Please Enter Credit card number ");
document.appl_form1.card_number.select();
document.appl_form1.card_number.focus();
return false;
}
if(IsString(document.appl_form1.card_number.value))
{
alert("Please Enter Valid Credit card number");
document.appl_form1.card_number.select();
document.appl_form1.card_number.focus();
return false;
}
if(document.appl_form1.emp_occupation.value=="")
{
alert("Please Enter What is your occupation?");
document.appl_form1.emp_occupation.select();
document.appl_form1.emp_occupation.focus();
return false;
}
if(IsNumeric1(document.appl_form1.emp_occupation.value))
{
alert("Please Enter Valid What is your occupation?");
document.appl_form1.emp_occupation.select();
document.appl_form1.emp_occupation.focus();
return false;
}
if(document.appl_form1.emp_status.selectedIndex==0)
{
alert("Please Select the What category best describes this occupation");  
return false;
}

/*if(document.appl_form1.emp_status.selectedIndex==1 || document.appl_form1.emp_status.selectedIndex==2 || document.appl_form1.emp_status.selectedIndex==3)
{
if(document.appl_form1.emp_co_name.value=="")
{
alert("Please Select the Current Company");
document.appl_form1.emp_co_name.select();
document.appl_form1.emp_co_name.focus();
return false;
}
}*/

if(document.appl_form1.emp_name.value=="")
{
alert("Please Enter Name of employer");
document.appl_form1.emp_name.select();
document.appl_form1.emp_name.focus();
return false;
}
if(IsNumeric1(document.appl_form1.emp_name.value))
{
alert("Please Enter Valid Name of employer");
document.appl_form1.emp_name.select();
document.appl_form1.emp_name.focus();
return false;
}
if(document.appl_form1.emp_add.value=="")
{
alert("Please Enter Employer address");
document.appl_form1.emp_add.select();
document.appl_form1.emp_add.focus();
return false;
}
if(IsNumeric1(document.appl_form1.emp_add.value))
{
alert("Please Enter Valid Employer address");
document.appl_form1.emp_add.select();
document.appl_form1.emp_add.focus();
return false;
}


if(document.appl_form1.emp_start_date_month.selectedIndex==0)
{
alert("Please Select the Start Date Of Current company");
return false;
}
if(document.appl_form1.emp_start_date_year.value=="")
{
alert("Please Enter Year Of Start Date");
document.appl_form1.emp_start_date_year.select();
document.appl_form1.emp_start_date_year.focus();
return false;
}
if(IsString(document.appl_form1.emp_start_date_year.value))
{
alert("Please Enter Valid Month Of Start Date");
document.appl_form1.emp_start_date_year.select();
document.appl_form1.emp_start_date_year.focus();
return false;
}
if(document.appl_form1.emp_city.value=="")
{
alert("Please Enter City ");
document.appl_form1.emp_city.select();
document.appl_form1.emp_city.focus();
return false;
}
if(document.appl_form1.emp_province.selectedIndex==0)
{
alert("Please Select Province");  
return false;
}
if(document.appl_form1.p_code1.value=="")
{
alert("Please Enter Post Code ");
document.appl_form1.p_code1.select();
document.appl_form1.p_code1.focus();
return false;
}
/*if(IsString(document.appl_form1.p_code1.value))
{
alert("Please Enter Valid Post Code");
document.appl_form1.p_code1.select();
document.appl_form1.p_code1.focus();
return false;
}*/
if(document.appl_form1.p_code2.value=="")
{
alert("Please Enter Post Code ");
document.appl_form1.p_code2.select();
document.appl_form1.p_code2.focus();
return false;
}
/*if(IsString(document.appl_form1.p_code2.value))
{
alert("Please Enter Valid Post Code");
document.appl_form1.p_code2.select();
document.appl_form1.p_code2.focus();
return false;
}*/





/*	if(document.appl_form1.card_issue.value=="")
{
alert("Please Enter Credit card issued By ");
document.appl_form1.card_issue.select();
document.appl_form1.card_issue.focus();
return false;
}
if(IsString(document.appl_form1.card_issue.value))
{
alert("Please Enter Valid Credit card issued By");
document.appl_form1.card_issue.select();
document.appl_form1.card_issue.focus();
return false;
}*/

	if(!document.appl_form1.term.checked)
	{
      alert("You must agree with Term & Conditions");
	  return false;
 	}

}



 //=============== Form 2 ===============
function validate_appl_form2()
{
 if(document.appl_form2.SIN1.value=="")
  {
   alert("Please Enter Social Insurance Number");
   document.appl_form2.SIN1.select();
   document.appl_form2.SIN1.focus();
   return false;
  }
  if(document.appl_form2.SIN2.value=="")
  {
   alert("Please Enter Social Insurance Number");
   document.appl_form2.SIN2.select();
   document.appl_form2.SIN2.focus();
   return false;
  }
  if(document.appl_form2.SIN3.value=="")
  {
   alert("Please Enter Social Insurance Number");
   document.appl_form3.SIN3.select();
   document.appl_form3.SIN3.focus();
   return false;
  }
  if(IsString(document.appl_form2.SIN1.value))
 {
  alert("Please Enter Valid Social Insurance Number");
  document.appl_form2.SIN1.select();
   document.appl_form2.SIN1.focus();
  return false;
  }
 if(IsString(document.appl_form2.SIN2.value))
 {
   alert("Please Enter Valid Social Insurance Number");
   document.appl_form2.SIN2.select();
   document.appl_form2.SIN2.focus();
   return false;
  }
  if(IsString(document.appl_form2.SIN3.value))
  {
  alert("Please Enter Valid Social Insurance Number");
  document.appl_form2.SIN3.select();
  document.appl_form2.SIN3.focus();
  return false;
  }
  if(document.appl_form2.creaditcard.selectedIndex==0)
  {
    alert("Please Enter Credit card type");
    return false;
  }

  if(document.appl_form2.card_number.value=="")
  {
   alert("Please Enter Credit card number ");
   document.appl_form2.card_number.select();
   document.appl_form2.card_number.focus();
   return false;
  }
  if(IsString(document.appl_form2.card_number.value))
  {
  alert("Please Enter Valid Credit card number");
  document.appl_form2.card_number.select();
  document.appl_form2.card_number.focus();
  return false;
  }

if(document.appl_form2.card_issue.value=="")
  {
   alert("Please Enter  Valid Credit card issued By");
   document.appl_form2.card_issue.select();
   document.appl_form2.card_issue.focus();
   return false;
  }
  if(IsNumeric1(document.appl_form2.card_issue.value))
  {
   alert("Please Enter Valid Credit card issued By ");
   document.appl_form2.card_issue.select();
   document.appl_form2.card_issue.focus();
   return false;
 }

}

//================ End Of Function ===========
//========== Validation Function For User  ========// 

function validate_USER1()
{

	if(document.userfrm.title.value =="Choose One")
	{
     alert("Please Select Title");
	 document.userfrm.title.focus();
	 document.userfrm.title.select();
	 return false;
    }
	

    if(document.userfrm.first_name.value =="")
	{
	alert("Please Enter First Name");
	document.userfrm.first_name.focus();
	document.userfrm.first_name.select();
	return false;
	}
	 
	if(IsNumeric1(document.userfrm.first_name.value))
	{
	alert("Please Enter Valid First Name");
	document.userfrm.first_name.focus();
	document.userfrm.first_name.select();
	return false;
	}

	 if(document.userfrm.last_name.value =="")
	{
	alert("Please Enter Last Name");
	document.userfrm.last_name.focus();
	document.userfrm.last_name.select();
	return false;
	}
	 
	if(IsNumeric1(document.userfrm.last_name.value))
	{
	alert("Please Enter Valid Last Name");
	document.userfrm.last_name.focus();
	document.userfrm.last_name.select();
	return false;
	}
    
    if(document.userfrm.email.value=="")
	{
	alert("Please Enter Email ");
	document.userfrm.email.focus();
	document.userfrm.email.select();
	return false;
	}
    
	if(!valid_email(document.userfrm.email.value))
	{
		alert('Please Enter Valid Email ,Try again!');
		
		document.userfrm.email.focus();
		document.userfrm.email.select();
		return false;
	}

    if(document.userfrm.c_email.value=="")
	{
	alert("Please Enter Confirm Email ");
	document.userfrm.c_email.focus();
	document.userfrm.c_email.select();
	return false;
	}



    if(!valid_email(document.userfrm.c_email.value))
	{
		alert('Please Enter Valid Email ,Try again!');
		document.userfrm.c_email.select();
		document.userfrm.c_email.focus();
		return false;
	}
     
	if((document.userfrm.email.value) != (document.userfrm.c_email.value))
	{
	alert("Both Email Address Are Not Equal");
	document.userfrm.c_email.focus();
	document.userfrm.c_email.select();
	return false;
	}
   

	if(document.userfrm.username.value=="")
	{
	alert("Please Enter User Name");
	document.userfrm.username.focus();
	document.userfrm.username.select();
	return false;
	}

	if(document.userfrm.password.value=="")
	{
	alert("Please Enter Password");
	document.userfrm.password.focus();
	document.userfrm.password.select();
	return false;
	}
     
	var length=document.userfrm.password.value;

	if(length < 6)
	{
	alert("Password Require Minimum 6 Charecter");
	document.userfrm.password.focus();
	document.userfrm.password.select();
	return false;
	}
	

	if(document.userfrm.c_password.value=="")
	{
	alert("Please Enter Password");
	document.userfrm.c_password.focus();
	document.userfrm.c_password.select();
	return false;
	}

  if(document.userfrm.password.value != document.userfrm.c_password.value)
	{
	alert("Please Enter Correct Password");
	document.userfrm.password.focus();
	document.userfrm.password.select();
	return false;
	}
	
     
    
    if(document.userfrm.city.value=="")
	{
	alert("Please Enter city ");
	document.userfrm.city.focus();
	document.userfrm.city.select();
	return false;
	}
     
	if(document.userfrm.postcode.value=="")
	{
	alert("Please Enter postcode ");
	document.userfrm.postcode.focus();
	document.userfrm.postcode.select();
	return false;
	}
     
	if(document.userfrm.que.value=="")
	{
	alert("Please Enter Security Question ");
	document.userfrm.que.focus();
	document.userfrm.que.select();
	return false;
	}
	if(document.userfrm.ans.value=="")
	{
	alert("Please Enter Answer ");
	document.userfrm.ans.focus();
	document.userfrm.ans.select();
	return false;
	}

	if(document.userfrm.income.value=="")
	{
	alert("Please Enter Annual Income ");
	document.userfrm.income.focus();
	document.userfrm.income.select();
	return false;
	}
	
}



//========== Validation Function For Credit Card ========//  

function validate_credit()
{
	
/*if(document.creditfrm.bank_name.value=="")
	{
	alert("Please Enter Bank Name ");
	document.creditfrm.bank_name.focus();
	document.creditfrm.bank_name.select();
	return false;
	}
	if(document.creditfrm.apply_type.selectedIndex!=0)
	{
		if(document.creditfrm.bank_url.value=="")
		{
		alert("Please Enter Bank URL ");
		document.creditfrm.bank_url.focus();
		document.creditfrm.bank_url.select();
		return false;
		}
		if(!isUrl(document.creditfrm.bank_url.value))
		 {
		  alert("Please,Enter Valid Bank Url");
		  document.creditfrm.bank_url.focus();
		  document.creditfrm.bank_url.select();
		  return false;
		 
		 }
	}
 if(document.creditfrm.card_title.value=="")
	{
	alert("Please Enter Card Title ");
	document.creditfrm.card_title.focus();
	document.creditfrm.card_title.select();
	return false;
	}

	
	if(document.creditfrm.joining_fee.value=="")
	{
	alert("Please Enter Joining Fee ");
	document.creditfrm.joining_fee.focus();
	document.creditfrm.joining_fee.select();
	return false;
	}

    if(IsString(document.creditfrm.joining_fee.value))
	{
	alert("Please Enter Valid Joining Fee");
	document.creditfrm.joining_fee.focus();
	document.creditfrm.joining_fee.select();
	return false;
	}
   
	if(document.creditfrm.annual_fee.value=="")
	{
	alert("Please Enter Annual Fee ");
	document.creditfrm.annual_fee.focus();
	document.creditfrm.annual_fee.select();
	return false;
	}
	 if(IsString(document.creditfrm.annual_fee.value))
	{
	alert("Please Enter Valid Annual Fee");
	document.creditfrm.annual_fee.focus();
	document.creditfrm.annual_fee.select();
	return false;
	}

if(document.creditfrm.monthly_interest_charges_in_percentage.value=="")
	{
	alert("Please Enter Monthly Interest Charges ");
	document.creditfrm.monthly_interest_charges_in_percentage.focus();
	document.creditfrm.monthly_interest_charges_in_percentage.select();
	return false;
	}
	 if(IsString(document.creditfrm.monthly_interest_charges_in_percentage.value))
	{
	alert("Please Enter Valid Monthly Interest Charges");
	document.creditfrm.monthly_interest_charges_in_percentage.focus();
	document.creditfrm.monthly_interest_charges_in_percentage.select();
	return false;
	}

if(document.creditfrm.cash_advance_amount_in_percentage.value=="")
	{
	alert("Please Enter Cash Advance Amount ");
	document.creditfrm.cash_advance_amount_in_percentage.focus();
	document.creditfrm.cash_advance_amount_in_percentage.select();
	return false;
	}
	 if(IsString(document.creditfrm.cash_advance_amount_in_percentage.value))
	{
	alert("Please Enter Valid Cash Advance Amount");
	document.creditfrm.cash_advance_amount_in_percentage.focus();
	document.creditfrm.cash_advance_amount_in_percentage.select();
	return false;
	}

if(document.creditfrm.cash_advance_charges_fixed.value=="")
	{
	alert("Please Enter Cash Advance Fixed Charges ");
	document.creditfrm.cash_advance_charges_fixed.focus();
	document.creditfrm.cash_advance_charges_fixed.select();
	return false;
	}
	 if(IsString(document.creditfrm.cash_advance_charges_fixed.value))
	{
	alert("Please Enter Valid Cash Advance Fixed Charges");
	document.creditfrm.cash_advance_charges_fixed.focus();
	document.creditfrm.cash_advance_charges_fixed.select();
	return false;
	}
if(document.creditfrm.cash_advance_charges_percentage.value=="")
	{
	alert("Please Enter Cash Advance Charges Percentage ");
	document.creditfrm.cash_advance_charges_percentage.focus();
	document.creditfrm.cash_advance_charges_percentage.select();
	return false;
	}
	 if(IsString(document.creditfrm.cash_advance_charges_percentage.value))
	{
	alert("Please Enter Valid Cash Advance  Charges Charges Percentage");
	document.creditfrm.cash_advance_charges_percentage.focus();
	document.creditfrm.cash_advance_charges_percentage.select();
	return false;
	}

if(document.creditfrm.late_payment_charges.value=="")
	{
	alert("Please Enter Late Payment charges ");
	document.creditfrm.late_payment_charges.focus();
	document.creditfrm.late_payment_charges.select();
	return false;
	}
	 if(IsString(document.creditfrm.late_payment_charges.value))
	{
	alert("Please Enter Valid Late Payment charges");
	document.creditfrm.late_payment_charges.focus();
	document.creditfrm.late_payment_charges.select();
	return false;
	}


if(document.creditfrm.cheque_bounce_charges.value=="")
	{
	alert("Please Enter Late Payment charges ");
	document.creditfrm.cheque_bounce_charges.focus();
	document.creditfrm.cheque_bounce_charges.select();
	return false;
	}
	 if(IsString(document.creditfrm.cheque_bounce_charges.value))
	{
	alert("Please Enter Valid Late Payment charges");
	document.creditfrm.cheque_bounce_charges.focus();
	document.creditfrm.cheque_bounce_charges.select();
	return false;
	}

if(document.creditfrm.card_replace_charges.value=="")
	{
	alert("Please Enter Card Replace charges ");
	document.creditfrm.card_replace_charges.focus();
	document.creditfrm.card_replace_charges.select();
	return false;
	}
	 if(IsString(document.creditfrm.card_replace_charges.value))
	{
	alert("Please Enter Valid Card Replace charges");
	document.creditfrm.card_replace_charges.focus();
	document.creditfrm.card_replace_charges.select();
	return false;
	}

   if(document.creditfrm.dial_a_draft_charges.value=="")
	{
	alert("Please Enter Draft charges ");
	document.creditfrm.dial_a_draft_charges.focus();
	document.creditfrm.dial_a_draft_charges.select();
	return false;
	}
	 if(IsString(document.creditfrm.dial_a_draft_charges.value))
	{
	alert("Please Enter Valid Draft charges ");
	document.creditfrm.dial_a_draft_charges.focus();
	document.creditfrm.dial_a_draft_charges.select();
	return false;
	}


 if(document.creditfrm.foreign_currency_charges.value=="")
	{
	alert("Please Enter Foreign Currency charges ");
	document.creditfrm.foreign_currency_charges.focus();
	document.creditfrm.foreign_currency_charges.select();
	return false;
	}
	 if(IsString(document.creditfrm.foreign_currency_charges.value))
	{
	alert("Please Enter Valid Foreign Currency charges ");
	document.creditfrm.foreign_currency_charges.focus();
	document.creditfrm.foreign_currency_charges.select();
	return false;
	}

 if(document.creditfrm.balance_transfer_interest_in_percentage.value=="")
	{
	alert("Please Enter Balance Transfer Interest ");
	document.creditfrm.balance_transfer_interest_in_percentage.focus();
	document.creditfrm.balance_transfer_interest_in_percentage.select();
	return false;
	}
	 if(IsString(document.creditfrm.balance_transfer_interest_in_percentage.value))
	{
	alert("Please Enter Valid Balance Transfer Interest ");
	document.creditfrm.balance_transfer_interest_in_percentage.focus();
	document.creditfrm.balance_transfer_interest_in_percentage.select();
	return false;
	}

	if(document.creditfrm.Provider_url.value=="")
	{
	 alert("Please Enter Icon URL ");
	 document.creditfrm.Provider_url.focus();
	 document.creditfrm.Provider_url.select();
	 return false;
	}
	if(!isUrl(document.creditfrm.Provider_url.value))
	{
	  alert("Please,Enter Valid Provider Url");
	  document.creditfrm.Provider_url.focus();
	  document.creditfrm.Provider_url.select();
	  return false;
	}
	/*if(document.creditfrm.detail_url.value=="")
	{
	 alert("Please Enter Detail URL ");
	 document.creditfrm.detail_url.focus();
	 document.creditfrm.detail_url.select();
	 return false;
	}*/
	/*if(document.creditfrm.detail_url.value!="")
	{
		if(!isUrl(document.creditfrm.detail_url.value))
		{
		  alert("Please,Enter Valid Detail Url");
		  document.creditfrm.detail_url.focus();
		  document.creditfrm.detail_url.select();
		  return false;
		}
	}*/


}




//========== Validation Function For Bank ====================//


function validate_bank()
{
	
/*	
 if(document.bankfrm.bank_name.value=="")
	{
	alert("Please Enter Bank Name ");
	document.bankfrm.bank_name.focus();
	document.bankfrm.bank_name.select();
	return false;
	}
    if(document.bankfrm.apply_type.selectedIndex!=0)
	{
		if(document.bankfrm.bank_url.value=="")
		{
		alert("Please Enter Bank URL ");
		document.bankfrm.bank_url.focus();
		document.bankfrm.bank_url.select();
		return false;
		}
	}

 	if(document.bankfrm.minimum_amount.value=="")
	{
	alert("Please Enter Minimum Amount ");
	document.bankfrm.minimum_amount.focus();
	document.bankfrm.minimum_amount.select();
	return false;
	}

    if(IsString(document.bankfrm.minimum_amount.value))
	{
	alert("Please Enter Valid Minimum Amount");
	document.bankfrm.minimum_amount.focus();
	document.bankfrm.minimum_amount.select();
	return false;
	}
   
   if(document.bankfrm.maximum_amount.value=="")
	{
	alert("Please Enter Maximum Amount ");
	document.bankfrm.maximum_amount.focus();
	document.bankfrm.maximum_amount.select();
	return false;
	}

    if(IsString(document.bankfrm.maximum_amount.value))
	{
	alert("Please Enter Valid Maximum Amount");
	document.bankfrm.maximum_amount.focus();
	document.bankfrm.maximum_amount.select();
	return false;
	}
if(document.bankfrm.interest_rate.value=="")
	{
	alert("Please Enter Interest Rate ");
	document.bankfrm.interest_rate.focus();
	document.bankfrm.interest_rate.select();
	return false;
	}

    if(IsString(document.bankfrm.interest_rate.value))
	{
	alert("Please Enter Valid Interest Rate");
	document.bankfrm.interest_rate.focus();
	document.bankfrm.interest_rate.select();
	return false;
	}
if(document.bankfrm.monthly_fee.value=="")
	{
	alert("Please Enter Monthly Fee ");
	document.bankfrm.monthly_fee.focus();
	document.bankfrm.monthly_fee.select();
	return false;
	}

    if(IsString(document.bankfrm.monthly_fee.value))
	{
	alert("Please Enter Valid Monthly Fee");
	document.bankfrm.monthly_fee.focus();
	document.bankfrm.monthly_fee.select();
	return false;
	}
if(document.bankfrm.minimum_balance.value=="")
	{
	alert("Please Enter Minimum Balance ");
	document.bankfrm.minimum_balance.focus();
	document.bankfrm.minimum_balance.select();
	return false;
	}

    if(IsString(document.bankfrm.minimum_balance.value))
	{
	alert("Please Enter Valid Minimum Balance");
	document.bankfrm.minimum_balance.focus();
	document.bankfrm.minimum_balance.select();
	return false;
	}
if(document.bankfrm.features.value=="")
	{
	alert("Please Enter Bank Features ");
	document.bankfrm.features.focus();
	document.bankfrm.features.select();
	return false;
	}
	if(document.bankfrm.details.value=="")
	{
	alert("Please Enter Bank Details ");
	document.bankfrm.details.focus();
	document.bankfrm.details.select();
	return false;
	}
	*/

	
}

//====================== Validation Function For New Account on user side====//
function validate_new_account()
{
 /*
 if(document.newaccountfrm.account_type.value=="")
	{
	alert("Please Select The Account Type ");
	document.newaccountfrm.account_type.focus();
	document.newaccountfrm.account_type.select();
	return false;
	}
	*/
if(document.newaccountfrm.maximum_amounts.value=="")
	{
	alert("Please Enter Maximum Amount ");
	document.newaccountfrm.maximum_amounts.focus();
	document.newaccountfrm.maximum_amounts.select();
	return false;
	}
if(IsString(document.newaccountfrm.maximum_amounts.value))
	{
	alert("Please Enter Valid Maximum Amount");
	document.newaccountfrm.maximum_amounts.focus();
	document.newaccountfrm.maximum_amounts.select();
	return false;
	}

  if(document.newaccountfrm.minimum_amounts.value=="")
	{
	alert("Please Enter Minimum Amount ");
	document.newaccountfrm.minimum_amounts.focus();
	document.newaccountfrm.minimum_amounts.select();
	return false;
	}

if(IsString(document.newaccountfrm.minimum_amounts.value))
	{
	alert("Please Enter Valid Minimum Amount");
	document.newaccountfrm.minimum_amounts.focus();
	document.newaccountfrm.minimum_amounts.select();
	return false;
	}
	//========== This is For Image Button ========
	document.newaccountfrm.btnsubmit.value="Compare";
	
}
//======================= End Of Function=============================//


//========== Validation Function For Mobile Phone ====================//


function validate_Mobilephone()
{
	
	
 /*if(document.mobilephone.mobile_name.value=="")
	{
	alert("Please Enter Mobile Name ");
	document.mobilephone.mobile_name.focus();
	document.mobilephone.mobile_name.select();
	return false;
	}
	if (document.mobilephone.mobile_carrier.value == "") {
		alert("Please Enter Carrier Name");
		document.mobilephone.mobile_carrier.focus();
		document.mobilephone.mobile_carrier.select();
	}
   if(document.mobilephone.mobileimg.value=="")
	{
	alert("Please Enter Mobile Image ");
	document.mobilephone.mobileimg.focus();
	document.mobilephone.mobileimg.select();
	return false;
	}
    
	if(document.mobilephone.Mob_manufacture.value=="")
	{
	alert("Please Enter Manufacture name ");
	document.mobilephone.Mob_manufacture.focus();
	document.mobilephone.Mob_manufacture.select();
	return false;
	}

 	if(document.mobilephone.Mob_modelno.value=="")
	{
	alert("Please Enter Model number ");
	document.mobilephone.Mob_modelno.focus();
	document.mobilephone.Mob_modelno.select();
	return false;
	}

    if(document.mobilephone.Mob_form.value == '')
	{
	alert("Please Enter Form name");
	document.mobilephone.Mob_form.focus();
	document.mobilephone.Mob_form.select();
	return false;
	}
   
   if(document.mobilephone.Mob_dimension.value=="")
	{
	alert("Please Enter Dimension ");
	document.mobilephone.Mob_dimension.focus();
	document.mobilephone.Mob_dimension.select();
	return false;
	}

    if(document.mobilephone.Mob_weight.value == '')
	{
	alert("Please Enter Weight");
	document.mobilephone.Mob_weight.focus();
	document.mobilephone.Mob_weight.select();
	return false;
	}
if(document.mobilephone.Mob_sarlevel.value=="")
	{
	alert("Please Enter SAR level ");
	document.mobilephone.Mob_sarlevel.focus();
	document.mobilephone.Mob_sarlevel.select();
	return false;
	}

    if(document.mobilephone.Mob_talktime.value == '')
	{
	alert("Please Enter Talk Time");
	document.mobilephone.Mob_talktime.focus();
	document.mobilephone.Mob_talktime.select();
	return false;
	}
if(document.mobilephone.Mob_standtime.value=="")
	{
	alert("Please Enter Stand time");
	document.mobilephone.Mob_standtime.focus();
	document.mobilephone.Mob_standtime.select();
	return false;
	}

    if(document.mobilephone.Mob_displaysize.value == '')
	{
	alert("Please Enter Display size");
	document.mobilephone.Mob_displaysize.focus();
	document.mobilephone.Mob_displaysize.select();
	return false;
	}
if(document.mobilephone.Mob_screentype.value=="")
	{
	alert("Please Enter Screen Type ");
	document.mobilephone.Mob_screentype.focus();
	document.mobilephone.Mob_screentype.select();
	return false;
	}

    if(document.mobilephone.Mob_bands.value == '')
	{
	alert("Please Enter Mobile band");
	document.mobilephone.Mob_bands.focus();
	document.mobilephone.Mob_bands.select();
	return false;
	}
if(document.mobilephone.Mob_operatingsys.value=="")
	{
	alert("Please Enter operating system");
	document.mobilephone.Mob_operatingsys.focus();
	document.mobilephone.Mob_operatingsys.select();
	return false;
	}
	if(document.mobilephone.Mob_price.value=="")
	{
	alert("Please Enter Price ");
	document.mobilephone.Mob_price.focus();
	document.mobilephone.Mob_price.select();
	return false;
	}

	*/
}

//============== End Of Function =============================//

//============= Validation Function For Gas & Electricity Supplier========//


function validate_ge_supplier()
{

	 /*if(document.supplierfrm.supplier_name.value=="")
	 {
	  alert("Please,Enter Supplier Name");
	  document.supplierfrm.supplier_name.focus();
	  document.supplierfrm.supplier_name.select();
	  return false;
	 
	 }

	 if(IsNumeric1(document.supplierfrm.supplier_name.value))
	 {
	  alert("Please Enter Valid Supplier Name");
	  document.supplierfrm.supplier_name.focus();
	  document.supplierfrm.supplier_name.select();
	   return false;
	 }
 if(document.supplierfrm.apply_type.selectedIndex!=0)
	{
		 if(document.supplierfrm.supplier_url.value=="")
		 {
		  alert("Please,Enter Supplier Url");
		  document.supplierfrm.supplier_url.focus();
		  document.supplierfrm.supplier_url.select();
		  return false;
		 
		 }
	}

	 if(!isUrl(document.supplierfrm.supplier_url.value))
	 {
	  alert("Please,Enter Valid Supplier Url");
	  document.supplierfrm.supplier_url.focus();
	  document.supplierfrm.supplier_url.select();
	  return false;
	 
	 }
	
		if(document.supplierfrm.supplier_email.value=="")
		{
		alert("Please Enter Email ");
		document.supplierfrm.supplier_email.focus();
		document.supplierfrm.supplier_email.select();
		return false;
		}
    
	 if(!valid_email(document.supplierfrm.supplier_email.value))
	  {
		alert('Please Enter Valid Email ,Try again!');
		
		document.supplierfrm.supplier_email.focus();
		document.supplierfrm.supplier_email.select();
		return false;
	  }
       if(IsString(document.supplierfrm.phone.value))
	  {
		alert('Please Enter Valid Phone Number,Try again!');
		
		document.supplierfrm.phone.focus();
		document.supplierfrm.phone.select();
		return false;
	  }

       if((document.supplierfrm.supply_product.selectedIndex)==0)
	  {
		alert('Please Select Supplier Product,Try again!');
		
		return false;
	  }

*/
}

//================ End Of Function ===================================//


//==================== Validation Function For  Plan benifit =========//

function validate_plan_benefit()
{
      if((document.plan_benefit_frm.plan.selectedIndex)==0)
	  {
		alert('Please Select Select plan,Try again!');
		
		return false;
	  }
	 if(document.plan_benefit_frm.paper_bill.value=="")
	 {
	  alert("Please,Enter Paper Bill");
	  document.plan_benefit_frm.paper_bill.focus();
	  document.plan_benefit_frm.paper_bill.select();
	  return false;
	 
	 }

	 if(IsString(document.plan_benefit_frm.paper_bill.value))
	 {
	  alert("Please Enter Valid Paper Bill");
	  document.plan_benefit_frm.paper_bill.focus();
	  document.plan_benefit_frm.paper_bill.select();
	   return false;
	 }

     if(document.plan_benefit_frm.online_ebill.value=="")
	 {
	  alert("Please,Enter Online E-bill");
	  document.plan_benefit_frm.online_ebill.focus();
	  document.plan_benefit_frm.online_ebill.select();
	  return false;
	 
	 }

	 if(IsString(document.plan_benefit_frm.online_ebill.value))
	 {
	  alert("Please,Enter Valid Online E-bill");
	  document.plan_benefit_frm.online_ebill.focus();
	  document.plan_benefit_frm.online_ebill.select();
	  return false;
	 
	 }
	
		if(document.plan_benefit_frm.billing_level.value=="")
		{
		alert("Please Enter Itemised Billing Level ");
		document.plan_benefit_frm.billing_level.focus();
		document.plan_benefit_frm.billing_level.select();
		return false;
		}
    
	 if(IsString(document.plan_benefit_frm.billing_level.value))
	  {
		alert('Please Enter Valid Itemised Billing Level');
		
		document.plan_benefit_frm.billing_level.focus();
		document.plan_benefit_frm.billing_level.select();
		return false;
	  }
	  if(document.plan_benefit_frm.account_online.value=="")
		{
		alert("Please Enter Account Online ");
		document.plan_benefit_frm.account_online.focus();
		document.plan_benefit_frm.account_online.select();
		return false;
		}
    
	 if(IsString(document.plan_benefit_frm.account_online.value))
	  {
		alert('Please Enter Valid Account Online');
		
		document.plan_benefit_frm.account_online.focus();
		document.plan_benefit_frm.account_online.select();
		return false;
	  }
       if(document.plan_benefit_frm.recent_calls.value=="")
		{
		alert("Please Enter  Recent Calls ");
		document.plan_benefit_frm.recent_calls.focus();
		document.plan_benefit_frm.recent_calls.select();
		return false;
		}
    
	 if(IsString(document.plan_benefit_frm.recent_calls.value))
	  {
		alert('Please Enter Valid Recent Calls');
		
		document.plan_benefit_frm.recent_calls.focus();
		document.plan_benefit_frm.recent_calls.select();
		return false;
	  }
	  if(document.plan_benefit_frm.past_bills.value=="")
		{
		alert("Please Enter  Past Bills ");
		document.plan_benefit_frm.past_bills.focus();
		document.plan_benefit_frm.past_bills.select();
		return false;
		}
    
	 if(IsString(document.plan_benefit_frm.past_bills.value))
	  {
		alert('Please Enter Valid Past Bills');
		
		document.plan_benefit_frm.past_bills.focus();
		document.plan_benefit_frm.past_bills.select();
		return false;
	  }
	  if(document.plan_benefit_frm.available_for_months.value=="")
		{
		alert("Please Enter Available For Months ");
		document.plan_benefit_frm.available_for_months.focus();
		document.plan_benefit_frm.available_for_months.select();
		return false;
		}
    
	 if(IsString(document.plan_benefit_frm.available_for_months.value))
	  {
		alert('Please Enter Valid Available For Months');
		
		document.plan_benefit_frm.available_for_months.focus();
		document.plan_benefit_frm.available_for_months.select();
		return false;
	  }
	  if(document.plan_benefit_frm.update_services.value=="")
		{
		alert("Please Enter Update Services ");
		document.plan_benefit_frm.update_services.focus();
		document.plan_benefit_frm.update_services.select();
		return false;
		}
    
	 if(IsString(document.plan_benefit_frm.update_services.value))
	  {
		alert('Please Enter Valid Update Services');
		
		document.plan_benefit_frm.update_services.focus();
		document.plan_benefit_frm.update_services.select();
		return false;
	  }
	  



}

//================ End Of Function ===================================//



//==================== Validation Function For Supplier Plan =========//
function validate_ge_supplier_plan()
{
	

	/* if(document.supplier_planfrm.supplier.selectedIndex==0)
	 {
	  alert("Please,Select Supplier Name");
	 
	  return false;
	 
	 }

	 if(document.supplier_planfrm.supply_product.selectedIndex==0)
	 {
	  alert("Please,Select Supplier Product");
	 
	  return false;
	 
	 }

	 if(document.supplier_planfrm.plan_name.value=="")
	 {
	  alert("Please,Enter Plan Name");
	  document.supplier_planfrm.plan_name.focus();
	  document.supplier_planfrm.plan_name.select();
	  return false;
	 
	 }

	 if(IsNumeric1(document.supplier_planfrm.plan_name.value))
	 {
	   alert("Please Enter Valid Plan Name");
	   document.supplier_planfrm.plan_name.focus();
	   document.supplier_planfrm.plan_name.select();
	   return false;
	 }

	 if(document.supplier_planfrm.plan_type.selectedIndex==0)
	 {
	  alert("Please,Select Plan Type");
	 
	  return false;
	 
	 }
	 if(document.supplier_planfrm.plan_features.value=="")
	 {
	  alert("Please,Enter Plan Features");
	  document.supplier_planfrm.plan_features.focus();
	  document.supplier_planfrm.plan_features.select();
	  return false;
	 
	 }
	 if(document.supplier_planfrm.plan_cond.value=="")
	 {
	  alert("Please,Enter Plan Conditions");
	  document.supplier_planfrm.plan_cond.focus();
	  document.supplier_planfrm.plan_cond.select();
	  return false;
	 
	 }
	 if(document.supplier_planfrm.price.value=="")
	 {
	  alert("Please,Enter Price");
	  document.supplier_planfrm.price.focus();
	  document.supplier_planfrm.price.select();
	  return false;
	 
	 }
      */
    

	
}


//========== Validation Function For Telephone Plan ====================//


function validate_Plan()
{
	
	
 if(document.telephoneplan.plan_name.value=="")
	{
		alert("Please Enter Plan Name ");
		document.telephoneplan.plan_name.focus();
		document.telephoneplan.plan_name.select();
		return false;
	}
   if(document.telephoneplan.supplier.value== 0)
	{
		alert("Please select Supplier Name");
		document.telephoneplan.supplier.focus();		
		return false;
	}
	if(document.telephoneplan.network_name.value=="")
	{
		alert("Please Enter Network Name");
		document.telephoneplan.network_name.focus();
		document.telephoneplan.network_name.select();
		return false;
	}
    
	if(document.telephoneplan.image.value=="")
	{
		alert("Please Enter company logo ");
		document.telephoneplan.image.focus();
		document.telephoneplan.image.select();
		return false;
	}

 	if(document.telephoneplan.plan_type.value=="")
	{
		alert("Please Enter the Plan type ");
		document.telephoneplan.plan_type.focus();
		document.telephoneplan.plan_type.select();
		return false;
	}

    if(document.telephoneplan.annualsaving.value == '')
	{
		alert("Please Enter the Annual saving");
		document.telephoneplan.annualsaving.focus();
		document.telephoneplan.annualsaving.select();
		return false;
	}
   
   if(document.telephoneplan.annualprice.value=="")
	{
		alert("Please Enter the Annual Price ");
		document.telephoneplan.annualprice.focus();
		document.telephoneplan.annualprice.select();
		return false;
	}


   
	
}

//============== End Of Function =============================//


//========== Validation Function For loan  ====================//


function validate_loan()
{
	
	
 if(document.frmloan.bank_name.value =="")
	{
		alert("Please Enter Bank Name ");
		document.frmloan.bank_name.focus();
		document.frmloan.bank_name.select();
		return false;
		
	}
	if(IsNumeric1(document.frmloan.bank_name.value))
	 {
	   alert("Please Enter Valid Bank Name");
	   document.frmloan.bank_name.focus();
	   document.frmloan.bank_name.select();
	   return false;
	 }
	if(document.frmloan.apply_type.selectedIndex == 0)
	{
		alert ( "Please select Apply Option" );

        return false;
	}

if(document.frmloan.icon_url.value =="")
	{
		alert("Please Enter Icon URL ");
		document.frmloan.icon_url.focus();
		document.frmloan.icon_url.select();
		return false;
		return false;
	}
	if(!isUrl(document.frmloan.icon_url.value))
	 {
	  alert("Please,Enter Valid Icon URL");
	  document.frmloan.icon_url.focus();
	  document.frmloan.icon_url.select();
	  return false;
	 
	 }
	/*if(document.frmloan.detail_url.value =="")
	{
		alert("Please Enter Detail URL ");
		document.frmloan.detail_url.focus();
		document.frmloan.detail_url.select();
		return false;
		return false;
	}
	*/
	if(document.frmloan.detail_url.value !="")
	{
	if(!isUrl(document.frmloan.detail_url.value))
	 {
	  alert("Please,Enter Valid Detail URL ");
	  document.frmloan.detail_url.focus();
	  document.frmloan.detail_url.select();
	  return false;
	 
	 }
	}
   if(document.frmloan.loan_type.selectedIndex == 0)
	{
		alert ( "Please select Loan Type" );
        return false;
	}
	if(document.frmloan.typical_apr.value=="")
	{
		alert("Please Enter Typical APR");
		document.frmloan.typical_apr.focus();
		document.frmloan.typical_apr.select();
		return false;
	}
	if(IsString(document.frmloan.typical_apr.value))
	  {
		alert('Please Enter Valid Typical APR');
		
		document.frmloan.typical_apr.focus();
		document.frmloan.typical_apr.select();
		return false;
	  }
    
	if(document.frmloan.early_charge.value=="")
	{
		alert("Please Enter Early Charge ");
		document.frmloan.early_charge.focus();
		document.frmloan.early_charge.select();
		return false;
	}
	if(IsString(document.frmloan.early_charge.value))
	  {
		alert('Please Enter Valid Early Charge');
		
		document.frmloan.early_charge.focus();
		document.frmloan.early_charge.select();
		return false;
	  }

 	if(document.frmloan.min_term.value=="")
	{
		alert("Please Enter Minimum term ");
		document.frmloan.min_term.focus();
		document.frmloan.min_term.select();
		return false;
	}
	if(IsString(document.frmloan.min_term.value))
	  {
		alert('Please Enter Valid Minimum term');
		
		document.frmloan.min_term.focus();
		document.frmloan.min_term.select();
		return false;
	  }

    if(document.frmloan.max_term.value == '')
	{
		alert("Please Enter Maximum term");
		document.frmloan.max_term.focus();
		document.frmloan.max_term.select();
		return false;
	}
	if(IsString(document.frmloan.max_term.value))
	  {
		alert('Please Enter Valid Maximum term');
		
		document.frmloan.max_term.focus();
		document.frmloan.max_term.select();
		return false;
	  }

   
   if(document.frmloan.min_advance.value=="")
	{
		alert("Please Enter Minimum advance ");
		document.frmloan.min_advance.focus();
		document.frmloan.min_advance.select();
		return false;
	} 
	if(IsString(document.frmloan.min_advance.value))
	  {
		alert('Please Enter Valid Minimum advance');
		
		document.frmloan.min_advance.focus();
		document.frmloan.min_advance.select();
		return false;
	  }
	if(document.frmloan.max_advance.value=="")
	{
		alert("Please Enter Maximum advance ");
		document.frmloan.max_advance.focus();
		document.frmloan.max_advance.select();
		return false;
	} 
	if(IsString(document.frmloan.max_advance.value))
	  {
		alert('Please Enter Valid Maximum advance');
		
		document.frmloan.max_advance.focus();
		document.frmloan.max_advance.select();
		return false;
	  }
	if(document.frmloan.min_age.value=="")
	{
		alert("Please Enter Minimum age");
		document.frmloan.min_age.focus();
		document.frmloan.min_age.select();
		return false;
	} 
	if(IsString(document.frmloan.min_age.value))
	  {
		alert('Please Enter Valid Minimum age');
		
		document.frmloan.min_age.focus();
		document.frmloan.min_age.select();
		return false;
	  }
	
	if(document.frmloan.fund.value=="")
	{
		alert("Please Enter Funded by ");
		document.frmloan.fund.focus();
		document.frmloan.fund.select();
		return false;
	} if(document.frmloan.address.value=="")
	{
		alert("Please Enter Address");
		document.frmloan.address.focus();
		document.frmloan.address.select();
		return false;
	} if(document.frmloan.apr_type.value=="")
	{
		alert("Please Enter APR type ");
		document.frmloan.apr_type.focus();
		document.frmloan.apr_type.select();
		return false;
	} if(document.frmloan.loan_fee.value=="")
	{
		alert("Please Enter Loan fee ");
		document.frmloan.loan_fee.focus();
		document.frmloan.loan_fee.select();
		return false;
	} if(document.frmloan.optional_payment.value=="")
	{
		alert("Please Enter Optional payment protection");
		document.frmloan.optional_payment.focus();
		document.frmloan.optional_payment.select();
		return false;
	} if(document.frmloan.loan_feature.value=="")
	{
		alert("Please Enter Loan features");
		document.frmloan.loan_feature.focus();
		document.frmloan.loan_feature.select();
		return false;
	}
	
}

//============== End Of Function =============================//

//========== Validation Function For Supplier on Telephone Module ====================//


function validate_Supplier()
{
	
	
 if(document.supplier.suppy_name.value=="")
	{
	alert("Please Enter Supplier Name ");
	document.supplier.suppy_name.focus();
	document.supplier.suppy_name.select();
	return false;
	}
   /*if(document.supplier.suppy_Email.value=="")
	{
	alert("Please Enter Email Address");
	document.supplier.suppy_Email.focus();
	document.supplier.suppy_Email.select();
	return false;
	}
     */
	if(ValidateEmail(document.supplier.suppy_Email)==false){
		return false;
	}
	if(document.supplier.suppy_phone.value=="")
	{
	alert("Please Enter Phone number");
	document.supplier.suppy_phone.focus();
	document.supplier.suppy_phone.select();
	return false;
	}

 	if(document.supplier.suppy_address.value=="")
	{
	alert("Please Enter Address ");
	document.supplier.suppy_address.focus();
	document.supplier.suppy_address.select();
	return false;
	}

    if(document.supplier.suppy_postcode.value == '')
	{
	alert("Please Enter Postcode name");
	document.supplier.suppy_postcode.focus();
	document.supplier.suppy_postcode.select();
	return false;
	}
   
   if(document.supplier.suppy_product.value=="")
	{
	alert("Please Enter Supply Product ");
	document.supplier.suppy_product.focus();
	document.supplier.suppy_product.select();
	return false;
	}

    if(document.supplier.area_distribution.value == '')
	{
	alert("Please Enter Area of distribution");
	document.supplier.area_distribution.focus();
	document.supplier.area_distribution.select();
	return false;
	}

	
}

//============== End Of Function =============================//





//========== Validation Function For Mobile Deals ====================//


function validate_MobileDeal()
{
 if(document.mobiledeal.deal_name.value=="")
	{
		alert("Please Enter Deal Name");
		document.mobiledeal.deal_name.focus();
		document.mobiledeal.deal_name.select();
		return false;
	}

	if(document.mobiledeal.site_url.value=="")
	{
		alert("Please Enter the Site URL ");
		document.mobiledeal.site_url.focus();
		document.mobiledeal.site_url.select();
		return false;
	}
  	if(document.mobiledeal.modelno.value=="")
	{
		alert("Please Select the Model Number ");
		document.mobiledeal.modelno.focus();
		document.mobiledeal.modelno.select();
		return false;
	}
	
}

//============== End Of Function =============================//




//========== Validation Function For Security Question ========// 

function validate_question()
{

 if(document.questionfrm.que.value =="")
	{
	alert("Please Enter Security Question");
	document.questionfrm.que.focus();
	document.questionfrm.que.select();
	return false;
	}
	 
	if(IsNumeric1(document.questionfrm.que.value))
	{
	alert("Please Enter Valid Security Question");
	document.questionfrm.que.focus();
	document.questionfrm.que.select();
	return false;
	}

}

//========== Validation Function For Credit Card Offer ========// 
function validate_credit_off()
{
  if(document.creditoff_frm.method2.value=="")
	{
      alert("Please Select Cash back Avilable");
	document.creditoff_frm.method2.focus();
	document.creditoff_frm.method2.select();
	return false;
    
    }

	if(document.creditoff_frm.cash_back_percentage.value=="")
	{
      alert("Please Enter Cash Back Percentage");
	document.creditoff_frm.cash_back_percentage.focus();
	document.creditoff_frm.cash_back_percentage.select();
	return false;
    
    }
   
     if(document.creditoff_frm.cash_back_min_transaction.value=="")
	{
      alert("Please Enter Cash Back Min. Transaction");
	document.creditoff_frm.cash_back_min_transaction.focus();
	document.creditoff_frm.cash_back_min_transaction.select();
	return false;
    
    }

     if(document.creditoff_frm.reward_points_per_spend.value=="")
	{
      alert("Please Enter Reward point Per Spend");
	document.creditoff_frm.reward_points_per_spend.focus();
	document.creditoff_frm.reward_points_per_spend.select();
	return false;
    
    }
     if(document.creditoff_frm.reward_point_spend_amount.value=="")
	{
      alert("Please Enter eward point  Spend Amount");
	document.creditoff_frm.reward_point_spend_amount.focus();
	document.creditoff_frm.reward_point_spend_amount.select();
	return false;
    
    }
 if(document.creditoff_frm.bt_offer_period_in_months.value=="")
	{
      alert("Please Enter Offer period  in Month");
	document.creditoff_frm.bt_offer_period_in_months.focus();
	document.creditoff_frm.bt_offer_period_in_months.select();
	return false;
    
    }
	if(document.creditoff_frm.bt_offer_charges.value=="")
	{
      alert("Please Enter Offer Charges");
	document.creditoff_frm.bt_offer_charges.focus();
	document.creditoff_frm.bt_offer_charges.select();
	return false;
    
    }
	if(document.creditoff_frm.bt_interest_for_offer_period.value=="")
	{
      alert("Please Enter Interest For offer Period");
	document.creditoff_frm.bt_interest_for_offer_period.focus();
	document.creditoff_frm.bt_interest_for_offer_period.select();
	return false;
    
    }
	if(document.creditoff_frm.bt_interest_after_offer_period.value=="")
	{
      alert("Please Enter Interest For After offer Period");
	document.creditoff_frm.bt_interest_after_offer_period.focus();
	document.creditoff_frm.bt_interest_after_offer_period.select();
	return false;
    
    }

    if(document.creditoff_frm.special_offers.value=="")
	{
      alert("Please Enter Special offer");
	document.creditoff_frm.special_offers.focus();
	document.creditoff_frm.special_offers.select();
	return false;
    
    }


}

//==================== Validation Function For Site Setting===========//

function validate_site()
{


	if(document.sfrm.admin_name.value=='')
	{
		alert("Please enter the admin name");
		document.sfrm.admin_name.select();
		document.sfrm.admin_name.focus();
		return false;
	}
	if(document.sfrm.admin_password.value=='')
	{
		alert("Please enter the admin password");
		document.sfrm.admin_password.select();
		document.sfrm.admin_password.focus();
		return false;
	}
	if(document.sfrm.admin_email.value=='')
	{
		alert("Please enter the admin email");
		document.sfrm.admin_email.select();
		document.sfrm.admin_email.focus();
		return false;
	}
    if(document.sfrm.site_title.value=='')
	{ 
	  
		alert("Please enter the site  title");
		document.sfrm.site_title.select();
		document.sfrm.site_title.focus();
		return false;
	}
	if(document.sfrm.user_records_per_page.value=='')
	{
		alert("Please enter the user side records per page");
		document.sfrm.user_records_per_page.select();
		document.sfrm.user_records_per_page.focus();
		return false;
	}
	if(document.sfrm.admin_records_per_page.value=='')
	{
		alert("Please enter the admin side records per page");
		document.sfrm.admin_records_per_page.select();
		document.sfrm.admin_records_per_page.focus();
		return false;
	}
	if(IsNumeric(document.sfrm.admin_name.value))
	{
	 alert("Enter Only character value");
	 document.sfrm.admin_name.select();
	document.sfrm.admin_name.focus();
	return false;
	}
	
	if(!valid_email(document.sfrm.admin_email.value))
	{	
		alert("Please enter the valid admin email");
		document.sfrm.admin_email.select();
		document.sfrm.admin_email.focus();
		return false;
	}
	
	if(IsNumeric(document.sfrm.site_title.value))
	{
	 alert("Enter Only charecter value");
	 document.sfrm.site_title.select();
	document.sfrm.site_title.focus();
	return false;
	}
	if(isNaN(document.sfrm.user_records_per_page.value))
	{
		alert("user side records per page must be a numeric value");
		document.sfrm.user_records_per_page.select();
		document.sfrm.user_records_per_page.focus();
		return false;
	}
	if(isNaN(document.sfrm.admin_records_per_page.value))
	{
		alert("admin side records per page must be a numeric value");
		document.sfrm.admin_records_per_page.select();
		document.sfrm.admin_records_per_page.focus();
		return false;
	}
	
	
	if(IsNegative(document.sfrm.user_records_per_page.value))
	{
	 alert("Enter Only Positive value");
	  document.sfrm.user_records_per_page.select();
		document.sfrm.user_records_per_page.focus();
		return false;
	}
	if(IsString(document.sfrm.user_records_per_page.value))
	{
	 alert("Enter Only Positive value");
	  document.sfrm.user_records_per_page.select();
		document.sfrm.user_records_per_page.focus();
		return false;
	}
	if(IsNegative(document.sfrm.admin_records_per_page.value))
	{
	 alert("Enter Only Positive value");
	  document.sfrm.admin_records_per_page.select();
		document.sfrm.admin_records_per_page.focus();
		return false;
	}
	if(IsString(document.sfrm.admin_records_per_page.value))
	{
	 alert("Enter Only Positive value");
	  document.sfrm.admin_records_per_page.select();
		document.sfrm.admin_records_per_page.focus();
		return false;
	}
}


//=========================== Validation Function For Cms File Edit====
function validate_file()
{
	
	if(document.form1.file_name.value=='')
	{
		alert("Please enter file name");
		document.form1.file_name.select();
		document.form1.file_name.focus();
		return false; 
	}
	if(IsNumeric1(document.form1.file_name.value))
	{
		alert("Only Charecter are valid");
		document.form1.file_name.select();
		document.form1.file_name.focus();
		return false; 
	}
}

//=========================== Validation Function For Cms File Edit====
function validate_page()
{
	
	if(document.form2.page_name.value=='')
	{
		alert("Please enter Page name");
		document.form2.page_name.select();
		document.form2.page_name.focus();
		return false; 
	}
	if(IsNumeric1(document.form2.page_name.value))
	{
		alert("Only Charecter are valid");
		document.form2.page_name.select();
		document.form2.page_name.focus();
		return false; 
	}
	if(document.form2.module_name.selectedIndex==0)
	{
    	alert("Please Select Module");
		return false; 
	
	}
	
	
}

// ================ Validation Function For Email Template=============
function validate_email_template()
 {
  if(document.form1.name.value=='')
    {
	  alert("Please Enter Name");
	  document.form1.name.focus();
	  document.form1.name.select();
	  return false;
	}
	if(document.form1.subject.value=='')
    {
	  alert("Please Enter Subject");
	  document.form1.subject.focus();
	  document.form1.subject.select();
	  return false;
	}
	if(IsNumeric1(document.form1.subject.value))
    {
	  alert("Please Enter charecter value");
	  document.form1.subject.focus();
	  document.form1.subject.select();
	  return false;
	}
 }
 
 function validate_mail(){
	if(document.mailform.to.value=='')
	{	
		alert("Please Select whom to send the mail.");
		return false;
		}
		if(document.mailform.subject.value==''){
			alert("Please Enter the subject.");
			document.mailform.subject.select();
			document.mailform.subject.focus();
			return false;
		}
}



//========== Validation Function For Already register user=======


function validate_register()
{

	if(document.lfrm.email.value =="")
	{
     alert("Please Enter Email Address");
	 document.lfrm.email.focus();
	 document.lfrm.email.select();
	 return false;
    }

 if(!valid_email(document.lfrm.email.value))
	{
		alert('Please Enter Valid Email ,Try again!');
		document.lfrm.email.select();
		document.lfrm.email.focus();
		return false;
	}
   if(document.lfrm.password.value =="")
	{
     alert("Please Enter Password ");
	 document.lfrm.password.focus();
	 document.lfrm.password.select();
	 return false;
    }
}

//======== Validation Function for Ragister User Detail For Bank Module====
 function validate_detail()
 {
	/* if(document.detailfrm.title.value=="Choose One")
    {
	  alert("Please Select Title");
	  document.detailfrm.title.focus();
	  document.detailfrm.title.select();
	  return false;
	}
	*/
   if(document.detailfrm.first_name.value=="")
    {
	  alert("Please Enter First Name");
	  document.detailfrm.first_name.focus();
	  document.detailfrm.first_name.select();
	  return false;
	}

	if(IsNumeric1(document.detailfrm.first_name.value))
    {
	  alert("Please Enter charecter value");
	  document.detailfrm.first_name.focus();
	  document.detailfrm.first_name.select();
	  return false;
	}

    if(document.detailfrm.last_name.value=="")
    {
	  alert("Please Enter Last Name");
	  document.detailfrm.last_name.focus();
	  document.detailfrm.last_name.select();
	  return false;
	}

	if(IsNumeric1(document.detailfrm.last_name.value))
    {
	  alert("Please Enter charecter value");
	  document.detailfrm.last_name.focus();
	  document.detailfrm.last_name.select();
	  return false;
	}

    if(document.detailfrm.email.value=="")
    {
	  alert("Please Enter Email Address");
	  document.detailfrm.email.focus();
	  document.detailfrm.email.select();
	  return false;
	}

    if(!valid_email(document.detailfrm.email.value))
    {
	  alert("Please Enter Valid Email Address");
	  document.detailfrm.email.focus();
	  document.detailfrm.email.select();
	  return false;
	}
 
 
 }



//========= Function used to validate Transfer balance Form=========//

/*function validate_balance()
{

    var balance_transfer=document.balancefrm.bal_to_transfer.value;
	if(balance_transfer=="")
	{
	alert("First Enter Balance Transfer Amount");
	document.balancefrm.bal_to_transfer.focus();
     document.balancefrm.bal_to_transfer.select();
	return false;
	}
	

 if(document.balancefrm.card.value) == "Select One")
	{
     alert("Please Select Credit card");
	 document.balancefrm.card.focus();
	 document.balancefrm.card.select();
	 return false;
    }
	
	
   if(document.balancefrm.repay.value =="")
	{
     alert("Please Enter Repayment Amount");
	 document.balancefrm.repay.focus();
	 document.balancefrm.repay.select();
	 return false;
    }


   if(document.balancefrm.bal_to_transfer.value =="")
	{
     alert("Please Enter Balance to Transfer");
	 document.balancefrm.bal_to_transfer.focus();
	 document.balancefrm.bal_to_transfer.select();
	 return false;
    }

}
*/
/*
var p1 = document.ApplicationForm.c_year_there.value;
if (p1.charAt(0)>=3)
{
document.getElementById('P1').style.display='none';
}

var p2 = document.ApplicationForm.ce_year_there.value;

if (p2.charAt(0)>=3)
{
document.getElementById('P2').style.display='none';
}

//Function to show or hide condo fees
if (document.ApplicationForm.tenure.value=='Condo')
{
showCondo();
}
// DOM3 = IE5, NS6

function showCondo()
{
	 if (document.getElementById) 
	{
		 document.getElementById('Fee1').style.display='block';
		 document.getElementById('Fee2').style.display='block';
		 document.getElementById('Lot1').style.display='none';
		 document.getElementById('Lot2').style.display='none';
	}
}

function hideCondo()
{
if (document.getElementById)
	{
	document.getElementById('Fee1').style.display='none';
	document.getElementById('Fee2').style.display='none';
	document.getElementById('Lot1').style.display='block';
	document.getElementById('Lot2').style.display='block';
	}
}
*/

//================ Validation Function For Mortgage Application==============

function validate_mortgage_application()
{
   if(document.ApplicationForm.first_name.value=="")
    {
	  alert("Please enter your first name.");
	  document.ApplicationForm.first_name.focus();
	  document.ApplicationForm.first_name.select();
	  return false;
	}

	if(IsNumeric1(document.ApplicationForm.first_name.value))
    {
	  alert("Numbers are not permitted in this field.");
	  document.ApplicationForm.first_name.focus();
	  document.ApplicationForm.first_name.select();
	  return false;
	}
	 
	 if(document.ApplicationForm.last_name.value=="")
    {
	  alert("Please enter your last name.");
	  document.ApplicationForm.last_name.focus();
	  document.ApplicationForm.last_name.select();
	  return false;
	}

	if(IsNumeric1(document.ApplicationForm.last_name.value))
    {
	  alert("Numbers are not permitted in this field.");
	  document.ApplicationForm.last_name.focus();
	  document.ApplicationForm.last_name.select();
	  return false;
	}
	
	if (document.ApplicationForm.month.selectedIndex == 0 )
    {
        alert ( "Please select your month of birth." );
        return false;
    }

    // Aron W - Jun-05-2008 - new validation rule for drop down list day of birth
    if (document.ApplicationForm.day.selectedIndex == 0 )
    {
        alert ( "Please select your day of birth." );
        return false;
    }

    //if(document.ApplicationForm.day.value=="")
    //{
	//  alert("Please enter your day of birth.");
	//  document.ApplicationForm.day.focus();
//	  document.ApplicationForm.day.select();
//	  return false;
//	}
	// Aron May-04-2008 if(IsString(document.ApplicationForm.day.value))
//    if(!IsNumeric1(document.ApplicationForm.day.value))
//    {
//      alert("Please enter a valid 2 digit number for your day of birth.");
//      document.ApplicationForm.year.focus();
//      document.ApplicationForm.year.select();
//      return false;
//    }
    if(document.ApplicationForm.year.value=="")
    {
	  alert("Please enter your year of birth.");
	  document.ApplicationForm.year.focus();
	  document.ApplicationForm.year.select();
	  return false;
	}
   // Aron May-04-2008 if(IsString(document.ApplicationForm.year.value))
   if(!IsNumeric1(document.ApplicationForm.year.value))
    {
	  alert("Please enter a valid 4 digit number for your year of birth.");
	  document.ApplicationForm.year.focus();
	  document.ApplicationForm.year.select();
	  return false;
	}
	
  if (document.ApplicationForm.marital_status.selectedIndex == 0 )
    {
        alert ( "Please select your marital status." );
        return false;
    }

	if(document.ApplicationForm.c_street_address.value=="")
    {
	  alert("Please enter your current street address.");
	  document.ApplicationForm.c_street_address.focus();
	  document.ApplicationForm.c_street_address.select();
	  return false;
	}
	if(document.ApplicationForm.c_city.value=="")
    {
	  alert("Please enter your current city.");
	  document.ApplicationForm.c_city.focus();
	  document.ApplicationForm.c_city.select();
	  return false;
	}

	if (document.ApplicationForm.c_prov.selectedIndex == 0 )
    {
        alert ( "Please select your current province of residence." );
        return false;
    }
	
    if(document.ApplicationForm.email.value=="")
    {
	  alert("Please enter your email address.");
	  document.ApplicationForm.email.focus();
	  document.ApplicationForm.email.select();
	  return false;
    }
    
    if(!valid_email(document.ApplicationForm.email.value))
    {
	  alert("Please enter a valid email address.");
	  document.ApplicationForm.email.focus();
	  document.ApplicationForm.email.select();
	  return false;
    }
	
    if( document.ApplicationForm.h_phone_area_code.value == "" )
    {
	  alert("Please enter the area code for your home phone number.");
	  document.ApplicationForm.h_phone_area_code.focus();
	  document.ApplicationForm.h_phone_area_code.select();
	  return false;
    }
    
    if( !IsNumeric1(document.ApplicationForm.h_phone_area_code.value) )
    {
	  alert("Please enter a valid area code for your home phone number.");
	  document.ApplicationForm.h_phone_area_code.focus();
	  document.ApplicationForm.h_phone_area_code.select();
	  return false;
    }
    
    if( document.ApplicationForm.h_phone_1.value == "" )
    {
	  alert("Please enter the first 3 digits of your home phone number.");
	  document.ApplicationForm.h_phone_1.focus();
	  document.ApplicationForm.h_phone_1.select();
	  return false;
    }
    
    if( !IsNumeric1(document.ApplicationForm.h_phone_1.value) )
    {
	  alert("Please enter the first 3 digits of your home phone number.");
	  document.ApplicationForm.h_phone_1.focus();
	  document.ApplicationForm.h_phone_1.select();
	  return false;
    }
    
    if( document.ApplicationForm.h_phone_2.value == "" )
    {
	  alert("Please enter the last 4 digits of your home phone number.");
	  document.ApplicationForm.h_phone_2.focus();
	  document.ApplicationForm.h_phone_2.select();
	  return false;
    }
    
    if( !IsNumeric1(document.ApplicationForm.h_phone_2.value) )
    {
	  alert("Please enter the last 4 digits of your home phone number.");
	  document.ApplicationForm.h_phone_2.focus();
	  document.ApplicationForm.h_phone_2.select();
	  return false;
    }

    //if(document.ApplicationForm.h_phone.value=="")
    //{
//	  alert("Please enter your home phone number including the area code.  No punctuation necessary.");
//	  document.ApplicationForm.h_phone.focus();
//	  document.ApplicationForm.h_phone.select();
//	  return false;
//	}
	// Aron May-04-2008 if(IsString(document.ApplicationForm.h_phone.value))
    //var minDigitsInIPhoneNumber = 10;
    
    // Aron W - Jun-05-2008 - re-added validation rules for 3 field phone number
}
//==================== End Of Function====================//

//================ Validation Function For Insurance Application==============

function validate_insurance_application()
{
   if(document.ApplicationForm.first_name.value=="")
    {
	  alert("Please enter your first name.");
	  document.ApplicationForm.first_name.focus();
	  document.ApplicationForm.first_name.select();
	  return false;
	}

	if(IsNumeric1(document.ApplicationForm.first_name.value))
    {
	  alert("Numbers are not permitted in this field.");
	  document.ApplicationForm.first_name.focus();
	  document.ApplicationForm.first_name.select();
	  return false;
	}
	 
	 if(document.ApplicationForm.last_name.value=="")
    {
	  alert("Please enter your last name.");
	  document.ApplicationForm.last_name.focus();
	  document.ApplicationForm.last_name.select();
	  return false;
	}

	if(IsNumeric1(document.ApplicationForm.last_name.value))
    {
	  alert("Numbers are not permitted in this field.");
	  document.ApplicationForm.last_name.focus();
	  document.ApplicationForm.last_name.select();
	  return false;
	}

	// mdp	june 18, 2008 valid day check
	var year = parseInt(document.ApplicationForm.year.value);
	var month = parseInt(document.ApplicationForm.month.value);
	var day = parseInt(document.ApplicationForm.day.value);
	
	if ((month==4 || month==6 || month==9 || month==11) && day==31) {
		alert("Month "+month+" doesn't have 31 days!");
		return false;
	}

	if (month == 2) { // check for february 29th
		var isleap = (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0));
		if (day > 29 || (day==29 && !isleap)) {
			alert("February " + year + " doesn't have " + day + " days!");
			return false;
		}
	}
	
	// mdp	june 18, 2008	dob check
	var age = 18;
	var year = parseInt(document.ApplicationForm.year.value);
	var month = parseInt(document.ApplicationForm.month.value);
	var day = parseInt(document.ApplicationForm.day.value);

	var theirDate = new Date((year + age), month, day);
	var today = new Date;

	if ( (today.getTime() - theirDate.getTime()) < 0) {
		alert("You must be at least 18 years of age to submit an application.");
		return false;
	}
	
	if (document.ApplicationForm.month.selectedIndex == 0 )
    {
        alert ( "Please select your month of birth." );
        return false;
    }

	if(document.ApplicationForm.day.value=="")
    {
	  alert("Please enter your day of birth.");
	  document.ApplicationForm.day.focus();
	  document.ApplicationForm.day.select();
	  return false;
	}
	// Aron May-04-2008 if(IsString(document.ApplicationForm.day.value))
    if(!IsNumeric1(document.ApplicationForm.day.value))
    {
      alert("Please enter a valid 2 digit number for your day of birth.");
      document.ApplicationForm.year.focus();
      document.ApplicationForm.year.select();
      return false;
    }
    if(document.ApplicationForm.year.value=="")
    {
	  alert("Please enter your year of birth.");
	  document.ApplicationForm.year.focus();
	  document.ApplicationForm.year.select();
	  return false;
	}
   // Aron May-04-2008 if(IsString(document.ApplicationForm.year.value))
   if(!IsNumeric1(document.ApplicationForm.year.value))
    {
	  alert("Please enter a valid 4 digit number for your year of birth.");
	  document.ApplicationForm.year.focus();
	  document.ApplicationForm.year.select();
	  return false;
	}
	
	// mdp	June 18, 2008	add checks for postal code
	if((document.ApplicationForm.c_postal_code_pre.value) && (document.ApplicationForm.c_postal_code_post.value =="")) {
		alert ( "Please enter a full postal code.");
		return false;
	}
	
  if (document.ApplicationForm.marital_status.selectedIndex == 0 )
    {
        alert ( "Please select your marital status." );
        return false;
    }

	if(document.ApplicationForm.c_street_address.value=="")
    {
	  alert("Please enter your current street address.");
	  document.ApplicationForm.c_street_address.focus();
	  document.ApplicationForm.c_street_address.select();
	  return false;
	}
	if(document.ApplicationForm.c_city.value=="")
    {
	  alert("Please enter your current city.");
	  document.ApplicationForm.c_city.focus();
	  document.ApplicationForm.c_city.select();
	  return false;
	}

	//if (document.ApplicationForm.c_prov.selectedIndex == 0 )
    //{
     //   alert ( "Please select your current province of residence." );
      //  return false;
    //}
	
	if(document.ApplicationForm.email.value=="")
    {
	  alert("Please enter your email address.");
	  document.ApplicationForm.email.focus();
	  document.ApplicationForm.email.select();
	  return false;
	}
	if(!valid_email(document.ApplicationForm.email.value))
    {
	  alert("Please enter a valid email address.");
	  document.ApplicationForm.email.focus();
	  document.ApplicationForm.email.select();
	  return false;
	}
	if((document.ApplicationForm.h_phone_area_code.value=="") || (document.ApplicationForm.h_phone_1.value=="") 
		|| (document.ApplicationForm.h_phone_2.value==""))
    {
	  alert("Please enter your home phone number including the area code.  No punctuation necessary.");
	  document.ApplicationForm.h_phone_area_code.focus();
	  document.ApplicationForm.h_phone_area_code.select();
	  return false;
	}
	// Aron May-04-2008 if(IsString(document.ApplicationForm.h_phone.value))
    //var minDigitsInIPhoneNumber = 10;
    
    //if( !IsNumeric1(document.ApplicationForm.h_phone.value) )
    //{
	 // alert("Please enter a valid numeric home telephone number including the area code.");
	 // document.ApplicationForm.h_phone.focus();
	 // document.ApplicationForm.h_phone.select();
	 // return false;
    //}
    
    // Auto Insurance Checks
    if(document.ApplicationForm.auto_insurance.checked) {
    	if((document.ApplicationForm.v1_make.value > "") && (document.ApplicationForm.v1_model.value > "")) {
    		// apply checks
    		if((document.ApplicationForm.v1_vin.value == "") || (document.ApplicationForm.v1_price.value == 0) 
    			|| (document.ApplicationForm.v1_km == 0)) {
    			
    			alert("Please enter in more information about your vehicle (#1).");
	  			document.ApplicationForm.v1_make.focus();
	  			document.ApplicationForm.v1_make.select();
	  			return false;
    			
    		}
    	}
    	
    	if((document.ApplicationForm.v2_make.value > "") && (document.ApplicationForm.v2_model.value > "")) {
    		// apply checks
    		if((document.ApplicationForm.v2_vin.value == "") || (document.ApplicationForm.v2_price.value == 0) 
    			|| (document.ApplicationForm.v2_km == 0)) {
    			
    			alert("Please enter in more information about your vehicle (#2).");
	  			document.ApplicationForm.v2_make.focus();
	  			document.ApplicationForm.v2_make.select();
	  			return false;
    			
    		}
    	}
    	
    	if((document.ApplicationForm.v3_make.value > "") && (document.ApplicationForm.v3_model.value > "")) {
    		// apply checks
    		if((document.ApplicationForm.v3_vin.value == "") || (document.ApplicationForm.v3_price.value == 0) 
    			|| (document.ApplicationForm.v3_km == 0)) {
    			
    			alert("Please enter in more information about your vehicle (#3).");
	  			document.ApplicationForm.v3_make.focus();
	  			document.ApplicationForm.v3_make.select();
	  			return false;
    			
    		}
    	}
    	
    	if((document.ApplicationForm.v4_make.value > "") && (document.ApplicationForm.v4_model.value > "")) {
    		// apply checks
    		if((document.ApplicationForm.v4_vin.value == "") || (document.ApplicationForm.v4_price.value == 0) 
    			|| (document.ApplicationForm.v4_km == 0)) {
    			
    			alert("Please enter in more information about your vehicle (#4).");
	  			document.ApplicationForm.v4_make.focus();
	  			document.ApplicationForm.v4_make.select();
	  			return false;
    			
    		}
    	}
    	
    }
    
    // Property Insurance Checks
    
    if(document.ApplicationForm.property_insurance.checked) {
    	if(document.ApplicationForm.p1_residential_status.value > "") {
			if((document.ApplicationForm.p1_dwelling_type.value == "") || 
			(document.ApplicationForm.p1_mortgage.value == "") ||
			(document.ApplicationForm.p1_CMHC_Lot_Size.value == "") ||
			(document.ApplicationForm.p1_dwelling_style.value == "") ||
			(document.ApplicationForm.p1_garage_size.value == "") ||
			(document.ApplicationForm.p1_CMHC_Square_Footage.value == "") ||
			(document.ApplicationForm.p1_CMHC_Heating_Type.value == "") ||
			(document.ApplicationForm.p1_garage_type.value == "") ||
			(document.ApplicationForm.p1_property_type.value == "")) {
				alert("Please enter more property information for property #1.");
				//document.ApplicationForm.p1_residential_status.focus();
				//document.ApplicationForm.p1_residential_status.select();
				return false;
			}
    	}
    	
    	if(document.ApplicationForm.p2_residential_status.value > "") {
			if((document.ApplicationForm.p2_dwelling_type.value == "") || 
			(document.ApplicationForm.p2_mortgage.value == "") ||
			(document.ApplicationForm.p2_CMHC_Lot_Size.value == "") ||
			(document.ApplicationForm.p2_dwelling_style.value == "") ||
			(document.ApplicationForm.p2_garage_size.value == "") ||
			(document.ApplicationForm.p2_CMHC_Square_Footage.value == "") ||
			(document.ApplicationForm.p2_CMHC_Heating_Type.value == "") ||
			(document.ApplicationForm.p2_garage_type.value == "") ||
			(document.ApplicationForm.p2_property_type.value == "")) {
				alert("Please enter more property information for property #2.");
				//document.ApplicationForm.p2_residential_status.focus();
				//document.ApplicationForm.p2_residential_status.select();
				return false;
			}
    	}
    }
    
    
    // Life Insurance Checks
    if(document.ApplicationForm.life_insurance.checked) {
    	if(document.ApplicationForm.l1_type.value > "") {
    		if((document.ApplicationForm.l1_age.value == 0) || (document.ApplicationForm.l1_coverage.value == 0)) {
    			alert("Please enter more life insurance information for person #1.");
    			//document.ApplicationForm.l1_type.focus();
    			//document.ApplicationForm.l1_type.select();
    			return false;
    		}
    	}
    	
    	if(document.ApplicationForm.l2_type.value > "") {
    		if((document.ApplicationForm.l2_age.value == 0) || (document.ApplicationForm.l2_coverage.value == 0)) {
    			alert("Please enter more life insurance information for person #2.");
    			//document.ApplicationForm.l2_type.focus();
    			//document.ApplicationForm.l2_type.select();
    			return false;
    		}
    	}
    	
    	if(document.ApplicationForm.l3_type.value > "") {
    		if((document.ApplicationForm.l3_age.value == 0) || (document.ApplicationForm.l3_coverage.value == 0)) {
    			alert("Please enter more life insurance information for person #3.");
    			//document.ApplicationForm.l3_type.focus();
    			//document.ApplicationForm.l3_type.select();
    			return false;
    		}
    	}
    	
    	if(document.ApplicationForm.l4_type.value > "") {
    		if((document.ApplicationForm.l4_age.value == 0) || (document.ApplicationForm.l4_coverage.value == 0)) {
    			alert("Please enter more life insurance information for person #4.");
    			//document.ApplicationForm.l4_type.focus();
    			//document.ApplicationForm.l4_type.select();
    			return false;
    		}
    	}
    }
    
    // Travel Insurance Checks
    if(document.ApplicationForm.travel_insurance.checked) {
    	// nothing much to check
    }
}


//==================== End Of Function====================//


//======================= VAlidation function for Mortgage Lender =======//
function validate_Mortgage()
{

 if(document.mortgagefrm.lender.value=="")
 {
  alert("Please Enter Mortgage Lender Name");
  document.mortgagefrm.lender.focus();
  document.mortgagefrm.lender.select();
  return false;
 }
 if(document.mortgagefrm.lender_url.value=="")
 {
  alert("Please Enter Mortgage Lender Url");
  document.mortgagefrm.lender_url.focus();
  document.mortgagefrm.lender_url.select();
  return false;
 }
 if(document.mortgagefrm.variable.value=="")
 {
  alert("Please Enter Mortgage Variable");
  document.mortgagefrm.variable.focus();
  document.mortgagefrm.variable.select();
  return false;
 }
 if(IsString(document.mortgagefrm.variable.value))
 {
  alert("Please Enter valid Mortgage Variable");
  document.mortgagefrm.variable.focus();
  document.mortgagefrm.variable.select();
  return false;
 }
/* if(document.mortgagefrm.6months.value=="")
 {
  alert("Please Enter Mortgage 6 months Variable");
  document.mortgagefrm.6months.focus();
  document.mortgagefrm.6months.select();
  return false;
 }
  if(document.mortgagefrm.1year.value=="")
 {
  alert("Please Enter Mortgage 1 year Variable");
  document.mortgagefrm.1year.focus();
  document.mortgagefrm.1year.select();
  return false;
 }
  if(document.mortgagefrm.2year.value=="")
 {
  alert("Please Enter Mortgage 2 year Variable");
  document.mortgagefrm.2year.focus();
  document.mortgagefrm.2year.select();
  return false;
 }
 if(document.mortgagefrm.3year.value=="")
 {
  alert("Please Enter Mortgage 3 year Variable");
  document.mortgagefrm.3year.focus();
  document.mortgagefrm.3year.select();
  return false;
 }
 if(document.mortgagefrm.4year.value=="")
 {
  alert("Please Enter Mortgage 4 year Variable");
  document.mortgagefrm.4year.focus();
  document.mortgagefrm.4year.select();
  return false;
 }
 if(document.mortgagefrm.5year.value=="")
 {
  alert("Please Enter Mortgage 5 year Variable");
  document.mortgagefrm.5year.focus();
  document.mortgagefrm.5year.select();
  return false;
 }
*/
}
//======================== End Of Function ==============================//

//==================== Banner Validation  Function========//
function validate_banner()
{

 if(document.bannerfrm.banner_name.value=="")
    {
	  alert("Please Enter Banner Name");
	  document.bannerfrm.banner_name.focus();
	  document.bannerfrm.banner_name.select();
	  return false;
	}

	if(IsNumeric1(document.bannerfrm.banner_name.value))
    {
	  alert("Please Enter Only Charecter");
	  document.bannerfrm.banner_name.focus();
	  document.bannerfrm.banner_name.select();
	  return false;
	}
	 if(document.bannerfrm.banner_size.value=="")
    {
	  alert("Please Enter Banner Size");
	  document.bannerfrm.banner_size.focus();
	  document.bannerfrm.banner_size.select();
	  return false;
	}
    if(document.bannerfrm.banner_cost.value=="")
    {
	  alert("Please Enter Banner Cost");
	  document.bannerfrm.banner_cost.focus();
	  document.bannerfrm.banner_cost.select();
	  return false;
	}

	if(IsString(document.bannerfrm.banner_cost.value))
    {
	  alert("Please Enter Only Numeric Value");
	  document.bannerfrm.banner_cost.focus();
	  document.bannerfrm.banner_cost.select();
	  return false;
	}
	if(document.bannerfrm.display_module.selectedIndex ==0)
    {
	   alert("Please Select Module to display Banner");
	   return false;
	}
	if(document.bannerfrm.banner_position.value=="")
    {
	  alert("Please Enter Banner Position");
	  document.bannerfrm.banner_position.focus();
	  document.bannerfrm.banner_position.select();
	  return false;
	}
	
	if (bannerfrm.status.checked==false)
	{
		alert("Please Select Status");
	    return false;
    }  
   /* if(document.bannerfrm.image.value!="")
	{
		var path = new String(document.bannerfrm.image.value)
		var fileName = path.substr(path.lastIndexOf(".")+1);
		var fileName = fileName.toLowerCase();
		if (!(fileName=="jpg" || fileName=="JPG" || fileName=="gif" || fileName=="GIF" || fileName=="jpeg" || fileName=="JPEG" || fileName=="swf"))
		{
		alert("You have tried to upload an invalid file format. Image must have .jpg, .gif, .jpeg, .swf extension");
		document.bannerfrm.image.focus();
		document.bannerfrm.image.select();
		return false;
		}
	}
	else
	{
	    alert("Please Insert an Image");
		document.bannerfrm.image.focus();
		document.bannerfrm.image.select();
		return false;
	
	}*/



}

//==================== End Of Function ===================//


//============= Validation Function For Gas & Electricity Supplier========//


function validate_br_supplier()
{

	 if(document.supplierfrm.supplier_name.value=="")
	 {
	  alert("Please,Enter Supplier Name");
	  document.supplierfrm.supplier_name.focus();
	  document.supplierfrm.supplier_name.select();
	  return false;
	 
	 }

	 if(IsNumeric1(document.supplierfrm.supplier_name.value))
	 {
	  alert("Please Enter Valid Supplier Name");
	  document.supplierfrm.supplier_name.focus();
	  document.supplierfrm.supplier_name.select();
	   return false;
	 }
	 if(document.supplierfrm.apply_type.selectedIndex!=0)
	{
		 if(document.supplierfrm.supplier_url.value=="")
		 {
		  alert("Please,Enter Supplier Url");
		  document.supplierfrm.supplier_url.focus();
		  document.supplierfrm.supplier_url.select();
		  return false;
		 
		 }
	}

	 if(!isUrl(document.supplierfrm.supplier_url.value))
	 {
	  alert("Please,Enter Valid Supplier Url");
	  document.supplierfrm.supplier_url.focus();
	  document.supplierfrm.supplier_url.select();
	  return false;
	 
	 }
       if(IsString(document.supplierfrm.phone_no.value) && document.supplierfrm.phone_no.value=="")
	  {
		alert('Please Enter Valid Phone Number,Try again!');
		
		document.supplierfrm.phone_no.focus();
		document.supplierfrm.phone_no.select();
		return false;
	  }
    
	
		if(document.supplierfrm.email.value=="")
		{
		alert("Please Enter Email ");
		document.supplierfrm.email.focus();
		document.supplierfrm.email.select();
		return false;
		}
    
	 if(!valid_email(document.supplierfrm.email.value))
	  {
		alert('Please Enter Valid Email ,Try again!');
		
		document.supplierfrm.email.focus();
		document.supplierfrm.email.select();
		return false;
	  }
      if(document.supplierfrm.website.value=="")
	 {
	  alert("Please,Enter Website Url");
	  document.supplierfrm.website.focus();
	  document.supplierfrm.website.select();
	  return false;
	 
	 }

	 if(!isUrl(document.supplierfrm.website.value))
	 {
	  alert("Please,Enter Valid Website");
	  document.supplierfrm.website.focus();
	  document.supplierfrm.website.select();
	  return false;
	 
	 }

       if((document.supplierfrm.supply_product.selectedIndex)==0)
	  {
		alert('Please Select Supplier Product,Try again!');
		
		return false;
	  }


}


//============= Validation Function For Gas & Electricity Supplier========//


function validate_bundle_supplier()
{

	 if(document.supplierfrm.supplier_name.value=="")
	 {
	  alert("Please,Enter Supplier Name");
	  document.supplierfrm.supplier_name.focus();
	  document.supplierfrm.supplier_name.select();
	  return false;
	 
	 }

	 if(IsNumeric1(document.supplierfrm.supplier_name.value))
	 {
	  alert("Please Enter Valid Supplier Name");
	  document.supplierfrm.supplier_name.focus();
	  document.supplierfrm.supplier_name.select();
	   return false;
	 }
	/* if(document.supplierfrm.apply_type.selectedIndex!=0)
	{
		 if(document.supplierfrm.supplier_url.value=="")
		 {
		  alert("Please,Enter Supplier Url");
		  document.supplierfrm.supplier_url.focus();
		  document.supplierfrm.supplier_url.select();
		  return false;
		 
		 }
	}*/
	if(document.supplierfrm.phone_no.value=="")
		{
		alert("Please Enter Phone No");
		document.supplierfrm.phone_no.focus();
		document.supplierfrm.phone_no.select();
		return false;
		}
		  if(IsString(document.supplierfrm.phone_no.value))
	  {
		alert('Please Enter Valid Phone Number,Try again!');
		
		document.supplierfrm.phone_no.focus();
		document.supplierfrm.phone_no.select();
		return false;
	  }
    
	
		if(document.supplierfrm.email.value=="")
		{
		alert("Please Enter Email ");
		document.supplierfrm.email.focus();
		document.supplierfrm.email.select();
		return false;
		}
		 if(!valid_email(document.supplierfrm.email.value))
	  {
		alert('Please Enter Valid Email ,Try again!');
		
		document.supplierfrm.email.focus();
		document.supplierfrm.email.select();
		return false;
	  }
	   if(document.supplierfrm.website.value=="")
	 {
	  alert("Please,Enter Supplier Url");
	  document.supplierfrm.website.focus();
	  document.supplierfrm.website.select();
	  return false;
	 
	 }
	 if(!isUrl(document.supplierfrm.website.value))
	 {
	  alert("Please,Enter Valid Supplier Url");
	  document.supplierfrm.website.focus();
	  document.supplierfrm.website.select();
	  return false;
	 
	 }
	 
       if(document.supplierfrm.address.value=="")
	 {
	  alert("Please,Enter Address");
	  document.supplierfrm.address.focus();
	  document.supplierfrm.address.select();
	  return false;
	 
	 }
	 
	 
	   if(document.supplierfrm.transfercosts.value=="")
	 {
	  alert("Please,Enter Transfer Cost");
	  document.supplierfrm.transfercosts.focus();
	  document.supplierfrm.transfercosts.select();
	  return false;
	 
	 }
	

     /*  if((document.supplierfrm.supply_product.selectedIndex)==0)
	  {
		alert('Please Select Supplier Product,Try again!');
		
		return false;
	  }*/


}

//==========================Telephone Supplier ====================//

function validate_telephone_supplier()
{
     if(IsNumeric1(document.telephonefrm.supplier_name.value) || document.telephonefrm.supplier_name.value=="")
	 {
	  alert("Please Enter Valid Supplier Name");
	  document.telephonefrm.supplier_name.focus();
	  document.telephonefrm.supplier_name.select();
	   return false;
	 }
	if(document.telephonefrm.phone_no.value=="")
	  {
		alert('Please Enter Valid Phone Number,Try again!');
		
		document.telephonefrm.phone_no.focus();
		document.telephonefrm.phone_no.select();
		return false;
	  }
	
		if(document.telephonefrm.email.value=="")
		{
		alert("Please Enter Email ");
		document.telephonefrm.email.focus();
		document.telephonefrm.email.select();
		return false;
		}
		
	 if(!valid_email(document.telephonefrm.email.value))
	  {
		alert('Please Enter Valid Email ,Try again!');
		
		document.telephonefrm.email.focus();
		document.telephonefrm.email.select();
		return false;
	  }
      if(document.telephonefrm.website.value=="")
	 {
	  alert("Please,Enter Website Url");
	  document.telephonefrm.website.focus();
	  document.telephonefrm.website.select();
	  return false;
	 
	 }

	 if(!isUrl(document.telephonefrm.website.value))
	 {
	  alert("Please,Enter Valid Website");
	  document.telephonefrm.website.focus();
	  document.telephonefrm.website.select();
	  return false;
	 
	 }
	 
	 if(document.telephonefrm.address.value=="")
	  {
		alert('Please Enter Address');
		document.telephonefrm.address.focus();
		document.telephonefrm.address.select();
		return false;
	  }
	  
	  if(document.telephonefrm.region.selectedIndex==0)
	{
		 if(document.telephonefrm.region.value=="")
		 {
		  alert("Please Enter Region");
		 
		  return false;
		 
		 }
	}
	   if(document.telephonefrm.transfercosts.value=="")
	  {
		alert('Please Enter Transfer Cost');
		document.telephonefrm.transfercosts.focus();
		document.telephonefrm.transfercosts.select();
		return false;
	  }


}
//===================================End Function=============================//

//================================== Function For Telephone Bundle Supplier========//
function validate_telephone_bundle_supplier()
{
     if(IsNumeric1(document.telephoneBundleFrm.supplier_name.value) || document.telephoneBundleFrm.supplier_name.value=="")
	 {
	  alert("Please Enter Valid Supplier Name");
	  document.telephoneBundleFrm.supplier_name.focus();
	  document.telephoneBundleFrm.supplier_name.select();
	   return false;
	 }
	if(document.telephoneBundleFrm.phone_no.value=="")
	  {
		alert('Please Enter Valid Phone Number,Try again!');
		
		document.telephoneBundleFrm.phone_no.focus();
		document.telephoneBundleFrm.phone_no.select();
		return false;
	  }
	
		if(document.telephoneBundleFrm.email.value=="")
		{
		alert("Please Enter Email ");
		document.telephoneBundleFrm.email.focus();
		document.telephoneBundleFrm.email.select();
		return false;
		}
		
	 if(!valid_email(document.telephoneBundleFrm.email.value))
	  {
		alert('Please Enter Valid Email ,Try again!');
		
		document.telephoneBundleFrm.focus();
		document.telephoneBundleFrm.select();
		return false;
	  }
      if(document.telephoneBundleFrm.website.value=="")
	 {
	  alert("Please,Enter Website Url");
	  document.telephoneBundleFrm.website.focus();
	  document.telephoneBundleFrm.website.select();
	  return false;
	 
	 }

	 if(!isUrl(document.telephoneBundleFrm.website.value))
	 {
	  alert("Please,Enter Valid Website");
	  document.telephoneBundleFrm.website.focus();
	  document.telephoneBundleFrm.website.select();
	  return false;
	 
	 }
	 
	 if(document.telephoneBundleFrm.address.value=="")
	  {
		alert('Please Enter Address');
		document.telephoneBundleFrm.address.focus();
		document.telephoneBundleFrm.address.select();
		return false;
	  }
	  
	  if(document.telephoneBundleFrm.region.selectedIndex==0)
	{
		 if(document.telephoneBundleFrm.region.value=="")
		 {
		  alert("Please Enter Region");
		 
		  return false;
		 
		 }
	}
	   if(document.telephoneBundleFrm.transfercosts.value=="")
	  {
		alert('Please Enter Transfer Cost');
		document.telephoneBundleFrm.transfercosts.focus();
		document.telephoneBundleFrm.transfercosts.select();
		return false;
	  }


}
//=============================== End Function =======================//

//================ End Of Function ===================================//

function validate_br_package()
{
	if((document.packagefrm.product.selectedIndex)==0)
	{
		alert('Please Select Product Name,Try again!');
		return false;
	}
	
	if(document.packagefrm.br_monthly_fees.value=="")
	{
		alert("Please Enter Monthly Fee");	  
		document.packagefrm.br_monthly_fees.focus();
		document.packagefrm.br_monthly_fees.select();
		return false;
	}
	if(document.packagefrm.br_service_type.selectedIndex==0)
	{
		alert("Please Select Service Type");	  
		return false;
	}
	if(document.packagefrm.br_connection_type.selectedIndex==0)
	{
		alert("Please Select Connection Type");	  
		return false;
	}
	if(document.packagefrm.br_down_speed.selectedIndex==0)
	{
		alert("Please Select Download Speed");	  
		return false;
	}
	if(document.packagefrm.br_spam_protection.value=="")
	{
		alert("Please Enter Spam Protection");	  
		document.packagefrm.br_spam_protection.focus();
		document.packagefrm.br_spam_protection.select();
		return false;
	}
	if(document.packagefrm.br_virus_protection.value=="")
	{
		alert("Please Enter Virus Protection");	  
		document.packagefrm.br_virus_protection.focus();
		document.packagefrm.br_virus_protection.select();
		return false;
	}
	if(document.packagefrm.br_spyware_protection.value=="")
	{
		alert("Please Enter Spyware Protection");	  
		document.packagefrm.br_spyware_protection.focus();
		document.packagefrm.br_spyware_protection.select();
		return false;
	}
	if(document.packagefrm.br_personal_firewall.value=="")
	{
		alert("Please Enter Firewall Service");	  
		document.packagefrm.br_personal_firewall.focus();
		document.packagefrm.br_personal_firewall.select();
		return false;
	}
	if(document.packagefrm.br_email_address.value=="")
	{
		alert("Please Enter Email Address");	  
		document.packagefrm.br_email_address.focus();
		document.packagefrm.br_email_address.select();
		return false;
	}
	if(document.packagefrm.br_email_space.value=="")
	{
		alert("Please Enter Email Space");	  
		document.packagefrm.br_email_space.focus();
		document.packagefrm.br_email_space.select();
		return false;
	}
	if(document.packagefrm.br_webmail.value=="")
	{
		alert("Please Select Webmail");	  
		return false;
	}
	if(document.packagefrm.br_personal_webpage.value=="")
	{
		alert("Please Select Personal Webpage");	  
		return false;
	}
	if(document.packagefrm.br_web_space.value=="")
	{
		alert("Please Enter Web Space");	  
		document.packagefrm.br_web_space.focus();
		document.packagefrm.br_web_space.select();
		return false;
	}
	if(document.packagefrm.br_free_web_space.value=="")
	{
		alert("Please Enter Free Webspace");
		document.packagefrm.br_free_web_space.focus();
		document.packagefrm.br_free_web_space.select();
		return false;
	}
	if(document.packagefrm.br_activation_fee.value=="")
	{
		alert("Please Enter Setup/Activation Fee");
		document.packagefrm.br_activation_fee.focus();
		document.packagefrm.br_activation_fee.select();
		return false;
	}
	if(document.packagefrm.payment_methods.selectedIndex==0)
	{
		alert("Please Select Payment Methods");	  
		return false;
	}
	if(document.packagefrm.supported_operating_system.selectedIndex==0)
	{
		alert("Please Select Supported Operating System");	  
		return false;
	}
	if(document.packagefrm.br_static_ip_address.value=="")
	{
		alert("Please Enter Static IP Address");
		document.packagefrm.br_static_ip_address.focus();
		document.packagefrm.br_static_ip_address.select();
		return false;
	}
	if(document.packagefrm.br_dialup_hours.selectedIndex==0)
	{
		alert("Please Select Dialup Hours");	  
		return false;
	}
	if(document.packagefrm.br_wireless_router.value=="")
	{
		alert("Please Select Wireless Router");	  
		return false;
	}
	if(document.packagefrm.br_web_space.value=="")
	{
		alert("Please Enter Web Space");	  
		document.packagefrm.br_web_space.focus();
		document.packagefrm.br_web_space.select();
		return false;
	}
	if(document.packagefrm.br_free_web_space.value=="")
	{
		alert("Please Enter Free Webspace");
		document.packagefrm.br_free_web_space.focus();
		document.packagefrm.br_free_web_space.select();
		return false;
	}
	if(document.packagefrm.br_activation_fee.value=="")
	{
		alert("Please Enter Setup/Activation Fee");
		document.packagefrm.br_activation_fee.focus();
		document.packagefrm.br_activation_fee.select();
		return false;
	}
	if(document.packagefrm.payment_methods.selectedIndex==0)
	{
		alert("Please Select Payment Methods");	  
		return false;
	}
	if(document.packagefrm.supported_operating_system.selectedIndex==0)
	{
		alert("Please Select Supported Operating Systems");	  
		return false;
	}
	if(document.packagefrm.br_static_ip_address.value=="")
	{
		alert("Please Enter Static IP addresses");	  
		document.packagefrm.br_static_ip_address.focus();
		document.packagefrm.br_static_ip_address.select();
		return false;
	}
	if(document.packagefrm.br_dialup_hours.selectedIndex==0)
	{
		alert("Please Select Dialup hours");
		return false;
	}
	if(document.packagefrm.br_wireless_router.value=="")
	{
		alert("Please Select Wireless Router");
		return false;
	}
	if(document.packagefrm.br_customer_supplied_modem.value=="")
	{
		alert("Please Select Customer Supplied Modem");
		return false;
	}
	if(document.packagefrm.br_modem_rental.value=="")
	{
		alert("Please Enter Modem Rental");	  
		document.packagefrm.br_modem_rental.focus();
		document.packagefrm.br_modem_rental.select();
		return false;
	}
	if(document.packagefrm.br_modem_deposit.value=="")
	{
		alert("Please Enter Modem Deposit");	  
		document.packagefrm.br_modem_deposit.focus();
		document.packagefrm.br_modem_deposit.select();
		return false;
	}
	if(document.packagefrm.br_sell_modem.value=="")
	{
		alert("Please Enter Sell Modem?");	  
		document.packagefrm.br_sell_modem.focus();
		document.packagefrm.br_sell_modem.select();
		return false;
	}
	if(document.packagefrm.br_tech_support.selectedIndex==0)
	{
		alert("Please Select 24/7 Tech Support");
		return false;
	}
}

//================ End Of Function ===================================//



//================ End Of Function ===================================//

function validate_bundle_package()
{
	if((document.packagefrm.product.selectedIndex)==0)
	{
		alert('Please Select Product Name,Try again!');
		return false;
	}
	
	if(document.packagefrm.br_monthly_fees.value=="")
	{
		alert("Please Enter Monthly Fee");	  
		document.packagefrm.br_monthly_fees.focus();
		document.packagefrm.br_monthly_fees.select();
		return false;
	}
	if(document.packagefrm.br_service_type.selectedIndex==0)
	{
		alert("Please Select Service Type");	  
		return false;
	}
	if(document.packagefrm.br_connection_type.selectedIndex==0)
	{
		alert("Please Select Connection Type");	  
		return false;
	}
	if(document.packagefrm.br_down_speed.selectedIndex==0)
	{
		alert("Please Select Download Speed");	  
		return false;
	}
	
	if(document.packagefrm.high_speed_internet_connection.value=="")
	{
		alert("Please Enter Internet Connection");	  
		document.packagefrm.high_speed_internet_connection.focus();
		document.packagefrm.high_speed_internet_connection.select();
		return false;
	}
	
	if(document.packagefrm.local_phone_service.value=="")
	{
		alert("Please Enter Local Phone Service");	  
		document.packagefrm.local_phone_service.focus();
		document.packagefrm.local_phone_service.select();
		return false;
	}
	
	if(document.packagefrm.long_distance_canada.value=="")
	{
		alert("Please Enter Long Distance Canada");	  
		document.packagefrm.long_distance_canada.focus();
		document.packagefrm.long_distance_canada.select();
		return false;
	}
	
	if(document.packagefrm.long_distance_us.value=="")
	{
		alert("Please Enter Long Distance US");	  
		document.packagefrm.long_distance_us.focus();
		document.packagefrm.long_distance_us.select();
		return false;
	}
	
	if(document.packagefrm.web_hosting.value=="")
	{
		alert("Please Enter Web Hosting");	  
		document.packagefrm.web_hosting.focus();
		document.packagefrm.web_hosting.select();
		return false;
	}
	
	if(document.packagefrm.tv_programming.value=="")
	{
		alert("Please Enter TV Programming");	  
		document.packagefrm.tv_programming.focus();
		document.packagefrm.tv_programming.select();
		return false;
	}
	
	if(document.packagefrm.activation_fee.value=="")
	{
		alert("Please Enter Activatio Fee");	  
		document.packagefrm.activation_fee.focus();
		document.packagefrm.activation_fee.select();
		return false;
	}
	
	if((document.packagefrm.supported_operating_system.selectedIndex)==0)
	{
		alert('Please Select Operating System,Try again!');
		return false;
	}
	
	
	if(document.packagefrm.bundle_description.value=="")
	{
		alert("Please Enter Bundle Description");	  
		document.packagefrm.bundle_description.focus();
		document.packagefrm.bundle_description.select();
		return false;
	}
	
	
	if(document.packagefrm.br_modem_deposit.value=="")
	{
		alert("Please Enter Modem Deposit");	  
		document.packagefrm.br_modem_deposit.focus();
		document.packagefrm.br_modem_deposit.select();
		return false;
	}
}

//================ End Of Function ==========================//

//========= Validation Function For Telephone Product========//

function validate_telephone_product()
{
	 if(document.frm_telephoneproduct.product_name.value=="")
	 {
	  alert("Please,Enter Product  Name");
	  document.frm_telephoneproduct.product_name.focus();
	  document.frm_telephoneproduct.product_name.select();
	  return false;
	 
	 }
	 if(IsNumeric1(document.frm_telephoneproduct.product_name.value))
	 {
	  alert("Please Enter Valid Product Name");
	  document.frm_telephoneproduct.product_name.focus();
	  document.frm_telephoneproduct.product_name.select();
	   return false;
	 }
	if(document.frm_telephoneproduct.supplier.selectedIndex==0)
	   {
		alert("Please Select Supplier");	  
		return false;
		}
	if(document.frm_telephoneproduct.monthly_cost.value=="")
	 {
	  alert("Please,Enter Monthly Cost");
	  document.frm_telephoneproduct.monthly_cost.focus();
	  document.frm_telephoneproduct.monthly_cost.select();
	  return false;
	 
	 }
	 if(document.frm_telephoneproduct.contract.selectedIndex==0)
	   {
		alert("Please Select Contract Period");	  
		return false;
		}
	 if(document.frm_telephoneproduct.activation_cost.value=="")
	   {
		alert("Please Enter Set Up Cost");	  
		 document.frm_telephoneproduct.activation_cost.focus();
	  	 document.frm_telephoneproduct.activation_cost.select();
	   return false;
		}
	if(document.frm_telephoneproduct.cancellation_charges.value=="")
	 {
	  alert("Please,Enter Cancellation Charges");
	  document.frm_telephoneproduct.cancellation_charges.focus();
	  document.frm_telephoneproduct.cancellation_charges.select();
	  return false;
	 
	 }
	if(document.frm_telephoneproduct.cancellation_notice_period.selectedIndex==0)
	   {
		alert("Please Select Cancellation Notice Period");	  
		return false;
		}
		if(document.frm_telephoneproduct.default_payment_notice.selectedIndex==0)
	   {
		alert("Please Select Default Payment Notice");	  
		return false;
		}
	if(document.frm_telephoneproduct.activation_cost.value=="")
	   {
		alert("Please Enter Set Up Cost");	  
		 document.frm_telephoneproduct.activation_cost.focus();
	  	 document.frm_telephoneproduct.activation_cost.select();
	   return false;
		}
		if(IsString(document.frm_telephoneproduct.activation_cost.value))
		{
		  alert("Please Enter Only Numeric Value");
		  document.frm_telephoneproduct.activation_cost.focus();
		  document.frm_telephoneproduct.activation_cost.select();
		  return false;
		}
	
	if(document.frm_telephoneproduct.overall_satisfaction.value=="")
	   {
		alert("Please Enter Overall Satisfaction");	  
		 document.frm_telephoneproduct.overall_satisfaction.focus();
	  	 document.frm_telephoneproduct.overall_satisfaction.select();
	   return false;
		}
	if(document.frm_telephoneproduct.recommend_a_friend.value=="")
	   {
		alert("Please Enter Recomended a Friend");	  
		 document.frm_telephoneproduct.recommend_a_friend.focus();
	  	 document.frm_telephoneproduct.recommend_a_friend.select();
	   return false;
		}
	if(document.frm_telephoneproduct.value_for_money.value=="")
	   {
		alert("Please Enter value for money");	  
		 document.frm_telephoneproduct.value_for_money.focus();
	  	 document.frm_telephoneproduct.value_for_money.select();
	   return false;
		}
	if(document.frm_telephoneproduct.customer_support.value=="")
	   {
		alert("Please Enter customer support");	  
		 document.frm_telephoneproduct.customer_support.focus();
	  	 document.frm_telephoneproduct.customer_support.select();
	   return false;
		}
	if(document.frm_telephoneproduct.technical_support.value=="")
	   {
		alert("Please Enter technical support");	  
		 document.frm_telephoneproduct.technical_support.focus();
	  	 document.frm_telephoneproduct.technical_support.select();
	   return false;
		}
	if(document.frm_telephoneproduct.ease_to_interpret_bill.value=="")
	   {
		alert("Please Enter ease to interpret bill");	  
		 document.frm_telephoneproduct.ease_to_interpret_bill.focus();
	  	 document.frm_telephoneproduct.ease_to_interpret_bill.select();
	   return false;
		}
	if(document.frm_telephoneproduct.quality_of_connection.value=="")
	   {
		alert("Please Enter quality of connection");	  
		 document.frm_telephoneproduct.quality_of_connection.focus();
	  	 document.frm_telephoneproduct.quality_of_connection.select();
	   return false;
		}
	if(document.frm_telephoneproduct.speed_and_payment_plans.value=="")
	   {
		alert("Please Enter speed and payment plans");	  
		 document.frm_telephoneproduct.speed_and_payment_plans.focus();
	  	 document.frm_telephoneproduct.speed_and_payment_plans.select();
	   return false;
		}
	if(document.frm_telephoneproduct.optimal_plan_assurance.value=="")
	   {
		alert("Please Enter optimal plan assurance");	  
		 document.frm_telephoneproduct.optimal_plan_assurance.focus();
	  	 document.frm_telephoneproduct.optimal_plan_assurance.select();
	   return false;
		}
	if(document.frm_telephoneproduct.ease_to_start_using_provider.value=="")
	   {
		alert("Please Enter ease to start using provider");	  
		 document.frm_telephoneproduct.ease_to_start_using_provider.focus();
	  	 document.frm_telephoneproduct.ease_to_start_using_provider.select();
	   return false;
		}
	if(document.frm_telephoneproduct.quality_of_information_provided_during_switching.value=="")
	   {
		alert("Please Enter quality of information provided during switching");	  
		 document.frm_telephoneproduct.quality_of_information_provided_during_switching.focus();
	  	 document.frm_telephoneproduct.quality_of_information_provided_during_switching.select();
	   return false;
		}
}

//========= Validation Function For Telephone Package========//
function validate_telephone_plan()
{
	 
	 if(document.frm_plan.plan_name.value=="")
	 {
	  alert("Please Enter Plan Name");
	  document.frm_plan.plan_name.focus();
	  document.frm_plan.plan_name.select();
	  return false;
	 }	 
	if(document.frm_plan.supplier.selectedIndex==0)
	   {
		alert("Please Select Supplier");	  
		return false;
		}
	if(document.frm_plan.monthly_fee.value=="")
	 {
	  alert("Please Enter Monthly Fees");
	  document.frm_plan.monthly_fee.focus();
	  document.frm_plan.monthly_fee.select();
	  return false;
	 }		
	if(document.frm_plan.service_type.selectedIndex==0)
	   {
		alert("Please Select Service Type");	  
		return false;
		}
	if(document.frm_plan.connection_type.selectedIndex==0)
	   {
		alert("Please Select Conection Type");	  
		return false;
		}
	if(document.frm_plan.contract.selectedIndex==0)
	 {
	  alert("Please Enter Contract");
	  return false;
	 }
	if(document.frm_plan.activation_fee_type.value=="")
	 {
	  alert("Please,Enter Activation Fee");
	  document.frm_plan.activation_fee_type.focus();
	  document.frm_plan.activation_fee_type.select();
	  return false;
	 }
	if(document.frm_plan.alternate_number.value=="")
	 {
	  alert("Please,Enter Alternate Number");
	  document.frm_plan.alternate_number.focus();
	  document.frm_plan.alternate_number.select();
	  return false;
	 }	 
	 if(document.frm_plan.long_distance_canada.value=="")
	 {
	  alert("Please,Enter Long Distance Canada");
	  document.frm_plan.long_distance_canada.focus();
	  document.frm_plan.long_distance_canada.select();
	  return false;
	 }	 
	if(document.frm_plan.long_distance_us.value=="")
	 {
	  alert("Please,Enter Long Distance US");
	  document.frm_plan.long_distance_us.focus();
	  document.frm_plan.long_distance_us.select();
	  return false;
	 }	 
	if(document.frm_plan.long_distance_europe.value=="")
	 {
	  alert("Please,Enter Long Distance Europe");
	  document.frm_plan.long_distance_europe.focus();
	  document.frm_plan.long_distance_europe.select();
	  return false;
	 }	 
	if(document.frm_plan.long_distance_asia.value=="")
	 {
	  alert("Please,Enter Long Distance Asia");
	  document.frm_plan.long_distance_asia.focus();
	  document.frm_plan.long_distance_asia.select();
	  return false;
	 }	
	  if(document.frm_plan.long_distance_additional_features.value=="")
	 {
	  alert("Please,Enter Long Distance Additional Features");
	  document.frm_plan.long_distance_additional_features.focus();
	  document.frm_plan.long_distance_additional_features.select();
	  return false;
	 }	 
	 if(document.frm_plan.local_service_additional_features.value=="")
	 {
	  alert("Please,Enter Long Service Additional Features");
	  document.frm_plan.local_service_additional_features.focus();
	  document.frm_plan.local_service_additional_features.select();
	  return false;
	 }	 
	 if(document.frm_plan.long_distance_access_number.value=="")
	 {
	  alert("Please,Enter Long Distance Access Number");
	  document.frm_plan.long_distance_access_number.focus();
	  document.frm_plan.long_distance_access_number.select();
	  return false;
	 }	 
	/*if(document.frm_plan.using_access_number.value=="")
	 {
	  alert("Please,Enter Using Access Number");
	  document.frm_plan.using_access_number.focus();
	  document.frm_plan.using_access_number.select();
	  return false;
	 }	*/ 
	 
	if(document.frm_plan.calling_card_billed.value=="")
	 {
	  alert("Please,Enter Calling Card billed");
	  document.frm_plan.calling_card_billed.focus();
	  document.frm_plan.calling_card_billed.select();
	  return false;
	 }	 
	 
	if(document.frm_plan.calling_card_prepaid.value=="")
	 {
	  alert("Please,Enter Calling Card Prepaid");
	  document.frm_plan.calling_card_prepaid.focus();
	  document.frm_plan.calling_card_prepaid.select();
	  return false;
	 }	
	
	if(document.frm_plan.call_display.value=="")
	 {
		  alert("Please Select Call Display");
		  document.frm_plan.call_display.focus();
		  document.frm_plan.call_display.select();
		  return false;
	}
	if(document.frm_plan.call_blocking.value=="")
	 {
	  alert("Please Select Call Blocking");
	  document.frm_plan.call_blocking.focus();
	  document.frm_plan.call_blocking.select();
	  return false;
	 }
	if(document.frm_plan.call_waiting.value=="")
	 {
	  alert("Please Select Call Waiting");
	  document.frm_plan.call_waiting.focus();
	  document.frm_plan.call_waiting.select();
	  return false;
	 }
	if(document.frm_plan.visual_call_waiting.value=="")
	 {
	  alert("Please Select Visual Call waiting");
	  document.frm_plan.visual_call_waiting.focus();
	  document.frm_plan.visual_call_waiting.select();
	  return false;
	 }
	if(document.frm_plan.call_forwarding.value=="")
	 {
	  alert("Please Select Call Forwarding");
	  document.frm_plan.call_forwarding.focus();
	  document.frm_plan.call_forwarding.select();
	  return false;
	 }
	if(document.frm_plan.conference_calling.value=="")
	 {
	  alert("Please Select Conference Calling");
	  document.frm_plan.conference_calling.focus();
	  document.frm_plan.conference_calling.select();
	  return false;
	 }
	if(document.frm_plan.forward_on_busy.value=="")
	 {
	  alert("Please Select Forward On Busy");
	  document.frm_plan.forward_on_busy.focus();
	  document.frm_plan.forward_on_busy.select();
	  return false;
	 }
	if(document.frm_plan.call_privacy.value=="")
	 {
	  alert("Please Select Cal Privacy");
	  document.frm_plan.call_privacy.focus();
	  document.frm_plan.call_privacy.select();
	  return false;
	 }
	if(document.frm_plan.last_call_return.value=="")
	 {
	  alert("Please Select Last Call Return");
	  document.frm_plan.last_call_return.focus();
	  document.frm_plan.last_call_return.select();
	  return false;
	 }
	if(document.frm_plan.call_transfer.value=="")
	 {
	  alert("Please Select Call Transfer");
	  document.frm_plan.call_transfer.focus();
	  document.frm_plan.call_transfer.select();
	  return false;
	 }
	if(document.frm_plan.call_hunt.value=="")
	 {
	  alert("Please Select Call Hunt");
	  document.frm_plan.call_hunt.focus();
	  document.frm_plan.call_hunt.select();
	  return false;
	 }
	if(document.frm_plan.do_not_disturb.value=="")
	 {
	  alert("Please Select Do Not Disturb");
	  document.frm_plan.do_not_disturb.focus();
	  document.frm_plan.do_not_disturb.select();
	  return false;
	 }
	if(document.frm_plan.voice_mail.value=="")
	 {
	  alert("Please Select Voice Mail");
	  document.frm_plan.voice_mail.focus();
	  document.frm_plan.voice_mail.select();
	  return false;
	 }	 
	if(document.frm_plan.detailed_billing.value=="")
	 {
	  alert("Please Select Detailed Billing");
	  document.frm_plan.detailed_billing.focus();
	  document.frm_plan.detailed_billing.select();
	  return false;
	 }	
	 if(document.frm_plan.tech_support.value=="")
	 {
	  alert("Please Select Detailed Billing");
	  document.frm_plan.tech_support.focus();
	  document.frm_plan.tech_support.select();
	  return false;
	 }	
	 
	
	if(document.frm_plan.unlisted_number.value=="")
	 {
	  alert("Please,Enter Unlisted Number");
	  document.frm_plan.unlisted_number.focus();
	  document.frm_plan.unlisted_number.select();
	  return false;
	 }	 
	
}

//============= Validation Function For Telephone Bundle Plan =====//
function validate_telephone_bundle_plan()
{
	 
	 
	 
	if(document.frm_package.service_type.selectedIndex==0)
	   {
		alert("Please Enter Service Type");	  
		return false;
		}
	if(document.frm_package.connection_type.selectedIndex==0)
	   {
		alert("Please Select Conection Type");	  
		return false;
		}
	if(document.frm_package.contract.value=="")
	 {
	  alert("Please Enter Contract");
	  document.frm_package.contract.focus();
	  document.frm_package.contract.select();
	  return false;
	 
	 }
	 if(document.frm_package.high_speed_internet_connection.value=="")
	 {
		alert("Please,Enter High Speed Internet Connection");
	  document.frm_package.high_speed_internet_connection.focus();
	  document.frm_package.high_speed_internet_connection.select();
	  return false;
	 }
	 if(document.frm_package.monthly_fees.value="")
	 {
		 alert("Please,Enter High Speed Internet Connection");
	  document.frm_package.monthly_fees.focus();
	  document.frm_package.monthly_fees.select();
	  return false;
	 }
	if(document.frm_package.activation_fee_type.value=="")
	 {
	  alert("Please,Enter Activation Fee Type");
	  document.frm_package.activation_fee_type.focus();
	  document.frm_package.activation_fee_type.select();
	  return false;
	 }
	if(document.frm_package.alternate_number.value=="")
	 {
	  alert("Please,Enter Alternate Number");
	  document.frm_package.alternate_number.focus();
	  document.frm_package.alternate_number.select();
	  return false;
	 }	 
	 if(document.frm_package.long_distance_canada.value=="")
	 {
	  alert("Please,Enter Long Distance Canada");
	  document.frm_package.long_distance_canada.focus();
	  document.frm_package.long_distance_canada.select();
	  return false;
	 }	 
	if(document.frm_package.long_distance_us.value=="")
	 {
	  alert("Please,Enter Long Distance US");
	  document.frm_package.long_distance_us.focus();
	  document.frm_package.long_distance_us.select();
	  return false;
	 }	 
	if(document.frm_package.long_distance_europe.value=="")
	 {
	  alert("Please,Enter Long Distance Europe");
	  document.frm_package.long_distance_europe.focus();
	  document.frm_package.long_distance_europe.select();
	  return false;
	 }	 
	if(document.frm_package.long_distance_asia.value=="")
	 {
	  alert("Please,Enter Long Distance Asia");
	  document.frm_package.long_distance_asia.focus();
	  document.frm_package.long_distance_asia.select();
	  return false;
	 }	
	  if(document.frm_package.long_distance_additional_features.value=="")
	 {
	  alert("Please,Enter Long Distance Additional Features");
	  document.frm_package.long_distance_additional_features.focus();
	  document.frm_package.long_distance_additional_features.select();
	  return false;
	 }	 
	 if(document.frm_package.local_service_additional_features.value=="")
	 {
	  alert("Please,Enter Long Service Additional Features");
	  document.frm_package.local_service_additional_features.focus();
	  document.frm_package.local_service_additional_features.select();
	  return false;
	 }	 
	 if(document.frm_package.long_distance_access_number.value=="")
	 {
	  alert("Please,Enter Long Distance Access Number");
	  document.frm_package.long_distance_access_number.focus();
	  document.frm_package.long_distance_access_number.select();
	  return false;
	 }	 
	if(document.frm_package.using_access_number.value=="")
	 {
	  alert("Please,Enter Using Access Number");
	  document.frm_package.using_access_number.focus();
	  document.frm_package.using_access_number.select();
	  return false;
	 }	 
	if(document.frm_package.calling_card_billed.value=="")
	 {
	  alert("Please,Enter Calling Card billed");
	  document.frm_package.calling_card_billed.focus();
	  document.frm_package.calling_card_billed.select();
	  return false;
	 }	 
	if(document.frm_package.calling_card_prepaid.value=="")
	 {
	  alert("Please,Enter Calling Card Prepaid");
	  document.frm_package.calling_card_prepaid.focus();
	  document.frm_package.calling_card_prepaid.select();
	  return false;
	 }	
	
	if(document.frm_package.call_display.value=="")
	 {
		  alert("Please Select Call Display");
		  document.frm_package.call_display.focus();
		  document.frm_package.call_display.select();
		  return false;
	}
	if(document.frm_package.call_blocking.value=="")
	 {
	  alert("Please Select Call Blocking");
	  document.frm_package.call_blocking.focus();
	  document.frm_package.call_blocking.select();
	  return false;
	 }
	if(document.frm_package.call_waiting.value=="")
	 {
	  alert("Please Select Call Waiting");
	  document.frm_package.call_waiting.focus();
	  document.frm_package.call_waiting.select();
	  return false;
	 }
	if(document.frm_package.visual_call_waiting.value=="")
	 {
	  alert("Please Select Visual Call waiting");
	  document.frm_package.visual_call_waiting.focus();
	  document.frm_package.visual_call_waiting.select();
	  return false;
	 }
	if(document.frm_package.call_forwarding.value=="")
	 {
	  alert("Please Select Call Forwarding");
	  document.frm_package.call_forwarding.focus();
	  document.frm_package.call_forwarding.select();
	  return false;
	 }
	if(document.frm_package.conference_calling.value=="")
	 {
	  alert("Please Select Conference Calling");
	  document.frm_package.conference_calling.focus();
	  document.frm_package.conference_calling.select();
	  return false;
	 }
	if(document.frm_package.forward_on_busy.value=="")
	 {
	  alert("Please Select Forward On Busy");
	  document.frm_package.forward_on_busy.focus();
	  document.frm_package.forward_on_busy.select();
	  return false;
	 }
	if(document.frm_package.call_privacy.value=="")
	 {
	  alert("Please Select Cal Privacy");
	  document.frm_package.call_privacy.focus();
	  document.frm_package.call_privacy.select();
	  return false;
	 }
	if(document.frm_package.last_call_return.value=="")
	 {
	  alert("Please Select Last Call Return");
	  document.frm_package.last_call_return.focus();
	  document.frm_package.last_call_return.select();
	  return false;
	 }
	if(document.frm_package.call_transfer.value=="")
	 {
	  alert("Please Select Call Transfer");
	  document.frm_package.call_transfer.focus();
	  document.frm_package.call_transfer.select();
	  return false;
	 }
	if(document.frm_package.call_hunt.value=="")
	 {
	  alert("Please Select Call Hunt");
	  document.frm_package.call_hunt.focus();
	  document.frm_package.call_hunt.select();
	  return false;
	 }
	if(document.frm_package.do_not_disturb.value=="")
	 {
	  alert("Please Select Do Not Disturb");
	  document.frm_package.do_not_disturb.focus();
	  document.frm_package.do_not_disturb.select();
	  return false;
	 }
	if(document.frm_package.voice_mail.value=="")
	 {
	  alert("Please Select Voice Mail");
	  document.frm_package.voice_mail.focus();
	  document.frm_package.voice_mail.select();
	  return false;
	 }	 
	if(document.frm_package.detailed_billing.value=="")
	 {
	  alert("Please Select Detailed Billing");
	  document.frm_package.detailed_billing.focus();
	  document.frm_package.detailed_billing.select();
	  return false;
	 }	
	 if(document.frm_package.tech_support.value=="")
	 {
	  alert("Please Select Detailed Billing");
	  document.frm_package.tech_support.focus();
	  document.frm_package.tech_support.select();
	  return false;
	 }	
	 
	
	if(document.frm_package.unlisted_number.value=="")
	 {
	  alert("Please,Enter Unlisted Number");
	  document.frm_package.unlisted_number.focus();
	  document.frm_package.unlisted_number.select();
	  return false;
	 }	 
}
//=================== End Function==============================//


//============= validation Funtion for Telephone Bundle  ====//
function validate_telephone_bundle()
{
	 if(document.frm_bundle.bundle_name.value=="")
	 {
	  alert("Please Enter Bundle Name");
	  document.frm_bundle.bundle_name.focus();
	  document.frm_bundle.bundle_name.select();
	  return false;
	 }	 
	if(document.frm_bundle.supplier.selectedIndex==0)
	   {
		alert("Please Select Supplier");	  
		return false;
		}
	if(document.frm_bundle.monthly_fee.value=="")
	 {
	  alert("Please Enter Monthly Fees");
	  document.frm_bundle.monthly_fee.focus();
	  document.frm_bundle.monthly_fee.select();
	  return false;
	 }		
	if(document.frm_bundle.service_type.selectedIndex==0)
	   {
		alert("Please Select Service Type");	  
		return false;
		}
	if(document.frm_bundle.connection_type.selectedIndex==0)
	   {
		alert("Please Select Conection Type");	  
		return false;
		}
	if(document.frm_bundle.contract.selectedIndex==0)
	 {
	  alert("Please Select Contract");
	  return false;
	 }
	if(document.frm_bundle.activation_fee_type.value=="")
	 {
	  alert("Please Enter Activation Fee");
	  document.frm_bundle.activation_fee_type.focus();
	  document.frm_bundle.activation_fee_type.select();
	  return false;
	 }
	 if(document.frm_bundle.local_service_additional_features.value=="")
	 {
	  alert("Please Enter Local Phone Service Features ");
	  document.frm_bundle.local_service_additional_features.focus();
	  document.frm_bundle.local_service_additional_features.select();
	  return false;
	 }	 
	 if(document.frm_bundle.long_distance_canada.value=="")
	 {
	  alert("Please Enter Long Distance Canada");
	  document.frm_bundle.long_distance_canada.focus();
	  document.frm_bundle.long_distance_canada.select();
	  return false;
	 }	 
	if(document.frm_bundle.long_distance_us.value=="")
	 {
	  alert("Please Enter Long Distance US");
	  document.frm_bundle.long_distance_us.focus();
	  document.frm_bundle.long_distance_us.select();
	  return false;
	 }	 
	if(document.frm_bundle.long_distance_europe.value=="")
	 {
	  alert("Please Enter Long Distance Europe");
	  document.frm_bundle.long_distance_europe.focus();
	  document.frm_bundle.long_distance_europe.select();
	  return false;
	 }	 
	if(document.frm_bundle.long_distance_asia.value=="")
	 {
	  alert("Please Enter Long Distance Asia");
	  document.frm_bundle.long_distance_asia.focus();
	  document.frm_bundle.long_distance_asia.select();
	  return false;
	 }	
	  if(document.frm_bundle.web_hosting.value=="")
	 {
	  alert("Please Enter Web Hosting Features");
	  document.frm_bundle.web_hosting.focus();
	  document.frm_bundle.web_hosting.select();
	  return false;
	 }	 
	 if(document.frm_bundle.tv_programming.value=="")
	 {
	  alert("Please Enter TV Programming Features");
	  document.frm_bundle.tv_programming.focus();
	  document.frm_bundle.tv_programming.select();
	  return false;
	 }	 
}
//=================End Function =============================//

//============= Validation Function For Broadband Product========//


function validate_br_product()
{
 if(document.BRproductfrm.product_name.value=="")
	 {
	  alert("Please,Enter Product  Name");
	  document.BRproductfrm.product_name.focus();
	  document.BRproductfrm.product_name.select();
	  return false;
	 
	 }

	 if(IsNumeric1(document.BRproductfrm.product_name.value))
	 {
	  alert("Please Enter Valid Product Name");
	  document.BRproductfrm.product_name.focus();
	  document.BRproductfrm.product_name.select();
	   return false;
	 }
	if(document.BRproductfrm.supplier.selectedIndex==0)
	   {
		alert("Please Select Supplier");	  
		return false;
		}
	
	if(document.BRproductfrm.contract.selectedIndex==0)
	   {
		alert("Please Select Contract Period");	  
		return false;
		}
	if(document.BRproductfrm.activation_cost.value=="")
	   {
		alert("Please Select Set Up Cost");	  
		 document.BRproductfrm.activation_cost.focus();
	  document.BRproductfrm.activation_cost.select();
	   return false;
		}
		if(IsString(document.BRproductfrm.activation_cost.value))
    {
	  alert("Please Enter Only Numeric Value");
	  document.BRproductfrm.activation_cost.focus();
	  document.BRproductfrm.activation_cost.select();
	  return false;
	}
		if(document.BRproductfrm.cancellation_charges.value=="")
	   {
		alert("Please Select Cancellation Charges");	  
		 document.BRproductfrm.cancellation_charges.focus();
	  document.BRproductfrm.cancellation_charges.select();
	   return false;
		}
		if(IsString(document.BRproductfrm.cancellation_charges.value))
    {
	  alert("Please Enter Only Numeric Value");
	  document.BRproductfrm.cancellation_charges.focus();
	  document.BRproductfrm.cancellation_charges.select();
	  return false;
	}
   if(document.BRproductfrm.cancellation_notice_period.selectedIndex==0)
	   {
		alert("Please Select Cancellation Notice Period");	  
		return false;
		}
		if(document.BRproductfrm.default_payment_notice.selectedIndex==0)
	   {
		alert("Please Select Default Notice Period");	  
		return false;
		}
}




function validate_bundle_product()
{
 if(document.BRproductfrm.product_name.value=="")
	 {
	  alert("Please,Enter Product  Name");
	  document.BRproductfrm.product_name.focus();
	  document.BRproductfrm.product_name.select();
	  return false;
	 }

	 if(IsNumeric1(document.BRproductfrm.product_name.value))
	 {
	  alert("Please Enter Valid Product Name");
	  document.BRproductfrm.product_name.focus();
	  document.BRproductfrm.product_name.select();
	   return false;
	 }
	 
	if(document.BRproductfrm.supplier.selectedIndex==0)
	   {
		alert("Please Select Supplier");	  
		return false;
		}
	
	
	if(document.BRproductfrm.monthly_cost.value=="")
	   {
		alert("Please Select Monthly Cost");	  
		 document.BRproductfrm.monthly_cost.focus();
	        document.BRproductfrm.monthly_cost.select();
	   return false;
		}
	
	
	if(document.BRproductfrm.contract.selectedIndex==0)
	   {
		alert("Please Select Conntract Period");	  
		return false;
		}
	
	if(document.BRproductfrm.activation_cost.value=="")
	   {
		alert("Please Select Activation Cost");	  
		 document.BRproductfrm.activation_cost.focus();
	  document.BRproductfrm.activation_cost.select();
	   return false;
		}
		
			if(document.BRproductfrm.payment_methods.selectedIndex==0)
	{
		alert("Please Select Payment Methods");	  
		return false;
	}
		
		if(document.BRproductfrm.cancellation_charges.value=="")
	   {
		alert("Please Enter Cancellation Charges");	  
		 document.BRproductfrm.cancellation_charges.focus();
	  document.BRproductfrm.cancellation_charges.select();
	   return false;
		}
	
			if(document.BRproductfrm.cancellation_notice_period.selectedIndex==0)
	{
		alert("Please Select Cancellation Notice Period");	  
		return false;
	}
	
			if(document.BRproductfrm.default_payment_notice.selectedIndex==0)
	{
		alert("Please Enter Default Payment Notice");	  
		return false;
	}
	
	if(document.BRproductfrm.overall_satisfaction.value=="")
	   {
		alert("Please Enter Overall Satisfaction");	  
		 document.BRproductfrm.overall_satisfaction.focus();
	  document.BRproductfrm.overall_satisfaction.select();
	   return false;
		}
	if(document.BRproductfrm.recommend_a_friend.value=="")
	   {
		alert("Please Recommend a Friend");	  
		 document.BRproductfrm.recommend_a_friend.focus();
	  document.BRproductfrm.recommend_a_friend.select();
	   return false;
		}if(document.BRproductfrm.value_for_money.value=="")
	   {
		alert("Please Enter Value for Money");	  
		 document.BRproductfrm.value_for_money.focus();
	  document.BRproductfrm.value_for_money.select();
	   return false;
		}
		if(document.BRproductfrm.customer_support.value=="")
	   {
		alert("Please Enter Customer Support");	  
		 document.BRproductfrm.customer_support.focus();
	  document.BRproductfrm.customer_support.select();
	   return false;
		}
		if(document.BRproductfrm.technical_support.value=="")
	   {
		alert("Please Enter Technical Support");	  
		 document.BRproductfrm.technical_support.focus();
	  document.BRproductfrm.technical_support.select();
	   return false;
		}
		if(document.BRproductfrm.ease_to_interpret_bill.value=="")
	   {
		alert("Please Enter Ease to interpret Bills");	  
		 document.BRproductfrm.ease_to_interpret_bill.focus();
	  document.BRproductfrm.ease_to_interpret_bill.select();
	   return false;
		}
		if(document.BRproductfrm.quality_of_connection.value=="")
	   {
		alert("Please Enter Quality of Connection");	  
		 document.BRproductfrm.quality_of_connection.focus();
	  document.BRproductfrm.quality_of_connection.select();
	   return false;
		}
		
		if(document.BRproductfrm.speed_and_payment_plans.value=="")
	   {
		alert("Please Enter Speed and Paymeny Plans");	  
		 document.BRproductfrm.speed_and_payment_plans.focus();
	  document.BRproductfrm.speed_and_payment_plans.select();
	   return false;
		}
		if(document.BRproductfrm.optimal_plan_assurance.value=="")
	   {
		alert("Please Enter Optimal Plan Assurance");	  
		 document.BRproductfrm.optimal_plan_assurance.focus();
	  document.BRproductfrm.optimal_plan_assurance.select();
	   return false;
		}
		if(document.BRproductfrm.ease_to_start_using_provider.value=="")
	   {
		alert("Please Enter Ease to start Using Provider");	  
		 document.BRproductfrm.ease_to_start_using_provider.focus();
	  document.BRproductfrm.ease_to_start_using_provider.select();
	   return false;
		}
		if(document.BRproductfrm.quality_of_information_provided_during_switching.value=="")
	   {
		alert("Please Enter quality of information provided during switching");	  
		 document.BRproductfrm.quality_of_information_provided_during_switching.focus();
	  document.BRproductfrm.quality_of_information_provided_during_switching.select();
	   return false;
		}
	
}





//==============Validation for Edit Product Features===============//
function validate_br_edit()
{
	//alert('soheb')
//alert(document.BRproductfrm.service_provide.selectedIndex)
/*if(document.BRproductfrm.products.selectedIndex==0)
{
alert("Please Select Product");
return false;
}*/

if(document.BRproductfrm.service_provide.selectedIndex==0)
{
alert("Please Select Service Provide");
return false;
}

	if(document.BRproductfrm.br_down_cap.value=="")
			{
			alert("Please Enter Download Capacity");	  
			//document.BRproductfrm.br_down_cap.focus();
			//document.BRproductfrm.br_down_cap.select();
			return false;
				}
				if(document.BRproductfrm.br_max_speed.value=="")
			{
			alert("Please Enter Maximum Speed");	  
			document.BRproductfrm.br_max_speed.focus();
			document.BRproductfrm.br_max_speed.select();
			return false;
				}
				if(document.BRproductfrm.br_modem.value=="")
			{
			alert("Please Enter Modem Type");	  
			document.BRproductfrm.br_modem.focus();
			document.BRproductfrm.br_modem.select();
			return false;
				}
				if(document.BRproductfrm.br_antivirus.value=="")
			{
			alert("Please Enter Antivirus Protection");	  
			document.BRproductfrm.br_antivirus.focus();
			document.BRproductfrm.br_antivirus.select();
			return false;
				}
				if(document.BRproductfrm.br_firewall.value=="")
			{
			alert("Please Enter FireWall Protection");	  
			document.BRproductfrm.br_firewall.focus();
			document.BRproductfrm.br_firewall.select();
			return false;
				}
				if(document.BRproductfrm.br_security_suite.value=="")
			{
			alert("Please Enter Security Suite");	  
			document.BRproductfrm.br_security_suite.focus();
			document.BRproductfrm.br_security_suite.select();
			return false;
				}
				if(document.BRproductfrm.br_webspace.value=="")
			{
			alert("Please Enter Web Space");	  
			document.BRproductfrm.br_webspace.focus();
			document.BRproductfrm.br_webspace.select();
			return false;
				}
				if(document.BRproductfrm.br_email_cap.value=="")
			{
			alert("Please Enter Email Address Limit");	  
			//document.BRproductfrm.br_email_cap.focus();
			//document.BRproductfrm.br_email_cap.select();
			return false;
				}
				if(document.BRproductfrm.br_space_per_email.value=="")
			{
			alert("Please Enter Space per Email");	  
			document.BRproductfrm.br_space_per_email.focus();
			document.BRproductfrm.br_space_per_email.select();
			return false;
				}
				if(document.BRproductfrm.br_contention_ratio.value=="")
			{
			alert("Please Enter Contention Ratio");	  
			document.BRproductfrm.br_contention_ratio.focus();
			document.BRproductfrm.br_contention_ratio.select();
			return false;
				}
				if(document.BRproductfrm.br_tech_support.value=="")
			{
			alert("Please Enter Technical Support Line");	  
			document.BRproductfrm.br_tech_support.focus();
			document.BRproductfrm.br_tech_support.select();
			return false;
				}
				if(document.BRproductfrm.br_cust_support.value=="")
			{
			alert("Please Enter Custumor Support Line");	  
			document.BRproductfrm.br_cust_support.focus();
			document.BRproductfrm.br_cust_support.select();
			return false;
				}
				if(document.BRproductfrm.br_dynamic_IP.value=="")
			{
			alert("Please Enter Dynamic IP");	  
			document.BRproductfrm.br_dynamic_IP.focus();
			document.BRproductfrm.br_dynamic_IP.select();
			return false;
				}
				if(document.BRproductfrm.br_static_IP.value=="")
			{
			alert("Please Enter Single Static IP ");	  
			document.BRproductfrm.br_static_IP.focus();
			document.BRproductfrm.br_static_IP.select();
			return false;
				}

				if(document.BRproductfrm.br_dail_backup.value=="")
			{
			alert("Please Enter 0845 Dial Backup ");	  
			document.BRproductfrm.br_dail_backup.focus();
			document.BRproductfrm.br_dail_backup.select();
			return false;
				}

	if(document.BRproductfrm.service_provide.value=="Broadband")
		{	
			document.BRproductfrm.ph_name.value="";
			document.BRproductfrm.ph_type.value="";
			document.BRproductfrm.ph_uk_weekend_traffic.value="";
			document.BRproductfrm.ph_uk_evening_traffic.value="";;
			document.BRproductfrm.ph_monthly_subscr.value="";
			document.BRproductfrm.ph_intern_traffic.value="";
			document.BRproductfrm.ph_mobile_traffic.value="";
			document.BRproductfrm.ph_peak_traffic.value="";
			document.BRproductfrm.ph_handset.value="";
			document.BRproductfrm.ph_singlecall_duration.value="";
			document.BRproductfrm.ph_additional_info.value="";

			document.BRproductfrm.tv_name.value="";
			document.BRproductfrm.tv_type.value="";
			document.BRproductfrm.tv_installation.value="";
			document.BRproductfrm.tv_subscr_fee.value="";
			document.BRproductfrm.tv_non_subscr_channels.value="";
			document.BRproductfrm.tv_subscr_channels.value="";
			document.BRproductfrm.tv_pay_per_view.value="";
			document.BRproductfrm.tv_additional_info.value="";


			}

	else if(document.BRproductfrm.service_provide.value=="Broadband/Phone")
		{
		if(document.BRproductfrm.ph_name.value=="")
			{
			alert("Please Enter Phone Name ");	  
			document.BRproductfrm.ph_name.focus();
			document.BRproductfrm.ph_name.select();
			return false;
				}
		
					if(document.BRproductfrm.ph_type.value=="")
			{
			alert("Please Enter Phone Type ");	  
			document.BRproductfrm.ph_type.focus();
			document.BRproductfrm.ph_type.select();
			return false;
				}
				if(document.BRproductfrm.ph_uk_weekend_traffic.value=="")
			{
			alert("Please Enter UK Weekend Traffic ");	  
			document.BRproductfrm.ph_uk_weekend_traffic.focus();
			document.BRproductfrm.ph_uk_weekend_traffic.select();
			return false;
				}
				if(document.BRproductfrm.ph_uk_evening_traffic.value=="")
			{
			alert("Please Enter UK Evening Traffic ");	  
			document.BRproductfrm.ph_uk_evening_traffic.focus();
			document.BRproductfrm.ph_uk_evening_traffic.select();
			return false;
				}
				if(document.BRproductfrm.ph_monthly_subscr.value=="")
			{
			alert("Please Enter Month Subscription ");	  
			document.BRproductfrm.ph_monthly_subscr.focus();
			document.BRproductfrm.ph_monthly_subscr.select();
			return false;
				}
				if(document.BRproductfrm.ph_intern_traffic.value=="")
			{
			alert("Please Enter International Traffic ");	  
			document.BRproductfrm.ph_intern_traffic.focus();
			document.BRproductfrm.ph_intern_traffic.select();
			return false;
				}
		

				if(document.BRproductfrm.ph_mobile_traffic.value=="")
			{
			alert("Please Enter Mobile Traffic ");	  
			document.BRproductfrm.ph_mobile_traffic.focus();
			document.BRproductfrm.ph_mobile_traffic.select();
			return false;
				}
				if(document.BRproductfrm.ph_peak_traffic.value=="")
			{
			alert("Please Enter Peak Traffic ");	  
			document.BRproductfrm.ph_peak_traffic.focus();
			document.BRproductfrm.ph_peak_traffic.select();
			return false;
				}

				if(document.BRproductfrm.ph_handset.value=="")
			{
			alert("Please Enter Handset ");	  
			document.BRproductfrm.ph_handset.focus();
			document.BRproductfrm.ph_handset.select();
			return false;
				}

			
				if(document.BRproductfrm.ph_singlecall_duration.value=="")
			{
			alert("Please Enter Single Call Duration ");	  
			document.BRproductfrm.ph_singlecall_duration.focus();
			document.BRproductfrm.ph_singlecall_duration.select();
			return false;
				}

					
			document.BRproductfrm.tv_name.value="";
			document.BRproductfrm.tv_type.value="";
			document.BRproductfrm.tv_installation.value="";
			document.BRproductfrm.tv_subscr_fee.value="";
			document.BRproductfrm.tv_non_subscr_channels.value="";
			document.BRproductfrm.tv_subscr_channels.value="";
			document.BRproductfrm.tv_pay_per_view.value="";
			document.BRproductfrm.tv_additional_info.value="";

			}
		

else if(document.BRproductfrm.service_provide.value=="Broadband/Phone/TV")
		{
			if(document.BRproductfrm.ph_name.value=="")
			{
			alert("Please Enter Phone Name ");	  
			document.BRproductfrm.ph_name.focus();
			document.BRproductfrm.ph_name.select();
			return false;
				}
		
				if(document.BRproductfrm.ph_type.value=="")
			{
			alert("Please Enter Phone Type ");	  
			document.BRproductfrm.ph_type.focus();
			document.BRproductfrm.ph_type.select();
			return false;
				}
				if(document.BRproductfrm.ph_uk_weekend_traffic.value=="")
			{
			alert("Please Enter UK Weekend Traffic ");	  
			document.BRproductfrm.ph_uk_weekend_traffic.focus();
			document.BRproductfrm.ph_uk_weekend_traffic.select();
			return false;
				}
				if(document.BRproductfrm.ph_uk_evening_traffic.value=="")
			{
			alert("Please Enter UK Evening Traffic ");	  
			document.BRproductfrm.ph_uk_evening_traffic.focus();
			document.BRproductfrm.ph_uk_evening_traffic.select();
			return false;
				}
				if(document.BRproductfrm.ph_monthly_subscr.value=="")
			{
			alert("Please Enter Month Subscription ");	  
			document.BRproductfrm.ph_monthly_subscr.focus();
			document.BRproductfrm.ph_monthly_subscr.select();
			return false;
				}
				if(document.BRproductfrm.ph_intern_traffic.value=="")
			{
			alert("Please Enter International Traffic ");	  
			document.BRproductfrm.ph_intern_traffic.focus();
			document.BRproductfrm.ph_intern_traffic.select();
			return false;
				}
				if(document.BRproductfrm.ph_mobile_traffic.value=="")
			{
			alert("Please Enter Mobile Traffic ");	  
			document.BRproductfrm.ph_mobile_traffic.focus();
			document.BRproductfrm.ph_mobile_traffic.select();
			return false;
				}
				if(document.BRproductfrm.ph_peak_traffic.value=="")
			{
			alert("Please Enter Peak Traffic ");	  
			document.BRproductfrm.ph_peak_traffic.focus();
			document.BRproductfrm.ph_peak_traffic.select();
			return false;
				}

				if(document.BRproductfrm.ph_handset.value=="")
			{
			alert("Please Enter Handset ");	  
			document.BRproductfrm.ph_handset.focus();
			document.BRproductfrm.ph_handset.select();
			return false;
				}
				if(document.BRproductfrm.ph_singlecall_duration.value=="")
			{
			alert("Please Enter Single Call Duration ");	  
			document.BRproductfrm.ph_singlecall_duration.focus();
			document.BRproductfrm.ph_singlecall_duration.select();
			return false;
				}
		
			
	   if(document.BRproductfrm.tv_name.value=="")
			{
			alert("Please Enter Digital TV Name ");	  
			document.BRproductfrm.tv_name.focus();
			document.BRproductfrm.tv_name.select();
			return false;
				}
				 if(document.BRproductfrm.tv_type.value=="")
			{
			alert("Please Enter Digital TV Type ");	  
			document.BRproductfrm.tv_type.focus();
			document.BRproductfrm.tv_type.select();
			return false;
				}


					 if(document.BRproductfrm.tv_installation.value=="")
			{
			alert("Please Enter Digital TV Installation Charge ");	  
			document.BRproductfrm.tv_installation.focus();
			document.BRproductfrm.tv_installation.select();
			return false;
				}
				 if(document.BRproductfrm.tv_subscr_fee.value=="")
			{
			alert("Please Enter Subscription Fee ");	  
			document.BRproductfrm.tv_subscr_fee.focus();
			document.BRproductfrm.tv_subscr_fee.select();
			return false;
				}
		
				 if(document.BRproductfrm.tv_non_subscr_channels.value=="")
			{
			alert("Please Enter Non-Subscription Channels ");	  
			document.BRproductfrm.tv_non_subscr_channels.focus();
			document.BRproductfrm.tv_non_subscr_channels.select();
			return false;
				}

			
			 if(document.BRproductfrm.tv_subscr_channels.value=="")
			{
			alert("Please Enter Subscription Channels ");	  
			document.BRproductfrm.tv_subscr_channels.focus();
			document.BRproductfrm.tv_subscr_channels.select();
			return false;
				}
				 if(document.BRproductfrm.tv_pay_per_view.value=="")
			{
			alert("Please Enter Pay Per View Channel ");	  
			document.BRproductfrm.tv_pay_per_view.focus();
			document.BRproductfrm.tv_pay_per_view.select();
			return false;
				}
				 
			}
}
//============= Validation Function For Insurance Provider========//

function isAlphanumeric(s, AllowSpace, AllowUnderscore)
  {
  var i;

  // Search through string's chars one by one until we find a 
  // non-alphanumeric char, then return false; if we don't, return true

  for (i = 0; i < s.length; i++)
    {   
    // Check that current character is number or letter
    var c = s.charAt(i);
		if (!(isLetter(c) || isDigit(c) )){
			switch(c){
				case "_" :
					if(!AllowUnderscore) {
						return false;
					}
					break ;
				case " " :
					if(!AllowSpace){
						return false;
					}
					break ;
				case "-" :
					break;
				default :
					return false;
			}	
		}
    }
	// All characters are numbers or letters
	return true;
  }
  function isLetter(c)
  {
  return (((c >= "a") && (c <= "z")) || ((c >= "A") && (c <= "Z")));
  }


// Returns true if character c is a digit (0 .. 9)

function isDigit(c)
  {
  return ((c >= "0") && (c <= "9"));
  }

function validate_insurance_provider()
{
	//frm=document.insuranceprovider;
	/* if(document.insuranceprovider.provider_name.value=="")
	 {
	  alert("Please,Enter Provider Name");
	  document.insuranceprovider.provider_name.focus();
	  document.insuranceprovider.provider_name.select();
	  return false;
	 
	 }

	 if(IsNumeric(document.insuranceprovider.provider_name.value==""))
	 {
	  alert("Please Enter Valid Provider Name");
	  document.insuranceprovider.provider_name.focus();
	  document.insuranceprovider.provider_name.select();
	   return false;
	 }*/
	/* if (frm.provider_name.value=='' || frm.provider_name.value==0 )
	{
		alert("Please fill in Provider Name")
		frm.provider_name.value="";
		frm.provider_name.focus();		
		return false;
	}
	 if(document.insuranceprovider.insurance_type.value=="")
	 {
	  alert("Please,Enter Insurance Type");
	  document.insuranceprovider.insurance_type.focus();
	  return false;
	 
	 }
	
	
	if(document.insuranceprovider.phone_no.value=="")
		{
			alert("Please fill in Your Phone Number as Numbers  ");
			document.insuranceprovider.phone_no.focus();
			document.insuranceprovider.phone_no.select();
			return false;
		}
    
	 if(!valid_email(document.insuranceprovider.email.value))
	  {
		alert('Please Enter Valid Email ,Try again!');
		
		document.insuranceprovider.email.focus();
		document.insuranceprovider.email.select();
		return false;
	  }
    if(document.insuranceprovider.website.value=="")
	 {
	  alert("Please,Enter Website Url");
	  document.insuranceprovider.website.focus();
	  document.insuranceprovider.website.select();
	  return false;
	 
	 }
	if(document.insuranceprovider.phone_no.value=="")
		{
			alert("Please fill in Your Phone Number as Numbers  ");
			document.insuranceprovider.phone_no.focus();
			document.insuranceprovider.phone_no.select();
			return false;
		}
	 if(frm.address.value=="")
		{
		alert("Please fill in Your Address  ");
		document.insuranceprovider.address.focus();
		document.insuranceprovider.address.select();
		return false;
		}
	 if(document.insuranceprovider.postcode.value=="")
		{
		alert("Please fill in Your PostCode  ");
		document.insuranceprovider.postcode.focus();
		document.insuranceprovider.postcode.select();
		return false;
		}
	
      if(document.insuranceprovider.city.value=="")
		{
		alert("Please fill in Your City ");
		document.insuranceprovider.city.focus();
		document.insuranceprovider.city.select();
		return false;
		}
	 if(document.insuranceprovider.detail_url.value!="")
		{
		 if(!isUrl(document.frmloan.detail_url.value))
	      {
			alert("Please fill in Your Details Url ");
			document.insuranceprovider.detail_url.focus();
			document.insuranceprovider.detail_url.select();
			return false;
		  }
		}
		if(document.insuranceprovider.icon_url.value=="")
		{
		alert("Please fill in Your  Icon Url ");
		document.insuranceprovider.icon_url.focus();
		document.insuranceprovider.icon_url.select();
		return false;
		}
	*/
}

//================  Validation Function For Plan Tariff =============//
 function validate_plan_tariff()
 {
 
   if(document.plan_tariff_frm.plan.selectedIndex==0)
	 {
	  alert("Please,Select Plan");
	  return false;
	 }
   if(document.plan_tariff_frm.area.selectedIndex==0)
	 {
	  alert("Please,Select Area");
	  return false;
	 }
	 if(document.plan_tariff_frm.day_time_area.value=="")
	 {
	  alert("Please,Enter Day Time");
	  document.plan_tariff_frm.day_time_area.focus();
	  document.plan_tariff_frm.day_time_area.select();
	  return false;
	 }
	 if(IsString(document.plan_tariff_frm.day_time_area.value))
	 {
	  alert("Please Enter Valid Day Time");
	  document.plan_tariff_frm.day_time_area.focus();
	  document.plan_tariff_frm.day_time_area.select();
	  return false;
	 }
     if(document.plan_tariff_frm.evening_area.value=="")
	 {
	  alert("Please,Enter Evening Time");
	  document.plan_tariff_frm.evening_area.focus();
	  document.plan_tariff_frm.evening_area.select();
	  return false;
	 }
	 if(IsString(document.plan_tariff_frm.evening_area.value))
	 {
	  alert("Please Enter Valid Evening Time");
	  document.plan_tariff_frm.evening_area.focus();
	  document.plan_tariff_frm.evening_area.select();
	  return false;
	 }
	 if(document.plan_tariff_frm.weekend_day_area.value=="")
	 {
	  alert("Please,Enter Weekend Day Time");
	  document.plan_tariff_frm.weekend_day_area.focus();
	  document.plan_tariff_frm.weekend_day_area.select();
	  return false;
	 }
	 if(IsString(document.plan_tariff_frm.weekend_day_area.value))
	 {
	  alert("Please Enter Valid Weekend Day Time");
	  document.plan_tariff_frm.weekend_day_area.focus();
	  document.plan_tariff_frm.weekend_day_area.select();
	  return false;
	 }
	 if(document.plan_tariff_frm.weekend_eve_area.value=="")
	 {
	  alert("Please,Enter Weekend Evening Time");
	  document.plan_tariff_frm.weekend_eve_area.focus();
	  document.plan_tariff_frm.weekend_eve_area.select();
	  return false;
	 }
	 if(IsString(document.plan_tariff_frm.weekend_eve_area.value))
	 {
	  alert("Please Enter Valid Weekend Evening Time");
	  document.plan_tariff_frm.weekend_eve_area.focus();
	  document.plan_tariff_frm.weekend_eve_area.select();
	  return false;
	 }
 
 }
//===============End Of Function=====================================//
//================= Validation Function For Plan Network=============//
function validate_network_frm()
{

if(document.plan_network_frm.mobile_networks.selectedIndex==0)
	 {
	  alert("Please,Select Network");
	  return false;
	 }
   
	 if(document.plan_network_frm.day_time_nw.value=="")
	 {
	  alert("Please,Enter Day Time Network");
	  document.plan_network_frm.day_time_nw.focus();
	  document.plan_network_frm.day_time_nw.select();
	  return false;
	 }
	 if(document.plan_network_frm.evening_nw.value=="")
	 {
	  alert("Please,Enter Evening Network Time");
	  document.plan_network_frm.evening_nw.focus();
	  document.plan_network_frm.evening_nw.select();
	  return false;
	 }
	 if(document.plan_network_frm.weekend_day_nw.value=="")
	 {
	  alert("Please,Enter Weekend Evening Network Time");
	  document.plan_network_frm.weekend_day_nw.focus();
	  document.plan_network_frm.weekend_day_nw.select();
	  return false;
	 }
	 if(document.plan_network_frm.weekend_eve_nw.value=="")
	 {
	  alert("Please,Enter Weekend Evening Network Time");
	  document.plan_network_frm.weekend_eve_nw.focus();
	  document.plan_network_frm.weekend_eve_nw.select();
	  return false;
	 }
	

}
//=============== End Of Function ==================================//
//=============== Validation Function For Plan Internatinal ========//
function validate_plan_international()
{
 if(document.plan_inter_frm.international.selectedIndex==0)
	 {
	  alert("Please,Select International");
	  return false;
	 }
   
	 if(document.plan_inter_frm.day_time.value=="")
	 {
	  alert("Please,Enter Day Time");
	  document.plan_inter_frm.day_time.focus();
	  document.plan_inter_frm.day_time.select();
	  return false;
	 }
	 if(document.plan_inter_frm.evening.value=="")
	 {
	  alert("Please,Enter Evening Time");
	  document.plan_inter_frm.evening.focus();
	  document.plan_inter_frm.evening.select();
	  return false;
	 }
	 if(document.plan_inter_frm.weekend_day.value=="")
	 {
	  alert("Please,Enter Weekend Day Time");
	  document.plan_inter_frm.weekend_day.focus();
	  document.plan_inter_frm.weekend_day.select();
	  return false;
	 }
	 if(document.plan_inter_frm.weekend_eve.value=="")
	 {
	  alert("Please,Enter Weekend Evening Time");
	  document.plan_inter_frm.weekend_eve.focus();
	  document.plan_inter_frm.weekend_eve.select();
	  return false;
	 }
}

//================ End Of Function ===================================//

function ValidateEmail(ctl)
	{
    var id=ctl;
	var at=id.value.indexOf('@');
	var lastat=id.value.lastIndexOf('@');
	var dot=id.value.indexOf('.');
	lastdot=id.value.lastIndexOf('.')
	if ( !( (0 < at) && (at < (lastdot-1)) && (lastdot < (id.value.length-1)) && (at == lastat) ) )
	{
	  error = 1;
	  alert("Email address is not formatted properly.");
	  ctl.focus();
	
	  return (false);
	}
	var str_referral=id.value.length;
	var ch_referral=id.value;
	for(i=0;i<str_referral;i++)
	{
		ch_referral1=ch_referral.substring(i,i+1);

		if(ch_referral1==" ")
		{
			alert("Please Enter Valid Email address Id need not content any space.");
			ctl.focus();
			return (false);
		}
	}
}

// ======================== Validation Function For Review ============= //
 function validate_review()
{
		if(document.reviewfrm.email.value=="")
	{
		alert("Please,Enter Email Address");
		document.reviewfrm.email.focus();
		document.reviewfrm.email.select();
		return false;

	}

	if(!valid_email(document.reviewfrm.email.value))
	{
		alert("Please Enter Valid Email Address");
		document.reviewfrm.email.focus();
		document.reviewfrm.email.select();
			return false;
	}
	if((document.reviewfrm.level.selectedIndex)==0)
		{
	alert('Please Select Level,Try again!');

	return false;
		}

	if(document.reviewfrm.comment.value=="")
	{
		alert("Please,Enter Comment");
		document.reviewfrm.comment.focus();
		document.reviewfrm.comment.select();
		return false;

	}
							
}

//================== VAlidation Function For Voip Provider ============= //
function validate_voip()
{
	 if(document.voipfrm.first_name.value=="")
	 {
	   alert("Please,Enter First Name");
		document.voipfrm.first_name.focus();
		document.voipfrm.first_name.select();
		return false;
	 }
	 if(document.voipfrm.last_name.value=="")
	 {
	   alert("Please,Enter Last Name");
		document.voipfrm.last_name.focus();
		document.voipfrm.last_name.select();
		return false;
	 }
	 if(document.voipfrm.postcode.value=="")
	 {
	   alert("Please,Enter PostCode");
		document.voipfrm.postcode.focus();
		document.voipfrm.postcode.select();
		return false;
	 }
	 if(document.voipfrm.email.value=="")
	 {
	   alert("Please,Enter Email");
		document.voipfrm.email.focus();
		document.voipfrm.email.select();
		return false;
	 }
     if(!valid_email(document.voipfrm.email.value))
	 {
	   alert("Please,Enter Valid Email Address");
		document.voipfrm.email.focus();
		document.voipfrm.email.select();
		return false;
	 }
	 if(document.voipfrm.monthly_rent_cost.value=="")
	 {
	   alert("Please,Enter Monthly Rental Cost");
		document.voipfrm.monthly_rent_cost.focus();
		document.voipfrm.monthly_rent_cost.select();
		return false;
	 } 
	 if(document.voipfrm.signup_cost.value=="")
	 {
	   alert("Please,Enter Sign Up Cost");
		document.voipfrm.signup_cost.focus();
		document.voipfrm.signup_cost.select();
		return false;
	 }
	 if(document.voipfrm.call_rate.value=="")
	 {
	   alert("Please,Enter Call Rate");
		document.voipfrm.call_rate.focus();
		document.voipfrm.call_rate.select();
		return false;
	 }
	 if(document.voipfrm.free_call.value=="")
	 {
	   alert("Please,Enter Free Call ");
		document.voipfrm.free_call.focus();
		document.voipfrm.free_call.select();
		return false;
	 }
	 if(document.voipfrm.emergency_call.value=="")
	 {
	   alert("Please,Enter Emergency Call ");
		document.voipfrm.emergency_call.focus();
		document.voipfrm.emergency_call.select();
		return false;
	 }
	 if(document.voipfrm.extra_needed.value=="")
	 {
	   alert("Please,Enter Extra Needed ");
		document.voipfrm.extra_needed.focus();
		document.voipfrm.extra_needed.select();
		return false;
	 }

}

//================== VAlidation Function For Product Package Editing ============= //
function validate_package_edit()
{
	if((document.packagefrm.products.selectedIndex)==0)
	{
		alert('Please Select Product Name,Try again!');
		return false;
	}

	if(document.packagefrm.br_monthly_fees.value=="")
	{
		alert("Please Enter Monthly Fee");	  
		document.packagefrm.br_monthly_fees.focus();
		document.packagefrm.br_monthly_fees.select();
		return false;
	}
	if(document.packagefrm.br_service_type.selectedIndex==0)
	{
		alert("Please Select Service Type");	  
		return false;
	}
	if(document.packagefrm.br_connection_type.selectedIndex==0)
	{
		alert("Please Select Connection Type");	  
		return false;
	}
	if(document.packagefrm.br_down_speed.selectedIndex==0)
	{
		alert("Please Select Download Speed");	  
		return false;
	}
	if(document.packagefrm.br_spam_protection.value=="")
	{
		alert("Please Enter Spam Protection");	  
		document.packagefrm.br_spam_protection.focus();
		document.packagefrm.br_spam_protection.select();
		return false;
	}
	if(document.packagefrm.br_virus_protection.value=="")
	{
		alert("Please Enter Virus Protection");	  
		document.packagefrm.br_virus_protection.focus();
		document.packagefrm.br_virus_protection.select();
		return false;
	}
	if(document.packagefrm.br_spyware_protection.value=="")
	{
		alert("Please Enter Spyware Protection");	  
		document.packagefrm.br_spyware_protection.focus();
		document.packagefrm.br_spyware_protection.select();
		return false;
	}
	if(document.packagefrm.br_personal_firewall.value=="")
	{
		alert("Please Enter Firewall Service");	  
		document.packagefrm.br_personal_firewall.focus();
		document.packagefrm.br_personal_firewall.select();
		return false;
	}
	if(document.packagefrm.br_email_address.value=="")
	{
		alert("Please Enter Email Address");	  
		document.packagefrm.br_email_address.focus();
		document.packagefrm.br_email_address.select();
		return false;
	}
	if(document.packagefrm.br_email_space.value=="")
	{
		alert("Please Enter Email Space");	  
		document.packagefrm.br_email_space.focus();
		document.packagefrm.br_email_space.select();
		return false;
	}
	if(document.packagefrm.br_webmail.value=="")
	{
		alert("Please Select Webmail");	  
		return false;
	}
	if(document.packagefrm.br_personal_webpage.value=="")
	{
		alert("Please Select Personal Webpage");	  
		return false;
	}
	if(document.packagefrm.br_web_space.value=="")
	{
		alert("Please Enter Web Space");	  
		document.packagefrm.br_web_space.focus();
		document.packagefrm.br_web_space.select();
		return false;
	}
	if(document.packagefrm.br_free_web_space.value=="")
	{
		alert("Please Enter Free Webspace");
		document.packagefrm.br_free_web_space.focus();
		document.packagefrm.br_free_web_space.select();
		return false;
	}
	if(document.packagefrm.br_activation_fee.value=="")
	{
		alert("Please Enter Setup/Activation Fee");
		document.packagefrm.br_activation_fee.focus();
		document.packagefrm.br_activation_fee.select();
		return false;
	}
	if(document.packagefrm.payment_methods.selectedIndex==0)
	{
		alert("Please Select Payment Methods");	  
		return false;
	}
	if(document.packagefrm.supported_operating_system.selectedIndex==0)
	{
		alert("Please Select Supported Operating System");	  
		return false;
	}
	if(document.packagefrm.br_static_ip_address.value=="")
	{
		alert("Please Enter Static IP Address");
		document.packagefrm.br_static_ip_address.focus();
		document.packagefrm.br_static_ip_address.select();
		return false;
	}
	if(document.packagefrm.br_dialup_hours.selectedIndex==0)
	{
		alert("Please Select Dialup Hours");	  
		return false;
	}
	if(document.packagefrm.br_wireless_router.value=="")
	{
		alert("Please Select Wireless Router");	  
		return false;
	}
	if(document.packagefrm.br_web_space.value=="")
	{
		alert("Please Enter Web Space");	  
		document.packagefrm.br_web_space.focus();
		document.packagefrm.br_web_space.select();
		return false;
	}
	if(document.packagefrm.br_free_web_space.value=="")
	{
		alert("Please Enter Free Webspace");
		document.packagefrm.br_free_web_space.focus();
		document.packagefrm.br_free_web_space.select();
		return false;
	}
	
	if(document.packagefrm.br_modem_rental.value=="")
	{
		alert("Please Enter Modem Rental");
		document.packagefrm.br_modem_rental.focus();
		document.packagefrm.br_modem_rental.select();
		return false;
	}
	
	if(document.packagefrm.br_modem_deposit.value=="")
	{
		alert("Please Enter Modem Deposit");
		document.packagefrm.br_modem_deposit.focus();
		document.packagefrm.br_modem_deposit.select();
		return false;
	}
	if(document.packagefrm.br_sell_modem.value=="")
	{
		alert("Please Enter Sell Modem");
		document.packagefrm.br_sell_modem.focus();
		document.packagefrm.br_sell_modem.select();
		return false;
	}
	
}


//================== VAlidation Function For Broadband Product Editing ============= //
function validate_br_product_edit()
{
	if((document.productfrm.product_name.value)=="")
	{
		alert('Please Enter Product Name,Try again!');
		return false;
	}
	
	if((document.productfrm.supplier_id.selectedIndex)==0)
	{
		alert('Please Select Supplier Name,Try again!');
		return false;
	}
	if(document.productfrm.monthly_cost.value=="")
	{
		alert("Please Enter Monthly Cost");	  
		document.productfrm.monthly_cost.focus();
		document.productfrm.monthly_cost.select();
		return false;
	}
	
	if(document.productfrm.contract.selectedIndex==0)
	{
		alert("Please Select Contract Type");	  
		return false;
	}
	if(document.productfrm.activation_cost.value=="")
	{
		alert("Please Enter Monthly Cost");	  
		document.productfrm.activation_cost.focus();
		document.productfrm.activation_cost.select();
		return false;
	}
	
		if(document.productfrm.cancellation_charges.value=="")
	{
		alert("Please Enter Cancellation Charges");	  
		document.productfrm.cancellation_charges.focus();
		document.productfrm.cancellation_charges.select();
		return false;
	}
	
	if(document.productfrm.cancellation_notice_period.selectedIndex==0)
	{
		alert("Please Select Cancellation Notice Period");	  
		return false;
	}
	
		/*if(document.productfrm.default_payment_notice.selectedIndex==0)
	{
		alert("Please Select Default Notice Period");	  
		return false;
	}*/
	
		if(document.productfrm.overall_satisfaction.value=="")
	{
		alert("Please Enter Overall Satifaction Status");	  
		document.productfrm.overall_satisfaction.focus();
		document.productfrm.overall_satisfaction.select();
		return false;
	}
	
		if(document.productfrm.recommend_friend.value=="")
	{
		alert("Please Recommend a Friend");	  
		document.productfrm.recommend_friend.focus();
		document.productfrm.recommend_friend.select();
		return false;
	}
		if(document.productfrm.value_for_money.value=="")
	{
		alert("Please Enter Value for Money");	  
		document.productfrm.value_for_money.focus();
		document.productfrm.value_for_money.select();
		return false;
	}
		if(document.productfrm.customer_support.value=="")
	{
		alert("Please Enter Customer Support");	  
		document.productfrm.customer_support.focus();
		document.productfrm.customer_support.select();
		return false;
	}
		if(document.productfrm.technical_support.value=="")
	{
		alert("Please Enter Technical Support");	  
		document.productfrm.technical_support.focus();
		document.productfrm.technical_support.select();
		return false;
	}
	
		if(document.productfrm.ease_to_interpret_bill.value=="")
	{
		alert("Please Enter Esae to Interpret Bills");	  
		document.productfrm.ease_to_interpret_bill.focus();
		document.productfrm.ease_to_interpret_bill.select();
		return false;
	}
		if(document.productfrm.quality_of_connection.value=="")
	{
		alert("Please Enter Quality of Connection");	  
		document.productfrm.quality_of_connection.focus();
		document.productfrm.quality_of_connection.select();
		return false;
	}
		if(document.productfrm.speed_and_payment_plans.value=="")
	{
		alert("Please Enter Payment Plans");	  
		document.productfrm.speed_and_payment_plans.focus();
		document.productfrm.speed_and_payment_plans.select();
		return false;
	}
		if(document.productfrm.optimal_plan_assurance.value=="")
	{
		alert("Please Enter Optimal Plan Assurance");	  
		document.productfrm.optimal_plan_assurance.focus();
		document.productfrm.optimal_plan_assurance.select();
		return false;
	}
		if(document.productfrm.ease_to_start_using_provider.value=="")
	{
		alert("Please Enter ease to start Using Provider");	  
		document.productfrm.ease_to_start_using_provider.focus();
		document.productfrm.ease_to_start_using_provider.select();
		return false;
	}
	if(document.productfrm.quality_of_information_provided_during_switching.value=="")
	{
		alert("Please Enter quality of information Provided During Switching");	  
		document.productfrm.quality_of_information_provided_during_switching.focus();
		document.productfrm.quality_of_information_provided_during_switching.select();
		return false;
	}
	
}

// Zarafat: 20/11/2008 Function for validation of prduct features edit form

function validate_product_features_edit()
{
	if((document.productfrm.product_name.selectedIndex)==0)
	{
		alert('Please Select Product Name,Try again!');
		return false;
	}
	
	if((document.productfrm.supplier.selectedIndex)==0)
	{
		alert('Please Select Supplier Name,Try again!');
		return false;
	}
	if(document.productfrm.monthly_cost.value=="")
	{
		alert("Please Enter Monthly Cost");	  
		document.productfrm.monthly_cost.focus();
		document.productfrm.monthly_cost.select();
		return false;
	}
	
	if(document.productfrm.contract.selectedIndex==0)
	{
		alert("Please Select Contract Type");	  
		return false;
	}
	if(document.productfrm.activation_cost.value=="")
	{
		alert("Please Enter Monthly Cost");	  
		document.productfrm.activation_cost.focus();
		document.productfrm.activation_cost.select();
		return false;
	}
	
		if(document.productfrm.cancellation_charges.value=="")
	{
		alert("Please Enter Cancellation Charges");	  
		document.productfrm.cancellation_charges.focus();
		document.productfrm.cancellation_charges.select();
		return false;
	}
	
	if(document.productfrm.cancellation_notice_period.selectedIndex==0)
	{
		alert("Please Select Cancellation Notice Period");	  
		return false;
	}
	
		/*if(document.productfrm.default_payment_notice.selectedIndex==0)
	{
		alert("Please Select Default Notice Period");	  
		return false;
	}*/
	
		if(document.productfrm.overall_satisfaction.value=="")
	{
		alert("Please Enter Overall Satifaction Status");	  
		document.productfrm.overall_satisfaction.focus();
		document.productfrm.overall_satisfaction.select();
		return false;
	}
	
		if(document.productfrm.recommend_friend.value=="")
	{
		alert("Please Recommend a Friend");	  
		document.productfrm.recommend_friend.focus();
		document.productfrm.recommend_friend.select();
		return false;
	}
		if(document.productfrm.value_for_money.value=="")
	{
		alert("Please Enter Value for Money");	  
		document.productfrm.value_for_money.focus();
		document.productfrm.value_for_money.select();
		return false;
	}
		if(document.productfrm.customer_support.value=="")
	{
		alert("Please Enter Customer Support");	  
		document.productfrm.customer_support.focus();
		document.productfrm.customer_support.select();
		return false;
	}
		if(document.productfrm.technical_support.value=="")
	{
		alert("Please Enter Technical Support");	  
		document.productfrm.technical_support.focus();
		document.productfrm.technical_support.select();
		return false;
	}
	
		if(document.productfrm.ease_to_interpret_bill.value=="")
	{
		alert("Please Enter Esae to Interpret Bills");	  
		document.productfrm.ease_to_interpret_bill.focus();
		document.productfrm.ease_to_interpret_bill.select();
		return false;
	}
		if(document.productfrm.quality_of_connection.value=="")
	{
		alert("Please Enter Quality of Connection");	  
		document.productfrm.quality_of_connection.focus();
		document.productfrm.quality_of_connection.select();
		return false;
	}
		if(document.productfrm.speed_and_payment_plans.value=="")
	{
		alert("Please Enter Payment Plans");	  
		document.productfrm.speed_and_payment_plans.focus();
		document.productfrm.speed_and_payment_plans.select();
		return false;
	}
		if(document.productfrm.optimal_plan_assurance.value=="")
	{
		alert("Please Enter Optimal Plan Assurance");	  
		document.productfrm.optimal_plan_assurance.focus();
		document.productfrm.optimal_plan_assurance.select();
		return false;
	}
		if(document.productfrm.ease_to_start_using_provider.value=="")
	{
		alert("Please Enter ease to start Using Provider");	  
		document.productfrm.ease_to_start_using_provider.focus();
		document.productfrm.ease_to_start_using_provider.select();
		return false;
	}
	if(document.productfrm.quality_of_information_provided_during_switching.value=="")
	{
		alert("Please Enter quality of information Provided During Switching");	  
		document.productfrm.quality_of_information_provided_during_switching.focus();
		document.productfrm.quality_of_information_provided_during_switching.select();
		return false;
	}
	
}


// ========== Validation Function For Broadband Search On User Side ===== //
function broadband_search()
{
 if(document.sortfrm.region.selectedIndex==0)
  {
   alert("Please,Select the Region");
   return false;
  }
 
 
 if(document.sortfrm.contract.selectedIndex==0)
  {
   alert("Please,Select the Contract duration");
   return false;
  }



}
// ========== Validation Function For Bundles On Admin Side ===== //
function validate_bundles()
{
 if(document.bundlesfrm.supplier.selectedIndex==0)
	 {
	  alert("Please,Select Supplier");
	  return false;
	 } 
if(document.bundlesfrm.types.selectedIndex==0)
	 {
	  alert("Please,Select type of bundle");
	  return false;
	 } 
if(document.bundlesfrm.bundles_name.value=="")
  {
	  alert("Please, Enter name of the bundles");
	  document.bundlesfrm.bundles_name.focus();
	  document.bundlesfrm.bundles_name.select();
	  return false;
  }
  if(document.bundlesfrm.bundles_cost.value=="")
   {
    alert("Please Enter bundles monthly cost");
	document.bundlesfrm.bundles_cost.focus();
	document.bundlesfrm.bundles_cost.select();
	return false;
   }
  if(IsString(document.bundlesfrm.bundles_cost.value))
   {
    alert("Please Enter Only Numeric digit");
	document.bundlesfrm.bundles_cost.focus();
	document.bundlesfrm.bundles_cost.select();
	return false;
   }
   if(document.bundlesfrm.avg_cost.value=="")
   {
    alert("Please Enter average monthly cost");
	document.bundlesfrm.avg_cost.focus();
	document.bundlesfrm.avg_cost.select();
	return false;
   }
   if(IsString(document.bundlesfrm.avg_cost.value))
   {
    alert("Please Enter Only Numeric digit");
	document.bundlesfrm.avg_cost.focus();
	document.bundlesfrm.avg_cost.select();
	return false;
   }
if(document.bundlesfrm.contract.selectedIndex==0)
	 {
	  alert("Please,Select Contract");
	  return false;
	 }
if(document.bundlesfrm.setup_cost.value=="")
  {
	  alert("Please, Enter Setup cost");
	  document.bundlesfrm.setup_cost.focus();
	  document.bundlesfrm.setup_cost.select();
	  return false;
  }
if(IsString(document.bundlesfrm.setup_cost.value))
  {
	  alert("Please, Enter Numeric digits only");
	  document.bundlesfrm.setup_cost.focus();
	  document.bundlesfrm.setup_cost.select();
	  return false;
  }
if(document.bundlesfrm.others.value=="")
  {
	  alert("Please, Enter Other information cost");
	  document.bundlesfrm.others.focus();
	  document.bundlesfrm.others.select();
	  return false;
  }
}

//==================== Validation Function For Broadband Bundles Edit =====/
function validate_editbundles()
{
 if(document.editfrm.supplier.selectedIndex==0)
	 {
	  alert("Please,Select Supplier");
	  return false;
	 } 
if(document.editfrm.types.selectedIndex==0)
	 {
	  alert("Please,Select type of bundle");
	  return false;
	 } 
if(document.editfrm.bundles_name.value=="")
  {
	  alert("Please, Enter name of the bundles");
	  document.editfrm.bundles_name.focus();
	  document.editfrm.bundles_name.select();
	  return false;
  }
  if(IsString(document.editfrm.bundles_monthly_cost.value))
   {
    alert("Please Enter Only Numeric digit");
	document.editfrm.bundles_monthly_cost.focus();
	document.editfrm.bundles_monthly_cost.select();
	return false;
   }
   if(IsString(document.editfrm.avg_monthly_cost.value))
   {
    alert("Please Enter Only Numeric digit");
	document.editfrm.avg_monthly_cost.focus();
	document.editfrm.avg_monthly_cost.select();
	return false;
   }
if(document.editfrm.contract.selectedIndex==0)
	 {
	  alert("Please,Select Contract");
	  return false;
	 }
  if(document.editfrm.setup_cost.value=="")
  {
	  alert("Please, Enter Setup cost");
	  document.editfrm.setup_cost.focus();
	  document.editfrm.setup_cost.select();
	  return false;
  }
  if(document.editfrm.other_info.value=="")
  {
	  alert("Please, Enter Other information cost");
	  document.editfrm.other_info.focus();
	  document.editfrm.other_info.select();
	  return false;
  }
}

//============== Validation Function For Broadband Bundles ==============/
function validate_bundles()
{
 if(document.bundlesfrm.supplier.selectedIndex==0)
	 {
	  alert("Please,Select Supplier");
	  return false;
	 } 
if(document.bundlesfrm.types.selectedIndex==0)
	 {
	  alert("Please,Select type of bundle");
	  return false;
	 } 
if(document.bundlesfrm.bundles_name.value=="")
  {
	  alert("Please, Enter name of the bundles");
	  document.bundlesfrm.bundles_name.focus();
	  document.bundlesfrm.bundles_name.select();
	  return false;
  }
  if(IsString(document.bundlesfrm.bundles_cost.value))
   {
    alert("Please Enter Only Numeric digit");
	document.bundlesfrm.bundles_cost.focus();
	document.bundlesfrm.bundles_cost.select();
	return false;
   }
   if(IsString(document.bundlesfrm.avg_cost.value))
   {
    alert("Please Enter Only Numeric digit");
	document.bundlesfrm.avg_cost.focus();
	document.bundlesfrm.avg_cost.select();
	return false;
   }
if(document.bundlesfrm.contract.selectedIndex==0)
	 {
	  alert("Please,Select Contract");
	  return false;
	 }
  if(document.bundlesfrm.setup_cost.value=="")
  {
	  alert("Please, Enter Setup cost");
	  document.bundlesfrm.setup_cost.focus();
	  document.bundlesfrm.setup_cost.select();
	  return false;
  }
  if(document.bundlesfrm.others.value=="")
  {
	  alert("Please, Enter Other information cost");
	  document.bundlesfrm.others.focus();
	  document.bundlesfrm.others.select();
	  return false;
  }
}

//============== Validation Function For Credit Card Benefit ============/
function validate_credit_benefit()
{
 if(document.credit_benefit_frm.card.selectedIndex==0)
	 {
	  alert("Please,Select Card");
	  return false;
	 } 

if(document.credit_benefit_frm.free_card_protection.value=="")
  {
	  alert("Please, Enter Free Card Protection");
	  document.credit_benefit_frm.free_card_protection.focus();
	  document.credit_benefit_frm.free_card_protection.select();
	  return false;
  }
  if(document.credit_benefit_frm.online_fraud_guarantee.value=="")
   {
    alert("Please Enter Online Fraud Guarantee");
	document.credit_benefit_frm.online_fraud_guarantee.focus();
	document.credit_benefit_frm.online_fraud_guarantee.select();
	return false;
   }
   if(document.credit_benefit_frm.chip_pin.value=="")
   {
    alert("Please Enter Chip & Pin");
	document.credit_benefit_frm.chip_pin.focus();
	document.credit_benefit_frm.chip_pin.select();
	return false;
   }

  if(document.credit_benefit_frm.branch_access.value=="")
  {
	  alert("Please, Enter Branch Access");
	  document.credit_benefit_frm.branch_access.focus();
	  document.credit_benefit_frm.branch_access.select();
	  return false;
  }
  if(document.credit_benefit_frm.online_open_account.value=="")
  {
	  alert("Please, Enter Online Open Account");
	  document.credit_benefit_frm.online_open_account.focus();
	  document.credit_benefit_frm.online_open_account.select();
	  return false;
  }
  if(document.credit_benefit_frm.online_manage_account.value=="")
  {
	  alert("Please, Enter Online Manage Account");
	  document.credit_benefit_frm.online_manage_account.focus();
	  document.credit_benefit_frm.online_manage_account.select();
	  return false;
  }
  if(document.credit_benefit_frm.pda_access.value=="")
  {
	  alert("Please, Enter PDA access");
	  document.credit_benefit_frm.pda_access.focus();
	  document.credit_benefit_frm.pda_access.select();
	  return false;
  }
  if(document.credit_benefit_frm.wap_access.value=="")
  {
	  alert("Please, Enter WAP Access");
	  document.credit_benefit_frm.wap_access.focus();
	  document.credit_benefit_frm.wap_access.select();
	  return false;
  }
  if(document.credit_benefit_frm.travel_service.value=="")
  {
	  alert("Please, Enter Travel Service");
	  document.credit_benefit_frm.travel_service.focus();
	  document.credit_benefit_frm.travel_service.select();
	  return false;
  }
  if(document.credit_benefit_frm.wwm_ann_travel_insurance.value=="")
  {
	  alert("Please, Enter Worldwide multi-trip Annual Travel Insurance");
	  document.credit_benefit_frm.wwm_ann_travel_insurance.focus();
	  document.credit_benefit_frm.wwm_ann_travel_insurance.select();
	  return false;
  }
  if(document.credit_benefit_frm.lost_delay_luggage_insurance.value=="")
  {
	  alert("Please, Enter Lost Delay Luggage Insurance");
	  document.credit_benefit_frm.lost_delay_luggage_insurance.focus();
	  document.credit_benefit_frm.lost_delay_luggage_insurance.select();
	  return false;
  }
  if(document.credit_benefit_frm.flight_delay_cancel_insurance.value=="")
  {
	  alert("Please, Enter Flight Delay Cancellation Insurance");
	  document.credit_benefit_frm.flight_delay_cancel_insurance.focus();
	  document.credit_benefit_frm.flight_delay_cancel_insurance.select();
	  return false;
  }
  if(document.credit_benefit_frm.travel_discount.value=="")
  {
	  alert("Please, Enter Travel Discount");
	  document.credit_benefit_frm.travel_discount.focus();
	  document.credit_benefit_frm.travel_discount.select();
	  return false;
  }
  if(document.credit_benefit_frm.free_travel_accident_insurance.value=="")
  {
	  alert("Please, Enter Free Travel Accident Insurance");
	  document.credit_benefit_frm.free_travel_accident_insurance.focus();
	  document.credit_benefit_frm.free_travel_accident_insurance.select();
	  return false;
  }
  if(document.credit_benefit_frm.free_purchase_protection.value=="")
  {
	  alert("Please, Enter Free Purchase Protection");
	  document.credit_benefit_frm.free_purchase_protection.focus();
	  document.credit_benefit_frm.free_purchase_protection.select();
	  return false;
  }
  if(document.credit_benefit_frm.hour_support.value=="")
  {
	  alert("Please, Enter 24 Hour Support");
	  document.credit_benefit_frm.hour_support.focus();
	  document.credit_benefit_frm.hour_support.select();
	  return false;
  }
  if(document.credit_benefit_frm.lost_stolen.value=="")
  {
	  alert("Please, Enter Lost Stolen");
	  document.credit_benefit_frm.lost_stolen.focus();
	  document.credit_benefit_frm.lost_stolen.select();
	  return false;
  }
  if(document.credit_benefit_frm.domestic.value=="")
  {
	  alert("Please, Enter domestic");
	  document.credit_benefit_frm.domestic.focus();
	  document.credit_benefit_frm.domestic.select();
	  return false;
  }
  if(document.credit_benefit_frm.emergency.value=="")
  {
	  alert("Please, Enter Emergency");
	  document.credit_benefit_frm.emergency.focus();
	  document.credit_benefit_frm.emergency.select();
	  return false;
  }
  if(document.credit_benefit_frm.legal.value=="")
  {
	  alert("Please, Enter Legal");
	  document.credit_benefit_frm.legal.focus();
	  document.credit_benefit_frm.legal.select();
	  return false;
  }
  if(document.credit_benefit_frm.medical.value=="")
  {
	  alert("Please, Enter Medical");
	  document.credit_benefit_frm.medical.focus();
	  document.credit_benefit_frm.medical.select();
	  return false;
  }
  if(document.credit_benefit_frm.roadside.value=="")
  {
	  alert("Please, Enter Roadside");
	  document.credit_benefit_frm.roadside.focus();
	  document.credit_benefit_frm.roadside.select();
	  return false;
  }
  if(document.credit_benefit_frm.free_ifa_advice.value=="")
  {
	  alert("Please, Enter Free IFA advice");
	  document.credit_benefit_frm.free_ifa_advice.focus();
	  document.credit_benefit_frm.free_ifa_advice.select();
	  return false;
  }
  if(document.credit_benefit_frm.purchase_warranties.value=="")
  {
	  alert("Please, Enter Purchase Warranties");
	  document.credit_benefit_frm.purchase_warranties.focus();
	  document.credit_benefit_frm.purchase_warranties.select();
	  return false;
  }
  if(document.credit_benefit_frm.personal_liability_insurance.value=="")
  {
	  alert("Please, Enter Personal Liability Insurance");
	  document.credit_benefit_frm.personal_liability_insurance.focus();
	  document.credit_benefit_frm.personal_liability_insurance.select();
	  return false;
  }
  if(document.credit_benefit_frm.medical_insurance.value=="")
  {
	  alert("Please, Enter Medical Insurance");
	  document.credit_benefit_frm.medical_insurance.focus();
	  document.credit_benefit_frm.medical_insurance.select();
	  return false;
  }
  if(document.credit_benefit_frm.payment_protection.value=="")
  {
	  alert("Please, Enter Payment Protection");
	  document.credit_benefit_frm.payment_protection.focus();
	  document.credit_benefit_frm.payment_protection.select();
	  return false;
  }
  if(document.credit_benefit_frm.free_purchase_protection_transit.value=="")
  {
	  alert("Please, Enter Free Purchase Protection Transit");
	  document.credit_benefit_frm.free_purchase_protection_transit.focus();
	  document.credit_benefit_frm.free_purchase_protection_transit.select();
	  return false;
  }
  if(document.credit_benefit_frm.loyality_on_purchase.value=="")
  {
	  alert("Please, Enter Loyality on Purchase");
	  document.credit_benefit_frm.loyality_on_purchase.focus();
	  document.credit_benefit_frm.loyality_on_purchase.select();
	  return false;
  }
  if(document.credit_benefit_frm.loyality_on_balance_transfer.value=="")
  {
	  alert("Please, Enter Loyality on Balance Transfer");
	  document.credit_benefit_frm.loyality_on_balance_transfer.focus();
	  document.credit_benefit_frm.loyality_on_balance_transfer.select();
	  return false;
  }
  if(document.credit_benefit_frm.loyality_on_cash_advance.value=="")
  {
	  alert("Please, Enter Loyality On Cash Advance");
	  document.credit_benefit_frm.loyality_on_cash_advance.focus();
	  document.credit_benefit_frm.loyality_on_cash_advance.select();
	  return false;
  }
  if(document.credit_benefit_frm.nector.value=="")
  {
	  alert("Please, Enter Nector");
	  document.credit_benefit_frm.nector.focus();
	  document.credit_benefit_frm.nector.select();
	  return false;
  }
  if(document.credit_benefit_frm.air_miles.value=="")
  {
	  alert("Please, Enter Air Miles");
	  document.credit_benefit_frm.air_miles.focus();
	  document.credit_benefit_frm.air_miles.select();
	  return false;
  }
  if(document.credit_benefit_frm.friend_recommend.value=="")
  {
	  alert("Please, Enter Friend Recommend");
	  document.credit_benefit_frm.friend_recommend.focus();
	  document.credit_benefit_frm.friend_recommend.select();
	  return false;
  }
  if(document.credit_benefit_frm.application_process.value=="")
  {
	  alert("Please, Enter Application Process");
	  document.credit_benefit_frm.application_process.focus();
	  document.credit_benefit_frm.application_process.select();
	  return false;
  }
  if(document.credit_benefit_frm.customer_support.value=="")
  {
	  alert("Please, Enter Customer Support");
	  document.credit_benefit_frm.customer_support.focus();
	  document.credit_benefit_frm.customer_support.select();
	  return false;
  }
  if(document.credit_benefit_frm.money_value.value=="")
  {
	  alert("Please, Enter Money Value");
	  document.credit_benefit_frm.money_value.focus();
	  document.credit_benefit_frm.money_value.select();
	  return false;
  }
  if(document.credit_benefit_frm.online_services.value=="")
  {
	  alert("Please, Enter Online Services");
	  document.credit_benefit_frm.online_services.focus();
	  document.credit_benefit_frm.online_services.select();
	  return false;
  }
  if(document.credit_benefit_frm.payment_services.value=="")
  {
	  alert("Please, Enter Payment Services");
	  document.credit_benefit_frm.payment_services.focus();
	  document.credit_benefit_frm.payment_services.select();
	  return false;
  }
  if(document.credit_benefit_frm.emergency_customer_support.value=="")
  {
	  alert("Please, Enter Emergency Customer Support");
	  document.credit_benefit_frm.emergency_customer_support.focus();
	  document.credit_benefit_frm.emergency_customer_support.select();
	  return false;
  }
  if(document.credit_benefit_frm.product_information.value=="")
  {
	  alert("Please, Enter Product Information");
	  document.credit_benefit_frm.product_information.focus();
	  document.credit_benefit_frm.product_information.select();
	  return false;
  }
}

//============= Validation Function For Mortgage Term/Rate =============/
function validate_termrate()
{
	if(IsString(document.termratefrm.term.value))
  {
	  alert("Please Enter Only Numeric digit");
	  document.termratefrm.term.focus();
	  document.termratefrm.term.select();
	  return false;
  }
 if(document.termratefrm.type.selectedIndex==0)
	 {
	  alert("Please,Select Type");
	  return false;
	 } 
if(IsString(document.termratefrm.rate.value))
   {
    alert("Please Enter Only Numeric digit");
	document.termratefrm.rate.focus();
	document.termratefrm.rate.select();
	return false;
   }

}

//============== VAlidation Function For News On admin Side ===============/
function validate_news()
{
	if(document.newsfrm.news_title.value=="")
  {
	  alert("Please Enter News Title");
	  document.newsfrm.news_title.focus();
	  document.newsfrm.news_title.select();
	  return false;
  }
 if(document.newsfrm.module.selectedIndex==0)
	 {
	  alert("Please,Select Module");
	  return false;
	 } 
}

//========== Validation Function For Article On Admin Side==============/
function validate_article()
{
  if(document.articlefrm.article_name.value=="")
  {
	  alert("Please Enter Article Name");
	  document.articlefrm.article_name.focus();
	  document.articlefrm.article_name.select();
	  return false;
  }
 if(document.articlefrm.module.selectedIndex==0)
	 {
	  alert("Please,Select Module");
	  return false;
	 } 
}
//========== Validation Function For Property form==============/

function validate_property()
{
  if(document.property.email.value=="")
	{
     alert("Please, Enter  Email Address");
	 document.property.email.focus();
	 document.property.email.select();
	 return false;
    }
  if(!valid_email(document.property.email.value))
  {
	 alert("Please, Enter Valid Email Address");
	 document.property.email.focus();
	 document.property.email.select();
	 return false;
  }

if(document.property.Month.selectedIndex==0)
{
alert("Please Select Birth Month");
	  return false;
}
if(document.property.DOB.selectedIndex==0)
{
alert("Please Select Birth Day");
	  return false;
}
if(document.property.year.selectedIndex==0)
{
alert("Please Select Birth year");
	  return false;
}

 var birth_day=document.property.DOB.value;
var birth_month=document.property.Month.value;
var birth_year=document.property.year.value;

var mydate=new Date()
var end_day=mydate.getDate()
var end_month=month=mydate.getMonth()+1
var end_year=mydate.getYear()
if (end_year < 1000)
end_year+=1900

var year_diff=Math.abs(end_year-birth_year);

if(year_diff < 18)
{
alert("You are not Eligible For Property insurance");
return false;
}

if(document.property.policy.selectedIndex==0)
{
alert("Please indicate if you are currently insured");
	  return false;
}
if(document.property.year_built.selectedIndex==0)
{
alert("Please indicate built  year");
	  return false;
}

  if(document.property.replacementvalue.selectedIndex==0)
{
alert("Please indicate replacement value");
	  return false;
}
 
 if(document.property.replacementvalue.selectedIndex==1)
 {
   if(document.property.replacementvalue1.value=="")
  {
	  alert("Please Enter replacement value.");
	  
	  return false;
  }
  if(IsString(document.property.replacementvalue1.value))
	{
		alert("Please Enter Only Numbers");
		document.property.replacementvalue1.select();
		document.property.replacementvalue1.focus();
		return false;
	}
 }

 if(document.property.replacementvalue.selectedIndex==2)
 {
   if(document.property.replacementvalue2.value=="")
  {
	  alert("Please Enter square footage of your home ");
	 // document.property.replacementvalue2.focus();
	 // document.property.replacementvalue2.select();
	  return false;
  }
  if(IsString(document.property.replacementvalue2.value))
	{
		alert("Please Enter Only Numbers");
		document.property.replacementvalue2.select();
		document.property.replacementvalue2.focus();
		return false;
	}
 
 }

/*if(document.property.replacementvalue1.value=="")
  {
	  alert("Please Enter replacement value.");
	  document.property.replacementvalue1.focus();
	  document.property.replacementvalue1.select();
	  return false;
  }
  if(document.property.replacementvalue2.value=="")
  {
	  alert("Please Enter replacement value.");
	  document.property.replacementvalue2.focus();
	  document.property.replacementvalue2.select();
	  return false;
  }*/
}
//=======function to calculate the square feet rate in property insurance
function calculate(cal)
{
	//var sqrfeet=document.property.replacementvalue2.value;
	var cost=0;
	if(cal!="")
	{
		cost=parseInt(cal)*130;
	}
			document.property.calcost.value=cost;


}

function auto_popup()
{ 
  	window.open("insurance.php?name=insurance&Type=Auto","newwindow", "height=580,width=790, toolbar=no, menubar=no,scrollbars=yes, resizable=yes,location=left, directories=no, status=no, target=_parent");
}
function life_popup()
{ 
  	window.open("insurance.php?name=insurance&Type=Life","newwindow", "height=580,width=790, toolbar=no, menubar=no,scrollbars=yes, resizable=yes,location=left, directories=no, status=no, target=_parent");
}
function property_popup()
{ 
  	window.open("insurance.php?name=insurance&Type=Property","newwindow", "height=580,width=790, toolbar=no, menubar=no,scrollbars=yes, resizable=yes,location=left, directories=no, status=no, target=_parent");
}
function travel_popup()
{ 
  	window.open("insurance.php?name=insurance&Type=Travel","newwindow", "height=580,width=790, toolbar=no, menubar=no,scrollbars=yes, resizable=yes,location=left, directories=no, status=no, target=_parent");
}
//=========fuction for selecting property replacement value
function hiddendivreplacement(val)
{
//	alert(val);
	
		if(val == "Yes")
		{
				document.getElementById("Yes").style.display="Block";
		}
	else 
		{
			document.getElementById("Yes").style.display="none";
  }
  if(val == "No")
			{
				document.getElementById("No").style.display="Block";
		}
	else 
		{
			document.getElementById("No").style.display="none";
  }
		  
}
//======function for displaying hidden div in life insurance for smoke
function hiddendivsmoke(val)
{	
	if(val == "Yes")
	{
			document.getElementById("smokeinfo").style.display="Block";
	}
	if(val == "No")
	{
		
		document.getElementById("smokeinfo").style.display="none";
	}
}
//=========function for hidden div of partner smoke info
function hiddendivpartnersmoke(val)
{	
	if(val == "Yes")
	{
			document.getElementById("smoke_partnerinfo").style.display="Block";
	}
	if(val == "No")
	{
		
		document.getElementById("smoke_partnerinfo").style.display="none";
	}
}
//======function for displaying hidden div in life insurance for term
function hiddendivdisplay(val)
{
	document.getElementById("term").style.display="none";
	document.getElementById("partner_info").style.display="none";
	if(val == "single")
	{
			document.getElementById("term").style.display="Block";
			document.getElementById("partner_info").style.display="none";
	}
   if(val == "joint")
	{
         document.getElementById("term").style.display="Block";
		 document.getElementById("partner_info").style.display="Block";
    }
}

//function for validation in life insurance
function fun_submit()
{
		var birth_day=document.frm_detail.DOB.value;
		var birth_month=document.frm_detail.Month.value;
		var birth_year=document.frm_detail.year.value;

		var mydate=new Date()
		var end_day=mydate.getDate()
		var end_month=month=mydate.getMonth()+1
		var end_year=mydate.getYear()
		if (end_year < 1000)
		end_year+=1900

		var year_diff=Math.abs(end_year-birth_year);

		if(year_diff < 18)
		{
		alert("You are not Eligible For Life insurance");
		return false;
		}
        
        var birth_day=document.frm_detail.DOB_partner.value;
		var birth_month=document.frm_detail.Month_partner.value;
		var birth_year=document.frm_detail.year_partner.value;

		var mydate=new Date()
		var end_day=mydate.getDate()
		var end_month=month=mydate.getMonth()+1
		var end_year=mydate.getYear()
		if (end_year < 1000)
		end_year+=1900

		var year_diff=Math.abs(end_year-birth_year);

		if(year_diff < 18)
		{
		alert("Your Partner is not Eligible For Life insurance");
		return false;
		}
        

		if(document.frm_detail.post.value=="")
		{
		alert("Please Enter Post Code");
		document.frm_detail.post.focus();		
		return false;
		}
		if(document.frm_detail.post1.value =="")
		{
		alert("Please Enter Correct Post Code");
		document.frm_detail.post1.focus();		
		return false;
		}
		if(document.frm_detail.email.value == 0)
		{
		alert("Please Enter Email");
		document.frm_detail.email.focus();		
		return false;
		}else
			{
			if(!valid_email(document.frm_detail.email.value))
			{
			alert("Pl, Enter Valid Email Address");
			document.frm_detail.email.focus();		
			return false;
			}
		}
		
		if(document.frm_detail.insured.selectedIndex==0)
		{
		alert("Please select How many people do you want insured? ");
		document.frm_detail.insured.focus();		
		return false;
		}
        
		if(document.frm_detail.insured.selectedIndex==1)
		{   
			if(document.frm_detail.Month.selectedIndex==0)
			{
				alert("Please select When were you born? ");
				document.frm_detail.Month.focus();		
				return false;
			}
			if(document.frm_detail.DOB.selectedIndex==0)
			{
				alert("Please select Birth Month ");
				document.frm_detail.DOB.focus();		
				return false;
			}
			if(document.frm_detail.year.selectedIndex==0)
			{
				alert("Please select Birth Year ");
				document.frm_detail.year.focus();		
				return false;
			}
			
			var found_it //initial value is null because we gave it no other value

			for (var i=0; i<document.frm_detail.gender.length; i++) 
				{ 
					if (document.frm_detail.gender[i].checked) 
					{

						found_it = document.frm_detail.gender[i].value //set found_it equal to checked button's value
			        } 

			    }
				//if found_it is NOT equal to null, a button HAS been checked
             if(found_it == null)
				 { 
					alert("Please check Gender");
						return false;
				 }
                 var smoked //initial value is null because we gave it no other value

			for (var i=0; i<document.frm_detail.smoke_q.length; i++) 
				{ 
					if (document.frm_detail.smoke_q[i].checked) 
					{

						smoked = document.frm_detail.smoke_q[i].value //set found_it equal to checked button's value
						
			        } 

			    }
				//if found_it is NOT equal to null, a button HAS been checked
             if(smoked =="Yes")
				 { 
					if(document.frm_detail.smoke1.selectedIndex==0 && document.frm_detail.smoke2.selectedIndex==0 && document.frm_detail.smoke3.selectedIndex==0 && document.frm_detail.smoke4.selectedIndex==0 && document.frm_detail.smoke5.selectedIndex==0 && document.frm_detail.smoke6.selectedIndex==0 && document.frm_detail.smoke7.selectedIndex==0 && document.frm_detail.smoke8.selectedIndex==0 &&  document.frm_detail.smoke9.selectedIndex==0)
					 {
						alert("You have selected 'Yes' for being a smoker. You must indicate the products you have used to continue your quote");
                        return false;
					 }

						
				 }


		}
		if(document.frm_detail.insured.selectedIndex==2)
		{
            if(document.frm_detail.Month.selectedIndex==0)
			{
				alert("Please select When were you born? ");
				document.frm_detail.Month.focus();		
				return false;
			}
			if(document.frm_detail.DOB.selectedIndex==0)
			{
				alert("Please select Birth Month ");
				document.frm_detail.DOB.focus();		
				return false;
			}
			if(document.frm_detail.year.selectedIndex==0)
			{
				alert("Please select Birth Year ");
				document.frm_detail.year.focus();		
				return false;
			}
			var found_it //initial value is null because we gave it no other value

			for (var i=0; i<document.frm_detail.gender.length; i++) 
				{ 
					if (document.frm_detail.gender[i].checked) 
					{

						found_it = document.frm_detail.gender[i].value //set found_it equal to checked button's value
			        } 

			    }
				//if found_it is NOT equal to null, a button HAS been checked
             if(found_it == null)
				 { 
					alert("Please check Gender");
						return false;
				 }
				 var smoked //initial value is null because we gave it no other value

			for (var i=0; i<document.frm_detail.smoke_q.length; i++) 
				{ 
					if (document.frm_detail.smoke_q[i].checked) 
					{

						smoked = document.frm_detail.smoke_q[i].value //set found_it equal to checked button's value
						
			        } 

			    }
				//if found_it is NOT equal to null, a button HAS been checked
             if(smoked =="Yes")
				 { 
					if(document.frm_detail.smoke1.selectedIndex==0 && document.frm_detail.smoke2.selectedIndex==0 && document.frm_detail.smoke3.selectedIndex==0 && document.frm_detail.smoke4.selectedIndex==0 && document.frm_detail.smoke5.selectedIndex==0 && document.frm_detail.smoke6.selectedIndex==0 && document.frm_detail.smoke7.selectedIndex==0 && document.frm_detail.smoke8.selectedIndex==0 &&  document.frm_detail.smoke9.selectedIndex==0)
					 {
						alert("You have selected 'Yes' for being a smoker. You must indicate the products you have used to continue your quote");
                        return false;
					 }

						
				 }
            if(document.frm_detail.Month_partner.selectedIndex==0)
			{
				alert("Please select When were  your partner born? ");
				document.frm_detail.Month_partner.focus();		
				return false;
			}
			if(document.frm_detail.DOB_partner.selectedIndex==0)
			{
				alert("Please select Your Partner's Birth Month ");
				document.frm_detail.DOB_partner.focus();		
				return false;
			}
			if(document.frm_detail.year_partner.selectedIndex==0)
			{
				alert("Please select Your Partner's  Birth Year ");
				document.frm_detail.year_partner.focus();		
				return false;
			}
			     var found_part          
			 for (var i=0; i<document.frm_detail.gender_partner.length; i++) 
				{ 
					if (document.frm_detail.gender_partner[i].checked) 
					{

						found_part = document.frm_detail.gender_partner[i].value //set found_it equal to checked button's value
			        } 

			    }
				//if found_it is NOT equal to null, a button HAS been checked
             if(found_part == null)
				 {

					 alert("Please check Your Partner's Gender");
                     return false;
					}
             
              var smoke_partner //initial value is null because we gave it no other value

			for (var i=0; i<document.frm_detail.smoke_partner.length; i++) 
				{ 
					if (document.frm_detail.smoke_partner[i].checked) 
					{

						smoke_partner = document.frm_detail.smoke_partner[i].value //set found_it equal to checked button's value
						
			        } 

			    }
				//if found_it is NOT equal to null, a button HAS been checked
             if(smoke_partner =="Yes")
				 { 
					if(document.frm_detail.smoke_part1.selectedIndex==0 && document.frm_detail.smoke_part2.selectedIndex==0 && document.frm_detail.smoke_part3.selectedIndex==0 && document.frm_detail.smoke_part4.selectedIndex==0 && document.frm_detail.smoke_part5.selectedIndex==0 && document.frm_detail.smoke_part6.selectedIndex==0 && document.frm_detail.smoke_part7.selectedIndex==0 && document.frm_detail.smoke_part8.selectedIndex==0 &&  document.frm_detail.smoke_part9.selectedIndex==0)
					 {
						alert("You have selected 'Yes' for being a smoker. You must indicate the products you have used to continue your quote");
                        return false;
					 }

						
				 }


				
		}
		
	}


// ============= Code For Image Button ================
function submit_form()
{
	document.forms[0].applybtn.value="Apply";
	document.forms[0].submit();

}


//========== Validation Function For Travel form==============/

function validate_travel()
{
    var departure_month=document.frm_travel.departure_month.value;
	var departure_day=document.frm_travel.departure_day.value;
	var departure_year=document.frm_travel.departure_year.value;
	var return_month=document.frm_travel.return_month.value;
	var return_day=document.frm_travel.return_day.value;
	var return_year=document.frm_travel.return_year.value;


	if(document.frm_travel.postcode.value=="")
	{
	alert("Please Enter Postcode");
	document.frm_travel.postcode.focus();
	document.frm_travel.postcode.select();
	return false;
	}
	if(document.frm_travel.email.value=="")
	{
	alert("Please Enter your email");
	document.frm_travel.email.focus();
	document.frm_travel.email.select();
	return false;
	}
	if(!valid_email(document.frm_travel.email.value))
	{
	alert("Please Enter valid email");
	document.frm_travel.email.focus();
	document.frm_travel.email.select();
	return false;
	}
	if(document.frm_travel.city.selectedIndex==0)
	{
		alert("Please select Location");			
		return false;
	}

	if(document.frm_travel.departure_month.selectedIndex==0)
	{
		alert("Please select departure month");	
		return false;
	}
	if(document.frm_travel.departure_day.selectedIndex==0)
	{
		alert("Please select departure day");				
		return false;
	}
	if(document.frm_travel.departure_year.selectedIndex==0)
	{
		alert("Please select departure year");		
		return false;
	}

	if(!isBefore(departure_year,departure_month,departure_day))
	{
	 alert("Departure date is before Current Date");
	 return false;
	
	}

	if(document.frm_travel.return_month.selectedIndex==0)
	{
		alert("Please select return month");
	}
	if(document.frm_travel.return_day.selectedIndex==0)
	{
		alert("Please select return day");
		
	}
	if(document.frm_travel.return_year.selectedIndex==0)
	{
		alert("Please select return year");				
		return false;
	}

	if(!isBefore(return_year,return_month,return_day))
	{
	 alert("Return date is before Current Date");
	 return false;
	
	}
   
    if(document.frm_travel.traveler.selectedIndex==0)
	{   
		alert("Please select traveler");				
		return false;
	}
	if(document.frm_travel.DOB.selectedIndex==0)
	{
		alert("Please select your day of birth");				
		return false;
	}
	if(document.frm_travel.Month.selectedIndex==0)
	{
		alert("Please select Month of birth");				
		return false;
	}
	if(document.frm_travel.year.selectedIndex==0)
	{
		alert("Please select year of birth");				
		return false;
	}
	
	Dlength = document.frm_travel.Did.length-1;
	//Mlength = document.frm_travel.Mid.length
	//Ylength = document.frm_travel.Yid.length
	for(k=0;k<Dlength;k++)
	{    
		if(document.frm_travel.Mid[k].value=="0")
		{
			alert("please select the month");
			document.frm_travel.Mid[k].focus();
			return false;
			break;
		}
		if(document.frm_travel.Did[k].value=="0")
		{
			alert("please select the date");
			document.frm_travel.Did[k].focus();
			return false;
			break;

		}
		
		if(document.frm_travel.Yid[k].value=="0")
		{
			alert("please select the year");
			document.frm_travel.Yid[k].focus();
			return false;
			break;
		}

	}
    if(departure_year>return_year)//check year
	{
			alert("Return Date is Before Departure Date");
			 return false;
	}else if(departure_year==return_year)//check if year is equal
	{
		   if(departure_month>return_month)//check month
		   {
			   alert("Return Date is Before Departure Date");
				return false;
		   }else if(departure_month==return_month)//check month if equal
		   {
				  if(departure_day>return_day)//check day
				  {
					  alert("Return Date is Before Departure Date");
					return false;
				  }else
				  {

					return true;
				  }
		   }else
		   {
			 return true;
		   }
   }else
   {
     return true;
   }
}

function ApplyInsurance(frm)
{
	frm.applybtn.value="Apply";
}


function validate_driver_claims(val)

{       document.getElementById("claim").style.display="none"
		  document.getElementById("claim2").style.display="none"
       if(val=="No")
		{ 
		  document.getElementById("claim").style.display="none"
		  document.getElementById("claim2").style.display="none"
        }
    if(val=="Once")
		{  
			 document.getElementById("claim").style.display="block"
			  document.getElementById("claim2").style.display="none"
	    }
     if(val=="Twice")
	    {
			document.getElementById("claim").style.display="block"
			document.getElementById("claim2").style.display="block"

	    }
		
		if(val=="3_or_more_times")
	    {
			
			document.getElementById("claim").style.display="none"
		    document.getElementById("claim2").style.display="none"
		     window.open('template/user_temp/claims.html','claims','scrollbars=no,resizable=no,toolbar=no,width=360,height=230,location=top');
	    }
		
}

function validate_driver_accidents(val)

{        document.getElementById("accidents1").style.display="none"
      if(val=="no")
		{  
		  
		  document.getElementById("accidents1").style.display="none"
		   
        }
    if(val=="yes")
		{  
		  document.getElementById("accidents1").style.display="block"
		} 
    
		
}
function validate_driver_accident2(val)

{      
	
	if(val=="0")
		{  
		  
		  document.getElementById("accident2_claim").style.display="none"
		   
        }
      if(val=="1")
		{  
		  
		  document.getElementById("accident2_claim").style.display="none"
		   
        }
    if(val=="2")
		{  
		  document.getElementById("accident2_claim").style.display="block"
		  document.getElementById("accident2_claim1").style.display="none"
		  document.getElementById("accident2_claim2").style.display="none"
		   document.getElementById("accident2_claim3").style.display="none"
		   document.getElementById("accident2_claim4").style.display="none"

		} 
     if(val=="3")
		{  
		 document.getElementById("accident2_claim").style.display="block"
		  document.getElementById("accident2_claim1").style.display="block"
		  document.getElementById("accident2_claim2").style.display="none"
		  document.getElementById("accident2_claim3").style.display="none"
		   document.getElementById("accident2_claim4").style.display="none"
		   
		} 
		if(val=="4")
		{  
		  document.getElementById("accident2_claim2").style.display="block"
          document.getElementById("accident2_claim").style.display="block"
		   document.getElementById("accident2_claim1").style.display="block"
		   document.getElementById("accident2_claim3").style.display="none"
		   document.getElementById("accident2_claim4").style.display="none"

		} 
		if(val=="5")
		{  
		  document.getElementById("accident2_claim2").style.display="block"
          document.getElementById("accident2_claim").style.display="block"
		   document.getElementById("accident2_claim1").style.display="block"
		    document.getElementById("accident2_claim3").style.display="block"
		   document.getElementById("accident2_claim4").style.display="none"


		} 
		if(val=="6")
		{  
		  document.getElementById("accident2_claim2").style.display="block"
          document.getElementById("accident2_claim").style.display="block"
		   document.getElementById("accident2_claim1").style.display="block"
		   document.getElementById("accident2_claim3").style.display="block"
		   document.getElementById("accident2_claim4").style.display="block"


		} 
		if(val=="7")
		{  
		   document.getElementById("accident2_claim").style.display="none"
		   window.open('template/user_temp/claims.html','claims','scrollbars=no,resizable=no,toolbar=no,width=390,height=230');
		} 

}
function validate_driver_accident1(val)

{      
	if(val=="0")
		{  
		  
		  document.getElementById("accident1_claim").style.display="none"
		   
        }
	
      if(val=="1")
		{  
		  
		  document.getElementById("accident1_claim").style.display="none"
		   
        }
    if(val=="2")
		{  
		  document.getElementById("accident1_claim").style.display="block"
		  document.getElementById("accident1_claim1").style.display="none"
		  document.getElementById("accident1_claim2").style.display="none"
		} 
     if(val=="3")
		{  
		 document.getElementById("accident1_claim").style.display="block"
		  document.getElementById("accident1_claim1").style.display="block"
		  document.getElementById("accident1_claim2").style.display="none"
		   
		} 
		if(val=="4")
		{  
		  document.getElementById("accident1_claim2").style.display="block"
          document.getElementById("accident1_claim").style.display="block"
		   document.getElementById("accident1_claim1").style.display="block"

		} 
		if(val=="5")
		{  
		   document.getElementById("accident1_claim").style.display="none"
		  window.open('template/user_temp/claims.html','claims','scrollbars=no,resizable=no,toolbar=no,width=390,height=230');

		} 

}

function validate_driver_accident3(val)

{      
	
	if(val=="0")
		{  
		  
		  document.getElementById("accident3_claim").style.display="none"
		   
        }
      if(val=="1")
		{  
		  
		  document.getElementById("accident3_claim").style.display="none"
		   
        }
    if(val=="2")
		{  
		  document.getElementById("accident3_claim").style.display="block"
		  document.getElementById("accident3_claim1").style.display="none"
		  document.getElementById("accident3_claim2").style.display="none"
		} 
     if(val=="3")
		{  
		 document.getElementById("accident3_claim").style.display="block"
		  document.getElementById("accident3_claim1").style.display="block"
		  document.getElementById("accident3_claim2").style.display="none"
		   
		} 
		if(val=="4")
		{  
		  document.getElementById("accident3_claim2").style.display="block"
          document.getElementById("accident3_claim").style.display="block"
		   document.getElementById("accident3_claim1").style.display="block"

		} 
		if(val=="5")
		{  
		   document.getElementById("accident3_claim").style.display="none"
		  window.open('template/user_temp/claims.html','claims','scrollbars=no,resizable=no,toolbar=no,width=390,height=230');

		} 

}

function validate_driver_insurance(val)

{       document.getElementById("driver_insurance").style.display="none"
	
      if(val=="No")
		{  
		  
		  document.getElementById("driver_insurance").style.display="none"
		   
        }
    if(val=="once")
		{  
		  document.getElementById("driver_insurance").style.display="block"
		
		  
		} 
     if(val=="more")
		{  
		 document.getElementById("driver_insurance").style.display="none"
		 window.open('template/user_temp/claims.html','claims','scrollbars=no,resizable=no,toolbar=no,width=390,height=230');

		   
		} 
		

}

function validate_policy_date(val)

{      
	 document.getElementById("policy_date").style.display="none"
      if(val=="no")
		{  
		  
		  document.getElementById("policy_date").style.display="none"
		   
        }
    if(val=="yes")
		{  
		  document.getElementById("policy_date").style.display="block"
		
		  
		} 
    

}

function validate_currently_insured(val)

{      document.getElementById("currently_insured_no").style.display="none"
		   document.getElementById("currently_insured1").style.display="none"

      if(val=="no")
		{  
	
		  document.getElementById("currently_insured_no").style.display="block"
		   document.getElementById("currently_insured1").style.display="none"
		   
        }
    if(val=="yes")
		{  

		  document.getElementById("currently_insured1").style.display="block"
		  document.getElementById("currently_insured_no").style.display="none"
			  
		} 
    

}

function validate_primary_driver(val)

{      
	
      if(val=="no")
		{  
		  
		  document.getElementById("primary_driver").style.display="none"
		   
        }
    if(val=="yes")
		{  
		  document.getElementById("primary_driver").style.display="block"
		
		  
		} 
    

}



function validate_protection_devices(val)

{      document.getElementById("protection_devices").style.display="none"
		  document.getElementById("protection_devices1").style.display="none"
		  document.getElementById("protection_devices2").style.display="none"
	if(val=="0")
		{  
		  document.getElementById("protection_devices").style.display="none"
		  document.getElementById("protection_devices1").style.display="none"
		  document.getElementById("protection_devices2").style.display="none"
		} 
    if(val=="1")
		{  
		  document.getElementById("protection_devices").style.display="block"
		  document.getElementById("protection_devices1").style.display="none"
		  document.getElementById("protection_devices2").style.display="none"
		} 
     if(val=="2")
		{  
		 document.getElementById("protection_devices").style.display="block"
		  document.getElementById("protection_devices1").style.display="block"
		  document.getElementById("protection_devices2").style.display="none"
		   
		} 
		if(val=="3")
		{  
		  document.getElementById("protection_devices").style.display="block"
          document.getElementById("protection_devices1").style.display="block"
		   document.getElementById("protection_devices2").style.display="block"

		} 
		
}


//validation function for auto insurance form 1
function validate_auto()
{
	var birth_day=document.auto.DOB.value;
		var birth_month=document.auto.Month.value;
		var birth_year=document.auto.year.value;

		var mydate=new Date()
		var end_day=mydate.getDate()
		var end_month=month=mydate.getMonth()+1
		var end_year=mydate.getYear()
		if (end_year < 1000)
		end_year+=1900

		var year_diff=Math.abs(end_year-birth_year);

		if(year_diff < 18)
		{
		alert("You are not Eligible For auto insurance");
		return false;
		}
if(document.auto.title.selectedIndex==0)
	{
	alert("Please select Title");
	return false;	
	}
if(document.auto.first_name.value=="")
	{
	alert("Please Enter your First Name");
	document.auto.first_name.focus();
	document.auto.first_name.select();
	return false;
	}
if(document.auto.last_name.value=="")
	{
	alert("Please Enter your Last Name");
	document.auto.last_name.focus();
	document.auto.last_name.select();
	return false;
	}
if(document.auto.email.value=="")
	{
	alert("Please Enter your email");
	document.auto.email.focus();
	document.auto.email.select();
	return false;
	}
if(!valid_email(document.auto.email.value))
	{
	alert("Please Enter valid email");
	document.auto.email.focus();
	document.auto.email.select();
	return false;
	}

if(document.auto.Month.selectedIndex==0)
	{
	alert("Please select Month");
	return false;
	
	}
if(document.auto.DOB.selectedIndex==0)
	{
	alert("Please select day");
	return false;
	
	}
if(document.auto.year.selectedIndex==0)
	{
	alert("Please select year");
	return false;
	
	}
if(document.auto.gender.selectedIndex==0)
	{
	alert("Please select gender");
	return false;
	
	}
if(document.auto.marital.selectedIndex==0)
	{
	alert("Please select marital Status");
	return false;
	
	}
if(document.auto.occupation.selectedIndex==0)
	{
	alert("Please select Occupation");
	return false;
	
	}
if(document.auto.licence.selectedIndex==0)
	{
	alert("Please select type of Licence");
	return false;
	
	}
if(document.auto.Month_l.selectedIndex==0)
	{
	alert("Please select month of receiving licence");
	return false;
	
	}
if(document.auto.year_l.selectedIndex==0)
	{
	alert("Please select year of receiving licence");
	return false;
	
	}
if(document.auto.suspend.selectedIndex==0)
	{
	alert("Please select if driver's licence has been suspended in the last 6 years");
	return false;
	
	}
 else if(document.auto.suspend.selectedIndex==2 )
	{
	   if(document.auto.M_suspension.selectedIndex==0)
		{
		  alert("Please Enter 1st suspension month");
		  return false;
		}
	  if(document.auto.y_suspension.selectedIndex==0)
		{
		  alert("Please Enter 1st suspension year");
		  return false;
		}
	  if(document.auto.M_reinstatement.selectedIndex==0)
		{
		  alert("Please Enter 1st reinstatement month");
		  
		  return false;
		}
	  if(document.auto.y_reinstatement.selectedIndex==0)
		{
		  alert("Please Enter 1st reinstatement year");
		  return false;
		}
      if(document.auto.suspend_reason1.selectedIndex==0)
		{
		alert("Please Enter 1st suspension reason");
		return false;
		}
 
    }else if(document.auto.suspend.selectedIndex==3)
     {
			if(document.auto.M_suspension.selectedIndex==0)
		{
		  alert("Please Enter 1st suspension month");
		  return false;
		}
	  if(document.auto.y_suspension.selectedIndex==0)
		{
		  alert("Please Enter 1st suspension year");
		  return false;
		}
	  if(document.auto.M_reinstatement.selectedIndex==0)
		{
		  alert("Please Enter 1st reinstatement month");
		  return false;
		}
	  if(document.auto.y_reinstatement.selectedIndex==0)
		{
		  alert("Please Enter 1st reinstatement year");
		  return false;
		}
	
      if(document.auto.suspend_reason1.selectedIndex==0)
		{
		alert("Please Enter 1st suspension reason");
		return false;
		}
		if(document.auto.M_suspension2.selectedIndex==0)
		{
		 alert("Please Enter 2nd suspension month");
		 return false;
		}
		if(document.auto.y_suspension2.selectedIndex==0)
		{
		 alert("Please Enter 2nd suspension year");
		 return false;
		}
		if(document.auto.M_reinstatement2.selectedIndex==0)
		{
		 alert("Please Enter 2nd reinstatement month");
		 return false;
		}
		if(document.auto.y_reinstatement2.selectedIndex==0)
		{
		 alert("Please Enter 2nd reinstatement year");
		 return false;
		}
		if(document.auto.suspend_reason2.selectedIndex==0)
		{
		alert("Please Enter 2nd suspension reason");
		return false;
		}
		 
	}

if(document.auto.driver_had_accident.selectedIndex==0)
	{
	alert("Please select if driver had any accidents, tickets, or claims while owning, using or operating a vehicle");
	return false;
	}else if(document.auto.driver_had_accident.selectedIndex==1)
	{
			if(document.auto.No_of_claims.selectedIndex==0)
			{
			alert("Please select accidents or accident-related No of claims");
			return false;
			}
			else if(document.auto.No_of_claims.selectedIndex==2)
				 {
					if(document.auto.accident1_explain.selectedIndex==0)
					{
					alert("Please choose the option that best describes the accident and indicate when it happened");
					return false;
					}
					if(document.auto.accident_month1.selectedIndex==0)
					{
					alert("Please choose the option that best describes the accident and indicate when it happened");
					return false;
					}
					if(document.auto.accident_year1.selectedIndex==0)
					{
					alert("Please choose the option that best describes the accident and indicate when it happened");
					return false;
					}
				}
	         else if(document.auto.No_of_claims.selectedIndex==3)
				{
					if(document.auto.accident1_explain.selectedIndex==0)
					{
					alert("Please choose the option that best describes the accident and indicate when it happened");
					return false;
					}
					if(document.auto.accident_month1.selectedIndex==0)
					{
					alert("Please choose month");
					return false;
					}
					if(document.auto.accident_year1.selectedIndex==0)
					{
					alert("Please choose year");
					return false;
					}
					if(document.auto.accident2_explain.selectedIndex==0)
					{
					alert("Please choose the option that best describes the accident and indicate when it happened");
					return false;
					}
					if(document.auto.accident_month2.selectedIndex==0)
					{
					alert("Please choose month");
					return false;
					}
					if(document.auto.accident_year2.selectedIndex==0)
					{
					alert("Please choose year");
					return false;
					}
				}
	           else if(document.auto.No_of_claims.selectedIndex==4)
				{
						if(document.auto.accident1_explain.selectedIndex==0)
						{
						alert("Please choose the option that best describes the accident and indicate when it happened");
						return false;
						}
						if(document.auto.accident_month1.selectedIndex==0)
						{
						alert("Please choose month");
						return false;
						}
						if(document.auto.accident_year1.selectedIndex==0)
						{
						alert("Please choose year");
						return false;
						}
						if(document.auto.accident2_explain.selectedIndex==0)
						{
						alert("Please choose the option that best describes the accident and indicate when it happened");
						return false;
						}
						if(document.auto.accident_month2.selectedIndex==0)
						{
						alert("Please choose month");
						return false;
						}
						if(document.auto.accident_year2.selectedIndex==0)
						{
						alert("Please choose year");
						return false;
						}
						if(document.auto.accident3_explain.selectedIndex==0)
						{
						alert("Please choose the option that best describes the accident and indicate when it happened");
						return false;
						}
						if(document.auto.accident_month3.selectedIndex==0)
						{
						alert("Please choose month");
						return false;
						}
						if(document.auto.accident_year3.selectedIndex==0)
						{
						alert("Please choose year");
						return false;
						}
				}
	
			 if(document.auto.no_of_tickets.selectedIndex==0)
				{
				alert("please chooose How many tickets (convictions) has this driver had in the last 3 years, excluding parking tickets?");
				return false;	
				}
				else if(document.auto.no_of_tickets.selectedIndex==2)
				{
					if(document.auto.ticket1.selectedIndex==0)
					{
					alert("Please choose the option that best describes the accident and indicate when it happened");
					return false;	
					}
					if(document.auto.accident_month4.selectedIndex==0)
					{
					alert("Please choose month");
					return false;	
					}
					if(document.auto.accident_year4.selectedIndex==0)
					{
					alert("Please choose year");
					return false;	
					}
				}
			    else if(document.auto.no_of_tickets.selectedIndex==3)
				{
					if(document.auto.ticket1.selectedIndex==0)
					{
					alert("Please choose the option that best describes the accident and indicate when it happened");
					return false;	
					}
					if(document.auto.accident_month4.selectedIndex==0)
					{
					alert("Please choose month");
					return false;	
					}
					if(document.auto.accident_year4.selectedIndex==0)
					{
					alert("Please choose year");
					return false;	
					}
					if(document.auto.ticket2.selectedIndex==0)
					{
					alert("Please choose the option that best describes the accident and indicate when it happened");
					return false;	
					}
					if(document.auto.accident_month5.selectedIndex==0)
					{
					alert("Please choose month");
					return false;	
					}
					if(document.auto.accident_year5.selectedIndex==0)
					{
					alert("Please choose year");
					return false;	
					}
				}
			    else if(document.auto.no_of_tickets.selectedIndex==4)
				{
				    if(document.auto.ticket1.selectedIndex==0)
					{
					alert("Please choose the option that best describes the accident and indicate when it happened");
					return false;	
					}
					if(document.auto.accident_month4.selectedIndex==0)
					{
					alert("Please choose month");
					return false;	
					}
					if(document.auto.accident_year4.selectedIndex==0)
					{
					alert("Please choose year");
					return false;	
					}
					if(document.auto.ticket2.selectedIndex==0)
					{
					alert("Please choose the option that best describes the accident and indicate when it happened");
					return false;	
					}
					if(document.auto.accident_month5.selectedIndex==0)
					{
					alert("Please choose month");
					return false;	
					}
					if(document.auto.accident_year5.selectedIndex==0)
					{
					alert("Please choose year");
					return false;	
					}
					if(document.auto.ticket3.selectedIndex==0)
					{
					alert("Please choose the option that best describes the accident and indicate when it happened");
					return false;	
					}
					if(document.auto.accident_month6.selectedIndex==0)
					{
					alert("Please choose month");
					return false;	
					}
					if(document.auto.accident_year6.selectedIndex==0)
					{
					alert("Please choose year");
					return false;	
					}
				}
				else if(document.auto.no_of_tickets.selectedIndex==5)
				{
					if(document.auto.ticket1.selectedIndex==0)
					{
					alert("Please choose the option that best describes the accident and indicate when it happened");
					return false;	
					}
					if(document.auto.accident_month4.selectedIndex==0)
					{
					alert("Please choose month");
					return false;	
					}
					if(document.auto.accident_year4.selectedIndex==0)
					{
					alert("Please choose year");
					return false;	
					}
					if(document.auto.ticket2.selectedIndex==0)
					{
					alert("Please choose the option that best describes the accident and indicate when it happened");
					return false;	
					}
					if(document.auto.accident_month5.selectedIndex==0)
					{
					alert("Please choose month");
					return false;	
					}
					if(document.auto.accident_year5.selectedIndex==0)
					{
					alert("Please choose year");
					return false;	
					}
					if(document.auto.ticket3.selectedIndex==0)
					{
					alert("Please choose the option that best describes the accident and indicate when it happened");
					return false;	
					}
					if(document.auto.accident_month6.selectedIndex==0)
					{
					alert("Please choose month");
					return false;	
					}
					if(document.auto.accident_year6.selectedIndex==0)
					{
					alert("Please choose year");
					return false;	
					}
					if(document.auto.ticket4.selectedIndex==0)
					{
					alert("Please choose the option that best describes the accident and indicate when it happened");
					return false;	
					}
					if(document.auto.accident_month7.selectedIndex==0)
					{
					alert("Please choose month");
					return false;	
					}
					if(document.auto.accident_year7.selectedIndex==0)
					{
					alert("Please choose year");
					return false;	
					}
				}
				else if(document.auto.no_of_tickets.selectedIndex==6)
				{
					if(document.auto.ticket1.selectedIndex==0)
					{
					alert("Please choose the option that best describes the accident and indicate when it happened");
					return false;	
					}
					if(document.auto.accident_month4.selectedIndex==0)
					{
					alert("Please choose month");
					return false;	
					}
					if(document.auto.accident_year4.selectedIndex==0)
					{
					alert("Please choose year");
					return false;	
					}
					if(document.auto.ticket2.selectedIndex==0)
					{
					alert("Please choose the option that best describes the accident and indicate when it happened");
					return false;	
					}
					if(document.auto.accident_month5.selectedIndex==0)
					{
					alert("Please choose month");
					return false;	
					}
					if(document.auto.accident_year5.selectedIndex==0)
					{
					alert("Please choose year");
					return false;	
					}
					if(document.auto.ticket3.selectedIndex==0)
					{
					alert("Please choose the option that best describes the accident and indicate when it happened");
					return false;	
					}
					if(document.auto.accident_month6.selectedIndex==0)
					{
					alert("Please choose month");
					return false;	
					}
					if(document.auto.accident_year6.selectedIndex==0)
					{
					alert("Please choose year");
					return false;	
					}
					if(document.auto.ticket4.selectedIndex==0)
					{
					alert("Please choose the option that best describes the accident and indicate when it happened");
					return false;	
					}
					if(document.auto.accident_month7.selectedIndex==0)
					{
					alert("Please choose month");
					return false;	
					}
					if(document.auto.accident_year7.selectedIndex==0)
					{
					alert("Please choose year");
					return false;	
					}
					if(document.auto.ticket5.selectedIndex==0)
					{
					alert("Please choose the option that best describes the accident and indicate when it happened");
					return false;	
					}
					if(document.auto.accident_month8.selectedIndex==0)
					{
					alert("Please choose month");
					return false;	
					}
					if(document.auto.accident_year8.selectedIndex==0)
					{
					alert("Please choose year");
					return false;	
					}
				}
	
				if(document.auto.no_of_nonaaccident_claim.selectedIndex==0)
				{
						alert("Please choose How many non-accident insurance claims (like theft or windshield claims) has this driver made in the past 6 years?");
						return false;	
				}
				else if(document.auto.no_of_nonaaccident_claim.selectedIndex==2)
				{
				  	if(document.auto.non_accident_claim1.selectedIndex==0)
				   	{
					alert("Please choose the option that best describes the accident and indicate when it happened");
					return false;	
					}
					if(document.auto.accident_month9.selectedIndex==0)
					{
					alert("Please choose Month");
					return false;	
					}
					if(document.auto.accident_year9.selectedIndex==0)
					{
					alert("Please choose Month");
					return false;	
					}
				}
				else if(document.auto.no_of_nonaaccident_claim.selectedIndex==3)
				{
					if(document.auto.non_accident_claim1.selectedIndex==0)
					{
					alert("Please choose the option that best describes the accident and indicate when it happened");
					return false;	
					}
					if(document.auto.accident_month9.selectedIndex==0)
					{
					alert("Please choose Month");
					return false;	
					}
					if(document.auto.accident_year9.selectedIndex==0)
					{
					alert("Please choose Month");
					return false;	
					}
					if(document.auto.non_accident_claim2.selectedIndex==0)
					{
					alert("Please choose the option that best describes the accident and indicate when it happened");
					return false;	
					}
					if(document.auto.accident_month10.selectedIndex==0)
					{
					alert("Please choose Month");
					return false;	
					}
					if(document.auto.accident_year10.selectedIndex==0)
					{
					alert("Please choose Month");
					return false;	
					}
					
				}
				else if(document.auto.no_of_nonaaccident_claim.selectedIndex==4)
				{
					if(document.auto.non_accident_claim1.selectedIndex==0)
					{
					alert("Please choose the option that best describes the accident and indicate when it happened");
					return false;	
					}
					if(document.auto.accident_month9.selectedIndex==0)
					{
					alert("Please choose Month");
					return false;	
					}
					if(document.auto.accident_year9.selectedIndex==0)
					{
					alert("Please choose Month");
					return false;	
					}
					if(document.auto.non_accident_claim2.selectedIndex==0)
					{
					alert("Please choose the option that best describes the accident and indicate when it happened");
					return false;	
					}
					if(document.auto.accident_month10.selectedIndex==0)
					{
					alert("Please choose Month");
					return false;	
					}
					if(document.auto.accident_year10.selectedIndex==0)
			        {
					alert("Please choose Month");
					return false;	
					}
					if(document.auto.non_accident_claim3.selectedIndex==0)
					{
					alert("Please choose the option that best describes the accident and indicate when it happened");
					return false;	
					}
					if(document.auto.accident_month11.selectedIndex==0)
					{
					alert("Please choose Month");
					return false;	
					}
					if(document.auto.accident_year11.selectedIndex==0)
					{
					alert("Please choose Month");
					return false;	
					}
					
				}
	}
 if(document.auto.policy.selectedIndex==0)
	{
	alert("Please select In the last 3 years, has this driver had a policy cancelled by an insurance company?");
	return false;	
	}
	else if(document.auto.policy.selectedIndex==2)
	{
		if(document.auto.reason.selectedIndex==0)
		{
		alert("Please select reason for the cancellation");
		return false;	
		}
		if(document.auto.companey_name.selectedIndex==0)
		{
		alert("Please select Which insurance company cancelled the policy");
		return false;	
		}
		if(document.auto.DOB_policy.selectedIndex==0)
		{
		alert("Please select Day ");
		return false;	
		}
		if(document.auto.Month_policy.selectedIndex==0)
		{
		alert("Please select Month");
		return false;	
		}
		if(document.auto.year_policy.selectedIndex==0)
		{
		alert("Please select year");
		return false;	
		}
		if(document.auto.result_period.selectedIndex==0)
		{
		alert("Please select policy cancellation result in a period of time where this driver had no insurance coverage");
		return false;	
		}
		if(document.auto.result_period.selectedIndex==1)
		{
		 if(document.auto.day_policy_reinstated.selectedIndex==0)
			{
			alert("Please select date the policy was reinstated");
			return false;	
			}
			if(document.auto.month_policy_reinstated.selectedIndex==0)
			{
			alert("Please select month the policy was reinstated");
			return false;	
			}
			if(document.auto.year_policy_reinstated.selectedIndex==0)
			{
			alert("Please select year the policy was reinstated");
			return false;	
			}
		}
	}
    if(document.auto.currently_insured.selectedIndex==0)
	 {
        alert("Please select Is this driver currently insured as a primary or occasional driver on a Canadian or US auto insurance policy");
		return false;	
	 }
	 else if(document.auto.currently_insured.selectedIndex==1)
		 {
		   if(document.auto.primary_driver.selectedIndex==0)
			{
		     alert("Please select Is this driver listed as the primary driver on their current insurance policy");
		     return false;	
			}	
		 }	
	
	 else if(document.auto.currently_insured.selectedIndex==2)
	 {
       if(document.auto.no_of_insured_years.selectedIndex==0)
		{
		alert("Please select How many years has this driver had continuous insurance without interruption in Canada (or the US)");
		return false;	
		}	
       if(document.auto.Month_expire.selectedIndex==0)
		{
		alert("Please select month of current policy expire");
		return false;	
		}
		if(document.auto.year_expire.selectedIndex==0)
		{
		alert("Please select year of current policy expire");
		return false;	
		}
		if(document.auto.primary_driver1.selectedIndex==0)
			{
		alert("Please select Is  driver listed as the primary driver on their current insurance policy");
		return false;	
			}	
	 }

}
//validation function for auto insurance form 2
function validate_autoform2()
{


if(document.autofrm.make.selectedIndex==0)
	{
	alert("Please select make of the vehicle");
	return false;
	
	}
if(document.autofrm.yearofmake.value==0)
	{
	alert("Please Enter year of make");
	return false;
	}
if(document.autofrm.model.value==0)
	{
	alert("Please select model of vehicle");
	return false;
	}
if(document.autofrm.is_vehicle_leased.value==0)
	{
	alert("Please select is vehicle leased");
	return false;
	}

if(document.autofrm.Month_purchase.selectedIndex==0)
	{
	alert("Please select Month");
	return false;
	
	}
if(document.autofrm.year_purchase.selectedIndex==0)
	{
	alert("Please select year");
	return false;
	
	}
if(document.autofrm.costofvehicle.value=="")
	{
	alert("Please Enter Cost of vehicle");
	document.autofrm.costofvehicle.focus();
	document.autofrm.costofvehicle.select();
	return false;
	}
if(IsString(document.autofrm.costofvehicle.value))
	{
		alert("Please Enter Only Numbers");
		document.autofrm.costofvehicle.select();
		document.autofrm.costofvehicle.focus();
		return false;
	}
if(document.autofrm.peryearkm.value=="")
	{
	alert("Please Enter  how many kilometres is it driven each year");
	document.autofrm.peryearkm.focus();
	document.autofrm.peryearkm.select();
	return false;
	}
if(IsString(document.autofrm.peryearkm.value))
	{
		alert("Please Enter how many kilometres  driven each year");
		document.autofrm.peryearkm.select();
		document.autofrm.peryearkm.focus();
		return false;
	}
if(document.autofrm.perdaykm.value=="")
	{
	alert("Please Enter how many kilometres driven to work/school each day");
	document.autofrm.perdaykm.focus();
	document.autofrm.perdaykm.select();
	return false;
	}
if(IsString(document.autofrm.perdaykm.value))
	{
		alert("Please Enter about how many kilometres driven to work/school each day");
		document.autofrm.perdaykm.select();
		document.autofrm.perdaykm.focus();
		return false;
	}
if(document.autofrm.businessperyearkm.value=="")
	{
	alert("Please Enter About how many kilometres driven for business each year");
	document.autofrm.businessperyearkm.focus();
	document.autofrm.businessperyearkm.select();
	return false;
	}
if(IsString(document.autofrm.businessperyearkm.value))
	{
		alert("Please Enter About how many kilometres driven for business each year");
		document.autofrm.businessperyearkm.select();
		document.autofrm.businessperyearkm.focus();
		return false;
	}
	if(document.autofrm.protection.selectedIndex==0)
	{
	alert("Please select How many theft protection devices does this vehicle have");
	return false;
	}
	else if(document.autofrm.protection.selectedIndex==2)
	{
		   if(document.autofrm.protection1.selectedIndex==0)
			{
		     alert("Please specify the type of theft protection:");
		     return false;	
			}	
	}	
	else if(document.autofrm.protection.selectedIndex==3)
	{       
		   if(document.autofrm.protection1.selectedIndex==0)
			{
		     alert("Please specify the type of theft protection:");
		     return false;	
			}
		   if(document.autofrm.protection2.selectedIndex==0)
			{
		     alert("Please specify the type of theft protection:");
		     return false;	
			}	
	}	
	else if(document.autofrm.protection.selectedIndex==4)
	{      
		     
		   if(document.autofrm.protection1.selectedIndex==0)
			{
		     alert("Please specify the type of theft protection:");
		     return false;	
			}
		   if(document.autofrm.protection2.selectedIndex==0)
			{
		     alert("Please specify the type of theft protection:");
		     return false;	
			}	
		   if(document.autofrm.protection3.selectedIndex==0)
			{
		     alert("Please specify the type of theft protection:");
		     return false;	
			}	
	}	
    if(document.autofrm.storage.selectedIndex==0)
	{
	alert("Where is this vehicle primarily garaged or parked while at your home");
	return false;
	
	}
}
//Validation function for add vehicle on admin side
function validate_vehicle()
{
 if(document.addvehicle.manufacturer.value=="")
	{
	alert("Please Enter Manufacturer");
	document.addvehicle.manufacturer.focus();
	document.addvehicle.manufacturer.select();
	return false;
	
	}
 if(document.addvehicle.year.selectedIndex==0)
	{
	alert("Please select year of make");
	return false;
	
	}
 if(document.addvehicle.model.value=="")
	{
	alert("Please Enter model");
	document.addvehicle.model.focus();
	document.addvehicle.model.select();
	return false;
	
	}
}

