/*
Existen protecciones
- de dominio
- Copy & paste en windows con IE (no funciona bien pues peta en TODO windows, asi que desactivado por defecto)
- para las imagenes
- contra impresion
- contra la seleccion
- contra seleccionar todo (no funciona en firefox)
- contra el menu contextual
- contra la tecla ctrl
*/
// Proteccion de dominio
/*
if(document.domain.toLowerCase().replace("www.","")!="infraestructura".toLowerCase().replace("www.","")){
	alert("Dominio invalido");
	location="about&#058;blank";
}
*/
// Proteccion muy bestia que hace que con IE no funcione copy&paste en todo windows
/*
if(document.all){
	_fc='<'+'div style="position:absolute;left:-1000px;top:-1000px;width:60px;height:35px;z-index:1">' + '<'+'input type="button" name="_xqq" value="" onClick=_ccd() style="visibility:hidden"><'+'/div>';
	document.write(_fc);
	function _ccd(){
		clipboardData.clearData()
	};
	function _cce(){
		_xqq.click();
		setTimeout("_cce()",300)
	};
	setTimeout("_cce()",1000);
}
*/
// Proteccion para las imagenes
function _ng(){
	if (document.all) for (i = 0;i< document.images.length;i++){
		z = document.images(i);
		z.galleryImg = 'no'
	}
}
_ng();

// Proteccion contra la impresion
/*
function _np1(){
	for(wi=0;wi<document.all.length;wi++){
		if(document.all[wi].style.visibility!="hidden"){
			document.all[wi].style.visibility="hidden";
			document.all[wi].id="gwp"
		}
	}
};
function _np2(){
	for (wi=0;wi<document.all.length;wi++){
		if(document.all[wi].id=="gwp")document.all[wi].style.visibility=""
	}
};
window.onbeforeprint=_np1;
window.onafterprint=_np2;


// Proteccion contra seleccion
function _ni(){
	if(document.all){
		document.onselectstart=function (){
			return false
		};
		document.ondragstart=function (){
			return false
		};
		setTimeout("_ni", 3000);
	}
};
_ni();

// Proteccion contra seleccionar todo (no funciona en IE)
function _nn(){
	if(document.layers||window.sidebar){
		var t= document.getSelection();
		if(t !=""){
			if(!window.find){
				alert("Function Disabled.");
				location="about&#058;blank";
			}
			else{
				if(t !=" "){
					window.find(" ")
				};
			}
		};
		setTimeout("_nn()",20)
	}
}
_nn();

// Proteccion contra el menu contextual
function _nrcie(){
	return false
}
function _nrcns(e){
	if(e.which==2||e.which==3)return false
}
if(document.layers){
	document.captureEvents(Event.MOUSEDOWN);
	document.onmousedown=_nrcns
}
document.oncontextmenu=_nrcie;

// Proteccion contra las teclas ctrl
function key(k)   
{	
	return false;	
}
if (document.layers) window.captureEvents(Event.KEYPRESS); 
	document.onkeydown=key; 
