var HORZ=0,VERT=1;
var velocity = 6;

//Object of Animate
function Animate() {
	this.fPStatus = -1;
	return this;
}
Animate.prototype.startAnimate = function (fP) {
	if(this.fPStatus == -1) {
		this.fPStatus = setInterval(fP, 10);
	}
};
Animate.prototype.stopAnimate = function () { 
	clearInterval(this.fPStatus); 
	this.fPStatus = -1; 
};


//Object of Scrollable Region
function ScrollRegion(iframeID) {
//	var iframe = document.getElementById(iframeID).contentWindow ? document.getElementById(iframeID).contentWindow : (document.getElementById(iframeID).scrollBy ? document.getElementById(iframeID) : document.frames.iframeID);
	if(document.getElementById(iframeID).contentWindow) {
		this.iframe = document.getElementById(iframeID).contentWindow;
	} else if(document.getElementById(iframeID).scrollBy) {
		this.iframe = document.getElementById(iframeID);
	} else if(document.frames) {
		this.iframe = document.frames[iframeID];
	} else {
		alert('Sorry, NO support for iFrames found..');
	}
	return this;
}
ScrollRegion.prototype.scrollByXY = function (speed,direction) { 
/*	var speedX = 0, speedY = 0;
	if(direction == HORZ) { 
		speedX = speed; 
	} else if(direction == VERT) { 
		speedY = speed; 
	}
*/
	speedX = (direction == HORZ) ? speed : 0
	speedY = (direction == VERT) ? speed : 0
	this.iframe.scrollBy(speedX,speedY);
};
ScrollRegion.prototype.scrollUp    = function () { this.scrollByXY(-velocity,VERT); };
ScrollRegion.prototype.scrollRight = function () { this.scrollByXY( velocity,HORZ); };
ScrollRegion.prototype.scrollDown  = function () { this.scrollByXY( velocity,VERT); };
ScrollRegion.prototype.scrollLeft  = function () { this.scrollByXY(-velocity,HORZ); };