var xmlHttp;
var GLOBAL_CART_ITEMS = new Array();
var GLOBAL_CART_LENGTH = 0;
var GLOBAL_SUB_TOTAL = 0;
var GLOBAL_PARTNER_ID = 0;
var GLOBAL_SUBSCRIBED = 0;
var	GLOBAL_FIRSTNAMEB = '';
var	GLOBAL_LASTNAMEB = '';
var	GLOBAL_EMAIL = '';
var GLOBAL_SHIPPINGCOUNTRY_ID = 0;
function getXmlHttpObject()
{
	var objXMLHttp = null;
	if (window.XMLHttpRequest)
		objXMLHttp = new XMLHttpRequest();
	else if (window.ActiveXObject)
		objXMLHttp = new ActiveXObject('Microsoft.XMLHTTP');
	if (objXMLHttp == null)
	{
		alert ('Your Browser does not support HTTP Requests!');
		return false;
	}
	else
		return objXMLHttp;
}

function sendOrder()
{
	var countcardattempt = document.getElementById('countCardAttempt').value;
	if(PAYMENT_OPTION == '1')
	{
		countcardattempt++;
		document.getElementById('countCardAttempt').value = countcardattempt;
	}
	if(countcardattempt == '6')
	{
		document.getElementById('mainCheckoutArea').innerHTML = '<p align="justify" style="padding-bottom:40px; padding-top:15px;">To prevent fraud, your International Checkout order page has been disabled due to numerous failed attempts to verify your credit card. We recommend that you contact your credit cards issuing bank to resolve this matter. You may place a new order with a valid credit card or another payment method. We apologize for any inconvenience. Thank You.</p>';
		document.getElementById('dvErrMsg').innerHTML = '';	
	}
	else
	{
		xmlHttp = getXmlHttpObject();
		if (!xmlHttp) return false;
		document.getElementById('dvErrMsg').innerHTML = '';
		var postVars = makePostVars();
		document.getElementById('mainCheckoutArea').align = 'center';
		document.getElementById('mainCheckoutArea').style.paddingTop = '100px';
		document.getElementById('btnSendOrder').disabled = true;
		document.getElementById('dvErrMsg').innerHTML = 'PLEASE WAIT...<img src="images/ajax-loader_big_ic.gif" border="0" />';
		document.getElementById('setErrorFocus').focus();			
		var url = 'ordersent_ajax.php?SID='+Math.random();
		xmlHttp.onreadystatechange = stateChanged_sendOrder;
		xmlHttp.open('POST', url, true);
		xmlHttp.setRequestHeader('Content-type', 'application/x-www-form-urlencoded; text/xml; charset=utf-8');
		xmlHttp.setRequestHeader('Content-length', postVars.length);
		xmlHttp.setRequestHeader('Connection', 'close');
		xmlHttp.send(postVars);
	}
}
function stateChanged_sendOrder()
{
	if (xmlHttp.readyState == 4 || xmlHttp.readyState == 'complete')
	{		
		if (xmlHttp.responseText.indexOf('E~R~R~0~R') != -1)
		{
			var arrResponse = new Array();
			arrResponse = xmlHttp.responseText.split('HAM~JAM');
			//window.location = arrResponse[1];
			document.getElementById('dvErrMsg').innerHTML = arrResponse[1];
			document.getElementById('setErrorFocus').focus();
			document.getElementById('btnSendOrder').disabled = false;
		}
		else
		{			
			document.getElementById('mainCheckoutArea').align = 'left';
			document.getElementById('mainCheckoutArea').style.paddingTop = '30px';
			document.getElementById('mainCheckoutArea').style.paddingLeft = '30px';			
			if(GLOBAL_PARTNER_ID == 151 && GLOBAL_SHIPPINGCOUNTRY_ID == 40 )			
				executePixelCode();
			else
				postOrderExecution();
/*			else if(GLOBAL_PARTNER_ID == 180 || GLOBAL_PARTNER_ID == 183)// coutrecandy or labelspree
				coutureCandy(xmlHttp.responseText);*/
			
			/*document.getElementById('mainCheckoutArea').innerHTML = xmlHttp.responseText;
			document.getElementById('dvErrMsg').innerHTML = '';
			
			if(document.getElementById('frmLaunchACS'))
			{
				document.getElementById('frmLaunchACS').submit();
			}*/
			var arrResponse = new Array();
			arrResponse = xmlHttp.responseText.split('HAM~JAM');
			if(arrResponse[1] && arrResponse[1] == '1')
			{
				document.getElementById('dvCardinal').style.display = 'inline';
				document.getElementById('mainCheckoutArea').style.visibility = 'hidden';
			}
			document.getElementById('mainCheckoutArea').innerHTML = arrResponse[0];
			document.getElementById('dvErrMsg').innerHTML = '';
			
			if(document.getElementById('frmLaunchACS'))
			{
				document.getElementById('frmLaunchACS').submit();
			}
			
//			postFormToMailChimp();
		}
	}
}
/*
function postFormToMailChimp()
{
	if(GLOBAL_SUBSCRIBED == 1)
	{
		document.getElementById('MERGE0').value = GLOBAL_EMAIL;
		document.getElementById('MERGE1').value = GLOBAL_FIRSTNAMEB;
		document.getElementById('MERGE2').value = GLOBAL_LASTNAMEB;
		document.getElementById('frmSubscribe').submit();
	}
}
*/
function postOrderExecution()
{
	switch(GLOBAL_PARTNER_ID)
	{
		case '199':
			var url = 'https://www.internationalcheckout.com/pixeltracking/masseysoutfitters.htm';
			document.getElementById('icIframe').src = url;
			break;
		case '200':
			var url = 'https://www.internationalcheckout.com/pixeltracking/theflipflopper.htm';
			document.getElementById('icIframe').src = url;
			break;
		case '201':
			var url = 'https://www.internationalcheckout.com/pixeltracking/skishop.htm';
			document.getElementById('icIframe').src = url;
			break;
		case '202':
			var url = 'https://www.internationalcheckout.com/pixeltracking/wegotyourpack.htm';
			document.getElementById('icIframe').src = url;
			break;
		case '529':
			var url = 'https://www.internationalcheckout.com/pixeltracking/threetailer.htm';
			document.getElementById('icIframe').src = url;
			break;
		case '340':
			var url = 'https://www.internationalcheckout.com/pixeltracking/windowalert.htm';
			document.getElementById('icIframe').src = url;
			break;	
		default:
			break;
	}
}
function executePixelCode()
{	
	var url = 'https://www.internationalcheckout.com/pixeltracking/trackingmartens.html';
	document.getElementById('icIframe').src = url;
}
function coutureCandy(orderData)
{	
	arrForOrderNo = orderData.split('<label>');
	arrOrderNo = arrForOrderNo[1].split('</label>');
 if(GLOBAL_PARTNER_ID == 180)
    var url = 'https://www.couturecandy.com/intl-checkout-receipt.do?oid='+arrOrderNo[0]+'&subtotal='+GLOBAL_SUB_TOTAL;
 if(GLOBAL_PARTNER_ID == 183)
    var url = 'https://www.labelspree.com/intl-checkout-receipt.do?oid='+arrOrderNo[0]+'&subtotal='+GLOBAL_SUB_TOTAL;
	var j = 1;
	for (i = 0; i < GLOBAL_CART_LENGTH; i++)
	{
		url += '&price'+j+'='+GLOBAL_CART_ITEMS['itemPrice'+i]+'&sku'+j+'='+GLOBAL_CART_ITEMS['itemDesc'+i]+'&qty'+j+'='+GLOBAL_CART_ITEMS['itemQuantity'+i];
		j++;
	}
	document.getElementById('icIframe').src = url;
}
function sendPaypalOrder()
{
	xmlHttp = getXmlHttpObject();
	if (!xmlHttp) return false;
	var postVars = makePostVars();
	postVars += '&forPaypalSite=1';
	document.getElementById('mainCheckoutArea').align = 'center';
	document.getElementById('mainCheckoutArea').style.paddingTop = '100px';
	document.getElementById('mainCheckoutArea').innerHTML = 'Please Wait...<br /><br /><img src="images/ajax-loader_big_ic.gif" border="0" />';
	var url = 'ordersent_ajax.php?SID='+Math.random();
	xmlHttp.onreadystatechange = stateChanged_sendPaypalOrder;
	xmlHttp.open('POST', url, true);
	xmlHttp.setRequestHeader('Content-type', 'application/x-www-form-urlencoded;charset=utf-8');
	xmlHttp.setRequestHeader('Content-length', postVars.length);
	xmlHttp.setRequestHeader('Connection', 'close');
	xmlHttp.send(postVars);
}
function stateChanged_sendPaypalOrder()
{
	if (xmlHttp.readyState == 4 || xmlHttp.readyState == 'complete')
	{
		document.getElementById('mainCheckoutArea').innerHTML = xmlHttp.responseText;
		document.getElementById('frmPaypal').submit();
	}
}

