	function response()
	{
		if(XMLHttp.readyState==4 || XMLHttp.readyState=="complete")
		{
			  var response = XMLHttp.responseText;			  
		}
	}
	
	function postComments(mid,type){
		 //alert(document.frm.comments.value);
		 if(document.frm.comments.value!="")
		 {
			//alert('dddddddd');
			getObject();
			document.getElementById("commentsform").style.display="none";
			
			//document.getElementById("cmntstr").style.display="block";
			document.getElementById("thnx").style.display="block";
			
			//document.getElementById("spcs").style.display="none";
			XMLHttp.open('post', 'comments.php?comments='+document.frm.comments.value+'&mid='+mid+'&mt='+type);
			//alert('comments.php?comments='+document.frm.comments.value+'&mid='+mid+'&mt='+type);
			XMLHttp.onreadystatechange = response;
			XMLHttp.send(null);
			document.getElementById("comments").value="";
		 }
		 else
		 {// set html error output for a div id
			 alert("comments empty");
		 }
	}
	
	function postUserComments(username,type){
		 //alert(document.frm.comments.value);
		 if(document.frm.comments.value!="")
		 {
			//alert('dddddddd');
			getObject();			
			XMLHttp.open('post', 'comments.php?subject='+document.frm.subject.value+'&comments='+document.frm.comments.value+'&mid='+username+'&mt='+type);
			//alert('comments.php?subject='+document.frm.subject.value+'&comments='+document.frm.comments.value+'&mid='+username+'&mt='+type);
			XMLHttp.onreadystatechange = response;
			XMLHttp.send(null);
			document.getElementById("comments").value="";
			document.getElementById("subject").value="";
			document.getElementById("form").style.display="none";
			document.getElementById("thnx").style.display="block";
			
		 }
		 else
		 {
			 alert("comments empty");
		 }
	}
 function postComments1(mid,type){
	 if(document.frm.comments.value!="")
	 {
		getObject();
		document.getElementById("form2").style.display="none";
		document.getElementById("cmntstr").style.display="block";
		document.getElementById("thnxC").style.display="block";
		document.getElementById("spcs").style.display="none";
		XMLHttp.open('post', 'comments.php?comments='+document.frm.comments.value+'&mid='+mid+'&mt='+type);
		XMLHttp.onreadystatechange = response;
		XMLHttp.send(null);
	 }
	 else
	 {
		 alert("comments empty");
	 }
	}
	
 function acceptComments(id)
	{
		getObject();
		document.getElementById("accepted").style.display="block";
		XMLHttp.open('post','commentAction.php?act=acc&cid='+id);
		XMLHttp.onreadystatechange = response;
		XMLHttp.send(null);
		alert('commentAction.php?act=acc&cid='+id);
	}
	
  function declineComments()
	{
		getObject();
		document.getElementById("declined").style.display="block";
		XMLHttp.open('post','commentAction.php?act=dec');
		XMLHttp.onreadystatechange = response;
		XMLHttp.send(null);
	}
	
	function addToFavorites(mid,mt)
	{
		getObject();
		//document.getElementById("declined").style.display="block";
		XMLHttp.open('post','add_to_favorites.php?mid='+mid+'&mt='+mt);
		XMLHttp.onreadystatechange = response;
		XMLHttp.send(null);
		//alert('add_to_favorites.php?mid='+mid+'&mt='+mt);
	}
	
 function addComments()
 {
	document.getElementById("commentsform").style.display="block";
	document.getElementById("thnx").style.display="none";
	document.getElementById("addcomments").style.display="none";
 }
 
 function addComments1()
 {
	document.getElementById("form2").style.display="block";
	document.getElementById("cmntstr").style.display="none";
 }
 
 function validate_upload_form1()
 { 
	 document.frm.private.selected=false;
 }
 
 function confirm_delete(mid,mt)
 {
	 value=confirm("Are you sure you want to delete?");
	 if(value==true)
	 {
	 	window.location="removemedia.php?mid="+mid+"&mt="+mt;
		//alert("removemedia.php?mid="+mid+"&mt="+mt);
	 }
 }
 
 function markFeatured(uid,id,type)
 {
	 getObject();
	 document.getElementById('markFeatured').style.display="none";
	 document.getElementById('markedFeatured').style.display="block";
	 XMLHttp.open("post","mark_featured.php?mid="+id+"&mt="+type+"&uid="+uid);
	 //alert("mark_featured.php?mid="+id+"&mt="+type+"&uid="+uid);
	 XMLHttp.onreadystatechange = response;
	 XMLHttp.send(null);
 }