

function searchform(){
//window.location.href="http://search.freefind.com/find.html?id=68086955&pageid=r&mode=ALL&n=0&x=6&y=11&query="+document.myfrm.query.value
window.location.href="http://search.freefind.com/find.html?id=68086955&pageid=r&mode=ALL&n=0&x=6&y=11&query="+query.value

		//document.myfrm.action = "http://search.freefind.com/find.html";
		//alert(URL);
		//document.myfrm.submit();


}
function isBetween (val, lo, hi) {
	if ((val < lo) || (val > hi)) { return(false); }
	else { return(true); }
}

/*********************************************************************************
*	FUNCTION	isEmpty checks if the parameter is empty or null
*	PARAMETER	str		AS String
**********************************************************************************/
function isEmpty (str) {
	if ((str==null)||(str.length==0)) return true;
	else return(false);
}
/*********************************************************************************
*	FUNCTION:		isDigit
*	PARAMETER:		Any Chracter
*	CALLS			isEmpty to check the NULL
*	RETURNS:		TRUE if the passed chracter is a digit, otherwise FALSE
**********************************************************************************/
function TrimLeft (str) {
	var pos = -1;

	if (str.length > 0) 
		while (str.substring(++pos, pos+1) == " ");
	else pos = 0;
		return (str.substring(pos, str.length));
}

function isDigit(theNum) {
	var theMask = '0123456789';
	
	if (isEmpty(theNum)) return(false);
	
	else if (theMask.indexOf(theNum) == -1) return(false);
	
	return(true);
}
/*********************************************************************************
*	FUNCTION:		isInt
*	PARAMETER:		theStr	AS String 
*	RETURNS:		TRUE if the passed parameter is an integer, otherwise FALSE
*	CALLS:			isDigit
**********************************************************************************/
function isInt (theStr) {
	var flag = true;

	if (isEmpty(theStr)) { flag=false; }
	else
	{	for (var i=0; i<theStr.length; i++) {
			if (isDigit(theStr.substring(i,i+1)) == false) {
				flag = false; break;
			}
		}
	}
	return(flag);
}




function isDate (thisis) {
	var theStr
	theStr=thisis.value
	var the1st = theStr.indexOf('/');
	var the2nd = theStr.lastIndexOf('/');
	
	if (the1st == the2nd) { 
	alert("Invalid Date");
	thisis.focus();
	return(false); 
	}
	else {
		var m = theStr.substring(0,the1st);
//		alert(m);
	//	alert(the1st);
		var d = theStr.substring(the1st+1,the2nd);
		var y = theStr.substring(the2nd+1,theStr.length);
		var maxDays = 31;
		if (isInt(m)==false || isInt(d)==false || isInt(y)==false) {
		alert("Invalid Date");
		thisis.focus();
			return(false);
			 }
		else if (y.length < 2) { 
		alert("Invalid Date");
		thisis.focus();
		return(false); 
		}
		else if (!isBetween (m, 1, 12)) {
		alert("Invalid Date");
		thisis.focus();
		return(false); 
		 }
		else if (m==4 || m==6 || m==9 || m==11) maxDays = 30;
		else if (m==2) {
			if (y % 4 > 0) maxDays = 28;
			else if (y % 100 == 0 && y % 400 > 0) maxDays = 28;
           	else maxDays = 29;
		}
			
		if (isBetween(d, 1, maxDays) == false) {
		 alert("Invalid Date");
		 thisis.focus();
		 return(false); 
		 }
		else {		
		 return(true); }
	}
}
function validateTel(field) {

var valid = "1234567890-()+,. "
var ok = "yes";
var temp;

for (var i=0; i<field.value.length; i++) {
temp = "" + field.value.substring(i, i+1);
if (valid.indexOf(temp) == "-1") ok = "no";
}

if (field.value=="") ok = "yes";

if (ok == "no") {
alert("Sorry!  Invalid Entry for Phone/Mobile/Fax Field");
field.focus();
field.select();
   }
}
////////////////////////////////////////////////////
function validateCode(field) {

var valid = "1234567890-()\/ "
var ok = "yes";
var temp;
for (var i=0; i<field.value.length; i++) {
temp = "" + field.value.substring(i, i+1);
if (valid.indexOf(temp) == "-1") ok = "no";
}

if (field.value=="") ok = "yes";

if (ok == "no") {
alert("Sorry!  Invalid Entry for code Field");
field.focus();
field.select();
   }
}
///////////////////////////////////////////////////////
function validateZip(field) {

var valid = "1234567890-"
var ok = "yes";
var temp;

for (var i=0; i<field.value.length; i++) {
temp = "" + field.value.substring(i, i+1);
if (valid.indexOf(temp) == "-1") ok = "no";
}

if (field.value=="") ok = "yes";

if (ok == "no") {
alert("Sorry!  Invalid Entry for ZIP Field");
field.focus();
field.select();
   }
}
function validateCityState(field) {

var valid = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ "
var ok = "yes";
var temp;

for (var i=0; i<field.value.length; i++) {
temp = "" + field.value.substring(i, i+1);
if (valid.indexOf(temp) == "-1") ok = "no";
}

if (field.value=="") ok = "yes";

if (ok == "no") {
alert("Sorry!  Invalid Entry for City/State Field");
field.focus();
field.select();
   }
}
function validatename(field) {

var valid = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ,.- "
var ok = "yes";
var temp;

for (var i=0; i<field.value.length; i++) {
temp = "" + field.value.substring(i, i+1);
if (valid.indexOf(temp) == "-1") ok = "no";
}

if (field.value=="") ok = "yes";

if (ok == "no") {
alert("Sorry!  Invalid Entry for Name Field");
field.focus();
field.select();
   }
}

