(function($) {
 $.fn.allWorkBlinkFade = function(_dur, _callbackFunc) {
	//traceOut("jquery.plugin.allWorkBlinkFade():workId=="+$(this).data('workId')+",year=="+$(this).data('year'));
	
	var _this = this;
	
	var callbackFunc = _callbackFunc;
	
	var theThumbnail = $('.theThumbnail', $(_this));
	theThumbnail.hide();
	
	$(_this).show();
	$(_this).css('visibility','visible');
	
	var blinkyColor;
	switch(Math.floor(Math.random()*5)) {
		case 0:{
			blinkyColor = "#ff7202";
			break;
		}
		case 1:{
			blinkyColor = "#ffd425";
			break;
		}
		case 2:{
			blinkyColor = "#9bc204";
			break;
		}
		case 3:{
			blinkyColor = "#0e9a82";
			break;
		}
		case 4:{
			blinkyColor = "#ce3677";
			break;
		}
	}
	
	var blinky = $('<div class="allWorkBlinky"></div>');
	blinky.width(theThumbnail.width()*.5);
	blinky.height(theThumbnail.height()*.5);
	blinky.css('position','relative');
	blinky.css('left', theThumbnail.width()*.25);
	blinky.css('top', theThumbnail.height()*.25);
	blinky.css('background-color', blinkyColor);
	blinky.hide();
	
	$(_this).append(blinky);
	
	setTimeout(showBlinky, _dur);
	
	function showBlinky() {
		
		$('.allWorkBlinky', $(_this)).show();
		setTimeout(killBlinky, _dur);
		callbackFunc(_this);
		
	}
	
	function killBlinky() {
		$(_this).css('padding',0);
		$(_this).css('background-color','');
		$('.theThumbnail', $(_this)).show();
		$('.allWorkBlinky',$(_this)).remove();
		//callbackFunc(_this);
	}
	
}})(jQuery);
