jQuery(document).ready(function(){
    
    /**
    * Home page sliders
    */
    var divIds = new Array("#911medcard", "#911propesafe", "#911finanesafe", "#911mypetsafe");
    var itemIds = new Array("#medicalIDCard", "#myPropertyeSafe", "#myFinancialeSafe", "#myPeteSafe");

        $(divIds[0]).mouseover(function()
        {
            $(itemIds[0]).show();
            $(itemIds[0]).mouseover(function()
            {
                $(itemIds[0]).show(); 
            }).mouseout(function()
            {
                $(itemIds[0]).hide();
            })
        }).mouseout(function()
        {
            $(itemIds[0]).hide();    
        });        
        
        $(divIds[1]).mouseover(function()
        {
            $(itemIds[1]).show();
            $(itemIds[1]).mouseover(function()
            {
                $(itemIds[1]).show();
            }).mouseout(function()
            {
                $(itemIds[1]).hide();
            })
        }).mouseout(function()
        {
            $(itemIds[1]).hide();    
        });
                                             
        $(divIds[2]).mouseover(function()
        {
            $(itemIds[2]).show();
            $(itemIds[2]).mouseover(function()
            {
                $(itemIds[2]).show();
            }).mouseout(function()
            {
                $(itemIds[2]).hide();
            })
        }).mouseout(function()
        {
            $(itemIds[2]).hide();    
        });
                  
        $(divIds[3]).mouseover(function()
        {
            $(itemIds[3]).show();
            $(itemIds[3]).mouseover(function()
            {
                $(itemIds[3]).show();
            }).mouseout(function()
            {
                $(itemIds[3]).hide();
            })
        }).mouseout(function()
        {
            $(itemIds[3]).hide();    
        });
        
   
   /**
   * video player
   */
   $('.videoThumb').click(function()
   {
       $('.video-list').slideDown('fast', function()
       {
           $(".video-player-container").show('slide', { direction: "right" }, 500, function(){
              $.post('getvid.php', { vid: $("#vidID").val()}, function(data)
              {                 
                  $("#video-player").html(data);
              });         
           });           
       });    
   });
   
   $('#close_button').click(function()
   {
       $(".video-player-container").hide('slide', { direction: "right" }, 500, function()
       {
           $('#video-player').empty();
           $('.video-list').slideUp('fast');    
       }); 
       
   }) 
});

/**
* get the video player  
*/
function getVideo($vid)
{ 
  $.post('getvid.php', { vid: $vid}, function(data)
  {                 
      $("#video-player").html(data);
  });
}


