<!--

function getCookie(sName)
{
    var aCookie = document.cookie.split("; ");
    for (var i=0; i < aCookie.length; i++)
    {
        var aCrumb = aCookie[i].split("=");
        if (sName == aCrumb[0])
            return unescape(aCrumb[1]);
    }
    return null;
}          

var i = 0;
var w, h;
var pop_url;

function popup(a,b,c,d,e,f,g,path,s)
{
   var filename=a;
   var top=b;
   var left=c;
   w=d;
   h=e;
   var cook = f;
   var no = g;
   
   pop_url=path+"/pop/popup"+i+".php?filename="+filename+"&x="+w+"&y="+h+"&no="+no+"&anim="+s+"&left="+left+"&top="+top;
   
   if (getCookie(cook) != "pop"+no ) 
   {
     /*
     if ( s == "0" ) 
       window.open(pop_url,"pop"+i, "toolbar=no, width="+w+", height="+h+", left="+left+", top="+top);
     else 
      resize_open(left,top);
      */
      if ( s == "0" ) 
        window.open(pop_url,"pop"+i, "toolbar=no, width="+w+", height="+h+", left="+left+", top="+top);
      else 
        window.open(pop_url,"pop"+i, "toolbar=no, width=100, height=100, left=3, top=3");
   }
   i = i + 1;
}


function setCookie(name, value, expiredays)
{ 
	var todayDate = new Date(); 
	todayDate.setTime(todayDate.getTime() + expiredays*24*60*60*1000); 
	document.cookie = name + "=" + escape(value) + "; path=/; expires=" + todayDate.toGMTString() + ";" 
} 

function closeWin(num, cooknm, no)
{ 
	var delay = num;
	var kpop = eval("document.kpop"+no);
	if(kpop.note.checked)
	{
		setCookie( cooknm, "pop"+no , delay);
	}
	document.getElementById("style"+no).style.display = "none";
} 

function initLayer(cooknm, no)
{
   if (getCookie(cooknm) == "pop"+no ) 
   {
     if ( document.getElementById("style"+no) ) {
      document.getElementById("style"+no).style.display = "none";
     }
   }
}


var winheight=100;
var winsize=100;
var x=5;
var pop_url;
var win;

function resize_open(left, top )
{
  win = window.open(pop_url, left+top, "scrollbars=no" );
  if (!document.layers&&!document.all) { win.location=pop_url; return; }
  win.resizeTo(100,100);
  win.moveTo(left,top);
  resize();
}

function resize()
{
  
  if ( winheight >= (parseInt(h)+50) -3) x=0;

  win.resizeBy(5,x);
  winheight+=5;
  winsize+=5;

  if ( winsize >= w -5)
  {
    //win2.location=pop_url;
    winheight=100;
    winsize=100;
    x=5;
    return;
  }
  
  setTimeout("resize()",1);
  
}




//-->
