var ovrfg="#ff0000";
var outfg="#ffffff";

var patronNOMBRE=/^\s*$/;
function esCadenaOK(str,filter){return!(filter.test(str));}


function chequearradios(){	//alert(document.form1.quehacer[0].checked)
if( (document.form1.quehacer[0].checked==false) && (document.form1.quehacer[1].checked==false) ){return false;}else{return true;}
}


function chequeardatos(t){var nombreok=esCadenaOK(t.nombremail.value,patronNOMBRE);
if( (t.tipomail.value=="") || (nombreok==false) ){
	alert('Debe completar los datos primero');
	return false;
}else{return true;}
}


// OBW 1.0 by www.MarceloPedra.com.ar
function OBW(pageToLoad,winName,scrollbars,ancho,alto,centrar){xposition=0;yposition=0;if((parseInt(navigator.appVersion)>=4)&&(centrar)){xposition=(screen.width-ancho)/2;yposition=(screen.height-alto)/2};args="width="+ancho+",height="+alto+",scrollbars="+scrollbars+",status=0,titlebar=0,toolbar=0,hotkeys=0,location=0,menubar=0,resizable=yes,dependant=1,screenx="+xposition+",screeny="+yposition+",left="+xposition+",top="+yposition;window.open(pageToLoad,winName,args)}


// IMG pop-GEN 1.0 by www.MarceloPedra.com.ar
// Pop-ups
var titulopordefecto="Nordelta";var ventana,cont=0;
var agt=navigator.userAgent.toLowerCase();var esMozilla=(agt.indexOf("firefox")!=-1);

function redimensionar(ancho,alto){var masancho=70,masalto=70;
if(esMozilla==true){masancho=50,masalto=90;}
ventana.resizeTo(ancho+masancho,alto+masalto);ventana.moveTo(0,0);}

function OPWrsz(cual,titulo){if(cont==1){ventana.close();ventana=null;};if(titulo==null){titulo=titulopordefecto;};
ventana=window.open('','ventana','status=0,titlebar=0,toolbar=0,hotkeys=0,location=0,menubar=0,resizable=0,dependant=1,scrollbars=1,width=100,height=100');
ventana.document.write('<html><head><title>'+titulo+'</title></head><body style="margin:0px;background-position:bottom;background-repeat:no-repeat;" marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" onUnload="opener.cont=0" bgcolor="#F4F4F4"><table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%"><tr valign="middle"><td align="center"><a style="cursor:hand" onclick="top.window.close()" title="Haga click en la foto para cerrar"><img src="'+cual+'" onLoad="opener.redimensionar(this.width,this.height);" border="0"></a></td></tr></table></body></html>');
ventana.document.close();cont++;
}








function verseles(destList,quetocar){
//alert(quetocar.value)
//alert(destList.length)

quetocar.value="|";

//var destList=window.document.forms["form1"].destList;
var len=destList.length;
	for(var i=0;i<len;i++){quetocar.value+=destList.options[i].text+"|";}
//alert(quetocar.value)
}




// Add the selected items from the source to destination list
function addSrcToDestList(destList,srcList,quetocar){
if(window.document.forms["form1"].enviado.value==1){return false;}
//alert(destList.length)

var len = destList.length;
for(var i = 0; i < srcList.length; i++) {
	if ((srcList.options[i] != null) && (srcList.options[i].selected)) {
	// Check if this value already exist in the destList or not
	// if not then add it, otherwise do not add it.
	var found = false;
	for(var count = 0; count < len; count++) {
		if (destList.options[count] != null) {
			if (srcList.options[i].text == destList.options[count].text) {
				found = true;
				break;
			}
		}
	}
		if (found != true) {
			destList.options[len] = new Option(srcList.options[i].text); 
			len++;
		}
	}
}

verseles(destList,quetocar);
}


// Deletes from the destination list.
function deleteFromDestList(destList,srcList,quetocar) {
if(window.document.forms["form1"].enviado.value==1){return false;}

//var destList  = window.document.forms["form1"].destList;
var len = destList.options.length;
for(var i = (len-1); i >= 0; i--) {
	if ((destList.options[i] != null) && (destList.options[i].selected == true)) {
	destList.options[i] = null;
	}
}

verseles(destList,quetocar);
}






