<script>

<%'if confirmAdminUser() then %>	

	if(window.opener){baseFrame=window.opener.top}else{baseFrame=top}	
	setJScriptWindows();

	function setJScriptWindows()
	{
	frameAppBar=baseFrame.frames[0];
	
	//Give the other frames time to load
	for(i = 1; i <= 10000; i++)
	{}
	
		//var refURL
		//refURL = document.location.href		
		//refURL = refURL.search('/admin');
	
		//if (refURL >-1 )
		//{
			if(baseFrame.frames[1].frames[1]!=null){
				mainWindowFrameset=baseFrame.frames[1].frames[1];
				if(baseFrame.frames[1].frames[1].frames[0]!=null){frameMainWindow=baseFrame.frames[1].frames[1].frames[0]}else{frameMainWindow=false};
				if(baseFrame.frames[1].frames[1].frames[2]!=null){frameDetailPane=baseFrame.frames[1].frames[1].frames[2]};
				if(baseFrame.frames[1].frames[1].frames[1]!=null){frameDetailPaneToggle=baseFrame.frames[1].frames[1].frames[1]};	
			};
		//}
	}

	
	function hideDetailPane()
	{
		//Hide the detail pane
		//frameHeaderPane.document.all('btnToggleDetail').value='Show Detail Pane';
		mainWindowFrameset.document.body.rows='*,20,0';
		if(frameDetailPaneToggle.document.all('arrow1')){
		frameDetailPaneToggle.document.all('arrow1').src='/img/icons/icon_arrowUp.gif';
		frameDetailPaneToggle.document.all('arrow2').src='/img/icons/icon_arrowUp.gif';
		}
	}
	
	function showDetailPane()
	{
		//Show the detail pane
		if (top.height == null){top.height='1200'}
		
		detailToggleHeight=(top.height / 2)-20;
		
		slideBar()
		return true
		
		//mainWindowFrameset.document.body.rows='*,20,' + detailToggleHeight;
		//frameDetailPaneToggle.document.all('arrow1').src='/img/icons/icon_arrowDown.gif';
		//frameDetailPaneToggle.document.all('arrow2').src='/img/icons/icon_arrowDown.gif';
	}
	
	var lastSize=1
	var lastTime=10
	
	function slideBar()
	{
	detailToggleHeight=(top.document.body.offsetHeight );
	
	lastSize=lastSize + 20
	lastTime=lastTime + 1
	
	mainWindowFrameset.document.body.rows='*,20,' + lastSize;
	frameDetailPaneToggle.document.all('arrow1').src='/img/icons/icon_arrowDown.gif';
	frameDetailPaneToggle.document.all('arrow2').src='/img/icons/icon_arrowDown.gif';
		
	//alert(mainWindowFrameset.document.body.rows)
	if (lastSize<detailToggleHeight)
	{window.setTimeout("slideBar()",lastTime)}
	else
	{lastSize=1;lastTime=10}
	}
	
	function clearDetailPane()
	{
	frameDetailPane.location="/blankdetail.asp"
	}
	
	function setDetailPane(URL)
	{
	frameDetailPane.location=URL;
	}
	
	function toggleDetailPane()
	{
		if(mainWindowFrameset.document.body.rows=='*,20,0')
		{
		showDetailPane()
		}
		else
		{
		hideDetailPane()
		}
	}
	function setTitle(titleText)
	{
	if(frameMainWindow.document.all("titleLineDiv"))
		{
		frameMainWindow.document.all("titleLineDiv").innerHTML=titleText;
		}
	}
	
	function setStatus(statusText)
	{
	//alert(statusText);
	//frameHeaderPane.document.all('statusLine').innerText=statusText;
	}
	
	function minOrMax(obj)
	{
		if(hideAppBar==true)
		{
		window.baseFrame.document.all('MyFrames').cols='0,*';
		obj.innerHTML='<img src="/imgCantera/showAppToolBar.gif">'
		hideAppBar=false;
		}
		else
		{
		window.baseFrame.document.all('MyFrames').cols='250,*';
		obj.innerHTML='<img src="/imgCantera/hideAppToolBar.gif">'
		hideAppBar=true
		}
	
	}
	
	function openEditorWindow(editorPage,holeID)
	{
	setDetailPane('/admin/cms/holeEditor.asp?holeID=' + holeID,'holeEditor' + holeID);
	showDetailPane();
	
	}

<%'end if %>		
</script>
