function fadein(id) { 

	    //speed for each frame 
    var speed = Math.round(100 / 100); 
    var timer = 0; 

    //determine the direction for the blending, if start and end are the same nothing happens 
        for(i = 0; i <= 100; i++) 
            { 
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); 
            timer++; 
        } 
} 

function fadeout(id) { 

	    //speed for each frame 
    var speed = Math.round(200 / 100); 
    var timer = 0; 
    var ergebnis = 101;

    //determine the direction for the blending, if start and end are the same nothing happens 
        for(i = 100; i >= 0; i--) { 
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); 
            timer++; 
            ergebnis--;
        } 
    if(i == -1){
 	   return i;
	}
} 

//change the opacity for different browsers 
function changeOpac(opacity, id) { 
    var object = document.getElementById(id).style; 
    object.opacity = (opacity / 100); 
    object.MozOpacity = (opacity / 100); 
    object.KhtmlOpacity = (opacity / 100); 
    object.filter = "alpha(opacity=" + opacity + ")"; 
} 

function ZweiFrames(URL1, URL2){
	parent.mitte.location = URL1;
	parent.rechts.location = URL2;	
}

function fade_frames(URL1,URL2)
{
	fadeout('main')
	setTimeout("fadein('main')",300);
	setTimeout("ZweiFrames('" + URL1 + "','" + URL2 + "')",200);
}

function warten(prmSec)
  {
  prmSec *= 1000;
  var eDate = null;
  var eMsec = 0;
  var sDate = new Date();
  var sMsec = sDate.getTime();

  do {
      eDate = new Date();
      eMsec = eDate.getTime();

  } while ((eMsec-sMsec)<prmSec);
}

window.onload = function(){
	var guddasURL = document.URL;
	var parameter = guddasURL.substr((guddasURL.indexOf("?")+1));
	
	if(parameter == "datenschutz"){
		parent.mitte.location = 'mitte_datenschutz.php';
	}
}

