
// set window height
function windowResize() {
	if (document.getElementById('content') && document.getElementById('content').style.height!=548) {
		document.getElementById('content').style.height=548;
	}
	if (document.getElementById('overview') && document.getElementById('overview').style.height!=568) {
		document.getElementById('overview').style.height=568;
	}
	if (document.getElementById('mainTable') && document.getElementById('mainTable').style.height!=568) {
		document.getElementById('mainTable').style.height=568;
	}
	//if (document.getElementById('mainTable') && document.getElementById('mainTable').style.marginTop!=((document.body.clientHeight/2)-284)) {
	//	document.getElementById('mainTable').style.marginTop=((document.body.clientHeight/2)-284);
	//}
}

window.onresize = windowResize;

var usrAgent = navigator.userAgent.toLowerCase();
//alert(usrAgent);

function backButton() {
	if (document.getElementById('photobig_table') && document.getElementById('photobig_table').style.border.indexOf("0px") != -1) {
		
		//alert(document.getElementById('photobig_table').style.border);
		
		var url = document.location.href;
		if (url.indexOf("?id=")!=-1) {
			url = url.substr(url.indexOf("?id="));
		}
		else if (url.indexOf("&id=")!=-1) {
			url = url.substr(url.indexOf("&id="));
		}
		var param = url.split("&");
		param = param[1].split("#");
		var aid = param[0].replace("id=","");
		
		if (aid != '' && aid != 'undefined') {
			deactivatePhotogallery(aid);
		}
		if (usrAgent.indexOf('firefox')!=-1) history.go(-1);
	}
	else {
		history.go(-1);
	}
}

function backButton2() {
/*	if (document.getElementById('photobig_table') && document.getElementById('photobig_table').style.border.indexOf("0px") != -1) {*/

		var url = document.location.href;
		if(url.indexOf("Schauspielerinnen") != -1) {
			//var stopSub = url.indexOf("Schauspielerinnen");
			location.href = "http://www.agentur-unitone.de/Schauspielerinnen";
		}
		else if(url.indexOf("Schauspieler") != -1) {
			//var stopSub = url.indexOf("Schauspieler");
			location.href = "http://www.agentur-unitone.de/Schauspieler";
		}
		else
			location.href = "http://www.agentur-unitone.de/Schauspielerinnen/";
	}
//}

function newWindowRes(url,name,width,height) {
	fenster = window.open (
	url,
	name, 					// name
	"toolbar=0" 			// tool bar 
	+",location=0" 			// address bar
	+",directories=0" 		// additional bars
	+",status=1" 			// status bar
	+",menubar=0" 			// menu bar
	+",scrollbars=yes" 		// scroll bars
	+",resizable=1" 		// window resizable
	+",width=" + width 		// window width in pixels
	+",height=" + height 	// window height in pixels
	);
}
