
function siteload()
{
	siteheight();
	MM_preloadImages('images/link_unternehmung_aktiv.jpg','images/link_kompetenzen_aktiv.jpg','images/link_mitarbeiter_aktiv.jpg','images/link_tools_aktiv.jpg');
    document.getElementById("merkzettel").style.display = "block";
}

function siteheight()
{
	var con = document.getElementById("content");
	var navi = document.getElementById("navigation");
	var navis = document.getElementById("navistrich");
	var sidebar = document.getElementById("sidebar");

	if(con.offsetHeight > 451 && con.offsetHeight > (getwindowheight()-171))
	{
		navi.style.height = con.offsetHeight+"px";
		navis.style.height = con.offsetHeight+"px";
		sidebar.style.height = con.offsetHeight+"px";
	}
	else
	{
		if(getwindowheight() > 620)
		{
			navi.style.height = getwindowheight()-171+"px";
			navis.style.height = getwindowheight()-171+"px";
			sidebar.style.height = getwindowheight()-171+"px";
		}
		else
		{
			navi.style.height = "450px";
			navis.style.height = "450px";
			sidebar.style.height = "450px";
		}
	}
	
	var bild = document.getElementById("bild");
	var header = document.getElementById("header");
	
	if(getWindowWidth() < 1080)
	{
	    bild.style.left = "630px";
	}
	else
	{
	    bild.style.left = "auto";
	}
	//bild.style.right = "20px";
	 
	//alert(getWindowWidth());
}


// returns INNER width of window
function getWindowWidth() {
 // if innerWidth is unknown [Internet Explorer] use offsetWidth
  if (window.innerWidth) {
    return window.innerWidth;
  } else if (document.body && document.body.offsetWidth) {
   // important: for IE set body width = 100%
   document.getElementsByTagName("body")[0].style.setAttribute("width", "100%", "false");
    return document.body.offsetWidth;
  } else {
    return 0;
  }
}

function getwindowheight() { 
var windowHeight = 0; 
if (typeof(window.innerHeight) == 'number') { 
windowHeight = window.innerHeight; 
} 
else { 
if (document.documentElement && document.documentElement.clientHeight) { 
windowHeight = document.documentElement.clientHeight; 
} 
else { 
if (document.body && document.body.clientHeight) { 
windowHeight = document.body.clientHeight; 
} 
} 
} 
return windowHeight; 
} 

function fontSize(Pixel){
    var addPixel = eval((document.getElementById("content").style.fontSize.replace("px","") == 0 ? 12 : document.getElementById("content").style.fontSize.replace("px",""))) + Pixel;
    document.getElementById("content").style.fontSize = addPixel + "px";
    siteheight();
}


var mas = new Array();

function showma(ma){
    mas.push(ma);
    for (i = 0; i < mas.length; i++) {
        document.getElementById(mas[i]).style.display = "none";
    }
    document.getElementById(ma).style.display = "block";
    siteheight();
}

function hidema(ma){
    //document.getElementById(ma).style.display = "none";
}

function trim(str){
    str = str.replace(" ", "");
    return str;
}

function generatePassword(field) {
    var length=6;
    var sPassword = "";

    var noPunction = true;
    var randomLength = false;

    if (randomLength) {
        length = Math.random();

        length = parseInt(length * 100);
        length = (length % 7) + 6;
    }


    for (i=0; i < length; i++) {

        numI = getRandomNum();
        if (noPunction) { while (checkPunc(numI)) { numI = getRandomNum(); } }

        sPassword = sPassword + String.fromCharCode(numI);
    }

    document.getElementById(field).value = sPassword;

    return true;
}

function getRandomNum() {

    // between 0 - 1
    var rndNum = Math.random();

    // rndNum from 0 - 1000
    rndNum = parseInt(rndNum * 1000);

    // rndNum from 33 - 127
    rndNum = (rndNum % 94) + 33;

    return rndNum;
}

function checkPunc(num) {

    if ((num >=33) && (num <=47)) { return true; }
    if ((num >=58) && (num <=64)) { return true; }
    if ((num >=91) && (num <=96)) { return true; }
    if ((num >=123) && (num <=126)) { return true; }

    return false;
}


function film()
{
    document.getElementById("filmfilm").style.display = "block";
    document.getElementById("bildfilm").style.display = "none";
    siteheight();
}

function adresseSchreiben(text1, text2, text3)
{

Mailstring = text1  + '@' + text2 + '.' + text3;

document.write('<a href="' + 'mailto:' + Mailstring + '">')
document.write( Mailstring + '</a>');
}

