function mOvr(src,clrOver,mensaje) {
	src.style.cursor = 'pointer';
	src.bgColor = clrOver;
    window.status=mensaje;
  }

function mOvr2(source,mensaje) {
	source.style.cursor = 'pointer';
	imagen = new Image();
	imagen
    window.status=mensaje;
  }

function mOut(src,clrIn) {
	src.style.cursor = 'default';
	src.bgColor = clrIn;
    window.status='Consorcio Promoción del Ovino';
  }
  
function mClk(src) {
 	  src.children.tags('A')[0].click();
   }
  
function dirigelinkFoto( pagina ) {
      
           window.open(pagina, '_blank', menubar='no');

     }

function dirigelinkLey( pagina ) {
      
        window.open(pagina, '_blank', 'menubar=no, location=no');

     }

function dirigelinkNoticia( pagina ) {
      
           window.open(pagina, '_blank', 'width=600,height=560 menubar=no');

     }

function dirigelinkInforme( ) {
      
           window.open('../informes/informe.pdf', '_blank');

     }

function dirigelinkEvento( pagina ) {
      
           window.open(pagina, '_blank', 'width=600,height=560 menubar=no');

     }

function dirigelinkBaja(pagina) {
           window.open(pagina, '_blank', 'width=370,height=200, menubar=no');			   
		   }
function dirigelinkAuth( pagina ) {
      
           window.open(pagina, '_blank', 'width=370,height=290, menubar=no');
  
     }

function dirigelink( pagina ) {
            parent.principal.location.href = pagina;
            return false;
   }

function dirigelinkPrecios( pagina ) {
        top.location.href=pagina;              
		return false;
   }

//Usuario
function dirigelinkNuevoUsuario() {
           location.href='./nuevoUsuario.php';
		   return false;
		   }

function dirigelinkBajaUsuario() {
           window.open('./eliminarUsuario.php', '_blank', 'width=370,height=200, menubar=no');			   
		   }		   

//Noticias
function dirigelinkNuevaNoticia() {
           location.href='./nuevaNoticia.php';
		   return false;
		   }

function dirigelinkBajaNoticia() {
           window.open('./eliminarNoticia.php', '_blank', 'width=370,height=200, menubar=no');			   
		   }		   

//Articulos
function dirigelinkNuevoArticulo() {
           location.href='./nuevoArticulo.php';
		   return false;
		   }

function dirigelinkBajaArticulo() {
           window.open('./eliminarArticulo.php', '_blank', 'width=370,height=200, menubar=no');			   
		   }		   
//Legislacion
function dirigelinkNuevaLegislacion() {
           location.href='./nuevaLegislacion.php';
		   return false;
		   }

function dirigelinkBajaLegislacion() {
           window.open('./eliminarLegislacion.php', '_blank', 'width=370,height=200, menubar=no');			   
		   }

//Legislacion
function dirigelinkNuevoMercado() {
           location.href='./nuevoMercado.php';
		   return false;
		   }

function dirigelinkBajaMercado() {
           window.open('./eliminarMercado.php', '_blank', 'width=370,height=200, menubar=no');			   
		   }
//IDI
function dirigelinkNuevoIdi() {
           location.href='./nuevoIdi.php';
		   return false;
		   }

function dirigelinkBajaIdi() {
           window.open('./eliminarIdi.php', '_blank', 'width=370,height=200, menubar=no');			   
		   }		   

//EVENTOS
function dirigelinkNuevoEvento() {
           location.href='./nuevoEvento.php';
		   return false;
		   }

function dirigelinkBajaEvento() {
           window.open('./eliminarEvento.php', '_blank', 'width=370,height=200, menubar=no');			   
		   }		  

//LECHE
function dirigelinkNuevaLeche() {
           location.href='./nuevoProducto.php';
		   return false;
		   }

function dirigelinkBajaLeche() {
           window.open('./eliminarProducto.php', '_blank', 'width=370,height=200, menubar=no');			   
		   }		  

function dirigelinkBajaPedido() {
           window.open('./eliminarPedido.php', '_blank', 'width=370,height=200, menubar=no');			   
		   }		  
		   
function dirigelinkArticulos() {
           location.href='./indexa.php';
		   return false;
   }
function dirigelinkIdi() {
           location.href='./indexi.php';
		   return false;
   }
