function GaleriaAct(id, ref) {
	window.open('____GeleriaActividades/index.php?id=' + id + '&ref=' + ref + '','','scrollbars=yes, width=850,height=570');
}

var titulopordefecto = "";
var Adal_ventana;
var cont=0;

function Adal_Foto(cual,titulo){
	if(cont==1){Adal_ventana.close();Adal_ventana=null}
	if(titulo==null){titulo=titulopordefecto}
	Adal_ventana=window.open('','Adal_ventana','resizable=yes,scrollbars=no')
	Adal_ventana.document.write('<html><head><title>' + titulo + '</title></head><body style="overflow:hidden" marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" scroll="no" onUnload="opener.cont=0"><img src="' + cual + '" onLoad="opener.redimensionar(this.width, this.height)">');
	Adal_ventana.document.close();
	cont++;
}

function InFoto(path,n) {
	window.open('__Windows/img_principal.php?path=' + path + '&n=' + n + '','','scrollbars=yes, width=590,height=390');
}

function getGFoto(id) {
	window.open('__Windows/fotos.php?id=' + id + '','','width=590,height=400,top=50,left=50,alwaysRaised=yes,toolbar=0,directories=0,menubar=0,status=1,resizable=yes,location=0,scrollbars=yes,copyhistory=0');
}

function getGFotoMain(id) {
	window.open('__Windows/main_fotos.php?id=' + id + '','','width=590,height=400,top=50,left=50,alwaysRaised=yes,toolbar=0,directories=0,menubar=0,status=1,resizable=yes,location=0,scrollbars=yes,copyhistory=0');
}

function InFotoGal(path,n) {
	window.open('__Windows/img_galeria.php?path=' + path + '&n=' + n + '','','scrollbars=yes, width=590,height=390');
}

function redimensionar(ancho, alto){
	Adal_ventana.resizeTo(ancho+12,alto+28);
	Adal_ventana.moveTo((screen.width-ancho)/2,(screen.height-alto)/2);
}

function AdalImagenRender(img, texto) {
	window.open('../../__RenderIMG/imgThumb.php?src=' + img + '&w=550&h=360&zc=0'+ texto +'','','scrollbars=yes, width=590,height=390');
}

function ImpArticulo(id) {
	window.open('PrintArticulo.php?id=' + id + '','','scrollbars=yes, width=600,height=500');
}

//
function orangeMarcas (urlLink) {
	window.open(urlLink);
}
//

function ImpArticuloNoImagen(id, img) {
	window.open('PrintArticulo.php?id=' + id + '&img=' + img + '','','scrollbars=yes, width=600,height=500');
}

function ConfirmaPrintView(id) {
if (confirm("¿Deseas imprimir este artículo con su Fotografía?")){ ImpArticulo(id)}
else {ImpArticuloNoImagen(id, 'no')}
}

function PoliticaUso() {
	window.open('../../../__$_Server/NtrWindows/politica_uso.php','','scrollbars=yes, width=400,height=500');
}

function precio(evt){ 
var key = nav4 ? evt.which : evt.keyCode; 
return (key <= 13 || (key >= 48 && key <= 57));
}

var nav4 = window.Event ? true : false;
function adal_icm_format_md(num) {
num = num.toString().replace(/\$|\,/g,'');
if(isNaN(num))
num = "0";
sign = (num == (num = Math.abs(num)));
num = Math.floor(num*100+0.50000000001);
cents = num%100;
num = Math.floor(num/100).toString();
if(cents<10)
cents = "0" + cents;
for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
num = num.substring(0,num.length-(4*i+3))+''+
num.substring(num.length-(4*i+3));
return (((sign)?'':'-') + '' + num + '');
}

function AdalInt(num) {
num = num.toString().replace(/\$|\,/g,'');
if(isNaN(num))
num = "0";
sign = (num == (num = Math.abs(num)));
num = Math.floor(num*100+0.50000000001);
cents = num%100;
num = Math.floor(num/100).toString();
if(cents<10)
cents = "0" + cents;
for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
num = num.substring(0,num.length-(4*i+3))+''+
num.substring(num.length-(4*i+3));
return (((sign)?'':'-') + '' + num + '');
}
function NTFormLoginFun(){
	if (document.NTFormLogin.as87asas5a4s82as4a.value.length < 3){
		alert("Escriba su dirección de E-mail")
		return false;
	}
	if (document.NTFormLogin.s2df4ds5f7sd8f7re.value.length < 3){
		alert("Escriba la Contraseña")
		return false;
	}
}
function NTFormPassWFun(){
	if (document.NTFormPassW.EmailRessive.value.length < 3){
		alert("Escriba su dirección de E-mail")
		return false;
	}
}
function NTFormDisplayPW(){
	if (document.NTFormPassWNew.PassOld.value.length < 7){
		alert("Escriba su Contraseña actual")
		return false;
	}
	
	if (document.NTFormPassWNew.PassNew.value.length < 7){
		alert("Escriba su Nueva Contraseña")
		return false;
	}
}
function SortTd (bloque) { 
  if (document.getElementById(bloque).style.display == 'none') {
    document.getElementById(bloque).style.display = 'block';
	}
  else {
    document.getElementById(bloque).style.display = 'none'; 
  }
}
