//When register the virus info.
function chk600(obj){
	obj = eval(obj);

	if(!obj.attack_type[0].checked && !obj.attack_type[1].checked){ //Check the attack_type
		alert("°ø°ÝÀ¯ÇüÀ» ¼±ÅÃÇØ ÁÖ¼¼¿ä!");
		obj.attack_type[0].focus();
		return false;
	}
	
	if (obj.attack_type[0].checked){	//when Application Attack
			if(removeSpace(obj.sid.value) == ""){ //Check the sid
				alert("SID¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä!");
				obj.sid.focus();
				return false;
			}

			if(removeSpace(obj.v_name.value) == ""){ //Check the v_name
				alert("¹ÙÀÌ·¯½º ÀÌ¸§À» ÀÔ·ÂÇØ ÁÖ¼¼¿ä!");
				obj.v_name.focus();
				return false;
			}

			if(!chkRadio(obj.ruin_grade)){ //Check the ruin_grade
				alert("ÆÄ±«µî±ÞÀ» ¼±ÅÃÇØ ÁÖ¼¼¿ä!");
				obj.ruin_grade[0].focus();
				return false;
			}

			if(!chkRadio(obj.diffuse_grade)){ //Check the diffuse_grade
				alert("È®»êµî±ÞÀ» ¼±ÅÃÇØ ÁÖ¼¼¿ä!");
				obj.diffuse_grade[0].focus();
				return false;
			}
	}else{
			if(removeSpace(obj.v_name.value) == ""){ //Check the v_name
				alert("¹ÙÀÌ·¯½º ÀÌ¸§À» ÀÔ·ÂÇØ ÁÖ¼¼¿ä!");
				obj.v_name.focus();
				return false;
			}
	}

/*
	if(removeSpace(obj.main_symptom_ko.value) == ""){ //Check the content
		alert("ÁÖ¿äÁõ»ó(ÇÑ±Û)À» ÀÔ·ÂÇØ ÁÖ¼¼¿ä!");
		obj.main_symptom_ko.focus();
		return false;
	}

	if(removeSpace(obj.main_symptom.value) == ""){ //Check the content
		alert("ÁÖ¿äÁõ»ó(¿µ¹®)À» ÀÔ·ÂÇØ ÁÖ¼¼¿ä!");
		obj.main_symptom.focus();
		return false;
	}
*/

/*
	if(removeSpace(obj.content.value) == ""){ //Check the content
		alert("ÆÐÅÏ°³¿ä ¹× Áõ»óÀ» ÀÔ·ÂÇØ ÁÖ¼¼¿ä!");
		obj.content.focus();
		return false;
	}
*/
}

//When select the other language
function chgLanguage(){		
	var obj = eval("document.lang")

	if(obj.select.value == "ko"){
		document.location.href = "/kor/html/";
	}else{
		document.location.href = "/eng/html/";
	}
}

//Search on the virus page
function chkSearch(){
	var obj1 = eval("document.formSearch");
	var obj2 = eval("document.listInfo");

	obj2.page.value = 0;
	obj2.searchStr.value = obj1.searchStr.value;

	obj2.submit();
}

//View content
function viewContent(arg,page){
	var obj2 = eval("document.listInfo");

	obj2.action = page;
	obj2.idx.value = arg;

	obj2.submit();
}

//View content - when click the news from main page
function viewContent550(arg,page,flg){
	var obj2 = eval("document.listInfo");

	obj2.action = page;
	obj2.idx.value = arg;
	obj2.cat_flg.value = flg;

	obj2.submit();
}

//View content - when click the Attack top 10 / Pattern update info from main page
function viewContent600(arg,page,rtnPage){
	var obj2 = eval("document.listInfo");

	obj2.action = page;
	obj2.idx.value = arg;
	obj2.rtnPage.value = rtnPage;

	obj2.submit();
}

//View content
function viewContentConfirm(arg,page,msg){
	if(confirm(msg)){
		var obj2 = eval("document.listInfo");

		obj2.action = page;
		obj2.idx.value = arg;

		obj2.submit();
	}
}

//View content - when click the title at quick link
function viewContentQuick(arg,page,flg){
	var obj2 = eval("document.listInfo");

	document.location.href = page + "?idx=" + arg + "&cat_flg=" + flg;
}

