var minHeight = 500;
var scroll;
function init() {
	scroll = new Fx.Scroll(window, {duration:1500, transition:Fx.Transitions.Quart.easeIn});
	window.addEvent("scroll",scrollChange);
	window.addEvent("resize",resizeChange);
	SWFAddress.addEventListener(SWFAddressEvent.CHANGE,resetY);
	setHookEventContainer(window);
	scroll.addEvent("complete", scrollComplete);
}
function resetY() {
	scroll.start(0, 0);
	return true;
}
function setHeight(value) {
	value = parseInt(value);
	if (value < getHeight()) {
		value = getHeight();
	}
	$("resizer").setStyle("height",value+"px");
}
function setWidth(value) {
	value = parseInt(value);
	if (value < getWidth()) {
		value = getWidth();
	}
	$("resizer").setStyle("width",value+"px");
}
function reset() {
	var height = "100%";
	if (getHeight()<minHeight) height = minHeight;
	$("resizer").setStyle('height',height);
}
function scrollChange() {
	$("swfContainer").setScroll(window.getScroll().x, window.getScroll().y);
}
function setScroll(x, y) {
	//alert(y);
	scroll.start(x, y);
	window.scroll(x, y);
	//document.body.scrollTop = y;
}
function getScrollX() {
	return window.getScroll().x;
}
function getScrollY() {
	return window.getScroll().y;
}
function scrollComplete(){
	$("swfContainer").scrollCompleteCallback();
}
function resizeChange(){
	$("swfContainer").resizeCallback();
}
function getWidth(){
	return window.getSize().x;
}
function getHeight() {
	return window.getSize().y;
}
window.addEvent("domready",init);
