(function(D){var A="Lite-1.0";D.fn.cycle=function(E){return this.each(function(){E=E||{};if(this.cycleTimeout){clearTimeout(this.cycleTimeout)}this.cycleTimeout=0;this.cyclePause=0;var I=D(this);var J=E.slideExpr?D(E.slideExpr,this):I.children();var G=J.get();if(G.length<2){if(window.console&&window.console.log){window.console.log("terminating; too few slides: "+G.length)}return }var H=D.extend({},D.fn.cycle.defaults,E||{},D.metadata?I.metadata():D.meta?I.data():{});H.before=H.before?[H.before]:[];H.after=H.after?[H.after]:[];H.after.unshift(function(){H.busy=0});var F=this.className;H.width=parseInt((F.match(/w:(\d+)/)||[])[1])||H.width;H.height=parseInt((F.match(/h:(\d+)/)||[])[1])||H.height;H.timeout=parseInt((F.match(/t:(\d+)/)||[])[1])||H.timeout;if(I.css("position")=="static"){I.css("position","relative")}if(H.width){I.width(H.width)}if(H.height&&H.height!="auto"){I.height(H.height)}var K=0;J.css({position:"absolute",top:0,left:0}).hide().each(function(M){D(this).css("z-index",G.length-M)});D(G[K]).css("opacity",1).show();if(D.browser.msie){G[K].style.removeAttribute("filter")}if(H.fit&&H.width){J.width(H.width)}if(H.fit&&H.height&&H.height!="auto"){J.height(H.height)}if(H.pause){I.hover(function(){this.cyclePause=1},function(){this.cyclePause=0})}D.fn.cycle.transitions.fade(I,J,H);J.each(function(){var M=D(this);this.cycleH=(H.fit&&H.height)?H.height:M.height();this.cycleW=(H.fit&&H.width)?H.width:M.width()});J.not(":eq("+K+")").css({opacity:0});if(H.cssFirst){D(J[K]).css(H.cssFirst)}if(H.timeout){if(H.speed.constructor==String){H.speed={slow:600,fast:200}[H.speed]||400}if(!H.sync){H.speed=H.speed/2}while((H.timeout-H.speed)<250){H.timeout+=H.speed}}H.speedIn=H.speed;H.speedOut=H.speed;H.slideCount=G.length;H.currSlide=K;H.nextSlide=1;var L=J[K];if(H.before.length){H.before[0].apply(L,[L,L,H,true])}if(H.after.length>1){H.after[1].apply(L,[L,L,H,true])}if(H.click&&!H.next){H.next=H.click}if(H.next){D(H.next).bind("click",function(){return C(G,H,H.rev?-1:1)})}if(H.prev){D(H.prev).bind("click",function(){return C(G,H,H.rev?1:-1)})}if(H.timeout){this.cycleTimeout=setTimeout(function(){B(G,H,0,!H.rev)},H.timeout+(H.delay||0))}})};function B(J,E,I,K){if(E.busy){return }var H=J[0].parentNode,M=J[E.currSlide],L=J[E.nextSlide];if(H.cycleTimeout===0&&!I){return }if(I||!H.cyclePause){if(E.before.length){D.each(E.before,function(N,O){O.apply(L,[M,L,E,K])})}var F=function(){if(D.browser.msie){this.style.removeAttribute("filter")}D.each(E.after,function(N,O){O.apply(L,[M,L,E,K])})};if(E.nextSlide!=E.currSlide){E.busy=1;D.fn.cycle.custom(M,L,E,F)}var G=(E.nextSlide+1)==J.length;E.nextSlide=G?0:E.nextSlide+1;E.currSlide=G?J.length-1:E.nextSlide-1}if(E.timeout){H.cycleTimeout=setTimeout(function(){B(J,E,0,!E.rev)},E.timeout)}}function C(E,F,I){var H=E[0].parentNode,G=H.cycleTimeout;if(G){clearTimeout(G);H.cycleTimeout=0}F.nextSlide=F.currSlide+I;if(F.nextSlide<0){F.nextSlide=E.length-1}else{if(F.nextSlide>=E.length){F.nextSlide=0}}B(E,F,1,I>=0);return false}D.fn.cycle.custom=function(K,H,I,E){var J=D(K),G=D(H);G.css({opacity:0});var F=function(){G.animate({opacity:1},I.speedIn,I.easeIn,E)};J.animate({opacity:0},I.speedOut,I.easeOut,function(){J.css({display:"none"});if(!I.sync){F()}});if(I.sync){F()}};D.fn.cycle.transitions={fade:function(F,G,E){G.not(":eq(0)").css("opacity",0);E.before.push(function(){D(this).show()})}};D.fn.cycle.ver=function(){return A};D.fn.cycle.defaults={timeout:4000,speed:1000,next:null,prev:null,before:null,after:null,height:"auto",sync:1,fit:0,pause:0,delay:0,slideExpr:null}})(jQuery);
(function(i){function q(a){if(a)if(d.back_disable==false)d.back.css("opacity",1);else{if(d.back!=false)d.back[0].className=t.back}else if(d.back_disable==false)d.back.css("opacity",0.5);else if(d.back!=false)d.back[0].className=d.back_disable}function s(a){if(a)if(d.forward_disable==false)d.forward.css("opacity",1);else{if(d.forward!=false)d.forward[0].className=t.forward}else if(d.forward_disable==false)d.forward.css("opacity",0.5);else if(d.forward!=false)d.forward[0].className=d.forward_disable} function K(a){if(i.browser.msie)r=document.selection.createRange();if(a.keyCode!=17&&!(a.ctrlKey&&(a.keyCode==89||a.keyCode==90))){b.val().length!=0?q(true):q(false);if(m!=0){n.slice(0,n.length-m);s(false);m=0}if(a.keyCode==8||a.keyCode==13||a.keyCode==32||a.keyCode==46||a.ctrlKey&&(a.keyCode==67||a.keyCode==86))u();i.fn.bbcodeeditor.preview()}}function B(a){if(i.browser.msie)r=document.selection.createRange();if(d.keyboard&&a.ctrlKey)if(a.keyCode==66&&d.bold!=false){a.preventDefault();j("bold text", "[b]","[/b]")}else if(a.keyCode==73&&d.italic!=false){a.preventDefault();j("italic text","[i]","[/i]")}else if(a.keyCode==75&&d.code!=false){a.preventDefault();j("function(event) {","[code]","[/code]",true)}else if(a.keyCode==76&&d.link!=false){a.preventDefault();C()}else if(a.keyCode==80&&d.image!=false){a.preventDefault();D()}else if(a.keyCode==81&&d.quote!=false){a.preventDefault();j("quote","[quote]","[/quote]",true)}else if(a.keyCode==85&&d.underline!=false){a.preventDefault();j("underline text", "[u]","[/u]")}else if(a.keyCode==89&&d.forward!=false){a.preventDefault();E()}else if(a.keyCode==90&&d.back!=false){a.preventDefault();F()}if(a.keyCode==13){var c=w().start,f=b[0].value.substring(0,c).lastIndexOf("\n");f=f==-1?0:f+1;var g=b[0].value.substring(f,c).match(/^\t+/g);if(g!=null){a.preventDefault();f=x();a=k;for(var e=0;e<g[0].length;e++)a+="\t";b[0].value=b[0].value.substring(0,c)+a+b[0].value.substring(c);o(c+a.length,c+a.length);y(f)}}else if(a.keyCode==9){a.preventDefault();f=x();u(); c=w();c.start!=c.end&&b[0].value.substr(c.start,1)=="\n"&&c.start++;g=b[0].value.substring(c.start,c.end).match(/\n/g);if(g!=null){var h=b[0].value.substring(0,c.start).lastIndexOf(k),l=h!=-1?h:0;if(a.shiftKey){e=b[0].value.substr(h!=-1?h+k.length:0,1)=="\t"?1:0;g=b[0].value.substring(l,c.end).match(/\n\t/g,"\n");if(h==-1&&b[0].value.substr(0,1)=="\t"){b[0].value=b[0].value.substr(1);g.push(0)}a=b[0].value.substring(l,c.end).replace(/\n\t/g,"\n");b[0].value=b[0].value.substring(0,l)+a+b[0].value.substring(c.end); o(c.start-e,c.end-(g!=null?g.length:0))}else{a=b[0].value.substring(l,c.end).replace(/\n/g,"\n\t");b[0].value=(h==-1?"\t":"")+b[0].value.substring(0,l)+a+b[0].value.substring(c.end);o(c.start+1,c.end+g.length+1)}}else if(a.shiftKey){g=b[0].value.substring(0,c.start).lastIndexOf("\n");e=g==-1?0:g;h=b[0].value.substring(e+1).indexOf("\n");if(h==-1)h=b[0].value.length;else h+=e+1;if(g==-1){l=b[0].value.substring(e,h).match(/^\t/);a=b[0].value.substring(e,h).replace(/^\t/,"")}else{l=b[0].value.substring(e, h).match(/\n\t/);a=b[0].value.substring(e,h).replace(/\n\t/,"\n")}b[0].value=b[0].value.substring(0,e)+a+b[0].value.substring(h);if(l!=null)o(c.start-(c.start-1>g?1:0),c.end-(c.start-1>g||c.start!=c.end?1:0))}else{b[0].value=b[0].value.substring(0,c.start)+"\t"+b[0].value.substring(c.start);o(c.start+1,c.start+1)}y(f)}}function x(){return{scrollTop:b.scrollTop(),scrollHeight:b[0].scrollHeight}}function y(a){b.scrollTop(a.scrollTop+b[0].scrollHeight-a.scrollHeight)}function u(){m=0;s(false);q(true); n[n.length-1]!=b[0].value&&n.push(b[0].value)}function F(){var a=b.scrollTop();if(m==0){u();m++}if(m!=n.length){m++;b[0].value=n[n.length-m];i.fn.bbcodeeditor.preview();s(true);m==n.length&&q(false)}b.scrollTop(a)}function E(){var a=b.scrollTop();if(m>1){b[0].value=n[n.length- --m];i.fn.bbcodeeditor.preview();q(true);m==1&&s(false)}b.scrollTop(a)}function j(a,c,f,g){u();var e=w(),h=x();if(g){if(f!="[/list]"&&c!="[*]")c+=k;if(c!="[*]")f=k+f;if(e.start!=0&&b[0].value.substr(e.start-1,1)!=k.substr(0, 1))c=k+c;if(b[0].value.length!=e.end&&b[0].value.substr(e.end,1)!=k.substr(0,1))f+=k}if(e.start!=e.end){a=b[0].value;if(g){g=new RegExp("\\["+f.substring(k.length==2?4:3,f.length-1)+"(.*?)\\]"+k+(f==k+"[/list]"?"\\[\\*\\]":"")+"$");var l=new RegExp("^"+k+"\\[/"+f.substring(k.length==2?4:3,f.length-1)+"\\]")}else{g=new RegExp("\\["+f.substring(2,f.length-1)+"([^\\]]*?)\\]$","g");l=new RegExp("^\\[/"+f.substring(2,f.length-1)+"\\]","g")}var p=a.substring(0,e.start).match(g),v=a.substring(e.end).match(l); if(p!=null&&v!=null){b[0].value=a.substring(0,e.start).replace(g,"")+a.substring(e.start,e.end)+a.substring(e.end).replace(l,"");o(e.start-p[0].length,e.end-p[0].length)}else{b[0].value=b[0].value.substr(0,e.start)+c+b[0].value.substring(e.start,e.end)+f+b[0].value.substr(e.end);o(e.start+c.length,e.end+c.length)}}else{b[0].value=b[0].value.substring(0,e.start)+c+a+f+b[0].value.substring(e.end);o(e.start+c.length,e.start+c.length+a.length)}y(h);i.fn.bbcodeeditor.preview()}function o(a,c){if(i.browser.msie){var f= b[0].value.substring(0,a).match(/\r/g);f=f!=null?f.length:0;var g=b[0].value.substring(a,c).match(/\r/g);g=g!=null?g.length:0;var e=b[0].createTextRange();e.collapse(true);e.moveStart("character",a-f);e.moveEnd("character",c-a-g);e.select();r=document.selection.createRange()}else{b[0].setSelectionRange(a,c);b.focus()}}function G(a){a?j("text","[size=150]","[/size]"):j("text","[size=80]","[/size]")}function D(){var a=prompt("Enter the URL of the image","http://");a=="http://"||!a||j(a,"[img]","[/img]")} function C(){var a=prompt("Enter the URL","http://");if(!(a=="http://"||!a)){var c=prompt("Enter text for your link","");c&&j(c,"[url="+a+"]","[/url]")}}function w(){if(i.browser.msie){if(r==null)return{start:b[0].value.length,end:b[0].value.length};var a=r.duplicate(),c=document.body.createTextRange();c.moveToElementText(b[0]);c.setEndPoint("EndToStart",a);var f=document.body.createTextRange();f.moveToElementText(b[0]);f.setEndPoint("StartToEnd",a);var g=false,e=false,h=false,l,p,v,z,H,I;l=p=c.text; v=z=a.text;H=I=f.text;do{if(!g)if(c.compareEndPoints("StartToEnd",c)==0)g=true;else{c.moveEnd("character",-1);if(c.text==l)p+="\r\n";else g=true}if(!e)if(a.compareEndPoints("StartToEnd",a)==0)e=true;else{a.moveEnd("character",-1);if(a.text==v)z+="\r\n";else e=true}if(!h)if(f.compareEndPoints("StartToEnd",f)==0)h=true;else{f.moveEnd("character",-1);if(f.text==H)I+="\r\n";else h=true}}while(!g||!e||!h);return{start:p.length,end:p.length+z.length}}else return{start:b[0].selectionStart,end:b[0].selectionEnd}} var b,d,t={},n=new Array(""),m=0,r=null,A=null,k="\n",J=false;i.fn.bbcodeeditor=function(a){d=i.extend({},i.fn.bbcodeeditor.defaults,a);b=this;i.browser.opera?b.keypress(B):b.keydown(B);i.browser.msie&&i(document).mousedown(function(c){if(A!=null&&A==b[0])r=document.selection.createRange();A=c.target});if(i.browser.msie||i.browser.opera)k="\r\n";d.bold!=false&&d.bold.click(function(){j("bold text","[b]","[/b]")});d.italic!=false&&d.italic.click(function(){j("italic text","[i]","[/i]")});d.underline!= false&&d.underline.click(function(){j("underline text","[u]","[/u]")});d.link!=false&&d.link.click(C);d.quote!=false&&d.quote.click(function(){j("quote","[quote]","[/quote]",true)});d.code!=false&&d.code.click(function(){j("function(event) {","[code]","[/code]",true)});d.image!=false&&d.image.click(D);d.nlist!=false&&d.nlist.click(function(){j("list item","[list=1]"+k+"[*]","[/list]",true)});d.blist!=false&&d.blist.click(function(){j("list item","[list]"+k+"[*]","[/list]",true)});d.litem!=false&& d.litem.click(function(){j("list item","[*]","",true)});d.usize!=false&&d.usize.click(function(){G(true)});d.dsize!=false&&d.dsize.click(function(){G(false)});if(d.back!=false){if(d.back_disable!=false)t.back=d.back[0].className;d.back.click(F);q(false)}if(d.forward!=false){if(d.forward_disable!=false)t.forward=d.forward[0].className;d.forward.click(E);s(false)}if(d.back!=false||d.forward!=false)b.keyup(K);i.fn.bbcodeeditor.preview();return this};i.fn.bbcodeeditor.defaults={bold:false,italic:false, underline:false,link:false,quote:false,code:false,image:false,usize:false,nsize:false,nlist:false,blist:false,litem:false,back:false,back_disable:false,forward:false,forward_disable:false,exit_warning:false,preview:false,keyboard:true};i.fn.bbcodeeditor.preview=function(){if(d.preview!=false){var a=b.val();a=a.replace(/</g,"&lt;");a=a.replace(/>/g,"&gt;");a=a.replace(/[\r\n]/g,"%lb%");var c=[/\[b\](.*?)\[\/b\]/gi,/\[i\](.*?)\[\/i\]/gi,/\[u\](.*?)\[\/u\]/gi,/\[size=(8\d|9\d|1\d\d|200)](.*?)\[\/size\]/gi, /\[url(?:\=?)(.*?)\](.*?)\[\/url\]/gi,/\[img(.*?)\](.*?)\[\/img\]/gi,/(?:%lb%|\s)*\[code(?:\=?)(?:.*?)\](?:%lb%|\s)*(.*?)(?:%lb%|\s)*\[\/code\](?:%lb%|\s)*/gi,/(?:%lb%|\s)*\[quote(?:\=?)(.*?)\](?:%lb%|\s)*(.*?)(?:%lb%|\s)*\[\/quote\](?:%lb%|\s)*/gi,/\[list(.*?)\](.*?)\[\*\](.*?)(?:%lb%|\s)*(\[\*\].*?\[\/list\]|\[\/list\])/i,/(?:%lb%|\s)*\[list\](?:%lb%|\s)*(.*?)(?:%lb%|\s)*\[\/list\](?:%lb%|\s)*/gi,/(?:%lb%|\s)*\[list=(\d)\](?:%lb%|\s)*(.*?)(?:%lb%|\s)*\[\/list\](?:%lb%|\s)*/gi,/(?:%lb%){3,}/g],f= ["<b>$1</b>","<i>$1</i>","<u>$1</u>",'<span style="font-size:$1%;">$2</span>','<a href="$1">$2</a>','<img $1 src="$2" />',"<pre><code>$1</code></pre>","<blockquote>$2</blockquote>","[list$1]$2<li>$3</li>$4","<ul>$1</ul>","<ol start=$1>$2</ol>","%lb%%lb%"];for(var g in c){a=a.replace(c[g],f[g]);if(g==8)for(;a.match(c[g],f[g]);)a=a.replace(c[g],f[g])}a=a.replace(/%lb%/g,"<br />");d.preview.html(a)}};i.fn.bbcodeeditor.pause=function(){J=J?false:true}})(jQuery);;
/**
 * jQuery.ScrollTo - Easy element scrolling using jQuery.
 * Copyright (c) 2008 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 * Date: 2/19/2008
 * @author Ariel Flesler
 * @version 1.3.3
 */
