function pop_window(url,width,height)
{ thewindow = window.open(url,'popped','width='+width+',height='+height+',toolbars=no,scrollbars=yes,copyhistory=yes,status=no'); }

function toggle(id)
{
	if (document.layers)
	{
		current = (document.layers[id].display == 'none') ? 'block' : 'none';
		document.layers[id].display = current;
	}
	else if (document.all)
	{
		current = (document.all[id].style.display == 'none') ? 'block' : 'none';
		document.all[id].style.display = current;
	}
	else if (document.getElementById)
	{
		vista = (document.getElementById(id).style.display == 'none') ? 'block' : 'none';
		document.getElementById(id).style.display = vista;
	}
}

function applications_show()
{

	document.getElementById('applicationdropdown').style.left = "0px"; 
	document.getElementById('applicationbutton').style.backgroundImage = "url(images/body_applicationbg_over.gif)"; 

}

function applications_hide()
{

	document.getElementById('applicationdropdown').style.left = "-2000px"; 
	document.getElementById('applicationbutton').style.backgroundImage = "url(images/body_applicationbg.gif)"; 

}

var defaultvalue = "By name"; 

function check_search()
{
	location.href = 
	"http://www.hadham.co.uk/search.php?unit_name=" + document.form_search.unit_name.value + 
	"&unit_status=" + document.form_search.unit_status.value + 
	"&unit_type=" + document.form_search.unit_type.value + 
	"&unit_size=" + document.form_search.unit_size.value + 
	"&search_posted=1"; 
}

function check_keywords()
{

	if(document.form_search.unit_name.value == defaultvalue)
	{ document.form_search.unit_name.value = ""; }

}


var xPos;
var yPos;

function showToolTip(id,imgid,evt){
    if (evt) {
        var url = evt.target;
    }
    else {
        evt = window.event;
        var url = evt.srcElement;
    }
    xPos = evt.clientX;
    yPos = evt.clientY;

   var toolTip = document.getElementById("toolTip");
   toolTip.innerHTML = "<img src='load_option_image.php?object_id="+id+"&amp;image_id="+imgid+"' border='0' alt=''>";
   toolTip.style.top = parseInt(yPos)+2 + "px";
   toolTip.style.left = parseInt(xPos)+2 + "px";
   toolTip.style.visibility = "visible";
   
}

function hideToolTip(){
   var toolTip = document.getElementById("toolTip");
   toolTip.innerHTML = "";
   toolTip.style.visibility = "hidden";
}


function set_content(id,content)
{ document.getElementById(id).innerHTML = content; }

var count = 0; 
function refresh_captcha()
{ 
document.getElementById('div_captcha').innerHTML = '<img src="captcha/generate.php?mode=refresh&count='+count+'" width="200" height="50" border="0" alt=""><br>'; 
count++; 
}
