	function setClip(clip) {
		sendData(clip);
	}
	function getPassedMedia() {
		var query = window.location.search;
		if (query.substring(0,1) == "?") {
		   query = query.substring (1);
		   if (query.length > 0) {
		   	  showMedia (query);
 		   }
		}
	}
	function showMediaInfo(Info) {
		var divCapture = document.getElementById('caption');
		divCapture.innerHTML = Info;
	}
	function sendData(mediaName) {
		var newURL = window.location.hostname + window.location.pathname;
		var fullURL="http://" + newURL + "?" + mediaName;
		window.location.href = fullURL;
	}
	function showBack() {
 		 var backThing = document.getElementById('go_back');
		 backThing.style.visibility="visible";
	}
	function showNext(maxShots) {
		var query = window.location.search;
		if (query.substring(0,1) == "?") {
		   query = query.substring (1);
		   if (query.length > 0) {
			  var wholeThing = query.substring(0);
			  var shotNum = parseInt(parseFloat(wholeThing.substring(shotName.length-3)));
			  var shotNamePart=wholeThing.substring(0,shotName.length-3);
			  var shotFull;
			  shotNum=(shotNum+1);
			  if (shotNum>maxShots) {
			  	 shotNum=1;
			  }
			  if (shotNum>9) {
			  	 shotFull=shotNamePart + "0" + shotNum;
			  }
			  else {
			  	 shotFull=shotNamePart + "00" + shotNum; 
			  }
			  sendData(shotFull);
		   }
		}
	}
	function showPrev(maxShots) {
		var query = window.location.search;
		if (query.substring(0,1) == "?") {
		   query = query.substring (1);
		   if (query.length > 0) {
			  var wholeThing = query.substring(0);
			  var shotNum = parseInt(parseFloat(wholeThing.substring(shotName.length-3)));
			  var shotNamePart=wholeThing.substring(0,shotName.length-3);
			  var shotFull;
			  shotNum=(shotNum-1);
			  if (shotNum<1) {
			  	 shotNum=maxShots;
			  }
			  if (shotNum>9) {
			  	 shotFull=shotNamePart + "0" + shotNum;
			  }
			  else {
			  	 shotFull=shotNamePart + "00" + shotNum; 
			  }
			  sendData(shotFull);
		   }
		}
	}
	