
	function downloadFile(dir , filename){
		window.location = "download.php?upPath="+dir+"&filename="+filename;
	}

function viewImg(src,width,height){

	var strHtml = "<head><title>¢Æ  ÀÌ¹ÌÁö¿øº» º¸±â ¢Æ</title></head>";
		strHtml += "<body topmargin=0 leftmargin=0 ><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">	";
		strHtml +="  <tr>";
		strHtml +="	<td width=\"100%\" height=\"100%\" valign=\"top\">";
		strHtml +="	<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
		strHtml +="	  <tr>";
		strHtml +="		<td><table width=\"100%\" border=\"0\" align=\"left\" cellpadding=\"0\" cellspacing=\"0\">";
		strHtml +="		  <tr>";
		strHtml +="			<td align=\"left\" height=\"100%\" ><img src=\""+src+"\" onclick='self.close()' style='cursor:hand'></td>";
		strHtml +="		  </tr>";
		strHtml +="		</table></td>";
		strHtml +="	  </tr>";
		strHtml +="	</table></td>";
		strHtml +="  </tr>";
		strHtml +="</table></body>";

	var win =window.open("","","resizable=yes,scrollbars=yes,width="+width+",height="+height);
	win.document.write(strHtml);
	win.focus();
}



function getFontSize() {
    var fontSize = parseInt(get_cookie("ck_fontsize")); // ÆùÆ®Å©±â Á¶Àý
    if (isNaN(fontSize)) { fontSize = 12; }
    return fontSize;
}

function scaleFont(val) {
    var fontSize = getFontSize();
    var fontSizeSave = fontSize;
    if (val > 0) {
        if (fontSize <= 18) {
            fontSize = fontSize + val; 
        }
    } else {
        if (fontSize > 12) {
            fontSize = fontSize + val; 
        }
    }
    if (fontSize != fontSizeSave) {
        drawFont(fontSize);
    }
    set_cookie("ck_fontsize", fontSize, 30, g4_cookie_domain); 
}

function drawFont(fontSize) {
    if (!fontSize) {
        fontSize = getFontSize();
    }

    var subject=document.getElementById("writeSubject"); 
    var content=document.getElementById("writeContents"); 
    var comment=document.getElementById("commentContents");
    var wr_subject=document.getElementById("wr_subject");
    var wr_content=document.getElementById("wr_content");

    if (comment) {
        var commentDiv = comment.getElementsByTagName("div");
        var lineHeight = fontSize+Math.round(1.1*fontSize); 
    }

    fontSize = fontSize + "px";

    if (subject)
        subject.style.fontSize=fontSize;
    if (content)
        content.style.fontSize=fontSize; 
    if (wr_subject)
        wr_subject.style.fontSize=fontSize; 
    if (wr_content)
        wr_content.style.fontSize=fontSize; 
    if (commentDiv) {
        for (i=0;i<commentDiv.length;i++) {
            commentDiv[i].style.fontSize=fontSize;
        }
    }
}