function validateDbl(field)
{
	
	var valid = "1234567890."
	var ok = "yes";
	var temp;
	val=parseInt(field.value)
	var dbl="."
	var dblcount=0


	for (var i=0; i<field.value.length; i++) 
	{
		temp = "" + field.value.substring(i, i+1);
		if (valid.indexOf(temp) == "-1") ok = "no";

		if (dbl.indexOf(temp) == "0")
		{
			dblcount=dblcount+1
		}

	}
	
	if (dblcount > 1)
	{
		ok = "no"
	}

	if (ok == "no")
	{
		alert("Sorry! Invalid Entry for this Field");
		field.focus();
		field.select();
	}

//	if ( val < 0 || val > 99999999)
//	{
//		alert("Invalid Input");
//		field.focus();
//		field.select();
//	}

return ok	
}

function validateDbl2(field)
{
	
	var valid = "1234567890."
	var ok = "yes";
	var temp;
	val=parseInt(field.value)
	var dbl="."
	var dblcount=0


	for (var i=0; i<field.value.length; i++) 
	{
		temp = "" + field.value.substring(i, i+1);
		if (valid.indexOf(temp) == "-1") ok = "no";

		if (dbl.indexOf(temp) == "0")
		{
			dblcount=dblcount+1
		}

	}
	
	if (dblcount > 1)
	{
		ok = "no"
	}

	if (ok == "no")
	{
		alert("Sorry! Invalid Entry for this Field");
		//field.focus();
		//field.select();
	}

//	if ( val < 0 || val > 99999999)
//	{
//		alert("Invalid Input");
//		field.focus();
//		field.select();
//	}

return ok	
}

function validateTaxParcelQuick(field) {

	var valid = "1234567890qwertyuioplkjhgfdsazxcvbnm QWERTYUIOPLKJHGFDSAZXCVBNM-,/"
	var ok = "yes";
	var temp;
	val=parseInt(field.value)

	for (var i=0; i<field.value.length; i++) 
	{
		temp = "" + field.value.substring(i, i+1);
		if (valid.indexOf(temp) == "-1") ok = "no";
	}
	
	if (field.value.length > 0)
	{
	if (field.value.length <= 14)
	{
		ok = "no"
	}
	}
	
	if (ok == "no") 
	{
		alert("Sorry! Invalid Entry for this Field");
		field.focus();
		field.select();
	}

	return ok	
}

function validateTaxParcelQuickComma(field) {

	var valid = "1234567890qwertyuioplkjhgfdsazxcvbnm QWERTYUIOPLKJHGFDSAZXCVBNM-,/"
	var ok = "yes";
	var temp;
	val=parseInt(field.value)

		for (var i=0; i<field.value.length; i++) 
		{
		temp = "" + field.value.substring(i, i+1);
		if (valid.indexOf(temp) == "-1") ok = "no";
		}
		
		if (field.value.length > 0)
		{
		str = new String(field.value);
		str2 = str.split(',');
		
		for(i=0;i<str2.length;i++){
			if (str2[i].length <= 14)
			{
				ok = "no";
			}
		}
		}

	if (ok == "no") 
	{
		alert("Parcel number can't be less than 14 characters");
		field.focus();
		field.select();
	}

	return ok	
}


