//	check blank
		function validateBlank(obj, msg)
		{
			if (obj.value == "")
			{
				alert(msg);
				obj.focus();
				obj.select();
				return false;
			}
			return true;
		}
//	end check blank

//	check selection of dropdown
		function validateSelect(obj, msg)
		{
			if (obj.value == "")
			{
				alert(msg);
				obj.focus();
				return false;
			}
			return true;
		}
//	end check selection of dropdown

//	check string
		function validateString(obj, msg)
		{
			var validStr = /^[a-zA-Z]{1,}$/;
			if (validStr.test(obj.value) == false)
			{
				alert(msg);
				obj.focus();
				obj.select();
				return false;
			}
			return true;
		}
//	end check string

		function validateAlphaNumeric(obj, msg)
		{
			var validStr = /^[a-zA-Z0-9\s\/\-\&\(\)\,]{1,}$/;
			if (validStr.test(obj.value) == false)
			{
				alert(msg);
				obj.focus();
				obj.select();
				return false;
			}
			return true;
		}
		function validateAlphaNumeric_old(obj, msg)
		{
			var validStr = /^[a-zA-Z0-9]{1,}$/;
			if (validStr.test(obj.value) == false)
			{
				alert(msg);
				obj.focus();
				obj.select();
				return false;
			}
			return true;
		}
		


//	check space
		function validateSpace(obj, msg)
		{
			var validSpace = /\s/;
			if (validSpace.test(obj.value) == true)
			{
				alert(msg);
				obj.focus();
				obj.select();
				return true;
			}
			return false;
		}
//	end check space

//	check string
		function validateLength(obj, msg, len)
		{
			if (obj.value.length > len )
			{
				alert(msg);
				obj.focus();
				obj.select();
				return false;
			}
			return true;
		}
//	end check string

//	check numeric
		function validateNumeric(obj, msg)
		{
			var validNum =  /^[0-9]{1,}$/;
			if (validNum.test(obj.value) == false)
			{
				alert(msg);
				obj.focus();
				obj.select();
				return false;
			}
			return true;
		}
		function validNumber(obj, msg)
		{
			if (isNaN(obj.value))
			{
				alert(msg);
				obj.focus();
				obj.select();
				return false;
			}
			return true;
		}

//	end check numeric

//	check float value with 2 decimal places
		function validateFloat(obj, msg)
		{
			var validNum =  /^([0-9]+)[0-9\.]{0,2}$/;
	//		var validNum =  /^([0-9]+)\.[0-9]{2}$/;
			if (validNum.test(obj.value) == false)
			{
				alert(msg);
				obj.focus();
				obj.select();
				return false;
			}
			return true;
		}
//	end float value with 2 decimal places

// 	email validation
		function validateEmail(obj)
		{
			var emailStr = /^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$/;
			if (emailStr.test(obj.value) == false)
			{
				alert("Please enter valid email address");
				obj.focus();
				obj.select();
				return false;
			}
			return true;
		}
// 	end email validation

// 	url validation
		function validateUrl(obj)
		{
			var urlStr = /^\http\:\/\/[a-zA-Z]{3,}\.[a-zA-Z0-9]{2,}(\.[a-zA-Z]{2,3}|\.[a-zA-Z]{2,3}\.[a-zA-Z]{2})$/;
			if (urlStr.test(obj.value) == false)
			{
				alert("Please enter valid site URL");
				obj.focus();
				obj.select();
				return false;
			}
			return true;
		}
// 	end url validation

//	check image file type
		function validateImgFile(obj)
		{
			validformFile = /(.jpg|.JPG|.gif|.GIF|.JPEG|.jpeg)$/;
			if (obj.value != "")
			{
				if(!validformFile.test(obj.value)) 
				{		
					alert("Only JPG, GIF, JPEG files supported, Please try again.");
					obj.focus();
					obj.select();
					return false;
				}
				return true;
			}
		}
//	end check image file type

//	check files 
		function validateFiles(obj)
		{
			validformFile = /(.jpg|.JPG|.gif|.GIF|.JPEG|.jpeg|.PDF|.pdf)$/;
			if (obj.value != "")
			{
				if(!validformFile.test(obj.value)) 
				{
		
					alert("Only JPG, GIF, JPEG files supported, Please try again.");
					obj.focus();
					obj.select();
					return false;
				}
				return true;
			}
		}
//	end check files type


//	check radio button validation
		function validateRadioCheck(fieldName, msg)
		{
			var arr = document.getElementsByName(fieldName);
			var choice = false;
			for(r=0;r<arr.length;r++)
			{
				if (arr[r].checked == true)
					choice = true;
			}
			if (!choice)
			{
				alert(msg);
				//arr[0].focus();
				return false;
			}
		}
//	end check radio button validation

//	check all checkboxes
		function checkAll(fieldName, val)
		{
			var chkarr = document.getElementsByName(fieldName);
			for(r=0;r<chkarr.length;r++)
			{
				if (val == true)
					chkarr[r].checked = true;
				else
					chkarr[r].checked = false;
			}
		}
//	end check all checkboxes

//	confirm to
		function confirmTo(msg)
		{
			var ans = confirm(msg);
			if (ans == true)
				return true;
			else
				return false;
		}
//	end confirm to

