// JavaScript Document
var xmlHttp
var t=0
var skip1
var answer1
var c=0
var tpath='http://www.beatbuggy.com/';
var j=0;
var no;
var starid;
var userid;

function addasfan(path1,fid,msg)
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	}
    //netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
	var url=tpath+"addasfan_ajax.php"
	url=url+"?touid="+fid
	url=url+"&msg="+msg
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=addasfanDone
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function addasfanDone() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("mypageerror").innerHTML=xmlHttp.responseText
	} 
}

function addasfan1(fid,msg)
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	}
	userid=fid;
    //netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
	var url=tpath+"addasfan_ajax.php"
	url=url+"?touid="+fid
	url=url+"&msg="+msg
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=addasfanDone1
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function addasfanDone1() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("user_msg"+userid).innerHTML=xmlHttp.responseText
	} 
}

function remove_fan(path1,fid)
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	userid=fid;
	var url=tpath+"unfan.php"
	url=url+"?userid="+fid
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=remove_fanDone
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function remove_fanDone() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("mypageerror").innerHTML=xmlHttp.responseText
	} 
}

function remove_fan1(fid)
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	userid=fid;
	var url=tpath+"unfan.php"
	url=url+"?userid="+fid
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=remove_fanDone1
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function remove_fanDone1() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("user_msg"+userid).innerHTML=xmlHttp.responseText
	} 
}

function remove_fan2(path1,fid)
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	var url=tpath+"unfan2.php"
	url=url+"?userid="+fid
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=remove_fan2Done
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function remove_fan2Done() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("mypageerror").innerHTML=xmlHttp.responseText
	} 
}

function add_photocomment(aid,cid,msg)
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	var url=tpath+"save_pcomment.php"
	url=url+"?aid="+aid
	url=url+"&cid="+cid
	url=url+"&msg="+msg
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=add_Done
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function add_Done() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
	     var con = xmlHttp.responseText;
		 var arr = con.split("{}");
		 var el = document.createElement('div');
		 var e2 = document.getElementById('comment_area');
		  //el.style.border="1px solid";
		 var childCount = e2.firstChild;
		  ++j;		  
		  el.innerHTML = arr[1];
		  el.id="comment_"+arr[0];
		  el.style.marginBottom="5";
		  el.style.marginTop="1";
		  el.className="comment_box";
		  if(childCount == null)
		  {
			  Dom.add(el, 'comment_area');
		  }
		  else
		  {
			  if(childCount != null)
			  {
				Dom.addChild(el, 'comment_area',childCount);  
			  }			  
		  } 
		  colorFade(el.id,'background','FFFFFF','EFEFEF',50,20,'add')
		  if(document.getElementById("total_commennt_label").innerHTML=="No")
		  {
			  document.getElementById("total_commennt_label").innerHTML="1";
		  }
		  else
		  {
			  document.getElementById("total_commennt_label").innerHTML=parseFloat(document.getElementById("total_commennt_label").innerHTML)+1;
		  }
		  document.getElementById("comment_process").style.display="none";
		  document.getElementById("comment_result").style.display="block";
	} 
}

