function doLicence(template)
{
	var winParms = "";
	var width = 750;
	var height = 550;
	var winX = Math.floor( (screen.width - width) / 2);
	var winY = Math.floor( (screen.height - height) / 2 - 25);
	winParms += "top=" + winY + ",left=" + winX + ",height=" + height + ",width=" + width;
	winParms += ",resizable=yes,location=no,directories=no,status=no,menubar=no";
	var dis_window = window.open(template, "Licence", winParms); 
	dis_window.title = "Carswell Licence Agreement";
	dis_window.focus();
}

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {

		HR_Prod_Link_over = newImage("images/nav_home_over.gif");
		Payroll_Prod_Link_over = newImage("images/nav_privacy_over.gif");
		OH_S_Prod_Link_over = newImage("images/nav_Site_map_over.gif");
		Labour_Prod_Link_over = newImage("images/nav_arrow_over.gif");
				
		preloadFlag = true;
	}
}

function GetViewWidth()
{
    var myview_w = 0;
	
    if (self.innerWidth){
	    myview_w = self.innerWidth;
	}
    else if (document.documentElement && document.documentElement.clientWidth){
	    myview_w = document.documentElement.clientWidth;
	}
    else if (document.body){
    	myview_w = document.body.clientWidth;
    }
    return myview_w;
}

function GetViewHeight()
{
    var myview_h = 0;

    if (self.innerHeight){
        myview_h = self.innerHeight;
    }
    else if (document.documentElement && document.documentElement.clientHeight){
	    myview_h = document.documentElement.clientHeight;
	}
    else if (document.body){
	    myview_h = document.body.clientHeight;
	}
    return myview_h;
}

function doPopup(winname,width,height,loadfile) {
	var left = Math.floor((GetViewWidth() - width) / 2);
	var top = Math.floor((GetViewHeight() - height) / 2);
	var winParms = "top=" + top + ",left=" + left + ",height=" + height + ",width=" + width;
	var win = window.open(loadfile, winname, winParms + ",resizable=yes,scrollbars=yes,toolbar=no,location=no,directories=no,status=no,menubar=no");
	win.focus();
} // function doPopup(winname,width,height,loadfile)
