/* THINGS TO DO IMMEDIATELY */


// admin popup start 
var itemId = "";
var itemLabel = "";
var action = "";
var objectId = "";
var preassignedRelations = "";
var preassignedProperties = "";
function openAdminPopup( id_item, label_object, id_object,  action, preassignedRelations, preassignedProperties )
{
	this.itemId = String(id_item);
	this.itemLabel = label_object;
	this.objectId = String(id_object);
	this.action = action;
	this.preassignedRelations = preassignedRelations;
	this.preassignedProperties = preassignedProperties;
	//alert (this.preassignedProperties);
	//this.preassignedProperties = "ciao";
	window.open("main.php", 'adminPanel', 'width=1015, height=500, resizable, status, scrollbars=1, location');
}
// admin popup end 


// login module start 
function submitLogin(field)
{
	document.getElementById("loginForm").submit();
}		
// login module end 	






/* THEN THINGS TO DO ON READY */


$(document).ready(
	function()
	{
		/*
		$('#oooguiFLVplayer_a01122006.flv_17').flash({
			swf: 'swf/FlvPlayer.swf?movie=content%2Ffiles%2F1%2F7%2Fvideo_12%2Fa01122006.flv&title=my title'
		});
		
		$(".oooguiFLVplayera01122006flv17").click(
			function(event)
			{
				alert("As you can see, the link no longer took you to jquery.com");
				event.preventDefault();
			}
		);
		*/
		
		/* viene chiamato solo dove serve 
		//activate datepickers in form inputs
		$('#kodio').DatePicker({
			format:'Y-m-d',
			date: $('#kodio').val(),
			current: $('#kodio').val(),
			position: 'bottom',
			onBeforeShow: function(){
				$('#kodio').DatePickerSetDate($('#kodio').val(), true);
			},
			onChange: function(formated, dates){
				$('#kodio').val(formated);
			}
		});
		*/
		
		//activate all popup for images
		$(".popupImage").ceebox({titles:false,margin:"20",padding:"0",borderWidth:"8px 0px"});
		//activate all popup for flash
		$(".popupFlash").ceebox({titles:false,margin:"20",padding:"0",borderWidth:"8px 0px"});
		
		/*
		//activate fading links
		$("a").fadeTo("slow", 0.7); // This sets the opacity of the thumbs to fade down to 60% when the page loads
		$("a").hover(function(){
			$(this).fadeTo(500, 1.0); // This should set the opacity to 100% on hover
		},function(){
			$(this).fadeTo(1500, 0.7); // This should set the opacity to 100% on hover
		});		
		*/
	}
);

	
	
	
//FINALLY THINGS TO DO ON LOAD (AFTER ALL IMAGES ARE LOADED)

	
$(window).load(
	function()
	{
			//activate masonry
			$('.masonry').masonry({	animate: true }); //questo è quello in produzione
			//$('.masonry').masonry({	animate: true, columnWidth: 112 }); //esempio
			//$('.moduleBox').masonry({	animate: true }); //esempio
		
	}
);


