<!--
if(self != top) top.location.href = window.location.href;
function submitonce(theform){
//if IE 4+ or NS 6+
if (document.all||document.getElementById){
//screen thru every element in the form, and hunt down "submit" and "reset"
for (i=0;i<theform.length;i++){
var tempobj=theform.elements[i]
if(tempobj.type.toLowerCase()=="submit"||tempobj.type.toLowerCase()=="reset")
//disable em
tempobj.disabled=true
}
}
}
 
 
var submitcount=0;
function check_form() {
   if (submitcount == 0)
      {
      submitcount++;
      return true;
      }
   else 
      {
      alert("This form has already been submitted.  Thanks!");
      return false;
      }
}

function openWin(url, SERVICE) {

	 		openNew = window.open(url, service, 'directories=no,height=335,width=550,resizable=yes,menubar=no,scrollbars=yes');

	  	}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_showHideLayers() { //v3.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 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_jumpMenu(selObj,restore){ //v3.0
 eval("location='"+selObj.options[selObj.selectedIndex].value+"'");
 if (restore) selObj.selectedIndex=0;
}

function MM_first(){
  MM_showHideLayers('menu1','','show','menu2','','hide','menu3','','hide','menu4','','hide','menu5','','hide','menu6','','hide');
}  

function MM_preloadImages() { //v3.0
  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];}}
}
//-->

 
function center_window(url,width,height,yesno,win_name)
{
	var posx=0;
	var posy=0;
	posx = (screen.width-width)/2-1;
	posy = (screen.height-height)/2-1;
	position =
"width="+width+",height="+height+",resizable=no,scrollbars="+yesno+",top="+posy+
",left="+posx;
	var openWindow = window.open(url,win_name, position);
}

 
function position_window(url,width,height,yesno,posx,posy,popup_name)
{
	position =
"width="+width+",height="+height+",scrollbars="+yesno+",top="+posy+",left="+posx
;
	var openWindow = window.open(url,popup_name,position);
}

             
function jump_sel(selObj,restore){
   eval("location='"+selObj.options[selObj.selectedIndex].value+"'");
   if (restore) selObj.selectedIndex=0;
}

 
function srv_sel(selObj,varObj){
   form = document.serviceForm;
   
   if(varObj == "scode_id2"){           
    form.scode_id2.value = selObj.options[selObj.selectedIndex].value;
    form.scode_seq.value = '';
   }
   else if(varObj == "scode_seq"){
    form.scode_seq.value = selObj.options[selObj.selectedIndex].value;
   }           
             
   form.mode.value = 'srv_sel';
   form.submit();
}

 
function ext_sel(selObj,varObj){
   form = document.extendForm;
   
   if(varObj == 'scode_seq'){
     form.scode_seq.value = selObj.options[selObj.selectedIndex].value;           
   }
   else if(varObj == 's_service_type'){
     form.service_type.value = selObj.options[selObj.selectedIndex].value;       
     form.s_service_type.value = selObj.options[selObj.selectedIndex].value;       
   }
            
   form.mode.value = 'extend_new';
   form.submit();
}
 
function trans_sel(selObj,varObj){
   form = document.serviceForm;
   
   if(varObj == 'scode_seq'){
     form.scode_seq.value = selObj.options[selObj.selectedIndex].value;           
   }
            
   form.mode.value = 'w_transextd_req';
   form.submit();
}

 
function add_sel(selObj,varObj){
   form = document.addForm;
   
   form.scode_seq.value = selObj.options[selObj.selectedIndex].value;           
             
   form.mode.value = 'add';
   form.submit();
}


// JavaScript Document

function setTab0dSyn(i,classnamebef,idbef,idall,tabtabbef)
{
	var waitInterval;
	
	var MouseDelayTime=150;//鼠標感應延遲300毫秒
//
	
					_gObj(idbef+i).onmouseout=function(aEvent)
					{					
					      
						  clearTimeout(waitInterval);
				    }
			    	clearTimeout(waitInterval);
					
					var str="setTab0dSyn1("+i+",'"+classnamebef+"','"+idbef+"',"+idall+",'"+tabtabbef+"')";
					
					waitInterval=setTimeout(str,MouseDelayTime);
	
}
function aa(i)
{
	alert("aa is run"+i);
}
//----------------------------------------------------------------------------------
function setTab0dSyn1(i,classnamebef,idbef,idall,tabtabbef)
{
//alert("aa");
changDivClass(idbef,idall,i,classnamebef)
selectTab0dSyn(tabtabbef,idall,i);
}
function selectTab0dSyn(div_id,allnum,now){
for(var i= 1; i<= allnum;i++)
{
	if(i==now)
	{
		_gObj(div_id+i).style.display="block";
	}else
	{
		_gObj(div_id+i).style.display="none";
	}
}

//		document.getElementById("tabtabd1").style.display="block";
//	document.getElementById("tabtabd2").style.display="none";

}	


function _gObj(id)
{
return document.getElementById(id);
}
function changDivClass(div_id,all,now,classnamebef)
{
for(var i= 1; i<= all;i++)
{
if(i==now)
{
_gObj(div_id+i).className = classnamebef+"_0"+i;
}else
{
//_gObj(div_id+i).className = "dj4_"+i;
_gObj(div_id+i).className = classnamebef+"_"+i;
}
}
}

function selectTabsearch(J,allcount,idnamebef,stabid)
{
	var xjwaitInterval;
	
	var MouseDelayTime1=150;//鼠標感應延遲300毫秒
//
					var idstr=stabid;
					//alert (idstr);
					_gObj(idstr).onmouseout=function(aEvent)
					{	  				
					      //alert(idstr);
						  clearTimeout(xjwaitInterval);
						  //alert(xjwaitInterval);
				    }
			    	clearTimeout(xjwaitInterval);
					
					var str="selectTabsearch1("+J+","+allcount+",'"+idnamebef+"')";
					//alert(str);					
					xjwaitInterval=setTimeout(str,MouseDelayTime1);
	
	
}

function selectTabsearch1(J,allcount,idnamebef)
{
		selectTabsearch2(J,allcount,idnamebef)
}

function selectTabsearch2(J,allcount,idnamebef)
{
	//alert(J);
	for(var i=1;i<=allcount;i++)
	{
		if(J==i)
		{
			_gObj(idnamebef+i).style.display="block";
		}
		else
		{
			_gObj(idnamebef+i).style.display="none";
		}
		
	}
	
}
