// flashWrite(ÆÄÀÏ°æ·Î, °¡·Î, ¼¼·Î[, º¯¼ö][,¹è°æ»ö][,À©µµ¿ì¸ðµå])
function flashWrite(url,w,h,vars,bg,win)
{
	var id = url.split("/")[url.split("/").length-1].split(".")[0]; //id´Â ÆÄÀÏ¸íÀ¸·Î ¼³Á¤
	if(vars==null) vars='';
	if(bg==null) bg='#FFFFFF';
	if(win==null) win='transparent';

	function BrowserCheck()
	{
		appname = navigator.appName;
		useragent = navigator.userAgent;
		 if(appname == "Microsoft Internet Explorer") appname = "IE";
		 IE55 = (useragent.indexOf('MSIE 5.5')>0);  //5.5 ¹öÀü
		 IE6 = (useragent.indexOf('MSIE 6')>0);     //6.0 ¹öÀü

		 if(appname=="IE" && IE55 || IE6) vars = 'ieVer=6'; //ÀÍ½ºÇÃ·Î·¯ÀÌ¸é¼­ 5.5 or 6.0 ¹öÀüÀÌ¸é...
		 else vars= 'ieVer=7';
	}

	//onload=BrowserCheck;

	// ÇÃ·¡½Ã ÄÚµå Á¤ÀÇ
	var flashStr= "	<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000'";
		flashStr+="			codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0'";
		flashStr+="			width='"+w+"'";
		flashStr+="			height='"+h+"'";
		flashStr+="			id='"+id+"'";
		flashStr+="			align='middle'>";

		flashStr+="		<param name='allowFullScreen' value='true' />";
		flashStr+="		<param name='allowScriptAccess' value='always' />";
		flashStr+="		<param name='movie' value='"+url+"' />";
		flashStr+="		<param name='FlashVars' value='"+vars+"' />";
		flashStr+="		<param name='wmode' value='"+win+"' />";
		flashStr+="		<param name='menu' value='false' />";
		flashStr+="		<param name='quality' value='high' />";
		flashStr+="		<param name='bgcolor' value='"+bg+"' />";

		flashStr+="		<embed src='"+url+"'";
		flashStr+="		       flashVars='"+vars+"'";
		flashStr+="		       wmode='"+win+"'";
		flashStr+="		       menu='false'";
		flashStr+="		       quality='high'";
		flashStr+="		       bgcolor='"+bg+"'";
		flashStr+="		       width='"+w+"'";
		flashStr+="		       height='"+h+"'";
		flashStr+="		       name='"+id+"'";
		flashStr+="		       align='middle'";
		flashStr+="		       allowScriptAccess='always'";
		flashStr+="		       allowFullScreen='true'";
		flashStr+="		       type='application/x-shockwave-flash'";
		flashStr+="		       pluginspage='http://www.macromedia.com/go/getflashplayer' />";
		flashStr+=" </object>";

	// ÇÃ·¡½Ã ÄÚµå Ãâ·Â
	document.write(flashStr);
}

function getPosition(width,height)
{
	var adjT, adjL, rtnStr
	adjL   = (screen.availWidth - width) / 2
	adjT   = (screen.availHeight - height) / 2
	rtnStr = ',top='+adjT+',left='+adjL
	return rtnStr
}

function openPopup(url,width,height,cname,opts)
{
	var popName, popNameOri, allowOpen
	popName    = 'HatKimChiPopUp'
	popNameOri = popName
	allowOpen  = true

	if (cname != null)
	{
		var noticeCookie = getCookie(cname)
		if (noticeCookie == "no")
		{
			allowOpen = false
			popName = cname
		}
	}

	if(allowOpen)
	{
		var strSize = 'width='+width+',height='+height
		var strPos  = getPosition(width,height)
		window.open(url,cname,strSize+strPos+opts)
	}

}

function mainlink(idx1, idx2)
{
	var tURL = "#";
	//alert("¸ÞÀÎ"+idx1+","+"¼­ºê"+idx2);
	// ÇÞ±èÄ¡ ÀÌ¾ß±â
	if (idx1 == 1)
	{
		if (idx2 == 1)
		{
			// ÇÞ±èÄ¡ ¼Ò°³
			tURL = "/brand/contents/contentsRead.do?brandSeq=24&menuSeq=1304&contSeq=698"
			     + "&bmcode=0101"
		}
		else if (idx2 == 2)
		{
			// Á¦Á¶ °øÁ¤ ¼Ò°³
			tURL = "/brand/contents/contentsRead.do?brandSeq=24&menuSeq=1305&contSeq=699"
			     + "&bmcode=0102"
		}
		else if (idx2 == 3)
		{
			// ÁÖ¿ä ¿øÀç·á & »êÁö ¼Ò°³
			tURL = "/brand/contents/contentsRead.do?brandSeq=24&menuSeq=1306&contSeq=700"
			     + "&bmcode=0103"
		}
		location.href = tURL
	}

	// ÇÞ±èÄ¡ Á¦Ç°
	else if (idx1 == 2)
	{
		if (idx2 == 1)
		{
			// ÇÞ±èÄ¡ ±ò²ûÇÑ¸À
			tURL = "/brand/product/productRead.do?brandSeq=24&menuSeq=1019&pcd=15656"
			     + "&bmcode=0201"
		}
		else if (idx2 == 2)
		{
			// ÇÞ±èÄ¡ Ç³ºÎÇÑ¸À
			tURL = "/brand/product/productRead.do?brandSeq=24&menuSeq=1210&pcd=15563"
			     + "&bmcode=0202"
		}
		else if (idx2 == 3)
		{
			// ÇÞ±èÄ¡ ½äÀº±èÄ¡
			tURL = "/brand/product/productRead.do?brandSeq=24&menuSeq=1239&pcd=15833"
			     + "&bmcode=0203"
		}
		else if (idx2 == 4)
		{
			// ÇÞ±èÄ¡ ÃÑ°¢±èÄ¡
			tURL = "/brand/product/productRead.do?brandSeq=24&menuSeq=1021&pcd=15654"
			     + "&bmcode=0204"
		}
		location.href = tURL
	}

	// ÇÞ±èÄ¡ Å¸¿î
	else if (idx1 == 3)
	{
		if (idx2 == 1)
		{
			// ´º½º°øÁö»çÇ×
			tURL = "/brand/board/boardList.do?brandSeq=24&menuSeq=1241&boardNum=104"
			     + "&bmcode=0301"
		}
		else if (idx2 == 2)
		{
			// ÇÞ±èÄ¡ Å¸¿î »ç¶÷µé
			tURL = "/brand/board/boardList.do?brandSeq=24&menuSeq=1303&boardNum=333"
			     + "&bmcode=0302"
		}
		location.href = tURL
	}

	else if (idx1 == 4)
	{
		if (idx2 == 1)
		{
			// ÀÌº¥Æ®
			tURL = "/event/year/kimchi/kimchi.do"
		}
		location.href = tURL
	}

	else if (idx1 == 5)
	{
		if (idx2 == 1)
		{
			// ±èÄ¡±³È¯±Ç
			openPopup('/ticket/kimchi/kimchiTicketForm.do','700','564')
		}
	}

	// ¸ÞÀÎÆäÀÌÁö ¹è³Ê
	else if (idx1 == 9)
	{
		if (idx2 == 1)
		{
			mainlink(1,1)
		}
		if (idx2 == 2)
		{
			mainlink(2,1)
		}
	}
}