
(function(a){a.extend(a.fn,{livequery:function(e,d,c){var b=this,f;if(a.isFunction(e)){c=d,d=e,e=undefined}a.each(a.livequery.queries,function(g,h){if(b.selector==h.selector&&b.context==h.context&&e==h.type&&(!d||d.$lqguid==h.fn.$lqguid)&&(!c||c.$lqguid==h.fn2.$lqguid)){return(f=h)&&false}});f=f||new a.livequery(this.selector,this.context,e,d,c);f.stopped=false;f.run();return this},expire:function(e,d,c){var b=this;if(a.isFunction(e)){c=d,d=e,e=undefined}a.each(a.livequery.queries,function(f,g){if(b.selector==g.selector&&b.context==g.context&&(!e||e==g.type)&&(!d||d.$lqguid==g.fn.$lqguid)&&(!c||c.$lqguid==g.fn2.$lqguid)&&!this.stopped){a.livequery.stop(g.id)}});return this}});a.livequery=function(b,d,f,e,c){this.selector=b;this.context=d;this.type=f;this.fn=e;this.fn2=c;this.elements=[];this.stopped=false;this.id=a.livequery.queries.push(this)-1;e.$lqguid=e.$lqguid||a.livequery.guid++;if(c){c.$lqguid=c.$lqguid||a.livequery.guid++}return this};a.livequery.prototype={stop:function(){var b=this;if(this.type){this.elements.unbind(this.type,this.fn)}else{if(this.fn2){this.elements.each(function(c,d){b.fn2.apply(d)})}}this.elements=[];this.stopped=true},run:function(){if(this.stopped){return}var d=this;var e=this.elements,c=a(this.selector,this.context),b=c.not(e);this.elements=c;if(this.type){b.bind(this.type,this.fn);if(e.length>0){a.each(e,function(f,g){if(a.inArray(g,c)<0){a.event.remove(g,d.type,d.fn)}})}}else{b.each(function(){d.fn.apply(this)});if(this.fn2&&e.length>0){a.each(e,function(f,g){if(a.inArray(g,c)<0){d.fn2.apply(g)}})}}}};a.extend(a.livequery,{guid:0,queries:[],queue:[],running:false,timeout:null,checkQueue:function(){if(a.livequery.running&&a.livequery.queue.length){var b=a.livequery.queue.length;while(b--){a.livequery.queries[a.livequery.queue.shift()].run()}}},pause:function(){a.livequery.running=false},play:function(){a.livequery.running=true;a.livequery.run()},registerPlugin:function(){a.each(arguments,function(c,d){if(!a.fn[d]){return}var b=a.fn[d];a.fn[d]=function(){var e=b.apply(this,arguments);a.livequery.run();return e}})},run:function(b){if(b!=undefined){if(a.inArray(b,a.livequery.queue)<0){a.livequery.queue.push(b)}}else{a.each(a.livequery.queries,function(c){if(a.inArray(c,a.livequery.queue)<0){a.livequery.queue.push(c)}})}if(a.livequery.timeout){clearTimeout(a.livequery.timeout)}a.livequery.timeout=setTimeout(a.livequery.checkQueue,20)},stop:function(b){if(b!=undefined){a.livequery.queries[b].stop()}else{a.each(a.livequery.queries,function(c){a.livequery.queries[c].stop()})}}});a.livequery.registerPlugin("append","prepend","after","before","wrap","attr","removeAttr","addClass","removeClass","toggleClass","empty","remove","html");a(function(){a.livequery.play()})})(jQuery);

