﻿var ie45,ns6,ns4,dom = false;
if (navigator.appName == "Microsoft Internet Explorer") ie45 = parseInt(navigator.appVersion) >= 4;
else if (navigator.appName == "Netscape"){
	ns6 = parseInt(navigator.appVersion) >= 5;
	ns4 = parseInt(navigator.appVersion) < 5;}
dom = ie45 || ns6;

var lastElement;

function expandElement(element)
{
	var hiddenLastElement = document.all ? document.all["ctl00_ContentPlaceHolder1_hiddenLastElement"] : dom ? document.getElementById("ctl00_ContentPlaceHolder1_hiddenLastElement") : document.layers["ctl00_ContentPlaceHolder1_hiddenLastElement"];
	var hiddenLastElementID;
	if(hiddenLastElement)
	{
		hiddenLastElementID = hiddenLastElement.value;
		if(hiddenLastElementID != "")
		{
			lastElement = document.all ? document.all[hiddenLastElementID] : dom ? document.getElementById(hiddenLastElementID) : document.layers[hiddenLastElementID];
			hiddenLastElement.value = "";
		}
	}
	
	if(lastElement) { lastElement.style.display = 'none'; }
	element.style.display = 'block';
	lastElement = element;
}

function collapseElement(element)
{
	element.style.display = 'none';
}

function expandCollapse(id) 
{
	element = document.all ? document.all[id] : dom ? document.getElementById(id) : document.layers[id];
	
	if(element.style.display == 'block') 
	{ 
		//collapseElement(element); 
	}
	else if(element.style.display == 'none') 
	{ 
		expandElement(element); 
	}
	else 
	{
		element.style.display = 'none';
	}
}
        
function expandDropDownList(elementRef)
{
	elementRef.style.minWidth = "200px";
    elementRef.style.width = "auto";
}

function collapseDropDownList(elementRef)
{
    elementRef.style.width = elementRef.width;
}

function openReadWindow(displayPage, fileName)
{
	var width = 540;
	var height = 500;
	var left = (screen.width - width) / 2;
	var top = (screen.height - height) / 2;

	window.open(displayPage + "?id=" + fileName,"read","height=" + height + ",width=" + width + ",left=" + left + ",top=" + top + ",directories=no,location=no,menubar=no,status=no,toolbar=no,scrollbars=yes");
	return false;
}


