  /* JS - FLASH INTERACTION */
  function getSWF(swf_ID){
  	if(navigator.appName.indexOf("Microsoft") != -1){ // IE?
  		return window[swf_ID];
  	}else{
  		if(document[swf_ID].length != undefined)
  			return document[swf_ID][1];
  		else
  			return document[swf_ID];
  	}
  }
  
  function update(direction){
  	/*
  	var invoker = "<invoke name=\"changeBackgroundTo\" returntype=\"javascript\">" + __flash__argumentsToXML(arguments,0) + "</invoke>";
	flashObject.CallFunction(invoker);
	*/
	var flashObject = getSWF('background');
    if(navigator.appName.indexOf("Microsoft") == -1){ // non IE?
  		flashObject.changeBackgroundTo(direction);
  	}else{
  		updateIE(direction);
	}
  }
  
  function updateIE(direction){
  	var invoker = "<invoke name=\"changeBackgroundTo\" returntype=\"javascript\">" + __flash__argumentsToXML(arguments,0) + "</invoke>";
	window['background'].CallFunction(invoker);
  }
  
/* Background functions */
function adjustBackground(){	
	var back=window.document.getElementById('back');	
	var dim = getDocumentDimension();
	back.style.width = dim[0]+"px";
	back.style.height = dim[1]+"px";
}

/**
 * Based on the original code from James Padolsey
 */
function getDocumentDimension() {
    var D = document;
    return [
    	Math.max(
        	Math.max(D.body.scrollWidth, D.documentElement.scrollWidth),
        	Math.max(D.body.offsetWidth, D.documentElement.offsetWidth),
        	Math.max(D.body.clientWidth, D.documentElement.clientWidth)
    		),
    	Math.max(
        	Math.max(D.body.scrollHeight, D.documentElement.scrollHeight),
        	Math.max(D.body.offsetHeight, D.documentElement.offsetHeight),
        	Math.max(D.body.clientHeight, D.documentElement.clientHeight)
        	)
    	];
}

