// GENERAL SCRIPT -----------------------------------------------------------------

// IE-only - for building HTML body of popup objects.
var useIEPopup = false;//(is_ie5_5up && is_win);
var hideAllDropDownsOnMenuOpen = (is_ie6 && is_win);
var stubHTML_preInclude = '<html><head>';
var stubHTML_preContent = '</head><body scroll="auto" topmargin="0" leftmargin="0" '
							+ 'bottommargin="0" rightmargin="0" '
							+ 'style="border: 0; background: transparent none;">';
var stubHTML_postContent = '</body></html>';


//dx:custom-drop-down ----------------------------------------------------------------------------------

var customDropdowns = new Object();

// If using IE popups, make sure they're closed before unloading the page.
if (useIEPopup) {
	bodyOnUnload.push(
		function() {
			for (var i in customDropdowns) {
				hideCustomDropdownOptions(customDropdowns[i]);
			}
		}
	);
}

function setupCustomDropdown(divDropdown, options, settings) {
	customDropdowns[divDropdown.id] = divDropdown;
	
	divDropdown.options = options;
	divDropdown.hasFormField = settings.hasFormField;
	divDropdown.FormFieldName = settings.name;
	divDropdown.optionClass = settings.optionClass;
	divDropdown.optionHighlightClass = settings.optionHighlightClass;
	divDropdown.selectedValue = settings.value;
	divDropdown.dropDir = settings.dropDir;
	
	// Either the main document object, or the IE popup document object (IE 5.5+).
	divDropdown.optionDoc = document;
	
	divDropdown.overDiv = false;
	divDropdown.overDropdown = false;
	
	// Give drop DIV its own link to the customDropdowns data structure. This is necessary 
	// because in IE, when popup appears, the drop div will live in there and will need 
	// a reference to the opening page's data structure.
	getObjectById(divDropdown.id + '_DropBox').customDropdowns = customDropdowns;
	
	// DIV events.
	
	divDropdown.onchangeCode = settings.onchange;
	divDropdown.onchange = dxCustomDropdown_onchange;
	divDropdown.onclick = dxCustomDropdown_onclick;
	divDropdown.onmouseover = dxCustomDropdown_onmouseover;
	divDropdown.onmouseout = dxCustomDropdown_onmouseout;
	
	// Child object events.
	
	divDropdown.onDropBoxMouseOver = dxCustomDropdown_onDropBoxMouseOver;
	divDropdown.onDropBoxMouseOut = dxCustomDropdown_onDropBoxMouseOut;
	divDropdown.onOptionClick = dxCustomDropdown_onOptionClick;
	divDropdown.onOptionMouseOver = dxCustomDropdown_onOptionMouseOver;
	divDropdown.onOptionMouseOut =  dxCustomDropdown_onOptionMouseOut;
	
	// Utilities.
	
	divDropdown.getOptionByID = dxCustomDropdown_getOptionByID;
}

function dxCustomDropdown_onchange(newValue) {
	eval(this.onchangeCode);
}

function dxCustomDropdown_onclick() {
	clearTimeout(this.timer);
	showCustomDropdownOptions(this);
}

function dxCustomDropdown_onmouseover() {
	this.overDiv = true;
	clearTimeout(this.timer);
}

function dxCustomDropdown_onmouseout() {
	this.overDiv = false;
	if (!this.overDropdown) 
		this.timer = setTimeout("hideCustomDropdownOptions(document.getElementById('" + this.id + "'));", 500);
}

// Child object events.

function dxCustomDropdown_onDropBoxMouseOver() {
	this.overDropdown = true;
	clearTimeout(this.timer);
}

function dxCustomDropdown_onDropBoxMouseOut() {
	this.overDropdown = false;
	if (!this.overDiv)
		this.timer = setTimeout("hideCustomDropdownOptions(document.getElementById('" + this.id + "'));", 500);
}

function dxCustomDropdown_onOptionClick(OptionID) {
	var option = this.getOptionByID(OptionID);
	if (option) {
		if (this.selectedValue != option.value) {
			// User has chosen a new value.
			
			// Swap icon and caption.
			document.getElementById(this.id + '_CaptionCell').innerHTML = 
				(option.icon ? '<img src="' + option.icon + '" class="topIcon"/>' : '') + 
				'<a href="#" onclick="document.getElementById(\'' + this.id + '\').onclick(); return false;">'
				+ option.caption
				+ '</a>';
			
			// Swap value and possibly form field.
			this.selectedValue = option.value;
			if (this.hasFormField) {
				var formField = document.getElementById(this.FormFieldName);
				formField.value = option.value;
				formField.isDirty = true;
			}
			
			// Fire event.
			this.onchange(option.value);
		}
		
		// Close menu.
		hideCustomDropdownOptions(this);
	}
}