;(function($){var o=$.scrollTo=function(a,b,c){o.window().scrollTo(a,b,c)};o.defaults={axis:'y',duration:1};o.window=function(){return $($.browser.safari?'body':'html')};$.fn.scrollTo=function(l,m,n){if(typeof m=='object'){n=m;m=0}n=$.extend({},o.defaults,n);m=m||n.speed||n.duration;n.queue=n.queue&&n.axis.length>1;if(n.queue)m/=2;n.offset=j(n.offset);n.over=j(n.over);return this.each(function(){var a=this,b=$(a),t=l,c,d={},w=b.is('html,body');switch(typeof t){case'number':case'string':if(/^([+-]=)?\d+(px)?$/.test(t)){t=j(t);break}t=$(t,this);case'object':if(t.is||t.style)c=(t=$(t)).offset()}$.each(n.axis.split(''),function(i,f){var P=f=='x'?'Left':'Top',p=P.toLowerCase(),k='scroll'+P,e=a[k],D=f=='x'?'Width':'Height';if(c){d[k]=c[p]+(w?0:e-b.offset()[p]);if(n.margin){d[k]-=parseInt(t.css('margin'+P))||0;d[k]-=parseInt(t.css('border'+P+'Width'))||0}d[k]+=n.offset[p]||0;if(n.over[p])d[k]+=t[D.toLowerCase()]()*n.over[p]}else d[k]=t[p];if(/^\d+$/.test(d[k]))d[k]=d[k]<=0?0:Math.min(d[k],h(D));if(!i&&n.queue){if(e!=d[k])g(n.onAfterFirst);delete d[k]}});g(n.onAfter);function g(a){b.animate(d,m,n.easing,a&&function(){a.call(this,l)})};function h(D){var b=w?$.browser.opera?document.body:document.documentElement:a;return b['scroll'+D]-b['client'+D]}})};function j(a){return typeof a=='object'?a:{top:a,left:a}}})(jQuery);;
/* Copyright (c) 2007 Brandon Aaron (brandon.aaron@gmail.com || http://brandonaaron.net)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) 
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 *
 * Version: 1.0.2
 * Requires jQuery 1.1.3+
 * Docs: http://docs.jquery.com/Plugins/livequery
 */
