var xmlhttp; var gamestr; var gameid; gamestr=new Array(); gameid=new Array(); gamestr[0]='Please Select The Game'; gameid[0]=0; gamestr[1]='World of Warcraft US'; gameid[1]=1; gamestr[2]='World of Warcraft EU'; gameid[2]=2; // build game list select var count_str; count_str=''; function build_gl() { document.fastorder.game_id.options.length=0; for(var i=0;i < gamestr.length;i++) { document.fastorder.game_id.options[document.fastorder.game_id.options.length]=new Option(gamestr[i],gameid[i]); } document.fastorder.game_id.disabled=false; } build_gl(); function gl_chg(){ var url; document.fastorder.price.value=''; document.fastorder.server_id.options.length=0; document.fastorder.count.options.length=0; document.fastorder.server_id.options[document.fastorder.server_id.options.length]=new Option('Please Select The Server',0); document.fastorder.count.options[document.fastorder.count.options.length]=new Option('Please Select The Product',0); document.fastorder.server_id.disabled=true; document.fastorder.count.disabled=true; if(document.fastorder.game_id.options[document.fastorder.game_id.selectedIndex].value!=0){ document.fastorder.server_id.options.length=0; document.fastorder.server_id.options[document.fastorder.server_id.options.length]=new Option("...Loading...",0); url='/fast-order/read-data.asp?action=serverlist\&game_id='+document.fastorder.game_id.options[document.fastorder.game_id.selectedIndex].value; xmlhttp=getXMLRequester(); xmlhttp.onreadystatechange = do_gl_chg; xmlhttp.open('GET', url, true); xmlhttp.send(null); } } function do_gl_chg(){ var sstr; var sid = new Array(); var str = new Array(); if (xmlhttp.readyState == 4) { if (xmlhttp.status == 200){ str=xmlhttp.responseText.split('||'); document.fastorder.server_id.options.length=0; for(var i=0;i < str.length-1;i++) { sstr=str[i]; sid=sstr.split('|'); document.fastorder.server_id.options[document.fastorder.server_id.options.length]=new Option(sid[0],sid[1]); } count_str=str[str.length-1]; document.fastorder.server_id.disabled=false; } else alert('read data 1error:'+xmlhttp.status); } } function sl_chg(){ var unit; var ssb; var sa = new Array(); var sb = new Array(); document.fastorder.price.value=''; if(document.fastorder.server_id.options[document.fastorder.server_id.selectedIndex].value==0){ document.fastorder.count.options.length=0; document.fastorder.count.options[document.fastorder.count.options.length]=new Option('Please Select The Product',0); document.fastorder.count.disabled=true; } else{ document.fastorder.count.options.length=0; document.fastorder.count.options[document.fastorder.count.options.length]=new Option('Please Select The Product',0); sa=count_str.split('|'); unit=sa[sa.length-1]; for(var i=0;i < sa.length-1;i++) { ssb=sa[i]; sb=ssb.split(':'); document.fastorder.count.options[document.fastorder.count.options.length]=new Option(sb[0] + ' ' + unit,sb[0]); } document.fastorder.count.disabled=false; } } function cal_price(){ var ssb; var sa = new Array(); var sb = new Array(); var count; var price; var up; if(document.fastorder.count.options[document.fastorder.count.selectedIndex].value==0){ document.fastorder.price.value=''; } else{ document.fastorder.price.value=''; count=document.fastorder.count.options[document.fastorder.count.selectedIndex].value; sa=count_str.split('|'); for(var i=0;i < sa.length-1;i++) { ssb=sa[i]; sb=ssb.split(':'); if(sb[0]-count==0){ up=document.fastorder.server_id.options[document.fastorder.server_id.selectedIndex].value; price=money_p*count*sb[1]*up.split(':')[1]; price=price.toFixed(2); document.fastorder.price.value=price; } } if(document.fastorder.price.value=='') alert('calculator error, please contact us with live chat'); } } function chk_forder(){ if(document.fastorder.price.value==''){ alert('please choose you need'); return false; } return true; }