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

} 
document.onfocusin=bluring; 

//window.onload¿Í <body onload="">´Â µ¿½Ã¿¡ »ç¿ëÀ» ÇÒ ¼ö ¾ø´Ù.
//<body onload="">°¡ ½ÇÇàÀÌ µÇ¸é window.onload´Â ½ÇÇàÀÌ µÇÁö ¾Ê´Â ¹®Á¦°¡ ÀÖ´Ù.
//window.onload = function(){ ½ÃÀÛ½Ã ½ÇÇàµÉ ³»¿ë }
//function window::onload(){ ½ÃÀÛ½Ã ½ÇÇàµÉ ³»¿ë }


//################################################################################//
// ÀÌ¹ÌÁö »õÃ¢À¸·Îº¸±â ¼Ò½ºµé
//################################################################################//

//ÀÌ¹ÌÁö »õÃ¢À¸·Î Å©°Ôº¸±â
function OpenImage(s){
        //
        // º¯¼ö Á¤ÀÇ
        //
        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("<meta http-equiv='imagetoolbar' CONTENT='no'>");
        win.document.writeln("</head>");
        win.document.writeln("<body style='margin:0px;' bgcolor='#333333'>");
        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='Å¬¸¯ÇÏ¸é »ç¶óÁý´Ï´Ù'></td>");
        win.document.writeln(" </tr>");
        win.document.writeln("</table>");
        win.document.writeln("</body>");
        win.document.writeln("</html>");

        srcImg = win.document.winImg;
        //
        // ÀÌ¹ÌÁö°¡ ¸ðµÎ ·ÎµùµÉ¶§±îÁö ±â´Ù¸²
        //
        while(true)
                if(srcImg.readyState == "complete")
                        break;

        //
        // »õÃ¢ÀÇ Å©±â ¼³Á¤
        //
        var winWidth = srcImg.width+10;
        var winHeight = srcImg.height+29;
        //
        // »õÃ¢ÀÌ ¶ç¿öÁú À§Ä¡ ¼³Á¤
        //
        var left = (clientWidth/2)-(srcImg.width/2);
        var top = (clientHeight/2)-(srcImg.height/2);
        //
        // ÀÌ¹ÌÁöÀÇ Å©±â overflow È®ÀÎÈÄ »õÃ¢ÀÇ Å©±â¿Í À§Ä¡ Àç¼³Á¤
        //
        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);
}


// ¹»±î?
function img_up(img,no,alt)
{
	t = eval("this.img"+no);
//	ts = eval("this.imgs"+no);
t.innerHTML = "<img src=\""+img+"\" onclick=\"OpenImage(this.src)\" width=30 height=30 alt=\""+alt+"\" style=cursor:hand>";
//if(alt=='')ts.innerHTML = "<img src=\""+img+"\" onclick=\"OpenImage(this.src)\" width=30 height=30 alt=\""+alt+"\" style=cursor:hand>";
}

//###############################################################################//
//ÆË¾÷¼Ò½ºµé
//###############################################################################//
// a ÅÂ±×¿¡¼­ onclick ÀÌº¥Æ®¸¦ »ç¿ëÇÏÁö ¾Ê±â À§ÇØ
function popOpen(url, name, option)
{
		var popup = window.open(url, name, option);
		popup.focus();
}

// ÆË¾÷À¸·Î¸¸ ¶ç¿ì±â 
function popOpen2(url, target) {
    if(typeof(target)=="undefined") target = "_blank";
    winopen(url, target, "left=10,top=10,width=10,height=10,scrollbars=no,resizable=no,toolbars=no");
}

//±âº» ÀÎÀÚ°ª ½ºÅ©·Ñ ¿©ºÎÁöÁ¤
function popValue(url, name, w, h, topP, leftP, s)
{
    var pop = window.open(url, name,
        'width='+ w + ', height='+ h +', top='+ topP +', left='+ leftP +', menubar=no, scrollbars='+ s +', resizable=no');
    pop.focus();
}

//ÆË¾÷À» Ã¢°¡¿îµ¥¿¡ ¶ç¿ì±â
function popCenter(url, name, w, h, topP, leftP, s)
{
    var leftX = (document.body.clientWidth/2) - (gopageWidth/2);
    var topY = (document.body.clientHeight/2) - (gopageHeight/2);
    var pop = window.open(url, name,'width='+w+ ', height='+h+', top='+ topP+', left='+leftP+', menubar=no, scrollbars='+s+', resizable=no');
    pop.focus();
}

function sk_pop(newwin,w,h,topP,leftP) { // À§Ä¡ÁöÁ¤
	winprops = 'width='+w+',height='+h+',top='+topP+',left='+leftP+',resizable=no,scrollbars=no,toolbars=no,status=no,menu=no';
	win = window.open(newwin, "new1", winprops);
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}
	
