//-------------------------- nonverba nv.js scripts starts ----------------------------------------------------


ver = new BrowserCheck()
/* enable disable starts here */ 
function BrowserCheck()
{
	var b = navigator.appName
	if (b=="Netscape") this.b = "ns"
	else if (b=="Microsoft Internet Explorer") this.b = "ie"
	else this.b = b

}

//function callPopupWindow(url)
//{
//		window.open(url,'mypopup','toolbars=0,menubars=0,scrollbars=No,width=900,height=500,left=150,top=50');
//} 

function checkEvent(e)
{
	if (e.target !="")
	{
		if (ver.b == 'ns')
		{
			if (e.target.name)
			{
				if (arrElementsStatus[e.target.name] == 'readonly')
				{
					e.target.blur();
					return false;
				}
				else
				{
					return true;
				}
			}
		}
		else
		{
			return true;
		}
	}
}

var netscapeItems;
ver = new BrowserCheck()
var o;
var arrElementsStatus = new Array();
var arrElementsNames = new Array();
var arrListBoxValue = new Array();

if (ver.b == 'ns')
{
	this.document.captureEvents(Event.MOUSEDOWN);
	this.document.captureEvents(Event.FOCUS);
	this.document.onMouseDown=checkEvent;
	this.document.onFocus=checkEvent;
}

function disabletextbox(objName)
{
	if (ver.b == 'ns')
	{
  	  this.arrElementsStatus[objName.name] = 'readonly';
	}
	else
	{
	    objName.disabled = 1;
	}
}

function enabletextbox(objName)
{
	if (ver.b == 'ns')
	{
	    this.arrElementsStatus[objName.name] = 'editable';
	}
	else
	{
	    objName.disabled = 0;
	}
}

/* enable disable ends here */
  
  
/* open popup window starts here */
function popupnewwindow(newlink)
{
	if(screen.width==900 && screen.height==500)
		window.open(newlink,null,"height=600,width=900,status=yes,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=No,top=100,left=80");
	else
		window.open(newlink,null,"height=600,width=900,status=yes,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=No,top=100,left=140");

}
function popupWhatWeDowindow(newlink)
{
	if(screen.width==800 && screen.height==650)
		window.open(newlink,null,"height=450,width=600,status=yes,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=yes,top=100,left=80");
	else
		window.open(newlink,null,"height=450,width=700,status=yes,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=yes,top=100,left=140");

}
function popupBenefitswindow(newlink)
{
	if(screen.width==800 && screen.height==700)
		window.open(newlink,null,"height=450,width=600,status=yes,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=yes,top=100,left=80");
	else
		window.open(newlink,null,"height=450,width=700,status=yes,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=yes,top=100,left=140");

}
/* open popup window ends here */


/* open popup window with Menu bar starts here */
function popupnewTaskwindow(newlink)
{
	if(screen.width==800 && screen.height==600)
		window.open(newlink,null,"height=450,width=600,status=yes,toolbar=Yes,menubar=Yes,location=no,resizable=yes,scrollbars=yes,top=100,left=80");
else
window.open(newlink,null,"height=450,width=700,status=yes,toolbar=yes,menubar=Yes,location=no,resizable=yes,scrollbars=yes,top=100,left=140");

}
/* open popup window with Menu Bar ends here */

function popupWithTaskwindow(tasklink)
{
	if(screen.width==800 && screen.height==600)
		window.open(tasklink,"newwindow","height=450,width=600,status=yes,toolbar=Yes,menubar=Yes,location=no,resizable=yes,scrollbars=yes,top=100,left=80");
	else
		window.open(tasklink,"newwindow","height=450,width=700,status=yes,toolbar=yes,menubar=Yes,location=no,resizable=yes,scrollbars=yes,top=100,left=140");

}

function buttonCancel()
{
	window.location.href="index.asp"
}

