var xmlHttp

function changefav(id){
normalisefav();

document.getElementById(id).className="TabbedPanelsTab TabbedPanelsTabSelected";
}
function normalisefav(){
	for( var i=1; i<7; i++)
	{
    document.getElementById("f_"+i).className="TabbedPanelsTab";
	}
}
function changefavp(id){
normalisefavp();

document.getElementById(id).className="TabbedPanelsTab TabbedPanelsTabSelected";
}
function normalisefavp(){
	for( var i=1; i<9; i++)
	{
    document.getElementById("p_"+i).className="TabbedPanelsTab";
	}
}

function changefavsf(id){
normalisefavsf();

document.getElementById(id).className="TabbedPanelsTab TabbedPanelsTabSelected";
}
function normalisefavsf(){
	for( var i=1; i<6; i++)
	{
    document.getElementById("sf_"+i).className="TabbedPanelsTab";
	}
} 

function showPost(sf,struser,p_type)
 { 
    
    //changefavsf('sf_'+sf);
 	xmlHttp=GetXmlHttpObject()
 
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
 var url="profile_sub_tab.php"
 url=url+"?user_id="+struser+"&type="+p_type
xmlHttp.onreadystatechange=stateChanged
xmlHttp.open("GET",url,true)
xmlHttp.send(null) 
 }
 
 
function stateChanged() 
{ 

if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
   // alert(xmlHttp.responseText)
    document.getElementById("profile_sub_tab_show").style.display='none'
    document.getElementById("profile_sub_tab_hide").innerHTML=xmlHttp.responseText
 }
 else
 { 
	document.getElementById("profile_sub_tab_show").style.display='none'
	document.getElementById("profile_sub_tab_hide").innerHTML="<div align='center'  class=left><img src='images/ajax-loader.gif'></div>"
 }
}


function add_guest(struser,eve_id)
 { 
 	xmlHttp=GetXmlHttpObject()
 
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
 var url="add_guest.php"
 url=url+"?user_id="+struser+"&eve_id="+eve_id

xmlHttp.onreadystatechange=stateChanged_guest
xmlHttp.open("GET",url,true)
xmlHttp.send(null) 
 }
 
 
function stateChanged_guest() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
  // document.getElementById("profile_sub_tab_show").style.display='none'
   //document.getElementById("profile_sub_tab_hide").innerHTML=xmlHttp.responseText
  alert(xmlHttp.responseText);
 
 
 } 
 
}




function showFav(fav,struser,p_type)
 { 

   // changefav('f_'+fav);
 	xmlHttp=GetXmlHttpObject()
 
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
 var url="profile_sub_fav.php"
 url=url+"?user_id="+struser+"&type="+p_type
xmlHttp.onreadystatechange=stateChanged1
xmlHttp.open("GET",url,true)
xmlHttp.send(null) 
 }
 
 
function stateChanged1() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
    document.getElementById("profile_sub_tab_show").style.display='none'
  document.getElementById("profile_sub_tab_hide").innerHTML=xmlHttp.responseText
 
 
 } 
else
 { 
 document.getElementById("profile_sub_tab_show").style.display='none'
  document.getElementById("profile_sub_tab_hide").innerHTML="<div align='center'  class=left><img src='images/ajax-loader.gif'></div>"
 
 }
}


/////////////////////////

function showFav1(fav,struser,p_type)
 { 

   // changefav('f_'+fav);
 	xmlHttp=GetXmlHttpObject()
 
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
 var url="profile_sub_fav1.php"
 url=url+"?user_id="+struser+"&type="+p_type
xmlHttp.onreadystatechange=stateChanged1_fav
xmlHttp.open("GET",url,true)
xmlHttp.send(null) 
 }
 
 
function stateChanged1_fav() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
    document.getElementById("profile_sub_tab_show").style.display='none'
  document.getElementById("profile_sub_tab_hide").innerHTML=xmlHttp.responseText
 
 
 } 
else
 { 
 document.getElementById("profile_sub_tab_show").style.display='none'
  document.getElementById("profile_sub_tab_hide").innerHTML="<div align='center'  class=left><img src='images/ajax-loader.gif'></div>"
 
 }
}

///////////////////////

