<!--

viewPicWin = null;
function viewPic(winurl) {
	viewPicWin=window.open(winurl, "PicWin", "toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=yes,directories=no,location=no,width=460,height=460,left=10,top=10");
	if(!viewPicWin || !viewPicWin.name) {
	alert('La foto que ha seleccionado no se pudo mostrar.\nPor favor, asegurese que su bloqueador de popups\no antivirus no este impidiendo abrir la foto.');
	 }
// alert(viewPicWin.name);
}

function changeIMG(imgname,imgfile) {
imgname.src = imgfile;
}

function preloadImages() {
  var d=document; if(d.images){ if(!d.p) d.p=new Array();
    var i,j=d.p.length,a=preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.p[j]=new Image; d.p[j++].src=a[i];}}
}

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.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\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+' is required.\n'; }
  } if (errors) alert('The following error(s) occurred:\n'+errors);
  document.MM_returnValue = (errors == '');
}

function setBackgroundImage (id, imageURL) {
  if (document.layers)
    document[id].background.src = imageURL == 'none' ? null : imageURL;
  else if (document.all)
    document.all[id].style.backgroundImage = imageURL == 'none' ? 'none' 
: 'url(' + imageURL + ')';
  else if (document.getElementById)
    document.getElementById(id).style.backgroundImage = imageURL == 
'none' ? 'none' : 'url(' + imageURL + ')';
}

function findTableParent(node) { var node = node.parentNode; while (node.tagName != "TR") { node = node.parentNode; } return node; }
function findTableIndexed(theIndex) { return (document.getElementsByTagName('TR'))[theIndex]; }
function changeTableColor(theTable,theColor) { theTable.style.backgroundColor = theColor; }

function emailvalidation(entered, alertbox) {
with (entered) { apos=value.indexOf("@"); 
dotpos=value.lastIndexOf(".");
lastpos=value.length-1;
if (apos<1 || dotpos-apos<2 || lastpos-dotpos>3 || lastpos-dotpos<2) 
{if (alertbox) {alert(alertbox);  } return false; }
else {return true;}
}
}

function valuevalidation(entered, min, max, alertbox, datatype) {
with (entered) {
checkvalue=parseFloat(value);
if (datatype){ smalldatatype=datatype.toLowerCase();
if (smalldatatype.charAt(0)=="i") {checkvalue=parseInt(value)};}
if ((parseFloat(min)==min && checkvalue<min) || (parseFloat(max)==max && checkvalue>max) || value!=checkvalue){
if (alertbox!="") {alert(alertbox);} return false;}
else {return true;}
}
}

function digitvalidation(entered, min, max, alertbox, datatype) {
with (entered) {
checkvalue=parseFloat(value);
if (datatype){ smalldatatype=datatype.toLowerCase();
if (smalldatatype.charAt(0)=="i") { checkvalue=parseInt(value); if (value.indexOf(".")!=-1) {checkvalue=checkvalue+1}}; }
if ((parseFloat(min)==min && value.length<min) || (parseFloat(max)==max && value.length>max) || value!=checkvalue)
{if (alertbox!="") {alert(alertbox);} return false;}
else {return true;}
}
}

function emptyvalidation(entered, alertbox) {
with (entered) {
if (value==null || value=="")
{if (alertbox!="") {alert(alertbox);} return false;}
else {return true;} }
}

function lengthvalidation(entered, min, max, alertbox) {
with (entered) {
if ((parseFloat(min)==min && value.length<min) || (parseFloat(max)==max && value.length>max)){ 
if (alertbox!="") { alert(alertbox); } return false; }
else {return true;}
}
}

function launch_solicitud() {
window.open("about:blank", "solicitudwin", "fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=no,directories=no,location=no,width=350,height=300,left=10,top=10")
return true;
}

function montre(id) {
var d = document.getElementById(id);
	for (var i = 1; i<=10; i++) {
		if (document.getElementById('smenu'+i)) {document.getElementById('smenu'+i).style.display='none';}
	}
if (d) {d.style.display='block';}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function startOpenWin(desktopURL,titulo,w,h)
{
	popupwin=window.open("", "_blank","toolbar=no,location=no,status=no,menubar=no,resizable=false,scrollbars=no,width=" + w + ",height="+ (h+0));
	popupwin.document.write("<html>");
	popupwin.document.write("<head>");
	popupwin.document.write("<title>"+titulo+"</title>");
	popupwin.document.write("</head>");
	popupwin.document.write("<body bgcolor='#FFFFFF' TOPMARGIN='0' LEFTMARGIN='0' MARGINWIDTH='0' MARGINHEIGHT='0'>");
	popupwin.document.write("<table width='" + w + "' border='0' cellpadding='0' cellspacing='0' align='center'>");
	popupwin.document.write("  <tr align='center' valign='middle'> ");
	popupwin.document.write("    <td><img src='" + desktopURL + "' width='" + w + "' height='" + h + "' border='0'></td>");
	popupwin.document.write("  </tr>");
	popupwin.document.write("</table>");
	popupwin.document.write("</body>");
	popupwin.document.write("</html>");}


// -->