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.display = "block"; 
}

function applications_hide()
{
	document.getElementById('applicationdropdown').style.display = "none"; 
}

var defaultvalue1 = "Please enter keywords"; 
var defaultvalue2 = "Product Search"; 

function check_search()
{

	if(document.form_search.keywords.value == "" || document.form_search.keywords.value == defaultvalue1 || document.form_search.keywords.value == defaultvalue2)
	{ document.form_search.keywords.value = defaultvalue1; }
	else
	{ location.href = "http://www.grosvenorfabrications.co.uk/search.php?keywords=" + document.form_search.keywords.value; }

}

function check_keywords()
{

	if(document.form_search.keywords.value == defaultvalue1 || document.form_search.keywords.value == defaultvalue2)
	{ document.form_search.keywords.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 iebody=(document.compatMode && document.compatMode != "BackCompat")? document.documentElement : document.body; 
	var dsocleft=document.all? iebody.scrollLeft : pageXOffset; 
	var dsoctop=document.all? iebody.scrollTop : pageYOffset; 

   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+dsoctop + "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";
}
