
function langeChanged()
{
	if (xmlhttp.readyState==4)
	{
	window.location.href = xmlhttp.responseText;
//	alert(xmlhttp.responseText);
	}
}

function stateChanged()
{
if (xmlhttp.readyState==4)
{
//org_id
//alert(xmlhttp.responseText);
var arr = xmlhttp.responseText.split("/^&$$&");
document.getElementById("edit-profile-address").value = arr[0];
document.getElementById("edit-profile-country").value = arr[1];
document.getElementById("edit-profile-type-of-organization").value = arr[2];
document.getElementById("edit-profile-scope-of-work").innerHTML = arr[3];
//document.getElementById("txtHint").innerHTML=xmlhttp.responseText;
}
}

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;
}




function update_user_organizations(org_id)
{
	//set given org values to the org fields...
	xmlhttp=GetXmlHttpObject();
	if (xmlhttp==null)
	  {
	  alert ("Browser does not support HTTP Request");
	  return;
	  }
	var url="get_org_details.php?org_id="+org_id;
	xmlhttp.onreadystatechange=stateChanged;
	xmlhttp.open("GET",url,true);
	xmlhttp.send(null);
	
}
function add_user_organization(org_title, org_id)
{
	var elSel = document.getElementById("edit-profile-organization-name");
	var elOptNew = document.createElement('option');
  	elOptNew.text = org_title;
  	elOptNew.value = org_id;
//  	var elSel = document.getElementById('selectX');

  	try {
    	elSel.add(elOptNew, null); // standards compliant; doesn't work in IE
  	}
  	catch(ex) {
    	elSel.add(elOptNew); // IE only
  	}
	elSel.value = org_id;
}


/*function add_custom_country(slct){
	//alert(slct.value);
if(slct.value == "Others")
	popup('/en/node/add/country&display=popup', 600 );
else if(slct.value == "Other")
	popup('/ar/node/add/country&display=popup', 600 );
}*/

function show_soc(){
	if(document.getElementById("soc").style.display=="block")
	document.getElementById("soc").style.display="none";
	else document.getElementById("soc").style.display="block";
	}
