//index.net
function showTabCard(CurrentId){
	for(var i=1;i<=3;i++){
		if(i==CurrentId)
			$("#event"+i).show();
		else
			$("#event"+i).hide();
	}
}

<!--
function MM_openBrWindow(theURL,winName,features){
	window.open(theURL,winName,features);
}

function MM_reloadPage(init){//reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}

function check(form){
	if(form.ftpuser.value==""){
		alert("請輸入FTP用戶名!");
		return false;
	}
	if(form.ftppass.value==""){
		alert("請輸入FTP密碼!");
		return false;
	}
	if(form.randNum.value==""){
		alert("請輸入驗證碼!");
		return false;
	}
	return true;
}

function MM_preloadImages(){
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

//-->

//vhostdiy.net
function $(o){return document.getElementById(o)}

function WindowOS(is08){
	document.getElementsByName('WindowsOS')[is08].checked = true;
	var opDB = document.getElementById("dbType");
	opDB.selectedIndex = 0;
	opDB.length = 0;
	if(opDB.options!=null)opDB.options[0]= new Option("無數據庫","");
	else{
		opDB.options = new Array();
		opDB.options[0]= new Option("無數據庫","");
	}
	if(is08){
		opDB.options[1]= new Option("SqlServer2005","mssql2005");
		opDB.selectedIndex = 1;
	}else{
		if(document.getElementById("script").value!="HTML"){
			opDB.options[1]= new Option("SqlServer2000","mssql2000");
			opDB.options[2]= new Option("SqlServer2005","mssql2005");
			opDB.selectedIndex = 2;
		}
	}
	var pp = document.getElementById("dbType");
	document.getElementById("dbPanel").style.display = pp.selectedIndex==0?'none':'';
}

function doScript(o){
	//var opDB = $("dbType");
	var opDB = document.getElementById("dbType");
	if(o.value=='C'){
		$("#sysDes").html("<span style='cursor:pointer' onClick='WindowOS(0)'><input name='WindowsOS' type='radio' value='2003'><img src='/vhost/images/v9/icon_win.gif'> Windows 2003</span>&nbsp;&nbsp;&nbsp;&nbsp;");
		$("#sysDes").html($("#sysDes").html()+"<span style='cursor:pointer;color:red' onClick='WindowOS(1)'><input name='WindowsOS' type='radio' value='2008' checked><img src='/vhost/images/v9/icon_win.gif'> Windows 2008</span><img src='/news/images/hot.gif'>");
	}else if(o.value=="HTML"){
		$("#sysDes").html("<span style='cursor:pointer'><input name='WindowsOS' type='radio' value='2003' onClick='WindowOS(0)' checked><img src='/vhost/images/v9/icon_win.gif'> Windows 2003</span>");
	}else{
		$("#sysDes").html("<img src='/vhost/images/v9/icon_linux.gif'> Linux / Unix <img src='/news/images/hot_old.gif'>");
	}
	opDB.length = 0;
	if(opDB.options!=null)opDB.options[0]= new Option("無數據庫","");
	else{
		opDB.options = new Array();
		opDB.options[0]= new Option("無數據庫","");
	}
	switch(o.value){
		case 'A':
			opDB.options[1]= new Option("MySql","mysql");
			//opDB.options[2]= new Option("SqlServer2000","mssql2000");
			//opDB.options[3]= new Option("SqlServer2005","mssql2005");
			//opDB.selectedIndex = 3;
			opDB.selectedIndex = 1;
			break;
		case 'B':
			opDB.options[1]= new Option("MySql","mysql");
			opDB.selectedIndex = 1;
			break;
		case 'C':
			opDB.options[1]= new Option("SqlServer2000","mssql2000");
			opDB.options[2]= new Option("SqlServer2005","mssql2005");
			opDB.selectedIndex = 2;
			break;
	}
	document.getElementById("dbType").selectedIndex = document.getElementById("dbType").length-1;
	document.getElementById("emailType").selectedIndex = 1;
	var pp = document.getElementById("dbType");
	document.getElementById("dbPanel").style.display=pp.selectedIndex==0?'none':'';
}

function doPanel(o,panel){
	document.getElementById(panel).style.display=o.selectedIndex==0?'none':'';
}

function ret(o,msg){
	alert(msg);
	o.focus();
	o.select();
	return false;
}

function goDIY(){
	var scriptObj = document.getElementById("script");
	if(scriptObj.value==''){
		alert('請選擇您要自定製的腳本語言');
		scriptObj.focus();
		return false;
	}
	var webSize = document.getElementById("diyVHostQuota");
	if(webSize.value=='')return ret(webSize,'請填寫您要自定制多大主機空間');
	if(webSize.value<150)return ret(webSize,'空間大小不能小于150MB');
	if(webSize.value%50!=0)return ret(webSize,'空間大小請輸入50的倍數');
	if(webSize.value>50000)return ret(webSize,'空間大小不能大于50G');
	
	var DBSize = document.getElementById("diyDBQuota");
	if(DBSize.value=='')return ret(DBSize,'請填寫您要自定制多大數據庫空間');
	if(DBSize.value%10!=0)return ret(DBSize,'數據庫容量大小請輸入10的倍數50的倍數');
	if(DBSize.value>2000)return ret(DBSize,'數據庫容量不能大于2000M');
	
	var MailSize = document.getElementById("diyEmailQuota");
	if(MailSize.value=='')return ret(MailSize,'請填寫您要自定制多大郵箱空間');
	if(MailSize.value%10!=0)return ret(MailSize,'郵箱空間大小請輸入50的倍數');
	if(MailSize.value<250)return ret(MailSize,'郵箱空間大小請最少為250M');
	if(MailSize.value>50000)return ret(MailSize,'郵箱空間大小不能大于50G');
}

function init(){
	doScript(document.getElementById("script"));
}

//order.net
function checkDomain(domain){
	if(domain.indexOf(".")==-1)return -1;
	return 1;
}

function getTargetIDProduct(form){
	var choose= false;
	var TargetIDProduct = 0;
	if(form.TargetIDProduct.length>0){
		for(i=0;i<form.TargetIDProduct.length;i++){
			if(form.TargetIDProduct[i].checked){
				TargetIDProduct = form.TargetIDProduct[i].value;
				choose=true;
			}
		}
	}else{
		if(form.TargetIDProduct.checked){
			TargetIDProduct = form.TargetIDProduct.value;
			choose = true;
		}
	}
	return TargetIDProduct;
}

function DomainExistHandle(){
	var response=this.req.responseText;
	if(response==2001){
		alert("該域名 "+$("#chrDomain").val()+" 已存在伺服器上，請重新輸入。\n\n主機開通后主機綁定的域名可自由更改綁定！");
		return;
	}
	if(response==2002){
		alert("很抱歉, 該域名'"+$("#chrDomain").val()+"'不為您擁有, 請選擇其它域名");
		return;
	}
	V_Form.submit();
}

function showDomainPanel(){
	$("#domain_panel").show();
	$("#domain_panel2").hide();
	$("#subm").attr("disabled","");
}

function showDomainPanel2(){
	$("#domain_panel").hide();
	$("#domain_panel2").show();
	$("#subm").attr("disabled","disabled");
}

function hiddenDomainPanel(){
	$("#domain_panel").hide();
	$("#domain_panel2").hide();
	$("#subm").attr("disabled","");
}

function checkDomainWhois(domain,domainType){
	$("#subm").attr("disabled","disabled");
	$("#ckDomain").attr("disabled","disabled");
	$("#rMsg").html("正在檢查，請稍候。。。");
	if(domain==""){
		$("#rMsg").html("<font color='red'>域名不能為空</font>");
		$("#ckDomain").attr("disabled","");
		return false;
	}
	if(domainType==""){
		$("#rMsg").html("<font color='red'>請選擇域名類型</font>");
		$("#ckDomain").attr("disabled","");
		return false;
	}
	if(domain.indexOf(".")>=0){
		$("#rMsg").html("<font color='red'>請填寫正確的域名</font>");
		$("#ckDomain").attr("disabled","");
		return false;
	}
	var xmlObj = null;
	if(window.XMLHttpRequest)xmlObj = new XMLHttpRequest();
	else if(window.ActiveXObject){
		try{
			xmlObj = new ActiveXObject("Msxml2.XMLHTTP");	
		}catch(e){
			try{
				xmlObj = new ActiveXObject("Microsoft.XMLHTTP");
			}catch(e){}
		}
	}
	if(!xmlObj){
		alert('Create Ajax Object Flase!');	
		return false;
	}else{
		xmlObj.open("POST","whoisdomain.inc.php",true);
		xmlObj.setRequestHeader("Content-Type","application/X-www-form-urlencoded");
		xmlObj.send("domain="+domain+"&domainType="+domainType+"&rid="+Math.random());
		xmlObj.onreadystatechange=function(){
			if(xmlObj.readyState==4){
				if(xmlObj.status==200){
					var rStr = xmlObj.responseText;
					rStr=rStr.replace(/^\s*/g,"");
					rStr=rStr.replace(/\s*$/g,"");
					rStr=rStr.replace("<!-- in core product/product.class.inc.php -->","");
					if(rStr==0){
						$("#rMsg").html("<font color='green'>恭喜，該域名還未註冊</font>");
						$("#subm").attr("disabled","");
					}else{
						$("#rMsg").html("<font color='red'>該域名不能註冊，請重新填寫</font>");
						$("#ckDomain").attr("disabled","");
						return false;
					}
				}
			}
		}
	}
}

function showbDomainPanel(){
	if($("#bDomain").attr('checked')){
		$("#formOne").hide();
		$("#formTwo").show();
		$("#Submit2").attr("disabled","disabled");
	}else{
		$("#formOne").show();
		$("#formTwo").hide();
		$("#Submit2").attr("disabled","");
	}
}

function checkDomainWhoisOther(domain,domainType){
	$("#Submit2").attr("disabled","disabled");
	$("#ckbDomain").attr("disabled","disabled");
	$("#rMsg").html("<font color='red'>正在檢查，請稍候。。。</font>");
	if(domain==""){
		$("#rMsg").html("<font color='red'>域名不能為空</font>");
		$("#ckbDomain").attr("disabled","");
		$("#ckbDomain").val("检查域名");
		return false;
	}
	if(domainType==""){
		$("#rMsg").html("<font color='red'>請選擇域名類型</font>");
		$("#ckbDomain").attr("disabled","");
		return false;
	}
	if(domain.indexOf(".")>=0){
		$("#rMsg").html("<font color='red'>請填寫正確的域名</font>");
		$("#ckbDomain").attr("disabled","");
		return false;
	}
	var xmlObj = null;
	if(window.XMLHttpRequest){
		xmlObj = new XMLHttpRequest();	
	}else if(window.ActiveXObject){
		try{
			xmlObj = new ActiveXObject("Msxml2.XMLHTTP");	
		}catch(e){
			try{
				xmlObj = new ActiveXObject("Microsoft.XMLHTTP");
			}catch(e){}
		}
	}
	if(!xmlObj){
		alert('Create Ajax Object Flase!');	
		return false;
	}else{
		xmlObj.open("POST","whoisdomain.inc.php",true);
		xmlObj.setRequestHeader("Content-Type","application/X-www-form-urlencoded");
		xmlObj.send("domain="+domain+"&domainType="+domainType+"&rid="+Math.random());
		xmlObj.onreadystatechange=function(){
			if(xmlObj.readyState==4){
				if(xmlObj.status==200){
					var rStr = xmlObj.responseText;
					rStr=rStr.replace(/^\s*/g,"");
					rStr=rStr.replace(/\s*$/g,"");
					rStr=rStr.replace("<!-- in core product/product.class.inc.php -->","");
					if(rStr==0){
						$("#rMsg").html("<font color='green'>恭喜，該域名還未註冊</font>");
						$("#Submit2").attr("disabled","");
					}else{
						$("#rMsg").html("<font color='red'>該域名不能註冊，請重新填寫</font>");
						$("#ckbDomain").attr("disabled","");
						return false;
					}
				}
			}
		}
	}
}
