// id of the swf so we can call it

var SWF_ID = "yacc"
var SWF_LOCAL = {};
var SWF_COVER_KEY_SHIFT = false;

function keypress(e){
	if(e.which == 17){
		document.onkeydown = null;
		document.onkeyup = keyrelease;
		SWF_COVER_KEY_SHIFT = true;
	}
}

function keyrelease(e){
	if(e.which == 17){
		document.onkeydown = keypress;
		document.onkeyup = null;
		SWF_COVER_KEY_SHIFT = false;
	}
}

document.onkeydown = keypress;
/**
 * Once the SWF has initialized (first onComplete call) you can use SWF().method
 * to send calls to the swf in this example the callbacks from the swf are named
 * the same as the methods you can call to the swf.
 */
SWF = function()
{
	return document.getElementById(SWF_ID);
}
function currentIndex(index){
	SWF_LOCAL.currentIndex = index;
}
function coverEnterLeft(obj){
	showTooltipLeft(obj.title);
}
function coverEnterRight(obj){
	showTooltipRight(obj.title);
}
function coverLeave(obj){
	clearTooltip();
}
function getImages(array){}
function getTitles(array){}
function getXML(xml){}
function getIndex(obj)
{
	SWF_LOCAL.indexResponse = obj;
}
function onClick(obj)
{
   var newWindow = window.open(obj.url, '_top');
	return null;
}
function onInit(obj){}
function swfLog(log){}
function swfInjectXML(){}

var firstCompleteDone = false;

function onComplete(obj){
  if(!firstCompleteDone)
    {
        SWF().getImages();
        firstCompleteDone = true;
    }
    else{
    sopenAppTitle(obj.title);
   //var newWindow = window.open(obj.url, '_blank');
   }
 return null;
}

function showTooltipLeft(title){
   if(currentAppTitle != title){
      document.getElementById('appTooltipText').innerHTML = title;
      document.getElementById('appTooltipText').className = 'sopenAppTooltipLeft';
   }
}

function showTooltipRight(title){
   if(currentAppTitle != title){
      document.getElementById('appTooltipText').innerHTML = title;
      document.getElementById('appTooltipText').className = 'sopenAppTooltipRight';
   }
}
function clearTooltip(){
   document.getElementById('appTooltipText').innerHTML = "";
}
function sopenDebug(output){
	document.getElementById('sopenDebug').innerHTML = output;
}
function sopenAppTitle(output){
	document.getElementById('sopenAppTitle').innerHTML = output;
   currentAppTitle = output;
}
