	/* Author: Gleb Samsonov 
	   Global Real Estate Institute
	*/
	
	
	// the following block is responsible for, essentialy menu behavior
	///////////////////////////////////////////////////////////////////////////////////////
	
		function UpdateView(ptrChld){
			var ptrChild = document.all(ptrChld);
			var ptrState = document.forms("MenuForm").item(ptrChld + "state")

			if (ptrChild.style.display == "none") {
				ptrChild.style.display = "";
				ptrState.value = "";		//we use hidden input to store state info for each menu group
			}
			else {
				ptrChild.style.display = "none";
				ptrState.value = "none";			//none means hide control
			}
		}


		function ClickHandler(){
			var strParentId = window.event.srcElement.id;
			
			if (strParentId.length > 0){	
				if (strParentId.substring(0, 2) == "mp"){  //mp1, mp2, mp3 is a parent cl1, ..2, ..3 are children
					UpdateView("cl" + strParentId.substring(2, 3));  //hide display
				}
			}			
		}


		// we need to decorate our item when mouse pointer is hoverd over link
		function mouseOverHandler(){
			var strParentId = window.event.srcElement;	
			if (strParentId.id.substring(0, 2) == "mp"){
				strParentId.style.color = "#ff9933";
			}
		}

		//remove decoration when mouse is out 
		function mouseOutHandler(){
			var strParentId = window.event.srcElement;
			
			if (strParentId.id.substring(0, 2) == "mp"){
				strParentId.style.color = "#ffff99"; 
			} 
		}


		// convert text to boolean
		function translateTtoB(str){
			if (str == "") {
				return("t")
			}
			else {
				return("f")
			}
		}

		//convert boolean to text
		function translateBtoT(str){
			if (str == "t") {
				return("");
			}else{
				return("none");
			}
		}


		//redirect to specified url on this website with menu status in query string
		function executeLink(strURL){

			var para = translateTtoB(document.forms("MenuForm").item("clastate").value);
			var parb = translateTtoB(document.forms("MenuForm").item("clbstate").value);
			var parc = translateTtoB(document.forms("MenuForm").item("clcstate").value);
			var pard = translateTtoB(document.forms("MenuForm").item("cldstate").value);
			var pare = translateTtoB(document.forms("MenuForm").item("clestate").value);
			var parf = translateTtoB(document.forms("MenuForm").item("clfstate").value);
			var parg = translateTtoB(document.forms("MenuForm").item("clgstate").value);
			var parh = translateTtoB(document.forms("MenuForm").item("clhstate").value);
			var pari = translateTtoB(document.forms("MenuForm").item("clistate").value);
			var parj = translateTtoB(document.forms("MenuForm").item("cljstate").value);
			var park = translateTtoB(document.forms("MenuForm").item("clkstate").value);
			var parl = translateTtoB(document.forms("MenuForm").item("cllstate").value);
			var parm = translateTtoB(document.forms("MenuForm").item("clmstate").value);
			var parn = translateTtoB(document.forms("MenuForm").item("clnstate").value);
			var paro = translateTtoB(document.forms("MenuForm").item("clostate").value);			
			var parp = translateTtoB(document.forms("MenuForm").item("clpstate").value);
					
			window.location.href=strURL + "cla=" + para + "&clb=" + parb + "&clc=" + parc + "&cld=" + pard + "&cle=" + pare + "&clf=" + parf + "&clg=" + parg + "&clh=" + parh + "&cli=" + pari + "&clj=" + parj + "&clk=" + park + "&cll=" + parl + "&clm=" + parm + "&cln=" + parn + "&clo=" + paro + "&clp=" + parp 
			       
		}


		function InitStates(){
			var ptrState = document.forms("MenuForm");
				ptrState.item("clastate").value = translateBtoT(ptrState.item("clastate").value);  //conver params from query string from bool to				
				ptrState.item("clbstate").value = translateBtoT(ptrState.item("clbstate").value);  //text (eg. t = "", f = "none")
				ptrState.item("clcstate").value = translateBtoT(ptrState.item("clcstate").value);  //text (eg. t = "", f = "none")
				ptrState.item("cldstate").value = translateBtoT(ptrState.item("cldstate").value);  //text (eg. t = "", f = "none")
				ptrState.item("clestate").value = translateBtoT(ptrState.item("clestate").value);  //text (eg. t = "", f = "none")
				ptrState.item("clfstate").value = translateBtoT(ptrState.item("clfstate").value);  //text (eg. t = "", f = "none")
				ptrState.item("clgstate").value = translateBtoT(ptrState.item("clgstate").value);  //text (eg. t = "", f = "none")
				ptrState.item("clhstate").value = translateBtoT(ptrState.item("clhstate").value);  //text (eg. t = "", f = "none")
				ptrState.item("clistate").value = translateBtoT(ptrState.item("clistate").value);  //text (eg. t = "", f = "none")
				ptrState.item("cljstate").value = translateBtoT(ptrState.item("cljstate").value);  //text (eg. t = "", f = "none")
				ptrState.item("clkstate").value = translateBtoT(ptrState.item("clkstate").value);  //text (eg. t = "", f = "none")
				ptrState.item("cllstate").value = translateBtoT(ptrState.item("cllstate").value);  //text (eg. t = "", f = "none")
				ptrState.item("clmstate").value = translateBtoT(ptrState.item("clmstate").value);  //text (eg. t = "", f = "none")
				ptrState.item("clnstate").value = translateBtoT(ptrState.item("clnstate").value);  //text (eg. t = "", f = "none")
				ptrState.item("clostate").value = translateBtoT(ptrState.item("clostate").value);  //text (eg. t = "", f = "none")
				ptrState.item("clpstate").value = translateBtoT(ptrState.item("clpstate").value);  //text (eg. t = "", f = "none")
		
				
				document.all("cla").style.display = ptrState.item("clastate").value		//set div tag property (visible/invisible)
				document.all("clb").style.display = ptrState.item("clbstate").value
				document.all("clc").style.display = ptrState.item("clcstate").value
				document.all("cld").style.display = ptrState.item("cldstate").value
				document.all("cle").style.display = ptrState.item("clestate").value
				document.all("clf").style.display = ptrState.item("clfstate").value
				document.all("clg").style.display = ptrState.item("clgstate").value
				document.all("clh").style.display = ptrState.item("clhstate").value
				document.all("cli").style.display = ptrState.item("clistate").value
				document.all("clj").style.display = ptrState.item("cljstate").value
				document.all("clk").style.display = ptrState.item("clkstate").value
				document.all("cll").style.display = ptrState.item("cllstate").value
				document.all("clm").style.display = ptrState.item("clmstate").value
				document.all("cln").style.display = ptrState.item("clnstate").value
				document.all("clo").style.display = ptrState.item("clostate").value
				document.all("clp").style.display = ptrState.item("clpstate").value
		}
	
	///////////////////////////////////////////////////////////////////////////////////////
	///////////////////////////////////////////////////////////////////////////////////////
	
	
	function DownloadPDF()
	{
		iconWin = window.open('/summit/summit2004/download.asp','Downloadwindow','toolbar=no,menubar=no,status=1,scrollbars=no,height=170,width=450');
		iconWin.focus()	
	}
	
	function DownloadPDFReader()
	{
		iconWin = window.open('http://www.adobe.co.uk/products/acrobat/readstep2.html','PDFReaderDownload','toolbar=yes,menubar=yes, statusbar=yes,scrollbars=yes,height=760,width=980, resizable=yes');
		iconWin.focus()	
	}	
	
	function OpenICHotel()
	{
		iconWin = window.open('http://www.ichotelsgroup.com/h/d/6c/1/en/hd/parhb?irs=null','GICHotel','toolbar=yes,menubar=yes, statusbar=yes,scrollbars=yes,height=760,width=980, resizable=yes');
		iconWin.focus()	
	}
	
	
		function ViewPDF(address)
	{
		iconWin = window.open(address,'Addresswindow','toolbar=yes,menubar=no,location=yes, status=1,scrollbars=yes,height=710,width=920, resizable=yes');
		iconWin.focus()
	}


	function ViewPreSumm()
	{
				
		iconWin = window.open('PreSummitAtte.asp','Attendeeswindow','toolbar=no,menubar=no,status=1,scrollbars=yes,height=650,width=850, resizable=yes');
		iconWin.focus()
	}
		
	function OpenWindow(url)
	{
				
		iconWin = window.open(url,'Attendeeswindow','toolbar=no,menubar=no,status=1,scrollbars=yes,height=650,width=850, resizable=yes');
		iconWin.focus()
	}
	
	
	function OpenLegend(url)
	{
				
		iconWin = window.open(url,'Attendeeswindow','toolbar=no,menubar=no,status=1,scrollbars=no,height=200,width=220, resizable=no');
		iconWin.focus()
	}
	
	
	function AlterateMsg(){
	if (msgID) {
		msg = document.createTextNode("Chairing A Discussion");
		msgID = false;
	}
	else {
		msg = document.createTextNode("Sponsorship Opportunities");
		msgID = true;
	}
	
	var oSpan = document.getElementById("Msg");
	oSpan.childNodes(0).replaceNode(msg);	
	}
	
	var msgID = true;
	var d = false;


	window.setInterval("AlterateMsg()", 5500);