// ---------- amazon filter

document.onclick = function(e) {
	var url, ie;
	if (document.all) {
		url = window.event.srcElement.href;
		ie = (!window.opera) ? 1 : 0;
	}
	else if (document.getElementById && e.which == 1) {
		url = e.target.href || e.target.parentNode.href;
	}

	if (url && url.match(/amazon/)) {
		if (ie) {
			if (!window.createPopup) {
				window.event.srcElement.target = "_blank";
				return true;
			}
			url = escape(url);
			url = decodeURIComponent(url);
			url = encodeURI(url);
		}
		if (!url.match(/\/$/)) url += "/";
		url += "otsi-22";
		window.open(url);
		return false;
	}
}


// ---------- enable thickbox automation

$(function(){
	$("div.main a[href$='.jpg']").addClass("thickbox");
});