//Paging Anchor
function gotoResultList(strFile,intPage){		
	var obj = eval("document.listInfo")
	obj.page.value = intPage;
	obj.action = strFile;
	obj.submit();
}

//when click the delete at attack top 10
function delSelectedAttackTop10(obj){	

	if(confirm("¼±ÅÃÇÑ Ç×¸ñÀ» »èÁ¦ ÇÏ½Ã°Ú½À´Ï±î?")){
		var rtnStr = "";	

		for ( i=0; i < obj.chk.length; i++ )
		{			
			if(obj.chk[i].checked)
			{
				if(obj.chk[i].value != ''){ //is not the temporary object
					rtnStr = rtnStr + obj.chk[i].value + ";$;$;";		
				}
			}
		}

		if(rtnStr == ""){
			alert("»èÁ¦ÇÒ Ç×¸ñÀ» ¼±ÅÃÇÏ¿© ÁÖ¼¼¿ä!");
			return;
		}

		obj.rtnStr.value = rtnStr;
		
		obj.action = "security_c_02_del.asp";
		obj.submit();
	}else{
		return;
	}	
}

//when click the button change sequence at attack top 10
function changeAttackTop10Seq(obj,num){	
	if(!chkRadio(obj.rdo)){
		alert("Ç×¸ñÀ» ¼±ÅÃÇÏ¿© ÁÖ¼¼¿ä!");
		return;
	}

	if(num == 1 && obj.rdo[0].checked){	//upper & selected top
		alert("¼±ÅÃÇÏ½Å Ç×¸ñÀº ÃÖ»óÀ§ À§Ä¡¿¡ ÀÖ½À´Ï´Ù!");
		return;
	}

	if(num == 0 && obj.rdo[obj.rdo.length-2].checked){	//lower & selected bottom
		alert("¼±ÅÃÇÏ½Å Ç×¸ñÀº ÃÖÇÏÀ§ À§Ä¡¿¡ ÀÖ½À´Ï´Ù!");
		return;
	}

	for ( i=0; i < obj.rdo.length; i++ )
	{			
		if(obj.rdo[i].checked)
		{
			if(obj.rdo[i].value != ''){ //is not the temporary object
				rtnStr1 = obj.rdo[i].value;
				break;
			}
		}
	}

	obj.rtnStr.value = num;
	obj.rtnStr1.value = rtnStr1;
	
	obj.action = "security_c_02_seq.asp";
	obj.submit();

}

//when click the selection at attack top 10
function selAttackTop10(obj){	

	if(confirm("¼±ÅÃÇÑ Ç×¸ñÀ» Ãß°¡ ÇÏ½Ã°Ú½À´Ï±î?")){
		var rtnStr = "";	

		for ( i=0; i < obj.chk.length; i++ )
		{			
			if(obj.chk[i].checked)
			{
				if(obj.chk[i].value != ''){ //is not the temporary object
					rtnStr = rtnStr + obj.chk[i].value + ";$;$;";		
				}
			}
		}

		if(rtnStr == ""){
			alert("Ãß°¡ÇÒ Ç×¸ñÀ» ¼±ÅÃÇÏ¿© ÁÖ¼¼¿ä!");
			return;
		}

		obj.rtnStr.value = rtnStr;
		
		obj.action = "security_c_02_sel.asp";
		obj.submit();
	}else{
		return;
	}	
}

//When register the virus pattern info.
function chk630(obj){
	obj = eval(obj);

	if(removeSpace(obj.patch_info.value) == ""){ //Check the patch_info
		alert("Update ³»¿ªÀ» ÀÔ·ÂÇØ ÁÖ¼¼¿ä!");
		obj.patch_info.focus();
		return false;
	}
}

//when click the delete at pattern update info
function delPatternUpdateInfo(obj){	

	if(confirm("¼±ÅÃÇÑ Ç×¸ñÀ» »èÁ¦ ÇÏ½Ã°Ú½À´Ï±î?")){
		var rtnStr = "";	

		for ( i=0; i < obj.chk.length; i++ )
		{			
			if(obj.chk[i].checked)
			{
				if(obj.chk[i].value != ''){ //is not the temporary object
					rtnStr = rtnStr + obj.chk[i].value + ";$;$;";		
				}
			}
		}

		if(rtnStr == ""){
			alert("»èÁ¦ÇÒ Ç×¸ñÀ» ¼±ÅÃÇÏ¿© ÁÖ¼¼¿ä!");
			return;
		}

		obj.rtnStr.value = rtnStr;
		
		obj.action = "security_c_03_del.asp";
		obj.submit();
	}else{
		return;
	}	
}