(function($){$.extend($.fn,{livequery:function(type,fn,fn2){var self=this,q;if($.isFunction(type))fn2=fn,fn=type,type=undefined;$.each($.livequery.queries,function(i,query){if(self.selector==query.selector&&self.context==query.context&&type==query.type&&(!fn||fn.$lqguid==query.fn.$lqguid)&&(!fn2||fn2.$lqguid==query.fn2.$lqguid))return(q=query)&&false;});q=q||new $.livequery(this.selector,this.context,type,fn,fn2);q.stopped=false;$.livequery.run(q.id);return this;},expire:function(type,fn,fn2){var self=this;if($.isFunction(type))fn2=fn,fn=type,type=undefined;$.each($.livequery.queries,function(i,query){if(self.selector==query.selector&&self.context==query.context&&(!type||type==query.type)&&(!fn||fn.$lqguid==query.fn.$lqguid)&&(!fn2||fn2.$lqguid==query.fn2.$lqguid)&&!this.stopped)$.livequery.stop(query.id);});return this;}});$.livequery=function(selector,context,type,fn,fn2){this.selector=selector;this.context=context||document;this.type=type;this.fn=fn;this.fn2=fn2;this.elements=[];this.stopped=false;this.id=$.livequery.queries.push(this)-1;fn.$lqguid=fn.$lqguid||$.livequery.guid++;if(fn2)fn2.$lqguid=fn2.$lqguid||$.livequery.guid++;return this;};$.livequery.prototype={stop:function(){var query=this;if(this.type)this.elements.unbind(this.type,this.fn);else if(this.fn2)this.elements.each(function(i,el){query.fn2.apply(el);});this.elements=[];this.stopped=true;},run:function(){if(this.stopped)return;var query=this;var oEls=this.elements,els=$(this.selector,this.context),nEls=els.not(oEls);this.elements=els;if(this.type){nEls.bind(this.type,this.fn);if(oEls.length>0)$.each(oEls,function(i,el){if($.inArray(el,els)<0)$.event.remove(el,query.type,query.fn);});}else{nEls.each(function(){query.fn.apply(this);});if(this.fn2&&oEls.length>0)$.each(oEls,function(i,el){if($.inArray(el,els)<0)query.fn2.apply(el);});}}};$.extend($.livequery,{guid:0,queries:[],queue:[],running:false,timeout:null,checkQueue:function(){if($.livequery.running&&$.livequery.queue.length){var length=$.livequery.queue.length;while(length--)$.livequery.queries[$.livequery.queue.shift()].run();}},pause:function(){$.livequery.running=false;},play:function(){$.livequery.running=true;$.livequery.run();},registerPlugin:function(){$.each(arguments,function(i,n){if(!$.fn[n])return;var old=$.fn[n];$.fn[n]=function(){var r=old.apply(this,arguments);$.livequery.run();return r;}});},run:function(id){if(id!=undefined){if($.inArray(id,$.livequery.queue)<0)$.livequery.queue.push(id);}else
$.each($.livequery.queries,function(id){if($.inArray(id,$.livequery.queue)<0)$.livequery.queue.push(id);});if($.livequery.timeout)clearTimeout($.livequery.timeout);$.livequery.timeout=setTimeout($.livequery.checkQueue,20);},stop:function(id){if(id!=undefined)$.livequery.queries[id].stop();else
$.each($.livequery.queries,function(id){$.livequery.queries[id].stop();});}});$.livequery.registerPlugin('append','prepend','after','before','wrap','attr','removeAttr','addClass','removeClass','toggleClass','empty','remove');$(function(){$.livequery.play();});var init=$.prototype.init;$.prototype.init=function(a,c){var r=init.apply(this,arguments);if(a&&a.selector)r.context=a.context,r.selector=a.selector;if(typeof a=='string')r.context=c||document,r.selector=a;return r;};$.prototype.init.prototype=$.prototype;})(jQuery);;
/* Copyright (c) 2006 Brandon Aaron (http://brandonaaron.net)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) 
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 *
 * $LastChangedDate: 2007-06-19 20:25:28 -0500 (Tue, 19 Jun 2007) $
 * $Rev: 2111 $
 *
 * Version 2.1
 */
