

// JavaScript Document
function show(e){
        e.getElementsByTagName("dd")[0].style.display="block";
		e.className="on";
    }
function hide(e){
        e.getElementsByTagName("dd")[0].style.display="none";
		e.className="off";
    }
function bgshow(e){
		e.className="sssubmiton";
    }
function bghide(e){
		e.className="sssubmitoff";
    }
	
function packchoose(){
	var packagnum;
	var game_price;	
	packagnum = document.getElementById("packagnum").value;
	for(i=1;i<packagnum;i++)
		{
		game_price = document.getElementById('game_price'+i).value;
		document.getElementById('package_price'+i).value = formatprice(game_price*getCookie("currenprice"));
		document.getElementById('package_name'+i).innerHTML = formatprice(game_price*getCookie("currenprice"));
		document.getElementById('package_curren'+i).innerHTML = getCookie("currenname");
		document.getElementById('package_label'+i).value = getCookie("currenname");
		}		
	}
	
//
function do_curren_chg(){
	
	var str = new Array();
	if (xmlhttp.readyState == 4) {
		if (xmlhttp.status == 200){
		str=xmlhttp.responseText.split('||');
		
		setCookie("currenid",str[0]);
		setCookie("currenname",str[1]);
		setCookie("currenprice",str[2]);
		
		//curren
	document.getElementById('currency').innerHTML = 'Currency('+getCookie("currenname")+')';
	//righter.fast
	document.getElementById('curry_price').value = getCookie("currenprice");
	document.getElementById('s_curr').value = getCookie("currenname");
		packchoose();
		//countPrice;
		countPrice();
		}
		else alert('read data 1error:'+xmlhttp.status);
	}
	
}

function curren(namea){
	
	try{
	xmlhttp=new XMLHttpRequest();
	}
	catch(e)
	{
	xmlhttp=new ActiveXObject("MIcrosoft.XMLHttp");
	}
	xmlhttp.onreadystatechange = do_curren_chg;
	url=siteUrl+'/read-curren.php?curren_id='+namea;
	xmlhttp.open('GET',url, true); 
	xmlhttp.send(null);
	
	}
	
	
function do_curren_chga(){
	
	var str = new Array();
	if (xmlhttp.readyState == 4) {
		if (xmlhttp.status == 200){
		str=xmlhttp.responseText.split('||');
		
		setCookie("currenid",str[0]);
		setCookie("currenname",str[1]);
		setCookie("currenprice",str[2]);
		
		//curren
	document.getElementById('currency').innerHTML = 'Currency('+getCookie("currenname")+')';
	//righter.fast
	document.getElementById('curry_price').value = getCookie("currenprice");
	document.getElementById('s_curr').value = getCookie("currenname");
		}
		else alert('read data 1error:'+xmlhttp.status);
	}
	
}

function currena(namea){
	
	try{
	xmlhttp=new XMLHttpRequest();
	}
	catch(e)
	{
	xmlhttp=new ActiveXObject("MIcrosoft.XMLHttp");
	}
	xmlhttp.onreadystatechange = do_curren_chgb;
	url=siteUrl+'/read-curren.php?curren_id='+namea;
	xmlhttp.open('GET',url, true); 
	xmlhttp.send(null);
	
	}
	
function do_curren_chgb(){
	
	var str = new Array();
	if (xmlhttp.readyState == 4) {
		if (xmlhttp.status == 200){
		str=xmlhttp.responseText.split('||');
		
		setCookie("currenid",str[0]);
		setCookie("currenname",str[1]);
		setCookie("currenprice",str[2]);
		
		//curren
	document.getElementById('currency').innerHTML = 'Currency('+getCookie("currenname")+')';
	//righter.fast
	document.getElementById('curry_price').value = getCookie("currenprice");
	document.getElementById('s_curr').value = getCookie("currenname");
		
		packchoose();
		}
		else alert('read data 1error:'+xmlhttp.status);
	}
	
}

function currenb(namea){
	
	try{
	xmlhttp=new XMLHttpRequest();
	}
	catch(e)
	{
	xmlhttp=new ActiveXObject("MIcrosoft.XMLHttp");
	}
	xmlhttp.onreadystatechange = do_curren_chgb;
	url=siteUrl+'/read-curren.php?curren_id='+namea;
	xmlhttp.open('GET',url, true); 
	xmlhttp.send(null);
	
	}
