function initArray()
{
	this.length=initArray.arguments.length;
	for(var i=0;i<this.length;i++)
	{
		this[i+1]=initArray.arguments[i];
	}
}

function Buildkey(num) {
	var ctr=1;
	document.CodeForm.subtype.selectedIndex=0;
	document.CodeForm.subtype.options[0]=new Option("請選擇服務項目...","#");
	/*
	定義二階選單內容
	if(num=="第一階下拉選單的值") {	document.CodeForm.subtype.options[ctr]=new Option("第二階下拉選單的顯示名稱","第二階下拉選單的值");	ctr=ctr+1;	}
	*/	
	/*台北*/  
	if(num=="1") {	document.CodeForm.subtype.options[ctr]=new Option("家事服務/居家照顧","service01.html");	ctr=ctr+1;	}
	if(num=="1") {	document.CodeForm.subtype.options[ctr]=new Option("家電維修/居家修繕","service02.html");	ctr=ctr+1;	}
	if(num=="1") {	document.CodeForm.subtype.options[ctr]=new Option("室內設計/居家布置","service03.html");	ctr=ctr+1;	}
	if(num=="1") {	document.CodeForm.subtype.options[ctr]=new Option("搬家","service04.html");	ctr=ctr+1;	}
	if(num=="1") {	document.CodeForm.subtype.options[ctr]=new Option("風水/命理","service05.html");	ctr=ctr+1;	}
	if(num=="1") {	document.CodeForm.subtype.options[ctr]=new Option("洗衣店","service06.html");	ctr=ctr+1;	}
	if(num=="1") {	document.CodeForm.subtype.options[ctr]=new Option("我要買/我要賣","service07.html");	ctr=ctr+1;	}
	if(num=="1") {	document.CodeForm.subtype.options[ctr]=new Option("環境保護/居家安全","service08.html");	ctr=ctr+1;	}
	if(num=="1") {	document.CodeForm.subtype.options[ctr]=new Option("做月子","service09.html");	ctr=ctr+1;	}
	if(num=="1") {	document.CodeForm.subtype.options[ctr]=new Option("外送服務","service10.html");	ctr=ctr+1;	}
	/*台中*/  
	if(num=="2") {	document.CodeForm.subtype.options[ctr]=new Option("家事服務/居家照顧","service01-1.html");	ctr=ctr+1;	}
	if(num=="2") {	document.CodeForm.subtype.options[ctr]=new Option("家電維修/居家修繕","service02-1.html");	ctr=ctr+1;	}
	if(num=="2") {	document.CodeForm.subtype.options[ctr]=new Option("室內設計/居家布置","service03-1.html");	ctr=ctr+1;	}
	if(num=="2") {	document.CodeForm.subtype.options[ctr]=new Option("搬家","service04-1.html");	ctr=ctr+1;	}
	if(num=="2") {	document.CodeForm.subtype.options[ctr]=new Option("風水/命理","service05-1.html");	ctr=ctr+1;	}
	if(num=="2") {	document.CodeForm.subtype.options[ctr]=new Option("洗衣店","service06-1.html");	ctr=ctr+1;	}
	if(num=="2") {	document.CodeForm.subtype.options[ctr]=new Option("我要買/我要賣","service07-1.html");	ctr=ctr+1;	}
	if(num=="2") {	document.CodeForm.subtype.options[ctr]=new Option("環境保護/居家安全","service08-1.html");	ctr=ctr+1;	}
	if(num=="2") {	document.CodeForm.subtype.options[ctr]=new Option("做月子","service09-1.html");	ctr=ctr+1;	}
	if(num=="2") {	document.CodeForm.subtype.options[ctr]=new Option("外送服務","service10-1.html");	ctr=ctr+1;	}
	/*高雄*/  
	if(num=="3") {	document.CodeForm.subtype.options[ctr]=new Option("家事服務/居家照顧","service01-2.html");	ctr=ctr+1;	}
	if(num=="3") {	document.CodeForm.subtype.options[ctr]=new Option("家電維修/居家修繕","service02-2.html");	ctr=ctr+1;	}
	if(num=="3") {	document.CodeForm.subtype.options[ctr]=new Option("室內設計/居家布置","service03-2.html");	ctr=ctr+1;	}
	if(num=="3") {	document.CodeForm.subtype.options[ctr]=new Option("搬家","service04-2.html");	ctr=ctr+1;	}
	if(num=="3") {	document.CodeForm.subtype.options[ctr]=new Option("風水/命理","service05-2.html");	ctr=ctr+1;	}
	if(num=="3") {	document.CodeForm.subtype.options[ctr]=new Option("洗衣店","service06-2.html");	ctr=ctr+1;	}
	if(num=="3") {	document.CodeForm.subtype.options[ctr]=new Option("我要買/我要賣","service07-2.html");	ctr=ctr+1;	}
	if(num=="3") {	document.CodeForm.subtype.options[ctr]=new Option("環境保護/居家安全","service08-2.html");	ctr=ctr+1;	}
	if(num=="3") {	document.CodeForm.subtype.options[ctr]=new Option("做月子","service09-2.html");	ctr=ctr+1;	}
	if(num=="3") {	document.CodeForm.subtype.options[ctr]=new Option("外送服務","service10-2.html");	ctr=ctr+1;	}
	document.CodeForm.subtype.length=ctr;
	document.CodeForm.subtype.options[0].selected=true;
}
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_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 MM_findObj(n, d) { //v3.0
  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_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];}
}

//service
function heartBeat()
{ 
	var diffY;
if (document.documentElement && document.documentElement.scrollTop)
    diffY = document.documentElement.scrollTop;
else if (document.body)
    diffY = document.body.scrollTop
else
    {/*Netscape stuff*/}
    
//alert(diffY);
percent=.1*(diffY-lastScrollY); 
if(percent>0)percent=Math.ceil(percent); 
else percent=Math.floor(percent); 
document.getElementById("lovexin12").style.top=parseInt(document.getElementById("lovexin12").style.top)+percent+"px";
document.getElementById("lovexin14").style.top=parseInt(document.getElementById("lovexin12").style.top)+percent+"px";

lastScrollY=lastScrollY+percent; 
//alert(lastScrollY);
}