//when click the selection at pattern update info
function selPatternUpdateInfo(obj){	

	if(confirm("¼±ÅÃÇÑ Ç×¸ñÀ» Ãß°¡ ÇÏ½Ã°Ú½À´Ï±î?")){
		var rtnStr = "";	

		for ( i=0; i < obj.chk.length; i++ )
		{			
			if(obj.chk[i].checked)
			{
				if(obj.chk[i].value != ''){ //is not the temporary object
					rtnStr = rtnStr + obj.chk[i].value + ";$;$;";		
				}
			}
		}

		if(rtnStr == ""){
			alert("Ãß°¡ÇÒ Ç×¸ñÀ» ¼±ÅÃÇÏ¿© ÁÖ¼¼¿ä!");
			return;
		}

		obj.rtnStr.value = rtnStr;
		//obj.pidx.value = idx;
		
		obj.action = "security_c_03_sel.asp";
		obj.submit();
	}else{
		return;
	}	
}

//When register the virus info.
function chk510(obj){
	obj = eval(obj);

	if(removeSpace(obj.title.value) == ""){ //Check the title
		alert("Á¦¸ñÀ» ÀÔ·ÂÇØ ÁÖ¼¼¿ä!");
		obj.title.focus();
		return false;
	}

	if(removeSpace(obj.content.value) == ""){ //Check the content
		alert("³»¿ëÀ» ÀÔ·ÂÇØ ÁÖ¼¼¿ä!");
		obj.content.focus();
		return false;
	}

	if(removeSpace(obj.files.value) == ""){ //Check the files
		alert("Ã·ºÎÆÄÀÏÀ» ¼±ÅÃÇØ ÁÖ¼¼¿ä!");
		obj.files.focus();
		return false;
	}
}

//When register the virus info.
function chk511(obj){
	obj = eval(obj);

	if(removeSpace(obj.title.value) == ""){ //Check the title
		alert("Á¦¸ñÀ» ÀÔ·ÂÇØ ÁÖ¼¼¿ä!");
		obj.title.focus();
		return false;
	}

	if(removeSpace(obj.content.value) == ""){ //Check the content
		alert("³»¿ëÀ» ÀÔ·ÂÇØ ÁÖ¼¼¿ä!");
		obj.content.focus();
		return false;
	}
}

//download when click the download button
function downLoad(num){		
	var obj = eval("document.frmdownload" + num)	
	obj.target = "frameDownload";
	obj.action = "download.asp";
	obj.submit();
}

//validate the email
//arg : document.form.objname
function validateEmail(arg){
	var email = arg;
	if (!email.value){
		alert('ÀÌ¸ÞÀÏÀ» ÀÔ·ÂÇÏ¼¼¿ä!');
		email.focus();
		return false;
	}else if (!checkValue('0123456789abcdefghijklmnopqrstuvwxyzABCEDFGHIJKLMNOPQRSTUVWXYZ.@_-', email.value)){
		alert('ÀÌ¸ÞÀÏÀ» Á¤È®ÇÏ°Ô ÀÔ·ÂÇÏ¼¼¿ä!')
		email.focus();
		return false;
	}else if (email.value.length < 5 || email.value.search('@') == -1 || email.value.indexOf(".") < 3){
		alert('ÀÌ¸ÞÀÏÀ» Á¤È®ÇÏ°Ô ÀÔ·ÂÇÏ¼¼¿ä!');
		email.focus();
		return false;
	}	
	return true;
}

