/*!
 * Drop Shadows (with Option Definition)
 * Copyright (c) 2010 Enklare KB
 * Version: 1.0 (07-03-2010)
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 * Requires: jQuery v1.2.6 or later
 */

(function($){

 	$.fn.extend({ 
 		
		//pass the options variable to the function
 		shadow: function(options) {
	
			//Set the default values, use comma to separate the settings, example:
			var defaults = {
				
				offset_1 : "4px", // off shadow offsets
				offset_2 : "4px", // off shadow offsets
				offset_3 : "4px", // off shadow offsets
				shadowColor : '#999', // shadow color
				opacity : ".6", //  opacity
			}
				
			var options =  $.extend(defaults, options);

    		return this.each(function() {
				var o = options;
				var obj = $(this);
				
				// shadow
				if ($(this).get(0).tagName == "DIV" || $(this).get(0).tagName == "IMG"){
					$(this).css("-moz-box-shadow",' ' + o.offset_1 +' '+ o.offset_2 + ' ' + o.offset_3 + ' ' + o.shadowColor );
					$(this).css("box-shadow",' ' + o.offset_1 +' '+ o.offset_2 + ' ' + o.offset_3 + ' ' + o.shadowColor );
					$(this).css("-webkit-box-shadow",' ' + o.offset_1 +' '+ o.offset_2 + ' ' + o.offset_3 + ' ' + o.shadowColor );
					$(this).css("FILTER", ' DropShadow(Color='+o.shadowColor+', OffX='+o.offset_1+', OffY='+o.offset_1+', Positive=1');
				}
				if ($(this).get(0).tagName == "H1" || $(this).get(0).tagName == "H2" || $(this).get(0).tagName == "H3"){
					$(this).css("text-shadow",' ' +o.shadowColor+' ' + o.offset_1 +' '+ o.offset_2 + ' ' + o.offset_3);
				}
				}); // return
    	
		} // function 
		
	}); // extend
	
})(jQuery); // end
