// JavaScript Document
var xmlHttpfunction ;

function ajax_UpdateStatus(id, value){
 xmlHttp=GetXmlHttpObject()
        if (xmlHttp==null)
        {
         alert ("Browser does not support HTTP Request")
         return
        }
        
    var url="include/video_Show.php?m=0&vid="+id+"&val="+value;
 //   alert(url);
     xmlHttp.onreadystatechange=function () { 
          if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){
                   // document.getElementById("text").innerHTML=xmlHttp.responseText;
           };
      };
    xmlHttp.open("GET",url,true);
    xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    xmlHttp.send(null); 
}
function ajax_UpdateOrder(id,e){
     xmlHttp=GetXmlHttpObject()
            if (xmlHttp==null)
            {
             alert ("Browser does not support HTTP Request")
             return
            }
            
        var url="include/video_Show.php?m=1&vid="+id+"&val="+e;
     //   alert(url);
         xmlHttp.onreadystatechange=function () { 
              if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){
                       // document.getElementById("text").innerHTML=xmlHttp.responseText;
               };
          };
        xmlHttp.open("GET",url,true);
        xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
        xmlHttp.send(null); 
    }   

function getvideo_detail(ch_id, itm,link){
 xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
		 alert ("Browser does not support HTTP Request")
		 return
		}
		
	var url;
	if (link!=""){
		url=link+"/include/video_detail.php";
	}else{
		url="include/video_detail.php";
	}
		url=url+"?chid="+ch_id+"&itm="+itm;
 		xmlHttp.onreadystatechange=function () { 
              if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){
						document.getElementById("itm").innerHTML=xmlHttp.responseText;
               };
          };
		xmlHttp.open("GET",url,true);
		xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		xmlHttp.send(null); 
}

function showlist_TAB(no){

		 xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
		 alert ("Browser does not support HTTP Request")
		 return
		}
 		var url="include/video_playlist.php";
		url=url+"?no="+no;
 		xmlHttp.onreadystatechange=function () { 
              if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){
						document.getElementById("tab_list").innerHTML=xmlHttp.responseText;
               };
          };
		xmlHttp.open("GET",url,true);
		xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		xmlHttp.send(null); 
} 
	 function remove_playlist( mem_id ,vdo_id)
{
if  (confirm('Are you sure you want to delete selected items')){
	 xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
		 alert ("Browser does not support HTTP Request")
		 return
		}
 		var url="include/remove_playlist.php";
		url=url+"?mem_id="+mem_id +"&vid="+vdo_id;
 		xmlHttp.onreadystatechange=result_table ;
		xmlHttp.open("GET",url,true);
		xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		xmlHttp.send(null); 
		}
}
 function add_playlist_show( mem_id ,vdo_id)
{
	 xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
		 alert ("Browser does not support HTTP Request")
		 return
		}
 		var url="include/add_playlist.php";
		url=url+"?mem_id="+mem_id +"&vid="+vdo_id+"&type=1";
 		xmlHttp.onreadystatechange=function () { 
              if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){
						document.getElementById("tab_list").innerHTML=xmlHttp.responseText;
						alert('เพิ่มเข้าไปใน playlist เรียบร้อยแล้ว');
							 init_dw_Scroll();
               };
          };
		xmlHttp.open("GET",url,true);
		xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		xmlHttp.send(null); 
}

 function add_playlist( mem_id ,vdo_id)
{
	 xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
		 alert ("Browser does not support HTTP Request")
		 return
		}
 		var url="include/add_playlist.php";
		url=url+"?mem_id="+mem_id +"&vid="+vdo_id;
 		xmlHttp.onreadystatechange=playlist ;
		xmlHttp.open("GET",url,true);
		xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		xmlHttp.send(null); 
}
function playlist() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	 { 
		document.getElementById("playlist_data").innerHTML=xmlHttp.responseText;
		alert('เพิ่มเข้าไปใน playlist เรียบร้อยแล้ว');
	 } 
}

 function loadVideo_blog( id ,page)
{
		 xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
		 alert ("Browser does not support HTTP Request")
		 return
		}
 
		var url="include/blog_video.php";
		url=url+"?mem_id="+id +"&page="+page;
 		xmlHttp.onreadystatechange=result_table ;
		xmlHttp.open("GET",url,true);
		xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		xmlHttp.send(null);
}
 function loadArticel_calendar( id,mem_id)
{

 

		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
		 alert ("Browser does not support HTTP Request")
		 return
		}
 
		var url="include/blog_calendar.php";
		url=url+"?blg_id="+id ;
 		xmlHttp.onreadystatechange=function  () { 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
			 { 
				 var  value=xmlHttp.responseText;
				 var pos=value.indexOf("-");
				 var blg = value.substr(0,pos);
			      value=value.substr(pos+1)
				//	  alert(value);
				document.getElementById("main_tabs").innerHTML=value;
				 document.getElementById("section_comment").style.display="block";
				document.getElementById("blog_no").value=blg;
				blogComment('view',mem_id,id,'','','',1);
			 } 
		};
		xmlHttp.open("GET",url,true);
		xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		xmlHttp.send(null);
}

 function loadcalendar( query )
{
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
		 alert ("Browser does not support HTTP Request")
		 return
		}
 
		var url="include/calendar.php";
 		xmlHttp.onreadystatechange=result_calendar ;
		xmlHttp.open("POST",url,true);
		xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		xmlHttp.send(query);
}
function  result_calendar() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	 { 
		document.getElementById("calendar").innerHTML=xmlHttp.responseText;
	 } 
}

