	$(document).ready(function(e) {
	
	function checkIEBrowser() {
		var ua = navigator.userAgent;
		var MSIEOffset = ua.indexOf("MSIE ");
			if (MSIEOffset == -1) 
				return false;
			 else 
				return true;
	}
	
		var height = $(document).height();
		var object = $("#rightBanner");
		var objectParent=$(object).parent();
		var position = object.position();
		var objectParentPosition=objectParent.position();
		var objectTop=position.top;
		var objectParentTop=objectParentPosition.top;
		var objectBottom=objectTop+$(object).height();
		var objectParentBottom=objectParentTop+$(objectParent).height();
		$("#divSplit").width($(object).width());
		if (checkIEBrowser()==false)
		{
			$(window).scroll(function(){
				var scrollTop = $(window).scrollTop();
				var windowHeight=$(window).height();
				
				if (objectParent.height()>object.height())
				{
					if (scrollTop+windowHeight>objectParentBottom)
					{
	//					$(objectParent).css("vertical-align","bottom");
	//					$(object).css("bottom",0);
						$(object).css("position","static");
	//					$(object).css("margin-bottom",30);
					}
					else
					{
					//	$(objectParent).css("vertical-align","top");
						if (scrollTop+windowHeight>objectBottom)
						{
							$(object).css("width",$(object).width());
							$(object).css("position","fixed");
							$(object).css("bottom",30);
						}
						else
						{
							$(object).css("position","static");
	//						$(object).css("bottom",0);
							$(objectParent).css("vertical-align","top");
						}
					}
				}
			});
		} // end if
    });
