// Add onload event to window.
// Thanks to Simon Willison (http://simon.incutio.com).
function addLoadEvent(func)
{
	var oldonload = window.onload;
	if (typeof window.onload != 'function')
	{
		window.onload = func;
	}
	else
	{
		window.onload = function() {
			oldonload();
			func();
		}
	}
}

// ÇÃ·¡½Ã ÄÚµå Á¤ÀÇ ¹× Ãâ·Â
function flashWrite(url,w,h,id,bg,vars,win,page)
{ 
	var flashStr=
		"<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+w+"' height='"+h+"' id='"+id+"' align='middle'>"+
		"<param name='allowScriptAccess' value='allways' />"+
		"<param name='movie' value='"+url+"?FirstOver="+page+"' />"+
		"<param name='FlashVars' value='"+vars+"' />"+
		"<param name='wmode' value='"+win+"' />"+
		"<param name='menu' value='false' />"+
		"<param name='quality' value='high' />"+
		"<param name='bgcolor' value='"+bg+"' />"+
		"<param name='base' value='.'>"+
		"<embed src='"+url+"?FirstOver="+page+"' FlashVars='"+vars+"' wmode='"+win+"' menu='false' quality='high' bgcolor='"+bg+"' width='"+w+"' height='"+h+"' name='"+id+"' align='middle' allowScriptAccess='allways' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />"+
		"</object>";

	document.write(flashStr);
	 //FlashÀÇ ExternalInterface°¡ Form Tag³»¿¡¼­ ¿À·ù³ª´Â ¹ö±×¸¦ ÇØ°áÇÏ´Â ÄÚµå     
	eval("window." + id + " = document.getElementsByName('" + id + "')[0];");
}

// ÇÃ·¡½Ã Ãâ·Â : ÇÔ°æ¿ì Á¦ÀÛ
function printSWF()
{
	var obj = new String; 
	var parameter = new String; 
	var embed = new String; 
	var html = new String; 
	var allParameter = new String; 
	var clsid = new String; 
	var codebase = new String; 
	var pluginspace = new String; 
	var embedType = new String; 
	var src = new String; 
	var width = new String; 
	var height = new String; 

	this.init = function( getType , s ,w , h ) { 

		if ( getType == "flash") 
		{ 

			clsid = "D27CDB6E-AE6D-11cf-96B8-444553540000";			
			codebase = "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,124,0"; 
			pluginspage = "http://www.macromedia.com/go/getflashplayer"; 
			embedType = "application/x-shockwave-flash"; 
		} 

		parameter += "<param name='movie' value='"+ s + "'>\n";	
		parameter += "<param name='quality' value='high'>\n";		

		src = s; 
		width = w; 
		height = h; 
	} 

	this.parameter = function( parm , value ) {		
		parameter += "<param name='"+parm +"' value='"+ value + "'>\n";			
		allParameter += " "+parm + "='"+ value+"'"; 
	}	

	this.show = function() { 
		if ( clsid ) 
		{ 
			obj = "<object classid=\"clsid:"+ clsid +"\" codebase=\""+ codebase +"\" width='"+ width +"' height='"+ height +"'>\n"; 
		} 

		embed = "<embed src='" + src + "' pluginspage='"+ pluginspage + "' type='"+ embedType + "' width='"+ width + "' height='"+ height +"'"+ allParameter +" ></embed>\n"; 

		if ( obj ) 
		{ 
			embed += "</object>\n"; 
		} 

		html = obj + parameter + embed; 
		
		document.write( html );
	}
}

// ÀÍ½º ÀÌ¹ÌÁö Ä³½Ã
try {
	document.execCommand('BackgroundImageCache', false, true);
} catch(e) {}

function winOpen(url,width,height,name)
{
	window.open(url, name, "height="+height+"px, width="+width+"px, top=100px, left=350px,resizable=no,scrollbars=yes,status=yes");
}

/**************************************************
ÇÁ·Î±×·¥ ID : 
ÇÁ·Î±×·¥ ¸í :F5 ¹× ¹öÆ° ¸·±â ¹× ¿À¸¥ÂÊ ¸¶¿ì½º ¸·±â
ÀÛ   ¼º   ÀÚ : ±¸¼º±Ù
ÃÖÃÊ ÀÛ¼ºÀÏ : 2008/01/12
ÃÖÁ¾ ÀÛ¼ºÀÏ : 
Âü°í »çÇ× :  Âü°í
*****************************************************/
function processKey()
{ 
    if( (event.ctrlKey == true && (event.keyCode == 78 || event.keyCode == 82)) || (event.keyCode >= 112 && event.keyCode <= 123) || event.keyCode == 8){ 
        event.keyCode = 0; 
        event.cancelBubble = true; 
        event.returnValue = false; 
    }    
    
}

function body_context()
{
	var cancelEvent = function (){return false;}
	document.oncontextmenu = cancelEvent;
	document.onselectstart = cancelEvent;
	document.ondragstart = cancelEvent;
	processKey();
}

//document.onkeydown = processKey;  //F5 ¹× ¹öÆ° ¸·±â

