/* (c) mjunka 2009 */
$(document).ready(function(){		
	 $("#photoBig").mouseover(function(){		 
		albumEventBinded = true;
		if (curPhoto>1) {
			$("#show_prev").show();
		}
		if (curPhoto<totalAlbumPhotos) {
			$("#show_next").show();
		}	  
    }).mouseout(function(){
		albumEventBinded = false;
		$("#show_prev").hide();
		$("#show_next").hide();      
    });	

	$(".thumbActions").mouseover(function(){		
		id = this.id.split( '_' )[1];
		$("#thumbAct_"+id).show();	  
		$("#comment_"+id).hide();	  
    }).mouseout(function(){
		id = this.id.split( '_' )[1];
		$("#thumbAct_"+id).hide();
		$("#comment_"+id).show();	  
    });
  });


function nextAlbumPhoto() {
	upThumbBack (curPhoto+1);
}

function prevAlbumPhoto() {
	upThumbBack (curPhoto-1);
}

function showAlbumPrev() {
	if (curAlbumPage-1<0) {		
	} else {
		showAlbumPage(curAlbumPage-1);
	}
}

function showAlbumNext() {
	if (curAlbumPage+1>albumPages-1) {		
	} else {
		showAlbumPage(curAlbumPage+1);
	}
}

function showAlbumPage(nor) {
	$("#albumPage"+curAlbumPage).fadeOut("fast", function() {
		$("#albumPage"+nor).fadeIn("fast");

		hide("albPg_Ac_"+curAlbumPage);
		show("albPg_In_"+curAlbumPage);

		curAlbumPage = nor;
		if (curAlbumPage==0) {
			$("#ctrlL").hide();
		} else {
			$("#ctrlL").show();
		}
		if (curAlbumPage==albumPages-1) {
			$("#ctrlR").hide();
		} else {
			$("#ctrlR").show();
		}

		hide("albPg_In_"+nor);
		show("albPg_Ac_"+nor);
	} );
	return;
}
