var lpUAStextLinkObject;
	
if (document.getElementById){
	lpUAStextLinkObject = document.getElementById('lpDynamicTextLink');
} else if (document.all){
	lpUAStextLinkObject = document.all['lpDynamicTextLink'];
} else if (document.layers){
	lpUAStextLinkObject = document.layers['lpDynamicTextLink'];
}

function lpUpdateDynamicTextLinkText(stateText){
	lpUAStextLinkObject.innerHTML = stateText;
}

//sets the initial text for the link
lpUpdateDynamicTextLinkText(lpUASdynamicTextLinkInitialText);
lpUpdateDynamicTextLinkStyle("Initial");

//overriding function from DynamicButtonScript2.js
function lpdbApplyButtonRule(width) {
	var response = false;
	var style = null;
	var hcDynamicIconImage=lpdbFindButtonImage('hcDynamicIcon');
	if (hcDynamicIconImage!=null) {
		style = hcDynamicIconImage.style;
	}
	if (width == 40) {
		response = true;
	} else
	if (width == 50) {
		if (typeof(lpdbButtonImageURL) != "undefined" && lpdbButtonImageURL != null) {
			if (hcDynamicIconImage!=null) 
				hcDynamicIconImage.src = lpdbButtonImageURL;
			if (style != null)
				style.cursor = hcPointerString;
			lpdbButtonAction = lpdbButtonActionFunction;
			if(lpUAStextLinkObject != null){
				lpUpdateDynamicTextLinkText(lpUASdynamicTextLinkOnlineText);
				lpUpdateDynamicTextLinkStyle("Online");
			}
		}
		if (typeof(lpdbMEname) != "undefined") {
			parent.document.getElementById(lpdbMEname).style.display="block";
			parent.document.getElementById("lpMEguide").style.display="block";
		}
		response = true;
	} else 	if (width == 60) {
		if (typeof(lpdbAlternateButtonBusyImageURL) != "undefined" && lpdbAlternateButtonBusyImageURL != null) {
			if (hcDynamicIconImage!=null) 
				hcDynamicIconImage.src = lpdbAlternateButtonBusyImageURL;
			if (typeof(lpdbBusyActionFunction) != "undefined") {
			    if (style != null)
			        style.cursor = hcPointerString;
			    lpdbButtonAction = lpdbBusyActionFunction;
			} else {
			    if (style != null)
			        style.cursor = "default";
			    lpdbButtonAction = lpdbDoNothingFunction
			}
			if(lpUAStextLinkObject != null){
				lpUpdateDynamicTextLinkText(lpUASdynamicTextLinkOccupiedText);
				lpUpdateDynamicTextLinkStyle("Occupied");
			}
		}
		response = true;
	} else 	if (width == 70) {
		if (typeof(lpdbAlternateButtonOfflineImageURL) != "undefined" && lpdbAlternateButtonOfflineImageURL != null) {
			if (hcDynamicIconImage!=null) 
				hcDynamicIconImage.src = lpdbAlternateButtonOfflineImageURL;
			if (typeof(lpdbOfflineActionFunction) != "undefined") {				
				if (style != null) 
					style.cursor = hcPointerString;
				lpdbButtonAction = lpdbOfflineActionFunction;
			} else {
				if (style != null)
					style.cursor = "default";
				lpdbButtonAction = lpdbDoNothingFunction;
			}
			if(lpUAStextLinkObject != null){
				lpUpdateDynamicTextLinkText(lpUASdynamicTextLinkOfflineText);
				lpUpdateDynamicTextLinkStyle("Offline");
			}
		}
		response = true;
	} else 	if (width == 80 || width == 0) {
		if (typeof(lpdbAlternateImageURL) != "undefined" && lpdbAlternateImageURL != null) {
			if (hcDynamicIconImage!=null) 
				hcDynamicIconImage.src = lpdbAlternateImageURL;
			if (typeof(lpdbAlternateFunction) != "undefined") {				
				if (style != null) 
					style.cursor = hcPointerString;
				lpdbButtonAction = lpdbAlternateFunction;
			} else {
				if (style != null)
					style.cursor = "default";
				lpdbButtonAction = lpdbDoNothingFunction;
			}
			if(lpUAStextLinkObject != null){
				lpUpdateDynamicTextLinkText(lpUASdynamicTextLinkOfflineText);
				lpUpdateDynamicTextLinkStyle("Offline");
			}
		}
		if (typeof(lpdbDefaultActionURL)!="undefined") {
			lpdbActionURL = lpProtocol + "://" + lpdbDefaultActionURL;
		} else {
			lpdbActionURL = lpProtocol + "://" + lpServerName + "/hcp/html/SalesEdition/ServiceTemporarilyUnavailable.html";
		}
		response = true;
	} else if (width == 90) {
		// (a)
		// For a type-1 button implementation with image-name reference
		//  	no need to reload image (no change)
		//	need to make it clickable and connect to action
		if (style != null) 
			style.cursor = hcPointerString;
		lpdbButtonAction = lpdbButtonActionFunction;
		// (b) 
		// For a type-1 button implementation with no image-name reference
		// 	lpdbButtonActionURL is set at the bottom of this script
		// 	nothing else to do 
		response = true;
	} else
		response = lpdbCustomHandler(width);
	
	if (response) {
		lpdbLastImpressionWidth = width;	
	}
	return response;
}