(function($){$.fn.bgIframe=$.fn.bgiframe=function(s){if($.browser.msie&&parseInt($.browser.version)<=6){s=$.extend({top:'auto',left:'auto',width:'auto',height:'auto',opacity:true,src:'javascript:false;'},s||{});var prop=function(n){return n&&n.constructor==Number?n+'px':n;},html='<iframe class="bgiframe"frameborder="0"tabindex="-1"src="'+s.src+'"'+'style="display:block;position:absolute;z-index:-1;'+(s.opacity!==false?'filter:Alpha(Opacity=\'0\');':'')+'top:'+(s.top=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+\'px\')':prop(s.top))+';'+'left:'+(s.left=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+\'px\')':prop(s.left))+';'+'width:'+(s.width=='auto'?'expression(this.parentNode.offsetWidth+\'px\')':prop(s.width))+';'+'height:'+(s.height=='auto'?'expression(this.parentNode.offsetHeight+\'px\')':prop(s.height))+';'+'"/>';return this.each(function(){if($('> iframe.bgiframe',this).length==0)this.insertBefore(document.createElement(html),this.firstChild);});}return this;};if(!$.browser.version)$.browser.version=navigator.userAgent.toLowerCase().match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)[1];})(jQuery);;
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}('(6($){$.1g.1w=6(o){o=$.1f({r:n,x:n,N:n,17:q,J:n,L:1a,16:n,y:q,u:12,H:3,B:0,k:1,K:n,I:n},o||{});8 G.R(6(){p b=q,A=o.y?"15":"w",P=o.y?"t":"s";p c=$(G),9=$("9",c),E=$("10",9),W=E.Y(),v=o.H;7(o.u){9.1h(E.D(W-v-1+1).V()).1d(E.D(0,v).V());o.B+=v}p f=$("10",9),l=f.Y(),4=o.B;c.5("1c","H");f.5({U:"T",1b:o.y?"S":"w"});9.5({19:"0",18:"0",Q:"13","1v-1s-1r":"S","z-14":"1"});c.5({U:"T",Q:"13","z-14":"2",w:"1q"});p g=o.y?t(f):s(f);p h=g*l;p j=g*v;f.5({s:f.s(),t:f.t()});9.5(P,h+"C").5(A,-(4*g));c.5(P,j+"C");7(o.r)$(o.r).O(6(){8 m(4-o.k)});7(o.x)$(o.x).O(6(){8 m(4+o.k)});7(o.N)$.R(o.N,6(i,a){$(a).O(6(){8 m(o.u?o.H+i:i)})});7(o.17&&c.11)c.11(6(e,d){8 d>0?m(4-o.k):m(4+o.k)});7(o.J)1p(6(){m(4+o.k)},o.J+o.L);6 M(){8 f.D(4).D(0,v)};6 m(a){7(!b){7(o.K)o.K.Z(G,M());7(o.u){7(a<=o.B-v-1){9.5(A,-((l-(v*2))*g)+"C");4=a==o.B-v-1?l-(v*2)-1:l-(v*2)-o.k}F 7(a>=l-v+1){9.5(A,-((v)*g)+"C");4=a==l-v+1?v+1:v+o.k}F 4=a}F{7(a<0||a>l-v)8;F 4=a}b=12;9.1o(A=="w"?{w:-(4*g)}:{15:-(4*g)},o.L,o.16,6(){7(o.I)o.I.Z(G,M());b=q});7(!o.u){$(o.r+","+o.x).1n("X");$((4-o.k<0&&o.r)||(4+o.k>l-v&&o.x)||[]).1m("X")}}8 q}})};6 5(a,b){8 1l($.5(a[0],b))||0};6 s(a){8 a[0].1k+5(a,\'1j\')+5(a,\'1i\')};6 t(a){8 a[0].1t+5(a,\'1u\')+5(a,\'1e\')}})(1x);',62,96,'||||curr|css|function|if|return|ul|||||||||||scroll|itemLength|go|null||var|false|btnPrev|width|height|circular||left|btnNext|vertical||animCss|start|px|slice|tLi|else|this|visible|afterEnd|auto|beforeStart|speed|vis|btnGo|click|sizeCss|position|each|none|hidden|overflow|clone|tl|disabled|size|call|li|mousewheel|true|relative|index|top|easing|mouseWheel|padding|margin|200|float|visibility|append|marginBottom|extend|fn|prepend|marginRight|marginLeft|offsetWidth|parseInt|addClass|removeClass|animate|setInterval|0px|type|style|offsetHeight|marginTop|list|jCarouselLite|jQuery'.split('|'),0,{}));
/*
 * Facebox (for jQuery)
 * version: 1.2 (05/05/2008)
 * @requires jQuery v1.2 or later
 *
 * Examples at http://famspam.com/facebox/
 *
 * Licensed under the MIT:
 *   http://www.opensource.org/licenses/mit-license.php
 *
 * Copyright 2007, 2008 Chris Wanstrath [ chris@ozmm.org ]
 *
 * Usage:
 *  
 *  jQuery(document).ready(function() {
 *    jQuery('a[rel*=facebox]').facebox() 
 *  })
 *
 *  <a href="#terms" rel="facebox">Terms</a>
 *    Loads the #terms div in the box
 *
 *  <a href="terms.html" rel="facebox">Terms</a>
 *    Loads the terms.html page in the box
 *
 *  <a href="terms.png" rel="facebox">Terms</a>
 *    Loads the terms.png image in the box
 *
 *
 *  You can also use it programmatically:
 * 
 *    jQuery.facebox('some html')
 *
 *  The above will open a facebox with "some html" as the content.
 *    
 *    jQuery.facebox(function($) { 
 *      $.get('blah.html', function(data) { $.facebox(data) })
 *    })
 *
 *  The above will show a loading screen before the passed function is called,
 *  allowing for a better ajaxy experience.
 *
 *  The facebox function can also display an ajax page or image:
 *  
 *    jQuery.facebox({ ajax: 'remote.html' })
 *    jQuery.facebox({ image: 'dude.jpg' })
 *
 *  Want to close the facebox?  Trigger the 'close.facebox' document event:
 *
 *    jQuery(document).trigger('close.facebox')
 *
 *  Facebox also has a bunch of other hooks:
 *
 *    loading.facebox
 *    beforeReveal.facebox
 *    reveal.facebox (aliased as 'afterReveal.facebox')
 *    init.facebox
 *
 *  Simply bind a function to any of these hooks:
 *
 *   $(document).bind('reveal.facebox', function() { ...stuff to do after the facebox and contents are revealed... })
 *
 */
