	/* Author: Gleb Samsonov 
	   Global Real Estate Institute
	*/
	
	
	// the following block is responsible for 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 par1 = translateTtoB(document.forms("MenuForm").item("cl1state").value);
			var par2 = translateTtoB(document.forms("MenuForm").item("cl2state").value);
			var par3 = translateTtoB(document.forms("MenuForm").item("cl3state").value);

			window.location.href=strURL + "cl1=" + par1 + "&cl2=" + par2 + "&cl3=" + par3
		}


		function InitStates(){
			var ptrState = document.forms("MenuForm");
				ptrState.item("cl1state").value = translateBtoT(ptrState.item("cl1state").value);  //conver params from query string from bool to
				ptrState.item("cl2state").value = translateBtoT(ptrState.item("cl2state").value);  //text (eg. t = "", f = "none")
				ptrState.item("cl3state").value = translateBtoT(ptrState.item("cl3state").value);
				
				document.all("cl1").style.display = ptrState.item("cl1state").value		//set div tag property (visible/invisible)
				document.all("cl2").style.display = ptrState.item("cl2state").value
				document.all("cl3").style.display = ptrState.item("cl3state").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             group discussion              at the Summit");
		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);