/******************************************************************/
/*ARD Blankplayer Version 1.19.7							*/
/******************************************************************/
/* � DMC 01 Consulting & Development GmbH - gerald.urbas@dmc01.at */
/******************************************************************/
/* ARD Player loader.js                                           */
/******************************************************************/
/* Javascript File loader class.                                          */
/* based on config vars loading of JS files of uncompressed, comppressed 6 merged js files  */
/* correct Order JS fileloading                    .                 */
/******************************************************************/

var DMCLoader = {
  Version: '3',
  Compression: COMPRESSEDJS,
  Merged: MERGEDJS,
  jsbasepath: JSBASEPATH,
  jspath:'uncompressed',
  compressedjspath:'compressed',
  mergedpath:'merged',
  swfobjectfilename:"swfobject_source",
  swfobject2filename:"swfobject2_source",
//  jquery_files:'jquery,jquery_compatibility',
  jquery_files:'',
  start_files:'ac_quicktime,swfobject_source,rpdetect,detection',
  basicjquery_jsfiles:'jquery.cookie,jquery.media,jquery.form,player', // BlankPlayer
  //basicjquery_jsfiles:'jquery.cookie,jquery.media,jquery.form,jdimensions,jmousewheel,jScrollPane,player', //DAS ERSTE
  dmcplayerplugins_jsfiles:'quickmedia,realmedia,microsoftmedia,flashmedia',
  dmcplayer_jsfiles:'dmcplayer',
  
//  jquery_files_merged:'jquery',
  jquery_files_merged:'',
  start_files_merged:'detection',
  basicjquery_jsfiles_merged:'jquery_plugins',
  dmcplayerplugins_jsfiles_merged:'playerplugins',
  dmcplayer_jsfiles_merged:'dmcplayer',

  
  require: function(libraryName) {
    // inserting via DOM fails in Safari 2.0, so brute force approach
    document.write('<script type="text/javascript" src="'+this.jspath+"/"+libraryName+'.js"><\/script>');
  },
  init: function () {
	if (this.Compression==true) {
		this.jspath = this.compressedjspath;
	}
	if (this.Merged==true) {
		this.jspath = this.mergedpath;
		this.jquery_files = this.jquery_files_merged;
		this.start_files = this.start_files_merged;
		this.basicjquery_jsfiles = this.basicjquery_jsfiles_merged;
		this.dmcplayerplugins_jsfiles = this.dmcplayerplugins_jsfiles_merged;
		this.dmcplayer_jsfiles = this.dmcplayer_jsfiles_merged;
	}
	this.jspath = this.jsbasepath+'/'+this.jspath;
  },
  getScriptPath: function () {
	return this.jspath;
  },
  load: function(type) {
    if ( type != undefined && type != '' ) {
      js = type.split(',');
      if ( js.length > 0 ) {
        for (file in js) {
          this.require(js[file]);
        }
      }
    }
  },
  loadjquery:function() {
	this.load(this.jquery_files);
  },
  loadplugindetection:function() {
	if (SWFOBJECTVERSION==2) {this.start_files = this.start_files.replace(this.swfobjectfilename,this.swfobject2filename)};
	this.load(this.start_files);
  },
  start: function() {
	this.load(this.basicjquery_jsfiles);
	this.load(this.dmcplayerplugins_jsfiles);
	this.load(this.dmcplayer_jsfiles);
  }
}
DMCLoader.init();
DMCLoader.loadjquery();
DMCLoader.loadplugindetection();



