




jQuery.fn.shadow = function() {

   return this.each(function(){

		var obj = jQuery(this);
		
		var width=25;
		
		var obj_height = obj.height() + parseInt(obj.css('padding-top')) + parseInt(obj.css('padding-bottom'));
		var obj_width = obj.width() + parseInt(obj.css('padding-left')) + parseInt(obj.css('padding-right'));
		
		obj.css({position: 'relative', overflow:'visible'});
		
		var a = $(document.createElement('div'));
		obj.append(a);
		a.css({position: 'absolute', top: '2px', right: -(width+1)+'px', width: width+'px', height: obj_height+'px'});

		a.css({background: 'transparent url(pictures/shadow_right.gif) top right scroll repeat-y'});


		var b = $(document.createElement('div'));
		obj.append(b);
		b.css({position: 'absolute', bottom: (-width-1)+'px', left: '2px', width: obj_width+'px', height: width+'px'});

		b.css({background: 'transparent url(pictures/shadow_bottom.gif) bottom left scroll repeat-x'});


		var c = $(document.createElement('div'));
		obj.append(c);
		c.css({position: 'absolute', bottom: -(width+1)+'px', right: -(width+1)+'px', width: width+'px', height: width+'px'});

		c.css({background: 'transparent url(pictures/shadow_corner.gif) bottom right scroll no-repeat'});

		var d = $(document.createElement('div'));
		obj.append(d);
		d.css({position: 'absolute', top: '0px', right: -(width+1)+'px', width: width+'px', height: width+'px'});

		d.css({background: 'transparent url(pictures/shadow_top.gif) top right scroll no-repeat'});

		var e = $(document.createElement('div'));
		obj.append(e);
		e.css({position: 'absolute', bottom: (-width-1)+'px', left: '0px', width: width+'px', height: width+'px'});

		e.css({background: 'transparent url(pictures/shadow_left.gif) bottom left scroll no-repeat'});
		

   });

};





jQuery.fn.center = function(sets) {

   return this.each(function(){

		var obj = jQuery(this);
		
		obj.css({height:'auto', width: 'auto'});
		
		if (!$.browser.msie) 
		{
			obj.css('position', 'fixed');
		}
		else
		{
			var container = jQuery(jQuery('body').get(0).appendChild(document.createElement('div')));
			container.fullscreen();
			container.css({zOrder: 1000});
			container.append(obj);
	
			obj.css({position: 'absolute'});		
			
		}

		obj.css({
			top: '50%',
			marginTop: -obj.height()/2,
			height: obj.height(),
			
			left:'50%',
			marginLeft: -obj.width()/2,
			width: obj.width()
		});
	

   });

};



jQuery.fn.uncenter = function() {

   return this.each(function(){
   	
		if ($.browser.msie)
		{
			var obj = jQuery(this);
			var parent = obj.parent();
			
			obj.css('dispay', 'none');
			
			$('body').append(obj);
			parent.remove();
			
			//alert(parent.html());
			//alert($('body').html());
			
			//alert(parent.nodeName);
			
			//if (parent.id=='fixing_container')
			//{
				//$('body').get(0).appendChild(this);
				
				//if (!parent.hasChildNodes())
				//{
					//$(parent).remove();
					//alert('parent removed');
					//jQuery.fixed.container.remove();
					//jQuery.fixed.container = null;
				//}
			//}
			

		}
	
   	})
};

jQuery.fn.fullscreen = function() {

   return this.each(function(){

		var obj = jQuery(this);
		
		if (!$.browser.msie) 
		{
			obj.css('position', 'fixed');
			obj.css({top: '0', left:'0'});
		}
		else
		{
			obj.css({position: 'absolute'});
			obj.css({top: jQuery(window).scrollTop()+'px', left:'0'});
			
			jQuery(window).bind('scroll', obj, function(event){
					//alert($(event.data).length);
					event.data.css('top', jQuery(window).scrollTop()+'px');
					
				});
		}

		obj.css({width: '100%', height:'100%'});

		
   });

};
