// JavaScript Document
function addme(){ 
var nome_sito = "WOW-Golds.ORG"; 
var url_sito = "http://www.wow-golds.org";
if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt
	(navigator.appVersion) >= 4))
	window.external.AddFavorite(url_sito, nome_sito);
else if (navigator.appName == "Netscape")
	window.sidebar.addPanel(nome_sito, url_sito, '');
else
	alert("Sorry! Cann't Add this site to your favorite! Please use IE or Firefox");

}

function $(id) {
	return document.getElementById(id);
}

function getXMLRequester( )
{ var xmlhttp_request = false;
try
{ if( window.ActiveXObject )
{ for( var i = 5; i; i-- ){
try{
if( i == 2 )
{ xmlhttp_request = new ActiveXObject( "Microsoft.XMLHTTP" ); }
else
{ xmlhttp_request = new ActiveXObject( "Msxml2.XMLHTTP." + i + ".0" );
xmlhttp_request.setRequestHeader("Content-Type","text/xml");
xmlhttp_request.setRequestHeader("Content-Type","utf8"); }
break;}
catch(e){ xmlhttp_request = false; } } }
else if( window.XMLHttpRequest )
{ xmlhttp_request = new XMLHttpRequest();
if (xmlhttp_request.overrideMimeType)
{ xmlhttp_request.overrideMimeType('text/xml'); } } }
catch(e){ xmlhttp_request = false; }
return xmlhttp_request ; }

function showatoz(a){
	for(var i=0;i<26;i++){
		$('atoz_'+String.fromCharCode(65+i)).style.display = 'none';
		$('aatoz_'+String.fromCharCode(65+i)).className = 'atoz';
	}
	$('atoz_'+a).style.display = '';
	$('aatoz_'+a).className = 'satoz';
}

function showlist(a,obj){
var ssa;
var ssb;
var sa = new Array();
var sb = new Array();
var dw;
var str;
var price;
str='';
$('servernamediv').innerHTML=obj.innerHTML;	
ssa=document.goldorder.count_str.value;
sa=ssa.split('|');
dw=sa[sa.length-1];
	for(var i=0;i < sa.length-1;i++)
	{
	ssb=sa[i];
	sb=ssb.split(':');
	price=sb[0]*sb[1]*a;
	price=price.toFixed(2);
	str=str + '<li>' + sb[0] + ' ' + dw + '</li><li>$ ' + price + '</li> <li><a href="#" onclick="buygold(' + price + ',' + sb[0] + ')"><img src="/images/buy.jpg" width="100" height="20" border="0" /></a></li>'
	}
$('plist').innerHTML=str;
}

function buygold(price,count){
document.goldorder.servername.value=$('servernamediv').innerHTML;
document.goldorder.price.value=price;
document.goldorder.count.value=count;
document.goldorder.submit();
}


function fastordersubmit(){
var str;
var gp;
if(document.fastorder.s_gl.options[document.fastorder.s_gl.selectedIndex].value==0){
	alert('please select your game');
}
else
{
		if(document.fastorder.s_sl.options[document.fastorder.s_sl.selectedIndex].value==0){
			alert('please select your server');
		}
		else
		{
				str=document.fastorder.s_pl.options[document.fastorder.s_pl.selectedIndex].value;
				gp=str.split(':');
				if(gp[0]==0 || gp[1]==0){
					alert('please select your product');
				}
				else
				{
					document.fastorder.game_id.value=document.fastorder.s_gl.options[document.fastorder.s_gl.selectedIndex].value;
					document.fastorder.servername.value=document.fastorder.s_sl.options[document.fastorder.s_sl.selectedIndex].text;
					document.fastorder.count.value=gp[0];
					document.fastorder.price.value=gp[1];
					document.fastorder.submit();
				}		
		}	
}	
}


function buygoldcheck(){
var str;
str='';
if(document.buygoldform.fullname.value==''){
str='please input your Full Name\n';
}
if(document.buygoldform.email.value==''){
str=str+'please input your E-mail\n';
}
else
{
patrn = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;
if (!patrn.test(document.buygoldform.email.value)){
str=str+'your E-mail addr format error\n';
}
}

if(document.buygoldform.phone.value==''){
str=str+'please input your phone\n';

}
if(document.buygoldform.character.value==''){
str=str+'please input your character name\n';
}
if(!document.buygoldform.acc.checked){
str=str+'please accept the terms and conditions \n';	
}
if(str!=''){
	str='Warning:\n---------------------------------\n\n'+str;
	alert(str);
	}
else
{
document.buygoldform.submit();	
}
}