document.domain = "joymax.com";

function JMXHeader_goURL(targetURL)
{
	top.window.location.href=targetURL;
}


function generateJMXHeader(leftWidth, bodyWidth, rightWidth)
{
	document.domain = 'joymax.com';

	var leftMargin;
	var val = top.getCertifyInfo();

	if (val != undefined) {																							
		var cert_spt		= val.split('|'); // val °ªÀ» split ÇÔ¼ö·Î ºÐ¸®ÈÄ ·Î±×ÀÎ Ã¼Å© ÆäÀÌÁö·Î °ªÀ» ³Ñ°ÜÁØ´Ù.	
		var cJid				=  cert_spt[0];																			
		var cUserId		=  cert_spt[1];																			
		var cTimestamp	=  cert_spt[3];																			
		var cSerialKey	=  cert_spt[4];																			
		var md5Value		=  cert_spt[5];			

	}

	// JOYMAX CI¸¦ Á¤·ÄÇÏ±â À§ÇÑ ºÎºÐ
	if (leftWidth == "0")
	{
		leftMargin = "36";
	}
	else
	{
		leftMargin = "0";
	}
	
	var tableHeader = "<div id='header'>\
						<table id='mainNavi' name='mainNavi' width='100%' border='0' cellpadding='0' cellspacing='0' style='margin: 0 0 0 0;'>\
							<tr valign='middle' style='height: 32px; background: url(http://img.joymax.com/portal/common/jbar/header/bg.gif) repeat;'>\
								<td width='" + leftWidth + "'></td>\
								<td>\
									<table width='" + bodyWidth + "' id='subNavi' name='subnavi' border='0' cellpadding='0' cellspacing='0'>\
										<tr valign='middle'>";
	
	var objHTML = "<td style='width: 57px;padding-left: " + leftMargin + "px;padding-bottom: 3px;margin: 0 0 0 0;'>\
						<a href=javascript:JMXHeader_goURL('http://www.joymax.com/') onfocus='this.blur();' />\
							<img src='http://img.joymax.com/portal/common/jbar/header/copyright_ci.gif' style='width: 57px;height: 24px;' border='0' />\
						</a>\
					</td>";
	
	objHTML = objHTML + "<td style='width: 97px;padding-left: 5px;' align='center'>\
						<a href=javascript:JMXHeader_goURL('http://silkroad.joymax.com/') onfocus='this.blur();' />\<img src='http://img.joymax.com/portal/common/jbar/header/pp_sro.gif' style='width: 97px;height: 18px;' border='0' />\</a>\
					</td>\
					<td style='padding: 0 2px 0 2px;'>\
					</td>\
					<td style='width: 68px;padding-left: 5px;' align='center'>\
						<a href=javascript:JMXHeader_goURL('http://darkeden.joymax.com/') onfocus='this.blur();' />\<img src='http://img.joymax.com/portal/common/jbar/header/pp_dark.gif' style='width: 68px;height: 18px;' border='0' />\</a>\
					</td>\
					<td style='padding: 0 2px 0 2px;'>\
					</td>\
					<td style='width: 82px;padding-left: 5px;' align='center'>\
						<a href=javascript:JMXHeader_goURL('http://deco.joymax.com/') onfocus='this.blur();' />\<img src='http://img.joymax.com/portal/common/jbar/header/pp_deco.gif' style='width: 82px;height: 18px;' border='0' />\</a>\
					</td>";
	
	objHTML = objHTML + "<td style='width: 100%;'>\
					</td>";

	if ( cJid != '' ) {
		objHTML = objHTML + "<td style='width: 43px;padding-right: 2px;' align='right'>\
						<a href=javascript:top.logout(document.URL); onfocus='this.blur();' />\
							<img src='http://img.joymax.com/portal/common/jbar/header/logout.gif' style='width: 43px;height: 16px;' border='0' />\</a>\
					</td>\
					<td style='width: 93px;padding-right: 2px;' align='right'>\
						<a href=javascript:top.memberModify(document.URL); onfocus='this.blur();' />\<img src='http://img.joymax.com/portal/common/jbar/header/manage.gif' style='width: 93px;height: 16px;' border='0' />\</a>\
					</td>";
	}
	else {
		objHTML = objHTML + "<td style='width: 43px;padding-right: 2px;' align='right'>\
						<a href=javascript:top.login(document.URL); onfocus='this.blur();' />\<img src='http://img.joymax.com/portal/common/jbar/header/login.gif' style='width: 43px;height: 16px;' border='0' />\</a>\
					</td>\
					<td style='width: 93px;padding-right: 2px;' align='right'>\
						<a href=javascript:top.memberJoin(document.URL); onfocus='this.blur();' />\<img src='http://img.joymax.com/portal/common/jbar/header/acc.gif' style='width: 93px;height: 16px;' border='0' />\</a>\
					</td>\
					<td style='width: 103px;padding-right: 2px;' align='right'>\
						<a href=javascript:top.emailVerification(document.URL); onfocus='this.blur();' />\<img src='http://img.joymax.com/portal/common/jbar/header/email.gif' style='width: 103px;height: 16px;' border='0' />\</a>\
					</td>\
					<td style='padding-left: 7px;' align='center'>\
					</td>";
	}
		
	var tableFooter = "</tr>\
										</table>\
									</td>\
									<td width='" + rightWidth + "'></td>\
								</tr>\
							</table>\
							</div>";
							
	document.write (tableHeader);
	document.write (objHTML);
	document.write (tableFooter);
}