
var checkOS = {
	Win:	navigator.userAgent.indexOf('Win',0) != -1,
	Mac:	navigator.userAgent.indexOf('Mac',0) != -1,
	MacOSX: navigator.userAgent.indexOf('Mac OS X',0) != -1,
	Vista: navigator.userAgent.indexOf('NT 6.0',0) != -1,
	IE: navigator.userAgent.indexOf('MSIE') > 0,
	IE6: navigator.userAgent.indexOf('MSIE 6') > 0
	
};

/*@cc_on _d=document;eval('var document=_d')@*/

//
var externalSwf;
var locationUrl;
var windowWidth;
var windowHeight;

var flashContainer;

//==========================================================================
//  flashplayer check
//==========================================================================
var flash_version = 9;
var FlashInstalled = false;
var pv = 6;

//Windows IE
if(checkOS.Win && Prototype.Browser.IE){
	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
	document.write('on error resume next \n');
	document.write('contentVersion = ' + flash_version + ' \n');
	document.write('FlashInstalled = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & contentVersion))) \n');
	document.write('</SCR' + 'IPT\> \n');
//Mac IE
}else if(checkOS.Mac && Prototype.Browser.IE){
	if(navigator.plugins["Shockwave Flash"]){
		var sp = navigator.plugins["Shockwave Flash"].description.indexOf("Flash");
		var ep = navigator.plugins["Shockwave Flash"].description.lastIndexOf(" ");
		var aver = parseFloat(navigator.plugins["Shockwave Flash"].description.substring(sp+pv,ep));
		if(aver >= flash_version){
			FlashInstalled = true;
		}
	}
//Others
}else if(navigator.plugins["Shockwave Flash"]){
	var sp = navigator.plugins["Shockwave Flash"].description.indexOf("Flash");
	var ep = navigator.plugins["Shockwave Flash"].description.lastIndexOf(" ");
	var aver = parseFloat(navigator.plugins["Shockwave Flash"].description.substring(sp+pv,ep));
	if(aver >= flash_version){
		FlashInstalled = true;
	}
}

//==========================================================================
//  addEvent
//==========================================================================
function addEvent(elm, evType, func, useCapture) {
	if(elm.addEventListener){
		elm.addEventListener(evType, func, useCapture);
		return true;
	} else if(elm.attachEvent){
		var r = elm.attachEvent('on' + evType, func);
		return r;
	} else {
		elm['on' + evType] = func;
	}
}



//==========================================================================
//  event
//==========================================================================
function initHandler(){
	setWindowSize();	
	var flashVars = ""
	var swfURL = "index.swf";
	
	flashContainer = $("flashcontent");

	//swf“\‚è•t‚¯


	flashContainer.innerHTML = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="https://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" id="externalInterface" width="100%" height="100%" align="top"><param name="allowScriptAccess" value="always" /><param name="wmode" value="transparent" /><param name="movie" value="' + swfURL + '" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><param name="flashvars" value="' + flashVars + '" /><embed src="' + swfURL + '" wmode="transparent" quality="high" bgcolor="#ffffff" width="100%" height="100%" flashvars="' + flashVars + '" name="externalInterface2" id="externalInterface2" align="top" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="https://www.macromedia.com/go/getflashplayer" /></object>';
	
	

	
	resizeHandler();
}





function resizeHandler()
{
	setWindowSize();
	
	
	flashContainer.style.width = windowWidth;
	flashContainer.style.height = windowHeight;
	
}



function setWindowSize()
{
	if(document.all){
		windowWidth = window.document.body.clientWidth;
		windowHeight = window.document.body.clientHeight;
	}else{
		windowWidth = window.innerWidth;
		windowHeight = window.innerHeight;
	}
	
	
	if(windowWidth < 970)
	{
		windowWidth = 950;	
	}
	if(windowHeight < 550)
	{
		windowHeight = 550;	
	}
	
}




addEvent(window, "load", initHandler, false);
addEvent(window, "resize", resizeHandler,false);

