$(document).ready(function(){  

//$("ul.subnav").parent().append("<span><span>");

$("img").hover(function() {
	  $(this).stop().animate({ opacity: "0.9"}, 400);
	}, function() {
	  $(this).stop().animate({ opacity: "1"}, 400);
	});
	
$(".thumb_single").hover(function() {
	  $(this).stop().animate({ opacity: "1"}, 400);
	}, function() {
	  $(this).stop().animate({ opacity: "0.8"}, 400);
	});
	
$(".search_submit, .search_field, .comments_input, .comments_textarea, #language_flags img, .module_hotel_search_input_text").hover(function() {
	  $(this).stop().animate({ opacity: "1"}, 200);
	}, function() {
	  $(this).stop().animate({ opacity: "0.5"}, 400);
	});
	
$("#footer_logo img, .module_box_featured_element").hover(function() {
	  $(this).stop().animate({ opacity: "1"}, 400);
	}, function() {
	  $(this).stop().animate({ opacity: "0.8"}, 400);
	});
	
	$( "#checkin_date, #checkout_date" ).datepicker({
				showOn: "focus",
				dateFormat: "dd.mm.yy",
				prevText: "",
				nextText: "",
				buttonImageOnly: true
			});

	
//$(".topnav li").addClass("active");

//$(".topnav li").addClass("active"); .css("background-image", "1px solid red").animate({ "margin-left": "20px" }, 300);

 //Only shows drop down trigger when js is enabled (Adds empty span tag after ul.subnav*)  
	
	$("ul.topnav li").hover(function() {
		$(this).addClass("topnav_hover");
	}, function() {
		$(this).removeClass("topnav_hover");
	});
	
	
	
    $("ul.topnav li a").hover(function() { //When trigger is clicked...  
  
	
  
        //Following events are applied to the subnav itself (moving subnav up and down)  
        $(this).parent().find("ul.subnav").show(); //Drop down the subnav on click  
  
        $(this).parent().hover(function() {  
        }, function(){  
            $(this).parent().find("ul.subnav").hide(); //When the mouse hovers out of the subnav, move it back up  
        });  
  
        //Following events are applied to the trigger (Hover events for the trigger)  
        }).hover(function() {  
            $(this).addClass(""); //On hover over, add class "subhover"  
        }, function(){  //On Hover Out  
            $(this).removeClass(""); //On hover out, remove class "subhover"  
    }); 

$("#photo-rotator").tabs({fx:{opacity: "toggle"}}).tabs("rotate", 3000);
$('#photo-rotator').css('height', $('#photo-rotator').height() + 'px');
$('#photo-rotator').css('width', $('#photo-rotator').width() + 'px');

});


