var ROOTURL="http://www.homeletsproperty.co.uk/";

function picture_window($file_path,$width,$height,$title) {
   pic_window = window.open("","media","width="+$width+",height="+$height+",scrollbars=no,left=100,top=100");
   pic_window.document.open();
   pic_window.document.write('<html><head></head><title>'+$title+'</title><body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" onblur="javascript: self.close()">'); 
   pic_window.document.write('<img src=\"'+$file_path+'\" width='+$width+' height='+$height+' alt=\"'+$title+'\">');
   pic_window.document.write('</body></html>');
}
	
function roll_over(image_id,change_to) {
   var this_img=document.getElementById(image_id);
   this_img.src=change_to;
}

function hover_on(layer_id,change_to) {
   var this_layer=document.getElementById(layer_id);
   this_layer.style.backgroundColor=change_to;
}

var headerimg=2;
function change_header() {

$s=document.getElementById("headerimg");
if(headerimg==2) {
$s.src="img/header1.jpg";
headerimg=1;
} else {
$s.src="img/header2.jpg";
headerimg=2;
}

}

function preload() {

$i=new Image(761,192);
$i.src="img/header1.jpg";

}

function preload_images() {

var $image=new Array();
for($i=0; $i<arguments.length;$i++) {
   $image[$i]=new Image(400,300);
   $image[$i].src=arguments[$i];
}

}

function show_image($image_id,$prop_id,$w,$h) {

document.getElementById("pthumb").src='content/property/thumbs/'+$image_id+'-'+$prop_id+'.jpg';
$epath='content/property/large/'+$image_id+'-'+$prop_id+'.jpg';
$l=document.getElementById("enlargelink");
$new_onclick="picture_window('"+$epath+"',"+$w+","+$h+","+$image_id+")";
$l.href="javascript:picture_window('"+$epath+"',"+$w+","+$h+","+$image_id+");";

}

function show_def($def) {

$s=document.getElementById("def-"+$def).style;
if($s.display=="none" || !$s.display) {
   $s.display="block";
} else {
   $s.display="none";
}

}

function pshowimg($path) {

document.getElementById("plarge").src=$path;

}

function send_link($pid) {
   window.open(ROOTURL+"send_link.php?pid="+$pid,"send_link","width=280,height=480,scrollbars=yes,left=100,top=100");
}



var gAutoPrint = true; // Flag for whether or not to automatically call the print function

function printSpecial() {

if (document.getElementById != null) {

var html = '<HTML>\n<HEAD>\n';

if (document.getElementsByTagName != null) {
   var headTags = document.getElementsByTagName("head");
			if (headTags.length > 0)
				html += headTags[0].innerHTML;
		}
		
		html += '\n</HE' + 'AD>\n<BODY>\n';
		
		var printReadyElem = document.getElementById("maincontent");
		
		if (printReadyElem != null)
		{
				html += printReadyElem.innerHTML;
		}
		else
		{
			alert("Could not find the printReady section in the HTML");
			return;
		}
			
		html += '\n</BO' + 'DY>\n</HT' + 'ML>';
		
		var printWin = window.open("","printSpecial");
		printWin.document.open();
		printWin.document.write(html);
		printWin.document.close();
		if (gAutoPrint)
			printWin.print();
	}
	else
	{
		alert("Sorry, the print feature is only available in modern browsers.");
	}
}