
/*
-- ------ Order ------ --
*/
function Order(){}
//-- ------ #Parameters ------ --
Order.prototype.sCarURL="Plus/Common/Shop/salecar_list.php";
Order.prototype.sOrderURL="Plus/Common/Shop/saleorder_list.php";
Order.prototype.sUserreceiveaddessURL="Plus/Common/Shop/userreceiveaddress.php";
Order.prototype.sAjax_0=new netsSingleAjax();


//-- ------ #Methods ------ --
//-- #Submit --
/*
Define:
商品ID,数量,价格,积分,活动ID,所属商品ID,类型,参数(8)
Saleid,Count,Price,Code,Activeid,Parentid,Type,Parameter(8)
*/
Order.prototype.OnOrder_Submit=function(pType,pSetsAble){
	//-- ------ ### ------ --
	var tmpURL="";
	var Coun0=0;
	var tmpElement=null;
	//-- ### --
	tmpURL=tmpCommon.sysHome+this.sOrderURL+"?DOrderOperation=";
	if(pType==1){
		tmpURL=tmpCommon.sysHome+this.sCarURL+"?DOrderOperation=";
	}
	//-- ------ ### ------ --
	//-- ### --
	tmpParameter="";
	tmpAR0=document.getElementById("Order_0_Parameters_Controls_Txt").value.split(tmpCommon.sysSPLIT1);
	Coun0=0;
	while((tmpAR0.length-1)>Coun0){
		tmpParameter+=document.getElementById(tmpAR0[Coun0]).value+tmpCommon.sysSPLIT15;
		Coun0++;
	}
	
	tmpSTR=
		tmpCommon.encodeURL(document.getElementById("Order_0_ID_Txt").value,0)+tmpCommon.sysSPLIT2+
		tmpCommon.encodeURL(document.getElementById("Order_0_Count_Txt").value,0)+tmpCommon.sysSPLIT2+
		tmpCommon.encodeURL(document.getElementById("Order_0_Price_Txt").value,0)+tmpCommon.sysSPLIT2+
		tmpCommon.encodeURL(document.getElementById("Order_0_Code_Txt").value,0)+tmpCommon.sysSPLIT2+
		tmpCommon.encodeURL(document.getElementById("Order_0_Activeid_Txt").value,0)+tmpCommon.sysSPLIT2+
		tmpCommon.encodeURL(document.getElementById("Order_0_Parentid_Txt").value,0)+tmpCommon.sysSPLIT2+
		tmpCommon.encodeURL(document.getElementById("Order_0_Type_Txt").value,0)+tmpCommon.sysSPLIT2+
		tmpCommon.encodeURL(document.getElementById("Order_0_Parameters_Txt").value,0)+tmpCommon.sysSPLIT2+
		tmpCommon.sysSPLIT5;
	
	tmpURL+=tmpSTR;
	//-- ### --
	tmpFlag="AccessoriesP";
	if(document.getElementById("mainSale_"+tmpFlag+"_Txt")!=undefined){
		tmpAR0=document.getElementById("mainSale_"+tmpFlag+"_Txt").value.split(tmpCommon.sysSPLIT1);
		Coun0=0;
		tmpElement=document.getElementById("Order_"+tmpFlag+"_"+Coun0+"_ID_Txt");
		while(tmpAR0.length>Coun0){
			if(tmpAR0[Coun0]!=""){
				tmpSTR=
					tmpCommon.encodeURL(document.getElementById("Order_"+tmpFlag+"_"+tmpAR0[Coun0]+"_ID_Txt").value,0)+tmpCommon.sysSPLIT2+
					tmpCommon.encodeURL(document.getElementById("Order_"+tmpFlag+"_"+tmpAR0[Coun0]+"_Count_Txt").value,0)+tmpCommon.sysSPLIT2+
					tmpCommon.encodeURL(document.getElementById("Order_"+tmpFlag+"_"+tmpAR0[Coun0]+"_Price_Txt").value,0)+tmpCommon.sysSPLIT2+
					tmpCommon.encodeURL(document.getElementById("Order_"+tmpFlag+"_"+tmpAR0[Coun0]+"_Code_Txt").value,0)+tmpCommon.sysSPLIT2+
					tmpCommon.encodeURL(document.getElementById("Order_"+tmpFlag+"_"+tmpAR0[Coun0]+"_Activeid_Txt").value,0)+tmpCommon.sysSPLIT2+
					tmpCommon.encodeURL(document.getElementById("Order_"+tmpFlag+"_"+tmpAR0[Coun0]+"_Parentid_Txt").value,0)+tmpCommon.sysSPLIT2+
					tmpCommon.encodeURL(document.getElementById("Order_"+tmpFlag+"_"+tmpAR0[Coun0]+"_Type_Txt").value,0)+tmpCommon.sysSPLIT2+
					tmpCommon.encodeURL(document.getElementById("Order_"+tmpFlag+"_"+tmpAR0[Coun0]+"_Parameters_Txt").value,0)+tmpCommon.sysSPLIT2+
					tmpCommon.sysSPLIT5;
				
				tmpURL+=tmpSTR;
			}
			Coun0++;
		}
	}
	//-- ### --
	tmpFlag="Accessories";
	if(document.getElementById("mainSale_"+tmpFlag+"_Txt")!=undefined){
		tmpAR0=document.getElementById("mainSale_"+tmpFlag+"_Txt").value.split(tmpCommon.sysSPLIT1);
		Coun0=0;
		tmpElement=document.getElementById("Order_"+tmpFlag+"_"+Coun0+"_ID_Txt");
		while(tmpAR0.length>Coun0){
			if(tmpAR0[Coun0]!=""){
				tmpSTR=
					tmpCommon.encodeURL(document.getElementById("Order_"+tmpFlag+"_"+tmpAR0[Coun0]+"_ID_Txt").value,0)+tmpCommon.sysSPLIT2+
					tmpCommon.encodeURL(document.getElementById("Order_"+tmpFlag+"_"+tmpAR0[Coun0]+"_Count_Txt").value,0)+tmpCommon.sysSPLIT2+
					tmpCommon.encodeURL(document.getElementById("Order_"+tmpFlag+"_"+tmpAR0[Coun0]+"_Price_Txt").value,0)+tmpCommon.sysSPLIT2+
					tmpCommon.encodeURL(document.getElementById("Order_"+tmpFlag+"_"+tmpAR0[Coun0]+"_Code_Txt").value,0)+tmpCommon.sysSPLIT2+
					tmpCommon.encodeURL(document.getElementById("Order_"+tmpFlag+"_"+tmpAR0[Coun0]+"_Activeid_Txt").value,0)+tmpCommon.sysSPLIT2+
					tmpCommon.encodeURL(document.getElementById("Order_"+tmpFlag+"_"+tmpAR0[Coun0]+"_Parentid_Txt").value,0)+tmpCommon.sysSPLIT2+
					tmpCommon.encodeURL(document.getElementById("Order_"+tmpFlag+"_"+tmpAR0[Coun0]+"_Type_Txt").value,0)+tmpCommon.sysSPLIT2+
					tmpCommon.encodeURL(document.getElementById("Order_"+tmpFlag+"_"+tmpAR0[Coun0]+"_Parameters_Txt").value,0)+tmpCommon.sysSPLIT2+
					tmpCommon.sysSPLIT5;
				
				tmpURL+=tmpSTR;
			}
			Coun0++;
		}
	}
	//-- ### --
	tmpFlag="Pesents";
	if(document.getElementById("mainSale_"+tmpFlag+"_Txt")!=undefined){
		tmpAR0=document.getElementById("mainSale_"+tmpFlag+"_Txt").value.split(tmpCommon.sysSPLIT1);
		Coun0=0;
		tmpElement=document.getElementById("Order_"+tmpFlag+"_"+Coun0+"_ID_Txt");
		while(tmpAR0.length>Coun0){
			if(tmpAR0[Coun0]!=""){
				tmpSTR=
					tmpCommon.encodeURL(document.getElementById("Order_"+tmpFlag+"_"+tmpAR0[Coun0]+"_ID_Txt").value,0)+tmpCommon.sysSPLIT2+
					tmpCommon.encodeURL(document.getElementById("Order_"+tmpFlag+"_"+tmpAR0[Coun0]+"_Count_Txt").value,0)+tmpCommon.sysSPLIT2+
					tmpCommon.encodeURL(document.getElementById("Order_"+tmpFlag+"_"+tmpAR0[Coun0]+"_Price_Txt").value,0)+tmpCommon.sysSPLIT2+
					tmpCommon.encodeURL(document.getElementById("Order_"+tmpFlag+"_"+tmpAR0[Coun0]+"_Code_Txt").value,0)+tmpCommon.sysSPLIT2+
					tmpCommon.encodeURL(document.getElementById("Order_"+tmpFlag+"_"+tmpAR0[Coun0]+"_Activeid_Txt").value,0)+tmpCommon.sysSPLIT2+
					tmpCommon.encodeURL(document.getElementById("Order_"+tmpFlag+"_"+tmpAR0[Coun0]+"_Parentid_Txt").value,0)+tmpCommon.sysSPLIT2+
					tmpCommon.encodeURL(document.getElementById("Order_"+tmpFlag+"_"+tmpAR0[Coun0]+"_Type_Txt").value,0)+tmpCommon.sysSPLIT2+
					tmpCommon.encodeURL(document.getElementById("Order_"+tmpFlag+"_"+tmpAR0[Coun0]+"_Parameters_Txt").value,0)+tmpCommon.sysSPLIT2+
					tmpCommon.sysSPLIT5;
				
				tmpURL+=tmpSTR;
			}
			Coun0++;
		}
	}
	//-- ### --
	tmpFlag="A"
	var Coun0=0;
	var tmpElement=document.getElementById("Order_"+tmpFlag+"_"+Coun0+"_ID_Txt");
	while(tmpElement!=undefined && pSetsAble==1){
		if(document.getElementById("Order_"+tmpFlag+"_"+Coun0+"_Txt").checked){
			tmpSTR=
				tmpCommon.encodeURL(document.getElementById("Order_"+tmpFlag+"_"+Coun0+"_ID_Txt").value,0)+tmpCommon.sysSPLIT2+
				tmpCommon.encodeURL(document.getElementById("Order_"+tmpFlag+"_"+Coun0+"_Count_Txt").value,0)+tmpCommon.sysSPLIT2+
				tmpCommon.encodeURL(document.getElementById("Order_"+tmpFlag+"_"+Coun0+"_Price_Txt").value,0)+tmpCommon.sysSPLIT2+
				tmpCommon.encodeURL(document.getElementById("Order_"+tmpFlag+"_"+Coun0+"_Code_Txt").value,0)+tmpCommon.sysSPLIT2+
				tmpCommon.encodeURL(document.getElementById("Order_"+tmpFlag+"_"+Coun0+"_Activeid_Txt").value,0)+tmpCommon.sysSPLIT2+
				tmpCommon.encodeURL(document.getElementById("Order_"+tmpFlag+"_"+Coun0+"_Parentid_Txt").value,0)+tmpCommon.sysSPLIT2+
				tmpCommon.encodeURL(document.getElementById("Order_"+tmpFlag+"_"+Coun0+"_Type_Txt").value,0)+tmpCommon.sysSPLIT2+
				tmpCommon.encodeURL(document.getElementById("Order_"+tmpFlag+"_"+Coun0+"_Parameters_Txt").value,0)+tmpCommon.sysSPLIT2+
				tmpCommon.sysSPLIT5;
			
			tmpURL+=tmpSTR;
		}
		Coun0++;
		tmpElement=document.getElementById("Order_"+tmpFlag+"_"+Coun0+"_ID_Txt");
	}
	//-- ------ ### ------ --
	if(pType==0){
		tmpCommon.OnUserURL(tmpURL,"登陆后才能提交订单");
	}else{
		window.location=tmpURL
	}
	return 0;
}

