
function setHeight(){
	/*document.getElementById('pic_right_pos').style.height = window.innerHeight;*/
	
	height_a = document.getElementById('spalte_links').offsetHeight;
	height_b = document.getElementById('spalte_mitte').offsetHeight;
	
	if(document.getElementById('box_rechts')){
		height_c = (document.getElementById('box_rechts').offsetHeight)-97;		/* 77 ist der überstand */
	}
	else{height_c = 0;}

	if(height_a > height_b && height_a > height_c){
		document.getElementById('spalte_mitte').style.minHeight = (height_a-10)+"px";
		if(document.getElementById('box_rechts'))document.getElementById('box_rechts').style.minHeight = (height_a+77)+"px";		
	}
	else if(height_b > height_a && height_b > height_c){
		document.getElementById('spalte_links').style.minHeight = (height_b-10)+"px";
		if(document.getElementById('box_rechts'))document.getElementById('box_rechts').style.minHeight = (height_b+77)+"px";		
	}
	else if(height_c > height_a && height_c > height_b){
		document.getElementById('spalte_links').style.minHeight = (height_c)+"px";
		document.getElementById('spalte_mitte').style.minHeight = (height_c)+"px";		
	}
		
}

/* funktion zum anzeigen der produktbilder */
function changePic(nr,von){
	for(var ipic = 1; ipic <= von; ipic++){
		document.getElementById('pic_'+ipic).style.display = 'none';
	}
	document.getElementById('pic_'+nr).style.display = 'block';
}

function changePicMultiple(welches,nr,von){
	for(var ipic = 1; ipic <= von; ipic++){
		document.getElementById('pic_'+welches+ipic).style.display = 'none';
	}
	document.getElementById('pic_'+welches+nr).style.display = 'block';
}

/* layer über den ganzen monitor */	
function doalertlayer(){
		document.getElementById("myalert").style.height = document.getElementById("inhalt").offsetHeight+"px";
		document.getElementById("myalert").style.visibility = 'visible';	
}
function hidealertlayer(){
	document.getElementById("myalert").style.height = "20px";
	document.getElementById("myalert").style.visibility = 'hidden';
}

function dolayer(){
		document.getElementById("mykatalog").style.height = document.getElementById("inhalt").offsetHeight+"px";
		document.getElementById("mykatalog").style.visibility = 'visible';	
}
function hidelayer(){
	document.getElementById("mykatalog").style.height = "20px";
	document.getElementById("mykatalog").style.visibility = 'hidden';
}

function doalertlayer_news(){
	document.getElementById("mynews").style.overflow = "visible";
	document.getElementById("mynews").style.height = (30 + document.getElementById("newslayer").offsetHeight)+"px";
	document.getElementById("mynews").style.visibility = 'visible';	
}
function hidealertlayer_news(){
	document.getElementById("mynews").style.overflow = "hidden";
	document.getElementById("mynews").style.height = "20px";
	document.getElementById("mynews").style.visibility = 'hidden';
}