function dxCustomDropdown_onOptionMouseOver(OptionID) {
	var option = this.getOptionByID(OptionID);
	var optionControl = this.optionDoc.getElementById(OptionID);
	
	if (option && optionControl) {
		if (this.optionHighlightClass) {
			optionControl.className = this.optionHighlightClass;
		}
	}
}

function dxCustomDropdown_onOptionMouseOut(OptionID) {
	var option = this.getOptionByID(OptionID);
	var optionControl = this.optionDoc.getElementById(OptionID);
	
	if (option && optionControl) {
		if (this.optionClass) {
			optionControl.className = this.optionClass;
		}
	}
}

// Utilities.

function dxCustomDropdown_getOptionByID(OptionID) {
	for (var i in this.options) {
		if (this.options[i].id == OptionID) return this.options[i];
	}
	return null;
}




function showCustomDropdownOptions(divDropdown) {
	var optionBox = document.getElementById(divDropdown.id + '_DropBox');
	var rect = getRect(divDropdown);
	var optionRect;
	
	if (useIEPopup) {
		if (!divDropdown.popup) {
			// Create IE popup object and initialize.
			
			divDropdown.popup = window.createPopup();
			var popDoc = divDropdown.popup.document;
			popDoc.write(stubHTML_preInclude);
			
			// Add stylesheets from the current document.
			for (var i in document.styleSheets) {
				if (document.styleSheets[i].href) {
					popDoc.write(
						'<link rel="stylesheet" type="text/css" href="'
						+ escape(document.styleSheets[i].href) + '">');
				} else {
					popDoc.write(
						'<style type="text/css">\n' + document.styleSheets[i].cssText
						+ '\n</style>');
				}
			}
			
			popDoc.write(stubHTML_preContent);
			popDoc.write(optionBox.outerHTML);
			popDoc.write(stubHTML_postContent);
			popDoc.close();
			showObject(null, popDoc.all[optionBox.id]);
			
			// Link popup event handlers to parent page event handlers.
			popDoc.all[optionBox.id].customDropdowns = customDropdowns;
			
			// Link other references.
			divDropdown.optionDoc = popDoc;
		}
		var remoteOptionBox = divDropdown.popup.document.getElementById(optionBox.id);
		remoteOptionBox.style.width = rect.right - rect.left;
		
		divDropdown.popup.show(0, 0, 0, 0, document.body);
		optionRect = getRect(remoteOptionBox);
		
		if (divDropdown.dropDir == 'down') {
			divDropdown.popup.show(0, rect.bottom - rect.top, rect.right - rect.left, 
				optionRect.bottom - optionRect.top, divDropdown);
		} else {
			divDropdown.popup.show(0, 0 - (optionRect.bottom - optionRect.top),
				rect.right - rect.left, optionRect.bottom - optionRect.top, divDropdown);
		}
		
	} else {
		if (divDropdown.dropDir == 'down') {
			optionBox.style.left = rect.left;
			optionBox.style.top = rect.bottom;
			optionBox.style.width = rect.right - rect.left;
			
			showObject(null, optionBox);
			
		} else {
			optionBox.style.left = rect.left;
			optionBox.style.width = 0;
			
			showObject(null, optionBox);
			
			optionRect = getRect(optionBox);
			optionBox.style.top = rect.top - (optionRect.bottom - optionRect.top);
			optionBox.style.width = rect.right - rect.left;
		}
	}
}

function hideCustomDropdownOptions(divDropdown) {
	if (useIEPopup) {
		if (divDropdown.popup) {
			divDropdown.popup.hide();
		}
	} else {
		var optionBox = document.getElementById(divDropdown.id + '_DropBox');
		hideObject(null, optionBox);
	}
}



//dx:menu-bar ------------------------------------------------------------------------------------------

var menuBars = new Object();

