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 = "Please enter keywords"; 

function check_search()
{

	if(document.form_search.keywords.value == "" || document.form_search.keywords.value == defaultvalue)
	{ document.form_search.keywords.value = defaultvalue; }
	else
	{ location.href = "search.php?keywords=" + document.form_search.keywords.value; }

}

function check_keywords()
{

	if(document.form_search.keywords.value == defaultvalue)
	{ 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 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";
}