$(document).ready(
	function () {
    
	$("#startuj").click(function () { 
      homepage(this); 
	  return false;
    });

//	// FIX JQUERY
//	( function( $ ) {
//	        $.dequeue = function( a , b ){
//	                return $(a).dequeue(b);
//	        };
//	
//	 })( jQuery );    	
	
	 $('fieldset.jcalendar').jcalendar();
	 
    restore_state();
	
	$('div.groupWrapper').Sortable(
		{
			accept: 'groupItem',
			helperclass: 'sortHelper',
			activeclass : 	'sortableactive',
			hoverclass : 	'sortablehover',
			handle: 'div.itemHeader',
			tolerance: 'pointer',
			onchange : function(ser)
			{
      save_state();
			},
			onStart : function()
			{
				$.iAutoscroller.start(this, document.getElementsByTagName('body'));
			},
			onStop : function()
			{
				$.iAutoscroller.stop();
			}
		}
	);

	$('div.groupWrapper2').Sortable(
		{
			accept: 'groupItem2',
			helperclass: 'sortHelper',
			activeclass : 	'sortableactive',
			hoverclass : 	'sortablehover',
			handle: 'div.itemHeader',
			tolerance: 'pointer',
			onchange : function(ser)
			{
			  save_state();
			},
			onStart : function()
			{
				$.iAutoscroller.start(this, document.getElementsByTagName('body'));
				
			},
			onStop : function()
			{
				$.iAutoscroller.stop();
			}
		}
	);
			try {
				$("a[rel^='prettyPhoto']").prettyPhoto({theme: 'facebook'});
				$('.starrating').rating();
				jQuery.jStore.load();
				$('span#starrating_tekst').hide();
				$('div#stars').hide();
				$('div#SRtm').load('/modules/Starrating/time.php');
			} catch(e){
				
			}
	}
);
