// JavaScript Document


// mmLoadMenus()

function mmLoadMenus() {
  if (window.mm_menu_0124105117_0) return;
  
   
//Bder   
    window.mm_menu_0124105117_0 = new Menu("root",125,18,"",12,"#FFFFFF","#FFFFFF","#000000","#343434","left","middle",3,0,1000,-5,7,true,true,true,0,true,true);
   mm_menu_0124105117_0.addMenuItem("Klassisch","location='baeder_klassisch.html'");
   mm_menu_0124105117_0.addMenuItem("Landhaus","location='baeder_landhaus.html'");
   mm_menu_0124105117_0.addMenuItem("Modern","location='baeder_modern.html'");
   mm_menu_0124105117_0.hideOnMouseOut=true;
   mm_menu_0124105117_0.bgColor='#555555';
   mm_menu_0124105117_0.menuBorder=1;
   mm_menu_0124105117_0.menuLiteBgColor='';
   mm_menu_0124105117_0.menuBorderBgColor='#343434';


//Kchen
    window.mm_menu_0125102547_0 = new Menu("root",125,18,"",12,"#FFFFFF","#FFFFFF","#000000","#343434","left","middle",3,0,1000,-5,7,true,true,true,0,true,true);
   mm_menu_0125102547_0.addMenuItem("Landhaus","location='kuechen_landhaus.html'");
   mm_menu_0125102547_0.addMenuItem("Klassisch&nbsp;&amp;&nbsp;Modern","location='kuechen_klassisch_modern.html'");
   mm_menu_0125102547_0.hideOnMouseOut=true;
   mm_menu_0125102547_0.bgColor='#555555';
   mm_menu_0125102547_0.menuBorder=1;
   mm_menu_0125102547_0.menuLiteBgColor='';
   mm_menu_0125102547_0.menuBorderBgColor='#343434';


//Wohnkeramik
window.mm_menu_0125094551_0 = new Menu("root",125,18,"",12,"#FFFFFF","#FFFFFF","#000000","#343434","left","middle",3,0,1000,-5,7,true,true,true,0,true,true);
   mm_menu_0125094551_0.addMenuItem("Klassisch","location='wohnkeramik_klassisch.html'");
   mm_menu_0125094551_0.addMenuItem("Landhaus","location='wohnkeramik_landhaus.html'");
   mm_menu_0125094551_0.addMenuItem("Modern","location='wohnkeramik_modern.html'");
   mm_menu_0125094551_0.hideOnMouseOut=true;
   mm_menu_0125094551_0.bgColor='#555555';
   mm_menu_0125094551_0.menuBorder=1;
   mm_menu_0125094551_0.menuLiteBgColor='';
   mm_menu_0125094551_0.menuBorderBgColor='#343434';

  

mm_menu_0125102547_0.writeMenus();
}




// Galerie
function nextContent () {
  //alle unsichtbar machen
  sectioncounter++;
  for(i=1;i<(contentsections+1);i++) {
    makeInvisible('content'+i);
  }
  
  if (sectioncounter<=contentsections) {
    makeVisible('content'+sectioncounter);
  } else {
    sectioncounter=1;
	makeVisible('content'+sectioncounter);
  }
}

function goNext () {
  MM_preloadImages(gallerypath+nextPicToLoad()+'.jpg');
  //makeInvisible('currentpic');  
  //MM_swapImage('currentpic','','../images/blank.jpg');
    MM_swapImage('currentthumb','',gallerypath+'thumbs/'+nextThumb()+'.jpg',0);
	MM_swapImage('currentpic','',gallerypath+nextPic()+'.jpg');
  //makeVisible('currentpic');
  //fadeIn('currentpic',0);
  if(isProduct) {
	if (clickpic==lastpicture) {
		document.getElementById('next-link').href='../bodenfliesen1.html';
		document.getElementById('thumb-next-link').href='../bodenfliesen1.html';
	}
	if (clickpic==1) {document.getElementById('prev-link').href='../bodenfliesen1.html';}
	else {
		{document.getElementById('prev-link').href='javascript: goBack();';}
	}
  }
}
function nextPicToLoad() {
	pictoload=clickpic+2;
	if(clickpic==(lastpicture-2))  pictoload = 1;
	return pictoload;
}

