function lib_bwcheck(){
        this.ver=navigator.appVersion
        this.agent=navigator.userAgent
        this.dom=document.getElementById?1:0
        this.opera5=this.agent.indexOf("Opera 5")>-1
        this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0;
        this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
        this.ie4=(document.all && !this.dom && !this.opera5)?1:0;
        this.ie=this.ie4||this.ie5||this.ie6
        this.mac=this.agent.indexOf("Mac")>-1
        this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0;
        this.ns4=(document.layers && !this.dom)?1:0;
        this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5)
        return this
}
    bw=new lib_bwcheck()
var px = bw.ns4||window.opera?"":"px";

if(navigator.userAgent.indexOf('Opera')>-1 && document.getElementById){ //Opera 5 resize fix.
        scrX= innerWidth; scrY= innerHeight;
        document.onmousemove= function(){
                if(scrX<innerWidth-10 || scrY<innerHeight-10 || scrX>innerWidth+10 || scrY>innerHeight+10){
                        scrX = innerWidth;
                        scrY = innerHeight;

                }
        };
}

//object constructor:

function makeDiv(obj,nest){
        nest= (!nest)?"":'document.'+nest+'.';
        this.el= bw.ie4?document.all[obj]:bw.ns4?eval(nest+'document.'+obj):document.getElementById(obj);
        this.css= bw.ns4?this.el:this.el.style;
        this.ref= bw.ns4?this.el.document:document;
        if(bw.ns4||bw.opera5)this.x= this.css.left;
        //to determine the position of an element,
        //in ns5+/ie looping thru all parent elements is necessary:
        else {
        var x= this.el.offsetLeft;
        var elm= this.el;
            while (elm.offsetParent){
            elm = elm.offsetParent;
            x += elm.offsetLeft;
            }
        this.x=x;
        }
        if(bw.ns4||bw.opera5)this.y= this.css.top;
        else {
        var y= this.el.offsetTop;
        var elm= this.el;
            while (elm.offsetParent){
            elm = elm.offsetParent;
            y += elm.offsetTop;
            }
        this.y=y;
        }

        this.hidd= b_hidd;
        this.hideIt= b_hideIt;
        this.showIt= b_showIt;
        this.moveIt= b_moveIt;
        return this
}

//object methods:

function b_showIt(){this.css.visibility='visible'}
function b_hideIt(){this.css.visibility='hidden'}
function b_hidd(){if(this.css.visibility=='hidden' || this.css.visibility=='hidden' || this.css.visibility=='hide') return true;}
function b_moveIt(x,y){this.css.left=x; this.css.top=y+px;}//

//Making the encapsulating div object:

function make(divID){
if(!bw.ns4){ //

        eval("o" + divID + "= new makeDiv('" + divID + "')");
}
}

//Moving and showing the preview-image:

function show(thumbID,prevID,picSrc) {
if(!bw.ns4){
/*values below define the relative offset of the preview-image to the thumbnail*/
var xof = 81;
var yof = -45;
eval("o" + thumbID + "= new makeDiv('" + thumbID + "')");
if (document.images['preview'].src!="images/shim.gif")document.images['preview'].src="images/shim.gif";
eval("var hello =o" + thumbID + ".x+xof");
eval("o" + prevID + ".moveIt(hello,(o" + thumbID + ".y+yof))");
eval("o" + prevID + ".showIt()");
document.images['preview'].src=picSrc;
}
}

function _show(thumbID,prevID) {
if(!bw.ns4){
/*values below define the relative offset of the preview-image to the thumbnail*/
var xof = -40;
var yof = -5;
eval("o" + thumbID + "= new makeDiv('" + thumbID + "')");
eval("var hello =o" + thumbID + ".x+xof");
eval("o" + prevID + ".moveIt(hello,(o" + thumbID + ".y+yof))");
eval("o" + prevID + ".showIt()");
}
}
//Hiding objects:

function hide(divID){
eval("o" + divID + ".hideIt()");
}

