/***India Starts Here***/
function superpackage(){fade('payopts','payopts1','dispdiv','600','200','','http://'+DOMAINARRAY['domainnameweb']+'/sitedata/inter-super-pop.html','','dispcontent','','','');}
function pluspackage()	{fade('payopts','payopts1','dispdiv','600','200','','http://'+DOMAINARRAY['domainnameweb']+'/sitedata/inter-plus-pop.html','','dispcontent','','','');}
function classicpackage(){fade('payopts','payopts1','dispdiv','600','200','','/sitedata/inter-classic-pop.html','','dispcontent','','','');}
function memschemepop(){fade('payopts','payopts1','dispdiv','625','700','','/sitedata/compare-memscheme-popup.html','','dispcontent','','','')}
function privpop(){fade('payopts','payopts1','dispdiv','525','700','','/sitedata/privilege-service-popup.html','','dispcontent','','','')}
var payopts="";var redirect="1";var bm_assit_val=0;

function mempac()
{
	var PayMemberpack = this.document.PayMemberpack;
	if ( !PayMemberpack.category[0].checked && !PayMemberpack.category[1].checked && !PayMemberpack.category[2].checked && !PayMemberpack.category[3].checked && !PayMemberpack.category[4].checked && !PayMemberpack.category[5].checked && !PayMemberpack.category[6].checked && !PayMemberpack.category[7].checked && !PayMemberpack.category[8].checked && !PayMemberpack.category[9].checked)
	{alert( "Please select the membership package" );PayMemberpack.category[3].focus( );return false;}
}

function pay_assit(amt,duration)
{  var PayMemberpack = this.document.PayMemberpack;
	if(PayMemberpack.category[9].checked==true)
	{$('fasttrack').style.display="none";$('fasttrackamt').innerHTML="&nbsp";PayMemberpack.bmassist.checked=false;PayMemberpack.bmassist.disabled=true;}
	else
	{PayMemberpack.bmassist.disabled=false;$('fasttrack').style.display="block";$('fasttrackamt').innerHTML="<font class='smalltxt'>"+amt+"&nbsp;"+duration+"</font>";}
}

function check_assit()
{
	var PayMemberpack = this.document.PayMemberpack;
	if(PayMemberpack.bmassist.checked==true){bm_assit_val=PayMemberpack.bmassist.value;}else{bm_assit_val=0;}
	return bm_assit_val;
}

function paymentoptchk()
{
	var PayMemberpack = this.document.PayMemberpack;

	var objlen=document.PayMemberpack.elements.length;
	for(i=0;i<objlen;i++)
	{
		if(document.PayMemberpack.elements[i].name=="PAYMENTOPT")
		{
			if(document.PayMemberpack.elements[i].checked==true){paycount=0;break}else{paycount=1}
		}
	}

	return paycount;
}

function paycatvalue()
{	
	var PayMemberpack = this.document.PayMemberpack;
	var objlen=document.PayMemberpack.elements.length;

	for(i=0;i<objlen;i++)
	{
		if(document.PayMemberpack.elements[i].name=="category")
		{
			if(document.PayMemberpack.elements[i].checked==true){var paycatval=document.PayMemberpack.elements[i].value;break}
		}
	}
	return paycatval;
}

var logck=GetCookie('LOGININFO');var MatriID='';if (logck!="" && logck!=null){MatriID=logck.substring(0,logck.indexOf('^'));}

function ValidateIndia( )
{	
	mempac();
	var paycount=paymentoptchk();

	if(paycount==1){alert( "Please select the payment mode" );PayMemberpack.PAYMENTOPT[0].focus();return false;}
	
	if($('PAYMENTOPT1').checked==true)
	{
		if (MatriID.length > 0)
		{
			var sendto = "https://bharatmatrimony.com/"+DOMAINARRAY['domainnameshort']+"matrimony/payments/ccredirectpayment.php?MatrimonyId="+MatriID+"&category="+paycatvalue()+"&POWERPACK=0&bmassist="+check_assit();
			document.PayMemberpack.action=sendto;
		}
		else
		{
			var sendto = "http://"+DOMAINARRAY['domainmodule']+"/payments/paymentcc.php?bmassist="+check_assit();
			document.PayMemberpack.action=sendto;
		}
	}
	else if($('PAYMENTOPT10').checked==true)
	{
		if (MatriID.length > 0)
		{
		var sendto = "http://"+DOMAINARRAY['domainnameweb']+"/payments/paymentthroughivrs.php?category="+paycatvalue()+"&POWERPACK=0&bmassist="+check_assit();
		document.PayMemberpack.action=sendto;
		}
		else
		{
			var sendto = "http://"+DOMAINARRAY['domainmodule']+"/payments/paymentcc.php?bmassist="+check_assit();
			document.PayMemberpack.action=sendto;
		}
	}
	else if($('PAYMENTOPT2').checked==true)
	{
			if (MatriID.length > 0 )
			{
				var sendto = "http://"+DOMAINARRAY['domainnameweb']+"/payments/ccgatwayredirect.php?MatrimonyId="+MatriID+"&category="+paycatvalue()+"&Cardtype=1&POWERPACK=0&bmassist="+check_assit();
				document.PayMemberpack.action=sendto;
			}
			else
			{
				var sendto = "http://"+DOMAINARRAY['domainmodule']+"/payments/paymentcc.php?bmassist="+check_assit();
				document.PayMemberpack.action=sendto;
			}
	}
	else if($('PAYMENTOPT8').checked==true)
	{
		if (MatriID.length > 0 )
		{
				var sendto = "http://www.bharatmatrimony.com/payments/itzcashredirectpayment.php?MatrimonyId="+MatriID+"&category="+paycatvalue()+"&POWERPACK=0&bmassist="+check_assit();
				document.PayMemberpack.action=sendto;
		}
		else
		{var sendto = "http://"+DOMAINARRAY['domainmodule']+"/payments/paymentcc.php?bmassist="+check_assit();
				document.PayMemberpack.action=sendto;
		}
	}
	else
	{
		var sendto = "http://"+DOMAINARRAY['domainmodule']+"/payments/paymentoptiondetail.php";
		document.PayMemberpack.action=sendto;
	}
	
	return true;
}

