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');
		 	var mnu = xGetElementById(SM_SHORT);

			HideSelects(xPageX(mnu), xPageY(mnu), xWidth(mnu), xHeight(mnu));

		 akt_sub=SM_SHORT;			   
	}

		//IFrame ausblenden beim IE 5.0 -> Untermenü wird überblendet
		var iFrame = document.getElementById("calc");
		if(iFrame && xIE5){
			iFrame.style.visibility = "hidden";
		}

}

var sel;
function HideSelects(x,y,w,h) {

	if(xIE4Up && !xMac) {
		var selx,sely,selw,selh,i
		if(!sel) sel = document.getElementsByTagName("SELECT");
		for(i=0;i<sel.length;i++){
			selx=xPageX(sel[i]);
			sely=xPageY(sel[i]);
			selw=sel[i].offsetWidth;
			selh=sel[i].offsetHeight;
			sel[i].style.visibility = (selx+selw>x && selx<x+w && sely+selh>y && sely<y+h) ? "hidden" : "visible";
		}
/*		var ifr=document.getElementById("calcdiv");
		if (ifr) {
		ifr.style.top='160px';
		}*/

	}
}

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');
 
}