var xmlHttp

function doEditCup(id,antal,grupp)
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	}
	id=escape(id);
	antal=escape(antal);
	grupp=escape(grupp);
	var url="/sub/cup2/ajax/do_editcup.php";
	url=url+"?namn=" + escape( document.getElementById("inputNamn").value );
	url=url+"&kanal=" + escape( document.getElementById("inputKanal").value );
	url=url+"&klaner=" + escape( document.getElementById("inputKlaner").value );
	url=url+"&date=" + escape( document.getElementById("inputDate").value );
	url=url+"&hour=" + escape( document.getElementById("inputHour").value );
	url=url+"&min=" + escape( document.getElementById("inputMin").value );
	url=url+"&server=" + escape( document.getElementById("inputServer").value );
	url=url+"&info=" + escape( document.getElementById("textbox").value );
	url=url+"&karta1=" + escape( document.getElementById("inputKarta1").value );
	url=url+"&karta2=" + escape( document.getElementById("inputKarta2").value );
	if (antal>=8) {
	url=url+"&karta3=" + escape( document.getElementById("inputKarta3").value );
	}
	if (antal>=16) {
		if (antal == 16 && grupp==1) {} else
		{
			url=url+"&karta4=" + escape( document.getElementById("inputKarta4").value );
		}
	}
	if (antal>=32) {
		if (antal == 32 && grupp==1) {} else
		{
			url=url+"&karta5=" + escape( document.getElementById("inputKarta5").value );
		}
	}
	if (antal>=64) {
		if (antal == 64 && grupp==1) {} else
		{
			url=url+"&karta6=" + escape( document.getElementById("inputKarta6").value );
		}
	}
	if( grupp == 1 )
	{
		url=url+"&gkarta1=" + escape( document.getElementById("inputGKarta1").value );
		url=url+"&gkarta2=" + escape( document.getElementById("inputGKarta2").value );
		url=url+"&gkarta3=" + escape( document.getElementById("inputGKarta3").value );
	}
	url=url+"&admin2=" + escape( document.getElementById("inputMedlem1").value );
	url=url+"&admin3=" + escape( document.getElementById("inputMedlem2").value );
	url=url+"&cid=" + id;
	xmlHttp.open("GET",url,true);
	xmlHttp.onreadystatechange=stateChangedDoEditCup
	xmlHttp.send(null)
}
function stateChangedDoEditCup()
{
	if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ document.getElementById("cupAdminBox").innerHTML=xmlHttp.responseText }
}
