$(document).ready(function(){
	if (typeof(InitilizeMap)==='function')
		{
				InitilizeMap();	
		}

    $('.menu ul.ul_holder li.main_li').hover(function(){
            $(this).children('ul').show();
            $(this).addClass('li_hover');
            $(this).children('a').css({color:'#333333'});;
        },function(){
            $(this).children('ul').hide();
            $(this).children('a').css({color:'#ffffff'});
            $(this).removeClass('li_hover');
        });    
    $('.menu ul.ul_holder li.main_li ul li').hover(function(){
            $(this).children('a').css({color:'#555'});
            $(this).css({background:'#74d9ee'});
        },function(){
            $(this).children('a').css({color:'#fff'});
            $(this).css({background:'none'});
        });    
    
    $(".location").draggable();
    $(".turizam").draggable();
 
	$('.sub_menu ul li').hover(function(){$(this).children('span.menu_link').stop().animate({paddingTop:'10px'},300);},function(){$(this).children('span.menu_link').stop().animate({paddingTop:'0'},100);});    
    
    $('.sub_menu ul li').click(function(){var href = $(this).find("a").attr("href");if(href) {window.location = href;}}); 
    
    $('.page_sub_menu ul li').hover(function(){$(this).children('span.menu_link').stop().animate({paddingTop:'10px'},300);},function(){$(this).children('span.menu_link').stop().animate({paddingTop:'0px'},100);});    
    
    
     $('.page_sub_menu ul li').click(function(){var href = $(this).find("a").attr("href");if(href) {window.location = href;}}); 
    
	 
		if (typeof(Init_uploadify)==='function')
		{
				Init_uploadify();	
		}
		if (typeof(newpicturesControls)==='function'){
					newpicturesControls();
		}
	 if (typeof(galleryInit)==='function'){
		 galleryInit();
		 
    }
    if (typeof(contactPage_clickEvents)==='function'){
		 contactPage_clickEvents();
    }
	 
        
  
   $('#breadcrumb li:last-child').addClass('bread_last');
   
   $('#atrakcii').lazytooltiper({div_to_show:'.turizam',close_button:'#close-turizam',centered:true});
   $('.f_con_loc a').lazytooltiper({div_to_show:'.location',close_button:'#close-location',centered:true});
 
   
   $(".anythingSlider").anythingSlider({
            easing: "swing",                // Anything other than "linear" or "swing" requires the easing plugin
            autoPlay: false,                 // This turns off the entire FUNCTIONALY, not just if it starts running or not
            startStopped: false,             // If autoPlay is on, this can force it to start stopped
            delay: 6000,                    // How long between slide transitions in AutoPlay mode
            animationTime: 600,             // How long the slide transition takes
            hashTags: true,                 // Should links change the hashtag in the URL?
            buildNavigation: true,         // If true, builds and list of anchor links to link to each slide
            pauseOnHover: true,             // If true, and autoPlay is enabled, the show will pause on hover
            startText: "Start",             // Start text
            stopText: "Stop",               // Stop text
            navigationFormatter: null       // Details at the top of the file on this use (advanced use)
        });
        
   $('#mycarousel').jcarousel({
        vertical: true,
        scroll: 2
    }); 
   $('#mycarousel1').jcarousel({
        vertical: true,
        scroll: 2 
    }); 
    $('#mycarousel2').jcarousel({
        vertical: true,
        scroll: 2
    });
    $('.jcarousel-item img').hover(function(){
        $(this).addClass('i_hover');
    },function(){
        $(this).removeClass('i_hover');
    });
    
    $(".jcarousel-item 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>';
         }
    }); 
   
   $(".gal_thumbs li a[rel=thumb]").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>';
         }
    });
   
    $('.contr div').hover(function(){
        $(this).css({'background-position':'0 -55px'});
    },function(){
        $(this).css({'background-position':'0 0'});
    });
    
   
   $('.f_con_loc img').hover(function(){
       $(this).addClass('img_hover');
   },function(){
       $(this).removeClass('img_hover');
   });
   
   
   $('.c_content table td').hover(function(){
       $(this).css({background:'#418d96',color:'#fff'});
   },function(){
       $(this).css({background:'none',color:'#333'});
   });
   
   
   if ($('.baner').length>0) $('.baner').ahover({toggleEffect: 'both',moveSpeed:150}); 
   
});
