/*
lib.js v 0.1 07.10.2004

*/

function Is() {
	var agent = navigator.userAgent.toLowerCase();
	this.major = parseInt(navigator.appVersion);
	this.minor = parseFloat(navigator.appVersion);
	this.ns = ((agent.indexOf('mozilla') != -1) && (agent.indexOf('spoofer') == -1) && (agent.indexOf('compatible') == -1) && (agent.indexOf('opera') == -1) && (agent.indexOf('webtv') == -1));
	this.ns2 = (this.ns && (this.major == 2));
	this.ns3 = (this.ns && (this.major == 3));
	this.ns4 = (this.ns && (this.major == 4));
	this.ns6 = (this.ns && (this.major >= 5));
	this.ie = (agent.indexOf("msie") != -1);
	this.ie3 = (this.ie && (this.major < 4));
	this.ie4 = (this.ie && (this.major >= 4));
	this.ie5 = (this.ie && (this.major == 4) && (agent.indexOf("msie 5.0") != -1));
	this.ie6 = (this.ie && (this.major == 4) && (agent.indexOf("msie 6.0") != -1));
	this.ieX = (this.ie && !this.ie3 && !this.ie4);
}

var is = new Is();

function initPage() {
	// call various other functions
	//
	setContentHeight();
}

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")) {
			var rel = anchor.getAttribute("rel");
			if (rel == "external") {
				anchor.target = "_blank";			
			} else if (rel.substring(0,9) == "external:") {
				anchor.target = rel.substring(9, rel.length);
			}
		}
	}
}

function getObject(id) {
	this.obj = document.getElementById(id);
	return this.obj;
}

function getObjectStyle(id) {
	this.obj = document.getElementById(id).style;
	return this.obj;
}

function showNav(elementName) {
	// get the anchor style
	//
	var anchorRef = getObject('anchor_' + elementName);
	
	// set the anchor class
	//
	anchorRef.className = "headernavactive";
	
	// get the divstyle
	//
	var divStyle = getObjectStyle('subnav_' + elementName);
	
	// display the div
	//
	divStyle.visibility	= "visible";
	divStyle.display	= "inline";
}

function hideNav(elementName) {
	// get the anchor style
	//
	var anchorRef = getObject('anchor_' + elementName);
	
	// set the anchor class
	//
	anchorRef.className = "headernav";
	
	// get the divstyle
	//
	var divStyle = getObjectStyle('subnav_' + elementName);
	
	// hide the div
	//
	divStyle.visibility	= "hidden";
	divStyle.display	= "none";
}

function displayGalleryImage(img) {
	// get the object
	//
	obj = getObject('galleryimage');
	
	// change the image
	//
	obj.src = '/images/gallerie/' + img;
}

// eof: lib.js

