				var xmlHttp1;
				var did;
				xmlHttp1=GetXmlHttpObject1()
				var windowHeight = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight;
				var windowWidth = window.innerWidth ? window.innerWidth : document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.clientWidth;
				var id2,cat2;
				var rate_type;
				var temp1,temp2;
				
				function save_qset(ques,id,cat)
				{
					id2=id;
					cat2=cat;
					xmlHttp1=GetXmlHttpObject1()
					if (xmlHttp1==null)
					 {
					 alert ("Browser does not support HTTP Request")
					 return
					 }
					var url="save_qset.php?ques=" + ques ;
					xmlHttp1.onreadystatechange=save_qset_req
					xmlHttp1.open("GET",url,true);
					xmlHttp1.send(null)
				}
				function save_qset_req() 
				{ 
					if (xmlHttp1.readyState==4 || xmlHttp1.readyState=="complete")
					{
						getwindow("slambook",id2,cat2)
					}
					else
					{
						document.getElementById("savebutton").innerHTML="Saving...";
					}
				}
				
				function show_friend_panel(id)
				{
					//alert(id);
					xmlHttp1=GetXmlHttpObject1()
					if (xmlHttp1==null)
					 {
					 alert ("Browser does not support HTTP Request")
					 return
					 }
					var url="show_friend_panel.php?id=" + id ;
					xmlHttp1.onreadystatechange=show_friend_panel_req
					xmlHttp1.open("GET",url,true);
					xmlHttp1.send(null)
				}
				function show_friend_panel_req() 
				{ 
					if (xmlHttp1.readyState==4 || xmlHttp1.readyState=="complete")
					{
						document.getElementById("message2").innerHTML=xmlHttp1.responseText;
					}
					else
					{
						document.getElementById("panel2").style.left=((windowWidth/2)-180) + "px";
						document.getElementById("panel2").style.top=((windowHeight/2)-120 ) + "px";
						document.getElementById("panel2").style.display="block";
						document.getElementById("message2").innerHTML="<div style='padding-top:100px' align=center><img src='images/loading.gif'></div>";
					}
				}
				
				function add_friend(id)
				{
					//alert(id);
					xmlHttp1=GetXmlHttpObject1()
					if (xmlHttp1==null)
					 {
					 alert ("Browser does not support HTTP Request")
					 return
					 }
					var url="add_friend.php?id=" + id ;
					xmlHttp1.onreadystatechange=add_friend_req
					xmlHttp1.open("GET",url,true);
					xmlHttp1.send(null)
				}
				function add_friend_req() 
				{ 
					if (xmlHttp1.readyState==4 || xmlHttp1.readyState=="complete")
					{
						document.getElementById("message2").innerHTML=xmlHttp1.responseText;
					}
					else
					{
						document.getElementById("panel2").style.left=((windowWidth/2)-280) + "px";
						document.getElementById("panel2").style.top=((windowHeight/2)-120 ) + "px";
						document.getElementById("panel2").style.display="block";
						document.getElementById("message2").innerHTML="<div style='padding-top:100px' align=center><img src='images/loading.gif'></div>";
					}
				}
				
				function view_message(id,type)
				{
					//alert(id);
					xmlHttp1=GetXmlHttpObject1()
					if (xmlHttp1==null)
					 {
					 alert ("Browser does not support HTTP Request")
					 return
					 }
					var url="viewmail.php?type=" + type + "&id=" + id ;
					xmlHttp1.onreadystatechange=view_message_req
					xmlHttp1.open("GET",url,true);
					xmlHttp1.send(null)
				}
				function view_message_req() 
				{ 
					if (xmlHttp1.readyState==4 || xmlHttp1.readyState=="complete")
					{
						document.getElementById("message").innerHTML=xmlHttp1.responseText;
					}
					else
					{
						document.getElementById("panel").style.left=((windowWidth/2)-280) + "px";
						document.getElementById("panel").style.top=((windowHeight/2)-120 ) + "px";
						document.getElementById("panel").style.display="block";
						document.getElementById("message").innerHTML="<div style='padding-top:180px' align=center><img src='images/loading.gif'></div>";
					}
				}
				
				function delmessage(id,dfor)
				{
					did=dfor;
					xmlHttp1=GetXmlHttpObject1()
					if (xmlHttp1==null)
					 {
					 alert ("Browser does not support HTTP Request")
					 return
					 }
					var url="valid_mail.php?type=delete&id=" + id + "&dfor=" + dfor;
					xmlHttp1.onreadystatechange=delmessage_req
					xmlHttp1.open("GET",url,true);
					xmlHttp1.send(null)
				}
				function delmessage_req() 
				{ 
					if (xmlHttp1.readyState==4 || xmlHttp1.readyState=="complete")
					{
						get_mails(did);
					}
					else
					{
						//document.getElementById("sentmail").innerHTML="<img src='images/loading.gif'>";
					}
				}
				function sendmessage(mail,subject,content)
				{
					content=content.replace(/\n/g,"<br>");
					xmlHttp1=GetXmlHttpObject1()
					if (xmlHttp1==null)
					 {
					 alert ("Browser does not support HTTP Request")
					 return
					 }
					var url="valid_mail.php?mail=" + mail + "&type=mail&subject=" + subject + "&content=" + content;
					xmlHttp1.onreadystatechange=sendmessage_req
					xmlHttp1.open("GET",url,true);
					xmlHttp1.send(null)
				}
				function sendmessage_req() 
				{ 
					if (xmlHttp1.readyState==4 || xmlHttp1.readyState=="complete")
					{
						document.getElementById("to").value="";
						document.getElementById("subject").value="";
						document.getElementById("message").value="";
						document.getElementById("sentmail").innerHTML="<input type=\"button\" name=\"Submit\" value=\"Send Message\" class=\"Button\" onClick=\"validate_mail(document.getElementById('to').value,document.getElementById('subject').value,document.getElementById('message').value)\">";
					}
					else
					{
						document.getElementById("sentmail").innerHTML="<img src='images/loading.gif'>";
					}
					
				}
			
				function validate_mail(mail,subject,content)
				{
					//alert(type);
					did=mail;
					temp1=subject;
					temp2=content;
					//alert(content);
					xmlHttp1=GetXmlHttpObject1()
					if (xmlHttp1==null)
					 {
					 alert ("Browser does not support HTTP Request")
					 return
					 }
					var url="valid_mail.php?mail=" + mail + "&type=check";
					xmlHttp1.onreadystatechange=validate_mail_req
					xmlHttp1.open("GET",url,true);
					xmlHttp1.send(null)
					//alert("222");
				}
				
				function validate_mail_req() 
				{ 
					if (xmlHttp1.readyState==4 || xmlHttp1.readyState=="complete")
					{
						//alert("333");	
						//document.getElementById("inbox_content").innerHTML=xmlHttp1.responseText;
						if(xmlHttp1.responseText!="0")
						{
							sendmessage(did,temp1,temp2);
						}
						else
						{
							document.getElementById("sentmail").innerHTML="<input type=\"button\" name=\"Submit\" value=\"Send Message\" class=\"Button\" onClick=\"validate_mail(document.getElementById('to').value,document.getElementById('subject').value,document.getElementById('message').value)\">";
							document.getElementById("status").innerHTML="<blink><b style='color:maroon'>Incorrect Email!</b></blink>";
						}
					}
					else
					{
						document.getElementById("sentmail").innerHTML="<img src='images/loading.gif'>";
					}
					
				}
			
				
				function get_mails(type)
				{
					//alert(type);
					document.getElementById('panel').style.display="none";
					xmlHttp1=GetXmlHttpObject1()
					if (xmlHttp1==null)
					 {
					 alert ("Browser does not support HTTP Request")
					 return
					 }
					var url="getmail.php?type=" + type;
					xmlHttp1.onreadystatechange=get_mails_req
					xmlHttp1.open("GET",url,true);
					xmlHttp1.send(null)
					//alert("222");
				}
				
				function get_mails_req() 
				{ 
					if (xmlHttp1.readyState==4 || xmlHttp1.readyState=="complete")
					{
						//alert("333");	
						document.getElementById("inbox_content").innerHTML=xmlHttp1.responseText;
					}
					else
					{
						document.getElementById("inbox_content").innerHTML="<div align=center>Loading...</div>";
					}
					
				}


			
			
				function rename_object(type,id,value)
				{
					xmlHttp1=GetXmlHttpObject1()
					if (xmlHttp1==null)
					 {
					 alert ("Browser does not support HTTP Request")
					 return
					 }
					var url="rename_document.php?type=" + type + "&id=" + id + "&value=" + value;
					xmlHttp1.onreadystatechange=rename_object_req
					xmlHttp1.open("GET",url,true);
					xmlHttp1.send(null)
				}
				
				function rename_object_req() 
				{ 
					if (xmlHttp1.readyState==4 || xmlHttp1.readyState=="complete")
					{
						//document.getElementById("profile_window").innerHTML=xmlHttp1.responseText;
						if(xmlHttp1.responseText=="")
						{
							getwindow('documents','0','0');
						}
						else
						{
							getwindow('documents','0',xmlHttp1.responseText);
						}
						
					}
					else
					{
						document.getElementById("profile_window").innerHTML="<div align=center><img src='images/loading.gif'> <br><br>Loading. Please wait...</div>";
					}
					
				}

			function delete_document(id,type)
				{
					//alert(id);
					//alert(type);
					//alert(fold);
					xmlHttp1=GetXmlHttpObject1()
					if (xmlHttp1==null)
					 {
					 alert ("Browser does not support HTTP Request")
					 return
					 }
					var url="delete_document.php?type=" + type + "&id=" + id;
					xmlHttp1.onreadystatechange=delete_document_req
					xmlHttp1.open("GET",url,true);
					xmlHttp1.send(null)
				}
				
				function delete_document_req() 
				{ 
					if (xmlHttp1.readyState==4 || xmlHttp1.readyState=="complete")
					{
						//document.getElementById("profile_window").innerHTML=xmlHttp1.responseText;
						if(xmlHttp1.responseText=="")
						{
							getwindow('documents','0','0');
						}
						else
						{
							getwindow('documents','0',xmlHttp1.responseText);
						}
					}
					else
					{
						document.getElementById("profile_window").innerHTML="<div align=center><img src='images/loading.gif'> <br><br>Loading. Please wait...</div>";
					}
					
				}

			
				function rate(id,type,value)
				{
					//alert(fold);
					rate_type=type;
					did=id;
					xmlHttp1=GetXmlHttpObject1()
					if (xmlHttp1==null)
					 {
					 alert ("Browser does not support HTTP Request")
					 return
					 }
					var url="ajaxrating.php?id=" + id + "&type=" + type + "&rate=" + value;
					xmlHttp1.onreadystatechange=rate_req
					xmlHttp1.open("GET",url,true);
					xmlHttp1.send(null)
				}
				
				function rate_req() 
				{ 
					if (xmlHttp1.readyState==4 || xmlHttp1.readyState=="complete")
					{
						if(rate_type=="photo")
						{	
							document.getElementById("rating").innerHTML="";
						}
						else if(rate_type=="video")
						{
							viewvideo(did);
							//alert("saved");
							//document.getElementById("view_video").innerHTML=xmlHttp1.responseText;
						}
						else if(rate_type=="group")
						{
							document.getElementById("starrating").innerHTML=xmlHttp1.responseText;
							document.getElementById("starrating2").innerHTML="<h3>Thanks for rating</h3>";
							
						}
						else if(rate_type=="article")
						{
							document.getElementById("starrating").innerHTML=xmlHttp1.responseText;
							document.getElementById("starrating2").innerHTML="<h3>Thanks for rating</h3>";
							
						}
						else if(rate_type=="classified")
						{
							document.getElementById("starrating").innerHTML=xmlHttp1.responseText;
							document.getElementById("starrating2").innerHTML="<h3>Thanks for rating</h3>";
							
						}
						else if(rate_type=="forum")
						{
							document.getElementById("starrating"+did).innerHTML=xmlHttp1.responseText;
							document.getElementById("starratings"+did).innerHTML="";
							
						}
						else if(rate_type=="profile")
						{
							document.getElementById("starrating").innerHTML=xmlHttp1.responseText;
							document.getElementById("starrating2").innerHTML="<h3>Thanks for rating</h3>";
							
						}
						else if(rate_type=="blog")
						{
							document.getElementById("starrating").innerHTML=xmlHttp1.responseText;
							document.getElementById("starrating2").innerHTML="<h3>Thanks for rating</h3>";
							
						}
					}
					else
					{
						if(rate_type=="photo")
						{
							document.getElementById("rating").innerHTML="<div align=center><img src='images/loading.gif'> <br><br>Saving. Please wait...</div>";
						}
						else if(rate_type=="video")
						{
							document.getElementById("view_video").innerHTML="<div align=center><img src='images/loading.gif'> <br><br>Saving. Please wait...</div>";
						}
					}
					
				}

				
				

				function viewvideo(id)
				{
					//alert(fold);
				
					xmlHttp1=GetXmlHttpObject1()
					if (xmlHttp1==null)
					 {
					 alert ("Browser does not support HTTP Request")
					 return
					 }
					var url="viewvideo.php?id=" + id;
					xmlHttp1.onreadystatechange=viewvideo_req
					xmlHttp1.open("GET",url,true);
					xmlHttp1.send(null)
				}
				
				function viewvideo_req() 
				{ 
					if (xmlHttp1.readyState==4 || xmlHttp1.readyState=="complete")
					{
						document.getElementById("view_video").innerHTML=xmlHttp1.responseText;
					}
					else
					{
						document.getElementById("view_video").innerHTML="<div align=center><img src='images/loading.gif'> <br><br>Loading. Please wait...</div>";
					}
					
				}



				function changePass(p1,p2)
				{
					xmlHttp1=GetXmlHttpObject1()
					if (xmlHttp1==null)
					 {
					 alert ("Browser does not support HTTP Request")
					 return
					 }
					var url="changepass.php?p1=" + p1 + "&p2=" + p2;
					xmlHttp1.onreadystatechange=changePass_req
					xmlHttp1.open("GET",url,true);
					xmlHttp1.send(null)
				}
				
				function changePass_req() 
				{ 
					if (xmlHttp1.readyState==4 || xmlHttp1.readyState=="complete")
					{
						if(xmlHttp1.responseText=="Invalid")
						{
							alert("Incorrect password entered");
							document.getElementById("stat1").innerHTML="<b>ERROR!! Incorrect password entered</b>";
						}
						else
						{
							document.getElementById("p1").value="";
							document.getElementById("p2").value="";
							document.getElementById("p3").value="";
							document.getElementById("stat1").innerHTML="<b>Password changed successfully.</b>";
						}
					}
					else
					{
						document.getElementById("stat1").innerHTML="Saving...";
					}
					
				}

				function getfcomments(uid)
				{
					//alert(fold);
				//	txt=txt.replace(/\n/g,"<br>");
					//did=txt;
					xmlHttp1=GetXmlHttpObject1()
					if (xmlHttp1==null)
					 {
						 alert ("Browser does not support HTTP Request")
						 return
					 }
					var url="getfcomment.php?uid=" + uid;
					xmlHttp1.onreadystatechange=getfcomments_req
					xmlHttp1.open("GET",url,true);
					xmlHttp1.send(null)
				}
				
				function getfcomments_req() 
				{ 
					if (xmlHttp1.readyState==4 || xmlHttp1.readyState=="complete")
					{
						document.getElementById('fcomtag').innerHTML=xmlHttp1.responseText;
						document.getElementById('comment').value="";
						document.getElementById('code').value="";
					}
				}

				function savefriendcomment(txt,to)
				{
					xmlHttp1=GetXmlHttpObject1()
					if (xmlHttp1==null)
					 {
						 alert ("Browser does not support HTTP Request")
						 return
					 }
					var url="savefcomment.php?to=" + to + "&txt=" + txt;
					xmlHttp1.onreadystatechange=savefcomm_req
					xmlHttp1.open("GET",url,true);
					xmlHttp1.send(null)
				}
				
				function savefcomm_req() 
				{ 
					if (xmlHttp1.readyState==4 || xmlHttp1.readyState=="complete")
					{
						document.getElementById("fcomtag").innerHTML=xmlHttp1.responseText;
						getfcomments('<?=$_GET[uid]?>');
						
					}
					
				}
		/*function start() {
        // get the reference for the body
        var body = document.getElementsByTagName("fcomtag")[0];

        // creates a <table> element and a <tbody> element
        var tbl     = document.createElement("table");
        var tblBody = document.createElement("tbody");

        // creating all cells
      
            // creates a table row
            var row = document.createElement("tr");

            //for (var i = 0; i < 2; i++) {
                // Create a <td> element and a text node, make the text
                // node the contents of the <td>, and put the <td> at
                // the end of the table row
				
                var cell = document.createElement("td");
				var img=document.createElement("img");
				img.setAttribute("src", "images/male.jpg");
				img.setAttribute("width", "53");
				img.setAttribute("height", "54");
           //     var cellText = document.createTextNode("<? echo \"\"; ?>");
				cell.setAttribute("width", "65");
                cell.appendChild(img);
				row.appendChild(cell);
				
				var cell = document.createElement("td");
				var str="";
                var cellText = document.createTextNode("Name");
				cell.setAttribute("width", "514");
				cell.setAttribute("valign", "top");
                cell.appendChild(cellText);
				row.appendChild(cell);
				
				var cell = document.createElement("td");
                var cellText = document.createTextNode("Edit");
				cell.setAttribute("width", "120");
                cell.appendChild(cellText);
				row.appendChild(cell);
				
            // add the row to the end of the table body
            tblBody.appendChild(row);


        // put the <tbody> in the <table>
        tbl.appendChild(tblBody);
        // appends <table> into <body>
        body.appendChild(tbl);
        // sets the border attribute of tbl to 2;
        tbl.setAttribute("border", "0");
		tbl.setAttribute("width", "100%");
    }*/
	
	

				function checkcode(code,txt,id)
				{
					//alert(fold);
					txt=txt.replace(/\n/g,"<br>");
					did=txt;
					id2=id;
					xmlHttp1=GetXmlHttpObject1()
					if (xmlHttp1==null)
					 {
					 alert ("Browser does not support HTTP Request")
					 return
					 }
					var url="check.php?code=" + code;
					xmlHttp1.onreadystatechange=checkcode_req
					xmlHttp1.open("GET",url,true);
					xmlHttp1.send(null)
				}
				
				function checkcode_req() 
				{ 
					if (xmlHttp1.readyState==4 || xmlHttp1.readyState=="complete")
					{
						if(xmlHttp1.responseText==0)
						{
							alert("Incorrect verfication code.");
						}
						else
						{
							savefriendcomment(did,id2);
						}
					}
					
				}
				
				
				function checkcodephoto(code)
				{
					
					xmlHttp1=GetXmlHttpObject1()
					if (xmlHttp1==null)
					 {
					 alert ("Browser does not support HTTP Request")
					 return
					 }
					var url="check.php?code=" + code;
					xmlHttp1.onreadystatechange=checkcodephoto_req
					xmlHttp1.open("GET",url,true);
					xmlHttp1.send(null)
				}
				
				function checkcodephoto_req() 
				{ 
					if (xmlHttp1.readyState==4 || xmlHttp1.readyState=="complete")
					{
						if(xmlHttp1.responseText==0)
						{
							alert("Incorrect verfication code.");
							document.getElementById('image').src = 'securimage_show.php?sid=' + Math.random();
						}
						else
						{
							document.forms['frm9'].submit();
						}
						
					}
					
				}



			function savejournal(txt,prv)
				{
					//alert(fold);
					txt=txt.replace(/\n/g,"<br>");
					xmlHttp1=GetXmlHttpObject1()
					if (xmlHttp1==null)
					 {
					 alert ("Browser does not support HTTP Request")
					 return
					 }
					var url="savejournal.php?text=" + txt+"&prv="+prv;
					xmlHttp1.onreadystatechange=savejournal_req
					xmlHttp1.open("GET",url,true);
					xmlHttp1.send(null)
				}
				
				function savejournal_req() 
				{ 
					if (xmlHttp1.readyState==4 || xmlHttp1.readyState=="complete")
					{
						getwindow('diaries','0','0')
					}
					else
					{
						document.getElementById("save_diary").innerHTML="Saving...";
					}
					
				}


			function savefolder(fold,pubprv)
				{
					xmlHttp1=GetXmlHttpObject1()
					if (xmlHttp1==null)
					 {
					 alert ("Browser does not support HTTP Request")
					 return
					 }
					var url="savefolder.php?folder=" + fold+"&prv="+pubprv;
					xmlHttp1.onreadystatechange=savefolder_req
					xmlHttp1.open("GET",url,true);
					xmlHttp1.send(null)
				}
				
				function savefolder_req() 
				{ 
					if (xmlHttp1.readyState==4 || xmlHttp1.readyState=="complete")
					{
						getwindow("documents",'0','0');
					}
					else
					{
						document.getElementById("savefolder").innerHTML="Saving...";
					}
					
				}


			function saveblogcomment1(comment,id,cat)
				{
					comment=comment.replace(/\n/g,"<br>");
					id2=id;
					cat2=cat;
					xmlHttp1=GetXmlHttpObject1()
					if (xmlHttp1==null)
					 {
					 alert ("Browser does not support HTTP Request")
					 return
					 }
					var url="saveblogcomment.php?id=" + id + "&comment=" + comment;
					xmlHttp1.onreadystatechange=blogcomment1
					xmlHttp1.open("GET",url,true);
					xmlHttp1.send(null)
				}
				
				function blogcomment1() 
				{ 
					if (xmlHttp1.readyState==4 || xmlHttp1.readyState=="complete")
					{
						getblog(id2,cat2);

					}
					else
					{
						document.getElementById("savecom").innerHTML="<div align=center>Saving...</div>";
					}
					
				}


				function getblog(id,cat)
				{
					//alert("111");
				
					xmlHttp1=GetXmlHttpObject1()
					if (xmlHttp1==null)
					 {
					 alert ("Browser does not support HTTP Request")
					 return
					 }
					var url="blogs_search.php?id=" + id + "&cat=" + cat + "&flag=1";
					xmlHttp1.onreadystatechange=search_blog
					xmlHttp1.open("GET",url,true);
					xmlHttp1.send(null)
					//alert("222");
				}
				
				function search_blog() 
				{ 
					if (xmlHttp1.readyState==4 || xmlHttp1.readyState=="complete")
					{
						document.getElementById("search_blog").innerHTML=xmlHttp1.responseText;
					}
					else
					{
						document.getElementById("search_blog").innerHTML="<div align=center>Loading. Please wait...</div>";
					}
					
				}


				function saveblog(comment,title,id,cat)
				{
					title=title.replace(/\n/g,"<br>");	
					comment=comment.replace(/\n/g,"<br>");
					//alert(title);
					//alert(id);
					//alert(cat);
					id2=id;
					cat2=cat;
					xmlHttp1=GetXmlHttpObject1()
					if (xmlHttp1==null)
					 {
					 alert ("Browser does not support HTTP Request")
					 return
					 }
					var url="saveblog.php?id=" + cat + "&title=" + title + "&body="+ comment;
					xmlHttp1.onreadystatechange=blog
					xmlHttp1.open("GET",url,true);
					xmlHttp1.send(null)
					//alert("222");
				}
				
				function blog() 
				{ 
					if (xmlHttp1.readyState==4 || xmlHttp1.readyState=="complete")
					{
						getwindow("blogs",id2,cat2);
						//document.getElementById("saveblog").innerHTML=xmlHttp1.responseText;
					}
					else
					{
						document.getElementById("saveblog").innerHTML="<div align=center>Saving...</div>";
					}
					
				}


				

				function saveblogcomment(comment,id,cat)
				{
					comment=comment.replace(/\n/g,"<br>");
					//alert(comment);
					//alert(id);
					//alert(cat);
					id2=id;
					cat2=cat;
					xmlHttp1=GetXmlHttpObject1()
					if (xmlHttp1==null)
					 {
					 alert ("Browser does not support HTTP Request")
					 return
					 }
					var url="saveblogcomment.php?id=" + id + "&comment=" + comment;
					xmlHttp1.onreadystatechange=blogcomment
					xmlHttp1.open("GET",url,true);
					xmlHttp1.send(null)
					//alert("222");
				}
				
				function blogcomment() 
				{ 
					if (xmlHttp1.readyState==4 || xmlHttp1.readyState=="complete")
					{
						getwindow("blogs",id2,cat2);
						//document.getElementById("savecom").innerHTML=xmlHttp1.responseText;
					}
					else
					{
						document.getElementById("savecom").innerHTML="<div align=center>Saving...</div>";
					}
					
				}

				function getwindow(page,id,cat)
				{
					//alert("111");
				
					xmlHttp1=GetXmlHttpObject1()
					if (xmlHttp1==null)
					 {
					 alert ("Browser does not support HTTP Request")
					 return
					 }
					var url="profile_windows/" + page + ".php?id=" + id + "&cat=" + cat;
					xmlHttp1.onreadystatechange=windowcontent
					xmlHttp1.open("GET",url,true);
					xmlHttp1.send(null)
					//alert("222");
				}
				
				function windowcontent() 
				{ 
					if (xmlHttp1.readyState==4 || xmlHttp1.readyState=="complete")
					{
						document.getElementById("profile_window").innerHTML=xmlHttp1.responseText;
					}
					else
					{
						document.getElementById("profile_window").innerHTML="<div align=center>Loading. Please wait...</div>";
					}
					
				}



               function getcalender(mn)
				{
					//alert(cat);
					xmlHttp1=GetXmlHttpObject1()
					if (xmlHttp1==null)
					 {
					 alert ("Browser does not support HTTP Request")
					 return
					 }
					var url="event_reminder.php?mn=" + mn;
					xmlHttp1.onreadystatechange=stateChanged13
					xmlHttp1.open("GET",url,true);
					xmlHttp1.send(null)
				}
				
				function stateChanged13() 
				{ 
					if (xmlHttp1.readyState==4 || xmlHttp1.readyState=="complete")
					{
						document.getElementById("calid").innerHTML=xmlHttp1.responseText;
					}
					else
					{
						document.getElementById("calid").innerHTML="<div align=center>Loading. Please wait...</div>";
					}
					
				}

					
				function addAlbum(album,description)
				{
					//alert(cat);
					xmlHttp1=GetXmlHttpObject1()
					if (xmlHttp1==null)
					 {
					 alert ("Browser does not support HTTP Request")
					 return
					 }
					var url="saveAlbum.php?album=" + album + "&description="+ description;
					xmlHttp1.onreadystatechange=stateChanged12
					xmlHttp1.open("GET",url,true);
					xmlHttp1.send(null)
				}
				
				function stateChanged12() 
				{ 
					if (xmlHttp1.readyState==4 || xmlHttp1.readyState=="complete")
					{
						document.getElementById("saving").innerHTML="";
						document.getElementById("saving").value="";
						document.getElementById("panel").style.display="none";
						document.location.href="photos.php";
					}
					else
					{
						document.getElementById("saving").innerHTML="Saving Album. Please wait."	
					}
					
				}
				
				function addVideoAlbum(album,description)
				{
					//alert(cat);
					xmlHttp1=GetXmlHttpObject1()
					if (xmlHttp1==null)
					 {
					 alert ("Browser does not support HTTP Request")
					 return
					 }
					var url="saveVideoAlbum.php?album=" + album + "&description="+ description;
					xmlHttp1.onreadystatechange=stateChanged14
					xmlHttp1.open("GET",url,true);
					xmlHttp1.send(null)
				}
				
                function stateChanged14() 
				{ 
					if (xmlHttp1.readyState==4 || xmlHttp1.readyState=="complete")
					{
						document.getElementById("saving").innerHTML="";
						document.getElementById("saving").value="";
						document.getElementById("panel").style.display="none";
						document.location.href="videos.php";
					}
					else
					{
						document.getElementById("saving").innerHTML="Saving Album. Please wait."	
					}
					
				}

				function sendreq(id,comment)
				{
					//alert(cat);
					xmlHttp1=GetXmlHttpObject1()
					if (xmlHttp1==null)
					 {
					 alert ("Browser does not support HTTP Request")
					 return
					 }
					// alert(id);
					// alert(comment);
					var url="sendrequest.php?id=" + id + "&comment=" + comment;
					xmlHttp1.onreadystatechange=stateChanged11
					xmlHttp1.open("GET",url,true);
					xmlHttp1.send(null)
				}
				
				function stateChanged11() 
				{ 
					if (xmlHttp1.readyState==4 || xmlHttp1.readyState=="complete")
					{
						//alert(xmlHttp1.responseText);
						document.getElementById("reqstatus").innerHTML="";	
						document.getElementById("panel").style.display='none';
					}
					else
					{
						document.getElementById("reqstatus").innerHTML="Sending request. Please wait..."	
					}
					
				}function getinfo(id)
				{
					//alert(cat);
					xmlHttp1=GetXmlHttpObject1()
					if (xmlHttp1==null)
					 {
					 alert ("Browser does not support HTTP Request")
					 return
					 }
					 //alert(id);
					var url="getfriendinfo.php?id=" + id;
					xmlHttp1.onreadystatechange=stateChanged10
					xmlHttp1.open("GET",url,true);
					xmlHttp1.send(null)
				}
				
				function stateChanged10() 
				{ 
					if (xmlHttp1.readyState==4 || xmlHttp1.readyState=="complete")
					{
						//alert(xmlHttp1.responseText);
						document.getElementById("requestinfo").innerHTML=xmlHttp1.responseText;	
					}
					else
					{
						document.getElementById("requestinfo").innerHTML="<div align=center><img src='images/loading.gif'> <br><br>Loading. Please wait...</div>"	
					}
					
				}
				
				
				function addCategory(cat,parent)
				{
					//alert(cat);
					xmlHttp1=GetXmlHttpObject1()
					if (xmlHttp1==null)
					 {
					 alert ("Browser does not support HTTP Request")
					 return
					 }
					var url="saveCat.php?parent=" + parent + "&cat="+ cat;
					xmlHttp1.onreadystatechange=stateChanged9
					xmlHttp1.open("GET",url,true);
					xmlHttp1.send(null)
				}
				
				function stateChanged9() 
				{ 
					if (xmlHttp1.readyState==4 || xmlHttp1.readyState=="complete")
					{
						//alert(xmlHttp1.responseText);
						document.getElementById("saving").innerHTML="";
						document.getElementById("saving").value="";
						document.getElementById("panel").style.display="none";
						document.location.href="articles.php";
					}
					else
					{
						document.getElementById("saving").innerHTML="Saving Category. Please wait."	
					}
					
				}
				
				function editProf(type)
				{ 			
					did=type;
					xmlHttp1=GetXmlHttpObject1()
					if (xmlHttp1==null)
					 {
					 alert ("Browser does not support HTTP Request")
					 return
					 }
					var url="changeProfile.php?type="+ type;
					xmlHttp1.onreadystatechange=stateChanged8
					xmlHttp1.open("GET",url,true);
					xmlHttp1.send(null)
				}
				
				function stateChanged8() 
				{ 
					if (xmlHttp1.readyState==4 || xmlHttp1.readyState=="complete")
					{
						document.getElementById(did).innerHTML=xmlHttp1.responseText;
					}
					else
					{
						document.getElementById(did).innerHTML="<br><div align=center><img src='images/loading.gif'><br><br>Loading profile. Please wait...</div><br>"	
					}
					
				}
				
				
				function updateprofile(sql,type)
				{ 			
					//alert(txt);
					//alert(usr);
					//alert(sql);
					did=type;
					//alert(sql);
					xmlHttp1=GetXmlHttpObject1()
					if (xmlHttp1==null)
					 {
					 alert ("Browser does not support HTTP Request")
					 return
					 }
					// alert(value);
					var url="updateprofile.php?sql="+ sql + "&type="+type;
					xmlHttp1.onreadystatechange=stateChanged7
					xmlHttp1.open("GET",url,true);
					xmlHttp1.send(null)
					//alert ("bb");
				}
				
				function stateChanged7() 
				{ 
					if (xmlHttp1.readyState==4 || xmlHttp1.readyState=="complete")
					{
						getdata(did);
						//document.getElementById(did).innerHTML=xmlHttp1.responseText;
					}
					else
					{
						document.getElementById(did).innerHTML="<br><div align=center><img src='images/loading.gif'><br><br>Saving profile. Please wait...</div><br>"	
					}
					
				}
				
				
				function getdata(type)
				{ 			
					//alert(txt);
					//alert(usr);
					//alert(type);
					did=type;
					xmlHttp1=GetXmlHttpObject1()
					if (xmlHttp1==null)
					 {
					 alert ("Browser does not support HTTP Request")
					 return
					 }
					// alert(value);
					var url="userInfo.php?type=" + type;
					xmlHttp1.onreadystatechange=stateChanged6
					xmlHttp1.open("GET",url,true);
					xmlHttp1.send(null)
					//alert ("bb");
				}
				
				function stateChanged6() 
				{ 
					if (xmlHttp1.readyState==4 || xmlHttp1.readyState=="complete")
					{
						try
						{
							document.getElementById(did).innerHTML=xmlHttp1.responseText;
						}
						catch(e){}
					}
					else
					{
						try
						{
							document.getElementById(did).innerHTML="<br><div align=center><img src='images/loading.gif'><br><br>Loading profile. Please wait...</div><br>"	
						}
						catch(e){}
					}
					
				}
				
				
				function savetxt(txt,usr)
				{ 			
					//alert(txt);
					//alert(usr);
					xmlHttp1=GetXmlHttpObject1()
					if (xmlHttp1==null)
					 {
					 alert ("Browser does not support HTTP Request")
					 return
					 }
					// alert(value);
					var url="usertxt.php?txt=" + txt + "&usr=" + usr;
					xmlHttp1.onreadystatechange=stateChanged5
					xmlHttp1.open("GET",url,true);
					xmlHttp1.send(null)
					//alert ("bb");
				}
				
				function stateChanged5() 
				{ 
					if (xmlHttp1.readyState==4 || xmlHttp1.readyState=="complete")
					{
						document.getElementById("mytext").innerHTML="&nbsp;&nbsp;" + xmlHttp1.responseText;
						document.getElementById("btn").style.display="none";
						document.getElementById("txt").value="What are you doing right now?";
					}
				}
				
				function validateLogin(query,url)
				{ 			
					
					did=url;
					if(did=="")
					{
						did="profile.php";
					}
					xmlHttp1=GetXmlHttpObject1()
					if (xmlHttp1==null)
					 {
					 alert ("Browser does not support HTTP Request")
					 return
					 }
					// alert(value);
					var url="checklogin.php?" + query;
					xmlHttp1.onreadystatechange=stateChanged4
					xmlHttp1.open("GET",url,true);
					xmlHttp1.send(null)
					//alert ("bb");
				}
				
				function stateChanged4() 
				{ 
					if (xmlHttp1.readyState==4 || xmlHttp1.readyState=="complete")
					{
						if(xmlHttp1.responseText!="No")
						{
							document.location.href=did;
							
						}
						else
						{
							document.getElementById("stats").style.top="-30px";
							document.getElementById("stats").style.display="none";
							//document.getElementById("message2").innerHTML="<br><img src='images/cross.jpg'>&nbsp;Incorrect login details.<br><br>";
							alert("Incorrect login ID or password");
						}
						
					}
					else
					{
						//document.getElementById("message2").style.display="block";	
						//document.getElementById("message2").innerHTML="<br><img src='images/loading.gif'>&nbsp;Validating login. Please wait...<br><br>";
					}
				}
				
				
				
				
				function newPass(email)
				{ 					
					xmlHttp1=GetXmlHttpObject1()
					if (xmlHttp1==null)
					 {
					 alert ("Browser does not support HTTP Request")
					 return
					 }
					// alert(value);
					var url="newpass.php?email=" + email;
					xmlHttp1.onreadystatechange=stateChanged3
					xmlHttp1.open("GET",url,true);
					xmlHttp1.send(null)
					//alert ("bb");
				}
				
				function stateChanged3() 
				{ 
					if (xmlHttp1.readyState==4 || xmlHttp1.readyState=="complete")
					{
						document.getElementById("d3").innerHTML=xmlHttp1.responseText;
					}
					else
					{
						document.getElementById("d3").innerHTML="<br><br><br><br><br><br><br><img src='images/loading.gif'><br>&nbsp;<br>Generating Password. Please wait... ";
					}
				}
				
				
				
				function saveUser(value)
				{ 					
					xmlHttp1=GetXmlHttpObject1()
					if (xmlHttp1==null)
					 {
					 alert ("Browser does not support HTTP Request")
					 return
					 }
					// alert(value);
					var url="userreg.php?" + value;
					xmlHttp1.onreadystatechange=stateChanged2
					xmlHttp1.open("GET",url,true);
					xmlHttp1.send(null)
					//alert ("bb");
				}
				
				function stateChanged2() 
				{ 
					if (xmlHttp1.readyState==4 || xmlHttp1.readyState=="complete")
					{
						document.getElementById("d2").innerHTML=xmlHttp1.responseText;
					}
					else
					{
						document.getElementById("d2").innerHTML="<br><br><br><br><br><br><br><img src='images/loading.gif'><br>&nbsp;<br>Registering user. Please wait... ";
					}
				}
				
				function verify(mail)
				{ 					
					xmlHttp1=GetXmlHttpObject1()
					if (xmlHttp1==null)
					 {
					 alert ("Browser does not support HTTP Request")
					 return
					 }
					var url="verify.php?email=" + mail;
					xmlHttp1.onreadystatechange=stateChanged1
					xmlHttp1.open("GET",url,true);
					xmlHttp1.send(null)
					//alert ("bb");
					window.setTimeout("getAd()",5000);
				
				}
				
				
				function stateChanged1() 
				{ 
				
					if (xmlHttp1.readyState==4 || xmlHttp1.readyState=="complete")
					{
						//alert ("ccc");
						var stat=xmlHttp1.responseText;
						
						if(stat=="False")
						{
							document.getElementById("stat2").innerHTML="";
							document.getElementById("v2").innerHTML="<br><font color=green>Valid email address.</font";
						}
						else
						{
							document.getElementById("stat2").innerHTML="<img src=images/cross.jpg width=16 height=16>";
							document.getElementById("v2").innerHTML="<br><font color=red>This email address already been registered</font>";
							document.form1.email.value="";
							document.form1.email.focus();
						}
						
					}
					else
					{
						document.getElementById("v2").innerHTML="<br>Verifying email address. Please wait...";
					}
				}
				
				function redflag(id,type)
				{
					//alert(fold);
					rate_type=type;
					did=id;
					xmlHttp1=GetXmlHttpObject1()
					if (xmlHttp1==null)
					 {
					 alert ("Browser does not support HTTP Request")
					 return
					 }
					var url="redflag.php?id=" + id + "&type=" + type;
					xmlHttp1.onreadystatechange=red_req
					xmlHttp1.open("GET",url,true);
					xmlHttp1.send(null)
				}
				
				function red_req() 
				{ 
					if (xmlHttp1.readyState==4 || xmlHttp1.readyState=="complete")
					{
						document.getElementById("flagged").innerHTML=xmlHttp1.responseText;
					}
				}
				
				function GetXmlHttpObject1()
				{
				var xmlHttp1=null;
				try
				 {
				 // Firefox, Opera 8.0+, Safari
				 xmlHttp1=new XMLHttpRequest();
				 }
				catch (e)
				 {
				 //Internet Explorer
				 try
				  {
				  xmlHttp1=new ActiveXObject("Msxml2.XMLHTTP");
				  }
				 catch (e)
				  {
				  xmlHttp1=new ActiveXObject("Microsoft.XMLHTTP");
				  }
				 }
				return xmlHttp1;
				}
				
