
/* DEFINE GLOBAL VARIABLES */
iLayoutHeight = 0;
arInit = new Array();

/* BASIC INIT-FUNCTION */
function initClient() {

	/* START GOOGLE MAP FOR MENUPOINT WITH ID 8 (Wegbeschreibung) */
	if (s==38) {
		GLoad();
		window.onunload = GUnload;
	}

	/* FIND THE LARGEST LAYOUT-DIV AND SET ALL L-DIVS TO CORRECT DESIGN */
	var iHH = $('titleBox').getStyle('height').toInt();
	var iHN = $('navigation').getStyle('height').toInt();
	iLayoutHeight = iHN;
	var iHC = $('content').getStyle('height').toInt();
	if (iLayoutHeight < iHC) iLayoutHeight = iHC;
	if ($('teaser')) {
		var iHT = $('teaser').getStyle('height').toInt();
		if (iLayoutHeight < iHT) iLayoutHeight = iHT;
	}
	iLayoutHeight = iLayoutHeight + iHH + 10;
	setLayoutHeight();
	window.onresize = setLayoutHeight;

	/* arInit CAN CONTAIN NAMES OF FUNCTIONS WHICH INITIALIZE EFFECTS... */
	for (var i = 0; i < arInit.length; i++) {
		eval(arInit[i] + '();');
	}
}

/* INIT JAVASCRIPT-FUNCTIONALITIES */
window.onload = function() {
	initClient();
};

/* INITIALIZE GOOGLE MAP */
function GLoad() {
	if (GBrowserIsCompatible()) {
		var map = new GMap2(document.getElementById("maptorit"));
		map.addControl(new GSmallMapControl());
		map.setCenter(new GLatLng(48.772788, 9.157597), 15);
		var point = new GLatLng(48.772788, 9.157597);
		var marker = new GMarker(point);
		GEvent.addListener(marker, "click", function() { marker.openInfoWindowHtml("Die <strong>release it gmbh</strong><br />finden Sie in der<br />Ludwigstraße 69<br />in Stuttgart-West."); });
		map.addOverlay(marker);
	}
}

/* SET DYNAMICALLY LAYOUT HEIGHT */
function setLayoutHeight() {
	var iHtoSet = (iLayoutHeight > window.getHeight()) ? iLayoutHeight + 'px' : '100%';
	/*var iHtoSet = iLayoutHeight + 'px';*/
	$('elHtml').setStyle('height', iHtoSet);
	$('elBody').setStyle('height', iHtoSet);
	$('screen').setStyle('height', iHtoSet);
	$('navigationBox').setStyle('height', iHtoSet);
	$('contentBox').setStyle('height', iHtoSet);
	$('navigationBox').setStyle('height', iHtoSet);
}

/* RELEASE CMS BASIC FUNCTIONALITIES */
function PicPrev(url, src) {
	url = url + "?src=" + src;
	NewWindow(url, 100, 100, "showimg", "yes");
}

function NewWindow(url, w, h, name, scroll) {
	NewWin = window.open(url,name,"width="+w+",height="+h+",scrollbars="+scroll+",status=no,toolbar=no,menubar=no,resizable=yes");
	NewWin.focus();
}

function preview() {
	url = p + ";bPrint:1";
	printWin = window.open(url, "printpage", "width=620,height=400,scrollbars=yes,status=no,toolbar=no,menubar=yes,resizable=no");
	printWin.focus();
}

function search() {
	document.frmSearch.submit();
}

function newwin(w,h) {
  myparm = 'width='+ w +',height='+ h +',scrollbars=no,status=no,toolbar=no,menubar=no';

  mywindow=window.open('','newwin',myparm);
  mywindow.focus();
}

/*
PERHAPS WE DO NOT NEED THIS

var setP = 1;
function showP(id) {
	if (document.getElementById("p" + setP)) {
		document.getElementById("p" + setP).style.display = "none";
	}
	if (document.getElementById("l" + setP)) {
		document.getElementById("l" + setP).className = "default";
	}
	if (document.getElementById("p" + id)) {
		document.getElementById("p" + id).style.display = "block";
		setP = id;
	}
	if (document.getElementById("l" + id)) {
		document.getElementById("l" + id).className = "selected";
		setP = id;
	}
}
*/
