/**
 * @project: stopgewortel.nu
 * @location: 
 * @date: 02.07.2010
 * @author: Simon Coudeville
 * @description: Core logic
 */

/**
 * Create the WORTEL object variable is it is undefined
 */
 
if(typeof $.WORTEL == "undefined") {
	$.WORTEL = Object;
}

$.WORTEL.upload			=		{
	construct	:		function(){
	},
	
	monitorUpload :		function(){
		$('#picture').bind('mouseout',function(){
			$('#imageCopycat input').attr('value',$('#picture').attr('value'));
		});
	}
}

$.WORTEL.photos			=		{
	construct	:		function(){
		if($('#photos').length){
			$.WORTEL.photos.lightbox();
		}
	},
	
	lightbox	:		function(){
		$('div.photo a').lightBox();
	}
}

$.WORTEL.scrollPane		=		{
	execute		:		function(){
		$.WORTEL.scrollPane.makeScrollPane();
	},
	makeScrollPane	:		function(){
		$('.scrollPane').jScrollPane();
		$('.jScrollPaneDrag').bind('mouseenter mouseleave', function() {
			$(this).toggleClass('jScrollPaneDragHover');
		});

	}
}

$(document).ready(function() {
	$.WORTEL.scrollPane.execute();
	$.WORTEL.upload.monitorUpload();
	$.WORTEL.photos.construct();
});