//-- #Order --
Order.prototype.OnOrder_Initial=function(){
	document.getElementById("OrderUserinfo_Contact_ZoneTxt").rows[0].deleteCell(0);
	
	return 0;
}

Order.prototype.OnOrder_CalculationALL=function(){
	var tmpALL=0.00;
	
	tmpALL+=parseFloat(document.getElementById("OrderInfo_TotalPayTxt").value);

	document.getElementById("OrderInfo_ALLPAY").innerHTML=tmpALL;
	return 0;
}

Order.prototype.OnOrder_CountAdd=function(pIndex){
	var tmpINT=parseInt(document.getElementById("Order_"+pIndex+"_Count_Txt").value);
	tmpINT++;
	document.getElementById("Order_"+pIndex+"_Count_Txt").value=tmpINT;
	
	this.OnOrder_ReCalculation();
	return 0;
}
Order.prototype.OnOrder_CountSub=function(pIndex){
	var tmpINT=parseInt(document.getElementById("Order_"+pIndex+"_Count_Txt").value);
	tmpINT--;
	document.getElementById("Order_"+pIndex+"_Count_Txt").value=tmpINT;
	
	this.OnOrder_ReCalculation();
	return 0;
}
Order.prototype.OnOrder_ReCalculation=function(){
	var Coun0=0;
	var tmpTotalPrice=0.00;
	var tmpTotalPrice0=0.00;
	var tmpTotalCode=0.00;
	var tmpIDS="";
	tmpElement=document.getElementById("OrderInfo_Price_"+Coun0);
	while(tmpElement!=undefined){
		var tmpSaleid=parseFloat(document.getElementById("Order_"+Coun0+"_ID_Txt").value);
		var tmpPrice=parseFloat(document.getElementById("Order_"+Coun0+"_Price_Txt").value);
		var tmpPrice0=parseFloat(document.getElementById("Order_"+Coun0+"_Price0_Txt").value);
		var tmpCode=parseFloat(document.getElementById("Order_"+Coun0+"_Code_Txt").value);
		var tmpINT=parseInt(document.getElementById("Order_"+Coun0+"_Count_Txt").value);
		var tmpMin=parseInt(document.getElementById("Order_"+Coun0+"_PeopleLowLimit_Txt").value);
		if(tmpMin>tmpINT){
			tmpINT=tmpMin;
		}
		var tmpMax=parseInt(document.getElementById("Order_"+Coun0+"_PeopleHighLimit_Txt").value);
		if(tmpMax<tmpINT){
			tmpINT=tmpMax;
		}
		var tmpCount=tmpINT;
		document.getElementById("Order_"+Coun0+"_Count_Txt").value=tmpINT;
		document.getElementById("OrderInfo_Pay0_"+Coun0).innerHTML=tmpPrice0*tmpCount;
		document.getElementById("OrderInfo_Pay_"+Coun0).innerHTML=tmpPrice*tmpCount;
		tmpTotalPrice+=tmpPrice*tmpCount;
		tmpTotalPrice0+=tmpPrice0*tmpCount;
		tmpTotalCode+=tmpCode*tmpCount;
		tmpIDS+=document.getElementById("Order_"+Coun0+"_ID_Txt").value+tmpCommon.sysSPLIT3+tmpCount+tmpCommon.sysSPLIT2;
		
		Coun0++;
		tmpElement=document.getElementById("OrderInfo_Price_"+Coun0);
	}
	document.getElementById("OrderInfo_TotalPay").innerHTML=tmpTotalPrice;
	document.getElementById("OrderInfo_TotalSaveprice").innerHTML=tmpTotalPrice0-tmpTotalPrice;
	document.getElementById("OrderInfo_TotalCode").innerHTML=tmpTotalCode;
	document.getElementById("OrderInfo_TotalPayTxt").value=tmpTotalPrice;
	document.getElementById("IDS").value=tmpIDS;
	
	this.OnOrder_CalculationALL();
	this.OnOrder_SaveOrderContent();
	return 0;
}
Order.prototype.OnOrder_DeleteRow=function(pIndex){
	document.getElementById("OrderInfo_Row_"+pIndex).className=tmpCommon.sysHidden;
	document.getElementById("Order_"+pIndex+"_PeopleLowLimit_Txt").value=-1;
	document.getElementById("Order_"+pIndex+"_PeopleHighLimit_Txt").value=1;
	document.getElementById("Order_"+pIndex+"_Count_Txt").value=0;
	
	this.OnOrder_ReCalculation();
	return 0;
}
Order.prototype.OnOrder_SetIDS=function(){
	var tmpOrderContent="";
	var Coun0=0;
	var tmpPay=0;
	var tmpElement=document.getElementById("Order_"+Coun0+"_ID_Txt");
	while(tmpElement!=undefined){
		tmpCount=parseInt(document.getElementById("Order_"+Coun0+"_Count_Txt").value);
		tmpPrice=parseInt(document.getElementById("Order_"+Coun0+"_Price_Txt").value);
		if(tmpCount>0){
			tmpPay=tmpPrice*tmpCount;

			tmpOrderContent+=
				document.getElementById("Order_"+Coun0+"_ID_Txt").value+tmpCommon.sysSPLIT2+
				document.getElementById("Order_"+Coun0+"_Count_Txt").value+tmpCommon.sysSPLIT2+
				document.getElementById("Order_"+Coun0+"_Price_Txt").value+tmpCommon.sysSPLIT2+
				document.getElementById("Order_"+Coun0+"_Code_Txt").value+tmpCommon.sysSPLIT2+
				document.getElementById("Order_"+Coun0+"_Activeid_Txt").value+tmpCommon.sysSPLIT2+
				document.getElementById("Order_"+Coun0+"_Parentid_Txt").value+tmpCommon.sysSPLIT2+
				document.getElementById("Order_"+Coun0+"_Type_Txt").value+tmpCommon.sysSPLIT2+
				document.getElementById("Order_"+Coun0+"_Parameters_Txt").value+tmpCommon.sysSPLIT2+
				tmpCommon.sysSPLIT5;
			
		}
		
		Coun0++;
		tmpElement=document.getElementById("Order_"+Coun0+"_ID_Txt");
	}
	
	document.getElementById("IDS").value=tmpOrderContent;
	return 0;
}

