
function pop_up_picture(imageType,imageName,imageWidth,imageHeight,alt,posLeft,posTop) {
    screenh = window.screen.height;
    screenw = window.screen.width;
    posLeft = (screenw-imageWidth)/2;
    posTop = (screenh-imageHeight)/2;
    theWindow = window.open("","theWindow","width="+imageWidth+",height="+imageHeight+",scrollbars=no,left="+posLeft+",top="+posTop);
    theWindow.document.open();
    theWindow.document.write('<html><title>'+alt+'</title><body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" onBlur="self.close()">');
    theWindow.document.write('<img src="'+imageName+'" width='+imageWidth+' height='+imageHeight+' alt="'+alt+'" onClick="javascript:window.self.close();" galleryimg="no">');
    theWindow.document.write('</body></html>');
    theWindow.document.close();
    theWindow.focus()
}

function popup(u,w,h){
    var ww=640;
    var wh=480;
    if (document.all || document.layers) {
    ww = screen.availWidth;
    wh = screen.availHeight;
    }
    var pl = (ww-w)/2, pt = (wh-h)/2;
    var a = "toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=" + w + ",height=" + h + ",left="+pl+",top="+pt;
    window.open(u,'',a);
}
function popupform(fm, wn){
    if (!window.focus){
    return true;
    }else{
    var w=300,h=150,ww=640,wh=480;
    if (document.all || document.layers) {
    ww = screen.availWidth;
    wh = screen.availHeight;
    }
    var pl = (ww-w)/2, pt = (wh-h)/2;
    var a = "toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=" + w + ",height=" + h + ",left="+pl+",top="+pt;
    pw = window.open('',wn,a);
    pw.focus();
    fm.target=wn;
    }
    return true;
}

function clickImg( id )
{
    var mainImg = document.getElementById( id );
    var oldSrc = mainImg.src;
    oldSrc = oldSrc.replace('/small/', '/');
    var imgName = oldSrc.substring( oldSrc.lastIndexOf('/') + 1 );
    var imgPath = oldSrc.substring( 0, oldSrc.lastIndexOf('/') );
    //window.open( imgPath + '/big/' + imgName );
    window.open('/showpic.jsp?image='+imgPath + '/big/' + imgName, 'ShowPicture', 'height=255,width=250,toolbar=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1');
}