//<!-- Hide from non JavaScript browsers
// Execute browser detection settings
document.domain = "shopnbc.com";
if((typeof(myBrowser) == 'undefined') || (!myBrowser))
	{ RunDetection(true, false); }

var blnGlobalsSet	= false;
var MenuObjects		= new Object();
var MenuContainer;
var MenuIframe;
var MenuAnimator;

function RegisterMenu(MenuID, Layout, FilterType, PixelAdjustment){
	if(!blnGlobalsSet){
		MenuContainer	= ( (oTmp = _GetObj('WCHiFrameContainer')) ? oTmp : _GetObj('#body') );
		MenuIframe 		= _GetFrame(MenuContainer);
		blnGlobalsSet	= true;	
	}
	MenuObjects[MenuID] = new WCHOverlay(Layout, FilterType, PixelAdjustment);
	_SetMenuMargins(MenuID);
	var SetEventHandler = new Function("evt", "SetEventElement(evt, '" + MenuID + "');");
	MenuContainer.onmouseout = SetEventHandler;
	gAddEventListener(window, 'unload', CleanUp);
}

function WCHOverlay() {
	var wch = new Object();
	
	//	Exit point for anything not supported. [Browser Requirements: IE5+ OR Mozilla5+ OR Opera4+, and NOT IEMac or Safari (some elusive glitch I cant work out)]
	// 	-> This allows the script to degrade well on unsupported browsers.
	if ( !document.write || (typeof(myBrowser) == 'undefined') || !(myBrowser && myBrowser.BrowserSupported)
		|| !(myBrowser.objIE.IsSupported  || myBrowser.objOpera.IsSupported || (myBrowser.objMoz.IsSupported && myBrowser.objMoz.IsFoxCurrent) || (myBrowser.objMoz.IsSupported && !myBrowser.objMoz.IsFireFox) ) 
		|| (myBrowser.objMac.IsMac && myBrowser.objIE.IsIE) )
	{
		wch.Setup				= function() {};
		wch.Apply 				= function() {};
		wch.Discard 			= function() {};
		wch.SetEventElement		= function() {};
		wch.CleanUp				= function() {};
		return wch;
	}
	
	//	public: Properties
	wch.objValidEventObjects	= new Collection();
	wch.sLayout					= ( arguments && arguments.length > 0 ) ? ((isNaN(arguments[0]))	? arguments[0].toLowerCase()	: 'bottom') : 'bottom';
	wch.sFilter					= ( arguments && arguments.length > 1 ) ? ((isNaN(arguments[1]))	? arguments[1].toLowerCase() 	: 'abczyz')	: 'abczyz';
	wch.iPixelAdjust			= ( arguments && arguments.length > 2 ) ? ((xNum(arguments[2]))		? arguments[2] 					: 0) 		: 0;
	wch.objCurrentAppliedMenu	= null;
	wch.iTimeOutSetFrameUI		= 0;
	wch.iFrameUISpeed			= 0;
	wch.iTimeOutAnimate			= 0;
	wch.clockValue				= 0;
	wch.ticker					= 0;
	wch.objMargins				= new Object();
	
	// Setup properties, pre-builds iFrame, retrieves anchors with "Filter1" attribute specified, and creates MenuCallout HTML... immediately after page renders.
	if ( MenuContainer ){		
		if(myBrowser.objIE.IsIE){
			// IE6 incorrectly computes the 0 width style
			xWidth(MenuIframe.theFrameElement, 0);
			xHeight(MenuIframe.theFrameElement, 0);
		}	

		// Make list of valid html targets that mouse can hover w/o discarding the menu.
		var arrLinks				= _GetFilteredLinkObjects(wch.sFilter);
		var arrHidden				= _GetFilteredLinkHiddenObjects(wch.sFilter);
		
		_SetCollectionParams(wch.objValidEventObjects, MenuContainer.id, MenuContainer);						// Add the iFrame Container
		_SetCollectionParams(wch.objValidEventObjects, MenuIframe.theID, MenuIframe.theFrameElement);			// Add the iFrame
		for(var i = 0; i < arrLinks.length; i++){
			_SetCollectionParams(wch.objValidEventObjects, arrLinks[i].id, _GetLinkContent(arrHidden[i].value, ((wch.sFilter.indexOf('globalnav')==-1)?true:false)));	// Add Filtered Links w/ HiddenInput.Values
		}
	}
	
	return wch;
};

