// JavaScript Document
function o(id,orig){
	if(!orig)
		return document.getElementById(id);
	else
		return orig.getElementById(id);
}
var vent;
function IR(url,windowd,al,an,scrollb){
	if(windowd == '_top'){
		window.parent.location = url;
	}else if(windowd == '_blank' || windowd == '_new'){
		if(an == null || al == null){
			window.open(url);
		}else{
			var alto = screen.height;
			var ancho = screen.width;
			var top = (alto/2)-(al/2);
			var left= (ancho/2)-(an/2);
			var params = 'width='+an+', height='+al+', scrollbars='+(scrollb ? 'yes' : 'no')+', resizable=no, status=no, toolbar=no, location=no, top='+top+', left='+left;
			if(windowd == '_new'){
				randt = new Date();
				rand  = randt.getMinutes();
				rand  += '_'+randt.getSeconds();
				rand  += '_'+randt.getMilliseconds();
				window.open(url, 'popup'+rand, params);
			}else{
				try{vent.close();}catch(e){}
				vent = window.open(url, 'popup', params);
				vent.focus();
			}
		}
	}else{
		window.location = url;
	}
}
function IFGO(txt,utrue,windowd,ufalse,al,an){
	tmp = window.confirm(txt);
	if(tmp){
		IR(utrue,windowd,al,an);
	}else{
		if(ufalse != null){
			IR(ufalse,windowd,al,an);
		}
	}
}
function IFSUB(txt,form){
	tmp = window.confirm(txt);
	if(tmp){
		o(form).submit();
	}
}
function SHOW(elem,show,visible){
	visible = visible != null ? visible : 'block';
	if(show){
		elem.style.display = visible;
	}else{
		elem.style.display = 'none';
	}
}
function H(n){
	window.history.go(n);
}
function sel(ob,val){
	if(val){
		ob.style.color='#999';
	}else{
		ob.style.color='';
	}
}
function EXTCHECK(arex,campo){
	var c = o(campo);
	var a = c.value.split('.');
	var ex = a[a.length - 1];
	for(it in arex){
		if(ex.toLowerCase() == arex[it].toLowerCase()){
			return true;
		}
	}
	return false;
}
function PREL(url){
	var ref = new Image();
	ref.src = url;
	return ref;
}