function  blog_tab(Type,mem_id,page,blgid)
{ 
 	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
		 {
			 alert ("Browser does not support HTTP Request")
			 return
		 }
 
		var url="include/blog_tab.php";
		url=url+"?Type="+Type+"&mem_id="+mem_id+"&page="+page;
		xmlHttp.onreadystatechange=function () { 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	 { 
		document.getElementById("main_tabs").innerHTML=xmlHttp.responseText;
		document.getElementById("blog_no").value=blgid;
        document.getElementById("section_comment").style.display="block";
		blogComment('view',mem_id,blgid,'','','',1);
	 } 
} ;
		xmlHttp.open("GET",url,true);
		xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		xmlHttp.send(null);
 }		
 function result_blog()
	{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	 { 
		document.getElementById("scrollbar_content").innerHTML=xmlHttp.responseText;
	 } 
}
function vote_video(vid,score)
{ 
 	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
		 {
			 alert ("Browser does not support HTTP Request")
			 return
		 }
	 
		var url="include/vote.php";
		url=url+"?video_id="+vid+"&score="+score;
		xmlHttp.onreadystatechange=result_vote ;
		xmlHttp.open("GET",url,true);
		xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		xmlHttp.send(null);
 
}	
	function result_vote() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	 { 
		document.getElementById("scored").innerHTML=xmlHttp.responseText;
	 } 
}
function delete_article(topic_id,Type,list_channel)
{ 
	var msg="";
if (Type==1){msg="คุณต้องการลบข้อมูลใช่ไหม"}
else{msg="คุณต้องการยกเลิกการแจ้งลบข้อมูลใช่ไหม"}
	if (confirm(msg)){
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
		 {
			 alert ("Browser does not support HTTP Request")
			 return
		 }
	 
		var url="include/webboard_notic.php";
		url=url+"?type="+Type+"&topic_id="+topic_id+"&channel_list="+list_channel;
		xmlHttp.onreadystatechange=result_table ;
		xmlHttp.open("GET",url,true);
		xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		xmlHttp.send(null);
		 }
}	
function update_inform(post_id,type){
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
		 {
			 alert ("Browser does not support HTTP Request")
			 return
		 }
		var url="include/update_inform.php";
		url=url+"?post_id="+post_id+"&type="+type;
		xmlHttp.onreadystatechange=result_table ;
		xmlHttp.open("GET",url,true);
		xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		xmlHttp.send(null);
}
function show_Article(id,channel_id,page)
{ 
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
		 {
			 alert ("Browser does not support HTTP Request")
			 return
		 }
	 	if (url_link!=""){
		url_link= url_link+"/";
		} 
 	var url=url_link+"include/article_tab.php";
		url=url+"?type="+id+"&page="+page+"&channel_id="+channel_id;
		xmlHttp.onreadystatechange=result_article ;
		xmlHttp.open("GET",url,true);
		xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		xmlHttp.send(null);
}
function result_article() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	 { 
		document.getElementById("article_data").innerHTML=xmlHttp.responseText;
	 } 
}
function show_index_webboard(id,channel_id)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
	 {
		 alert ("Browser does not support HTTP Request")
		 return
	 }
 
	if (url_link!=""){
		url_link= url_link+"/";
	} 
 	var url=url_link+"include/webboard_tab.php";
	url=url+"?type="+id+"&channel_id="+channel_id;
	xmlHttp.onreadystatechange=result_table ;
	xmlHttp.open("GET",url,true);
	xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	//xmlHttp.send("value="+id);
	xmlHttp.send(null);
}

