$(document).ready(function () {
    $("#heightholder").removeClass("notabsdisplay");    //remove black bg/padding cssclass from tabs area as we are restyling it for tabs
    
    //Long Description
    $("#longDesc").hide();
    $(".showlongDesc").click(function () {
        $('#longDesc').show();
        $(".showlongDesc").hide();
    });
    $(".hidelongDesc").click(function () {
        $('#longDesc').hide();
        $(".showlongDesc").show();
    });

    //add styles
    $('#heightholder').css({
        'height': '422px'  //422px
    });
    $('#reldiv').css({     // element that tabs & content are positioned to
        'height': '422px', //422px
        'position': 'relative',
        'top': '0',
        'left': '0'
    });
    $('#t1, #t2, #t3, #t4').css({ // buttons / tabs absolute positioning
        'position': 'absolute',
        'width': '145px',
        'padding': '2px 0px 0px 7px',
        'font-size': '18px'
    });
    $('#t1').css({
        'left': '0px'
    });
    $('#t2').css({
        'left': '156px'
    });
    $('#t3').css({
        'left': '312px'
    });
    $('#t4').css({
        'left': '468px'
    });
    $('.tabContent').css({     //in content boxes
        'color': '#dddddd',
        'position': 'absolute',
        'top': '28px', //32
        'left': '0px',
        'width': '620px',
        'height': '352px',
        'overflow': 'auto',
        'background-color': '#000000'
    });
    // Rcol forms Show Hide
    $('#bookform').hide();
    $('#infoform').hide();
    $('#showform').hide();

    $('#booknow').click(function () {
        $('#bookform').toggle();
        $('#bookform').focus();
        $('#infoform').hide();
    });
    $('#infonow').click(function () {
        $('#infoform').toggle();
        $('#infoform').focus();
        $('#bookform').hide();
    });
    $('#shownow').click(function () {
        $('#showform').toggle();
        $('#showform').focus();
        $('#infoform').hide();
        $('#bookform').hide();
    });

    // End Rcol forms




    // initial TABS setup
    $('#tab2').hide();
    $('#tab3').hide();
    $('#tab4').hide();
    $('#t1, #t2, #t3, #t4').addClass('taboff');
    $('#t1').removeClass('taboff').addClass('tabon');


    //T1
    $('#t1').click(function () {
        // tabs content
        $('#tab2, #tab3, #tab4').hide();
        $('#t1, #t2, #t3, #t4').addClass('taboff');
        $('#t1').removeClass('taboff').addClass('tabon');
        $('#tab1').show();
        $('#tab1').focus();
    });
    // T2
    $('#t2').click(function () {
        // tabs content
        $('#tab1, #tab3, #tab4').hide();
        $('#t1, #t2, #t3, #t4').addClass('taboff');
        $('#t2').removeClass('taboff').addClass('tabon');
        $('#tab2').show();
        $('#tab2').focus();
    });
    //T3
    $('#t3').click(function () {
        // tabs content
        $('#tab1, #tab2, #tab4').hide();
        $('#t1, #t2, #t3, #t4').addClass('taboff');
        $('#t3').removeClass('taboff').addClass('tabon');
        $('#tab3').show();
        $('#tab3').focus();
    });
    //T4
    $('#t4').click(function () {
        // tabs content
        $(' #tab1, #tab2, #tab3').hide();
        $('#t1, #t2, #t3, #t4').addClass('taboff');
        $('#t4').removeClass('taboff').addClass('tabon');
        $('#tab4').show();
        $('#tab4').focus();
    });

    //====SQUEEZE=================================================================
    var pop = function () {  // function for grey out and box
       $('#screen').css({ "display": "block", opacity: 0.7, "width": $(document).width(), "height": $(document).height() });
       $('body').css({ "overflow": "hidden" });
       //stick the footer at the bottom of the page if we're on an iPad/iPhone due to viewport/page bugs in mobile webkit 
       if (navigator.platform == 'iPad' || navigator.platform == 'iPhone' || navigator.platform == 'iPod') {
            $('#mainclaimForm').css({ "position": "static" });
        };
        $('#mainclaimForm').css({ "display": "block" });
        $('#m_name_tb').focus();
       return false;
    }

    $('#button').click(pop);    // open the popupbox

    $('#closebox').click(function () {    // clodse the popupbox
       $('#mainclaimForm').css("display", "none");
       $('body').css({ "overflow": "scroll" });
      $('#screen').css("display", "none");
       return false;
    })
    $(window).resize(function () {
       $('#mainclaimForm').css("display") == 'block' ? pop.call($('#button')) : "";
    });

//  $(window).resize(pop);   // call again if window is resized 


   function hei() {
       var winH = $(window).height();  // viewport
       var docH = $('body').height(); // doc           
       if ($('#hold').length != 0) {
           if (winH > docH) {                //$('.coltwo').height($(window).height() - 140);
               $('#hold').css('min-height', $(window).height() - 10);
           }
       }     
   } // hei 
   hei();
   $(window).resize(hei);
});