(function(){$.fn.simpleVideo=function(options){var opts=$.extend({},$.fn.simpleVideo.defaults,options);return this.each(function(){var video=this,o=$.meta?$.extend({},opts,$video.data()):opts,$video=$(this),elements={overlay:$(o.overlay),video:$video,wrapper:$(o.wrapper)},playing=false,playCheck=null;function init(){var agent=navigator.userAgent.toLowerCase(),is_ios=agent.indexOf('iphone')!==-1||agent.indexOf('ipad')!==-1;if(is_ios){video.controls=true;}
if(video.play&&typeof(video.play)==="function"&&!is_ios){$video.wrap(elements.wrapper).before(elements.overlay);$video.bind({click:function(){$video.trigger("toggle");},pause:function(){if(isPlaying()){pause();}},play:function(){play();},stop:function(){stop();},toggle:function(){if(isPlaying()){pause();}else{play();}}});elements.overlay.bind({click:function(){$video.trigger("toggle");}});}else{if(o.isNotSupported&&typeof(o.isNotSupported)==="function")
o.isNotSupported();}};function play(){video.play();pingVideo();if(o.onPlay&&typeof(o.onPlay)==="function")
o.onPlay(elements);};function pause(){video.pause();endPing();if(o.onPause&&typeof(o.onPause)==="function")
o.onPause(elements);};function stop(){video.pause();if(o.onStop&&typeof(o.onStop)==="function")
o.onStop(elements);}
function isPlaying(){if(video.paused||video.ended){return false;}
return true;};function pingVideo(){playing=true;playCheck=setInterval(function(){if(isPlaying()){return;}
endPing();},1000);};function endPing(){playing=false;clearInterval(playCheck);o.onStop(elements);};init();});};$.fn.simpleVideo.defaults={isNotSupported:function(){},onPause:function(elements){elements.overlay.fadeIn();},onPlay:function(elements){elements.overlay.fadeOut();},onStop:function(elements){elements.overlay.fadeIn();},overlay:'<span class="simple-video-overlay"></span>',wrapper:'<div class="simple-video-wrapper"></div>'};})(jQuery);

