	function goPicList() {
		document.frmForm.func_name.value = "imgList";
		document.frmForm.event_id.value="5087";
		document.frmForm.curr_page.value = "1";
		document.frmForm.page_rows.value = "10";
		document.frmForm.rows_page.value = "8";
		document.frmForm.jsp_name.value = "HD/event/enu_20090408/pic_boardList";	
		document.frmForm.action = "/ingevent.kto";
		document.frmForm.submit();
	}

	// 사진등록이벤트
	function fc_login_check(loginCheck, eventid){
		if(loginCheck == "loginfalse") {
			// 이벤트에 참여하기 위해서는 로그인을 하셔야 합니다.
			if(confirm("You must first log in to participate in this event.")) {
				document.LoginForm.method.value = "loginForm";	
				document.LoginForm.next_url.value="/ingevent.kto?func_name=write||jsp_name=HD/event/enu_20090408/pic_boardWrite||event_id=5078||md=enu||lang_se=ENG";
				document.LoginForm.action = "/login.kto?method=eLogin&md=enu";
				document.LoginForm.target = "_parent";
				document.LoginForm.submit();
			}
		}else{
			document.frmForm.func_name.value = "write";		
			document.frmForm.jsp_name.value = "HD/event/enu_20090408/pic_boardWrite";		
			document.frmForm.event_id.value="5078";
			document.frmForm.action = "ingevent.kto";
			document.frmForm.target = "_parent";
			document.frmForm.submit();
		}
	}

	function goPicSave() {
		if(document.frmForm.subject.value == ""){
			alert("Please enter the Title");
			return;
		}

		if(document.frmForm.file1.value == ""){
			alert("Please attach photograph.");
			return;
		}

		if(document.frmForm.cn.value == ""){
			alert("Please enter the Contents");
			return;
		}

		if (document.frmForm.file1.value) {
            if (!checkImageFile(document.frmForm.file1.value)) {
                alert("'Image column JPG, GIF, JPEG only upload!");
                return;
            }

            if (!getFileSize(document.frmForm.file1.value)) {
                alert("'Image file capacity is exceeded");
                return;
            }
        } 

		document.frmForm.action = "/ingevent.kto";
		document.frmForm.jsp_name.value = "HD/event/enu_20090408/pic_boardList";
		document.frmForm.event_id.value="5087";
		document.frmForm.page_rows.value = "10";
		document.frmForm.rows_page.value = "8";
		document.frmForm.curr_page.value = "1";
		document.frmForm.lang_se.value = "ENG";
		document.frmForm.fileSe.value = "img";
		document.frmForm.jsp_page.value = "imgList";
		document.frmForm.thumbWidth.value = "173";
		document.frmForm.thumbHeight.value = "114";
		document.frmForm.thumb_yn.value = "Y";
		document.frmForm.func_name.value = "writeProcess";
		document.frmForm.submit();
	}

	function goPicModify(){
		if(validate(document.frmForm)== false){
			return;
		}
		document.frmForm.action = "/ingevent.kto";
		document.frmForm.jsp_name.value = "HD/event/enu_20090408/pic_boardModify";
		document.frmForm.lang_se.value = "ENG";
		document.frmForm.fileSe.value = "img";
		document.frmForm.func_name.value = "modify";
		document.frmForm.submit();		
	}

	function goPicUpdate(){
		if(document.frmForm.subject.value == ""){
			alert("Please enter the Title");
			return;
		}

		if(document.frmForm.deleteYN_1.checked && document.frmForm.file1.value == ""){
			alert("Please attach photograph.");
			return;
		}

		if(document.frmForm.cn.value == ""){
			alert("Please enter the Contents");
			return;
		}

		if (document.frmForm.file1.value) {
            if (!checkImageFile(document.frmForm.file1.value)) {
                alert("'Image column JPG, GIF, JPEG only upload!");
                return;
            }

            if (!getFileSize(document.frmForm.file1.value)) {
                alert("'Image file capacity is exceeded");
                return;
            }
        } 
		
		document.frmForm.action = "/ingevent.kto";
		document.frmForm.jsp_name.value = "HD/event/enu_20090408/pic_boardList";
		document.frmForm.event_id.value="5087";
		document.frmForm.lang_se.value = "ENG";
		document.frmForm.fileSe.value = "img";
		document.frmForm.jsp_page.value = "imgList";
		document.frmForm.thumbWidth.value = "173";
		document.frmForm.thumbHeight.value = "114";
		document.frmForm.thumb_yn.value = "Y";
		document.frmForm.func_name.value = "modifyProcess";
		document.frmForm.submit();		
	}
	
	function goPicView(seqno) {
		document.frmForm.func_name.value = "view";
		document.frmForm.event_id.value="5087";
		document.frmForm.event_sn.value = seqno;
		document.frmForm.jsp_name.value = "HD/event/enu_20090408/pic_boardView";	
		document.frmForm.action = "/ingevent.kto";
		document.frmForm.submit();		
	}

	function goPicPage(curr_page) {
		document.frmForm.func_name.value = "imgList";
		document.frmForm.event_id.value="5087";
		document.frmForm.jsp_name.value = "HD/event/enu_20090408/pic_boardList";	
		document.frmForm.curr_page.value = curr_page;
		document.frmForm.action = "/ingevent.kto";
		document.frmForm.submit();
	}	

	function goPicDelete() {
		if(confirm("Are you sure you want to delete?")){
			document.frmForm.func_name.value = "delete";
			document.frmForm.event_id.value="5087";
			document.frmForm.jsp_name.value = "HD/event/enu_20090408/pic_boardList";	
			document.frmForm.jsp_page.value = "imgList";
			document.frmForm.thumb_yn.value = "N";
			document.frmForm.action = "/ingevent.kto";
			document.frmForm.submit();
		}
	}	

	function checkImageFile(str) {
        var arr = ("file:///"+str.replace(/ /gi,"%20").replace(/\\/gi,"/")).split("/");
        var fname = arr[arr.length-1];
        var e = fname.length;
        var m=fname.lastIndexOf(".");
        var filename=fname.substring(0,m); //파일명
        var extname=fname.substring(m+1,e); //확장자명
            
        if(extname.toUpperCase()=="JPG" || extname.toUpperCase()=="GIF" || extname.toUpperCase()=="JPEG") {
            return true;
        } else {
            return false;
        }
    } 

    function getFileSize(filePath) {
    	
    		var len = 0;
        var maxSize = 0;
/*        if (idx == "1" || idx == "2") {
            maxSize = 1000000;
        } else if (idx == "3") {
            maxSize = 3000000;
        }
*/
		maxSize = 1024*1024*2;

       if ( navigator.appName.indexOf("Netscape") != -1) {
            try {
                netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
            } catch(e) {
//                alert("'Signed.applets.codebase_principal_support'  S’il vous plaît laissez-moi série!\n"+e);
                return -1;
            }
            try {
                var file = Components.classes["@mozilla.org/file/local;1"]
                                     .createInstance(Components.interfaces.nsILocalFile);
                file.initWithPath ( filePath );
                
                len = file.fileSize;
            } catch(e) {
                alert("Error!!:"+e);
            }
        } else if (navigator.appName.indexOf('Microsoft') != -1) {
		     	//ie 7이 아닌 경우에는 스크립트에서 파일 사이즈 체크
		     	//ie 7일 경우에는 서버에서 사이즈 체크
					if(navigator.appVersion.indexOf("MSIE 7") < 0){  
						var img = new Image();
						img.dynsrc = filePath;
						len = img.fileSize;
					}
        }

        if (len > maxSize) {
            return false;
        } else {
            return true;
        }
    }