function add_photoreplycomment(aid,cid,ref,msg)
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	var url=tpath+"save_reply_pcomment.php"
	url=url+"?aid="+aid
	url=url+"&cid="+cid
	url=url+"&ref="+ref
	url=url+"&msg="+msg
	url=url+"&sid="+Math.random()
	var e1=document.getElementById("reply_input_sub_"+cid);
	e1.style.display="none";
	xmlHttp.onreadystatechange=add_photoreplycomment_Done
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function add_photoreplycomment_Done() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		 var con = xmlHttp.responseText;
		 var arr = con.split("{}");
		 if(parseFloat(arr[3])==1)
		 {
			 var e2 = document.createElement('div');
			 e2.innerHTML="<p class=small>Comment replies (1)</p>";
			 e2.id="comment_reply_total_"+arr[0];
			 e2.style.marginBottom="5";
			 e2.style.marginLeft="100";
			 e2.style.marginTop="5";
			 e2.style.width="430";
			 e2.className="comment_thread_header";		
			 Dom.add(e2, 'comment_'+arr[0]);
		 }
		  var el = document.createElement('div');
		  ++j;
		  el.innerHTML = arr[5];
		  el.id="comment_"+arr[2];
		  el.style.width="400";
		  el.style.marginBottom="5";
		  if(parseFloat(arr[3])==1)
		  {
			el.style.marginLeft="120";
		  	if(arr[4]=="firefox")
			{
				el.style.marginTop="55";
			}
			else
			{
				el.style.marginTop="5"; 
			}
		  }
		  else
		  {
			el.style.marginLeft="100";
			el.style.marginTop="5";  
			el.className="comment_box";
		  }
		  Dom.add(el, 'comment_'+arr[0]);
		  colorFade(el.id,'background','FFFFFF','EFEFEF',50,20,'add')
		  var e2=document.getElementById('comment_reply_total_'+arr[0]);
		  e2.innerHTML="<p class=small>Comment replies ("+arr[3]+")</p>";
		  //e2.innerHTML="<p class=small>Comment replies ("+arr[3]+")"+arr[0]+"</p>";
		  if(parseFloat(arr[3])==1)
		  {
			  var el = document.getElementById('reply_link_'+arr[1]);
			  el.style.display="none";
			  
			  var el = document.getElementById('delete_link_'+arr[1]);
			  el.style.display="none";
		  }
		  var el = document.getElementById('reply_input_sub_'+arr[2]);
		  el.style.display="none";
		  
		  if(document.getElementById("total_commennt_label").innerHTML=="No")
		  {
			  document.getElementById("total_commennt_label").innerHTML="1";
		  }
		  else
		  {
			  document.getElementById("total_commennt_label").innerHTML=parseFloat(document.getElementById("total_commennt_label").innerHTML)+1;
		  }
		  
		 /* if(parseFloat(arr[3])==1)
		  {
			 var e2 = document.createElement('div');
			 e2.innerHTML=arr[6];
			 e2.id="comment_reply_total_"+arr[0];
			 e2.style.marginBottom="5";
			 e2.style.marginLeft="100";
			 e2.style.marginTop="5";
			 e2.style.width="400";
			 e2.style.height="30";
			 e2.className="comment_box";		
			 Dom.add(e2, 'comment_'+arr[0]);
		  }*/
	} 
}

function update_photocomment(aid,msg)
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	}
	var url=tpath+"update_pcomment.php"
	url=url+"?aid="+aid
	url=url+"&msg="+msg	
	url=url+"&sid="+Math.random()
	var e1=document.getElementById("comment_upate_"+aid).style.display="block";
	ct=setTimeout("timedCount2("+aid+")",1500);
	xmlHttp.onreadystatechange=update_photocomment_Done
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function update_photocomment_Done() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
	     var con = xmlHttp.responseText;
		 var arr = con.split("{}");
		 var e1=document.getElementById("reply_input_"+arr[0]).style.display="none";
		 var e1=document.getElementById("comment_div_detail_"+arr[0]).style.display="block";
		 var e1=document.getElementById("comment_text_"+arr[0]).innerHTML=arr[1];		  
		 //colorFade("comment_div_detail_"+arr[0],'background','FFFFFF','EFEFEF',50,20,'add');
		 colorFade("comment_"+arr[0],'background','FFFFFF','EFEFEF',50,30,'add');		 
	} 
}

function delete_palbum(aid)
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	var url=tpath+"delete_palbum.php"
	url=url+"?aid="+aid
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=deletepalbum_ajax_Done
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function deletepalbum_ajax_Done() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		//colorFade("comment_"+xmlHttp.responseText,'background','CCCCCC','FFCACA',30,30,'delete')
	} 
}

function delete_starphoto(aid)
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	var url=tpath+"deletestar_photo.php"
	url=url+"?aid="+aid
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=delete_starphotoDone
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function delete_starphotoDone() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		//colorFade("comment_"+xmlHttp.responseText,'background','CCCCCC','FFCACA',30,30,'delete')
	} 
}

function delete_valbum(aid)
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	var url=tpath+"delete_valbum.php"
	url=url+"?aid="+aid
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=deletevalbum_ajax_Done
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function deletevalbum_ajax_Done() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		//colorFade("comment_"+xmlHttp.responseText,'background','CCCCCC','FFCACA',30,30,'delete')
	} 
}

