$(document).ready(function(){
    if (typeof(pageFunction)==='function')
    {
        pageFunction();
    }
	if (typeof(initialize)==='function')
	{
	    initialize();	
	}
        
	//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();
    }
	 
	 $(".anythingSlider").anythingSlider({
            easing: "swing",                // Anything other than "linear" or "swing" requires the easing plugin
            autoPlay: true,                 // 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: false,         // 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)
        });
    
    
    
   $('.nav ul li').hover(function(){
       $(this).addClass('li-hover');
       $(this).children('ul').show();
       $(this).children('a').css({'color':'#000000','text-decoration':'none'});
   },function(){
       $(this).removeClass('li-hover');
       $(this).children('ul').hide();
       $(this).children('a').css({'color':'#DEDEDE'});
   });
        
   $('li.aggr_gallery img').hover(function(){
       $(this).stop().animate({opacity:'1',width:'186px',left:'65px'},200);
   },function(){
       $(this).stop().animate({opacity:'0.7',width:'170px',left:'75px'},200);
   });    
     
   $('li.aggr_preporaki img').hover(function(){
       $(this).stop().animate({opacity:'1',width:'160px',left:'19px'},200);
   },function(){
       $(this).stop().animate({opacity:'0.7',width:'150px',left:'22px'},200);
   }); 
    
   //$("ul.paging").quickPager({pageSize: 3});
    
});