//	public: Updates iFrame's contents and sets iFrame to overlay windowed controls (visible).
Apply = function (MenuID, MenuBGColor, MenuHoverColor, oTheCaller) {
	if( (!oTheCaller) || (typeof(MenuObjects[MenuID]) == 'undefined') || ((typeof(MenuObjects[MenuID]) != 'undefined') && (MenuObjects[MenuID].objCurrentAppliedMenu == oTheCaller)) )
		{return; }

	// Stop any previous Apply function (if still running).
	stopTick(MenuID);
	Discard(MenuID, document);
	MenuObjects[MenuID].objCurrentAppliedMenu = oTheCaller;

	// Update iFrame with HTML
	MenuObjects[MenuID].iTimeOutSetFrameUI = setTimeout(
		function () {
			_SetFrameUI(MenuIframe.theFrameDocument, MenuBGColor, MenuHoverColor, MenuObjects[MenuID].objValidEventObjects.getValue(MenuObjects[MenuID].objCurrentAppliedMenu.id)); 
		}
	, MenuObjects[MenuID].iFrameUISpeed);
			
	// Delay on animate processes.
	MenuObjects[MenuID].iTimeOutAnimate = setTimeout(
		function () {
			// Get Width and Height of auto-sized Frame.
			var _iAutoWidth 	= xWidth(MenuIframe.theFrameDocumentInnerTable) + 20;	//MenuIframe.theFrameDocument.body.scrollWidth;
			var _iAutoHeight 	= xHeight(MenuIframe.theFrameDocumentInnerTable) + 14;	//MenuIframe.theFrameDocument.body.scrollHeight;
			
			// Move the menu into place, next to the calling object.
			if(myBrowser.objIE.IsIE)
				{ _MoveTheMenu(MenuObjects[MenuID].objCurrentAppliedMenu, MenuObjects[MenuID].sLayout, MenuContainer, _iAutoWidth, _iAutoHeight, MenuObjects[MenuID].iPixelAdjust, MenuObjects[MenuID].objMargins); }
			else
				{ _MoveTheMenu(MenuObjects[MenuID].objCurrentAppliedMenu, MenuObjects[MenuID].sLayout, MenuContainer, _iAutoWidth, _iAutoHeight, 0, MenuObjects[MenuID].objMargins); }
			
			// Show menu (container);
			xResizeTo(MenuContainer, _iAutoWidth+(MenuObjects[MenuID].objMargins.HorizontalPadding*2)+2, _iAutoHeight+(MenuObjects[MenuID].objMargins.VerticalPadding*2)+2);
			
			// Show menu (frame);
			xResizeTo(MenuIframe.theFrameElement, _iAutoWidth, _iAutoHeight);
			
			// Stop the Apply function (if still running).
			clearTimeout(MenuObjects[MenuID].iTimeOutAnimate);
			
			// Speed up next call speed
			MenuObjects[MenuID].iFrameUISpeed = 0;
		} 
	, MenuObjects[MenuID].iFrameUISpeed * 3);
};
	
//	public: Hides the iFrame.
Discard = function(MenuID, ParentID) {
	if ( (typeof(MenuObjects[MenuID]) == 'undefined') || (MenuObjects[MenuID].objValidEventObjects.exists(ParentID)) )	{ return; }

	// Stop the Apply function (if still running).
	stopTick(MenuID);
	clearTimeout(MenuObjects[MenuID].iTimeOutSetFrameUI);
	clearTimeout(MenuObjects[MenuID].iTimeOutAnimate);
	MenuObjects[MenuID].objCurrentAppliedMenu = null;
	
	// Remove the event listener
	if (myBrowser.objOpera.IsOpera) {
		if(MenuIframe.theFrameDocumentInnerTable)
			{ MenuIframe.theFrameDocumentInnerTable.style.width = 'auto'; }
	}
	
	// Resize/Reset menu size
	xResizeTo(MenuIframe.theFrameElement, 0, 0);

	// Move Menu outta sight.				
	xMoveTo(MenuContainer, -(500 * 2), -(500 * 2));	
};

