function abrir_ventana(url, nombre, width, height, posicionamiento, x, y, scrolls){
	if(posicionamiento=="centrado"){
		x = (screen.width - width)/2;
		y = (screen.height - height)/2;
	}
	open(url, nombre, "width="+width+", height="+height+", screenLeft="+x+", screenTop="+y+", scrollbars="+scrolls);
}
function getCookieVal (offset) {
	var endstr = document.cookie.indexOf (";", offset);
	if (endstr == -1)
		endstr = document.cookie.length;
	return unescape(document.cookie.substring(offset, endstr));
}
function GetCookie(name){
	var arg = name + "=";
	var alen = arg.length;
	var clen = document.cookie.length;
	var i = 0;
	while (i < clen) {
		var j = i + alen;
		if (document.cookie.substring(i, j) == arg)
			return getCookieVal (j);
		i = document.cookie.indexOf(" ", i) + 1;
		if (i == 0) break; 
	}
	return null;
}

function SetCookie(name, value){
	var argv = SetCookie.arguments;
	var argc = SetCookie.arguments.length;
	var expires = (argc > 2) ? argv[2] : null;
	var path = (argc > 3) ? argv[3] : null;
	var domain = (argc > 4) ? argv[4] : null;
	var secure = (argc > 5) ? argv[5] : false;
	document.cookie = name + "=" + escape (value) +
		((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
		((path == null) ? "" : ("; path=" + path)) +
		((domain == null) ? "" : ("; domain=" + domain)) +
		((secure == true) ? "; secure" : "");
}

function trim(inputString) {
   // Removes leading and trailing spaces from the passed string. Also
   // removes consecutive spaces and replaces it with one space.
   var retValue = inputString;
   var ch = retValue.substring(0, 1);
   while (ch == " ") { // Check for spaces at the beginning of the string
      retValue = retValue.substring(1, retValue.length);
      ch = retValue.substring(0, 1);
   }
   ch = retValue.substring(retValue.length-1, retValue.length);
   while (ch == " ") { // Check for spaces at the end of the string
      retValue = retValue.substring(0, retValue.length-1);
      ch = retValue.substring(retValue.length-1, retValue.length);
   }
   while (retValue.indexOf("  ") != -1) { // Note that there are two spaces in the string - look for multiple spaces within the string
      retValue = retValue.substring(0, retValue.indexOf("  ")) + retValue.substring(retValue.indexOf("  ")+1, retValue.length); // Again, there are two spaces in each of the strings
   }
   return retValue; // Return the trimmed string back to the user
} // Ends the "trim" function


function check_all_none(clase,p){
	// si p=0 todos los checkboxes estarán descheckeados
	// si p=1 todos los checkboxes estarán checkeados
	x=0;
	coleccion=document.all;
	for (x=0;x<coleccion.length;x++){
		obj=coleccion[x];
		if (obj.className==clase){
			obj.checked=p;
		}
	}
}

function Nueva_Ventana(el_url,ancho,alto) 
{ 
	
	var especificaciones="top=0, left=0,  toolbar=no,menubar=no,scrollbars=no,resizable=no" 
	var titulo="repositorio"
	ancho=String(ancho);
	alto=String(alto);
	especificaciones=especificaciones+", width="+ancho+", height="+alto;
	window.open(el_url,titulo,especificaciones); 
	
}       