// JavaScript Document
function showcategory(str)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="showbloglist.php"
url=url+"?q="+str
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

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

function showcmmcategory(str)
{ 
xmlHttp1=GetXmlHttpObject()
if (xmlHttp1==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="showcmmcategory.php"
url=url+"?q="+str
xmlHttp1.onreadystatechange=stateChanged1
xmlHttp1.open("GET",url,true)
xmlHttp1.send(null)
}

function stateChanged1() 
{ 
if (xmlHttp1.readyState==4 || xmlHttp1.readyState=="complete")
 { 
 document.getElementById("show").innerHTML=xmlHttp1.responseText 
 } 
}


function showcmt(str)
{
	
 
	xmlHttp7=GetXmlHttpObject();
	if (xmlHttp7==null)
  	{
		alert ("Browser does not support HTTP Request");
	  	return;
  	} 
  	var url="community/getphotocmt.php";
	
	xmlHttp7.open("POST",url,true);
	
	xmlHttp7.setRequestHeader("Content-Type",
"application/x-www-form-urlencoded; charset=UTF-8");
	xmlHttp7.onreadystatechange=stateChanged7;
	xmlHttp7.send("val="+str);	
}

function stateChanged7() 
{ 
if (xmlHttp7.readyState==4 || xmlHttp7.readyState=="complete")
 { 
   document.getElementById("dispcmt").innerHTML=xmlHttp7.responseText;

 } 
}



function postcmt(str)
{
	
   
	xmlHttp8=GetXmlHttpObject();
	if (xmlHttp8==null)
  	{
		alert ("Browser does not support HTTP Request");
	  	return;
  	} 
  	var url="community/disppost.php";
	
	xmlHttp8.open("POST",url,true);
	
	xmlHttp8.setRequestHeader("Content-Type",
"application/x-www-form-urlencoded; charset=UTF-8");
	xmlHttp8.onreadystatechange=stateChanged8;
	xmlHttp8.send("val="+str);
}

function stateChanged8() 
{ 
if (xmlHttp8.readyState==4 || xmlHttp8.readyState=="complete")
 { 
   document.getElementById("postcmt").innerHTML=xmlHttp8.responseText;

 } 
}


function showpopular()
{
	xmlHttp9=GetXmlHttpObject();
	if (xmlHttp9==null)
  	{
		alert ("Browser does not support HTTP Request");
	  	return;
  	} 
  	var url="showpopularcmm.php";
	
	xmlHttp9.onreadystatechange=stateChanged9;
	xmlHttp9.open("GET",url,true);
	xmlHttp9.send(null);	
	
	
}
function stateChanged9() 
{ 
if (xmlHttp9.readyState==4 || xmlHttp9.readyState=="complete")
 { 
   document.getElementById("show").innerHTML=xmlHttp9.responseText;

 } 
}

function showmostrated()
{
	xmlHttp10=GetXmlHttpObject();
	if (xmlHttp10==null)
  	{
		alert ("Browser does not support HTTP Request");
	  	return;
  	} 
  	var url="showmostratedcmm.php";
	
	xmlHttp10.onreadystatechange=stateChanged10;
	xmlHttp10.open("GET",url,true);
	xmlHttp10.send(null);	
	
	
}
function stateChanged10() 
{ 
if (xmlHttp10.readyState==4 || xmlHttp10.readyState=="complete")
 { 
   document.getElementById("show").innerHTML=xmlHttp10.responseText;

 } 
}




function showrecent()
{
	xmlHttp11=GetXmlHttpObject();
	if (xmlHttp11==null)
  	{
		alert ("Browser does not support HTTP Request");
	  	return;
  	} 
  	var url="showrecentcmm.php";
	
	xmlHttp11.onreadystatechange=stateChanged11;
	xmlHttp11.open("GET",url,true);
	xmlHttp11.send(null);	
	
	
}
function stateChanged11() 
{ 
if (xmlHttp11.readyState==4 || xmlHttp11.readyState=="complete")
 { 
   document.getElementById("show").innerHTML=xmlHttp11.responseText;

 } 
}



function showrecentblog()
{
	xmlHttp12=GetXmlHttpObject();
	if (xmlHttp12==null)
  	{
		alert ("Browser does not support HTTP Request");
	  	return;
  	} 
  	var url="showrecentblog.php";
	
	xmlHttp12.onreadystatechange=stateChanged12;
	xmlHttp12.open("GET",url,true);
	xmlHttp12.send(null);	
	
	
}
function stateChanged12() 
{ 
if (xmlHttp12.readyState==4 || xmlHttp12.readyState=="complete")
 { 
   document.getElementById("show").innerHTML=xmlHttp12.responseText;

 } 
}
function preview(str)
{
	xmlHttp13=GetXmlHttpObject();
	if (xmlHttp13==null)
  	{
		alert ("Browser does not support HTTP Request");
	  	return;
  	} 
  	var url="previewmes.php";
	url=url+"?val="+str;
	xmlHttp13.onreadystatechange=stateChanged13;
	xmlHttp13.open("GET",url,true);
	xmlHttp13.send(null);	
}
function stateChanged13() 
{ 
if (xmlHttp13.readyState==4 || xmlHttp13.readyState=="complete")
 { 
   document.getElementById("show").innerHTML=xmlHttp13.responseText;

 } 
}




function preview1(str)
{
	xmlHttp29=GetXmlHttpObject();
	if (xmlHttp29==null)
  	{
		alert ("Browser does not support HTTP Request");
	  	return;
  	} 
  	var url="previewmes.php";
	url=url+"?val="+str;
	xmlHttp29.onreadystatechange=stateChanged13;
	xmlHttp29.open("GET",url,true);
	xmlHttp29.send(null);	
}
function stateChanged29() 
{ 
if (xmlHttp29.readyState==4 || xmlHttp29.readyState=="complete")
 { 
   document.getElementById("show1").innerHTML=xmlHttp29.responseText;

 } 
}

function showmes(str1,str2)
{
	xmlHttp18=GetXmlHttpObject();
	
	if (xmlHttp18==null)
  	{
		alert ("Browser does not support HTTP Request");
	  	return;
  	} 
  	var url="showmessage.php";
	url=url+"?val="+str1;
	
	xmlHttp18.onreadystatechange=function()
    {
    if(xmlHttp18.readyState==4)
      {
     document.getElementById(str2).innerHTML=xmlHttp18.responseText;
      }
    }

	xmlHttp18.open("GET",url,true);
	xmlHttp18.send(null);	
}
function newmes()
{
	xmlHttp19=GetXmlHttpObject();
	
	if (xmlHttp19==null)
  	{
		alert ("Browser does not support HTTP Request");
	  	return;
  	} 
  	var url="newmes.php";
	
	
	xmlHttp19.onreadystatechange=function()
    {
    if(xmlHttp19.readyState==4)
      {
     document.getElementById('countrydivcontainer').innerHTML=xmlHttp19.responseText;
      }
    }

	xmlHttp19.open("GET",url,true);
	xmlHttp19.send(null);	
}


function readreceived()
{
	xmlHttp20=GetXmlHttpObject();
	
	if (xmlHttp20==null)
  	{
		alert ("Browser does not support HTTP Request");
	  	return;
  	} 
  	var url="readmes.php";
	
	
	xmlHttp20.onreadystatechange=function()
    {
    if(xmlHttp20.readyState==4)
      {
     document.getElementById('countrydivcontainer').innerHTML=xmlHttp20.responseText;
      }
    }

	xmlHttp20.open("GET",url,true);
	xmlHttp20.send(null);	
}



function check(value)
	{
		xmlHttp25=GetXmlHttpObject();
	
	if (xmlHttp25==null)
  	{
		alert ("Browser does not support HTTP Request");
	  	return;
  	} 
  	var url="check.php?va="+value;
	
	
	xmlHttp25.onreadystatechange=function()
    {
    if(xmlHttp25.readyState==4)
      {
     document.getElementById('showavailable').innerHTML=xmlHttp25.responseText;
      }
    }

	xmlHttp25.open("GET",url,true);
	xmlHttp25.send(null);	
		
	}
	
	function checkemail(value)
	{
		xmlHttp26=GetXmlHttpObject();
		
	if (xmlHttp26==null)
  	{
		alert ("Browser does not support HTTP Request");
	  	return;
  	} 
  	var url="checkemail.php?va="+value;
	
	
	xmlHttp26.onreadystatechange=function()
    {
    if(xmlHttp26.readyState==4)
      {
     document.getElementById('showemail').innerHTML=xmlHttp26.responseText;
      }
    }

	xmlHttp26.open("GET",url,true);
	xmlHttp26.send(null);	
		
	}
	


	function addtofriend(myform)
	{
		
		xmlHttp27=GetXmlHttpObject();
		
	if (xmlHttp27==null)
  	{
		alert ("Browser does not support HTTP Request");
	  	return;
  	} 
	var message="val="+myform;
  	var url="community/addfromsearch.php";
	
	xmlHttp27.open("POST",url);
	xmlHttp27.setRequestHeader("Content-Type",
"application/x-www-form-urlencoded; charset=UTF-8");
	xmlHttp27.onreadystatechange=function()
    {
    if(xmlHttp27.readyState==4)
      {
     document.getElementById('show').innerHTML=xmlHttp27.responseText;
      }
    }

	
	xmlHttp27.send(message);	
		
	}
		function addrel(cid,rid)
	{
		
		xmlHttp47=GetXmlHttpObject();
		
	if (xmlHttp47==null)
  	{
		alert ("Browser does not support HTTP Request");
	  	return;
  	} 
	var message="cmid="+cid+"&rd="+rid;
  	var url="addrel.php";
	
	xmlHttp47.open("POST",url);
	xmlHttp47.setRequestHeader("Content-Type",
"application/x-www-form-urlencoded; charset=UTF-8");
	xmlHttp47.onreadystatechange=function()
    {
    if(xmlHttp47.readyState==4)
      {
    window.location.href="community.php?cmid="+cid;
      }
    }

	
	xmlHttp47.send(message);	
		
	}
	
function shoutit(shbxstr,recid,flg,conid,fid)
{
	xmlHttp28=GetXmlHttpObject();
	alert(shbxstr);
	alert(recid);
	alert(flg);
	alert(conid);
	alert(fid);	
	if (xmlHttp28==null)
  	{
		alert ("Browser does not support HTTP Request");
	  	return;
  	} 
	
  	var url="addshout.php";
	var ms="shtxt="+shbxstr+"receivid="+recid+"flag="+flg+"convid="+conid+"fid="+fid;
	/*var ms2="receivid="+recid;
	var ms3="flag="+flg;
	var ms4="convid="+conid;
	var ms5="fid="+fid;
	var postArray=new Array(5);
	postArray[0]=ms1;
	postArray[1]=ms2;
	postArray[2]=ms3;
	postArray[3]=ms4;
	postArray[4]=ms5;*/
	

	xmlHttp28.open("POST",url);
	xmlHttp28.setRequestHeader("Content-Type",
"application/x-www-form-urlencoded; charset=UTF-8");
	xmlHttp28.setRequestHeader("Content-length", ms.length);
	//for(var i=0;i<postArray.length;i++)
	//{
		xmlHttp28.send(ms);//postArray[i]);
	//}
	xmlHttp28.onreadystatechange=function()
    {
     if(xmlHttp28.readyState==4)
     {
		
      document.getElementById('show').innerHTML=xmlHttp28.responseText;
     }
	 else if(xmlHttp28.readyState==0) 
	 {
		document.write("The request is not initialized");
	 }
	 else if(xmlHttp28.readyState==1) 
	 {
		document.write("The request has been set up");
	 }
	 else if(xmlHttp28.readyState==2) 
	 {
		document.write("The request has been sent");
	 }
	 else if(xmlHttp28.readyState==3) 
	 {
		document.write("The request is in process");
	 }
	 else
	 {
		document.write("404 Not Found. There may have been an error in the request");
	 }
   }

}
	
function singDel(mid,cid,id,strt,rp)
	{
		xmlHttp29=GetXmlHttpObject();
		
	if (xmlHttp29==null)
  	{
		alert ("Browser does not support HTTP Request");
	  	return;
  	} 
	var message="mesid="+mid;
	var mes="convid="+cid;
	var mes1="fid="+id;
	var mes2="start="+strt;
	var mes3="rows_per_page="+rp;
  	var url="ShoutDelete.php";
	
	xmlHttp29.open("POST",url);
	xmlHttp29.setRequestHeader("Content-Type",
"application/x-www-form-urlencoded; charset=UTF-8");
	xmlHttp29.onreadystatechange=function()
    {
    if(xmlHttp29.readyState==4)
      {
     document.getElementById('show').innerHTML=xmlHttp29.responseText;
      }
    }

	
	xmlHttp29.send(message);
	xmlHttp29.send(mes);
	xmlHttp29.send(mes1);
	xmlHttp29.send(mes2);
	xmlHttp29.send(mes3);
	}


function makerequest2(file) {

xmlHttp30=GetXmlHttpObject();
var message="val="+file;
var url="addasshow.php";
xmlHttp30.open("POST", url);
xmlHttp30.setRequestHeader("Content-Type",
"application/x-www-form-urlencoded; charset=UTF-8");
xmlHttp30.onreadystatechange = function() {
if (xmlHttp30.readyState == 4 && xmlHttp30.status == 200) {


}
}
xmlHttp30.send(message);
}
//-->

function closewindow(D){ 
var obj = document.getElementById('addfriend');
obj.style.visibility="hidden"; 


}



function addtovideo(url1,title)
{
	xmlHttp34=GetXmlHttpObject();
		
	if (xmlHttp34==null)
  	{
		alert ("Browser does not support HTTP Request");
	  	return;
  	} 

	var uriid="videoname="+url1;
	var tit="vtitle="+title;
	var url="addvidfromsearch.php";
	xmlHttp34.open("POST",url);
	xmlHttp34.setRequestHeader("Content-Type",
"application/x-www-form-urlencoded; charset=UTF-8");
	xmlHttp34.onreadystatechange=function()
    {
    if(xmlHttp34.readyState==4)
      {
     document.getElementById('show').innerHTML=xmlHttp34.responseText;
      }
    }

	
	xmlHttp34.send("videoname="+url1+"&vtitle="+title);
	
	
}
function showcmt(str,str2,str3)
{
	
 
	xmlHttp7=GetXmlHttpObject();
	if (xmlHttp7==null)
  	{
		alert ("Browser does not support HTTP Request");
	  	return;
  	} 
  	var url="community/getphotocmt.php";
	
	xmlHttp7.open("POST",url,true);
	
	xmlHttp7.setRequestHeader("Content-Type",
"application/x-www-form-urlencoded; charset=UTF-8");
	xmlHttp7.onreadystatechange=stateChanged7;
	xmlHttp7.send("val="+str+"&fid="+str2+"&aid="+str3);	
}







 
  	function closewindow(){ 
var obj = document.getElementById('show');
obj.style.visibility="hidden"; 
	}
	

function statusupdate()
{
	
xmlHttp43=GetXmlHttpObject();
		
	if (xmlHttp43==null)
  	{
		alert ("Browser does not support HTTP Request");
	  	return;
  	} 

	
	var url="status.php";
	xmlHttp43.open("POST",url);
	xmlHttp43.setRequestHeader("Content-Type",
"application/x-www-form-urlencoded; charset=UTF-8");
	xmlHttp43.onreadystatechange=function()
    {
    if(xmlHttp43.readyState==4)
      {
     document.st.status1.value=xmlHttp43.responseText;
      }
    }

	
	xmlHttp43.send(null);	
	
	
}

function boxblur(control,val)
	{
            
			   new1= val.replace(/^\s+|\s+$/g, '');
		  
	 
		 if(!$("#"+control).val()) $("#"+control).val(new1);
		
	}
	function boxfocus(control,val)
	{

			  new1= val.replace(/^\s+|\s+$/g, '');
		 if($("#"+control).val() == val) $("#"+control).val("");
	}
	
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;
}
