var xmlHttp;

//***************************************************
//***************************************************

function editLink(str, id, type, linkid)
{ 
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 }
var url="editlink.php";
url=url+"?type="+type+"&q="+str+"&link="+linkid;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=function () { 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById(id).innerHTML=xmlHttp.responseText;
 } 
};
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}


//***************************************************
//***************************************************

function deletePhoto(str, id, uid)
{ 
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 }
var url="album_photo_delete.php";
url=url+"?photo="+str+"&id="+id+"&uid="+uid;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=PhotodClicked;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function PhotodClicked() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("photoDelete").innerHTML=xmlHttp.responseText;
 } 
}

//***************************************************


function showTown(str)
{ 
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 }
var url="gettowns.php";
url=url+"?q="+str;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function stateChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("txtHint").innerHTML=xmlHttp.responseText;
 } 
}

//***************************************************


function showPlayer(id,query,time)
{ 
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 }
var url="show_player.php";
url=url+"?a="+id+"&b="+query+"&c="+time;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=playerOK;
xmlHttp.open("POST",url,true);
xmlHttp.send(null);
}

function playerOK() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("playerAppear").innerHTML=xmlHttp.responseText;
 } 
}

//***************************************************
//***************************************************

function editAlbum(str)
{ 
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 }
var url="album_edit_proc.php";
url=url+"?album="+str;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=albumSelected;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function albumSelected() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("editAlbum").innerHTML=xmlHttp.responseText;
 } 
}

//***************************************************
//***************************************************

function deleteAlbum(str)
{ 
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 }
var url="album_delete_proc.php";
url=url+"?album="+str;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=albumSelected;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

//***************************************************
//***************************************************

function uploadPhotos(str)
{ 
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 }
var url="album_upload.php";
url=url+"?upload="+str;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=albumMSelected;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function albumMSelected() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("uploadPhotos").innerHTML=xmlHttp.responseText;
 } 
}


//*****************************************
//*****************************************

function showResults(str)
{ 
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 }
var url="search_included.php";
url=url+"?"+str;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=searchResultsDone;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function searchResultsDone() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("search_results_id").innerHTML=xmlHttp.responseText;
 } 
}

//**************************************
//**************************************

function showPhoto(str, id, uid)
{ 
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 }
var url="albums.php";
url=url+"?photo="+str+"&id="+id+"&uid="+uid;
xmlHttp.onreadystatechange=PhotoClicked;
parent.location.href = url;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function PhotoClicked() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("photoDisplay").innerHTML=xmlHttp.responseText;
 } 
}

//***************************************************
//***************************************************

function confDelMsg(str)
{ 
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 }
var url="conf_del_message.php";
url=url+"?q="+str;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=buttonSelected;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

//**************************************
//**************************************

function confDelFriend(str)
{ 
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 }
var url="conf_del_friend.php";
url=url+"?q="+str;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=buttonSelected;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

//***************************************************
//***************************************************

function confDelVideo(str)
{ 
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 }
var url="conf_del_video.php";
url=url+"?q="+str;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=buttonSelected;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

//***************************************************
//***************************************************


function buttonSelected() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("showMsg").innerHTML=xmlHttp.responseText;
 } 
}

//***************************************************
//***************************************************

function profileTabs() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("white_special").innerHTML=xmlHttp.responseText;
 } 
}

//***************************************************
//***************************************************

function GetXmlHttpObject()
{
var xmlHttp;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    try
      {
      xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
    catch (e)
      {
      alert("Your browser does not support AJAX!");
      return false;
      }
    }
  }
return xmlHttp
}

//***************************************************
//***************************************************


