		
		function findElementById(id,frame) {
			if ((frame != undefined) && (frame != "") && (frame != 'undefined') && (frame != 'this')) {		
				var doc = top.frames[frame].document;
			}else{
				var doc = document;
			}
			
			if (document.getElementById) {
				if (doc.getElementById(id) != undefined) {
					return doc.getElementById(id);
				}else{
					return false;	
				}
			}else if (document.layers) {
				if (doc[id] != undefined) {
					return doc[id];
				}else{
					return false;	
				}
			}else{
				if (doc.all[id] != undefined) {
					return doc.all[id];
				}else{
					return false;	
				}
			}		
		}
		
		function findElementStyleById(id,frame) {
			var ele = findElementById(id,frame);
			if (document.layers) {
				return ele;
			}else{
				return ele.style;
			}
		}
		
		function changeImg(img_name,img_src) {
			document[img_name].src=img_src;
		}
		
		timerID = 0;
		
		function setDisplay (id,value,frame,pause) {
			clearTimeout(timerID);
			if (pause == undefined || pause == 0) {
				findElementStyleById(id,frame).display = value;
			}else{		
				var funkStr = "findElementStyleById('" + id + "','" + frame + "').display = '" + value + "';";
				timerID = setTimeout(funkStr,pause);
			}
		}
		
		function setVisibility (id,value,frame) {
			if (value == "visible" || value == true) {
				value = "visible";
			}else{
				value = "hidden";
			}
			findElementStyleById(id,frame).visibility = value;
		}		
		
		
		function findElementStyleById(id,frame) {
			var ele = findElementById(id,frame);
			if (document.layers) {
				return ele;
			}else{
				return ele.style;
			}
		};
		
		function setDisplay (id,value,frame) {
			findElementStyleById(id,frame).display = value;
		};
		
		function setVisibility (id,value,frame) {
			if (value == "visible" || value == true) {
				value = "visible";
			}else{
				value = "hidden";
			}
			findElementStyleById(id,frame).visibility = value;
			
		}
		
		
		function dynamicTabs () {
			this.allTabStrips = new Array();
		}
		
		//This will draw out a tab dynamically...it will ensure that the content will stay xhtml(ish)
		var allTabStrips = new Array();
		
		function drawDynamicTabs_orig(tabArray,styleClass,tabLabels,frame,displayType) {		
			allTabStrips.push(tabArray);
			tabId = allTabStrips.length-1;	
			document.write("<style type='text/css'>");
			for (a=1; a<tabArray.length; a++) {
				if (displayType === "display") {
					document.write("#" + tabArray[a] + " { display: none; }");
				}else{
					document.write("#" + tabArray[a] + " { visibility:hidden; }");
				}
			}
			document.write("</style>");
			
			if (tabLabels.length != tabArray.length) {
				tabLabels = tabArray;
			}
			
			document.write("<ul class='" + styleClass + "'>");
			for (a=0; a<tabArray.length; a++) {
				ele = tabArray[a];
				if (a == 0) {
					style = "class=\"tabSelected\"";
				}else{
					style = "";
				}
				document.write("<li id=\"" + ele + "Tab\" " + style + "><a href=\"javascript:turnOnSectionTab('" + ele + "'," + tabId + ",'" + frame + "','" + displayType + "');\">" + tabLabels[a] + "</a></li>");
			}			
			document.write("");
			document.write("</ul>");			
		}
		
		function drawDynamicTabs(tabArray,styleClass,tabLabels,frame,displayType) {		
			allTabStrips.push(tabArray);
			tabId = allTabStrips.length-1;	
			document.write("<style type='text/css'>");
			for (a=1; a<tabArray.length; a++) {
				if (displayType === "display") {
					document.write("#" + tabArray[a] + " { display: none; }");
				}else{
					document.write("#" + tabArray[a] + " { visibility:hidden; }");
				}
			}
			document.write("</style>");
			
			if (tabLabels.length != tabArray.length) {
				tabLabels = tabArray;
			}
			
			document.write("<table class='" + styleClass + "' cellpadding='0px' cellspacing='0px'><tr>");
			
			cellWidth = Math.floor(100/tabArray.length);
			for (a=0; a<tabArray.length; a++) {
				ele = tabArray[a];
				if (a == 0) {
					style = "tabSelected_table";
				}else{
					style = "tab_table";
				}
				document.write("<td id=\"" + ele + "Tab\" class=\"" + style + "\" style=\"width:" + cellWidth + "%\"><a href=\"javascript:turnOnSectionTab('" + ele + "'," + tabId + ",'" + frame + "','" + displayType + "');\">" + tabLabels[a] + "</a></td>");
			}			
			document.write("");
			document.write("</tr></table>");			
		}
		
		
		function turnOnSectionTab(id,tabId,frame,displayType) {
			allTabs = allTabStrips[tabId];			
			for (var a=0; a<allTabs.length; a++) {
				var ele = allTabs[a];
				if (displayType === "display") {
					setDisplay(ele,"none",frame);
				}else{
					setVisibility(ele,"hidden",frame);
				}
				findElementById(ele + "Tab").className = "tab_table";
			}
			if (displayType === "display") {
				setDisplay(id,"inline",frame);
			}else{
				setVisibility(id,"visible",frame);
			}
			findElementById(id + "Tab").className = "tabSelected_table";				
		}
		
				
		
		
	