$(document).ready(function(){ $.preloadImages("http://www.avr.hr/img/template/left_bg.jpg", "http://www.avr.hr/img/template/bg-header.jpg", "http://www.avr.hr/img/icons/head-admin_white.png", "http://www.avr.hr/img/icons/head-rss_white.png", "http://www.avr.hr/img/icons/head-cart_white.png"); $("a[class='prozor']").colorbox(); $("a[rel='prozor']").colorbox();
 function addMega(){
        $(this).addClass("hovering");
        }

      function removeMega(){
        $(this).removeClass("hovering");
        }

    var megaConfig = {
         interval: 60,
         sensitivity: 4,
         over: addMega,
         timeout: 500,
         out: removeMega
    };

    $("li.mega").hoverIntent(megaConfig);

function log( message ) {
			$( "<div/>" ).text( message ).prependTo( "#log" );
			$( "#log" ).scrollTop( 0 );
		}

		$.ajax({
			url: "rss-file.asp",
			dataType: "xml",
			success: function( xmlResponse ) {
				var data = $( "item", xmlResponse ).map(function() {
					return {
						value: $( "title", this ).text() ,
						id: $( "link", this ).text()
					};
				}).get();
				$( "#KW" ).autocomplete({
					source: data,
					minLength: 3,
					select: function( event, ui ) {
						  parent.location.href = ui.item.id;
						log( ui.item ?
							"Selected: " + ui.item.value + ", ID: " + ui.item.id :
							"Nothing selected, input was " + this.value );
					}
				});
			}
		});
}); 

$(function() { $('#slideshow1').cycle({ delay: 2000, speed: 500, before: onBefore
}); $('#slideshow2').cycle({ delay: 2000, speed: 500, before: onBefore
}); $('#slideshow3').cycle({ delay: 2000, speed: 700, before: onBefore
}); function onBefore() { $('#title').html(this.alt);}
});
$(function(){ $("#accordion").accordion({ header: "h3" }); $('#tabs').tabs(); $('#dialog').dialog({ autoOpen: false, width: 600, buttons: { "Ok": function() { $(this).dialog("close");}, "Cancel": function() { $(this).dialog("close");}
}
}); $('#dialog_link').click(function(){ $('#dialog').dialog('open'); return false;}); $('#dialog_link, ul#icons li').hover( function() { $(this).addClass('ui-state-hover');}, function() { $(this).removeClass('ui-state-hover');} );});  
var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-3203906-1']);
  _gaq.push(['_trackPageview']);
	$(function(){

		$(".fg-button:not(.ui-state-disabled)")
		.hover(
			function(){ 
				$(this).addClass("ui-state-hover"); 
			},
			function(){ 
				$(this).removeClass("ui-state-hover"); 
			}
		)
		.mousedown(function(){
				$(this).parents('.fg-buttonset-single:first').find(".fg-button.ui-state-active").removeClass("ui-state-active");
				if( $(this).is('.ui-state-active.fg-button-toggleable, .fg-buttonset-multi .ui-state-active') ){ $(this).removeClass("ui-state-active"); }
				else { $(this).addClass("ui-state-active"); }	
		})
		.mouseup(function(){
			if(! $(this).is('.fg-button-toggleable, .fg-buttonset-single .fg-button,  .fg-buttonset-multi .fg-button') ){
				$(this).removeClass("ui-state-active");
			}
		});
	});
	(function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
//-->