//	public: Captures a given event type, applied above and sets the current event target (html object that called method).
SetEventElement = function(evt, MenuID) {
	if(typeof(MenuObjects[MenuID]) == 'undefined') { return; }
	if(!evt) { 
		if(!event) { return; }	// No event object, and is mozilla brand
		else { evt = event; }	// Is IE and new event object.
	}
	
	// Get the calling event.
	var _oCurrentTarget			= new xEvent(evt);
	var _oCurrentRelatedTarget	= _oCurrentTarget.relatedTarget;
	
	// Safari treats events on links a bit differently than other browsers
	// Safari returns the text within the link as the object which triggered the event, rather than the actual link 
	if(myBrowser.objSafari.IsSafari) {
		if (_oCurrentTarget.target.tagName != 'A')
			{ _oCurrentTarget = _oCurrentTarget.target.parentNode; }
	}

	// After tick delay, call discard (this will check for valid targets; if not valid, the overlay will be destroyed)
	if((MenuObjects[MenuID].objValidEventObjects.exists(_oCurrentTarget.target.id)) && ((MenuObjects[MenuID].objValidEventObjects.exists(_oCurrentRelatedTarget.id)) || (_oCurrentRelatedTarget.tagName.toLowerCase() == "a")) ) {
		/* If Next Event Target (where mouse is moving) is an anchor, OR
		 * If current event (mouse calling event) is an anchor and Next Event Target is page body. */
		// Discard Immediately //
		MenuObjects[MenuID].clockValue = 1;		
	}
	else {
		// Reset ticker count.
		stopTick(MenuID);
		// Reset next call speed
		MenuObjects[MenuID].iFrameUISpeed = 0;
	}
	doTick(MenuID, _oCurrentRelatedTarget.id);
};

doTick = function(MenuID, ParentID) {
	if (MenuObjects[MenuID].clockValue>=1){
		stopTick(MenuID);
		Discard(MenuID, ParentID);
	} else {
		MenuObjects[MenuID].clockValue++;
		MenuObjects[MenuID].ticker=setTimeout("doTick('"+MenuID+"','"+ParentID+"');", 0);
	}
}
stopTick = function(MenuID) {
	MenuObjects[MenuID].clockValue=0;
	clearTimeout(MenuObjects[MenuID].ticker);
}

//	public: We are leaving, deallocate any object of significant size. You leaky bastard.
CleanUp			= function() {
	//gRemoveEventListener(window, 'load', SetupOverlay);
	gRemoveEventListener(window, 'unload', CleanUp);
	MenuAnimator	= null;
	MenuIframe		= null;
	MenuContainer	= null;
	MenuObjects		= null;
};

// 	Set the position of menu at the oTarget's position + iPixelAdjust + objMargin.
function _MoveTheMenu(oTarget, vLayout, oContainer, vWidth, vHeight, iPixelAdjust, objMargins){
	if ( oTarget != document ) {
		var offSetY 	= 0;
		var offSetX 	= 0;
		var XPageTarget	= xPageX(oTarget);
		var YPageTarget	= xPageY(oTarget);
		
		// Move the menu to correct location
		switch( vLayout ) {
			case "right":
				offSetX = (xWidth(oTarget) 	+ iPixelAdjust);
				break;
			case "left":
				offSetX = -(vWidth 			- iPixelAdjust);
				break;
			case "top":
				offSetY = -(vHeight 		- iPixelAdjust);
				break;				
			default:
				offSetY = (xHeight(oTarget)	+ iPixelAdjust);
				break;
		}
		
		// Check for 'out of page bounds'
		var iTargetConsumeLeft		= (XPageTarget + vWidth);
		var iTargetConsumeHeight	= (YPageTarget + vHeight);
		switch( vLayout ) {
			case "right":
			case "left":
				if(vHeight < YPageTarget){						// If no room up, do not readjust.
					if(iTargetConsumeHeight > xPageBottom())	// If menu is larger than bottom scroll-edge, readjust to the top.
						{ offSetY = (xHeight(oTarget) + iPixelAdjust) - vHeight; }
				}			
				break;
			case "top":
			default:
				if(vWidth < XPageTarget){					// If no room right, do not readjust.
					if(iTargetConsumeLeft > xPageRight())	// If menu is larger than right scroll-edge, readjust to the left.
						{ offSetX = (xWidth(oTarget) + iPixelAdjust) - vWidth; }
				}
				break;
		}
		
		// Calculate location.
		var Xm	= (XPageTarget + offSetX - objMargins.HorizontalPadding);
		var Ym	= (YPageTarget + offSetY - objMargins.VerticalPadding);
		xMoveTo(oContainer, Xm, Ym);
	}
};