/* Date Picker Starts HERE ! */ 
  function show_calendar(str_target, str_datetime) 
{
	//alert ( str_datetime );
	var arr_months = ["January", "February", "March", "April", "May", "June",
		"July", "August", "September", "October", "November", "December"];
	var week_days = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
	var n_weekstart = 1; // day week starts from (normally 0 or 1)	
	var dt_datetime = (str_datetime == null || str_datetime =="" ?  new Date() : str2dt(str_datetime));
	var dt_prev_month = new Date(dt_datetime);
	dt_prev_month.setMonth(dt_datetime.getMonth()-1);
	var dt_next_month = new Date(dt_datetime);
	dt_next_month.setMonth(dt_datetime.getMonth()+1);
	
	var dt_next_year = new Date(dt_datetime);
	dt_next_year.setYear(dt_datetime.getFullYear()+1);	
	
	var dt_prev_year = new Date(dt_datetime);
	dt_prev_year.setYear(dt_datetime.getFullYear()-1);	


	var dt_firstday = new Date(dt_datetime);
	dt_firstday.setDate(1);
	dt_firstday.setDate(1-(7+dt_firstday.getDay()-n_weekstart)%7);
	var dt_lastday = new Date(dt_next_month);
	dt_lastday.setDate(0);
	
	// html generation (feel free to tune it for your particular application)
	// print calendar header
	var intYear = dt_datetime.getFullYear();
	var str_buffer = new String (
		"<html>\n"+
		"<head>\n"+
		"	<title>Calendar</title>\n"+
		"</head>\n"+
		"<body topmargin = '5' bgcolor=\"#ffffff\">\n"+
		"<table class=\"clsOTable\" cellspacing=\"0\" border=\"0\" width=\"100%\">\n"+
		"<tr><td bgcolor=\"#7fc372\">\n"+
		"<table cellspacing=\"1\" cellpadding=\"3\" border=\"0\" width=\"100%\">\n"+
		"<tr>\n	<td bgcolor=\"#7fc372\"><a onfocus = 'this.blur()' href=\"javascript:window.opener.show_calendar('"+
		str_target+"', '"+ dt2dtstr(dt_prev_year)+"');\">"+
		"<img src=\"..\\images\\previousyear.jpg\"  border=\"0\""+
		" alt=\"Previous Year\"></a>" +		
		"<a onfocus = 'this.blur()' href=\"javascript:window.opener.show_calendar('"+
		str_target+"', '"+ dt2dtstr(dt_prev_month)+"');\">"+
		"<img src=\"..\\images\\previousmonth.jpg\"  border=\"0\""+
		" alt=\"Previous Month\"></a></td>\n"+				
		"	<td bgcolor=\"#7fc372\"  align = \"center\">"+
		"<font color=\"white\" face=\"tahoma, verdana\" size=\"2\"><b>"
		+arr_months[dt_datetime.getMonth()]+" " + intYear  + "</b></font></td>\n"+
		"	<td bgcolor=\"#7fc372\" align=\"right\"><a onfocus = 'this.blur()' href=\"javascript:window.opener.show_calendar('"
		+str_target+"', '"+dt2dtstr(dt_next_month)+"');\">"+
		"<img src=\"..\\images\\nextmonth.jpg\"  border=\"0\""+
		" alt=\"Next Month\"></a>" + 
		"<a onfocus = 'this.blur()' href=\"javascript:window.opener.show_calendar('"
		+str_target+"', '"+dt2dtstr(dt_next_year)+"');\">"+
		"<img src=\"..\\images\\nextyear.jpg\"  border=\"0\""+
		" alt=\"Next Year\"></a>" + 
		"</td>\n</tr></table>\n"
	);

	var dt_current_day = new Date(dt_firstday);
	// print weekdays titles
	str_buffer += "<table cellspacing=\"1\" cellpadding=\"3\" border=\"0\" width=\"100%\"><tr>\n";
	for (var n=0; n<7; n++)
		str_buffer += "	<td bgcolor=\"#eceaea\">"+
		"<font color=\"#000000\" face=\"tahoma, verdana\" size=\"2\">"+
		week_days[(n_weekstart+n)%7]+"</font></td>\n";
	// print calendar table
	str_buffer += "</tr>\n";
	var intWeek = 0;
	while (dt_current_day.getMonth() == dt_datetime.getMonth() ||
		dt_current_day.getMonth() == dt_firstday.getMonth()) {
		// print row heder
		str_buffer += "<tr>\n";
		for (var n_current_wday=0; n_current_wday<7; n_current_wday++) {
				if (dt_current_day.getDate() == dt_datetime.getDate() &&
					dt_current_day.getMonth() == dt_datetime.getMonth())
					// print current date
					str_buffer += "	<td bgcolor=\"#54B7BC\" align=\"right\">";
				else if (dt_current_day.getDay() == 0 || dt_current_day.getDay() == 6)
					// weekend days
					str_buffer += "	<td bgcolor=\"#E5F9E5\" align=\"right\">";
				else
					// print working days of current month
					str_buffer += "	<td bgcolor=\"white\" align=\"right\">";

				if (dt_current_day.getMonth() == dt_datetime.getMonth())
					// print days of current month
					str_buffer += "<a href=\"javascript:window.opener.document."+str_target+
					".value='"+dt2dtstr(dt_current_day)+"'; window.close();\">"+
					"<font color=\"#000000\" face=\"tahoma, verdana\" size=\"2\">";
				else 
					// print days of other months
					str_buffer += "<a href=\"javascript:window.opener.document."+str_target+
					".value='"+dt2dtstr(dt_current_day)+"'; window.close();\">"+
					"<font color=\"#B0B8C6\" face=\"tahoma, verdana\" size=\"2\">";
				str_buffer += dt_current_day.getDate()+"</font></a></td>\n";
				dt_current_day.setDate(dt_current_day.getDate()+1);
		}
		// print row footer
		str_buffer += "</tr>\n";
		intWeek ++;
	}
	// print calendar footer
	str_buffer += 
		"</table>\n" +
		"</tr>\n</td>\n</table>\n" +
		"</body>\n" +
		"</html>\n"; 

	
		/* "<form name=\"cal\">\n<tr><td colspan=\"7\" bgcolor=\"#87CEFA\">"+
		"<font color=\"White\" face=\"tahoma, verdana\" size=\"2\">"+
		"Time: <input type=\"text\" name=\"time\" value=\""+dt2tmstr(dt_datetime)+
		"\" size=\"8\" maxlength=\"8\"></font></td></tr>\n</form>\n" +
		"</table>\n" +
		"</tr>\n</td>\n</table>\n" +
		"</body>\n" +
		"</html>\n"; */
	var vWinCal = window.open("", "Calendar", "width=270,height=175,status=no,resizable=no" );

	if( intWeek < 5)
		vWinCal.resizeTo(270, intWeek * 49 );	
	else if( intWeek == 5)
		vWinCal.resizeTo(270, intWeek * 43 );
	else
		vWinCal.resizeTo(270, intWeek * 40 );
	vWinCal.opener = self;
	var calc_doc = vWinCal.document;
	calc_doc.write (str_buffer);
	calc_doc.close();
}
// datetime parsing and formatting routimes. modify them if you wish other datetime format
function str2dt (str_datetime) 
{
	var re_date = /^(\d+)\-(\d+)\-(\d+)/;
	if (!re_date.exec(str_datetime))
		return alert("Invalid Datetime format: "+ str_datetime);
	return (new Date (RegExp.$3, RegExp.$2-1, RegExp.$1, RegExp.$4, RegExp.$5, RegExp.$6));
}
function dt2dtstr (dt_datetime) 
{
	var intMonth;
	if((dt_datetime.getMonth()+1) <= 9)
		intMonth = "0" + (dt_datetime.getMonth()+1);
	else
		intMonth = (dt_datetime.getMonth()+1);

	var intDate;
	if( dt_datetime.getDate() <= 9)
		intDate = "0" + dt_datetime.getDate();	
	else
		intDate = dt_datetime.getDate();

	return (new String (intDate+"-"+(intMonth)+"-"+dt_datetime.getFullYear()+" "));
}
function dt2tmstr (dt_datetime) 
{
	return (new String (
			dt_datetime.getHours()+":"+dt_datetime.getMinutes()+":"+dt_datetime.getSeconds()));
}


