//------------ Bibliography ---------
function tester(){
	alert("javaScript is alife !!");
	return false;
}
//---------------------------------------------------------------------
var xmlHttp;
/**
 * This function returns the xmlHttp object
 * Auther:Isam M. Abdelhameed
 */
function GetXmlHttpObject(){
	var xmlHttp=null;
	try{
  		// Firefox, Opera 8.0+, Safari
  		xmlHttp=new XMLHttpRequest();
  	}catch (e){
  		// Internet Explorer
  		try{
    		xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    	}catch (e){
    		xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    	}
  	}
	return xmlHttp;
}
//---------------------------------------------------------------------
function showList(str){
	if (str.length==0){ 
  		document.getElementById("listHints").innerHTML="";
  		return;
  	}
	//alert('before getting thexmlHttp object');
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null){
  		alert ("Your browser does not support AJAX!");
  		return;
  	} 
	var url="http://localhost:8080/documentManagment/dynaList";
	url=url+"?q="+str;
	//alert('url: ' + url);
	xmlHttp.onreadystatechange=listStateChanged;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
} 
//----------------------------------------------------------------------------------
function listStateChanged(){ 
	if (xmlHttp.readyState==4){ 
		document.getElementById("listHints").innerHTML=xmlHttp.responseText;
	}
}
//----------------------------------------------------------------------------------
/**
 * Set the hidden field method to its value
 */
function setMethod(value){
	document.forms[0].method.value=value;
}
//----------------------------------------------------------------------------------
function setfocus(){
	var textField=document.getElementById("searchBox");
	textField.focus();
	textField.value = textField.value;
}
//------------------------------------------------------------------------------------
function openVarable(url){
	//alert(url);
	
	features = 'toolbar=no,location=no,directories=no,status=no,menubar=no,' +
	           'scrollbars=yes,resizable=yes,copyhistory=no,'+
	           'width='+ (screen.width)/1.3 + 'px,' +
	           'height=' + (screen.height)/1.3 + 'px' + ',left=80,top=80'         
		           
	 window.open(url,"",features)
}
//--------------------------------------------------------------------------------------------