(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);;
(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);;
https://github.com/allmarkedup/jQuery-URL-Parser
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}}();;
/**
 * jquery.safesubmit - Disable form buttons to avoid double-clicking
 * @date 23 July 2010
 * @author Jake Trent  http://www.jtsnake.com/
 * @version 1.1
 * Modified by worky to remove some unrequired functions
 */
(function($){$.fn.safesubmit=function(settings){var opts=$.extend({},$.fn.safesubmit.defaults,settings);this.each(function(){$(this).data('opts',opts).click($.fn.safesubmit.safe).ajaxComplete($.fn.safesubmit.unsafe);});return this;};$.fn.safesubmit.safe=function(event,elem){var opts=$(this).data('opts');elem=elem||$(this);if(elem.data('safesubmit')!='fail'){elem.addClass(opts.disabled_class).attr(opts.disabled_attr,opts.disabled_attr_val);}
elem.removeData('safesubmit');};$.fn.safesubmit.unsafe=function(event){var opts=$(this).data('opts');$(event.target).removeClass(opts.disabled_class).removeAttr(opts.disabled_attr);};$.fn.safesubmit.failsubmit=function(elem){elem.data('safesubmit','fail');};$.fn.safesubmit.defaults={disabled_class:"disabled",disabled_attr:"disabled",disabled_attr_val:"disabled"};})(jQuery);;
// 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.1.4 (c)2010 Julian Aubourg | MIT License
// http://code.google.com/p/jquery-jsonp/
(function(e,b){function d(){}function t(C){c=[C]}function m(C){f.insertBefore(C,f.firstChild)}function l(E,C,D){return E&&E.apply(C.context||C,D)}function k(C){return/\?/.test(C)?"&":"?"}var n="async",s="charset",q="",A="error",r="_jqjsp",w="on",o=w+"click",p=w+A,a=w+"load",i=w+"readystatechange",z="removeChild",g="<script/>",v="success",y="timeout",x=e.browser,f=e("head")[0]||document.documentElement,u={},j=0,c,h={callback:r,url:location.href};function B(C){C=e.extend({},h,C);var Q=C.complete,E=C.dataFilter,M=C.callbackParameter,R=C.callback,G=C.cache,J=C.pageCache,I=C.charset,D=C.url,L=C.data,P=C.timeout,O,K=0,H=d;C.abort=function(){!K++&&H()};if(l(C.beforeSend,C,[C])===false||K){return C}D=D||q;L=L?((typeof L)=="string"?L:e.param(L,C.traditional)):q;D+=L?(k(D)+L):q;M&&(D+=k(D)+encodeURIComponent(M)+"=?");!G&&!J&&(D+=k(D)+"_"+(new Date()).getTime()+"=");D=D.replace(/=\?(&|$)/,"="+R+"$1");function N(S){!K++&&b(function(){H();J&&(u[D]={s:[S]});E&&(S=E.apply(C,[S]));l(C.success,C,[S,v]);l(Q,C,[C,v])},0)}function F(S){!K++&&b(function(){H();J&&S!=y&&(u[D]=S);l(C.error,C,[C,S]);l(Q,C,[C,S])},0)}J&&(O=u[D])?(O.s?N(O.s[0]):F(O)):b(function(T,S,U){if(!K){U=P>0&&b(function(){F(y)},P);H=function(){U&&clearTimeout(U);T[i]=T[o]=T[a]=T[p]=null;f[z](T);S&&f[z](S)};window[R]=t;T=e(g)[0];T.id=r+j++;if(I){T[s]=I}function V(W){(T[o]||d)();W=c;c=undefined;W?N(W[0]):F(A)}if(x.msie){T.event=o;T.htmlFor=T.id;T[i]=function(){/loaded|complete/.test(T.readyState)&&V()}}else{T[p]=T[a]=V;x.opera?((S=e(g)[0]).text="jQuery('#"+T.id+"')[0]."+p+"()"):T[n]=n}T.src=D;m(T);S&&m(S)}},0);return C}B.setup=function(C){e.extend(h,C)};e.jsonp=B})(jQuery,setTimeout);;