function makePostVars()
{
	var form = document.getElementById('frmCheckout');
	var i;
	var subscribeVal = (document.getElementById('subscribe0').checked ? 0 : 1);
	GLOBAL_SUBSCRIBED = subscribeVal;
	var postVars = '';
	var cartElements = new Array();
	var arrCartItems = new Array();
	var cartElements = makeCart();
	arrCartItems = cartElements[0];
	cartLength   = cartElements[1];

	//GLOBAL_CART_ELEMENTS = cartElements;
	GLOBAL_CART_ITEMS = arrCartItems;
	GLOBAL_CART_LENGTH = cartLength;

	for (i = 0; i < cartLength; i++)
	{
		postVars += '&itemStore'   + i + '=' + arrCartItems['itemStore'+i];		
		var repAmp = /&/gi;
		var repPlus = /\+/gi;
		arrCartItems['itemDesc'+i] = arrCartItems['itemDesc'+i].replace(repAmp, 'ic_ampersand');
		postVars += '&itemDesc'    + i + '=' + arrCartItems['itemDesc'+i];
		arrCartItems['itemProduct'+i] = arrCartItems['itemProduct'+i].replace(repAmp, 'ic_ampersand');
		postVars += '&itemProduct' + i + '=' + arrCartItems['itemProduct'+i];
		arrCartItems['itemSize'+i] = arrCartItems['itemSize'+i].replace(repAmp, 'ic_ampersand');
		postVars += '&itemSize'    + i + '=' + arrCartItems['itemSize'+i];
		arrCartItems['itemColor'+i] = arrCartItems['itemColor'+i].replace(repAmp, 'ic_ampersand');
		postVars += '&itemColor'   + i + '=' + arrCartItems['itemColor'+i];
		postVars += '&itemWeight'   + i + '=' + arrCartItems['itemWeight'+i];
		postVars += '&itemQuantity'+ i + '=' + arrCartItems['itemQuantity'+i];
		postVars += '&itemPrice'   + i + '=' + arrCartItems['itemPrice'+i];
		postVars += '&itemTotal'   + i + '=' + arrCartItems['itemTotal'+i];
		arrCartItems['itemImg'+i] = arrCartItems['itemImg'+i].replace(repPlus, 'ic_plus');
		arrCartItems['itemImg'+i] = arrCartItems['itemImg'+i].replace(repAmp, 'ic_ampersand');
		postVars += '&itemImg'	   + i + '=' + arrCartItems['itemImg'+i];
		postVars += '&tempItemImg' + i + '=' + arrCartItems['tempItemImg'+i];
		postVars += '&storeItemImg'+ i + '=' + arrCartItems['storeItemImg'+i];
		postVars += '&imgHeight'+ i + '=' + arrCartItems['imgHeight'+i];
		postVars += '&imgWidth'+ i + '=' + arrCartItems['imgWidth'+i];
	}
	postVars += '&cartLength='+cartLength;
	if(document.getElementById('ShipToSame'))
		var shipToSame = (document.getElementById('ShipToSame').checked ? 1 : 0);
	else
		var shipToSame = 0;
	postVars += '&shipToSame='+shipToSame;
	postVars += '&loggedIn='+document.getElementById('loggedIn').value;
	postVars += '&customerEmail='+document.getElementById('username').value;
	postVars += '&FirstNameB='+document.getElementById('FirstNameB').value;
	GLOBAL_FIRSTNAMEB = document.getElementById('FirstNameB').value;
	postVars += '&LastNameB='+document.getElementById('LastNameB').value;
	GLOBAL_LASTNAMEB = document.getElementById('LastNameB').value;
	//postVars += '&Email='+document.getElementById('custEmail').value;
	GLOBAL_EMAIL = document.getElementById('username').value;
	
	postVars += '&Phone='+document.getElementById('Phone').value;
	postVars += '&Mobile='+document.getElementById('Mobile').value;
	postVars += '&CompanyB='+document.getElementById('CompanyB').value;
	postVars += '&Address1B='+document.getElementById('Address1B').value;
	postVars += '&Address2B='+document.getElementById('Address2B').value;
	postVars += '&CityB='+document.getElementById('CityB').value;
	postVars += '&StateB='+document.getElementById('StateB').value;
	postVars += '&ZipB='+document.getElementById('ZipB').value;
	postVars += '&CountryBId='+BILLING_COUNTRY_ID;
	postVars += '&CountryB='+BILLING_COUNTRY;
	postVars += '&FirstNameS='+document.getElementById('FirstNameS').value;
	postVars += '&LastNameS='+document.getElementById('LastNameS').value;
	postVars += '&CompanyS='+document.getElementById('CompanyS').value;
	postVars += '&Address1S='+document.getElementById('Address1S').value;
	postVars += '&Address2S='+document.getElementById('Address2S').value;
	postVars += '&CityS='+document.getElementById('CityS').value;
	postVars += '&StateS='+document.getElementById('StateS').value;
	postVars += '&ZipS='+document.getElementById('ZipS').value;
	postVars += '&ShippingCountryId='+COUNTRY_ID;
	GLOBAL_SHIPPINGCOUNTRY_ID = COUNTRY_ID;
	postVars += '&ShippingCountry='+COUNTRY_NAME;
	postVars += '&subscribe='+subscribeVal;
	postVars += '&customerID='+document.getElementById('customerID').value;
	postVars += '&CmbnDomShipHndling='+document.getElementById('CmbnDomShipHndling').value;
	//postVars += '&username='+document.getElementById('username').value;
	postVars += '&Password='+document.getElementById('Password').value;
	postVars += '&Comments='+document.getElementById('Comments').value;
	postVars += '&partnerId='+document.getElementById('partnerId').value;
	postVars += '&partnerLogo='+document.getElementById('partnerLogo').value;
	postVars += '&partnerName='+document.getElementById('partnerName').value;
	GLOBAL_PARTNER_ID = document.getElementById('partnerId').value;
	postVars += '&default_cpc='+document.getElementById('default_cpc').value;
	postVars += '&CAPartnerTax='+document.getElementById('CAPartnerSalesTax').value;
	postVars += '&CAsalesTaxMail='+document.getElementById('ca_sales_tax').value;	
	postVars += '&CCType='+CC_TYPE;
	if(CURRENCY_ABV == 'USD')
	{
		postVars += '&CPC_Mail='+document.getElementById('CPC_Mail').value;
		postVars += '&hdCPCValue='+document.getElementById('hdCPCValue').value;
		postVars += '&sub_total='+document.getElementById('sub_total_h').value;
		GLOBAL_SUB_TOTAL = document.getElementById('sub_total_h').value;
		postVars += '&FreeShippingMinTotal='+document.getElementById('FreeShippingMinTotal').value;
		postVars += '&DomShipping='+document.getElementById('DomShipping').value;
		postVars += '&IntHandling='+document.getElementById('IntHandling').value;
		postVars += '&SSurcharge='+document.getElementById('SSurcharge').value;
		postVars += '&AddSSurcharge='+document.getElementById('AddSSurcharge').value;
		postVars += '&PPI='+document.getElementById('PPI').value;
		postVars += '&Config_IntS_ppi='+document.getElementById('Config_IntS_ppi').value;
		postVars += '&IntShipping='+document.getElementById('IntShipping').value;
		postVars += '&fees='+document.getElementById('fees').value;
		postVars += '&Config_IntH_min='+document.getElementById('Config_IntH_min').value;
		postVars += '&Config_IntH_percent='+document.getElementById('Config_IntH_percent').value;
		postVars += '&Config_IntS_pri_sur='+document.getElementById('Config_IntS_pri_sur').value;
		postVars += '&Config_IntS_max='+document.getElementById('Config_IntS_max').value;
		postVars += '&Config_Fees_min='+document.getElementById('Config_Fees_min').value;
		postVars += '&Config_Fees_percent='+document.getElementById('Config_Fees_percent').value;
		postVars += '&discount='+document.getElementById('discount').value;
		if (document.getElementById('external_domesticshipping'))
			postVars += '&external_domesticshipping='+document.getElementById('external_domesticshipping').value;
		
	}
	else
	{
		postVars += '&CPC_Mail='+convCurrOtherThanCartTotal(document.getElementById('CPC_Mail').value,0);
		postVars += '&hdCPCValue='+convCurrOtherThanCartTotal(document.getElementById('hdCPCValue').value,0);
		postVars += '&sub_total='+convCurrOtherThanCartTotal(document.getElementById('sub_total_h').value,0);
		GLOBAL_SUB_TOTAL = convCurrOtherThanCartTotal(document.getElementById('sub_total_h').value,0);
		postVars += '&FreeShippingMinTotal='+convCurrOtherThanCartTotal(document.getElementById('FreeShippingMinTotal').value,0);
		postVars += '&DomShipping='+convCurrOtherThanCartTotal(document.getElementById('DomShipping').value,0);
		postVars += '&IntHandling='+convCurrOtherThanCartTotal(document.getElementById('IntHandling').value,0);
		postVars += '&SSurcharge='+convCurrOtherThanCartTotal(document.getElementById('SSurcharge').value,0);
		postVars += '&AddSSurcharge='+convCurrOtherThanCartTotal(document.getElementById('AddSSurcharge').value,0);
		postVars += '&PPI='+convCurrOtherThanCartTotal(document.getElementById('PPI').value,0);
		postVars += '&Config_IntS_ppi='+convCurrOtherThanCartTotal(document.getElementById('Config_IntS_ppi').value,0);
		postVars += '&IntShipping='+convCurrOtherThanCartTotal(document.getElementById('IntShipping').value,0);
		postVars += '&fees='+convCurrOtherThanCartTotal(document.getElementById('fees').value,0);
		postVars += '&Config_IntH_min='+convCurrOtherThanCartTotal(document.getElementById('Config_IntH_min').value,0);
		postVars += '&Config_IntH_percent='+convCurrOtherThanCartTotal(document.getElementById('Config_IntH_percent').value,0);
		postVars += '&Config_IntS_pri_sur='+convCurrOtherThanCartTotal(document.getElementById('Config_IntS_pri_sur').value,0);
		postVars += '&Config_IntS_max='+convCurrOtherThanCartTotal(document.getElementById('Config_IntS_max').value,0);
		postVars += '&Config_Fees_min='+convCurrOtherThanCartTotal(document.getElementById('Config_Fees_min').value,0);
		postVars += '&Config_Fees_percent='+convCurrOtherThanCartTotal(document.getElementById('Config_Fees_percent').value,0);
		postVars += '&discount='+convCurrOtherThanCartTotal(document.getElementById('discount').value,0);
		if (document.getElementById('external_domesticshipping'))
			postVars += '&external_domesticshipping='+convCurrOtherThanCartTotal(document.getElementById('external_domesticshipping').value,0);
		
	}

	postVars += '&ExpShipping='+document.getElementById('ExpShipping').value;
	postVars += '&Duties='+document.getElementById('Duties').value;
	postVars += '&hazmatFee='+HAZMAT_FEE;
/*	for (i = 0; i < form.paymentTypeId.length; i++)
	{
		if (form.paymentTypeId[i].checked)
		{
			var paymentTypeIdVal = form.paymentTypeId[i].value;
			break;
		}
	}*/
	postVars += '&paymentTypeId='+PAYMENT_OPTION;
	postVars += '&RefererIP='+document.getElementById('refererIP').value;
	if (document.getElementById('refererOrderStatus'))
		postVars += '&RefererOrderStatus='+document.getElementById('refererOrderStatus').value;
	postVars += '&GrandTotal='+document.getElementById('GrandTotal_h').value;
	postVars += '&qttyallitems='+document.getElementById('qttyallitems').value;
	postVars += '&USDsub_total='+document.getElementById('sub_total_h').value;
	postVars += '&Shipping='+document.getElementById('Shipping_h').value;
	if (document.getElementById('external_order_num'))
		postVars += '&external_order_num='+document.getElementById('external_order_num').value;
	if (document.getElementById('external_shipping_surcharge'))
		postVars += '&external_shipping_surcharge='+document.getElementById('external_shipping_surcharge').value;
	/*
	if (document.getElementById('external_domesticshipping'))
		postVars += '&external_domesticshipping='+document.getElementById('external_domesticshipping').value;
	*/
	if (document.getElementById('affiliate_Id'))
		postVars += '&affiliate_Id='+document.getElementById('affiliate_Id').value;
	if (document.getElementById('eci'))
		postVars += '&eci='+document.getElementById('eci').value;
	postVars += '&Partner='+document.getElementById('Partner').value;
	postVars += '&BankWireFee='+document.getElementById('BankWireFee').value;
//	postVars += '&CurrConvCountry='+document.getElementById('CurrConvCountry').value.split('|')[0];
//	postVars += '&CurrCountryTxt='+document.getElementById('CurrConvCountry').options[document.getElementById('CurrConvCountry').selectedIndex].text;
	var QACount  = parseInt(document.getElementById('QACount').value);
	var QACountJ = parseInt(document.getElementById('QACountJ').value);

	for (i = 0; i <= QACount; i++)
	{
		postVars += '&orderQuestion'+i+'='+document.getElementById('tdQuestion'+i).innerHTML;
		for (var j = 0; j <= QACountJ ; j++)
		{
			if (document.getElementById('OrderQAs'+i+'_'+j).checked)
			{
				postVars += '&OrderQAs'+i+'='+document.getElementById('OrderQAs'+i+'_'+j).value.split('#')[0];
				postVars += '&orderQAnswer'+i+'='+document.getElementById('OrderQAs'+i+'_'+j).value.split('#')[1];
			}
		}
	}
	postVars += '&QACount='+QACount;
	postVars += '&discountType='+document.getElementById('discountType').value;
	postVars += '&CCNumber='+document.getElementById('CCNumber').value;
	postVars += '&CCSecurityCode='+document.getElementById('CCSecurityCode').value;
	postVars += '&CCMonth='+document.getElementById('CCMonth').value;
	postVars += '&CCYear='+document.getElementById('CCYear').value;
	postVars += '&CCOwner='+document.getElementById('CCOwner').value;
	postVars += '&CCBankPhone='+document.getElementById('CCBankPhone').value;
	postVars += '&CCBankName='+document.getElementById('CCBankName').value;
	postVars += '&CurrConversion='+document.getElementById('GrandTotal').value;
	postVars += '&abtOrderId='+document.getElementById('abtOrderId').value;
	postVars += '&abandonedId='+document.getElementById('abandonedId').value;
	postVars += '&currencyAbv='+CURRENCY_ABV;
	postVars += '&currencyRate='+CURRENCY_RATE;
	postVars += '&currencyCode='+CURRENCY_CODE;	
	return postVars;
}
//----Money Booker send order function ---
function sendMoneyBookerOrder(){
	xmlHttp = getXmlHttpObject();
	if (!xmlHttp) return false;
	var postVars = makePostVars();
	postVars += '&forMoneyBookerSite=1';
	document.getElementById('mainCheckoutArea').align = 'center';
	document.getElementById('mainCheckoutArea').style.paddingTop = '100px';
	document.getElementById('mainCheckoutArea').innerHTML = 'Please Wait...<br /><br /><img src="images/ajax-loader_big_ic.gif" border="0" />';
	var url = 'ordersent_ajax.php?SID='+Math.random();
	xmlHttp.onreadystatechange = stateChanged_sendMoneyBooker;
	xmlHttp.open('POST', url, true);
	xmlHttp.setRequestHeader('Content-type', 'application/x-www-form-urlencoded;charset=utf-8');
	xmlHttp.setRequestHeader('Content-length', postVars.length);
	xmlHttp.setRequestHeader('Connection', 'close');
	xmlHttp.send(postVars);
}
function stateChanged_sendMoneyBooker(){
	if (xmlHttp.readyState == 4 || xmlHttp.readyState == 'complete'){
		document.getElementById('mainCheckoutArea').innerHTML = xmlHttp.responseText;
		//alert(xmlHttp.responseText)
		document.getElementById('frmMoneyBooker').submit();
	}
}

