var submit = 0;

//直选单票用--------------彩种ID,票内容,金额类型1积分2人民币,注数,期号,玩法值,单复试[1单式 2 复式],金额
function zucai_create_xml_date(lotteryIdValue,ticketContent,moneyTypeValue,recordsValue,issue,palyTypeIdValue,saleTypeValue,buyMoneyValue){
	//创建xml 
	var orderType = 1;//订单类型为直选 
	//alert(lotteryIdValue+"-----"+ticketContent+"-----"+moneyTypeValue+"-----"+recordsValue+"-----"+issue+"-----"+palyTypeIdValue+"-----"+saleTypeValue+"-----"+buyMoneyValue);
	//编码与页面编码不一致会报错	
	var doc = XmlDom();
	//创建文件头
	var p = doc.createProcessingInstruction("xml","version='1.0'  encoding='utf-8'");
	//添加文件头
	doc.appendChild(p);
	//创建根接点
	var jfkLotteryOrder =  doc.createElement("jfkLotteryOrder");
	//订单金额（所有类型）
	//创建子接点
	var jfkLottery = doc.createElement("jfkLottery"); 
   	//期号 倍数 金额  按issue的值来算 其他直接从ticketInfo里取
	var issueName = doc.createElement("issueName");
	var playTypeId = doc.createElement("playTypeId");
	var saleType = doc.createElement("saleType");
	var buyMoney = doc.createElement("buyMoney");
	var playType = doc.createElement("playType");
	var scales = doc.createElement("scales");
	var content = doc.createElement("content");
	//添加文本接点
	issueName.appendChild(doc.createTextNode(issue));
 	playTypeId.appendChild(doc.createTextNode(0));//暂时不用
	buyMoney.appendChild(doc.createTextNode(buyMoneyValue));
	saleType.appendChild(doc.createTextNode(saleTypeValue));
	playType.appendChild(doc.createTextNode(palyTypeIdValue));//ok
	scales.appendChild(doc.createTextNode(buyMoneyValue/(recordsValue*2)));//倍数为金额/单注订单金额
 	content.appendChild(doc.createTextNode(strTrim(ticketContent)));//ok
 	jfkLottery.appendChild(issueName);
 	jfkLottery.appendChild(playTypeId);
 	jfkLottery.appendChild(saleType);
 	jfkLottery.appendChild(buyMoney);
 	jfkLottery.appendChild(playType);
 	jfkLottery.appendChild(scales);
 	jfkLottery.appendChild(content);
	 //添加子接点
	jfkLotteryOrder.appendChild(jfkLottery);
	//order 的属性 通用的 ------------------------------------------------------------
	var lotteryId = doc.createElement("lotteryId");
	var startIssue = doc.createElement("startIssue");
	var buyMoney = doc.createElement("buyMoney");
	var orderType = doc.createElement("orderType");
	var moneyType = doc.createElement("moneyType");
	var records = doc.createElement("records");
	var totalIssues = doc.createElement("totalIssues");
	lotteryId.appendChild(doc.createTextNode(lotteryIdValue));
	startIssue.appendChild(doc.createTextNode(issue));
	buyMoney.appendChild(doc.createTextNode(buyMoneyValue));
	orderType.appendChild(doc.createTextNode(1));
	moneyType.appendChild(doc.createTextNode(moneyTypeValue));
	records.appendChild(doc.createTextNode(recordsValue));//注数
	totalIssues.appendChild(doc.createTextNode(1));//不能追号，只能投注一期
	jfkLotteryOrder.appendChild(lotteryId);
	jfkLotteryOrder.appendChild(startIssue);
	jfkLotteryOrder.appendChild(buyMoney);
	jfkLotteryOrder.appendChild(orderType);
	jfkLotteryOrder.appendChild(moneyType);
	jfkLotteryOrder.appendChild(records);
	jfkLotteryOrder.appendChild(totalIssues);
	var buyNum = doc.createElement("buyNum");//认购份数
	var unitNum = doc.createElement("unitNum");//该方案分成几份
	var unitMoney = doc.createElement("unitMoney");//每份金额
	// 代购时 份数:1 每份金额:总金额 已购数量:总注数 合买是从页面取
	buyNum.appendChild(doc.createTextNode("1"));
	unitNum.appendChild(doc.createTextNode("1"));
	unitMoney.appendChild(doc.createTextNode(buyMoneyValue));
	jfkLotteryOrder.appendChild(buyNum);
	jfkLotteryOrder.appendChild(unitNum);
	jfkLotteryOrder.appendChild(unitMoney);
	doc.appendChild(jfkLotteryOrder);
	if(doc.xml==null){
		alert("非法数据");
		return;
	}
	return doc.xml;
}
function ShopConfirm(buyMoney,zhushu,scales){
	//显示覆盖层
	openWebBgLayer();
	document.getElementById("ShopConfirmLayer").style.display = "block";
	showPopUp("ShopConfirmLayer",570,535);
	document.getElementById("totalFee").value = buyMoney;
	document.getElementById("totalM").innerHTML = "本次投注金额：<font class='red'>" + buyMoney + "&nbsp;</font>元&nbsp;&nbsp;<font class='red'>" + zhushu + "</font>&nbsp;&nbsp;注&nbsp;&nbsp;<font class='red'>" + scales + "&nbsp;</font>倍" ;
	document.getElementById("total_money").innerHTML = document.getElementById("totalFee").value;
	createTable();
}

