function openPicture(imageName,imageWidth,imageHeight,alt,posLeft,posTop) {

	newWindow = window.open("","newWindow","width="+imageWidth+",height="+imageHeight+",left="+posLeft+",top="+posTop);
	newWindow.document.open();
	newWindow.document.write('<html><title>'+alt+'</title><body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" onBlur="self.close()">'); 
	newWindow.document.write('<img src='+imageName+' width='+imageWidth+' height='+imageHeight+' alt='+alt+'>'); 
	newWindow.document.write('</body></html>');
	newWindow.document.close();
	newWindow.focus();
}
function Mostrar(menu){
	if (window.document.getElementById(menu).style.display =='none')
		window.document.getElementById(menu).style.display = '';
	else
		window.document.getElementById(menu).style.display ='none';
}
function movecube2(){
	 specifyimage=new Array() //Your images
specifyimage[0]="http://www.comoadelgazar.net/imagenes/surf.gif"
specifyimage[1]="http://www.comoadelgazar.net/imagenes/playa.gif"
specifyimage[2]="http://www.comoadelgazar.net/imagenes/peine.gif"
specifyimage[3]="http://www.comoadelgazar.net/imagenes/sansebastian.gif"
specifyimage[4]="http://www.comoadelgazar.net/imagenes/playa2.gif"
specifyimage[5]="http://www.comoadelgazar.net/imagenes/playa3.gif"
specifyimage[6]="http://www.comoadelgazar.net/imagenes/playa4.gif"

 delay=3000 //3 seconds

//Counter for array 
 count =1;

 cubeimage=new Array()
for (i=0;i<specifyimage.length;i++){
cubeimage[i]=new Image()
cubeimage[i].src=specifyimage[i]
}
setTimeout('movecube()',delay);
}
function movecube(){
if (window.createPopup)
cube.filters[0].apply()
document.images.cube.src=cubeimage[count].src;
if (window.createPopup)
cube.filters[0].play()
count++;
if (count==cubeimage.length)
count=0;
setTimeout("movecube()",delay)
}
function Imprimir(enlace){
	window.open("http://www.comoadelgazar.net/Print.php?enlace="+enlace,"","height=600,width=500");
}
function EnviarEmail2(enlace){
					var email = window.document.FormEmail.email.value;
					var nombre = window.document.FormEmail.nombre.value;
					var comentarios = window.document.FormEmail.comentarios.value;
			  	if (window.XMLHttpRequest){
			  		HTTPobj =new XMLHttpRequest();
			  		
			  		//HTTPobj.overrideMimeType('text/xml');
			  	}
			  	else
			    	HTTPobj = new ActiveXObject("Microsoft.XMLHTTP");
				 HTTPobj.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
				 HTTPobj.onreadystatechange = respuesta;
			   HTTPobj.open("GET","http://www.comoadelgazar.net/enviamail.php?email="+email+"&nombre="+nombre+"&comentarios="+comentarios, false);
			   HTTPobj.send();
			    
					if (HTTPobj.responseText.substring(0,4).toString() == "aaaa"){
					
						alert("");
					}
					else{
						alert("");
					  window.document.getElementById("EnviarEmail").innerHTML = HTTPobj.responseText;
					}
}

var http_request = false;
		//window.document.getElementById("EnviarEmail").innerHTML ="<img src='http://www.comoadelgazar.net/imagenes/reloj.gif' align='center' border=0>";
    function EnviarEmail(enlace,directorio) {
				var email = window.document.FormEmail.email.value;
					var nombre = window.document.FormEmail.nombre.value;
					var comentarios = window.document.FormEmail.comentarios.value;
        http_request = false;
        if (window.XMLHttpRequest) { // Mozilla, Safari,...
            http_request = new XMLHttpRequest();
            
        } else if (window.ActiveXObject) { // IE
            try {
                http_request = new ActiveXObject("Msxml2.XMLHTTP");
            } catch (e) {
                try {
                    http_request = new ActiveXObject("Microsoft.XMLHTTP");
                } catch (e) {}
            }
        }

        if (!http_request) {
            alert('Falla :( No es posible crear una instancia XMLHTTP');
            return false;
        }
        http_request.onreadystatechange = alertContents;
        http_request.open('GET', "http://www.comoadelgazar.net/enviamail.php?email="+email+"&nombre="+nombre+"&enlace="+enlace+"&directorio="+directorio+"&comentarios="+comentarios, true);
        http_request.send(null);

    }

    function alertContents() {

        if (http_request.readyState == 4) {
            if (http_request.status == 200) {
                if (http_request.responseText == "1"){
                	window.document.getElementById("EnviarEmail").innerHTML = "<center><h5 align=center>Message sent correctly.</h5>Thank you for trusting us and using our services. Please send us any suggestions on our web page. <br><img align=center style='cursor:hand;cursor:pointer;' border='0' src='http://www.comoadelgazar.net/imagenes/cerrar.gif' onclick=window.document.getElementById('EnviarEmail').style.display='none';></center>";
                }
            } else {
                alert('Hubo problemas con la petici�n.');
            }
        }

    }
