
function ckquickorder2()
{
	var fn=document.quickorder2;
	if(!fn.gid.value){alert('Please select a game.');return false;}
	if(!fn.sid.value){alert('Please select a server.');return false;}
    if(!fn.cid.value){alert('Please select a quantity.');return false;}
	if(!fn.charactername.value){alert('Please input your CharacterName.');fn.charactername.focus();return false;}
	if(!fn.price.value){alert('Price Error.');return false;}
	fn.title.value=fn.gid.options[fn.gid.selectedIndex].text+" - "+fn.sid.options[fn.sid.selectedIndex].text;

	fn.action='index.php?main_page=buygold-shoppingcart&action=add';
}
var   xmlHttp2; 
function   createXMLHttpRequest2()   {
      if (window.ActiveXObject) {   
           xmlHttp2   =   new   ActiveXObject("Microsoft.XMLHTTP");   
      }     
      else if (window.XMLHttpRequest) {   
           xmlHttp2 = new XMLHttpRequest();   
      }   
  }     
  
 function handleStateChange21() {   
     if ( xmlHttp2.readyState == 4) {  	
         if ( xmlHttp2.status == 200 && xmlHttp2.responseText) { 
            var ajax_content = new Array(); 
            ajax_content = xmlHttp2.responseText.split('#'); 
            
            
            var ser_content = new Array(); 
            ser_content = ajax_content[1].split(','); 
            var ser_id = new Array(); 
            ser_id = ajax_content[2].split(','); 
            
            var item_content = new Array(); 
            
            item_content=ajax_content[0].split(',');
            document.quickorder2.sid.options.length = 0;
            for( s = 0; s < ser_content.length; s++){
                document.quickorder2.sid.options.add(new Option(ser_content[s],ser_id[s]));
            }
            
            document.quickorder2.cid.options.length = 1;
            for (v = 0; v < item_content.length; v++){
                document.quickorder2.cid.options.add(new Option(item_content[v],v));
            }
          }
      }
  }



			
function   handleStateChange22() {   
    if(xmlHttp2.readyState == 4){   
          if(xmlHttp2.status == 200){ 
		      document.quickorder2.price.value = xmlHttp2.responseText;
		  }
	 }
}		
function changeserver2(gameid){
    document.quickorder2.sid.options.length = 0;	
    document.quickorder2.price.value = '';
    document.quickorder2.sid.options.add(new Option('Loading...','Loading...'));
    createXMLHttpRequest2();   
    xmlHttp2.onreadystatechange   =   handleStateChange21;   
    xmlHttp2.open("GET",   "index.php?action=ajax&type=changeserver&id="+gameid,   true);   
    xmlHttp2.send(null);
}
            
function showprice2(itemid,sid,currency){
    createXMLHttpRequest2();   
    xmlHttp2.onreadystatechange = handleStateChange22;   
    xmlHttp2.open("GET",   "index.php?action=ajax&type=showprice&sid="+sid+"&style=1&itemid="+itemid+"&currency="+currency,   true);   
    xmlHttp2.send(null);   
}