jQuery(function( $ ){	
	Shadowbox.init({
		// let's skip the automatic setup because we don't have any
		// properly configured link elements on the page
		skipSetup: true
	});
	
	
	Shadowbox.setup(".pics a", {
        gallery:            "My Movies",
        autoplayMovies:     true
    });
		
		
	$( '#projects_list .work_item a' ).bind( 'click', function(){		
		var title = $(this).find( 'span em' ).html();
		var id = $(this).attr( 'id' );
		
		$.ajax({
			url : '/projects/get_item',
			data: 'id='+id,
			type: 'POST',
			beforeSend: function(){
				
			}, 
			success: function( response ){
				var html = response;
				Shadowbox.open({
					handleOversize : 'resize',
					content:    '<div class="modal_wrap">'+html+'</div>',
					player:     "html",
					title:      title,					
					width: 		730,
					height:     525
				});
			}
		})		
	} );
	
	$( '#events_list .work_item a' ).bind( 'click', function(){		
		var title = $(this).find( 'span em' ).html();
		var id = $(this).attr( 'id' );
		
		$.ajax({
			url : '/events/get_item',
			data: 'id='+id,
			type: 'POST',
			beforeSend: function(){
				
			}, 
			success: function( response ){
				var html = response;
				Shadowbox.open({
					handleOversize : 'resize',
					content:    '<div class="modal_wrap">'+html+'</div>',
					player:     "html",
					title:      title,					
					width: 		730,
					height:     525
				});
			}
		})		
	} );	
    
	$('.nav').localScroll();
});

function doClear(theText) { 
	if (theText.value == theText.defaultValue) { theText.value = '' } 
}

function doDefault(theText) { 
	if (theText.value == '') { theText.value = theText.defaultValue } 
}

