function piePagina() {
	var innerHTML = '<table border="0" cellpadding="0" cellspacing="0" align="center" width="770"><tr height="70px"><td align="center"><span class="pieHome">SHOWROOM MICROCENTRO: Florida 439 Local 15 (y Corrientes) Galería Vía Florencia.</BR>Lunes a Viernes 9:30 a 19:00 hs. (Sábados con entrevista)</BR>Tel: (011) 4326 2210  -  Email: consultas@portenadas.com.ar</span></BR>';
	innerHTML+='<a href="http://www.facebook.com/pages/PORTE&NtildeADAS/129250593777786" title="Seguinos en Facebook" target="_blank" ><img src="images/facebook.png" border="0" /></a>&nbsp;&nbsp;&nbsp;';
	innerHTML+='<a href="http://portenadas.blogspot.com" title="Seguinos en nuestro blog" target="_blank" ><img src="images/blogspot.png" border="0" width="24" height="24" /></a></td></tr></table>';
	document.getElementById("piePagina").innerHTML=innerHTML
}

function doVerMapa() {
	var cVentana = window.open("mapa.htm","Show","center=yes,help=no,status=no,Width=444px,Height=369px,navNoWriteToCache");
}

function doShowPromo(promo) {
	var opt = "center=yes,help=no,status=no,Width=940px,Height=585px,navNoWriteToCache"
	var url = "verPromo.asp?promo="+promo
	var cVentana = window.open(url,"Show",opt);
}


function myPopup(Carp,myImg){
	var blanket = window.parent.document.getElementById('blanket');
	var myInnerHTML = '<table border="0" bgcolor="#FFFFFF">'
	myInnerHTML+='<tr ><td align="left" ><img src="images/retroceder.gif" class="button" onclick="doRetroceder(\''+Carp+'\',\''+myImg+'\')"/></td>'
	myInnerHTML+=     '<td align="right" ><img src="images/avanzar.gif" class="button" onclick="doAvanzar(\''+Carp+'\',\''+myImg+'\')"/></td>'
	myInnerHTML+='</tr>'
	myInnerHTML+='<tr height="50px">'
	myInnerHTML+=  '<td colspan="2"><img id="imgPopup" name="imgPopup" src="images/album/'+Carp+'/'+myImg+'.gif" /></td>'
	myInnerHTML+='</tr>'
	myInnerHTML+='<tr valign="top">'
	myInnerHTML+=  '<td align="right" ><span class="codigoPopup">Codigo: '+myImg+'</span></td>'
	myInnerHTML+=  '<td align="right"><img src="images/boton_cerrar1.gif" class="button" onclick="myPopupClose()"/></td>'
	myInnerHTML+='</tr></table>'
	blanket.style.top = 30 + 'px';
	blanket.style.left = 70 + 'px';
	blanket.innerHTML=myInnerHTML
	blanket.style.display='block';
	
}
function doAvanzar(Carp,myImg){
	//Bodas 57
	//Quince 51
	//Comunion 24
	//Infantiles 56
	//Empresas 16
	var qType = myImg.substr(0,1)
	var nNumero = myImg.substr(1,2)

	if (Carp == 'Bodas')
	  {
	  if (eval(nNumero)<57) {
		nNumero = eval(nNumero)+1;
		var im=qType + nNumero;
		myPopup(Carp,im)
	  }
	  else {window.alert('Esta imagen es la última de la sección Bodas/Unión Civil')}
	  }
	else if (Carp == '15')
	  {
	  if (eval(nNumero)<51) {
		nNumero = eval(nNumero)+1;
		var im=qType + nNumero;
		myPopup(Carp,im)
	  }
	  else {window.alert('Esta imagen es la última de la sección 15 Años Bar/Bat Mitzvah')}
	  }
	else if (Carp == 'Comunion')
	  {
	  if (eval(nNumero)<24) {
		nNumero = eval(nNumero)+1;
		var im=qType + nNumero;
		myPopup(Carp,im)
	  }
	  else {window.alert('Esta imagen es la última de la sección Bautismo/Comunión')}
	  }
	else if (Carp == 'Empresas')
	  {
	  if (eval(nNumero)<16) {
		nNumero = eval(nNumero)+1;
		var im=qType + nNumero;
		myPopup(Carp,im)
	  }
	  else {window.alert('Esta imagen es la última de la sección Grafica empresas')}
	  }	  
    else //Infantiles
	  {
	  if (eval(nNumero)<56) {
		nNumero = eval(nNumero)+1;
		var im=qType + nNumero;
		myPopup(Carp,im)
	  }
	  else {window.alert('Esta imagen es la última de la sección Infantiles/Nacimiento')}
	  }	
}

