<!--
// ####### FUNCIONES DE MANEJO DE IMAGENES
if (document.images) {
	path ="/img/";
	//sigon=new Image(); sigon.src=path+"next_button_on.gif";
	//sigoff=new Image(); sigoff.src=path+"next_button.gif";
}

function CambiaModo(picname, mod){
	if (document.images) {
	document[picname].src= eval(picname + mod + ".src");}
}
function CambiaOn(picname){
	CambiaModo(picname, "on");
}
function CambiaOff(picname){
	CambiaModo(picname, "off");
}
// ####### FIN DE FUNCIONES DE MANEJO DE IMAGENES

// ## separa los parametros get
function getArgs(  ) {
    var args = new Object(  );
    var query = location.search.substring(1);     
      // Get query string
    var pairs = query.split(",");
     // Break at comma
    for(var i = 0; i < pairs.length; i++) {
        var pos = pairs[i].indexOf('=');
          // Look for "name=value"
        if (pos == -1) continue;
          // If not found, skip
        var argname = pairs[i].substring(0,pos);
          // Extract the name
        var value = pairs[i].substring(pos+1);
          // Extract the value
        args[argname] = unescape(value);
         // Store as a property
       // In JavaScript 1.5, use decodeURIComponent(  ) 
       // instead of escape(  )
    }
    return args;     // Return the object
}

function maximizar() {
  if (window.screen) {
    var aw = screen.availWidth;
    var ah = screen.availHeight;
    window.moveTo(0, 0);
    window.resizeTo(aw, ah);
  }
}

// funciones de logueo
window.log_ok = 1;
function log(id){ 
	if (parent) {
		ref=escape(parent.document.referrer);
	} else {
		ref=escape(document.referrer);
	}
	if (getCookie("log_" + id) == "1") {
	} else {
		setCookie("log_" + id,1);
		document.write("<img src=\"/cgi-bin/log.cgi?id=" + id + "&ref=" + ref + "\" height=1 width=1>");
	}
}

function foco() {
	if (window.screen) {
		self.focus();
	}
}

function XY(w, h) {
	if (window.screen) {
		window.resizeTo(w, h);
	}	
}

function redir(URL) {
	window.location.replace(URL);
}

function go(url) {
	location.href = url;
}

function Abrir(URL, X, Y) {
	window.open(URL,"_child","width="+X+", height="+Y+",scrollbars=1,resizable=1");
}

function mail(direccion,nombre,asunto,cc,cco,mensaje) {	
	if (!direccion) direccion = "";
	if (!nombre) nombre = "";
	if (!asunto) asunto = "";
	if (!cc) cc = "";
	if (!cco) cco = "";
	if (!mensaje) mensaje = "";
	var url = "http://www.salvador.edu.ar/contacto/mail.html?site=servicios&to=" + direccion + "&name=" + nombre + "&subject=" + asunto + "&cc=" + cc + "&bcc=" + cco + "&body=" + mensaje;
	window.open(url,"Mail","scrollbars=1,width=580,height=500,resizable=1");
}

function _mail(direccion) {
	window.open("/cgi-bin/mail/form.cgi?email=" + direccion,"Mail", "scrollbars=0,width=500,height=400,resizable=1");
}
function abrir(url, win, param) {
	window.open(url, win, param);
}

function sel_all(check) {
	if (! document.forms(0)) {
		return
	}
	var form = document.forms(0);
	var i, chkbx;
	for(i=1; i < form.all.length; i++) {
		chkbx = form.all[i];
	   if (chkbx.type) {
   		if ((chkbx.type == "checkbox") && (chkbx.name.indexOf("s_") == 0)) {
   			if (check == -1) {
   				chkbx.checked = !chkbx.checked
   			} else {
   				if (check == 0) {
   					chkbx.checked = false
   				} else {
   					chkbx.checked = true
   				}
   			}
   		}
	 	}
  	}
}

function agregar_a_favoritos() {
  if (window.external)
    external.AddFavorite('http://servicios.salvador.edu.ar','USAL Servicios')
  else
    alert("Su navegador no soporta esta función.");
}

