/**
  *
  * Datei               -> getPosition.js
  * Zuletzt geändert am -> 2011-05-24 04:05:47
  * Verwendung          -> Positionierung der HTML Elemente auf der Hauptseite
  * Copyright by        -> projects of WDNS.at
  *
  **/

var contentDyn = 'true';
var gesamtHoehe = 700;
var gesamtBreite = 1000;
var randSeitlich = 0;
var randObenUnten = 0;
var borderWidth = 1;
var datetimeShort = 'false';
var contentHeight = 466;
var footerShow = 'true';
var footerHeight = 25;
var contentTop = 180;
var contentLeft = 0;
var contentWidth = 1000;
var srollBarWidth = 20;
var pbarShow = 'true';
var menuHeight = 30;
var pbarTop = 2;
var pbarLeft = 870;
var pbarWidth = 100;
var pbarStart = 'false';
var menuShow = 'true';
var menuTop = 110;
var menuLeft = 680;
var menuWidth = 320;
var pbarHeight = 20;
var contentShow = 'true';
var footerShImprint = 'true';
var footerShContact = 'false';
var footerShAgb = 'false';
var footerShCounter = 'true';
var introShow = 'false';
var introMainWidth = 800;
var introMainHeight = 400;
var introInfoWidth = 800;
var introInfoHeight = 100;
var datetimeDate = 'false';
var coretoolsShow = 'false';
var coretoolsHeight = 22;
var coretoolsTop = 2;
var coretoolsLeft = 975;
var coretoolsWidth = 58;


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('div_main_menu');
	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-1 + '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';
	 }
	 if(pbarStart=='true')startProgressBar();

	 if(coretoolsShow=='true'){
	  var coretools                = new getObj('coretools');
	  coretools.style.top          = coretoolsTop  + 'px';
	  coretools.style.left         = coretoolsLeft + 'px';
	  coretools.style.height       = coretoolsHeight  + 'px';
	  coretools.style.width        = coretoolsWidth + 'px';
	  coretools.style.display      = 'inline';
	 }

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

var logo = new getObj('div_plugin_logo');
    logo.style.height = '175px';
    logo.style.top = '5px';
    logo.style.left = '-70px';
    logo.style.width = '300px';
    logo.style.display = 'block';

var style1 = new getObj('div_plugin_style1');
    style1.style.height = '180px';
    style1.style.top = '0px';
    style1.style.left = '0px';
    style1.style.width = '1000px';
    style1.style.display = 'block';


    if(document.getElementById('bannertext')==null){
     alert('Diese Anwendung wurde mit dem\ni-VCD - Internet Visiting Card Designer erstellt.\nInformationen unter http://www.i-VCD.at');
    }else{
      var btxt              = document.getElementById('bannertext'); 
      btxt.innerHTML        = '(c)2011 by Lex und Wölbl Ges.b.R.&nbsp;|&nbsp;<span style="cursor:pointer;" onclick="window.open(\'http://www.i-VCD.at\'); return false;">i-VCD.at</span>'; 
      btxt.style.display    = 'inline'; 
      btxt.style.visibility = 'visible';
      btxt.style.styleFloat = 'right'; 
      btxt.style.cssFloat   = 'right'; 
    }

 } //END FUNCTION

/* Positionierung der Elemente auf der Intro Seite */
function getEPosition(e){
var ax,ay;
if(!e) var e = window.event;
if(self.innerHeight){
	ax = self.innerWidth;
	ay = self.innerHeight;
}else if (document.documentElement && document.documentElement.clientHeight){
	// Explorer 6 Strict Mode
	ax = document.documentElement.clientWidth;
	ay = document.documentElement.clientHeight;
}else if (document.body){
	   // other Explorers
	ax = document.body.clientWidth;
	ay = document.body.clientHeight;
}

 var main   =  new getObj('div_introMain');
 var info   =  new getObj('div_introInfo');
 var ah = (introMainHeight+introInfoHeight)*1;
 main.style.top      = (ay-ah)/2 + 'px';
 main.style.left     = (ax-introMainWidth)/2 + 'px';
 main.style.height   = introMainHeight + 'px';
 main.style.width    = introMainWidth + 'px';
 info.style.top      = (introMainHeight)+((ay-ah)/2)*1 + 'px';
 info.style.left     = (ax-introInfoWidth)/2 + 'px';
 info.style.height   = introInfoHeight + 'px';
 info.style.width    = introInfoWidth + 'px';
}

