function check_form(form_object){
	if(form_object){
		for(var i=0;i<form_object.elements.length;i++){
			var form_item = form_object.elements[i];
			var form_value = form_item.value;
			var form_length = form_value.length;
			var form_disabled = form_item.disabled;
			
			// number --------------------------------------------------------------------
			var form_command = form_item.attributes.getNamedItem("number");
			if(form_command&&!form_disabled){
				if(isNaN(form_value)||form_length==0){
					if(form_command.value.length>0){alert(form_command.value);}
					form_item.value = "";
					form_item.focus();
					return false;
				}
			}
			// number --------------------------------------------------------------------
			
			// email ---------------------------------------------------------------------
			var form_command = form_item.attributes.getNamedItem("email");
			if(form_command&&!form_disabled){
				if(!reg_exp(form_value,/^[\w\.\-]+@[\w\.]+$/gim)){
					if(form_command.value.length>0){alert(form_command.value);}
					form_item.value = "";
					form_item.focus();
					return false;
				}				
			}
			// email ---------------------------------------------------------------------

			// notempty ------------------------------------------------------------------
			var form_command = form_item.attributes.getNamedItem("notempty");
			if(form_command&&!form_disabled&&form_length==0){
				if(form_command.value.length>0){alert(form_command.value);}
				form_item.focus();
				return false;
			}
			// notempty ------------------------------------------------------------------
			
			// minlength -----------------------------------------------------------------
			var form_command = form_item.attributes.getNamedItem("minlength");
			var error_command = form_item.attributes.getNamedItem("minlength_error");
			if(form_command&&!form_disabled){
				if(form_length<form_command.value){
					if(error_command&&error_command.value.length>0){alert(error_command.value);}
					form_item.focus();
					return false;
				}
			}
			// minlength -----------------------------------------------------------------
			
			// maxchar -------------------------------------------------------------------
			var form_command = form_item.attributes.getNamedItem("maxchar");
			var error_command = form_item.attributes.getNamedItem("maxchar_error");
			if(form_command&&!form_disabled){
				if(form_length>form_command.value){
					if(error_command&&error_command.value.length>0){alert(error_command.value);}
					form_item.value = "";
					for(var q=0;q<form_command.value;q++){ form_item.value+= form_value.charAt(q); }
					form_item.focus();
					return false;
				}
			}
			// maxchar -------------------------------------------------------------------
			
		}
		return true;
		//return false;
	}
	else {
		alert("check html code! (return check_form(this);)");
		return false;
	}
}

function reg_exp(source_string,reg_pattern){
	var reg = new RegExp(reg_pattern);
	return (reg.test(source_string));
}

function jsGo(){
	if(arguments[0].length > 0){
		window.location.href = arguments[0];
	}
	
}

function jsPop(source,width,height,center,scroll,x,y){
	var props = "width="+width+",height="+height;
	if(center){
		x = Math.round((window.screen.availWidth-width)/2);
		y = Math.round((window.screen.availHeight-height)/2);
		props+=",left="+x+",top="+y;
	} else{ 
		if(!x){ x = 0; }
		if(!y){ y = 0; }
		props+=",left="+x+",top="+y;
	}
	if(scroll){ props+=",scrollbars=yes,resizable=yes" } else { props+=",scrollbars=no,resizable=no" }
	var oNewWindow = window.open(source,null,props);
}