var xmlhttp=false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
  try {
  xmlhttp=new ActiveXObject("Msxml2.XMLHTTP")
 } catch (e) {
  try {
    xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
  } catch (E) {
   xmlhttp=false
  }
 }
@else
 xmlhttp=false
@end @*/
if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
 try {
  xmlhttp = new XMLHttpRequest();
 } catch (e) {
  xmlhttp=false
 }
}

function watching(url) {
	  xmlhttp.open("GET",url,true)
	  xmlhttp.onreadystatechange=function() {
	   if (xmlhttp.readyState==4) {
		if (xmlhttp.responseText==0) {
			alert('Oops, something is wrong');
		} else if (xmlhttp.responseText==1) {
			var starton = document.getElementById('star');
			starton.src = '/images/unstar.png';
		} else if (xmlhttp.responseText==2) {
			var starton = document.getElementById('star');
			starton.src = '/images/star.png';
		}
		
	   }
	  }
	  xmlhttp.setRequestHeader('Accept','message/x-formresult')
	  xmlhttp.send(null)
	  return false
}
function unwatching(url) {
	  xmlhttp.open("GET",url,true)
	  xmlhttp.onreadystatechange=function() {
	   if (xmlhttp.readyState==4) {
		if (xmlhttp.responseText==0) {
			alert('Oops, something is wrong');
		} else if (xmlhttp.responseText==1) {
			//var starton = document.getElementById('starton');
			//starton.src = '/images/star.png';
			var starton = document.getElementById('starton');
			var startoff = document.getElementById('startoff');
			starton.style.display = 'none';
			startoff.style.display = 'block';
		}
		
	   }
	  }
	  xmlhttp.setRequestHeader('Accept','message/x-formresult')
	  xmlhttp.send(null)
	  return false
}

function showUploadForm(id) {
	if (document.getElementById(id).style.display == 'none') {
		document.getElementById(id).style.display = 'block'
	}
}