
function toggleLayer( whichLayer )
{
  var elem, vis;
  if( document.getElementById ) // this is the way the standards work
    elem = document.getElementById( whichLayer );
  else if( document.all ) // this is the way old msie versions work
      elem = document.all[whichLayer];
  else if( document.layers ) // this is the way nn4 works
    elem = document.layers[whichLayer];
  vis = elem.style;
  // if the style.display value is blank we try to figure it out here
  if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)
    vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
  vis.display = (vis.display==''||vis.display=='block')?'none':'block';
}
function loadContent(elementSelector, sourceURL) {
	$(""+elementSelector+"").load("buybar.php?test=test");
}function loadBuybar(elementSelector, id) {
	form="form"+id;
	attrib1 = document.getElementById("item_"+id+"_attrib_1").value;
	attrib2 = document.getElementById("item_"+id+"_attrib_2").value;
	attrib3 = document.getElementById("item_"+id+"_attrib_3").value;
	attrib4 = document.getElementById("item_"+id+"_attrib_4").value;
	quant = document.getElementById("item_"+id+"_quant").value;
	$(""+elementSelector+"").load("bananapress/buybar.php?attrib1="+attrib1+"&attrib2="+attrib2+"&attrib3="+attrib3+"&attrib4="+attrib4+"&item_id="+id+"&quant="+quant+"");
}

function formValidation(form){
	if(notEmpty(form.attrib1) && notEmpty (form.attrib2) && notEmpty (form.attrib3) && notEmpty (form.attrib4)){
		return true;
		}
	return false;
	}
	function notEmpty(elem){
		var str = elem.value;
		if(str.length == 0){
			alert("Bitte alle Merkmale auswählen!");
			return false;
		} else {
		return true;
	}
}



