	// Start JavaScript Document
	//--------------------------------
	
	function GetControlByName(controlName)
	{
		//return GetControlsByMatchedName(controlName);
		totalForms = document.forms.length;
		for(x = 0 ; x < totalForms; x++)
		{
			control = eval("document.forms[" + x + "]." + controlName);
			if(control)
			{
				break;
			}
		}
		return control;
	}
	
	//-------------------------------------
	
	function GetControlsByMatchedName(matchedName)
	{
		matchedControls = new Array();
		myForm = document.forms[0];
		totalControls = myForm.elements.length;
		counter = 0;
		for(i = 0; i < totalControls; i++)
		{
			if(myForm.elements[i].name)
			{
				if(myForm.elements[i].name.indexOf(matchedName) != -1)
				{
					matchedControls[counter] = myForm.elements[i];
					counter++;
				}
			}
		}
		return matchedControls;
	}	
	
	//------------------------------------
	
	function SetFocus(controlName)
	{
		control = GetControlByName(controlName);
		if(control.type)
		{
			if(control.type == "text" || control.type == "password")
			{
				control.select();
				control.focus();
			}
			else
			{
				control.focus();
			}
		}
		
		else if(control.length)
		{
			control[0].focus();
		}
	}	
	
	//------------------------------------
	
	function GetDropDownListValue(control)
	{
		return control.options[control.selectedIndex].value;
	}
	
	//-----------------------------------
	
	function SetDropDownListValue(control, value)
	{
		totalOptions = control.options.length;
		for(i = 0; i < totalOptions; i++)
		{
			if(control.options[i].value == value)
			{
				control.options.selectedIndex = i;
				return;
			}
		}
	}
	
	//--------------------------------
	
	function GetRadioButtonValue(control)
	{	
		totalOptions = control.length;		
		for(i = 0; i < totalOptions; i++)
		{
			if(control[i].checked)
			{
				return control[i].value;
			}
		}		
	}	
	//------------------------------
	
	function SetRadioButtonValue(control, value)
	{
		totalOptions = control.length;
		for(i = 0; i < totalOptions; i++)
		{
			if(control[i].value == value)
			{
				control[i].checked = true;
				return;
			}
		}
	}
	
	//-----------------------------
	
	function SetCheckBoxValue(control, value)
	{		
		if(value == 1)
		{
			control.checked = true;
			return;
		}		
	}
	
	//------------------------------------
	
	function GetValue(controlName)
	{
		control = GetControlByName(controlName);
		if(control.type)
		{
			if(control.type == "text" || control.type == "password" || control.type == "hidden" || control.type == "textarea")
			{
				return control.value;
			}
			else if(control.type == "select-one")
			{
				return GetDropDownListValue(control);
			}
			else if(control.type == "radio")
			{
				return GetRadioButtonValue(control);
			}
		}
		
		if (control.length)
		{
			if(control.length > 0)
			{
				if (control[0].type == "radio")
				{
					return GetRadioButtonValue(control);
				}
			}
		}
	}
	
	//-------------------------------------
	
	function SetValue(controlName, value)
	{
		control = GetControlByName(controlName);
		if(!control.length)
		{
			if(control.type){
				if(control.type == "text" || control.type == "password" || control.type == "hidden" || control.type == "textarea")
				{
					control.value = value;
				}
				else if(control.type == "select-one")
				{
					SetDropDownListValue(control,value);
				}
				else if(control.type == "radio")
				{
					SetRadioButtonValue(control,value);
				}
				else if(control.type == "checkbox")
				{
					SetCheckBoxValue(control,value);
				}
			}
		}
		else
		{
			if(control.length > 0)
			{
				if(control[0].type == "radio")
				{
					SetRadioButtonValue(control,value);
				}
				else if(control.type == "select-one")
				{
					SetDropDownListValue(control,value);
				}
			}
		}	
	}
	
	//------------------------------------
	
	function IsEmpty(controlName)
	{
		if(GetValue(controlName) == "")
		{
			return true;
		}
		else
		{
			return false;
		}
	}
	
	//------------------------------------
	
	function IsNumber(ctlValue)
	{
		number = "0123456789";
		ln = ctlValue.length;
		for(i = 0; i < ln; i++)
		{
			singleChar = ctlValue.charAt(i);
			pos = number.indexOf(singleChar);
			if(pos == -1)
			{
				return false;
			}
		}
		return true;
	}
	
	//------------------------------------
	
	function IsNumeric(value)
	{
		return !isNaN(value);
	}
	
	//--------------------------------
	function CheckAll(matchName)
	{
		controls = GetControlsByMatchedName(matchName);		
		if(controls.length && controls.length > 0)
		{
			totalControls = controls.length;
			for(i = 0;i < totalControls; i++)
			{
				control = controls[i];
				if(control.type = "checkbox")
				{
					control.checked = true;
				}
			}
		}
	}
	
	//-------------------------------
	
	function UnCheckAll(matchName)
	{
		controls = GetControlsByMatchedName(matchName);
		if(controls.length && controls.length > 0)
		{
			totalControls = controls.length;
			for(i = 0;i < totalControls; i++)
			{
				control = controls[i];
				if(control.type = "checkbox")
				{
					control.checked = false;
				}
			}
		}
	}
	
	//--------------------------------
	
	function IsAllChecked(matchName)
	{
		controls = GetControlsByMatchedName(matchName);
		if(controls.length && controls.length > 0)
		{
			totalControls = controls.length;
			for(i = 0;i < totalControls; i++)
			{
				control = controls[i];
				if(control.type = "checkbox" && control.checked == false)
				{
					return false;
				}
			}
		}
		return true;
	}
	
	//--------------------------------
	
	function ValidateEmptyValue(controlNameList, messageList)
	{
		if(controlNameList.length)
		{
			totalControls = controlNameList.length;
			for(i = 0;i < totalControls; i++)
			{
				if(GetValue(controlNameList[i]) == ""){
					alert(messageList[i]);
					SetFocus(controlNameList[i]);
					return false;
				}
			}
		}
		else
		{
			if(GetValue(controlNameList) == "")
			{
				alert(messageList);
				SetFocus(controlNameList);
				return false;
			}
		}
		return true;
	}
	
	
	//--------Rajibul------------------------
	
	function ValidateEmptyValueMessage(controlNameList, messageList,divid)
	{
		var flag;
		if(controlNameList.length)
		{
			totalControls = controlNameList.length;
			document.getElementById(divid).innerHTML = "<div align='center'><a href='javascript:void(0)' onclick=\"document.getElementById('"+divid+"').style.display='none';hideModal('modalPage');\">Close</a><br />&nbsp;<br /></div>";
			document.getElementById(divid).innerHTML +="<font size='+1' color='#333366' style='text-align:left'>Please correct the following errors :</font> <br />&nbsp;<br />";
			for(i = 0;i < totalControls; i++)
			{
				if(GetValue(controlNameList[i]) == ""){
					document.getElementById(divid).style.display = "block";
					revealModal('modalPage');
					document.getElementById(divid).innerHTML += "**  "+messageList[i]+"<br />&nbsp;<br />";
					SetFocus(controlNameList[i]);
					flag=1;
				}
			}
			if(flag==1)
			{
				document.getElementById(divid).innerHTML += "<br /><br /><a href='javascript:void(0)' onclick=\"document.getElementById('"+divid+"').style.display='none';hideModal('modalPage');\">Close</a><br />&nbsp;<br />";
				flag=0;
				return false;
			}
		}
		else
		{
			if(GetValue(controlNameList) == "")
			{
				revealModal('modalPage');
				document.getElementById(divid).innerHTML = "<div align='center'><a href='javascript:void(0)' onclick=\"document.getElementById('"+divid+"').style.display='none';hideModal('modalPage');\">Close</a><br />&nbsp;<br /></div>";
				document.getElementById(divid).innerHTML += "**  "+messageList;
				SetFocus(controlNameList);
				document.getElementById(divid).innerHTML += "<br /><br /><a href='javascript:void(0)' onclick=\"document.getElementById('"+divid+"').style.display='none';hideModal('modalPage');\">Close</a><br />&nbsp;<br />";
				return false;
			}
		}
		return true;
	}
	function ValidateDropdownValueMessage(controlNameList, messageList,divid)
	{

		var validflag;
		if(controlNameList.length)
		{
			totalControls = controlNameList.length;
			document.getElementById(divid).innerHTML = "<div align='center'><a href='javascript:void(0)' onclick=\"document.getElementById('"+divid+"').style.display='none';hideModal('modalPage');\">Close</a><br />&nbsp;<br /></div>";
			document.getElementById(divid).innerHTML +="<font size='+1' color='#333366' style='text-align:left'>Please correct the following errors :</font> <br />&nbsp;<br />";
			for(i = 0;i < totalControls; i++)
			{
				if(document.getElementById(controlNameList[i]).selectedIndex == 0){
					document.getElementById(divid).style.display = "block";
					revealModal('modalPage');
					document.getElementById(divid).innerHTML += "**  "+messageList[i]+"<br />&nbsp;<br />";
					SetFocus(controlNameList[i]);
					validflag=1;
				}
			}
			if(validflag==1)
			{
				document.getElementById(divid).innerHTML += "<br /><br /><a href='javascript:void(0)' onclick=\"document.getElementById('"+divid+"').style.display='none';hideModal('modalPage');\">Close</a><br />&nbsp;<br />";
				validflag=0;
				return false;
			}
		}
		else
		{
			if(document.getElementById(controlNameList).selectedIndex == 0)
			{
				revealModal('modalPage');
				document.getElementById(divid).innerHTML = "<div align='center'><a href='javascript:void(0)' onclick=\"document.getElementById('"+divid+"').style.display='none';hideModal('modalPage');\">Close</a><br />&nbsp;<br /></div>";
				document.getElementById(divid).innerHTML += "**  "+messageList;
				SetFocus(controlNameList);
				document.getElementById(divid).innerHTML += "<br /><br /><a href='javascript:void(0)' onclick=\"document.getElementById('"+divid+"').style.display='none';hideModal('modalPage');\">Close</a><br />&nbsp;<br />";
				return false;
			}
		}
		return true;
	}
	
	//--------------------------------	
	
	function ConfirmLogout()
	{
		return confirm("Are you sure that you want to logout?");
	}
	
	function ConfirmDelete(itemType)
	{
		return confirm("Are you sure that you want to delete this " + itemType + "?");
	}
	
	//--------------------------------
	
	function DeleteFromList(itemType, controlName, value)
	{
		var confirmed = ConfirmDelete(itemType);
		if(confirmed)
		{
			SetValue(controlName, value);
			SubmitForm();
		}
	}
	//--------------------------------
	function IsDuplicateValue(firstControlName, secondControlName)
	{
		if(GetValue(firstControlName) == GetValue(secondControlName))
		{
			return true;
		}
		else
		{
			return false;
		}
	}
	
	function _IsValidEmail(str)
	{
		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		
		if (str.indexOf(at)==-1)
		{
		   return false
		}
		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr)
		{
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr)
		{
		    return false
		}
		if (str.indexOf(at,(lat+1))!=-1)
		{
		return false
		}
		if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot)
		{
		return false
		}
		
		if (str.indexOf(dot,(lat+2))==-1)
		{
		return false
		}
		
		if (str.indexOf(" ")!=-1)
		{
		return false
		}
		return true
	}
	
	//--------------------------------
	
	function IsValidEmail(targetName)
	{
		var chkemail = /^([a-zA-Z0-9_\.\-])+(\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4}))+$/;		
		var value = GetValue(targetName);		
		if(!chkemail.test(value))
		{
			 return false;
		}
		return true
	}
	
	//--------------------------------
	
	function IsValidNickName(control)
	{
		val = control.value;
		pattern=/[\ \\~\!\@\$\%\^\&\*\(\)\+\-\=\|\{\}\[\]\'\"\;\<\>\:\#\/\,\.\\]/;		
		res = pattern.test(val);
		if(res==true)
		{
			alert('Nickname cannot contain any of the following characters:\n\n ~   ! $ % \\ \' ^ & * @ ( ) + = | { } [ ] " ; < > : , . # /');
			control.focus();
			return false;
		}
	}	
	
	//--------------------------------
	
	function ValidateEmail(ctlName)
	{
		if(!IsValidEmail(ctlName))
		{
			alert("Invalid e-mail address! Please re-enter.");
			SetFocus(ctlName);
			return false;
		}
		else
		{
			return true;
		}
	}
	
	function IsValidFile(targetName, messagecontrol)
	{
		var value = GetValue(targetName);
		var fileparts = value.split(".");
		var position = validext.indexOf(fileparts[fileparts.length - 1]);
		if(position == -1)
		{
			var control = eval("document.getElementById('" + messagecontrol + "')");
			control.style.display = "Block"
			control.innerHTML = "This is not a valid format";
			document.getElementById('message').innerHTML = "<span class='ErrorMessage'>There was a problem with your upload. Please go back and try again</span>";
			return false;
		}
		return true;
	}

function ConfirmPassword(ctlPasswordName, ctlConfirmName)
	{
		if(!IsDuplicateValue(ctlPasswordName, ctlConfirmName))
		{
			alert("Please confirm your password again.");
			SetFocus(ctlConfirmName);
			return false;
		}
		else
		{
			return true;
		}
	}
	
	//--------------------------------
	
	function TransferAllOptions(from, to, startFrom)
	{
		ctlFrom = GetControlByName(from)
		ctlTo = GetControlByName(to)
		
		totalFrom = ctlFrom.options.length
		totalTo = ctlTo.options.length
		for(i = startFrom; i < totalFrom; i++)
		{
			opt = new Option(ctlFrom.options[startFrom].text,ctlFrom.options[startFrom].value);
			ctlTo.options[totalTo+(i-startFrom)] = opt;
			ctlFrom.options[startFrom] = null
		}
	}
	//--------------------------------
	function TransferSelectedOptions(from, to, startFrom)
	{
		ctlFrom = GetControlByName(from)
		ctlTo = GetControlByName(to)
		
		totalFrom = ctlFrom.options.length
		totalTo = ctlTo.options.length
		for(i = startFrom; i < ctlFrom.options.length; i++)
		{
			if (ctlFrom.options[i].selected)
			{
				opt = new Option(ctlFrom.options[i].text,ctlFrom.options[i].value);
				ctlTo.options[ctlTo.options.length] = opt;
				ctlFrom.options[i] = null
				i--;
			}
		}
	}
	
	//--------------------------------
	
	function SelectAllOptions(ctlName, startFrom)
	{
		ctl = GetControlByName(ctlName)
		total = ctl.options.length
		for(i = startFrom; i < total; i++)
		{
			ctl.options[i].selected = true;
		}
		for(i = 0 ; i < startFrom; i++)
		{
			ctl.options[i].selected = false;
		}
	}
	
	function SelectMultipleOptions_2(ctlName, commaDelimatedValue)
	{
		valueArray = commaDelimatedValue.split(",")		
		ctl = GetControlByName(ctlName);		
		for(i = 0; i < valueArray.length; i++)
		{
			currentValue = valueArray[i];
			for(j = 0; j < ctl.options.length; j++)
			{
				if (ctl.options[j].value != "" && (ctl.options[j].value == currentValue.replace(" ","")))
				{
					ctl.options[j].selected = true;
				}	
			}			
		}
	}
	
	function SelectMultipleOptions(ctlName, commaDelimatedValue)
	{
		valueArray = commaDelimatedValue.split(",")		
		ctl = GetControlsByMatchedName(ctlName);		
		for(i = 0; i < valueArray.length; i++)
		{
			currentValue = valueArray[i];
			for(j = 0; j < ctl.options.length; j++)
			{
				if (ctl.options[j].value != "" && (ctl.options[j].value == currentValue.replace(" ","")))
				{
					ctl.options[j].selected = true;
				}	
			}			
		}
	}
	
	//--------------------------------
	
	function UnselectAllOptions(ctlName)
	{
		ctl = GetControlByName(ctlName);
		for(i = 0; i < ctl.options.length; i++)
		{
			ctl.options[i].selected = false;
		}
	}
	
	//--------------------------------
	
	function GetCommaListFromOptions(ctlName, startFrom)
	{
		rslt = "";
		ctl = GetControlByName(ctlName);
		for(i = startFrom ; i < ctl.options.length; i++)
		{
			rslt += ctl.options[i].value + ",";
		}
		rslt = rslt.substring(0,rslt.length-1);
		return rslt;
	}
	
	//--------------------------------
	
	function OpenWindow(pagePath)
	{
		wd = parseInt(screen.width/2);
		ht = parseInt(screen.height/2);
		l = parseInt((screen.width - wd)/2);
		t = parseInt((screen.height - ht)/2);
		win = window.open(pagePath,'','width=' + wd + ',height=' + ht + ',scrollbars=yes,resizable=yes');
		win.moveTo(l,t);
		return false;
	}
	
	//--------------------------------
	
	function OpenDefaultWindow(pagePath)
	{
		win = window.open(pagePath,'','scrollbars=yes,resizable=yes');
		return false;
	}
	
	//--------------------------------
	
	function GoUrl(url)
	{
		document.location = url + "?r=" + Math.random(1);
	}
	
	//--------------------------------
	
	function Redirect(url)
	{
		document.location = url + "?r=" + Math.random(1);
	}
	
	//--------------------------------
	
	function GoBack()
	{
		history.back();
	}
	
	//--------------------------------
	
	function SubmitForm()
	{
		ln = document.forms.length;
		document.forms[ln-1].submit();
	}
	
	//--------------------------------
	
	function ResetForm()
	{
		myForm = document.forms[0];
		totalControls = myForm.elements.length;
		for(i = 0; i < totalControls; i++)
		{
			if((myForm.elements[i].type == "text") || (myForm.elements[i].type == "password") || (myForm.elements[i].type == "select-one")|| (myForm.elements[i].type == "textarea"))
			{
				myForm.elements[i].value = "";
			}
		}
	}
	
	//--------------------------------
	
	function ForgotPassword()
	{
		var controls 	=	 new Array("TxtEmail");
		var messages 	=	 new Array("Please specify email address.\t ");
		for(i = 0; i<controls.length; i++)
		{
			if( GetValue( controls[i] ) == "" )
			{
				alert( messages[i] );
				SetFocus( controls[i] );
				return false;		
			}
			
			if(i==0)
			{
				if(!ValidateEmail(controls[0]))
				{
					return false;
				}
			}
		}		
	}
	
	//--------------------------------
			
	var UploadpopWindow = 0;
	
	function UploadWindow(URLStr)
	{
		var left = "290";
		var top = "250";
		var width = "300";
		var height = "220";
		if(UploadpopWindow)
		{
			if(!UploadpopWindow.closed)
			{
				UploadpopWindow.close();
			}
		}
	    UploadpopWindow = window.open(URLStr, 'UploadpopWindow', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
	}
	
	//--------------------------------
	
	var popUpWin = 0;
	
	function popUpWindow(URLStr, width, height)
	{	
	  if(popUpWin)
	  {
		if(!popUpWin.closed)
		{
			popUpWin.close();
		}
	  }
	  
	  var left = parseInt((screen.width - width)/2);
	  var top = parseInt((screen.height - height)/2);	  
	  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=0,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
	  popUpWin.focus();
	}
	
	//--------------------------------
	
	function popUpWindowClose()
	{	  
		if(popUpWin)
		{
			if(!popUpWin.closed)
			{				
				popUpWin.close();
			}
		}
	 }
	
	//--------------------------------
	
	var eventPopUpWin = 0;
	function eventPopUpWindow(URLStr, width, height)
	{
	
	  if(eventPopUpWin)
	  {
		if(!eventPopUpWin.closed)
		{
			eventPopUpWin.close();
		}
	  }
	  
	  var left = parseInt((screen.width - width)/2);
	  var top = parseInt((screen.height - height)/2);	  
	  eventPopUpWin = open(URLStr, 'eventPopUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
	  eventPopUpWin.focus();
	}
	
	//--------------------------------
	
	function eventPopUpWindowClose()
	{		
		if(eventPopUpWin)
		{		
			if(!eventPopUpWin.closed)
			{				
				eventPopUpWin.close();
			}
		}
	 }
	 
	 //--------------------------------
	
	var ImagePopUpWin = 0;
	
	function ImagePopUpWindow(URLStr)
	{
		var left = "600";
		var top = "70";
		var width = "395";
		var height = "533";
	  if(ImagePopUpWin)
	  {
		if(!ImagePopUpWin.closed) ImagePopUpWin.close();
	  }
	  ImagePopUpWin = window.open(URLStr, 'ImagePopUpWin', 'toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
	}
	
	//--------------------------------
	
	function Check()
	{
		if(GetValue('TxtSearchWord')=="")
		{
		alert("Can't search blank field.please insert a value.\t");
		SetFocus('TxtSearchWord');
		return false
		}
	}
	
	//--------------------------------
		
	function DoFocus(obj,colorcode)
	{
		obj.style.background = colorcode;
	
	}
	
	//--------------------------------
	
	function DoDisabled(obj)
	{	
		//obj.className = "Disabled";
		obj.disabled = true;
		
	}
	
	//--------------------------------
	
	function DoDisabledTopMenu(obj)
	{	
		//obj.className = "DisabledTopMenu";
		//obj.disabled = true;
			
	}
	
	//--------------------------------
	
	function MM_swapImgRestore() { //v3.0
	  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
	}
	
	//--------------------------------
	
	function MM_preloadImages() { //v3.0
	  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
		var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
		if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
	}
	
	//--------------------------------
	
	function MM_findObj(n, d) { //v4.01
	  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
		d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
	  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	  if(!x && d.getElementById) x=d.getElementById(n); return x;
	}
	
	//--------------------------------	
	
	function MM_swapImage() { //v3.0
	  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
	   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
	}
	
	//--------------------------------
	
	function LogoutWindow()
	{
		var ok =  confirm('Are you sure that you want to logout?\t');
		if(ok)
		{
			window.location = "SecureLogout.php";
		}	
	}
	
	//--------------------------------
	
	function VrfySearch()
	{
		var TxtValue = document.FrmSiteSearch.TxtSiteSearch.value;
		if(TxtValue == "" || TxtValue == " ")
		{
			alert("You should enter at least one keyword. \t");		
			SetFocus('SiteSearch');
			return false;	
		}
	}
	
	//--------------------------------

	// Example:
	// var b = new BrowserInfo();
	// alert(b.version); 
	function BrowserInfo()
	{
	  this.name = navigator.appName;
	  this.codename = navigator.appCodeName;
	  this.version = navigator.appVersion.substring(0,4);
	  this.platform = navigator.platform;
	  this.javaEnabled = navigator.javaEnabled();
	  this.screenWidth = screen.width;
	  this.screenHeight = screen.height;
	}

	//--------------------------------
	
	function ShowHideContent(name,img)
	{
		var target=eval("document.all['"+ name +"']");
		var targetimg=eval("document.all['"+ img +"']");
		
		if(target.style.visibility == 'hidden')
		{
			target.style.visibility = "visible";		
			targetimg.src = "images/min.gif";
			targetimg.alt = 'Minimize'
		}
		else
		{
			target.style.visibility = "hidden";		
			targetimg.src = "images/max.gif";
			targetimg.alt = 'Maximize'
		}
	}
	
	//--------------------------------
	
	function ShowHideLayer(l,swh)
	{
		var target=eval("document.all['"+l +"']")
		if(swh=='1')
		{
			target.style.visibility="visible";
		}
		else if(swh=='0')
		{
			target.style.visibility="hidden";
		}
	}
	
	//--------------------------------
	
	function MakeHomePage()
	{
		if (document.all)
		{
			var url = document.location;		
			//myHomePage.style.behavior='url(#default#homepage)';
			myHomePage.setHomePage(url);			
		}
	}
	
	//--------------------------------	
	
	function UnderCostruction()
	{
		alert("Coming Very Soon! \t");
		return false;
	}
	
	//--------------------------------
	
	function ValidateUSDate(control)
	{
		if(control.value != "")
		{
			if(!IsValidateUSDate( control.value ))
			{
				alert("Birth  date doesn't match pattern, bad date.\t");
				SetFocus(control);
				return false;
			}
		}
	}
	
	//--------------------------------
	
	function IsValidateUSDate( strValue )	
	{
		/************************************************
		DESCRIPTION: Validates that a string contains only
			valid dates with 2 digit month, 2 digit day,
			4 digit year. Date separator can be ., -, or /.
			Uses combination of regular expressions and
			string parsing to validate date.
			Ex. mm/dd/yyyy or mm-dd-yyyy or mm.dd.yyyy
		
		PARAMETERS:
			strValue - String to be tested for validity
		
		RETURNS:
			True if valid, otherwise false.
		
		REMARKS:
			Avoids some of the limitations of the Date.parse()
			method such as the date separator character.
			*************************************************/
		var objRegExp = /^\d{1,2}(\-|\/|\.)\d{1,2}\1\d{4}$/;
		
		//check to see if in correct format
		if(!objRegExp.test(strValue))
		{
		return false;
		}
		return true;
		//doesn't match pattern, bad date
		/*else{
		
		// var strSeparator = strValue.substring(2,3)
		// bug fix by Radovan Radic to get the first separator
		for (i=0; i<strValue.length; i++) {
		  if (strValue.charAt(i)>'9') or (strValue.charAt(i)<'0')
			break;
		}
		var strSeparator=str.charAt(i);
		
		var arrayDate = strValue.split(strSeparator); //split date into month, day, year
		//create a lookup for months not equal to Feb.
		var arrayLookup = { '01' : 31,'03' : 31, '04' : 30,'05' : 31,'06' : 30,'07' : 31,
							'08' : 31,'09' : 30,'10' : 31,'11' : 30,'12' : 31}
		var intDay = parseInt(arrayDate[1]);
		
		//check if month value and day value agree
		if(arrayLookup[arrayDate[0]] != null) {
		  if(intDay <= arrayLookup[arrayDate[0]] && intDay != 0)
			return true; //found in lookup table, good date
		}
		
		//check for February (bugfix 20050322)
		var intMonth = parseInt(arrayDate[0]);
		if (intMonth == 2) { 
		   var intYear = parseInt(arrayDate[2]);
		   if( ((intYear % 4 == 0 && intDay <= 29) || (intYear % 4 != 0 && intDay <=28)) && intDay !=0)
			  return true; //Feb. had valid number of days
		   }
		}
		return false; //any other values, bad date*/
	}
	function isValidUKPostcode(postcode) {
		var objRegExp = /^[A-Z]{1,2}\d{1,2} \d[A-Z]{2}$/;
		if (!postcode.match(objRegExp))
		{
			return false;
		}
		return true;
	}
