<!--
	function setMeasure(frameId) {
	  try
		{
		frame = document.getElementById(frameId);
		//alert (frameId);
		innerDoc = (frame.contentDocument) ? frame.contentDocument : frame.contentWindow.document;
		objToResize = (frame.style) ? frame.style : frame;
		objToResize.height = innerDoc.body.scrollHeight + 10;
	  }
		catch(err){
	  	window.status = err.message;
	  }

}

  function calcHeight(frameId)
	{
	//find the height of the internal page
	//var the_height=document.getElementById(frameId).contentWindow.document.body.scrollHeight;
	
	//change the height of the iframe
	//document.getElementById(frameId).height=the_height + 25;
  var h = 0;
  if(document.getElementById && !(document.all))
  {
    h = document.getElementById(frameId).contentDocument.height;
    document.getElementById(frameId).style.height = h + 60 + 'px';
  }
  else if(document.all)
       {
          h = document.frames(frameId).document.body.scrollHeight;
          document.getElementById(frameId).height = h + 20 + 'px';
        }
  }

  function handleQueryResponse() {    
	if (http.readyState == 4) { 
		  if(http.status==200) { 
			var results=http.responseText; 
			//alert(results);
      var searchvalue = document.getElementById('searchfield').value;
			//alert (searchvalue);
			document.getElementById('mainbody').src = 'searchquery.php?searchvalue=' + searchvalue;
			//document.getElementById('mainbody').innerHTML = results;
		  } 
	   } 
	} 

function ExecuteQuery(event) {      

    var inputKey =  event.keyCode;
    if (
				(inputKey == 33) || 
				(inputKey == 34) || 
				(inputKey == 35) || 
				(inputKey == 36) || 
				(inputKey == 37) || 
			  (inputKey == 38) || 
			  (inputKey == 39) || 
			  (inputKey == 40))
    {
      return;
    }

    var searchvalue = document.getElementById('searchfield').value;
	  if (searchvalue.length <= 1) {
		  return;
		};
		var param = "searchvalue=" + searchvalue;
		//alert (param);
		var url = "searchquery.php";
		http.open("POST", url, true); 
    http.setRequestHeader('Content-Type','application/x-www-form-urlencoded;charset=utf-8');
		http.onreadystatechange = handleQueryResponse; 
		http.send(param); 
	} 

  function ToDay () {
    var d=new Date();
    var day=d.getDate();
    var month=d.getMonth() + 1;
    var year=d.getFullYear();
		return year + "-" + month + "-" + day;
	}
	
function fromHTMLtoXML(val)
{
	val = val.replace(/&amp;/g,'%26'); 
	val = val.replace(/&lt;/g,'%3C');
	val = val.replace(/&gt;/g,'%3E');
	val = val.replace(/&nbsp;/g,'%20');
	val = val.replace(/&shy;/g,'%20');
	val = val.replace(/%/g,'%25'); 
	return val;
}

	function getHTTPObject() { 
	var xmlhttp; 

	if(window.XMLHttpRequest){ 
	  xmlhttp = new XMLHttpRequest(); 
	} 
	else if (window.ActiveXObject){ 
	  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); 
	  if (!xmlhttp){ 
		xmlhttp=new ActiveXObject("Msxml2.XMLHTTP"); 
	  } 
	} 
	return xmlhttp; 
	} 
	
var http = getHTTPObject(); // We create the HTTP Object 
