/*CVS Add-ins*/
/*
$Revision: 1.2 $
$RCSfile: flashbehaviour.js,v $
author: JDE
*/

/* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + */
/*
    flashbehaviour.js
    15.01.2009 JDE
*/
/* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + */

/* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + */
/*Copyright (c) A&B FACE2NET GmbH*/

function check(){ alert("JS eingebunden"); }

if (typeof flashplayer == "undefined") {
    var flashplayer = new Object();
}

function startVideo(containerID, still){
  var script_url = 'http://www.movingimage24.de/video_22928?width=459&height=309&player=v2&adbtn=1&adbtn1=1&adbtn2=0&adbtn5=1&adbtn6=0&chapter=1&overlays=1&cbarPlayPauseFlag=1&cbarTrackFlag=1&cbarTimeTotalFlag=1&cbarTimeDurationFlag=1&cbarvolumeBarFlag=1&volumeBtn=1&cbarFullScreenFlag=1&bg=559db3&ctlstyle=none&fg=ffffff&ctcb1=ffffff&ctcb2=294f5b&ctcb3=e2001a&ctcb4=294f5b&ctcb5=589fb4&ctcb6=5dafc7&ctcb7=ffffff&ctg1=393838&ctg2=e2001a&ctg3=ffffff&ctg4=000000&ctg5=70&ctab1=407c8e&ctab2=5dafc7&ctab3=294f5b&ctab4=589fb4&ctab5=ffffff&ctab6=ffffff&sbg=559db3&wvm=2&start=1&volume=100&thumbasfs=0&loadtime=0&wmode=window&fupdate=1&cwm=0&ctp=0';
  stop_sliding();

    var removed = $('#'+still).remove();
    $('#'+containerID).append('<div class="frame"><div><iframe scrolling=no height=309 width=459 frameborder=0 src="'+script_url+'"></iframe></div></div>');
}

flashplayer = function(swfUrlStr, widthStr, heightStr, reqVerStr) {

    this.pluginVer = swfobject.getFlashPlayerVersion();
    var requiredVer = new Array;
    this.requiredVer = reqVerStr.split(".");
    this.url = swfUrlStr;
    this.width = widthStr;
    this.height = heightStr;

    this.embed_youtube = function(video_id, containerID) {
        if(this.hasRequiredFlashVersion()) {
          swfobject.embedSWF(this.url.concat(video_id), containerID, this.width, this.height, reqVerStr);
        }else{
          this.writeErrorMessage(0);
        }
    }

    this.embed_spdtv = function(video_id, containerID) {
        if(this.hasRequiredFlashVersion()) {

        }else{
          this.writeErrorMessage(1);
        }
    }

    this.hasRequiredFlashVersion = function() {
        this.requiredVer.major = this.requiredVer[0]!=null?parseInt(this.requiredVer[0]):0;
        if(this.pluginVer.major < this.requiredVer.major){ return false; }
        if(this.pluginVer.major > this.requiredVer.major){ return true;  }

        this.requiredVer.minor = this.requiredVer[1]!=null?parseInt(this.requiredVer[1]):0;
        if(this.pluginVer.minor < this.requiredVer.minor) { return false; }

        if(this.pluginVer.minor > this.requiredVer.minor) { return true;  }

        this.requiredVer.release = this.requiredVer[2]!=null?parseInt(this.requiredVer[2]):0;
        if(this.pluginVer.release < this.requiredVer.release) { return false; }
        return true;

    }

    this.writeErrorMessage = function(n) {
      switch(n) {
        case 0: //Youtube
          $(".youtube .basic_txt").remove();
           if (this.pluginVer.major != 0 || this.pluginVer.minor != 0 || this.pluginVer.rev != 0) {
            $(".youtube .errortxt").html("Sie haben den Adobe&reg; Flashplayer in der Version " + this.pluginVer.major + "." + this.pluginVer.minor + "." + this.pluginVer.release + ". Bitte aktualisieren Sie ihn. Die aktuelle Version");
           }else{
            $(".youtube .errortxt").html("Sie haben keinen Adobe&reg; Flashplayer installiert oder er ist deaktiviert. Die aktuelle Version");
           }
           break;
        case 2: //SPD.tv
          break;
        default:
          break;
      }
    }

}

var flashPlayer = new flashplayer("http://www.youtube.com/v/","327","266","9.0.0");
