function adStickyShoppingMobile() {

	// Building the content
	var size = 155; // size is 155px x 155px
	var el = $ui("a#ad-sticky-shopping-mobile");
	el.insertBefore("#main");

	// IE6-Specials
	if ($ui.browser.msie && $ui.browser.version == "6.0") { //Todo: If updating jQuery to 1.3.x this is deprecated
		function reposIE() {
			var topPos = $ui(window).innerHeight() + $ui(window).scrollTop() - size;
			if ( $ui("html").innerWidth() < ($ui("#main").width() + size + 5) ) {
				var rightPos = (parseInt($ui("html").innerWidth()) - (parseInt($ui("#main").width()) + size) - 50);
				el.attr("style", "top: " + topPos + "px; position: absolute; right:" + rightPos + "px; z-index: 0;")
			} else {
				el.attr("style", "top: " + topPos + "px; position: absolute; right: 0px; z-index: 0;");
			}
		};
		reposIE();
		$ui(window).scroll(function() {
			reposIE();
		});
		$ui(window).resize(function() {
			reposIE();
		});
	} else {
		// Positioning the content
		function repos() {
			if ( $ui("html").innerWidth() < ($ui("#main").width() + size + 5) ) {
				var rightPos = (parseInt($ui("html").innerWidth()) - (parseInt($ui("#main").width()) + size) - 10);
				el.attr("style", "bottom: 0px; height: " + size + "px; position: fixed; right: 0px; width: " + size + "px; right: " + rightPos + "px; z-index: 0;");
			} else {
				el.attr("style", "bottom: 0px; height: " + size + "px; position: fixed; right: 0px; width: " + size + "px; right: 0px; z-index: 0;");
			}
		};
		repos();
		$ui(window).resize(function(){
			repos();
		});

	}
};

$ui(document).ready(function(){
	adStickyShoppingMobile();
});
