/************************************************************
 General Utility Functions
************************************************************/
function IsNull(AValue){ // Is the variant null
	if( typeof(AValue) == "undefined" || AValue == null){
		return(true);
	}else{
		return(false);
	}
}	 
//***********************************************************
function IsEmpty(AValue){ // Is the variant empty
	if(AValue.length == 0){
		return(true);
	}else{
		return(false);
	} 
}
//***********************************************************
function IsObject(AValue){ // Is the variant an Object
	if(typeof(AValue)=="object"){
		return(true);
	}else{
		return(false);
	}
}
//***********************************************************
function IsBlank(AValue){ // Is the variant Blank or Empty or Null

	if(IsNull(AValue)){
		return(true);
	}
	if(IsObject(AValue)){
		return(true);
	}
	if(IsEmpty(AValue)){
		return(true);
	}

	if(Trim(AValue)==""){
		return(true);
	}

	return(false);
}
//***********************************************************
function iif(bValue, AWhenTrue, AWhenFalse){ //Immediate if
	if(bValue == true){
		return(AWhenTrue);
	}else{
		return(AWhenFalse);
	}
}
//***********************************************************
function LTrim(AValue){ // Left Trim a string value
	var RetVal
	var i;
	var nLen;
	
	if(IsNull(AValue)){
		return("");
	}
	RetVal = AValue.toString();
	nLen= RetVal.length;
	i	= 0;
	while (i <= nLen){
		if(RetVal.charAt(i) == " "){
			i++;
		}else{
			break;
		}
	}
	if(i>0){
		return(RetVal.substr(i,nLen-i));
	}else{
		return(RetVal.toString());
	}
}
//***********************************************************
function RTrim(AValue){ // Right Trim a string value
	var RetVal; 
	var i;
	var nLen;
	
	if(IsNull(AValue)){
		return("");
	}
	RetVal = AValue.toString();
	nLen= RetVal.length;
	i	= nLen-1;
	while (i >= 0){
		if(RetVal.charAt(i) == " "){
			i--;
		}else{
			break;
		}
	}
	if(i>=0){
		return(RetVal.substr(0,i+1));
	}else{
		return("");
	}
}
//***********************************************************
function Trim(AValue){ //  Trim a string value
	return(LTrim(RTrim(AValue)));
}
//***********************************************************
function Left(AValue, nLeft){ // Left characters of a string
	var RetVal; 

	if(IsNull(AValue)){
		return("");
	}
	RetVal = AValue.toString();
	return(RetVal.substr(0,nLeft));
}
//***********************************************************
function Right(AValue, nRight){ // Right characters of a string
	var RetVal;
	
	if(IsNull(AValue)){
		return("");
	}
	RetVal = AValue.toString();
	return(RetVal.substr(RetVal.length-nRight,nRight));
}
//***********************************************************
function ToInt(AValue){ // Variant to Integer (eg £10.00 -> 10)
	var RetVal = 0;

	if(IsBlank(AValue)){
		return(0);
	}
	AValue = AValue.toString();
	AValue = AValue.replace("£","");
	AValue = AValue.replace(",","");
	AValue = AValue.replace(",","");
	
	RetVal = parseInt(AValue,10);
	if(RetVal!=RetVal){
		// it must be NaN
		return(0);
	}else{
		return(RetVal);
	}
}
//***********************************************************
function ToStr(AValue){ // Variant to String (eg £10.00 -> "£10.00")
	var RetVal = 0;

	if(IsBlank(AValue)){
		return("");
	}
	RetVal = AValue.toString();
	return(RetVal);
}
//***********************************************************
function ToIntNull(AValue){ // Variant to Integer (if not blank)
	return(iif(IsBlank(AValue), "", ToInt(AValue)));
}
//***********************************************************
function ToNum(AValue){ // Variant to numeric (eg £1,000.10 -> 1000.1)
	var RetVal = 0;

	if(IsBlank(AValue)){
		return(0);
	}
	
	AValue = AValue.toString();

	AValue = AValue.replace("£","");
	AValue = AValue.replace(",","");
	AValue = AValue.replace(",","");
	
	//alert(AValue);
	
	RetVal = parseFloat(AValue);
	
	if(RetVal!=RetVal){
		// it must be NaN
		return(0);
	}else{
		return(RetVal);
	}
}
//***********************************************************
function ToNumNull(AValue){ // Variant to numeric (if not blank)
	return(iif(IsBlank(AValue), "", ToNum(AValue)));
}
//***********************************************************
function ToNum4Display(AValue){ // Variant to numeric (eg £1,000.10 -> 1000.1)
	var RetVal = 0;
	
	AValue = ToNum(AValue);
	AValue = AValue.toString();

	//alert(AValue);

	//alert("Typeof " + typeof(AValue));

	if(typeof(AValue) == "string"){
		RetVal = AValue;
	}
	return(RetVal)
}
//***********************************************************
function ToNumNull4Display(AValue){ // Variant to numeric (if not blank)
	return(iif(IsBlank(AValue), "", ToNum4Display(AValue)));
}
//***********************************************************
function VToP(AValue){ // Variant to Percentage (eg 10 -> 10% or 10% -> 10%)
	var RetVal = 0;

	if(IsBlank(AValue)){
		return(0+'%');
	}

	AValue = AValue.toString();
	AValue = AValue.replace("%","");
	AValue = AValue.replace(",","");
	AValue = AValue.replace(",","");

	//alert("Before " +AValue);

	RetVal = parseFloat(AValue);

	//alert("After " + RetVal);

	
	if(RetVal!=RetVal){
		// it must be NaN
		return(0+'%');
	}else{
		// Now for German numbers replace the 
		// decimal with a comma
		return(ToNum4Display(RetVal)+'%');
	}
}
//***********************************************************
function VToPNull(AValue){ // Variant to Percentage (if not blank)
	return(iif(IsBlank(AValue), "", VToP(AValue)));
}
//***********************************************************
function PToD(AValue){ // Convert a percentage figure to the appropiate decimal value (eg 10% -> 0.1)
	var RetVal = 0;

	if(IsBlank(AValue)){
		return(0);
	}
	AValue = AValue.toString();
	AValue = AValue.replace("%","");


	AValue = AValue.replace(",","");
	AValue = AValue.replace(",","");

	RetVal = parseFloat(AValue);
	
	if(RetVal!=RetVal){
		// it must be NaN
		return(0);
	}else{
		return(RetVal/100);
	}
}
//***********************************************************
function DToP(AValue){ // Decimal to Percentage (eg 0.1 -> 10% + 10% -> 10%)
	var RetVal = 0;

	if(IsBlank(AValue)){
		return(0+'%');
	}
	AValue = AValue.toString();

	if(InStr(AValue,'%')>-1){
		return(VToP(AValue));
	}

	AValue = AValue.replace(",","");
	AValue = AValue.replace(",","");

	RetVal = parseFloat(AValue);
	
	if(RetVal!=RetVal){
		// it must be NaN
		return(0+'%');
	}else{
		return((RetVal*100)+'%');
	}
}