/*******	The 'SETS'	*******/
//	private: Adds/Updates the collection's name-value pair.
function _SetCollectionParams(theCollection, name, value) {
	if(typeof(theCollection) != 'undefined')
	{
		if((name.length > 0) && (typeof(value) != 'undefined'))
		{ 
			if(theCollection.exists(name))
				{ theCollection.update(name, value); }
			else
				{ theCollection.add(name, value); }
		}
	}
};

//	private: Gets the current MenuContainer's padding style and adds to MenuObject array.
function _SetMenuMargins(MenuID){
	var PropLeft = "paddingLeft";
	var PropTop	 = "paddingTop";
	if(!myBrowser.objIE.IsIE) {
		PropLeft = "padding-left";
		PropTop	 = "padding-top";
	}	
	
	// Get the frame containers's current margin
	MenuObjects[MenuID].objMargins.HorizontalPadding	= xGetComputedStyle(MenuContainer, PropLeft, true);
	MenuObjects[MenuID].objMargins.VerticalPadding		= xGetComputedStyle(MenuContainer, PropTop, true);
}

//	private: Write to a div container element in the iframe's html shell, this div is the html that will be shown to user.
function _SetFrameUI(oFrameDoc, sBackColor, sHoverColor, sInnerHTML) { 
	if( oFrameDoc ){
		if( (sInnerHTML) && (sInnerHTML.length > 0) ) {
			// Set Sheet Title
			var strTitle = "AltCSS";
			
			// Test Contrast
			var blnIsBackContrasting = _GetComplianceContrast(sBackColor, "#000000");
			var blnIsHoverContrasting = _GetComplianceContrast(sHoverColor, "#000000");
			
			// Set Border Color
			xBackground(oFrameDoc.body, sBackColor);

			// Set Title Colors
			_SetCSSRule("#MenuCanvasTitle", "backgroundColor", sBackColor, strTitle, oFrameDoc);
			_SetCSSRule("#MenuCanvasTitle", "borderBottom", "1px solid " + sHoverColor, strTitle, oFrameDoc);
			if(!blnIsBackContrasting)
				{ _SetCSSRule("#MenuCanvasTitle", "color", "#FFFFFF", strTitle, oFrameDoc); }

			// Set MenuItem Colors
			_SetCSSRule("#MenuCanvasLinkBox a", "borderBottom", "1px solid " + sBackColor, strTitle, oFrameDoc);
			_SetCSSRule("#MenuCanvasLinkBox a:hover", "backgroundColor", sHoverColor, strTitle, oFrameDoc);
			if(!blnIsHoverContrasting)
				{ _SetCSSRule("#MenuCanvasLinkBox a:hover", "color", "#FFFFFF", strTitle, oFrameDoc); }
				
			_GetObj("MenuCanvasLinkBox", oFrameDoc).innerHTML = sInnerHTML;	// Inject html into iFrame
		}	
	}
};

function _GetComplianceContrast(sColor1, sColor2) {
	var base					= 16;
	var brightnessThreshold		= 125;
	var colorThreshold			= 400;
	var bestBrightnessThreshold = brightnessThreshold	+ (brightnessThreshold * .1);
	var bestColorThreshold		= colorThreshold		+ (colorThreshold * .1);
	
	var sBGArray				= sColor1.match(/(\w{2})/gi);
	var sFontArray				= sColor2.match(/(\w{2})/gi);
	var br 						= parseInt(sBGArray[0], base);
	var bg 						= parseInt(sBGArray[1], base);
	var bb 						= parseInt(sBGArray[2], base);
	var fr 						= parseInt(sFontArray[0], base);
	var fg 						= parseInt(sFontArray[1], base);
	var fb 						= parseInt(sFontArray[2], base);
	
	var bY						= ((br * 299) + (bg * 587) + (bb * 114)) / 1000;
	var fY						= ((fr * 299) + (fg * 587) + (fb * 114)) / 1000;
	var brightnessDifference	= Math.abs(bY-fY);
	var colorDifference			= Math.max ((fr - br) , (br - fr)) + Math.max ((fg - bg) , (bg - fg)) + Math.max ((fb - bb) , (bb - fb));
	
	if ((brightnessDifference < bestBrightnessThreshold) || (colorDifference < bestColorThreshold))
		{ return false; }	// not contrasting enough 
	else
		{ return true; }	// good contrast qualities
}

