// Main Application JS

function fileQueued(v,h){var G=document.getElementById("SWFUploadFileListingFiles");if(!G.getElementsByTagName("ul")[0]){var Z=document.createElement("ul");G.appendChild(Z);}G=G.getElementsByTagName("ul")[0];var O=document.createElement("li");O.id=v.id;O.className="SWFUploadFileItem";O.innerHTML=v.name+" <span class='progressBar' id='"+v.id+"progress'></span><a id='"+v.id+"deletebtn' class='cancelbtn' href='javascript:swfu.cancelFile(\""+v.id+"\");'><!-- IE --></a>";G.appendChild(O);var S=document.getElementById("queueinfo");S.innerHTML=h+" files queued";document.getElementById(swfu.movieName+"UploadBtn").style.display="block";}function uploadFileCancelled(Z,h){var O=document.getElementById(Z.id);O.innerHTML=Z.name+" - cancelled";O.className="SWFUploadFileItem uploadCancelled";var S=document.getElementById("queueinfo");S.innerHTML=h+" files queued";}function uploadFileStart(Z,S,h){var v=document.getElementById("queueinfo");v.innerHTML="Uploading file "+S+" of "+h;var O=document.getElementById(Z.id);O.className+=" fileUploading";}function uploadProgress(h,Z){var O=document.getElementById(h.id+"progress");var S=Math.ceil((Z/h.size)*311);O.style.background="url(/images/upload/progressbar.png) no-repeat -"+(311-S)+"px 0";}function uploadError(O){}function uploadFileComplete(h){var O=document.getElementById(h.id);O.className="SWFUploadFileItem uploadCompleted";}function cancelQueue(){swfu.cancelQueue();}

function explainIncompatabilty() {
	alert("Something seems to have gone wrong. This game has been made Instant Play only by the creator or a moderator. To play this you need to install the ActiveX or Firefox control, if you have already done this, please see the help pages for more information.");
}

function rollBarInit() {
	
}

// set a simple var to check for anim in progress
var rollBarAnimationInProgress = false;

function rollBarUp() {
	if (!rollBarAnimationInProgress)
	{
		rollBarAnimationInProgress = true;
		Effect.SlideUp('instant_play_detection', { afterFinish:flagBarRollAnimFinished });
	}
}

function rollBarDown() {
	if (!rollBarAnimationInProgress)
	{
		rollBarAnimationInProgress = true;
		Effect.BlindDown('instant_play_detection', { afterFinish:flagBarRollAnimFinished });
	}
}

function flagBarRollAnimFinished(){ rollBarAnimationInProgress = false; }

// firefox check for instant play plugin
function firefoxPluginInstalled() {
  var installed = false;
  if (navigator.plugins && navigator.plugins.length > 0) {
      for (i = 0; i < navigator.plugins.length && ! installed; i++) {
          installed = navigator.plugins[i].filename == "NPYYGInstantPlay.dll";
      }
  }
  return installed;
}