//
// Scripts especificos de la pagina de almocafre
//
function menuover(objeto){
	if(objeto.id.substr(5,1)!="<?php echo $ap1; ?>"){
		document.getElementById("menu"+objeto.id.substr(5,1)).src="_imagenes/cab_menu_d_"+objeto.id.substr(5,1)+".gif";
	}
}
function menuout(objeto){
	if(objeto.id.substr(5,1)!="<?php echo $ap1; ?>"){
		document.getElementById("menu"+objeto.id.substr(5,1)).src="_imagenes/cab_menu_c_"+objeto.id.substr(5,1)+".gif";
	}
}
function mdover(objeto){
	objeto.parentElement.className='opmenuderover';
}
function mdout(objeto){
	objeto.parentElement.className='opmenuder';
}

function IsNumeric(sText)
{
   var ValidChars = "0123456789.";
   var IsNumber=true;
   var Char;

 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
      }
   return IsNumber;
   
   }

   
//
//------------------------------------------
function agregar(titulo,url){
   if ((navigator.appName=="Microsoft Internet Explorer") && 
         (parseInt(navigator.appVersion)>=4)) {
      window.external.AddFavorite(url,titulo);
   } else { 
      if(navigator.appName == "Netscape") 
         alert("Presione Crtl+D para agregar este sitio en sus Bookmarks"); 
   }
} 

function cambiarImagen(destino,imagen)
{
		
	e = document.getElementById(destino);

    e.src = imagen;
	
}

//
//	AGL 2003-10-03
//	FUNCION QUE CAMBIA EL ESTILO DE UN OBJETO DE LA PAGINA
//
function cambiarEstilo(Id, Estilo)
{
	e = document.getElementById(Id)
	e.className = Estilo;
	
	}
	
function DoWindow(url,titulo,Ancho,Alto, Scroll) {

	//window.open(url);
	
	//return window.showModalDialog(url,titulo,"dialogheight:" + Alto +" px;dialogwidth:" + Ancho + " px;center:yes;edge:sunken;help:no;resizable:no;scroll:" + Scroll + ";status:no");
	AbreVentana(url,titulo,Ancho,Alto,0,0)	
//	AbreVentanaSeleccion(url,titulo)
}


//
//	ABRE UNA VENTANA PARA SELECCIONAR UN VALOR
//
function AbreVentanaSeleccion(url,creador)
{
	var win_opt="toolbar=0,location=0,directories=0,status=0,";
		win_opt += "menubar=0,scrollbars=1,resizable=0,copyhistory=0,";
		win_opt += "width="+ 500 +",Height="+650 + ",top=" + 0 + ",left=" + 0;
		
	newWindow = window.open("","",win_opt);
	newWindow.creator=creador;
	newWindow.document.location = url;


}
		
function AbreVentana(url,Title,Width,Height,top, left)
	{
		
		var htmlpage=" ";
	var win_opt="toolbar=0,location=0,directories=0,status=0,";
		win_opt += "menubar=0,scrollbars=0,resizable=0,copyhistory=0,";
		win_opt += "width="+ Width +",Height="+ Height + ",top=" + top + ",left=" + left;
				
		newWindow = window.open("","",win_opt);
		newWindow.creator=self;
		newWindow.document.title = Title;
		
		newWindow.document.location = url;
		
		return;
				
		
	}		

	function ponebrs(str)
	{
		
		while(str.indexOf('\n') != -1)
		{
			str = str.replace('\n','<br>');
		}
		
		return str;
		
	};


function navegar(url){
 	
	window.document.location = url;
	
 }