/* Date Picker ENDS HERE ! */ 

function isValidSubject(field)
{
	var strTmp = (field.value).toUpperCase(); 
	var valid = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_&',/() " ;
	var temp;
	for (var i=0; i<strTmp.length; i++)
	{
		temp = ""+ strTmp.substring(i, i+1);
					
		if (valid.indexOf(temp) == -1) 
		{
			return false;
			break;
		}
	}
	return true;   	
}	
function trimBlankSpaces(frmName)
{
	for(index=0;index<frmName.elements.length;index++)
	{
		if(frmName.elements[index].type.indexOf("text") == 0 )
		{
			frmName.elements[index].value = stripBlanks(frmName.elements[index].value);
		}
	}
}

function stripEmptyBlanks(ObjCtrl)
{
 	    var newString;
	    var i;
	    var j;
	    var blank;
	    blank = " ";
	    newString = "";
	    aString = ObjCtrl.value;	
	    if(aString == null) aString = " ";
	    for (i=0; i<aString.length; i++)
	    { 
		    if (aString.charAt(i) != blank && aString.charCodeAt(i)!= 13 && aString.charCodeAt(i) != 10 )
		    {
			    break;
		    }
	    }
	    for (j=aString.length-1; j>=0; j--)
	    {
		    if (aString.charAt(j) != blank   && aString.charCodeAt(j)!= 13 && aString.charCodeAt(j) != 10 )
		    {
				    break;
		    }
	    }
	    for(k=i;k<=j;k++)
	    {
		    newString += aString.charAt(k);
	    }	
	    return newString;	
}