function validateTaxParcel(field) {

	var valid = "1234567890qwertyuioplkjhgfdsazxcvbnm QWERTYUIOPLKJHGFDSAZXCVBNM-,/"
	var ok = "yes";
	var temp;
	val=parseInt(field.value)

	for (var i=0; i<field.value.length; i++) 
	{
		temp = "" + field.value.substring(i, i+1);
		if (valid.indexOf(temp) == "-1") ok = "no";
	}

	
	if (ok == "no") 
	{
		alert("Sorry! Invalid Entry for this Field");
		field.focus();
		field.select();
	}

	return ok	
}


function validateInt(field) {

	var valid = "1234567890"
	var ok = "yes";
	var temp;
	val=parseInt(field.value)

	for (var i=0; i<field.value.length; i++) 
	{
		temp = "" + field.value.substring(i, i+1);
		if (valid.indexOf(temp) == "-1") ok = "no";
	}

	
	if (ok == "no") 
	{
		alert("Sorry! Invalid Entry for this Field");
		field.focus();
		field.select();
	}

	return ok	
}
function validateNum(field) {

	var valid = "1234567890.,:"
	var ok = "yes";
	var temp;
	val=parseInt(field.value)

	for (var i=0; i<field.value.length; i++) 
	{
		temp = "" + field.value.substring(i, i+1);
		if (valid.indexOf(temp) == "-1") ok = "no";
	}

	
	if (ok == "no") 
	{
		alert("Sorry! Invalid Entry for this Field");
		field.focus();
		field.select();
	}
	
return ok	
}


function validateOrderNumber(field) {

	var valid = "1234567890-qwertyuiopasdfghjklzxcvbnmQWERTYUIOPLKJHGFDSAZXCVBNM "
	var ok = "yes";
	var temp;
	val=parseInt(field.value)

	for (var i=0; i<field.value.length; i++) 
	{
		temp = "" + field.value.substring(i, i+1);
		if (valid.indexOf(temp) == "-1") ok = "no";
	}

	
	if (ok == "no") 
	{
		alert("Sorry! Invalid Entry for Escrow/Title Number Field");
		field.focus();
		field.select();
	}
	
return ok	
}

function validateReferenceno(field) {

	var valid = "1234567890-qwertyuiopasdfghjklzxcvbnmQWERTYUIOPLKJHGFDSAZXCVBNM "
	var ok = "yes";
	var temp;
	val=parseInt(field.value)

	for (var i=0; i<field.value.length; i++) 
	{
		temp = "" + field.value.substring(i, i+1);
		if (valid.indexOf(temp) == "-1") ok = "no";
	}

	
	if (ok == "no") 
	{
		alert("Sorry! Invalid Entry for Reference No Field");
		field.focus();
		field.select();
	}
	
return ok	
}


function validateSSN(field) {

	var valid = "1234567890/-_.,:;(){}[]qwertyuioplkjhgfdsazxcvbnmQWERTYUIOPLKJHGFDSAZXCVBNM&* "
	var ok = "yes";
	var temp;
	val=parseInt(field.value)

	for (var i=0; i<field.value.length; i++) 
	{
		temp = "" + field.value.substring(i, i+1);
		if (valid.indexOf(temp) == "-1") ok = "no";
	}

	
	if (ok == "no") 
	{
		alert("Sorry! Invalid Entry for TaxID/SSN Field");
		field.focus();
		field.select();
	}
	
return ok	
}

function validateid(field) 
{
var valid = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-_. "  
var ok = "yes";
var temp;
for (var i=0; i<field.value.length; i++) {
temp = "" + field.value.substring(i, i+1);
if (valid.indexOf(temp) == "-1") ok = "no";
}

if (field.value=="") ok= "yes";

if (ok == "no") {
alert("Sorry!  Invalid Entry for this Field");
field.focus();
field.select();
   }
return ok   
}

function f(field)
{
var valid = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-, "
var ok = "yes";
var temp;
for (var i=0; i<field.value.length; i++) {
temp = "" + field.value.substring(i, i+1);
if (valid.indexOf(temp) == "-1") ok = "no";
}

if (field.value=="") ok= "yes";

if (ok == "no") {
alert("Sorry!  Invalid Entry for name Field");
field.focus();
field.select();
   }
return ok   
}