function showPage(p,strpage,userid)
 { 
    //changefavp('p_'+p);
 	xmlHttp=GetXmlHttpObject()
 
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
 
 var url="list_post.php?page="+strpage+"&id="+userid
xmlHttp.onreadystatechange=stateChanged_page
xmlHttp.open("GET",url,true)
xmlHttp.send(null) 
 }
 
 
function stateChanged_page() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 

    document.getElementById("profile_sub_tab_show").style.display='none'
  document.getElementById("profile_sub_tab_hide").innerHTML=xmlHttp.responseText
 
 
 } 
  else
 { document.getElementById("profile_sub_tab_show").style.display='none'
  document.getElementById("profile_sub_tab_hide").innerHTML="<div align='center'  class=left><img src='images/ajax-loader.gif'></div>"
 
 }
}

 
function delete_image(image_id,userid,type)
 { 
 
 	xmlHttp=GetXmlHttpObject()
  
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }

 var url="delete_image.php?id="+userid+"&image="+image_id+"&type="+type
xmlHttp.onreadystatechange=stateChanged_image

xmlHttp.open("GET",url,true)
xmlHttp.send(null) 
 }
 
 
function stateChanged_image() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 

  
   //document.getElementById("profile_sub_tab_show").style.display='none'
// document.getElementById("profile_sub_tab_hide").innerHTML=xmlHttp.responseText
 alert(xmlHttp.responseText)
 location.reload();
 } 
 else
 {
	 
   // document.getElementById("profile_sub_tab_show").style.display='none'
    document.getElementById("profile_sub_tab_hide").innerHTML="<div align='center'  class=left><img src='images/ajax-loader.gif'></div>"
 }
}


 
//////////////////// delete fav ////////////////////////////////
var g_boxno
function DelFav(table,id,boxno)
 { 
    g_boxno=boxno
   // changefav('f_'+fav);
 	xmlHttp=GetXmlHttpObject()
 
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
 var url="del_record_fav.php"
 url=url+"?table="+table+"&id="+id
xmlHttp.onreadystatechange=stateChanged_DF
xmlHttp.open("GET",url,true)
xmlHttp.send(null) 
 }
 
 
function stateChanged_DF() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
//    document.getElementById("profile_sub_tab_show").style.display='none'
  document.getElementById("d_box"+g_boxno).style.visibility="hidden";
  document.getElementById("d_box"+g_boxno).style.display="none";
  document.getElementById("b_box"+g_boxno).style.visibility="hidden";
  document.getElementById("b_box"+g_boxno).style.display="none";

} 
else
 { 
 //document.getElementById("profile_sub_tab_show").style.display='none'
  //document.getElementById("profile_sub_tab_hide").innerHTML="<div align='center'  class=left><img src='images/ajax-loader.gif'></div>"
 
 }
}
//////////////////////end of delete fav ///////////////////////


//////////////////// delete post ////////////////////////////////
var g_boxno
function DelPost(table,id,boxno)
 { 
    g_boxno=boxno
   // changefav('f_'+fav);
 	xmlHttp=GetXmlHttpObject()
 
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
 var url="del_record.php"
 url=url+"?table="+table+"&id="+id
xmlHttp.onreadystatechange=stateChanged_DP
xmlHttp.open("GET",url,true)
xmlHttp.send(null) 
 }
 
 
function stateChanged_DP() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
//    document.getElementById("profile_sub_tab_show").style.display='none'
  document.getElementById("d_box"+g_boxno).style.visibility="hidden";
  document.getElementById("d_box"+g_boxno).style.display="none";
  document.getElementById("b_box"+g_boxno).style.visibility="hidden";
  document.getElementById("b_box"+g_boxno).style.display="none";

} 
else
 { 
 //document.getElementById("profile_sub_tab_show").style.display='none'
  //document.getElementById("profile_sub_tab_hide").innerHTML="<div align='center'  class=left><img src='images/ajax-loader.gif'></div>"
 
 }
}
//////////////////////end of delete post ///////////////////////

function ChangeVenueList(country_code)
{
	xmlHttp=GetXmlHttpObject()
 
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
	var url="changevenue.php"
	url=url+"?code="+country_code
	xmlHttp.onreadystatechange=ChangeVenue
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

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






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;
}// JavaScript Document

