jQuery(document).ready(function(){
	
	///////////////////////////////////////////////////////////////////////////////////////////////////////
	//	Lightbox
	///////////////////////////////////////////////////////////////////////////////////////////////////////
		if(jQuery("a.lightbox"))
		{
	   		$('a.lightbox').lightBox({
				overlayBgColor: '#000',
				overlayOpacity: 0.8, 
				imageLoading: 'http://www.jadran-oie.com/images/lightbox-ico-loading.gif',
				imageBtnClose: 'http://www.jadran-oie.com/images/closelabel.gif',
				imageBtnPrev: 'http://www.jadran-oie.com/images/prev.gif',
				imageBtnNext: 'http://www.jadran-oie.com/images/next.gif',
				containerResizeSpeed: 350,
				txtImage: 'Slika',
				txtOf: 'od'
			});
		}	
	
	///////////////////////////////////////////////////////////////////////////////////////////////////////
	//	Scroll
	///////////////////////////////////////////////////////////////////////////////////////////////////////
	
	  $("div.scrollable").scrollable({
			size: 4,
			items: '#thumbs',  
			hoverClass: 'hover',
			clickable: false
	});
	
	if ($("div#thumbs div").length <= 4 )
	{
		$("div.slider a.next").hide();
	}

	///////////////////////////////////////////////////////////////////////////////////////////////////////
	//	superfish menu
	///////////////////////////////////////////////////////////////////////////////////////////////////////
	
		jQuery("ul.sf-menu").superfish().find('ul').bgIframe({
			opacity:     true,
			delay:       200,								// half second delay on mouseout 
			animation:   {opacity:'show',height:'show'},	// fade-in and slide-down animation 
			speed:       'fast',                        	// faster animation speed 
			autoArrows:  false,                           	// disable generation of arrow mark-up 
			dropShadows: true                            	// disable drop shadows
		});
	
			
	///////////////////////////////////////////////////////////////////////////////////////////////////////
	//	png fix
	///////////////////////////////////////////////////////////////////////////////////////////////////////
			
			$('div#thumbNav a').ifixpng().click(function(){return true});
			//$('div#thumbNav').ifixpng();
			
			
	///////////////////////////////////////////////////////////////////////////////////////////////////////
	//	slider
	///////////////////////////////////////////////////////////////////////////////////////////////////////

		function formatText(index, panel) {
				  return index + "";
				}
					if($('.anythingSlider ul li').length > 1)
					{
						$('.anythingSlider').anythingSlider({
							easing: "easeInOutExpo",        		// 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.
							delay: 8000,                    		// How long between slide transitions in AutoPlay mode
							startStopped: false,            		// If autoPlay is on, this can force it to start stopped
							animationTime: 600,             		// How long the slide transition takes
							hashTags: false,                 		// 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
							navigationFormatter: formatText         // Details at the top of the file on this use (advanced use)
						});
					}		
			
    });  // end documents
				
	///////////////////////////////////////////////////////////////////////////////////////////////////////
	//	DW
	///////////////////////////////////////////////////////////////////////////////////////////////////////
			
	function MM_openBrWindow(theURL,winName,features) { //v2.0
		  window.open(theURL,winName,features);
		}
		
	function MM_goToURL() { //v3.0
		  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
		  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
		}