//***********************************************************
function DToPNull(AValue){ // // Decimal to Percentage (if not blank)
	return(iif(IsBlank(AValue), "", DToP(AValue)));
}
//***********************************************************
function InStr(ASearchString, AFindString){ // In String position
	var AValue;
	
	if(IsBlank(ASearchString)){
		return(-1);
	}
	AValue = ASearchString.toString()
	return(AValue.indexOf(AFindString));
}
//***********************************************************
function ToCur(AValue){ // Variant to Currency
	var RetVal = 0;
	var nDotPos;
	var nLen

	RetVal = ToNum(AValue);
	RetVal = Math.round(RetVal*100)/100;
	
	RetVal = RetVal.toString();
	nDotPos = InStr(RetVal,".");

	//alert(RetVal);
	
	if(nDotPos == -1){
		RetVal += ".00";
	}else{
		RetVal = Left(RetVal+"00", nDotPos+3);
	}
		
	RetVal = FormatCur4Display(RetVal, "£", ",", ".");


	return(RetVal);
}
//***********************************************************
// This function assumes the number being passed is in the following format
// nnnnnnnnn.nn and will produce £nnn,nnn,nnn.nn
function FormatCur4Display(AValue, sCurrencyChar, sThousandChar, sDecimalChar){
	var i;
	var nLen;
	var AString;
	var sRetVal;
	var sRebuild
	var sMinus
	
	AString = AValue.toString();
	AString = AString.replace(".", sDecimalChar);

	// Now remove minus if used. And store in special var
	if(Left(AString,1) == '-'){
		sMinus = '-';
	}else{
		sMinus = ''; 
	}

	nLen = AString.length;
	// Now if the Minus sign is used then remove it
	if(sMinus=='-'){
		AString = Right(AString,nLen-1);
		nLen = AString.length;
	}

	sRetVal = Right(AString, 3);
	sReBuild = Right(AString, 3);
	
	i = nLen-3;
	while(i>0){
		if(sReBuild.length == 6 || sReBuild.length == 9 || sReBuild.length == 12){
			sRetVal = sThousandChar + sRetVal;
		}
		i--;
		sRetVal = AString.charAt(i) + sRetVal;
		sReBuild = AString.charAt(i) + sReBuild;
	}
	
	return(sMinus + sCurrencyChar + sRetVal);
}

