// JavaScript Document
//Code for Div Scolling
var d = document;
function scrollControl(direction, divid,action){
	//var d = document;
	scrolldiv = divid;
	scrolldirection = direction;
	if(action = "start"){
		myint = setInterval('updateScroll(\'' + action +'\',\''+ divid+'\')', 10);
	}else{
		clearInterval(myint);
	}
}
function scrollStop(){
	clearInterval(myint);
}
var count = 0
function updateScroll(action){
	if(action == "start"){
		var cdiv = d.getElementById(scrolldiv);
		var ctop = cdiv.scrollTop;
		var limit = cdiv.scrollHeight;
		var ntop;
		ntop = ctop;
		if(ntop <= limit && ntop >= 0){
			if(scrolldirection == "up"){
				ntop = ntop - 1;
			}else{
				ntop = ntop + 1;
			}
		}else{
			if(ntop > limit){
				ntop = limit;
				scrollStop();
				return false;
			}else if(ntop < 0){
				ntop = 0;
				scrollStop()
				return false;
			}
		}
		if(ntop == limit || ntop == 0){
			cdiv.scrollTop = ntop;
			scrollStop();
		}else{
			cdiv.scrollTop = ntop;
		}
	}else{
		clearInterval(myint);
	}
}
function getCat(catid){
	new Ajax.Updater( 'pgContent', '/modules/mod_portfolio.php', { method: 'get',parameters: "act=getCat&c=" + catid} );
}