Order.prototype.OnOrder_SaveOrderContent=function(){
	//-- ### --
	var tmpURL="";
	var Coun0=0;
	var tmpElement=document.getElementById("OrderInfo_Price_"+Coun0);
	while(tmpElement!=undefined){
		tmpSTR=
			tmpCommon.encodeURL(document.getElementById("Order_"+Coun0+"_ID_Txt").value,0)+tmpCommon.sysSPLIT2+
			tmpCommon.encodeURL(document.getElementById("Order_"+Coun0+"_Count_Txt").value,0)+tmpCommon.sysSPLIT2+
			tmpCommon.encodeURL(document.getElementById("Order_"+Coun0+"_Price_Txt").value,0)+tmpCommon.sysSPLIT2+
			tmpCommon.encodeURL(document.getElementById("Order_"+Coun0+"_Code_Txt").value,0)+tmpCommon.sysSPLIT2+
			tmpCommon.encodeURL(document.getElementById("Order_"+Coun0+"_Activeid_Txt").value,0)+tmpCommon.sysSPLIT2+
			tmpCommon.encodeURL(document.getElementById("Order_"+Coun0+"_Parentid_Txt").value,0)+tmpCommon.sysSPLIT2+
			tmpCommon.encodeURL(document.getElementById("Order_"+Coun0+"_Type_Txt").value,0)+tmpCommon.sysSPLIT2+
			tmpCommon.encodeURL(document.getElementById("Order_"+Coun0+"_Parameters_Txt").value,0)+tmpCommon.sysSPLIT2+
			tmpCommon.sysSPLIT5;
		tmpURL+=tmpSTR;
		Coun0++;
		tmpElement=document.getElementById("OrderInfo_Price_"+Coun0);
	}
	//-- #SEND --
	var tmpURL=tmpCommon.sysRoot+this.sCarURL+"?DOrderContent="+tmpURL;
	this.sAjax_0.sPanel="Data";
	this.sAjax_0.sFlag="Data";
	this.sAjax_0.sendRequestSp(tmpURL,"order_SaveOrderContent_callback()");
	//window.open(tmpURL,"_blank");
	return 0;
}
function order_SaveOrderContent_callback(){}



