/**
  *
  * Datei               -> getPosition.js
  * Zuletzt geändert am -> 2010-06-14 21:13:07
  * Verwendung          -> Positionierung der HTML Elemente auf der Hauptseite
  * Copyright by        -> projects of WDNS.at
  *
  **/

var contentDyn = 'false';
var gesamtHoehe = 600;
var gesamtBreite = 1000;
var randSeitlich = 0;
var randObenUnten = 2;
var borderWidth = 1;
var contentHeight = 466;
var footerShow = 'true';
var footerHeight = 30;
var contentTop = 130;
var contentLeft = 2;
var contentWidth = 780;
var srollBarWidth = 20;
var pbarShow = 'false';
var menuHeight = 25;
var pbarTop = 5;
var pbarLeft = 870;
var pbarWidth = 120;
var pbarStart = 'false';
var menuShow = 'true';
var menuTop = 95;
var menuLeft = 255;
var menuWidth = 600;
var pbarHeight = 10;
var contentShow = 'true';
var footerShImprint = 'true';
var footerShContact = 'true';
var footerShAgb = 'true';
var footerShCounter = 'true';
var mtop; if(footerHeight<20)footerHeight=20;

/*
 **** Objekte ermitteln ****/

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];
  }
}

/*
 **** HTML (Element) Größe ermitteln ****/

function getLPosition(e){
	if (!e) var e = window.event;
	var x,y;

	if (self.innerHeight){
		x = self.innerWidth;
		y = self.innerHeight;
	}else if (document.documentElement && document.documentElement.clientHeight){
		// Explorer 6 Strict Mode
		x = document.documentElement.clientWidth;
		y = document.documentElement.clientHeight;
	}else if (document.body){
	       // other Explorers
		x = document.body.clientWidth;
		y = document.body.clientHeight;
    }

	var mcontent =  new getObj('div_main_content');
	var content  =  new getObj('content');
	var menu     =  new getObj('wdnsMenu');
	var appWidth = gesamtBreite;
	var appLeft  = (x-appWidth-randSeitlich)/2;

/*
 **** CORE Elements *********************/

	 if(menuShow=='true'){
	  menu.style.visibility = 'visible';

	   if(contentDyn == 'true'){
		 menu.style.top     = randObenUnten+menuTop*1 + 'px';
	   }else{
		 menu.style.top     = (y-gesamtHoehe-footerHeight)/2-borderWidth+menuTop*1 + 'px';
	   }
	  menu.style.left    = (appLeft+menuLeft)*1 + 'px';
	  menu.style.height  = menuHeight + 'px';
	  menu.style.width   = menuWidth + 'px';
	 }else{
	  menu.style.visibility = 'hidden';
	 }

	 if(footerShow=='true'){
	   var footer =  new getObj('div_main_footer');
	   var fooImprint = new getObj('fooImprint');
	   var fooContact = new getObj('fooContact');
	   var fooAgb = new getObj('fooAgb');
	   var fooCounter = new getObj('fooCounter');
	   footer.style.display = 'block';
	   footer.style.width   = appWidth + 'px';
	   footer.style.left    = appLeft + 'px';
	   footer.style.height  = footerHeight-(borderWidth*2)*1 + 'px';

	   if(footerShImprint=='true')fooImprint.style.display = 'inline';
	   if(footerShContact=='true')fooContact.style.display = 'inline';
	   if(footerShAgb=='true')fooAgb.style.display = 'inline';
	   if(footerShCounter=='true')fooCounter.style.display = 'inline';

	 }else{
	   footerHeight = 0;
	 }


	 if(contentDyn == 'false'){
		 mcontent.style.height = gesamtHoehe + 'px';
		 mtop                  = (y-gesamtHoehe-footerHeight)/2-borderWidth;
		 mcontent.style.top    = mtop + 'px';
		 content.style.height  = contentHeight + 'px';
		 if(footerShow=='true')footer.style.top = mtop+gesamtHoehe*1  + 'px';
	 }else{
		 mcontent.style.height    = (y-footerHeight-(borderWidth*2)-(randObenUnten*2)) + 'px';
		 mcontent.style.top       = randObenUnten + 'px';
		 content.style.height     = y-footerHeight-(borderWidth*2)-(randObenUnten*2)-contentTop-7 + 'px';
		 if(footerShow=='true')footer.style.top = (y-footerHeight-(borderWidth*2)-randObenUnten)*1  + 'px';
	 }

	 content.style.width     = contentWidth + 'px';
	 content.style.top       = contentTop   + 'px';
	 content.style.left      = contentLeft  + 'px';
	 content.style.padding   = '0px';

	 mcontent.style.width     = appWidth + 'px';
	 mcontent.style.left      = appLeft  + 'px';

/*
 **** ProgressBar MUSST BE HERE**********/

	 if(pbarShow=='true'){
	  var pbar                = new getObj('progressBar');
	  pbar.style.top          = pbarTop  + 'px';
	  pbar.style.left         = pbarLeft + 'px';
	  pbar.style.height       = pbarHeight  + 'px';
	  pbar.style.width        = pbarWidth + 'px';
	 }else{
	  var pbar                =  new getObj('progressBar');
	  pbar.style.top          = '0px';
	  pbar.style.left         = '0px';
	  pbar.style.height       = '0px';
	  pbar.style.width        = '0px';
	 }
	 if(pbarStart=='true')startProgressBar();

/*
 **** PlugIns ***************************/


var logo = new getObj('div_plugin_logo');
    logo.style.height = '100px';
    logo.style.top = '0px';
    logo.style.left = '0px';
    logo.style.width = '240px';
    logo.style.display = 'block';


} //END FUNCTION




/*
 *  Positionierung der Elemente auf der Intro Seite
 *
 */

function getEPosition(e){

	if(!e) var e = window.event;

	var x,y;

	if(self.innerHeight){
		x = self.innerWidth;
		y = self.innerHeight;
	}else if (document.documentElement && document.documentElement.clientHeight){
		// Explorer 6 Strict Mode
		x = document.documentElement.clientWidth;
		y = document.documentElement.clientHeight;
	}else if (document.body){
	       // other Explorers
		x = document.body.clientWidth;
		y = document.body.clientHeight;

	}

	 var scroll   =  new getObj('scroll');
	 var footer   =  new getObj('footer_line');

	 scroll.style.top      = (y-490)/2 + 'px';
     scroll.style.left     = (x-988)/2 + 'px';
     footer.style.left     = (x-988)/2 + 'px';
     footer.style.top      = (y+495)/2 + 'px';
     footer.style.width    = '980px';

}

function getErrPosition(e){

	if(!e) var e = window.event;

	var x,y;

	if(self.innerHeight){
		x = self.innerWidth;
		y = self.innerHeight;
	}else if (document.documentElement && document.documentElement.clientHeight){
		// Explorer 6 Strict Mode
		x = document.documentElement.clientWidth;
		y = document.documentElement.clientHeight;
	}else if (document.body){
	       // other Explorers
		x = document.body.clientWidth;
		y = document.body.clientHeight;

	}

	 var scroll   =  new getObj('errImg');
	 var footer   =  new getObj('errTxt');

     scroll.style.top      = (y-490)/2 + 'px';
     scroll.style.left     = (x-988)/2 + 'px';
     footer.style.left     = (x-988)/2 + 'px';
     footer.style.top      = (y+495)/2 + 'px';
     footer.style.width    = '980px';

}


