﻿<!--
var StartWin = null;
var Check = 0;

function sInputCheck(theForm) {
var bRet = true;
	if (theForm.sSearchWord.value.length < 3) {
		alert("3글자 이상 입력하세요");
		theForm.sSearchWord.focus();
		return (false);
   }
	if (isKorean(theForm.sSearchWord.value)) {
		alert("영문으로만 입력가능합니다.");
		theForm.sSearchWord.focus();
		return (false);
   }
   
	
	theForm.action = "http://www.icpart.com/sell_search.jsp?sSearchWord=" + theForm.sSearchWord.value.toUpperCase() ;
    return(true);
}

function isAlphabet(ch) {
           var numUnicode = ch.charCodeAt(0);                                                                                    
           if ( 65 <= numUnicode && numUnicode <= 90 ) return true;            // 대문자
           if ( 97 <= numUnicode && numUnicode <= 122 ) return true;            // 소문자
           return false;
}

function isKorean(ch) {
           var numUnicode = ch.charCodeAt(0);                                                                                    
           if (  numUnicode >= 12593 ) return true;            
           return false;
}
function isNumber(ch) {
           var numUnicode = ch.charCodeAt(0);                                                                                    
           if ( 48 <= numUnicode && numUnicode <= 57 ) return true;            
           return false;
}
/*
function isAlphabet(ch) {
           var numUnicode = ch.charCodeAt(0);                                                                                    
           if ( 65 <= numUnicode && numUnicode <= 90 ) return true;            // 대문자
           if ( 97 <= numUnicode && numUnicode <= 122 ) return true;            // 소문자
           return false;
}

function isKorean(ch) {
           var numUnicode = ch.charCodeAt(0);                                                                                    
           if ( 44032 <= numUnicode && numUnicode <= 55203 ) return true;           
           return false;
}
function isNumber(ch) {
           var numUnicode = ch.charCodeAt(0);                                                                                    
           if ( 48 <= numUnicode && numUnicode <= 57 ) return true;            
           return false;
}
*/

function bInputCheck(theForm) {

	if (theForm.sSearchWord.value.length < 3) {
		alert("3글자 이상 입력하세요");
		theForm.sSearchWord.focus();
		return (false);
	}
		if (isKorean(theForm.sSearchWord.value)) {
		alert("영문으로만 입력가능합니다.");
		theForm.sSearchWord.focus();
		return (false);
   }
	theForm.action = "http://www.icpart.com/buy_search.jsp?sSearchWord=" + theForm.sSearchWord.value.toUpperCase()  ; 
return(true);
}


function InputCheck(theForm) {

	if(theForm.amount.value.length == 0){
		alert("수량을 입력해주세요.");
		theForm.amount.focus();
		return false;
	}
	if(theForm.price.value.length == 0){
		alert("단가를 입력해주세요.");
		theForm.price.focus();
		return false;
	}
	if (theForm.id.value.length < 2) {
		alert("이름을 2글자 이상 입력해 주세요");
		theForm.id.focus();
		return (false);
	}

	if (theForm.email.value.length == 0) {
		alert("E-mail을 입력해주세요");
		theForm.email.focus();
		return(false);
	}
	if (!EmailCheck(theForm.email.value)) {
		alert("E-mail 에러입니다.다시확인해 주세요");
		theForm.email.focus();
		return(false);
	}
	if (theForm.tel.value.length == 0) {
		alert("전화번호를 입력해 주세요");
		theForm.tel.focus();
		return(false);
	}

	if (theForm.company.value.length == 0) {
		alert("회사이름을 입력해 주세요");
		theForm.company.focus();
		return(false);
	}
 
 

}



function EmailCheck(checkStr) {
	Flag1 = 0;
	Flag2 = 0;
	for (i =0;i < checkStr.length; i++) {
		ch = checkStr.charAt(i);
		if ( ch == '@' )
			{ Flag1 = 1; }
		if ( ch == '.' )
		 	{ Flag2 = 1; }
	}
	if ( (Flag1 != 1) || (Flag2 != 1) ) {
		return(false);
	}
	else return(true);

}

function StringCheck(checkStr) {
	Flags1 = 0;
	for (i =0;i < checkStr.length; i++) {
		ch = checkStr.charAt(i);
		if ( ("0" <= ch) && (ch <= "9") || ("A" <= ch) && (ch <= "Z") || ("a" <= ch) && (ch <="z") )

		{  }

		else { Flags1 = Flags1 + 1 }

	}
	if ( Flags1 == 0 )
	{
		return(false);
	}
	else return(true);

}


//-->
