	// Global Variables //
	var _isMoz = (navigator.appName == "Netscape");
	var _isIE = (navigator.appName == "Microsoft Internet Explorer");
	var _isIE6 = (navigator.appVersion.search("MSIE 6.0") != -1);
	var _isSafari = (navigator.userAgent.indexOf("Safari") != -1);
	var _isLoaded = false, _i = 0, _j = 0, _timeOut = 0;

	// getElementById //
	$ = function(_elementID) {
		return document.getElementById(_elementID);
	}

	// init function //
	init = function() {
		addEvent(onLoad,"load");
		addEvent(posMenu,"resize");
	}

	// Manage onLoad events //
	addEvent = function(_function,_event) {
		if (eval(_function)) {
			if ((document.all) && (window.attachEvent)) {
				window.attachEvent("on" + _event,_function);
			} else if (window.addEventListener) {
				window.addEventListener(_event,_function,false);
			}
		}
	}

	// onLoad //
	onLoad = function() {
		(new Image()).src = "/images/menu/menuItemOn.png";
		(new Image()).src = "/images/menu/subMenuItemOn.png";

		// Position menu //
		posMenu();

		_isLoaded = true;
	}

	getPageSize = function() {
		var _xScroll, _yScroll;

		if (window.innerHeight && window.scrollMaxY) {	
			_xScroll = (window.innerWidth + window.scrollMaxX);
			_yScroll = (window.innerHeight + window.scrollMaxY);
		} else if (document.body.scrollHeight > document.body.offsetHeight) { // all but Explorer Mac
			_xScroll = document.body.scrollWidth;
			_yScroll = document.body.scrollHeight;
		} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
			_xScroll = document.body.offsetWidth;
			_yScroll = document.body.offsetHeight;
		}

		var _windowWidth, _windowHeight;
		if (self.innerHeight) {	// all except Explorer
			if (document.documentElement.clientWidth){
				_windowWidth = document.documentElement.clientWidth;
			} else {
				_windowWidth = self.innerWidth;
			}
			_windowHeight = self.innerHeight;
		} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
			_windowWidth = document.documentElement.clientWidth;
			_windowHeight = document.documentElement.clientHeight;
		} else if (document.body) { // other Explorers
			_windowWidth = document.body.clientWidth;
			_windowHeight = document.body.clientHeight;
		}

		// for small pages with total height less then height of the viewport
		_pageHeight = (_yScroll < _windowHeight) ? _windowHeight : _yScroll;

		// for small pages with total width less then width of the viewport
		_pageWidth = (_xScroll < _windowWidth) ? _xScroll : _windowWidth;

		return [_pageWidth,_pageHeight,_windowWidth,_windowHeight];
	}

	// Menu //
	posMenu = function() {
		var _pageSize = getPageSize();
		var _parent = $("menu1");
		var _yOffset = 0;

		_windowWidth = _pageSize[2];
		_windowWidth = ((_windowWidth < 756) ? 756 : _windowWidth);

		while (_parent.offsetParent) {
			_parent = _parent.offsetParent;
			_yOffset += _parent.offsetTop;
		}

		$("subMenu1").style.left = (((_windowWidth / 2) - 221) + "px");
		$("subMenu1").style.top = (_yOffset + 7 + "px");

		$("subMenu2").style.left = (((_windowWidth / 2) - 221) + "px");
		$("subMenu2").style.top = (_yOffset + 40 + "px");

		$("subMenu3").style.left = (((_windowWidth / 2) - 221) + "px");
		$("subMenu3").style.top = (_yOffset + 73 + "px");

		$("subMenu4").style.left = (((_windowWidth / 2) - 221) + "px");
		$("subMenu4").style.top = (_yOffset + 106 + "px");
        
        $("subMenu9").style.left = (((_windowWidth / 2) - 221) + "px");
        $("subMenu9").style.top = (_yOffset + 139 + "px");
        
        
        
	}

	menuOpen = function(_elementID) {
		hideAllSubMenus();
		$(_elementID).style.display = "block";
	}

	menuOver = function(_menuID) {
		$(_menuID).style.backgroundImage = "url(/images/menu/menuItemOn.png)";
		clearTimeout(_timeOut);
	}

	menuOut = function() {
		_timeOut = setTimeout(hideAllSubMenus,500);
	}

	subMenuOver = function(_subMenuID) {
		$(_subMenuID).style.backgroundImage = "url(/images/menu/subMenuItemOn.png)";
	}

	subMenuOut = function(_subMenuID) {
		$(_subMenuID).style.backgroundImage = "url(/images/menu/subMenuItemOff.png)";
	}

	// Line 136 can be changed for more menu sockets //
    
    hideAllSubMenus = function() {
		for (_i=1;_i<12;_i++) {
			$("menu" + _i).style.backgroundImage = "url(/images/menu/menuItemOff.png)";
			$("subMenu" + _i).style.display = "none";
		}
	}
	// End menu //

	whatTypePhoneLinesAction = function(_elementID) {
		$("loopStartDiv").style.display = "none";
		$("groundStartDiv").style.display = "none";
		$("PRIISDNDiv").style.display = "none";
		$("DIDDiv").style.display = "none";

		$(_elementID + "Div").style.display = "block";
	}

	doYouRequireHeadsetsAction = function(_elementID) {
		$("howManyHeadsetsDiv").style.display = ($(_elementID).value == "Yes") ? "block" : "none";
	}

	doYouRequireCordlessPhonesAction = function(_elementID) {
		$("howManyCordlessPhonesDiv").style.display = ($(_elementID).value == "Yes") ? "block" : "none";
	}

	doYouUseAnalogDevicesAction = function(_elementID) {
		$("doYouUseAnalogDevicesOnYourCurrentSystemDiv").style.display = ($(_elementID).value == "Yes") ? "block" : "none";
	}

	doYouHaveAnyPlansAction = function(_elementID) {
		$("doYouHaveAnyPlansForFutureExpansionOfYourBusinessDiv").style.display = ($(_elementID).value == "Yes") ? "block" : "none";
	}

	swapImage = function(_elementID,_src) {
		var _element = "";
		if (_element = _src.match(/(.+)Off\.png$/)) {
			$(_elementID).src = _element[1] + "On.png";
		} else {
			$(_elementID).src = _src.match(/(.+)On\.png$/)[1] + "Off.png";
		}
	}

	toggleDisplay = function(_elementID,_flow) {
		$(_elementID).style.display = ($(_elementID).style.display == _flow) ? "none" : _flow;
	}

	// Verify object //
	objectVerify = function() {
		_elements = new Array;
		this._i = 0;

		this.addElement = function(_elementID,_vType,_errMsg) {
			_elements[this._i] = [_elementID,_vType,_errMsg];
			this._i++;
		}

		this.getElement = function(_elementID) {
			return _elements[_elementID];
		}
	}

	// Form verification //
	verifyByObject = function(_vO,_submitBtnText,_submitBtnID) {
		var _vO = eval(_vO), _submitForm = true, _submitBtn = "", _i, _vField, _vType, _msg = "";
		var _errMsg = "Please Fill out all required fields";
		_submitBtnID = (_submitBtnID) ? _submitBtnID : "submitBtn";

		for (_i=0;_i<_vO._i;_i++) {
			if (_vField = $(_vO.getElement(_i)[0])) {
				if (!_vField.disabled) {
					_vType = _vO.getElement(_i)[1];
					_vErrMsg = _vO.getElement(_i)[2];
					//_vField.style.borderColor = "";

					// eMail verification //
					if (_vType == "eMail") {
						if (_vField.value.match(/[a-zA-Z0-9._%-]+@[a-zA-Z0-9._%-]+\.[a-zA-Z]{2,4}/) != _vField.value) {
							_submitForm = false;
							//_vField.style.borderColor = "#ff0000";
							_msg = (_msg != _errMsg) ? "Value must be an eMail Address\nex: User@Domain.com" : _msg;
						}
					// Zip code verification //
					} else if (_vType == "zip") {
						if (_vField.value.match(/[0-9]{5}/) != _vField.value) {
							_submitForm = false;
							//_vField.style.borderColor = "#ff0000";
							_msg = (_msg != _errMsg) ? "Value must be a Zip Code\nex: 97220" : _msg;
						}
					// "checked" verification //
					} else if (_vType == "checked") {
						if (!_vField.checked) {
							_submitForm = false;
							_msg = (_msg != _errMsg) ? _vErrMsg : _msg;
						}
					// Numerical verification //
					} else if (_vType == "numeric") {
						if (isNaN(_vField.value) || (_vField.value == "")) {
							_submitForm = false;
							//_vField.style.borderColor = "#ff0000";
							_msg = (_msg != _errMsg) ? "Value must be a Number\nex: 1219" : _msg;
						}
					// Check multiple checkboxes for "checked", at least one must be checked //
					} else if (_vType == "multChecked") {
						var _j, _checkArray = _vErrMsg, _checkCount = 0;

						for (_j=1;_j<_checkArray.length;_j++) {
							if ($(_checkArray[0] + _checkArray[_j]).checked) {
								_checkCount++;
							}
						}

						if (_checkCount == 0) {
							_submitForm = false;
							_msg = (_msg != _errMsg) ? _oErrMsg : _msg;
						}
					// Check if given select's selected element's value is not "" //
					} else if (_vType == "select") {
						if (_vField.options[_vField.selectedIndex].value == "") {
							_submitForm = false;
							//_vField.style.borderColor = "#ff0000";
							_msg = (_msg != _errMsg) ? _vErrMsg : _msg;
						}
					// Checks two password fields //
					} else if (_vType == "passwd") {
						var _checkArray = _vErrMsg, _badPasswd = false;
						_badPasswd = ($(_checkArray[2]).value != $(_checkArray[3]).value) ? true : _badPasswd;
						_badPasswd = ($(_checkArray[2]).value.length < _checkArray[1]) ? true : _badPasswd;
						_badPasswd = ($(_checkArray[3]).value.length < _checkArray[1]) ? true : _badPasswd;
						_badPasswd = ($(_checkArray[3]).value.search(/[0-9]/) == -1) ? true : _badPasswd;
						_badPasswd = ($(_checkArray[3]).value.search(/[a-zA-Z]/) == -1) ? true : _badPasswd;
						if (_badPasswd) {
							_submitForm = false;
							//$(_checkArray[2]).style.borderColor = "#ff0000";
							//$(_checkArray[3]).style.borderColor = "#ff0000";
							_msg = (_msg != _errMsg) ? _checkArray[0] : _msg;
						} else {
							//$(_checkArray[2]).style.borderColor = "";
							//$(_checkArray[3]).style.borderColor = "";
						}
					// Verify userName //
					} else if (_vType == "userName") {
						var _regEx = /["'#$%&,\/?:<>=+|]/ig;
						//var _regEx = /[^\u00A3-\uFFFF\d\w!\*\-: ,@.()`^\[\]{}~]/ig;
						if ((_vField.value.replace(_regEx,"") != _vField.value) || (_vField.value == "")) {
							//_vField.style.borderColor = "#ff0000";
							_submitForm = false;
							_msg = (_msg != _errMsg) ? _vErrMsg : _msg;
						}
					// Radio verification //
					} else if (_vType == "radio") {
						var _j, _checkArray = _vErrMsg, _checkCount = 0;

						for (_j=0;_j<_checkArray.length;_j++) {
							if ($(_checkArray[_j]).checked) {
								_checkCount++;
							}
						}

						if (_checkCount == 0) {
							_submitForm = false;
							_msg = (_msg != _errMsg) ? _oErrMsg : _msg;
						}
					// Hex verification //
					} else if (_vType == "colorHex") {
						if (!isHex(_vField.value)) {
							//_vField.style.borderColor = "#ff0000";
							_submitForm = false;
							_msg = (_msg != _errMsg) ? "Value must be a valid Hex value\nex: FF33CC" : _msg;
						}						
					// Flickr ID verification //
					} else if (_vType == "flickrID") {
						if ((_vField.value.match(/[0-9A-Z@]+/) != _vField.value) && (_vField.value != "")) {
							_submitForm = false;
							//_vField.style.borderColor = "#ff0000";
							_msg = (_msg != _errMsg) ? "Value must be a valid Flickr ID\nex: 41434087@N00" : _msg;
						}
					} else if (_vField.value == "") {
						_submitForm = false;
						//_vField.style.borderColor = "#ff0000";
						_msg = _errMsg;
					}
				}

			} else {
				window.alert("'" + _vO.getElement(_i)[0] + "' does not exist.");
			}
		}

		if (_submitForm == true) {
			if (_submitBtn = $(_submitBtnID)) {
				_submitBtn.disabled = true;
				_submitBtn.value = _submitBtnText;
			}
			return true;
		} else {
			window.alert(_msg);
			return false;
		}
	}

	init();

    // BANNER OBJECT
function Banner(objName){
    this.obj = objName;
    this.aNodes = [];
    this.currentBanner = 0;
    
};

// ADD NEW BANNER
Banner.prototype.add = function(bannerType, bannerPath, bannerDuration, height, width, hyperlink) {
    this.aNodes[this.aNodes.length] = new Node(this.obj +"_"+ this.aNodes.length, bannerType, bannerPath, bannerDuration, height, width, hyperlink);
};

// Node object
function Node(name, bannerType, bannerPath, bannerDuration, height, width, hyperlink) {
    this.name = name;
    this.bannerType = bannerType;
    this.bannerPath = bannerPath;
    this.bannerDuration = bannerDuration;
    this.height = height
    this.width = width;
    this.hyperlink= hyperlink;
//    alert (name +"|" + bannerType +"|" + bannerPath +"|" + bannerDuration +"|" + height +"|" + width + "|" + hyperlink);
};

// Outputs the banner to the page
Banner.prototype.toString = function() {
    var str = ""
    for (var iCtr=0; iCtr < this.aNodes.length; iCtr++){
        str = str + '<span name="'+this.aNodes[iCtr].name+'" '
        str = str + 'id="'+this.aNodes[iCtr].name+'" ';
        str = str + 'class="m_banner_hide" ';
        str = str + 'bgcolor="#FFFCDA" ';    // CHANGE BANNER COLOR HERE
        str = str + 'align="center" ';
        str = str + 'valign="top" >\n';
        if (this.aNodes[iCtr].hyperlink != ""){
            str = str + '<a href="'+this.aNodes[iCtr].hyperlink+'">';
        }
            
        if ( this.aNodes[iCtr].bannerType == "FLASH" ){
            str = str + '<OBJECT '
            str = str + 'classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" '
            str = str + 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" '
            str = str + 'WIDTH="'+this.aNodes[iCtr].width+'" '
            str = str + 'HEIGHT="'+this.aNodes[iCtr].height+'" '
            str = str + 'id="bnr_'+this.aNodes[iCtr].name+'" '
            str = str + 'ALIGN="" '
            str = str + 'VIEWASTEXT>'
            str = str + '<PARAM NAME=movie VALUE="'+ this.aNodes[iCtr].bannerPath + '">'
            str = str + '<PARAM NAME=quality VALUE=high>'
            str = str + '<PARAM NAME=bgcolor VALUE=#FFFCDA>'
            str = str + '<EMBED ';
            str = str + 'src="'+this.aNodes[iCtr].bannerPath+'" '
            str = str + 'quality=high '
//            str = str + 'bgcolor=#FFFCDA '
            str = str + 'WIDTH="'+this.aNodes[iCtr].width+'" '
            str = str + 'HEIGHT="'+this.aNodes[iCtr].height+'" '
            str = str + 'NAME="bnr_'+this.aNodes[iCtr].name+'" '
            str = str + 'ALIGN="center" '
            str = str + 'TYPE="application/x-shockwave-flash" '
            str = str + 'PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">'
            str = str + '</EMBED>'
            str = str + '</OBJECT>'
        }else if ( this.aNodes[iCtr].bannerType == "IMAGE" ){
            str = str + '<img src="'+this.aNodes[iCtr].bannerPath+'" ';
            str = str + 'style="width="'+this.aNodes[iCtr].width+'; height="'+this.aNodes[iCtr].height+'" ';
            str = str + 'class="left">';
        }

        if (this.aNodes[iCtr].hyperlink != ""){
            str = str + '</a>';
        }

        str += '</span>';
    }
    return str;
};

// START THE BANNER ROTATION
Banner.prototype.start = function(){
    this.changeBanner();
    var thisBannerObj = this.obj;
    // CURRENT BANNER IS ALREADY INCREMENTED IN cahngeBanner() FUNCTION
    setTimeout(thisBannerObj+".start()", this.aNodes[this.currentBanner].bannerDuration * 1000);
}

// CHANGE BANNER
Banner.prototype.changeBanner = function(){
    var thisBanner;
    var prevBanner = -1;
    if (this.currentBanner < this.aNodes.length ){
        thisBanner = this.currentBanner;
        if (this.aNodes.length > 1){
            if ( thisBanner > 0 ){
                prevBanner = thisBanner - 1;
            }else{
                prevBanner = this.aNodes.length-1;
            }
        }
        if (this.currentBanner < this.aNodes.length - 1){
            this.currentBanner = this.currentBanner + 1;
        }else{
            this.currentBanner = 0;
        }
    }
    

    if (prevBanner >= 0){
        document.getElementById(this.aNodes[prevBanner].name).className = "m_banner_hide";
    }
    document.getElementById(this.aNodes[thisBanner].name).className = "m_banner_show";
}
