function AbstFrm(theForm)
{
	theForm = document.abst_form;
    var msgEnt = 'Please enter your ';
    var msgSel = 'Please select ';
    var msgChk = 'Please check your ';

	if (!radioCheck(theForm.pretype)){
		alert(msgSel + "a your Profered Presentation Form.");
		theForm.pretype[0].focus();
		return false;
	}
	if (!theForm.topic.value){
		alert(msgSel + "a your Topic.");
		theForm.topic.focus();
		return false;
	}
	if (!theForm.abst_title.value){
		alert("Plesae enter Abstract Title.");
		theForm.abst_title.focus();
		return false;
	}
	if (!theForm.country.value){
		alert(msgSel + "a your Country.");
		theForm.country.focus();
		return false;
	}
	if(!theForm.email.value){
		alert(msgEnt + "E-mail Address.");
		theForm.email.focus();
		return false;
	}else{
		if (!isEmail(theForm.email.value)){
			alert(msgChk + "E-mail Address.");
			theForm.email.focus();
			return false;
		}
	}
    if (!theForm.pwd.value || theForm.pwd.value.length<4 || theForm.pwd.value.length>12) {
        alert(msgEnt + 'password.\nPassword may consist of a-Z, 0-9 and 4~12 characters.');
        theForm.pwd.focus();
		return false;
    }
    if (!isPwdChars(theForm.pwd.value)) {
        alert(msgChk + 'password.\nPassword may consist of a-Z, 0-9 and 4~12 characters.');
        theForm.pwd.focus();
		return false;
    }
    if (!theForm.cnfrmPwd.value) {
        alert(msgEnt + 'Confirm Password.');
		theForm.cnfrmPwd.focus();
		return false;
    }
    if (theForm.pwd.value!=theForm.cnfrmPwd.value) {
        alert(msgChk + 'Confirm Password.');
		theForm.cnfrmPwd.select();
		return false;
    }
	if (!radioCheck(theForm.title)){
		alert(msgSel + "a your Title.");
		theForm.title[0].focus();
		return false;
	}
    if (theForm.title[4].checked == true && !theForm.title_other.value) {
        alert(msgEnt + 'Title.');
		theForm.title_other.focus();
		return false;
    }
    if (!theForm.fname.value) {
        alert(msgEnt + 'First Name.');
		theForm.fname.focus();
		return false;
    }
    if (!isNameChars(theForm.fname.value)) {
        alert('Please enter only alphabet characters and numeric or dash(\'-\').');
        theForm.fname.select();
		return false;
    }
    if (!theForm.lname.value) {
        alert(msgEnt + 'Last Name.');
		theForm.lname.focus();
		return false;
    }
    if (!isNameChars(theForm.lname.value)) {
        alert('Please enter only alphabet characters and numeric or dash(\'-\').');
        theForm.lname.select();
		return false;
    }
    if (!theForm.department.value) {
        alert(msgEnt + 'Department.');
		theForm.department.focus();
		return false;
    }
    if (!theForm.organization.value) {
        alert(msgEnt + 'Organization.');
		theForm.organization.focus();
		return false;
    }
    if (theForm.post.value && !isCardNo(theForm.post.value)) {
        alert(msgChk + 'Postal Code.');
		theForm.post.select();
		return false;
    }
    if (!theForm.address.value) {
        alert(msgEnt + 'Address.');
		theForm.address.focus();
		return false;
    }
    if (!theForm.phone.value) {
        alert(msgEnt + 'Phone Number.');
		theForm.phone.focus();
		return false;
    }
    if (!isTelNumber(theForm.phone.value)) {
        alert(msgChk + 'Phone Number.');
		theForm.phone.select();
		return false;
    }
    if (theForm.fax.value && !isTelNumber(theForm.fax.value)) {
        alert(msgChk + 'Fax Number.');
		theForm.fax.select();
		return false;
    }

    if (!theForm.old_file.value)
    {
		if (!theForm.file.value) {
			alert('Please select a Upload File.');
			theForm.file.focus();
			return false;
		}else{
			var exeName = getFileNameC(theForm.file.value);
			var allowFileType = new Array();
			allowFileType[0] = 'doc';
			allowFileType[1] = 'docx';
			allowFileType[2] = 'rtf';

			var tmpIdx = 0;

			for (var i=0; i<allowFileType.length; i++) {
				if (allowFileType[i]==exeName) {
					tmpIdx++;
				}
			}

			if (tmpIdx==0) {
				alert('All abstracts should be submitted in Windows-based Microsoft Word(*.doc, *.docx) or Rich Text Format(*.rtf).');
				theForm.file.focus();
				return false;
			}
		}
	}

    theForm.action = 'AbstractStep2Conf.html';
    theForm.submit();
}