function validatedescription(field)
{
var valid = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ 1234567890-_'%(){},.@#&*£ "
var ok = "yes";
var temp;
for (var i=0; i<field.value.length; i++) {
temp = "" + field.value.substring(i, i+1);
if (valid.indexOf(temp) == "-1") ok = "no";
}

if (field.value=="") ok= "yes";

if (ok == "no") {
alert("Sorry!  Invalid Entry for this Field");
field.focus();
field.select();
   }
return ok   
}

function validatedescription1(field)
{
var valid = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ 1234567890-_%(){},.@#&*£ "
var ok = "yes";
var temp;
for (var i=0; i<field.value.length; i++) {
temp = "" + field.value.substring(i, i+1);
if (valid.indexOf(temp) == "-1") ok = "no";
}

if (field.value=="") ok= "yes";

if (ok == "no") {
alert("Sorry!  Invalid Entry for this Field");
field.focus();
field.select();
   }
return ok   
}

function validateChar(field) 
{
var valid = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ(),.-:;<>\r* "
var ok = "yes";
var temp;
for (var i=0; i<field.value.length; i++) {
temp = "" + field.value.substring(i, i+1);
if (valid.indexOf(temp) == "-1") ok = "no";
}

if (field.value=="") ok= "yes";

if (ok == "no") {
alert("Sorry!  Invalid Entry for this Field");
field.focus();
field.select();
   }
return ok   
}

function validateCharInt(field) 
{
var valid = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ(),.-:;<>*&+#$@1234567890/_\\ "
var ok = "yes";
var temp;
for (var i=0; i<field.value.length; i++) {
temp = "" + field.value.substring(i, i+1);
if (valid.indexOf(temp) == "-1") ok = "no";
}

if (field.value=="") ok = "yes";

if (ok == "no") {
alert("Sorry!  Invalid Entry for this Field");
field.focus();
field.select();
   }
return ok   
}
/***********************************************************************
this check is for the validity of street no.

**************************************************************************/

function validateStreet(field) 
{
var valid = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ,.-:1234567890/_\\ "
var ok = "yes";
var temp;
for (var i=0; i<field.value.length; i++) {
temp = "" + field.value.substring(i, i+1);
if (valid.indexOf(temp) == "-1") ok = "no";
}

if (field.value=="") ok = "yes";

if (ok == "no") {
alert("Sorry!  Invalid Entry for this Field");
field.focus();
field.select();
   }
return ok   
}
//*****************************************************************
function validatepassword(field) 
{
var valid = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ(),.-:;<>*&+#$@1234567890/_\\ "
var ok = "yes";
var temp;
for (var i=0; i<field.value.length; i++) {
temp = "" + field.value.substring(i, i+1);
if (valid.indexOf(temp) == "-1") ok = "no";
}

if (field.value=="") ok = "yes";

if (ok == "no") {
alert("Sorry!  Invalid Entry for this Field");
field.focus();
field.select();
   }
return ok   
}


function validateDateCL(field,svrdate)
{
	var year,day,month,slash1,slash2;
	var checkYear,checkMonth,checkDay

	date=field.value
	slash1=date.indexOf('/',0)
	date1=date.substring(slash1+1,date.length)
	slash2=date1.indexOf('/',0)

	month=date.substring(0,slash1)

	day=date1.substring(0,slash2)
	year=date1.substring(slash2+1,date1.length)

if (field.value !="")
{

	if ((slash2==2) ||(slash2==1))
	{
		if (month>0 && month <13)
		{
			checkMonth=1
		}
		else
		{
			checkMonth=0
		}
	}
	else
	{
		checkMonth=0
	}

//for day

	if ((slash1==2) ||(slash1==1))
	{
		if (day>0 && day <32)
		{
				if(month==2)
				{
					
					if(day>0 && day<29 )
					{
						checkDay = 1;	
					
					}
					else
					{
						checkDay = 0;	
					}
				}

				else		
				if (month==4 || month==6 || month==9 || month==11)
				{
						if(day > 0 && day < 31 )
						{
							checkDay = 1;	
						}
						else
						{
							checkDay = 0;	
						}
				}
				else
				{
					checkDay = 1;	
				}
				
		}		
		else
		{
			checkDay=0
		}
	}
	else
	{
		checkDay=0
	}
	
//for year	
	if (year.length==4 || year.length==2)
	{
		if (year.length==4)
		{
			if(year>1900 && year <= 2020)
			{
				checkYear=1
			}
		}
		else
		if(year.length==2)
		{
			if(year >=00 && year <= 99)
			{
				checkYear=1
			}
		}
		else
		{
			checkYear=0
		}
	}

	else
	{
		checkYear=0
	}
/*
alert(checkDay)	
alert(checkMonth)
alert(checkYear)
*/		

if(checkDay==1 && checkMonth==1 && checkYear==1)
{
	dateobj = new Date(field.value)
	dateobj2 = new Date(svrdate)
	if (dateobj < dateobj2)
	{
		alert("Date must be bigger than or equal to current date")
		field.select()
		field.focus()
	}

}
else
{
	alert("Invalid Date.  Date Format: MM/DD/YY")
	field.select()
	field.focus()
}
}
}