Order.prototype.OnOrder_ResetOptionbox=function(){
	
	/*
	var Coun0=0;
	while(document.getElementById("OrderUserinfo_OptionBox").rows.length>Coun0){
		document.getElementById("OrderUserinfo_OptionBox").rows[Coun0].deleteCell(0);
		Coun0++;
	}
	var Coun0=0;
	while(document.getElementById("OrderSendmodel_OptionBox").rows.length>Coun0){
		document.getElementById("OrderSendmodel_OptionBox").rows[Coun0].deleteCell(0);
		Coun0++;
	}
	var Coun0=0;
	while(document.getElementById("OrderPaytype_OptionBox").rows.length>Coun0){
		document.getElementById("OrderPaytype_OptionBox").rows[Coun0].deleteCell(0);
		Coun0++;
	}
	var Coun0=0;
	while(document.getElementById("Favourableids_OptionBox").rows.length>Coun0){
		document.getElementById("Favourableids_OptionBox").rows[Coun0].deleteCell(0);
		Coun0++;
	}
	*/
	
	return 0;
}
Order.prototype.OnOrder_Receiveaddress=function(){
	
	var Coun0=0;
	if(document.getElementById(tmpCommon.sysForm).Receiveaddress_Txt.value!=undefined){
		if(document.getElementById(tmpCommon.sysForm).Receiveaddress_Txt.checked){
			document.getElementById("OrderUserinfo_Label").innerHTML=document.getElementById("Receiveaddress_TxtLabel"+Coun0).innerHTML;
		}
	}
	Coun0=0;
	while(document.getElementById(tmpCommon.sysForm).Receiveaddress_Txt.length>Coun0){
		if(document.getElementById(tmpCommon.sysForm).Receiveaddress_Txt[Coun0].checked){
			document.getElementById("OrderUserinfo_Label").innerHTML=document.getElementById("Receiveaddress_TxtLabel"+Coun0).innerHTML;
		}
		Coun0++;
	}
	
	return 0;
}
Order.prototype.OnOrder_OrderSendmodel=function(){

	var Coun0=0;
	if(document.getElementById(tmpCommon.sysForm).OrderSendmodel_Txt.value!=undefined){
		if(document.getElementById(tmpCommon.sysForm).OrderSendmodel_Txt.checked){
			document.getElementById("OrderSendmodel_Label").innerHTML=document.getElementById("OrderSendmodel_TxtLabel"+Coun0).innerHTML;
		}
	}
	Coun0=0;
	while(document.getElementById(tmpCommon.sysForm).OrderSendmodel_Txt.length>Coun0){
		if(document.getElementById(tmpCommon.sysForm).OrderSendmodel_Txt[Coun0].checked){
			document.getElementById("OrderSendmodel_Label").innerHTML=document.getElementById("OrderSendmodel_TxtLabel"+Coun0).innerHTML;
		}
		Coun0++;
	}
	
	return 0;
}
Order.prototype.OnOrder_OrderPaytype=function(){

	var Coun0=0;
	if(document.getElementById(tmpCommon.sysForm).OrderPaytype_Txt.value!=undefined){
		if(document.getElementById(tmpCommon.sysForm).OrderPaytype_Txt.checked){
			document.getElementById("OrderPaytype_Label").innerHTML=document.getElementById("OrderPaytype_TxtLabel"+Coun0).innerHTML;
		}
	}
	Coun0=0;
	while(document.getElementById(tmpCommon.sysForm).OrderPaytype_Txt.length>Coun0){
		if(document.getElementById(tmpCommon.sysForm).OrderPaytype_Txt[Coun0].checked){
			document.getElementById("OrderPaytype_Label").innerHTML=document.getElementById("OrderPaytype_TxtLabel"+Coun0).innerHTML;
		}
		Coun0++;
	}
	
	return 0;
}
Order.prototype.OnOrder_OrderOther=function(){
	//#Invoice
	var tmpInvoice="";
	var Coun0=0;
	if(document.getElementById(tmpCommon.sysForm).OrderOther_Invoice_Txt.value!=undefined){
		if(document.getElementById(tmpCommon.sysForm).OrderOther_Invoice_Txt.checked){
			tmpInvoice=document.getElementById("OrderOther_Invoice_TxtLabel"+Coun0).innerHTML;
		}
	}
	Coun0=0;
	while(document.getElementById(tmpCommon.sysForm).OrderOther_Invoice_Txt.length>Coun0){
		if(document.getElementById(tmpCommon.sysForm).OrderOther_Invoice_Txt[Coun0].checked){
			tmpInvoice=document.getElementById("OrderOther_Invoice_TxtLabel"+Coun0).innerHTML;
		}
		Coun0++;
	}
	//#InvoiceUnit
	var tmpInvoiceUnit="";
	var Coun0=0;
	if(document.getElementById(tmpCommon.sysForm).OrderOther_InvoiceUnit_Txt.value!=undefined){
		if(document.getElementById(tmpCommon.sysForm).OrderOther_InvoiceUnit_Txt.checked){
			tmpInvoiceUnit=document.getElementById("OrderOther_InvoiceUnit_TxtLabel"+Coun0).innerHTML;
		}
	}
	Coun0=0;
	while(document.getElementById(tmpCommon.sysForm).OrderOther_InvoiceUnit_Txt.length>Coun0){
		if(document.getElementById(tmpCommon.sysForm).OrderOther_InvoiceUnit_Txt[Coun0].checked){
			tmpInvoiceUnit=document.getElementById("OrderOther_InvoiceUnit_TxtLabel"+Coun0).innerHTML;
		}
		Coun0++;
	}
	//#InvoiceUnit
	var tmpInvoiceTitle=document.getElementById("OrderOther_InvoiceTitle_Txt").value;
	
	//#InvoiceUnit
	var tmpInvoiceTitleType=document.getElementById("OrderOther_InvoiceTitleType_Txt").options[document.getElementById("OrderOther_InvoiceTitleType_Txt").selectedIndex].text;
	
	//#InvoiceUnit
	var tmpFavourableids="";
	var Coun0=0;
	if(document.getElementById(tmpCommon.sysForm).OrderOther_FavourableidsTxt.value!=undefined){
		if(document.getElementById(tmpCommon.sysForm).OrderOther_FavourableidsTxt.checked){
			tmpFavourableids+=document.getElementById("OrderOther_FavourableidsTxtLabel"+Coun0).innerHTML;
		}
	}
	Coun0=0;
	while(document.getElementById(tmpCommon.sysForm).OrderOther_FavourableidsTxt.length>Coun0){
		if(document.getElementById(tmpCommon.sysForm).OrderOther_FavourableidsTxt[Coun0].checked){
			tmpFavourableids+=document.getElementById("OrderOther_FavourableidsTxtLabel"+Coun0).innerHTML+"；";
		}
		Coun0++;
	}
	
	document.getElementById("OrderOther_Label").innerHTML=
		"<b>是否需要发票：</b>"+tmpInvoice+"&nbsp;&nbsp;"+
		"<b>索取人类型：</b>"+tmpInvoiceUnit+"&nbsp;&nbsp;"+
		"<b>发票抬头：</b>"+tmpInvoiceTitle+"&nbsp;&nbsp;"+
		"<b>发票类型：</b>"+tmpInvoiceTitleType+"&nbsp;&nbsp;"+
		"<br /><b>使用优惠券：</b>"+tmpFavourableids+"&nbsp;&nbsp;"
		;
	return 0;
}

