moving = false;
delta = 108;
delta_count = 2;
speed = 1000;
table = null;
div = null;
function MoveUp(){
	if (moving) return;
	moving = true;
	var curtd;
	if (!table) table = document.getElementById('galTable');
	if (!div) div = document.getElementById('galInner');
	//var tr = document.getElementById('portfolio_tr');
	for (i=0;i<delta_count;i++) {
		curtd = table.insertRow(-1).insertCell(0);
		curtd.innerHTML = table.rows[i].cells[0].innerHTML;
		update_images($(curtd).find('a.tozoom'));
		//console.log(curtd);
		//console.log
	}
	//$(tr.cells[0]).hide(1000);
	$(div).animate({
		top: "-" + (delta*delta_count) + "px"
	}, speed ,"linear",function(){
		var w1 = delta*delta_count;
		for (i=0;i<delta_count;i++) {
			w1 = w1 - delta;
			//console.log(w1);
			table.deleteRow(0);
			div.style.top = "-" + w1 + "px";
		}
		div.style.top = 0;
		moving = false;
	});
}
function MoveDown(){
	if (moving) return;
	moving = true;
	var curtd;
	if (!table) table = document.getElementById('galTable');
	if (!div) div = document.getElementById('galInner');
	//var tr = document.getElementById('portfolio_tr');
	var i;
	div.style.top = "-" + (delta*delta_count+4) + "px";
	for (i=0;i<delta_count;i++) {
		curtd = table.insertRow(0).insertCell(0);
		curtd.innerHTML = table.rows[table.rows.length-1-i].cells[0].innerHTML;
		update_images($(curtd).find('a.tozoom'));
	}
	//*
	$(div).animate({
		top: 0
	}, speed ,"linear",function(){
		//document.getElementById('portfolio_div').style.left = 0;
		for (i=0;i<delta_count;i++){
			table.deleteRow(table.rows.length-1);
		}
		moving = false;
    });
    /**/
}
$(document).ready(function(){
	table = document.getElementById('galTable');
	div = document.getElementById('galInner');
});