var win= null;
function NewWindow(mypage,myname,w,h,scroll){
var winl = (screen.width-w)/2;
var wint = (screen.height-h)/2;
var settings ='height='+h+',';
settings +='width='+w+',';
settings +='top='+wint+',';
settings +='left='+winl+',';
settings +='scrollbars='+scroll+',';
settings +='resizable=yes';
win=window.open(mypage,myname,settings);
if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
}
// esta funcion, para abrir al tamaņo maximo de la ventana.
// la altura de la pagina, depende de la variable "h"

function Full(mypage,myname,w,h,scroll){
var winl = (screen.width);
var wint = (screen.height-h)/2;
var settings ='height='+h+',';
settings +='width='+(screen.width)+',';
settings +='top=0';
settings +='left=0,'
settings +='scrollbars='+scroll+',';
settings +='resizable=no';
win=window.open(mypage,myname,settings);
if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
}

function MM_openBrWindow(theURL,winName,features) {
window.open(theURL,winName,features);
}

function Alternar(Seccion)
{ 
    if (Seccion.style.display=="none"){Seccion.style.display=""}
    else{Seccion.style.display="none"} 
}
function Mostrar(Seccion)
{
Seccion.style.display="";
}

function Ocultar(Seccion)
{
Seccion.style.display="none";
}

function EscribirRojo(Mensaje,Destino)
{
document.getElementById(Destino).innerHTML='<br><FONT COLOR="#CC0000"><strong>'+Mensaje+'</strong></FONT>';
}
function Escribir(Mensaje,Destino)
{
document.getElementById(Destino).innerHTML=Mensaje;
}
function CheckUncheck(box)
{
if (document.getElementById(box).checked==false){document.getElementById(box).checked=1}else{document.getElementById(box).checked=0}
}


function EscribirImagen(UrlBase,Archivo,Destino)
{
var comilla= "\""
if (Archivo.length >0)
{
foto = '<img src='+comilla+UrlBase+Archivo+comilla+' WIDTH=80 HEIGHT=80 BORDER=0 ALIGN=bottom />'
//alert(foto)
document.getElementById(Destino).innerHTML=foto;
}
else
{
document.getElementById(Destino).innerHTML='No se especifico archivo';
}
}
function info(destino,origen)
//esta funcion, antes se llamaba info (destino,origen)
//corregir luego el nombre...
{
document.getElementById(destino).value=document.getElementById(destino).value+' '+document.getElementById(origen).value
}
//---------------------------------------
// Funciones de cookies
//---------------------------------------
function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name) {
	createCookie(name,"",-1);
}