function Fensterweite () {
  if (window.innerWidth) {
    return window.innerWidth;
  } else if (document.body && document.body.offsetWidth) {
    return document.body.offsetWidth;
  } else {
    return 0;
  }
}

function Fensterhoehe () {
  if (window.innerHeight) {
    return window.innerHeight;
  } else if (document.body && document.body.offsetHeight) {
    return document.body.offsetHeight;
  } else {
    return 0;
  }
}


//Diverse Ebenen bei Auflösung 800x600 umpositionieren
function CheckAufloesung(){
	objHead = document.getElementById('head');	
	if(objHead){
		if (Fensterweite () < 810) {			
			objHead.style.left="320px";
		} else {
			objHead.style.left="534px";
		}
	}

	objNav = document.getElementById('nav');	
	if(objNav){
		if (Fensterweite () < 810) {			
			objNav.style.padding="0 0 0 0";
		} else {
			objNav.style.padding="0 0 0 181";
		}
	}

	objLogo2 = document.getElementById('logo2');	
	if(objLogo2){
		if (document.body.offsetWidth < 810) {			
			objLogo2.style.left="769px";
		} else {
			objLogo2.style.left="983px";
		}
	}

	var array = new Array('tipp');
	var obj;

	if (Fensterhoehe () < 580) {
		for(i = 0; i < array.length; i++) {
			obj = document.getElementById(array[i])
			if(obj)
				obj.style.display = 'none';
		}
	}else{
		for(i = 0; i < array.length; i++) {
			obj = document.getElementById(array[i])
			if(obj)
				obj.style.display = '';
		}
	}

}

window.onload=function(){CheckAufloesung();}
window.onresize=function(){CheckAufloesung();}




function changeDisplay(div_id,if_,then_)
{
 var elem=document.getElementById(div_id);
 if (elem)
 { if (elem.style.display==if_) {elem.style.display=then_;}

 }
}
function changeVisibility(div_id,if_,then_)
{
 var elem=document.getElementById(div_id);

 if (elem)
 {
  
 if (elem.style.visibility==if_) {elem.style.visibility=then_;}}
} 

function open_sub(SM_SHORT)
{
/*
	if (akt_sub!=SM_SHORT) {

		 changeDisplay(akt_sub,'block','none');
		 changeDisplay(SM_SHORT,'none','block');

		 akt_sub=SM_SHORT;			   
	}
	*/
}
function getAdr(prefix,postfix,lnkparam,lnktxt)
{
  lnktxt=lnktxt.replace(/TMPL_MAIL/,prefix+'@'+postfix);
 document.write('<a '+lnkparam+' href="mailto:'+prefix+'@'+postfix+'">'+lnktxt);
}



/*printjob*/
function printjob()
{		
    
    		if (document.all && (navigator.appVersion.indexOf("Mac") != -1))
		{

		self.focus();
		alert("Drucken-Funktion unter Macintosh nicht moeglich! \nBitte verwenden Sie Datei/Drucken");
		}
		else
		{
					if (document.all && navigator.appVersion.substring(22,23)==4)
      		{
					self.focus();
					var OLECMDID_PRINT = 6;
 					var OLECMDEXECOPT_DONTPROMPTUSER = 2;
 					var OLECMDEXECOPT_PROMPTUSER = 1;
 					var WebBrowser = '<object id="WebBrowser1" width="0" height="0" classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></object>';
 					document.body.insertAdjacentHTML('beforeEnd',WebBrowser);
					WebBrowser1.ExecWB(OLECMDID_PRINT,OLECMDEXECOPT_DONTPROMPTUSER);
 					WebBrowser1.outerHTML = '';
		      }
					else{	self.focus();window.print();}

		}
	}
	
function Startpage(obj)
{
 if (document.all)
 {
 obj.style.behavior='url(#default#homepage)';
 obj.setHomePage('http://www.diesteuerplaner.at/');
 }
} 
function Favorite()
{
 if (document.all)
 {
   window.external.AddFavorite('http://www.diesteuerplaner.at/','Die Steuerplaner');
 }
} 
function cont2pdf(ID)
{
 script="http://www.atikon.at/rechner/content2pdf.php";

 script=script+"?ID="+ID+"&url="+encodeURIComponent(window.location);

 window.open(script,'m','scrollbars=no,height=400,width=470');
 
}