(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);;
// Faceboook
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){}else{}});}
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()};;
/**
*	@name               Elastic
*	@descripton         Elastic is jQuery plugin that grow and shrink your textareas automatically
*	@version            1.6.10
*	@requires           jQuery 1.2.6+
*	@author             Jan Jarfalk
*	@author-email       jan.jarfalk@unwrongest.com
*	@author-website     http://www.unwrongest.com
*	@licence            MIT License - http://www.opensource.org/licenses/mit-license.php
*/
(function(jQuery){jQuery.fn.extend({elastic:function(){var mimics=['paddingTop','paddingRight','paddingBottom','paddingLeft','fontSize','lineHeight','fontFamily','width','fontWeight','border-top-width','border-right-width','border-bottom-width','border-left-width','borderTopStyle','borderTopColor','borderRightStyle','borderRightColor','borderBottomStyle','borderBottomColor','borderLeftStyle','borderLeftColor'];return this.each(function(){if(this.type!=='textarea'){return false}var $textarea=jQuery(this),$twin=jQuery('<div />').css({'position':'absolute','display':'none','word-wrap':'break-word'}),lineHeight=parseInt($textarea.css('line-height'),10)||parseInt($textarea.css('font-size'),'10'),minheight=parseInt($textarea.css('height'),10)||lineHeight*3,maxheight=parseInt($textarea.css('max-height'),10)||Number.MAX_VALUE,goalheight=0;if(maxheight<0){maxheight=Number.MAX_VALUE}$twin.appendTo($textarea.parent());var i=mimics.length;while(i--){$twin.css(mimics[i].toString(),$textarea.css(mimics[i].toString()))}function setTwinWidth(){curatedWidth=Math.floor(parseInt($textarea.width(),10));if($twin.width()!==curatedWidth){$twin.css({'width':curatedWidth+'px'});update(true)}}function setHeightAndOverflow(height,overflow){var curratedHeight=Math.floor(parseInt(height,10));if($textarea.height()!==curratedHeight){$textarea.css({'height':curratedHeight+'px','overflow':overflow});$textarea.trigger('resize')}}function update(forced){var textareaContent=$textarea.val().replace(/&/g,'&amp;').replace(/ {2}/g,'&nbsp;').replace(/<|>/g,'&gt;').replace(/\n/g,'<br />');var twinContent=$twin.html().replace(/<br>/ig,'<br />');if(forced||textareaContent+'&nbsp;'!==twinContent){$twin.html(textareaContent+'&nbsp;');if(Math.abs($twin.height()+lineHeight-$textarea.height())>3){var goalheight=$twin.height()+lineHeight;if(goalheight>=maxheight){setHeightAndOverflow(maxheight,'auto')}else if(goalheight<=minheight){setHeightAndOverflow(minheight,'hidden')}else{setHeightAndOverflow(goalheight,'hidden')}}}}$textarea.css({'overflow':'hidden'});$textarea.bind('keyup change cut paste',function(){update()});$(window).bind('resize',setTwinWidth);$textarea.bind('resize',setTwinWidth);$textarea.bind('update',update);$textarea.bind('blur',function(){if($twin.height()<maxheight){if($twin.height()>minheight){$textarea.height($twin.height())}else{$textarea.height(minheight)}}});$textarea.bind('input paste',function(e){setTimeout(update,250)});update()})}})})(jQuery);;
/*
 *
 * Textarea Maxlength Setter JQuery Plugin
 * Version 1.0
 *
 * Copyright (c) 2008 Viral Patel
 * website : http://viralpatel.net/blogs
 *
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
*/
jQuery.fn.maxlength=function(){$("textarea[maxlength]").keypress(function(event){var key=event.which;if(key>=33||key==13||key==8){var maxLength=$(this).attr("maxlength");var length=this.value.length;if(length>=maxLength){event.preventDefault();}}});};
// MSDropDown - jquery.dd.js
// author: Marghoob Suleman - Search me on google
// Date: 12th Aug, 2009
// Version: 2.36 {date: 18 Dec, 2010}
// Revision: 31
// web: www.giftlelo.com | www.marghoobsuleman.com
/*
// msDropDown is free jQuery Plugin: you can redistribute it and/or modify
// it under the terms of the either the MIT License or the Gnu General Public License (GPL) Version 2
*/
;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}(';(5($){3 1N="";3 3u=5(p,q){3 r=p;3 s=1b;3 q=$.3k({1g:4r,2g:7,3j:23,1R:11,1T:4t,3e:\'2d\',1O:18,3f:\'4S\',2G:\'\',1k:\'\'},q);1b.1U=2y 3g();3 t="";3 u={};u.2Y=11;u.2o=18;u.2m=1m;3 v=18;3 w={2J:\'4l\',1L:\'4q\',1K:\'4s\',1M:\'4Q\',1f:\'42\',2W:\'4d\',2S:\'4h\',4i:\'4j\',2h:\'4m\',3F:\'4p\'};3 x={2d:q.3e,2N:\'2N\',2M:\'2M\',2L:\'2L\',1u:\'1u\',1j:.30,2K:\'2K\',2v:\'2v\',2n:\'2n\'};3 y={3L:"2k,2P,2I,1Q,2l,2j,1v,1F,2i,1J,4x,2c,2F",41:"1E,1z,1j,44"};1b.1G=2y 3g();3 z=$(r).12("1a");4(3Q(z)=="19"||z.1c<=0){z="4o"+$.1P.3P++;$(r).12("1a",z)};3 A=$(r).12("1k");q.1k+=(A==19)?"":A;3 B=$(r).3M();v=($(r).12("1E")>1||$(r).12("1z")==11)?11:18;4(v){q.2g=$(r).12("1E")};3 C={};3 D=5(a){15 z+w[a]};3 E=5(a){3 b=a;3 c=$(b).12("1k");15 c};3 F=5(a){3 b=$("#"+z+" 2q:8");4(b.1c>1){1t(3 i=0;i<b.1c;i++){4(a==b[i].1i){15 11}}}1d 4(b.1c==1){4(b[0].1i==a){15 11}};15 18};3 G=5(a,b,c,d){3 e="";3 f=(d=="2T")?D("2S"):D("2W");3 g=(d=="2T")?f+"2X"+(b)+"2X"+(c):f+"2X"+(b);3 h="";3 i="";4(q.1O!=18){i=\' \'+q.1O+\' \'+a.3D}1d{h=$(a).12("1W");h=(h.1c==0)?"":\'<3B 3A="\'+h+\'" 3z="3x" /> \'};3 j=$(a).1p();3 k=$(a).4g();3 l=($(a).12("1j")==11)?"1j":"21";C[g]={1H:h+j,24:k,1p:j,1i:a.1i,1a:g};3 m=E(a);4(F(a.1i)==11){e+=\'<a 3q="3p:3n(0);" 1o="8 \'+l+i+\'"\'}1d{e+=\'<a  3q="3p:3n(0);" 1o="\'+l+i+\'"\'};4(m!==18&&m!==19){e+=" 1k=\'"+m+"\'"};e+=\' 1a="\'+g+\'">\';e+=h+\'<1A 1o="\'+x.1u+\'">\'+j+\'</1A></a>\';15 e};3 H=5(){3 f=B;4(f.1c==0)15"";3 g="";3 h=D("2W");3 i=D("2S");f.2V(5(c){3 d=f[c];4(d.4u=="4v"){g+="<1y 1o=\'4J\'>";g+="<1A 1k=\'3h-4R:4Y;3h-1k:3S; 3T:3X;\'>"+$(d).12("3Z")+"</1A>";3 e=$(d).3M();e.2V(5(a){3 b=e[a];g+=G(b,c,a,"2T")});g+="</1y>"}1d{g+=G(d,c,"","")}});15 g};3 I=5(){3 a=D("1L");3 b=D("1f");3 c=q.1k;1X="";1X+=\'<1y 1a="\'+b+\'" 1o="\'+x.2L+\'"\';4(!v){1X+=(c!="")?\' 1k="\'+c+\'"\':\'\'}1d{1X+=(c!="")?\' 1k="2s-1r:45 46 #4b;1s:2x;1q:2D;\'+c+\'"\':\'\'};1X+=\'>\';15 1X};3 J=5(){3 a=D("1K");3 b=D("2h");3 c=D("1M");3 d=D("3F");3 e="";3 f="";4(6.9(z).1D.1c>0){e=$("#"+z+" 2q:8").1p();f=$("#"+z+" 2q:8").12("1W")};f=(f.1c==0||f==19||q.1R==18||q.1O!=18)?"":\'<3B 3A="\'+f+\'" 3z="3x" /> \';3 g=\'<1y 1a="\'+a+\'" 1o="\'+x.2N+\'"\';g+=\'>\';g+=\'<1A 1a="\'+b+\'" 1o="\'+x.2M+\'"></1A><1A 1o="\'+x.1u+\'" 1a="\'+c+\'">\'+f+\'<1A 1o="\'+x.1u+\'">\'+e+\'</1A></1A></1y>\';15 g};3 K=5(){3 c=D("1f");$("#"+c+" a.21").1I("1Q");$("#"+c+" a.21").1e("1Q",5(a){a.26();N(1b);4(!v){$("#"+c).1I("1F");P(18);3 b=(q.1R==18)?$(1b).1p():$(1b).1H();T(b);s.2a()};X()})};3 L=5(){3 d=18;3 e=D("1L");3 f=D("1K");3 g=D("1M");3 h=D("1f");3 i=D("2h");3 j=$("#"+z).2A();j=j+2;3 k=q.1k;4($("#"+e).1c>0){$("#"+e).2t();d=11};3 l=\'<1y 1a="\'+e+\'" 1o="\'+x.2d+\'"\';l+=(k!="")?\' 1k="\'+k+\'"\':\'\';l+=\'>\';l+=J();l+=I();l+=H();l+="</1y>";l+="</1y>";4(d==11){3 m=D("2J");$("#"+m).2U(l)}1d{$("#"+z).2U(l)};4(v){3 f=D("1K");$("#"+f).2u()};$("#"+e).14("2A",j+"1S");$("#"+h).14("2A",(j-2)+"1S");4(B.1c>=q.2g){3 n=2f($("#"+h+" a:3b").14("25-3a"))+2f($("#"+h+" a:3b").14("25-1r"));3 o=((q.3j)*q.2g)-n;$("#"+h).14("1g",o+"1S")}1d 4(v){3 o=$("#"+z).1g();$("#"+h).14("1g",o+"1S")};4(d==18){S();O(z)};4($("#"+z).12("1j")==11){$("#"+e).14("2w",x.1j)};R();$("#"+f).1e("1F",5(a){33(1)});$("#"+f).1e("1J",5(a){33(0)});K();$("#"+h+" a.1j").14("2w",x.1j);4(v){$("#"+h).1e("1F",5(c){4(!u.2o){u.2o=11;$(6).1e("2c",5(a){3 b=a.35;u.2m=b;4(b==39||b==40){a.26();a.2z();U();X()};4(b==37||b==38){a.26();a.2z();V();X()}})}})};$("#"+h).1e("1J",5(a){P(18);$(6).1I("2c");u.2o=18;u.2m=1m});$("#"+f).1e("1Q",5(b){P(18);4($("#"+h+":3c").1c==1){$("#"+h).1I("1F")}1d{$("#"+h).1e("1F",5(a){P(11)});s.3d()}});$("#"+f).1e("1J",5(a){P(18)});4(q.1R&&q.1O!=18){W()}};3 M=5(a){1t(3 i 2r C){4(C[i].1i==a){15 C[i]}};15-1};3 N=5(a){3 b=D("1f");4($("#"+b+" a.8").1c==1){t=$("#"+b+" a.8").1p()};4(!v){$("#"+b+" a.8").1B("8")};3 c=$("#"+b+" a.8").12("1a");4(c!=19){3 d=(u.1V==19||u.1V==1m)?C[c].1i:u.1V};4(a&&!v){$(a).1x("8")};4(v){3 e=u.2m;4($("#"+z).12("1z")==11){4(e==17){u.1V=C[$(a).12("1a")].1i;$(a).4w("8")}1d 4(e==16){$("#"+b+" a.8").1B("8");$(a).1x("8");3 f=$(a).12("1a");3 g=C[f].1i;1t(3 i=2Z.4y(d,g);i<=2Z.4H(d,g);i++){$("#"+M(i).1a).1x("8")}}1d{$("#"+b+" a.8").1B("8");$(a).1x("8");u.1V=C[$(a).12("1a")].1i}}1d{$("#"+b+" a.8").1B("8");$(a).1x("8");u.1V=C[$(a).12("1a")].1i}}};3 O=5(a){3 b=a;6.9(b).4I=5(e){$("#"+b).1P(q)}};3 P=5(a){u.2Y=a};3 Q=5(){15 u.2Y};3 R=5(){3 b=D("1L");3 c=y.3L.4N(",");1t(3 d=0;d<c.1c;d++){3 e=c[d];3 f=Y(e);4(f==11){3i(e){1n"2k":$("#"+b).1e("4T",5(a){6.9(z).2k()});1h;1n"1Q":$("#"+b).1e("1Q",5(a){$("#"+z).1C("1Q")});1h;1n"2l":$("#"+b).1e("2l",5(a){$("#"+z).1C("2l")});1h;1n"2j":$("#"+b).1e("2j",5(a){$("#"+z).1C("2j")});1h;1n"1v":$("#"+b).1e("1v",5(a){$("#"+z).1C("1v")});1h;1n"1F":$("#"+b).1e("1F",5(a){$("#"+z).1C("1F")});1h;1n"2i":$("#"+b).1e("2i",5(a){$("#"+z).1C("2i")});1h;1n"1J":$("#"+b).1e("1J",5(a){$("#"+z).1C("1J")});1h}}}};3 S=5(){3 a=D("2J");$("#"+z).2U("<1y 1o=\'"+x.2K+"\' 1k=\'1g:3U;3V:3W;1q:3l;\' 1a=\'"+a+"\'></1y>");$("#"+z).3Y($("#"+a))};3 T=5(a){3 b=D("1M");$("#"+b).1H(a)};3 U=5(){3 a=D("1M");3 b=D("1f");3 c=$("#"+b+" a.21");1t(3 d=0;d<c.1c;d++){3 e=c[d];3 f=$(e).12("1a");4($(e).3m("8")&&d<c.1c-1){$("#"+b+" a.8").1B("8");$(c[d+1]).1x("8");3 g=$("#"+b+" a.8").12("1a");4(!v){3 h=(q.1R==18)?C[g].1p:C[g].1H;T(h)};4(2f(($("#"+g).1q().1r+$("#"+g).1g()))>=2f($("#"+b).1g())){$("#"+b).2b(($("#"+b).2b())+$("#"+g).1g()+$("#"+g).1g())};1h}}};3 V=5(){3 a=D("1M");3 b=D("1f");3 c=$("#"+b+" a.21");1t(3 d=0;d<c.1c;d++){3 e=c[d];3 f=$(e).12("1a");4($(e).3m("8")&&d!=0){$("#"+b+" a.8").1B("8");$(c[d-1]).1x("8");3 g=$("#"+b+" a.8").12("1a");4(!v){3 h=(q.1R==18)?C[g].1p:C[g].1H;T(h)};4(2f(($("#"+g).1q().1r+$("#"+g).1g()))<=0){$("#"+b).2b(($("#"+b).2b()-$("#"+b).1g())-$("#"+g).1g())};1h}}};3 W=5(){4(q.1O!=18){3 a=D("1M");3 b=6.9(z).1D[6.9(z).1l].3D;4(b.1c>0){3 c=D("1f");3 d=$("#"+c+" a."+b).12("1a");3 e=$("#"+d).14("29-43");3 f=$("#"+d).14("29-1q");3 g=$("#"+d).14("25-3o");4(e!=19){$("#"+a).28("."+x.1u).12(\'1k\',"29:"+e)};4(f!=19){$("#"+a).28("."+x.1u).14(\'29-1q\',f)};4(g!=19){$("#"+a).28("."+x.1u).14(\'25-3o\',g)};$("#"+a).28("."+x.1u).14(\'29-34\',\'47-34\');$("#"+a).28("."+x.1u).14(\'25-3a\',\'48\')}}};3 X=5(){3 a=D("1f");3 b=$("#"+a+" a.8");4(b.1c==1){3 c=$("#"+a+" a.8").1p();3 d=$("#"+a+" a.8").12("1a");4(d!=19){3 e=C[d].24;6.9(z).1l=C[d].1i};4(q.1R&&q.1O!=18)W()}1d 4(b.1c>1){3 f=$("#"+z+" > 2q:8").49("8");1t(3 i=0;i<b.1c;i++){3 d=$(b[i]).12("1a");3 g=C[d].1i;6.9(z).1D[g].8="8"}};3 h=6.9(z).1l;s.1U["1l"]=h};3 Y=5(a){4($("#"+z).12("4a"+a)!=19){15 11};3 b=$("#"+z).2O("4c");4(b&&b[a]){15 11};15 18};3 Z=5(){3 b=D("1f");4(Y(\'2I\')==11){3 c=C[$("#"+b+" a.8").12("1a")].1p;4($.3r(t)!==$.3r(c)&&t!==""){$("#"+z).1C("2I")}};4(Y(\'1v\')==11){$("#"+z).1C("1v")};4(Y(\'2P\')==11){$(6).1e("1v",5(a){$("#"+z).2k();$("#"+z)[0].2P();X();$(6).1I("1v")})}};3 33=5(a){3 b=D("2h");4(a==1)$("#"+b).14({3s:\'0 4f%\'});1d $("#"+b).14({3s:\'0 0\'})};3 3t=5(){1t(3 i 2r 6.9(z)){4(3Q(6.9(z)[i])!=\'5\'&&6.9(z)[i]!==19&&6.9(z)[i]!==1m){s.1w(i,6.9(z)[i],11)}}};3 3v=5(a,b){4(M(b)!=-1){6.9(z)[a]=b;3 c=D("1f");$("#"+c+" a.8").1B("8");$("#"+M(b).1a).1x("8");3 d=M(6.9(z).1l).1H;T(d)}};3 3w=5(i,a){4(a==\'d\'){1t(3 b 2r C){4(C[b].1i==i){4k C[b];1h}}};3 c=0;1t(3 b 2r C){C[b].1i=c;c++}};3 2E=5(){3 a=D("1f");3 b=D("1L");3 c=$("#"+b).1q();3 d=$("#"+b).1g();3 e=$(3y).1g();3 f=$(3y).2b();3 g=$("#"+a).1g();3 h={1T:q.1T,1r:(c.1r+d)+"1S",1s:"2e"};3 i=q.3f;3 j=18;3 k=x.2n;$("#"+a).1B(x.2n);$("#"+a).1B(x.2v);4((e+f)<2Z.4n(g+d+c.1r)){3 l=c.1r-g;4((c.1r-g)<0){l=10};h={1T:q.1T,1r:l+"1S",1s:"2e"};i="2C";j=11;k=x.2v};15{2B:j,3C:i,14:h,2s:k}};1b.3d=5(){4((s.22("1j",11)==11)||(s.22("1D",11).1c==0))15;3 c=D("1f");4(1N!=""&&c!=1N){$("#"+1N).3E("2Q");$("#"+1N).14({1T:\'0\'})};4($("#"+c).14("1s")=="2e"){t=C[$("#"+c+" a.8").12("1a")].1p;$(6).1e("2c",5(a){3 b=a.35;4(b==39||b==40){a.26();a.2z();U()};4(b==37||b==38){a.26();a.2z();V()};4(b==27||b==13){s.2a();X()};4($("#"+z).12("3G")!=19){6.9(z).3G()}});$(6).1e("2F",5(a){4($("#"+z).12("3H")!=19){6.9(z).3H()}});$(6).1e("1v",5(a){4(Q()==18){s.2a()}});3 d=2E();$("#"+c).14(d.14);4(d.2B==11){$("#"+c).14({1s:\'2x\'});$("#"+c).1x(d.2s);4(s.1G["2p"]!=1m){1Y(s.1G["2p"])(s)}}1d{$("#"+c)[d.3C]("2Q",5(){$("#"+c).1x(d.2s);4(s.1G["2p"]!=1m){1Y(s.1G["2p"])(s)}})};4(c!=1N){1N=c}}};1b.2a=5(){3 b=D("1f");$(6).1I("2c");$(6).1I("2F");$(6).1I("1v");3 c=2E();4(c.2B==11){$("#"+b).14("1s","2e")};$("#"+b).3E("2Q",5(a){Z();$("#"+b).14({1T:\'0\'});4(s.1G["3I"]!=1m){1Y(s.1G["3I"])(s)}})};1b.1l=5(i){s.1w("1l",i)};1b.1w=5(a,b,c){4(a==19||b==19)3J{3K:"1w 4z 4A?"};s.1U[a]=b;4(c!=11){3i(a){1n"1l":3v(a,b);1h;1n"1j":s.1j(b,11);1h;1n"1z":6.9(z)[a]=b;v=($(r).12("1E")>0||$(r).12("1z")==11)?11:18;4(v){3 d=$("#"+z).1g();3 f=D("1f");$("#"+f).14("1g",d+"1S");3 g=D("1K");$("#"+g).2u();3 f=D("1f");$("#"+f).14({1s:\'2x\',1q:\'2D\'});K()};1h;1n"1E":6.9(z)[a]=b;4(b==0){6.9(z).1z=18};v=($(r).12("1E")>0||$(r).12("1z")==11)?11:18;4(b==0){3 g=D("1K");$("#"+g).2C();3 f=D("1f");$("#"+f).14({1s:\'2e\',1q:\'3l\'});3 h="";4(6.9(z).1l>=0){3 i=M(6.9(z).1l);h=i.1H;N($("#"+i.1a))};T(h)}1d{3 g=D("1K");$("#"+g).2u();3 f=D("1f");$("#"+f).14({1s:\'2x\',1q:\'2D\'})};1h;4B:4C{6.9(z)[a]=b}4D(e){};1h}}};1b.22=5(a,b){4(a==19&&b==19){15 s.1U};4(a!=19&&b==19){15(s.1U[a]!=19)?s.1U[a]:1m};4(a!=19&&b!=19){15 6.9(z)[a]}};1b.3c=5(a){3 b=D("1L");4(a==11){$("#"+b).2C()}1d 4(a==18){$("#"+b).2u()}1d{15 $("#"+b).14("1s")}};1b.4E=5(a,b){3 c=a;3 d=c.1p;3 e=(c.24==19||c.24==1m)?d:c.24;3 f=(c["1W"]==19||c["1W"]==1m)?\'\':c["1W"];3 i=(b==19||b==1m)?6.9(z).1D.1c:b;6.9(z).1D[i]=2y 4F(d,e);4(f!=\'\')6.9(z).1D[i]["1W"]=f;3 g=M(i);4(g!=-1){3 h=G(6.9(z).1D[i],i,"","");$("#"+g.1a).1H(h)}1d{3 h=G(6.9(z).1D[i],i,"","");3 j=D("1f");$("#"+j).4G(h);K()}};1b.2t=5(i){6.9(z).2t(i);4((M(i))!=-1){$("#"+M(i).1a).2t();3w(i,\'d\')};4(6.9(z).1c==0){T("")}1d{3 a=M(6.9(z).1l).1H;T(a)};s.1w("1l",6.9(z).1l)};1b.1j=5(a,b){6.9(z).1j=a;3 c=D("1L");4(a==11){$("#"+c).14("2w",x.1j);s.2a()}1d 4(a==18){$("#"+c).14("2w",1)};4(b!=11){s.1w("1j",a)}};1b.32=5(){15(6.9(z).32==19)?1m:6.9(z).32};1b.31=5(){4(1Z.1c==1){15 6.9(z).31(1Z[0])}1d 4(1Z.1c==2){15 6.9(z).31(1Z[0],1Z[1])}1d{3J{3K:"4K 1i 4L 4M!"}}};1b.3N=5(a){15 6.9(z).3N(a)};1b.1z=5(a){4(a==19){15 s.22("1z")}1d{s.1w("1z",a)}};1b.1E=5(a){4(a==19){15 s.22("1E")}1d{s.1w("1E",a)}};1b.4O=5(a,b){s.1G[a]=b};1b.4P=5(a){1Y(s.1G[a])(s)};3 3O=5(){s.1w("2R",$.1P.2R);s.1w("2H",$.1P.2H)};3 3R=5(){L();3t();3O();4(q.2G!=\'\'){1Y(q.2G)(s)}};3R()};$.1P={2R:2.36,2H:"4U 4V",3P:20,4W:5(a,b){15 $(a).1P(b).2O("2d")}};$.4X.3k({1P:5(b){15 1b.2V(5(){3 a=2y 3u(1b,b);$(1b).2O(\'2d\',a)})}})})(4e);',62,309,'|||var|if|function|document||selected|getElementById||||||||||||||||||||||||||||||||||||||||||||||||||||||true|attr||css|return|||false|undefined|id|this|length|else|bind|postChildID|height|break|index|disabled|style|selectedIndex|null|case|class|text|position|top|display|for|ddTitleText|mouseup|set|addClass|div|multiple|span|removeClass|trigger|options|size|mouseover|onActions|html|unbind|mouseout|postTitleID|postID|postTitleTextID|bh|useSprite|msDropDown|click|showIcon|px|zIndex|ddProp|oldIndex|title|sDiv|eval|arguments||enabled|get||value|padding|preventDefault||find|background|close|scrollTop|keydown|dd|none|parseInt|visibleRows|postArrowID|mousemove|mousedown|focus|dblclick|currentKey|noBorderTop|keyboardAction|onOpen|option|in|border|remove|hide|borderTop|opacity|block|new|stopPropagation|width|opp|show|relative|bn|keyup|onInit|author|change|postElementHolder|ddOutOfVision|ddChild|arrow|ddTitle|data|blur|fast|version|postOPTAID|opt|after|each|postAID|_|insideWindow|Math||item|form|bj|repeat|keyCode|||||bottom|first|visible|open|mainCSS|animStyle|Object|font|switch|rowHeight|extend|absolute|hasClass|void|left|javascript|href|trim|backgroundPosition|bk|bi|bl|bm|absmiddle|window|align|src|img|ani|className|slideUp|postInputhidden|onkeydown|onkeyup|onClose|throw|message|actions|children|namedItem|bo|counter|typeof|bp|italic|clear|0px|overflow|hidden|both|appendTo|label||prop|_child|image|tabindex|1px|solid|no|2px|removeAttr|on|c3c3c3|events|_msa|jQuery|100|val|_msopta|postInputID|_msinput|delete|_msddHolder|_arrow|floor|msdrpdd|_inp|_msdd|120|_title|9999|nodeName|OPTGROUP|toggleClass|keypress|min|to|what|default|try|catch|add|Option|append|max|refresh|opta|An|is|required|split|addMyEvent|fireEvent|_titletext|weight|slideDown|mouseenter|Marghoob|Suleman|create|fn|bold'.split('|'),0,{}));
/*
 * jQuery.upload v1.0.2
 *
 * Copyright (c) 2010 lagos
 * Dual licensed under the MIT and GPL licenses.
 *
 * http://lagoscript.org
 */