function goSave(theForm) {
	theForm = document.abst_form;
    theForm.action = 'AbstractSave.php';
    theForm.submit();
}


//----------------------- ÅØ½ºÆ® Byte±¸ÇÏ±â ----------------------------
function Text_len(str)
{
	var Body_value = str.value;
	// Ãß°¡ºÎºÐ---------------------------// <sub></sub><sup></sup> ÅÂ±×´Â ¹ÙÀÌÆ® ¼ö Ã¼Å©¿¡¼­ Á¦¿Ü
	Body_value = Body_value.replace(/<sup>/gi,"");
	Body_value = Body_value.replace(/<\/sup>/gi,"");
	Body_value = Body_value.replace(/<sub>/gi,"");
	Body_value = Body_value.replace(/<\/sub>/gi,"");
	// Ãß°¡ºÎºÐ---------------------------//
	var Body_len = Body_value.length;
	var bytesLen = 0;

	for (var i = 0; i < Body_len; i++) 
	{
		var oneChar = Body_value.charAt(i);
		if (escape(oneChar).length > 4) 
		{
			bytesLen += 2;
		} 
		else if (oneChar!='\r') 
		{
			bytesLen++;
		}
	}
	return bytesLen;
}

//----------------------- Byte check ----------------------------
function Byte_check(str,str_limit) 
{
	theForm = document.abst_form;
	switch(str)
	{
		case "0" :
			var bodyForm = theForm.title;
			var bodyLimit = theForm.title_limit;
			break;
		case "1" :
			var bodyForm = theForm.abstract;
			var bodyLimit = theForm.abstract_limit;
			break;
		case "2" :
			var bodyForm = theForm.opinion;
			var bodyLimit = theForm.opinion_limit;
			break;
		case "3" :
			var bodyForm = theForm.keyword;
			var bodyLimit = theForm.keyword_limit;
			break;
	}
	var bodyVal = bodyForm.value;
	// Ãß°¡ºÎºÐ---------------------------// <sub></sub><sup></sup> ÅÂ±×´Â ¹ÙÀÌÆ® ¼ö Ã¼Å©¿¡¼­ Á¦¿Ü
	bodyVal = bodyVal.replace(/<sup>/gi,"");
	bodyVal = bodyVal.replace(/<\/sup>/gi,"");
	bodyVal = bodyVal.replace(/<sub>/gi,"");
	bodyVal = bodyVal.replace(/<\/sub>/gi,"");
	// Ãß°¡ºÎºÐ---------------------------//
	var bodyLen = bodyVal.length;
	var bytesLen = 0;
	var validBodyLen = 0;
	var validBytesLen = 0;

	for (var i = 0; i < bodyLen; i++) 
	{
		var oneChar = bodyVal.charAt(i);
		if (escape(oneChar).length > 4) 
		{
			bytesLen += 2;
		} 
		else if (oneChar!='\r') 
		{
			bytesLen++;
		}
		if(bytesLen <= str_limit)	
		{
			validBodyLen = i + 1;
			validBytesLen = bytesLen;
		}
	}
	if(bytesLen > str_limit) 
	{
		alert(str_limit+"byte ÀÌ»óÀÇ ±ÛÀ» ¾²½Ç ¼ö ¾ø½À´Ï´Ù.");
		var realBodyVal = bodyVal.substr(0, validBodyLen);
		bodyForm.value = realBodyVal;
		var bytesVal = validBytesLen;
	} 
	else 
	{
		bytesVal = bytesLen;
	}
	
	bodyLimit.value = bytesVal;
	bodyForm.focus();
}