function sk_pop1(newwin,w,h) { //±âº» °øÅë ÆË¾÷
	var winl = 0;
	var wint = 0;
	winprops = 'width='+w+',height='+h+',top='+wint+',left='+winl+',resizable=no,scrollbars=no,toolbars=no,status=no,menu=no';
	win = window.open(newwin, "new1", winprops);
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

// ¿ìÆí¹øÈ£ Ã¢
function win_zip(frm_name, frm_zip1, frm_zip2, frm_addr1, frm_addr2)
{
		url = g4_path + "/" + g4_bbs + "/zip.php?frm_name="+frm_name+"&frm_zip1="+frm_zip1+"&frm_zip2="+frm_zip2+"&frm_addr1="+frm_addr1+"&frm_addr2="+frm_addr2;
		popOpen(url, "winZip", "left=50,top=50,width=616,height=460,scrollbars=1");
}

// ÆÐ½º¿öµå ºÐ½Ç Ã¢
function win_password_forget()
{
		popOpen(g4_path + "/" + g4_bbs + "/password_forget.php", 'winPasswordForget', 'left=50, top=50, width=616, height=500, scrollbars=1');
}

//################################################################################//

//Select Link ÀÌµ¿
//<select name="pageSelect" onChange="navigate()">
//<option value="http://www.infraware.co.kr"> ÀÎÇÁ¶ó¿þ¾î </option>
//</select>
function navigate()
{
	var selectedIndex = document.testForm.pageSelect.selectedIndex;
	var navigateURL =	document.testForm.pageSelect.options[selectedIndex].value;
	
	window.open( navigateURL );
}

//Select Link ÀÌµ¿2
//<select name="drop" onChange="navChange2(this); return true;">
function navChange2(popup) {
if (popup.options[popup.selectedIndex].value != "")
{
window.open(popup.options[popup.selectedIndex].value, '_blank');
popup.selectedIndex=0;
}
}

//################################################################################//

//¸ÞÀÏ, mailto
function sendMailTo(to) {
    location.href="mailto:"+to;
}

//################################################################################//
// ÇÃ·¡½Ã Á¡¼±¾ø¾Ö´Â ¼Ò½ºµé
//################################################################################//

// ¸ÖÆ¼¹Ìµð¾î Ãâ·Â¿ë (IE¿¡¼­ ÇÃ·¡½¬/µ¿¿µ»ó ÁÖº¯¿¡ Á¡¼± »ý±è ¹æÁö¿ë)
function displayMultimedia(src, width, height, auto_start) {
    if(src.indexOf('files')==0) src = request_uri+src;
    if(auto_start) auto_start = "true";
    else auto_start = "false";

    var clsid = "";
    var codebase = "";
    var html = "";

    if(/\.swf/i.test(src)) {
        clsid = "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"; 
        codebase = "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0";
        html = ""+
            "<object classid=\""+clsid+"\" codebase=\""+codebase+"\" width=\""+width+"\" height=\""+height+"\" >"+
            "<param name=\"wmode\" value=\"transparent\" />"+
            "<param name=\"allowScriptAccess\" value=\"always\" />"+
            "<param name=\"movie\" value=\""+src+"\" />"+
            "<param name=\"quality\" value=\"high\" />"+
            "<embed src=\""+src+"\" autostart=\""+auto_start+"\"  width=\""+width+"\" height=\""+height+"\"></embed>"+
            "<\/object>";
    } else if(/\.flv/i.test(src)) {
        html = "<embed src=\""+request_uri+"common/tpl/images/flvplayer.swf?autoStart="+auto_start+"&file="+src+"\" width=\""+width+"\" height=\""+height+"\" type=\"application/x-shockwave-flash\"></embed>";
    } else {
        html = "<embed src=\""+src+"\" autostart=\""+auto_start+"\" width=\""+width+"\" height=\""+height+"\"></embed>";
    }

    document.writeln(html);
}

// ÇÃ·¡½ÃÅ×µÎ¸®¾ø¾Ö±â JavaScript Document
//<script language="javascript"> inflash('995','80','../image/menubar.swf'); </script>
function inflash(fwidth,fheight,fpath) {
var flash_tag = "";
flash_tag = '<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ';
flash_tag +='codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" ';
flash_tag +='WIDTH="'+fwidth+'" HEIGHT="'+fheight+'" >';
flash_tag +='<param name="movie" value="'+fpath+'">';
flash_tag +='<param name="quality" value="high">';
flash_tag +='<param name="wmode" value="transparent">';
flash_tag +='<embed src="'+fpath+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" ';
flash_tag +='type="application/x-shockwave-flash" WIDTH="'+fwidth+'" HEIGHT="'+fheight+'"></embed></object>'

document.write(flash_tag);

}

//################################################################################//
// ÀÌ¹ÌÁö Rollover ¼Ò½º
//################################################################################//

//<img src="../image/xxx.gif" border="0" onmouseover="imgOn(this)" onmouseout="imgOut(this)">
// rollover
function imgOn(imgEl)
{
 if(imgEl.className!="onpage") {
 imgEl.src = imgEl.src.replace(".gif", "_on.gif");
 }
}
// rollout
function imgOut(imgEl)
{
 if(imgEl.className!="onpage") { 
 imgEl.src = imgEl.src.replace("_on.gif", ".gif");
 }
}

