// main init
var objectId = "flashHolder";
var minWidth = 950;
var minHeight = 940;
var flashHeight = minHeight;

// swfobject init
swfobject.registerObject(objectId, "9.0.0");

// swfaddress init
SWFAddress.setId(objectId);
function initSWFAddress () {
	var activeObj = swfobject.getObjectById(objectId);
	if (activeObj && activeObj.id != objectId) SWFAddress.setId(activeObj.id);
}

// window methods
window.onload = function () {
	initSWFAddress();
	resizeHandler();
}
window.onresize = resizeHandler;
function resizeHandler () {
	var frameWidth;
	var frameHeight;
	if (self.innerWidth) {
		frameWidth = self.innerWidth;
		frameHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientWidth) {
		frameWidth = document.documentElement.clientWidth;
		frameHeight = document.documentElement.clientHeight;
	} else if (document.body) {
		frameWidth = document.body.clientWidth;
		frameHeight = document.body.clientHeight;
	} else {
		return;
	}
	var wrapper = getElement("wrapper");
	var newWidth = frameWidth < minWidth ? minWidth+"px" : "100%";
	if (frameHeight < flashHeight) frameHeight = flashHeight;
	var newHeight = frameHeight < minHeight ? minHeight+"px" : frameHeight+"px";
	if (newWidth == wrapper.style.width && newHeight == wrapper.style.height) return;
	wrapper.style.width = newWidth;
	wrapper.style.height = newHeight;
}

// flash external calls
function setFlashHeight (n) {
	flashHeight = n;
	var wrapper = getElement("wrapper");
	wrapper.style.height = n+"px";
}
function scrollWindowTop () {
	scroll(0,0);
}
// utils
function getElement (id) {
	if (document.getElementById) {
		return document.getElementById(id);
	} else {
		return document.all[id];
	}
}