function doRetroceder(Carp,myImg) {
	var qType = myImg.substr(0,1)
	var nNumero = myImg.substr(1,2)

	if (eval(nNumero)>1) {
		nNumero = eval(nNumero)-1;
		var im=qType + nNumero;
		myPopup(Carp,im)
	} 
	else {window.alert('Esta imagen es la primera de la sección')}
}


function myPopupClose() {
	var blanket = window.parent.document.getElementById('blanket');
	blanket.style.display='none';
}

function toggle(div_id) {
	var el = document.getElementById(div_id);
	if ( el.style.display == 'none' ) {	el.style.display = 'block';}
	else {el.style.display = 'none';}
}

function blanket_size(popUpDivVar) {
	if (typeof window.innerWidth != 'undefined') {
		viewportheight = window.innerHeight;
	} else {
		viewportheight = document.documentElement.clientHeight;
	}
	if ((viewportheight > document.body.parentNode.scrollHeight) && (viewportheight > document.body.parentNode.clientHeight)) {
		blanket_height = viewportheight;
	} else {
		if (document.body.parentNode.clientHeight > document.body.parentNode.scrollHeight) {
			blanket_height = document.body.parentNode.clientHeight;
		} else {
			blanket_height = document.body.parentNode.scrollHeight;
		}
	}
	var blanket = document.getElementById('blanket');
	blanket.style.height = blanket_height + 'px';
	var popUpDiv = document.getElementById(popUpDivVar);
	popUpDiv_height=blanket_height/2-150;//150 is half popup's height
	//popUpDiv.style.top = popUpDiv_height + 'px';
	popUpDiv.style.top = 80 + 'px';
}
function window_pos(popUpDivVar) {
	if (typeof window.innerWidth != 'undefined') {
		viewportwidth = window.innerHeight;
	} else {
		viewportwidth = document.documentElement.clientHeight;
	}
	if ((viewportwidth > document.body.parentNode.scrollWidth) && (viewportwidth > document.body.parentNode.clientWidth)) {
		window_width = viewportwidth;
	} else {
		if (document.body.parentNode.clientWidth > document.body.parentNode.scrollWidth) {
			window_width = document.body.parentNode.clientWidth;
		} else {
			window_width = document.body.parentNode.scrollWidth;
		}
	}
	var popUpDiv = document.getElementById(popUpDivVar);
	window_width=window_width/2-150;//150 is half popup's width
	//popUpDiv.style.left = window_width + 'px';
	popUpDiv.style.left = 200 + 'px';
}
function popup(windowname,img) {
	blanket_size(windowname);
	window_pos(windowname);
	toggle('blanket');
	toggle(windowname);		
}	

function doEnviar(f) {
	/*Nombre*/
	if (f.Nombre.value.length == 0) {
		window.alert("Debe ingresar un Nombre.");
		f.Nombre.focus();
		return false;
	}
	vmsg = CheckAlfaNum(f.Nombre.value)
	if (vmsg != '' && vmsg != null ) {
		window.alert(vmsg);
		f.Nombre.focus();
		return false;
	}
	f.Nombre.value=f.Nombre.value.substring(0,30)

	/*Fecha*/
	if (f.Fecha.value.length == 0) {
		alert("Debe ingresar una fecha aproximada del evento.");
		f.Fecha.focus();
		return false;
	}
	vmsg = CheckAlfaNum(f.Fecha.value)
	if (vmsg != '' && vmsg != null ) {
		window.alert(vmsg);
		f.Fecha.focus();
		return false;
	}
	f.Fecha.value=f.Fecha.value.substring(0,30)
	/*Email*/
	if (f.Email.value.length == 0) {
		window.alert("Debe ingresar Email.");
		f.Email.focus();
		return false;
	}
	if (!isMail(f.Email.value)) {
		f.Email.focus();
		return false;		
	}
	f.Email.value=f.Email.value.substring(0,50)
	/*Comentario*/
	if (f.Comentario.value.length == 0) {
		alert("Debe ingresar un Comentario.");
		f.Comentario.focus();
		return false;
	}
	f.Comentario.value=f.Comentario.value.substring(0,250)		
	/*codigo*/
	if (f.txtCode.value.length == 0) {
		alert("Debe ingresar el codigo de Seguridad.");
		f.txtCode.focus();
		return false;
	}		
	f.action="contacto_procesar.asp";
	f.submit();
}

