// JavaScript Document
<!-- 

//
/*function clickshow(num) {
	for (i=1;i<=1;i++) {  // change the number of blocks in the page, the object ID should be 'block#'
		layer=eval("document.all.block"+i+".style");
		if (num==i) {
			if (layer.display=="block") {
				layer.display="none";
			}
			else {
				layer.display="block";
			}
        }
	}
}
*/
//---------------- Hide/Show Layer ------------------//
/* Usage: onclick="clickshow('ticker') 
<div id="ticker"> </div>
<script type="text/javascript">
	document.getElementById('ticker').style.display = "block";
</script>*/
function clickshow(objectID) {	
	object=document.getElementById(objectID)
	layer=eval("object.style");
	if (layer.display=="block") {
		layer.display="none";
	}
	else {
		layer.display="block";
	}
}
//---------------- End Hide/Show layer --------------//

function copyit(content) {
        var copy = eval(content)       
        copy.select()
        doc = copy.createTextRange()
        doc.execCommand("Copy")
	    alert("복사된 피드 주소를 Ctrl+V를 사용하여 RSS Reader에 입력하세요.")
}

// Example:
// alert( readCookie("myCookie") );
function readCookie(name) {
  var cookieValue = "";
  var search = name + "=";
  if(document.cookie.length > 0) { 
    offset = document.cookie.indexOf(search);
    if (offset != -1) { 
      offset += search.length;
      end = document.cookie.indexOf(";", offset);
      if (end == -1) end = document.cookie.length;
      cookieValue = unescape(document.cookie.substring(offset, end))
    }
  }
  return cookieValue;
}

// Example:
// writeCookie("myCookie", "my name", 24);
// Stores the string "my name" in the cookie "myCookie" which expires after 24 hours.
function writeCookie(name, value, hours) {
  var expire = "";
  if(hours != null) {
    expire = new Date((new Date()).getTime() + hours * 3600000);
    expire = "; expires=" + expire.toGMTString();
  }
  document.cookie = name + "=" + escape(value) + expire;
}

//---------------- Begin Open Image --------------//
function OpenImage(s){
        browserName=navigator.appName;
        
        srcImg = new Image();
        clientWidth = screen.width;
        clientHeight = screen.height;
        srcImg.src = s;

        var srcFileName = srcImg.src.substr(srcImg.src.lastIndexOf("/")+1, srcImg.src.length);

        win = window.open("","","width=15,height=15,scrollbars=no,resizable=no,left="+(clientWidth/2-15)+",top="+(clientHeight/2-15)+"");
        win.document.writeln("<html>");
        win.document.writeln("<head>");
        win.document.writeln("<title>"+document.title+" ["+srcFileName+"]</title>");
        win.document.writeln("</head>");
        win.document.writeln("<body>");
        win.document.writeln("<table border='0' cellpadding='0' cellspacing='0' style='cursor:hand' onclick='self.close()'>");
        win.document.writeln(" <tr>");
        win.document.writeln("  <td align='center'><img src="+s+" name='winImg' style='cursor:hand' onclick='self.close()' alt='Click the image to close'></td>");
        win.document.writeln(" </tr>");
        win.document.writeln("</table>");
        win.document.writeln("</body>");
        win.document.writeln("</html>");
        win.document.close(); 
        win.focus(); 

        srcImg = win.document.winImg;
        
        if (browserName =="Microsoft Internet Explorer") { 
          while(true)
                if(srcImg.readyState == "complete")
                        break;
        }
        
        var winWidth = srcImg.width+50;
        var winHeight = srcImg.height+69;

        var left = (clientWidth/2)-(srcImg.width/2);
        var top = (clientHeight/2)-(srcImg.height/2+50);

        if(clientWidth <= srcImg.width){
                winWidth = clientWidth;
                left = 0;
                win.document.body.scroll = "auto";
        }
        if(clientHeight <= srcImg.height){
                winHeight = clientHeight-30;
                top = 0;
                win.document.body.scroll = "auto";
        }

        win.moveTo(left, top);
        win.resizeTo(winWidth, winHeight);
}
//---------------- End Open Image --------------//

//---------------- Begin Open Window --------------//
/* Usage: javascript:openWindow('remote_desktop.html','resizable=no, toolbar=no, menubar=no, scrollbars=yes, width=920,        
		  height=600,top=0,left=0')*/
pollWin = null
function openWindow(url, resize, scroll, w, h) {
     if(pollWin && !pollWin.closed) {
            pollWin.close()
      }
     pollWin = window.open(url,null, "resizable="+resize+",scrollbars="+scroll+",width="+w+",height="+h+",top=140,left=200") ;
     browser_name = navigator.appName;
     if (browser_name == "Netscape") { 
          pollWin.focus() ;
     }
     
}
//---------------- End Open Window --------------//


//-->
