// common - Flash Contents
// v0.9 lastUpdate : 2008. 03. 19
var fc_isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var fc_isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var fc_isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;

var targetFlash;
var FlashListener;

/*flashResizing*/

function divResize(_divid , newX , newY ,newW , newH )
{
	var divObj = findFlashObj(_divid);

	if(newX!=undefined) divObj.style.left = newX+"px";
	if(newY!=undefined) divObj.style.top = newY+"px";
	if(newW!=undefined) divObj.style.width = newW+"px";
	if(newH!=undefined) divObj.style.height = newH+"px";
}


function canResizeFlash(){
	var ua = navigator.userAgent.toLowerCase();
	var opera = ua.indexOf("opera");
	if( document.getElementById ){
		if(opera == -1) return true;
		else if(parseInt(ua.substr(opera+6, 1)) >= 7) return true;
	}
	return false;
}
/********************************************************************/
function checkFlashPlayerVersion(){
	var _version;
	var _e;
	try {
		var _axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.5");
		_version = _axo.GetVariable("$version");
	} catch (_e) {
		_version = -1;
	}
	return _version;
}

function showFlash(_swfURL_,_flashID_,_width_,_height_,_wmode_,_flashVars_,_bgColor_,_menu_,_fullscreen_){
	_wmode_ = (_wmode_ == undefined)? "transparent" : _wmode_;
	_bgColor_ = (_bgColor_ == undefined)? "#FFFFFF" : _bgColor_;
	_fullscreen_ = (_fullscreen_ == undefined)? "false" : _fullscreen_;
	
	//alert(_flashVars_)
	if(fc_isIE && fc_isWin && !fc_isOpera)
		{
		_object_ ='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="'+_width_+'" height="'+_height_+'" id="'+_flashID_+'" align="middle">';
		_object_ += '<param name="allowScriptAccess" value="always" />';
		_object_ += '<param name="quality" value="high" />'; 
		_object_ += '<param name="movie" value="'+_swfURL_+'" />';
		_object_ += '<param name="wmode" value="'+_wmode_+'" />'; 
		_object_ += '<param name="allowFullScreen" value="'+_fullscreen_+'">';
		_object_ += '<param name="bgcolor" value="'+_bgColor_+'" />'; 
		_object_ += '<param name="menu" value="'+_menu_+'" />'; 
		_object_ += '<param name="FlashVars" value="'+_flashVars_+'">';
		_object_ += '</object>';
	}else
	{
		_object_ = '<embed src="'+_swfURL_+'" quality="high" wmode="'+_wmode_+'" menu="'+_menu_+'" allowFullScreen="'+_fullscreen_+'" FlashVars="'+_flashVars_+'" bgcolor="'+_bgColor_+'" width="'+_width_+'" height="'+_height_+'" name="'+_flashID_+'" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'; 
	}

	document.write(_object_);
}

function findFlashObj(_flashID_){
	var tarObj = fc_isIE ? document.all[_flashID_] : document[_flashID_];	
	return tarObj;
}


function popWinCenter(szUrl,winW,winH) { 
        var szWidth; 
        var szHeight; 
        var szWin; 
        szWidth        = (window.screen.width/2) - (winW/2 + 10); 
        szHeight= (window.screen.height/2) - (winH/2 + 50); 
        szWin        = window.open(szUrl,"Window2","status,width="+winW+",height="+winH+",resizable=no,left=" + szWidth + ",top=" + szHeight + ",screenX=" + szWidth + ",screenY=" + szHeight + ",scrollbars=no"); 
        szWin.focus();			// »õÃ¢ÀÌ ¸ÕÀú º¸ÀÎ´Ù. 
        //this.window.focus();	// »õÃ¢ÀÌ µÚ·Î ¼û°Ô ¸¸µç´Ù. 
} 