Order.prototype.OnOrder_ShowBox=function(pName){

	if(document.getElementById(pName+"_Box").className==tmpCommon.sysHidden){
		document.getElementById(pName+"_Button").innerHTML="[关闭]";
		document.getElementById(pName+"_Label").className=tmpCommon.sysHidden;
		document.getElementById(pName+"_Box").className="ConfirmOrder_1_41";
	}else{
		document.getElementById(pName+"_Button").innerHTML="[修改]";
		document.getElementById(pName+"_Label").className="ConfirmOrder_1_48";
		document.getElementById(pName+"_Box").className=tmpCommon.sysHidden;
	}
	
	return 0;
}
Order.prototype.OnOrder_Contact_New=function(){

	document.getElementById("OrderUserinfo_Contact_Box").className="ConfirmOrder_1_42";
	
	document.getElementById("OrderUserinfo_Contact_ConManTxt").value="";
	document.getElementById("OrderUserinfo_Contact_MobileTxt").value="";
	document.getElementById("OrderUserinfo_Contact_EmailTxt").value="";
	/*
	document.getElementById("OrderUserinfo_Contact_Zone_CountryTxt").selectIndex=0;
	document.getElementById("OrderUserinfo_Contact_Zone_ProvinceTxt").selectIndex=0;
	document.getElementById("OrderUserinfo_Contact_Zone_CityTxt").selectIndex=0;
	*/
	document.getElementById("OrderUserinfo_Contact_AddressTxt").value="";
	document.getElementById("OrderUserinfo_Contact_TeleTxt").value="";
	document.getElementById("OrderUserinfo_Contact_NumCodeTxt").value="";
	//#Zone
	var tmpURL=tmpCommon.sysPage+"?ActionType=DZone";
	this.sAjax_0.sPanel="ZoneChooseTxtPanelBox";
	this.sAjax_0.sFlag="ZoneChooseTxt";
	this.sAjax_0.sendRequestSp(tmpURL,"order_Contact_ZoneReflash_callback()");
	//window.open(tmpURL,"_blank");


	return 0;
}
Order.prototype.OnOrder_Contact_Edit=function(pID,pConMan,pMobile,pEmail,pZone_Country,pZone_Province,pZone_City,
	pAddress,pTele,pNumCode){

	document.getElementById("OrderUserinfo_Contact_Box").className="ConfirmOrder_1_42";

	document.getElementById("OrderUserinfo_Contact_IDTxt").value=pID;
	document.getElementById("OrderUserinfo_Contact_ConManTxt").value=pConMan;
	document.getElementById("OrderUserinfo_Contact_MobileTxt").value=pMobile;
	document.getElementById("OrderUserinfo_Contact_EmailTxt").value=pEmail;
	/*
	document.getElementById("OrderUserinfo_Contact_Zone_CountryTxt").selectIndex=0;
	document.getElementById("OrderUserinfo_Contact_Zone_ProvinceTxt").selectIndex=0;
	document.getElementById("OrderUserinfo_Contact_Zone_CityTxt").selectIndex=0;
	*/
	document.getElementById("OrderUserinfo_Contact_AddressTxt").value=pAddress;
	document.getElementById("OrderUserinfo_Contact_TeleTxt").value=pTele;
	document.getElementById("OrderUserinfo_Contact_NumCodeTxt").value=pNumCode;
	//#Zone
	if(pZone_City<2){
		pZone_City=2;
	}
	var tmpURL=tmpCommon.sysPage+"?ActionType=DZone&DZone="+pZone_City;
	this.sAjax_0.sPanel="ZoneChooseTxtPanelBox";
	this.sAjax_0.sFlag="ZoneChooseTxt";
	this.sAjax_0.sendRequestSp(tmpURL,"order_Contact_ZoneReflash_callback()");
	//window.open(tmpURL,"_blank");


	return 0;
}
function order_Contact_ZoneReflash_callback(){
	var tmpFlag=tmpOrder.sAjax_0.sFlag;
	var tmpPanel=document.getElementById(tmpOrder.sAjax_0.sPanel);
	var tmpURL=tmpOrder.sAjax_0.sURL;
	var tmpHttpRequests=tmpOrder.sAjax_0.sHttpRequests;
	//alert(tmpHttpRequests.responseText);
	if(tmpHttpRequests.readyState==4){
		//alert(tmpHttpRequests.responseText);
		var tmpData=getDataByFlag(tmpHttpRequests.responseText,tmpFlag);
		//alert(tmpData);
		if(tmpData.indexOf("sendRequest")>=0 && tmpData!="<!--sendRequest-->"){
			tmpPanel.innerHTML=tmpData;
	    	tmpFrames.showLoading(1);
	    }else{
	    	//tmpPanel.innerHTML=tmpCommon.sysError_Ajax.replace(/\{Nets.Response}/g,tmpURL);
	    	tmpFrames.showLoading(1);
	    }
	}else{
		tmpFrames.showLoading(0);
	}
}

