/* Author: 

*/

$(document).ready(function () {


  var $winwidth = $(window).width();

  if($winwidth > 1300){
                $("img.bgImage").attr({
                        width: $winwidth
                });
                }
  else{
    
    $("img.bgImage").attr({
                        width: 1300
                });
    
    
  }
                $(window).bind("resize", function(){

                  
                        var $winwidth = $(window).width();

                  if($winwidth > 1300){
                        $("img.bgImage").attr({
                                width: $winwidth
                        });
                }
                  else{
                    
                    
                    $("img.bgImage").attr({
                        width: 1300
                });
                    
                    
                    
                  }
      });
  

  
      $(".panelHeader").hover(function () {

        $(this).css("cursor", "pointer");


    },

    function () {

        $(this).css("cursor", "default");


    });




    $(".searchTextBox").each(function () {

        if (!$.trim(this.value).length) {

            $(this).val("Search");

        }

        $(this).focus(function () {

            $(this).val("");

        });


        $(this).blur(function () {

            if ((!$.trim(this.value).length) || (!$.trim(this.value) == "Search")) {

                $(this).val("Search");

            }

        });


    });

    $("#contactsHolder").css("display", "none");


    


    $(".close").click(function () {

        
        $('.loginDDHolder').toggle();
        return false;



    });


    $(".openLogin a").click(function () {


        $('.loginDDHolder').toggle();
        return false;



    });

  $("#topBar").click(function(){
    
    $("#contactsHolder").slideToggle();
                    
  });

    $("#topBar").hover(function () {

        $(this).css("cursor", "pointer");


    },

    function () {


        $(this).css("cursor", "default");


    }

    );

    $(".loginDDHolder").each(function () {


        $(".loginHolder").append($(this));


    });


    $("li.personHolder, li.personHolder img").hover(function () {


        $(this).css("cursor", "pointer");

    },

    function () {

        $(this).css("cursor", "default");


    });


    $("li.personHolder").each(function () {

        $(this).fancybox({

            'overlayShow': true,
            'content': $(this).find(".bioHolder").html(),
            'showCloseButton': false,
            'titleShow': false
        });

    });
  
  $(".dataTrigger").each(function(){
                  
                  
      $(this).fancybox({

            'overlayShow': true,
            'showCloseButton': false,
            'titleShow': false
        });
      
  });

        $('.homePanels').accordion({ autoHeight: false, animated: 'bounceslide' });

      

    $('.carouselHolder').cycle({ 
    fx:      'fade', 
    speed:    200, 
    timeout:  6000,
      pause: 1 

        });   





    



    


}

);





















