// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults
var AS = {
  // Returns an object referencing the Flash MovieClip.
  get: function(movieName) 
  {
    return (document[movieName] == undefined) ? window[movieName] : document[movieName];
  },
  // Includes an SWF file in the HTML
  load: function(movieName, elementId, width, height, backgroundColor, requestView, text, mode) 
  {
    var tmp = new SWFObject("/flash/" + movieName + ".swf", movieName, width, height, "8", backgroundColor);
    
    if ( this.testLocal )
    {
        tmp.addParam("allowScriptAccess", "always");
    }
    var flashVarsParams =  "loadView=" + requestView;
    flashVarsParams +=  "&requestView=" + requestView;
    if(mode != null && mode != "")
    {
	    flashVarsParams +=  "&conditionText=" + text;
	    flashVarsParams +=  "&requestMode=" + mode;
    }
    //alert(flashVarsParams);
    tmp.addParam("flashVars", flashVarsParams);
    tmp.write(elementId);
  },
  // If true, the html can be tested locally
  testLocal: false 
}
