/*

	Drop Shadow JQuery plugin

*/

(function( $ ){
	
  $.fn.dropShadow = function() {
	 
	  this.each( function () {
		
			$(this).css( 'zIndex' , 20 );
			$(this).css( 'position' , 'relative' );
			$(this).append('<div style="clear:both"></div>');
			
			var height = $(this).height();
		  	var width =  $(this).width();
		  	var left =  $(this).position().left;
		  	var top =  $(this).position().top;	
		  	var $shadow = $('<div></div>');
		  	var $superShadow = $('<div></div>');
		  	
		  	var $this = $(this);
		  		/*  	
		  	try {
				$(this).parent().prepend( $shadow.attr({
					'class':'dsShadowWrapper'				
				}).append( $this ));
		  	} catch (err) {
		  		
		  	}
		  	
		  	$this.parent().parent().prepend( $superShadow.attr('class','dsSuperShadowWrapper').append( $shadow ));					  	
		  	*/
		  	$(this).parent().parent().append('<div class="dsCorner dsLBCorner" ></div>');
		  	$(this).parent().parent().append('<div class="dsBShadow"></div>');
		  	$(this).parent().parent().append('<div class="dsCorner dsRBCorner" ></div>');
		  	
		  
		  
		  	var wWidth = width + 40;
		  	$(this).css('z-index','10');
		  	$(this).parent().css( 'width' ,  wWidth + 'px' );	
		  	$(this).parent().parent().css( 'width' ,  wWidth + 'px' );	
		  	
			$(this).append('<div class="dsRShadow"></div>');
			$(this).append('<div class="dsLShadow"></div>');
			$(this).append('<div class="dsTShadow"></div>');
		
			$(this).append('<div class="dsCorner dsRTCorner" ></div>');
			$(this).append('<div class="dsCorner dsLTCorner" ></div>');
						
			$(this).find(".dsRShadow").css( 'height' ,   '5000px' );											
			$(this).find(".dsLShadow").css( 'height' ,  '5000px' );												
			$(this).find(".dsTShadow").css( 'width' , width + 'px');
			
			$(this).parent().parent().find(".dsBShadow").css( 'width' , width + 'px')
									
		
		});
 /*
	  $.fn.dropShadow.redraw = function() {
			$(this).find(".dsRShadow").css( 'height' ,  height + 'px' );											
			$(this).find(".dsLShadow").css( 'height' ,  height + 'px' );												
			$(this).find(".dsTShadow").css( 'width' , width + 'px');
			$(this).find(".dsBShadow").css( 'width' , width + 'px');
	  }
	  */
  };
})( jQuery );

