		
		hovered_link 			= "";
		preselected_active_link = "";
		
		$(document).ready(function(){
			
			// form submit
			$("A#btn_submit_form").bind('click', function(){
			
				$("FORM#pp_form").submit();
			
				return false;
				
			});
			
			// back btn
			$("A#rt_back , A#rt_back_bottom").bind('click', function(){
				history.go(-1);
				return false;	
			});
			
			
			// top btn
			$("A#rt_top").bind('click', function(){
				$('html, body').animate({scrollTop:0}, 'slow');
				return false;	
			});
			
			// print btn
			$("A#rt_print").bind('click', function(){
				window.print();
				return false;	
			});
			
			// bookmark btn
			$("A#rt_bookmark").bind('click', function(event){
				event.preventDefault(); // prevent the anchor tag from sending the user off to the link
				var url = this.href;
				//var title = this.title;
				var title = document.title;
		
				if (window.sidebar) { // Mozilla Firefox Bookmark
					window.sidebar.addPanel(title, url,"");
				} else if( window.external ) { // IE Favorite
					window.external.AddFavorite( url, title);
				} else if(window.opera) { // Opera 7+
					return false; // do nothing - the rel="sidebar" should do the trick
				} else { // for Safari, Konq etc - browsers who do not support bookmarking scripts (that i could find anyway)
					 alert('Unfortunately, this browser does not support the requested action,'
					 + ' please bookmark this page manually.');
				}
				return false;
			});

			


			
			// sublists
			$("DIV#text_left UL.items_list UL LI:first").addClass('first');
			
			// table styles
			$("TABLE.tablica-pokazatelji TBODY TR:odd").addClass('alt');
			
			// save preselected link
			preselected_active_link = "#" + $("#topmenu A.active").attr('id');
			
			// h1 add span
			$("#text_left H1").each(function(){ $(this).html('<span>'+$(this).html()+'</span>'); });

			// sifr
			if(typeof sIFR == "function"){
			    // sIFR.replaceElement("UL#topmenu UL LI A SPAN", named({sFlashSrc: "/include/sifr/myriad_reg.swf", sWmode: "transparent" , sColor: "#508f9c", sSelector: "UL#topmenu UL LI A SPAN"}));
			    // sIFR.replaceElement("UL#topmenu UL LI A SPAN", named({sFlashSrc: "/include/sifr/myriad_reg.swf", sWmode: "transparent" , sColor: "#508f9c", sSelector: "UL#topmenu UL LI A SPAN"}));
			    sIFR.replaceElement("H1 SPAN", named({sFlashSrc: "/include/sifr/tra511.swf", sWmode: "transparent" , sColor: "#3c8696", sSelector: "H1 SPAN"}));
			};
			
			// mark sublists
			$('ul.sf-menu li:has(ul)').addClass('has_sub');
			
			// last list - smaller width
			$("#tm_edukacija").next('ul').addClass('last_list');
			
			// dropmenu - initialise plugins
			$(function(){ 
		        $('ul.sf-menu').superfish({ 
		        	delay:		   100,
		        	speed:		   0,
		        	dropShadows:   false,
		            autoArrows:    false,              // disable generation of arrow mark-up
				    onInit:        function(){},       // callback function fires once Superfish is initialised – 'this' is the containing ul 
				    onBeforeShow:  function(){},       // callback function fires just before reveal animation begins – 'this' is the ul about to open 
				    onShow:        function(){
				    	
				    	// remove all active
				    	$("#topmenu A").removeClass('active');
				    	
				    	// mark hovered link as active
				    	$(this).prev().addClass('active');
				    	
				    	// mark last link (no border)
				    	$(this).find('li:last a').addClass('last');
				    	
				    	// show menu
				    	/*$(this)
				    	.css('top','-999px')
						.animate({dummy:1}, 100, function(){
							
							if( !($(this).attr('class') == "sublist") ) $(this).css('top','39px');
							else $(this).css('top','0px');
									
						});*/

				    	
				    },       // callback function fires once reveal animation completed – 'this' is the opened ul 
				    onHide:  function(){
						
						if( $('ul.sf-menu li.sfHover').length == 0 ){

							$("#topmenu A").removeClass('active');
						
						}
					    	
				    	
				    }        // callback function fires after a sub-menu has closed – 'this' is the ul that just closed  
		        }); 
			});
			
			// show links in menu
			$("ul.sf-menu UL").css('visibility', 'visible');

			
			// after menu loaded, return active
			$(preselected_active_link).addClass('active');
			
			$("A.lightbox, A.veliki-prozor").lightbox();
			
			// video player
			if( $("a.myPlayer").length ){
				
				$f("a.myPlayer", "/videoplayer/flowplayer-3.0.5.swf", { 
										
						/*canvas: {backgroundColor: "transparent"},*/
						
						/*plugins: {
						   controls: {
						      progressColor: '#b75679',
						      backgroundColor: '#52585a',
						      timeColor: '#f1bbd0',
						      borderRadius: '0',
						      sliderColor: '#b75679',
						      progressGradient: 'medium',
						      durationColor: '#d399af',
						      buttonOverColor: '#728B94',
						      buttonColor: '#b75679',
						      sliderGradient: 'none',
						      bufferGradient: 'none',
						      bufferColor: '#b75679',
						      backgroundGradient: 'none',
						      fullscreen:false, 
							  opacity:1.0
						   }
						},*/
						
						plugins: {
						   controls: {
								backgroundGradient: 'none',
						      	backgroundColor: '#4f4f4f',
						      	bufferColor: '#a8a8a8',
						      	progressColor: '#242424',
						      	timeColor: '#e0c94b'
						   }
						},
						
						clip: {  
						      autoPlay: false
						}
				} );			
				
			}

			
		});
		
		