//var expphone = /[^\d|\-|\+|\,]+/;
//var expname = /[^\w|\s|\!|\=|\&|\$|\'|\?|\.|\/|\_|\)|\(|\[|\]|\:|\-]+/;
//var expvarchar =/[^\w|\s|\!|\=|\&|\$|\'|\?|\.|\/|\_|\)|\(|\[|\]|\:|\-]+/;
//var emailexp = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/;
var emailexp = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
var adminemail = 'admin@mone.com';
var siteurl = 'http://www.mone.com';
var msg = '(\",%,;,~,@,#,%,^,*,{}\)';
var FEmsg = '(\",%,;,~,@,#,%,^,*,{}\)';
//var urlexp = /^(http:\/\/www.){1}([\w]+)(.[\w]+){1,2}$/;
var userexp = /(\s)/;

var expphone = /[^\d|\-|\+|\,]+/;
var expaddress = /[^\w|\s|\~|\!|\@|\#|\&|\(|\)|\_|\-|\+|\{|=|\[|\]|\:|\,|\.|\/]+/;	
//var emailexp = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/;
var expname = /[^\w|\s|\!|\=|\&|\$|\'|\?|\.|\/|\_|\)|\(|\[|\]|\:|\-]+/;

var expvarchar =/[^\w|\s|\~|\!|\@|\#|\&|\(|\)|\{|\}|=|\[|\]|\:|\.|\'|\?|\/|\$|\*|\,|\-|\%]+/;
var explevelvarchar =/[\~|\!|\@|\_|\{|\}|=|\[|\]|\:|\"]+/;
var expValueDomain =/[^\w|\s|\~|\!|\@|\#|\&|\(|\)|\{|\}|=|\[|\]|\:|\.|\'|\?|\/|\$|\*|\,|\-|\%]+/;
var expCommon =/[^\w|\s|\~|\!|\@|\#|\&|\(|\)|\{|\}|=|\[|\]|\:|\.|\'|\?|\/|\$|\*|\,|\-|\%]+/;
var expPrice = /[^\d|\,|\.]+/;
var urlexp = /http:\/\/([\w-]+\.)+[\w-]+(\/[\w- ./?%&=]*)?/; 

var expMassage = '(\",%,;,~,@,#,%,^,*,{}\)';
var expVDomainMassage = '(\",~,^,{}\)';

var expPrice1 = /[^\d|\,|]+/;
var expIntStock= /^[\d]+$/;
var expDecimalFixed = /^\d+(\.\d{1,2})?$/
var expOMRDecimalFixed = /^\d+(\.\d{1,3})?$/

var expnamearabic = /[\'|\"|\%]+/;

var expcheckprice= /^((\d+(\.\d)?)|((\d*\.)?\d{1,2}))$/; // Allow dot operator
var expcheckprice1= /^((\d+(\.\d)?)|((\d*\.)?\d{1,3}))$/; // Allow dot operator
var expchecknewone= /[^\w|\s|\d|\-|\/]+/;

//Function to Check the Characters length of the TextArea Fields
function checkCharLength(strObj,strName,maxlen)
{
	strTestObj = "document.form1."+strObj 
	if (eval(strTestObj+".value.length")>maxlen)
	{
	  eval(strTestObj+".value="+strTestObj+".value.substring(0,"+maxlen+")");
	  alert(strName+" can only be "+ maxlen +" characters long");
	}
}	
//Function To Limit the Attachments like .doc or .xls or .txt
function LimitAttach(form,file,fileext)
{
	 var strExt = new String();
		 strExt = fileext;	 
	   extArray = strExt.split(",")	 
	var allowSubmit = false;
	if (!file) return;
		while (file.indexOf("\\") != -1)
			file = file.slice(file.indexOf("\\") + 1);
			//ext  = file.slice(file.indexOf(".")).toLowerCase();
			ext  = file.split(".");
			//alert(ext[ext.length-1]);
			for (var i = 0; i < extArray.length; i++)
			{	
				if (extArray[i] == "."+ext[ext.length-1].toLowerCase()) { allowSubmit = true; break; }
			}			
			if (allowSubmit) 
			{
				return true;
			}					
			else
			{
				alert("Only (" + (extArray.join("  ")) + ") files are allowed to upload," +
				"\nPlease select a new "
				+ "file and upload again.");				
				return false;
			} 
}

// to change form Omani Rial to US Dolar
function setDolarValue(value1,value2) { //Vlaue1 : Resource field    &   Value2: Destination Field
	if (value1.value != "" )
		{value2.value = value1.value * 2.59;      } 
	else {value2.value = "";      }   }		 