function validateDate(field)
{
	var year,day,month,slash1,slash2;
	var checkYear,checkMonth,checkDay

	date=field.value
	slash1=date.indexOf('/',0)
	date1=date.substring(slash1+1,date.length)
	slash2=date1.indexOf('/',0)

//  for dd/mm/yyyy

/*	day=date.substring(0,slash1)
	month=date1.substring(0,slash2)
	year=date1.substring(slash2+1,date1.length)*/

// for mm/dd/yyyy

	month=date.substring(0,slash1)
//	alert(month)
//	alert(slash1)
	day=date1.substring(0,slash2)
	year=date1.substring(slash2+1,date1.length)

if (field.value !="")
{
//for month	

	if ((slash2==2) ||(slash2==1))
	{
		if (month>0 && month <13)
		{
			checkMonth=1
		}
		else
		{
			checkMonth=0
		}
	}
	else
	{
		checkMonth=0
	}

//for day

	if ((slash1==2) ||(slash1==1))
	{
		if (day>0 && day <32)
		{
				if(month==2)
				{
					
					if(day>0 && day<29 )
					{
						checkDay = 1;	
					
					}
					else
					{
						checkDay = 0;	
					}
				}

				else		
				if (month==4 || month==6 || month==9 || month==11)
				{
						if(day > 0 && day < 31 )
						{
							checkDay = 1;	
						}
						else
						{
							checkDay = 0;	
						}
				}
				else
				{
					checkDay = 1;	
				}
				
		}		
		else
		{
			checkDay=0
		}
	}
	else
	{
		checkDay=0
	}
	
//for year	
	if (year.length==4 || year.length==2)
	{
		if (year.length==4)
		{
			if(year>1900 && year <= 2020)
			{
				checkYear=1
			}
		}
		else
		if(year.length==2)
		{
			if(year >=00 && year <= 99)
			{
				checkYear=1
			}
		}
		else
		{
			checkYear=0
		}
	}

	else
	{
		checkYear=0
	}
/*
//alert(checkDay)	
//alert(checkMonth)
//alert(checkYear)
*/		

if(checkDay==1 && checkMonth==1 && checkYear==1)
{
}
else
{
	alert("Invalid Date.  Date Format: MM/DD/YY")
	field.select()
	field.focus()
}
}
}



function validateTime(field)
{
	var hour,minute,slash1
	var checkHour,checkMin

	time=field.value
	slash1=time.indexOf(':',0)

	hour=time.substring(0,slash1)
	min=time.substring(slash1+1,time.length)
if (field.value !="")
{

	if (hour > 0 && hour < 24 )
	{
			checkHour=true
	}
	else
	{
			checkHour=false
	}

	if (min >= 0 && min < 60 )
	{
			checkMin=true
	}
	else
	{
			checkMin=false
	}
	
	if (checkHour && checkMin)
	{
	}
	else
	{
		alert("Invalid Time!  Time Format HH:MM")
		field.select();
		field.focus();
	}
}
}

