Biblio=function(id){this.ns4 =(document.layers);this.ie4 =(document.all&&!document.getElementById);this.ie5=(document.all&&document.getElementById);this.ns6=(!document.all&&document.getElementById);this.mac=(navigator.appVersion.indexOf("Mac")>=0)?1:0;this.dom=(document.getElementById)?1:0;this.ie=(this.ie4||this.ie5)?1:0;if(eval("id")){this.currentLayer=this.getLayer(id);this.idLayer=this.getIdLayer(id);}}
var biblio=new Biblio();
Biblio.prototype.getLayer=function(id){var retVal;if(this.ns4)retVal=document.layers[id];else if(this.ie4)retVal=document.all[id].style;else if(this.dom)retVal=document.getElementById(id).style;return retVal;}
Biblio.prototype.getIdLayer=function(id){var retVal;if(this.ns4)retVal=document.layers[id];else if(this.ie4)retVal=document.all[id];else if(this.dom)retVal=document.getElementById(id);return retVal;}
Biblio.prototype.getAnchorObj=function(AnchorName){var retVal;if(this.dom)retVal=document.getElementById(AnchorName);else if(this.ie4)retVal=document.all[AnchorName];else if(this.ns4)retVal=document.anchors[AnchorName];return retVal;}
Biblio.prototype.setLeft=function(x,id){eval("id")?this.getLayer(id).left=x:this.currentLayer.left=x;}
Biblio.prototype.setTop=function(y,id){eval("id")?this.getLayer(id).top=y:this.currentLayer.top=y;}
Biblio.prototype.setTopLeft=function(x,y,id){var currentObject=eval("id")?this.getLayer(id):this.currentLayer;currentObject.top =x;currentObject.left=y;}
Biblio.prototype.setWidth=function(w,id){eval("id")?this.getLayer(id).width=w:this.currentLayer.width=w;}
Biblio.prototype.setHeight=function(h,id){eval("id")?this.getLayer(id).height=h:this.currentLayer.height=h;}
Biblio.prototype.setZ=function(z,id){eval("id")?this.getLayer(id).zIndex=z:this.currentLayer.zIndex=z;}
Biblio.prototype.showHide=function(s,id){eval("id")?this.getLayer(id).visibility=s:this.currentLayer.visibility=s;}
Biblio.prototype.setClip=function(myClip,id){var currentObject=eval("id")?this.getLayer(id):this.currentLayer;if(!this.ns4)currentObject.clip="rect(" + myClip[0] + "px " + myClip[1] + "px " + myClip[2] + "px " + myClip[3] + "px)";  else{currentObject.clip.top=myClip[0];currentObject.clip.right=myClip[1];currentObject.clip.bottom=myClip[2];currentObject.clip.left=myClip[3];}}
Biblio.prototype.getLeft=function(id){var currentObject=eval("id")?this.getLayer(id):this.currentLayer;var retLeft;if(!this.ns4&&!this.mac)retLeft=parseInt(currentObject.left.substring(0,currentObject.left.indexOf("p")));else if(this.dom&&this.mac&&!this.ie)retLeft=parseInt(currentObject.left.substring(0,currentObject.left.indexOf("p")));else retLeft=parseInt(currentObject.left);return retLeft;}
Biblio.prototype.getTop=function(id){var currentObject=eval("id")?this.getLayer(id):this.currentLayer;var retTop;if(!this.ns4&&!this.mac)retTop=parseInt(currentObject.top.substring(0,currentObject.top.indexOf("p")));else if(this.dom&&this.mac&&!this.ie)retTop=parseInt(currentObject.top.substring(0,currentObject.top.indexOf("p")));else retTop=parseInt(currentObject.top);return retTop;}
Biblio.prototype.getWidth=function(id){var currentObject=eval("id")?id:this.idLayer.id;var retWidth;if((this.ie5&&!this.mac)||this.ns6)retWidth=document.getElementById(currentObject).offsetWidth;else if(this.ie4)retWidth=document.all[currentObject].clientWidth;else if(this.ns4)retWidth=document.layers[currentObject].clip.width;else if(this.ie5&&this.mac)retWidth=document.all[currentObject].offsetWidth;else retWidth=document.getElementById(currentObject).offsetWidth;return retWidth;}
Biblio.prototype.getHeight=function(id){var currentObject=eval("id")?id:this.idLayer.id;var retHeight;if((this.ie5&&!this.mac)||this.ns6)retHeight=document.getElementById(currentObject).offsetHeight;else if(this.ie4)retHeight=document.all[currentObject].clientHeight;else if(this.ns4)retHeight=document.layers[currentObject].clip.height; else if(this.ie5&&this.mac)retHeight=document.all[currentObject].offsetHeight;else retHeight=document.getElementById(currentObject).offsetHeight;return retHeight;}
Biblio.prototype.getAnchorLeft=function(AnchorObj){if(this.dom||this.ie4){if(AnchorObj.offsetParent)return(AnchorObj.offsetLeft + biblio.getAnchorLeft(AnchorObj.offsetParent));else return(AnchorObj.offsetLeft);} if(this.ns4)return(AnchorObj.x);}
Biblio.prototype.getAnchorTop=function(AnchorObj){if(this.dom||this.ie4){if(AnchorObj.offsetParent)return(AnchorObj.offsetTop + biblio.getAnchorTop(AnchorObj.offsetParent));else return(AnchorObj.offsetTop);} if(this.ns4)return(AnchorObj.y);}
Biblio.prototype.setToAnchor=function(AnchorName,id,x,y){var deltaX=(eval("x"))?x:0;var deltaY=(eval("y"))?y:0;var AnchorObj=biblio.getAnchorObj(AnchorName);biblio.setLeft(biblio.getAnchorLeft(AnchorObj)+ deltaX,id);biblio.setTop(biblio.getAnchorTop(AnchorObj)+ deltaY,id);}
Biblio.prototype.getAnchorPositions=function(AnchorName){var anchorPos=[];var dynLyrPos=document.write('<div id="anchorPos_'+AnchorName+'" style="position:absolute;visibility:visible;">getPosition_'+AnchorName+'</div>');this.setToAnchor(AnchorName,"anchorPos_"+AnchorName);anchorPos["left"]=this.getLeft("anchorPos_"+AnchorName);anchorPos["top"]=this.getTop("anchorPos_"+AnchorName);return anchorPos;}
String.prototype.trim = function() { return this.replace(/^\s+|\s+$/, ''); };
String.prototype.LTrim = function ( value ) {var re = /\s*((\S+\s*)*)/;	return value.replace(re, "$1");}
String.prototype.RTrim = function ( value ) {var re = /((\s*\S+)*)\s*/;	return value.replace(re, "$1");}

