<!--

// ----------------------- CLIENT-CHECK

var Opera = window.opera ? true : false;

function getClient() {
	// convert all characters to lowercase to simplify testing
	var agt=navigator.userAgent.toLowerCase()
	var apv=navigator.appVersion.toLowerCase()
	this.major = parseInt(navigator.appVersion)
	// browserversion
	this.ns  = ((agt.indexOf('mozilla')!=-1) && ((agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible') == -1)))
	this.gecko = (this.ns && (this.major >= 5))
	this.ie   = (agt.indexOf("msie") != -1)
	this.ie4  = (this.ie && (this.major == 3))
	this.ie45 = (agt.indexOf('msie 4.5') != -1);
	this.ie5  = (this.ie && (this.major == 4))
	//Safari
	this.isSafari = (agt.indexOf('safari') != - 1);
	this.versionMinor = parseFloat(navigator.appVersion); 
	this.isSafari10 = ((this.isSafari) && (this.versionMinor < 87));
	//Mozilla
	this.moz = ((agt.indexOf('mozilla') != -1)&& (agt.indexOf('gecko') != -1) && (agt.indexOf('netscape') == -1));
	// platform
	this.mac = (apv.indexOf("macintosh")>0);
	// compatible browsers
	this.ie4comp = ((this.ie4 && !this.mac) || this.ie45 || this.ie5)
	this.comp = (this.ie4comp || this.gecko);
	return (this)
}

var is = new getClient();

// ----------------------- IMAGE PRELOAD
function preloadImages() { 
	if (document.images) {
		var imgStr = preloadImages.arguments;
		if (!document.preloadArray) document.preloadArray = new Array();
		var n = document.preloadArray.length;
		for (var i=0; i<preloadImages.arguments.length; i++) {
			document.preloadArray[n] = new Image;
			document.preloadArray[n].src = imgStr[i];
			n++;
		} 
	}
}

// ----------------------- SWAP-IMAGE SUBMIT BG:
function roSubmit(id,pic,pos){
	if(is.comp && !(is.mac && is.ie4comp)){
		var ref = document.getElementById(id);
		ref.style.background = "url('" + pic + "') no-repeat";
		if(roSubmit.arguments.length > 2) {
			if (pos==1){ ref.style.backgroundPosition = 'right'; }
		}
	}
}

// ----------------------- SWAP-IMAGE SUBMIT IMG:
function roSubmitImg(id,pic){
	if(is.comp && !(is.mac && is.ie4comp)){
		var ref = document.getElementById(id);
		ref.src = pic;		
	}
}

// ---------------------- CALCULATE HEIGHT and WIDTH OF THE VIEWPORT
function getWindowHeight() {
	var windowHeight = 0;
	if (typeof(window.innerHeight) == 'number') {
		windowHeight = window.innerHeight;
	}
	else {
		if (document.documentElement && document.documentElement.clientHeight) {
			windowHeight = document.documentElement.clientHeight;
		}
		else {
			if (document.body && document.body.clientHeight) {
				windowHeight = document.body.clientHeight;
			}
		}
	}
	return windowHeight;
}

function getWindowWidth() {
	var windowWidth = 0;
	if (typeof(window.innerWidth) == 'number') {
		windowWidth = window.innerWidth;
	}
	else {
		if (document.documentElement && document.documentElement.clientWidth) {
			windowWidth = document.documentElement.clientWidth;
		}
		else {
			if (document.body && document.body.clientWidth) {
				windowWidth = document.body.clientWidth;
			}
		}
	}
	return windowWidth;
}

// ---------------------- OPEN POPUP WINDOW
var newWin = new Object();
var popupUrl;
function popup(url) {
	var windowProperties = "";
	if (arguments[1]) {
		windowProperties = arguments[1];
	}
	if ((newWin.closed) || (popupUrl != url)) {
		newWin = window.open(url, "popup", windowProperties);
		popupUrl = url;
	}
	newWin.focus();
}


//-->
