function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;

	} else {
		window.onload = function() {
			if (oldonload) {
				oldonload();
			}
			func();
		}
	}
}


function oeffneFenster(seitenName,instanzName,fensterBreite,fensterHoehe) 
{
   breiteBildschirm = screen.availWidth;
   hoeheBildschirm = screen.availHeight - 20;
   randLinks = breiteBildschirm/2-(fensterBreite/2);
   randOben = hoeheBildschirm/2-(fensterHoehe/2);
   fensterParameter = "top="+randOben+",left="+randLinks+",width="+fensterBreite+",height="+fensterHoehe+",scrollbars=yes,toolbar=no,status=no,resizeable=no,location=no";
   satellitenFenster = window.open(seitenName,instanzName,fensterParameter);
   satellitenFenster.focus();
}


function setLeftMargin() {
	var w;
	if (self.innerHeight) {
		// Mozilla		
		w=self.innerWidth;
	}
	else if (document.documentElement && document.documentElement.clientWidth) {
		// IE 6 Strict
		w=document.documentElement.clientWidth;
	}
	else if (document.body) {
		w=document.body.clientWidth;
	}
	if (w<=1024) {
		var cssFile="/system/modules/de.maritim_invest/resources/css/page_small.css";
		if (document.createStyleSheet) {
    		    document.createStyleSheet(cssFile);
    	        }
  		else {
  			var headID = document.getElementsByTagName("head")[0];
        		var cssNode = document.createElement('link');
			cssNode.type = 'text/css';
			cssNode.rel = 'stylesheet';
			cssNode.media = 'screen';
			cssNode.href = cssFile;
			headID.appendChild(cssNode);	
   		}
   	}
}


setLeftMargin();