var Prototype={Version:"1.5.0_rc0",ScriptFragment:"(?:<script.*?>)((\n|\r|.)*?)(?:</script>)",emptyFunction:function(){},K:function(x){return x;}};var Class={create:function(){return function(){this.initialize.apply(this,arguments);};}};Function.prototype.bind=function(_2){var _3=this;return function(){return _3.apply(_2,arguments);};};Object.extend=function(_4,_5){for(var _6 in _5){_4[_6]=_5[_6];}return _4;};function $(){var _7=[],element;for(var i=0;i<arguments.length;i++){element=arguments[i];if(typeof element=="string"){element=document.getElementById(element);}_7.push(Element.extend(element));}return _7.length<2?_7[0]:_7;}if(!window.Element){var Element=new Object();}Element.extend=function(_9){if(!_9){return;}if(_nativeExtensions){return _9;}if(!_9._extended&&_9.tagName&&_9!=window){var _a=Element.Methods,cache=Element.extend.cache;for(property in _a){var _b=_a[property];if(typeof _b=="function"){_9[property]=cache.findOrStore(_b);}}}_9._extended=true;return _9;};Element.extend.cache={findOrStore:function(_c){return this[_c]=this[_c]||function(){return _c.apply(null,[this].concat($A(arguments)));};}};Element.Methods={hide:function(){for(var i=0;i<arguments.length;i++){var _e=$(arguments[i]);_e.style.display="none";}},show:function(){for(var i=0;i<arguments.length;i++){var _10=$(arguments[i]);_10.style.display="";}}};var _nativeExtensions=false;Element.addMethods=function(_11){Object.extend(Element.Methods,_11||{});if(typeof HTMLElement!="undefined"){var _12=Element.Methods,cache=Element.extend.cache;for(property in _12){var _13=_12[property];if(typeof _13=="function"){HTMLElement.prototype[property]=cache.findOrStore(_13);}}_nativeExtensions=true;}};Element.addMethods();var $A=Array.from=function(_14){if(!_14){return [];}if(_14.toArray){return _14.toArray();}else{var _15=[];for(var i=0;i<_14.length;i++){_15.push(_14[i]);}return _15;}};var JPGMAG={prepareLogin:function(){var div=document.createElement("div");div.fx=new fx.Opacity(div);Element.extend(div);div.id="loginform";div.className="login";div.fx.hide();div.innerHTML="<form method=\"POST\" action=\"/login.html\">"+"<label for=\"user\">Username </label><input type=\"text\" class=\"input\" id=\"user\" name=\"user\" size=\"14\" />"+"<label for=\"password\">Password </label><input type=\"password\" class=\"input\" id=\"password\" name=\"password\" size=\"14\" />"+"<input type=\"hidden\" name=\"process\" value=\"TRUE\" />"+"<input type=\"submit\" value=\"  Log In  \" class=\"submit\" /><a href=\"#\" id=\"cancel\" onclick=\"this.parentNode.parentNode.fx.toggle();\">Cancel</a></form>";var el=$("meta");var lis=el.getElementsByTagName("li");for(var i=0;i<lis.length;i++){if(lis[i].nodeType==1&&lis[i].className=="metalog"){lis[i].parentNode.parentNode.appendChild(div);lis[i].onclick=function(){div.fx.toggle();setTimeout("$('user').focus()",50);return false;};return;}}}};var Ajax=function(url,_1c){var _1d;try{_1d=new XMLHttpRequest();}catch(e){try{_1d=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{_1d=new ActiveXObject("Microsoft.XMLHTTP");}catch(e){_1d=false;}}}var _1e=_1c.onComplete||function(){};var _1f=_1c.method||"get";var _20=_1c.params||null;if(_1f=="get"&&_20){url+="?"+_20;_20=null;}_1d.onreadystatechange=function(){if(_1d.readyState==4){_1e(_1d.responseText);}};_1d.open(_1f,url,true);_1d.send(_20);};Date.prototype.addYear=function(){this.setTime(this.getTime()+365*24*60*60*1000);return this;};var SNOOK={};SNOOK.setCookie=function(_23,_24,_25){var _26="jpgmag.com";var _27=_23+"="+escape(_24)+((_25)?"; expires="+_25.toGMTString():"")+((_26)?"; domain="+_26:"")+"; path=/";document.cookie=_27;};SNOOK.getCookie=function(_28){var _29=_28+"=";var c=document.cookie;var _2b="";var _2c=c.indexOf(_29);if(_2c==-1){return _2b;}var _2d=c.indexOf(";",_2c+_29.length);if(_2d==-1){_2d=c.length;}return unescape(c.substring(_2c+_29.length,_2d));};var fx=new Object();fx.Base=function(){};fx.Base.prototype={setOptions:function(_2e){this.options={duration:500,onComplete:"",transition:fx.sinoidal};Object.extend(this.options,_2e||{});},step:function(){var _2f=(new Date).getTime();if(_2f>=this.options.duration+this.startTime){this.now=this.to;clearInterval(this.timer);this.timer=null;if(this.options.onComplete){setTimeout(this.options.onComplete.bind(this),10);}}else{var _30=(_2f-this.startTime)/(this.options.duration);this.now=this.options.transition(_30)*(this.to-this.from)+this.from;}this.increase();},custom:function(_31,to){if(this.timer!=null){return;}this.from=_31;this.to=to;this.startTime=(new Date).getTime();this.timer=setInterval(this.step.bind(this),13);},hide:function(){this.now=0;this.increase();},clearTimer:function(){clearInterval(this.timer);this.timer=null;}};fx.Layout=Class.create();fx.Layout.prototype=Object.extend(new fx.Base(),{initialize:function(el,_34){this.el=$(el);this.el.style.overflow="hidden";this.iniWidth=this.el.offsetWidth;this.iniHeight=this.el.offsetHeight;this.setOptions(_34);}});fx.Height=Class.create();Object.extend(Object.extend(fx.Height.prototype,fx.Layout.prototype),{increase:function(){this.el.style.height=this.now+"px";},toggle:function(){if(this.el.offsetHeight>0){this.custom(this.el.offsetHeight,0);}else{this.custom(0,this.el.scrollHeight);}}});fx.Opacity=Class.create();fx.Opacity.prototype=Object.extend(new fx.Base(),{initialize:function(el,_36){this.el=$(el);this.now=1;this.increase();this.setOptions(_36);},increase:function(){if(this.now==1&&(/Firefox/.test(navigator.userAgent))){this.now=0.9999;}this.setOpacity(this.now);},setOpacity:function(_37){if(_37==0&&this.el.style.visibility!="hidden"){this.el.style.visibility="hidden";}else{if(this.el.style.visibility!="visible"){this.el.style.visibility="visible";}}if(window.ActiveXObject){this.el.style.filter="alpha(opacity="+_37*100+")";}this.el.style.opacity=_37;},toggle:function(){if(this.now>0){this.custom(1,0);}else{this.custom(0,1);}}});fx.Bg=Class.create();fx.Bg.prototype=Object.extend(new fx.Base(),{initialize:function(el,ops){this.el=$(el);this.now=0;this.setOptions(ops);if(!this.options.bgStart)this.options.bgStart="#ffcc00";if(!this.options.bgEnd)this.options.bgEnd="#ffffff";this.redStart=parseInt(this.options.bgStart.substr(1,2),16);this.greenStart=parseInt(this.options.bgStart.substr(3,2),16);this.blueStart=parseInt(this.options.bgStart.substr(5,2),16);this.redEnd=parseInt(this.options.bgEnd.substr(1,2),16);this.greenEnd=parseInt(this.options.bgEnd.substr(3,2),16);this.blueEnd=parseInt(this.options.bgEnd.substr(5,2),16);this.redDiff=this.redEnd-this.redStart;this.greenDiff=this.greenEnd-this.greenStart;this.blueDiff=this.blueEnd-this.blueStart;},increase:function(){var red=Math.floor(this.now*this.redDiff)+this.redStart;red=red.toString(16);if(red.length==1)red='0'+red;var green=Math.floor(this.now*this.greenDiff)+this.greenStart;green=green.toString(16);if(green.length==1)green='0'+green;var blue=Math.floor(this.now*this.blueDiff)+this.blueStart;blue=blue.toString(16);if(blue.length==1)blue='0'+blue;this.el.style.backgroundColor='#'+red+green+blue;},flash:function(){this.timer=null;this.custom(0,1);}});fx.sinoidal=function(pos){return ((-Math.cos(pos*Math.PI)/2)+0.5);};var ElementReady=new function(){var _39=[];var _3a=null;var _3b=false;var _3c=function(){clearTimeout(this.timer);this.timerStarted=false;};var _3d=function(){if(!this.timerStarted){this.timer=setTimeout(function(){ElementReady.check(false);},100);this.timerStarted=true;}};return {check:function(_3e){for(var i=0;i<_39.length;i++){if(document.getElementById(_39[i]["element"])){_39[i]["callback"]();_39.splice(i--,1);}else{if(_3e){_39.splice(i--,1);}}}if(_39.length==0){_3c();}},cleanUp:function(){this.check(true);_3c();},chkDomId:function(_40,_41){if(document.getElementById){var el=document.getElementById(_40);if(el){_41();}else{_39[_39.length]={"element":_40,"callback":_41};_3d();}}}};};document.getElementsByClassName=function(_42,_43){var _44=($(_43)||document.body).getElementsByTagName('*');var _45=[],_46,_47=new RegExp("(^|\\s)"+_42+"(\\s|$)");for(var i=0,length=_44.length;i<length;i++){_46=_44[i];var _48=_46.className;if(_48.length == 0)continue;if(_48==_42||_48.match(_47))_45.push(Element.extend(_46));}return _45;};ElementReady.chkDomId("meta",JPGMAG.prepareLogin);window.onload=function(){ElementReady.cleanUp();};