$(function() {

    
    
    $(".MMDataCaptureForm_ErrorTD span").attr("style","");
    $("textarea").attr("style","");
    
    $(".content_left .MMDataCaptureForm_Table tr").attr("style","border-top: 1px dotted #666;");
    $(".content_left .MMDataCaptureForm_Table tr:first").attr("style","border-top: 0px;");
    
    if ($("textarea").is(":visible")) {
        $(".content_left .MMDataCaptureForm_Table tr:last").attr("style","border-bottom: 1px dotted #666; ");
    }
    
        
    $("#top_nav a:first").attr("style","border-left: none; padding-left: 0px; text-align: left;");
    $("#top_nav a:last").attr("style","padding-right: 0px; text-align: left;");
    
    $("table.NavigationMenu td:last").attr("style","border-right: 0px dotted #cc9966;");
    $(".accommodation:first").attr("style","margin-top: 0px;");
    if ($.browser.msie) { 
            $(".accommodation:first").attr("style","margin-top: 10px;");  
        }
    
    var blogContent = $(".blogFeed").html();
        $("#blogFeed").html(blogContent);
        $("#blogFeed div:first").addClass("first_blog");
        $(".first_blog .blog_desc").show();
        
   
    $("#news .news_post:first").addClass("first_news");
    $("#news .news_post:first .news_desc").show();
    $(".first_news a").attr("style","color: #fff; border: none; background: #273040; height: 23px; padding: 7px 7px 0; width: 260px; line-height: 14px;");


    $(".price:first, .info:first").show();
    
    if ($(".info:first").is(":visible")) {
        $(".home_offer:first").addClass("first");
    }
    
    
    $(".home_offer").hover(function(){
        $(".price, .info").hide();
        $("div,.price,.info",this).show();
        $(".home_offer:first").removeClass("first");
        $(".home_mast_image div div div div").show();
        $(".home_mast_image div div div div:first").hide();
        $(".home_mast_image div div div div:last").hide();
        
        $(".home_offer1").removeClass("first");
    },function(){
        $(".home_offer").addClass("first");
        $(".home_offer:first").removeClass("first");

            if ($(".price").not(":visible")) {
     
            }
    });

    $(".home_offer:first").hover(function(){
        $(".price, .info").hide();
        $("div,.price,.info",this).show();
        $(".home_offer").removeClass("first");
        $(".home_offer1").removeClass("first");
        $(".home_offer:first").removeClass("first");
        $(".home_mast_image div div div div:first").show();
    },function(){
        $(".home_offer").removeClass("first");
        $(".home_offer:first").addClass("first");

            if ($(".price").not(":visible")) {
     
            }
    });
    
    
    
    $(".home_offer1").hover(function(){
        $(".price, .info").hide();
        $("div,.price,.info",this).show();
        $(".home_offer").removeClass("first");
        $(".home_mast_image div div div div").hide();
        $(".home_mast_image div div div div:first").hide();
        $(".home_mast_image div div div div:last").show();
    },function(){
        $(".home_offer1").removeClass("first");
        $(".home_offer1:first").addClass("first");

            if ($(".price").not(":visible")) {
     
            }
    });
    
    $(".acc_detail_image a").lightBox();
    $(".acc_detail_image:last").attr("style","margin-right: 0px;");
    
    if ($(".brochure_download").is(":visible")) {
        $(".menu_download").attr("style","margin-top: -10px;");
    }
    
    $(".paging a").each(function(){
        var getStyle = $(this).attr("style");
        if (getStyle=="font-weight: bold; text-decoration: underline;") {
            $(this).css("text-decoration","none").css("background","#00338e");
        }
    });
    
    $(".paging a").each(function(){
        $(this).html($(this).html().replace("Next &gt;","&gt;").replace("&lt; Prev","&lt;"));
    });
    
    var urlsubnav = window.location;
    $("#top_nav div div a[href$="+urlsubnav+"]").addClass("active");
    
    
    var chosenOffer=$.cookie("offer");
        if (chosenOffer) {
            $("#C865_5_12_textbox").attr("value",chosenOffer);
        }
        $(".book_this_offer a").click(function(){
            var thisOffer=$(this).attr("title");
            $.cookie("offer",thisOffer,{path:'/'});
            window.location="http://www.theliner.co.uk/offers/offer-enquiry.phuse";
            return false;
        });
        $(".clear").click(function(){
            $.cookie("offer",null);
            window.location=location.href;
        });
        
        if (($.browser.safari)) {
            $("#top_nav *").attr("style","float: right; text-align: right;");
            $("#top_nav a").attr("style","text-align: left;");
            $("#top_nav a:first").attr("style","text-align: left; border: 0;");
        }
        
        if (($.browser.mozilla)) {
            $("#top_nav *").attr("style","float: right; text-align: right;");
            $("#top_nav a").attr("style","text-align: left;");
            $("#top_nav a:first").attr("style","text-align: left; border: 0;");
        }

		
       
        $(".virtual_tour a").attr("class","fancybox iframe");
        $(".fancybox").fancybox({"frameWidth":643,"frameHeight":483,"hideOnContentClick":false});
		
});