function createTable(){//球号@注
	if(document.getElementById('ballNav1').className == "ballmenuOn"){//自选号
		var content = document.getElementById("ballContent").value;
		var zhushu = document.getElementById("ballZhuShu").value;
		var beishu = document.getElementById("ballBeiShu").value;
		var tablehtml = "";
		tablehtml+="<table width='95%' border='0' cellspacing='0' cellpadding='0'>"+"<tr><th width='10%'>序号</th><th width='70%'>投注内容</th><th width='10%'>倍数</th><th width='10%'>注数</th></tr>";
		tablehtml+="<tr>"
		tablehtml+="<td class='red'>";
		tablehtml+=(1);//一列显示
		tablehtml+="</td><td><span class='red'>";
		tablehtml+=content;
		tablehtml+="</span></td><td class='red'>";
		tablehtml+=beishu;//倍数
		tablehtml+="</td><td class='red'>";
		tablehtml+=zhushu;//注数
		tablehtml+="</td>";
		tablehtml+="</tr>";
		tablehtml+="</table>";
		document.getElementById("tables").innerHTML=tablehtml;
	}else if(document.getElementById('ballNav2').className == "ballmenuOn"){//上传号
		var len = document.getElementById('lotteryContents').length;
		var tablehtml = "";
		tablehtml+="<table width='95%' border='0' cellspacing='0' cellpadding='0'>"+"<tr><th width='10%'>序号</th><th width='70%'>投注内容</th><th width='10%'>倍数</th><th width='10%'>注数</th></tr>";
		for(var k = 0; k < len; k++){
			var selectedNum = document.getElementById('lotteryContents').options[k].value.split(":");
			//alert(selectedNum);
			tablehtml+="<tr>"
			tablehtml+="<td class='red'>";
			tablehtml+=(k+1);//一列显示
			tablehtml+="</td><td><span class='red'>";
			tablehtml+=selectedNum[0];
			tablehtml+="</span></td><td class='red'>";
			tablehtml+=document.getElementById('uploadsales').value;//倍数
			tablehtml+="</td><td class='red'>";
			tablehtml+=document.getElementById('uploadsales').value*selectedNum[1]/2;//注数
			tablehtml+="</td>";
			tablehtml+="</tr>";
		}
		tablehtml+="</table>";
		//alert(tablehtml);
		document.getElementById("tables").innerHTML=tablehtml;
	}
}
//关闭浮层
function CloseShopConfirm(){
	/**document.getElementById("jfPoint").innerHTML = "读取中...."; 
	for (var i = 0; i < document.getElementsByName("jfType").length; i++) {
		if (document.getElementsByName("jfType")[i].checked) {
			document.getElementsByName("jfType")[i].checked = false;
			break;
		}
	}**/
	retJF();//打开中信
	retBank();//打开银行
	var ShopConfirmLayer=document.getElementById("ShopConfirmLayer");
	var webBgLayer=document.getElementById("webBgLayer");
	var indexConfirm=document.getElementById("indexConfirm");
	var indexSuccess=document.getElementById("indexSuccess");
	var indexError=document.getElementById("indexError");
	indexConfirm.style.display="none";//关闭确认层
	ShopConfirmLayer.style.display="none";//关闭显示层
	webBgLayer.style.display="none";//关闭覆盖层
	indexSuccess.style.display="none";//关闭成功层
	indexError.style.display="none";//关闭失败层
	document.getElementById('lotteryContents').style.display="block";
}
/**彩票正式提交**/
function loginConfirm(){
	submit++;
    if(submit>1){
    	alert("不能重复提交！");
    	return false;
    }
	document.getElementById("indexPay").style.display = "block";
	document.getElementById("indexPaySuccess").style.display = "none";
	if(document.getElementById("agree").checked==false){
		alert("请选择我已经看过并同意《积分卡电话投注网站服务协议》");
		return false;
	}else{/**
		document.getElementById("indexConfirm").style.display="block";
		document.getElementById("ShopConfirmLayer").style.display="none";
		showPopUp("indexConfirm",570,465);
		document.getElementById("webBgLayer").style.display="block";
		//var content = document.getElementById("indexBallContent").value;ballContent
		var content = document.getElementById("ballContent").value;
		//alert(content);
		document.getElementById("indexIssue").innerHTML=document.getElementById("issueNameId").value;
		//var con = content.split("@")[0];
		//document.getElementById("indexContent").innerHTML = con;
		document.getElementById("indexContent").innerHTML = content;
		ba = setInterval("begin()",1000);//setInterval 返回的是一个全局变量，一个间隔数值.这个数值是表示调用setInterval的次数**/
		touZhuResult();
	}
}