function openWindow(url){
	_openWindow(url,"theWindow", 800, 800, "yes", "yes");
}

function _openWindow(url, win, width, height, scroll, resize)
{
	var txt = "screenX=0,screenY=0,top=0,left=0,scrollbars="+scroll+",resizable="+resize+",status=yes,width="+width+",height="+height;
	
    if(navigator.appName == "Netscape") 
    {//moz
        popWin = window.open(url,win,txt);
        popWin.focus();
    }
    else
    {  //ie
       if (navigator.userAgent.indexOf("MSIE 3") >= 0)
       { 
           popWin = window.open(url,win,txt);
           popWin.location.href = url;
           //if (popWin.opener == null) popWin.opener = window; 
           //popWin.opener.name = "opener";
		   popWin.focus();
       }
       else
       {
           var popWin = window.open(url,win,txt);
		   popWin.focus();
       }
   }       
}


var pageIsLoaded = 0;

function showHideLyr(action,lyr)
{
	fixLyr();
	hideAll();
	biblio.showHide(action,lyr);
}

function showLyr(lyr)
{
	biblio.showHide("visible",lyr);
}

function hideLyr(lyr)
{
	biblio.showHide("hidden",lyr);
}

function hideAll()
{
	biblio.showHide("hidden","dropmenu1");
	biblio.showHide("hidden","dropmenu2");
	biblio.showHide("hidden","dropmenu3");
}

function setAnchor(a,l,x,y)
{
	biblio.setToAnchor(a,l,x,y);
}

function fixLyr()
{
	biblio.setToAnchor("dropmenu","dropmenu1",1,0);
	biblio.setToAnchor("dropmenu","dropmenu2",319,0);
	biblio.setToAnchor("dropmenu","dropmenu3",637,0);
}

function dmenuInit()
{
	document.pageIsLoaded=1;
	fixLyr();	
}