//----------------------- Abstract Byte check ----------------------------
function BodyLenCheck(str,str_limit) 
{
	theForm = document.abst_form;
	var bytesLen = 0;
	var validBodyLen = 0;
	var validBytesLen = 0;
	switch(str)
	{
		case "1" :
		var bodyForm = theForm.purpose;
		var val_Form = theForm.method.value+theForm.result.value+theForm.conclusion.value;
		var Total_len = theForm.method.value.length+theForm.result.value.length+theForm.conclusion.value.length;
		var bytesLen = Text_len(theForm.method)+Text_len(theForm.result)+Text_len(theForm.conclusion);
		break;

		case "2" :
		var bodyForm = theForm.method;
		var val_Form = theForm.purpose.value+theForm.result.value+theForm.conclusion.value;
		var Total_len = theForm.purpose.value.length+theForm.result.value.length+theForm.conclusion.value.length;
		var bytesLen = Text_len(theForm.purpose)+Text_len(theForm.result)+Text_len(theForm.conclusion);
		break;

		case "3" :
		var bodyForm = theForm.result;
		var val_Form = theForm.purpose.value+theForm.method.value+theForm.conclusion.value;
		var Total_len = theForm.purpose.value.length+theForm.method.value.length+theForm.conclusion.value.length;
		var bytesLen = Text_len(theForm.purpose)+Text_len(theForm.method)+Text_len(theForm.conclusion);
		break;

		case "4" :
		var bodyForm = theForm.conclusion;
		var val_Form = theForm.purpose.value+theForm.method.value+theForm.result.value;
		var Total_len = theForm.purpose.value.length+theForm.method.value.length+theForm.result.value.length;
		var bytesLen = Text_len(theForm.purpose)+Text_len(theForm.method)+Text_len(theForm.result);
		break;
	}

	var Total_byte = Text_len(theForm.purpose)+Text_len(theForm.method)+Text_len(theForm.result)+Text_len(theForm.conclusion);
	var bodyLimit = theForm.abstract_limit;

	var bodyVal = val_Form+bodyForm.value;
	var bodyLen = bodyForm.value.length;
	var bodyLen = Total_len+bodyLen;

	for (var i = Total_len; i < bodyLen; i++) 
	{
		var oneChar = bodyVal.charAt(i);
		if (escape(oneChar).length > 4){
			bytesLen += 2;
		}else if (oneChar!='\r'){
			bytesLen++;
		}
		if(bytesLen <= str_limit){
			validBodyLen = i + 1;
			validBytesLen = bytesLen;
		}
	}

	if(bytesLen > str_limit){
		var bodyVal = bodyForm.value;
		var validBodyLen = validBodyLen - Total_len;
		if(validBytesLen == '0') validBytesLen = bodyLimit.value;
		alert(str_limit+"byte ÀÌ»óÀÇ ±ÛÀ» ¾²½Ç ¼ö ¾ø½À´Ï´Ù.");
		var realBodyVal = bodyVal.substr(0, validBodyLen);
		bodyForm.value = realBodyVal;
		var bytesVal = validBytesLen;
	}else{
		bytesVal = bytesLen;
	}
	
	bodyLimit.value = bytesVal;
	bodyForm.focus();
}



//------------------------¿ìÆí¹øÈ£ÀÔ·Â----------------------------
function put_post1(p_zip1,p_zip2,p_juso)
{
	theForm = document.green_form;
	theForm.s_zip1.value = p_zip1 ;
	theForm.s_zip2.value = p_zip2 ;
	theForm.s_addr.focus();
	theForm.s_addr.value = p_juso ;
	return;
}

//-------------------------½É»ç----------------------------------
function JudgeFrm(theForm,msg)
{
	if(!theForm.point.value){
		alert("½É»ç Á¡¼ö¸¦ ÀÔ·ÂÇÏ½Ê½Ã¿À.");
		theForm.point.focus();
		return false;
	}
	if(!Check_Num(theForm.point)){
		return false;
	}
	if(theForm.point.value == 0){
		alert("½É»çÀÇ ÃÖÀú Á¡¼ö´Â 1Á¡ ÀÔ´Ï´Ù.");
		theForm.point.focus();
		return false;
	}
	if(theForm.point.value > 20){
		alert("½É»çÀÇ ÃÖ°í Á¡¼ö´Â 20Á¡ ÀÔ´Ï´Ù.");
		theForm.point.focus();
		return false;
	}
	if (confirm("Á¡¼ö¸¦ " + msg + "ÇÏ½Ã°Ú½À´Ï±î?")){
		return true;
	}else{
		return false;
	}
}

function Slide_Send(theForm)
{
	theForm = document.abst_form;
	if(!theForm.slide_file.value){
		alert("Ã·ºÎÆÄÀÏÀ» ¼±ÅÃÇØ¾ß ÇÕ´Ï´Ù.");
		theForm.slide_file.focus();
		return false;
	}else{
		d_f = formatChk(theForm.slide_file);
		if(!(d_f == "ppt")){
			alert("Áö¿øµÇÁö ¾Ê´Â Æ÷¸ËÀÔ´Ï´Ù.\n\n±ÇÀåµÇ´Â ÆÄÀÏ Æ÷¸ËÀº ppt ÀÔ´Ï´Ù.");
			theForm.slide_file.focus();
			return false;
		}
	}
	theForm.target = "";
	document.all.submitFrm.style.display='none';
	document.all.sendingFrm.style.display='';
	theForm.action = "slide.php";
	theForm.submit();
}
