//top¹öÆ° ·Ñ¸µ
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 + 20; // À§ÂÊ À§Ä¡
}
else if ( bExplorer4plus ) { // IE ¿ë ¼³Á¤
yMenuFrom = parseInt (divMenu.style.top, 10); //À§¿¡¼­ ³»·Á¿À´Â À§Ä¡
yMenuTo = document.body.scrollTop + 345; // À§ÂÊ À§Ä¡
}

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 )
// top.location.href = self.location.href;

// Æä¿¡Áö ·Îµù½Ã Æ÷Áö¼Ç
if ( bNetscape4plus ) {
document["divMenu"].top = top.pageYOffset + 100;
document["divMenu"].visibility = "visible";
}
else if ( bExplorer4plus ) {
divMenu.style.top = document.body.scrollTop + 100;
divMenu.style.visibility = "visible";
}

CheckUIElements();
return true;
}

//ÀÌ¹ÌÁö ·Ñ¿À¹ö È¿°ú
function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

function na_restore_img_src(name, nsdoc)
{
  var img = eval((navigator.appName.indexOf('Netscape', 0) != -1) ? nsdoc+'.'+name : 'document.all.'+name);
  if (name == '')
    return;
  if (img && img.altsrc) {
    img.src    = img.altsrc;
    img.altsrc = null;
  } 
}

function na_preload_img()
{ 
  var img_list = na_preload_img.arguments;
  if (document.preloadlist == null) 
    document.preloadlist = new Array();
  var top = document.preloadlist.length;
  for (var i=0; i < img_list.length; i++) {
    document.preloadlist[top+i]     = new Image;
    document.preloadlist[top+i].src = img_list[i+1];
  } 
}

function na_change_img_src(name, nsdoc, rpath, preload)
{ 
  var img = eval((navigator.appName.indexOf('Netscape', 0) != -1) ? nsdoc+'.'+name : 'document.all.'+name);
  if (name == '')
    return;
  if (img) {
    img.altsrc = img.src;
    img.src    = rpath;
  } 
}

// ¸µÅ©Á¡¼±¾ø¾Ö±â ///////////////////////////////////////////////
function bluring() {
	if (event.srcElement.tagName == "A" || event.srcElement.tagName == "IMG")
		document.body.focus();
} 
document.onfocusin = bluring;

// iframe sizeÁ¶Àý¿ë ½ºÅ©¸³Æ® ------------
function reSize() {
        try{
        var objBody = innerFrame.document.body;
        var objFrame = document.all["innerFrame"];
        ifrmHeight = objBody.scrollHeight + (objBody.offsetHeight - objBody.clientHeight);
        
        if (ifrmHeight > 300) {
                objFrame.style.height = ifrmHeight
        }else{
                objFrame.style.height = 300;
        }
        objFrame.style.width = '640'
        }catch(e){}
}
function init_iframe() {
        reSize();
        setTimeout('init_iframe()',100)
}
init_iframe();

//»õÃ¢ ¶ç¿ì±â
function na_open_window(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';
  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 MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

//select
function go_url(url)
{
    if(url != '')   window.open(url,'_blank');
}

// ÇØ»óµµ¿¡ °ü°è¾øÀÌ È­¸é Áß¾Ó¿¡ »õÃ¢ ¶ç¿ì±â
function CenterWin(url,winname,features) {
	features = features.toLowerCase(); 
	len = features.length; 
	sumchar= ""; 
	
	 // ºóÄ­ Á¦°Å
	for (i=1; i <= len; i++) { 
		onechar = features.substr(i-1, 1);
		if (onechar != " ") sumchar += onechar;
	}
	
	features = sumchar; 
	sp = new Array(); 
	sp = features.split(',', 10); // ¹è¿­¿¡ ¿É¼ÇÀ» ºÐ¸®ÇØ¼­ ÀÔ·Â 
	splen = sp.length; // ¹è¿­ °¹¼ö 
	
	// width, height °ªÀ» ±¸ÇÏ±â À§ÇÑ ºÎºÐ 
	for (i=0; i < splen; i++) { 
		if (sp[i].indexOf("width=") == 0) // width °ªÀÏ¶§ 
		{ 
			width = Number(sp[i].substring(6)); 
		} else if (sp[i].indexOf("height=") == 0) // height °ªÀÏ¶§ 
		{ 
			height = Number(sp[i].substring(7)); 
		}
	} 
	
	sleft = (screen.width - width) / 2; 
	//stop = (screen.height - height) / 2; 
	stop = 20;
	features = features + ",left=" + sleft + ",top=" + stop; 
	popwin = window.open(url,winname,features); 
}