/* http://www.JSON.org/json2.js
 * Public Domain. */
if(!this.JSON)this.JSON={};
(function(){function l(b){return b<10?"0"+b:b}function o(b){p.lastIndex=0;return p.test(b)?'"'+b.replace(p,function(f){var c=r[f];return typeof c==="string"?c:"\\u"+("0000"+f.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+b+'"'}function m(b,f){var c,d,g,j,i=h,e,a=f[b];if(a&&typeof a==="object"&&typeof a.toJSON==="function")a=a.toJSON(b);if(typeof k==="function")a=k.call(f,b,a);switch(typeof a){case "string":return o(a);case "number":return isFinite(a)?String(a):"null";case "boolean":case "null":return String(a);
case "object":if(!a)return"null";h+=n;e=[];if(Object.prototype.toString.apply(a)==="[object Array]"){j=a.length;for(c=0;c<j;c+=1)e[c]=m(c,a)||"null";g=e.length===0?"[]":h?"[\n"+h+e.join(",\n"+h)+"\n"+i+"]":"["+e.join(",")+"]";h=i;return g}if(k&&typeof k==="object"){j=k.length;for(c=0;c<j;c+=1){d=k[c];if(typeof d==="string")if(g=m(d,a))e.push(o(d)+(h?": ":":")+g)}}else for(d in a)if(Object.hasOwnProperty.call(a,d))if(g=m(d,a))e.push(o(d)+(h?": ":":")+g);g=e.length===0?"{}":h?"{\n"+h+e.join(",\n"+h)+
"\n"+i+"}":"{"+e.join(",")+"}";h=i;return g}}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+l(this.getUTCMonth()+1)+"-"+l(this.getUTCDate())+"T"+l(this.getUTCHours())+":"+l(this.getUTCMinutes())+":"+l(this.getUTCSeconds())+"Z":null};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()}}var q=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
p=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,h,n,r={"\u0008":"\\b","\t":"\\t","\n":"\\n","\u000c":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},k;if(typeof JSON.stringify!=="function")JSON.stringify=function(b,f,c){var d;n=h="";if(typeof c==="number")for(d=0;d<c;d+=1)n+=" ";else if(typeof c==="string")n=c;if((k=f)&&typeof f!=="function"&&(typeof f!=="object"||typeof f.length!=="number"))throw Error("JSON.stringify");return m("",
{"":b})};if(typeof JSON.parse!=="function")JSON.parse=function(b,f){function c(g,j){var i,e,a=g[j];if(a&&typeof a==="object")for(i in a)if(Object.hasOwnProperty.call(a,i)){e=c(a,i);if(e!==undefined)a[i]=e;else delete a[i]}return f.call(g,j,a)}var d;b=String(b);q.lastIndex=0;if(q.test(b))b=b.replace(q,function(g){return"\\u"+("0000"+g.charCodeAt(0).toString(16)).slice(-4)});if(/^[\],:{}\s]*$/.test(b.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){d=eval("("+b+")");return typeof f==="function"?c({"":d},""):d}throw new SyntaxError("JSON.parse");}})();

/* Copyright (c) 2010 Marcus Westin store.js @ 
 * https://github.com/marcuswestin/store.js */
var store=function(){var b={},e=window,g=e.document,c;b.disabled=false;b.set=function(){};b.get=function(){};b.remove=function(){};b.clear=function(){};b.transact=function(a,d){var f=b.get(a);if(typeof f=="undefined")f={};d(f);b.set(a,f)};b.serialize=function(a){return JSON.stringify(a)};b.deserialize=function(a){if(typeof a=="string")return JSON.parse(a)};var h;try{h="localStorage"in e&&e.localStorage}catch(k){h=false}if(h){c=e.localStorage;b.set=function(a,d){c.setItem(a,b.serialize(d))};b.get=
function(a){return b.deserialize(c.getItem(a))};b.remove=function(a){c.removeItem(a)};b.clear=function(){c.clear()}}else{var i;try{i="globalStorage"in e&&e.globalStorage&&e.globalStorage[e.location.hostname]}catch(l){i=false}if(i){c=e.globalStorage[e.location.hostname];b.set=function(a,d){c[a]=b.serialize(d)};b.get=function(a){return b.deserialize(c[a]&&c[a].value)};b.remove=function(a){delete c[a]};b.clear=function(){for(var a in c)delete c[a]}}else if(g.documentElement.addBehavior){c=g.createElement("div");
e=function(a){return function(){var d=Array.prototype.slice.call(arguments,0);d.unshift(c);g.body.appendChild(c);c.addBehavior("#default#userData");c.load("localStorage");d=a.apply(b,d);g.body.removeChild(c);return d}};b.set=e(function(a,d,f){a.setAttribute(d,b.serialize(f));a.save("localStorage")});b.get=e(function(a,d){return b.deserialize(a.getAttribute(d))});b.remove=e(function(a,d){a.removeAttribute(d);a.save("localStorage")});b.clear=e(function(a){var d=a.XMLDocument.documentElement.attributes;
a.load("localStorage");for(var f=0,j;j=d[f];f++)a.removeAttribute(j.name);a.save("localStorage")})}else b.disabled=true}return b}();