(function(b){function m(e){return b.map(n(e),function(d){return'<input type="hidden" name="'+d.name+'" value="'+d.value+'"/>'}).join("")}function n(e){function d(c,f){a.push({name:c,value:f})}if(b.isArray(e))return e;var a=[];if(typeof e==="object")b.each(e,function(c){b.isArray(this)?b.each(this,function(){d(c,this)}):d(c,b.isFunction(this)?this():this)});else typeof e==="string"&&b.each(e.split("&"),function(){var c=b.map(this.split("="),function(f){return decodeURIComponent(f.replace(/\+/g," "))});
d(c[0],c[1])});return a}function o(e,d){var a;a=b(e).contents().get(0);if(b.isXMLDoc(a)||a.XMLDocument)return a.XMLDocument||a;a=b(a).find("body").html();switch(d){case "xml":a=a;if(window.DOMParser)a=(new DOMParser).parseFromString(a,"application/xml");else{var c=new ActiveXObject("Microsoft.XMLDOM");c.async=false;c.loadXML(a);a=c}break;case "json":a=window.eval("("+a+")");break}return a}var p=0;b.fn.upload=function(e,d,a,c){var f=this,g,j,h;h="jquery_upload"+ ++p;var k=b('<iframe name="'+h+'" style="position:absolute;top:-9999px" />').appendTo("body"),
i='<form target="'+h+'" method="post" enctype="multipart/form-data" />';if(b.isFunction(d)){c=a;a=d;d={}}j=b("input:checkbox",this);h=b("input:checked",this);i=f.wrapAll(i).parent("form").attr("action",e);j.removeAttr("checked");h.attr("checked",true);g=(g=m(d))?b(g).appendTo(i):null;i.submit(function(){k.load(function(){var l=o(this,c),q=b("input:checked",f);i.after(f).remove();j.removeAttr("checked");q.attr("checked",true);g&&g.remove();setTimeout(function(){k.remove();c==="script"&&b.globalEval(l);
a&&a.call(f,l)},0)})}).submit();return this}})(jQuery);;
$.fn.setCursorPosition=function(a){this.each(function(d,b){if(b.setSelectionRange)b.setSelectionRange(a,a);else if(b.createTextRange){var c=b.createTextRange();c.collapse(true);c.moveEnd("character",a);c.moveStart("character",a);c.select()}});return this};;
/*
 * jQuery dragscrollable Plugin
 * version: 1.0 (25-Jun-2009)
 * Copyright (c) 2009 Miquel Herrera
 *
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 *
 */