function dirigelinkIni() {
           location.href='./index.php';
		   return false;
   }

/* Creamos la función */
function AgregarFavoritos(Titulo,URL) {
/* Condición para el navegador Firefox */
if (navigator.appName=="Netscape") {
/* Agrega la página a favoritos y asigna un título al enlace */
	window.sidebar.addPanel(Titulo,URL,""); 
}
/* Condición para el navegador IE */
if (navigator.appName=="Microsoft Internet Explorer"){
/* Agrega la página a favoritos y asigna un título al enlace */
	window.external.AddFavorite(URL,Titulo);
}
}//funcion

var embeddedContent = 
{

	isMSIE : (document.all && !window.opera) ? true : false,
	
	
	/**
	 * Reinserta en el documento HTML los elementos que han sido incrustados mediante
	 * las etiquetas OBJECT, EMBED y/o APPLET, redefiniendo su propiedad outerHTML
	 */
	reinsertContent : function()
	{	
	var totalNodes = new Array(3);
		totalNodes['OBJECT'] = document.getElementsByTagName('OBJECT').length;
		totalNodes['EMBED'] = document.getElementsByTagName('EMBED').length;
		totalNodes['APPLET'] = document.getElementsByTagName('APPLET').length;
		for(var tagName in totalNodes)
		{
			var counter = totalNodes[tagName] - 1;
			for(var node; node = document.getElementsByTagName(tagName)[counter]; counter--)
			{
				sourceCode = embeddedContent.getSourceCode(node);
				if(sourceCode)
				{
					node.outerHTML = sourceCode;
				}
			}
		}
		embeddedContent.isMSIE = null;
	},
	
	
	/**
	 * Obtiene el código HTML completo de un determinado nodo.
	 * @param	node (object) - El nodo analizado
	 * @return	sourceCode (string) - El código HTML obtenido
	 */
	getSourceCode : function(node)
	{
		var sourceCode = node.outerHTML;
		switch(node.nodeName)
		{
			case 'EMBED':
				return sourceCode;
			break;
			case 'OBJECT':
			case 'APPLET':
				var openTag = sourceCode.substr(0, sourceCode.indexOf('>') + 1).toLowerCase();
				var closeTag = sourceCode.substr(sourceCode.length - 9).toLowerCase();
				if(closeTag != '</object>' && closeTag != '</applet>')
				{
					/* Si el nodo está mal formado (etiquetas de apertura y cierre) se debe 
					anular el script ya que podría devolver un resultado incorrecto */
					return null;
				}
				if(embeddedContent.isMSIE)
				{
					/* Para I. Explorer se debe obtener aparte el código HTML de los nodos hijos,
					ya que la propiedad outerHTML en ocasiones devolverá un resultado incompleto */
					var innerCode = embeddedContent.getInnerCode(node);
					sourceCode = openTag + innerCode + closeTag;
				}
				return sourceCode;
			break;
		}
	},
	
	
	/**
	 * Obtiene el código HTML de los nodos hijos de un determinado nodo. No se debe utilizar directamente
	 * la propiedad innerHTML ya que en ciertos casos I. Explorer devolverá un resultado incompleto.
	 * @param	node (object) - El nodo padre que será analizado
	 * @return	innerCode (string) - El código HTML obtenido
	 */
	getInnerCode : function(node)
	{
		var innerCode = '';
		var totalChilds = node.childNodes.length - 1;
		for(var counter = totalChilds, child; child = node.childNodes[counter]; counter--)
		{
			innerCode += child.outerHTML;
		}
		return innerCode;
	}
	
}


/**
 * Activación:
 * -----------
 * Detectamos el soporte de attachEvent() como filtro para I. Explorer y Ópera.
 * Para ejecutar el script sólo necesitamos que el DOM (Document Object Model); para
 * ello en Ópera recurrimos al evento DOMContentLoaded, mientras que en I. Explorer
 * emulamos dicho evento apoyándonos en el atributo DEFER de la etiqueta SCRIPT
 * con la que estamos cargando este archivo.
 */
if(document.attachEvent)
{
	if(window.opera)
	{
		document.attachEvent("DOMContentLoaded", embeddedContent.reinsertContent);
	}
	else
	{
		embeddedContent.reinsertContent();
	}
}


function cerrarVentana()
{
window.open('','_parent','');
window.close();
}








