window.onload = height;


var ie6=document.getElementById&&document.all&&(navigator.appVersion.indexOf("MSIE 6.")!=-1);
var ie = ((document.all) && (window.offscreenBuffering)) ? true : false;;


function height(){
    if(document.getElementById("content")){
        var contentheight = document.getElementById("content").offsetHeight;
        var rightheight = document.getElementById("private").offsetHeight ;

        var isMSIE//@cc_on=1;
        var ie7 = (typeof document.addEventListener != 'function' && window.XMLHttpRequest) ? true : false;

        var privat_height = document.getElementById("private").style.height;
        privat_height = privat_height.replace(/px/,"");

	    if(privat_height == "2222"){
            if(ie7)
                document.getElementById("private").style.height = (contentheight-232)+"px";
            else if(isMSIE)
                    document.getElementById("private").style.height = (contentheight-273)+"px";
            else
                    document.getElementById("private").style.height = (contentheight-240)+"px";
	    }
	    else if(privat_height == "1111"){
            if(ie7)
                document.getElementById("private").style.height = (contentheight-233)+"px";
            else if(isMSIE)
                    document.getElementById("private").style.height = (contentheight-292)+"px";
            else
                    document.getElementById("private").style.height = (contentheight-240)+"px";
	    }

  	    else if((contentheight-230) > privat_height){
            if(ie7)
                document.getElementById("private").style.height = (contentheight-236)+"px";
            else if(isMSIE)
                    document.getElementById("private").style.height = (contentheight-240)+"px";
            else
                    document.getElementById("private").style.height = (contentheight-240)+"px";
                
	    }


	     if(isMSIE){ //ie BUGfix
	            document.getElementById("content_left").style.bottom = "47px";
       	     if(ie7){
              	  document.getElementById("onsite").style.height = "100%";
	                document.getElementById("content_left").style.bottom = "32px";
       	     }
	            else{
       	         document.getElementById("onsite").style.height = (contentheight+345)+"px";
              	  document.getElementById("onsite_bottom").style.bottom = "-"+(contentheight-580)+"px";
            	    }
	    }
    }
}


function switchImageSimple(imgId, imgState) 
{
  if (document.getElementById)
  {
	var imageSrcCurrent = document.getElementById(imgId).src;
    if (imgState == "hi")
    {
	  //Mouseover Service und Technik Ende
	  imageSrcCurrent = imageSrcCurrent.replace(/.gif/,"_hi.gif");
      document.getElementById(imgId).src = imageSrcCurrent;
    } else
    {
	  var imagesrclow = document.getElementById(imgId).src;
	  imagesrclow = imagesrclow.replace(/_hi.gif/, ".gif");
      //Mouseout Service und Technik Ende
	  document.getElementById(imgId).src = imagesrclow;
    }
  }
} 



function getFlashVer(){
	var flashVer = -1;
	
	if (navigator.plugins != null && navigator.plugins.length > 0) {
		if (navigator.plugins["Shockwave Flash"]) {
			var flashDescription = navigator.plugins["Shockwave Flash"].description;
			var descArray = flashDescription.split(" ");
			var tempArrayMajor = descArray[2].split(".");			
			var versionMajor = tempArrayMajor[0];
			var flashVer = versionMajor;
		}
	}
	else if (navigator.appVersion.indexOf("MSIE") != -1 && navigator.appVersion.toLowerCase().indexOf("win") != -1) {
        try {
            axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
            flashVer = axo.GetVariable("$version");
            flashVer = flashVer.substr(4,2).replace(/,/, "");
	    } catch (e) {}
	}	
	return flashVer;
}

// Flash-Detection
var plugin = (getFlashVer() >= 8)?1:0;
var plugin6 = (getFlashVer() >= 6)?1:0;

function showFlash(src, width, height, quality, menu, bgcolor, flashvars) { 
	closeTags = "</" + "embed></" + "object>";
        document.write('<object name="flash" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="' + width + '" height="' + height + '" title="flash"><param name="movie" value="' + src + '"><param name="quality" value="' + quality + '"><param name="play" value="true" /><embed src="' + src + '" quality="' + quality + '" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" play="true" width="' + width + '" height="' + height + '">'+closeTags); 
} 

function gotoPage(u) {
	if(top.opener!=null){
		top.opener.location.href = u;
	}
	else {
		window.open(u,'mainWindow');
	}
}
function error_close(){
	document.getElementById('login_errorbox_root').style.display = 'none';
}

function blackPopUp(url, size){
	args = 'width=650,height='+size+',scrollbars';
	window.open(url,'',args)
}







function randomLayer(){
    height();
    var cookie = document.cookie;
    if(cookie.search(/befragt.+/) == -1){
        var random = Math.round(Math.random()*2);
        if(random == '2'){
            showLayer("rxcBefragung");
        }
    }
}

function showLayer(layerid){
    document.getElementById("dunkel").style.display = "block";
    document.getElementById(layerid).style.display = "block";
if(ie6){
    document.getElementById("login_authtype").style.display = "none";
    for(i=0;i<4;i++)
	document.getElementsByName("eventid")[i].style.display = "none";
}
    for(i=0;i<2;i++)
	document.getElementsByName("flash")[i].style.display = "none";
}

function hideLayer(layerid, submit){
    document.getElementById(layerid).style.display = "none";
    document.getElementById("dunkel").style.display = "none";

    if(ie6){
    	document.getElementById("login_authtype").style.display = "block";
    	for(i=0;i<4;i++)
	    document.getElementsByName("eventid")[i].style.display = "block";
    }

    for(i=0;i<2;i++)
	document.getElementsByName("flash")[i].style.display = "block";

    if(submit){
        document.cookie = "befragt=true; expires=Thu, 01-Jan-09 00:00:01 GMT;";
    }
}