function stripBlanks(Source)
{
 	var newString;
	var i;
	var j;
	var blank;
	blank = " ";
	newString = "";
	if(Source == null) Source = " ";
	aString = Source;	
	for (i=0; i<aString.length; i++)
	{ 
		if (aString.charAt(i) != blank && aString.charCodeAt(i)!= 13 && aString.charCodeAt(i) != 10 )
		{
			break;
		}
	}
	for (j=aString.length-1; j>=0; j--)
	{
		if (aString.charAt(j) != blank   && aString.charCodeAt(j)!= 13 && aString.charCodeAt(j) != 10 )
		{
				break;
		}
	}
	for(k=i;k<=j;k++)
	{
		newString += aString.charAt(k);
	}	
	return newString;	
}

function ConvertProperCase(Field)
{
	var tmpStr;
	tmpStr=Field.value;
	tmpStr = stripBlanks(Field.value);
	Field.value=tmpStr;
	tmpStr = tmpStr.substr(0,1).toUpperCase() + tmpStr.substr(1,tmpStr.length);
	Field.value=tmpStr;
}

function UserNameCheck(Field)
{
	var strTmp = Field.value;  	
		
	var valid = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890_" ;
	var temp;
	for (var i=0; i<strTmp.length; i++)
	{
		temp = ""+ strTmp.substring(i, i+1);
					
		if (valid.indexOf(temp) == -1) 
		{
			return false;
			break;
		}
	}
	return true;   	
}

function NameCheck(Field)
{
	var strTmp = Field.value;  	
	
	var valid = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz " ;
	var temp;
	for (var i=0; i<strTmp.length; i++)
	{
		temp = ""+ strTmp.substring(i, i+1);
				
		if (valid.indexOf(temp) == -1) 
		{
			return false;
			break;
		}
	}
	return true;   	
}

function ZipCodeCheck(Field)
{
	var strTmp = Field.value;  	
	var intBlankOccurance = 0;
	var strAlertMsg;
	var valid = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890 " ;
	var temp;
	
	for (var i=0; i<strTmp.length; i++)
	{
		temp = ""+ strTmp.substring(i, i+1);
				
		if (valid.indexOf(temp) == -1) 
		{
			return false;
			break;
		}
		else
		{
			if(temp == " ")
			{
				intBlankOccurance = intBlankOccurance + 1;
			}
		}
	}
	if (intBlankOccurance > 1)
		return false;
	else
		return true;   	
}

function PhoneNumberCheck(Field)
{
	var strTmp = Field.value;  	
	var intBlankOccurance = 0;
	var intHypenOccurance = 0;
	var strAlertMsg;
	var valid = "1234567890 -()+" ;
	var temp;
	
	for (var i=0; i<strTmp.length; i++)
	{
		temp = ""+ strTmp.substring(i, i+1);
				
		if (valid.indexOf(temp) == -1) 
		{
			return false;
			break;
		}
	/*	else
		{
			if(temp == " ")
			{
				intBlankOccurance = intBlankOccurance + 1;
			}
			else if(temp == "-")
			{
				intHypenOccurance = intHypenOccurance + 1;
			}
		} */
	}
	//if (intBlankOccurance > 1 || intHypenOccurance > 1 )
	//	return false;
	//else
		return true;   	
}

function ChangedPhoneNumber(Field)
{
	var strTmp = Field.value;  	
	var intBlankOccurance = 0;
	var intHypenOccurance = 0;
	var strAlertMsg;
	var valid = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890 -()+" ;
	var temp;
	
	for (var i=0; i<strTmp.length; i++)
	{
		temp = ""+ strTmp.substring(i, i+1);
				
		if (valid.indexOf(temp) == -1) 
		{
			return false;
			break;
		}
	/*	else
		{
			if(temp == " ")
			{
				intBlankOccurance = intBlankOccurance + 1;
			}
			else if(temp == "-")
			{
				intHypenOccurance = intHypenOccurance + 1;
			}
		} */
	}
	//if (intBlankOccurance > 1 || intHypenOccurance > 1 )
	//	return false;
	//else
		return true;   	
}

function PhoneCountryCodeCheck(Field)
{
	var strTmp = Field.value;  	
	var intBlankOccurance = 0;
	var intHypenOccurance = 0;
	var strAlertMsg;
	var valid = "1234567890 +" ;
	var temp;
	
	for (var i=0; i<strTmp.length; i++)
	{
		temp = ""+ strTmp.substring(i, i+1);
				
		if (valid.indexOf(temp) == -1) 
		{
			return false;
			break;
		}
	}
		return true;   	
}