function tab_index_webboard(id,page)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
	 {
		 alert ("Browser does not support HTTP Request")
		 return
	 }
 
	if (url_link!=""){
		url_link= url_link+"/";
	} 
 	var url=url_link+"include/index_webboard_tab.php";
	url=url+"?type="+id+"&page="+page;
	xmlHttp.onreadystatechange=result_table ;
	xmlHttp.open("GET",url,true);
	xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	//xmlHttp.send("value="+id);
	xmlHttp.send(null);
}
function tab_index_blog(id,page)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
     {
         alert ("Browser does not support HTTP Request")
         return
     }
    if (typeof(url_link) == 'undefined') {
        url_link = '';
    }else {
        if (url_link!=""){
            url_link= url_link+"/";
        } 
    }
     var url=url_link+"include/index_blog_tab.php";
    url=url+"?type="+id+"&page="+page;
    xmlHttp.onreadystatechange=result_table ;
    xmlHttp.open("GET",url,true);
    xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    //xmlHttp.send("value="+id);
    xmlHttp.send(null);
}
function result_table() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	 { 
		document.getElementById("result_data").innerHTML=xmlHttp.responseText;
	 } 
}

function showFriend(mode,id,page)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
	 {
		 alert ("Browser does not support HTTP Request")
		 return
	 }
 
	var url="view_people.php";
	url=url+"?type="+mode+"&page="+page+"&sid="+id;
	xmlHttp.onreadystatechange=stateChanged ;
	xmlHttp.open("GET",url,true);
	xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	//xmlHttp.send("value="+id);
	xmlHttp.send(null);
}

 
function  ShowWebboardTopic(forumID,catID){
	xmlHttp=GetXmlHttpObject()
	 if (xmlHttp==null)
	 {
		 alert ("Browser does not support HTTP Request")
		 return
	 }
	// alert(catID);
 	var url="include/viewforum.php";
	url=url+"?forumID="+forumID+"&catID="+catID;
	xmlHttp.onreadystatechange=returnWebboard ;
	xmlHttp.open("GET",url,true);
	xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	//xmlHttp.send("value="+id);
	xmlHttp.send(null);
 }
function showWebboard( catID)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
	 {
		 alert ("Browser does not support HTTP Request")
		 return
	 }
	if (url_link!=""){
		url_link= url_link+"/";
	} 
 	var url=url_link+"include/viewforum.php";
	url=url+"?catID="+catID;
	xmlHttp.onreadystatechange=returnWebboard ;
	xmlHttp.open("GET",url,true);
	xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	//xmlHttp.send("value="+id);
	xmlHttp.send(null);
}
function createTopic(forumID){
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
		 {
			 alert ("Browser does not support HTTP Request")
			 return
		 }
		// alert(forumID);
	 	var url="viewforum_createtopic.php";
		url=url+"?forumID="+forumID;
		xmlHttp.onreadystatechange=returnWebboard ;
		xmlHttp.open("GET",url,true);
		xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		//xmlHttp.send("value="+id);
		xmlHttp.send(null);	
}
function returnWebboard() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	 { 
		document.getElementById("blogWebboad").innerHTML=xmlHttp.responseText;
	 } 
}

