//초기 로딩
function addLoadEvent(func){
	var oldonload = window.onload;
	if(typeof window.onload != "funcion") {
		window.onload = func;
	}else{
		oldonload();
		func();
	}
}


var swfName = "navigation";
var swfId = "gnbSwf";
var swfPath = "/common/flash/";
var widthValue = 740;
var heightValue = 58;
var xmlPath = "/common/xml/";
var wmodeValue = "window"

// GNB 플래시 로딩
function gnbFlashWrite(pageCode) {
	flashTagValue = "" +
	"<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' width='"+ widthValue + "' height='" + heightValue + "' id='" + swfId + "' align='middle'>" +
	"<param name='allowScriptAccess' value='sameDomain' />" +
	"<param name='allowFullScreen' value='true' />" +
	"<param name='movie' value='" + swfPath + swfName + ".swf' />" +
	"<param name='quality' value='high' />" +
	"<param name='FlashVars' value='xmlPath=" + xmlPath + "&pageCode=" + pageCode + "' />" +
	"<param name='wmode' value='" + wmodeValue + "' />" +
	"<embed src='" + swfPath + swfName + ".swf' FlashVars='xmlPath=" + xmlPath + "&pageCode=" + pageCode + "' quality='high' width='" + widthValue + "' height='" + heightValue + "' id='" + swfId + "' align='middle' allowScriptAccess='sameDomain' allowFullScreen='true' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />" +
	"</object>";
	document.write(flashTagValue);
}

// Main Banner 플래시 로딩
function bannerFlashWrite() {
	flashTagValue = "" +
	"<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' width='151' height='184' id='ban' align='middle'>" +
	"<param name='allowScriptAccess' value='sameDomain' />" +
	"<param name='allowFullScreen' value='true' />" +
	"<param name='movie' value='" + swfPath + "banner.swf' />" +
	"<param name='quality' value='high' />" +
	"<param name='wmode' value='" + wmodeValue + "' />" +
	"<embed src='" + swfPath + "banner.swf' quality='high' width='151' height='184' id='ban' align='middle' allowScriptAccess='sameDomain' allowFullScreen='true' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />" +
	"</object>";
	document.write(flashTagValue);
}


function lngService(pageCode) {
	var sv1 = ""
	var sv2 = ""
	var sv3 = ""

	if(pageCode == "040100") {
		sv1 = "selected"
	} else if (pageCode == "040200"){
		sv2 = "selected"
	} else if (pageCode == "040300"){
		sv3 = "selected"
	}

	tagValue = "" +
		"				<li><a href='/service/as.asp' class='" + sv1 + "'>A/S 안내</a></li>" +
		"				<li><a href='/service/book.asp' class='" + sv2 + "'>데모룸 예약</a></li>" +
		"				<li><a href='/service/edu.asp' class='" + sv3 + "'>교육 안내</a></li>";

	document.write(tagValue);
}


function lngNews(pageCode) {
	var sv1 = ""
	var sv2 = ""

	if(pageCode == "030100") {
		sv1 = "selected"
	} else if (pageCode == "030200"){
		sv2 = "selected"
	}

	tagValue = "" +
		"				<li><a href='/news/news.asp' class='" + sv1 + "'>공지 &amp; 뉴스</a></li>" +
		"				<li><a href='/news/event.asp' class='" + sv2 + "'>이벤트</a></li>";

	document.write(tagValue);
}


// 뉴스/이벤트 게시판 읽기 iframe 리사이징
function getReSize()
{
       try {
              var objFrame = document.getElementById("ifrm");
              var objBody = ifrm.document.body; 

              ifrmHeight = objBody.scrollHeight + (objBody.offsetHeight - objBody.clientHeight); 

              if (ifrmHeight > 200) { 
                     objFrame.style.height = ifrmHeight; 
              } else {
                     objFrame.style.height = ifrmHeight;
              } 
              objFrame.style.width = '690'
       } catch(e) {
       };
} 

function getRetry()
{
       getReSize(); 
       setTimeout('getRetry()',100);
}



function OpenWindow(url, boxname, width, height , scrollbars)
{
    if ( !scrollbars ) scrollbars = "no";
    
	var winLeft = (screen.width - width) / 2;
    var winTop = (screen.height - height) / 2;
    var winProps = "width="+width+",height="+height+",top="+winTop+",left="+winLeft+",scrollbars=" + scrollbars + ",resize=yes";

    var win = window.open(url,boxname,winProps);
    win.focus();
}

function objPriview(strKey)
{
	OpenWindow(strKey, "AdvanceOrder", 950, 550, 1);
}