//Embed Flash
var flashvars = {};
var params = {};
var attributes = {id:"MainSWF"};
swfobject.embedSWF("/swf/loader.swf", "NonFlashContent", "100%", "100%", "9.0.0", false, flashvars, params, attributes);
addEvent(window,"load", enableMouseWheel,false);

//Fix Window Size
/*
var ua=navigator.userAgent;
var winWidth = screen.availWidth ;
var winHeight = screen.availHeight ;
if ( winWidth/winHeight > 1.5 ) winWidth = winHeight*1.5;
if(ua.indexOf("MSIE",0)>=0 || ua.indexOf("Netscape")>=0 || ua.indexOf("Safari")>=0){
	window.resizeTo(winWidth,winHeight);
}
else if(ua.indexOf("Mozilla/4",0)>=0){
	window.outerWidth=winWidth;
	window.outerHeight=winHeight;
}
*/

//Function to add event listener
function addEvent(elm,eventName,func,cap) {
	if(elm.addEventListener){
		elm.addEventListener(eventName,func,!!cap);
		return true;
	} else if(elm.attachEvent) {
		return elm.attachEvent('on'+eventName,func);
	} else {
		var oldFunc=elm["on"+eventName];
		elm["on"+eventName] = (typeof oldFunc!="function"?function(event){func(event)}:function(event){oldFunc(event);func(event)});
	}
}

//Function to enable mac's mouse wheel
function enableMouseWheel() {
	macmousewheel = new SWFMacMouseWheel( attributes.id );
}

