function popIt(page, widthVal, heightVal){
 
    var newWnd = window.open( page, 'popupWindow', 'status,width=' + widthVal + ',height=' + heightVal + '', true ); 
    newWnd.focus(); 
    return false;
}

function ShowTimeoutWarning ()
{
	window.alert( "You will be automatically logged out of HITE in five minutes unless you:\n\n" +
		"  * Click \"OK,\" and then\n" +
		"  * Click on any button or link in the HITE Web site.\n\n" +
		"If this box has been on your screen for more than 5 minutes you will need to log back in." );
}

function PrintPage ()
{
	var Banner = document.getElementById( "Banner" );
	if ( Banner != null )
		Banner.style.display = "None";

	var LeftColumn = document.getElementById( "LeftColumn" );
	if ( LeftColumn != null )
		LeftColumn.style.display = "None";

	var RightColumn = document.getElementById( "RightColumn" );
	if ( RightColumn != null )
		RightColumn.style.display = "None";
		
	var MyHiteBox = document.getElementById( "rdTable");
	if ( MyHiteBox != null)
	    MyHiteBox.style.display = "None";
		
	var PrintThisPage = document.getElementById( "PrintThisPage" );
	if ( PrintThisPage != null )
		PrintThisPage.style.display = "None";
		
	var PrintContact = document.getElementById( "printContact");
	if ( PrintContact != null )
	    PrintContact.style.display = "None";
		
	var CenterColumn = document.getElementById( "CenterColumn" );
	if ( CenterColumn != null )
	{
		CenterColumn.style.margin = "0px";
		CenterColumn.style.backgroundImage = "url('')";
	}
	
	document.body.style.backgroundImage = "url('')";
}

function showHide ( objectId, anchorId )
{	
	var obj = document.getElementById( objectId );
	var anc = document.getElementById( anchorId );
	
	if ( ( obj == null ) || ( anc == null ) )
		return;
	
	//default is not expanded
	var expanded = ( obj.expanded == null ? false : obj.expanded );
	
	if ( expanded == false )
	{
		//if ( navigator.userAgent.toLowerCase().indexOf("msie") >= 1 )
		{
			anc.innerText = "Hide Preview";
			obj.style.display = "";
		}
		//else
	}
	else
	{
		anc.innerText = "Show Preview";
		obj.style.display = "none";
	}

	obj.expanded = !expanded;
}

function ShowHideAll()
{
    var obj = document.getElementById( 'lnkShowHideAll' );
    
    var elmnts = document.getElementsByName('ancShowHide'); 
    //    obj.innerText = "Records "+elmnts[0].id;
    //    showHide('obj'+elmnts[0].id.replace('anc',''), elmnts[0].id);  
    //    obj.innerText = 'obj'+elmnts[0].id.replace('anc','');
   
    for(i = 0;i<elmnts.length;i++)
    {
        showAllorHideAll('obj'+elmnts[i].id.replace('anc',''), elmnts[i].id, obj.innerText);
    }
    
    if (obj.innerText == "Show All")
    {
        obj.innerText = "Hide All";
    }
    else
    {
        obj.innerText = "Show All";
    }
}

function showAllorHideAll ( objectId, anchorId, showOrHide )
{	
	var obj = document.getElementById( objectId );
	var anc = document.getElementById( anchorId );
	
	if ( ( obj == null ) || ( anc == null ) )
		return;
	
	var expanded = ((showOrHide == "Show All")== false);
	
	if ( showOrHide == "Show All")
	{
		//if ( navigator.userAgent.toLowerCase().indexOf("msie") >= 1 )
		{
			anc.innerText = "Hide Preview";
			obj.style.display = "";
		}
		//else
	}
	else
	{
		anc.innerText = "Show Preview";
		obj.style.display = "none";
	}

	obj.expanded = !expanded;
}