function CheckSpaces(string) {
	var temp = "";
	string = '' + string;
	splitstring = string.split(" ");
		for(i = 0; i < splitstring.length; i++)
		temp += splitstring[i];
	return temp;
}

function ConvertEnter(input) {
	var output = "";
	for (var i = 0; i < input.length; i++) {
		if ((input.charCodeAt(i) == 13) && (input.charCodeAt(i + 1) == 10)) {
			i++;
			output += "";
		} else {
			output += input.charAt(i);
	   }
	}
	return output;
}

//--- ¼ýÀÚ/¿µ¹®°Ë»ç ---//
function IsCode(formname){
	var formstr=eval(formname);
	for(var i=0;i<formstr.value.length;i++){
		var chr=formstr.value.substr(i,1);
		if((chr<'0'||chr>'9')&&(chr<'a'||chr>'z')&&(chr<'A'||chr>'Z') && chr!='-' && chr!='_') return false;
	}
	return true;
}

//--- ¼ýÀÚ/ÄÚµå°Ë»ç ---//
function IsNumber(formname){
	var formstr=eval(formname);
	for(var i=0;i<formstr.value.length;i++){
		var chr=formstr.value.substr(i,1);
		if((chr<'0'||chr>'9') && chr!='-' && chr!='_') return false;
	}
	return true;
}

//---¼ýÀÚ°Ë»ç--//
function IsAmount(formname){
	var formstr=eval(formname);
	for(i=0;i<formstr.value.length;i++){
		var chr=formstr.value.substr(i,1);
		if((chr<'0'||chr>'9') && chr!='.') return false;
	}
	return true;   
}

//--- ÇÑ±Û °Ë»ç ---//
function IsKorean(formname) {
	var intErr
	var strValue=formname.value
	var retCode=0
	for(var i=0;i<strValue.length;i++){
		var retCode=strValue.charCodeAt(i)
		var retChar=strValue.substr(i,1).toUpperCase()
		retCode=parseInt(retCode)
		if((retChar<'0' || retChar>'9')&&(retChar<'A' || retChar>'Z')&&((retCode>255) || (retCode<0))) return false;
	}
	return true;
}

//--- ÀüÀÚ¿ìÆí°Ë»ç ---//
function IsEmail(formname){
	for(var l=0;l<=(formname.value.length-1);l++){
		if(formname.value.indexOf(' ')>=0){
			formname.select();
			return false;
		}
	}
	if((formname.value.indexOf('/'))!=-1 || (formname.value.indexOf(';'))!=-1){
		formname.select();
		return false;
	}
	if((formname.value.length!=0)&&(formname.value.search(/(\S+)@(\S+)\.(\S+)/)==-1)){
		formname.select();
		return false;
	}
	if(!IsKorean(formname)){
		formname.select();
		return false;
	}
	return true;
}

function usermode_view(opt1,opt2){
	if(opt2){
		if(opt2=='on') document.all[opt1].style.display="block";
		else document.all[opt1].style.display="none";
	}else{
		if(document.all[opt1].style.display!="none") document.all[opt1].style.display="none";
		else document.all[opt1].style.display="block";
	}
}

function textarea_resize(formname,size){
	if(size=='reset'){
		formname.rows=6;
	}else{
		var value=formname.rows+size;
		if(value>0) formname.rows=value
		else return;
	}
}
function MM_openBrWindow(theURL,winName,features){ //v2.0
  window.open(theURL,winName,features);
}
