		var popupPage, mainPage;
		
		function setPageName(){
			if((this.name != "popupPage") && (this.name != "mainPage") && (this.name != "login")) {
				this.name = "mainPage";
				mainPage = this;
			}
		}
		
		function openPopupPage(url,w,h,scrollbars, win){
			var isMac = (navigator.platform.indexOf("Mac") != -1);
			if ( popupPage != null){
				popupPage.close();	
			} else if (this.name == "popupPage") {
				this.name="closeWin";
			}
			var sb;		
			if (scrollbars == "No" || scrollbars == "N" || scrollbars == 0) {
				sb = 0;
			}else{
				sb = 1;
			}
		
			if (win != '' && win != null) {
				if(mainPage != '' && mainPage != null) {
					mainPage.name="oldMainPage";
					mainPage = null;
				}
				win.name = "mainPage";
				mainPage = win;
			}
			
			var locX = ( screen.width - w ) / 2;
			var locY = ( screen.height - h) / 2;
		
			var strFeatures = "width="+w+",height="+h+",scrollbars="+sb+
						+ ",screenX=" + locX + ",screenY=" + locY //Netscape
						+ ",left=" + locX + ",top=" + locY;       //IE
			
			popupPage = null;			
			popupPage = open( url, "popupPage", strFeatures );
			popupPage.focus();
			popupPage.opener=self;	
			
			if (this.name == "closeWin") {
				this.close();
			}
			setPageName();
		}
		
		function openMainPage(url){
			if ( ( mainPage == null ) || mainPage.closed ) {  
				mainPage = open( url, "mainPage" );
				if ( this != mainPage) {
					this.close();
				}
			}else{
				mainPage.window.location.href = url;
			}
			mainPage.focus();
		}
		
		function pageInit() {
			setPageName();
		}
		
		document.onload = pageInit();
		
		function doExpandAll()
		{
			var section;
			var i = 1;
			section = document.getElementById("sec" + i);
		   	while (section != null) {
		   		expandSection( section );
				i++;
				section = document.getElementById("sec" + i);
			}		
			  
		}
		
		function doCollapseAll()
		{
			var section;
			var i = 1;
			section = document.getElementById("sec" + i);
			while (section != null){
		   		collapseSection( section );
				i++;
				section = document.getElementById("sec" + i);
			}
		}

		
		
		function doSection(secnum) { 
			// display the section if it's not displayed; hide it if it is displayed
			if ( document.getElementById(secnum).style.display == "none" ) {
				doCollapseAll();
				document.getElementById(secnum).style.display = "";
		   } else {
			  document.getElementById(secnum).style.display = "none";
		   }
		}
		
		function collapseSection(secnum)
		{ // hide section if it is displayed
		   secnum.style.display = "none";
		}
		
		function expandSection(secnum)
		{ // display section if it is hidden
		   secnum.style.display = "";
		}
		

		