/* infoLayer */
function showinfo(welche, e, fensterhoehe){
	if(!fensterhoehe)fensterhoehe = 220;
	
	document.getElementById("ilayer").style.height = fensterhoehe+'px';
	
	if(!e) e = window.event;
  var body = (window.document.compatMode && window.document.compatMode == "CSS1Compat") ?
  window.document.documentElement : window.document.body || null;
  mousey = e.pageY ? e.pageY : e.clientY + body.scrollTop;
  mousex = e.pageX ? e.pageX : e.clientX + body.scrollLeft;

	fensterbreite = document.documentElement.clientWidth;

	document.getElementById("ilayer").style.visibility = 'visible';
	
	/*var paul = fensterhoehe+40;
	if(mousey-paul > 0)document.getElementById("ilayer").style.top = mousey-paul+'px';
	else document.getElementById("ilayer").style.top = mousey+5+'px';*/
	document.getElementById("ilayer").style.top = mousey-fensterhoehe/2+'px';
	
	/*if(fensterbreite - mousex < 380) document.getElementById("ilayer").style.left =  mousex-380+'px';
	else document.getElementById("ilayer").style.left = mousex-190+'px';*/
	if(mousex > fensterbreite/2)
		document.getElementById("ilayer").style.left =  mousex-450+'px';
	else
		document.getElementById("ilayer").style.left =  mousex+40+'px';
	
	document.getElementById("ilayer_"+welche).style.display = 'block';
}
function showinfo_bargain(welche, e, fensterhoehe, basic, deutsch){
	if(!fensterhoehe)fensterhoehe = 220;
	
	document.getElementById("ilayer").style.height = fensterhoehe+'px';
	
	if(!e) e = window.event;
  var body = (window.document.compatMode && window.document.compatMode == "CSS1Compat") ?
  window.document.documentElement : window.document.body || null;
  mousey = e.pageY ? e.pageY : e.clientY + body.scrollTop;
  mousex = e.pageX ? e.pageX : e.clientX + body.scrollLeft;

	fensterbreite = document.documentElement.clientWidth;

	document.getElementById("ilayer").style.visibility = 'visible';
	
	/*var paul = fensterhoehe+40;
	if(mousey-paul > 0)document.getElementById("ilayer").style.top = mousey-paul+'px';
	else document.getElementById("ilayer").style.top = mousey+5+'px';*/
	document.getElementById("ilayer").style.top = mousey-fensterhoehe/2+'px';
	
	/*if(fensterbreite - mousex < 380) document.getElementById("ilayer").style.left =  mousex-380+'px';
	else document.getElementById("ilayer").style.left = mousex-190+'px';*/
	if(mousex > fensterbreite/2)
		document.getElementById("ilayer").style.left =  mousex-450+'px';
	else
		document.getElementById("ilayer").style.left =  mousex+40+'px';
		
	document.getElementById("line_b").style.display = 'none';
	document.getElementById("line_d").style.display = 'none';
	document.getElementById("line_x").style.display = 'none';
		
	if(basic != '0'){
		document.getElementById("line_b").style.display = 'block';
	}
	else if(deutsch == '10.00'){
		document.getElementById("line_d").style.display = 'block';
	}
	else{ 
		document.getElementById("line_x").style.display = 'block';
	}
	
	document.getElementById("ilayer_"+welche).style.display = 'block';
}
function hideinfo(){
	//children = document.getElementById('ilayer').getElementsByTagName('*');
	children = document.getElementById('ilayer').childNodes;
	for(var il = 0; il < children.length; il++){
		if(children[il].id)
			document.getElementById(children[il].id).style.display = 'none';
	}
	document.getElementById("ilayer").style.visibility = 'hidden';
}

function postit(param,nam) {
        var f1 = nam;
        var doma = "foeldeak";
        var f2 = f1.substr(0,7) + param + f1.substr(11,1) + doma + f1.substr(16,1) + f1.substr(17,3);
        location.href = f2;
}
function postitd(param,nam) {
        var f1 = nam;
        var doma = "eg-mediendesign";
        var f2 = f1.substr(0,7) + param + f1.substr(11,1) + doma + f1.substr(16,1) + f1.substr(17,2);
        location.href = f2;
}