function showRelateVideo(view,channel,mode,page)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
	 {
		 alert ("Browser does not support HTTP Request")
		 return
	 }
 	var url="include/video_Channel.php";
	url=url+"?view="+view+"&channel="+channel+"&mode="+mode+"&pages="+page;
	xmlHttp.onreadystatechange=returnData ;
	xmlHttp.open("GET",url,true);
	xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	//xmlHttp.send("value="+id);
	xmlHttp.send(null);
}

function  videoComment(vid,memID,mode,comment,createBy ,pages)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
	 {
		 alert ("Browser does not support HTTP Request")
		 return
	 }
  	var url="include/video_comment_save.php";
	url=url+"?vid_id='"+vid+"'&mem_id="+memID+"&mode="+mode+"&postby="+createBy+"&msg="+comment+"&pages="+pages;
  	xmlHttp.onreadystatechange=returnComment ;
	xmlHttp.open("GET",url,true);
	xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	//xmlHttp.send("value="+id);
	xmlHttp.send(null);
}

function  blogComment(menu,pst_id,blgID,memID,comment,ssCode,pages)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
	 {
		 alert ("Browser does not support HTTP Request")
		 return
	 }
 
	var url="include/blog_comment.php";
	url=url+"?mode="+menu+"&pst_id="+pst_id+"&blg_id="+blgID+"&mem_id="+memID+"&comment="+comment+"&ss_code="+ssCode+"&pages="+pages;
	xmlHttp.onreadystatechange=returnComment ;
	xmlHttp.open("GET",url,true);
	xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	//xmlHttp.send("value="+id);
	xmlHttp.send(null);
}
function articleComment(menu,newID,memID,comment,pages)
{ 
 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
	 {
		 alert ("Browser does not support HTTP Request")
		 return
	 }
 
	var url="include/article_comment.php";
	url=url+"?mode="+menu+"&news_id="+newID+"&mem_id="+memID+"&comment="+comment+"&pages="+pages;
	xmlHttp.onreadystatechange=function returnComment() 
			{ 
			if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
				 { 
					document.getElementById("blogComment").innerHTML=xmlHttp.responseText;
					if (menu=="add")
							alert('ขอบคุณค่ะ');
				 } 
			} ;
	xmlHttp.open("GET",url,true);
	xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	//xmlHttp.send("value="+id);
	xmlHttp.send(null);
}
function returnComment() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	 { 
		document.getElementById("blogComment").innerHTML=xmlHttp.responseText;
 	 } 
}
/* Use for video menu */
function showVideoAll(menu,page,catID)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
	 {
		 alert ("Browser does not support HTTP Request")
		 return
	 }
 
	var url="view_video.php";
	url=url+"?mode="+menu+"&cat="+catID+"&page="+page;
	xmlHttp.onreadystatechange=returnData ;
	xmlHttp.open("GET",url,true);
	xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	//xmlHttp.send("value="+id);
	xmlHttp.send(null);
}
function showVideo_channel(menu,page,chid,catID)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
     {
         alert ("Browser does not support HTTP Request")
         return
     }
 
    var url="channel_view_video.php";
    url=url+"?mode="+menu+"&cat="+catID+"&page="+page+"&ID="+chid;
    xmlHttp.onreadystatechange=returnData ;
    xmlHttp.open("GET",url,true);
    xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    //xmlHttp.send("value="+id);
    xmlHttp.send(null);
}
/* Use for mainpage */
function showVideo_URL(menu,page,id,link)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
	 {
		 alert ("Browser does not support HTTP Request")
		 return
	 }
		
	var url;
	if (link!=""){
		url=link+"/include/index_tab.php";
	}else{
		url="include/index_tab.php";
	}
	url=url+"?menu="+menu+"&ID="+id+"&page="+page+"&link="+link;
	xmlHttp.onreadystatechange=returnData ;
	xmlHttp.open("GET",url,true);
	xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	//xmlHttp.send("value="+id);
	xmlHttp.send(null);
}
function showVideo_TAB(menu,page,id)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
	 {
		 alert ("Browser does not support HTTP Request")
		 return
	 }
 	if (url_link!=""){
		url_link= url_link+"/";
	} 
 	var url=url_link+"include/index_tab.php";
	url=url+"?menu="+menu+"&ID="+id+"&page="+page;
	xmlHttp.onreadystatechange=returnData ;
	xmlHttp.open("GET",url,true);
	xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	//xmlHttp.send("value="+id);
	xmlHttp.send(null);
}
function showVideo_TAB_2(menu,page,id)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
	 {
		 alert ("Browser does not support HTTP Request")
		 return
	 }
 
	if (url_link!=""){
		url_link= url_link+"/";
	} 
 	var url=url_link+"?menu="+menu+"&ID="+id+"&page="+page;
	xmlHttp.onreadystatechange=returnComment ;
	xmlHttp.open("GET",url,true);
	xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	//xmlHttp.send("value="+id);
	xmlHttp.send(null);
}
function returnData() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	 { 
		document.getElementById("tab_menu").innerHTML=xmlHttp.responseText;
	 } 
}

