function openBox(content, width, height) {
	SqueezeBox.open(content, {
		handler: 'adopt',
		size: {x: (width + 3), y: (height + 3)}
	});
}

window.addEvent('domready', function() {
	SqueezeBox.initialize();
	
	$$('.squeeze').each(function(el) {
		el.addEvent('click', function(e) {
			e.stop();
			var code = this.get('ref');
			var swf = new Element('div', {
				'styles' : {
					'padding' : 0,
					'margin' : 0
				}
			});
			if (this.hasClass('youtube')) {
				var width = 590;
				var height = 360;
				
				var html = '<object width="'+width+'" height="'+height+'">';
				html += '<param name="movie" value="'+code+'"></param>'
				html += '<param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param>';
				html += '<embed src="'+code+'" type="application/x-shockwave-flash"';
				html += ' allowscriptaccess="always" allowfullscreen="true" width="'+width+'" height="'+height+'"></embed></object>'
			} else if (this.hasClass('etarget')) {
				var width = 425;
				var height = 349;
				
				var html = '<object width="'+width+'" height="'+height+'">';
				html += '<param name="movie" value="http://sk.search.etargetnet.com/videoplayer.swf"></param>';
				html += '<param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param>';
				html += '<param name="flashVars" value="'+code+'"></param>';
				html += '<embed src="http://sk.search.etargetnet.com/videoplayer.swf"';
				html += ' type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true"';
				html += 'width="'+width+'" height="'+height+'" flashVars="'+code+'"></embed>';
			}
			swf.set('html', html);
			parent.openBox(swf, width, height);
			
		});
	});
});