function PhoneCheck(Field)
{
	var strTmp = Field.value;  	
	var intBlankOccurance = 0;
	var intHypenOccurance = 0;
	var strAlertMsg;
	var valid = "1234567890 " ;
	var temp;
	
	for (var i=0; i<strTmp.length; i++)
	{
		temp = ""+ strTmp.substring(i, i+1);
				
		if (valid.indexOf(temp) == -1) 
		{
			return false;
			break;
		}
	}
		return true;   	
}

function emailCheck(email)
{
	var intI=1;
	var intCounter=0;
	strEmail=email.value;
	var strEmailLength = strEmail.length;
	var check =1;
	 if (email.value == '')	
	 {
	 	alert('Please enter an E-mail ID.');
	 	email.focus();
	 	check = 0; 
	 	return check;
	 }
	 // look for @
	 while ((intI < strEmailLength) && (strEmail.charAt(intI) != "@"))
	 { intI++ }
	 if ((intI >= strEmailLength) || (strEmail.charAt(intI) != "@"))
	 {
	 	check = 0; 
	 	return check;
	 }
	 
	else intI += 2;

    while ((intI < strEmailLength) && (strEmail.charAt(intI) != "."))
	{ intI++     }

    diff=strEmailLength - intI;
	if ((intI >= strEmailLength - 1) || (strEmail.charAt(intI) != ".")) 
	{
	    check = 0; 
		return check;
	}
	 
	 for(i=0; i < strEmailLength; i++)
	 {
	    if(strEmail.charAt(i) == ".")
	    {
	   	if(strEmail.charAt(i+1) == ".")
	   	{
	   		check = 0; 
	   		return check;
	   	}
	   }
	}
	 
	 
	var valid1='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@._0123456789-';
    var temp1;
	var fieldx=email.value;
	for (var intI=0; intI <fieldx.length; intI++) 
	{
		temp1 = "" + fieldx.substring(intI, intI+1);
	    if(temp1 == "@")
		{
			intCounter=intCounter+1;
		}
		if (valid1.indexOf(temp1) == "-1")
		{
			check = 0; 
	 		return check;
		}
	}
	var strSourceField = email.value;
	var blnNumCheckStatus = true;
	var intDectot  = 0;
	var intDecpos  = 0;
	var strValidchars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@._0123456789-";
	for(var intDecCount=0; intDecCount<strSourceField.length;intDecCount++) 
	{
		if(strSourceField.charAt(intDecCount)=='@') 
		{
			intDectot++;
			intDecpos = (intDecCount+1);
		}
		if (intDectot>1)
		{
			blnNumCheckStatus = false;
		}
	}
	if(blnNumCheckStatus==false)
	{
		return blnNumCheckStatus;
	}
	if ((email.value.length < 6) || (email.value.length > 80))
	{
		check = 0; 

	}
	var invalid = " "; // Invalid character is a space
	if (email.value.indexOf(invalid) > -1) 
	{
		check = 0; 
		return check;
	}
	var strSourceField = email.value;
	var blnNumCheckStatus = true;
	var intDectot  = 0;
	var intDecpos  = 0;
	var strValidchars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@._0123456789-";
	for(var intDecCount=0; intDecCount<strSourceField.length;intDecCount++) 
	{
		if(strSourceField.charAt(intDecCount)=='@') 
		{
			intDectot++;
			intDecpos = (intDecCount+1);
		}
		if (intDectot>1)
		{
			blnNumCheckStatus = false;
		}
	}
	if(blnNumCheckStatus==false)
	{
		return blnNumCheckStatus;
	}
	
	return check;
}