function validateDate_NFC(field)
{

	var year,day,month,slash1,slash2;
	var checkYear,checkMonth,checkDay

	date=field.value
	slash1=date.indexOf('/',0)
	date1=date.substring(slash1+1,date.length)
	slash2=date1.indexOf('/',0)

//  for dd/mm/yyyy

/*	day=date.substring(0,slash1)
	month=date1.substring(0,slash2)
	year=date1.substring(slash2+1,date1.length)*/

// for mm/dd/yyyy

	month=date.substring(0,slash1)
	day=date1.substring(0,slash2)
	year=date1.substring(slash2+1,date1.length)

if (field.value !="")
{
//for month	

	if ((slash2==2) ||(slash2==1))
	{
		if (month>0 && month <13)
		{
			checkMonth=1
		}
		else
		{
			checkMonth=0
		}
	}
	else
	{
		checkMonth=0
	}

//for day

	if ((slash1==2) ||(slash1==1))
	{
		if (day>0 && day <32)
		{
				if(month==2)
				{
					
					if(day>0 && day<29 )
					{
						checkDay = 1;	
					
					}
					else
					{
						checkDay = 0;	
					}
				}

				else		
				if (month==4 || month==6 || month==9 || month==11)
				{
						if(day > 0 && day < 31 )
						{
							checkDay = 1;	
						}
						else
						{
							checkDay = 0;	
						}
				}
				else
				{
					checkDay = 1;	
				}
				
		}		
		else
		{
			checkDay=0
		}
	}
	else
	{
		checkDay=0
	}
	
//for year	
	if (year.length==4 || year.length==2)
	{
		if (year.length==4)
		{
			if(year>1900 && year <= 2020)
			{
				checkYear=1
			}
		}
		else
		if(year.length==2)
		{
			if(year >=00 && year <= 99)
			{
				checkYear=1
			}
		}
		else
		{
			checkYear=0
		}
	}

	else
	{
		checkYear=0
	}
/*
alert(checkDay)	
alert(checkMonth)
alert(checkYear)
*/		

if(checkDay==1 && checkMonth==1 && checkYear==1)
{
	
	if(!chkDt(month + "/" + day + "/" + year))
	{
		field.select()
		field.focus()
	}
}
else
{
	alert("Invalid Date.  Date Format: MM/DD/YY")
	field.select()
	field.focus()
}
}
}



function chkDt(param)
{

	var today= new Date();
	var given= new Date(param);

	alert(param)
	alert(today)
	alert(given)
 
	
	if(today.getTime() < given.getTime())
	{
		alert("Invalid Date.Date can not be greater than today's date");
		return false;
	}
	return true;
}


function validateCompanyNameCopy(field,field2) 
 {
	var valid = " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-_.&"
	var ok = "yes";
	var temp;
	for (var i=0; i<field.value.length; i++) {
		temp = "" + field.value.substring(i, i+1);
		if (valid.indexOf(temp) == "-1") ok = "no";
	}

	if (field.value=="") ok= "yes";

	if (ok == "no") {
		alert("Sorry!  Invalid Entry for This Field");
		field.focus();
		field.select();
    }
	if (ok == "yes") {
		if (field.readOnly == false)
		{
			field2.value = field.value
		}
    }
   
	return ok   
 }


function validateCompanyName(field) 
 {
	var valid = " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-_.&/"
	var ok = "yes";
	var temp;
	for (var i=0; i<field.value.length; i++) {
		temp = "" + field.value.substring(i, i+1);
		if (valid.indexOf(temp) == "-1") ok = "no";
	}

	if (field.value=="") ok= "yes";

	if (ok == "no") {
		alert("Sorry!  Invalid Entry for This Field");
		field.focus();
		field.select();
   }
	return ok   
 }



function validateNum1(field) {

	var valid = "1234567890"
	var ok = "yes";
	var temp;
	val=parseInt(field.value)

	for (var i=0; i<field.value.length; i++) 
	{
		temp = "" + field.value.substring(i, i+1);
		if (valid.indexOf(temp) == "-1") ok = "no";
	}

	if (val=="") ok = "yes";	

	if (ok == "no") 
	{
		field.focus();
		field.select();
		alert("Sorry! Invalid Entry for this Field");
		
	}
return ok	
}

function validat(field) {
	
	var ok="no";
	val=field.value;
	if (val.indexOf("@") != "-1" && val.indexOf(".") != "-1" ) ok = "yes";
	
    
	if (field.value =="")ok== "yes";
	if (ok == "no")
	{
		
		alert("Sorry! Enter valid email address");
		field.focus();
		field.select();
	}
return ok

}