/* video layer über den ganzen monitor */	
function showvideo(film,breite,hoehe,farbe,oben){

		document.getElementById("clipcontainer").style.height = document.getElementById("inhalt").offsetHeight+"px";
		document.getElementById("clipcontainer").style.display = 'block';	
		
		var abstandY = getScrollXY();
		document.getElementById("clipcontainer").style.paddingTop = (abstandY+150)+"px";
		//hoehe = parseInt(hoehe)+20; // für die Navi-Bar
		var oSpan = document.createElement("div");
		document.getElementById('clipcontainer').appendChild(oSpan);
		oSpan.id = "clipspan";
		/*oSpan.innerHTML = '<object data="clips/flvplayer.swf" type="application/x-shockwave-flash" id="clip" '+
			'style="width:'+breite+'px;height:'+hoehe+'px;">'+
		  '<param name="movie" value="clips/flvplayer.swf">'+
		  '<param name="quality" value="high">'+
		  '<param name="scale" value="exactfit">'+
		  '<param name="menu" value="true">'+
		  '<param name="wmode" value="window">'+
		  '<param name="flashvars" value="file='+film+'.flv&amp;autoStart=true&amp;clicktext=%20&amp;repeat=false&amp;">'+
		  '<param name="bgcolor" value="#000000">'+
		'</object>';
		'<param name="bgcolor" value="'+farbe+'">'+*/
		hoehe = parseInt(hoehe)+15; // für die Navi-Bar
		if(oben){
			unten='<div style="width:'+(breite-10)+'px;background-color:#ffffff;padding:5px">'+oben+'</div>';
		}else unten='';
		oSpan.innerHTML = '<div style="width:'+(breite-3)+'px;text-align:right;background-color:#ffffff;padding-right:3px" id="clipclose">'+
			'<a href="javascript:void(0);" onclick="hidevideo()"><img style="width:66px;height:22px" src="lightbox/closelabel.gif" /></a></div>'+
			'<object data="clips/FlvPlayerSlim.swf" type="application/x-shockwave-flash" id="clip" '+
			'style="width:'+breite+'px;height:'+hoehe+'px;">'+
		  '<param name="menu" value="true">'+
		  '<param name="wmode" value="window">'+
			'<param name="quality" value="high">'+
		  '<param name="allowFullScreen" value="true">'+
		  '<param name="scale" value="noscale">'+
		  '<param name="allowScriptAccess" value="always">'+
		  '<param name="bgcolor" value="#A3BFC0">'+
		  '<param name="movie" value="clips/FlvPlayerSlim.swf">'+
		  '<param name="flashvars" value="asf='+film+'.flv&amp;autoPlay=true&amp;allowFullScreen=true&amp;debug=false&amp;autoChangePlay=true">'+
		'</object>'+unten;
		/* videoWidth=00&amp;videHeight=00 */
		document.getElementById('clipspan').style.marginLeft = (screen.width-breite)/2+'px';
}
function hidevideo(){
	if(document.getElementById("clipspan")){
		document.getElementById("clipspan").removeChild(document.getElementById('clip'));
		document.getElementById("clipspan").removeChild(document.getElementById('clipclose'));
		document.getElementById("clipcontainer").removeChild(document.getElementById('clipspan'));
		
		document.getElementById("clipcontainer").style.display = 'none';
		document.getElementById("clipcontainer").style.height = '20px';
	}
}
function getScrollXY() {
    var scrOfX = 0, scrOfY = 0;
 
    if( typeof( window.pageYOffset ) == 'number' ) {
        //Netscape compliant
        scrOfY = window.pageYOffset;
        scrOfX = window.pageXOffset;
    } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
        //DOM compliant
        scrOfY = document.body.scrollTop;
        scrOfX = document.body.scrollLeft;
    } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
        //IE6 standards compliant mode
        scrOfY = document.documentElement.scrollTop;
        scrOfX = document.documentElement.scrollLeft;
    }
    return scrOfY;
}

function addEvent(obj,type,fn){
	if(obj.addEventListener){
		obj.addEventListener(type,fn,false);
	}
	else if(obj.attachEvent){ 
		obj.attachEvent('on'+type,function(){return fn.apply(obj,new Array(window.event));});
	}
}

//START SNOW	*******************************************************************************************************
//Snow Fall 1 - no images - Java Script - http://rainbow.arch.scriptmania.com/scripts/

// Set the number of snowflakes (more than 30 - 40 not recommended)
var snowmax=30;
// Set the colors for the snow. Add as many colors as you like
var snowcolor=new Array("#aaaacc","#ddddff","#ccccdd","#f3f3f3","#f0ffff");
// Set the fonts, that create the snowflakes. Add as many fonts as you like
var snowtype=new Array("Times","Arial","Times","Verdana");
// Set the letter that creates your snowflake (recommended: * )
var snowletter="*";
// Set the speed of sinking (recommended values range from 0.3 to 2)
var sinkspeed=0.6;
// Set the maximum-size of your snowflakes
var snowmaxsize=30;
// Set the minimal-size of your snowflakes
var snowminsize=8;
// Set the snowing-zone
// Set 1 for all-over-snowing, set 2 for left-side-snowing
// Set 3 for center-snowing, set 4 for right-side-snowing
var snowingzone=1;

