
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function  new_check_form()
{ 

if  (document.getElementById('type').value=='no')  { 

alert("Please select the type");

return  false;
}else{
	
	if(document.getElementById('type').value=='GOLD'){
	   var game=document.getElementById('pro_game').value;
	   var server=document.getElementById('service1').value;
	   var prosl=document.getElementById('prosl').value;
       var prices=document.getElementById('prices').value;
       var date1xx=document.getElementById('date1xx').value;

	   var msg='';
	   if(game=='')
	   {
	    msg+='Please select the Game\n';
	   }
	   if(prosl=='')
	   {
	    msg+='Please select the Quantity\n';
	   }
       if(prices==0)
	   {
	    msg+='Please select the Quantity\n';
	   }
       if(date1xx==0)
	   {
	    msg+='Please select Birthday\n';
	   }
      	var firstname=document.getElementById('firstname').value.length;
	var lastname=document.getElementById('lastname').value.length;
	var charname=document.getElementById('charname').value;
	var charname1=document.getElementById('charname1').value;
	var email=document.getElementById('fast_email').value;
	var code1=document.getElementById('code1').value;
	var Phone1=document.getElementById('Phone1').value;
	if(firstname==0){
	msg+='Please Enter First Name\n';
	}
	if(lastname==0){
	msg+='Please Enter Last Name\n';
	}
	if(charname!=charname1){
	msg+='Please verify your CharacterName again\n';
	}
	var emailStr=email;
	var emailPat=/^(.+)@(.+)$/;
	var matchArray=emailStr.match(emailPat);
	if (matchArray==null)
	{
      
	  msg+='email is wrong\n';
	}
	if(Phone1==0||code1==0)
	{
	 msg+='Please Enter  Invalid  Phone number  \n';
	}
	  if(msg!=''){
	   alert(msg);
	   return  false;
	   }
	}else if(document.getElementById('type').value=='CDK'){
		var game=document.getElementById('pro_cdk1').value;
		var product=document.getElementById('cdkids').value;
		var date1xx=document.getElementById('date1xx').value;
		var msg='';
	   if(game=='')
	   {
	    msg+='Please select the Game\n';
	   }
	   if(product=='')
	   {
	    msg+='Please select the Product\n';
	   }
	  if(date1xx==0)
	   {
	    msg+='Please select Birthday\n';
	   }
    var firstname=document.getElementById('firstname').value.length;
	var lastname=document.getElementById('lastname').value.length;
	var charname=document.getElementById('charname').value;
	var charname1=document.getElementById('charname1').value;
	var email=document.getElementById('fast_email').value;
	var code1=document.getElementById('code1').value;
	var Phone1=document.getElementById('Phone1').value;
	if(firstname==0){
	msg+='Please Enter First Name\n';
	}
	if(lastname==0){
	msg+='Please Enter Last Name\n';
	}
	if(charname!=charname1){
	msg+='Please verify your CharacterName again\n';
	}
	var emailStr=email;
	var emailPat=/^(.+)@(.+)$/;
	var matchArray=emailStr.match(emailPat);
	if (matchArray==null)
	{
      
	  msg+='email is wrong\n';
	}
	if(Phone1==0||code1==0)
	{
	 msg+='Please Enter  Invalid  Phone number  \n';
	}
	 if(msg!=''){
	   alert(msg);
	   return  false;
	   }
	  
	}
	
   return true;
}
}


function display()
{
   var values=document.getElementById('type').value;
  
  if(values=='GOLD'){

	document.getElementById('LM10021').style.display='block';
    document.getElementById('table1').style.display='inline'; 
	document.getElementById('table2').style.display='none';
    document.getElementById('character').style.display='inline'; 
  }else if(values=='CDK'){
	
	document.getElementById('LM10021').style.display='inline';
	document.getElementById('table1').style.display='none'; 
	document.getElementById('table2').style.display='inline'; 
      document.getElementById('character').style.display='none';
	
  }else{
	
	document.getElementById('LM10021').style.display='none';
document.getElementById('table1').style.display='none'; 
	document.getElementById('table2').style.display='none';
  }
}

scores = new Array(20);
var numTotal=0;
NS4 = (document.layers) ? 1 : 0;IE4 = (document.all) ? 1 : 0;ver4 = (NS4 || IE4) ? 1 : 0;
			
	function getIndex(el) {   
	 ind = null;   
	 
	  for (i=0; i<document.layers.length; i++)   
	  {        whichEl = document.layers[i];     
	     if (whichEl.id == el) {            ind = i;         
		    break;        }    }  
			  return ind;}
function arrange() 
{  
nextY = document.layers[firstInd].pageY +document.layers[firstInd].document.height;    
for (i=firstInd+1; i<document.layers.length; i++)
   {    
	whichEl = document.layers[i];  
	if (whichEl.visibility != "hide")
	{         
		whichEl.pageY = nextY;          
		nextY += whichEl.document.height;      
	}    
  }
}
		  
function initIt(){  
if (!ver4) return;   
if (NS4)
  {        
	for (i=0; i<document.layers.length; i++) 
	{

	
	whichEl = document.layers[i];          
		if (whichEl.id.indexOf("Child") != -1) whichEl.visibility = "hide";
	} 
   arrange();
   }else { 
   divColl = document.all.tags("DIV");     
	for (i=0; i<divColl.length; i++) 
	{    
	   
		if(i!=1)
		{ 
		 whichEl = divColl(i);
		  
          if (whichEl.className == "child") whichEl.style.display = "none";
		  if(whichEl.id=='KB1Child')
		  {
		  whichEl.style.display='block';
		  }
		}       
    }  
  }
 }
function expandIt(el) 
{   
   
	if (!ver4) return;    
	if (IE4) 
	   {
		whichEl1 = eval(el + "Child");     
		for(i=1;i<=numTotal;i++)
		{
			whichEl = eval(scores[i] + "Child");
			if(whichEl!=whichEl1) 
			{
			 whichEl.style.display = "none"; 
			 }
		} 
		whichEl1 = eval(el + "Child");        
		if (whichEl1.style.display == "none")
		  { 
			 whichEl1.style.display = "block";
		   }else {
		   whichEl1.style.display = "none";       
		   }   
	  }else{
		 whichEl = eval("document." + el + "Child");        
		for(i=1;i<=numTotal;i++)
		{ 
		 whichEl = eval("document." + scores[i] + "Child");     
		   
		 if(whichEl!=whichEl1) 
		 { 
		   whichEl.visibility = "hide";
		  }    
	   }        
	if (whichEl.visibility == "hide")
	 { 
	 
	   whichEl.visibility = "show"; 
	 }else { 
	   whichEl.visibility = "hide";
	 } 
	   
	  arrange();
	}
	 divColl = document.all.tags("DIV");
 
	for (j=0; j<divColl.length; j++) 
	{    
		
		 whichEl = divColl(j);
		  
          if (whichEl.className == "child") 
		  whichEl.style.display = "none";
		  
    }
	 whichEl1.style.display='';
}
onload = initIt;