function deleteComment_ajax(aid)
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	var url=tpath+"delete_pcomment.php"
	url=url+"?aid="+aid
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=deleteComment_ajax_Done
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function deleteComment_ajax_Done() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		var con = xmlHttp.responseText;
		var arr = con.split("{}");
		if(parseFloat(arr[1])==0)
		{
			colorFade("comment_"+arr[0],'background','CCCCCC','FFCACA',30,30,'delete')
		}
		else
		{
			if(parseFloat(arr[2])==0)
			{
				colorFade("comment_"+arr[0],'background','CCCCCC','FFCACA',30,30,'delete')
				var el = document.getElementById("comment_reply_total_"+arr[1]);
			 	el.parentNode.removeChild(el);
			}
			else
			{
				var el = document.getElementById("comment_reply_total_"+arr[1]);
				el.innerHTML="<p class=small>Comment replies ("+arr[2]+")</p>";
				colorFade("comment_"+arr[0],'background','CCCCCC','FFCACA',30,30,'delete')
			}
		}
		if(document.getElementById("total_commennt_label").innerHTML=="1")
		{
			  document.getElementById("total_commennt_label").innerHTML="No";
		}
		else
		{
			  document.getElementById("total_commennt_label").innerHTML=parseFloat(document.getElementById("total_commennt_label").innerHTML)-1;
		}
	} 
}

function delete_per_tag(aid,no)
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	no1=no;
	var url=tpath+"delete_per_tag.php"
	url=url+"?aid="+aid
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=delete_per_tag_Done
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function delete_per_tag_Done() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		var con = xmlHttp.responseText;
		//colorFade("album"+no,'background','CCCCCC','FFCACA',30,30,'delete');
		document.getElementById("album"+no1).style.display="none";
	} 
}

function delete_module(aid,no)
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	no1=no;
	var url=tpath+"delete_module.php"
	url=url+"?aid="+aid
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=delete_module_Done
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function delete_module_Done() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		var con = xmlHttp.responseText;
		//colorFade("album"+no,'background','CCCCCC','FFCACA',30,30,'delete');
		document.getElementById("module"+no1).innerHTML = '';
	} 
}

function song_played(fid)
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	}
	var url=tpath+"songplay_ajax.php"
	url=url+"?touid="+fid
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=song_playedDone
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function song_playedDone()
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{
		//document.getElementById("mypageerror").innerHTML=xmlHttp.responseText
	}
}

function remove_photo(aid)
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	var url=tpath+"remove_photo.php"
	url=url+"?aid="+aid
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=remove_photoDone
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function remove_photoDone() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		//document.getElementById("mypageerror").innerHTML=xmlHttp.responseText
	} 
}

function remove_video(aid)
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	var url=tpath+"remove_video.php"
	url=url+"?aid="+aid
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=remove_videoDone
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function remove_videoDone() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		//document.getElementById("mypageerror").innerHTML=xmlHttp.responseText
	} 
}

function like_photo(aid)
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	var url=tpath+"add_photo.php"
	url=url+"?aid="+aid
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=like_photoDone
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function like_photoDone() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		//document.getElementById("mypageerror").innerHTML=xmlHttp.responseText
	} 
}

function like_video(aid)
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	var url=tpath+"add_video.php"
	url=url+"?aid="+aid
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=like_videoDone
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function like_videoDone() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		//document.getElementById("mypageerror").innerHTML=xmlHttp.responseText
	} 
}

function comment_send(uid,msg)
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	var url=tpath+"friend_find_comment_ajax.php"
	url=url+"?uid="+uid
	url=url+"&msg="+msg
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=comment_sendDone
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function comment_sendDone() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("add_comment_loading").style.display="none";
		document.sendcomment.userid.value=0;
		document.sendcomment.comment.value='Type your comment...';
		document.sendcomment.comment.style.color='#999';
		document.sendcomment.comment.style.backgroundColor='#F3F3F3';
		var subobj2=document.getElementById("comment_success");
		subobj2.style.display="block";
		subobj2.style.top=((75*(document.sendcomment.uno.value-1))+22)+"px";
		overlayclose('send_comment');		
	} 
}