// Do not edit below this line
/*var timer_is_on=0;
var snow=new Array();
var marginbottom;
var marginright;
var timer_snow;
var i_snow=0;
var x_mv=new Array();
var crds=new Array();
var lftrght=new Array();
var browserinfos=navigator.userAgent;
var ie5=document.all&&document.getElementById&&!browserinfos.match(/Opera/);
var ns6=document.getElementById&&!document.all;
var opera=browserinfos.match(/Opera/);

function randommaker(range) {
	rand=Math.floor(range*Math.random());
  return rand;
}

function initsnow(){
  if (ie5 || opera){
  	marginbottom = document.body.scrollHeight;
    marginright = document.body.clientWidth-15;
   }
   else if(ns6){
   	marginbottom = document.body.scrollHeight;
    marginright = window.innerWidth-15;
   }
   var snowsizerange=snowmaxsize-snowminsize;
   for (i=0;i<=snowmax;i++){
    crds[i] = 0;
    lftrght[i] = Math.random()*15;
    x_mv[i] = 0.03 + Math.random()/10;
    snow[i]=document.getElementById("s"+i);
    snow[i].style.fontFamily=snowtype[randommaker(snowtype.length)];
    snow[i].size=randommaker(snowsizerange)+snowminsize;
    snow[i].style.fontSize=snow[i].size+'px';
    snow[i].style.color=snowcolor[randommaker(snowcolor.length)];
    snow[i].style.zIndex=1000;
    snow[i].sink=sinkspeed*snow[i].size/5;
    if (snowingzone==1) {snow[i].posx=randommaker(marginright-snow[i].size);}
    if (snowingzone==2) {snow[i].posx=randommaker(marginright/2-snow[i].size);}
    if (snowingzone==3) {snow[i].posx=randommaker(marginright/2-snow[i].size)+marginright/4;}
    if (snowingzone==4) {snow[i].posx=randommaker(marginright/2-snow[i].size)+marginright/2;}
    snow[i].posy=randommaker(2*marginbottom-marginbottom-2*snow[i].size);
    snow[i].style.left=snow[i].posx+'px';
    snow[i].style.top=snow[i].posy+'px';
   }
   movesnow();
}

function movesnow(){
   for (i=0;i<=snowmax;i++){
   	crds[i] += x_mv[i];
    snow[i].posy+=snow[i].sink;
    snow[i].style.left=snow[i].posx+lftrght[i]*Math.sin(crds[i])+'px';
    snow[i].style.top=snow[i].posy+'px';

   	if (snow[i].posy>=marginbottom-2*snow[i].size || parseInt(snow[i].style.left)>(marginright-3*lftrght[i])){
    	if (snowingzone==1) {snow[i].posx=randommaker(marginright-snow[i].size);}
	    if (snowingzone==2) {snow[i].posx=randommaker(marginright/2-snow[i].size);}
	    if (snowingzone==3) {snow[i].posx=randommaker(marginright/2-snow[i].size)+marginright/4;}
	    if (snowingzone==4) {snow[i].posx=randommaker(marginright/2-snow[i].size)+marginright/2;}
	    snow[i].posy=0;
    }
  }
  timer_snow=setTimeout("movesnow()",50);
  timer_is_on=1;
}

function stopsnow(){
	if(timer_is_on == 1){
		for (i=0;i<=snowmax;i++){
			document.getElementById('s'+i+'').style.display = 'none';
		}
		
		clearTimeout(timer_snow);
		timer_is_on=0;
	}
}
function startsnow(){
	if(timer_is_on == 0){
		for (i=0;i<=snowmax;i++){
			document.getElementById('s'+i+'').style.display = 'block';
		}
		movesnow();
	}
}

for (i=0;i<=snowmax;i++){
  document.write("<span id='s"+i+"' style='position:absolute;top:-"+snowmaxsize+"'>"+snowletter+"</span>");
}

addEvent(window,'load',initsnow);*/
//END SNOW
