function SWFObjectNew(ancho, alto, archivoswf, DivObject, ActiveTransparent) { var SWFobject;
SWFobject = ''; SWFobject += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="' + ancho + '" height="' + alto + '">'; SWFobject += '<param name="movie" value="' + archivoswf + '">'; SWFobject += '<param name="quality" value="high">'; if(ActiveTransparent) { SWFobject += '<param name="wmode" value="transparent">'; }
if(ActiveTransparent) { SWFobject += '<embed src="' + archivoswf + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + ancho + '" height="' + alto + '" wmode="transparent">'; } else { SWFobject += '<embed src="' + archivoswf + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + ancho + '" height="' + alto + '">'; }	SWFobject += '</embed></object>'; if(document.getElementById(DivObject)) { document.getElementById(DivObject).innerHTML = SWFobject; } else { document.write(SWFobject); }}

function naviTop(n) {

   document.getElementById('navitop-sub1').style.display = 'none';
   document.getElementById('navitop-sub2').style.display = 'none';
   document.getElementById('navitop-sub3').style.display = 'none';
   document.getElementById('navitop-sub4').style.display = 'none';
   document.getElementById('navitop-sub5').style.display = 'none';
   document.getElementById('navitop-sub6').style.display = 'none';
   document.getElementById('navitop-sub7').style.display = 'none';
   document.getElementById('navitop-sub8').style.display = 'none';
   document.getElementById('navitop-sub' + n).style.display = 'block';
   
   if (n==1) {
	   document.getElementById('navitop-m1').className = 'navitopActive';
   } else {
	   document.getElementById('navitop-m1').className = 'navitop';
   }
   
   if (n==2) {
	   document.getElementById('navitop-m2').className = 'navitopActive';
   } else {
	   document.getElementById('navitop-m2').className = 'navitop';
	   }
	   
   if (n==3) {
	   document.getElementById('navitop-m3').className = 'navitopActive';
   } else {
	   document.getElementById('navitop-m3').className = 'navitop';
	   }
   
   if (n==4) {
	   document.getElementById('navitop-m4').className = 'navitopActive';
   } else {
	   document.getElementById('navitop-m4').className = 'navitop';
   }
   
   if (n==5) {
	   document.getElementById('navitop-m5').className = 'navitopActive';
	   } else {document.getElementById('navitop-m5').className = 'navitop';}
		   
   if (n==6) {
	   document.getElementById('navitop-m6').className = 'navitopActive';
	   } else {
		   document.getElementById('navitop-m6').className = 'navitop';
		   }
		   
   if (n==7) {
	   document.getElementById('navitop-m7').className = 'navitopActive';
	   } else {
		   document.getElementById('navitop-m7').className = 'navitop';
		   }
	   
   if (n==8) {
	   document.getElementById('navitop-m8').className = 'navitopActive';
	   } else {
		   document.getElementById('navitop-m8').className = 'navitop';
	   }
   
}

function loadGoToIndex (i) {
	 var i;
	 window.location.href = i + '.php';
}

function popUpGene(URL, W, H) {

 day = new Date();
 id = day.getTime();
 eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=1,menubar=0,resizable=1,width=" + W + ",height=" + H + ",left = 282,top = 234');");

}

function popUpGeneFull(URL) {
window.open(URL, '', 'fullscreen=yes,,resizable=1,scrollbars=yes');
}

function fBuscar() {
	
	if (document.getElementById('q').value.length < 3 || document.getElementById('q').value == 'Buscar') {
		alert('Su búsqueda debe contener más de 3 caracteres');
		return false;
	}

 document.ftopBuscar.submit();

}

function SystemFormRequet() {

if (document.nformNewUserBoletin.email.value.length < 3) {
document.getElementById('email').style.border = '1px solid #FF0000';
alert('Por favor introduzca su correo electrónico (e-mail)');
document.nformNewUserBoletin.email.focus();
return 0;
}

var str=document.nformNewUserBoletin.email.value

var filtro=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i

if (filtro.test(str)) {
 resultado = true
} else {
 alert("Correo Electrónico Invalido!")
 return 0;
}

document.nformNewUserBoletin.submit();

}


enc_on=false;
	
function encValidate(f) { 
 
if(!enc_on){ 
alert("Por favor marque su preferencia"); 
return false; 
} 
else {return true; 
} 
}

function ResultadosEnc (id) {
	RumEncuesta('__encuesta/resultados.php?idenc=' + id + '','','scrollbars=yes, width=480,height=360');
}

function RumEncuesta(theURL,winName,features) {
	window.open(theURL,winName,features);
}


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 orangeMarcas (urlLink) {
	window.open(urlLink);
}
//

function ImpArticulo(id, img) {
	window.open('__Windows/imprimir_art.php?id=' + id + '&img=' + img + '','','scrollbars=yes, width=600,height=500');
}

function ImpArticuloNoImagen(id, img) {
	window.open('__Windows/imprimir_art.php?id=' + id + '&img=' + img + '','','scrollbars=yes, width=600,height=500');
}

function getPrintArticulo(id) {
if (confirm("¿Deseas imprimir este artículo con su fotografía?")){ ImpArticulo(id, '1')}
else {ImpArticuloNoImagen(id, '0')}
}

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'; 
  }
}

function artComents() {
	
	re=/^[_a-z0-9-]+(.[_a-z0-9-]+)*@[a-z0-9-]+(.[a-z0-9-]+)*(.[a-z]{2,3})$/

	if (document.form_comment.tex_name.value.length < 2 || document.form_comment.tex_name.value == 'Nombre') {
	    alert('Por favor escriba su nombre');
	    document.form_comment.tex_name.focus()
		return 0;
	}
	
	if (document.form_comment.tex_email.value.length < 2 || document.form_comment.tex_email.value == 'E-mail' || !re.exec(document.form_comment.tex_email.value)) {
	    alert('Campo e-mail incompleto o invalido');
	    document.form_comment.tex_email.focus()
		return 0;
	}
	
	if (document.form_comment.text_comentario.value.length < 2 || document.form_comment.text_comentario.value == 'Comentario') {
	    alert('Debe escribir un comentario');
	    document.form_comment.text_comentario.focus()
		return 0;
	}

 document.form_comment.submit();

}
