
	function addOnServiceChange(xx)
	{
		//x1 = document.getElementById("chkVirus");
		x2 = document.getElementById("chkPort");
		x3 = document.getElementById("chkService");
		
		
	//	if (xx.id != x1.id)
	//		x1.checked= false;
		if (xx.id != x2.id)
			x2.checked= false;
		if (xx.id != x3.id)
			x3.checked= false;
	
		

	
	}

		function getSWF(movieName)
		{
			if (navigator.appName.indexOf("Microsoft") != -1)
				return  window[movieName] ;			
			else
				return  document[movieName] ;

		  /*if (navigator.appName.indexOf("Microsoft") != -1)
				return document.getElementById(movieName); //return window[movieName];
		  else
			return document[movieName];*/
		}

		function promotionPlayVideo()
		{
			videoPlaying = true;		
			getSWF('videobox').startPlayVideo();
			

		}

    function playVideo()
    {
		jQuery('#promoteVideo').css('display', 'block');
		setTimeout(" promotionPlayVideo()", 100);
     
    }

	function onVideoFinish()
	{
		videoPlaying = false;
		jQuery('#promoteVideo').css('display', 'none');
	}





function js_clock(){
		var clock_time = new Date();
		var clock_hours = clock_time.getHours();
		var clock_minutes = clock_time.getMinutes();
		var clock_seconds = clock_time.getSeconds();
		var clock_years =  clock_time.getFullYear();
		var clock_months =  clock_time.getMonth() + 1;
		var clock_days =  clock_time.getDate();
		var clock_week = clock_time.getDay();


		var weekday=new Array(7);
		weekday[0]="星期日";
		weekday[1]="星期一";
		weekday[2]="星期二";
		weekday[3]="星期三";
		weekday[4]="星期四";
		weekday[5]="星期五";
		weekday[6]="星期六";

		var clock_prefix = "上午";
	
		if (clock_hours > 11){
				clock_prefix = "下午";
				clock_hours = clock_hours - 12;
		}
		if (clock_hours == 0){
			clock_hours = 12;
		}
		if (clock_hours < 10){
			clock_hours = "0" + clock_hours;
		}
		if (clock_minutes < 10){
				clock_minutes = "0" + clock_minutes;
		}
		if (clock_seconds < 10){
			clock_seconds = "0" + clock_seconds;
		}
/*
	 var today       = new Date();
    var strYear     = today.getFullYear();
    var iMonth      = today.getMonth() + 1; // +1, we do NOT want zero-based month index
    var iQuarter    = Math.ceil((iMonth / 12) * 4);
    var iDay        = today.getDate();
    var strDateOut  = "";

*/

		var clock_div = document.getElementById('js_clock');
		clock_div.innerHTML =  clock_years + '年' + clock_months + '月' + clock_days  + '日' +	'&nbsp;&nbsp;&nbsp;' + weekday[clock_week]  + '&nbsp;&nbsp;&nbsp;<img src="images/index_22.jpg" width="3" height="11">&nbsp;&nbsp;&nbsp;' + clock_prefix + clock_hours + ":" + clock_minutes + ":" + clock_seconds ;

	
		setTimeout("js_clock()", 1000);
}


												
												function swapIndexPage(index)
												{
													reloadFormIndexBox('doIndex.php?b='+ index ,'divProIndex','indexForm'); 
												}
				
												
												function CheckStep1a()
												{
													reloadForm('doDomainRegistration.php','divContent','regForm'); 
												}
												
												function changeType(x)
												{
													y1 = document.getElementById("divWeb");
													y2 = document.getElementById("divEmail");

													if (x == 'email')
													{
														y1.style.display = "none";
														y2.style.display = "block";
													}else
													{	
														y1.style.display = "block";
														y2.style.display = "none";																								
													}
												}
												function CheckStep1b(errorMessage)
												{
													form = document.getElementById('regForm');
													
												
													y = document.getElementById('rbWebID'); 
													z = document.getElementById('rbEmailID'); 
																										
													if (form.rbHostType[0].checked)
													{
														if (y.value == '0')
														{
															alert(errorMessage);
															return false;
														}
													}else if (form.rbHostType[1].checked)
													{
														if (z.value == '0')
														{
															alert(errorMessage);
															return false;
														}
													
													}
													reloadForm('doDomainRegistration.php','divContent','regForm'); 
												}

												function showDetail(x)
												{
													x = document.getElementById(x);
													if (x)
													{	x.style.display = "block";
													}
												}

												function hideDetail(x)
												{
													x = document.getElementById(x);
													if (x)
													{	x.style.display = "none";
													}
												}

												function CheckStep2()
												{
													x = document.getElementById("chkTerm");
													if (x.checked)
													{
														reloadForm('doDomainRegistration.php','divContent','regForm'); 
													}else
														alert("請閱讀並同意接受域思科技有限公司的服務條款。");

												}

												


											  
											  function reloadForm(url,refreshElement,form_name)
											  {

													//url,refreshElement,form_name
												

												 // startLoading(refreshElement)
												  form = document.getElementById(form_name);	

												  new Ajax.Updater(
													refreshElement,
													url,
													{
													  asynchronous:true,
													  evalScripts:true,
													  onComplete: function(request, json)
													  {
																								
													  },
													  onLoading:function(request, json)
													  {

													  },
													  parameters:Form.serialize(form)
													}
												  );												 
												  return false;
											  }

											  function reloadFormIndexBox(url,refreshElement,form_name)
											  {

													//url,refreshElement,form_name
												

												 // startLoading(refreshElement)
												  form = document.getElementById(form_name);	

												  new Ajax.Updater(
													refreshElement,
													url,
													{
													  asynchronous:true,
													  evalScripts:true,
													  onComplete: function(request, json)
													  {
														 endLoadinIndexBox()												
													  },
													  onLoading:function(request, json)
													  {

													  },
													  parameters:Form.serialize(form)
													}
												  );												 
												  return false;
											  }

											  function reloadFormRegBox(url,refreshElement,form_name)
											  {

													//url,refreshElement,form_name
												

												 // startLoading(refreshElement)
												  form = document.getElementById(form_name);	

												  new Ajax.Updater(
													refreshElement,
													url,
													{
													  asynchronous:true,
													  evalScripts:true,
													  onComplete: function(request, json)
													  {
														 endLoadingRegBox()												
													  },
													  onLoading:function(request, json)
													  {

													  },
													  parameters:Form.serialize(form)
													}
												  );												 
												  return false;
											  }

											   function reloadFormReg3(url,refreshElement,form_name)
											  {

													//url,refreshElement,form_name
												

												 // startLoading(refreshElement)
												  form = document.getElementById(form_name);	

												  new Ajax.Updater(
													refreshElement,
													url,
													{
													  asynchronous:true,
													  evalScripts:true,
													  onComplete: function(request, json)
													  {
														 endLoadingReg3()												
													  },
													  onLoading:function(request, json)
													  {

													  },
													  parameters:Form.serialize(form)
													}
												  );												 
												  return false;
											  }


											  
											  function startLoading(refreshElement)
											  {
												   
												  divRefreshElement = document.getElementById(refreshElement);
												  x = document.getElementById("divLoading");
												  x.className = "loadingShow";
												  if (divRefreshElement)
												  {
													  alert(divRefreshElement.offsetWidth);
													  div_width =divRefreshElement.offsetWidth ;
															div_height =divRefreshElement.offsetHeight;     
													
													x.style.left = (divRefreshElement.offsetLeft +  div_width/2 - 70) + 'px';
															x.style.top = (divRefreshElement.offsetTop + div_height/2  ) + 'px';
													
												  }
											  }

											  function endLoadinIndexBox()
											  {
												
													 x = document.getElementById("checkIndexFormPass");
													if (x)
														reloadForm('doIndex.php?button='+x.value,'divindexButtomForm','indexButtomForm');
											  }

											  function endLoadingReg3()
											  {
												
													 x = document.getElementById("checkRegForm3Pass");
													if (x)
														reloadForm('doDomainRegistration.php','divContent','regForm');
													else
												    {

														 x = document.getElementById("checkRegForm3Error3");														 
														 y = document.getElementById("divRegForm3Error3");
														 if (x && y)
														 {
															 y.innerHTML = x.value;
														 }

														 x = document.getElementById("checkRegForm3Error2");														 
														 y = document.getElementById("divRegForm3Error2");
														 if (x && y)
														 {
															 y.innerHTML = x.value;
														 }

														 x = document.getElementById("checkRegForm3Error1");														 
														 y = document.getElementById("divRegForm3");
														 if (x && y)
														 {
															 y.innerHTML = x.value;
														 }
													
													
													}
											  }

											  function endLoadingRegBox()
											  {
												
												x = document.getElementById("domRegBoxPass");
												if (x)
												{
												
													form = document.getElementById("domainRegBoxForm");
													form.action = 'domain_reg.php';
													form.submit();

												}												


											  }	
											  /*function endLoading()
											  {
												  												
												  x = document.getElementById("divLoading");
												  x.className = "loadingHide";

											  }	*/							
											
											function IsEnter(e,step)
											{
												if ( 13 == e.keyCode)
												{	
													if (step=='a')
															CheckStep1a();
													else if (step=='newsletter')
														reloadForm('doNewsLetter.php','divProNewsLetter','newsletterForm');
													else if (step=='domBox')
														reloadForm('doDomainRegBox.php','divProdomainRegBox','domainRegBoxForm');
													return	false;
												}
													
											
											}

											
											function changeLang(lang)
											{
												link = window.location.href;
												if (lang=="chi")
													link = link.replace("/eng/","/chi/");
												else if(lang=="eng")
													link = link.replace("/chi/","/eng/");
												window.location.href = link;											
											}