//When register the inquiry.
function chk520(obj){
	obj = eval(obj);

	if(!chkRadio(obj.cat_flg)){ //Check the cat_flg
		alert("Please select the Inquiry Type!");
		obj.cat_flg[0].focus();
		return false;
	}

	if(removeSpace(obj.title.value) == ""){ //Check the title
		alert("Please input the title!");
		obj.title.focus();
		return false;
	}

	if(removeSpace(obj.writer.value) == ""){ //Check the writer
		alert("Please input your name!");
		obj.writer.focus();
		return false;
	}

	if(removeSpace(obj.phone.value) == ""){ //Check the phone
		alert("Please input your contact No.!");
		obj.phone.focus();
		return false;
	}

	if(removeSpace(obj.email.value) == ""){ //Check the email
		alert("Please input your e-mail address!");
		obj.email.focus();
		return false;
	}

	if(!validateEmail(removeSpace(obj.email))){	//Check the email
		return false;
	}

	if(removeSpace(obj.company.value) == ""){ //Check the company
		alert("Please input your company name!");
		obj.company.focus();
		return false;
	}

	if(removeSpace(obj.content.value) == ""){ //Check the content
		alert("Please input the content!");
		obj.content.focus();
		return false;
	}

}

//When deliver the Product Info.
function chk530(obj){
	obj = eval(obj);

	if(removeSpace(obj.title.value) == ""){ //Check the title
		alert("Please input the title!");
		obj.title.focus();
		return false;
	}

	if(removeSpace(obj.r_name.value) == ""){ //Check the r_name
		alert("Please input a receiving person name!");
		obj.r_name.focus();
		return false;
	}

	if(removeSpace(obj.r_email.value) == ""){ //Check the r_email
		alert("Please input a receiving person mail address!");
		obj.r_email.focus();
		return false;
	}

	if(!validateEmail(removeSpace(obj.r_email))){	//Check the r_email
		return false;
	}

	if(removeSpace(obj.s_name.value) == ""){ //Check the s_name
		alert("Please input a sender name!");
		obj.s_name.focus();
		return false;
	}

	if(removeSpace(obj.s_email.value) == ""){ //Check the s_email
		alert("Please input a sender mail address!");
		obj.s_email.focus();
		return false;
	}

	if(!validateEmail(removeSpace(obj.s_email))){	//Check the r_email
		return false;
	}

	if(removeSpace(obj.content.value) == ""){ //Check the content
		alert("Please input the content!");
		obj.content.focus();
		return false;
	}

}

//When register the NEWS.
function chk550(obj){
	var attach, dot, ext;
	obj = eval(obj);

	if(removeSpace(obj.title.value) == ""){ //Check the title
		alert("Á¦¸ñÀ» ÀÔ·ÂÇØ ÁÖ¼¼¿ä!");
		obj.title.focus();
		return false;
	}

	if(removeSpace(obj.content.value) == ""){ //Check the content
		alert("³»¿ëÀ» ÀÔ·ÂÇØ ÁÖ¼¼¿ä!");
		obj.content.focus();
		return false;
	}

	attach = obj.files(0).value;
	if(removeSpace(attach) != ""){
		dot = attach.lastIndexOf(".");
		ext = attach.substring(dot).toLowerCase() ;
		if((ext != ".jpg") && (ext != ".gif") && (ext != ".bmp") && (ext != ".png")){
			alert("1¹øÂ°ÀÌ¹ÌÁö : jpg,gif,bmp,png Çü½Ä¸¸ Ã·ºÎ °¡´ÉÇÕ´Ï´Ù."); 
			return false;
		}
	}

	attach = obj.files(1).value;
	if(removeSpace(attach) != ""){
		dot = attach.lastIndexOf(".");
		ext = attach.substring(dot).toLowerCase() ;
		if((ext != ".jpg") && (ext != ".gif") && (ext != ".bmp") && (ext != ".png")){
			alert("2¹øÂ°ÀÌ¹ÌÁö : jpg,gif,bmp,png Çü½Ä¸¸ Ã·ºÎ °¡´ÉÇÕ´Ï´Ù."); 
			return false;
		}
	}

	attach = obj.files(2).value;
	if(removeSpace(attach) != ""){
		dot = attach.lastIndexOf(".");
		ext = attach.substring(dot).toLowerCase() ;
		if((ext != ".jpg") && (ext != ".gif") && (ext != ".bmp") && (ext != ".png")){
			alert("3¹øÂ°ÀÌ¹ÌÁö : jpg,gif,bmp,png Çü½Ä¸¸ Ã·ºÎ °¡´ÉÇÕ´Ï´Ù."); 
			return false;
		}
	}
}

 //image pop up
function openImgReal(img){
	window.open('../templates/image_realsize.asp?img='+img ,'rimage','resizable=yes,scrollbars=yes,width=320,height=340');  	
}

