﻿/* open paypal*/
function Init(){
	String.prototype.replaceAll  = function(s1,s2)
	{return this.replace(new RegExp(s1,"gm"),s2);};
	var msg, CurrencyIndex ,buttonCaption;
	CurrencyIndex = window.external.DefaultCry;
	window.document.getElementById("selCurrency").selectedIndex = CurrencyIndex;
	buttonCaption = window.external.DonateText ;
	if(buttonCaption != undefined)
	window.document.getElementById("btnDonate").value = " "  + buttonCaption + " " ;}
function OpenPaypalLink(aAmount, aCurrencyIndex){
  //if((window.external.DefaultCry == undefined)||(window.external.DefaultCry == 0)){
  window.open(GetPaypalLink(aAmount , aCurrencyIndex));
  //}else{window.external.OpenPPLink(aAmount , aCurrencyIndex);}
	}
function GetPaypalLink(aAmount, aCurrencyIndex){
	var ppLink = "";
	var CurrencyList=  new Array('USD', 'EUR', 'GBP', 'CAD', 'AUD', 'CZK', 'DKK', 'HKD', 
'HUF', 'JPY', 'NZD', 'NOK', 'PLN', 'SGD', 'SEK', 'CHF');
	ppLink = 
"https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=kezesoftware%40gmail%2ecom&lc=C2"
		+ "&item_name=Support%20Avant%20Browser&amount="
		+ aAmount
		+ "%2e00&currency_code="
		+ CurrencyList[aCurrencyIndex]
		+ 
"&button_subtype=services&no_note=0&cn=Add%20special%20instructions%20to%20the%20seller&no_shipping=1&undefined_quantity=1&rm=1"
		+ 
"&return=http%3a%2f%2fwww%2eavantbrowser%2ecom%2f&cancel_return=http%3a%2f%2fwww%2eavantbrowser%2ecom%2f&tax_rate=0%2e000&shipping=0%2e00&bn=PP%2dBuyNowBF%3abtn_buynowCC_LG%2egif%3aNonHosted";

	return ppLink;}
function OpenNewForPaypal(){
	var aAmount , aCurrency;
	aAmount = parseInt(window.document.getElementById("selAmount").value);
	aCurrency = window.document.getElementById("selCurrency").selectedIndex;
	OpenPaypalLink(aAmount, aCurrency);
	}
 /* open paypal*/ 