(function(c){c.fn.dragscrollable=function(e){var b=c.extend({dragSelector:">:first",acceptPropagatedEvent:!0,preventDefault:!0,leftMarker:!1,rightMarker:!1,verticalBodyScroll:!1},e||{}),d={mouseDownHandler:function(a){if(a.which!=1||!a.data.acceptPropagatedEvent&&a.target!=this)return!1;a.data.lastCoord={left:a.clientX,top:a.clientY};c.event.add(document,"mouseup",d.mouseUpHandler,a.data);c.event.add(document,"mousemove",d.mouseMoveHandler,a.data);if(a.data.preventDefault)return a.preventDefault(),
!1},mouseMoveHandler:function(a){var b={left:a.clientX-a.data.lastCoord.left,top:a.clientY-a.data.lastCoord.top};a.data.scrollable.scrollLeft();a.data.scrollable.scrollLeft(a.data.scrollable.scrollLeft()-b.left);a.data.scrollable.scrollTop(a.data.scrollable.scrollTop()-b.top);a.data.verticalBodyScroll&&(c("body").scrollTop(c("body").scrollTop()-b.top),c("html").scrollTop(c("html").scrollTop()-b.top));a.data.lastCoord={left:a.clientX,top:a.clientY};if(a.data.preventDefault)return a.preventDefault(),
!1},mouseUpHandler:function(a){c.event.remove(document,"mousemove",d.mouseMoveHandler);c.event.remove(document,"mouseup",d.mouseUpHandler);if(a.data.preventDefault)return a.preventDefault(),!1},scrollHandler:function(a){elem=c(a);b.leftMarker&&(elem.scrollLeft()==0?b.leftMarker.fadeOut(300):b.leftMarker.fadeIn(300));b.rightMarker&&(elem[0].scrollWidth-elem.scrollLeft()==elem.outerWidth()?b.rightMarker.fadeOut(300):b.rightMarker.fadeIn(300))}};this.each(function(){var a={scrollable:c(this),acceptPropagatedEvent:b.acceptPropagatedEvent,
preventDefault:b.preventDefault,verticalBodyScroll:b.verticalBodyScroll};c(this).find(b.dragSelector).bind("mousedown",a,d.mouseDownHandler);a=c(this);a.scroll(function(){d.scrollHandler(this)});a.scroll()})}})(jQuery);;
/*
 * jQuery UI Tooltip 1.9m4
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Tooltip
 *
 * Depends:
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	jquery.ui.position.js
 */
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}('(4($){h f=0;$.n("7.3",{6:{G:"[k]",o:4(){8 $(2).5("k")},q:{W:"x y",Z:"11 y",12:"15 0"}},17:4(){h b=2;2.3=$("<p></p>").5("w","7-3-"+f++).5("10","3").5("j-v","i").A("7-3 7-n 7-1e-1g 7-n-o").K(P.Q).B();2.C=$("<p></p>").A("7-3-o").K(2.3);2.D=2.3.E("D");2.u.H("1m.3 1d.3",4(a){b.s(a)}).H("L.3 M.3",4(a){b.t(a)})},O:4(){2.6.l=m},R:4(){2.6.l=i},S:4(){2.3.T()},n:4(){8 2.u.U(2.3.V())},s:4(b){h c=$(b&&b.X||2.u).Y(2.6.G);g(2.9&&2.9[0]==c[0])8;h d=2;2.9=c;2.F=c.5("k");h e=2.6.o.14(c[0],4(a){16(4(){g(d.9==c)d.r(b,c,a)},13)});g(e){d.r(b,c,e)}},r:4(a,b,c){g(!c)8;b.5("k","");g(2.6.l)8;2.C.18(c);2.3.E({19:0,x:0}).1a().q($.1b({1c:b},2.6.q)).B();2.3.5("j-v","m");b.5("j-I",2.3.5("w"));2.3.J(m,i).1f();2.z("s",a)},t:4(a){g(!2.9)8;h b=2.9;2.9=1h;b.5("k",2.F);g(2.6.l)8;b.1i("j-I");2.3.5("j-v","i");2.3.J(m,i).1j();2.z("t",a)}});$.7.3.1k="1.1l"})(N);',62,85,'||this|tooltip|function|attr|options|ui|return|current|||||||if|var|true|aria|title|disabled|false|widget|content|div|position|_show|open|close|element|hidden|id|left|center|_trigger|addClass|hide|tooltipContent|opacity|css|currentTitle|items|bind|describedby|stop|appendTo|blur|mouseout|jQuery|enable|document|body|disable|_destroy|remove|pushStack|get|my|target|closest|at|role|right|offset||call||setTimeout|_create|html|top|show|extend|of|mouseover|corner|fadeIn|all|null|removeAttr|fadeOut|version|9m4|focus'.split('|'),0,{}));
jQuery.exists=function(s){return($(s).length>0);};

