function AJAX(){
	try{
		xmlHttp=new XMLHttpRequest();
		return xmlHttp;
	}
	catch (e){
		try{
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
			return xmlHttp;
		}
		catch (e){
			try{
				xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
				return xmlHttp;
			}
			catch (e){
				alert("Your browser does not support AJAX.");
				return false;
			}
		}
	}
}

function radioclick(str) {
	var divid = "city";
	var cu = 'http://'+window.location.hostname;
	var url = cu+"/ajax.php";
	url=url+"?id="+str;
	url=url+"&rid="+Math.random();
	var elid = str;
	var chc = elid - 1;
	
	if(elid == 2) {
		var clss = "box2-a";
	} else {
		var clss = "box-lr-a";
	}
	document.uzsakymas.pristatymas[chc].checked=true
	var e = document.getElementById(elid);
 			e.setAttribute("class", clss);
 			e.setAttribute("className", clss);
	
	if(elid == 1) {
		var e = document.getElementById(2);
 			e.setAttribute("class", "box2");
 			e.setAttribute("className", "box2");
		var e = document.getElementById(3);
 			e.setAttribute("class", "box-lr");
 			e.setAttribute("className", "box-lr");
	}
	if(elid == 2) {
		var e = document.getElementById(1);
 			e.setAttribute("class", "box-lr");
 			e.setAttribute("className", "box-lr");
		var e = document.getElementById(3);
 			e.setAttribute("class", "box-lr");
 			e.setAttribute("className", "box-lr");
	}
	if(elid == 3) {
		var e = document.getElementById(1);
 			e.setAttribute("class", "box-lr");
 			e.setAttribute("className", "box-lr");
		var e = document.getElementById(2);
 			e.setAttribute("class", "box2");
 			e.setAttribute("className", "box2");
	}
	
	var xmlHttp_one = AJAX();
	
	xmlHttp_one.onreadystatechange=function(){
		if(xmlHttp_one.readyState==4){
			document.getElementById(divid).innerHTML=xmlHttp_one.responseText;
		}
	}
	xmlHttp_one.open("GET",url,true);
	xmlHttp_one.send(null);
}
