// write object, embed, applet tag
function writeObjTag(objName)
{
	document.write(document.getElementById(objName).value);
}

//³¯°³¹è³Ê ½ºÅ©¸³Æ®
var bNetscape4plus = (navigator.appName == "Netscape" && navigator.appVersion.substring(0,1) >= "4");
var bExplorer4plus = (navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.substring(0,1) >= "4");
function CheckUIElements(){
        var yMenuFrom, yMenuTo, yButtonFrom, yButtonTo, yOffset, timeoutNextCheck;

        if ( bNetscape4plus ) { 
                yMenuFrom   = document["divMenu"].top;
                yMenuTo     = top.pageYOffset + 157;
        }
        else if ( bExplorer4plus ) {
                yMenuFrom   = parseInt (divMenu.style.top, 10);
                yMenuTo     = document.body.scrollTop + 154;
        }

        timeoutNextCheck = 500;

        if ( Math.abs (yButtonFrom - (yMenuTo + 152)) < 6 && yButtonTo < yButtonFrom ) {
                setTimeout ("CheckUIElements()", timeoutNextCheck);
                return;
        }

        if ( yButtonFrom != yButtonTo ) {
                yOffset = Math.ceil( Math.abs( yButtonTo - yButtonFrom ) / 10 );
                if ( yButtonTo < yButtonFrom )
                        yOffset = -yOffset;

                if ( bNetscape4plus )
                        document["divLinkButton"].top += yOffset;
                else if ( bExplorer4plus )
                        divLinkButton.style.top = parseInt (divLinkButton.style.top, 10) + yOffset;

                timeoutNextCheck = 10;
        }
        if ( yMenuFrom != yMenuTo ) {
                yOffset = Math.ceil( Math.abs( yMenuTo - yMenuFrom ) / 20 );
                if ( yMenuTo < yMenuFrom )
                        yOffset = -yOffset;

                if ( bNetscape4plus )
                        document["divMenu"].top += yOffset;
                else if ( bExplorer4plus )
                        divMenu.style.top = parseInt (divMenu.style.top, 10) + yOffset;

                timeoutNextCheck = 10;
        }

        setTimeout ("CheckUIElements()", timeoutNextCheck);
}

function OnLoad()
{
        var y;
        if ( top.frames.length )
        if ( bNetscape4plus ) {
                document["divMenu"].top = top.pageYOffset + 135;
                document["divMenu"].visibility = "visible";
        }
        else if ( bExplorer4plus ) {
                divMenu.style.top = document.body.scrollTop + 135;
                divMenu.style.visibility = "visible";
        }
        CheckUIElements();
        return true;
}


function putHotlink() {
    document.writeln('<div id=divMenu style="position:absolute; left:920; top:100">');
    document.writeln('<script>putFlash("../flash/hotlink.swf","80","270")</script>');
    document.writeln('</div>');
    document.writeln('<script>OnLoad();</script>');
    document.writeln('');
    document.writeln('');
    document.writeln('');
}

function putMainTop(SESSION) {
    document.writeln('<table border="0" width="100%" cellspacing="0" cellpadding="0" bgcolor="white" height="510">');
    document.writeln('	<tr>');
    document.writeln('		<td width="920" height="510" style="background-image:url(../images/main/main_bg.jpg);background-repeat:no-repeat;"><script>putFlash("../flash/main_visual.swf?session='+SESSION+'","920","510")</script></td>');
    document.writeln('		<td><script>putHotlink();</script></td>');
    document.writeln('	</tr>');
    document.writeln('</table>');
}

function putSubTop(CATE,SESSION) {
    document.writeln('<table border="0" width="100%" cellspacing="0" cellpadding="0" bgcolor="white" height="260">');
    document.writeln('	<tr>');
    document.writeln('		<td width="920" height="260"><script>putFlash("../flash/sub_visual.swf?NowCate='+CATE+'&session='+SESSION+'","920","260")</script></td>');
    document.writeln('		<td><script>putHotlink();</script></td>');
    document.writeln('	</tr>');
    document.writeln('</table>');
}

function putFooter() {
    document.writeln('<title>:::Ã¢´ö±Ã:::</title>');
    document.writeln('<table border="0" width="100%" cellspacing="0" cellpadding="0" background="../images/common/footer_bg.gif">');
    document.writeln('	<tr>');
    document.writeln('		<td><img src="../images/common/footer_copyright.gif"></td>');
    document.writeln('	</tr>');
    document.writeln('</table>');
}

function putLeftMenu(MENU) {
    document.writeln('<script>putFlash("../flash/sub_leftMenu.swf?NowMenu='+MENU+'","170","250")</script>');
}

function putFlash(SRC,WIDTH,HEIGHT) {
    document.writeln('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+WIDTH+'" height="'+HEIGHT+'">');
    document.writeln('<param name="movie" value="'+SRC+'">');
    document.writeln('<param name="wmode" value="transparent">');
    document.writeln('<param name="quality" value="high">');
    document.writeln('<embed src="'+SRC+'" quality="high" pluginspage="https://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+WIDTH+'" height="'+HEIGHT+'"></embed>');
    document.writeln('</object>');
}


function openWin(name, url, left, top, width, height, toolbar, menubar, statusbar, scrollbar, resizable)
{
  toolbar_str = toolbar ? 'yes' : 'no';
  menubar_str = menubar ? 'yes' : 'no';
  statusbar_str = statusbar ? 'yes' : 'no';
  scrollbar_str = scrollbar ? 'yes' : 'no';
  resizable_str = resizable ? 'yes' : 'no';

  cookie_str = document.cookie;
  cookie_str.toString();

  pos_start  = cookie_str.indexOf(name);
  pos_end    = cookie_str.indexOf('=', pos_start);

  cookie_name = cookie_str.substring(pos_start, pos_end);

  pos_start  = cookie_str.indexOf(name);
  pos_start  = cookie_str.indexOf('=', pos_start);
  pos_end    = cookie_str.indexOf(';', pos_start);
  
  if (pos_end <= 0) pos_end = cookie_str.length;
  cookie_val = cookie_str.substring(pos_start + 1, pos_end);
  if (cookie_name == name && cookie_val  == "done")
    return;
//	alert(height);
  window.open(url, name, 'left='+left+',top='+top+',width='+width+',height='+height+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str);
}

function popupLogin(){
	/*
//document.write(navigator.userAgent);
//Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; i-NavFourF; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; InfoPath.1)
//Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.2; .NET CLR 1.1.4322; InfoPath.1)
	*/
	strAgent = navigator.userAgent ;
	var Width , Flag = "MSIE 7.0";
	if((i = strAgent.indexOf(Flag)) >= 0 ){
		Height = 210 ;
	}
	else{
		Height = 200 ;
	}

//	window.open('../member/popup_login.htm','Login',' left=100, top=100,width=250,height='+Height+', toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=no');
	openWin('win', '../member/popup_login.htm', 100, 100, 250, Height, 0, 0, 0, 0, 0);
}

function popupQnA(){
	window.open('http://www.e-minwon.go.kr/webs/menu.jsp?m1=3&m2=3#epeopleFrameFocus');
}

//ÆË¾÷´ÝÈ÷¸é¼­ ÀÌµ¿
function popupCloseMove(url) {
  opener.location.href = url;
  window.close();
}