var userAgent=navigator.userAgent.toLowerCase();var is_opera=userAgent.indexOf('opera')!=-1&&opera.version();var is_ie=(userAgent.indexOf('msie')!=-1&&!is_opera)&&userAgent.substr(userAgent.indexOf('msie')+5,3);var s,aj;function getGamelist(){var x=new Ajax('HTML','errMsg');x.get('../ajax.php?action=getGamelist',BoandGamelist);};function ajaxresponse1(objname,data){var x=new Ajax('HTML',objname);x.get('../ajax.php?'+data,function(s){var obj=$(objname);if(s==''){obj.style.display='';obj.innerHTML='error!';}else{BoandGamelist(obj,s);}});};function BoandGamelist(msg,aj){ var str=msg;while(document.theform.GameNameListID.options.length>0){document.theform.GameNameListID.remove(0)};document.theform.GameNameListID.selectedIndex=-1;var arrayStr=str.split("|");var i;var opt=document.createElement("OPTION");opt.text="---Please select the game---";opt.value="0";document.theform.GameNameListID.options.add(opt);opt.selected=true;if(arrayStr.length-1>0){for(i=0;i<arrayStr.length-1;i++){var arrayName=new Array(1);arrayName=arrayStr[i].split("@");var opt=document.createElement("OPTION");opt.text=arrayName[1];opt.value=arrayName[0];document.theform.GameNameListID.options.add(opt);}}};function getServerList(){var gameid=document.getElementById("GameNameListID").value;var x=new Ajax('HTML','errMsg');x.get('../ajax.php?action=getServerList&group='+gameid,BoandServerList);};function ajaxresponse2(objname,data){var x=new Ajax('HTML',objname);x.get('../ajax.php?'+data,function(s){var obj=$(objname);if(s==''){obj.style.display='';obj.innerHTML='error!';}else{BoandServerList(obj,s);}});};function BoandServerList(msg,aj){while(document.theform.ServerNameListID.options.length>0){document.theform.ServerNameListID.remove(0)};document.theform.ServerNameListID.selectedIndex=-1;var opt=document.createElement("OPTION");opt.text="---Loading...---";opt.value="0";document.theform.ServerNameListID.options.add(opt);opt.selected=true;var str=msg;while(document.theform.ServerNameListID.options.length>0){document.theform.ServerNameListID.remove(0)};document.theform.ServerNameListID.selectedIndex=-1;var arrayStr=str.split("|");var i;var opt=document.createElement("OPTION");opt.text="---Please select the server---";opt.value="0";document.theform.ServerNameListID.options.add(opt);opt.selected=true;if(arrayStr.length-1>0){for(i=0;i<arrayStr.length-1;i++){var arrayName=new Array(1);arrayName=arrayStr[i].split("@");var opt=document.createElement("OPTION");opt.text=arrayName[1];opt.value=arrayName[0];document.theform.ServerNameListID.options.add(opt);}}};function getProductList(){var serverid=document.getElementById("ServerNameListID").value;var gameid=document.getElementById("GameNameListID").value;var x=new Ajax('HTML','errMsg');x.get('../ajax.php?action=getProductList&group='+gameid+"&cat="+serverid,BoandProductList);};function ajaxresponse3(objname,data){var x=new Ajax('HTML',objname);x.get('../ajax.php?'+data,function(s){var obj=$(objname);if(s==''){obj.style.display='';obj.innerHTML='error!';}else{BoandProductList(obj,s);}});};function BoandProductList(msg,aj){while(document.theform.ProductNameListID.options.length>0){document.theform.ProductNameListID.remove(0)};document.theform.ProductNameListID.selectedIndex=-1;var opt=document.createElement("OPTION");opt.text="---Loading...---";opt.value="0";document.theform.ProductNameListID.options.add(opt);opt.selected=true;var str=msg;while(document.theform.ProductNameListID.options.length>0){document.theform.ProductNameListID.remove(0)};document.theform.ProductNameListID.selectedIndex=-1;var arrayStr=str.split("|");var i;var opt=document.createElement("OPTION");opt.text="---Please select the product---";opt.value="0";document.theform.ProductNameListID.options.add(opt);opt.selected=true;if(arrayStr.length-1>0){for(i=0;i<arrayStr.length-1;i++){var arrayName=new Array(1);arrayName=arrayStr[i].split("@");var opt=document.createElement("OPTION");opt.text=arrayName[1];opt.value=arrayName[0];document.theform.ProductNameListID.options.add(opt);}}};function Check(){if(document.theform.GameNameListID.options[document.theform.GameNameListID.selectedIndex].value==0){alert("Please select the game!");return false;}else if(document.theform.ServerNameListID.options[document.theform.ServerNameListID.selectedIndex].value==0){alert("Please select the server!");return false;}else if(document.theform.ProductNameListID.options[document.theform.ProductNameListID.selectedIndex].value==0){alert("Please select the product");return false;}else if(document.theform.ShippingNameListID.options[document.theform.ShippingNameListID.selectedIndex].value==0){alert("Please select the Payment Method!");return false;}else if(document.theform.character.value==''){alert("Please enter the character");return false;}else{return true;}};function getShipping(){var x=new Ajax('HTML','errMsg');x.get('../ajax.php?action=getShipping',BoandShipping);};function ajaxresponse4(objname,data){var x=new Ajax('HTML',objname);x.get('../ajax.php?'+data,function(s){var obj=$(objname);if(s==''){obj.style.display='';obj.innerHTML='error!';}else{BoandShipping(obj,s);}});};function BoandShipping(msg,aj){ var str=msg;while(document.theform.ShippingNameListID.options.length>0){document.theform.ShippingNameListID.remove(0)};document.theform.ShippingNameListID.selectedIndex=-1;var arrayStr=str.split("|");var i;var opt=document.createElement("OPTION");if(arrayStr.length-1>0){for(i=0;i<arrayStr.length-1;i++){var arrayName=new Array(1);arrayName=arrayStr[i].split("@");var opt=document.createElement("OPTION");opt.text=arrayName[1];opt.value=arrayName[0];document.theform.ShippingNameListID.options.add(opt);}}};function getElseInfo(){var obj=document.getElementById("getElseInfo");GameIndex=document.theform.GameNameListID.options[document.theform.GameNameListID.selectedIndex].value;ServerIndex=document.theform.ServerNameListID.options[document.theform.ServerNameListID.selectedIndex].value;ProductIndex=document.theform.ProductNameListID.options[document.theform.ProductNameListID.selectedIndex].value;if(GameIndex>0&&ServerIndex>0&&ProductIndex>0){obj.style.display='';}else{obj.style.display='none';}}
