var pop = {
	overlay: function(){document.body.appendChild(Builder.node('div', { id: 'box_overlay', style: 'display:none' }))},
	
	window: function(file,width,title){
		pop.destroy();
		pop.overlay();
		
		var element = Builder.node('div', { id: 'box_wrapper2', style: 'display:none;width:' + width + 'px;margin-left:-' + parseInt(width/2) + 'px;'}, [
				  	Builder.node('div', { id: 'box_top', className: 'box_top' }, title),
					Builder.node('div', { id: 'box_content', className: 'box_window' }),
					Builder.node('div', { id: 'box_close' })
				  ]);
			
		document.body.appendChild(element);	  
		
		if ($('box_top')){
			if ($('box_top').innerHTML == ''){
				$('box_top').remove();
			};
		};
		
		$('box_overlay').observe('click',pop.destroy );
		$('box_close').observe('click', pop.destroy );
		$('box_overlay').appear({ duration: 0.3, from: 0.0, to: 0.8, queue: 'end' });
		$('box_wrapper2').appear({ duration: 0.3, from: 0.0, to: 1.0, queue: 'end' });
		
		pop.update_content(file);
	},

	update_content: function(file){
		$('box_content').insert('<div class="video"><div class="popupvideo"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"  width="640" height="375" id="promoLoader" align="middle"><param name="allowFullScreen" value="false" /><param name="flashvars" value="images/dittferiested_v3_1.swf" /><param name="movie" value="images/dittferiested_v3_1.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />	<embed src="images/dittferiested_v3_1.swf" quality="high" bgcolor="#ffffff"  width="640" height="375" name="promoLoader" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object></div></div>');
	},
	
	destroy: function(){
 		if ($('box_overlay')){ 
			$('box_overlay').remove(); 
			if ($('loader')) $('loader').remove(); 
			if ($('box_wrapper2')) $('box_wrapper2').remove(); 
		};
	}	
};


