$(document).ready(function(){
    
	if (typeof(InitilizeMap)==='function')
		{
			InitilizeMap();	
		}
        
    if (typeof(Init_uploadify)==='function')
		{
			Init_uploadify();	
		}
	if (typeof(newpicturesControls)==='function'){
			
            newpicturesControls();
            
		}
    $.each(ADAMANTIUM_FRONT_NAMESPACE, function(key, value) { 
           var fanction =value;

           fanction();
       });
    
    $('#awards ul li a[rel=nagradi]').fancybox({
             'transitionIn' : 'elastic',
             'transitionOut' : 'elastic',
             'easingIn' : 'easeInOutExpo',
             'easingOut' : 'easeInBack',
             'titlePosition' : 'over',
             'titleShow' : true,
             'titleFormat' : function(title, currentArray, currentIndex, currentOpts) {
             return '<span id="fancybox-title-over">' + (title) + '</span>';
         }
     }); 
     
     $('.mp_link a').hover(function(){
         
         $(this).find('span').stop().animate({backgroundPosition:'0 0'},150);
         
     },function(){
         
         $(this).find('span').stop().animate({backgroundPosition:'-19px 0'},1);
         
     });
     
     $('.product_holder:last-child').removeClass('divider');

     $('.anythingSlider').anythingSlider({
          // Appearance
          width               : null,      // Override the default CSS width
          height              : null,      // Override the default CSS height
          resizeContents      : true,      // If true, solitary images/objects in the panel will expand to fit the viewport
          // Navigation
          startPanel          : 1,         // This sets the initial panel
          hashTags            : true,      // Should links change the hashtag in the URL?
          buildArrows         : true,      // If true, builds the forwards and backwards buttons
          buildNavigation     : false,      // If true, buildsa list of anchor links to link to each panel
          navigationFormatter : null,      // Details at the top of the file on this use (advanced use)
          forwardText         : "&raquo;", // Link text used to move the slider forward (hidden by CSS, replaced with arrow image)
          backText            : "&laquo;", // Link text used to move the slider back (hidden by CSS, replace with arrow image)
          // Slideshow options
          autoPlay            : true,      // This turns off the entire slideshow FUNCTIONALY, not just if it starts running or not
          startStopped        : false,     // If autoPlay is on, this can force it to start stopped
          pauseOnHover        : true,      // If true & the slideshow is active, the slideshow will pause on hover
          resumeOnVideoEnd    : true,      // If true & the slideshow is active & a youtube video is playing, it will pause the autoplay until the video has completed
          stopAtEnd           : false,     // If true & the slideshow is active, the slideshow will stop on the last page
          playRtl             : false,     // If true, the slideshow will move right-to-left
          startText           : "Start",   // Start button text
          stopText            : "Stop",    // Stop button text
          delay               : 3000,      // How long between slideshow transitions in AutoPlay mode (in milliseconds)
          animationTime       : 600,       // How long the slideshow transition takes (in milliseconds)
          easing              : "swing"    // Anything other than "linear" or "swing" requires the easing plugin
        });
      
      
      $('.frontpage_menu ul.ul_holder li.main_li:first-child').addClass('selected');
      
      $('.menu ul.ul_holder li.main_li').hover(function(){
          if($(this).hasClass('selected')){
              return false;
          }else{
            $(this).children('span').stop().animate({backgroundPosition:"(0 0)"}, {duration:350});    
          }
      },function(){
          if($(this).hasClass('selected')){
              return false;
          }else{
            $(this).children('span').stop().animate({backgroundPosition:"(0 53px)"}, {duration:350});
          }
      });
      
      
    
           
});
