/*ecContent*/

var EcContent = new Object();

EcContent.init = function () {
  var ecContentList = $("table.ecContent");
  for (var i = 0; i < ecContentList.length; i++) {
  	var header = $(ecContentList[i]).find(".ecContentI");
  	var header_2 = $(ecContentList[i]).find(".ecContentH");
  	var header_3 = $(ecContentList[i]).find(".ecContentHD");
  	$(header).click(expand);
	$(header_2).click(expand);
	$(header_3).click(expand);
  	if ($(ecContentList[i]).hasClass("showContent")) {
  		$(header).attr("expand",1);
  		$(header_2).attr("expand",1);
  		$(header_3).attr("expand",1);
  		$(ecContentList[i]).find(".ecContentHD").find("span").addClass("expand");
  	} else {
  		$(header).attr("expand",0);
  		$(header_2).attr("expand",0);
  		$(header_3).attr("expand",0);
  		$(ecContentList[i]).find(".ecContentHD").find("span").addClass("collapse");
  		$(ecContentList[i]).find(".ecContentB").addClass("ccInvisible");
  	}
  }
}

function expand() {
	if ($(this).attr("expand") == "0") {
		$(this).attr("expand",1);
		$(this).parents("table.ecContent").find(".ecContentHD").find(".collapse").addClass("expand").html("Zwiń").removeClass("collapse");
		$(this).parents("table.ecContent").find(".ecContentB").removeClass("ccInvisible");
	} else {
		$(this).attr("expand",0);
		$(this).parents("table.ecContent").find(".ecContentHD").find(".expand").addClass("collapse").html("Rozwiń").removeClass("expand");
		$(this).parents("table.ecContent").find(".ecContentB").addClass("ccInvisible");
	}
	if (self != top) {
		top.iframeOnload();
	}
}