<!--
function getElementsByClassName(oElm, strTagName, oClassNames){
    var arrElements = (strTagName == "*" && document.all)? document.all : 
    oElm.getElementsByTagName(strTagName);
    var arrReturnElements = new Array();
    var arrRegExpClassNames = new Array();
    if(typeof oClassNames == "object"){
        for(var i=0; i<oClassNames.length; i++){
            arrRegExpClassNames.push(new RegExp("(^|\\s)" + 
            oClassNames[i].replace(/\-/g, "\\-") + "(\\s|$)"));
        }
    }
    else{
        arrRegExpClassNames.push(new RegExp("(^|\\s)" + 
        oClassNames.replace(/\-/g, "\\-") + "(\\s|$)"));
    }
    var oElement;
    var bMatchesAll;
    for(var j=0; j<arrElements.length; j++){
        oElement = arrElements[j];
        bMatchesAll = true;
        for(var k=0; k<arrRegExpClassNames.length; k++){
            if(!arrRegExpClassNames[k].test(oElement.className)){
                bMatchesAll = false;
                break;                      
            }
        }
        if(bMatchesAll){
            arrReturnElements.push(oElement);
        }
    }
    return (arrReturnElements)
}

function winOpen(filename,wideness,tallness){
	theURL = filename;
//	theURL = "http://192.168.10.17:9933/cgi-bin/blank.html";
	winName = '';
	features = "width=" + wideness + ",height=" + tallness + ",scrollbars=no,toolbar=no,menubar=no,location=no,status=no";
	newWindow = window.open(theURL,winName,features);
	if (window.focus) {newWindow.focus()}
	newWindow.document.write('<html><head><title>Popup</title>');  
	newWindow.document.write('<style>body { margin:0; padding:0; }</style>');
	newWindow.document.write('</head><body>');
	newWindow.document.write('<img src=\"'+theURL+'\" />');
	newWindow.document.write('</body></html>');
	newWindow.document.close();
}
function popupImage(href,width,height) {
	winOpen(href,width,height);
	return false;
}
function replaceImageLinks(width,height) {
	var imagesList;
	if (imagesList = document.getElementById("imagesList")) {
		var aNode;
		for (var i=0;i<imagesList.childNodes.length;i++) {
			if (imagesList.childNodes[i].nodeType == 1) {
				if (imagesList.childNodes[i].childNodes[0].nodeType == 1) {
					aNode = imagesList.childNodes[i].childNodes[0];
				} else {
					aNode = imagesList.childNodes[i].childNodes[1];
				}
				aNode.onclick = function() {
					popupImage(this.getAttribute("href"),width,height);
					return false;
				}
			}
		}
	} else if (imagesList = getElementsByClassName(document,"a","imagepopup")) {
		for (var i=0;i<imagesList.length; i++) {
			imagesList[i].onclick = function() {
				switch(this.id) {
					case 'low':
						alert("low: "+this.getAttribute("href"));
					break;
					case 'preview':
						alert("preview: "+this.getAttribute("href"));
					break;
					case 'high':
						alert("high: "+this.getAttribute("href"));
					break;
				}
				return false;
			}
		}
	}
}
//-->

