_editor_url = "";                     // URL to htmlarea files
var win_ie_ver = parseFloat(navigator.appVersion.split("MSIE")[1]);
if (navigator.userAgent.indexOf('Mac')        >= 0) { win_ie_ver = 0; }
if (navigator.userAgent.indexOf('Windows CE') >= 0) { win_ie_ver = 0; }
if (navigator.userAgent.indexOf('Opera')      >= 0) { win_ie_ver = 0; }
if (win_ie_ver >= 5.5) {
  document.write('<scr' + 'ipt src="' +_editor_url+ 'editor.js"');
  document.write(' language="Javascript1.2"></scr' + 'ipt>');  
} else { document.write('<scr'+'ipt>function editor_generate() { return false; }</scr'+'ipt>'); }
// --></script>
function CheckMail ( email ){
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9])+$/;
	if ( filter.test(email) ) return true;
	else return false;
}

function CheckInput(){
var height=window.screen.height;
var width=window.screen.width;
width=width/2-150;
height=height/2-75;
	// Require Fieldes
	var name=document.form1.name.value;
	var email=document.form1.email.value;
	var msg=document.form1.msg.value;

	var names=new Array('name', 'email', 'msg');
	var txt=new Array('نام', 'پست الکترونيکي', 'سوال');

	var requires=new Array();
	var i, j=0;
	for(i=0; i<names.length;i++)
		if( eval(names[i])=='' || (names[i]=='email' && !CheckMail(email)) )
			requires[j++]=txt[i];

	if( requires.length!=0 ) {
		alert('گزينه هاي زير را وارد کنيد'+'\n\n'+requires.join(' و '));
		return false;
	} else if( CheckMail(email)){
		;
			/*outputWin1.document.write('<html dir=rtl>'+
	'<head>'+
	'	<title>با تشكر</title>'+
	'<style>'+
	'td {'+
	'	font-family: tahoma;'+
	'	font-size: 13px;'+
	'}'+
	'a { text-decoration:none; }'+
	'</style>'+
	'</head>'+
	'<body bgcolor="#ffffff">'+
	'<div align="center">'+
	'<table border="0" height="200" width="500" cellpadding="0" cellspacing="0">'+
	'<tr><td align="center" valign="middle">'+
	'	<table border="0" height="100%" width="100%" cellpadding="0" cellspacing="0">'+
	'	<tr><td height="10"></td></tr>'+
	'	<tr><td align="center"><a href=javascript:history.back()>بازگشت</a></td></tr>'+
	'	<tr><td height="150"></td></tr>'+

	'	</table>'+
	'</td></tr>'+
	'</table>'+
	'</div>'+
	'</body>'+
	'</html>');
			document.forms.formmail.action = "<?=$path?><?=$path?>db/q-send.php";*/
				}
	else
		return false;

}
