﻿var highContastMode = false;

function highContrastMode() {
	var header = document.getElementById("header");
	if (header != null && (header.currentStyle.backgroundImage == null || header.currentStyle.backgroundImage == 'none')) {
		highContastMode = true;	
		
		// add high contrast style sheet here
	}
}

function BuildMask() {
var maskWindow = document.createElement('div'); maskWindow.className = 'maskwindow';
maskWindow.style.height = document.body.clientHeight; maskWindow.style.width = document.body.clientWidth;
return maskWindow;
}

function loadButton(buttonId, noVal) {
document.getElementById(buttonId).click();
var timer = 1000;
if (typeof(Page_Validators) == "undefined") { if (!noVal) { setTimeout('loader()',timer); } }
else { if (!noVal) { if (Page_IsValid = null || Page_IsValid) { setTimeout('loader()',timer); } } }
}

function loader() {
var maskWindow = BuildMask(); document.getElementsByTagName('body')[0].appendChild(maskWindow);
var loader = document.createElement('div'); loader.className = 'loader';
var spanNoText = document.createElement('span'); spanNoText.innerText = 'Loading...'; spanNoText.className = 'notext';
loader.appendChild(spanNoText); document.getElementsByTagName('body')[0].appendChild(loader)
}

function onloader() {
    // add list of function to process onload of page
    highContrastMode();
}

if (window.attachEvent) window.attachEvent("onload", onloader);