window.onload = layoutControler;
function layoutControler() {
	var n;
	var m;
	if(document.getElementById) {
		if(document.getElementById("col-left")){
			n = document.getElementById("col-left");
		}
		if(document.getElementById("col-right")){
			m = document.getElementById("col-right");
		}
		
		if(n != null) {
			var parentHeight = n.parentNode.offsetHeight;
			n.style.height = parentHeight+ "px";
			m.style.height=  parentHeight+ "px";
			
			
		}
	}
}


ImageRotator = function(img, imgs, largeDir) {

	this.img = img;
	this.imgs = imgs;
	this.actImg = 0;
	this.totalImgs = this.imgs.length;
	this.largeDir = largeDir;
	
	this.next = function() {
		this.actImg = (this.actImg >= (this.totalImgs - 1)) ? 0: this.actImg + 1;
		this.setSrc();
		return false;
	}

	this.prev = function() {
		this.actImg = (this.actImg == 0) ? (this.totalImgs - 1): this.actImg - 1;
		this.setSrc();
		return false;
	}
	
	this.open = function() {
		openPic('/picviewer.php?bild=' + this.largeDir, 'img', true);
		return false;
	}
	
	this.setSrc = function() {
		this.img.src = this.imgs[this.actImg];
	}
}


// 	Funktion oeffent Browser Fenster mit vergroesserter Ansicht des Bildes (aufrufen mit 'url' und 'name')
function openPic(url,name, menu) {
	if(menu) { 
		if ((navigator.appName.indexOf("Explorer") != -1) && (navigator.platform.indexOf("Mac") != -1)) {
			window.open(url, name,'height=330,width=400,locationbar=no,menubar=no,resizable=no,status=yes');
		} else {
			window.open(url, name,'height=380,width=450,locationbar=no,menubar=no,resizable=no,status=yes');
		}
	} else { 
		if ((navigator.appName.indexOf("Explorer") != -1) && (navigator.platform.indexOf("Mac") != -1)) {
			window.open(url, name,'height=300,width=400,locationbar=no,menubar=no,resizable=no,status=yes');
		} else {
			window.open(url, name,'height=350,width=450,locationbar=no,menubar=no,resizable=no,status=yes');
		}
	}
}

// 	Funktion oeffent Browser Fenster mit vergroesserter Ansicht des Bildes (aufrufen mit 'url' und 'name')
function openPlan(url,name,hight,width) {
    if ((navigator.appName.indexOf("Explorer") != -1) && (navigator.platform.indexOf("Mac") != -1)) {
		optStr = 'height=' + hight + ',width=' + width + ',locationbar=no,menubar=no,resizable=no,status=yes';
		window.open(url, name, optStr);
	} else {
		optStr = 'height=' + hight + ',width=' + width + ',locationbar=no,menubar=no,resizable=no,status=yes';
		window.open(url, name, optStr);
   	}
}
