	//function for float menu
	var _totalWinHeight=-1;
	var _adjWinHeight;
	var _rightDivPos;
	var _rightFooterPos;
	var _bottomFooterPos;

	function setTotal()
	{
		_totalWinHeight = document.body.scrollHeight;
		_adjWinHeight= _totalWinHeight;//-608;
		
		var eRightHead = document.getElementById("righthead");
		var eRightDiv = document.getElementById("rightdiv");
		var eFloatMenu = document.getElementById("FloatMenu");
		var eFooterMenu = document.getElementById("FooterMenu");
		
		if(eFloatMenu!=null)
		{
			_rightFooterPos = document.body.clientHeight - eFloatMenu.clientHeight;
			eFloatMenu.style.top=_rightFooterPos;
			resizePanel(_rightFooterPos);
		}
		
		if(eFooterMenu!=null)
		{	
			_bottomFooterPos=document.body.clientHeight - eFooterMenu.clientHeight;
			eFooterMenu.style.top= _bottomFooterPos;
		}	

/*
		if(eRightDiv!=null && eFloatMenu!=null)
		{
			var eRightHeadHeight = 0;
			if (eRightHead != null){
				eRightHead.style.height='';
				eRightHeadHeight = parseInt(eRightHead.clientHeight);
			}	
			eFloatMenu.style.height='';

			eRightDiv.style.height = 
				parseInt(document.body.clientHeight) - 
				eRightHeadHeight -  
				parseInt(eFloatMenu.clientHeight)
				;
		}
*/
	}

	function window_onscroll()
	{
	  if(document.body.scrollTop <= _adjWinHeight) {

		var eRightComp = document.getElementById("rightcomp");
		var eRightHead = document.getElementById("righthead");
		var eRightDiv = document.getElementById("rightdiv");
		var eFloatMenu = document.getElementById("FloatMenu");
		var eFooterMenu = document.getElementById("FooterMenu");

		if(eRightComp!=null && eFloatMenu!=null)
		{	
			var floatMenuTop = 0;
			
			if(eRightComp.style.position=='absolute')
				floatMenuTop=document.body.scrollTop + _rightFooterPos - 120;//523;
			else
				floatMenuTop=document.body.scrollTop + _rightFooterPos;
	
			eFloatMenu.style.top=floatMenuTop-1;
			resizePanel(floatMenuTop);
		}		

		if(eFooterMenu!=null){
			eFooterMenu.style.top=document.body.scrollTop + _bottomFooterPos;
		}
	  }
	}
	
	function ShowControl()
	{
		if(typeof(ddlArray)!="undefined")
		{
			var ddlArrayItem = null;
			for(var i=0;i<=ddlArray.length-1;i++)
			{
				ddlArrayItem = document.getElementById(ddlArray[i]);
				if (ddlArrayItem != null) ddlArrayItem.style.display='';
			}
		}
	}
	//Function for Right pane
	var blcheck=true;
	function tabControl()
	{
		try
		{
		if (blcheck==true)
		  {
		    	
		    if(typeof(ddlArray)!="undefined")
		    {
				for(var i=0;i<=ddlArray.length-1;i++)
				{
					var objectToHide = document.getElementById(ddlArray[i]);
					if(objectToHide != null) objectToHide.style.display='none';
				}
		    }

		     //calling tab control function
		    if(typeof(al_TabControl_SingleRowMode)!="undefined")
		    {
				al_TabControl_SingleRowMode("cntrlTab", true, 997)
			}

		    document.getElementById("rightcomp").style.position='absolute';
		    if (document.getElementById("rightdiv") != null) document.getElementById("rightdiv").style.width=997;
		    document.getElementById("rightcomp").style.left=0;
		    document.getElementById("rightcomp").style.width=1004;

		    if(document.getElementById("middletab")!=null)
		    {
				document.getElementById("middletab").style.display='none';
		    }

		    if(document.getElementById("FloatMenu")!=null)
		    {
				document.getElementById("FloatMenu").style.top = document.body.scrollTop + _rightFooterPos -120;//-42;//42;//523;			
				document.getElementById("FloatMenu").style.left=0;
				document.getElementById("FloatMenu").style.width=1004;	
		    }

		    document.getElementById("tabctrl").src='/DIAHome/Common/Resources/Images/right.gif';
		    document.getElementById("tabctrl1").src='/DIAHome/Common/Resources/Images/right.gif';		   
		    document.getElementById("tabctrl").alt='Click here to Collapse the Tab';
		    document.getElementById("tabctrl1").alt='Click here to Collapse the Tab';
		    document.getElementById("expandcolapse").innerHTML='Collapse';		    
		    document.getElementById("expandcolapse").style.width=974;
		    document.getElementById("rightHead").style.width=970;

		    blcheck=false;
		    if (document.getElementById("bottomlnk") != null)
				document.getElementById("bottomlnk").style.display='none';
						
		    return;		
		  }
		  else
		  {

		    if(typeof(ddlArray)!="undefined")
		    {
				var ddlArrayItem = null;
				for(var j=0;j<=ddlArray.length-1;j++)
				{
					ddlArrayItem = document.getElementById(ddlArray[j]);
					if (ddlArrayItem != null) ddlArrayItem.style.display='';
				}
		    }

		    document.getElementById("rightcomp").style.position='';
   		    if (document.getElementById("rightdiv") != null) document.getElementById("rightdiv").style.width=275;
		    document.getElementById("rightcomp").style.width=278;
		    document.getElementById("rightcomp").style.left=726;

		    if(document.getElementById("middletab")!=null)
		    {
				document.getElementById("middletab").style.display='';
		    }

		    if(document.getElementById("FloatMenu")!=null)
		    {
				document.getElementById("FloatMenu").style.top=document.body.scrollTop + _rightFooterPos;//565;
				document.getElementById("FloatMenu").style.left=726;
				document.getElementById("FloatMenu").style.width=278;
			}

    		//document.getElementById("expandcolapse").style.width=190;
		    document.getElementById("tabctrl").src='/DIAHome/Common/Resources/Images/left.gif';
		    document.getElementById("tabctrl").alt='Click here to Expand the Tab';
            document.getElementById("tabctrl1").src='/DIAHome/Common/Resources/Images/left.gif';
		    document.getElementById("tabctrl1").alt='Click here to Expand the Tab';
		    document.getElementById("expandcolapse").innerHTML='Expand';
			document.getElementById("rightHead").style.width=255;			

	        if(document.getElementById("bottomlnk")!=null)
				document.getElementById("bottomlnk").style.display = '';

	        //calling tab control function
	        if(typeof(al_TabControl_SingleRowMode)!="undefined")
	        {
				al_TabControl_SingleRowMode("cntrlTab", false, 275)
	        }

	        blcheck=true;

		  }	
		  }
		  catch(e){
			var txt="There was an error on this page.\n\n";
			txt+="Error source: " + e.name + "\n\n";
			txt+="Error description: " + e.description + "\n\n";
			txt+="Click OK to continue.\n\n";
			alert(txt);
			}
	}
 
  function resizePanel(floatMenuTop)
  {
  	var name = "cntrlTab";
  	var currentTabs = document.getElementsByName(name + "_currentTab");
	if ( currentTabs.length > 0){
		var num = currentTabs[0].value;
		var oPanel = al_TabControl_GetPanel(name, num);
		if (oPanel != null) 
			oPanel.style.height = floatMenuTop - findPosY(oPanel)-5;
	}
	else
	{
		var rdiv = document.getElementById("rightdiv");
		if (rdiv != null)
			rdiv.style.height = floatMenuTop - findPosY(rdiv)-5;
	}
  }


