// JavaScript Document
function infoBanerHome(id){
	//alert(id);
	var capa = document.getElementById(id);
	var div = document.createElement("div");
	div.setAttribute("id", "contenido");
	//div.innerHTML = "sdfsdffdfdsfsdfsfds";
	capa.appendChild(div);
	
	jQuery.ajax({
	   type: "POST",
	   url: "/inc/banershome.php",
	   //data: "image_id="+image_id,
	   success: function(html){	   
			jQuery("#contenido").html(html);
			jQuery("#contenido").css({
					width:"400px",
					zIndex:"-1",
					marginLeft:"210px"
			});
			jQuery("#banerHome1").css("width","auto").css("height","auto");
			
			jQuery("#banerHome1").mouseout(function() {
				delete_infoBanerHome('banerHome1');
			});
			   }
			   
			
	   });

}
function delete_infoBanerHome(id){
	var div = document.getElementById('contenido');
	padre = div.parentNode;
	jQuery("#"+id).css("width","200px").css("height","158px");
	padre.removeChild(div);
	

}

function estiloOn(which, estilo){
//alert (estilo);
if (document.all||document.getElementById){
which.className= estilo;
}
}

function zonaAjax1(ruta) {
	//alert(ruta);
	jQuery.ajax({
	   type: "POST",
	   url: ruta,
	   //data: "image_id="+image_id,
	   success: function(html){	   
			jQuery("#zonaAjax1").html(html);
			jQuery('#photos').galleryView({
				panel_width: 310,
				panel_height: 220,
				overlay_height:50,
				frame_width: 86,
				frame_height: 54,
				background_color: '#333',
				nav_theme: 'light'
			});
			window.lightwindowInit();
		}	
	});
	
}

function openDiv(codi) {
	jQuery("#"+codi).each(function () {
			if (jQuery(this).css("display")=="none") {
				jQuery(this).slideDown("slow");
			} else {
				jQuery(this).slideUp("slow");
			}
	});
}

function enviarform(archivo)
{
	//alert(archivo);
	if (archivo == "altaclub") {
		if (document.formulario.nombre.value==''){
			alert("Falta el Nombre");return false;
		}else if (document.formulario.apellidos.value==''){
			alert("Faltan los apellidos");return false;
		}else if (document.formulario.mail.value==''){
			alert("Falta el Email");return false;
		}else if (document.formulario.pais.value==''){
			alert("Falta el Pais");return false;
		}
	}
	
	document.formulario.action = "/form/"+archivo+".php";
	document.formulario.submit();
}

function lightWin(pathImagen) {
		
		//alert (pathImagen);
		var titImagen = "Cheque Regalo";
		var ruta = pathImagen;
		//alert (ruta);
		lightwindowInit();
		myLightWindow.activateWindow({
			href: ruta, 
			title: titImagen,
			author: 'rocblanc.com', 
			caption: '',
			width:600,
			height:390
		});
		
		//return false;
	}