function album_create_ajax(msg)
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return	
	} 
	var url=tpath+"create_photoalbum.php"
	url=url+"?msg="+msg
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=album_createDone
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function album_createDone() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{
		toggleLayer('create_cat');
	} 
}

function album_edit_ajax(aid,msg)
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	var url=tpath+"edit_photoalbum.php"
	url=url+"?msg="+msg
	url=url+"&aid="+aid
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=album_editDone
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function album_editDone() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{
		//
	} 
}

function videoalbum_edit(aid,msg)
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	var url=tpath+"edit_videoalbum.php"
	url=url+"?msg="+msg
	url=url+"&aid="+aid
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=videoalbum_editDone
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function videoalbum_editDone() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{
		//
	} 
}

function pref_send(uid,cid)
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	}
	var epi=0;
	if(cid==true)
	{
		epi=1;	
	}
	var url=tpath+"edit_pref_save_ajax.php"
	url=url+"?uid="+uid
	url=url+"&epi="+epi
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=pref_sendDone
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function pref_sendDone() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("edit_pref_loading").style.display="none";
		document.editpref.userid.value=0;
		var subobj2=document.getElementById("pref_success");
		subobj2.style.display="block";
		subobj2.style.top=((75*(document.editpref.uno.value-1))+22)+"px";
		document.getElementById("savepref").src="images/btn_save_changes.gif";
		overlayclose('edit_pref');
	} 
}

function editpref_send(uid)
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	var url=tpath+"get_pref_ajax.php"
	url=url+"?uid="+uid
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=editpref_sendDone
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function editpref_sendDone() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		if(xmlHttp.responseText==1)
		{
			document.editpref.ep.checked=true;
		}
		else
		{
			document.editpref.ep.checked=false;
		}
		document.getElementById("edit_pref_loading").style.display="none";
		document.getElementById("showpref").style.display="block";
	} 
}

function addtoplaylist(fid,ltype)
{
	xmlHttp=GetXmlHttpObject() 
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	}
	if(ltype==0)
	{
		var subobj=document.getElementById("atp");
		subobj.innerHTML="Remove from Playlist";
	}
	else
	{
		var subobj=document.getElementById("atf");
		subobj.innerHTML="Remove Favorite";
	}
	subobj.onclick = function() { removeplaylist(fid,ltype);return false; };
	var url=tpath+"addtoplaylist_ajax.php"
	url=url+"?touid="+fid
	url=url+"&ltype="+ltype
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=addtoplaylistDone
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

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

function addtoplaylist1(fid,ltype)
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	}	
	var url=tpath+"addtoplaylist_ajax.php"
	url=url+"?touid="+fid
	url=url+"&ltype="+ltype
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=addtoplaylistDone1
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function addtoplaylistDone1() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("mypageerror").innerHTML=xmlHttp.responseText
	} 
}

function add_favorite_beat(fid,ltype)
{
	xmlHttp=GetXmlHttpObject() 
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	}
	var url=tpath+"addtoplaylist_ajax.php"
	url=url+"?touid="+fid
	url=url+"&ltype="+ltype
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=add_favorite_beatDone
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function add_favorite_beatDone() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		callFeed();
	} 
}

function remove_beat_favorite(fid,ltype)
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	var url=tpath+"removefrom_playlist.php"
	url=url+"?touid="+fid
	url=url+"&ltype="+ltype
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=remove_beat_favoriteDone
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function remove_beat_favoriteDone() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
	} 
}

function removeplaylist(fid,ltype)
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	if(ltype==0)
	{
		var subobj=document.getElementById("atp");
		subobj.innerHTML="Add To Playlist";
	}
	else
	{
		var subobj=document.getElementById("atf");
		subobj.innerHTML="Add To Favorite";
	}
	subobj.onclick = function() { addtoplaylist(fid,ltype);return false; };
	var url=tpath+"removefrom_playlist.php"
	url=url+"?touid="+fid
	url=url+"&ltype="+ltype
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=removeplaylistDone
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function removeplaylistDone() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("mypageerror").innerHTML=xmlHttp.responseText
	} 
}