//***********************************************************
function ToCurNull(AValue){ // Variant to Currency (if not blank)
	return(iif(IsBlank(AValue), "", ToCur(AValue)));
}
//***********************************************************
function ToDate(ADate){ // Variant to Date (eg dd/mm/yy -> dd-mmm-yyyy)
	var aDates;
	var i;
	var TestDate;
	var IsValid;
	var RetVal;
	
	if(IsBlank(ADate)){
		return("");
	}

	ADate = Trim(ADate);
	// Split it into parts first
	if(InStr(ADate,"-") >= 0){
		aDates = ADate.split("-");
	}else if(InStr(ADate,"/") >= 0){
		aDates = ADate.split("/");
	}else if(InStr(ADate," ") >= 0){
		aDates = ADate.split(" ");
	}else if(InStr(ADate,".") >= 0){
		aDates = ADate.split(".");
	}else{
		return("");
	}
	
	//if incorrect number of parts zero it
	if(aDates.length != 3){
		return("");
	} 	
	aDates[0] = ToInt(aDates[0])
	aDates[1] = ToMonth(aDates[1]);
	aDates[2] = ToYear(aDates[2]);
	
	if(IsBlank(aDates[1]) || IsBlank(aDates[2]) || aDates[0]==0){
		RetVal = "";
	}else{
		// Test the date is a real date correct
		TestDate = new Date(aDates[2],ToMonthNum(aDates[1])-1, aDates[0]);
		if(TestDate.getFullYear() == aDates[2] && 
			TestDate.getMonth() == (ToMonthNum(aDates[1])-1) &&
			TestDate.getDate() == aDates[0]){
			RetVal = iif(aDates[0]<=9, "0"+aDates[0], aDates[0]) + "-" + aDates[1] + "-" + aDates[2];
		}else{
			RetVal = "";
		}
	}
	
	return(RetVal);

}
//***********************************************************
function ToTime(sTime){ // Variant to Time (eg hh:mm (or h:m) -> hh:mm)
	var aTime;
	var nHours;
	var sHours;
	var nMinutes;
	var sMinutes;
	var nAddHours;
	
	sTime = LTrim(ToStr(sTime))
	if(IsBlank(sTime)){
		return("00:00");
	}

	if(InStr(sTime, "pm") > 0){
		sTime = sTime.replace("pm", "");
		sTime = sTime.replace("PM", "");
		sTime = sTime.replace("pM", "");
		sTime = sTime.replace("Pm", "");
		nAddHours = 12;
	}else{
		nAddHours = 0
	}

	// first split the time into hh and mm. We expect a : to do this
	sTime = Trim(sTime);
	aTime = sTime.split(":");
	
	// Extract Hours
	nHours = ToInt(aTime[0]) + ToInt(nAddHours);

	// Extract Minutes
	if(aTime.length == 1){
		nMinutes = 0;
	}else{
		nMinutes = ToInt(aTime[1]);
	}
	
	// if outside acceptable range reset		
	if(nHours >= 24){
		nHours = 0;
	}
	
	// if outside acceptable range reset
	if(nMinutes >= 60){
		nMinutes = 0;
	}		

	if(nHours < 10){
		sHours = "0"+nHours;
	}else{
		sHours = ToStr(nHours);
	}
	
	if(nMinutes < 10){
		sMinutes = "0"+ToStr(nMinutes);
	}else{
		sMinutes = ToStr(nMinutes);
	}

	return(sHours + ":" + sMinutes);
}

