
function FP_changeProp() {//v1.0
 var args=arguments,d=document,i,j,id=args[0],o=FP_getObjectByID(id),s,ao,v,x;
 d.$cpe=new Array(); if(o) for(i=2; i<args.length; i+=2) { v=args[i+1]; s="o"; 
 ao=args[i].split("."); for(j=0; j<ao.length; j++) { s+="."+ao[j]; if(null==eval(s)) { 
  s=null; break; } } x=new Object; x.o=o; x.n=new Array(); x.v=new Array();
 x.n[x.n.length]=s; eval("x.v[x.v.length]="+s); d.$cpe[d.$cpe.length]=x;
 if(s) eval(s+"=v"); }
}

function FP_getObjectByID(id,o) {//v1.0
 var c,el,els,f,m,n; if(!o)o=document; if(o.getElementById) el=o.getElementById(id);
 else if(o.layers) c=o.layers; else if(o.all) el=o.all[id]; if(el) return el;
 if(o.id==id || o.name==id) return o; if(o.childNodes) c=o.childNodes; if(c)
 for(n=0; n<c.length; n++) { el=FP_getObjectByID(id,c[n]); if(el) return el; }
 f=o.forms; if(f) for(n=0; n<f.length; n++) { els=f[n].elements;
 for(m=0; m<els.length; m++){ el=FP_getObjectByID(id,els[n]); if(el) return el; } }
 return null;
}

function FP_changePropRestore() {//v1.0
 var d=document,x; if(d.$cpe) { for(i=0; i<d.$cpe.length; i++) { x=d.$cpe[i];
 if(x.v=="") x.v=""; eval("x."+x.n+"=x.v"); } d.$cpe=null; }
}