/**var nussss = 30;
function begin(){
	if(nussss > 0){
	    document.getElementById("in").style.width=(31-nussss)/30*100+"%";
	    document.getElementById("number").innerHTML=nussss-1+"秒";
	    nussss-=1;
	}else{
		touZhuResult();
	}
}**/
var indexQuickXmlHttp;//首页当期期号与截止时间提交对象

function createIndexQuickXMLHttpRequest() {
	if (window.ActiveXObject) {
			indexQuickXmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
	}else if (window.XMLHttpRequest) {
			indexQuickXmlHttp = new XMLHttpRequest();
	}
}

function indexQuickResult(){
	var indexAjaxUrl = "/include/indexQuickAjax.htm";
	createIndexQuickXMLHttpRequest();
	indexQuickXmlHttp.onreadystatechange = resultIndexQuick;
	indexQuickXmlHttp.open("POST",indexAjaxUrl,true);
	indexQuickXmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");  
    indexQuickXmlHttp.send("");
}

function resultIndexQuick(){
	if(indexQuickXmlHttp.readyState==4){
		if(indexQuickXmlHttp.status==200){
			var resultdata = indexQuickXmlHttp.responseText; 
			//更改各自的当期彩种和截止时间
			//alert("当前期resultdata"+resultdata);
			//上新彩种时更改成6
			var resList = resultdata.split(";");
			
			for(i=0;i<resList.length;i++)
			{
				var res = resList[i].split(",");;
				if(res[0] == '01'){
					document.getElementById("issueName0").innerHTML = res[1];
					document.getElementById("issueDate0").innerHTML = res[2];
				}
				if(res[0] == '02'){
					document.getElementById("issueName1").innerHTML = res[1];
					document.getElementById("issueDate1").innerHTML = res[2];
				}
				if(res[0] == '05'){
					document.getElementById("issueName2").innerHTML = res[1];
					document.getElementById("issueDate2").innerHTML = res[2];
				}
				if(res[0] == 'D11'){
					document.getElementById("issueName5").innerHTML = res[1];
					document.getElementById("issueDate5").innerHTML = res[2];
				}
				//if(res[0] == 'jxssc'){
				//	document.getElementById("issueName4").innerHTML = res[1];
				//	document.getElementById("issueDate4").innerHTML = res[2];
				//}
				if(res[0] == '10401'){
					document.getElementById("issueName3").innerHTML = res[1];
					document.getElementById("issueDate3").innerHTML = res[2];
				}
			}
			//	var issueName4 = resultdata.split(",")[0];
			//	var issueDate4 = resultdata.split(",")[5];
			// document.getElementById("issueName4").innerHTML=issueName4;
			//  document.getElementById("issueDate4").innerHTML=issueDate4;
			}
		}
	}
/*
*/
var indexLotteryXmlHttp;//异步提交

function createIndexLotteryXMLHttpRequest() {
	if (window.ActiveXObject) {
			indexLotteryXmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
	}else if (window.XMLHttpRequest) {
			indexLotteryXmlHttp = new XMLHttpRequest();
	}
}

