// JK Pop up image viewer script- By JavaScriptKit.com
// Visit JavaScript Kit (http://javascriptkit.com)
// for free JavaScript tutorials and scripts
// This notice must stay intact for use

var popbackground="white" //specify backcolor or background image for pop window
var windowtitle="Image Window"  //pop window title

function detectexist(obj){
return (typeof obj !="undefined")
}

function jkpopimage(imgpath, popwidth, popheight, textdescription){

function getpos(){
leftpos=(detectexist(window.screenLeft))? screenLeft+document.body.clientWidth/2-popwidth/2 : detectexist(window.screenX)? screenX+innerWidth/2-popwidth/2 : 0
toppos=(detectexist(window.screenTop))? screenTop+document.body.clientHeight/2-popheight/2 : detectexist(window.screenY)? screenY+innerHeight/2-popheight/2 : 0
if (window.opera){
leftpos-=screenLeft
toppos-=screenTop
}
}

getpos()
var winattributes='width='+popwidth+',height='+popheight+',resizable=yes,left='+leftpos+',top='+toppos
var bodyattribute=(popbackground.indexOf(".")!=-1)? 'background="'+popbackground+'"' : 'bgcolor="'+popbackground+'"'
if (typeof jkpopwin=="undefined" || jkpopwin.closed)
jkpopwin=window.open("","",winattributes)
else{
//getpos() //uncomment these 2 lines if you wish subsequent popups to be centered too
//jkpopwin.moveTo(leftpos, toppos)
jkpopwin.resizeTo(popwidth, popheight+30)
}
jkpopwin.document.open()
jkpopwin.document.write('<html><head><title>'+windowtitle+'</title><link rel="stylesheet" href="/includes/emx_nav_right.css" type="text/css"></head><body '+bodyattribute+'><img src="'+imgpath+'" style="margin-bottom: 0.5em"><br><div align=center><h2>'+textdescription+'</h2></div></body></html>')
jkpopwin.document.close()
jkpopwin.focus()
}

//UDMv3.8.5

//*** DO NOT EDIT **************************************************************************
var tempEl;function getRealLeft(imgElem){if(ns4){xPos=imgElem.x;}else if(!exclude){xPos=eval(imgElem).offsetLeft;tempEl=eval(imgElem).offsetParent;while(tempEl!=null){xPos+=tempEl.offsetLeft;tempEl=tempEl.offsetParent;}}if(mac&&ie5){xPos+=parseInt(document.body.leftMargin);}return xPos;};function getRealTop(imgElem){if(ns4){yPos=imgElem.y;}else if(!exclude){yPos=eval(imgElem).offsetTop;tempEl=eval(imgElem).offsetParent;while(tempEl!=null){yPos+=tempEl.offsetTop;tempEl=tempEl.offsetParent;}}if(mac&&ie5){yPos+=parseInt(document.body.topMargin);}return yPos;};/*get offset position based on a function from http://www.webreference.com/js/column33/image.html*/var xPos=0;var yPos=0;var rImg;var rPosition=new Array;if(typeof document.images['anchor']!="undefined"&&typeof document.images['anchor']!=null){rImg=document.images['anchor'];};var fAry=new Array;var fj=0;var fImgs=document.images;var faryl=0;if(!exclude){faryl=fImgs.length;}for(var i=0;i<faryl;i++){if(fImgs[i].name=="freeanchor"){fAry[fj]=fImgs[i];fj++;}};var usingR=0;var usingRF=0;if(!exclude&&rImg){usingR=1;if((mac&&ie4)||(lin&&(op5||op6))||(kde&&KDEn<3)){ie4=0;ie=0;kde=0;exclude=1;}else if(ns4){xPos=getRealLeft(rImg);yPos=getRealTop(rImg);if(menuALIGN!="free"){menuALIGN="left";}absLEFT=xPos;absTOP=yPos;}else{xPos=getRealLeft(rImg);yPos=getRealTop(rImg);if(menuALIGN!="free"){menuALIGN="left";}absLEFT=xPos;absTOP=yPos;}}faryl=fAry.length;if(faryl>0&&menuALIGN=="free"){usingRF=1;if((mac&&ie4)||(lin&&(op5||op6))||(kde&&KDEn<3)){ie4=0;ie=0;kde=0;exclude=1;}else if(ns4){for(i=0;i<faryl;i++){xPos=getRealLeft(fAry[i]);yPos=getRealTop(fAry[i]);if(typeof mI[i]!="undefined"){mI[i][7]=xPos;mI[i][6]=yPos;}absLEFT=0;absTOP=0;}}else{for(i=0;i<faryl;i++){xPos=getRealLeft(fAry[i]);yPos=getRealTop(fAry[i]);if(typeof mI[i]!="undefined"){mI[i][7]=xPos;mI[i][6]=yPos;}absLEFT=0;absTOP=0;}}};var brTok="";if(ie4||(mac&&ie5)){brTok="ie4";}else if(ie5){brTok="ie5";}if(ns6||op7||kde){brTok="moz";}if(op6){brTok="op6";}if(op5){brTok="op5";}if(ns4){brTok="ns4";}if(!exclude){document.write('<script language="javascript1.2" type="text/javascript" src="'+baseHREF+'menu_'+brTok+'.js"></script>');}