function setJSLinks() 
{ 
	if (!document.getElementsByTagName) return;

	var links = document.getElementsByTagName("a");
	for (i = 0; i<links.length; i++) {
		if (links[i].getAttribute("href") && (links[i].getAttribute("rel"))) {
			// showcase pop-up links
			if (links[i].getAttribute("rel").indexOf("showcase") != -1) {
				links[i].onclick = function () {
					window.open(this.href, 'showcasepop', 'width=550,height=575,resizable=1,status=1');
					return false;
				}; 
			}
			// end showcase pop-up links
			
			// showcase detail rollover links
			if (links[i].getAttribute("rel").indexOf("detail:") == 0) {
				var str = null;
				var args = new Array();
				
				links[i].onclick = function () {
					str = this.getAttribute("rel").substring(7);
					args = str.split(',');
					
					document.getElementById(args[0]).src = args[1];
					document.getElementById(args[0]).width = args[2];
					document.getElementById(args[0]).height = args[3];
					
					return false;
				}; 
			}
			// end showcase detail rollover links
			
			
			// product images link
			if (links[i].getAttribute("rel").indexOf("productimgs:") == 0) {
				var str = null;
				var args = new Array();
				var j = 0;
				
				links[i].onclick = function () {
				    if (++j >= args.length - 1) {
					    j = 0;
					}
					
					str = this.getAttribute("rel").substring(12);
					args = str.split(';');				
					img = args[j].split(',');
					
					document.getElementById('productimgs').src = img[0];
                    document.getElementById('productimgs').width  = img[1];
                    document.getElementById('productimgs').height = img[2];
					
					return false;
				}; 
			}
			// end product images
		}
	}

}


addLoadEvent(setJSLinks);