// JavaScript Document
var xmlhttp;
var xmlhttp2;

//gr="2";
function showUser(str)
{
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
var url="../../../../../../gradovi.php";
url=url+"?country="+str;
url=url+"&sid="+Math.random();
xmlhttp.onreadystatechange=stateChanged;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);

}

function stateChanged()
{
if (xmlhttp.readyState==4)
{
document.getElementById("gradovi1").innerHTML=xmlhttp.responseText;
//document.getElementById('countrydp').selected=document.getElementById('countrydp').selected
document.getElementById('countrydp').value=document.getElementById('country').value;
}
}

function GetXmlHttpObject()
{
if (window.XMLHttpRequest)
  {
  // code for IE7+, Firefox, Chrome, Opera, Safari
  return new XMLHttpRequest();
  }
if (window.ActiveXObject)
  {
  // code for IE6, IE5
  return new ActiveXObject("Microsoft.XMLHTTP");
  }
return null;
}

///////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////VTORIOT AJAX/////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////

function showUser2(str2)
{
	
	
	
	
xmlhttp2=GetXmlHttpObject2();
if (xmlhttp2==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
var url2="../../../../../../../dpgrad.php";
url2=url2+"?country="+document.getElementById('country').value+"&city="+str2;
url2=url2+"&sid2="+Math.random();
xmlhttp2.onreadystatechange=stateChanged2;
xmlhttp2.open("GET",url2,true);
xmlhttp2.send(null);

}

function stateChanged2()
{
if (xmlhttp2.readyState==4)
{
document.getElementById("cityoff").innerHTML=xmlhttp2.responseText;
//document.write(xmlhttp2.responseText);
//document.getElementById('countrydp').selected=document.getElementById('countrydp').selected
//document.getElementById('countrydp').value=document.getElementById('country').value;
}
}

function GetXmlHttpObject2()
{
if (window.XMLHttpRequest)
  {
  // code for IE7+, Firefox, Chrome, Opera, Safari
  return new XMLHttpRequest();
  }
if (window.ActiveXObject)
  {
  // code for IE6, IE5
  return new ActiveXObject("Microsoft.XMLHTTP");
  }
return null;
}