function VerificarIngresoLogin123(f) {
	if (f.txtClave.value.length == 0) {
		alert("La clave inicial no puede estar en blanco.");
		f.txtClave.focus();
		return false;
	}
	f.action="123accesoAM.asp"
	return true;
}

function doEnviarMail(f) {
	if (f.Asunto.value.length == 0) {
		window.alert("El Asunto no puede estar en blanco.");
		f.Asunto.focus();
		return false;
	}	
	if (f.Email.value.length == 0) {
		window.alert("El email no puede estar en blanco.");
		f.Email.focus();
		return false;
	}
	if (f.Comentario.value.length == 0) {
		window.alert("El comentario no puede estar en blanco.");
		f.Comentario.focus();
		return false;
	}
	f.action="123ProcesoAM.asp"
	return true;
}

function doDesconectarse() {
	window.parent.location.href="Desconectarse.asp";
}

function doVisualizarMensaje() {
	var opt = "center=yes,help=no,status=no,Width=760px,Height=585px,navNoWriteToCache"
	var Salutacion = "?Salutacion=" + document.all.Salutacion.value
	var Nombre = "&Nombre=" + document.all.Nombre.value
	var Comentario = "&Comentario=" + document.all.Comentario.value
	var url = "verEmail.asp"+Salutacion+Nombre+Comentario;
	var cVentana = window.open(url,"Show",opt);
}


/*-------------------------------------------------------------------------------------------------*/
function CheckAlfaNum(val) {
  var CharsValidos="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890 áéíóúñÑ-";
  for (i = 0; i < val.length; i++) {
	c = val.charAt(i);
	if ( CharsValidos.indexOf(c) == -1 ) {
		return "Por favor, debe ingresar caracteres válidos (a - z, A - Z, 0 - 9)";
		}
	}
}
function isMail(Cadena) {
	Punto = Cadena.substring(Cadena.lastIndexOf('.') + 1, Cadena.length)			// Cadena del .com
	Dominio = Cadena.substring(Cadena.lastIndexOf('@') + 1, Cadena.lastIndexOf('.')) 	// Dominio @lala.com
	Usuario = Cadena.substring(0, Cadena.lastIndexOf('@'))					// Cadena lalala@
	Reserv = "@/º\"\'+*{}\\<>?¿[]áéíóú#·¡!^*;,:"						// Letras Reservadas
	// Añadida por El Codigo para poder emitir un alert en funcion de si email valido o no
	valido = true
	
	// verifica qie el Usuario no tenga un caracter especial
	for (var Cont=0; Cont<Usuario.length; Cont++) {
		X = Usuario.substring(Cont,Cont+1)
		if (Reserv.indexOf(X)!=-1)
                	valido = false
	}

	// verifica qie el Punto no tenga un caracter especial
	for (var Cont=0; Cont<Punto.length; Cont++) {
		X=Punto.substring(Cont,Cont+1)
		if (Reserv.indexOf(X)!=-1)
			valido = false
	}
                        
	// verifica qie el Dominio no tenga un caracter especial
	for (var Cont=0; Cont<Dominio.length; Cont++) {
		X=Dominio.substring(Cont,Cont+1)
		if (Reserv.indexOf(X)!=-1)
			valido = false
		}

	// Verifica la sintaxis básica.....
	if (Punto.length<2 || Dominio <1 || Cadena.lastIndexOf('.')<0 || Cadena.lastIndexOf('@')<0 || Usuario<1) {
		valido = false
	}
	
	// Añadido por El Código para que emita un alert de aviso indicando si email válido o no
	if (valido) {
		//alert('Email válido.')
		return true
	} else {
		alert('Email no válido.')
		return false
	}
}


/*  */
var message="Si deseas esta imagen, escribenos y con gusto te la haremos llegar en el formato que desees.";
function clickIE() { 
	if (event.button==0) {
		void(0);//alert(message); 
		return false;
	} 
} 
function clickNS(e) { 
	if (document.layers||(document.getElementById&&!document.all)) { 
		if (e.which==2||e.which==3) { 
			void(0);//alert(message);
			return false; 
		} 
	} 
} 

if(window.navigator.appName=="Netscape") { 
	document.onmouseup=clickNS; 
	document.oncontextmenu=clickIE; 
	document.oncontextmenu=new Function("return false") 
} 
else if (window.navigator.appName=="Microsoft Internet Explorer") { 
	document.oncontextmenu=clickIE; 
} 
else if (window.navigator.appName=="Opera") { 

} 
else if (document.layers) { 
	document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS; 
} 
else { 
	document.onmouseup=clickNS; 
	document.oncontextmenu=clickIE; 
} 
//-->