// If using IE popups, make sure they're closed before unloading the page.
if (useIEPopup) {
	bodyOnUnload.push(
		function() {
			for (var i in menuBars) {
				hideMenu(menuBars[i]);
			}
		}
	);
}

function setupMenuBar(menuBarID, settings) {
	var menuBar = new Object();
	menuBar.menuBarID = menuBarID;
	
	if (useIEPopup) menuBar.popup = false;
	
	for (var i in settings) {
		menuBar[i] = settings[i];
	}
	
	menuBars[menuBarID] = menuBar;
	
	// Either the main document object, or the IE popup document object (IE 5.5+).
	menuBar.menuDoc = document;
	
	// Horizontal and vertical offsets (determining the position of the drop menu, when it 
	// appears).
	menuBar.hOffset = settings.hOffset;
	menuBar.vOffset = settings.vOffset;
	
	// Give menu DIVs their own references to the menuBars data structure. This is necessary 
	// because in IE, when popup appears, the menu div will live in there and will need 
	// a reference to the opening page's data structure.
	for (var i in menuBar.menus) {
		var menu = getObjectById('menu_' + menuBar.menus[i]);
		menu.menuBars = menuBars;
		menu.menuBar = menuBar;
		menu.overMenuHeader = false;
		menu.overMenu = false;
	}
	
	menuBar.menuItemClick = dxMenuBar_menuItemClick;
	menuBar.menuItemKeyDown = dxMenuBar_menuItemKeyDown;
	menuBar.menuItemFocus = dxMenuBar_menuItemFocus;
	menuBar.menuItemBlur = dxMenuBar_menuItemBlur;
	menuBar.menuItemMouseOver = dxMenuBar_menuItemMouseOver;
	menuBar.menuItemMouseOut = dxMenuBar_menuItemMouseOut;
	menuBar.initClose = dxMenuBar_initClose;
	menuBar.stopClose = dxMenuBar_stopClose;
	
	if (useIEPopup) {
		// Create IE popup object and initialize.
		
		menuBar.popup = window.createPopup();
		var popDoc = menuBar.popup.document;
		popDoc.write(stubHTML_preInclude);
		
		// Add stylesheets from the current document.
		for (var i in document.styleSheets) {
			if (document.styleSheets[i].href) {
				popDoc.write(
					'<link rel="stylesheet" type="text/css" href="'
					+ escape(document.styleSheets[i].href) + '">');
			} else {
				popDoc.write(
					'<style type="text/css">\n' + document.styleSheets[i].cssText
					+ '\n</style>');
			}
		}
		
		popDoc.write(stubHTML_preContent);
		popDoc.write('<div id="MenuContainer" style="margin: 0px; padding: 0px; border: 0px;"></div>');
		popDoc.write(stubHTML_postContent);
		popDoc.close();
		
		// Link references.
		menuBar.menuDoc = popDoc;
	}
}

function dxMenuBar_menuItemClick(itemID) {
	var item = this.items[itemID];
	
	if (useIEPopup) displayMenu(this.menuBarID);	// hide IE popup
	
	if (item.onclick()) {
		window.location.href = item.href;
	}
}

