function makePayments() {	
	document.getElementById('payment_loading').style.display='none';
	if (document.forma2.payment.value.indexOf("$")==-1) {flag_pay_module="url";document.getElementById("pay_zone").innerHTML=button("b",l_sendorder,"check_order()");} 
	else 
	{
		flag_pay_module="standart";
		if (document.forma2.payment.value.indexOf("$googleCheckout")!=-1) 
		{
			merchantID=get_var_from_str(document.forma2.payment.value,"param1");document.getElementById("pay_zone").innerHTML=makeGoogleApi();
		}
		if (document.forma2.payment.value.indexOf("$paypal")!=-1) {document.getElementById("pay_zone").innerHTML=makePayPal();	}
		if (document.forma2.payment.value.indexOf("$e-gold")!=-1) {document.getElementById("pay_zone").innerHTML=makeEGold();};
		if (document.forma2.payment.value.indexOf("$webmoney")!=-1) {document.getElementById("pay_zone").innerHTML=makeWebmoney();};
		if (document.forma2.payment.value.indexOf("$2co")!=-1) {document.getElementById("pay_zone").innerHTML=make2co();};
		if (document.forma2.payment.value.indexOf("$assist")!=-1) {document.getElementById("pay_zone").innerHTML=makeAssist();};
	}	
}
function makeGoogleApi()
{	if (merchantID=='738991747006380') {str='<form method="POST" name=forma_pay  action="https://sandbox.google.com/checkout/cws/v2/Merchant/'+merchantID+'/checkoutForm" accept-charset="utf-8">';}
	else {str='<form method="POST" name=forma_pay action="https://checkout.google.com/cws/v2/Merchant/'+merchantID+'/checkoutForm" accept-charset="utf-8">';}	
	kskidka=(100-discountvalue)/100;	
	for (var i=0;i<=zak_count;i++) 
	{ 
		str=str+'<input type="hidden" name="item_name_' +(i+1)+ '" value="'+ GN[zak_index[i]] +'"/>';
		//str=str+'<input type="hidden" name="item_description_' +(i+1)+ '" value="'+ GKod[zak_index[i]] +'"/>';
		str=str+'<input type="hidden" name="item_description_' +(i+1)+ '" value="'+ "" +'"/>';
		str=str+'<input type="hidden" name="item_quantity_' +(i+1)+ '" value="'+ zak[zak_index[i]] +'"/>';
		str=str+'<input type="hidden" name="item_price_' +(i+1)+ '" value="'+ (GP[zak_index[i]]*kskidka) +'"/>';		
	}	
	str=str+'<input type="hidden" name="ship_method_name_1" value="'+get_var_from_str(document.forma2.payment.value,"param2")+'"/>';
	str=str+'<input type="hidden" name="ship_method_price_1" value="'+formatCur(dost,znakov)+'"/>';
	str=str+'<input type="hidden" name="tax_rate" value="'+get_var_from_str(document.forma2.payment.value,"param3")+'"/>';
	str=str+'<input type="hidden" name="tax_us_state" value="'+get_var_from_str(document.forma2.payment.value,"param4")+'"/>';
	str=str+'<input type="hidden" name="_charset_"/><a href="javascript:check_order()">';	
	if (merchantID=='738991747006380') {str=str+'<img alt="Fast checkout through Google" border=0 src="http://sandbox.google.com/checkout/buttons/checkout.gif?merchant_id='+merchantID+'&w=180&h=46&style=white&variant=text&loc=en_US" height="46" width="180">';}	 
	else {str=str+'<img alt="Fast checkout through Google" border=0  src="http://checkout.google.com/buttons/checkout.gif?merchant_id='+merchantID+'&w=180&h=46&style=white&variant=text&loc=en_US" height="46" width="180">';}		
	str=str+'</a></form>';
	return str;
}
function makePayPal()
{	str='<form action="https://www.paypal.com/cgi-bin/webscr" method="post" name=forma_pay >';	
	str=str+'<input type="hidden" name="cmd" value="_cart"><input type="hidden" name="upload" value="1">';
 	str=str+'<input type="hidden" name="business"  value="'+email+'">';
	str=str+'<input type="hidden" name="currency_code" value="'+get_var_from_str(document.forma2.payment.value,"param1")+'">';
	kskidka=(100-discountvalue)/100;	
	for (var i=0;i<=zak_count;i++) 
	{ 
		str=str+'<input type="hidden" name="item_name_' +(i+1)+ '" value="'+ GN[zak_index[i]] +'"/>';
		//str=str+'<input type="hidden" name="item_description_' +(i+1)+ '" value="'+ GKod[zak_index[i]] +'"/>';
		//str=str+'<input type="hidden" name="item_description_' +(i+1)+ '" value="'+ "" +'"/>';
		str=str+'<input type="hidden" name="quantity_' +(i+1)+ '" value="'+ zak[zak_index[i]] +'"/>';
		str=str+'<input type="hidden" name="amount_' +(i+1)+ '" value="'+ formatCur(GP[zak_index[i]]*kskidka,znakov) +'"/>';
	}
	str=str+'<input type="hidden" name="shipping_1" value="'+formatCur(dost,znakov)+'"/>';	
	str=str+'<a href="javascript:check_order()"><img src="https://www.paypal.com/en_US/i/btn/btn_xpressCheckoutsm.gif" border=0 alt="Make payments with payPal - it&#39;s fast, free and secure!"></a>';
	str=str+'<img alt="" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">';
	str=str+'</form>';	
	return str;
}
function makeEGold()
{	str='<form action="https://www.e-gold.com/sci_asp/payments.asp" method="POST" name=forma_pay   target=_top>';
	str=str+'<input type="hidden" name="PAYEE_ACCOUNT" value="'+get_var_from_str(document.forma2.payment.value,"param1")+'">';
	str=str+'<input type="hidden" name="PAYEE_NAME" value="'+get_var_from_str(document.forma2.payment.value,"param2")+'">';
	str=str+'<input type=hidden name="PAYMENT_AMOUNT" size=4 value="'+ formatCur((zak_summa+dost-discountsum),znakov) +'">';
	str=str+'<input type=hidden name="PAYMENT_UNITS" value=1>';
	str=str+'<input type=hidden name="PAYMENT_METAL_ID" value=1>';
	str=str+'<input type="hidden" name="STATUS_URL" value="mailto:'+email+'">';
	str=str+'<input type="hidden" name="NOPAYMENT_URL" value="'+get_var_from_str(document.forma2.payment.value,"param4")+'">';
	str=str+'<input type="hidden" name="NOPAYMENT_URL_METHOD" value="LINK">';
	str=str+'<input type="hidden" name="PAYMENT_URL" value="'+get_var_from_str(document.forma2.payment.value,"param3")+'">';
	str=str+'<input type="hidden" name="PAYMENT_URL_METHOD" value="LINK">';
	str=str+'<input type="hidden" name="BAGGAGE_FIELDS" value="CUSTOMERID">';
	str=str+'<input type="hidden" name="CUSTOMERID" value="0">';
	str=str+'<input type="hidden" name="SUGGESTED_MEMO" value="' + paynote + '  '+ '">';
	str=str+'<a href="javascript:check_order()"><img src=http://www.e-gold.com/gif/paywith.gif border=0 Alt="Pay Now with e-gold..."></a>';
	str=str+'</form> ';
	return str;
}
function makeWebmoney()
{		
	ss=zak_str1.replace("zak_str1=","");ss=ss.replace(/:;/g,",");ss=ss.replace(/,;/g,"  ");
	str='<form name=forma_pay method="POST" action="https://merchant.webmoney.ru/lmi/payment.asp">';
	str=str+'<input type="hidden" name="LMI_PAYMENT_AMOUNT" value="'+ formatCur((zak_summa+dost-discountsum),znakov) +'">';
	str=str+'<input type="hidden" name="LMI_PAYMENT_DESC" value="' + ss + ' ">';
	str=str+'<input type="hidden" name="LMI_PAYMENT_NO" value="1">';
	str=str+'<input type="hidden" name="LMI_PAYEE_PURSE" value="'+get_var_from_str(document.forma2.payment.value,"param1")+'">';
	str=str+'<input type="hidden" name="LMI_SIM_MODE" value="'+get_var_from_str(document.forma2.payment.value,"param2")+'">';
	str=str+button("b",l_sendorder,"check_order()");
	str=str+'</form> ';
	return str;
}
function makeAssist()
{
	var act_url, dd;
	dd=new Date();
	ss=zak_str1.replace("zak_str1=","");ss=ss.replace(/:;/g,",");ss=ss.replace(/,;/g,"  ");
	if (get_var_from_str(document.forma2.payment.value,"param2")=="Demo") {act_url="https://test.assist.ru/shops/purchase.cfm";}
	else {act_url="https://secure.assist.ru/shops/purchase.cfm";}
	str='<form name=forma_pay method="POST" action="'+act_url+'">';
	str=str+'<input type="hidden" name="Subtotal_P" value="'+ formatCur((zak_summa+dost-discountsum),znakov) +'">';
	str=str+'<input type="hidden" name="Comment" value="' + ss + ' ">';
	str=str+'<input type="hidden" name="Order_IDP" value="'+dd.getTime()+'">';
	str=str+'<input type="hidden" name="Shop_IDP" value="'+get_var_from_str(document.forma2.payment.value,"param1")+'">';
	if (get_var_from_str(document.forma2.payment.value,"param2")=="Demo") {str=str+'<input type="hidden" name="DemoResult" value="AS000">';}
	str=str+'<input type="hidden" name="Currency" value="'+get_var_from_str(document.forma2.payment.value,"param3")+'">';
	str=str+button("b",l_sendorder,"check_order()");
	str=str+'</form> ';
	return str;
}

