/*
***************************************
* PopupLayerPic
***************************************

Author:			Keegan Rowe
Version:			1.3
Date Created:	01/06/2007
Last Modified:	03/03/2008

Purpose:
	PopupLayerPic is a javascript function that will allow an image to be displayed
	on the page in a layered div. The common use of the script to show an enlarged
	version of an image on the screen rather than using a standard popup screen
	that can often by blocked by browers.

Compatibility:
	IE7, IE6, Firefox 1.5, Firefox 2.0, Safari. More browsers may work but are
	currently untested.

Requirements:
	The only real requirement is the doctype of the website. Use loose.

Changelog:
	1.0 - Created script
	1.1 - Fixed a problem where the loaded image would not show up due to an
			incompatibility with Safari (image.complete method)
	1.2 - Put in the timer so that the script does not infinitely loop trying
			to show an image that cannot be loaded
	1.3 - Reprogrammed CheckPopupLayerPicSize() so it will dynamically check
			the size of the popup layer and and if it is too large it will
			resize the loaded image to make it fit on the users screen. To turn
			this functionality off, set the bDynamicResize variable to false;
*/

// Use this variable the time we wait before alerting the usre that their image
// is not loading correctly. Set the timer to 0 to disable the timer facility
var iTimerSeconds	= 30;

// Use this variable to set whether or not the script should attempt to look
// at the users current resolution and resize the enlarged picture so that
// it will fit on their screen
var bDynamicResize = true;

// Use this variable to set whether debug mode is on or not. It will issue many
// alerts that cover what is happening as the script is executed
var bDebugMode = false;

eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('u v(a){j b,i;j c;6.8("C").l.o="y";6.8("K").l.o="y";5(9)h("v :: L 1u W p");c=\'<1v w="\'+a+\'" 1w="" 1x="0" 1y="k" />\';6.8("C").1z=c;5(9)h("v :: L 1A W p w");6.8("M").l.o="";5(9)h("v :: L 1B 1C p");6.8("q").l.o="";5(9)h("v :: N 1D 1E D");O();5(9)h("v :: X 1F D (1G)");Y(\'s(0)\',Z);5(9)h("v :: X \'1H\' 1I D 1J")}u O(){j a,i;a=6.8("q").10;i=6.8("q").11;5(9)h("1 :: P :: 12 13 m :: "+a);5(9)h("1 :: i :: 12 13 r :: "+i);a=E.14(a/2);i=E.14(i/2);5(9)h("2 :: P :: 15 16 2 :: "+a);5(9)h("2 :: i :: 15 16 2 :: "+i);i=i-17();5(9)h("3 :: i :: 1K 1L 1M :: "+i);5(a>0){a="-"+a+"z"}B{a=E.18(a)+"z"}5(i>0){i="-"+i+"z"}B{i=E.18(i)+"z"}5(9)h("4 :: P :: 19 1a :: "+a);5(9)h("4 :: i :: 19 1a :: "+i);6.8("q").l.1N=a;6.8("q").l.1O=i}u s(a){5(9)h("s :: 1b");5(9)h("s :: F? "+6.8("k").F);5(9)h("s :: w > 0? "+(6.8("k").w.1c>0));5(9)h("s :: 1d :: "+a);j b=G;j c="";5(a>1e*2&&1e!=0){5(9)h("s :: 1d Q R - 1P 1Q");c=c+"1R p 1S t 1T 1U a 1V 1W 1X 1Y t 1f.\\n\\n";c=c+"1Z x 20 1g A p 21 x 22 23 1h 1g A p 24 25 1f 26.\\n\\n";c=c+"27 28 29 t 2a t 2b?";5(!2c(c)){6.8("k").w="";1i();b=S}B{a=0}}5(!b){a++;5(6.8("k").F&&6.8("k").w.1c>0){5(9)h("s :: x F 1h 2d w");T()}B{Y(\'s(\'+a+\')\',Z)}}}u H(){5(2e){j a=6.8("q").11;j b=6.8("q").10;j c=U.1j.r-2f;j d=U.1j.m-2g;j e=6.8("k").r;j f=6.8("k").m;j g=0;5(9)h(\'2h :: \'+a);5(9)h(\'2i :: \'+c);5(9)h(\'2j :: \'+e);5(a>c){e=e-(a-c);g=e/6.8("k").r;5(9)h("I p r J 1k x Q R");6.8("k").r=e;5(9)h("I p m t A 1l 1m J A r ("+g+"%)");5(9)h("1n 1o : "+f);f=f*g;f=f.1p(0);5(9)h("1n N x : "+f);5(9)h("1q 1r m t "+f+"z");6.8("k").m=f;H();V G}5(b>d){f=f-(b-d);g=f/6.8("k").m;6.8("k").m=f;5(9)h("I p m J 1k x Q R");5(9)h("I p r t A 1l 1m J A m ("+g+"%)");5(9)h("1s 1o : "+e);e=e*g;e=e.1p(0);5(9)h("1s N x : "+e);5(9)h("1q 1r r t "+e+"z");6.8("k").r=e;H();V G}}}u T(){5(9)h("T :: 1b");6.8("M").l.o="y";6.8("C").l.o="";6.8("K").l.o="";H();O()}u 1i(){6.8("C").l.o="y";6.8("K").l.o="y";6.8("M").l.o="";6.8("q").l.o="y";6.8("q").m=6.8("2k").m}u 17(){j a=6.2l?S:G;5(2m.2n.2o(\'2p/7.0\')!=-1)j b=S;D=6.8("q");j c=0;5(a)c=6.2q.1t;B c=6.2r.2s.1t;5(b)c=U.2t;V c}',62,154,'|||||if|document||getElementById|bDebugMode||||||||alert|iDivHeight|var|PopupLayerImage|style|width||display|image|PopupLayer|height|CheckPopupLayerPic|to|function|PopupLayerPic|src|is|none|px|the|else|PopupLayerImageDiv|layer|Math|complete|false|CheckPopupLayerPicSize|Adjusting|as|PopupLayerText|Just|PopupLayerLoadingPic|now|RecentrePopupLayer|iDivWidth|too|large|true|ShowPopupLayerPic|window|return|main|just|setTimeout|500|offsetWidth|offsetHeight|overall|div|floor|divided|by|GetScrollTop|abs|final|figure|start|length|counter|iTimerSeconds|load|that|and|HidePopupLayer|screen|it|same|percentage|Width|was|toFixed|Setting|calculated|Height|scrollTop|hid|img|alt|border|id|innerHTML|set|showed|loading|showing|entire|resized|apparently|checkeded|popup|pic|with|top|scroll|marginLeft|marginTop|asking|question|The|appears|be|taking|considerable|amount|of|time|It|possible|path|not|valid|will|never|successfully|Do|you|wish|continue|wait|confirm|have|bDynamicResize|250|100|iLayerHeight|iWindowHeight|iImageHeight|PopupLayerLogo|all|navigator|userAgent|indexOf|Netscape|documentElement|body|parentNode|pageYOffset'.split('|'),0,{}))