function dxMenuBar_menuItemKeyDown(e, menuBarID, subMenuID, itemID) {
	if (!e) e = window.event;

	var iCode;
	if ((e.charCode) && (e.keyCode==0)) {
		iCode = e.charCode
	}
	else {
		iCode = e.keyCode;
	}
	
	var ret = dxMenuBar_menuItemProcessKeyDown(e.shiftKey, iCode, menuBarID, subMenuID, itemID);
	return(ret);
}
function dxMenuBar_menuItemProcessKeyDown(shiftKey, iCode, menuBarID, subMenuID, itemID) {
	var topMenu, topMenuItems;
	var subMenu, subMenuItems;
	var i, currentTopMenuIndex, currentSubMenuIndex, subMenuIDWithNoPrefix;

	subMenuIDWithNoPrefix = subMenuID.substr(5);
	currentTopMenuIndex = -1;
	currentSubMenuIndex = -1;

	topMenu = document.getElementById(menuBarID + "_table");
	if (topMenu) {
		topMenuItems = topMenu.getElementsByTagName('A');
		if (topMenuItems) {
			for (i = 0; i < topMenuItems.length; i++) {
				if (topMenuItems[i].id == "link_" + subMenuIDWithNoPrefix) {
					currentTopMenuIndex = i;
				}
			}
		}
	}

	subMenu = document.getElementById(subMenuID);
	if (subMenu) {
		subMenuItems = subMenu.getElementsByTagName('A');
		if (subMenuItems) {
			for (i = 0; i < subMenuItems.length; i++) {
				if (subMenuItems[i].id == "menuItemLink_" + itemID) {
					currentSubMenuIndex = i;
				}
			}
		}
	}

	switch(iCode) {
		case 9: // Tab
			if (shiftKey && currentSubMenuIndex == 0) {
				dxMenuBar_menuItemProcessKeyDown(false, 38, menuBarID, subMenuID, itemID);
			}
			else if (!shiftKey && currentSubMenuIndex == (subMenuItems.length - 1)) {
				if (currentTopMenuIndex != (topMenuItems.length - 1)) {
					topMenuItems[currentTopMenuIndex+1].focus();
					// The next line was the old approach, at least temporarily scrapped because Deque was having problems with it.
					//dxMenuBar_menuItemProcessKeyDown(false, 39, menuBarID, subMenuID, itemID);
				}
				else {
					topMenuItems[currentTopMenuIndex].focus();
					return(true);
				}
			}
			else {
				return(true);
			}
			break;

		case 38: // Up
			if (subMenuItems) {
				if (currentSubMenuIndex > 0) {
					subMenuItems[currentSubMenuIndex-1].focus();
				}
				else {
					topMenuItems[currentTopMenuIndex].focus();
				}
			}
			break;

		case 40: // Down
			if (subMenuItems && currentSubMenuIndex != -1 && currentSubMenuIndex < (subMenuItems.length - 1)) {
				subMenuItems[currentSubMenuIndex+1].focus();
			}
			break;

		case 37: // Left
		case 39: // Right
			menuProcessKeyDown(shiftKey, iCode, menuBarID, topMenuItems[currentTopMenuIndex].id.substr(5));
			break;

		default:
			return(true);
			break;
	}

	return(false);
}

function dxMenuBar_menuItemMouseOver(itemID) {
	dxMenuBar_menuItemMouseOverOrFocus(this, itemID);
}
function dxMenuBar_menuItemFocus(itemID) {
	dxMenuBar_menuItemMouseOverOrFocus(this, itemID);
}
function dxMenuBar_menuItemMouseOverOrFocus(objThis, itemID) {
	objThis.stopClose();
	var menuItem = objThis.menuDoc.getElementById("menuItem_" + itemID);
	menuItem.className = objThis.menuItemSelectedClass;
}

function dxMenuBar_menuItemMouseOut(itemID) {
	dxMenuBar_menuItemMouseOutOrBlur(this, itemID);
}
function dxMenuBar_menuItemBlur(itemID) {
	dxMenuBar_menuItemMouseOutOrBlur(this, itemID);
}
function dxMenuBar_menuItemMouseOutOrBlur(objThis, itemID) {
	objThis.initClose();
	var menuItem = objThis.menuDoc.getElementById("menuItem_" + itemID);
	menuItem.className = objThis.menuItemClass;
}

function dxMenuBar_initClose() {
	this.timer = setTimeout("displayMenu('" + this.menuBarID + "', null);unhideAllDropDownsIfIE6();", 500);
}

function dxMenuBar_stopClose() {
	clearTimeout(this.timer);
}