//***********************************************************
function ToDateTime(sDateTime){ // Variant to Date and Time (eg dd/mm/yy hh:mm -> dd-mmm-yyyy hh:mm)
	var aDates;
	var aDateTime;
	var i;
	var TestDate;
	var IsValid;
	var sDate;
	var sTime;
	
	if(IsBlank(sDateTime)){
		return("");
	}
	// first split the date time in Time and Date. We expect a space to do this
	sDateTime = Trim(sDateTime);

	aDateTime = sDateTime.split(" ");
	
	if(aDateTime.length > 3){
		return("");
	}else if (aDateTime.length == 1){
		sDate = ToDate(aDateTime[0])
		if(IsBlank(sDate)){
			return("");
		}else{ 
			return(sDate + " 00:00");
		}
	}

	sDate = ToDate(aDateTime[0])
	if(IsBlank(sDate)){
		return("");
	} 

	if(aDateTime.length > 2){
		sTime = ToTime(aDateTime[1]+aDateTime[2]);
	}else{
		sTime = ToTime(aDateTime[1]);
	}
	
	return(sDate + " " + sTime);
}
//***********************************************************
function ValidDate(ADate){ // Checks if date string is valid (accepts blanks)
	var ATest;
	
	ATest = ToDate(ADate);
	if(IsBlank(ATest)){
		return false;
	}else{
		return true;
	}
}

//***********************************************************
function ToYear(sYear){ // Internal function
	var nYear;
	
	nYear = ToInt(sYear);
	if(nYear >= 00 && nYear <= 30){
		nYear += 2000;  
	}else if(nYear>30 && nYear<=99){
		nYear += 1900;
	}else if(nYear < 1900 || nYear > 2100){
		return("");
	} 
	return(nYear.toString());
}
//***********************************************************
function ToMonth(sMonth){ // Internal function
	var aMonths = new Array(12);
	var nMonth;
	var sRetVal = "";
	
	
	aMonths[0] = "Jan";
	aMonths[1] = "Feb";
	aMonths[2] = "Mar";
	aMonths[3] = "Apr";
	aMonths[4] = "May";
	aMonths[5] = "Jun";
	aMonths[6] = "Jul";
	aMonths[7] = "Aug";
	aMonths[8] = "Sep";
	aMonths[9] = "Oct";
	aMonths[10]= "Nov";
	aMonths[11]= "Dec";

	nMonth = ToInt(sMonth);
	if(nMonth == 0){
		for(i=0;i<=11;i++){
			if(sMonth.toUpperCase()==aMonths[i].toUpperCase()){
				sRetVal = aMonths[i];
				break;
			}
		}
	}else if(nMonth >= 1 && nMonth <= 12){
		sRetVal = aMonths[nMonth-1];
	}
	return(sRetVal)
}
//***********************************************************
function ToMonthNum(sMonth){ // Internal function
	var aMonths = new Array(12);
	var nMonth;
	var nRetVal = 0;
	

	aMonths[0] = "Jan";
	aMonths[1] = "Feb";
	aMonths[2] = "Mar";
	aMonths[3] = "Apr";
	aMonths[4] = "May";
	aMonths[5] = "Jun";
	aMonths[6] = "Jul";
	aMonths[7] = "Aug";
	aMonths[8] = "Sep";
	aMonths[9] = "Oct";
	aMonths[10]= "Nov";
	aMonths[11]= "Dec";

	nMonth = ToInt(sMonth);
	if(nMonth == 0){
		for(i=0;i<=11;i++){
			if(sMonth.toUpperCase()==aMonths[i].toUpperCase()){
				nRetVal = i+1;
				break;
			}
		}
	}else if(nMonth >= 1 && nMonth <= 12){
		nRetVal = nMonth;
	}
	return(nRetVal)
}
//***********************************************************
function UpperCase(AValue){ // Converts a string to uppercase
	
	if(IsBlank(AValue)){
		return("");
	}else{
		return(AValue.toUpperCase());
	}
}
//***********************************************************
function LowerCase(AValue){ // Converts a string to lowercase

	if(IsBlank(AValue)){
		return("");
	}else{
		return(AValue.toLowerCase());
	}
}
//***********************************************************
function GetSelectedValue(selList){ // Returns the selected value from a SELECT tag
	return(selList.options[selList.selectedIndex].value);
}