var arrUKCounty = new Array();	
	arrUKCounty[0] = "Alderney";
	arrUKCounty[1] = "Avon";
	arrUKCounty[2] = "Bedfordshire";
	arrUKCounty[3] = "Berkshire" ;
	arrUKCounty[4] = "Borders";
	arrUKCounty[5] = "Buckinghamshire";
	arrUKCounty[6] = "Cambridgeshire";
	arrUKCounty[7] ="Central";
	arrUKCounty[8] = "Cheshire";
	arrUKCounty[9] = "Cleveland";
	arrUKCounty[10] = "Clwyd";
	arrUKCounty[11] = "Cornwal";
	arrUKCounty[12] = "County Antrim";
	arrUKCounty[13] = "County Armagh";
	arrUKCounty[14] = "County Down";
	arrUKCounty[15] = "County Durham";
	arrUKCounty[16] = "County Fermanagh";
	arrUKCounty[17] = "County Londonderry";
	arrUKCounty[18] = "County Tyrone";
	arrUKCounty[19] = "Cumbria";
	arrUKCounty[20] = "Derbyshire";
	arrUKCounty[21] = "Devon";
	arrUKCounty[22] = "Dorse";
	arrUKCounty[23] = "Dumfries & Galloway";
	arrUKCounty[24] = "Dyfed";
	arrUKCounty[25] = "East Sussex";
	arrUKCounty[26] = "Essex";
	arrUKCounty[27] = "Fife";
	arrUKCounty[28] = "Glamorgan";
	arrUKCounty[29] = "Gloucester";
	arrUKCounty[30] = "Grampian";
	arrUKCounty[31] = "Greater London";
	arrUKCounty[32] = "Greater Manchester";
	arrUKCounty[33] = "Guernsey";
	arrUKCounty[34] = "Gwent";
	arrUKCounty[35] = "Gwynedd";
	arrUKCounty[36] = "Hampshire";
	arrUKCounty[37] = "Hereford & Worcester";
	arrUKCounty[38] = "Hertfordshire";
	arrUKCounty[39] = "Highlands";
	arrUKCounty[40] = "Humberside";
	arrUKCounty[41] = "Isle of Man";
	arrUKCounty[42] = "Isle of Wight";
	arrUKCounty[43] = "Jersey";
	arrUKCounty[44] = "Kent";
	arrUKCounty[45] = "Lancashire";
	arrUKCounty[46] = "Leicestershire";
	arrUKCounty[47] = "Lincolnshire";
	arrUKCounty[48] = "Lothian";
	arrUKCounty[49] = "Merseyside";
	arrUKCounty[50] = "Norfolk";
	arrUKCounty[51] = "North Yorkshire";
	arrUKCounty[52] = "Northamptonshire";
	arrUKCounty[53] = "Northumberland";
	arrUKCounty[54] = "Nottinghamshire";
	arrUKCounty[55] = "Orkney";
	arrUKCounty[56] = "Oxfordshire";
	arrUKCounty[57] = "Powys";
	arrUKCounty[58] = "The Sark";
	arrUKCounty[59] = "Shetland";
	arrUKCounty[60] = "Shropshire";
	arrUKCounty[61] = "Somerset";
	arrUKCounty[62] = "South Glamorgan";
	arrUKCounty[63] = "South Yorkshire";
	arrUKCounty[64] = "Staffordshire";
	arrUKCounty[65] = "Strathclyde";
	arrUKCounty[66] = "Suffolk";
	arrUKCounty[67] = "Surrey";
	arrUKCounty[68] = "Tayside";
	arrUKCounty[69] = "Tyne & Wear";
	arrUKCounty[70] = "Warwickshire";
	arrUKCounty[71] = "West Glamorgan";
	arrUKCounty[72] = "West Midlands";
	arrUKCounty[73] = "West Sussex";
	arrUKCounty[74] = "West Yorkshire";
	arrUKCounty[75] = "Western Isles";
	arrUKCounty[76] = "Wiltshire";
	
//-------------------------- nonverba nv.js scripts ends ------------------------------------------------------

//-------------------------- nonverba nonverba.js scripts starts -------------------------------------------

function ChangeHelp()
{
	if(document.frmhelp.selHelp.value == "help")
	{
		alert ('Please select an option.');
		return false;
	}
	else
	{	
		parent.frames[0].location.href = "../blue.htm"
		location.href = document.frmhelp.selHelp.options[document.frmhelp.selHelp.selectedIndex].value; return true;
	}
}

function cancelPage()
{
	parent.frames[0].location.href = "../blue.htm"	
	location.href = "default.asp"
}