function save_review(no,rid,identical,offensive,specific,meaningful,review_word,featured)
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	c=no;
	var url=tpath+"review.php"
	url=url+"?rateid="+rid
	url=url+"&identical="+identical
	url=url+"&offensive="+offensive
	url=url+"&specific="+specific
	url=url+"&meaningful="+meaningful
	url=url+"&review_word="+review_word
	url=url+"&featured="+featured
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=reviewDone
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function reviewDone() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		overlayclose('review_div'+c)
		document.getElementById("review_link").innerHTML=xmlHttp.responseText
	} 
}

function addtoprofile(fid)
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	var url=tpath+"addtoprofile_ajax.php"
	url=url+"?touid="+fid
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=addtoprofileDone
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function addtoprofileDone() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("mypageerror").innerHTML=xmlHttp.responseText
	} 
}


/*function loadsubgener(str)

{ 

	xmlHttp=GetXmlHttpObject()

	if (xmlHttp==null)

	{

	alert ("Browser does not support HTTP Request")

	return

	} 

	var url="loadsubgener.php"

	url=url+"?q="+str

	url=url+"&sid="+Math.random()

	xmlHttp.onreadystatechange=subgenerChanged 

	xmlHttp.open("GET",url,true)

	xmlHttp.send(null)

}

function subgenerChanged() 

{ 

	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")

	{ 

		document.getElementById("loadsubgener").innerHTML=xmlHttp.responseText 

	} 

} */

function save_qcomment(str,comment)
{ 
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	}
	var url=tpath+"save_comment.php"
	url=url+"?qid="+str
	url=url+"&comment="+comment
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=save_commentChanged 
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function save_commentChanged() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		parent.window.frames["ifrm1"].location.href = "quiz_comments.php?id="+xmlHttp.responseText;
//		document.getElementById("loadsubgener").innerHTML=xmlHttp.responseText 
	} 
}

function save_pcomment(str,comment)
{ 
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	}
	var url=tpath+"save_photocomment.php"
	url=url+"?qid="+str
	url=url+"&comment="+comment
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=save_pcommentChanged 
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function save_pcommentChanged() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
//		load_photo(xmlHttp.responseText);
		parent.window.frames["myframe"].location.href = "photo_comments.php?id="+xmlHttp.responseText;
//		document.getElementById("loadsubgener").innerHTML=xmlHttp.responseText 
	} 
}

function save_vcomment(str,comment)
{ 
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	}
	var url=tpath+"save_videocomment.php"
	url=url+"?qid="+str
	url=url+"&comment="+comment
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=save_vcommentChanged 
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function save_vcommentChanged() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
//		load_photo(xmlHttp.responseText);
		parent.window.frames["myframe"].location.href = "video_comments.php?id="+xmlHttp.responseText;
//		document.getElementById("loadsubgener").innerHTML=xmlHttp.responseText 
	} 
}

function load_photo(str)
{ 
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	}
	//alert(parent.document.getElementById("finalphoto").src);
	var url=tpath+"load_starphoto.php"
	url=url+"?qid="+str
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=load_photoChanged 
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function load_photoChanged() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		var now = new Date();
		fnm=xmlHttp.responseText.split(";");
		parent.document.getElementById("finalphoto").src=fnm[0]+"?"+now.getTime();
		//alert(parent.document.getElementById("finalphoto").src);
		parent.document.getElementById("finalphoto").width=fnm[1];
		parent.document.getElementById("finalphoto").height=fnm[2];
		parent.document.getElementById("photo_name").innerHTML="";
//		document.getElementById("loadsubgener").innerHTML=xmlHttp.responseText 
	} 
}

function delete_comment(str)
{ 
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	}
	var url=tpath+"delete_qcomment.php"
	url=url+"?cid="+str
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=delete_commentChanged 
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function delete_commentChanged() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		//alert(xmlHttp.responseText);
		parent.window.frames["ifrm1"].location.href = "quiz_comments.php?id="+xmlHttp.responseText;
//		document.getElementById("loadsubgener").innerHTML=xmlHttp.responseText 
	} 
}