function touZhuResult(){
	var payOrderType = document.getElementById("payOrderType").value;
	var indexAjaxUrl = document.getElementById("indexAjaxUrl").value + "?payOrderType=" + payOrderType;
	document.getElementById("lktj").style.display = "none";
	document.getElementById("zztj").style.display = "block";
	createIndexLotteryXMLHttpRequest();
	indexLotteryXmlHttp.onreadystatechange = resultAllIndexLottery;
	//alert(document.getElementById("xmlText").value);
	var xmlText = "xmlText="+document.getElementById("xmlText").value;
	//alert(xml);
	indexLotteryXmlHttp.open("POST",indexAjaxUrl,true);
	indexLotteryXmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");  
    indexLotteryXmlHttp.send(xmlText); 
}
function resultAllIndexLottery(){
	if(indexLotteryXmlHttp.readyState==4){
		if(indexLotteryXmlHttp.status==200){
			var resultdata = indexLotteryXmlHttp.responseText;
			var isWin = resultdata.split(",")[0];
			var msg = resultdata.split(",")[1];
			document.getElementById("ShopConfirmLayer").style.display = "none";
			//CloseShopConfirm();
			//alert(resultdata);
			if(isWin=='00'){//下单成功
			    document.getElementById("yuer").innerHTML = resultdata.split(",")[2];
			    document.getElementById("caijin").innerHTML = resultdata.split(",")[3];
			    if(document.getElementById("yuer") != null){
			    	window.frames['iframeLogin'].document.getElementById("showRMBBlance").innerHTML = document.getElementById("yuer").innerHTML;
			    }
			    if(document.getElementById("leaveMoney") != null){
			    	document.getElementById("leaveMoney").innerHTML = resultdata.split(",")[2]+"元";
			    }
			    document.getElementById("totalM").innerHTML = resultdata.split(",")[2]+"元";
				document.getElementById("indexConfirm").style.display="none";
				document.getElementById("indexSuccess").style.display="block";
				showPopUp("indexSuccess",570,239);
				document.getElementById("lktj").style.display = "block";
				document.getElementById("zztj").style.display = "none";
				document.getElementById('lotteryContents').style.display="block";
			}else{
				document.getElementById("errorMsg").innerHTML=msg;
				document.getElementById("indexConfirm").style.display="none";
				document.getElementById("indexError").style.display="block";
				showPopUp("indexError",570,239);
				document.getElementById("lktj").style.display = "block";
				document.getElementById("zztj").style.display = "none";
				document.getElementById('lotteryContents').style.display="block";
			}
		}
		submit = 0;
	}
}

//异步
var xmlHttp;
	
function createXMLHttpRequest() {
	if (window.ActiveXObject) {
			xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
	}else if (window.XMLHttpRequest) {
			xmlHttp = new XMLHttpRequest();
	}
}
function sendXML(xml,url){
		createXMLHttpRequest();
		xmlHttp.onreadystatechange = handleStateChange;
		xmlHttp.open("POST",url, false);
		xmlHttp.send(xml);
}
function handleStateChange() {	
	if(xmlHttp.readyState == 4) {
		if(xmlHttp.status == 200){
		}else if (xmlHttp.status == 404){
 			alert("你访问的页面不存在");
		}
	}
}

function XmlDom() {
	//通过对象/属性检测法，判断是 IE 来是 Mozilla
    if (window.ActiveXObject) {
        var arrSignatures = ["MSXML2.DOMDocument.5.0", "MSXML2.DOMDocument.4.0",
                             "MSXML2.DOMDocument.3.0", "MSXML2.DOMDocument",
                             "Microsoft.XmlDom"];
        for ( i=0; i < arrSignatures.length; i++) {
            try {
                var oXmlDom = new ActiveXObject(arrSignatures[i]);
                return oXmlDom;
            } catch (oError) {
            }
        }
        throw new Error("MSXML is not installed on your system.");
    //同上         
    } else if (document.implementation && document.implementation.createDocument) {
       //变相应用firefox没有的方法
        var oXmlDom = document.implementation.createDocument("","",null);
        //判断是否是firefox
		var sUserAgent=navigator.userAgent;
		var isKHTML=sUserAgent.indexOf("KHTML")>-1||sUserAgent.indexOf("Konqueror")>-1||sUserAgent.indexOf("AppleWebKit")>-1;
		var isMoz=sUserAgent.indexOf("Gecko")>-1&&!isKHTML;
        	if (isMoz){
					    Document.prototype.readyState = 0;
					    Document.prototype.onreadystatechange = null;
					    Document.prototype.__changeReadyState__ = function (iReadyState) {
					        this.readyState = iReadyState;
					        if (typeof this.onreadystatechange == "function") {
					            this.onreadystatechange();
					        }
					    };
					    Node.prototype.__defineGetter__("xml", function () {
					        var oSerializer = new XMLSerializer();
					        return oSerializer.serializeToString(this, "text/xml");
					    });
			}
        return oXmlDom;
    } else {
        throw new Error("Your browser doesn't support an XML DOM object.");
    }
}

