var NN = (navigator.userAgent.indexOf("Mozilla") != -1 && parseInt(navigator.appVersion) >= 5 && navigator.appName == "Netscape");
var IE = (navigator.userAgent.indexOf("Mozilla") != -1 && parseInt(navigator.appVersion) >= 4 && navigator.userAgent.indexOf("MSIE") != -1);
var chooseimage = new Image();
var images_fn = '';
var images_t  = '';
var images_x  = 0;
var images_y  = 0;
function md(e) {
    if(NN) {
        images_x = e.pageX;
        images_y = e.pageY;
    }
    if(IE) {
        images_x = event.clientX + document.body.scrollLeft;
        images_y = event.clientY + document.body.scrollTop;
    }
    chooseimage.src = "/p/images.cgi?mode=choose&fn=" + images_fn + "&t=" + images_t + "&x=" + images_x + "&y=" + images_y;
}
function claimmousedown(fn, t) {
    if(IE || NN) {
        if (fn) { images_fn = fn; }
        if (t)  { images_t  = t;  }
        document.onmouseup = md; //changed onmousedown to onmouseup to avoid potential drag problem
    }
}