function newImage(arg) 
{
	if (document.images) 
	{
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changehover() 
{
	if (document.images && (preloadFlag == true)) 
	{
		for (var i=0; i<changehover.arguments.length; i+=2) 
		{
			document[changehover.arguments[i]].src = changehover.arguments[i+1];
		}
	}
}

var preloadFlag = false;

function loadImages() 
{
	if (document.images) 
	{
		animate_01_out = newImage("home.gif");
		preloadFlag = true;
	}
}
function goBack()
{
	location.href ="services.htm"
	
}

function stripBlanks(Source)
{
 	var newString;
	var i;
	var j;
	var blank;
	blank = " ";
	newString = "";
	aString = Source;	
	for (i=0; i<aString.length; i++)
	{ 
		if (aString.charAt(i) != blank && aString.charCodeAt(i)!= 13 && aString.charCodeAt(i) != 10 )
		{
			break;
		}
	}
	for (j=aString.length-1; j>=0; j--)
	{
		if (aString.charAt(j) != blank   && aString.charCodeAt(j)!= 13 && aString.charCodeAt(j) != 10 )
		{
				break;
		}
	}
	for(k=i;k<=j;k++)
	{
		newString += aString.charAt(k);
	}	
	return newString;	
}


function NameCheck(Field)
{
	var strTmp = Field.value;  	
	
	var valid = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz " ;
	var temp;
	for (var i=0; i<strTmp.length; i++)
	{
		temp = ""+ strTmp.substring(i, i+1);
				
		if (valid.indexOf(temp) == -1) 
		{
			return false;
			break;
		}
	}
	return true;   	
}


function emailCheck(email)
{
	var intI=1;
	var intCounter=0;
	strEmail=email.value;
	var strEmailLength = strEmail.length;
	var check =1;
	 if (email.value == '')	
	 {
	 	alert('Please enter an E-mail ID.');
	 	email.focus();
	 	check = 0; 
	 	return check;
	 }
	 // look for @
	 while ((intI < strEmailLength) && (strEmail.charAt(intI) != "@"))
	 { intI++ }
	 if ((intI >= strEmailLength) || (strEmail.charAt(intI) != "@"))
	 {
	 	//alert('E-mail ID should be of the form - name@company.com or name@company.co.country. Please try again.');
	 //	email.focus();
	 	check = 0; 
	 	return check;
	 }
	 else intI += 2;
    // look for .
    while ((intI < strEmailLength) && (strEmail.charAt(intI) != "."))
	{ intI++     }
	// there must be at least one character after the .
    diff=strEmailLength - intI;
	if ((intI >= strEmailLength - 1) || (strEmail.charAt(intI) != ".")) 
	{
	   // alert('E-mail ID should be of the form - name@company.com or name@company.co.country. Please try again.');
    	//email.focus();
	    check = 0; 
		return check;
	}
	var valid1='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@._0123456789-';
    var temp1;
	var fieldx=email.value;
	for (var intI=0; intI <fieldx.length; intI++) 
	{
		temp1 = "" + fieldx.substring(intI, intI+1);
	    if(temp1 == "@")
		{
			intCounter=intCounter+1;
		}
		if (valid1.indexOf(temp1) == "-1")
		{
		//	alert("E-mail ID should be of the form - name@company.com or name@company.co.country. Please try again.");
		//	email.focus();
			check = 0; 
	 		return check;
		}
	}
	var strSourceField = email.value;
	var blnNumCheckStatus = true;
	var intDectot  = 0;
	var intDecpos  = 0;
	var strValidchars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@._0123456789-";
	for(var intDecCount=0; intDecCount<strSourceField.length;intDecCount++) 
	{
		if(strSourceField.charAt(intDecCount)=='@') 
		{
			intDectot++;
			intDecpos = (intDecCount+1);
		}
		if (intDectot>1)
		{
			blnNumCheckStatus = false;
		}
	}
	if(blnNumCheckStatus==false)
	{
		//alert("E-mail ID should be of the form - name@company.com or name@company.co.country. Please try again.");
		//email.focus();
		return blnNumCheckStatus;
	}
	if ((email.value.length < 6) || (email.value.length > 80))
	{
		//alert("E-mail ID should be of the form - name@company.com or name@company.co.country. Please try again.");
		//email.focus();
		check = 0; 
	 //	return check;
	}
	var invalid = " "; // Invalid character is a space
	if (email.value.indexOf(invalid) > -1) 
	{
	//	alert("E-mail ID should be of the form - name@company.com or name@company.co.country. Please try again.");
	//	email.focus();
		check = 0; 
		return check;
	}
	var strSourceField = email.value;
	var blnNumCheckStatus = true;
	var intDectot  = 0;
	var intDecpos  = 0;
	var strValidchars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@._0123456789-";
	for(var intDecCount=0; intDecCount<strSourceField.length;intDecCount++) 
	{
		if(strSourceField.charAt(intDecCount)=='@') 
		{
			intDectot++;
			intDecpos = (intDecCount+1);
		}
		if (intDectot>1)
		{
			blnNumCheckStatus = false;
		}
	}
	if(blnNumCheckStatus==false)
	{
		//alert("E-mail ID should be of the form - name@company.com or name@company.co.country. Please try again. ");
		//email.focus();
		return blnNumCheckStatus;
	}
	
	return check;
}

function PhoneFaxNumberCheck(Field)
{
	
	var strTmp = Field.value;
	
	var valid = "0123456789().&- \n" ;
	var ok = "yes";
	var temp;
	for (var i=0; i<strTmp.length; i++)
	{
		temp = ""+ strTmp.substring(i, i+1);
				
		if (valid.indexOf(temp) == -1) 
		{
			ok = "no";
			break;
		}
	}
	if (ok == "no")
	{  
	//	alert("Please enter only alphabetic characters, numbers, space, ampersand and hyphen.");
	//	Field.focus();	
		//Field.select();
		return false;
	}	
	return true;
}

//-------------------------- nonverba nonverba.js scripts ends   -------------------------------------------
function calldeployment(url)
{
		winStatus=window.open(url,'mypopup','toolbars=0,menubars=0,scrollbars=1,width=600,height=400,left=140,top=90');
		if(winStatus!=null && winStatus)
        {
            winStatus.focus();
        }		
}
function callViewProductScreenshots(url)
{
		winStatus=window.open(url,'mypopup','toolbars=0,menubars=0,scrollbars=1,width=800,height=650,left=140,top=25');
		if(winStatus!=null && winStatus)
        {
            winStatus.focus();
        }	   
}
function callCarouseleSecurus(url)
{
		winStatus=window.open(url,'mypopup','toolbars=0,menubars=0,scrollbars=0,width=800,height=620,left=130,top=50');
		if(winStatus!=null && winStatus)
        {
            winStatus.focus();
        }	   
}
function callCarouseleOperandi(url)
{
		winStatus=window.open(url,'mypopup','toolbars=0,menubars=0,scrollbars=0,width=1010,height=640,left=0,top=50');
		if(winStatus!=null && winStatus)
        {
            winStatus.focus();
        }	   
}
function callViewDemo(url)
{
		winStatus=window.open(url,'mypopup','toolbars=0,menubars=0,scrollbars=1,width=800,height=650,left=140,top=25');
		if(winStatus!=null && winStatus)
        {
            winStatus.focus();
        }	   
}
function callinfinityModel(url)
{
		winStatus=window.open(url,'mypopup','toolbars=0,menubars=0,scrollbars=1,width=630,height=475,left=140,top=90');
		if(winStatus!=null && winStatus)
        {
            winStatus.focus();
        }	   
}
function callInteractModel(url)
{
		winStatus=window.open(url,'mypopup','toolbars=0,menubars=0,scrollbars=1,width=700,height=680,left=140,top=20');
		if(winStatus!=null && winStatus)
        {
            winStatus.focus();
        }	   
}
function callMagazine(MagazinePic) {
	html = "<HTML><HEAD><TITLE>NonVerba - Actions, Not Words!</TITLE>" +
    "</HEAD><BODY LEFTMARGIN=0 " +
    "MARGINWIDTH=0 TOPMARGIN=0 MARGINHEIGHT=0><CENTER>" +
    "<IMG SRC='" + MagazinePic + "' BORDER=0 NAME=image " +
    "onload='window.resizeTo(document.image.width,document.image.height)'></CENTER></BODY></HTML>";
	popup=window.open('','image','toolbar=0,location=0,directories=0,menuBar=0,scrollbars=0,resizable=1,top=50,left=50');
	popup.document.open();
	popup.document.write(html);
	popup.document.close()
 };
function CallCancel()
{
	document.location.href = 'Home.htm';
}
function CallIndex()
{
	document.location.href = 'Home.htm';
}
function addbookmark(){
if (document.all)
window.external.AddFavorite(self.location.href,"NonVerba - Actions, Not Words!")
}
function CallDeploymentOptions()
{
//window.open('nvasp.htm','sample','toolbar=no,width=525,height=250,left=200,top=200, status=no,scrollbars=no,resize=no');
	window.open('deploymentOptions.htm','deployment','toolbars=0,menubars=0,scrollbars=1,width=500,height=425,left=300,top=150');
}

//Factsheet Htm files popup start here

function callFactSheet(url)
{
		window.open(url,'mypopup','toolbars=0,menubars=0,scrollbars=1,width=666,height=500,left=140,top=90');
}

//Contact Us Map Htm files popup start here

function callLocationMaps(url)
{
		window.open(url,'callmaps','toolbars=0,menubars=0,scrollbars=1,width=516,height=286,left=140,top=90');
}

//expo flyer Htm file popup start here

function callExpoFlyer(url)
{
		window.open(url,'mypopup','toolbars=0,menubars=0,scrollbars=1,width=630,height=400,left=140,top=90');
}
///////////////////////////////////////////////// Click to activate Flash ///////////////////////
 
window.onload = fixClickMeObjProblem;
function fixClickMeObjProblem() {
 //Fix Eolas' patent ('Click to activate and use this control' problem in Opera/IE)
 var htmlObjects = document.getElementsByTagName("object");
 for (i = 0; i < htmlObjects.length; i++) {
  htmlObjects[i].outerHTML += "";
 }
}



////////////////////////////////////////////////////////////////////////////////////////////////////////

