$(document).ready(function(){
    if (typeof(InitilizeMap)==='function')
        {
                InitilizeMap();    
        }
     //init uploadify, the function is inline defined in views/pages/contact_page
     
        if (typeof(Init_uploadify)==='function')
        {
                Init_uploadify();    
        }
        if (typeof(newpicturesControls)==='function'){
                    newpicturesControls();
        }
     if (typeof(galleryInit)==='function'){
         galleryInit();
         
    }
    if (typeof(contactPage_clickEvents)==='function'){
         contactPage_clickEvents();
    }
     
      $('.menu ul li').hover(function(){
          $(this).addClass('menu_h');
          $(this).children('a').addClass('a_color');
          $(this).children('ul').show();
      },function(){
          $(this).removeClass('menu_h');
          $(this).children('a').removeClass('a_color');
          $(this).children('ul').hide();
      });
      
      $('.menu ul li').click(function(){
         var href = $(this).find("a").attr("href");
         if(href) {
         window.location = href;
         }
      }); 
       
     if ($('.side_menu ul li').length>0) $('.side_menu ul li').ahover({moveSpeed: 100});
     $('.side_menu ul li').click(function(){
         var href = $(this).find("a").attr("href");
         if(href) {
         window.location = href;
         }
      });
      
      
     $('.input-field label[for=message_body]').css({padding:'10px 0',display:'block'});
     
     $('.agg_p_image a img').hover(function(){
         $(this).stop().animate({left:'-15px',width:'220px'},200);
     },function(){
         $(this).stop().animate({left:'0',width:'190px'},200);
     });
     $('.p_image a img').hover(function(){
         $(this).stop().animate({left:'-15px',width:'220px'},200);
     },function(){
         $(this).stop().animate({left:'0',width:'190px'},200);
     });
     
      $('#lazy').lazyslider({btnsHeight:13,btnsWidth:13,slowcontrols:false,fastrightPos:78,fastleftPos:65});
      
       $(".lazyslider-container ul li a[rel=example_group]").fancybox({
         'transitionIn' : 'elastic',
         'transitionOut' : 'elastic',
         'easingIn' : 'easeInOutExpo',
         'easingOut' : 'easeInBack',
         'titlePosition' : 'over',
         'titleShow' : false,
         'titleFormat' : function(title, currentArray, currentIndex, currentOpts) {
         return '<span id="fancybox-title-over">' + (title) + '</span>';
         }
    });
    
     $('#lazy li a img').hover(function(){
         $(this).stop().animate({left:'2px',width:'208px',top:'0px'},200);
     },function(){
         $(this).stop().animate({left:'16px',width:'180px',top:'7px'},200);
     });
     

     
});
