days= new Array("31", "28", "31", "30", "31", "30", "31", "31", "30", "31", "30", "31");
function dayschecking(which)
{
  fy = document.maid_registration_1[which + "Year"];
  fm = document.maid_registration_1[which + "Month"];
  fd = document.maid_registration_1[which + "Day"];
  yearid = fy.options.selectedIndex;
  monthid = fm.options.selectedIndex;
  dayid = fd.options.selectedIndex;
  dayno = parseInt(days[monthid]);
  if( parseInt(fy.options[yearid].value) % 400 == 0 || (parseInt(fy.options[yearid].value) % 100 != 0 && parseInt(fy.options[yearid].value) % 4 == 0) )
  {
    if(monthid ==  1)   dayno ++;
  }
  for(i = 0; i < dayno; i++) {
    fd.options[i] = new Option(i + 1);
    fd.options[i].value = i + 1;
  }
  if(dayid > dayno - 1)  dayid = dayno - 1;
  fd.options[dayid].selected = true;
  fd.length = dayno;
}

function MM_findObj(n, d) { //v4.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 && document.getElementById) x=document.getElementById(n); return x;
}

function submenu() { //v3.0
  var i,p,v,obj,args=submenu.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_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_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 openVideo(video,title,size){
  videoWin = window.open("/hk_c/movies/video.asp?video="+video+"&title="+title+"&size="+size,"videoWin","width=362,height=285");
	videoWin.focus();
}

function popup1(url){
popWin1 = window.open(url,"popWin1","width=410,height=480,scrollbars=1");
popWin1.focus();
}

function translate(file){
window.top.soundFrame.document.location = "translate.asp?wav="+file;
}

function textAni(el, x, y, a, b, c, s) { //v2.5 PVII
 var g,elo=el,f="",m=false,d="";x=parseInt(x);y=parseInt(y);
 var t = 'g.p7Magic = setTimeout("textAni(\''+elo+'\','; 
 if ((g=MM_findObj(el))!=null) {d=(document.layers)?g:g.style;}else{return;}
 if (parseInt(s)>0) {eval(t+x+','+y+','+a+','+b+','+c+',0)",' + s+')');return;}
 var xx=(parseInt(d.left))?parseInt(d.left):0;
 var yy=(parseInt(d.top))?parseInt(d.top):0;
 if(parseInt(c)==1) {x+=xx;y+=yy;m=true;c=0;}
 else if (c==2) {m=false;clearTimeout(g.p7Magic);}
 else {var i=parseInt(a);
  if (eval(g.moved)){clearTimeout(g.p7Magic);}
  if (xx<x){xx+=i;m=true;if(xx>x){xx=x;}}
  if (xx>x){xx-=i;m=true;if(xx<x){xx=x;}}
  if (yy<y){yy+=i;m=true;if(yy>y){yy=y;}}
  if (yy>y){yy-=i;m=true;if(yy<y){yy=y;}}}
 if (m) {if((navigator.appName=="Netscape") && parseInt(navigator.appVersion)>4){
    xx+="px";yy+="px";}
  d.left=xx;d.top=yy;g.moved=true;eval(t+x+','+y+','+a+','+b+','+c+',0)",'+b+')');
  }else {g.moved=false;}
}

function forget_contract_password(){
contract_pass_win = window.open("/hk_c/maids/forget_password.html","contract_pass_win","width=400,height=180");
contract_pass_win.focus();
}

function disclaimer(){
disclaimer_win = window.open("/hk_c/disclaimer/disclaimer.html","disclaimer_win","width=540,height=420,scrollbars=1");
disclaimer_win.focus();
}

function terms(){
disclaimer_win = window.open("/hk_c/disclaimer/terms.html","disclaimer_win","width=540,height=420,scrollbars=1");
disclaimer_win.focus();
}

function rPrint(id, lang){
recipe_win = window.open("/hk_c/assistance/recipe/print_recipe.asp?id=" + id + "&lang=" + lang,"recipe_win","width=640,height=420,scrollbars=1,menubar=1");
recipe_win.focus();
}

// for Maids Search 
function select_age(selObj){
	selIndex = selObj.selectedIndex
	selAge = selObj.options[selIndex].value;
	if (selAge == '' || selAge == '36'){
		document.sForm.age2.selectedIndex=0;
		document.sForm.age2.disabled = true;
	} else {
		if (document.sForm.age2.selectedIndex < selIndex)
			document.sForm.age2.selectedIndex=selIndex;
		document.sForm.age2.disabled = false;
	}

}

function check_age(selObj){
	selIndex = selObj.selectedIndex
	if (document.sForm.age1.selectedIndex > selIndex)
		document.sForm.age2.selectedIndex=document.sForm.age1.selectedIndex;
}

function change_wp1(selObj){
	selIndex = selObj.selectedIndex;
	if (selIndex == '0'){
		document.sForm.wp2.selectedIndex=0;
		document.sForm.wp2.disabled = true;
		document.sForm.wp3.selectedIndex=0;
		document.sForm.wp3.disabled = true;
		document.sForm.wp4.selectedIndex=0;
		document.sForm.wp4.disabled = true;
		document.sForm.wp5.selectedIndex=0;
		document.sForm.wp5.disabled = true;
	} else {
		if (document.sForm.wp2.selectedIndex == selIndex)
			document.sForm.wp2.selectedIndex=0;
		if (document.sForm.wp3.selectedIndex == selIndex)
			document.sForm.wp3.selectedIndex=0;
		if (document.sForm.wp4.selectedIndex == selIndex)
			document.sForm.wp4.selectedIndex=0;
		if (document.sForm.wp5.selectedIndex == selIndex)
			document.sForm.wp5.selectedIndex=0;
		document.sForm.wp2.disabled = false;
	}
}

function change_wp2(selObj){
	selIndex = selObj.selectedIndex;
	if (selIndex == '0'){
		document.sForm.wp3.selectedIndex=0;
		document.sForm.wp3.disabled = true;
		document.sForm.wp4.selectedIndex=0;
		document.sForm.wp4.disabled = true;
		document.sForm.wp5.selectedIndex=0;
		document.sForm.wp5.disabled = true;
	} else {
		if (document.sForm.wp1.selectedIndex == selIndex)
			document.sForm.wp2.selectedIndex=0;
		if (document.sForm.wp3.selectedIndex == selIndex)
			document.sForm.wp3.selectedIndex=0;
		if (document.sForm.wp4.selectedIndex == selIndex)
			document.sForm.wp4.selectedIndex=0;
		if (document.sForm.wp5.selectedIndex == selIndex)
			document.sForm.wp5.selectedIndex=0;
		document.sForm.wp3.disabled = false;
	}
}

function change_wp3(selObj){
	selIndex = selObj.selectedIndex;
	if (selIndex == '0'){
		document.sForm.wp4.selectedIndex=0;
		document.sForm.wp4.disabled = true;
		document.sForm.wp5.selectedIndex=0;
		document.sForm.wp5.disabled = true;
	} else {
		if (document.sForm.wp1.selectedIndex == selIndex)
			document.sForm.wp3.selectedIndex=0;
		if (document.sForm.wp2.selectedIndex == selIndex)
			document.sForm.wp3.selectedIndex=0;
		if (document.sForm.wp4.selectedIndex == selIndex)
			document.sForm.wp4.selectedIndex=0;
		if (document.sForm.wp5.selectedIndex == selIndex)
			document.sForm.wp5.selectedIndex=0;
		document.sForm.wp4.disabled = false;
	}
}

function change_wp4(selObj){
	selIndex = selObj.selectedIndex;
	if (selIndex == '0'){
		document.sForm.wp5.selectedIndex=0;
		document.sForm.wp5.disabled = true;
	} else {
		if (document.sForm.wp1.selectedIndex == selIndex)
			document.sForm.wp4.selectedIndex=0;
		if (document.sForm.wp2.selectedIndex == selIndex)
			document.sForm.wp4.selectedIndex=0;
		if (document.sForm.wp3.selectedIndex == selIndex)
			document.sForm.wp4.selectedIndex=0;
		if (document.sForm.wp5.selectedIndex == selIndex)
			document.sForm.wp5.selectedIndex=0;
		document.sForm.wp5.disabled = false;
	}
}

function change_wp5(selObj){
	selIndex = selObj.selectedIndex;
		if (document.sForm.wp1.selectedIndex == selIndex)
			document.sForm.wp5.selectedIndex=0;
		if (document.sForm.wp2.selectedIndex == selIndex)
			document.sForm.wp5.selectedIndex=0;
		if (document.sForm.wp3.selectedIndex == selIndex)
			document.sForm.wp5.selectedIndex=0;
		if (document.sForm.wp4.selectedIndex == selIndex)
			document.sForm.wp5.selectedIndex=0;
}
// end for Maids Search

// Home page pop up promotion
function promotion(URL) {
	proWin = window.open(URL, "proWin", "width=580,height=450");
	proWin.focus();
}