
HF.commercial = function(element,video,call_url)
{
	this.init(element,video,call_url);
};


HF.commercial.prototype = 
{
	init: function(element,video,call_url) 
	{
		this.dialog = new YAHOO.widget.Dialog(element,  
		{ 
			width: "800px",
			height: "600px",
			effect:{effect:YAHOO.widget.ContainerEffect.FADE, duration:0.25}, 
			visible: false,
			modal:true,
			zIndex:99999999,
			close:false,
			fixedcenter:true,
			constraintoviewport:true,
			draggable: false
		} );
		this.dialog.render();	
		this.element = element;
		this.video = video;
		this.call_url = call_url;
	},
	show: function()
	{
		this.call();
		elem = $(this.element);
		elem.innerHTML = '<div class="hd">Dein Fisch wird jetzt gebraten...</div><embed src="/sys_resources/mediaplayer/mediaplayer.swf" width="800" height="600" allowscriptaccess="always" allowfullscreen="true" flashvars="height=570&width=800&file=' + this.video + '&id=commercialvideo&searchbar=false&showicons=false&shownavigation=false&showdigits=false&usefullscreen=false&thumbsinplaylist=false&autostart=true&repeat=false&shuffle=true&logo=/tpl/shared/handfisch/img/hf-logo-trsp.png&screencolor=0xEEEEEE&enablejs=true&javascriptid=commercialvideo" />';
		this.dialog.show();
		/*
		that = this;
		setTimeout("that.hide();",this.timeout);
		clearTimeout();				
		*/
	},
	hide: function()
	{
		elem = $(this.element);
		elem.innerHTML = '';
		this.dialog.hide();
	},
	call: function() 
	{
		//YAHOO.util.Connect.setForm('frmcell', false);
		YAHOO.util.Connect.asyncRequest('POST', this.call_url);
	},
};
