<!--
errColor='#f0f0f0'
function comparar(obj1,obj2,nombre){
	alert(obj1.value+"-"+obj2.value); 
	if (obj1.value!==obj2.value){obj1.style.backgroundColor=errColor; obj2.style.backgroundColor=errColor; return "\n* "+nombre+" deben ser id\u00e9nticas."}else{return ""}}
function completo(obj,nombre,tipo){if (tipo=='int'){ if ((obj.value=='')||(isNaN(obj.value))){obj.style.backgroundColor=errColor;return "\n* "+nombre+" debe ser completado con n\u00fameros."}else{return ""}}else{ if (obj.value==''){obj.style.backgroundColor=errColor;return "\n* "+nombre+" debe ser completado."}else{return ""}}}
function emailvalido(obj,nombre) {msg=""; if(obj.value!=""){var reg1 = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/;var reg2 = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/;if (reg1.test(obj.value) || !reg2.test(obj.value)){obj.style.backgroundColor=errColor;msg= "\n* "+nombre+" es inv\u00e1lido."}} return msg}
function telefonovalido(obj,nombre){var reg=/\d{3,}(.?\d{3,})+/; if((obj.value!="")&&!reg.test(obj.value)){obj.style.backgroundColor=errColor;return "\n* "+nombre+" es inv\u00e1lido."}else{return ""}}
function chequeado(obj, nombre){ ok = false; for(i=0; i<obj.length; i++){obj[i].style.backgroundColor=''; if(obj[i].checked){ok = true}}; if(ok){return ""}else{for(i=0; i<obj.length; i++)obj[i].style.backgroundColor=errColor; return "\n* "+nombre+" debe ser seleccionado."}}
function fechavalida(dia, mes, ano, nombre){val=dia.value+'-'+mes.value+'-'+ano.value; dr=/^[ ]*[0]?(\d{1,2})[-\/](\d{1,2})[-\/](\d{4,})[ ]*$/; mc=val.match(dr);if (mc){ var td=new Date(mc[3],parseInt(mc[2])-1,mc[1]);	if (td.getDate()==parseInt(mc[1]) && td.getFullYear()==parseInt(mc[3]) && (td.getMonth()+1)==parseInt(mc[2])) return"";} dia.style.backgroundColor=errColor; mes.style.backgroundColor=errColor; ano.style.backgroundColor=errColor; return "\n* "+nombre+" es inv\u00e1lido."}
//-->

//----------------------------------------------------------------------------------------------------------------------------//
//-- QUERYS ------------------------------------------------------------------------------------------------------------------//
//-- obtener var1ables pasadas por url
function getQueryVariable(variable) {
  var query = self.location.search.substring(1);
  var vars = query.split("&");
  for (var i=0;i<vars.length;i++) {
    var pair = vars[i].split("=");
    if (pair[0] == variable) {
		if( variable == 'swf'){
			salida = new String(pair[1]);
			salida2 = salida.substr(0,salida.length-4);
		}else{
			salida2 = pair[1];
		}
		return salida2;
    }
  } 
}


//----------------------------------------------------------------------------------------------------------------------------//
//-- COOKIES -----------------------------------------------------------------------------------------------------------------//
//--
function writeCookie(name, value, hours, path){
	var domain = document.domain;
	var expire = "";
	if(hours != null){
		expire = new Date((new Date()).getTime() + hours * 3600000);
		expire = "; expires=" + expire.toGMTString();
	}
	document.cookie = name + "=" + escape(value) + expire + "; path=" + path + "; domain=" + domain;
}
function readCookie(name){
	var cookieValue = "";
	var search = name + "=";
	if(document.cookie.length > 0){ 
		offset = document.cookie.indexOf(search);
		if (offset != -1){ 
			offset += search.length;
			end = document.cookie.indexOf(";", offset);
			if (end == -1) end = document.cookie.length;
			cookieValue = unescape(document.cookie.substring(offset, end));
		}
	}
	return cookieValue;
}


<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  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];}}
}

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_swapImage() { //v3.0
  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];}
}
//-->