//	private: Update the current style attribute, with the one provided.
function _SetCSSRule(sRuleName, sProp, sValue, sSheetTitle, oDoc) {
    return;
	var mySheetList, myRules;
	if((oDoc == null) || (typeof(oDoc) == 'undefined'))	{ oDoc = window.top.document; }
	if(oDoc && (mySheetList = oDoc.styleSheets)) {
		for (i=mySheetList.length-1; i >= 0; i--) {		/* look through stylesheets in reverse order that they appear in the document */
			if(sSheetTitle && (sSheetTitle.length > 0) && (mySheetList[i].title.toLowerCase() != sSheetTitle.toLowerCase())) 
				{ continue; }	// Try the next stylesheet
			if(mySheetList[i] && (myRules = (mySheetList[i].cssRules || mySheetList[i].rules))){
				for (j=0; j<myRules.length; j++){
					if(myRules[j].selectorText.toLowerCase() == sRuleName.toLowerCase()){	
						myRules[j].style[sProp] = sValue;
						return;	// We updated the one we wanted, stop finding rules and exit.
					}
				}
			}
		}
	}
}

/*******	The 'GETS'	*******/
//	private: Build Frame's Content (UI).
function _GetLinkContent(strLinkListValue, activateHeader) {
	var iRowCounter					= 0;
	var iColumnCount				= 0;
	var strHtmlLinks				= '';
	var tmpArrLink					= '';
	var star						= '';
	var navCoremetricsPath			= '/DynaNav';
	var sHeaderMarkup				= '';
	var strBreaker1					= '%|_|%';
	var strBreaker2					= '%<<<%';
	var strBreaker3					= '%>>>%';
	var sHeaderTitle				= strLinkListValue.substr(0, strLinkListValue.indexOf(strBreaker1));
	var arrLinkList					= strLinkListValue.slice(((sHeaderTitle.length>0)?(sHeaderTitle.length + strBreaker1.length):0), (strLinkListValue.length)).split(strBreaker3);
	var iLinkListCount				= arrLinkList.length;
	
	if (iLinkListCount > 100)
		{ iColumnCount				= 4; }
	else if (iLinkListCount > 40)
		{ iColumnCount				= 3; }
	else if (iLinkListCount > 15)
		{ iColumnCount				= 2; }
	else
		{ iColumnCount				= 1; }
		
	if( (sHeaderTitle) && (sHeaderTitle.length > 0) ) { 
	  navCoremetricsPath			+= "/" + sHeaderTitle;
	  if(activateHeader) 
		{ sHeaderMarkup				= "<tr id=\"trHead0\"><td id=\"MenuCanvasTitle\" colspan=\"" + iColumnCount + "\" noWrap>" + sHeaderTitle + "</td></tr>"; }
	}
		
	strHtmlLinks					+= "\n<table id=\"MenuCanvasTable\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"100%\">" + sHeaderMarkup + "<tr><td id=\"tdContent_0\" nowrap valign=\"top\">";
	for (var x = 0; x < iLinkListCount; x++) {
		tmpArrLink					= arrLinkList[x].split(strBreaker2);
		if(((star = tmpArrLink[0].replace(/^\s*|\s*$/g,"")).length) > 0) {
			strHtmlLinks				+= "<a href=\"" + navCoremetricsPath + "/" + star.replace(/'/g,"") + "\" id=\"anchItem_" + x + "\"" + " onmouseover=\"UpdateStatus('" + star.replace(/'/g,"\\'") + "');return true;\" onmouseout=\"UpdateStatus('');return true;\" onclick=\"BacOut('" + tmpArrLink[1].replace(/\'/g, "%27").replace(/^\s*|\s*$/g,"") + "','" + navCoremetricsPath + "/" + star.replace(/'/g,"") + "');return false;\"><span>" + star + "</span></a>";
			iRowCounter++;
			
			if (iRowCounter >= (iLinkListCount / iColumnCount))	{
				iRowCounter				= 0;
				strHtmlLinks			+= "</td><td id=\"tdContent_" + x + "\" nowrap valign=\"top\">";
			}
		}
	}
	strHtmlLinks		+= "</td></tr></table>\n";
	return strHtmlLinks;
};

