
	$(document).ready(function() {
			// insert top Flash
			var so = new SWFObject("images/layout/creek.swf", "topflashen", 220, 136, "7", "#000");
			so.addParam("wmode","transparent");
			so.write("topflash");
			// init menu hover
			navHover();
	});

	function navHover(){
		$("#menu li:not(.current):has(ul)")
			.hover(function () {
					$("#menu li.current ul").css("left","-5000px");
					$(this).find("ul").css("left","-5px");
				  
				}, function () {
					$(this).find("ul").css("left","-5000px");
					$("#menu li.current ul").css("left","-5px");
				});
	}
	
	$(document).ready(function(){
			$('#main_col #paragraphs').sortable({
				axis:"y",
				tolerance:"intersect",
				handle: $('div.handlebar'),
				update: function() {
						$.post("ajax_sort.php", $('#main_col #paragraphs').sortable("serialize", {attribute:"class"}));
				}
			});
	});

	$(document).ready(function(){
			$('#right_col #paragraphs').sortable({
				axis:"y",
				tolerance:"intersect",
				handle: $('div.handlebar'),
				update: function() {
						$.post("ajax_sort.php", $('#right_col #paragraphs').sortable("serialize", {attribute:"class"}));
				}
			});
	});


	
	function saveSorted(listorder) {
	
		var serial2 = [];
		$('paragraphs').getChildren().each(function(element, i){
				serial2[i] = element.getProperty('class').replace('pid_','');
			});
		var myAjax = new Ajax('ajax_sort.php?p_sort_ids='+serial2, {method: 'get'});
		myAjax.request();
	}
	
	function popup_flashfilm()
		{
			day = new Date();
			id = day.getTime();
			eval("page" + id + " = window.open('flash_film/filmen.html', '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=437,height=366,left = 490,top = 262');");
		}