function sendGoogleCheckOutOrder(){
	xmlHttp = getXmlHttpObject();
	if (!xmlHttp) return false;
	var postVars = makePostVars();
	postVars += '&forGoogleCheckOut=1';
	
	document.getElementById('mainCheckoutArea').align = 'center';
	document.getElementById('mainCheckoutArea').style.paddingTop = '100px';
	document.getElementById('mainCheckoutArea').innerHTML = 'Please Wait...<br /><br /><img src="images/ajax-loader_big_ic.gif" border="0" />';
	var url = 'ordersent_ajax.php?SID='+Math.random();
	xmlHttp.onreadystatechange = stateChanged_sendGoogleCheckOut;
	xmlHttp.open('POST', url, true);
	xmlHttp.setRequestHeader('Content-type', 'application/x-www-form-urlencoded;charset=utf-8');
	xmlHttp.setRequestHeader('Content-length', postVars.length);
	xmlHttp.setRequestHeader('Connection', 'close');
	xmlHttp.send(postVars);
}
function stateChanged_sendGoogleCheckOut(){
	if (xmlHttp.readyState == 4 || xmlHttp.readyState == 'complete'){
		document.getElementById('mainCheckoutArea').innerHTML = xmlHttp.responseText;
		document.getElementById('BB_BuyButtonForm').submit();
	}
}
function PostGoogleOrder() {
 var objGoogleForm = document.getElementById('frmGoogleCheckOut');
 objGoogleForm.submit();
}
function PaypalVerfication()
{
	return confirm("Are you sure you want to place an order through PayPal?");

}