function delete_pcomment(str)
{ 
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	}
	var url=tpath+"delete_photocomment.php"
	url=url+"?cid="+str
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=delete_photocommentChanged 
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function delete_photocommentChanged() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		//alert(xmlHttp.responseText);
		parent.window.frames["myframe"].location.href = "photo_comments.php?id="+xmlHttp.responseText;
	} 
}

function delete_vcomment(str)
{ 
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	}
	var url=tpath+"delete_videocomment.php"
	url=url+"?cid="+str
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=delete_videocommentChanged 
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function delete_videocommentChanged() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		//alert(xmlHttp.responseText);
		parent.window.frames["myframe"].location.href = "video_comments.php?id="+xmlHttp.responseText;
	} 
}

function save_skip(qid,skip,answer,answer_true)
{ 
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	}
	skip1=skip;
	answer1=answer;
	var url=tpath+"save_skip_quiz.php"
	url=url+"?qid="+qid
	url=url+"&skip="+skip
	url=url+"&answer="+answer
	url=url+"&answer_true="+answer_true
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=save_skipChanged 
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function save_skipChanged() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		str=xmlHttp.responseText;
		s=str.split(",");
		if(s[2]==0)
		{
			if(skip1==1)
			{
				parent.window.frames["myframe"].location.href = "quiz_status.php?id="+s[0]+"&skip=1";
			}
			else
			{
				parent.window.frames["myframe"].location.href = "quiz_status.php?id="+s[0]+"&answer="+answer1;
			}
			parent.window.frames["ifrm"].location.href = "quiz_loadquestion.php?id="+s[1];
			//parent.window.frames["ifrm1"].location.href = "quiz_comments.php?id="+s[1];
			//parent.document.getElementById("tr_comment").display="none";
			parent.document.getElementById("tr_comment").style.display="none";
			parent.window.frames["ifrm1"].location.href = "quiz_comments.php?id="+s[1];
			parent.window.frames["myframe1"].location.href = "quiz_rank.php";
			//parent.window.frames["ifrm1"].style= "display:none";
		}
		else
		{
			if(skip1==1)
			{
				parent.window.frames["myframe"].location.href = "quiz_status.php?id="+s[0]+"&skip=1";
			}
			else
			{
				parent.window.frames["myframe"].location.href = "quiz_status.php?id="+s[0]+"&answer="+answer1;
			}
			parent.window.frames["ifrm"].location.href = "quiz_loadquestion.php?id="+s[1];
			parent.window.frames["ifrm1"].location.href = "quiz_comments.php?id="+s[1];
			parent.window.frames["myframe1"].location.href = "quiz_rank.php";
		}
        window.parent.callfeed();
	} 
}

function emailcheck(str,str1)
{ 
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	if (str==""){
	//	document.getElementById("checkemail").innerHTML="Enter Email ID"
	//	document.reg.email.focus()
		return false;
	}
	n=str.indexOf('.');
	n1=str.indexOf('@');
	if(!((n>0) && (n1>0)))
	{
		document.getElementById("checkemail").innerHTML="Email is not ok"
		document.f1.email.focus()
		return false;
	}
	var url="checkemail.php"
	url=url+"?q="+str
	url=url+"&q1="+str1
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=stateChanged2
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function stateChanged2() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("checkemail").innerHTML=xmlHttp.responseText 		
		if (xmlHttp.responseText!=""){
			document.f1.email.value=""
			document.f1.email.focus()
		} 
	} 
}

function checknname(str)
{ 
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	var url="checknname.php"
	url=url+"?q="+str
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=checknickname
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function checknickname() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("checknname").innerHTML=xmlHttp.responseText 
		if(xmlHttp.responseText!="")
		{
			document.f1.uname.value=document.f1.uname.value
			document.f1.uname.focus()
		} 
	} 
} 

function set_avtar(str)
{ 
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	var url="setavatar.php"
	url=url+"?q="+str
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=setavtar
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function setavtar() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		return
	} 
} 

function set_template(str)
{ 
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	var url="settemplate.php"
	url=url+"?q="+str
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=settemplate
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function settemplate() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		/*alert(xmlHttp.responseText);
		alert(parent.document.getElementById("load_skin").innerHTML); */
		//parent.document.getElementById("load_skin").innerHTML=xmlHttp.responseText;
	} 
} 