Order.prototype.OnOrder_Contact_Save=function(){
	//-- #CHECK --
	//-- ------ #Check ------ --
	var tmpError="";
	var tmpChecker=new netsChecker();
	var Coun0=0;
	//#OrderUserinfo_Contact_ConManTxt
	tmpCheckCont=document.getElementById("OrderUserinfo_Contact_ConManTxt");
	tmpCheckCont.value=tmpChecker.Filter(tmpCheckCont.value,0);
	if(!tmpChecker.CheckLen(tmpCheckCont.value,1,120)){
		Coun0++;
		tmpError+=Coun0+".联系人姓名不能为空"+tmpCommon.sysSPLIT8;
	}
	//#OrderUserinfo_Contact_MobileTxt
	tmpCheckCont=document.getElementById("OrderUserinfo_Contact_MobileTxt");
	tmpCheckCont.value=tmpChecker.Filter(tmpCheckCont.value,0);
	if(!tmpChecker.CheckLen(tmpCheckCont.value,10,12)){
		Coun0++;
		tmpError+=Coun0+".手机号必须为11位的数字"+tmpCommon.sysSPLIT8;
	}
	//#OrderUserinfo_Contact_EmailTxt
	tmpCheckCont=document.getElementById("OrderUserinfo_Contact_EmailTxt");
	tmpCheckCont.value=tmpChecker.Filter(tmpCheckCont.value,0);
	if(!tmpChecker.CheckLen(tmpCheckCont.value,3,120)){
		Coun0++;
		tmpError+=Coun0+".邮箱地址格式错误，正确格式如：13900000000"+tmpCommon.sysSPLIT8;
	}
	//-- ------ #Result ------ --
	if(tmpError!=""){
		tmpSTR="<span class=\"FStrong\">对不起，您提交的内容存在以下错误:</span>"+tmpCommon.sysSPLIT8+tmpError;
		tmpFrames.showMessage("系统消息 - "+tmpCommon.sysName,tmpSTR,"","0");
		return 1;
	}

	//-- #SAVE --
	var tmpURL=tmpCommon.sysHome+this.sUserreceiveaddessURL+"?ActionType=DSaveReceiveaddress"+
		"&ID="+tmpCommon.encodeURL(document.getElementById("OrderUserinfo_Contact_IDTxt").value)+
		"&ConManTxt="+tmpCommon.encodeURL(document.getElementById("OrderUserinfo_Contact_ConManTxt").value)+
		"&MobileTxt="+tmpCommon.encodeURL(document.getElementById("OrderUserinfo_Contact_MobileTxt").value)+
		"&EmailTxt="+tmpCommon.encodeURL(document.getElementById("OrderUserinfo_Contact_EmailTxt").value)+
		/*
		"&Zone_CountryTxt="+tmpCommon.encodeURL(document.getElementById("OrderUserinfo_Contact_Zone_CountryTxt").value)+
		"&Zone_ProvinceTxt="+tmpCommon.encodeURL(document.getElementById("OrderUserinfo_Contact_Zone_ProvinceTxt").value)+
		"&Zone_CityTxt="+tmpCommon.encodeURL(document.getElementById("OrderUserinfo_Contact_Zone_CityTxt").value)+
		*/
		"&Zone_CountryTxt="+tmpCommon.encodeURL(0)+
		"&Zone_ProvinceTxt="+tmpCommon.encodeURL(0)+
		"&Zone_CityTxt="+tmpCommon.encodeURL(document.getElementById("shuractZoneChooseTxt").value)+
		"&AddressTxt="+tmpCommon.encodeURL(document.getElementById("OrderUserinfo_Contact_AddressTxt").value)+
		"&TeleTxt="+tmpCommon.encodeURL(document.getElementById("OrderUserinfo_Contact_TeleTxt").value)+
		"&NumCodeTxt="+tmpCommon.encodeURL(document.getElementById("OrderUserinfo_Contact_NumCodeTxt").value);

	this.sAjax_0.sPanel="OrderUserinfo_List";
	this.sAjax_0.sFlag="OrderUserinfo_Contact";
	this.sAjax_0.sendRequestSp(tmpURL,"order_Contact_Save_callback()");
	//window.open(tmpURL,"_blank");
	
	return 0;
}
function order_Contact_Save_callback(){
	var tmpFlag=tmpOrder.sAjax_0.sFlag;
	var tmpPanel=document.getElementById(tmpOrder.sAjax_0.sPanel);
	var tmpURL=tmpOrder.sAjax_0.sURL;
	var tmpHttpRequests=tmpOrder.sAjax_0.sHttpRequests;
	//alert(tmpHttpRequests.responseText);
	if(tmpHttpRequests.readyState==4){
		//alert(tmpHttpRequests.responseText);
		var tmpData=getDataByFlag(tmpHttpRequests.responseText,tmpFlag);
		//alert(tmpData);
		if(tmpData.indexOf("sendRequest")>=0 && tmpData!="<!--sendRequest-->"){
			tmpPanel.innerHTML=tmpData;
			/*
			document.getElementById("Receiveaddress_Txt0").selected=true;
			document.getElementById("OrderUserinfo_Contact_ConManTxt").value="";
			document.getElementById("OrderUserinfo_Contact_MobileTxt").value="";
			document.getElementById("OrderUserinfo_Contact_EmailTxt").value="";
			document.getElementById("OrderUserinfo_Contact_Zone_CountryTxt").selectIndex=0;
			document.getElementById("OrderUserinfo_Contact_Zone_ProvinceTxt").selectIndex=0;
			document.getElementById("OrderUserinfo_Contact_Zone_CityTxt").selectIndex=0;
			document.getElementById("ZoneChooseTxt").selectIndex=0;
			document.getElementById("OrderUserinfo_Contact_AddressTxt").value="";
			document.getElementById("OrderUserinfo_Contact_TeleTxt").value="";
			document.getElementById("OrderUserinfo_Contact_NumCodeTxt").value="";
			*/
	    	tmpFrames.showLoading(1);
	    }else{
	    	tmpPanel.innerHTML=tmpCommon.sysError_Ajax.replace(/\{Nets.Response}/g,tmpURL);
	    	tmpFrames.showLoading(1);
	    }
	}else{
		tmpFrames.showLoading(0);
	}
}



