String.prototype.trim = function() {
	return this.replace(/^\s+|\s+$/g,"");
}
function GV(lpC){
	var a="";a=document.getElementById(lpC).value;	
	return a.trim();
}
function ParseUrl(lpCmd,lpP1,lpP2,lpP3,lpP4,lpP5,lpP6,lpP7,lpP8,lpP9){
	lpUrl="ajf.php?C="+lpCmd;
	if(lpP1== undefined)lpP1="";if(lpP2== undefined)lpP2="";
	if(lpP3== undefined)lpP3="";if(lpP4== undefined)lpP4="";
	if(lpP5== undefined)lpP5="";if(lpP6== undefined)lpP6="";
	if(lpP7== undefined)lpP7="";if(lpP8== undefined)lpP8="";
	if(lpP9== undefined)lpP9="";
	if(lpP1.length>0)lpP1=document.getElementById(lpP1).value;
	if(lpP2.length>0)lpP2=document.getElementById(lpP2).value;
	if(lpP3.length>0)lpP3=document.getElementById(lpP3).value;
	if(lpP4.length>0)lpP4=document.getElementById(lpP4).value;
	if(lpP5.length>0)lpP5=document.getElementById(lpP5).value;
	if(lpP6.length>0)lpP6=document.getElementById(lpP6).value;
	if(lpP7.length>0)lpP7=document.getElementById(lpP7).value;
	if(lpP8.length>0)lpP8=document.getElementById(lpP8).value;
	if(lpP9.length>0)lpP9=document.getElementById(lpP9).value;	
	lpP1=lpP1.replace(" ","%20");
	lpP2=lpP2.replace(" ","%20");lpP3=lpP3.replace(" ","%20");
	lpP4=lpP4.replace(" ","%20");lpP5=lpP5.replace(" ","%20");
	lpP6=lpP6.replace(" ","%20");lpP7=lpP7.replace(" ","%20");
	lpP8=lpP8.replace(" ","%20");lpP9=lpP9.replace(" ","%20");
	lpUrl=lpUrl+"&P1="+lpP1+"&P2="+lpP2+"&P3="+lpP3+"&P4="+lpP4+"&P5="+lpP5+"&P6="+lpP6+"&P7="+lpP7+"&P8="+lpP8+"&P9="+lpP9;
	return lpUrl;
}
function AJF(lpDiv,lpCmd,lpP1,lpP2,lpP3,lpP4,lpP5,lpP6,lpP7,lpP8,lpP9){
	lpUrl=ParseUrl(lpCmd,lpP1,lpP2,lpP3,lpP4,lpP5,lpP6,lpP7,lpP8,lpP9);	
	DivArea = document.getElementById(lpDiv);
	DivArea.style.visibility="hidden";	
	StrDatos="";
	ajax=CreateAJAX();
	ajax.open("GET",lpUrl);	
	ajax.onreadystatechange=function() {
		   if (ajax.readyState==4) {
					var StrDatos=ajax.responseText;					
					if(StrDatos.trim().length>0){			  
					    DivArea.innerHTML = StrDatos;
						DivArea.style.visibility="visible";
					}else{
						DivArea.style.visibility="visible";
					}
		   }
	}
	ajax.send(null);	
}
//**************************************************************************

