// JavaScript Document

NS6=false;
IE4=(document.all);
if (!IE4) {NS6=(document.getElementById);}
NS4=(document.layers);

function submitTimetableForm() {
	
	document.formular.submit();

	setTimeout('showTimetableFormError()',3000);
}

function showTimetableFormError() {
	
	if (NS4) document.layers['formerror'].visibility = "show";
	if (NS6) document.getElementById('formerror').style.display = "block";
	if (IE4) document.all['formerror'].style.display = "block";
	
}

function getPageWidth() {
		
	if( window.innerWidth && window.scrollMaxX ) { // Firefox 
		pageWidth = window.innerWidth + window.scrollMaxX;
		pageHeight = window.innerHeight + window.scrollMaxY;
	}
	else if( document.body.scrollWidth > document.body.offsetHeight ) // all but Explorer Mac
	{
		pageWidth = document.body.scrollWidth;
		pageHeight = document.body.scrollHeight;
	}
	else // works in Explorer 6 Strict, Mozilla (not FF) and Safari
	{
		pageWidth = document.body.offsetWidth + document.body.offsetLeft;
		pageHeight = document.body.offsetHeight + document.body.offsetTop;
	}
	
	return pageWidth;
}

function adjust() {

contentwidth = 750;
advertwidth = 140;

	if (getPageWidth() < 10 + contentwidth + advertwidth) {
		if (NS4) document.layers['main'].width = 750;
		if (NS6) document.getElementById('main').style.width = "750px";
		if (IE4) document.all['main'].style.width = 750;		
		if (NS4) document.layers['logos'].visibility = "none";
		if (NS6) document.getElementById('logos').style.display = "none";
		if (IE4) document.all['logos'].style.display = "none";
	} else {
		if (NS4) document.layers['main'].width = 890;
		if (NS6) document.getElementById('main').style.width = "890px";
		if (IE4) document.all['main'].style.width = 890;	
		if (NS4) document.layers['logos'].visibility = "show";
		if (NS6) document.getElementById('logos').style.display = "block";
		if (IE4) document.all['logos'].style.display = "block";	
	}

	setTimeout('adjust()',30);
}

function popitup(theURL,winName,features)
{
	newwindow=window.open(theURL,winName,features);
	if (window.focus) {newwindow.focus()}
	return false;
}

function showContactDetails(id)
{
	SwissReviewChild=window.open('showcontactdetails.php?id='+id,'SwissReviewChild','status=no,scrollbars=no,width=300,height=150,left=50,top=150,resizable=no');
	SwissReviewChild.focus();
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_setTextOfLayer(objName,x,newText) { //v3.0
  if ((obj=MM_findObj(objName))!=null) with (obj)
    //if (navigator.appName=='Netscape') {document.write(unescape(newText)); document.close();}
    //else innerHTML = unescape(newText);
	innerHTML = unescape(newText);
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}