function _stitch_vertical() {
	
	// remove any existing stitching
	$(".stitch").remove();
	
	// console.log("stitching");
	$("img[rel='vertical']").not(":last").each(function(){
		var stitch = $('<img class="stitch" src="/common/images/vertical_stitch_short-trans.png" width="20" height="194" alt="" border="0" />');
		stitch.css({
			position: "absolute",
			top: "-9px",
			left: ($(this).position().left + $(this).attr("width") - 11) + "px",
			zIndex: "0"
		});

		$(this).after(stitch);
	});		
}


function _stitch_horizontal() {
	// remove any existing stitching
	$(".stitch").remove();
	
	// console.log("stitching");
	$("img[rel='horizontal']").not(":last").each(function(){
		var stitch = $('<img class="stitch" src="/common/images/horizontal_stitch-trans.png" width="155" height="37" alt="" border="0" />');
		stitch.css({
			position: "absolute",
			float: "none",
			clear: "none",
			top: ($(this).position().top + $(this).attr("height") - 18) + "px",
			left: "-16px",
			zIndex: "0"
		});

		$(this).after(stitch);
	});
}


function stitch_vertical() {
	$(document).ready(function(){
		_stitch_vertical();
		if(!$.browser.msie){
			// re-stitch one second later
			setTimeout(_stitch_vertical, 1000);
		}
	});
}

function stitch_horizontal() {
	$(document).ready(function(){
		_stitch_horizontal();
		if(!$.browser.msie){
			// re-stitch one second later
			setTimeout(_stitch_horizontal, 1000);
		}
	});
}