/*function makeRequest1(){var u="/cgi-bin/citicheck.cgi?"+genNumbers();payopts=MakeGetRequest(u,'payoptscript');}

function payoptscript()
{
	if (payopts.readyState == 4) 
	{
	 if (payopts.status == 200) {if(payopts.responseText!=null && payopts.responseText!=""){redirect = payopts.responseText;}} 
	 else {alert('There was a problem with the request.');}
  }
}*/

/***India Ends Here***/

function validate()
{
	 if(country=="98"){return ValidateIndia();}
	 else if(country=="220"){return ValidateUae();}
	 else if(country=="21"){return ValidateEuro();}
	 else if(country=="221"){return ValidateUk();}
	 else{return ValidateUs();} 
}

/***USA Starts Here***/
function ValidateUs( )
{
	var PayMemberpack = this.document.PayMemberpack;

	mempac();
	var paycount=paymentoptchk();

	if(paycount==1){alert( "Please select the payment mode" );	PayMemberpack.PAYMENTOPT[0].focus();return false;}

	if($('PAYMENTOPT1').checked==true)
	{
		if (MatriID.length > 0)
		{
			var sendto = "https://bharatmatrimony.com/"+DOMAINARRAY['domainnameshort']+"matrimony/payments/usupgrade.php?MatrimonyId="+MatriID+"&category="+paycatvalue()+"&CN="+country+"&POWERPACK=0&bmassist="+check_assit();
			document.PayMemberpack.action=sendto;return true;
		}
		else
		{
			var sendto = "http://"+DOMAINARRAY['domainmodule']+"/payments/paymentcc.php?bmassist="+check_assit();
			document.PayMemberpack.action=sendto;
		}
		return true;
	}
	else
	{
		var sendto = "http://"+DOMAINARRAY['domainmodule']+"/payments/paymentoptiondetail.php";
		document.PayMemberpack.action=sendto;
	}

}
/***USA Ends Here***/

/***UK Starts Here***/
function ValidateUk( )
{
	var PayMemberpack = this.document.PayMemberpack;

	mempac();
	var paycount=paymentoptchk();

	if(paycount==1){alert( "Please select the payment mode" );	PayMemberpack.PAYMENTOPT[0].focus();return false;}

	if($('PAYMENTOPT1').checked==true)
	{
		if (MatriID.length > 0)
		{
			var sendto = "https://bharatmatrimony.com/"+DOMAINARRAY['domainnameshort']+"matrimony/payments/usupgrade.php?MatrimonyId="+MatriID+"&category="+paycatvalue()+"&CN="+country+"&POWERPACK=0&bmassist="+check_assit();
			document.PayMemberpack.action=sendto;return true;
		}
		else
		{
			var sendto = "http://"+DOMAINARRAY['domainmodule']+"/payments/paymentcc.php?bmassist="+check_assit();
			document.PayMemberpack.action=sendto;
		}
		return true;
	}
	else
	{
		var sendto = "http://"+DOMAINARRAY['domainmodule']+"/payments/paymentoptiondetail.php";
		document.PayMemberpack.action=sendto;
	}

}
/***UK Ends Here***/

/***UAE Starts Here***/
function ValidateUae( )
{
	var PayMemberpack = this.document.PayMemberpack;
	mempac();
	var paycount=paymentoptchk();

	if(paycount==1){alert( "Please select the payment mode" );	PayMemberpack.PAYMENTOPT[0].focus();return false;}

	if($('PAYMENTOPT1').checked==true)
	{

		if (MatriID.length > 0)
		{			
				var sendto = "https://bharatmatrimony.com/"+DOMAINARRAY['domainnameshort']+"matrimony/payments/usupgrade.php?MatrimonyId="+MatriID+"&category="+paycatvalue()+"&CN="+country+"&POWERPACK=0&bmassist="+check_assit();
				document.PayMemberpack.action=sendto;
				return true;
		}
		else
		{
			var sendto = "http://"+DOMAINARRAY['domainmodule']+"/payments/paymentcc.php?bmassist="+check_assit();
			document.PayMemberpack.action=sendto;
		}
		return true;
	}
	else
	{var sendto = "http://"+DOMAINARRAY['domainmodule']+"/payments/paymentoptiondetail.php";document.PayMemberpack.action=sendto;}
}
/***UAE Ends Here***/

/***EURO Starts Here***/
function ValidateEuro( )
{
	var PayMemberpack = this.document.PayMemberpack;
	mempac();
	
	if ($('PAYMENTOPT1').checked==false)
	{alert( "Please select the payment mode" );document.PayMemberpack.PAYMENTOPT.focus();return false;}

	if($('PAYMENTOPT1').checked==true)
	{
		if (MatriID.length > 0)
		{
			var sendto = "https://bharatmatrimony.com/"+DOMAINARRAY['domainnameshort']+"matrimony/payments/usupgrade.php?MatrimonyId="+MatriID+"&category="+paycatvalue()+"&CN="+country+"&POWERPACK=0&bmassist="+check_assit();
			document.PayMemberpack.action=sendto;return true;
		}
		else
		{
			var sendto = "http://"+DOMAINARRAY['domainmodule']+"/payments/paymentcc.php?bmassist="+check_assit();
			document.PayMemberpack.action=sendto;
		}
		return true;
	}
}
/***EURO Ends Here***/