(function($) {
  $.facebox = function(data, klass) {
    $.facebox.loading()

    if (data.ajax) fillFaceboxFromAjax(data.ajax)
    else if (data.image) fillFaceboxFromImage(data.image)
    else if (data.div) fillFaceboxFromHref(data.div)
    else if ($.isFunction(data)) data.call($)
    else $.facebox.reveal(data, klass)
  }

  /*
   * Public, $.facebox methods
   */

  $.extend($.facebox, {
    settings: {
      opacity      : .5,
      overlay      : true,
      loadingImage : '/images/loading.gif',
      closeImage   : '/images/iconClose.png',
      imageTypes   : [ 'png', 'jpg', 'jpeg', 'gif' ],
      modal        : true,
      faceboxHtml  : '\
    <div id="facebox" style="display:none;"> \
      <div class="popup"> \
        <table> \
          <tbody> \
            <tr> \
              <td class="topl"/><td class="top"/><td class="topr"/> \
            </tr> \
            <tr> \
              <td class="left"/> \
              <td class="body"> \
                <div class="content"> \
                </div> \
                <div class="closeButton"> \
                  <a href="#" class="close"> \
                   close \
                  </a> \
                </div> \
              </td> \
              <td class="right"/> \
            </tr> \
            <tr> \
              <td class="botl"/><td class="bot"/><td class="botr"/> \
            </tr> \
          </tbody> \
        </table> \
      </div> \
    </div>'
    },

    loading: function() {
      init()
      if ($('#facebox .loading').length == 1) return true
      showOverlay()

      $('#facebox .content').empty()
      $('#facebox .body').children().hide().end().
        append('<div class="loading"><img src="'+$.facebox.settings.loadingImage+'"/></div>')

      $('#facebox').css({
        top:	getPageScroll()[1] + (getPageHeight() / 10),
        left:	385.5
      }).show()

      $(document).bind('keydown.facebox', function(e) {
        if (e.keyCode == 27) $.facebox.close()
        return true
      })
      $(document).trigger('loading.facebox')
    },

    reveal: function(data, klass) {
      $(document).trigger('beforeReveal.facebox')
      if (klass) $('#facebox .content').addClass(klass)
      $('#facebox .content').append(data)
      $('#facebox .loading').remove()
      $('#facebox .body').children().fadeIn('normal')
      $('#facebox').css('left', $(window).width() / 2 - ($('#facebox table').width() / 2) /*- 75*/ )
      $(document).trigger('reveal.facebox').trigger('afterReveal.facebox')
    },

    close: function() {
      $(document).trigger('close.facebox')
      return false
    }
  })

  /*
   * Public, $.fn methods
   */

  $.fn.facebox = function(settings) {
    init(settings)

    function clickHandler() {
      $.facebox.loading(true)

      // support for rel="facebox.inline_popup" syntax, to add a class
      // also supports deprecated "facebox[.inline_popup]" syntax
      var klass = this.rel.match(/facebox\[?\.(\w+)\]?/)
      if (klass) klass = klass[1]

      fillFaceboxFromHref(this.href, klass)
      return false
    }

    return this.click(clickHandler)
  }

  /*
   * Private methods
   */

  // called one time to setup facebox on this page
  function init(settings) {
    if ($.facebox.settings.inited) return true
    else $.facebox.settings.inited = true

    $(document).trigger('init.facebox')
    makeCompatible()

    var imageTypes = $.facebox.settings.imageTypes.join('|')
    $.facebox.settings.imageTypesRegexp = new RegExp('\.' + imageTypes + '$', 'i')

    if (settings) $.extend($.facebox.settings, settings)
    $('body').append($.facebox.settings.faceboxHtml)

    var preload = [ new Image(), new Image() ]
    preload[0].src = $.facebox.settings.closeImage
    preload[1].src = $.facebox.settings.loadingImage

    $('#facebox').find('.bot:first, .botl, .botr, .topl, .topr').each(function() {
      preload.push(new Image())
      preload.slice(-1).src = $(this).css('background-image').replace(/url\((.+)\)/, '$1')
    })

    $('#facebox .close').click($.facebox.close)
    $('#facebox .close_image').attr('src', $.facebox.settings.closeImage)
  }
  
  // getPageScroll() by quirksmode.com
  function getPageScroll() {
    var xScroll, yScroll;
    if (self.pageYOffset) {
      yScroll = self.pageYOffset;
      xScroll = self.pageXOffset;
    } else if (document.documentElement && document.documentElement.scrollTop) {	 // Explorer 6 Strict
      yScroll = document.documentElement.scrollTop;
      xScroll = document.documentElement.scrollLeft;
    } else if (document.body) {// all other Explorers
      yScroll = document.body.scrollTop;
      xScroll = document.body.scrollLeft;	
    }
    return new Array(xScroll,yScroll) 
  }

  // Adapted from getPageSize() by quirksmode.com
  function getPageHeight() {
    var windowHeight
    if (self.innerHeight) {	// all except Explorer
      windowHeight = self.innerHeight;
    } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
      windowHeight = document.documentElement.clientHeight;
    } else if (document.body) { // other Explorers
      windowHeight = document.body.clientHeight;
    }	
    return windowHeight
  }

  // Backwards compatibility
  function makeCompatible() {
    var $s = $.facebox.settings

    $s.loadingImage = $s.loading_image || $s.loadingImage
    $s.closeImage = $s.close_image || $s.closeImage
    $s.imageTypes = $s.image_types || $s.imageTypes
    $s.faceboxHtml = $s.facebox_html || $s.faceboxHtml
  }

  // Figures out what you want to display and displays it
  // formats are:
  //     div: #id
  //   image: blah.extension
  //    ajax: anything else
  function fillFaceboxFromHref(href, klass) {
    // div
    if (href.match(/#/)) {
      var url    = window.location.href.split('#')[0]
      var target = href.replace(url,'')
      $.facebox.reveal($(target).clone().show(), klass)

    // image
    } else if (href.match($.facebox.settings.imageTypesRegexp)) {
      fillFaceboxFromImage(href, klass)
    // ajax
    } else {
      fillFaceboxFromAjax(href, klass)
    }
  }

  function fillFaceboxFromImage(href, klass) {
    var image = new Image()
    image.onload = function() {
      $.facebox.reveal('<div class="image"><img src="' + image.src + '" /></div>', klass)
    }
    image.src = href
  }

  function fillFaceboxFromAjax(href, klass) {
    $.get(href, function(data) { $.facebox.reveal(data, klass) })
  }

  function skipOverlay() {
    return $.facebox.settings.overlay == false || $.facebox.settings.opacity === null 
  }

  function showOverlay() {
    if (skipOverlay()) return

    if ($('facebox_overlay').length == 0) 
      $("body").append('<div id="facebox_overlay" class="facebox_hide"></div>')

    $('#facebox_overlay').hide().addClass("facebox_overlayBG")
      .css('opacity', $.facebox.settings.opacity)
      //.click(function() { $(document).trigger('close.facebox') })
      .click(function() {if ($.facebox.settings.modal != true)$(document).trigger('close.facebox')}) 
      .fadeIn(200)
    return false
  }

  function hideOverlay() {
    if (skipOverlay()) return

    $('#facebox_overlay').fadeOut(200, function(){
      $("#facebox_overlay").removeClass("facebox_overlayBG")
      $("#facebox_overlay").addClass("facebox_hide") 
      $("#facebox_overlay").remove()
    })
    
    return false
  }

  /*
   * Bindings
   */

  $(document).bind('close.facebox', function() {
    $(document).unbind('keydown.facebox')
    $('#facebox').fadeOut(function() {
      $('#facebox .content').removeClass().addClass('content')
      hideOverlay()
      $('#facebox .loading').remove()
    })
  })

})(jQuery);

