var gwin_directory = null;

var isNav4, isIE4;
if (parseInt(navigator.appVersion.charAt(0)) >= 4) {
	isNav4 = (navigator.appName == "Netscape") ? 1 : 0;
	isIE4 = (navigator.appName.indexOf("Microsoft") != -1) ? 1 : 0;
}
	function wpopup3(a,b,c){
		if(b == "directory"){
			lsleft = 10;
			lstop=280;
			feature="width=280,height=380,left="+lsleft+",top="+lstop+",toolbar=1,location=1,directories=1,status=1,menuBar=1,scrollBars=1,resizable=1";
			if(gwin_directory !=null && isIE4) gwin_directory.close();
			gwin_directory = window.open('redir.htm?'+escape(a),b,feature);
		}else{
			window.open('redir.htm?'+escape(a),b,c);
		}
	}

	function changeselecticon(i){
		switch(i){
			case '0':
				document.body.style.cursor = 'default';
				break;
			case '1':
				document.body.style.cursor = 'pointer';
				break;			
		}
	}
	
	function jsctmod1mo(ax,ay,a0,a1,a2,a31,a32,a33,a34,a41,a42,a51,a52,a61,a62,a71,a72, atype){
		atxt = "- ";
	
		if(atype == 'c'){
			if(a41 != "" && a42 != ""){
				atxt += "<a href=javascript:jsfreloadthis5(3,'"+a42+"',jsmcode2,'tr',0);>"+a41+"</a> > ";
			}
			else if(a41 != "" && a42 == ""){
				atxt += "<span class=\"ptgrey\">"+a41+"</span> > ";
			}
			if(a51 != "" && a52 != ""){
				atxt += "<a href=javascript:jsfreloadthis5(2,'"+a52+"',jsmcode2,'tr',0);>"+a51+"</a> > ";
			}
			else if(a51 != "" && a52 == ""){
				atxt += "<span class=\"ptgrey\">"+a51+"</span> > ";
			}
			if(a61 != "" && a62 != ""){
				atxt += "<a href=javascript:jsfreloadthis5(1,'"+a62+"',jsmcode2,'tr',0);>"+a61+"</a><br>";
			}
			else if(a61 != "" && a62 == ""){
				atxt += "<span class=\"ptgrey\">"+a61+"</span><br>";
			}
			if(a72 != ""){
				atxt += "- <a href=javascript:jsfreloadthis5(4,'"+a72+"', jsmcode2,'tr',0);>可相比樓宇組群成交及人口統計</a>";
			}		
		}
		else if(atype == ''){
			if(a41 != "" && a42 != ""){
				atxt += "<a href=javascript:jsfreloadthis4(3,'"+a42+"','tr',0);>"+a41+"</a> > ";
			}
			else if(a41 != "" && a42 == ""){
				atxt += "<span class=\"ptgrey\">"+a41+"</span> > ";
			}
			if(a51 != "" && a52 != ""){
				atxt += "<a href=javascript:jsfreloadthis4(2,'"+a52+"','tr',0);>"+a51+"</a> > ";
			}
			else if(a51 != "" && a52 == ""){
				atxt += "<span class=\"ptgrey\">"+a51+"</span> > ";
			}
			if(a61 != "" && a62 != ""){
				atxt += "<a href=javascript:jsfreloadthis4(1,'"+a62+"','tr',0);>"+a61+"</a><br>";
			}
			else if(a61 != "" && a62 == ""){
				atxt += "<span class=\"ptgrey\">"+a61+"</span><br>";
			}
			if(a72 != ""){
				atxt += "- <a href=javascript:(4,'"+a72+"','tr',0);>可相比樓宇組群成交及人口統計</a>";
			}		
		}
		if(atxt == ""){
			atxt += "<table border=0><tr><td width=\"33%\">";
		}
		else{
			atxt =  "<table border=0><tr><td colspan=3>" + atxt + "<hr>";
			atxt += "</td></tr><tr><td width=\"33%\">";
		}
		
		if(a0==1)atxt += "<img style=\"position:relative;top:3px\" src=\"pmast/img/pmasttr.gif\"> <a href=javascript:jsfreloadthis5(1,'"+a1+"','"+a2+"','trandetail',0);>成交詳情</a></td>";
		else	atxt += "<img style=\"position:relative;top:3px\" src=\"pmast/img/pmastnotr.gif\"><span style=\"color:'#d0d0d0'\"> 成交詳情</span></td>";
		atxt += "<td width=\"33%\"><img style=\"position:relative;top:3px\" src=\"pmast/img/pmastbasicinfo.gif\"> <a href=javascript:jsfreloadthis(1,'"+a1+"','basicinfo');>物業資料</a></td>";
		if(a31 != ''){
			atxt += "<td width=\"33%\"><img style=\"position:relative;top:3px\" src=\"img/ctmod1tablocation.gif\"> <a href=\"javascript:jsfwindowopen(100,100,800,600,'http://www.centamap.com/gc/home.aspx?x="+a31+"&y="+a32+"&z=3&ft3=cpal&source=data');\">屋苑位置</a></td></tr>";
		}
		else{
			atxt += "<td width=\"33%\"></td></tr>";
		}
		
		atxt += "<tr><td width=\"33%\"><img style=\"position:relative;top:3px\" src=\"pmast/img/pmastfp.gif\"> <a href=javascript:jsfreloadthis(1,'"+a1+"','fp');>平面圖</a></td>";
		if(a31 != ''){
			atxt += "<td width=\"33%\"><img style=\"position:relative;top:3px\" src=\"img/ctmod1taborient.gif\"> <a href=\"javascript:jsfwindowopen(100,100,800,600,'http://www.centamap.com/gc/home.aspx?x="+a31+"&y="+a32+"&z=2&ft3=cpal&source=data');\">單位座向</a></td> ";
			//atxt += "<td width=\"33%\"><img style=\"position:relative;top:3px\" src=\"img/ctmod1taborient.gif\"> <a href=\"javascript:jsfwindowopen(100,100,800,600,'http://www.centamap.com/gc/home.aspx?x="+a31+"&y="+a32+"&z=1&ft3=cpal&source=data');\">單位座向</a></td> ";
			//atxt += "<td width=\"33%\"><img style=\"position:relative;top:5px\" src=\"img/ctmod1tabgoogle.gif\"><a href=\"javascript:jsfwindowopen(100,100,800,600,'http://www.centamap.com/scripts/centamaptogoogle.asp?x="+a31+"&y="+a32+"&z=1');\">google衛星圖</a></td></tr>";
			atxt += "<td width=\"33%\"><img style=\"position:relative;top:5px\" src=\"img/ctmod1tabgoogle.gif\"><a href=\"javascript:jsfwindowopen(100,100,800,600,'http://www.centamap.com/gc/googlec.aspx?x="+a31+"&y="+a32+"&z=1&brtype=1&source=data');\">google衛星圖</a></td></tr>";
		}
		else{
			atxt += "<td width=\"66%\" colspan=\"2\"></td></tr>";
		}
		
		//By Leo 20091229
		if (a52 != '')
			atxt += "<tr><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"javascript:jsfwindowopen(0,0,1024,768,'/pih09/pih09/estate.aspx?type=2&code="+a52+"&ref=data');\">屋苑專頁</a></td></tr>";
		else
			atxt += "<tr><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"javascript:jsfwindowopen(0,0,1024,768,'/pih09/pih09/estate.aspx?type="+jsmtype+"&code="+jsmcode+"&ref=data');\">屋苑專頁</a></td></tr>";
		
		
		atxt += "</table>";
		
		jsheadermore2a(atxt,ax,ay);
	}	
	