
var currenul = '';
	
function showlist(obj, aug){
	if(currenul != obj){
		var ulhol = document.getElementById('productlist');
		var allul = ulhol.getElementsByTagName('ul');
		for (var i=0;i<allul.length;i++) allul[i].style.display = 'none';
		var alla = ulhol.getElementsByTagName('a');
		for (var i=0;i<alla.length;i++) alla[i].className = '';
	
		var theli = document.getElementById(obj);
		var theul = theli.getElementsByTagName('ul');
		theul[0].style.display = 'block';
		var thea = theli.getElementsByTagName('a');
		thea[0].className = 'ulopen';
		
		currenul = obj;
		
	}else{
		var theli = document.getElementById(obj);
		var theul = theli.getElementsByTagName('ul');
		theul[0].style.display = 'none';
		var thea = theli.getElementsByTagName('a');
		thea[0].className = '';
		
		currenul = '';
	}
}

function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') window.onload = func;
	else {
		window.onload = function() {
			oldonload();
			func();
		}
	}
}

function windowLinks() {
    if(!document.getElementsByTagName) return;
    var anchors = document.getElementsByTagName("a");
    for (var i=0; i<anchors.length; i++) {
        var anchor = anchors[i];
        var relIndex = anchor.rel;
		if (relIndex) {
			var relSplit = relIndex.split("|");          
			if (relSplit[0] == "external") { 
				anchor.target = "_blank";
			}else if (relSplit[0] == "popup") {
				anchor.popupWidth = relSplit[1];
				anchor.popupHeight = relSplit[2];
				anchor.onclick = function() {
					var winchild = window.open('', 'Popup', 'width='+this.popupWidth+',height='+this.popupHeight);
					var tmp = winchild.document;
					tmp.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'+"\n");
					tmp.write('<html xmlns="http://www.w3.org/1999/xhtml">'+"\n");
					tmp.write('<html>'+"\n");
					tmp.write('	<head>'+"\n");
					tmp.write('		<title>ImageHolder | Pinewood</title>'+"\n");
					tmp.write('		<style type="text/css"> * { margin:0px; padding:0px; border:0px; } </style>'+"\n");
					tmp.write('	</head>'+"\n");
					tmp.write('	<body>'+"\n");
					tmp.write('		<p><a href="javascript:self.close()"><img src="'+this.href+'" alt="Click to close" width="'+this.popupWidth+'" height="'+this.popupHeight+'" /></a></p>'+"\n");
					tmp.write('	</body>'+"\n");
					tmp.write('</html>'+"\n");
					tmp.close();
					winchild.focus();
					return false;
				}
			}
		}
	}
} 

addLoadEvent(windowLinks);