﻿var myVianPlayer = null;

function vianPlayer() {
    this.playerWidth = 400;
    this.playerHeight = 320;
    this.playerID = "vianAdPlayer";
    this.playerName = "vianAdPlayer";
    this.wmode = "opaque";
    this.bgColor = "000000";
    this.contentURL = "";
    this.placementCode = "";
    this.campaignID = "";
    this.flashVars = "";
    this.requiredMajorVersion = 8;
    this.requiredMinorVersion = 0;
    this.requiredRevision = 0;
    this.playerURL = "http://www.vianadserver.com/vianAdPlayer102";
    this.jsSuffix = "";
    this.playerDIVContainer = "";
    this.initPic = "";
    this.logoURL = "";
    this.hideControlBar = "";
    this.floatingControlBar = "true";
    this.floatingPlayList = "true";
    this.playListFixed = "";
    this.videoGalleryID = "";
    
    this.getFlashVars = function() {
        var myFlashVars;
    
        myFlashVars = "&PlacementCode=" + this.placementCode;
        myFlashVars = myFlashVars + "&VideoURL=" + this.contentURL;
        myFlashVars = myFlashVars + "&CampaignID=" + this.campaignID;
        myFlashVars = myFlashVars + "&jsSuffix=" + this.jsSuffix;
        myFlashVars = myFlashVars + "&InitPic=" + this.initPic;
        myFlashVars = myFlashVars + "&LogoURL=" + this.logoURL;
        myFlashVars = myFlashVars + "&HideControlBar=" + this.hideControlBar;
        myFlashVars = myFlashVars + "&FloatingControlBar=" + this.floatingControlBar;
        myFlashVars = myFlashVars + "&FloatingPlayList=" + this.floatingPlayList;
        myFlashVars = myFlashVars + "&PlayListFixed=" + this.playListFixed;
        myFlashVars = myFlashVars + "&VideoGalleryID=" + this.videoGalleryID;
        myFlashVars = myFlashVars + this.flashVars;
        
        return myFlashVars;
    }
    
    this.display = function() {
        if(AC_FL_RunContent == 0) {
	        alert("Diese Seite erfordert die Datei \"AC_RunActiveContent.js\".");
        } else {
            var hasRightVersion = true;
            if(DetectFlashVer != 0) {
                hasRightVersion = DetectFlashVer(this.requiredMajorVersion, this.requiredMinorVersion, this.requiredRevision);
            }
            if(hasRightVersion) {
                myVianPlayer = this;
                if(this.playerDIVContainer == "") {
                    this.playerDIVContainer = this.playerID + "Container";
                }
                document.write("<div id='" + this.playerDIVContainer + "' style='width: " + this.playerWidth + "px;height: " + this.playerHeight + "px;'>");
	            AC_FL_RunContent(
		            'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
		            'width', this.playerWidth,
		            'height', this.playerHeight,
		            'src', this.playerURL,
		            'quality', 'high',
		            'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
		            'align', 'middle',
		            'play', 'true',
		            'loop', 'true',
		            'scale', 'showall',
		            'wmode', this.wmode,
		            'devicefont', 'false',
		            'id', this.playerID,
		            'bgcolor', this.bgColor,
		            'name', this.playerName,
		            'menu', 'true',
		            'allowFullScreen', 'true',
		            'allowScriptAccess','always',
		            'movie', this.playerURL,
		            'salign', '',
		            'flashvars', this.getFlashVars()
		            );
                document.write("</div>");
	        } else {
		        var alternateContent = 'F&uuml;r diesen Inhalt ist der Adobe Flash Player erforderlich.<br />'
			                           + '<a href=https://www.macromedia.com/go/getflash/ target=_blank>Flash installieren</a>';
		        document.write(alternateContent);
	        }
        }
    }
}

function vianUpload() {
    this.playerWidth = 520;
    this.playerHeight = 55;
    this.playerID = "vianAdPlayer";
    this.playerName = "vianAdPlayer";
    this.wmode = "opaque";
    this.bgColor = "000000";
    this.flashVars = "";
    this.requiredMajorVersion = 8;
    this.requiredMinorVersion = 0;
    this.requiredRevision = 0;
    this.playerURL = "http://upload.vianadserver.com/vianUpload100";
    this.videoID = "";
    this.evoAdUserID = "";
    
    this.getFlashVars = function() {
        var myFlashVars;
    
        myFlashVars = "&VideoID=" + this.videoID;
        myFlashVars = myFlashVars + "&EvoAdUserID=" + this.evoAdUserID;
        myFlashVars = myFlashVars + this.flashVars;
        
        return myFlashVars;
    }
    
    this.display = function() {
        if(AC_FL_RunContent == 0) {
	        alert("Diese Seite erfordert die Datei \"AC_RunActiveContent.js\".");
        } else {
            var hasRightVersion = true;
            if(DetectFlashVer != 0) {
                hasRightVersion = DetectFlashVer(this.requiredMajorVersion, this.requiredMinorVersion, this.requiredRevision);
            }
            if(hasRightVersion) {
	            AC_FL_RunContent(
		            'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
		            'width', this.playerWidth,
		            'height', this.playerHeight,
		            'src', this.playerURL,
		            'quality', 'high',
		            'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
		            'align', 'middle',
		            'play', 'true',
		            'loop', 'true',
		            'scale', 'showall',
		            'wmode', this.wmode,
		            'devicefont', 'false',
		            'id', this.playerID,
		            'bgcolor', this.bgColor,
		            'name', this.playerName,
		            'menu', 'true',
		            'allowFullScreen', 'true',
		            'allowScriptAccess','always',
		            'movie', this.playerURL,
		            'salign', '',
		            'flashvars', this.getFlashVars()
		            );
	        } else {
		        var alternateContent = 'F&uuml;r diesen Inhalt ist der Adobe Flash Player erforderlich.<br />'
			                           + '<a href=https://www.macromedia.com/go/getflash/ target=_blank>Flash installieren</a>';
		        document.write(alternateContent);
	        }
        }
    }   
}