//-- #Userpay --
Order.prototype.OnUserpay_ShowBox=function(pName){

	if(document.getElementById(pName+"_Box").className==tmpCommon.sysHidden){
		document.getElementById(pName+"_Button").innerHTML="[关闭]";
		document.getElementById(pName+"_Label").className=tmpCommon.sysHidden;
		document.getElementById(pName+"_Box").className="ConfirmOrder_1_41";
	}else{
		document.getElementById(pName+"_Button").innerHTML="[修改]";
		document.getElementById(pName+"_Label").className="ConfirmOrder_1_48";
		document.getElementById(pName+"_Box").className=tmpCommon.sysHidden;
	}
	
	return 0;
}
Order.prototype.OnUserpay_UserpayPaytype=function(){

	var Coun0=0;
	if(document.getElementById(tmpCommon.sysForm).UserpayPaytype_Txt.value!=undefined){
		if(document.getElementById(tmpCommon.sysForm).UserpayPaytype_Txt.checked){
			document.getElementById("UserpayPaytype_Label").innerHTML=document.getElementById("UserpayPaytype_TxtLabel"+Coun0).innerHTML;
		}
	}
	Coun0=0;
	while(document.getElementById(tmpCommon.sysForm).UserpayPaytype_Txt.length>Coun0){
		if(document.getElementById(tmpCommon.sysForm).UserpayPaytype_Txt[Coun0].checked){
			document.getElementById("UserpayPaytype_Label").innerHTML=document.getElementById("UserpayPaytype_TxtLabel"+Coun0).innerHTML;
		}
		Coun0++;
	}
	
	return 0;
}
Order.prototype.OnUserpay_SetMoney=function(pValue){
	document.getElementById("shuptTotalPriceTxt").value=pValue;
	
	return 0;
}









