	/**
	*
	*	Helper functions for pop up windows
	*
	*/
	function openTreeView(strQuery){		
		var strReturn = "";
		
		try{												
			openWindow("TreeSelect.aspx?" + strQuery,"TreeSelect", "700", "480")
		}catch(e){
			strReturn = "Can't open treeview";		
		}
		return(strReturn);
	}	

	function openHelp(strQuery){		
		var strReturn = "";
		
		try{			
    		openResizableWindow("/Forms/Help.aspx?" + strQuery,"Help", "800", "600")
		}catch(e){
			strReturn = "Can't open help";		
		}
		return(strReturn);
	}
	
	function openModalWindow(url, displayname, widthInPx, heightInPx){		
		var strReturn = "";
		
		try{												
			window.showModalDialog(url, displayname, "scroll:no;resizable:no;status:no;dialogHeight:" + heightInPx + "px;DialogWidth:" + widthInPx + "px;");	
		}catch(e){
			strReturn = "Can't open window";		
		}
		return(strReturn);
	}	

	function openWindow(url, displayname, widthInPx, heightInPx){		
		var strReturn = "";
		try{												
			window.open(url, displayname, "scrollbars=no,resizable=no,status=no,top=80,left=100,height=" + heightInPx + ",width=" + widthInPx);	
		}catch(e){
			strReturn = "Can't open window";		
		}
		return(strReturn);
	}	
	
	function openResizableWindow(url, displayname, widthInPx, heightInPx){		
		var strReturn = "";
		try{												
			window.open(url, displayname, "scrollbars=no,resizable=1,status=no,top=80,left=100,height=" + heightInPx + ",width=" + widthInPx);	
		}catch(e){
			strReturn = "Can't open window";		
		}
		return(strReturn);
	}	
	
	
	function closeWindow(){		
		var strReturn = "";
		
		try{
			window.close();			
		}catch(e){
			strReturn = "Can't close window";		
		}
		return(strReturn);
	}	
	
	
    function writeSelectionToBox(boxId, selection)
    {
		try{												
            var box = document.getElementById(boxId);
            box.value = selection;
		}catch(e){
		    //No action - current parent page does not contain the box
		}
    }
     
	function openPrintWindow(url){		
		var strReturn = "";
		try{												
			window.open(url, 'print', "scrollbars=yes,resizable=no,status=no,top=80,left=100,height=500,width=667");	
		}catch(e){
			strReturn = "Can't open window";		
		}
		return(strReturn);
	}     
  