function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
function sbar(st){st.style.backgroundColor='#Fafafa';}
function cbar(st){st.style.backgroundColor='';}
var search_step_remark=0;
function SearchTrade(trade)
{
	var AREA1=document.all.area1;
	var AREA2=document.all.area2;
	window.open('search_trade.asp?trade='+trade+'&area1='+AREA1.value+'&area2='+AREA2.value,'_self')
	document.all.area1.selectedIndex=0;		
	document.all.area2.selectedIndex=0;
}
function SearchSub()
{
	var AREA1=document.all.area1;
	var AREA2=document.all.area2;
	var SKEY=document.all.skey;
	var AREASUB=document.all.subject;
	window.open('search_trade.asp?trade='+AREASUB.value+'&area1='+AREA1.value+'&area2='+AREA2.value+'&skey='+SKEY.value,'_self')
	document.all.area1.selectedIndex=0;		
	document.all.area2.selectedIndex=0;
}
function search_check0()
{
	if(document.all.keyword0.value!='' && document.all.keyword0.value!=document.all.keyword0.defaultValue)
		{
			window.open('search_kw.asp?keyword='+document.all.keyword0.value,'_self');
		}	
}
function search_check()
{
	//if(search_step.style.display=='block')
	//{
		if(document.all.area1.value!='' || document.all.keyword.value!='')
		{
			var area1=document.all.area1.value;
			var area2=document.all.area2.value;
			document.all.area1.selectedIndex=0;		
			document.all.area2.selectedIndex=0;
			window.open('search_kw.asp?area1='+ area1 +'&area2='+area2+'&keyword='+document.all.keyword.value,'_self');
		}
	//}
	else
	{
		if(document.all.keyword.value!='')
		{
			window.open('search_kw.asp?keyword='+document.all.keyword.value,'_self');
		}
	}
}
function search_check1(obj)
{
	var message=""
	if(obj.id_.value==''  || obj.id_.value=='-缄打逗┍, 缄打盝,缄打笴, 缄打璹┬, 缄打チ盝, 缄打パ︽, 缄打竊-')
	{
		message="缄打逗┍, 缄打盝,缄打笴, 缄打璹┬, 缄打チ盝, 缄打パ︽, 缄打竊 !\n";		
	}
	if(obj.password.value=='')
	{
		message=message+"缄打逗┍, 缄打盝,缄打笴, 缄打璹┬, 缄打チ盝, 缄打パ︽, 缄打竊 !";		
	}
	if(message!='')
	{
		alert(message);
		return false;
	}
	else
	{
		
		return true;
	}
}
function search_check2(obj)
{
	var message=""
	if(obj.id_.value==''  || obj.id_.value=='-缄打逗┍, 缄打盝,缄打笴, 缄打璹┬, 缄打チ盝, 缄打パ︽, 缄打竊-')
	{
		message="缄打逗┍, 缄打盝,缄打笴, 缄打璹┬, 缄打チ盝, 缄打パ︽, 缄打竊 !\n";		
	}
	else
	{
		var myid = obj.id_.value;
		var temp=0
		myid = myid.toUpperCase();
		id = myid;
		if(myid.length>10)
		temp=1;
		if(myid.length<10)
		temp=1;
		var c = myid.charAt(0);
		if(c<"A" || c> "Z")
		temp=1;
		c = myid.charAt(1);
		if(c!="1" && c!="2")
		temp=1;
		for(i=1;i<10;i++)
		if(isNaN(parseFloat(myid.charAt(i))))
		temp=1;
		var alph = new Array("A","B","C","D","E","F","G","H","J","K","L","M","N","P","Q","R","S","T","U","V","X","Y","W","Z","I","O");
		var num = new Array("10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31","32","33","34","35");
		var n=0;
		for(i=0;i<alph.length;i++)
		if(myid.charAt(0)==alph[i])
		n=i;
		var tot1 = parseFloat(num[n].charAt(0)) + (parseFloat(num[n].charAt(1)) * 9);
		var tot2 = 0;
		for(i=1;i<myid.length-1;i++)
		tot2 = tot2 + parseFloat(myid.charAt(i))*(9-i);
		var tot3 = parseFloat(myid.charAt(9));
		var tot4 = tot1 + tot2 + tot3;
		if((tot4 % 10)!=0)
		temp=1;
		if(temp==1){message=message+"缄打逗┍, 缄打盝,缄打笴, 缄打璹┬, 缄打チ盝, 缄打パ︽, 缄打竊 !\n";}
	}
	if(obj.password.value=='')
	{
		message=message+"缄打逗┍, 缄打盝,缄打笴, 缄打璹┬, 缄打チ盝, 缄打パ︽, 缄打竊 !";		
	}
	if(message!='')
	{
		alert(message);
		return false;
	}
	else
	{
		return true;
	}
}
function search_match(para)
{
	if(para!='')
	{
		window.open('search_kw.asp?keyword='+para,'_self');
	}
}
function search_matchcheck()
{
	//if(search_step.style.display=='block')
	//{
		if(document.all.areax.value!='' || document.all.xkeyword.value!='')
		{
			var areax=document.all.areax.value;
			var areay=document.all.areay.value;
			document.all.areax.selectedIndex=0;		
			document.all.areay.selectedIndex=0;
			window.open('search_kw.asp?area1='+ areax +'&area2='+areay+'&keyword='+document.all.xkeyword.value,'_self');
		}
	//}
	else
	{
		if(document.all.keyword.value!='')
		{
			window.open('search_kw.asp?keyword='+document.all.keyword.value,'_self');
		}
	}
}
function favority()
{
	if (navigator.appName!="Netscape")
	{
		window.external.AddFavorite("http://104net.com.tw","缄打逗┍, 缄打盝,缄打笴, 缄打璹┬, 缄打チ盝, 缄打パ︽, 缄打竊");
	}
	else
	{
		window.location = "http://104net.com.tw";
	}
}
//MoveBanner


function FP_changeProp() {//v1.0
 var args=arguments,d=document,i,j,id=args[0],o=FP_getObjectByID(id),s,ao,v,x;
 d.$cpe=new Array(); if(o) for(i=2; i<args.length; i+=2) { v=args[i+1]; s="o"; 
 ao=args[i].split("."); for(j=0; j<ao.length; j++) { s+="."+ao[j]; if(null==eval(s)) { 
  s=null; break; } } x=new Object; x.o=o; x.n=new Array(); x.v=new Array();
 x.n[x.n.length]=s; eval("x.v[x.v.length]="+s); d.$cpe[d.$cpe.length]=x;
 if(s) eval(s+"=v"); }
}