function menuKeyDown(e, menuBarID, menuID) {
	if (!e) e = window.event;

	var iCode;
	if ((e.charCode) && (e.keyCode==0)) {
		iCode = e.charCode
	}
	else {
		iCode = e.keyCode;
	}
	
	var ret = menuProcessKeyDown(e.shiftKey, iCode, menuBarID, menuID);
	return(ret);
}
function menuProcessKeyDown(shiftKey, iCode, menuBarID, menuID, extra) {
	var topMenu, topMenuItems;
	var subMenu, subMenuItems;
	var i, currentTopMenuIndex;

	currentTopMenuIndex = -1;

	topMenu = document.getElementById(menuBarID + "_table");
	if (topMenu) {
		topMenuItems = topMenu.getElementsByTagName('A');
		if (topMenuItems) {
			for (i = 0; i < topMenuItems.length; i++) {
				if (topMenuItems[i].id == "link_" + menuID) {
					currentTopMenuIndex = i;
				}
			}
		}
	}

	subMenu = document.getElementById("menu_" + menuID);
	if (subMenu) {
		subMenuItems = subMenu.getElementsByTagName('A');
	}

	switch(iCode) {
		case 9: // Tab (and Shift-Tab)
			if (shiftKey) {
				if (currentTopMenuIndex < 1) {
					return(true);
				}
				else {
					var previousSubMenu = document.getElementById("menu_" + topMenuItems[currentTopMenuIndex-1].id.substr(5));
					if (previousSubMenu) {
						var previousSubMenuItems = previousSubMenu.getElementsByTagName('A');
						if (previousSubMenuItems.length > 0) {
							// We have to make the previous submenu visible first,
							// or IE chokes due to timing and visibility issues.
							menuFocus(menuBarID, previousSubMenu.id.substr(5));
							setTimeout("document.getElementById('" + previousSubMenuItems[previousSubMenuItems.length-1].id + "').focus();", 10);
						}
					}
				}
			}
			else {
				if (subMenuItems) {
					if (subMenuItems.length == 0) {
						return(true);
					}
					else {
						subMenuItems[0].focus();
					}
				}
			}
			break;
			
		case 40: // Down
			if (subMenuItems) {
				if (subMenuItems.length > 0) {
					subMenuItems[0].focus();
				}
			}
			break;
			
		case 37: // Left
			if (topMenuItems && currentTopMenuIndex != -1 && currentTopMenuIndex > 0) {
				topMenuItems[currentTopMenuIndex-1].focus();
			}
			break;

		case 39: // Right
			if (topMenuItems && currentTopMenuIndex != -1 && currentTopMenuIndex < (topMenuItems.length - 1)) {
				topMenuItems[currentTopMenuIndex+1].focus();
			}
			break;

		default:
			return(true);
			break;
	}

	return(false);
}

function menuMouseOver(menuBarID, menuID) {
	menuMouseOverOrFocus(menuBarID, menuID);
}
function menuFocus(menuBarID, menuID) {
	menuMouseOverOrFocus(menuBarID, menuID);
}
function menuMouseOverOrFocus(menuBarID, menuID) {
	if (menuBars[menuBarID]) {
		if (menuBars[menuBarID].timer) menuBars[menuBarID].stopClose();
		setTimeout("displayMenu('" + menuBarID + "','" + menuID + "');", 10);
	}
}

function menuMouseOut(menuBarID, menuID) {
	menuMouseOutOrBlur(menuBarID, menuID);
}
function menuBlur(menuBarID, menuID) {
	menuMouseOutOrBlur(menuBarID, menuID);
}
function menuMouseOutOrBlur(menuBarID, menuID) {
	if (menuBars[menuBarID]) {
		menuBars[menuBarID].initClose();
	}
}

function displayMenu(menuBarID, menuID) {
	var menuBar = menuBars[menuBarID];
	
	hideAllDropDownsIfIE6();

	if (useIEPopup) {
		if (menuID) {
			showMenu(menuBar, menuID);
		} else {
			hideMenu(menuBar);
		}
	} else {
		var counter;
		// Show the new menu item BEFORE hiding any that were open.
		for(counter = 0; counter < menuBar.menus.length; counter++) {
			if(menuBar.menus[counter] == menuID) {
				showMenu(menuBar, menuID);
			}
		}
		for(counter = 0; counter < menuBar.menus.length; counter++) {
			if(menuBar.menus[counter] != menuID) {
				hideMenu(menuBar, menuBar.menus[counter]);
			}
		}
	}
}

function hideAllDropDownsIfIE6() {
	if (hideAllDropDownsOnMenuOpen) {
		var dropDownLists = document.getElementsByTagName('SELECT');
		if (dropDownLists) {
			for (var i = 0; i < dropDownLists.length; i++) {
				if (dropDownLists[i].style.display != "none") {
					dropDownLists[i].style.unhideOnMenuClose = "1";
					dropDownLists[i].style.display = "none";
				}
			}
		}
	}
}

function unhideAllDropDownsIfIE6() {
	if (hideAllDropDownsOnMenuOpen) {
		var dropDownLists = document.getElementsByTagName('SELECT');
		if (dropDownLists) {
			for (var i = 0; i < dropDownLists.length; i++) {
				if (dropDownLists[i].style.unhideOnMenuClose == "1") {
					dropDownLists[i].style.display = "";
				}
				dropDownLists[i].style.unhideOnMenuClose = "";
			}
		}
	}
}