function make2co()
{	
	var dd;
	dd=new Date();	
	str='<form name=forma_pay method="POST" action="https://www.2checkout.com/checkout/purchase">';
	str=str+'<INPUT type="hidden" name="cart_order_id" value="'+dd.getTime()+'">';	
	str=str+'<INPUT type="hidden" name="sid" value="'+get_var_from_str(document.forma2.payment.value,"param1")+'">';
	str=str+'<INPUT type="hidden" name="total" value="'+ formatCur((zak_summa+dost-discountsum),znakov) +'">';
	str=str+'<INPUT type="hidden" name="lang" value="'+get_var_from_str(document.forma2.payment.value,"param2")+'">';
	str=str+'<input type="hidden" name="id_type" value="1"/>';
	for (var i=0;i<=zak_count;i++) 
	{ 
		
		str=str+'<input type="hidden" name="c_name_' +(i+1)+ '" value="'+ GN[zak_index[i]] +'"/>';
		//str=str+'<input type="hidden" name="item_description_' +(i+1)+ '" value="'+ GKod[zak_index[i]] +'"/>';
		//str=str+'<input type="hidden" name="item_description_' +(i+1)+ '" value="'+ "" +'"/>';
		str=str+'<input type="hidden" name="c_prod_' +(i+1)+ '" value="'+ GKod[zak_index[i]]+","+zak[zak_index[i]] +'"/>';
		str=str+'<input type="hidden" name="c_description_' +(i+1)+ '" value="'+ GKod[zak_index[i]]+'"/>';
		str=str+'<input type="hidden" name="c_price_' +(i+1)+ '" value="'+ formatCur(GP[zak_index[i]]*(zak_summa+dost-discountsum)/zak_summa,znakov) +'"/>';
	}
	str=str+button("b",l_sendorder,"check_order()");
	return str;
}