function addasfriend(path1,fid,msg)
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	}
    //netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
	var url=tpath+"addasfriend_ajax.php"
	url=url+"?touid="+fid
	url=url+"&msg="+msg
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=addasfriendDone
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function addasfriendDone() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("mypageerror").innerHTML=xmlHttp.responseText
	} 
}

function bogaus_profile(fid)
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	var url=tpath+"bogas_profile.php"
	url=url+"?userid="+fid
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=bogaus_profileDone
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function bogaus_profileDone() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("mypageerror").innerHTML=xmlHttp.responseText
	} 
}

function remove_friend(path1,fid)
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	var url=tpath+"unfriend.php"
	url=url+"?userid="+fid
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=remove_friendDone
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function remove_friendDone() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("mypageerror").innerHTML=xmlHttp.responseText
	} 
}

function remove_favourite(fid)
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	var url=tpath+"unstar.php"
	url=url+"?id="+fid
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=remove_starDone
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function remove_starDone() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("star_msg").innerHTML=xmlHttp.responseText
	} 
}

function remove_favourite1(fid)
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	starid=fid;
	var url=tpath+"unstar.php"
	url=url+"?id="+fid
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=remove_starDone1
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function remove_starDone1() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		if(xmlHttp.responseText!="")
		{
			document.getElementById("star_msg"+starid).style.display="block";
			document.getElementById("star_msg"+starid).innerHTML=document.getElementById("star_msg"+starid).innerHTML+xmlHttp.responseText
		}
	} 
}

function add_favourite(fid)
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	var url=tpath+"addstar.php"
	url=url+"?id="+fid
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=add_starDone
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function add_starDone() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("star_msg").innerHTML=xmlHttp.responseText
        callFeed();
	} 
}

function add_favourite1(fid)
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	starid=fid;
	var url=tpath+"addstar.php"
	url=url+"?id="+fid
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=add_starDone1
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function add_starDone1() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		if(xmlHttp.responseText!="")
		{
			document.getElementById("star_msg"+starid).style.display="block";
			document.getElementById("star_msg"+starid).innerHTML=document.getElementById("star_msg"+starid).innerHTML+xmlHttp.responseText
		}
	} 
}

function replyscrap(from1,to1,msg,n)
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	t=n;
	var url=tpath+"save_msg.php"
	url=url+"?fid="+from1
	url=url+"&puid="+to1
	url=url+"&scrap="+msg
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=replySended
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function replySended() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("p"+t).innerHTML=xmlHttp.responseText 
		document.getElementById("Reply"+t).disabled=false;
	} 
} 

function bogaus_question(fid)
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	var url="bogas_question.php"
	url=url+"?quizid="+fid
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=bogaus_questionDone
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function bogaus_questionDone() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("quiz_message").innerHTML="<br>"+xmlHttp.responseText
	} 
}

function friends_find(fid)
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	var url="friend_find_ajax.php"
	url=url+"?q="+fid
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=friends_findDone
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function friends_findDone() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("subcontent").innerHTML=xmlHttp.responseText
	} 
}

function tags_ajax_find(fid)
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	var url="tags_find_ajax.php"
	url=url+"?q="+fid
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=tags_findDone
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function tags_findDone() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("subcontent").innerHTML=xmlHttp.responseText
	} 
}

function rotatePhoto(rtype,aid)
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	}	
	var url="rotate_image.php"
	url=url+"?rtype="+rtype
	url=url+"&aid="+aid
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=rotatephotoDone1
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function rotatephotoDone1() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		var now = new Date();
		str=xmlHttp.responseText;
		s=str.split(",")
//		document.getElementById("loadimg").innerHTML="";
		document.getElementById("loadimg").src=s[0]+"?"+now.getTime();
		document.getElementById("loadimg").height=s[1];
		document.getElementById("loadimg").width=s[2];
	} 
}

function GetXmlHttpObject()
{ 
	var objXMLHttp=null
	if (window.XMLHttpRequest)
	{
		objXMLHttp=new XMLHttpRequest()
	}
	else if (window.ActiveXObject)
	{
		objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
	}
	return objXMLHttp
}