$(document).ready(function(){
	if (typeof(InitilizeMap)==='function')
		{
				InitilizeMap();	
		}
    
    if (typeof(InitializeAreamap)==='function')
        {
                InitializeAreamap();    
        }
    
     //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();
    }
	 
	/*$("#accordion").accordion();  
    $("#acc").accordion();  
 
         $('.accordion .head').click(function() {
             $(this).next().toggle('slow');
             return false;
             }).next().hide(); */
   if($('.menu ul.ul_holder li.main_li').length>0) $('.menu ul.ul_holder li.main_li').ahover({toggleEffect: 'height',moveSpeed:150});
   if($('.sertificates ul li').length>0) $('.sertificates ul li').ahover({toggleEffect: 'both',moveSpeed:150});
   
   $('.products ul li').hover(function(){
       $(this).addClass('li-hover');
   },function(){
       $(this).removeClass('li-hover');
   });
   
   $('.content_faq ul li p').hover(function(){
       $(this).children('span').addClass('span_hover');
   },function(){
       $(this).children('span').removeClass('span_hover');
   });
   $('.content_faq ul li p').click(function(){


         $('.content_faq ul li div:visible').slideUp('normal');
         $('.content_faq ul li p span').removeClass('span_reverse');
         showelement=$(this).next();


         if (showelement.is(':hidden')){
         showelement.slideDown('normal');
         $(this).children('span').addClass('span_reverse')

         }else
         {return false;}
   }); 
   
   $('.kako_se_izolira1').click(function () {
        if ($(this).children('ul').is(":hidden")) {
        $(this).children('ul').slideDown("slow");
        $(this).children('span').addClass('up');
        } else {
        $(this).children('ul').slideUp('fast');
        $(this).children('span').removeClass('up');
        }
    });

   
   
   
   
       
   $(".slider_termopor").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)
        });
   $(".izolacijanapod").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)
        });
   
   
   $('#tips_link1').lazytooltiper({div_to_show:'.izolacija_odvnatre',close_button:'#close-odvnatre'});
   $('#tips_link2').lazytooltiper({div_to_show:'.sendvic',close_button:'#close-sendvic'});
   $('#tips_link3').lazytooltiper({div_to_show:'.izolacija_odnadvor',close_button:'#close-odnadvor'});
   $('#tips_link4').lazytooltiper({div_to_show:'.termopor-f',close_button:'#close-termopor-f'});
   $('#tips_link5').lazytooltiper({div_to_show:'.izolacija_na_pod',close_button:'#close-pod'});
   
   
   
    $('#lazy1').lazyslider({btnsHeight:33,btnsWidth:33,slowcontrols:false,fastrightPos:70,fastleftPos:22});
    $('#lazy2').lazyslider({btnsHeight:33,btnsWidth:33,slowcontrols:false,fastrightPos:70,fastleftPos:22});
    $('#lazy3').lazyslider({btnsHeight:33,btnsWidth:33,slowcontrols:false,fastrightPos:70,fastleftPos:22});
    $('#lazy4').lazyslider({btnsHeight:33,btnsWidth:33,slowcontrols:false,fastrightPos:70,fastleftPos:22});
    $('#lazy5').lazyslider({btnsHeight:33,btnsWidth:33,slowcontrols:false,fastrightPos:70,fastleftPos:22});

     $(".lazyslider-container a").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>';
         }
     }); 

   
});
