function focusLoginField() {
//Name:     setFocus
//Purpose:  set focus to field
//Returns:  does not return anything
   if (document.login.elements["unm"].value != "Username.enterprise" ) {
      document.login.elements["unm"].style.color = "#000";
      document.login.elements["password"].focus();
   }
   else {
      document.login.elements["unm"].focus();
   }
}

function clickclear(thisfield, defaulttext) {
        if (thisfield.value == defaulttext) {
                thisfield.value = "";
                thisfield.style.color = "#000";
        }
}

function clickrecall(thisfield, defaulttext) {
        if (thisfield.value == "") {
                thisfield.value = defaulttext;
                thisfield.style.color = "#999";
        }
}

/**
  *Browser Detection Class
  *author kjesse
  *date 10/09/2008
  *project register.com
**/
var btBrowserDetect = {
	userAgentString : "",
	versionSubstring : "",
	minSupportedVersion : "",
	maxSupportedVersion : "",
	//populate broser data for supported browsers
	browserData : [
			{
				userAgent : navigator.userAgent, //javascript user agent string
				stringMatch : "Firefox", //string to match in user agent string
				name : "Firefox", //name of browser
				versionSubstring : "Firefox/", //substring before version number in user agent string
				minVersion : 2, //minimum supported version
				maxVersion : 3 //maximum supported version
			},
			{
				userAgent : navigator.userAgent,
				stringMatch : "MSIE",
				name : "IE",
				versionSubstring : "MSIE ",
				minVersion : 6,
				maxVersion : 7

			},
			{
				userAgent : navigator.userAgent,
				stringMatch : "AppleWebKit",
				name : "Safari",
				versionSubstring : "Version/",
				minVersion : 3,
				maxVersion : 3

			}
	],
	//initialization will get browser name and version from user agent string
	init : function () {
		this.browser = this.getBrowserFromString();
		this.version = this.getVersionFromString();
		switch (this.browser) {
			case 'Safari':
				document.is_safari = true;
			case 'Firefox':
				document.is_firefox = true;
			case 'IE':
				document.is_IE = true;
		}
	},
	//get browser name, version substring, min/max supported versions and user agent string from matching browser
	getBrowserFromString : function () {
		for (var i = 0; i < this.browserData.length; i++)       {
			if (this.browserData[i].userAgent.indexOf(this.browserData[i].stringMatch) != -1) {
				this.userAgentString = this.browserData[i].userAgent;
				this.versionSubstring = this.browserData[i].versionSubstring; 
				this.minSupportedVersion = this.browserData[i].minVersion;
				this.maxSupportedVersion = this.browserData[i].maxVersion;
				return this.browserData[i].name;
			}
		}
		//no browser data in this.browserData
		return "Unsupported browser";
	},
	//get browser version from user agent string
	getVersionFromString : function () {
		var index = this.userAgentString.indexOf(this.versionSubstring);
		if (index == -1 || this.versionSubstring == "") {
			//could not find browser version data
			return "Unknown browser version";
		} else {
			return parseFloat(this.userAgentString.substring(index + this.versionSubstring.length));
		}
	}
}
//initialize browser detection class
btBrowserDetect.init();

//get browsers current location and initialize a string
var curLocation = new String(window.location);

//check current location for an error message flag to avoid looping
if (!curLocation.match("msg")) {
	//check browser version is less than supported version and redirect to display error message
	if (btBrowserDetect.version < btBrowserDetect.minSupportedVersion || btBrowserDetect.version == "Unknown browser version") {
		//remove string from memory
		curLocation = null;
		window.location = '?msg=4';
	}
}