

var NS4;
var IE4;
if (document.all)
{
    IE4 = true;
    NS4 = false;
}
else
{
    IE4 = false;
    NS4 = true;
}
isWin = (navigator.appVersion.indexOf("Win") != -1)

/* onLoad Handler */
LOAD_LIST = new Array();
function LH_create()
{
    this.LIST = LOAD_LIST;
    this.add = LH_add;
    this.exec = LH_exec;
}

function LH_add(strExec)
{
    LOAD_LIST[LOAD_LIST.length] = strExec;
}

function LH_exec()
{
    var list_len = LOAD_LIST.length;
    for (var i = 0; i < list_len; i++)
    {
        eval(LOAD_LIST[i]);
    }
      parent.document.body.scrollTop = 0;
}

function resizeIframe(name)
{

    if (name == null || name == "")
    {
        name = "club_main";
    }
	
    var MinX = 0; //ÃÖ¼Ò °¡·ÎÆø
    var MinY = 0; //ÃÖ¼Ò ¼¼·ÎÆø
    var Frame_Body = document.frames(name).document.body;
    var Frame_Name = document.all(name);
	var x = Frame_Body.scrollWidth + (Frame_Body.offsetWidth - Frame_Body.clientWidth);
    var y = Frame_Body.scrollHeight + (Frame_Body.offsetHeight - Frame_Body.clientHeight);

    Frame_Name.style.width = x;

    if (x < MinX) x = MinX;
    if (y < MinY) y = MinY;

    Frame_Name.style.width = x;
    Frame_Name.style.height = y;
}


function parentResizeIframe(name)
{
    if (parent && parent != this && parent.resizeIframe != null)
    {
        parent.resizeIframe(name);
    }
}





// focus
function allblur() {
  for (i = 0; i < document.links.length; i++)
	document.links[i].onfocus = document.links[i].blur;
}

function window.onload()
{
	allblur();	
}

var changedImg;
function EImgChg(flag, e)
{
  if (!e) var e = window.event;
  if (e.target) source = e.target;
  else source=e.srcElement;

  if (source.name == "")
    return false;

  if(changedImg == source.name)
  return;

  else if (document.images && source.tagName=="IMG") 
  {
    imgElement = source.name;
    imgPath = source.src;

    imgPathLen = imgPath.length;
    imgPathFlag = imgPath.lastIndexOf("_");
    imgName = imgPath.substring(0,imgPathFlag+1);

    source.src =  imgName + flag + ".gif";
  }
}

function slink(){
        if (document.Links.Link_select.options[document.Links.Link_select.selectedIndex].value != "none")
                { 
        location = document.Links.Link_select.options[document.Links.Link_select.selectedIndex].value
                }           
}

function slink02(){
        if (document.Links.Link_select02.options[document.Links.Link_select02.selectedIndex].value != "none")
                { 
        location = document.Links.Link_select02.options[document.Links.Link_select02.selectedIndex].value
                }           
}

function Sntlink(){
        if (document.sntLinks.Snt_Link_select.options[document.sntLinks.Snt_Link_select.selectedIndex].value != "none")
                { 
                  var Tempsite;                  
             Tempsite = document.sntLinks.Snt_Link_select.options[document.sntLinks.Snt_Link_select.selectedIndex].value
             window.open(Tempsite);
                }           
}

function prod(info,max){
	 for(k=1; k<=max; k++) {
		 if(k == info) {
		   eval("p"+k+".style.display='';");
		 } else {
		   eval("p"+k+".style.display='none';");
		 }
	 }
}

function openWindow(url,intWidth,intHeight)
{
	window.open(url, "_blank", "width="+intWidth+",height="+intHeight+",resizable=0,scrollbars=0,statusbar=no") ;
}

// layer
function LayerSH(LayerName,Status) 
{
	LayerN = document.all[LayerName].style;
	if (Status == 'show') LayerN.display = '';
	if (Status == 'hide') LayerN.display = 'none';
}


   function func_adjustimage(target_img,chk_width,chk_height)
   {
//   		alert(chk_width);
      var newX;
      var newY;
      var newHeight;
      var newWidth;
      var maxWidth = chk_width;
      var maxHeight = chk_height;
      var newImg = new Image();
      newImg.src = target_img.src;
      imgw = newImg.width;
      imgh = newImg.height;
      if (imgw > maxWidth || imgh > maxHeight)
      {
         if (imgw > imgh)
         {
            if (imgw > maxWidth)
               newWidth = maxWidth;
            else
               newWidth = imgw;
            newHeight = Math.round((imgh * newWidth) / imgw);
			
         }
         else
         {
            if (imgh > maxHeight)
               newHeight = maxHeight;
            else
               newHeight = imgh;
            newWidth = maxWidth;
			//Math.round((imgw * newHeight) / imgh);
//			alert(newWidth);
         }
      }
      else
      {
         newWidth = imgw;
         newHeight = imgh;
      }
       newX = maxWidth / 2 - newWidth / 2;
       newY = maxHeight / 2 - newHeight / 2;
       target_img.onload = null;
       target_img.src = newImg.src;
       target_img.width = newWidth;
       target_img.height = newHeight;
//	   alert(target_img.width);
//	   alert(target_img.height);

//		parentResizeIframe('ts_frm_cont')
	}

	
function win_open(url,width,height)
{
	open_win(url, 'openwin',width, height,'');
}

/* ÆË¾÷ °ü·Ã ÇÔ¼ö */
function open_win(url, name, width, height, feature)
{
    var oWnd;

    if (IE4 && width < window.screen.width && height < window.screen.height) 
    {
        var windowX = Math.ceil( (window.screen.width  - width) / 2 );
        var windowY = Math.ceil( (window.screen.height - height) / 2 );

        oWnd = window.open(url, name, feature+",width=" + width +",height=" + height+",left="+windowX+",top="+windowY + ",scrollbars=yes,resizable=no");
    }
    else 
    {
        oWnd = window.open(url, name, feature+",width=" + width +",height=" + height + ",scrollbars=yes, resizable=no");
    }

    return oWnd;
}


function preview(imgsrc)
{
	open("/comm/preview.asp?imgsrc="+imgsrc, "preview", "width=100, height=100, top=0, left=0");
}

