var xmlHttp

function Photos()
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
 var url="main_actions.php"
 url=url+"?tag=albums"
 xmlHttp.onreadystatechange=photos
 xmlHttp.open("GET",url,true)
 xmlHttp.send(null)
}

function photos()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 {
  result = xmlHttp.responseText.split("<!-- NEXT DIV -->");
  document.getElementById("main_div").innerHTML=result[0];
  document.getElementById("TopPrev").innerHTML=result[1];
  document.getElementById("ad_space").innerHTML='';
//  document.getElementById("ad_space").innerHTML=result[2];

 }
}

function Events()
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
 var url="main_actions.php"
 url=url+"?tag=events"
 xmlHttp.onreadystatechange=events
 xmlHttp.open("GET",url,true)
 xmlHttp.send(null)
}

function events()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 {
  result = xmlHttp.responseText.split("<!-- NEXT DIV -->");
  document.getElementById("main_div").innerHTML=result[0];
  document.getElementById("TopPrev").innerHTML=result[1];
  document.getElementById("ad_space").innerHTML='';
//  document.getElementById("ad_space").innerHTML=result[2];
  //alert(result[1]);
 }
}

function ShowEvent(id)
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
 var url="main_actions.php"
 url=url+"?tag=show_event"
 url=url+"&event_id="+id
 xmlHttp.onreadystatechange=show_event
 xmlHttp.open("GET",url,true)
 xmlHttp.send(null)
}

function show_event()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 {
  result = xmlHttp.responseText.split("<!-- NEXT DIV -->");
  document.getElementById("main_div").innerHTML=result[0];
  document.getElementById("TopPrev").innerHTML=result[1];

  //  document.getElementById("main_div").innerHTML=xmlHttp.responseText;
  //alert(result[1]);
 }
}

function ShowIEvent(id)
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
 var url="main_actions.php"
 url=url+"?tag=show_event"
 url=url+"&event_id="+id
 xmlHttp.onreadystatechange=show_Ievent
 xmlHttp.open("GET",url,true)
 xmlHttp.send(null)
}

function show_Ievent()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 {
  parent.document.getElementById("main_div").innerHTML=xmlHttp.responseText;
  //alert(result[1]);
 }
}



function Video()
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
 var url="main_actions.php"
 url=url+"?tag=video"
 xmlHttp.onreadystatechange=video
 xmlHttp.open("GET",url,true)
 xmlHttp.send(null)
}

function video()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 {
  result = xmlHttp.responseText.split("<!-- NEXT DIV -->");
  document.getElementById("main_div").innerHTML=result[0];
  document.getElementById("TopPrev").innerHTML=result[1];
  document.getElementById("ad_space").innerHTML='';
//  document.getElementById("ad_space").innerHTML=result[2];
 }
}


function ListPics(id,city)
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }

// alert(city);
 window.location = "http://" + city + ".localites.tv/show_dates.php?id=" + id;

// var url="main_actions.php"
// url=url+"?tag=list_pics"
// url=url+"&id="+id
// xmlHttp.onreadystatechange=listpics
// xmlHttp.open("GET",url,true)
// xmlHttp.send(null)
}

function listpics()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 {
  result = xmlHttp.responseText.split("<!-- NEXT DIV -->");
  document.getElementById("main_div").innerHTML=result[0];
  document.getElementById("TopPrev").innerHTML=result[1];
  //alert(result[1]);
 }
}

function ShowPage(page_num,id)
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
 var url="main_actions.php"
 url=url+"?tag=show_page"
 url=url+"&page_num="+page_num
 url=url+"&id="+id
 xmlHttp.onreadystatechange=showpage
 xmlHttp.open("GET",url,true)
 xmlHttp.send(null)
}

function ShowAPage(page_num,id)
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
 var url="main_actions.php"
 url=url+"?tag=show_apage"
 url=url+"&page_num="+page_num
 url=url+"&id="+id
 xmlHttp.onreadystatechange=showpage
 xmlHttp.open("GET",url,true)
 xmlHttp.send(null)
}

function showpage()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 {
  document.getElementById("main_div").innerHTML=xmlHttp.responseText
 }
}

function show_photo(id)
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
 var url="main_actions.php"
 url=url+"?tag=show_photo"
 url=url+"&id="+id
 xmlHttp.onreadystatechange=showPhoto
 xmlHttp.open("GET",url,true)
 xmlHttp.send(null)
}

function showPhoto()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 {
  result = xmlHttp.responseText.split("<!-- NEXT DIV -->");
  document.getElementById("main_div").innerHTML=result[0];
  document.getElementById("TopPrev").innerHTML=result[1];
//  document.getElementById("main_div").innerHTML=xmlHttp.responseText
 }
}



function About()
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
 var url="main_actions.php"
 url=url+"?tag=about"
 xmlHttp.onreadystatechange=about
 xmlHttp.open("GET",url,true)
 xmlHttp.send(null)
}

function about()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 {
  result = xmlHttp.responseText.split("<!-- NEXT DIV -->");
  document.getElementById("main_div").innerHTML=result[0];
  document.getElementById("TopPrev").innerHTML=result[1];
  document.getElementById("ad_space").innerHTML='';

 }
}


function Blog()
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
 var url="main_actions.php"
 url=url+"?tag=blog"
 xmlHttp.onreadystatechange=blog
 xmlHttp.open("GET",url,true)
 xmlHttp.send(null)
}

function blog()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 {
  document.getElementById("main_div").innerHTML=xmlHttp.responseText
  document.getElementById("TopPrev").innerHTML="<img src='http://www.localites.tv/imgs/juice_banner.jpg' width='630' height='350'>";
  document.getElementById("ad_space").innerHTML='';
 }
}


function Vip()
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
 var url="main_actions.php"
 url=url+"?tag=vip"
 xmlHttp.onreadystatechange=vip
 xmlHttp.open("GET",url,true)
 xmlHttp.send(null)
}

function vip()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 {
  document.getElementById("main_div").innerHTML=xmlHttp.responseText
  document.getElementById("TopPrev").innerHTML="<img src='http://www.localites.tv/imgs/vip_banner.jpg' width='630' height='350'>";
  document.getElementById("ad_space").innerHTML='';
 }
}



function GetXmlHttpObject()
{
var xmlHttp=null;
try
 {
 // Firefox, Opera 8.0+, Safari
 xmlHttp=new XMLHttpRequest();
 }
catch (e)
 {
 //Internet Explorer
 try
  {
  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return xmlHttp;
}
