//  TelcoTwo Java Script
//  Date: 11 Feb 2008
//  Author: Piet Swanepoel



	var order_toggle = false;
	var advanced_toggle = false;
	var cal_toggle = true;
	var origTableHTML = "";
	var first = true;
	var browser=navigator.appName;
	var b_version=navigator.appVersion;
	var version=parseFloat(b_version);
	var criteria_toggle = false;
	var graph_toggle = false;
	var origGraphHTML = "";

	
	<!--
	//Load and save original table
	function HideOrderTable()
	{
		//alert(browser);
		if(browser != "Microsoft Internet Explorer")
		{
			origTableHTML = document.getElementById("order_table").innerHTML;
			document.getElementById("order_table").innerHTML = "<tr><td></td></tr>";
		}
		//else
		//	alert("Facility only works some browsers like Firefox");
		
	}
	//-->
	
	<!--
	//Load and save original table
	function ShowTable()
	{
		if(browser != "Microsoft Internet Explorer")
		{
			document.getElementById("order_table").innerHTML = origTableHTML;
			//alert("hello show");
		}
		else
			alert("Facility only works on some browsers like Firefox");
	}
	//-->
	
	<!--
	function ShowOrder()
	{

		if(order_toggle == true)
		{
			order_toggle = false;
			HideOrderTable();
			//alert("Hide");
		}
		else
		{
			order_toggle = true;
			ShowTable();
			//alert("Show");
		}
		
		//alert(origSortTable[0].innerHTML);
	}
	//-->

	<!--
	function ShowOrderNew()
	{

		if(order_toggle == true)
		{
			order_toggle = false;
			document.getElementById("all_order").style.visibility = "hidden";
				
			//alert("Hide");
		}
		else
		{
			order_toggle = true;
			document.getElementById("all_order").style.visibility = "visible";
			//alert("Show");
		}
		
		//alert(origSortTable[0].innerHTML);
	}
	//-->
	
	// Detail Search page
	
	
	

	
	<!--
	function ShowCriteria()
	{
		if(criteria_toggle == true)
		{
			document.getElementById("crit1").style.visibility = "hidden";
			document.getElementById("crit2").style.visibility = "hidden";
			document.getElementById("crit3").style.visibility = "hidden";
			document.getElementById("crit4").style.visibility = "hidden";
			document.getElementById("crit5").style.visibility = "hidden";
			document.getElementById("crit6").style.visibility = "hidden";
			document.getElementById("crit7").style.visibility = "hidden";
			document.getElementById("crit8").style.visibility = "hidden";
			criteria_toggle = false;
		}
		else
		{
			document.getElementById("crit1").style.visibility = "visible";
			document.getElementById("crit2").style.visibility = "visible";
			document.getElementById("crit3").style.visibility = "visible";
			document.getElementById("crit4").style.visibility = "visible";
			document.getElementById("crit5").style.visibility = "visible";
			document.getElementById("crit6").style.visibility = "visible";
			document.getElementById("crit7").style.visibility = "visible";
			document.getElementById("crit8").style.visibility = "visible";
			criteria_toggle = true;
		}
	}
	//-->
	
	// Shows and hides graphs on pages with graphs
	<!--
	//Load and save original Graph
	function HideGraph()
	{
		//alert(browser);
		if(browser != "Microsoft Internet Explorer")
		{
			//origGraphHTML = document.getElementById("graph1").innerHTML;
			if(document.getElementById("graph1") != null)
				document.getElementById("graph1").innerHTML = "<td></td>";
			if(document.getElementById("graph2") != null)
				document.getElementById("graph2").innerHTML = "<td></td>";
			//alert(origGraphHTML.substr(0,20));
		}
		else
			alert("Facility only works on some browsers like Firefox");
	}
	//-->
	
	
	<!--
	//Load and save original Graph
	// Functions to hide the calendars on search pages - for microsofts sake
	function hideCals()
	{
		cal_toggle = false;
		document.getElementById("cal_start").style.visibility = "hidden";
		document.getElementById("cal_end").style.visibility = "hidden";
	}
	
	function viewCals()
	{
		cal_toggle = true;
		document.getElementById("cal_start").style.visibility = "visible";
		document.getElementById("cal_end").style.visibility = "visible";
	}
	
	function ToggleCal()
	{
		if(cal_toggle == true)
		{
			hideCals();
			//alert("Hide");
		}
		else
		{
			viewCals();
			//alert("Show");
		}
	}
	//-->
	
	<!--
	//Switch on or off an advanced marked table	
	function ToggleAdvanced()
	{
		if(advanced_toggle == true)
		{
			advanced_toggle = false;
			document.getElementById("advanced").style.visibility = "hidden";
		}
		else
		{
			advanced_toggle = true;
			document.getElementById("advanced").style.visibility = "visible";
		}
	}
	//-->
	
	
	<!--
	// The function below are used on the TeleBrandConfig.cfm Page
		function getHEXstring(val)
		{
			var output;
			
			if(val < 10)
				output = String(val);
			else
			{
				switch(val)
				{
					case 10:
						output = "A";
						break;
					case 11:
						output = "B";
						break;
					case 12:
						output = "C";
						break;
					case 13:
						output = "D";
						break;
					case 14:
						output = "E";
						break;
					case 15:
						output = "F";
						break;
					default:
						output = "0";
						break;
				}
			}
			
			return output;
		}
		//-->
		
		<!--
	// The function below are used on the TeleBrandConfig.cfm Page
		function MakeHEXstring(tval, incolour, tref)
		{
			var tdigit;
			
			tdigit = getHEXstring(tval);
			tdigit = incolour.substring(0, tref) + tdigit + tdigit + incolour.substring(tref+2, 10);
			
			return tdigit;
		}
		//-->
		
		<!-- // change colour value in the display, the values and the input form
		// The function below are used on the TeleBrandConfig.cfm Page
		function changecolour(the_id, my_id, col_val)
		{
			document.getElementById(the_id).bgColor=col_val;
			//document.getElementsByName(the_id).bgColour = col_val;
			//document.getElementById(the_id).innerHTML=col_val;
			document.getElementById(my_id).value=col_val;
			//document.getElementsByName(my_id).value=col_val;
		}
		//-->
		
		<!-- // These buttons are used for workarounds for multiple image buttons using IE
		function SubmitThisform()
		{
			//document.getElementById("butt01").value = "B1";
			if(browser != "Microsoft Internet Explorer")
				document.FRM.submit();
			else
				{
					if(document.getElementById("search_form") != null)
						document.getElementById("search_form").submit();
				}
			return true;
		}
		// -->
		
		
		<!-- // These buttons are used for workarounds for multiple image buttons using IE
		function OnButton1()
		{
			document.getElementById("butt01").value = "B1";
			if(browser != "Microsoft Internet Explorer")
				document.FRM.submit();
			else
				{
					if(document.getElementById("search_form") != null)
						document.getElementById("search_form").submit();
				}
			return true;
		}
		// -->
		
		function OnButton2()
		{
			document.getElementById("butt01").value = "B2";
			if(browser != "Microsoft Internet Explorer")
				document.FRM.submit();
			else
				{
					if(document.getElementById("search_form") != null)
						document.getElementById("search_form").submit();
				}
			return true;
		}      
		
		function OnButton3()
		{
			document.getElementById("butt01").value = "B3";
			if(browser != "Microsoft Internet Explorer")
				document.FRM.submit();
			else
				{
					if(document.getElementById("search_form") != null)
						document.getElementById("search_form").submit();
				}
			return true;
		}
		
		function OnButton4()
		{
			document.getElementById("butt01").value = "B4";
			if(browser != "Microsoft Internet Explorer")
				document.FRM.submit();
			else
				{
					if(document.getElementById("search_form") != null)
						document.getElementById("search_form").submit();
				}
			return true;
		}
		
		function OnButton5()
		{
			document.getElementById("butt01").value = "B5";
			if(browser != "Microsoft Internet Explorer")
				document.FRM.submit();
			else
				{
					if(document.getElementById("search_form") != null)
						document.getElementById("search_form").submit();
				}
			return true;
		}
		
		function OnButton6()
		{
			document.getElementById("butt01").value = "B6";
			if(browser != "Microsoft Internet Explorer")
				document.FRM.submit();
			else
				{
					if(document.getElementById("search_form") != null)
						document.getElementById("search_form").submit();
				}
			return true;
		}
		
		
		function doChangeHover() 
		{

			var targetAnchor = document.getElementById('myAnchor');
			targetAnchor.className = (targetAnchor.className == 'over') ? '' : 'over' ;
		
		}
		
		
		


