//---------------------------------------------------------------------------
var _dom = 0;

function KeyPressHandler(e)
{
	if (document.all) e = window.event; // for IE
	if (_dom == 3) var EventStatus= e.srcElement.tagName;
	else if(_dom == 1) var EventStatus= e.target.nodeName; // for Mozilla

	var cc = '';
	var ch = '';

	if (_dom == 3) // for IE
	{
		if (e.keyCode > 0)
		{
			ch = String.fromCharCode(e.keyCode);
			cc = e.keyCode;
		}
	}
	else // for Mozilla
	{
		cc = e.keyCode;
		if (e.charCode > 0)
		{
			ch = String.fromCharCode(e.charCode);
		}
	}

	if (e.altKey || e.ctrlKey) return;
	if (_dom == 2) return;
	if (EventStatus == 'INPUT' || EventStatus == 'TEXTAREA') return;

	//-----------------------------------------------------------------------
	// on editing mode
	//alert(cc);
	if (document.forms[0] != null && document.forms[0].elements['memo'] != null && cc == 27)
	{
		document.forms[0].elements['memo'].focus();
	}
	//-----------------------------------------------------------------------

	else
	{
		switch (ch)
		{
			case "`": self.location = "/"; break; // ÀÚÀ¯°Ô½ÃÆÇ
			case "1": self.location = "/bbs/zboard.php?id=board&page=1"; break; // ÀÚÀ¯°Ô½ÃÆÇ
			case "2": self.location = "/bbs/zboard.php?id=qna_bbs&page=1&select_arrange=reg_date&desc=desc"; break; // Áú¹®°Ô½ÃÆÇ
			case "3": self.location = "/bbs/zboard.php?id=off_bbs&page=1&select_arrange=reg_date&desc=desc"; break; // ¿ÀÇÁ°Ô½ÃÆÇ
			case "4": self.location = "/bbs/zboard.php?id=notice_bbs&page=1&select_arrange=reg_date&desc=desc"; break; // °øÁö»çÇ×
			case "q": self.location = "/bbs/zboard.php?id=gallery"; break; // ÀÚÀ¯°Ö·¯¸®
			case "w": self.location = "/bbs/zboard.php?id=main"; break; // º£½ºÆ®°Ö·¯¸®	
			case "e": self.location = "/bbs/zboard.php?id=gallery6"; break; // ¿ÀÇÁ°Ö·¯¸®			
			case "r": self.location = "/bbs/zboard.php?id=gallery2"; break; // Çà»ç°Ö·¯¸®
			case "t": self.location = "/bbs/zboard.php?id=gallery4"; break; // ½ºÅä¸®°Ö·¯¸®, ½Å¾Ó	
			case "0": dblclick(); break; //È­¸é ¸ÇÇÏ´ÜÀ¸·Î ÀÌµ¿								 			
			default: break;
		}
	}

	/*
	// [C] - Community
	else if (ch == "c")
		self.location = URLPrefix + URLCommunity;

	// [G] - Gallery
	else if (ch == "g")
		self.location = URLPrefix + URLGallery;

	// [F] - Forum
	else if (ch == "f")
		self.location = URLPrefix + URLForum;
	*/

	return;
}

function KeyInput()
{
	_dom = document.all ? 3 : (document.getElementById ? 1 : (document.layers ? 2 : 0));
	document.onkeypress = KeyPressHandler;
}

KeyInput();
//---------------------------------------------------------------------------


function flash_load(set1,size1,size2,FlashVars){
document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='"+size1+"' height='"+size2+"'>");
document.write("<param name='movie' value='/"+set1+"'>");
document.write("<param name='quality' value='high'>");
document.write("<param name='FlashVars' value='"+FlashVars+"' >");
document.write("<param name='bgcolor' value='#000000' >");
document.write("<param name='wmode' value='transparent'>");
//document.write("<embed src='"+ set1+"' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+size1+"' height='"+size2+"'></embed></object>");
document.write("<embed src='"+ set1+"?"+FlashVars+"' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+size1+"' height='"+size2+"'></embed></object>");
} 