/**从数字m到n,机选出s个数**/
function genRandomNum(digitalLower,digitalUpper,digitalNum){
	var randomNum = "";
	var i = 0; // 用来控制循环
	var temp = 0;
	//设置循环条件
	while (i < digitalNum) {
	    var str = "";
	    temp = Math.round(Math.random()*(digitalUpper-digitalLower))+digitalLower;
	    if (temp < 10) {
	            str += "0";
	       }
	    //将产生的随机数转化为字符串类型
	    str += temp;
	    //设置一组数字中不能有重复的号码,并且不能出现"00"类型的无效字符
	    if (randomNum.indexOf(str) < 0) {
	        //将产生的每一组数字之间用空格符号隔开
	        str = str + ",";
	        randomNum += str;
	        i++;
	    }
	}
	//截取两端的空格，排序后返回空格分隔开的号码
	return strTrim(randomNum).split(",").sort().toString().replace(",","");
}

function strTrim(str) {
	str+="";
	var i=0;
	while(str.charCodeAt(i)==32){
		i++;
	}
	str=str.substr(i);
	i=str.length;
	while(str.charCodeAt(i-1)==32){
		i--;
	}
	str=str.substring(0,i);
	return str;
}

//上传号码通用接口--------------投注内容,彩种,金额类型1积分2人民币,注数,订单类型,期次信息
//ticketContent格式：3,5#6,8#5,9#3,2#1,0
//saleTypeValue格式：5#8#9#2#0
//perMoney格式：		5#8#9#2#0

