var msg="all images and text are copyright protected";
function click(e) {
    if (document.all) {
		if (event.button == 2) {
			alert(msg);
			return false;
		}
	}
	else if (document.layers) {
		if (e.which == 3) {
			alert(msg);
			return false;
		}
	}
	else {
		if (e.button == 2) {
			alert(msg);
			return false;
		}
	}
}
if (document.layers) {
	document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=click;

window.onload = function() {
    var links = getElementsByClass('popup');

    for(i=0; i < links.length; i++) {            
        links[i].onclick= function(){                
            return popup(this.href,'adminwin');
        }
    }
}


function popup(mylink, windowname, width, height)
{
    if (! window.focus)return true;
    var href;
    if (typeof(mylink) == 'string')
       href=mylink;
    else
       href=mylink.href;

    if (width == null )
        width = 900;
    if (height == null )
        height = 710;
    window.open(href, null, 'width='+ width +',height='+ height +',top=100,left=100,noresize,scrollbars=no,toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0');
    return false;
}


function getElementsByClass(searchClass,node,tag) 
{
    var classElements = new Array();
    if ( node == null )
        node = document;
    if ( tag ==  null )
        tag = '*';
    var els = node.getElementsByTagName(tag);
    var elsLen = els.length;
    var pattern = new RegExp('(^|\\s)'+searchClass+'(\\s|$)');
    for (i = 0, j = 0; i < elsLen; i++) {
        if ( pattern.test(els[i].className) ) {
            classElements[j] = els[i];
            j++;
        }
    }
    return classElements;
}