function FP_getObjectByID(id,o) {//v1.0
 var c,el,els,f,m,n; if(!o)o=document; if(o.getElementById) el=o.getElementById(id);
 else if(o.layers) c=o.layers; else if(o.all) el=o.all[id]; if(el) return el;
 if(o.id==id || o.name==id) return o; if(o.childNodes) c=o.childNodes; if(c)
 for(n=0; n<c.length; n++) { el=FP_getObjectByID(id,c[n]); if(el) return el; }
 f=o.forms; if(f) for(n=0; n<f.length; n++) { els=f[n].elements;
 for(m=0; m<els.length; m++){ el=FP_getObjectByID(id,els[n]); if(el) return el; } }
 return null;
}

function FP_changePropRestore() {//v1.0
 var d=document,x; if(d.$cpe) { for(i=0; i<d.$cpe.length; i++) { x=d.$cpe[i];
 if(x.v=="") x.v=""; eval("x."+x.n+"=x.v"); } d.$cpe=null; }
}
var LEFT=-280;
function MoveBanner()
{
	
	if(LEFT<0)
	{	LEFT+=10;
		document.all.layer1.style.left=LEFT;
	}
	else
	{document.all.layer2.style.visibility='visible';}
	setTimeout('MoveBanner()',1);
}
function check(obj)
{	
	var message=""
	if(obj.rname.value=='')
	{
		message="缄打逗┍, 缄打盝,缄打笴, 缄打璹┬, 缄打チ盝, 缄打パ︽, 缄打竊 !\n";
	}
	if(obj.tel.value=='')
	{//alert('aaa');
		message=message+"缄打逗┍, 缄打盝,缄打笴, 缄打璹┬, 缄打チ盝, 缄打パ︽, 缄打竊 ! \n";		
	}
	if(obj.trade.value=='')
	{
		message=message+"缄打逗┍, 缄打盝,缄打笴, 缄打璹┬, 缄打チ盝, 缄打パ︽, 缄打竊 !\n";
	}
	
	if(obj.addr2.value=='')
	{
		message=message+"叫块祅魁 ! \n";		
	}
	if(obj.addr1.value!='')
	{
		if(obj.addr1.value=='' )
		{
			message=message+"缄打逗┍, 缄打盝,缄打笴, 缄打璹┬, 缄打チ盝, 缄打パ︽, 缄打竊 ! \n";
		}
	}
	if(obj.cname.value=='')
	{
		message=message+"缄打逗┍, 缄打盝,缄打笴, 缄打璹┬, 缄打チ盝, 缄打パ︽, 缄打竊 !\n";
	}
	
	if(message!='')
	{
		alert(message);
		
	}
	else
	{
		if(confirm('缄打逗┍, 缄打盝,缄打笴, 缄打璹┬, 缄打チ盝, 缄打パ︽, 缄打竊!!'))
		{
			obj.action='banner_insert.asp?web=ok';
		}
		obj.submit();
		//FP_changeProp(/*id*/'layer1',1,'style.visibility','hidden');
		document.all.layer1.style.left=-280;
	}
}
function check2(obj)
{	
	var message=""	
	if(obj.name.value=='')
	{
		message=message+"缄打逗┍, 缄打盝,缄打笴, 缄打璹┬, 缄打チ盝, 缄打パ︽, 缄打竊 !\n";
	}
	if(obj.tel.value=='')
	{
		message=message+"缄打逗┍, 缄打盝,缄打笴, 缄打璹┬, 缄打チ盝, 缄打パ︽, 缄打竊 ! \n";		
	}
	if(obj.addr2.value=='')
	{
		message=message+"缄打逗┍, 缄打盝,缄打笴, 缄打璹┬, 缄打チ盝, 缄打パ︽, 缄打竊 ! \n";		
	}
	if(obj.addr2.value!='')
	{
		if(obj.addr1.value=='' )
		{
			message=message+"缄打逗┍, 缄打盝,缄打笴, 缄打璹┬, 缄打チ盝, 缄打パ︽, 缄打竊 ! \n";
		}
	}
	
	
	if(message!='')
	{
		alert(message);
		
	}
	else
	{
		obj.submit();
		FP_changeProp(/*id*/'layer1',1,'style.visibility','hidden')
	}
}

