var showNewDetails = 0;

$( document ).ready( function() {
	getComment( 0 );
	
	// Show more info text
	$( '#showMore' ).click( function() {
		$( this ).hide();
		$( '#showLess' ).show();
		$( '#moreInfo' ).slideDown();
		return false;
	});
	
	// Show less info text
	$( '#showLess' ).click( function() {
		$( this ).hide();
		$( '#showMore' ).show();
		$( '#moreInfo' ).slideUp();
		return false;
	});
	
	$( '.moreVideos' ).hover( function() {
		$( '.moreComments' ).slideDown();
	},
	function() {
		$( '.moreComments' ).slideUp();
	});
	
	$( '#newDetails' ).click( function() {
		if( showNewDetails ) {
			$( '.boxNewDetails' ).slideUp();
			showNewDetails = 0;
			
			return false;
		}
		
		$( '.boxNewDetails' ).slideDown();
		showNewDetails = 1;
		
		return false;
	});
	
	// Show introduction video
	$( '.infoPict img' ).click( function() {
		manageLightBox( 0, '.boxPopup' );
	});
});

//Retrieve comment content
function getComment( page ) {
	$.ajax({
		type: 'POST',
		url: 'index.php?ctr=ajaxCommander&class=startGetComment&tlp=startIndex',
		data: {
			page: page
		},
		success: function( data ) {
			$('#comments').html( data );
			
			$('#nextComment').click(function() {
				var page = $('#page').val();
				getComment( page );
				
				return false;
			});
		}
	});
}