//	private: Gets the iframe object in the current document.
function _GetFrame(oContainer) {
	// Current count of frame objects in the document (before creation of new iframe);
	var iDocFrameLength						= window.frames.length;

	// IFrame Object:
	var objIframe 							= new Object();
	objIframe.theFrameElement				= null;	
	objIframe.theFrameDocument				= null;
	objIframe.theFrameDocumentInnerTable	= null;
	objIframe.theID 						= 'WCHiFrame';

	// Get the created frame object(s) from the Dom, if not available returns NULL.
	objIframe.theFrameElement				= _GetObj(objIframe.theID);
	objIframe.theFrameDocument				= _GetIFrameDocument(_GetWindowFrameObj(objIframe.theID, iDocFrameLength));
	objIframe.theFrameDocumentInnerTable	= _GetObj('MenuCanvas', objIframe.theFrameDocument);

	// Return the Iframe object (not just the Dom object but its attributes also);
	return objIframe;
};

//	private: returns iFrame inner document object.
function _GetIFrameDocument(oIframe){
    
    try {
	    if( oIframe.contentDocument ) 		{ return oIframe.contentDocument; }			// NS6 
	} catch(err) {}
	
	try {
	    if( oIframe.contentWindow )   		{ return oIframe.contentWindow.document; }	// IE5.5+ 
	} catch(err) {}
	
	try {
 	    if( oIframe.document )        		{ return oIframe.document; }				// IE5
 	} catch(err) {}
 	
	return null; 
};

//	private: returns iFrame object reference.
function _GetWindowFrameObj(frameid, prevlen) {
	// Check for a named frame first,
	// Some browsers may not detect the new object... so we get the last frame object in the document.
	if( window.frames[frameid] ) 			{ return top.frames[frameid]; } 
	if( window.frames.length > prevlen ) 	{ return top.frames[window.frames.length - 1]; }
	return null;
};

//	private: returns a given object reference.
function _GetObj(vObj, oDoc) {
	// If the parameter has already been found return the object.
	// Otherwise, get the element in the document, and return it's object.
	var oObj = null;
	
	switch( typeof(vObj) ) {
		case "object":
			oObj = vObj;
			break;
		case "string":
			var vTempDocument = oDoc;	
			if( (oDoc == null) || (typeof(oDoc) == 'undefined') )		{ vTempDocument = window.top.document; }
			if( vTempDocument ){ 
				if( document.getElementsByTagName 
					&& (vObj.indexOf('#') != -1) 
					&& (oTmp = vTempDocument.getElementsByTagName(vObj.replace('#',''))) 
					&& (oTmp.length > 0) )								{ oObj = oTmp[0]; }
				else if( document.getElementById 
					&& (oTmp = vTempDocument.getElementById(vObj)) )	{ oObj = oTmp; }
				else if( document.getElementByName 
					&& (oTmp = vTempDocument.getElementByName(vObj)) )	{ oObj = oTmp; }
			}
			break;
	}
	return oObj;
};

//	private: Retrive HTML Anchor Objects
function _GetFilteredLinkObjects(sFilter){
	return _GetDocumentLinkObjects(sFilter);
};
function _GetDocumentLinkObjects(sFilterAttribute){
	var anchArr	= new Array();
	if (document.links) {
		var attrNode; 
		for(var i = 0; i < document.links.length; i++) {
			attrNode = document.links[i].getAttributeNode('Filter1');
			if(attrNode && (attrNode != null)) {
				if (attrNode.value == sFilterAttribute) {
					anchArr[anchArr.length] = document.links[i];
				}
			}
		}
	}
	return anchArr;
};

//	private: Retrive HTML Input Objects
function _GetFilteredLinkHiddenObjects(sFilter){
	return _GetDocumentInputObjects("hidden", sFilter);
};
function _GetDocumentInputObjects(sInputType, sFilterAttribute) {
	var arrHiddenInputCollection	= new Array();
	if (document.getElementsByTagName) {
		var arrDocInputCollection	= document.getElementsByTagName('input');
		var attrNode; 
		for(var i = 0; i < arrDocInputCollection.length; i++) {
			if(arrDocInputCollection[i] && (arrDocInputCollection[i] != null)) {
				if(arrDocInputCollection[i].type == sInputType) {
					attrNode = arrDocInputCollection[i].getAttributeNode('Filter1');
					if(attrNode && (attrNode != null)) {
						if (attrNode.value == sFilterAttribute) {
							arrHiddenInputCollection[arrHiddenInputCollection.length] = arrDocInputCollection[i];
						}
					}				
				}
			}
		}
	}
	return arrHiddenInputCollection;
};
// End Hide Code-->
