///////////////
// BROWSERCHECK
var version = parseInt(navigator.appVersion);
if (navigator.appName == "Microsoft Internet Explorer" && version == 4) {
	if (/4\.\d+\D+(\d+)\D/.test(navigator.appVersion)) {
		version = RegExp.$1;
	}
}
if(navigator.appName == "Netscape" && navigator.userAgent.indexOf("Netscape") != -1 && version < 5) {
	window.location.href = 'browser.html';
}
// UPDATE BROWSERCHECK FOR IE8
//else if(navigator.userAgent.indexOf("MSIE 6.0") != -1 || navigator.userAgent.indexOf("MSIE 7.0") != -1 || navigator.userAgent.indexOf("MSIE 8.0") != -1) {
//	alert(navigator.userAgent+' '+version);
//}
else if(navigator.platform == "Win32" && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Opera") == -1) {
	if (version < 5 || navigator.userAgent.indexOf('MSIE 5.01') !=-1) {
		window.location.href = 'browser.html';
	}
}
else if(navigator.platform == "MacPPC" && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Opera") == -1) {
	window.location.href = 'browser.html';
}

////////////
// STYLECORR
if (navigator.platform == "Win32" && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Opera") == -1) {
	document.write('<style type="text/css"><!-- ');
	document.write('.clearFloat {margin:0px;padding:0px;clear:both;}');
	document.write(' --><\/style>');
}
else if (navigator.platform == "Win32" && navigator.userAgent.indexOf("Opera") != -1) {
	document.write('<style type="text/css"><!-- ');
	document.write('.clearFloat {height:1px;margin:0px;padding:0px;clear:both;}');
	document.write(' --><\/style>');
}
else if (navigator.userAgent.indexOf("Safari") != -1) {
	document.write('<style type="text/css"><!-- ');
	document.write('input.submitButton {padding:1px 3px 1px 3px;}');
	document.write(' --><\/style>');
}
else {
	document.write('<style type="text/css"><!-- ');
	document.write('.clearFloat {margin:0px;padding:0px;clear:both;}');
	document.write(' --><\/style>');
}

/////////////////////////////////
// XHTMLSTRIC CONFORM EXT. TARGET
function externalLinks() {
	if (!document.getElementsByTagName) return;
	var anchors = document.getElementsByTagName("a");
	for (var i=0; i<anchors.length; i++) {
		var anchor = anchors[i]; 
		if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") anchor.target = "_blank"; 
	}
}
//function cursorIE() {
//}
function init() {
	externalLinks();
//	cursorIE();
}
window.onload = init();

function arrayToString(whichone) {
	return whichone.join(',');
}

/////////////
// MOUSE OVER
var resetBg;
var resetColor;
function getColours(which) {
	var thisClassDef = document.getElementById(which).className;
	if(thisClassDef.indexOf('print')!=-1) {
		resetBg = '#1A1A1A';
		resetColor = '#FFFFFF';
	}
	else if(thisClassDef.indexOf('web')!=-1) {
		resetBg = '#363636';
		resetColor = '#FFFFFF';
	}
	else if(thisClassDef.indexOf('motion')!=-1) {
		resetBg = '#4D4D4D';
		resetColor = '#FFFFFF';
	}
	else if(thisClassDef.indexOf('object')!=-1) {
		resetBg = '#616161';
		resetColor = '#FFFFFF';
	}
	else if(thisClassDef.indexOf('seen')!=-1) {
		resetBg = '#4B98C8';
		resetColor = '#FFFFFF';
	}
	else if(thisClassDef.indexOf('disclaimer')!=-1) {
		resetBg = '#FF0000';
		resetColor = '#FFFFFF';
	}
	else if(thisClassDef.indexOf('d')!=-1 || thisClassDef.indexOf('h')!=-1 || thisClassDef.indexOf('fn')!=-1) {
		resetBg = '#BAD926';
		resetColor = '#FFFFFF';
	}
	return resetBg;
	return resetColor;
}
function mouse(which, state) {
//	document.getElementById('console').innerHTML = String(shortcutList);
	getColours(which);
	if(state=='over') {
		document.getElementById(which).style.backgroundColor = '#FFFFFF';
		document.getElementById(which).style.color = '#000000';
	}
	if(state=='out' && String(shortcutList).indexOf(which)==-1) {
		document.getElementById(which).style.backgroundColor = resetBg;
		document.getElementById(which).style.color = resetColor;
	}
}
function getSizes(which) {
	var thisClassDef = document.getElementById(which).className;
	if(thisClassDef.indexOf('xs')!=-1) {
		bottomPx = '2px';
	}
	else if(thisClassDef.indexOf('s')!=-1) {
		bottomPx = '20px';
	}
	else if(thisClassDef.indexOf('m')!=-1) {
		bottomPx = '55px';
	}
	else if(thisClassDef.indexOf('l')!=-1) {
		bottomPx = '90px';
	}
	return bottomPx;
}

function loadCont(which,what) {
	if (which == 'doc') {
		document.location.href =what + ".html";
	
	}
	if (which == 'popup') {
		detailWin = window.open(what + '.html','FINCKNEYE_CLIENTS','width=450,height=450,top=150,left=150,resizable=no,scrollbars=yes');
		detailWin.focus();
	}
	if (which == 'extern') {
		detailWin = window.open(what);
		detailWin.focus();
	}
}
