function expandItContent(list){

	//alert('Expand: ' + list);


	var listElementStyle=document.getElementById(list).style;

	if (listElementStyle.display!="block"){
		listElementStyle.display="block";
	} else {
		listElementStyle.display="none";
	}
}

function CheckForBrowserCompatability() {

    bHasSilverlight = CheckForSilverlight();
    
    if (!bHasSilverlight) {
    	bHasSilverlight = CheckForDirtyFirefoxSilverlight();
    }
    
    bHasOldBrowser = CheckForOldBrowser();

    bHasVisitedInLast24Hour = readCookie("HasVisitedInLast24Hour")

    if (bHasVisitedInLast24Hour == null) {
    	// If this is the first visit in 24 hours
        if (bHasOldBrowser) {
            OpenBrowserCompatabilityWarning('BrowserCompatabilityOldBrowser');
        } else {
	    if (!bHasSilverlight) {
                OpenBrowserCompatabilityWarning('BrowserCompatabilityNoSilverlight');
            }
        }
    }

    createCookie("HasVisitedInLast24Hour",true,1)
    
}

function CloseBrowserCompatabilityWarning(PopupName) {
	
	oPopupMessage = document.getElementById(PopupName);
	// Locate the hidden span for no Silverlight
	oTransparency = document.getElementById('PopupTransparencyFilter');
	// Locate the hidden span for no Silverlight
	
	oTransparency.style.display = 'none';
	oPopupMessage.style.display = 'none';
	// Make the warning invisible
	
}

function CheckForDirtyFirefoxSilverlight() {

	if(navigator != null) {
		if(navigator.plugins != null) {
			if(navigator.plugins.length) {
				var plugin = navigator.plugins["Silverlight Plug-In"];
				// Check for the plugin
				if(plugin != null) {
					// Silverlight is installed
					return true
					// Return SUCCESS
				}
			}
		}
	}
	return false;
	// Return FAILURE
}

function CheckForOldBrowser() {
	if (window.XMLHttpRequest) {
		return false;
	} else {
		return true;
	}
}

function CheckForSilverlight() {

	//var hasVisitedLast24Hours
	
	if ( typeof CheckForSilverlight.counter == 'undefined' ) {
		// It has not... perform the initilization
		CheckForSilverlight.counter = 0;
	}
	
	var isSLInstalled = Silverlight.isInstalled();
	// Check if Silverlight is installed

	return isSLInstalled;
	
}

function OpenBrowserCompatabilityWarning(PopupName) {

	oPopupMessage = document.getElementById(PopupName);
	// Locate the hidden span for no Silverlight
	oTransparency = document.getElementById('PopupTransparencyFilter');
	// Locate the hidden span for no Silverlight
	
	oSilverlightControl = document.getElementById('silverlightControlHost');
	// Locate the silverlight control
	oStaticImage = document.getElementById('StaticImage');
	// Locate the static image

	// If Silverlight is not installed
	// They have been here before
	oSilverlightControl.style.display = 'none';
	// Hide the silverlight control
	oStaticImage.style.display = 'block';
	// Hide the silverlight control
	oTransparency.style.height = GetPageHeight();
	oTransparency.style.width = GetPageWidth();
	oTransparency.style.display = 'block';
	oTransparency.style.position = 'absolute';
	oTransparency.style.right = 0;
	oTransparency.style.top = 0;
	// Hide the body of the page
	oPopupMessage.style.display = 'inline-block';
	oPopupMessage.style.position = 'absolute';
	oPopupMessage.style.right = (GetPageWidth() - 600) / 2;
	oPopupMessage.style.top = 100;
	// Make the warning visible
	
}

function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name) {
	createCookie(name,"",-1);
}

function GetPageWidth() {

    var aPageSize = GetPageSize();
    // Calculate the size of the screen
    return aPageSize[2];

}

function GetPageHeight() {

    var aPageSize = GetPageSize();
    // Calculate the size of the screen
    return aPageSize[1];

}

function GetPageSize() {

    var xScroll, yScroll;

    if (window.innerHeight && window.scrollMaxY) {
        xScroll = document.body.scrollWidth;
        yScroll = window.innerHeight + window.scrollMaxY;
    } else if (document.body.scrollHeight > document.body.offsetHeight) { // all but Explorer Mac
        xScroll = document.body.scrollWidth;
        yScroll = document.body.scrollHeight;
    } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
        xScroll = document.body.offsetWidth;
        yScroll = document.body.offsetHeight;
    }

    var windowWidth, windowHeight;
    if (self.innerHeight) {	// all except Explorer
        windowWidth = self.innerWidth;
        windowHeight = self.innerHeight;
    } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
        windowWidth = document.documentElement.clientWidth;
        windowHeight = document.documentElement.clientHeight;
    } else if (document.body) { // other Explorers
        windowWidth = document.body.clientWidth;
        windowHeight = document.body.clientHeight;
    }

    // for small pages with total height less then height of the viewport
    if (yScroll < windowHeight) {
        pageHeight = windowHeight;
    } else {
        pageHeight = yScroll;
    }

    // for small pages with total width less then width of the viewport
    if (xScroll < windowWidth) {
        pageWidth = windowWidth;
    } else {
        pageWidth = xScroll;
    }

    arrayPageSize = new Array(pageWidth, pageHeight, windowWidth, windowHeight)
    return arrayPageSize;
}
