function Off(obj){
	document.getElementById(obj).style.display="none";
	}

function On(obj){
	document.getElementById(obj).style.display="block";
	}

function switchOnOff(obj){
	var httpRequest;
	
	if (document.getElementById(obj).getAttribute("class")=="shown") document.getElementById(obj).setAttribute("class","hidden");
	 else document.getElementById(obj).setAttribute("class","shown");


	if (window.XMLHttpRequest) {
		httpRequest = new XMLHttpRequest();
		}
	 else if(window.ActiveXObject){
		try{
			httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		 }

	if (httpRequest) {
		httpRequest.open('GET', "http://www.poszukiwaczeprzygod.pl/panel/interface/showelements.php?id="+obj, true);
		httpRequest.send(null);
		
		}
	}

function switchFSOnOff(obj){
	var httpRequest;
	
	if (document.getElementById(obj).getAttribute("class")=="shown") document.getElementById(obj).setAttribute("class","hidden");
	 else document.getElementById(obj).setAttribute("class","shown");


	if (window.XMLHttpRequest) {
		httpRequest = new XMLHttpRequest();
		}
	 else if(window.ActiveXObject){
		try{
			httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		 }

	if (httpRequest) {
		httpRequest.open('GET', "http://www.poszukiwaczeprzygod.pl/panel/interface/showelements.php?id="+obj, true);
		httpRequest.send(null);
		
		}
	}

function tC(obj,max,min) {
	if (document.getElementById(obj).value.length > max || document.getElementById(obj).value.length<min) {
		 document.getElementById(obj+"_cn").innerHTML = document.getElementById(obj).value.length + " / " + max;
		 document.getElementById(obj+"_cn").setAttribute("class","invalid counter");
		 On(obj+"_cn");
		 }
	else {
		 document.getElementById(obj+"_cn").innerHTML = document.getElementById(obj).value.length + " / " + max;
		 document.getElementById(obj+"_cn").setAttribute("class","counter");
		 On(obj+"_cn");
		 }
	}

function switchDiv(input,obj,state) {
	if(input.checked==state) {
		document.getElementById(obj).setAttribute("class","shown");
		}
	 else {
		document.getElementById(obj).setAttribute("class","hidden");
		}
	}