;
(function(b){b.fn.extend({tip:function(c){c=b.extend({delay:1E3},c);return this.each(function(){var d=b(this),a=d.children();a.append("<div class='tooltip-close'></div>");a.children(".tooltip-close").click(function(e){e.stopPropagation();e.preventDefault();a.fadeOut("fast")});d.click(function(){a.fadeIn("fast")})})}})})(jQuery);;
jQuery.url=function(){var segments={};var parsed={};var options={url:window.location,strictMode:false,key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}};var parseUri=function(){str=decodeURI(options.url);var m=options.parser[options.strictMode?"strict":"loose"].exec(str);var uri={};var i=14;while(i--){uri[options.key[i]]=m[i]||""}uri[options.q.name]={};uri[options.key[12]].replace(options.q.parser,function($0,$1,$2){if($1){uri[options.q.name][$1]=$2}});return uri};var key=function(key){if(!parsed.length){setUp()}if(key=="base"){if(parsed.port!==null&&parsed.port!==""){return parsed.protocol+"://"+parsed.host+":"+parsed.port+"/"}else{return parsed.protocol+"://"+parsed.host+"/"}}return(parsed[key]==="")?null:parsed[key]};var param=function(item){if(!parsed.length){setUp()}return(parsed.queryKey[item]===null)?null:parsed.queryKey[item]};var setUp=function(){parsed=parseUri();getSegments()};var getSegments=function(){var p=parsed.path;segments=[];segments=parsed.path.length==1?{}:(p.charAt(p.length-1)=="/"?p.substring(1,p.length-1):path=p.substring(1)).split("/")};return{setMode:function(mode){strictMode=mode=="strict"?true:false;return this},setUrl:function(newUri){options.url=newUri===undefined?window.location:newUri;setUp();return this},segment:function(pos){if(!parsed.length){setUp()}if(pos===undefined){return segments.length}return(segments[pos]===""||segments[pos]===undefined)?null:segments[pos]},attr:key,param:param}}();;
// Simulates PHP's date function
Date.prototype.format=function(format){var returnStr='';var replace=Date.replaceChars;for(var i=0;i<format.length;i++){var curChar=format.charAt(i);if(replace[curChar]){returnStr+=replace[curChar].call(this);}else{returnStr+=curChar;}}return returnStr;};Date.replaceChars={shortMonths:['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'],longMonths:['January','February','March','April','May','June','July','August','September','October','November','December'],shortDays:['Sun','Mon','Tue','Wed','Thu','Fri','Sat'],longDays:['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'],d:function(){return(this.getDate()<10?'0':'')+this.getDate();},D:function(){return Date.replaceChars.shortDays[this.getDay()];},j:function(){return this.getDate();},l:function(){return Date.replaceChars.longDays[this.getDay()];},N:function(){return this.getDay()+1;},S:function(){return(this.getDate()%10==1&&this.getDate()!=11?'st':(this.getDate()%10==2&&this.getDate()!=12?'nd':(this.getDate()%10==3&&this.getDate()!=13?'rd':'th')));},w:function(){return this.getDay();},z:function(){return"Not Yet Supported";},W:function(){return"Not Yet Supported";},F:function(){return Date.replaceChars.longMonths[this.getMonth()];},m:function(){return(this.getMonth()<9?'0':'')+(this.getMonth()+1);},M:function(){return Date.replaceChars.shortMonths[this.getMonth()];},n:function(){return this.getMonth()+1;},t:function(){return"Not Yet Supported";},L:function(){return(((this.getFullYear()%4==0)&&(this.getFullYear()%100!=0))||(this.getFullYear()%400==0))?'1':'0';},o:function(){return"Not Supported";},Y:function(){return this.getFullYear();},y:function(){return(''+this.getFullYear()).substr(2);},a:function(){return this.getHours()<12?'am':'pm';},A:function(){return this.getHours()<12?'AM':'PM';},B:function(){return"Not Yet Supported";},g:function(){return this.getHours()%12||12;},G:function(){return this.getHours();},h:function(){return((this.getHours()%12||12)<10?'0':'')+(this.getHours()%12||12);},H:function(){return(this.getHours()<10?'0':'')+this.getHours();},i:function(){return(this.getMinutes()<10?'0':'')+this.getMinutes();},s:function(){return(this.getSeconds()<10?'0':'')+this.getSeconds();},e:function(){return"Not Yet Supported";},I:function(){return"Not Supported";},O:function(){return(-this.getTimezoneOffset()<0?'-':'+')+(Math.abs(this.getTimezoneOffset()/60)<10?'0':'')+(Math.abs(this.getTimezoneOffset()/60))+'00';},P:function(){return(-this.getTimezoneOffset()<0?'-':'+')+(Math.abs(this.getTimezoneOffset()/60)<10?'0':'')+(Math.abs(this.getTimezoneOffset()/60))+':'+(Math.abs(this.getTimezoneOffset()%60)<10?'0':'')+(Math.abs(this.getTimezoneOffset()%60));},T:function(){var m=this.getMonth();this.setMonth(0);var result=this.toTimeString().replace(/^.+ \(?([^\)]+)\)?$/,'$1');this.setMonth(m);return result;},Z:function(){return-this.getTimezoneOffset()*60;},c:function(){return this.format("Y-m-d")+"T"+this.format("H:i:sP");},r:function(){return this.toString();},U:function(){return this.getTime()/1000;}};;
// jquery.jsonp 2.0.1 (c)2010 Julian Aubourg | MIT License
// http://code.google.com/p/jquery-jsonp/
(function(e,b){function d(){}function r(z){c=[z]}function m(z){f.insertBefore(z,f.firstChild)}function l(B,z,A){B&&B.apply(z,A)}function k(z){return/\?/.test(z)?"&":"?"}var n="async",p="",x="error",q="_jqjsp",u="on",o=u+x,a=u+"load",i=u+"readystatechange",w="removeChild",g="<script/>",t="success",v="timeout",f=e("head")[0]||document.documentElement,s={},j=0,c,h={callback:q,url:location.href};function y(z){z=e.extend({},h,z);var N=z.complete,B=z.dataFilter,J=z.callbackParameter,O=z.callback,D=z.cache,F=z.pageCache,A=z.url,I=z.data,M=z.timeout,L,H=z.beforeSend,G=0,E=d;z.abort=function(){!G++&&E()};if(H&&(H(z,z)===false||G)){return z}A=A||p;I=I?((typeof I)=="string"?I:e.param(I)):p;A+=I?(k(A)+I):p;J&&(A+=k(A)+escape(J)+"=?");!D&&!F&&(A+=k(A)+"_"+(new Date()).getTime()+"=");A=A.replace(/=\?(&|$)/,"="+O+"$1");function K(P){!G++&&b(function(){E();F&&(s[A]={s:[P]});B&&(P=B.apply(z,[P]));l(z.success,z,[P,t]);l(N,z,[z,t])},0)}function C(P){!G++&&b(function(){E();F&&P!=v&&(s[A]=P);l(z.error,z,[z,P]);l(N,z,[z,P])},0)}F&&(L=s[A])?(L.s?K(L.s[0]):C(L)):b(function(Q,P,R){if(!G){R=M>0&&b(function(){C(v)},M);E=function(){R&&clearTimeout(R);Q[i]=Q[a]=Q[o]=null;f[w](Q);P&&f[w](P)};window[O]=r;Q=e(g)[0];function S(T){T=c;c=undefined;T?K(T[0]):C(x)}Q[i]=function(){/loaded|complete/.test(Q.readyState)&&S()};Q[o]=Q[a]=S;e.browser.opera?((P=e(g)[0]).text="jQuery('#"+(Q.id=q+j++)+"')[0]."+o+"()"):Q[n]=n;Q.src=A;m(Q);P&&m(P)}},0);return z}y.setup=function(z){e.extend(h,z)};e.jsonp=y})(jQuery,setTimeout);;
function Facebook_Connect(url, in_perms, status)
{
    url = url + '?status=' + encodeURIComponent(status);
    if (status == 'promo') {
        var promo = prompt('Please type in your promo code', '');
        url = url + '&promocode=' + encodeURIComponent(promo);
    }

    FB.getLoginStatus(function(response) {
        if (response.session)
        {
            document.location=url;
        }
        else
        {
            FB.login(function(response)
            {
                if (response.session)
                    document.location=url;
            }, {
                perms:in_perms
            }
            );
        }
    });
}

