	var oLastBtn=0;
	function RaiseButton(){
		window.event.cancelBubble=true;
		oBtn = window.event.srcElement;
		var bChosen = false;
		if(oLastBtn && oLastBtn != oBtn){
			HideButton();
		}
		if(oBtn.buttonType){
			oBtn.className = oBtn.buttonType + "Up";
			oLastBtn=oBtn;
			}
		else {
		oLastBtn = 0;
		}
	}
	function DepressButton(){
		window.event.cancelBubble=true;
		oBtn = window.event.srcElement;
		if(oBtn.buttonType){
			oBtn.className = oBtn.buttonType + "Down";
		}
	}
	function HideButton(){
		if ((oLastBtn.buttonType == "LeftNavChosen") || (oLastBtn.buttonType == "LeftNavSubChosen") || (oLastBtn.buttonType == "appNavChosen") || (oLastBtn.buttonType == "appNavSubChosen")) {
			oLastBtn.className = oLastBtn.buttonType;
		}
		else {
		
			if ((oLastBtn.buttonType == "ToolNavChosen") || (oLastBtn.buttonType == "ToolNavSubChosen") || (oLastBtn.buttonType == "appNavChosen") || (oLastBtn.buttonType == "appNavSubChosen")) 
			{
				
				oLastBtn.className = oLastBtn.buttonType;
				
			}
			else
				
				oLastBtn.className = oLastBtn.buttonType + "Off";
				
		}
	}

	function trim ( strTexto )
	{

		var cont = 0, strNuevo = "", strVerifica;

		strVerifica = strTexto;

		while ( cont < strVerifica.length )
		{

			if ( strVerifica.substring ( cont, cont + 1 ) != " " )
			{

				strNuevo += strVerifica.substring ( cont, cont + 1 );

			}

			cont++;

		}

		return strNuevo;

	}

	function FilterNum()
	{

		
		keycode = window.event.keyCode;
			
		if( !( keycode >= 48 && keycode <= 57 ) )
		{
				window.event.returnValue = false;
		}		

	}

	function FilterFecha()
	{
	
		keycode = window.event.keyCode;
			
		if( !( keycode >= 48 && keycode <= 57 ) && ( keycode != 47 ) )
		{
			
			window.event.returnValue = false;

		}		
		
	}
	
	function FilterDinero()
	{

		
		keycode = window.event.keyCode;
			
		if( !( keycode >= 48 && keycode <= 57 ) && ( keycode != 46 ) )
		{
				window.event.returnValue = false;
		}		

	}
		
	var iPosicionX, iPosicionY;

	if (window.captureEvents) {
		window.captureEvents(Event.MOUSEUP);
		window.onmousemove = mouseTracker;
	} else {
		document.onmousemove = mouseTracker;
	}

	function mouseTracker ( eElement )
	{

		eElement = eElement || window.Event || window.event;
		//Con esto logramos que la posicion del elemento se justo donde se encuentra el objeto
		iPosicionX = 50;
		iPosicionY = eElement.pageY || eElement.clientY;
		iPosicionY += 12;

	}
	
	function fnBuscar()
	{
		if(trim(document.all.txtBusqueda.value)=="")
		{
			alert("Escriba el texto a buscar.");
		}
		else
		{
			location.href="Busqueda.aspx?busca=" + document.all.txtBusqueda.value;
		}
	}
	
	function fnImageClient(oImage,bON)
	{
		if(bON)
		{
			oImage.src='Images/Client/' + oImage.id + 'B.jpg';
		}
		else
		{
			oImage.src='Images/Client/' + oImage.id + '.jpg';
		}
	}