//************************************************************
// Functions for deleting records
//************************************************************
function imgDel_mouseover(img) { // MouseOver event
	img.src = "../images/butDelOn.gif";
}
function imgDel_mouseout(img) { // MouseOut event
	img.src = "../images/butDelOff.gif";
}
function imgDel_delete(sMessage) { // Message box for Delete
	if(confirm(sMessage)){
		return(true)
	}else{
		return(false)
	}
}
/************************************************************
 Functions for displaying and hiding areas on a page
************************************************************/
function CloseOpenSection(div, img) {
	if(div.style.display == "none"){
		div.style.display = "block";
		img.src = "../images/NavMinus.gif";
	}else{
		div.style.display = "none";
		img.src = "../images/NavPlus.gif";
	}
	return(false);
}
/************************************************************/
function CloseOpenOverlay(span, img, td) {
	if(span.style.display == "none"){
		span.style.display = "block";
		td.title = "Click here to Close";
	}else{
		span.style.display = "none";
		td.title = "Click here to Open";
	}
	return(false);
}
/************************************************************
 Functions for displaying and displaying and validing number of 
 pages
************************************************************/
function SetPageSize(nSize) {
	nSize = ToInt(nSize);
	if (nSize <= 0){
		nSize = 20;
	} else {
		if(nSize > 100){
			nSize = 100;
		}
	};
	return(nSize);
}
/************************************************************
 Functions for loading a page from the client side
************************************************************/
function LoadPage(sAddress) {
	window.location.href = sAddress;
}
/************************************************************
 Functions to Support Spin Boxes
************************************************************/
function SpinIncrement(sControl, nMax) {
	var nNext;
	
	nNext = ToInt(document.all(sControl).value)+1;
	
	if(ToInt(nNext) > ToInt(nMax)){
		nNext = ToInt(nMax);
	}
	document.all(sControl).value = ToInt(nNext)
}
/************************************************************/
function SpinDecrement(sControl, nMin) {
	var nPrev;
	
	nPrev = ToInt(document.all(sControl).value)-1;
	
	if(ToInt(nPrev) < ToInt(nMin)){
			nPrev = ToInt(nMin);
	}
	document.all(sControl).value = ToInt(nPrev)
}
/************************************************************/
function SpinChangeValue(sControl, nNew, nMin, nMax){
	var 
	
	nNew = ToInt(nNew);
	if(nNew < nMin){
		nNew = ToInt(nMin);
	}
	if(nNew>nMax){
		nNew = ToInt(nMax);
	}
	document.all(sControl).value = ToInt(nNew)
}
/************************************************************/
function CollectionLen(oColl){
	var nLen = oColl.length;
	var nRetVal;
	
	if(IsBlank(nLen)){
		nRetVal = 1;
	}else{
		nRetVal = nLen;
	}
	return nRetVal;
}
/************************************************************/
function CollectionValue(oColl,i){
	var RetVal;
	
	if(CollectionLen(oColl) == 1){
		if(i == 0){
			RetVal = oColl.value;
		}else{
			RetVal = "";
		}
	}else{
		RetVal = oColl[i].value;
	}
	return RetVal;
}
/************************************************************/
function SetCollectionValue(oColl,i, NewValue){
	
	if(CollectionLen(oColl) == 1){
		if(i == 0){
			oColl.value = NewValue;
		}
	}else{
		oColl[i].value = NewValue;
	}
}
/************************************************************
 Functions for Causing Program delays will accept seconds and 
 points of seconds
************************************************************/
function WaitFor(nSecs) {
	var oOrigDate;
	var nOrigSec;
	var oNextDate;
	var nNextSec;

	// Record Original Time
	oOrigDate = new Date();
	nOrigSec = (oOrigDate.getHours() * 24 * 60) + 
		(oOrigDate.getMinutes() * 60) + oOrigDate.getSeconds() +
		(oOrigDate.getMilliseconds() * 0.001);

	// Repeat this loop until the elasped time has been reached or
	// exceeded
	while(true){
		
		oNextDate = new Date();
		nNextSec = (oNextDate.getHours() * 24 * 60) + 
		(oNextDate.getMinutes() * 60) + oNextDate.getSeconds() +
		(oNextDate.getMilliseconds() * 0.001);

		//alert(nNextSec);

		if(nNextSec >= nOrigSec + nSecs){
			break;
		}
	}
		
	return true;
}
/************************************************************
 Functions to Support Ordering Select Lists
************************************************************/
function xMoveSelectedItemsUp(oSel){
	var i;
	var oOpt;
	
	for(i=0; i<=oSel.options.length-1; i++){
		if(oSel.options[i].selected == true){
			if(i==0){
				break;
			}else{
				oOpt = oSel.options.item(i);
				oSel.remove(i);
				oSel.options.add(oOpt, i-1);
			}
		}
	}
}
/************************************************************/
function xMoveSelectedItemsDown(oSel){
	var i;
	var oOpt;

	for(i=oSel.options.length-1; i>=0; i--){
		if(oSel.options[i].selected == true){
			if(i==oSel.options.length-1){
				break;
			}else{
				oOpt = oSel.options.item(i);
				oSel.remove(i);
				oSel.options.add(oOpt, i+1);
			}
		}
	}
}