function showMenu(menuBar, menuID, setFocus) {
	var menu = getObjectById("menu_" + menuID);
	var header = getObjectById("header_" + menuID);
	var rect = getRect(header);
	var headerWidth = rect.right - rect.left;
	var menuRect;
	
	if (useIEPopup) {
		if (menuID) {
			var popDoc;
			
			popDoc = menuBar.popup.document;
			popDoc.all.MenuContainer.innerHTML = menu.outerHTML;
			
			var remoteMenu = popDoc.all[menu.id];
			
			// Link popup event handlers to parent page event handlers.
			remoteMenu.menuBars = menuBars;
			
			showObject(null, remoteMenu);
			remoteMenu.style.width = headerWidth;
			
			// Call .show() twice to initialize the dimensional properties of the inner 
			// menu div. 
			menuBar.popup.show(0, 0, 0, 0, document.body);
			menuRect = getRect(remoteMenu);
			menuBar.popup.show(menuBar.hOffset, (rect.bottom - rect.top) + menuBar.vOffset, 
				menuRect.right - menuRect.left, menuRect.bottom - menuRect.top,
				header);
		}
	} else {
		menu.style.left = rect.left + menuBar.hOffset;
		menu.style.top = rect.bottom + menuBar.vOffset;
		showObject(null, menu);
		
		menuRect = getRect(menu);
		var menuWidth = menuRect.right - menuRect.left;
		
		if (menuWidth < headerWidth) {
			menu.style.width = headerWidth;
		}
	}
}

function hideMenu(menuBar, menuID) {
	if (useIEPopup) {
		if (menuBar.popup) {
			menuBar.popup.hide();
		}
	} else {
		hideObject("menu_" + menuID);
	}
}


//dx:multi-section -------------------------------------------------------------------------------------------------------------------------

function dxMultiSection() {
	this.sections = new Array();
	this.currentSection = 0;
	
	this.showSection = dxMultiSection_showSection;
	this.previousSection = dxMultiSection_previousSection;
	this.nextSection = dxMultiSection_nextSection;
	this.refresh = dxMultiSection_refresh;
	this.showAll = dxMultiSection_showAll;
	this.printPage = dxMultiSection_printPage;
}

function dxMultiSection_showSection(sectionIndex) {
	this.currentSection = sectionIndex;
	if(this.currentSection < 0) 
		this.currentSection = this.sections.length - 1;
	if(this.currentSection >= this.sections.length) 
		this.currentSection = 0;
	this.refresh();
}

function dxMultiSection_previousSection() {
	this.currentSection --;
	if(this.currentSection < 0) 
		this.currentSection = this.sections.length - 1;
	this.refresh();
}

function dxMultiSection_nextSection () {
	this.currentSection ++;
	if(this.currentSection >= this.sections.length) 
		this.currentSection = 0;
	this.refresh();
}

function dxMultiSection_refresh () {
	for(var index = 0; index < this.sections.length; index ++) {
		if(index == this.currentSection)
			this.sections[index].style.display = "inline";
		else
			this.sections[index].style.display = "none";
	}
}

function dxMultiSection_showAll () {
	for(var index = 0; index < this.sections.length; index ++) {
		this.sections[index].style.display = "inline";
	}
}

function dxMultiSection_printPage () {
	this.showAll();
	if(window.print)
		window.print();
}

// Highlights the drop-down arrow image when you mouse over a dxFakeDropdown field
	function dxFakeDropdown_onmouseover() {
		dxFakeDropdown_changeArrowImage(this, root + '/images/dropdownMouseOver.gif');
	}
	
	// Removes the highlight from the drop-down arrow image when you mouse out of a dxFakeDropdown field
	function dxFakeDropdown_onmouseout() {
		dxFakeDropdown_changeArrowImage(this, root + '/images/dropdownIdle.gif');
	}
	
	function dxFakeDropdown_changeArrowImage(currentDropDown, newSourcePath) {
		var imageElements = currentDropDown.getElementsByTagName('img');
		
		for (var i = 0; i < imageElements.length; i++) {
			if (imageElements[i].id == 'FakeDropDownArrow') {
				imageElements[i].src = newSourcePath;
				return;
			}
		}
	}
