/******************************************************************/
/* © DMC 01 Consulting & Development GmbH - gerald.urbas@dmc01.at */
/******************************************************************/
/* Flashmedia Frontend Code Plugin in                             */
/******************************************************************/
/* Object generates Flashmedia HTML code                          */
/* can get evolved for styled buttons. able to provide            */
/* Flashmedia-Interface player plugin                             */
/******************************************************************/


function quicktime_Playercode(pt) {
	this.name = "Quicktime"; // player frontend name
	this.typ = "quicktime"; // Type
	this.detectionplugin = "QuickTime"; // detection plugin string
	this.objid="QUICKCONTENT"+Math.round(Math.random()*10000); // Object ID 4 HTML
	this.playertype = pt // home or extended or simple
	this.connurls = false; // initially there are no urls
	this.previewimage = false;
	this.playerurl = "swf/player.swf";
	this.playercontrols={// special HTML tag properties for embedding, and object code in HTML frontend
		'simple':{
			'embed':'controls="ImageWindow"',
			'object':'<param name="controls" value="ImageWindow" />'
			},
		'home':{
			'embed':'controls="ImageWindow"',
			'object':'<param name="controls" value="ImageWindow" />'
			},
		'extended':{
			'embed':'controls="ImageWindow,StatusBar"',
			'object':'<param name="controls" value="ImageWindow,StatusBar" />'
		}
	};
	this.FLASHEMBEDSIMPLEW="256" // normal embed W
	this.FLASHEMBEDSIMPLEH="180" // normal embed H
	this.FLASHEMBEDW="573" // normal embed W
	this.FLASHEMBEDH="317" // normal embed H
	this.FLASHEMBEDHQW="960" // HQ embed W
	this.FLASHEMBEDHQH="573" // HQ embed H
	
	
	this.playercontrolsheight={ // all Players generate there own control heigts... wo correction values definined here
		'simple':{
			'embed':0,
			'object':0
			},
		'home':{
			'embed':160,
			'object':160
			},
		'extended':{
			'embed':0,
			'object':0
			}
			
			
			
			
	};
	$.fn.media.defaults.bgColor = QTBGCOLOR;
	this.mediaobject = function(conn) {
		if (this.autostart==1) {
			var as="true";
		}else {
			var as="false";
		}
		return { 
	    width:     this.vsizes[conn]['w'], 
	    height:    (this.vsizes[conn]['h']+this.playercontrolsheight[this.playertype]['embed']),   
	    autoplay:  this.autostart, 
	    src:       this.connurls[conn],
	    attrs:     { id:  this.objid, autoplay:  as,  center:  'true', scale:'aspect' },  // object/embed attrs
			params: {autostart:  as, scale:'aspect'},
	    caption:   false // supress caption text 
			};	
	}

	this.playerstring = '<div id="'+this.objid+'" style="margin-bottom:-1px;">'
                    + 'Dieser Text wird durch den Qucktimeinhalt ersetzt.'
                    + '</div>';
		
	this.debug = function (str) { // debuglayer is deativated @ moment
		dbg("Qucktime plugin: "+str);
	};

	this.testscriptconn  = function () {
		return false;
	}
	
	this.playercall= function() {
		var conn = arguments[1]; // get conn param
		$j("#"+this.objid).empty();
		$j("#"+this.objid).media(this.mediaobject(conn));
	}
	
	/* ARD.de-Aenderung */
	
	this.enabled = true;
	this.write = writeplayercode;
	this.replace = replaceVars;
	this.setsizes = setsizes;
	
		/* ARD.de-Aenderung */
	
	this.setconn = setconn;
	this.setplayertype = setplayertype;
	this.setautostart = setautostart;	
	this.setglobid = setglobid;
	this.call_popup = playerPopup;
	this.close_popup = playerPopupClose;
	this.call_carrier = carrierPopup
	this.setPreviewimage = setPreviewImage;
	this.getPreviewimage = getPreviewImage;
	this.previewImage = previewImagecall;
	
	
	this.getconn = function () {
		return this.connurls;
	}
	
	this.report = function () {
		return "Player:"+this.name+" obid:"+this.objid+" url:"+this.connurls;
	};
	
	this.shutdown = function () {
		return;
	}
	
	this.play = function () {
		return
	}
	
	this.pause = function () {
		return
	}
	
	this.stop = function () {
		return
	}
	
	this.fullscreen = function () {
		return
	}
	
	this.carrier = function () {
		this.call_carrier(200);
	}
}

// Prototype of this object is playercode
quicktime_Playercode.prototpe = new playercode();
