function openwin(url,w,h){
	if(w>screen.width) w=screen.width-20;
	if(h>screen.height) h=screen.height-80;
	l=(screen.width-w)/2;
	t=(screen.height-h)/2;
	feat="width="+w+",height="+h+",top="+t+",left="+l+",statusbar=no,scrollbars=yes,menubar=no,resizable=yes";
	w1=window.open(url,'',feat);
}

function decodem(txt){
	var orig="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890_-.@";
	var dest="bcqNdghT1YUV2Xi9jaQklm0LpJDr@stKuv6734wx_yzABCE.FGHMnIOPRSefWZ58-o";
	var out="";
	if(txt!=""){
		for(i=0;i<txt.length;i++){
			ind=orig.indexOf(txt.substring(i,i+1));
			if(ind!=-1) out+=dest.substring(ind,ind+1);
			else out+=txt.substring(i,i+1);
		}
	}
	return out;
}

function emailto(witch){
	document.location.href="mailto:"+decodem(witch);
}

function updtwhois(){
	document.forms[0].sld.value="";
	document.forms[0].action="whois.php?updt=1";
	document.forms[0].submit();
}

function solicitardominios(){
	document.forms[0].action="contactar.php?tipo=3&domain=1";
	document.forms[0].submit();	
}


function fflash(tsrc,w,h){
	document.write("<OBJECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' ");
	document.write("codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0' ");
	document.write("width='"+ w + "' height='"+ h + "' id='iflash' ALIGN='center'> ");
	document.write("<PARAM NAME=movie VALUE='" + tsrc + "'> <PARAM NAME=quality VALUE=high> <PARAM NAME=menu VALUE=false> ");
	document.write("<PARAM NAME=bgcolor VALUE=#FFFFFF> <EMBED src='" + tsrc + "' quality=high ");
	document.write("bgcolor=#FFFFFF  width='"+ w + "' height='"+ h + "' NAME='iflash' ALIGN='center' ");
	document.write("TYPE='application/x-shockwave-flash' menu='false' ");
	document.write("PLUGINSPAGE='http://www.macromedia.com/go/getflashplayer'></EMBED></OBJECT>");
}

function fcontac(cual){
	document.location.href="contactar.php?tipo="+cual;
}

function fenvio(){
	document.forms[0].action="contactar.php?action=envio";
	document.forms[0].submit();
}

function refwhois(){
	document.location.href="whois.php";
}

function clisalir(){
	if(confirm("¿Desea cerrar la sesión y salir de la extranet de cliente?")){
		document.location.href="clientes.php?salir=1";
	}
}

function fTrOver(tr) {
	if (tr) {
		var tds=tr.getElementsByTagName("td");
		if (tds){
			var i=0;
			for (;i<tds.length;i++) {
				if (tds[i].parentNode==tr) {
					tds[i].className="tdover";
				}
			}
		}
	}
}

function fTrOut(tr) {
	if (tr) {
		var tds=tr.getElementsByTagName("td");
		if (tds){
			var i=0;var idx=1;
			for(;i<tds.length;i++) {
				if (tds[i].parentNode==tr) {
					idx = i%2 ? 2 : 1;
					tds[i].className = "td_" + idx;
				}
			}
		}
	}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function showhide(capa,siempre){
	tmpcapa=MM_findObj(capa);
	if(tmpcapa.style.display=='none' || siempre){
		tmpcapa.style.display='';
	}
	else {
		tmpcapa.style.display='none';
	}
}