var offsetfrommouse=[15,25];
var defaultimageheight = 500;	// maximum image size.
var defaultimagewidth = 500;	// maximum image size.






function truebody(){
return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}
function showimage(imagename,title,width,height)
	{
		//alert(imagename);
		//alert(width);
		//alert(height);
	var details=title.split("~");
	var subDet=details[0].split(":");
	//var subDet1=details[1].split(":");
	var subDet2=details[1].split(":");
	var subDet3=details[2].split(":");
	var subDet4=details[3].split(":");
	var subDet5=details[4].split(":");
	var subDet6=details[5].split(":");
	var subDet7=details[6].split(":");
	var subDet8=details[7].split(":");
	var subDet9=details[8].split(":");

	document.getElementById("preview_div").style.display='block';



newHTML = '<div class="border_preview"><table width="' + width + '" border="0" cellspacing="0" cellpadding="4" class="greytxt"><tr><td height="15" colspan="4" align="center" bgcolor="#FEFBEF" class="blu12 brdrbtm">';
	if(subDet[1]!='')
	{
	newHTML = newHTML +' '+subDet[0]+' '+'&nbsp;<span class="orange-txt"><b>'+subDet[1]+'</b></span></td></tr>';
	}
	if(subDet9[1]!='')
	{
	newHTML = newHTML +'<tr><td  width="10%" align="left" valign="top" class="bluetxtbld brdrbtm">County</td><td width="20%"  align="left" valign="top" class="brdrbtm">'+subDet2[1]+'</td><td  width="15%" align="left" valign="top" class="bluetxtbld brdrbtm">'+subDet9[0]+'</td><td width="20%"  align="left" valign="top">'+subDet9[1]+'</td></tr>';
	}
	//if(subDet1[1]!='')
	//{
	//newHTML = newHTML +' '+'<tr><td  width="15%" align="left" valign="top" class="bluetxtbld brdrbtm">'+subDet1[0]+'</td><td width="20%"  align="left" valign="top" class="brdrbtm">'+subDet1[1]+'</td><td  width="10%" align="left" valign="top" class="bluetxtbld brdrbtm">County</td><td width="20%"  align="left" valign="top" class="brdrbtm">'+subDet2[1]+'</td></tr>';
	//}	
	if(subDet3[1]!='')
	{
	newHTML = newHTML +'<tr><td  width="15%" align="left" valign="top" class="bluetxtbld brdrbtm">'+subDet3[0]+'</td><td width="20%"  align="left" valign="top" class="brdrbtm">'+subDet3[1]+'</td><td  width="10%" align="left" valign="top" class="bluetxtbld brdrbtm">'+subDet4[0]+'</td><td width="20%"  align="left" valign="top" class="brdrbtm">'+subDet4[1]+'</td></tr>';
	}	
	if(subDet5[1]!='')
	{
	newHTML = newHTML +'<tr><td  width="15%" align="left" valign="top" class="bluetxtbld brdrbtm">'+subDet5[0]+'</td><td width="20%"  align="left" valign="top" class="brdrbtm">'+subDet5[1]+'</td><td  width="10%" align="left" valign="top" class="bluetxtbld brdrbtm">'+subDet6[0]+'</td><td width="20%"  align="left" valign="top" class="brdrbtm">'+subDet6[1]+'</td></tr>';
	}	
	if(subDet7[1]!='')
	{
	newHTML = newHTML +'<tr><td  width="15%" align="left" valign="top" class="bluetxtbld brdrbtm">'+subDet7[0]+'</td><td width="20%"  align="left" valign="top" class="brdrbtm">'+subDet7[1]+'</td><td  width="10%" align="left" valign="top" class="bluetxtbld brdrbtm">'+subDet8[0]+'</td><td width="20%"  align="left" valign="top" class="brdrbtm">'+subDet8[1]+'</td></tr>';
	}	
	
	newHTML = newHTML +'<tr><td colspan="2">&nbsp;</td></tr></table>';
	
	document.getElementById("preview_div").innerHTML=newHTML;

	if(imagename!='')
		{
		newHTML = newHTML + '<div class="preview_temp_load"> <img  src="' + imagename + '" class="border" width="' + width + '" height="' + height + '"></div>';
		}
	newHTML = newHTML + '</div>';

	 //alert(newHTML);
	//document.onmousemove=followmouse; 
	
	document.getElementById("preview_div").innerHTML=newHTML;
	}
function hideImage()
	{
	document.getElementById("preview_div").style.display='none';
	propertyId_hover='';
	}

//function remove_loading() 
//	{
//	var targelem = document.getElementById('loader_container');
//	targelem.style.display='none';
//	targelem.style.visibility='hidden';
//	}

function followmouse(e){
  if (document.getElementById("preview_div"))
	{
	var xcoord=offsetfrommouse[0];
	var ycoord=offsetfrommouse[1];

	var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-10;
	var docheight=document.all? Math.min(truebody().scrollHeight, truebody().clientHeight) : Math.min(window.innerHeight);

	if (typeof e != "undefined"){
		if (docwidth - e.pageX < defaultimagewidth + 2*offsetfrommouse[0]){
			xcoord = e.pageX - xcoord - defaultimagewidth; // Move to the left side of the cursor
		} else {
			xcoord += e.pageX;
		}
		if (docheight - e.pageY < defaultimageheight + 2*offsetfrommouse[1]){
			ycoord += e.pageY - Math.max(0,(2*offsetfrommouse[1] + defaultimageheight + e.pageY - docheight - truebody().scrollTop));
		} else {
			ycoord += e.pageY;
		}

	} else if (typeof window.event != "undefined"){
		if (docwidth - event.clientX < defaultimagewidth + 2*offsetfrommouse[0]){
			xcoord = event.clientX + truebody().scrollLeft - xcoord - defaultimagewidth; // Move to the left side of the cursor
		} else {
			xcoord += truebody().scrollLeft+event.clientX
		}
		if (docheight - event.clientY < (defaultimageheight + 2*offsetfrommouse[1])){
			ycoord += event.clientY + truebody().scrollTop - Math.max(0,(2*offsetfrommouse[1] + defaultimageheight + event.clientY - docheight));
		} else {
			ycoord += truebody().scrollTop + event.clientY;
		}
	}
	document.getElementById("preview_div").style.left=xcoord+"px";
	document.getElementById("preview_div").style.top=ycoord+"px";
 }

}
document.onmousemove=followmouse; 