<!--
//Contains scripts throughout site

var total_cols;
var curr_col;
var img_box_high;
var imgs_high;


$(function()
{
	// Gallery Information
	total_cols = $("#total_cols").text();
	curr_col = $("#curr_col").text();
	img_box_high = $("#img_box_high").text();
	imgs_high = $("#imgs_high").text();
	for( i=1; i<=total_cols;i++ ) {
		if( i > imgs_high )
		{
			$("#gal_div"+i).hide();
		}
	}
	$("#gal_bottom").hide();
	
	if ( parseInt(imgs_high) >= parseInt(total_cols) )
	{
		$("#gal_top").hide();
	}
	$("#gal_top").click(clickUp);
	$("#gal_bottom").click(clickDown);
});

function menuClicked() {
	var href = ($(this).find("a").attr("href"));
	window.location=href;
}

function clickDown() {
	var right_column_name = "#gal_div" + (curr_col+parseInt(imgs_high-1)); // get the name for the right column
	$(right_column_name).fadeOut(500); //hide right col
	curr_col--; //move to next col
	//loop until to end col
	curr_move_col = curr_col+1; // which column to move
	curr_pos_pix = parseInt(img_box_high);
	curr_pos_img = 2;
	while ( curr_pos_img <= imgs_high )
	{
		var move_column_name = "#gal_div"+curr_move_col;
		$(move_column_name).animate({ top:curr_pos_pix+"px"}, 500); //move next col right
		curr_move_col++;
		curr_pos_img++;
		curr_pos_pix += parseInt(img_box_high);
	}
	$("#gal_div"+curr_col).fadeIn(500);//show the next col on the left
	//check to see wether left/right arrows need to be shown/hidden
	if (curr_col == 1)
	{
		$("#gal_bottom").fadeOut(500);
	}
	if (curr_col == (total_cols-imgs_high))
	{
		$("#gal_top").fadeIn(500);
	}
}

function clickUp() {
	$("#gal_div"+curr_col).fadeOut(500); //hide left col
	curr_col++; //move to next col
	//loop until to end col
	curr_move_col = curr_col
	curr_pos_pix = 0;
	curr_pos_img = 1;
	while ( curr_pos_img < imgs_high )
	{
		$("#gal_div"+curr_move_col).animate({ top:curr_pos_pix+"px"}, 500); //move next col left
		curr_move_col++;
		curr_pos_img++;
		curr_pos_pix += parseInt(img_box_high);
	}
	
	$("#gal_div"+(curr_col+parseInt(imgs_high-1))).fadeIn(500);//show the next col on the right
	//check to see wether left/right arrows need to be shown/hidden
	if(curr_col == 2)
	{
		$("#gal_bottom").fadeIn(500);
	}
	if (curr_col == (total_cols-parseInt(imgs_high)+1))
	{
		$("#gal_top").fadeOut(500);
	}
}

-->