function create_xml_date_upload(lotteryContentsValue,lotteryIdValue,moneyTypeValue,recordsValue,orderTypeValue,issues,scales){
	//创建xml
	//编码与页面编码不一致会报错	
	var doc = XmlDom();
	//创建文件头
	var p = doc.createProcessingInstruction("xml","version='1.0'  encoding='utf-8'");
	//添加文件头
	doc.appendChild(p);
	//创建根接点
   	var jfkLotteryOrder =  doc.createElement("jfkLotteryOrder");
   	//订单总金额（所有类型）
   	var buyMoneyValue=0;
   	//lottery 的属性
   	for(j=0; j<issues.length; j++){//追号多期
		for( i=0; i <lotteryContentsValue.length; i++){
			//issueDate[0] 是期号 issueDate[1]是倍数
   			var issueDate =issues[j].split(",");
   			//格式 号码:单注金额:玩法:投注方式 //lotteryNum:money:playTypeId:saleType
   			//球号:单注金额:玩法ID:投注方式:倍数 投注列表中的每项的value的格式
   			var ticket= lotteryContentsValue[i].split(":");
   			alert(ticket[4]);
   			var ticketContent=ticket[0];//投注的球号
   			var ticketMoneyValue = ticket[1]*issueDate[1]*ticket[4];//一式金额
   			var palyTypeIdValue = ticket[2];//玩法ID
   			var saleTypeValue = ticket[3];//投注方式
   			var scalesValue = ticket[4];//单注倍数
   			buyMoneyValue=buyMoneyValue+ticketMoneyValue;
		   		//创建子接点
	   		var jfkLottery = doc.createElement("jfkLottery");
	   		//期号 倍数 金额  按issue的值来算 其他直接从ticketInfo里取
	   		var issueName = doc.createElement("issueName");
	   		var playTypeId = doc.createElement("playTypeId");
	   		var saleType = doc.createElement("saleType");
	   		var buyMoney = doc.createElement("buyMoney");
	   		var playType = doc.createElement("playType");
	   		var scales = doc.createElement("scales");
	   		var content = doc.createElement("content");
	   		//添加文本接点
			issueName.appendChild(doc.createTextNode(issueDate[0]));
		 	playTypeId.appendChild(doc.createTextNode(palyTypeIdValue));//判断是rxj 还是ssc
	   		buyMoney.appendChild(doc.createTextNode(ticketMoneyValue));
	   		saleType.appendChild(doc.createTextNode(saleTypeValue));
	   		playType.appendChild(doc.createTextNode(palyTypeIdValue));
	   		scales.appendChild(doc.createTextNode(issueDate[1]*scalesValue));
		 	content.appendChild(doc.createTextNode(strTrim(ticketContent)));
		 	jfkLottery.appendChild(issueName);
		 	jfkLottery.appendChild(playTypeId);
		 	jfkLottery.appendChild(saleType);
		 	jfkLottery.appendChild(buyMoney);
		 	jfkLottery.appendChild(playType);
		 	jfkLottery.appendChild(scales);
		 	jfkLottery.appendChild(content);
			 //添加子接点
			jfkLotteryOrder.appendChild(jfkLottery);
		}
	}
	//order 的属性 通用的 ------------------------------------------------------------
	var lotteryId = doc.createElement("lotteryId");
	var startIssue = doc.createElement("startIssue");
	var buyMoney = doc.createElement("buyMoney");
	var orderType = doc.createElement("orderType");
	var moneyType = doc.createElement("moneyType");
	var records = doc.createElement("records");
	var totalIssues = doc.createElement("totalIssues");
	lotteryId.appendChild(doc.createTextNode(lotteryIdValue));
	startIssue.appendChild(doc.createTextNode(issues[0].substring(0,issues[0].indexOf(","))));
	buyMoney.appendChild(doc.createTextNode(buyMoneyValue));
	orderType.appendChild(doc.createTextNode(orderTypeValue));
	moneyType.appendChild(doc.createTextNode(moneyTypeValue));
	records.appendChild(doc.createTextNode(recordsValue));
	totalIssues.appendChild(doc.createTextNode(issues.length));
	jfkLotteryOrder.appendChild(lotteryId);
	jfkLotteryOrder.appendChild(startIssue);
	jfkLotteryOrder.appendChild(buyMoney);
	jfkLotteryOrder.appendChild(orderType);
	jfkLotteryOrder.appendChild(moneyType);
	jfkLotteryOrder.appendChild(records);
	jfkLotteryOrder.appendChild(totalIssues);
	var buyNum = doc.createElement("buyNum");//认购份数
	var unitNum = doc.createElement("unitNum");//该方案分成几份
	var unitMoney = doc.createElement("unitMoney");//每份金额
	if(orderTypeValue==3){
			//发起和买的时候才用到 ----------------------------------------------------------------
		var title = doc.createElement("title");
		var isOpen = doc.createElement("isOpen");
		var depositeMoney = doc.createElement("depositeMoney");
		var deductRate = doc.createElement("deductRate");
		var description = doc.createElement("description");
		title.appendChild(doc.createTextNode(document.getElementById("orderTitle").value));
		isOpen.appendChild(doc.createTextNode(document.getElementById("isOpen").value));
		depositeMoney.appendChild(doc.createTextNode(document.getElementById("depositeMoney").value));
		deductRate.appendChild(doc.createTextNode(document.getElementById("deductRate").value));
		description.appendChild(doc.createTextNode(document.getElementById("descriptionId").value));
		buyNum.appendChild(doc.createTextNode(document.getElementById("buyNum").value));
		unitNum.appendChild(doc.createTextNode(document.getElementById("unitNum").value));
		unitMoney.appendChild(doc.createTextNode(document.getElementById("unitMoney").value));
		jfkLotteryOrder.appendChild(title);
		jfkLotteryOrder.appendChild(isOpen);
		jfkLotteryOrder.appendChild(depositeMoney);
		jfkLotteryOrder.appendChild(deductRate);
		jfkLotteryOrder.appendChild(description);
		//---------------------------------------------------------------------------
	}else{
		// 代购和追号时 份数:1 每份金额:总金额 已购数量:总注数 合买是从页面取
		buyNum.appendChild(doc.createTextNode("1"));
		unitNum.appendChild(doc.createTextNode("1"));
		unitMoney.appendChild(doc.createTextNode(buyMoneyValue));
		if(orderTypeValue==2){
		//追号 -------------------------------------------------------------------------
			var isWinStop = doc.createElement("isWinStop");
			if(document.getElementById('is_win_stop').checked){
				isWinStop.appendChild(doc.createTextNode("1"));
			}else{
				isWinStop.appendChild(doc.createTextNode("0"));
			}
			jfkLotteryOrder.appendChild(isWinStop);
		}
	}
	jfkLotteryOrder.appendChild(buyNum);
	jfkLotteryOrder.appendChild(unitNum);
	jfkLotteryOrder.appendChild(unitMoney);
	
	doc.appendChild(jfkLotteryOrder);
	if(doc.xml==null){
		alert("非法数据");
		return;
	}
	return doc.xml;
}
