var UbiV = {

	init : function() {
		var a = YAHOO.util.Dom.getElementsByClassName('video_popup', 'a');
		for(var i = 0; i < a.length; i++) {
			UbiEvent.addEvent(a[i], 'click', UbiV.handleClick, false);
		}
	},

	handleClick : function(e) {
		UbiV.cancelBubbling(e);
		var target = UbiEvent.getTarget(UbiEvent.getEvent(e));
		if(target.nodeName.toLowerCase() == 'img') {
			target = target.parentNode;
		}
		var src = target.href;
		window.open(src, 'video','status=0,location=0,location=0,scrollbars=1,resizable=1,width=520,height=500');
	},

	cancelBubbling : function(e) {
		if(window.event) {
			window.event.cancelBubble = true;
			window.event.returnValue = false;
		}
		if(e && e.stopPropagation && e.preventDefault) {
			e.stopPropagation();
			e.preventDefault();
		}
	}

};

UbiEvent.addEvent(window, 'load', UbiV.init, false);