function showChannel(mode,id,page)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
	 {
		 alert ("Browser does not support HTTP Request")
		 return
	 }
 
	var url="view_channels.php";
	url=url+"?type="+mode+"&page="+page+"&sid="+id;
	xmlHttp.onreadystatechange= function () { 
              if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){
						document.getElementById("txtPeople_"+id).innerHTML=xmlHttp.responseText;
               };
          };
	xmlHttp.open("GET",url,true);
	xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	//xmlHttp.send("value="+id);
	xmlHttp.send(null);
}
 
function stateChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	 { 
		document.getElementById("txtPeople").innerHTML=xmlHttp.responseText;
	 } 
}

function showSearch(type)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
	 {
		 alert ("Browser does not support HTTP Request")
		 return
	 }
 
	var url="findcriteria.php";
	url=url+"?searchtype="+type;
	xmlHttp.onreadystatechange=criteriachange;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
function criteriachange() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	 { 
		document.getElementById("txtSearch").innerHTML=xmlHttp.responseText; 
	 } 
}

function showFriendRequest(result,fid,page)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
	 {
		 alert ("Browser does not support HTTP Request")
		 return
	 }
 
	var url="view_friend_request.php";
	url=url+"?resulta="+result+"&FID="+fid+"&page="+page;
	xmlHttp.onreadystatechange=FriendRequestChanged ;
	xmlHttp.open("GET",url,true);
	xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	//xmlHttp.send("value="+id);
	xmlHttp.send(null);
}
function FriendRequestChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	 { 
		document.getElementById("txtPeople").innerHTML=xmlHttp.responseText;
	 } 
}


function showFriendSuggest(result,fid,page)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
	 {
		 alert ("Browser does not support HTTP Request")
		 return
	 }
 
	var url="view_friend_suggestion.php";
	url=url+"?resulta="+result+"&FID="+fid+"&page="+page;
	xmlHttp.onreadystatechange=FriendSuggestChanged ;
	xmlHttp.open("GET",url,true);
	xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	//xmlHttp.send("value="+id);
	xmlHttp.send(null);
}
function FriendSuggestChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	 { 
		document.getElementById("txtPeople").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;
}
function strpos(str, searchstring)
{
	for (var i = 0; i < str.length; i++)
		if (str.substring(i, i+searchstring.length) == searchstring) return i;

	return -1;
}

function menuClick(menuid, img)
{
	if (document.getElementById)
	{
		var rmenu = document.getElementById (menuid);
		if (rmenu && rmenu.className)
		{
		    rmenu.className = (rmenu.className == 'menuOpen') ? 'menuClosed' : 'menuOpen';
		    if (strpos(img.src, 'images/arr_up.png') == -1)
			{
				img.src = 'images/arr_up.png';
			}
			else
			{
				img.src = 'images/arr_on.png';
			}
		}
	}
	//if (navigator.appName == 'Microsoft Internet Explorer' && document.documentElement && navigator.userAgent.indexOf ('Opera') == -1) parent.setScrollInIE();
	return false;
}