function InStr(n,s1,s2){

		var numargs=InStr.arguments.length;

		if (numargs<3)
			return n.indexOf(s1);
		else
			return s1.indexOf(s2,n);
		}

		function RInStr(n,s1,s2){

		var numargs=RInStr.arguments.length;

		if (numargs<3){
			return n.lastIndexOf(s1);
			}
		else
			return s1.lastIndexOf(s2,n);
		}


		function Mid(s,n,c){
		var numargs=Mid.arguments.length;

		if (numargs<3)
			c=s.length-n+1;
									
		if (c<1)
			c=s.length-n+1;
		if (n+c > s.length)
			c=s.length-n+1;
		if (n>s.length)
			return "";
		return s.substring (n-1,n+c);
		}
function PonElementoMenuDerecho(texto,url,EsSeguro)
{
var total;
total = "";
total += "<tr>"total += "<td>"total += "    <img src='/elementos/nada.gif' width=5 height=0>"total += "</td>"total += "<td align='left'>"
total += "   <font class='menutext'><a href="
if (InStr(url,"javascript")==-1){
	if (InStr(url,"http://")==-1){		if (EsSeguro==true){
			total += "https://"
		}else{			total += "http://"
		}		total += document.domain
	}	
}total +=urltotal +=" class='menulink'>"+texto+"</a></font>"
total += "</td>"total += "</tr>"
						

document.write(total);
  
}
function PonElementoMenu(texto,url,EsSeguro)
{
var total;
total = "";
total += "<tr>"total += "<td width='16' align='center'>"total += "    <img src='/elementos/nada.gif' width=4 height=0><img height='12' width='9' src='/elementos/nuevo/fecha.gif'>"total += "</td>"total += "<td align='left' width=100>"
total += "    <font class='menutext'><a href="

if (InStr(url,"javascript")==-1){
	if (InStr(url,"http://")==-1){		if (EsSeguro==true){
			total += "https://"
		}else{			total += "http://"
		}		total += document.domain
	}
}total +=urltotal += " class='menulink' target='_parent'>"+texto+"</a></font>"
total += "</td>"total += "</tr>"
						

document.write(total);
  
}

function PonSeparador()
{
var total;
total = "";
total += "<tr>"total += "<td align='center' colspan='2'>"total += "    <center><img height='3' width='113' src='/elementos/nuevo/linea.gif'></center>"total += "</td>"
total += "</tr>"

document.write(total);
  
}							

function MenuShow(NumeroMenu)
{
	popUp("HM_Menu"+NumeroMenu,event);
	eval("flecha"+NumeroMenu+".src=\"/elementos/nuevo/flechainvertida.gif\"");
}

function MenuHide(NumeroMenu)
{
	popDown("HM_Menu"+NumeroMenu);
	eval("flecha"+NumeroMenu+".src=\"/elementos/nuevo/fecha.gif\"");
}

function PonElementoMenuConSubMenu(texto,link,submenu,EsSeguro)
{
var total;
total = "";
total += "<tr>"total += "<td width='16' align='center'>"total += "    <img src='/elementos/nada.gif' width=4 height=0><img height='12' width='9' src='/elementos/nuevo/fecha.gif' name='flecha"+submenu+"'>"total += "</td>"total += "<td align='left' width=100  onMouseOver=\"MenuShow("+submenu+")\" onMouseOut=\"MenuHide("+submenu+")\">"
total += "    <font class='menutext'><a href='"
if (link!=""){	if (EsSeguro==true){
		total += "https://"
	}else{		total += "http://"
	}

	total += document.domain	total +=link}
else{	total +="javascript:void(null);";
}total += "' class='menulink' target='_parent' onMouseOver=\"MenuShow("+submenu+")\" onMouseOut=\"MenuHide("+submenu+")\">"+texto+"</a></font>"
total += "</td>"total += "</tr>"
						

document.write(total);
  
}

function PonElmentoMenuSuperior(texto,url)
{
var total;
total = "";
total += "<td bgcolor=\"#9dca18\" width=\"102\" height=\"22\" align=\"center\" onmouseover=\"mOvr(this,'#e6f1bd','');\" onmouseout=\"mOut(this,'#9dca18');\"  onmouseclick=\"mClk('http://"+document.domain+url+"')\">"
total += "<font class=\"botonuptext\"><a href=\"http://"+document.domain+url+"\" class=\"botonuplink\" target=\"_parent\">"+texto+"</a></font></td>"document.write(total);
}

function mOvr(src,clrOver,pie) {
if (!src.contains(event.fromElement)) {
src.style.cursor = 'hand';
src.bgColor = clrOver;
window.status=pie;
}
}
function mOut(src,clrIn) {
if (!src.contains(event.toElement)) {
src.style.cursor = 'default';
src.bgColor = clrIn;
window.status='';
}
}
function mClk(src) {
/*if(event.srcElement.tagName=='TD'){
src.children.tags('A')[0].click();
}*/
//alert(src);
location.href=src;
}

function IrA(url)
{
	document.location.href="http://"+document.domain+url;
}

function AbrirQueDeseas()
{
	var wWidth = screen.width-10;
	var ventana = open("/quedesea/programas/que_deseas.asp","que_deseas","Left=0,Top=0,help=no,status=no,height=20,width="+wWidth+"");
	if(ventana!=null){
		ventana.focus();
	}
}