/************************************************************
The following functions are used in conjunction with the 
systemlist popup search.

************************************************************/
function ClearPopUpField(sName){
	var sDisplayFieldName = "PopUpDisplay" + sName;

	//alert(sName);
	//alert(sDisplayFieldName);
	
	window.document.getElementById(sDisplayFieldName).innerHTML = "&nbsp;";
	window.document.getElementById(sName).value = "";

}
/************************************************************/
function CreatePopUpSelectionWindow(sName, nAttributeID, nHeight, nWidth){
	var sDisplayFieldName = "PopUpDisplay" + sName;
	var leftPos = (screen.availWidth-nWidth) / 2;
	var topPos = (screen.availHeight-nHeight) / 2; 
	var charWin;
	
	charWin = window.open('../Utils/PopupSystemList.asp?Name='+sName+'&AttributeID='+nAttributeID,'','width=' + nWidth + ',height=' + nHeight + ',scrollbars=no,resizable=yes,titlebar=0,top=' + topPos + ',left=' + leftPos);

}
/************************************************************/
//function PopUpSelectRecord(nAttributeID, nGenID, aValues){
//	var sName = "_L" + nAttributeID;
//	var sDisplayFieldName = "PopUpDisplay" + sName;
//	var sValue;
//	var i;
//
//	window.opener.document.getElementById(sName).value = nGenID; 
//	
//	sValue = "";
//	for(i=0; i< aValues.length; i++){
//		sValue = sValue + aValues[i] + "<BR>";
//	}
//	window.opener.document.getElementById(sDisplayFieldName).innerHTML = sValue;
//	window.close();
//}
/************************************************************/
function PopUpSelectRecord(sName, nGenID, aValues){
	//var sName = "_L" + nAttributeID;
	var sDisplayFieldName = "PopUpDisplay" + sName;
	var sValue;
	var i;

	window.opener.document.getElementById(sName).value = nGenID; 
	
	sValue = "";
	for(i=0; i< aValues.length; i++){
		sValue = sValue + aValues[i] + "<BR>";
	}
	window.opener.document.getElementById(sDisplayFieldName).innerHTML = sValue;
	window.close();
}

/************************************************************
 Functions for linking to MultiMap
************************************************************/
function MultiMap_Display(sPostcode) {
	var oNewWindow;
	var sLink;
	
	if(IsBlank(sPostcode)){
		alert('No postcode specified');
		return false;
	}
	
	sLink = 'http://www.multimap.com/map/browse.cgi?pc=' + sPostcode +'&scale=10000'
	oNewWindow = window.open(sLink,'MultiMap',
		'left=5,height=600,width=800,resizable=yes,status=yes,toolbar=yes,menubar=yes,location=yes,scrollbars=yes');
	
	// Wait for 1/10 of a second
	WaitFor(0.2);
	oNewWindow.focus();
	return false;
}
/************************************************************/
function MultiMap_DisplayFar(sPostcode) {
	var oNewWindow;
	var sLink;
	
	if(IsBlank(sPostcode)){
		alert('No postcode specified');
		return false;
	}
	
	sLink = 'http://www.multimap.com/map/browse.cgi?pc=' + sPostcode +'&scale=100000'
	oNewWindow = window.open(sLink,'MultiMap',
		'left=5,height=400,width=750,resizable=yes,status=yes,toolbar=yes,menubar=yes,location=yes,scrollbars=yes');
	
	// Wait for 1/10 of a second
	WaitFor(0.2);
	oNewWindow.focus();
	return false;
}
/************************************************************
 H and S link
************************************************************/
function OpenHealthAndSafetyLink() {
	var oNewWindow;
	var sLink;
	
	sLink = '../Utils/procCommand.asp?Command=HSLink';
	oNewWindow = window.open(sLink,'NHFHandS',
		'height=450,width=800,status=no,toolbar=yes,menubar=no,location=no,resizable=yes,scrollbars=yes');
	
	// Wait for 1/10 of a second
	WaitFor(0.2);
	oNewWindow.focus();
	return false;
}


