function NW(o){//<a href="link.html" onclick="return NW(this);">link</a> 
 window.open(o.href);
 return false;
}

function submit(id){//<a href="link.html" onclick="submit('formularz');return false;">link</a>
	document.getElementById(id).submit;
}

function changeDisplay(id, a, b){//
	var element=document.getElementById(id);
	if (element.style.display != a){
		element.style.display = a;
	}else{
		element.style.display = b;
	}
	return false;
}

function multiChangeDisplay(count, fid, disp){//ile elementow, wspolny id, nowy display
	for(var i=1; i<=count; i++){
		if(document.getElementById(fid+i)){
			document.getElementById(fid+i).style.display = disp;
		}
	}
	return false;
}

/*p:xml rpc connect*/
var xmlhttp
function loadXMLDoc(url){
	// code for Mozilla, etc.
	if (window.XMLHttpRequest){
		xmlhttp=new XMLHttpRequest();
		xmlhttp.onreadystatechange=state_Change;
		xmlhttp.open("GET",url,true);
		xmlhttp.send(null);
	}
	// code for IE
	else if (window.ActiveXObject){
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		if (xmlhttp){
			xmlhttp.onreadystatechange=state_Change;
			xmlhttp.open("GET",url,true);
			xmlhttp.send();
		}
	}
}

function state_Change(){
// if xmlhttp shows "loaded"
	if (xmlhttp.readyState==4){
		// if "OK"
		if (xmlhttp.status==200){
			document.getElementById('t1').innerHTML=xmlhttp.responseText
		}else{
			alert("Problem retrieving data:" + xmlhttp.statusText)
		}
	}
}
/*k:xml rpc connect*/
