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 MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.title; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' debe ser un e-mail.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' debe ser un número.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' es obligatorio.\n'; }
  } if (errors) alert('por favor, revise lo siguiente:\n'+errors);
  document.MM_returnValue = (errors == '');
}


function recuclave()
{	me=document.getElementById('imel').value;
	if(me=="") {  alert('Por favor digite su email');  return false; }
	else
	{	filter=/^[A-Za-z][A-Za-z0-9_]*@[A-Za-z0-9_]+\.[A-Za-z0-9_.]+[A-za-z]$/;
		if (filter.test(me))
		{	document.location.replace('msg.php?o=e&e='+me);
		}
		else
		{	alert('Por favor digite correctamente su email');  return false;	}
	}
}

function helper(que)
{ document.write('<img src="imgs/help1.gif" align="absmiddle" border="0" onMouseover="showtip(this,event,\''+que+'\')" onMouseout="hidetip()">');
}

function showtip(current,e,text)
{  if (document.all||document.getElementById)
  {	thetitle=text.split('<br>')
    if (thetitle.length>1)
	{ thetitles=''
	  for (i=0;i<thetitle.length;i++)	thetitles+=thetitle[i]
	  current.title=thetitles
	}
	else	current.title=text
  }
  else if (document.layers)
  {	document.tooltip.document.write('<layer bgColor="white" style="border:1px solid black;font-size:12px;">'+text+'</layer>')
	document.tooltip.document.close()
	document.tooltip.left=e.pageX+5
	document.tooltip.top=e.pageY+5
	document.tooltip.visibility="show"
  }
}

function hidetip()
{ if (document.layers)  document.tooltip.visibility="hidden"
}

/*<div align="center" style="margin:0; padding:0;border:1px solid #a9a9a9; width:625px; height:96px">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="625" height="96">
<param name="movie" value="pauta/banner_melendez2.swf"><param name="quality" value="high">
<embed src="pauta/banner_melendez2.swf" width="625" height="96" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed>
</object></div>*/
function rotaban(me)
{	ancho="625";	alto="80"; 	
	if(me==0)
	{	var how_many_ads = 3; var banner; var now=new Date(); var sec=now.getSeconds(); var ad=sec%how_many_ads; ad +=1;	
		if(ad==2) { ad=1; }
	}
	else	{	ad=me;	}
	if (ad==1) { banner="ban_728x90_elcastillo.swf"; ancho="625";	alto="80"; }
	if (ad==2) { banner="bannerconstructorabolivar.swf"; ancho="625";	alto="80"; }
	if (ad==3) { banner="ustorage_800_150.swf"; 	 ancho="625";	alto="117"; }
	if (ad==4) { banner="ban_728x90_melendez_2.swf"; ancho="625";	alto="80"; }
	
	document.write('<div align="center" style="margin:0; padding:0;border:1px solid #a9a9a9; width:625px;">');
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" border="0" width="'+ ancho +'" height="'+ alto +'">');
	document.write('<param name="movie" value="pauta/'+ banner +'"><param name="quality" value="High">');
	document.write('<embed src="pauta/'+banner+'" width="'+ancho+'" height="'+alto+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" name="bantop"></embed></object>');
	document.write('</div>');
}