// Funciones MM
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_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_findObj(n, d) { //v3.0
  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); 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];}
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}
// Fin de funciones MM

// Ventanas que se abren
//if (document.location.href.indexOf("/exe/login.pl") > 0) { Abrir('/varios/Cuota.html',400,350) }
//if (document.location.href.indexOf("/academ/index.html") > 0) { Abrir('/varios/Cuota.html',300,300) }

//if (document.location.href.indexOf("/exe/iexam/consul_exam.pl") > 0) { Abrir('/varios/Inscripcion2.html',450,450) }

//if (document.location.href.indexOf("/cgi-bin/academ/asistencia.cgi") > 0) { Abrir('/varios/Presentismo.html',300,300) }
//if (document.location.href.indexOf("/exe/info/asistencia.pl") > 0) { Abrir('/varios/Presentismo.html',300,300) }

// name - name of the cookie
// value - value of the cookie
// [expires] - expiration date of the cookie (defaults to end of current session)
// [path] - path for which the cookie is valid (defaults to path of calling document)
// [domain] - domain for which the cookie is valid (defaults to domain of calling document)
// [secure] - Boolean value indicating if the cookie transmission requires a secure transmission
// * an argument defaults when it is assigned null as a placeholder
// * a null placeholder is not required for trailing omitted arguments
function setCookie(name, value, expires, path, domain, secure) {
  var curCookie = name + "=" + escape(value) +
      ((expires) ? "; expires=" + expires.toGMTString() : "") +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      ((secure) ? "; secure" : "");
  document.cookie = curCookie;
}

// name - name of the desired cookie
// * return string containing value of specified cookie or null if cookie does not exist
function getCookie(name) {
  var dc = document.cookie;
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0) return null;
  } else
    begin += 2;
  var end = document.cookie.indexOf(";", begin);
  if (end == -1)
    end = dc.length;
  return unescape(dc.substring(begin + prefix.length, end));
}

// name - name of the cookie
// [path] - path of the cookie (must be same as path used to create cookie)
// [domain] - domain of the cookie (must be same as domain used to create cookie)
// * path and domain default if assigned null or omitted if no explicit argument proceeds
function deleteCookie(name, path, domain) {
  if (getCookie(name)) {
    document.cookie = name + "=" + 
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}

// date - any instance of the Date object
// * hand all instances of the Date object to this function for "repairs"
function fixDate(date) {
  var base = new Date(0);
  var skew = base.getTime();
  if (skew > 0)
    date.setTime(date.getTime() - skew);
}

// ************************
// layer utility routines *
// ************************

function getStyleObject(objectId) {
    // cross-browser function to get an object's style object given its id
  if(document.getElementById && document.getElementById(objectId)) {
	// W3C DOM
			return document.getElementById(objectId).style;
  } else if (document.all && document.all(objectId)) {
	// MSIE 4 DOM
			return document.all(objectId).style;
  } else if (document.layers && document.layers[objectId]) {
	// NN 4 DOM.. note: this won't find nested layers
		return document.layers[objectId];
  } else {
		return false;
   }
} // getStyleObject

function hideObject(objectId) {
    if(objectId) {
			return changeObjectVisibility(objectId, 'hidden');
    } else {
    	return false;
    }
}

function showObject(objectId) {
    if(objectId) {
			return changeObjectVisibility(objectId, 'visible');
    } else {
    	return false;
    }
}

function changeObjectVisibility(objectId, newVisibility) {
    // get a reference to the cross-browser style object and make sure the object exists
    var styleObject = getStyleObject(objectId);
    if(styleObject) {
	styleObject.visibility = newVisibility;
	return true;
    } else {
	// we couldn't find the object, so we can't change its visibility
	return false;
    }
} // changeObjectVisibility

function moveObject(objectId, newXCoordinate, newYCoordinate) {
    // get a reference to the cross-browser style object and make sure the object exists
    var styleObject = getStyleObject(objectId);
    if(styleObject) {
	styleObject.left = newXCoordinate;
	styleObject.top = newYCoordinate;
	return true;
    } else {
	// we couldn't find the object, so we can't very well move it
	return false;
    }
} // moveObject

//-->