var intro;
var logo;
var navi;
var oldScroll = -10;
var oldHeight = 0;
var oldWidth = 0;
var browser = navigator.appVersion;
var macnoscroll = 0;

function init() {
  logo = new getObj('logo');
	navi = new getObj('navi');
	movemenu();
}

function initintro() {
  intro = new getObj('divin');
  moveintro();
}

function tdresize() {	 


	document.getElementById('bodycontent').style.height = document.documentElement.clientHeight + "px";

}

function footerwidth() {	

	if (window.innerHeight) { //Netscape Version
		var x = window.innerWidth;
	}
	if(document.body) { //IE VERSION
		var x = document.body.clientWidth;
	}
	    var y = x-295-308;
	document.getElementById('footerw').style.width = y+"px";	
}

function movemenu() {

  if (window.innerHeight) {  //Netscape Version
	  winHeight = window.innerHeight;
		winWidth  = document.width; 
    posScroll = window.pageYOffset;
  }
  else if (document.body) {  //IE Version
	  winHeight = document.documentElement.clientHeight;
		winWidth  = document.documentElement.clientWidth;
    posScroll = document.documentElement.scrollTop;
  }

	   if(winWidth < 955) {
		   winWidth = 940 - winWidth;
		 }
		 else{
		   winWidth = -15;
		 }
		 
		/* if(macnoscroll != 1){
		  navi.style.top  = posScroll;
			navi.style.right = 0+"px";
		} */ 
		 
  logo.style.top  = posScroll + winHeight - 60+"px";
 
	oldHeight = winHeight;
	oldWidth  = winWidth;
  oldScroll = posScroll;

	if(browser.indexOf("MSIE") > 0 && browser.indexOf("Mac") > 0){
	  macnoscroll = 1;
	}	
	
  temp = setTimeout('movemenu()',1000);
  }

function moveintro() {

  if (window.innerHeight) {  //Netscape Version
	  winHeight = window.innerHeight;
		winWidth  = document.width; 
    posScroll = window.pageYOffset;
  }
  else if (document.body) {  //IE Version
	  winHeight = document.body.clientHeight;
		winWidth  = document.body.clientWidth;
    posScroll = document.body.scrollTop;
  }
    intro.style.top  = (winHeight / 2) - 285;	
  }

function getObj(name) {
  if (document.getElementById) {
        this.obj = document.getElementById(name);
        this.style = document.getElementById(name).style;
  }
  else if (document.all) {
        this.obj = document.all[name];
        this.style = document.all[name].style;
  }
  else if (document.layers) {
        this.obj = document.layers[name];
        this.style = document.layers[name];
  }
}


//function to change the images on the left
var lastDiv = 0;
var lastalink = 1;

function switchDiv(newDiv,alink,anzahl) {
	
	//var getlink = document.getElementsByName("link"+newDiv+alink);
	//var getoldlink = document.getElementsByName("link"+lastDiv+lastalink);		
	//var currentlink= document.getElementsById("linkCurrent");
	
	divName = "image_"+lastDiv;	
	
	hideDiv = new getObj(divName);
	hideDiv.style.visibility = "hidden";
	
	
	divName = "image_"+newDiv;
	
	showDiv = new getObj(divName);
	showDiv.style.visibility = "visible";	
	//if(getlink.length > 1) {
	//for(var i = 0; i<anzahl; i++) {
	//getoldlink[i].style.color = ""; 
	//getlink[i].style.color = "#606565"; 	
	//}	
	//}
	lastDiv = newDiv;	
	//lastalink = alink;
}


function disable_submit()
  {
	for(var i=0;i<document.editorform.length;++i)
    {
		if(document.editorform.elements[i].type == "submit" || document.editorform.elements[i].type == "button" || document.editorform.elements[i].type == "reset")
		  {
			document.editorform.elements[i].disabled = true;
			} 
    }
	}
	
function regular_submit()
  {
	document.editorform.submit();
	disable_submit();
	}
	
function register_submit()
  {
	document.editorform.register.value = 1;
	document.editorform.submit();
	disable_submit();
	}