function goBack () {
  //MM_preloadImages(gallerypath+prevPicToLoad()+'.jpg');
  //makeInvisible('currentpic');
  //MM_swapImage('currentpic','','../images/blank.jpg');
    MM_swapImage('currentthumb','',gallerypath+'thumbs/'+prevThumb()+'.jpg',0);
	MM_swapImage('currentpic','',gallerypath+prevPic()+'.jpg');
  //makeVisible('currentpic');
  //fadeIn('currentpic',0);
  if(isProduct) {
	  if (clickpic==1) {document.getElementById('prev-link').href='../bodenfliesen1.html';}
	  else {
			{document.getElementById('prev-link').href='javascript: goBack();';}
	  }
  }
}
function prevPicToLoad() {
	if(clickpic==2)  pictoload = lastpicture;
	else if(clickpic==1)  pictoload = lastpicture-1;
	else pictoload-=1;
	return pictoload;
}

function nextPic() {
	clickpic = clickpic+1;
	if(clickpic>lastpicture) clickpic = 1;
	
	setDescription();
	
	return clickpic;
}
function prevPic() {
	clickpic = clickpic-1;
	if(clickpic<1) clickpic = lastpicture;
	
	setDescription();
	
	return clickpic;
}

function nextThumb() {
	clickthumb = clickthumb+1;
	if(clickthumb>lastpicture) clickthumb = 1;
	return clickthumb;
}

function prevThumb() {
	clickthumb = clickthumb-1;
	if(clickthumb<1) clickthumb = lastpicture;
	return clickthumb;
}

/*function nextPicToLoad() {
	nexttoload = nexttoload+1;
	if(nexttoload>lastpicture) nexttoload = 1;
	return nexttoload;
}*/
/*function prevPicToLoad() {
	nexttoload = nexttoload-1;
	if(nexttoload<0) nexttoload = lastpicture;
	return nexttoload;
}*/

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments;
  document.MM_sr=new Array;
  for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function initImage() {
  imageId = 'currentpic';
  image = document.getElementById(imageId);
  setOpacity(image, 0);
  image.style.visibility = 'visible';
  fadeIn(imageId,0);
}

function makeInvisible(imageId) {
  image = document.getElementById(imageId);
  image.style.visibility = 'hidden';
}

function makeVisible(imageId) {
  image = document.getElementById(imageId);
  image.style.visibility = 'visible';
}

function setOpacity(obj, opacity) {
  opacity = (opacity == 100)?99.999:opacity;
  
  // IE/Win
  obj.style.filter = "alpha(opacity:"+opacity+")";
  
  // Safari<1.2, Konqueror
  obj.style.KHTMLOpacity = opacity/100;
  
  // Older Mozilla and Firefox
  obj.style.MozOpacity = opacity/100;
  
  // Safari 1.2, newer Firefox and Mozilla, CSS3
  obj.style.opacity = opacity/100;
}

function fadeIn(objId,opacity) {
  if (document.getElementById) {
    obj = document.getElementById(objId);
    if (opacity <= 100) {
      setOpacity(obj, opacity);
      opacity += 5;
      window.setTimeout("fadeIn('"+objId+"',"+opacity+")", 50);
    }
  }
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function setDescription() {
//	document.all.description.innerText = description[clickpic];
//output = (description[clickpic]==null)?(description[0]):description[clickpic];

if (description[clickpic]==null) {
	output = (description[0]==0)?"":"<div class='laquo'>"+description[0]+"</div>";
} else if(description[clickpic]=="") {
	output = "";
} else
{
	output = "<div class='laquo'>"+description[clickpic]+"</div>";
}


output = output+"<div style='text-align:left;font-size:9px; margin-top:20px;'>("+clickpic+"/"+lastpicture+")</div>";
document.getElementById("mydescription").innerHTML = output;
}

function setContent() {
document.getElementById("content").innerHTML = content[contentcounter];
contentcounter = (contentcounter==lastcontentelement)?1:contentcounter+1;
}