// JavaScript Document
//include("jquery-1.4.2.min.js");

$(document).ready(function(e){
						   
	$("a").click(function(e){
		e.preventDefault();
	})

	$("a").bind('mouseover',function(e){
		window.status='';return true;
	});

	$("#upbanner").click(function(){
		window.location="./index.php";
	  });

	$(".botoneravertical ul div").click(function(e){
		if ($(e.target).is("li"))
		{
			if ($(e.target).parent().next().hasClass("subsecciones"))
				$(e.target).parent().next().slideToggle();
			else
				window.location=$(e.target).children().attr("href");
		}
			
		if ($(e.target).is("a"))
		{
			if ($(e.target).parent().parent().next().hasClass("subsecciones"))
				$(e.target).parent().parent().next().slideToggle();
			else
				window.location=$(e.target).attr("href");
		}
	});
		
	$(".botoneraservicios").after('<div class="bannerauspicio2"><iframe src="http://www.facebook.com/plugins/likebox.php?href=http://www.facebook.com/pages/Hoteles-y-Gastronomia/161044987251103&amp;width=180&amp;colorscheme=light&amp;connections=0&amp;stream=false&amp;header=false&amp;height=100" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:180px; height:100px;" allowTransparency="true"></iframe></div>');
			
	$(".subsecciones").click(function(e){
		if ($(e.target).is("li"))
			window.location=$(e.target).children().attr("href");

		if ($(e.target).is("a"))
			window.location=$(e.target).attr("href");
	});

	$("head").append("<LINK REL='SHORTCUT ICON' HREF='images/icono.ico'>");

	$("head").append("<script type='text/javascript'>var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-19307741-1']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script>");

	$(".facebook").bind({
		mouseover:function(){
			$(this).children().children().attr({'src':'images/facebookOver.png'});
		},
		mouseout:function(){
			$(this).children().children().attr({'src':'images/facebookGris.png'});
		},
		click:function(){
			window.open('http://www.facebook.com/pages/Hoteles-y-Gastronomia/161044987251103',"_blank");
		}		
	});

	$(".twitter").bind({
		mouseover:function(){
			$(this).children().children().attr({'src':'images/twitterOver.png'});
		},
		mouseout:function(){
			$(this).children().children().attr({'src':'images/twitterGris.png'});
		},
		click:function(){
			window.open('http://www.twitter.com',"_blank");
		}
	});

	$(".contbot").bind({
		mouseover:function(){
			$(this).css("background","#fff");	
		},
		mouseout:function(){
			$(this).css("background-image","url(images/fdobotonppal.jpg)");
		}			   
	});

	$(".subsecciones li").bind({
		mouseover:function(){
			$(this).css("background","#ffc");	
		},
		mouseout:function(){
			$(this).css("background","#f9f9f9");
		}			   
	});


	$(".acciones_auspicio ul li img").bind({
		mouseover:function(e){
			$(".msj_emergentes").css("top",(e.pageY-45)); $(".msj_emergentes").css("left",(e.pageX-20));
			$(".msj_emergentes").html($(this).attr("alt"));			
			$(".msj_emergentes").css("visibility","visible");			
		},
		mouseout:function(e){
			$(".msj_emergentes").css("visibility","hidden");			
			$(".msj_emergentes").css("top",0); $(".msj_emergentes").css("left",0);
		}
	});

	$(".acciones_auspicio ul li img, .foto_auspicio_central a img ").click(function(){
			window.alert("A la brevedad le ofreceremos toda la informacion.");
	});



	$(".contbotonerahorizontal ul li").bind({
		mouseover:function(){
			$(this).css("color","#fff");	
		},
		mouseout:function(){
			$(this).css("color","#edd");
		},		
		click:function(){
			window.location=$(this).children().attr("href");
		}
	});
	
	$(".botoneraservicios ul div li").bind({
		mouseover:function(){			 
			$(this).children().css("color","#e85");
			$(this).parent().css("background","#ffd");				
		},
		mouseout:function(){			 
			$(this).children().css("color","#824A4A");
			$(this).parent().css("background-image","url(images/fdobotonserv.jpg)");
		},
		click:function(){			 
			window.open($(this).children().attr("href"),$(this).children().attr("target"));
		}
	});


	$(".activar_link").click(function(){ 
		window.open($(this).attr("href"),$(this).attr("target"));
	});

});