(function($){$.toJSON=function(o)
{if(typeof(JSON)=='object'&&JSON.stringify)
return JSON.stringify(o);var type=typeof(o);if(o===null)
return"null";if(type=="undefined")
return undefined;if(type=="number"||type=="boolean")
return o+"";if(type=="string")
return $.quoteString(o);if(type=='object')
{if(typeof o.toJSON=="function")
return $.toJSON(o.toJSON());if(o.constructor===Date)
{var month=o.getUTCMonth()+1;if(month<10)month='0'+month;var day=o.getUTCDate();if(day<10)day='0'+day;var year=o.getUTCFullYear();var hours=o.getUTCHours();if(hours<10)hours='0'+hours;var minutes=o.getUTCMinutes();if(minutes<10)minutes='0'+minutes;var seconds=o.getUTCSeconds();if(seconds<10)seconds='0'+seconds;var milli=o.getUTCMilliseconds();if(milli<100)milli='0'+milli;if(milli<10)milli='0'+milli;return'"'+year+'-'+month+'-'+day+'T'+
hours+':'+minutes+':'+seconds+'.'+milli+'Z"';}
if(o.constructor===Array)
{var ret=[];for(var i=0;i<o.length;i++)
ret.push($.toJSON(o[i])||"null");return"["+ret.join(",")+"]";}
var pairs=[];for(var k in o){var name;var type=typeof k;if(type=="number")
name='"'+k+'"';else if(type=="string")
name=$.quoteString(k);else
continue;if(typeof o[k]=="function")
continue;var val=$.toJSON(o[k]);pairs.push(name+":"+val);}
return"{"+pairs.join(", ")+"}";}};$.evalJSON=function(src)
{if(typeof(JSON)=='object'&&JSON.parse)
return JSON.parse(src);return eval("("+src+")");};$.secureEvalJSON=function(src)
{if(typeof(JSON)=='object'&&JSON.parse)
return JSON.parse(src);var filtered=src;filtered=filtered.replace(/\\["\\\/bfnrtu]/g,'@');filtered=filtered.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,']');filtered=filtered.replace(/(?:^|:|,)(?:\s*\[)+/g,'');if(/^[\],:{}\s]*$/.test(filtered))
return eval("("+src+")");else
throw new SyntaxError("Error parsing JSON, source is not valid.");};$.quoteString=function(string)
{if(string.match(_escapeable))
{return'"'+string.replace(_escapeable,function(a)
{var c=_meta[a];if(typeof c==='string')return c;c=a.charCodeAt();return'\\u00'+Math.floor(c/16).toString(16)+(c%16).toString(16);})+'"';}
return'"'+string+'"';};var _escapeable=/["\\\x00-\x1f\x7f-\x9f]/g;var _meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'};})(jQuery);

(function($){if(!$||!($.toJSON||Object.toJSON||window.JSON)){throw new Error("jQuery, MooTools or Prototype needs to be loaded before jStorage!");}
var
_storage={},_storage_service={jStorage:"{}"},_storage_elm=null,_storage_size=0,json_encode=$.toJSON||Object.toJSON||(window.JSON&&(JSON.encode||JSON.stringify)),json_decode=$.evalJSON||(window.JSON&&(JSON.decode||JSON.parse))||function(str){return String(str).evalJSON();},_backend=false;_XMLService={isXML:function(elm){var documentElement=(elm?elm.ownerDocument||elm:0).documentElement;return documentElement?documentElement.nodeName!=="HTML":false;},encode:function(xmlNode){if(!this.isXML(xmlNode)){return false;}
try{return new XMLSerializer().serializeToString(xmlNode);}catch(E1){try{return xmlNode.xml;}catch(E2){}}
return false;},decode:function(xmlString){var dom_parser=("DOMParser"in window&&(new DOMParser()).parseFromString)||(window.ActiveXObject&&function(_xmlString){var xml_doc=new ActiveXObject('Microsoft.XMLDOM');xml_doc.async='false';xml_doc.loadXML(_xmlString);return xml_doc;}),resultXML;if(!dom_parser){return false;}
resultXML=dom_parser.call("DOMParser"in window&&(new DOMParser())||window,xmlString,'text/xml');return this.isXML(resultXML)?resultXML:false;}};function _init(){if("localStorage"in window){try{if(window.localStorage){_storage_service=window.localStorage;_backend="localStorage";}}catch(E3){}}
else if("globalStorage"in window){try{if(window.globalStorage){_storage_service=window.globalStorage[window.location.hostname];_backend="globalStorage";}}catch(E4){}}
else{_storage_elm=document.createElement('link');if(_storage_elm.addBehavior){_storage_elm.style.behavior='url(#default#userData)';document.getElementsByTagName('head')[0].appendChild(_storage_elm);_storage_elm.load("jStorage");var data="{}";try{data=_storage_elm.getAttribute("jStorage");}catch(E5){}
_storage_service.jStorage=data;_backend="userDataBehavior";}else{_storage_elm=null;return;}}
_load_storage();}
function _load_storage(){if(_storage_service.jStorage){try{_storage=json_decode(String(_storage_service.jStorage));}catch(E6){_storage_service.jStorage="{}";}}else{_storage_service.jStorage="{}";}
_storage_size=_storage_service.jStorage?String(_storage_service.jStorage).length:0;}
function _save(){try{_storage_service.jStorage=json_encode(_storage);if(_storage_elm){_storage_elm.setAttribute("jStorage",_storage_service.jStorage);_storage_elm.save("jStorage");}
_storage_size=_storage_service.jStorage?String(_storage_service.jStorage).length:0;}catch(E7){}}
function _checkKey(key){if(!key||(typeof key!="string"&&typeof key!="number")){throw new TypeError('Key name must be string or numeric');}
return true;}
$.jStorage={version:"0.1.5.0",set:function(key,value){_checkKey(key);if(_XMLService.isXML(value)){value={_is_xml:true,xml:_XMLService.encode(value)};}
_storage[key]=value;_save();return value;},get:function(key,def){_checkKey(key);if(key in _storage){if(typeof _storage[key]=="object"&&_storage[key]._is_xml&&_storage[key]._is_xml){return _XMLService.decode(_storage[key].xml);}else{return _storage[key];}}
return typeof(def)=='undefined'?null:def;},deleteKey:function(key){_checkKey(key);if(key in _storage){delete _storage[key];_save();return true;}
return false;},flush:function(){_storage={};_save();try{window.localStorage.clear();}catch(E8){}
return true;},storageObj:function(){function F(){}
F.prototype=_storage;return new F();},index:function(){var index=[],i;for(i in _storage){if(_storage.hasOwnProperty(i)){index.push(i);}}
return index;},storageSize:function(){return _storage_size;},currentBackend:function(){return _backend;},storageAvailable:function(){return!!_backend;},reInit:function(){var new_storage_elm,data;if(_storage_elm&&_storage_elm.addBehavior){new_storage_elm=document.createElement('link');_storage_elm.parentNode.replaceChild(new_storage_elm,_storage_elm);_storage_elm=new_storage_elm;_storage_elm.style.behavior='url(#default#userData)';document.getElementsByTagName('head')[0].appendChild(_storage_elm);_storage_elm.load("jStorage");data="{}";try{data=_storage_elm.getAttribute("jStorage");}catch(E5){}
_storage_service.jStorage=data;_backend="userDataBehavior";}
_load_storage();}};_init();})(window.jQuery||window.$);

