// VividSilver BV - Cornelis Geellaan 43 - 2406 JE - Alphen aan den Rijn
// (+31) 172 - 47 99 00  vividlibrary1.5 (at] vividsilver [dot) com
//
// Library-versie:	1.5 (2005)
//
// Copyright (C) 2002-2005 - VividSilver BV  -  All rights reserved.
//
//
// Version history:
// - 1.5
//	 - added function openHelpWindow
//
// - 1.4
//	 - changed redirectUrl to accept parameters
//
// - 1.3
//   - added function redirectUrl
//
// - 1.2
//   - added support for Netscape/7 compatible browsers


if(document.all && !document.getElementById) {
    document.getElementById = function(id) {
         return document.all[id];
    }
}



function detectSize() {
	if (navigator.appName.indexOf("scape")>0) {
		nBrowsWidth = window.innerWidth;
		nBrowsHeight = window.innerHeight;
//		alert(navigator.userAgent);
		if (navigator.userAgent.indexOf("Netscape6") != -1) {
			nBrowsHeight = nBrowsHeight - 6;
		}
		if (navigator.userAgent.indexOf("Netscape/7") != -1) {
			nBrowsHeight = nBrowsHeight - 6;
		}
	}
	else {
		if (((navigator.userAgent.indexOf("MSIE 5") != -1) || (navigator.userAgent.indexOf("MSIE 6") != -1)) && (navigator.userAgent.indexOf("Opera") == -1))  {
			nBrowsWidth = document.body.clientWidth;
			nBrowsHeight = document.body.clientHeight;

			if (navigator.userAgent.indexOf("MSIE 5.0") != -1) {
				nBrowsWidth = nBrowsWidth - 20;
			}
		}
	}

}

//detectSize()

function redirectUrl(seconds2wait, targetUrl) {

	if (seconds2wait>0) {
		seconds2wait-=1;
		setTimeout("redirectUrl("+seconds2wait+", '"+targetUrl+"')", 1000);
	} else {
		document.location.href=targetUrl;
		return true;
	}
}

function redirectTopUrl() {

	if (seconds2wait>0) {
		seconds2wait-=1;
		setTimeout("redirectTopUrl()", 1000);
	} else {
		window.top.location.href=targetUrl;
		return true;
	}
}

function openHelpWindow(strHelpFiles, strUrl, strMode) {
	var widthPixels = 450;
    var heightPixels = 500;
    var strParams = "titlebar=1,toolbar=0,menubar=0,location=0,personalbar=0,directories=0,width="+widthPixels+",height="+heightPixels+",scrollbars=1,resizable=1,status=0";

    newHelpWindow = window.open(strHelpFiles+"?ur="+strUrl+"&mo="+strMode, "helpWindow", strParams);
    if (newHelpWindow) newHelpWindow.focus();
}