/* jQuery Data Link Plugin
 * http://github.com/jquery/jquery-datalink
 * Copyright Software Freedom Conservancy, Inc.
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license */
(function(b){function q(a,d,g){if(a.nodeType){d=v[d]||"attr";b(a)[d](g)}else b(a).data(d,g)}function p(a){a=b.data(a);var d;return(a._getLinks||(d={s:[],t:[]},a._getLinks=function(){return d}))()}function r(a,d,g){d.bind(a.nodeType?"change":"changeData",g)}function m(a,d,g){d.unbind(a.nodeType?"change":"changeData",g)}function s(a,d,g,e,c,j){j=a.target;c=a.type==="changeData";var i;if(c){name=d;if(a.namespace)name+="."+a.namespace}else name=j.name||j.id;if(e){i=e[name];if(!i)return null;a=i.name;
i=i.convert;if(typeof i==="string")i=b.convertFn[i]}else a=name;return{name:a,convert:i,value:c?g:b(j).val()}}var w=b.cleanData,v={val:"val",html:"html",text:"text"};b.extend({cleanData:function(a){for(var d=0,g;(g=a[d])!=null;d++){var e=b.data(g,"_getLinks");if(e){e=e();var c=b(g);b.each(e.s,function(){m(g,c,this.handler);this.handlerRev&&m(this.target,b(this.target),this.handlerRev)});b.each(e.t,function(){m(this.source,b(this.source),this.handler);this.handlerRev&&m(g,c,this.handlerRev)});e.s=
[];e.t=[]}}w(a)},convertFn:{"!":function(a){return!a}}});b.extend(b.fn,{link:function(a,d){function g(f){f="[name="+f+"], [id="+f+"]";return e.filter(f).add(e.find(f))}var e=this;if(!a)return e;if(typeof a==="string")a=b(a,this.context||null)[0];var c=!d,j,i,t=function(f,k,h){var l=s(f,k,h,j);if(l){k=l.name;h=l.value;if(l=l.convert)h=l(h,f.target,a);h!==undefined&&q(a,k,h)}},u=function(f,k,h){if(f=s(f,k,h,i)){var l=f.value,n=f.convert;g(f.name).each(function(){h=l;if(n)h=n(h,a,this);h!==undefined&&
q(this,"val",h)})}};d&&b.each(d,function(f,k){var h=k,l,n,o;if(b.isPlainObject(k)){h=k.name||f;l=k.convert;n=k.convertBack;o=k.twoWay!==false;c|=o}else c=o=true;if(o){i=i||{};i[f]={name:h,convert:n}}j=j||{};j[h]={name:f,convert:l,twoWay:o}});e.each(function(){r(this,b(this),t);var f={handler:t,handlerRev:c?u:null,target:a,source:this};p(this).s.push(f);a.nodeType&&p(a).t.push(f)});c&&r(a,b(a),u);return e},unlink:function(a){this.each(function(){for(var d=b(this),g=p(this).s,e=g.length-1;e>=0;e--){var c=
g[e];if(c.target===a){m(this,d,c.handler);c.handlerRev&&m(c.target,b(c.target),c.handlerRev);g.splice(e,1);var j=p(c.target).t;c=b.inArray(c,j);c!==-1&&j.splice(c,1)}}})}})})(jQuery);