function val(field) {
	
	var ok="no";
	val=field.value;
	if (val.indexOf("@") != "-1" && val.indexOf(".") != "-1" ) ok = "yes";
	

	if (field.value == " ") ok == "no";
	if (ok == "no")
	{
		
		alert("Sorry! Enter valid email address");
		field.focus();
		field.select();
	}
return ok

}
/*******************************************************************************
        check if the email is correct or not	
*******************************************************************************/
/*******************************************************************************
	If the user have not permission of a particular menu Item. Then
	This function will be called to display the message
*******************************************************************************/
 
function validateemail(thisis)
{
  if (!isEmail(thisis.value))
    { 
      alert("Enter a valid e-mail address"); 
   		thisis.focus(); 
   		return false;
    }  
} 
 

function isEmail (theStr) 
{

var atIndex = theStr.indexOf('@');
 var dotIndex = theStr.indexOf('.', atIndex);
 var flag = true;
 

 theSub = theStr.substring(0, dotIndex+1)
 if (theStr=="") 
 return(flag);
 if ((atIndex < 1)||(atIndex != theStr.lastIndexOf('@'))||(dotIndex < atIndex + 2)||(theStr.length <= theSub.length)) 
 { flag = false; }
 else { flag = true; }
 
 return(flag);
} 

 
function AccessDenied(Message)
{	
	alert("Access Denied!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r----------------------------------------------------------------\r You do'not have Rights to " + Message + ".\r Contact the 'The Florist Exchange Administrator'");
}





function DateDiff(Date1,Date2)
{
	var d1,d2
	//Date1=YearInFourDigit(Date1)
	//Date2=YearInFourDigit(Date2)
	
	//alert("Date="+Date2)
	//alert("Rturnvalue="+YearInFourDigit(Date2));
	d1 = new Date(Date1)
	d2 = new Date(Date2)
	if ( Date1== "" || Date2=="" || Date1.length<1 || Date2.length<1 )
		difd=0
	else
		difd = ( (d2-d1) / 86400000 ) //86400000 milliseconde = 24 Hrs.
	//alert(difd)	
	return  difd
}





function isRealKeyPress(theNum)
{
	var theMask = '0123456789.';
	
	var firstIndex;
	var lastIndex;
		
	var fIndex;
	var lIndex;

	if ( (event.keyCode >=48 && event.keyCode < 58) ) 
		event.returnValue= true; 
	else 
	if (event.keyCode == 46)
	{ 
		fIndex = theMask.indexOf(theNum);
		lIndex = theMask.lastIndexOf(theNum);
	} 
	
	if (fIndex != -1) 
		firstIndex = fIndex;
	
	
	if (lIndex != -1)
		lastIndex = lIndex;
	
			
	if (firstIndex == lastIndex)
		return true;
	else
	{
		alert("You have entered decimal more than once.");
		return false;	
	}
	
	
}


function isReal2(field)
{
	var valid = '012345.6789';
	
	
	for (var i=0; i<field.value.length; i++) 
	{
		temp = "" + field.value.substring(i, i+1);
			if (valid.indexOf(temp) == "-1") 
				return false;
				
	}

	return true;	
}


function isReal(thisis) 
{
	
	
	
	var theMask = '012345.6789';
	
	var str;
	str = thisis.value;
	
	var strFloat;
	strFloat = parseFloat(str);
	if (strFloat == 0)
	{
		alert("Please Enter Valid Value");
		thisis.focus();
		return false;
	}
	
	var strlen;
	strlen = str.length;
	//alert("__uuidof = " + strlen);
	
	var bCheck = isReal2(thisis);
	if (bCheck == true)
	{	
		//alert("true");
	}
	else
	{
		alert("Please Enter Valid Value.");
		thisis.focus();
		return false;
	}
	
	
	
	var firstIndex;
	var lastIndex;
		
	var fIndex;
	var lIndex;

	if (isEmpty(str)) 
		return(false);
	
	else 
	{
		
		fIndex = str.indexOf('.');
		lIndex = str.lastIndexOf('.');
		
	}
			
	if (fIndex != -1) 
	{
		
		firstIndex = fIndex;
	}
	
	
	if (lIndex != -1)
	{
		
		lastIndex = lIndex;
	}
			
	if (firstIndex == lastIndex)
	{
		
		return true;
	}
	else
	{
		alert("Please Enter Decimal Place only Once.");
		thisis.focus();
		return false;	
	}
	
	
	

}