var	__url_prefix = "http://marathon.chosun.com/eng";

var	__main_prefix = __url_prefix + "/images/chuncheon/";
var	__main_links = 
[ 
	__url_prefix + "/chuncheon/general00.html"
	, __url_prefix + "/chuncheon/history.html"
	, __url_prefix + "/chuncheon/course.html"
	, "javascript:popup_registation()"
	, "javascript:popup_confirmation()"
	, "javascript:popup_record()"
];

var	__main_sub_links = 
[ 
	__url_prefix + "/chuncheon/general_award.html"
	, __url_prefix + "/chuncheon/general_souvenir.html"
];

var	__bbs_prefix = __url_prefix + "/images/bbs/";
var	__bbs_links = 
[ 
	"http://bbs.chosun.com/bbs.message.list.screen?bbs_id=10071001"
	, "http://bbs.chosun.com/bbs.message.list.screen?bbs_id=10071005"
	, "http://bbs.chosun.com/bbs.message.list.screen?bbs_id=10071002"
];

var	__story_prefix = __url_prefix + "/images/story/";
var	__story_links = 
[ 
	"http://bbs.chosun.com/bbs.message.list.screen?bbs_id=10071003"
	, "http://bbs.chosun.com/bbs.message.list.screen?bbs_id=10071004" 
];

function write_left(mainIndex, subIndex)
{
	if ( mainIndex == "main" ) 
	{
		if ( subIndex == 10 || subIndex == 11 || subIndex == 12 )
			__write_left_impl(__main_prefix, __main_links, 1, __main_sub_links, subIndex);
		else
			__write_left_impl(__main_prefix, __main_links, subIndex);
	}
	else if ( mainIndex == "bbs" ) __write_left_impl(__bbs_prefix, __bbs_links, subIndex);		
	else if ( mainIndex == "story" ) __write_left_impl(__story_prefix, __story_links, subIndex);		
}

function __write_left_impl(prefix, links, index, expand_links, expand_index)
{
	var	code = "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">";
	code += "<tr>";
	code += "<td><img src=\"" + prefix + "menu00.gif\" border=\"0\"></td>";
	code += "</tr>";
	
	for ( var i = 1; i <= links.length; i++ )
	{
		if ( i == index )
		{
			code += "<tr>";
			code += "<td><a href=\"" + links[i - 1] + "\"  OnFocus=\"this.blur()\"><img src=\"" + prefix + "menu0" + i + "_on.gif\" border=\"0\"  name=\"r" + i + "\"></a></td>";
			code += "</tr>";
			
			if ( expand_links != null )
			{
				for ( var j = 1; j <= expand_links.length; j++ )
				{
					var	temp = (index * 10) + j;
					
					if ( expand_index == temp )
					{
						code += "<tr>";
						code += "<td><a href=\"" + expand_links[j - 1] + "\"  OnFocus=\"this.blur()\"><img src=\"" + prefix + "menu" + temp + "_on.gif\" border=\"0\"  name=\"r" + temp + "\"></a></td>";
						code += "</tr>";
					}
					else
					{
						code += "<tr>";
						code += "<td><a href=\"" + expand_links[j - 1] + "\" onMouseOver=\"imgOn('" + temp + "')\" onMouseOut=\"imgOff('" + temp + "')\" OnFocus=\"this.blur()\"><img src=\"" + prefix + "menu" + temp + "_off.gif\" border=\"0\"  name=\"r" + temp + "\"></a></td>";
						code += "</tr>";
					}
				}
			}
		}
		else
		{
			code += "<tr>";
			code += "<td><a href=\"" + links[i - 1] + "\" onMouseOver=\"imgOn('" + i + "')\" onMouseOut=\"imgOff('" + i + "')\" OnFocus=\"this.blur()\"><img src=\"" + prefix + "menu0" + i + "_off.gif\" border=\"0\"  name=\"r" + i + "\"></a></td>";
			code += "</tr>";
		}
	}
	
		
	code += "<tr>";
	code += "<td></td>";
	code += "</tr>";
	code += "</table>";

	document.write(code);
}


function popup_bbs()
{
	//var	win = window.open("http://echosun.com/event/cgi-bin/CrazyWWWBoard.cgi?db=enmarathon", "popup_eng", "left=50,top=50,width=700,height=700,scrollbars=1");
	//win.focus();
	location.href = 'http://echosun.com/event/cgi-bin/CrazyWWWBoard.cgi?db=enmarathon';
}

function popup_record()
{
	//var	win = window.open("http://marathon3.chosun.com/hrecord_search.html", "popup_eng", "left=50,top=50,width=700,height=450,scrollbars=1");
	//win.focus();
	//location.href = 'http://marathon3.chosun.com/hrecord_search.html';
	location.href = 'http://marathon3.chosun.com/PsnRankSearch3.html';
}

function popup_registation()
{
	//var	win = window.open("http://marathon3.chosun.com/html/personal/fagree.html", "popup_eng", "left=50,top=50,width=700,height=500,scrollbars=1");
	//win.focus();
	//location.href = 'http://marathon3.chosun.com/html/personal/fagree.html';
	location.href = 'http://marathon3.chosun.com/html/personal/fagree_close.html';
}

function popup_confirmation()
{
	//var	win = window.open("http://marathon3.chosun.com/html/personal/fpersonalLogin.html", "popup_eng", "left=50,top=50,width=700,height=610,scrollbars=1");
	//win.focus();
	location.href = 'http://marathon3.chosun.com/html/personal/fpersonalLogin.html';
}

function popup_participants()
{
	//var	win = window.open("http://marathon3.chosun.com/html/personal/perDirVerify.html", "popup_eng", "left=50,top=50,width=700,height=400,scrollbars=1");
	//win.focus();
	location.href = 'http://marathon3.chosun.com/html/personal/perDirVerify.html';
	//location.href = 'http://marathon3.chosun.com/html/personal/fpersonalLogin.html';
}