function toggleVisibility(theImage) {

	var pathToImages = "../images/products/";
	var theImageName = theImage.id;
    var theRowName = theImageName.replace('_image', '_comment');
    var theRow = document.getElementById(theRowName);
    if (theRow.style.display=="none") {
       
		theRow.style.display = "";
        theImage.src = pathToImages + "pdt_down_arrow_icon.gif";
    } else {
        theRow.style.display = "none";
        theImage.src = pathToImages + "pdt_active_arrow_icon.gif";
    }
}

function checkCompareCount(form){
	if(form.products.length > 0){
		var checkedCount = 0;
		for(var i=0;i<form.products.length;i++){
			if(form.products[i].checked){
				checkedCount++;
			}
		}
		if(checkedCount > 1 && checkedCount < 5){
			form.submit();
		}else{
			alert("Bitte wählen Sie für den Produktvergleich mindestens 2 und höchstens 4 Produkte aus. Danke!");
		}
	}
	return false;
}

function showModel(path,direction){
    var theCell = document.getElementById("product_picture");
	if(path == '' && direction == -1){
		if(currentIndex == -1){
			currentIndex = EffPics.length-1;
		}else{
			currentIndex = (currentIndex+EffPics.length-1)%EffPics.length;
		}
		path = EffPics[currentIndex];
	}else if(path == '' && direction == 1){
		if(currentIndex == -1){
			currentIndex = 0;
		}else{
			currentIndex = (currentIndex+1)%EffPics.length;
		}
		path = EffPics[currentIndex];
	}
	theCell.src = path;

}

function showModelColour(path){
    var theCell = document.getElementById("product_picture");
	theCell.src = "/thumb" +path + "?sizeh=181&sizew=201";	
}

function showZoom(path){
    var theCell = document.getElementById("product_picture");

var a=window.open (theCell.src,"imagepopup","left=300,top=150,menubar=0,resizable=1,width=400,height=400"); 
	
//	theCell.src = path;	
}

function MM_controlShockwave(objStr,x,cmdName,frameNum) { //v3.0
  var obj=MM_findObj(objStr);
  if (obj)
  {
   eval('obj.'+cmdName+'('+((cmdName=='GotoFrame')?frameNum:'')+')');
  }
  else
  {
  	return false;
  }
}

