function change_background(id,over_out,id_img){
  var color = (over_out) ? "#22363f" : "";
  var image = (over_out) ? "menu_item_over.jpg" : "menu_item_out.jpg";
  var padding = (over_out) ? "23px" : "15px";
  
  document.getElementById(id).style.backgroundColor = color;
  document.getElementById(id).style.paddingLeft = padding;
  document.getElementById(id_img).src = "fileadmin/templates/img/" + image;
}


function change_background_sub(id,over_out,id_img){
  var color = (over_out) ? "#22363f" : "";
  var image = (over_out) ? "menu_item_over.jpg" : "menu_item_out.jpg";
  var padding = (over_out) ? "35px" : "30px";
  
  document.getElementById(id).style.backgroundColor = color;
  document.getElementById(id).style.paddingLeft = padding;
  document.getElementById(id_img).src = "fileadmin/templates/img/" + image;
}


function showElement(id){

  var objDiv = document.getElementById("divMenu").getElementsByTagName("DIV");
  for (var i=0; i<objDiv.length; i++) {
      if(objDiv[i].style.display=="block"){ document.getElementById(objDiv[i].id).style.display='none'; }
  }
  
  document.getElementById(id).style.display='block';
}



function checkVisibility(id){
  if(document.getElementById(id).style.display == 'block'){return false;}
  else{return true;}
}


sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}


newsletter_value = function() {
  if(document.forms.Formular.mp_last_step.value == 1){
    document.getElementById("adres_email").value = "Wpisz swój adres e-mail";
  }
}


if (window.attachEvent) window.attachEvent("onload", sfHover);
if (window.attachEvent) window.attachEvent("onload", newsletter_value);
if (window.addEventListener) window.addEventListener("load", newsletter_value, false)


/*
function divName(){
  var txt = "";
  var objDiv = document.getElementById("divMenu").getElementsByTagName("DIV");
  for (var i=0; i<objDiv.length; i++) {
    txt +="to jest id: "+ objDiv[i].id +"";
      if(objDiv[i].style.display=="block"){ txt+=" display:block, id div:"+objDiv[i].id; }
      if(objDiv[i].style.display=="none"){ txt+=" display:none"; }
    txt +="\n";
  }
  alert("to jest txt: "+txt);
}
*/