function masnotas(antes, despues){
var avisog="\n\nEL CAMBIO TENDRÁ EFECTO CUANDO GUARDE EL ARCHIVO.";
plural="";if((despues-antes)>1||(antes-despues)>1){plural="s";}
avisonota="s primeras "+despues+" notas";if(despues==1){avisonota=" primera nota"}

if(antes<despues){		// agregarán notas
	alert("Con esto agregará "+(despues-antes)+" nota"+plural+"."+avisog)
}else if(antes>despues){		// quitarán notas
	alert("Con esto quitará "+(antes-despues)+" nota"+plural+".\n\nSolo se guardará la configuración para la"+avisonota+".      "+avisog)
}else if(antes==despues){	// sin cambios
	return;
}

}



function intercambiar(seleccion1,seleccion2){

// Levanto el array del origen
  var PrimerArraySEL = new Array();
  var PrimerArrayTXT = new Array();
  var PrimerArrayVAL = new Array();
  var PrimerArrayLEN = seleccion1.options.length;
  var i=count=0;
  for(i=0; i<seleccion1.options.length;i++){
      PrimerArraySEL[count]=seleccion1.options[i].selected;
      PrimerArrayTXT[count]=seleccion1.options[i].text;
      PrimerArrayVAL[count]=seleccion1.options[i].value;
      count++;
  }
  
// Copio el array a un contenedor  
  var ArrayContenedorSEL = new Array();
  var ArrayContenedorTXT = new Array();
  var ArrayContenedorVAL = new Array();
  var ArrayContenedorLEN;
  ArrayContenedorSEL = PrimerArraySEL;
  ArrayContenedorTXT = PrimerArrayTXT;
  ArrayContenedorVAL = PrimerArrayVAL;
  ArrayContenedorLEN = PrimerArrayLEN


// Levanto el array del target
  var SegundoArraySEL = new Array();
  var SegundoArrayTXT = new Array();
  var SegundoArrayVAL = new Array();
  var SegundoArrayLEN = seleccion2.options.length;
  var i=count=0;
  for(i=0; i<seleccion2.options.length;i++){
      SegundoArraySEL[count]=seleccion2.options[i].selected;
      SegundoArrayTXT[count]=seleccion2.options[i].text;
      SegundoArrayVAL[count]=seleccion2.options[i].value;
      count++;
  }

// Switcheo los arrays
PrimerArraySEL=SegundoArraySEL;	SegundoArraySEL=ArrayContenedorSEL;
PrimerArrayTXT=SegundoArrayTXT;	SegundoArrayTXT=ArrayContenedorTXT;
PrimerArrayVAL=SegundoArrayVAL;	SegundoArrayVAL=ArrayContenedorVAL;
PrimerArrayLEN=SegundoArrayLEN;	SegundoArrayLEN=ArrayContenedorLEN;


// Asigno cada array a su selector:

// sel1 con el Primer Array
  var i=count=0;
  seleccion1.options.length=0;
  seleccion1.options.length=PrimerArrayLEN;
  for(i=0; i<seleccion1.options.length;i++){
      seleccion1.options[i].selected=	PrimerArraySEL[count];
      seleccion1.options[i].text=	PrimerArrayTXT[count];
      seleccion1.options[i].value=	PrimerArrayVAL[count];
      count++;
  }


// sel2 con el Segundo Array
  var i=count=0;
  seleccion2.options.length=0;
  seleccion2.options.length=SegundoArrayLEN;
  for(i=0; i<seleccion2.options.length;i++){
      seleccion2.options[i].selected=	SegundoArraySEL[count];      
      seleccion2.options[i].text=	SegundoArrayTXT[count];
      seleccion2.options[i].value=	SegundoArrayVAL[count];
      count++;      
  }

      
// Todos felices!

}




// Overstate functions

//v3.0
function MM_preloadImages(){var d=document;if(d.images){if(!d.MM_p)d.MM_p=new Array();var i,j=d.MM_p.length,a=MM_preloadImages.arguments;for(i=0;i<a.length;i++)
if(a[i].indexOf("#")!=0){d.MM_p[j]=new Image;d.MM_p[j++].src=a[i];}}}

//v4.01
function MM_findObj(n,d){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;}

//v3.0
function MM_swapImage(){var i,j=0,x,a=MM_swapImage.arguments;document.MM_sr=new Array;for(i=0;i<(a.length-2);i+=3){if((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x;if(!x.oSrc){x.oSrc=x.src;};x.src=a[i+2];}}}

//v3.0
function MM_swapImgRestore(){var i,x,a=document.MM_sr;for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++){x.src=x.oSrc;}}

