$.fn.wait = function(time, type) {
    time = time || 1000;
    type = type || "fx";
    return this.queue(type, function() {
        var self = this;
        setTimeout(function() {
            $(self).dequeue();
        }, time);
    });
};
	
$(document).ready(function(){
	
	$("#q").focus(function(){
		if ($("#q").attr("rel") == $("#q").attr("value")) {
			$("#q").attr("value","");
		}	
	});
	
	$("#q").blur(function(){
		if (!$("#q").attr("value")) {
			$("#q").attr("value",$("#q").attr("rel"));
		}	
	});
	
	$("#video-anons").click(function() {
		$.fancybox({
		  'padding'             : 0,
		  'autoScale'   		: false,
		  'transitionIn'        : 'none',
		  'transitionOut'       : 'none',
		  'overlayOpacity'      : 0.5,
		  'titleShow'			: false,
		  'width'               : 720,
		  'height'              : 564,
		  'href'                : this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
		  'type'                : 'swf',    // <--add a comma here
		  'swf'                 : {'allowfullscreen':'true', 'wmode':'opaque'} // <-- flashvars here
		  });
		 
		 return false;
	});
	
	/*
	$("#video-anons").fancybox({
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'scrolling'   		: 'no',
		'padding'			: 0,
		'titleShow'			: false,
		'width'				: 640,
		'height'			: 480
	});
	*/
});