/* jQuery Templates Plugin 1.0.0pre
 * http://github.com/jquery/jquery-tmpl
 * Copyright Software Freedom Conservancy, Inc.
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license */
(function(d){function s(a,b,e,c){c={data:c||(b?b.data:{}),_wrap:b?b._wrap:null,tmpl:null,parent:b||null,nodes:[],calls:I,nest:J,wrap:K,html:L,update:M};a&&d.extend(c,a,{nodes:[],parent:b});if(e){c.tmpl=e;c._ctnt=c._ctnt||c.tmpl(d,c);c.key=++t;(z.length?u:m)[t]=c}return c}function v(a,b,e){var c;e=e?d.map(e,function(f){return typeof f==="string"?a.key?f.replace(/(<\w+)(?=[\s>])(?![^>]*_tmplitem)([^>]*)/g,"$1 "+q+'="'+a.key+'" $2'):f:v(f,a,f._ctnt)}):a;if(b)return e;e=e.join("");e.replace(/^\s*([^<\s][^<]*)?(<[\w\W]+>)([^>]*[^>\s])?\s*$/,
function(f,g,h,j){c=d(h).get();C(c);if(g)c=A(g).concat(c);if(j)c=c.concat(A(j))});return c?c:A(e)}function A(a){var b=document.createElement("div");b.innerHTML=a;return d.makeArray(b.childNodes)}function D(a){return new Function("jQuery","$item","var $=jQuery,call,_=[],$data=$item.data;with($data){_.push('"+d.trim(a).replace(/([\\'])/g,"\\$1").replace(/[\r\t\n]/g," ").replace(/\$\{([^\}]*)\}/g,"{{= $1}}").replace(/\{\{(\/?)(\w+|.)(?:\(((?:[^\}]|\}(?!\}))*?)?\))?(?:\s+(.*?)?)?(\(((?:[^\}]|\}(?!\}))*?)\))?\s*\}\}/g,
function(b,e,c,f,g,h,j){b=d.tmpl.tag[c];if(!b)throw"Template command not found: "+c;c=b._default||[];if(h&&!/\w$/.test(g)){g+=h;h=""}if(g){g=w(g);j=j?","+w(j)+")":h?")":"";j=h?g.indexOf(".")>-1?g+w(h):"("+g+").call($item"+j:g;h=h?j:"(typeof("+g+")==='function'?("+g+").call($item):("+g+"))"}else h=j=c.$1||"null";f=w(f);return"');"+b[e?"close":"open"].split("$notnull_1").join(g?"typeof("+g+")!=='undefined' && ("+g+")!=null":"true").split("$1a").join(h).split("$1").join(j).split("$2").join(f?f.replace(/\s*([^\(]+)\s*(\((.*?)\))?/g,
function(o,n,x,l){return(l=l?","+l+")":x?")":"")?"("+n+").call($item"+l:o}):c.$2||"")+"_.push('"})+"');}return _;")}function E(a,b){a._wrap=v(a,true,d.isArray(b)?b:[F.test(b)?b:d(b).html()]).join("")}function w(a){return a?a.replace(/\\'/g,"'").replace(/\\\\/g,"\\"):null}function C(a){function b(n){function x(B){B+=e;i=g[B]=g[B]||s(i,m[i.parent.key+e]||i.parent)}var l,k=n,i,r;if(r=n.getAttribute(q)){for(;k.parentNode&&(k=k.parentNode).nodeType===1&&!(l=k.getAttribute(q)););if(l!==r){k=k.parentNode?
k.nodeType===11?0:k.getAttribute(q)||0:0;if(!(i=m[r])){i=u[r];i=s(i,m[k]||u[k]);i.key=++t;m[t]=i}p&&x(r)}n.removeAttribute(q)}else if(p&&(i=d.data(n,"tmplItem"))){x(i.key);m[i.key]=i;k=(k=d.data(n.parentNode,"tmplItem"))?k.key:0}if(i){for(l=i;l&&l.key!=k;){l.nodes.push(n);l=l.parent}delete i._ctnt;delete i._wrap;d.data(n,"tmplItem",i)}}var e="_"+p,c,f,g={},h,j,o;h=0;for(j=a.length;h<j;h++)if((c=a[h]).nodeType===1){f=c.getElementsByTagName("*");for(o=f.length-1;o>=0;o--)b(f[o]);b(c)}}function I(a,
b,e,c){if(!a)return z.pop();z.push({_:a,tmpl:b,item:this,data:e,options:c})}function J(a,b,e){return d.tmpl(d.template(a),b,e,this)}function K(a,b){var e=a.options||{};e.wrapped=b;return d.tmpl(d.template(a.tmpl),a.data,e,a.item)}function L(a,b){var e=this._wrap;return d.map(d(d.isArray(e)?e.join(""):e).filter(a||"*"),function(c){if(b)c=c.innerText||c.textContent;else{var f;if(!(f=c.outerHTML)){f=document.createElement("div");f.appendChild(c.cloneNode(true));f=f.innerHTML}c=f}return c})}function M(){var a=
this.nodes;d.tmpl(null,null,null,this).insertBefore(a[0]);d(a).remove()}var G=d.fn.domManip,q="_tmplitem",F=/^[^<]*(<[\w\W]+>)[^>]*$|\{\{\! /,m={},u={},y,H={key:0,data:{}},t=0,p=0,z=[];d.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){d.fn[a]=function(e){var c=[];e=d(e);var f,g,h;f=this.length===1&&this[0].parentNode;y=m||{};if(f&&f.nodeType===11&&f.childNodes.length===1&&e.length===1){e[b](this[0]);c=this}else{g=0;for(h=
e.length;g<h;g++){p=g;f=(g>0?this.clone(true):this).get();d(e[g])[b](f);c=c.concat(f)}p=0;c=this.pushStack(c,a,e.selector)}e=y;y=null;d.tmpl.complete(e);return c}});d.fn.extend({tmpl:function(a,b,e){return d.tmpl(this[0],a,b,e)},tmplItem:function(){return d.tmplItem(this[0])},template:function(a){return d.template(a,this[0])},domManip:function(a,b,e){if(a[0]&&d.isArray(a[0])){for(var c=d.makeArray(arguments),f=a[0],g=f.length,h=0,j;h<g&&!(j=d.data(f[h++],"tmplItem")););if(j&&p)c[2]=function(o){d.tmpl.afterManip(this,
o,e)};G.apply(this,c)}else G.apply(this,arguments);p=0;!y&&d.tmpl.complete(m);return this}});d.extend({tmpl:function(a,b,e,c){var f=!c;if(f){c=H;a=d.template[a]||d.template(null,a);u={}}else if(!a){a=c.tmpl;m[c.key]=c;c.nodes=[];c.wrapped&&E(c,c.wrapped);return d(v(c,null,c.tmpl(d,c)))}if(!a)return[];if(typeof b==="function")b=b.call(c||{});e&&e.wrapped&&E(e,e.wrapped);b=d.isArray(b)?d.map(b,function(g){return g?s(e,c,a,g):null}):[s(e,c,a,b)];return f?d(v(c,null,b)):b},tmplItem:function(a){var b;
if(a instanceof d)a=a[0];for(;a&&a.nodeType===1&&!(b=d.data(a,"tmplItem"))&&(a=a.parentNode););return b||H},template:function(a,b){if(b){if(typeof b==="string")b=D(b);else if(b instanceof d)b=b[0]||{};if(b.nodeType)b=d.data(b,"tmpl")||d.data(b,"tmpl",D(b.innerHTML));return typeof a==="string"?d.template[a]=b:b}return a?typeof a!=="string"?d.template(null,a):d.template[a]||d.template(null,F.test(a)?a:d(a)):null},encode:function(a){return(""+a).split("<").join("&lt;").split(">").join("&gt;").split('"').join("&#34;").split("'").join("&#39;")}});
d.extend(d.tmpl,{tag:{tmpl:{_default:{$2:"null"},open:"if($notnull_1){_=_.concat($item.nest($1,$2));}"},wrap:{_default:{$2:"null"},open:"$item.calls(_,$1,$2);_=[];",close:"call=$item.calls();_=call._.concat($item.wrap(call,_));"},each:{_default:{$2:"$index, $value"},open:"if($notnull_1){$.each($1a,function($2){with(this){",close:"}});}"},"if":{open:"if(($notnull_1) && $1a){",close:"}"},"else":{_default:{$1:"true"},open:"}else if(($notnull_1) && $1a){"},html:{open:"if($notnull_1){_.push($1a);}"},"=":{_default:{$1:"$data"},
open:"if($notnull_1){_.push($.encode($1a));}"},"!":{open:""}},complete:function(){m={}},afterManip:function(a,b,e){var c=b.nodeType===11?d.makeArray(b.childNodes):b.nodeType===1?[b]:[];e.call(a,b);C(c);p++}})})(jQuery);


/* jQuery hashchange event - v1.3
 * http://benalman.com/projects/jquery-hashchange-plugin/
 * Copyright (c) 2010 "Cowboy" Ben Alman
 * Dual licensed under the MIT and GPL licenses.
 * http://benalman.com/about/license/ */
(function($,e,b){var c="hashchange",h=document,f,g=$.event.special,i=h.documentMode,d="on"+c in e&&(i===b||i>7);function a(j){j=j||location.href;return"#"+j.replace(/^[^#]*#?(.*)$/,"$1")}$.fn[c]=function(j){return j?this.bind(c,j):this.trigger(c)};$.fn[c].delay=50;g[c]=$.extend(g[c],{setup:function(){if(d){return false}$(f.start)},teardown:function(){if(d){return false}$(f.stop)}});f=(function(){var j={},p,m=a(),k=function(q){return q},l=k,o=k;j.start=function(){p||n()};j.stop=function(){p&&clearTimeout(p);p=b};function n(){var r=a(),q=o(m);if(r!==m){l(m=r,q);$(e).trigger(c)}else{if(q!==m){location.href=location.href.replace(/#.*/,"")+q}}p=setTimeout(n,$.fn[c].delay)}$.browser.msie&&!d&&(function(){var q,r;j.start=function(){if(!q){r=$.fn[c].src;r=r&&r+a();q=$('<iframe tabindex="-1" title="empty"/>').hide().one("load",function(){r||l(a());n()}).attr("src",r||"javascript:0").insertAfter("body")[0].contentWindow;h.onpropertychange=function(){try{if(event.propertyName==="title"){q.document.title=h.title}}catch(s){}}}};j.stop=k;o=function(){return a(q.location.href)};l=function(v,s){var u=q.document,t=$.fn[c].domain;if(v!==s){u.title=h.title;u.open();t&&u.write('<script>document.domain="'+t+'"<\/script>');u.close();q.location.hash=v}}})();return j})()})(jQuery,this);


/* HTML5 Placeholder jQuery Plugin v1.7
 * Mathias Bynens http://mathiasbynens.be */
(function(f,z){var e=z in document.createElement('input'),a=z in document.createElement('textarea');if(e&&a){f.fn.placeholder=function(){return this}}else{f.fn.placeholder=function(){return this.filter((e?'textarea':':input')+'['+z+']').bind('focus.'+z,b).bind('blur.'+z,d).trigger('blur.'+z).end()}}function c(h){var g={},i=/^jQuery\d+$/;f.each(h.attributes,function(k,j){if(j.specified&&!i.test(j.name)){g[j.name]=j.value}});return g}function b(){var g=f(this);if(g.val()===g.attr(z)&&g.hasClass(z)){if(g.data(z+'-password')){g.hide().next().show().focus()}else{g.val('').removeClass(z)}}}function d(g){var j,i=f(this);if(i.val()===''||i.val()===i.attr(z)){if(i.is(':password')){if(!i.data(z+'-textinput')){try{j=i.clone().attr({type:'text'})}catch(h){j=f('<input>').attr(f.extend(c(i[0]),{type:'text'}))}j.removeAttr('name').data(z+'-password',true).bind('focus.'+z,b);i.data(z+'-textinput',j).before(j)}i=i.hide().prev().show()}i.addClass(z).val(i.attr(z))}else{i.removeClass(z)}}f(function(){f('form').bind('submit.'+z,function(){var g=f('.'+z,this).each(b);setTimeout(function(){g.each(d)},10)})});f(window).bind('unload.'+z,function(){f('.'+z).val('')})})(jQuery,'placeholder');


/* Copyright (C) 1999-2009 Jive Software. All rights reserved.
 * $ lightbox_me / By: Buck Wilson / Version : 2.2
 * Licensed under the Apache License, Version 2.0 (the "License") */
(function(b){b.fn.lightbox_me=function(l){return this.each(function(){function h(e){c[a.disappearEffect](a.lightboxDisappearSpeed,function(){e&&m();a.destroyOnClose?c.remove():c.hide();c.find(a.closeSelector).unbind("click");c.unbind("close");c.unbind("resize");b(window).unbind("scroll",f);b(window).unbind("resize",f)})}function m(){d.fadeOut(a.overlayDisappearSpeed,function(){b(window).unbind("resize",i);d.remove();d.unbind("click");a.onClose()})}function i(){if(b(window).height()<b(document).height())d.css({height:b(document).height()+
"px"});else{d.css({height:"100%"});j&&b("html,body").css("height","100%")}}function f(){var e=c[0].style;if(c.height()+80>=b(window).height()&&(c.css("position")!="absolute"||j)){var k=b(document).scrollTop()+40;c.css({position:"absolute",top:k+"px",marginTop:0});j&&e.removeExpression("top")}else if(c.height()+80<b(window).height())if(j){e.position="absolute";if(a.centered){e.setExpression("top",'(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"');
e.marginTop=0}else{k=a.modalCSS&&a.modalCSS.top?parseInt(a.modalCSS.top):0;e.setExpression("top","((blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "+k+') + "px"')}}else a.centered?c.css({position:"fixed",top:"50%",marginTop:c.outerHeight()/2*-1}):c.css({position:"fixed"}).css(a.modalCSS)}var a=b.extend({},b.fn.lightbox_me.defaults,l),d=b("div."+a.classPrefix+"_overlay"),c=b(this),g=b("iframe#lb_iframe"),j=b.browser.msie&&b.browser.version<
7;if(d.length>0)d[0].removeModal();else d=b('<div class="'+a.classPrefix+'_overlay" style="display:none;"/>');g=g.length>0?g:g=b('<iframe id="lb_iframe" style="z-index: '+(a.zIndex+1)+'; display: none; border: none; margin: 0; padding: 0; position: absolute; width: 100%; height: 100%; top: 0; left: 0;"/>');if(j){var n=/^https/i.test(window.location.href||"")?"javascript:false":"about:blank";g.attr("src",n);b("body").append(g)}b("body").append(c).append(d);f();c.css({left:"50%",marginLeft:c.outerWidth()/
2*-1,zIndex:a.zIndex+3});i();d.css({position:"absolute",width:"100%",top:0,left:0,right:0,bottom:0,zIndex:a.zIndex+2}).css(a.overlayCSS);d.is(":hidden")?d.fadeIn(a.overlaySpeed,function(){c[a.appearEffect](a.lightboxSpeed,function(){i();a.onLoad()})}):c[a.appearEffect](a.lightboxSpeed,function(){i();a.onLoad()});b(window).resize(i).resize(f).scroll(f).keydown(function(e){if((e.keyCode==27||e.DOM_VK_ESCAPE==27&&e.which==0)&&a.closeEsc)h(true)});c.find(a.closeSelector).click(function(){h(true);return false});
d.click(function(){if(a.closeClick){h(true);return false}});c.bind("close",function(){h(true)});c.bind("resize",f);d[0].removeModal=h})};b.fn.lightbox_me.defaults={appearEffect:"fadeIn",overlaySpeed:300,lightboxSpeed:"fast",disappearEffect:"fadeOut",overlayDisappearSpeed:300,lightboxDisappearSpeed:"fast",closeSelector:".close",closeClick:true,closeEsc:true,destroyOnClose:false,onLoad:function(){},onClose:function(){},classPrefix:"lb",zIndex:999,centered:false,modalCSS:{top:"40px"},overlayCSS:{background:"black",
opacity:0.6}}})(jQuery);


/* jQuery Tools Validator 1.2.5 */
(function(e){function t(a,b,c){var k=a.offset().top,f=a.offset().left,l=c.position.split(/,?\s+/),p=l[0];l=l[1];k-=b.outerHeight()-c.offset[0];f+=a.outerWidth()+c.offset[1];if(/iPad/i.test(navigator.userAgent))k-=e(window).scrollTop();c=b.outerHeight()+a.outerHeight();if(p=="center")k+=c/2;if(p=="bottom")k+=c;a=a.outerWidth();if(l=="center")f-=(a+b.outerWidth())/2;if(l=="left")f-=a;return{top:k,left:f}}function y(a){function b(){return this.getAttribute("type")==a}b.key="[type="+a+"]";return b}function u(a,
b,c){function k(g,d,i){if(!(!c.grouped&&g.length)){var j;if(i===false||e.isArray(i)){j=h.messages[d.key||d]||h.messages["*"];j=j[c.lang]||h.messages["*"].en;(d=j.match(/\$\d/g))&&e.isArray(i)&&e.each(d,function(m){j=j.replace(this,i[m])})}else j=i[c.lang]||i;g.push(j)}}var f=this,l=b.add(f);a=a.not(":button, :image, :reset, :submit");e.extend(f,{getConf:function(){return c},getForm:function(){return b},getInputs:function(){return a},reflow:function(){a.each(function(){var g=e(this),d=g.data("msg.el");
if(d){g=t(g,d,c);d.css({top:g.top,left:g.left})}});return f},invalidate:function(g,d){if(!d){var i=[];e.each(g,function(j,m){j=a.filter("[name='"+j+"']");if(j.length){j.trigger("OI",[m]);i.push({input:j,messages:[m]})}});g=i;d=e.Event()}d.type="onFail";l.trigger(d,[g]);d.isDefaultPrevented()||q[c.effect][0].call(f,g,d);return f},reset:function(g){g=g||a;g.removeClass(c.errorClass).each(function(){var d=e(this).data("msg.el");if(d){d.remove();e(this).data("msg.el",null)}}).unbind(c.errorInputEvent||
"");return f},destroy:function(){b.unbind(c.formEvent+".V").unbind("reset.V");a.unbind(c.inputEvent+".V").unbind("change.V");return f.reset()},checkValidity:function(g,d){g=g||a;g=g.not(":disabled");if(!g.length)return true;d=d||e.Event();d.type="onBeforeValidate";l.trigger(d,[g]);if(d.isDefaultPrevented())return d.result;var i=[];g.not(":radio:not(:checked)").each(function(){var m=[],n=e(this).data("messages",m),v=r&&n.is(":date")?"onHide.v":c.errorInputEvent+".v";n.unbind(v);e.each(w,function(){var o=
this,s=o[0];if(n.filter(s).length){o=o[1].call(f,n,n.val());if(o!==true){d.type="onBeforeFail";l.trigger(d,[n,s]);if(d.isDefaultPrevented())return false;var x=n.attr(c.messageAttr);if(x){m=[x];return false}else k(m,s,o)}}});if(m.length){i.push({input:n,messages:m});n.trigger("OI",[m]);c.errorInputEvent&&n.bind(v,function(o){f.checkValidity(n,o)})}if(c.singleError&&i.length)return false});var j=q[c.effect];if(!j)throw'Validator: cannot find effect "'+c.effect+'"';if(i.length){f.invalidate(i,d);return false}else{j[1].call(f,
g,d);d.type="onSuccess";l.trigger(d,[g]);g.unbind(c.errorInputEvent+".v")}return true}});e.each("onBeforeValidate,onBeforeFail,onFail,onSuccess".split(","),function(g,d){e.isFunction(c[d])&&e(f).bind(d,c[d]);f[d]=function(i){i&&e(f).bind(d,i);return f}});c.formEvent&&b.bind(c.formEvent+".V",function(g){if(!f.checkValidity(null,g))return g.preventDefault()});b.bind("reset.V",function(){f.reset()});a[0]&&a[0].validity&&a.each(function(){this.oninvalid=function(){return false}});if(b[0])b[0].checkValidity=
f.checkValidity;c.inputEvent&&a.bind(c.inputEvent+".V",function(g){f.checkValidity(e(this),g)});a.filter(":checkbox, select").filter("[required]").bind("change.V",function(g){var d=e(this);if(this.checked||d.is("select")&&e(this).val())q[c.effect][1].call(f,d,g)});var p=a.filter(":radio").change(function(g){f.checkValidity(p,g)});e(window).resize(function(){f.reflow()})}e.tools=e.tools||{version:"1.2.5"};var z=/\[type=([a-z]+)\]/,A=/^-?[0-9]*(\.[0-9]+)?$/,r=e.tools.dateinput,B=/^([a-z0-9_\.\-\+]+)@([\da-z\.\-]+)\.([a-z\.]{2,6})$/i,
C=/^(https?:\/\/)?[\da-z\.\-]+\.[a-z\.]{2,6}[#&+_\?\/\w \.\-=]*$/i,h;h=e.tools.validator={conf:{grouped:false,effect:"default",errorClass:"invalid",inputEvent:null,errorInputEvent:"keyup",formEvent:"submit",lang:"en",message:"<div/>",messageAttr:"data-message",messageClass:"error",offset:[0,0],position:"center right",singleError:false,speed:"normal"},messages:{"*":{en:"Please correct this value"}},localize:function(a,b){e.each(b,function(c,k){h.messages[c]=h.messages[c]||{};h.messages[c][a]=k})},
localizeFn:function(a,b){h.messages[a]=h.messages[a]||{};e.extend(h.messages[a],b)},fn:function(a,b,c){if(e.isFunction(b))c=b;else{if(typeof b=="string")b={en:b};this.messages[a.key||a]=b}if(b=z.exec(a))a=y(b[1]);w.push([a,c])},addEffect:function(a,b,c){q[a]=[b,c]}};var w=[],q={"default":[function(a){var b=this.getConf();e.each(a,function(c,k){c=k.input;c.addClass(b.errorClass);var f=c.data("msg.el");if(!f){f=e(b.message).addClass(b.messageClass).appendTo(document.body);c.data("msg.el",f)}f.css({visibility:"hidden"}).find("p").remove();
e.each(k.messages,function(l,p){e("<p/>").html(p).appendTo(f)});f.outerWidth()==f.parent().width()&&f.add(f.find("p")).css({display:"inline"});k=t(c,f,b);f.css({visibility:"visible",position:"absolute",top:k.top,left:k.left}).fadeIn(b.speed)})},function(a){var b=this.getConf();a.removeClass(b.errorClass).each(function(){var c=e(this).data("msg.el");c&&c.css({visibility:"hidden"})})}]};e.each("email,url,number".split(","),function(a,b){e.expr[":"][b]=function(c){return c.getAttribute("type")===b}});
e.fn.oninvalid=function(a){return this[a?"bind":"trigger"]("OI",a)};h.fn(":email","Please enter a valid email address",function(a,b){return!b||B.test(b)});h.fn(":url","Please enter a valid URL",function(a,b){return!b||C.test(b)});h.fn(":number","Please enter a numeric value.",function(a,b){return A.test(b)});h.fn("[max]","Please enter a value smaller than $1",function(a,b){if(b===""||r&&a.is(":date"))return true;a=a.attr("max");return parseFloat(b)<=parseFloat(a)?true:[a]});h.fn("[min]","Please enter a value larger than $1",
function(a,b){if(b===""||r&&a.is(":date"))return true;a=a.attr("min");return parseFloat(b)>=parseFloat(a)?true:[a]});h.fn("[required]","Please complete this mandatory field.",function(a,b){if(a.is(":checkbox"))return a.is(":checked");return!!b});h.fn("[pattern]",function(a){return RegExp("^"+a.attr("pattern")+"$").test(a.val())});e.fn.validator=function(a){var b=this.data("validator");if(b){b.destroy();this.removeData("validator")}a=e.extend(true,{},h.conf,a);if(this.is("form"))return this.each(function(){var c=
e(this);b=new u(c.find(":input"),c,a);c.data("validator",b)});else{b=new u(this,this.eq(0).closest("form"),a);return this.data("validator",b)}}})(jQuery);

//money converter
Number.prototype.tPenge = function() { 
	var n = this,
			c = Math.abs(0),
			d = ',',
			t = ' ',
			sign = (n < 0) ? '-' : '',
			i = parseInt(n = Math.abs(n).toFixed(c)) + '',

		j = ((j = i.length) > 3) ? j % 3 : 0;
		return sign + (j ? i.substr(0, j) + t : '') + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + t) + (c ? d + Math.abs(n - i).toFixed(c).slice(2) : ''); 
}