function Facebook_CallPublish(msg, attachment, action_link) {
    FB.ui(
        {
            method: 'stream.publish',
            message: msg,
            attachment: attachment,
            action_links: action_link,
            user_message_prompt: 'Share your thoughts about Worky'
        },
        function(response) {
            if (response && response.post_id) {
                // post was published
            } else {
                // post was not published
            }
        }
    );
}

function Facebook_AddProfileTab() {
    FB.ui(
        {
            method: 'profile.addtab'
        },
        function(response) {
            if (response['tab_added'] == 1) {
                $('#fb_tab_add').remove();
                var options = {};
                options['url'] = '/profile/facebook/settabtrue';
                options['type'] = 'GET';
                jQuery.ajax(options);
            }
        }
    );
};
var QueryWrapper=function(a,b,c,d){this.query=a;this.visualization=b;this.options=c||{};this.errorContainer=d;this.currentDataTable=null;if(!b||!("draw"in b)||typeof b.draw!="function")throw Error("Visualization must have a draw method.");};QueryWrapper.prototype.draw=function(){this.currentDataTable&&this.visualization.draw(this.currentDataTable,this.options)};QueryWrapper.prototype.sendAndDraw=function(){var a=this;this.query.send(function(b){a.handleResponse(b)})};
QueryWrapper.prototype.handleResponse=function(a){this.currentDataTable=null;if(a.isError())this.handleErrorResponse(a);else{this.currentDataTable=a.getDataTable();this.draw()}};QueryWrapper.prototype.handleErrorResponse=function(a){var b=a.getMessage();a=a.getDetailedMessage();if(this.errorContainer)google.visualization.errors.addError(this.errorContainer,b,a,{showInTooltip:false});else throw Error(b+" "+a);};QueryWrapper.prototype.abort=function(){this.query.abort()};;
