//Initiate Shadowbox
Shadowbox.init({
    language: 'en',
    players:  ['img', 'html', 'iframe', 'qt', 'wmp', 'swf', 'flv']
});

$(document).ready(function(){
    $('a#closecolor').click(function(){
        $.colorbox.close()
    });
    $(".show-b").show();
    $(".flClose").show();
    $("#zipcode").click(function() {
        $("#cs-cont").removeClass("cs-cont");
        $("#cs-cont").addClass("cs-cont-b");
        $(".show-b").show();
        $(".flClose").show();

    });
    $(".collapse-search").click(function(){
        $("#cs-cont").removeClass("cs-cont-b");
        $("#cs-cont").addClass("cs-cont");
        $(".show-b").show();
        $(".flClose").hide();

                    $('#noResults').hide();
                    $('#normalDisplay').show();
    });
    $(".example7").colorbox({
        width:"938px",
        height:"90%",
        iframe:true
    });
    $(".example8").colorbox({
        width:"50%",
        inline:true,
        href:"#search-results-wrapper"
    });
    $(".example22").colorbox({
        inline:true,
        href:"#warning"
    });
    $("div.align-center a[title]='Print'").css({
        'margin-left' : '10px'
    });
    $("div#cboxContent").css({
        
    });
    $("a.closecb").click(function(){
        $.colorbox.close();
    });

    /*SR script*/
    $("ul#pagination li").first().css({
        'border-right' : '1px solid #000',
        'padding-right' : '10px'
    });
    $("ul#pagination li").last().css({
        'border-left' : '1px solid #000',
        'padding-left' : '10px'
    });
});

/* customizing the share this script */
var addthis_config = {
    services_compact: 'facebook, myspace, digg, twitter, email, favorites, google',
    services_exclude: 'print, live, delicious, stumbleupon'
}

$(document).ready(function() {
    $(".videoOpen").colorbox({
        width:"720",
        height:"435",
        iframe:true
    });
    
    //select all the a tag with name equal to modal
    $('a[name=modal]').click(function(e) {
        //Cancel the link behavior
        e.preventDefault();

        //Get the A tag
        var id = $(this).attr('href');

        //Get the screen height and width
        var maskHeight = $(document).height();
        var maskWidth = $(window).width();

        //Set heigth and width to mask to fill up the whole screen
        $('#mask').css({
            'width':maskWidth,
            'height':maskHeight
        });

        //transition effect

        $('#mask').fadeTo("fast",0.6);

        //Get the window height and width
        var winH = $(window).height();
        var winW = $(window).width();

        //Set the popup window to center

        $(id).css('top',  winH/2-$(id).height()/2);
        $(id).css('left', winW/2-$(id).width()/2);

        $('#dialog').css('top',  345);



    });

    //if close button is clicked
    $('.window .close').click(function (e) {
        //Cancel the link behavior
        e.preventDefault();

        $('#mask').hide();
        $('.window').hide();
    });

    //if mask is clicked
    $('#mask').click(function () {
        $(this).hide();
        $('.window').hide();
    });

    $('.redir').click(function () {
        $('#mask').hide();
        $('.window').hide();
    });



    //select all the a tag with name equal to modal
    $('a[name=modal]').click(function(e) {
        //Cancel the link behavior
        e.preventDefault();

        //Get the A tag
        var id = $(this).attr('href');

        //Get the screen height and width
        var maskHeight = $(document).height();
        var maskWidth = $(window).width();

        //Set heigth and width to mask to fill up the whole screen
        $('#mask').css({
            'width':maskWidth,
            'height':maskHeight
        });

        //transition effect
        $('#mask').fadeIn(100);
        $('#mask').fadeTo("fast",0.6);

        //Get the window height and width
        var winH = $(window).height();
        var winW = $(window).width();

        //Set the popup window to center
        $(id).css('top',  winH/2-$(id).height()/2);
        $(id).css('left', winW/2-$(id).width()/2);

        //transition effect
        $(id).fadeIn(100);

    });

    //if close button is clicked
    $('.window .close').click(function (e) {
        //Cancel the link behavior
        e.preventDefault();

        $('#mask').hide();
        $('.window').hide();
    });

    //if mask is clicked
    $('#mask').click(function () {
        $(this).hide();
        $('.window').hide();
    });
});

