var URL_BASE = 'http://www.thekidscoop.com/';
var TODAY_DATE = '2012-02-22';
var IN_TWO_WEEKS_DATE = '2012-03-07';
var IN_FOUR_WEEKS_DATE = '2012-03-21';
var LIMIT_TOTAL = '3';
var TOTAL_SPECIAL_EVENTS_TWO_WEEKS = '57';
var TOTAL_SPECIAL_EVENTS_FOUR_WEEKS = '113';
var TOTAL_SPECIAL_EVENTS_FOUR_WEEKS_AND_MORE = '171'; 
var PROVINCE_ID = 4;
(function(E,B){function ka(a,b,d){if(d===B&&a.nodeType===1){d=a.getAttribute("data-"+b);if(typeof d==="string"){try{d=d==="true"?true:d==="false"?false:d==="null"?null:!c.isNaN(d)?parseFloat(d):Ja.test(d)?c.parseJSON(d):d}catch(e){}c.data(a,b,d)}else d=B}return d}function U(){return false}function ca(){return true}function la(a,b,d){d[0].type=a;return c.event.handle.apply(b,d)}function Ka(a){var b,d,e,f,h,l,k,o,x,r,A,C=[];f=[];h=c.data(this,this.nodeType?"events":"__events__");if(typeof h==="function")h=
h.events;if(!(a.liveFired===this||!h||!h.live||a.button&&a.type==="click")){if(a.namespace)A=RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)");a.liveFired=this;var J=h.live.slice(0);for(k=0;k<J.length;k++){h=J[k];h.origType.replace(X,"")===a.type?f.push(h.selector):J.splice(k--,1)}f=c(a.target).closest(f,a.currentTarget);o=0;for(x=f.length;o<x;o++){r=f[o];for(k=0;k<J.length;k++){h=J[k];if(r.selector===h.selector&&(!A||A.test(h.namespace))){l=r.elem;e=null;if(h.preType==="mouseenter"||
h.preType==="mouseleave"){a.type=h.preType;e=c(a.relatedTarget).closest(h.selector)[0]}if(!e||e!==l)C.push({elem:l,handleObj:h,level:r.level})}}}o=0;for(x=C.length;o<x;o++){f=C[o];if(d&&f.level>d)break;a.currentTarget=f.elem;a.data=f.handleObj.data;a.handleObj=f.handleObj;A=f.handleObj.origHandler.apply(f.elem,arguments);if(A===false||a.isPropagationStopped()){d=f.level;if(A===false)b=false;if(a.isImmediatePropagationStopped())break}}return b}}function Y(a,b){return(a&&a!=="*"?a+".":"")+b.replace(La,
"`").replace(Ma,"&")}function ma(a,b,d){if(c.isFunction(b))return c.grep(a,function(f,h){return!!b.call(f,h,f)===d});else if(b.nodeType)return c.grep(a,function(f){return f===b===d});else if(typeof b==="string"){var e=c.grep(a,function(f){return f.nodeType===1});if(Na.test(b))return c.filter(b,e,!d);else b=c.filter(b,e)}return c.grep(a,function(f){return c.inArray(f,b)>=0===d})}function na(a,b){var d=0;b.each(function(){if(this.nodeName===(a[d]&&a[d].nodeName)){var e=c.data(a[d++]),f=c.data(this,
e);if(e=e&&e.events){delete f.handle;f.events={};for(var h in e)for(var l in e[h])c.event.add(this,h,e[h][l],e[h][l].data)}}})}function Oa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function oa(a,b,d){var e=b==="width"?a.offsetWidth:a.offsetHeight;if(d==="border")return e;c.each(b==="width"?Pa:Qa,function(){d||(e-=parseFloat(c.css(a,"padding"+this))||0);if(d==="margin")e+=parseFloat(c.css(a,
"margin"+this))||0;else e-=parseFloat(c.css(a,"border"+this+"Width"))||0});return e}function da(a,b,d,e){if(c.isArray(b)&&b.length)c.each(b,function(f,h){d||Ra.test(a)?e(a,h):da(a+"["+(typeof h==="object"||c.isArray(h)?f:"")+"]",h,d,e)});else if(!d&&b!=null&&typeof b==="object")c.isEmptyObject(b)?e(a,""):c.each(b,function(f,h){da(a+"["+f+"]",h,d,e)});else e(a,b)}function S(a,b){var d={};c.each(pa.concat.apply([],pa.slice(0,b)),function(){d[this]=a});return d}function qa(a){if(!ea[a]){var b=c("<"+
a+">").appendTo("body"),d=b.css("display");b.remove();if(d==="none"||d==="")d="block";ea[a]=d}return ea[a]}function fa(a){return c.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var t=E.document,c=function(){function a(){if(!b.isReady){try{t.documentElement.doScroll("left")}catch(j){setTimeout(a,1);return}b.ready()}}var b=function(j,s){return new b.fn.init(j,s)},d=E.jQuery,e=E.$,f,h=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,l=/\S/,k=/^\s+/,o=/\s+$/,x=/\W/,r=/\d/,A=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,
C=/^[\],:{}\s]*$/,J=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,w=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,I=/(?:^|:|,)(?:\s*\[)+/g,L=/(webkit)[ \/]([\w.]+)/,g=/(opera)(?:.*version)?[ \/]([\w.]+)/,i=/(msie) ([\w.]+)/,n=/(mozilla)(?:.*? rv:([\w.]+))?/,m=navigator.userAgent,p=false,q=[],u,y=Object.prototype.toString,F=Object.prototype.hasOwnProperty,M=Array.prototype.push,N=Array.prototype.slice,O=String.prototype.trim,D=Array.prototype.indexOf,R={};b.fn=b.prototype={init:function(j,
s){var v,z,H;if(!j)return this;if(j.nodeType){this.context=this[0]=j;this.length=1;return this}if(j==="body"&&!s&&t.body){this.context=t;this[0]=t.body;this.selector="body";this.length=1;return this}if(typeof j==="string")if((v=h.exec(j))&&(v[1]||!s))if(v[1]){H=s?s.ownerDocument||s:t;if(z=A.exec(j))if(b.isPlainObject(s)){j=[t.createElement(z[1])];b.fn.attr.call(j,s,true)}else j=[H.createElement(z[1])];else{z=b.buildFragment([v[1]],[H]);j=(z.cacheable?z.fragment.cloneNode(true):z.fragment).childNodes}return b.merge(this,
j)}else{if((z=t.getElementById(v[2]))&&z.parentNode){if(z.id!==v[2])return f.find(j);this.length=1;this[0]=z}this.context=t;this.selector=j;return this}else if(!s&&!x.test(j)){this.selector=j;this.context=t;j=t.getElementsByTagName(j);return b.merge(this,j)}else return!s||s.jquery?(s||f).find(j):b(s).find(j);else if(b.isFunction(j))return f.ready(j);if(j.selector!==B){this.selector=j.selector;this.context=j.context}return b.makeArray(j,this)},selector:"",jquery:"1.4.4",length:0,size:function(){return this.length},
toArray:function(){return N.call(this,0)},get:function(j){return j==null?this.toArray():j<0?this.slice(j)[0]:this[j]},pushStack:function(j,s,v){var z=b();b.isArray(j)?M.apply(z,j):b.merge(z,j);z.prevObject=this;z.context=this.context;if(s==="find")z.selector=this.selector+(this.selector?" ":"")+v;else if(s)z.selector=this.selector+"."+s+"("+v+")";return z},each:function(j,s){return b.each(this,j,s)},ready:function(j){b.bindReady();if(b.isReady)j.call(t,b);else q&&q.push(j);return this},eq:function(j){return j===
-1?this.slice(j):this.slice(j,+j+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(N.apply(this,arguments),"slice",N.call(arguments).join(","))},map:function(j){return this.pushStack(b.map(this,function(s,v){return j.call(s,v,s)}))},end:function(){return this.prevObject||b(null)},push:M,sort:[].sort,splice:[].splice};b.fn.init.prototype=b.fn;b.extend=b.fn.extend=function(){var j,s,v,z,H,G=arguments[0]||{},K=1,Q=arguments.length,ga=false;
if(typeof G==="boolean"){ga=G;G=arguments[1]||{};K=2}if(typeof G!=="object"&&!b.isFunction(G))G={};if(Q===K){G=this;--K}for(;K<Q;K++)if((j=arguments[K])!=null)for(s in j){v=G[s];z=j[s];if(G!==z)if(ga&&z&&(b.isPlainObject(z)||(H=b.isArray(z)))){if(H){H=false;v=v&&b.isArray(v)?v:[]}else v=v&&b.isPlainObject(v)?v:{};G[s]=b.extend(ga,v,z)}else if(z!==B)G[s]=z}return G};b.extend({noConflict:function(j){E.$=e;if(j)E.jQuery=d;return b},isReady:false,readyWait:1,ready:function(j){j===true&&b.readyWait--;
if(!b.readyWait||j!==true&&!b.isReady){if(!t.body)return setTimeout(b.ready,1);b.isReady=true;if(!(j!==true&&--b.readyWait>0))if(q){var s=0,v=q;for(q=null;j=v[s++];)j.call(t,b);b.fn.trigger&&b(t).trigger("ready").unbind("ready")}}},bindReady:function(){if(!p){p=true;if(t.readyState==="complete")return setTimeout(b.ready,1);if(t.addEventListener){t.addEventListener("DOMContentLoaded",u,false);E.addEventListener("load",b.ready,false)}else if(t.attachEvent){t.attachEvent("onreadystatechange",u);E.attachEvent("onload",
b.ready);var j=false;try{j=E.frameElement==null}catch(s){}t.documentElement.doScroll&&j&&a()}}},isFunction:function(j){return b.type(j)==="function"},isArray:Array.isArray||function(j){return b.type(j)==="array"},isWindow:function(j){return j&&typeof j==="object"&&"setInterval"in j},isNaN:function(j){return j==null||!r.test(j)||isNaN(j)},type:function(j){return j==null?String(j):R[y.call(j)]||"object"},isPlainObject:function(j){if(!j||b.type(j)!=="object"||j.nodeType||b.isWindow(j))return false;if(j.constructor&&
!F.call(j,"constructor")&&!F.call(j.constructor.prototype,"isPrototypeOf"))return false;for(var s in j);return s===B||F.call(j,s)},isEmptyObject:function(j){for(var s in j)return false;return true},error:function(j){throw j;},parseJSON:function(j){if(typeof j!=="string"||!j)return null;j=b.trim(j);if(C.test(j.replace(J,"@").replace(w,"]").replace(I,"")))return E.JSON&&E.JSON.parse?E.JSON.parse(j):(new Function("return "+j))();else b.error("Invalid JSON: "+j)},noop:function(){},globalEval:function(j){if(j&&
l.test(j)){var s=t.getElementsByTagName("head")[0]||t.documentElement,v=t.createElement("script");v.type="text/javascript";if(b.support.scriptEval)v.appendChild(t.createTextNode(j));else v.text=j;s.insertBefore(v,s.firstChild);s.removeChild(v)}},nodeName:function(j,s){return j.nodeName&&j.nodeName.toUpperCase()===s.toUpperCase()},each:function(j,s,v){var z,H=0,G=j.length,K=G===B||b.isFunction(j);if(v)if(K)for(z in j){if(s.apply(j[z],v)===false)break}else for(;H<G;){if(s.apply(j[H++],v)===false)break}else if(K)for(z in j){if(s.call(j[z],
z,j[z])===false)break}else for(v=j[0];H<G&&s.call(v,H,v)!==false;v=j[++H]);return j},trim:O?function(j){return j==null?"":O.call(j)}:function(j){return j==null?"":j.toString().replace(k,"").replace(o,"")},makeArray:function(j,s){var v=s||[];if(j!=null){var z=b.type(j);j.length==null||z==="string"||z==="function"||z==="regexp"||b.isWindow(j)?M.call(v,j):b.merge(v,j)}return v},inArray:function(j,s){if(s.indexOf)return s.indexOf(j);for(var v=0,z=s.length;v<z;v++)if(s[v]===j)return v;return-1},merge:function(j,
s){var v=j.length,z=0;if(typeof s.length==="number")for(var H=s.length;z<H;z++)j[v++]=s[z];else for(;s[z]!==B;)j[v++]=s[z++];j.length=v;return j},grep:function(j,s,v){var z=[],H;v=!!v;for(var G=0,K=j.length;G<K;G++){H=!!s(j[G],G);v!==H&&z.push(j[G])}return z},map:function(j,s,v){for(var z=[],H,G=0,K=j.length;G<K;G++){H=s(j[G],G,v);if(H!=null)z[z.length]=H}return z.concat.apply([],z)},guid:1,proxy:function(j,s,v){if(arguments.length===2)if(typeof s==="string"){v=j;j=v[s];s=B}else if(s&&!b.isFunction(s)){v=
s;s=B}if(!s&&j)s=function(){return j.apply(v||this,arguments)};if(j)s.guid=j.guid=j.guid||s.guid||b.guid++;return s},access:function(j,s,v,z,H,G){var K=j.length;if(typeof s==="object"){for(var Q in s)b.access(j,Q,s[Q],z,H,v);return j}if(v!==B){z=!G&&z&&b.isFunction(v);for(Q=0;Q<K;Q++)H(j[Q],s,z?v.call(j[Q],Q,H(j[Q],s)):v,G);return j}return K?H(j[0],s):B},now:function(){return(new Date).getTime()},uaMatch:function(j){j=j.toLowerCase();j=L.exec(j)||g.exec(j)||i.exec(j)||j.indexOf("compatible")<0&&n.exec(j)||
[];return{browser:j[1]||"",version:j[2]||"0"}},browser:{}});b.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(j,s){R["[object "+s+"]"]=s.toLowerCase()});m=b.uaMatch(m);if(m.browser){b.browser[m.browser]=true;b.browser.version=m.version}if(b.browser.webkit)b.browser.safari=true;if(D)b.inArray=function(j,s){return D.call(s,j)};if(!/\s/.test("\u00a0")){k=/^[\s\xA0]+/;o=/[\s\xA0]+$/}f=b(t);if(t.addEventListener)u=function(){t.removeEventListener("DOMContentLoaded",u,
false);b.ready()};else if(t.attachEvent)u=function(){if(t.readyState==="complete"){t.detachEvent("onreadystatechange",u);b.ready()}};return E.jQuery=E.$=b}();(function(){c.support={};var a=t.documentElement,b=t.createElement("script"),d=t.createElement("div"),e="script"+c.now();d.style.display="none";d.innerHTML="   <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";var f=d.getElementsByTagName("*"),h=d.getElementsByTagName("a")[0],l=t.createElement("select"),
k=l.appendChild(t.createElement("option"));if(!(!f||!f.length||!h)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(h.getAttribute("style")),hrefNormalized:h.getAttribute("href")==="/a",opacity:/^0.55$/.test(h.style.opacity),cssFloat:!!h.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:k.selected,deleteExpando:true,optDisabled:false,checkClone:false,
scriptEval:false,noCloneEvent:true,boxModel:null,inlineBlockNeedsLayout:false,shrinkWrapBlocks:false,reliableHiddenOffsets:true};l.disabled=true;c.support.optDisabled=!k.disabled;b.type="text/javascript";try{b.appendChild(t.createTextNode("window."+e+"=1;"))}catch(o){}a.insertBefore(b,a.firstChild);if(E[e]){c.support.scriptEval=true;delete E[e]}try{delete b.test}catch(x){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function r(){c.support.noCloneEvent=
false;d.detachEvent("onclick",r)});d.cloneNode(true).fireEvent("onclick")}d=t.createElement("div");d.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";a=t.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var r=t.createElement("div");r.style.width=r.style.paddingLeft="1px";t.body.appendChild(r);c.boxModel=c.support.boxModel=r.offsetWidth===2;if("zoom"in r.style){r.style.display="inline";r.style.zoom=
1;c.support.inlineBlockNeedsLayout=r.offsetWidth===2;r.style.display="";r.innerHTML="<div style='width:4px;'></div>";c.support.shrinkWrapBlocks=r.offsetWidth!==2}r.innerHTML="<table><tr><td style='padding:0;display:none'></td><td>t</td></tr></table>";var A=r.getElementsByTagName("td");c.support.reliableHiddenOffsets=A[0].offsetHeight===0;A[0].style.display="";A[1].style.display="none";c.support.reliableHiddenOffsets=c.support.reliableHiddenOffsets&&A[0].offsetHeight===0;r.innerHTML="";t.body.removeChild(r).style.display=
"none"});a=function(r){var A=t.createElement("div");r="on"+r;var C=r in A;if(!C){A.setAttribute(r,"return;");C=typeof A[r]==="function"}return C};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=f=h=null}})();var ra={},Ja=/^(?:\{.*\}|\[.*\])$/;c.extend({cache:{},uuid:0,expando:"jQuery"+c.now(),noData:{embed:true,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:true},data:function(a,b,d){if(c.acceptData(a)){a=a==E?ra:a;var e=a.nodeType,f=e?a[c.expando]:null,h=
c.cache;if(!(e&&!f&&typeof b==="string"&&d===B)){if(e)f||(a[c.expando]=f=++c.uuid);else h=a;if(typeof b==="object")if(e)h[f]=c.extend(h[f],b);else c.extend(h,b);else if(e&&!h[f])h[f]={};a=e?h[f]:h;if(d!==B)a[b]=d;return typeof b==="string"?a[b]:a}}},removeData:function(a,b){if(c.acceptData(a)){a=a==E?ra:a;var d=a.nodeType,e=d?a[c.expando]:a,f=c.cache,h=d?f[e]:e;if(b){if(h){delete h[b];d&&c.isEmptyObject(h)&&c.removeData(a)}}else if(d&&c.support.deleteExpando)delete a[c.expando];else if(a.removeAttribute)a.removeAttribute(c.expando);
else if(d)delete f[e];else for(var l in a)delete a[l]}},acceptData:function(a){if(a.nodeName){var b=c.noData[a.nodeName.toLowerCase()];if(b)return!(b===true||a.getAttribute("classid")!==b)}return true}});c.fn.extend({data:function(a,b){var d=null;if(typeof a==="undefined"){if(this.length){var e=this[0].attributes,f;d=c.data(this[0]);for(var h=0,l=e.length;h<l;h++){f=e[h].name;if(f.indexOf("data-")===0){f=f.substr(5);ka(this[0],f,d[f])}}}return d}else if(typeof a==="object")return this.each(function(){c.data(this,
a)});var k=a.split(".");k[1]=k[1]?"."+k[1]:"";if(b===B){d=this.triggerHandler("getData"+k[1]+"!",[k[0]]);if(d===B&&this.length){d=c.data(this[0],a);d=ka(this[0],a,d)}return d===B&&k[1]?this.data(k[0]):d}else return this.each(function(){var o=c(this),x=[k[0],b];o.triggerHandler("setData"+k[1]+"!",x);c.data(this,a,b);o.triggerHandler("changeData"+k[1]+"!",x)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var e=
c.data(a,b);if(!d)return e||[];if(!e||c.isArray(d))e=c.data(a,b,c.makeArray(d));else e.push(d);return e}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),e=d.shift();if(e==="inprogress")e=d.shift();if(e){b==="fx"&&d.unshift("inprogress");e.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b===B)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this,
a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var sa=/[\n\t]/g,ha=/\s+/,Sa=/\r/g,Ta=/^(?:href|src|style)$/,Ua=/^(?:button|input)$/i,Va=/^(?:button|input|object|select|textarea)$/i,Wa=/^a(?:rea)?$/i,ta=/^(?:radio|checkbox)$/i;c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",
colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};c.fn.extend({attr:function(a,b){return c.access(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(x){var r=c(this);r.addClass(a.call(this,x,r.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ha),d=0,e=this.length;d<e;d++){var f=this[d];if(f.nodeType===
1)if(f.className){for(var h=" "+f.className+" ",l=f.className,k=0,o=b.length;k<o;k++)if(h.indexOf(" "+b[k]+" ")<0)l+=" "+b[k];f.className=c.trim(l)}else f.className=a}return this},removeClass:function(a){if(c.isFunction(a))return this.each(function(o){var x=c(this);x.removeClass(a.call(this,o,x.attr("class")))});if(a&&typeof a==="string"||a===B)for(var b=(a||"").split(ha),d=0,e=this.length;d<e;d++){var f=this[d];if(f.nodeType===1&&f.className)if(a){for(var h=(" "+f.className+" ").replace(sa," "),
l=0,k=b.length;l<k;l++)h=h.replace(" "+b[l]+" "," ");f.className=c.trim(h)}else f.className=""}return this},toggleClass:function(a,b){var d=typeof a,e=typeof b==="boolean";if(c.isFunction(a))return this.each(function(f){var h=c(this);h.toggleClass(a.call(this,f,h.attr("class"),b),b)});return this.each(function(){if(d==="string")for(var f,h=0,l=c(this),k=b,o=a.split(ha);f=o[h++];){k=e?k:!l.hasClass(f);l[k?"addClass":"removeClass"](f)}else if(d==="undefined"||d==="boolean"){this.className&&c.data(this,
"__className__",this.className);this.className=this.className||a===false?"":c.data(this,"__className__")||""}})},hasClass:function(a){a=" "+a+" ";for(var b=0,d=this.length;b<d;b++)if((" "+this[b].className+" ").replace(sa," ").indexOf(a)>-1)return true;return false},val:function(a){if(!arguments.length){var b=this[0];if(b){if(c.nodeName(b,"option")){var d=b.attributes.value;return!d||d.specified?b.value:b.text}if(c.nodeName(b,"select")){var e=b.selectedIndex;d=[];var f=b.options;b=b.type==="select-one";
if(e<0)return null;var h=b?e:0;for(e=b?e+1:f.length;h<e;h++){var l=f[h];if(l.selected&&(c.support.optDisabled?!l.disabled:l.getAttribute("disabled")===null)&&(!l.parentNode.disabled||!c.nodeName(l.parentNode,"optgroup"))){a=c(l).val();if(b)return a;d.push(a)}}return d}if(ta.test(b.type)&&!c.support.checkOn)return b.getAttribute("value")===null?"on":b.value;return(b.value||"").replace(Sa,"")}return B}var k=c.isFunction(a);return this.each(function(o){var x=c(this),r=a;if(this.nodeType===1){if(k)r=
a.call(this,o,x.val());if(r==null)r="";else if(typeof r==="number")r+="";else if(c.isArray(r))r=c.map(r,function(C){return C==null?"":C+""});if(c.isArray(r)&&ta.test(this.type))this.checked=c.inArray(x.val(),r)>=0;else if(c.nodeName(this,"select")){var A=c.makeArray(r);c("option",this).each(function(){this.selected=c.inArray(c(this).val(),A)>=0});if(!A.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},
attr:function(a,b,d,e){if(!a||a.nodeType===3||a.nodeType===8)return B;if(e&&b in c.attrFn)return c(a)[b](d);e=a.nodeType!==1||!c.isXMLDoc(a);var f=d!==B;b=e&&c.props[b]||b;var h=Ta.test(b);if((b in a||a[b]!==B)&&e&&!h){if(f){b==="type"&&Ua.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed");if(d===null)a.nodeType===1&&a.removeAttribute(b);else a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&
b.specified?b.value:Va.test(a.nodeName)||Wa.test(a.nodeName)&&a.href?0:B;return a[b]}if(!c.support.style&&e&&b==="style"){if(f)a.style.cssText=""+d;return a.style.cssText}f&&a.setAttribute(b,""+d);if(!a.attributes[b]&&a.hasAttribute&&!a.hasAttribute(b))return B;a=!c.support.hrefNormalized&&e&&h?a.getAttribute(b,2):a.getAttribute(b);return a===null?B:a}});var X=/\.(.*)$/,ia=/^(?:textarea|input|select)$/i,La=/\./g,Ma=/ /g,Xa=/[^\w\s.|`]/g,Ya=function(a){return a.replace(Xa,"\\$&")},ua={focusin:0,focusout:0};
c.event={add:function(a,b,d,e){if(!(a.nodeType===3||a.nodeType===8)){if(c.isWindow(a)&&a!==E&&!a.frameElement)a=E;if(d===false)d=U;else if(!d)return;var f,h;if(d.handler){f=d;d=f.handler}if(!d.guid)d.guid=c.guid++;if(h=c.data(a)){var l=a.nodeType?"events":"__events__",k=h[l],o=h.handle;if(typeof k==="function"){o=k.handle;k=k.events}else if(!k){a.nodeType||(h[l]=h=function(){});h.events=k={}}if(!o)h.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem,
arguments):B};o.elem=a;b=b.split(" ");for(var x=0,r;l=b[x++];){h=f?c.extend({},f):{handler:d,data:e};if(l.indexOf(".")>-1){r=l.split(".");l=r.shift();h.namespace=r.slice(0).sort().join(".")}else{r=[];h.namespace=""}h.type=l;if(!h.guid)h.guid=d.guid;var A=k[l],C=c.event.special[l]||{};if(!A){A=k[l]=[];if(!C.setup||C.setup.call(a,e,r,o)===false)if(a.addEventListener)a.addEventListener(l,o,false);else a.attachEvent&&a.attachEvent("on"+l,o)}if(C.add){C.add.call(a,h);if(!h.handler.guid)h.handler.guid=
d.guid}A.push(h);c.event.global[l]=true}a=null}}},global:{},remove:function(a,b,d,e){if(!(a.nodeType===3||a.nodeType===8)){if(d===false)d=U;var f,h,l=0,k,o,x,r,A,C,J=a.nodeType?"events":"__events__",w=c.data(a),I=w&&w[J];if(w&&I){if(typeof I==="function"){w=I;I=I.events}if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(f in I)c.event.remove(a,f+b)}else{for(b=b.split(" ");f=b[l++];){r=f;k=f.indexOf(".")<0;o=[];if(!k){o=f.split(".");f=o.shift();x=RegExp("(^|\\.)"+
c.map(o.slice(0).sort(),Ya).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(A=I[f])if(d){r=c.event.special[f]||{};for(h=e||0;h<A.length;h++){C=A[h];if(d.guid===C.guid){if(k||x.test(C.namespace)){e==null&&A.splice(h--,1);r.remove&&r.remove.call(a,C)}if(e!=null)break}}if(A.length===0||e!=null&&A.length===1){if(!r.teardown||r.teardown.call(a,o)===false)c.removeEvent(a,f,w.handle);delete I[f]}}else for(h=0;h<A.length;h++){C=A[h];if(k||x.test(C.namespace)){c.event.remove(a,r,C.handler,h);A.splice(h--,1)}}}if(c.isEmptyObject(I)){if(b=
w.handle)b.elem=null;delete w.events;delete w.handle;if(typeof w==="function")c.removeData(a,J);else c.isEmptyObject(w)&&c.removeData(a)}}}}},trigger:function(a,b,d,e){var f=a.type||a;if(!e){a=typeof a==="object"?a[c.expando]?a:c.extend(c.Event(f),a):c.Event(f);if(f.indexOf("!")>=0){a.type=f=f.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[f]&&c.each(c.cache,function(){this.events&&this.events[f]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===
8)return B;a.result=B;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(e=d.nodeType?c.data(d,"handle"):(c.data(d,"__events__")||{}).handle)&&e.apply(d,b);e=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+f]&&d["on"+f].apply(d,b)===false){a.result=false;a.preventDefault()}}catch(h){}if(!a.isPropagationStopped()&&e)c.event.trigger(a,b,e,true);else if(!a.isDefaultPrevented()){var l;e=a.target;var k=f.replace(X,""),o=c.nodeName(e,"a")&&k===
"click",x=c.event.special[k]||{};if((!x._default||x._default.call(d,a)===false)&&!o&&!(e&&e.nodeName&&c.noData[e.nodeName.toLowerCase()])){try{if(e[k]){if(l=e["on"+k])e["on"+k]=null;c.event.triggered=true;e[k]()}}catch(r){}if(l)e["on"+k]=l;c.event.triggered=false}}},handle:function(a){var b,d,e,f;d=[];var h=c.makeArray(arguments);a=h[0]=c.event.fix(a||E.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive;if(!b){e=a.type.split(".");a.type=e.shift();d=e.slice(0).sort();e=RegExp("(^|\\.)"+
d.join("\\.(?:.*\\.)?")+"(\\.|$)")}a.namespace=a.namespace||d.join(".");f=c.data(this,this.nodeType?"events":"__events__");if(typeof f==="function")f=f.events;d=(f||{})[a.type];if(f&&d){d=d.slice(0);f=0;for(var l=d.length;f<l;f++){var k=d[f];if(b||e.test(k.namespace)){a.handler=k.handler;a.data=k.data;a.handleObj=k;k=k.handler.apply(this,h);if(k!==B){a.result=k;if(k===false){a.preventDefault();a.stopPropagation()}}if(a.isImmediatePropagationStopped())break}}}return a.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
fix:function(a){if(a[c.expando])return a;var b=a;a=c.Event(b);for(var d=this.props.length,e;d;){e=this.props[--d];a[e]=b[e]}if(!a.target)a.target=a.srcElement||t;if(a.target.nodeType===3)a.target=a.target.parentNode;if(!a.relatedTarget&&a.fromElement)a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement;if(a.pageX==null&&a.clientX!=null){b=t.documentElement;d=t.body;a.pageX=a.clientX+(b&&b.scrollLeft||d&&d.scrollLeft||0)-(b&&b.clientLeft||d&&d.clientLeft||0);a.pageY=a.clientY+(b&&b.scrollTop||
d&&d.scrollTop||0)-(b&&b.clientTop||d&&d.clientTop||0)}if(a.which==null&&(a.charCode!=null||a.keyCode!=null))a.which=a.charCode!=null?a.charCode:a.keyCode;if(!a.metaKey&&a.ctrlKey)a.metaKey=a.ctrlKey;if(!a.which&&a.button!==B)a.which=a.button&1?1:a.button&2?3:a.button&4?2:0;return a},guid:1E8,proxy:c.proxy,special:{ready:{setup:c.bindReady,teardown:c.noop},live:{add:function(a){c.event.add(this,Y(a.origType,a.selector),c.extend({},a,{handler:Ka,guid:a.handler.guid}))},remove:function(a){c.event.remove(this,
Y(a.origType,a.selector),a)}},beforeunload:{setup:function(a,b,d){if(c.isWindow(this))this.onbeforeunload=d},teardown:function(a,b){if(this.onbeforeunload===b)this.onbeforeunload=null}}}};c.removeEvent=t.removeEventListener?function(a,b,d){a.removeEventListener&&a.removeEventListener(b,d,false)}:function(a,b,d){a.detachEvent&&a.detachEvent("on"+b,d)};c.Event=function(a){if(!this.preventDefault)return new c.Event(a);if(a&&a.type){this.originalEvent=a;this.type=a.type}else this.type=a;this.timeStamp=
c.now();this[c.expando]=true};c.Event.prototype={preventDefault:function(){this.isDefaultPrevented=ca;var a=this.originalEvent;if(a)if(a.preventDefault)a.preventDefault();else a.returnValue=false},stopPropagation:function(){this.isPropagationStopped=ca;var a=this.originalEvent;if(a){a.stopPropagation&&a.stopPropagation();a.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=ca;this.stopPropagation()},isDefaultPrevented:U,isPropagationStopped:U,isImmediatePropagationStopped:U};
var va=function(a){var b=a.relatedTarget;try{for(;b&&b!==this;)b=b.parentNode;if(b!==this){a.type=a.data;c.event.handle.apply(this,arguments)}}catch(d){}},wa=function(a){a.type=a.data;c.event.handle.apply(this,arguments)};c.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){c.event.special[a]={setup:function(d){c.event.add(this,b,d&&d.selector?wa:va,a)},teardown:function(d){c.event.remove(this,b,d&&d.selector?wa:va)}}});if(!c.support.submitBubbles)c.event.special.submit={setup:function(){if(this.nodeName.toLowerCase()!==
"form"){c.event.add(this,"click.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="submit"||d==="image")&&c(b).closest("form").length){a.liveFired=B;return la("submit",this,arguments)}});c.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="text"||d==="password")&&c(b).closest("form").length&&a.keyCode===13){a.liveFired=B;return la("submit",this,arguments)}})}else return false},teardown:function(){c.event.remove(this,".specialSubmit")}};if(!c.support.changeBubbles){var V,
xa=function(a){var b=a.type,d=a.value;if(b==="radio"||b==="checkbox")d=a.checked;else if(b==="select-multiple")d=a.selectedIndex>-1?c.map(a.options,function(e){return e.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},Z=function(a,b){var d=a.target,e,f;if(!(!ia.test(d.nodeName)||d.readOnly)){e=c.data(d,"_change_data");f=xa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data",f);if(!(e===B||f===e))if(e!=null||f){a.type="change";a.liveFired=
B;return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:Z,beforedeactivate:Z,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return Z.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return Z.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a,"_change_data",xa(a))}},setup:function(){if(this.type===
"file")return false;for(var a in V)c.event.add(this,a+".specialChange",V[a]);return ia.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return ia.test(this.nodeName)}};V=c.event.special.change.filters;V.focus=V.beforeactivate}t.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(e){e=c.event.fix(e);e.type=b;return c.event.trigger(e,null,e.target)}c.event.special[b]={setup:function(){ua[b]++===0&&t.addEventListener(a,d,true)},teardown:function(){--ua[b]===
0&&t.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,e,f){if(typeof d==="object"){for(var h in d)this[b](h,e,d[h],f);return this}if(c.isFunction(e)||e===false){f=e;e=B}var l=b==="one"?c.proxy(f,function(o){c(this).unbind(o,l);return f.apply(this,arguments)}):f;if(d==="unload"&&b!=="one")this.one(d,e,f);else{h=0;for(var k=this.length;h<k;h++)c.event.add(this[h],d,l,e)}return this}});c.fn.extend({unbind:function(a,b){if(typeof a==="object"&&!a.preventDefault)for(var d in a)this.unbind(d,
a[d]);else{d=0;for(var e=this.length;d<e;d++)c.event.remove(this[d],a,b)}return this},delegate:function(a,b,d,e){return this.live(b,d,e,a)},undelegate:function(a,b,d){return arguments.length===0?this.unbind("live"):this.die(b,null,d,a)},trigger:function(a,b){return this.each(function(){c.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){var d=c.Event(a);d.preventDefault();d.stopPropagation();c.event.trigger(d,b,this[0]);return d.result}},toggle:function(a){for(var b=arguments,d=
1;d<b.length;)c.proxy(a,b[d++]);return this.click(c.proxy(a,function(e){var f=(c.data(this,"lastToggle"+a.guid)||0)%d;c.data(this,"lastToggle"+a.guid,f+1);e.preventDefault();return b[f].apply(this,arguments)||false}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var ya={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};c.each(["live","die"],function(a,b){c.fn[b]=function(d,e,f,h){var l,k=0,o,x,r=h||this.selector;h=h?this:c(this.context);if(typeof d===
"object"&&!d.preventDefault){for(l in d)h[b](l,e,d[l],r);return this}if(c.isFunction(e)){f=e;e=B}for(d=(d||"").split(" ");(l=d[k++])!=null;){o=X.exec(l);x="";if(o){x=o[0];l=l.replace(X,"")}if(l==="hover")d.push("mouseenter"+x,"mouseleave"+x);else{o=l;if(l==="focus"||l==="blur"){d.push(ya[l]+x);l+=x}else l=(ya[l]||l)+x;if(b==="live"){x=0;for(var A=h.length;x<A;x++)c.event.add(h[x],"live."+Y(l,r),{data:e,selector:r,handler:f,origType:l,origHandler:f,preType:o})}else h.unbind("live."+Y(l,r),f)}}return this}});
c.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),function(a,b){c.fn[b]=function(d,e){if(e==null){e=d;d=null}return arguments.length>0?this.bind(b,d,e):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});E.attachEvent&&!E.addEventListener&&c(E).bind("unload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}});
(function(){function a(g,i,n,m,p,q){p=0;for(var u=m.length;p<u;p++){var y=m[p];if(y){var F=false;for(y=y[g];y;){if(y.sizcache===n){F=m[y.sizset];break}if(y.nodeType===1&&!q){y.sizcache=n;y.sizset=p}if(y.nodeName.toLowerCase()===i){F=y;break}y=y[g]}m[p]=F}}}function b(g,i,n,m,p,q){p=0;for(var u=m.length;p<u;p++){var y=m[p];if(y){var F=false;for(y=y[g];y;){if(y.sizcache===n){F=m[y.sizset];break}if(y.nodeType===1){if(!q){y.sizcache=n;y.sizset=p}if(typeof i!=="string"){if(y===i){F=true;break}}else if(k.filter(i,
[y]).length>0){F=y;break}}y=y[g]}m[p]=F}}}var d=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e=0,f=Object.prototype.toString,h=false,l=true;[0,0].sort(function(){l=false;return 0});var k=function(g,i,n,m){n=n||[];var p=i=i||t;if(i.nodeType!==1&&i.nodeType!==9)return[];if(!g||typeof g!=="string")return n;var q,u,y,F,M,N=true,O=k.isXML(i),D=[],R=g;do{d.exec("");if(q=d.exec(R)){R=q[3];D.push(q[1]);if(q[2]){F=q[3];
break}}}while(q);if(D.length>1&&x.exec(g))if(D.length===2&&o.relative[D[0]])u=L(D[0]+D[1],i);else for(u=o.relative[D[0]]?[i]:k(D.shift(),i);D.length;){g=D.shift();if(o.relative[g])g+=D.shift();u=L(g,u)}else{if(!m&&D.length>1&&i.nodeType===9&&!O&&o.match.ID.test(D[0])&&!o.match.ID.test(D[D.length-1])){q=k.find(D.shift(),i,O);i=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]}if(i){q=m?{expr:D.pop(),set:C(m)}:k.find(D.pop(),D.length===1&&(D[0]==="~"||D[0]==="+")&&i.parentNode?i.parentNode:i,O);u=q.expr?k.filter(q.expr,
q.set):q.set;if(D.length>0)y=C(u);else N=false;for(;D.length;){q=M=D.pop();if(o.relative[M])q=D.pop();else M="";if(q==null)q=i;o.relative[M](y,q,O)}}else y=[]}y||(y=u);y||k.error(M||g);if(f.call(y)==="[object Array]")if(N)if(i&&i.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&k.contains(i,y[g])))n.push(u[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&n.push(u[g]);else n.push.apply(n,y);else C(y,n);if(F){k(F,p,n,m);k.uniqueSort(n)}return n};k.uniqueSort=function(g){if(w){h=
l;g.sort(w);if(h)for(var i=1;i<g.length;i++)g[i]===g[i-1]&&g.splice(i--,1)}return g};k.matches=function(g,i){return k(g,null,null,i)};k.matchesSelector=function(g,i){return k(i,null,null,[g]).length>0};k.find=function(g,i,n){var m;if(!g)return[];for(var p=0,q=o.order.length;p<q;p++){var u,y=o.order[p];if(u=o.leftMatch[y].exec(g)){var F=u[1];u.splice(1,1);if(F.substr(F.length-1)!=="\\"){u[1]=(u[1]||"").replace(/\\/g,"");m=o.find[y](u,i,n);if(m!=null){g=g.replace(o.match[y],"");break}}}}m||(m=i.getElementsByTagName("*"));
return{set:m,expr:g}};k.filter=function(g,i,n,m){for(var p,q,u=g,y=[],F=i,M=i&&i[0]&&k.isXML(i[0]);g&&i.length;){for(var N in o.filter)if((p=o.leftMatch[N].exec(g))!=null&&p[2]){var O,D,R=o.filter[N];D=p[1];q=false;p.splice(1,1);if(D.substr(D.length-1)!=="\\"){if(F===y)y=[];if(o.preFilter[N])if(p=o.preFilter[N](p,F,n,y,m,M)){if(p===true)continue}else q=O=true;if(p)for(var j=0;(D=F[j])!=null;j++)if(D){O=R(D,p,j,F);var s=m^!!O;if(n&&O!=null)if(s)q=true;else F[j]=false;else if(s){y.push(D);q=true}}if(O!==
B){n||(F=y);g=g.replace(o.match[N],"");if(!q)return[];break}}}if(g===u)if(q==null)k.error(g);else break;u=g}return F};k.error=function(g){throw"Syntax error, unrecognized expression: "+g;};var o=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+\-]*)\))?/,
POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(g){return g.getAttribute("href")}},relative:{"+":function(g,i){var n=typeof i==="string",m=n&&!/\W/.test(i);n=n&&!m;if(m)i=i.toLowerCase();m=0;for(var p=g.length,q;m<p;m++)if(q=g[m]){for(;(q=q.previousSibling)&&q.nodeType!==1;);g[m]=n||q&&q.nodeName.toLowerCase()===
i?q||false:q===i}n&&k.filter(i,g,true)},">":function(g,i){var n,m=typeof i==="string",p=0,q=g.length;if(m&&!/\W/.test(i))for(i=i.toLowerCase();p<q;p++){if(n=g[p]){n=n.parentNode;g[p]=n.nodeName.toLowerCase()===i?n:false}}else{for(;p<q;p++)if(n=g[p])g[p]=m?n.parentNode:n.parentNode===i;m&&k.filter(i,g,true)}},"":function(g,i,n){var m,p=e++,q=b;if(typeof i==="string"&&!/\W/.test(i)){m=i=i.toLowerCase();q=a}q("parentNode",i,p,g,m,n)},"~":function(g,i,n){var m,p=e++,q=b;if(typeof i==="string"&&!/\W/.test(i)){m=
i=i.toLowerCase();q=a}q("previousSibling",i,p,g,m,n)}},find:{ID:function(g,i,n){if(typeof i.getElementById!=="undefined"&&!n)return(g=i.getElementById(g[1]))&&g.parentNode?[g]:[]},NAME:function(g,i){if(typeof i.getElementsByName!=="undefined"){for(var n=[],m=i.getElementsByName(g[1]),p=0,q=m.length;p<q;p++)m[p].getAttribute("name")===g[1]&&n.push(m[p]);return n.length===0?null:n}},TAG:function(g,i){return i.getElementsByTagName(g[1])}},preFilter:{CLASS:function(g,i,n,m,p,q){g=" "+g[1].replace(/\\/g,
"")+" ";if(q)return g;q=0;for(var u;(u=i[q])!=null;q++)if(u)if(p^(u.className&&(" "+u.className+" ").replace(/[\t\n]/g," ").indexOf(g)>=0))n||m.push(u);else if(n)i[q]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()},CHILD:function(g){if(g[1]==="nth"){var i=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=i[1]+(i[2]||1)-0;g[3]=i[3]-0}g[0]=e++;return g},ATTR:function(g,i,n,
m,p,q){i=g[1].replace(/\\/g,"");if(!q&&o.attrMap[i])g[1]=o.attrMap[i];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,i,n,m,p){if(g[1]==="not")if((d.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,i);else{g=k.filter(g[3],i,n,true^p);n||m.push.apply(m,g);return false}else if(o.match.POS.test(g[0])||o.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===
true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,i,n){return!!k(n[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)},text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===
g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}},setFilters:{first:function(g,i){return i===0},last:function(g,i,n,m){return i===m.length-1},even:function(g,i){return i%2===0},odd:function(g,i){return i%2===1},lt:function(g,i,n){return i<n[3]-0},gt:function(g,i,n){return i>n[3]-0},nth:function(g,i,n){return n[3]-
0===i},eq:function(g,i,n){return n[3]-0===i}},filter:{PSEUDO:function(g,i,n,m){var p=i[1],q=o.filters[p];if(q)return q(g,n,i,m);else if(p==="contains")return(g.textContent||g.innerText||k.getText([g])||"").indexOf(i[3])>=0;else if(p==="not"){i=i[3];n=0;for(m=i.length;n<m;n++)if(i[n]===g)return false;return true}else k.error("Syntax error, unrecognized expression: "+p)},CHILD:function(g,i){var n=i[1],m=g;switch(n){case "only":case "first":for(;m=m.previousSibling;)if(m.nodeType===1)return false;if(n===
"first")return true;m=g;case "last":for(;m=m.nextSibling;)if(m.nodeType===1)return false;return true;case "nth":n=i[2];var p=i[3];if(n===1&&p===0)return true;var q=i[0],u=g.parentNode;if(u&&(u.sizcache!==q||!g.nodeIndex)){var y=0;for(m=u.firstChild;m;m=m.nextSibling)if(m.nodeType===1)m.nodeIndex=++y;u.sizcache=q}m=g.nodeIndex-p;return n===0?m===0:m%n===0&&m/n>=0}},ID:function(g,i){return g.nodeType===1&&g.getAttribute("id")===i},TAG:function(g,i){return i==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===
i},CLASS:function(g,i){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(i)>-1},ATTR:function(g,i){var n=i[1];n=o.attrHandle[n]?o.attrHandle[n](g):g[n]!=null?g[n]:g.getAttribute(n);var m=n+"",p=i[2],q=i[4];return n==null?p==="!=":p==="="?m===q:p==="*="?m.indexOf(q)>=0:p==="~="?(" "+m+" ").indexOf(q)>=0:!q?m&&n!==false:p==="!="?m!==q:p==="^="?m.indexOf(q)===0:p==="$="?m.substr(m.length-q.length)===q:p==="|="?m===q||m.substr(0,q.length+1)===q+"-":false},POS:function(g,i,n,m){var p=o.setFilters[i[2]];
if(p)return p(g,n,i,m)}}},x=o.match.POS,r=function(g,i){return"\\"+(i-0+1)},A;for(A in o.match){o.match[A]=RegExp(o.match[A].source+/(?![^\[]*\])(?![^\(]*\))/.source);o.leftMatch[A]=RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[A].source.replace(/\\(\d+)/g,r))}var C=function(g,i){g=Array.prototype.slice.call(g,0);if(i){i.push.apply(i,g);return i}return g};try{Array.prototype.slice.call(t.documentElement.childNodes,0)}catch(J){C=function(g,i){var n=0,m=i||[];if(f.call(g)==="[object Array]")Array.prototype.push.apply(m,
g);else if(typeof g.length==="number")for(var p=g.length;n<p;n++)m.push(g[n]);else for(;g[n];n++)m.push(g[n]);return m}}var w,I;if(t.documentElement.compareDocumentPosition)w=function(g,i){if(g===i){h=true;return 0}if(!g.compareDocumentPosition||!i.compareDocumentPosition)return g.compareDocumentPosition?-1:1;return g.compareDocumentPosition(i)&4?-1:1};else{w=function(g,i){var n,m,p=[],q=[];n=g.parentNode;m=i.parentNode;var u=n;if(g===i){h=true;return 0}else if(n===m)return I(g,i);else if(n){if(!m)return 1}else return-1;
for(;u;){p.unshift(u);u=u.parentNode}for(u=m;u;){q.unshift(u);u=u.parentNode}n=p.length;m=q.length;for(u=0;u<n&&u<m;u++)if(p[u]!==q[u])return I(p[u],q[u]);return u===n?I(g,q[u],-1):I(p[u],i,1)};I=function(g,i,n){if(g===i)return n;for(g=g.nextSibling;g;){if(g===i)return-1;g=g.nextSibling}return 1}}k.getText=function(g){for(var i="",n,m=0;g[m];m++){n=g[m];if(n.nodeType===3||n.nodeType===4)i+=n.nodeValue;else if(n.nodeType!==8)i+=k.getText(n.childNodes)}return i};(function(){var g=t.createElement("div"),
i="script"+(new Date).getTime(),n=t.documentElement;g.innerHTML="<a name='"+i+"'/>";n.insertBefore(g,n.firstChild);if(t.getElementById(i)){o.find.ID=function(m,p,q){if(typeof p.getElementById!=="undefined"&&!q)return(p=p.getElementById(m[1]))?p.id===m[1]||typeof p.getAttributeNode!=="undefined"&&p.getAttributeNode("id").nodeValue===m[1]?[p]:B:[]};o.filter.ID=function(m,p){var q=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&q&&q.nodeValue===p}}n.removeChild(g);
n=g=null})();(function(){var g=t.createElement("div");g.appendChild(t.createComment(""));if(g.getElementsByTagName("*").length>0)o.find.TAG=function(i,n){var m=n.getElementsByTagName(i[1]);if(i[1]==="*"){for(var p=[],q=0;m[q];q++)m[q].nodeType===1&&p.push(m[q]);m=p}return m};g.innerHTML="<a href='#'></a>";if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")o.attrHandle.href=function(i){return i.getAttribute("href",2)};g=null})();t.querySelectorAll&&
function(){var g=k,i=t.createElement("div");i.innerHTML="<p class='TEST'></p>";if(!(i.querySelectorAll&&i.querySelectorAll(".TEST").length===0)){k=function(m,p,q,u){p=p||t;m=m.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!u&&!k.isXML(p))if(p.nodeType===9)try{return C(p.querySelectorAll(m),q)}catch(y){}else if(p.nodeType===1&&p.nodeName.toLowerCase()!=="object"){var F=p.getAttribute("id"),M=F||"__sizzle__";F||p.setAttribute("id",M);try{return C(p.querySelectorAll("#"+M+" "+m),q)}catch(N){}finally{F||
p.removeAttribute("id")}}return g(m,p,q,u)};for(var n in g)k[n]=g[n];i=null}}();(function(){var g=t.documentElement,i=g.matchesSelector||g.mozMatchesSelector||g.webkitMatchesSelector||g.msMatchesSelector,n=false;try{i.call(t.documentElement,"[test!='']:sizzle")}catch(m){n=true}if(i)k.matchesSelector=function(p,q){q=q.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(p))try{if(n||!o.match.PSEUDO.test(q)&&!/!=/.test(q))return i.call(p,q)}catch(u){}return k(q,null,null,[p]).length>0}})();(function(){var g=
t.createElement("div");g.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){o.order.splice(1,0,"CLASS");o.find.CLASS=function(i,n,m){if(typeof n.getElementsByClassName!=="undefined"&&!m)return n.getElementsByClassName(i[1])};g=null}}})();k.contains=t.documentElement.contains?function(g,i){return g!==i&&(g.contains?g.contains(i):true)}:t.documentElement.compareDocumentPosition?
function(g,i){return!!(g.compareDocumentPosition(i)&16)}:function(){return false};k.isXML=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false};var L=function(g,i){for(var n,m=[],p="",q=i.nodeType?[i]:i;n=o.match.PSEUDO.exec(g);){p+=n[0];g=g.replace(o.match.PSEUDO,"")}g=o.relative[g]?g+"*":g;n=0;for(var u=q.length;n<u;n++)k(g,q[n],m);return k.filter(p,m)};c.find=k;c.expr=k.selectors;c.expr[":"]=c.expr.filters;c.unique=k.uniqueSort;c.text=k.getText;c.isXMLDoc=k.isXML;
c.contains=k.contains})();var Za=/Until$/,$a=/^(?:parents|prevUntil|prevAll)/,ab=/,/,Na=/^.[^:#\[\.,]*$/,bb=Array.prototype.slice,cb=c.expr.match.POS;c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,e=0,f=this.length;e<f;e++){d=b.length;c.find(a,this[e],b);if(e>0)for(var h=d;h<b.length;h++)for(var l=0;l<d;l++)if(b[l]===b[h]){b.splice(h--,1);break}}return b},has:function(a){var b=c(a);return this.filter(function(){for(var d=0,e=b.length;d<e;d++)if(c.contains(this,b[d]))return true})},
not:function(a){return this.pushStack(ma(this,a,false),"not",a)},filter:function(a){return this.pushStack(ma(this,a,true),"filter",a)},is:function(a){return!!a&&c.filter(a,this).length>0},closest:function(a,b){var d=[],e,f,h=this[0];if(c.isArray(a)){var l,k={},o=1;if(h&&a.length){e=0;for(f=a.length;e<f;e++){l=a[e];k[l]||(k[l]=c.expr.match.POS.test(l)?c(l,b||this.context):l)}for(;h&&h.ownerDocument&&h!==b;){for(l in k){e=k[l];if(e.jquery?e.index(h)>-1:c(h).is(e))d.push({selector:l,elem:h,level:o})}h=
h.parentNode;o++}}return d}l=cb.test(a)?c(a,b||this.context):null;e=0;for(f=this.length;e<f;e++)for(h=this[e];h;)if(l?l.index(h)>-1:c.find.matchesSelector(h,a)){d.push(h);break}else{h=h.parentNode;if(!h||!h.ownerDocument||h===b)break}d=d.length>1?c.unique(d):d;return this.pushStack(d,"closest",a)},index:function(a){if(!a||typeof a==="string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var d=typeof a==="string"?c(a,b||this.context):
c.makeArray(a),e=c.merge(this.get(),d);return this.pushStack(!d[0]||!d[0].parentNode||d[0].parentNode.nodeType===11||!e[0]||!e[0].parentNode||e[0].parentNode.nodeType===11?e:c.unique(e))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode",d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,
2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,
b){c.fn[a]=function(d,e){var f=c.map(this,b,d);Za.test(a)||(e=d);if(e&&typeof e==="string")f=c.filter(e,f);f=this.length>1?c.unique(f):f;if((this.length>1||ab.test(e))&&$a.test(a))f=f.reverse();return this.pushStack(f,a,bb.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return b.length===1?c.find.matchesSelector(b[0],a)?[b[0]]:[]:c.find.matches(a,b)},dir:function(a,b,d){var e=[];for(a=a[b];a&&a.nodeType!==9&&(d===B||a.nodeType!==1||!c(a).is(d));){a.nodeType===1&&
e.push(a);a=a[b]}return e},nth:function(a,b,d){b=b||1;for(var e=0;a;a=a[d])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var za=/ jQuery\d+="(?:\d+|null)"/g,$=/^\s+/,Aa=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Ba=/<([\w:]+)/,db=/<tbody/i,eb=/<|&#?\w+;/,Ca=/<(?:script|object|embed|option|style)/i,Da=/checked\s*(?:[^=]|=\s*.checked.)/i,fb=/\=([^="'>\s]+\/)>/g,P={option:[1,
"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};P.optgroup=P.option;P.tbody=P.tfoot=P.colgroup=P.caption=P.thead;P.th=P.td;if(!c.support.htmlSerialize)P._default=[1,"div<div>","</div>"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d=
c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==B)return this.empty().append((this[0]&&this[0].ownerDocument||t).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this},
wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})},
prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,
this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,e;(e=this[d])!=null;d++)if(!a||c.filter(a,[e]).length){if(!b&&e.nodeType===1){c.cleanData(e.getElementsByTagName("*"));c.cleanData([e])}e.parentNode&&e.parentNode.removeChild(e)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild);
return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,e=this.ownerDocument;if(!d){d=e.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(za,"").replace(fb,'="$1">').replace($,"")],e)[0]}else return this.cloneNode(true)});if(a===true){na(this,b);na(this.find("*"),b.find("*"))}return b},html:function(a){if(a===B)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(za,""):null;
else if(typeof a==="string"&&!Ca.test(a)&&(c.support.leadingWhitespace||!$.test(a))&&!P[(Ba.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Aa,"<$1></$2>");try{for(var b=0,d=this.length;b<d;b++)if(this[b].nodeType===1){c.cleanData(this[b].getElementsByTagName("*"));this[b].innerHTML=a}}catch(e){this.empty().append(a)}}else c.isFunction(a)?this.each(function(f){var h=c(this);h.html(a.call(this,f,h.html()))}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(c.isFunction(a))return this.each(function(b){var d=
c(this),e=d.html();d.replaceWith(a.call(this,b,e))});if(typeof a!=="string")a=c(a).detach();return this.each(function(){var b=this.nextSibling,d=this.parentNode;c(this).remove();b?c(b).before(a):c(d).append(a)})}else return this.pushStack(c(c.isFunction(a)?a():a),"replaceWith",a)},detach:function(a){return this.remove(a,true)},domManip:function(a,b,d){var e,f,h,l=a[0],k=[];if(!c.support.checkClone&&arguments.length===3&&typeof l==="string"&&Da.test(l))return this.each(function(){c(this).domManip(a,
b,d,true)});if(c.isFunction(l))return this.each(function(x){var r=c(this);a[0]=l.call(this,x,b?r.html():B);r.domManip(a,b,d)});if(this[0]){e=l&&l.parentNode;e=c.support.parentNode&&e&&e.nodeType===11&&e.childNodes.length===this.length?{fragment:e}:c.buildFragment(a,this,k);h=e.fragment;if(f=h.childNodes.length===1?h=h.firstChild:h.firstChild){b=b&&c.nodeName(f,"tr");f=0;for(var o=this.length;f<o;f++)d.call(b?c.nodeName(this[f],"table")?this[f].getElementsByTagName("tbody")[0]||this[f].appendChild(this[f].ownerDocument.createElement("tbody")):
this[f]:this[f],f>0||e.cacheable||this.length>1?h.cloneNode(true):h)}k.length&&c.each(k,Oa)}return this}});c.buildFragment=function(a,b,d){var e,f,h;b=b&&b[0]?b[0].ownerDocument||b[0]:t;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&b===t&&!Ca.test(a[0])&&(c.support.checkClone||!Da.test(a[0]))){f=true;if(h=c.fragments[a[0]])if(h!==1)e=h}if(!e){e=b.createDocumentFragment();c.clean(a,b,e,d)}if(f)c.fragments[a[0]]=h?e:1;return{fragment:e,cacheable:f}};c.fragments={};c.each({appendTo:"append",
prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var e=[];d=c(d);var f=this.length===1&&this[0].parentNode;if(f&&f.nodeType===11&&f.childNodes.length===1&&d.length===1){d[b](this[0]);return this}else{f=0;for(var h=d.length;f<h;f++){var l=(f>0?this.clone(true):this).get();c(d[f])[b](l);e=e.concat(l)}return this.pushStack(e,a,d.selector)}}});c.extend({clean:function(a,b,d,e){b=b||t;if(typeof b.createElement==="undefined")b=b.ownerDocument||
b[0]&&b[0].ownerDocument||t;for(var f=[],h=0,l;(l=a[h])!=null;h++){if(typeof l==="number")l+="";if(l){if(typeof l==="string"&&!eb.test(l))l=b.createTextNode(l);else if(typeof l==="string"){l=l.replace(Aa,"<$1></$2>");var k=(Ba.exec(l)||["",""])[1].toLowerCase(),o=P[k]||P._default,x=o[0],r=b.createElement("div");for(r.innerHTML=o[1]+l+o[2];x--;)r=r.lastChild;if(!c.support.tbody){x=db.test(l);k=k==="table"&&!x?r.firstChild&&r.firstChild.childNodes:o[1]==="<table>"&&!x?r.childNodes:[];for(o=k.length-
1;o>=0;--o)c.nodeName(k[o],"tbody")&&!k[o].childNodes.length&&k[o].parentNode.removeChild(k[o])}!c.support.leadingWhitespace&&$.test(l)&&r.insertBefore(b.createTextNode($.exec(l)[0]),r.firstChild);l=r.childNodes}if(l.nodeType)f.push(l);else f=c.merge(f,l)}}if(d)for(h=0;f[h];h++)if(e&&c.nodeName(f[h],"script")&&(!f[h].type||f[h].type.toLowerCase()==="text/javascript"))e.push(f[h].parentNode?f[h].parentNode.removeChild(f[h]):f[h]);else{f[h].nodeType===1&&f.splice.apply(f,[h+1,0].concat(c.makeArray(f[h].getElementsByTagName("script"))));
d.appendChild(f[h])}return f},cleanData:function(a){for(var b,d,e=c.cache,f=c.event.special,h=c.support.deleteExpando,l=0,k;(k=a[l])!=null;l++)if(!(k.nodeName&&c.noData[k.nodeName.toLowerCase()]))if(d=k[c.expando]){if((b=e[d])&&b.events)for(var o in b.events)f[o]?c.event.remove(k,o):c.removeEvent(k,o,b.handle);if(h)delete k[c.expando];else k.removeAttribute&&k.removeAttribute(c.expando);delete e[d]}}});var Ea=/alpha\([^)]*\)/i,gb=/opacity=([^)]*)/,hb=/-([a-z])/ig,ib=/([A-Z])/g,Fa=/^-?\d+(?:px)?$/i,
jb=/^-?\d/,kb={position:"absolute",visibility:"hidden",display:"block"},Pa=["Left","Right"],Qa=["Top","Bottom"],W,Ga,aa,lb=function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){if(arguments.length===2&&b===B)return this;return c.access(this,a,b,true,function(d,e,f){return f!==B?c.style(d,e,f):c.css(d,e)})};c.extend({cssHooks:{opacity:{get:function(a,b){if(b){var d=W(a,"opacity","opacity");return d===""?"1":d}else return a.style.opacity}}},cssNumber:{zIndex:true,fontWeight:true,opacity:true,
zoom:true,lineHeight:true},cssProps:{"float":c.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,d,e){if(!(!a||a.nodeType===3||a.nodeType===8||!a.style)){var f,h=c.camelCase(b),l=a.style,k=c.cssHooks[h];b=c.cssProps[h]||h;if(d!==B){if(!(typeof d==="number"&&isNaN(d)||d==null)){if(typeof d==="number"&&!c.cssNumber[h])d+="px";if(!k||!("set"in k)||(d=k.set(a,d))!==B)try{l[b]=d}catch(o){}}}else{if(k&&"get"in k&&(f=k.get(a,false,e))!==B)return f;return l[b]}}},css:function(a,b,d){var e,f=c.camelCase(b),
h=c.cssHooks[f];b=c.cssProps[f]||f;if(h&&"get"in h&&(e=h.get(a,true,d))!==B)return e;else if(W)return W(a,b,f)},swap:function(a,b,d){var e={},f;for(f in b){e[f]=a.style[f];a.style[f]=b[f]}d.call(a);for(f in b)a.style[f]=e[f]},camelCase:function(a){return a.replace(hb,lb)}});c.curCSS=c.css;c.each(["height","width"],function(a,b){c.cssHooks[b]={get:function(d,e,f){var h;if(e){if(d.offsetWidth!==0)h=oa(d,b,f);else c.swap(d,kb,function(){h=oa(d,b,f)});if(h<=0){h=W(d,b,b);if(h==="0px"&&aa)h=aa(d,b,b);
if(h!=null)return h===""||h==="auto"?"0px":h}if(h<0||h==null){h=d.style[b];return h===""||h==="auto"?"0px":h}return typeof h==="string"?h:h+"px"}},set:function(d,e){if(Fa.test(e)){e=parseFloat(e);if(e>=0)return e+"px"}else return e}}});if(!c.support.opacity)c.cssHooks.opacity={get:function(a,b){return gb.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var d=a.style;d.zoom=1;var e=c.isNaN(b)?"":"alpha(opacity="+b*100+")",f=
d.filter||"";d.filter=Ea.test(f)?f.replace(Ea,e):d.filter+" "+e}};if(t.defaultView&&t.defaultView.getComputedStyle)Ga=function(a,b,d){var e;d=d.replace(ib,"-$1").toLowerCase();if(!(b=a.ownerDocument.defaultView))return B;if(b=b.getComputedStyle(a,null)){e=b.getPropertyValue(d);if(e===""&&!c.contains(a.ownerDocument.documentElement,a))e=c.style(a,d)}return e};if(t.documentElement.currentStyle)aa=function(a,b){var d,e,f=a.currentStyle&&a.currentStyle[b],h=a.style;if(!Fa.test(f)&&jb.test(f)){d=h.left;
e=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;h.left=b==="fontSize"?"1em":f||0;f=h.pixelLeft+"px";h.left=d;a.runtimeStyle.left=e}return f===""?"auto":f};W=Ga||aa;if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b=a.offsetHeight;return a.offsetWidth===0&&b===0||!c.support.reliableHiddenOffsets&&(a.style.display||c.css(a,"display"))==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var mb=c.now(),nb=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
ob=/^(?:select|textarea)/i,pb=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,qb=/^(?:GET|HEAD)$/,Ra=/\[\]$/,T=/\=\?(&|$)/,ja=/\?/,rb=/([?&])_=[^&]*/,sb=/^(\w+:)?\/\/([^\/?#]+)/,tb=/%20/g,ub=/#.*$/,Ha=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!=="string"&&Ha)return Ha.apply(this,arguments);else if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var f=a.slice(e,a.length);a=a.slice(0,e)}e="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b===
"object"){b=c.param(b,c.ajaxSettings.traditional);e="POST"}var h=this;c.ajax({url:a,type:e,dataType:"html",data:b,complete:function(l,k){if(k==="success"||k==="notmodified")h.html(f?c("<div>").append(l.responseText.replace(nb,"")).find(f):l.responseText);d&&h.each(d,[l.responseText,k,l])}});return this},serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&
!this.disabled&&(this.checked||ob.test(this.nodeName)||pb.test(this.type))}).map(function(a,b){var d=c(this).val();return d==null?null:c.isArray(d)?c.map(d,function(e){return{name:b.name,value:e}}):{name:b.name,value:d}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,e){if(c.isFunction(b)){e=e||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:e})},
getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,e){if(c.isFunction(b)){e=e||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:e})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return new E.XMLHttpRequest},accepts:{xml:"application/xml, text/xml",html:"text/html",
script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},ajax:function(a){var b=c.extend(true,{},c.ajaxSettings,a),d,e,f,h=b.type.toUpperCase(),l=qb.test(h);b.url=b.url.replace(ub,"");b.context=a&&a.context!=null?a.context:b;if(b.data&&b.processData&&typeof b.data!=="string")b.data=c.param(b.data,b.traditional);if(b.dataType==="jsonp"){if(h==="GET")T.test(b.url)||(b.url+=(ja.test(b.url)?"&":"?")+(b.jsonp||"callback")+"=?");else if(!b.data||
!T.test(b.data))b.data=(b.data?b.data+"&":"")+(b.jsonp||"callback")+"=?";b.dataType="json"}if(b.dataType==="json"&&(b.data&&T.test(b.data)||T.test(b.url))){d=b.jsonpCallback||"jsonp"+mb++;if(b.data)b.data=(b.data+"").replace(T,"="+d+"$1");b.url=b.url.replace(T,"="+d+"$1");b.dataType="script";var k=E[d];E[d]=function(m){if(c.isFunction(k))k(m);else{E[d]=B;try{delete E[d]}catch(p){}}f=m;c.handleSuccess(b,w,e,f);c.handleComplete(b,w,e,f);r&&r.removeChild(A)}}if(b.dataType==="script"&&b.cache===null)b.cache=
false;if(b.cache===false&&l){var o=c.now(),x=b.url.replace(rb,"$1_="+o);b.url=x+(x===b.url?(ja.test(b.url)?"&":"?")+"_="+o:"")}if(b.data&&l)b.url+=(ja.test(b.url)?"&":"?")+b.data;b.global&&c.active++===0&&c.event.trigger("ajaxStart");o=(o=sb.exec(b.url))&&(o[1]&&o[1].toLowerCase()!==location.protocol||o[2].toLowerCase()!==location.host);if(b.dataType==="script"&&h==="GET"&&o){var r=t.getElementsByTagName("head")[0]||t.documentElement,A=t.createElement("script");if(b.scriptCharset)A.charset=b.scriptCharset;
A.src=b.url;if(!d){var C=false;A.onload=A.onreadystatechange=function(){if(!C&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){C=true;c.handleSuccess(b,w,e,f);c.handleComplete(b,w,e,f);A.onload=A.onreadystatechange=null;r&&A.parentNode&&r.removeChild(A)}}}r.insertBefore(A,r.firstChild);return B}var J=false,w=b.xhr();if(w){b.username?w.open(h,b.url,b.async,b.username,b.password):w.open(h,b.url,b.async);try{if(b.data!=null&&!l||a&&a.contentType)w.setRequestHeader("Content-Type",
b.contentType);if(b.ifModified){c.lastModified[b.url]&&w.setRequestHeader("If-Modified-Since",c.lastModified[b.url]);c.etag[b.url]&&w.setRequestHeader("If-None-Match",c.etag[b.url])}o||w.setRequestHeader("X-Requested-With","XMLHttpRequest");w.setRequestHeader("Accept",b.dataType&&b.accepts[b.dataType]?b.accepts[b.dataType]+", */*; q=0.01":b.accepts._default)}catch(I){}if(b.beforeSend&&b.beforeSend.call(b.context,w,b)===false){b.global&&c.active--===1&&c.event.trigger("ajaxStop");w.abort();return false}b.global&&
c.triggerGlobal(b,"ajaxSend",[w,b]);var L=w.onreadystatechange=function(m){if(!w||w.readyState===0||m==="abort"){J||c.handleComplete(b,w,e,f);J=true;if(w)w.onreadystatechange=c.noop}else if(!J&&w&&(w.readyState===4||m==="timeout")){J=true;w.onreadystatechange=c.noop;e=m==="timeout"?"timeout":!c.httpSuccess(w)?"error":b.ifModified&&c.httpNotModified(w,b.url)?"notmodified":"success";var p;if(e==="success")try{f=c.httpData(w,b.dataType,b)}catch(q){e="parsererror";p=q}if(e==="success"||e==="notmodified")d||
c.handleSuccess(b,w,e,f);else c.handleError(b,w,e,p);d||c.handleComplete(b,w,e,f);m==="timeout"&&w.abort();if(b.async)w=null}};try{var g=w.abort;w.abort=function(){w&&Function.prototype.call.call(g,w);L("abort")}}catch(i){}b.async&&b.timeout>0&&setTimeout(function(){w&&!J&&L("timeout")},b.timeout);try{w.send(l||b.data==null?null:b.data)}catch(n){c.handleError(b,w,null,n);c.handleComplete(b,w,e,f)}b.async||L();return w}},param:function(a,b){var d=[],e=function(h,l){l=c.isFunction(l)?l():l;d[d.length]=
encodeURIComponent(h)+"="+encodeURIComponent(l)};if(b===B)b=c.ajaxSettings.traditional;if(c.isArray(a)||a.jquery)c.each(a,function(){e(this.name,this.value)});else for(var f in a)da(f,a[f],b,e);return d.join("&").replace(tb,"+")}});c.extend({active:0,lastModified:{},etag:{},handleError:function(a,b,d,e){a.error&&a.error.call(a.context,b,d,e);a.global&&c.triggerGlobal(a,"ajaxError",[b,a,e])},handleSuccess:function(a,b,d,e){a.success&&a.success.call(a.context,e,d,b);a.global&&c.triggerGlobal(a,"ajaxSuccess",
[b,a])},handleComplete:function(a,b,d){a.complete&&a.complete.call(a.context,b,d);a.global&&c.triggerGlobal(a,"ajaxComplete",[b,a]);a.global&&c.active--===1&&c.event.trigger("ajaxStop")},triggerGlobal:function(a,b,d){(a.context&&a.context.url==null?c(a.context):c.event).trigger(b,d)},httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status===1223}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),
e=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(e)c.etag[b]=e;return a.status===304},httpData:function(a,b,d){var e=a.getResponseHeader("content-type")||"",f=b==="xml"||!b&&e.indexOf("xml")>=0;a=f?a.responseXML:a.responseText;f&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b==="json"||!b&&e.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&e.indexOf("javascript")>=0)c.globalEval(a);return a}});
if(E.ActiveXObject)c.ajaxSettings.xhr=function(){if(E.location.protocol!=="file:")try{return new E.XMLHttpRequest}catch(a){}try{return new E.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}};c.support.ajax=!!c.ajaxSettings.xhr();var ea={},vb=/^(?:toggle|show|hide)$/,wb=/^([+\-]=)?([\d+.\-]+)(.*)$/,ba,pa=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b,d){if(a||a===0)return this.animate(S("show",
3),a,b,d);else{d=0;for(var e=this.length;d<e;d++){a=this[d];b=a.style.display;if(!c.data(a,"olddisplay")&&b==="none")b=a.style.display="";b===""&&c.css(a,"display")==="none"&&c.data(a,"olddisplay",qa(a.nodeName))}for(d=0;d<e;d++){a=this[d];b=a.style.display;if(b===""||b==="none")a.style.display=c.data(a,"olddisplay")||""}return this}},hide:function(a,b,d){if(a||a===0)return this.animate(S("hide",3),a,b,d);else{a=0;for(b=this.length;a<b;a++){d=c.css(this[a],"display");d!=="none"&&c.data(this[a],"olddisplay",
d)}for(a=0;a<b;a++)this[a].style.display="none";return this}},_toggle:c.fn.toggle,toggle:function(a,b,d){var e=typeof a==="boolean";if(c.isFunction(a)&&c.isFunction(b))this._toggle.apply(this,arguments);else a==null||e?this.each(function(){var f=e?a:c(this).is(":hidden");c(this)[f?"show":"hide"]()}):this.animate(S("toggle",3),a,b,d);return this},fadeTo:function(a,b,d,e){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,d,e)},animate:function(a,b,d,e){var f=c.speed(b,
d,e);if(c.isEmptyObject(a))return this.each(f.complete);return this[f.queue===false?"each":"queue"](function(){var h=c.extend({},f),l,k=this.nodeType===1,o=k&&c(this).is(":hidden"),x=this;for(l in a){var r=c.camelCase(l);if(l!==r){a[r]=a[l];delete a[l];l=r}if(a[l]==="hide"&&o||a[l]==="show"&&!o)return h.complete.call(this);if(k&&(l==="height"||l==="width")){h.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY];if(c.css(this,"display")==="inline"&&c.css(this,"float")==="none")if(c.support.inlineBlockNeedsLayout)if(qa(this.nodeName)===
"inline")this.style.display="inline-block";else{this.style.display="inline";this.style.zoom=1}else this.style.display="inline-block"}if(c.isArray(a[l])){(h.specialEasing=h.specialEasing||{})[l]=a[l][1];a[l]=a[l][0]}}if(h.overflow!=null)this.style.overflow="hidden";h.curAnim=c.extend({},a);c.each(a,function(A,C){var J=new c.fx(x,h,A);if(vb.test(C))J[C==="toggle"?o?"show":"hide":C](a);else{var w=wb.exec(C),I=J.cur()||0;if(w){var L=parseFloat(w[2]),g=w[3]||"px";if(g!=="px"){c.style(x,A,(L||1)+g);I=(L||
1)/J.cur()*I;c.style(x,A,I+g)}if(w[1])L=(w[1]==="-="?-1:1)*L+I;J.custom(I,L,g)}else J.custom(I,C,"")}});return true})},stop:function(a,b){var d=c.timers;a&&this.queue([]);this.each(function(){for(var e=d.length-1;e>=0;e--)if(d[e].elem===this){b&&d[e](true);d.splice(e,1)}});b||this.dequeue();return this}});c.each({slideDown:S("show",1),slideUp:S("hide",1),slideToggle:S("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){c.fn[a]=function(d,e,f){return this.animate(b,
d,e,f)}});c.extend({speed:function(a,b,d){var e=a&&typeof a==="object"?c.extend({},a):{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};e.duration=c.fx.off?0:typeof e.duration==="number"?e.duration:e.duration in c.fx.speeds?c.fx.speeds[e.duration]:c.fx.speeds._default;e.old=e.complete;e.complete=function(){e.queue!==false&&c(this).dequeue();c.isFunction(e.old)&&e.old.call(this)};return e},easing:{linear:function(a,b,d,e){return d+e*a},swing:function(a,b,d,e){return(-Math.cos(a*
Math.PI)/2+0.5)*e+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]||c.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a=parseFloat(c.css(this.elem,this.prop));return a&&a>-1E4?a:0},custom:function(a,b,d){function e(l){return f.step(l)}
var f=this,h=c.fx;this.startTime=c.now();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start;this.pos=this.state=0;e.elem=this.elem;if(e()&&c.timers.push(e)&&!ba)ba=setInterval(h.tick,h.interval)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true;
this.custom(this.cur(),0)},step:function(a){var b=c.now(),d=true;if(a||b>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var e in this.options.curAnim)if(this.options.curAnim[e]!==true)d=false;if(d){if(this.options.overflow!=null&&!c.support.shrinkWrapBlocks){var f=this.elem,h=this.options;c.each(["","X","Y"],function(k,o){f.style["overflow"+o]=h.overflow[k]})}this.options.hide&&c(this.elem).hide();if(this.options.hide||
this.options.show)for(var l in this.options.curAnim)c.style(this.elem,l,this.options.orig[l]);this.options.complete.call(this.elem)}return false}else{a=b-this.startTime;this.state=a/this.options.duration;b=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||b](this.state,a,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a=
c.timers,b=0;b<a.length;b++)a[b]()||a.splice(b--,1);a.length||c.fx.stop()},interval:13,stop:function(){clearInterval(ba);ba=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){c.style(a.elem,"opacity",a.now)},_default:function(a){if(a.elem.style&&a.elem.style[a.prop]!=null)a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit;else a.elem[a.prop]=a.now}}});if(c.expr&&c.expr.filters)c.expr.filters.animated=function(a){return c.grep(c.timers,function(b){return a===
b.elem}).length};var xb=/^t(?:able|d|h)$/i,Ia=/^(?:body|html)$/i;c.fn.offset="getBoundingClientRect"in t.documentElement?function(a){var b=this[0],d;if(a)return this.each(function(l){c.offset.setOffset(this,a,l)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);try{d=b.getBoundingClientRect()}catch(e){}var f=b.ownerDocument,h=f.documentElement;if(!d||!c.contains(h,b))return d||{top:0,left:0};b=f.body;f=fa(f);return{top:d.top+(f.pageYOffset||c.support.boxModel&&
h.scrollTop||b.scrollTop)-(h.clientTop||b.clientTop||0),left:d.left+(f.pageXOffset||c.support.boxModel&&h.scrollLeft||b.scrollLeft)-(h.clientLeft||b.clientLeft||0)}}:function(a){var b=this[0];if(a)return this.each(function(x){c.offset.setOffset(this,a,x)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);c.offset.initialize();var d,e=b.offsetParent,f=b.ownerDocument,h=f.documentElement,l=f.body;d=(f=f.defaultView)?f.getComputedStyle(b,null):b.currentStyle;
for(var k=b.offsetTop,o=b.offsetLeft;(b=b.parentNode)&&b!==l&&b!==h;){if(c.offset.supportsFixedPosition&&d.position==="fixed")break;d=f?f.getComputedStyle(b,null):b.currentStyle;k-=b.scrollTop;o-=b.scrollLeft;if(b===e){k+=b.offsetTop;o+=b.offsetLeft;if(c.offset.doesNotAddBorder&&!(c.offset.doesAddBorderForTableAndCells&&xb.test(b.nodeName))){k+=parseFloat(d.borderTopWidth)||0;o+=parseFloat(d.borderLeftWidth)||0}e=b.offsetParent}if(c.offset.subtractsBorderForOverflowNotVisible&&d.overflow!=="visible"){k+=
parseFloat(d.borderTopWidth)||0;o+=parseFloat(d.borderLeftWidth)||0}d=d}if(d.position==="relative"||d.position==="static"){k+=l.offsetTop;o+=l.offsetLeft}if(c.offset.supportsFixedPosition&&d.position==="fixed"){k+=Math.max(h.scrollTop,l.scrollTop);o+=Math.max(h.scrollLeft,l.scrollLeft)}return{top:k,left:o}};c.offset={initialize:function(){var a=t.body,b=t.createElement("div"),d,e,f,h=parseFloat(c.css(a,"marginTop"))||0;c.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",
height:"1px",visibility:"hidden"});b.innerHTML="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";a.insertBefore(b,a.firstChild);d=b.firstChild;e=d.firstChild;f=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=e.offsetTop!==5;this.doesAddBorderForTableAndCells=
f.offsetTop===5;e.style.position="fixed";e.style.top="20px";this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15;e.style.position=e.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==h;a.removeChild(b);c.offset.initialize=c.noop},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.css(a,
"marginTop"))||0;d+=parseFloat(c.css(a,"marginLeft"))||0}return{top:b,left:d}},setOffset:function(a,b,d){var e=c.css(a,"position");if(e==="static")a.style.position="relative";var f=c(a),h=f.offset(),l=c.css(a,"top"),k=c.css(a,"left"),o=e==="absolute"&&c.inArray("auto",[l,k])>-1;e={};var x={};if(o)x=f.position();l=o?x.top:parseInt(l,10)||0;k=o?x.left:parseInt(k,10)||0;if(c.isFunction(b))b=b.call(a,d,h);if(b.top!=null)e.top=b.top-h.top+l;if(b.left!=null)e.left=b.left-h.left+k;"using"in b?b.using.call(a,
e):f.css(e)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),e=Ia.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.css(a,"marginTop"))||0;d.left-=parseFloat(c.css(a,"marginLeft"))||0;e.top+=parseFloat(c.css(b[0],"borderTopWidth"))||0;e.left+=parseFloat(c.css(b[0],"borderLeftWidth"))||0;return{top:d.top-e.top,left:d.left-e.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||t.body;a&&!Ia.test(a.nodeName)&&
c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(e){var f=this[0],h;if(!f)return null;if(e!==B)return this.each(function(){if(h=fa(this))h.scrollTo(!a?e:c(h).scrollLeft(),a?e:c(h).scrollTop());else this[d]=e});else return(h=fa(f))?"pageXOffset"in h?h[a?"pageYOffset":"pageXOffset"]:c.support.boxModel&&h.document.documentElement[d]||h.document.body[d]:f[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();
c.fn["inner"+b]=function(){return this[0]?parseFloat(c.css(this[0],d,"padding")):null};c.fn["outer"+b]=function(e){return this[0]?parseFloat(c.css(this[0],d,e?"margin":"border")):null};c.fn[d]=function(e){var f=this[0];if(!f)return e==null?null:this;if(c.isFunction(e))return this.each(function(l){var k=c(this);k[d](e.call(this,l,k[d]()))});if(c.isWindow(f))return f.document.compatMode==="CSS1Compat"&&f.document.documentElement["client"+b]||f.document.body["client"+b];else if(f.nodeType===9)return Math.max(f.documentElement["client"+
b],f.body["scroll"+b],f.documentElement["scroll"+b],f.body["offset"+b],f.documentElement["offset"+b]);else if(e===B){f=c.css(f,d);var h=parseFloat(f);return c.isNaN(h)?f:h}else return this.css(d,typeof e==="string"?e:e+"px")}})})(window);
var Quick_Search = 'Quick Search!';
var Keyword_Search = 'Keyword Search!';
var Search_Parameters = 'Search Parameters';
var My_Child_is = 'My Child is';
var Years_Old = 'years old';
var And_I_am_looking_for = 'and I am looking for';
var In = 'In';
var Idea = 'Idea';
var Question = 'Question';
var Problem = 'Problem';
var Praise = 'Praise';
var Please_Enter_A_Title = 'Please enter a Title';
var Please_Enter_Your_Email = 'Please enter your Email';
var How_Would_You_Describe_It = 'How would you describe it?';
var Please_Add_Some_Information_About_your_Feedback = 'Please Add Some information about your Feedback';
var There_Was_A_Problem = 'There Was a problem sending your Feedback, Please contact the System Administrator at';
var Please_Add_A_Name = 'Please Add a Name';
var Please_Enter_A_Correct_Email_Address = 'Please Enter a Correct Email Address';
var Please_Enter_A_Comment = 'Please Enter a Comment';
var Please_Enter_An_Email_Address = 'Please Enter an Email Address';
var Please_Enter_A_Contact_Name = 'Please Enter a Contact Name';
var Please_Enter_A_Website = 'Please Enter a Website';
var Please_Enter_A_Phone_Number = 'Please Enter a Phone Number';
var Please_Enter_A_Location = 'Please Enter a Location';
var Please_Enter_An_Address = 'Please Enter an Address';
var Please_Enter_A_Business_Name = 'Please Enter a Business Name';
var Creation_Of_The_Parent_Acount_Failed = 'creation of the Parent Acount Failed, Please try again';
var Please_Select_A_Contry_First = 'Please Select a country first';
var Please_Select_A_Province_First = 'Please Select a Province first';
var Not_Saved = 'Not Saved';
var Saved = 'Saved';
var Please_Add_An_Event_Name = 'Please Add an Event Name';
var Please_Add_An_Event_Address = 'Please Add an Event Address';
var Please_Add_A_Postal_Code = 'Please Add a Postal Code';
var Please_Add_A_Description = 'Please Add a Description';
var Please_Add_A_Start_Date = 'Please Add a Start Date';
var Please_Add_A_Start_Time = 'Please Add a Start time'; 
var Please_Add_A_End_Date = 'Please Add a End Date';
var Please_Add_An_End_Time = 'Please Add an End Time';
var Please_Add_A_Location = 'Please Add a Location';
var Please_Add_A_Category = 'Please Add a Category';
var Please_Wait = 'Please wait';
var Delete_child = 'Delete child';
var Cancel = 'Cancel';
var Close = 'close';
var Child_Not_Deleted = 'The child was not Deleted';
var There_are_no_events_in_this_catalogue = 'Sorry, There are no events in this catalogue that match the selected category';
var Hide_Expired_Events = 'Hide Expired Events';
var Show_Expired_Events = 'Show Expired Events';
var Event_End_Date_Cannot_Be_Smaller_Than_Start_Date = 'Event end date cannot be smaller than event start date';
var Please_Enter_A_City = 'Please Enter a City';
var Please_Enter_A_Province = 'Please Enter a Province';
var Please_Enter_A_Bio = 'Please Enter a Bio';
var Please_Enter_A_Title = 'Please Enter a Title';
var Please_Enter_An_Article = 'Please Enter an Article';





























var Spry;
if (!Spry)Spry = {};
if (!Spry.Widget)Spry.Widget = {};

Spry.Widget.TabbedPanels = function(element, opts)
{
this.element = this.getElement(element);
this.defaultTab = 0; 
this.tabSelectedClass = "TabbedPanelsTabSelected";
this.tabHoverClass = "TabbedPanelsTabHover";
this.tabFocusedClass = "TabbedPanelsTabFocused";
this.panelVisibleClass = "TabbedPanelsContentVisible";
this.focusElement = null;
this.hasFocus = false;
this.currentTabIndex = 0;
this.enableKeyboardNavigation = true;
this.nextPanelKeyCode = Spry.Widget.TabbedPanels.KEY_RIGHT;
this.previousPanelKeyCode = Spry.Widget.TabbedPanels.KEY_LEFT;

Spry.Widget.TabbedPanels.setOptions(this, opts);




if (typeof (this.defaultTab)== "number")
{
if (this.defaultTab < 0)
this.defaultTab = 0;
else
{
var count = this.getTabbedPanelCount();
if (this.defaultTab >= count)
this.defaultTab = (count > 1)? (count - 1): 0;
}

this.defaultTab = this.getTabs()[this.defaultTab];
}





if (this.defaultTab)
this.defaultTab = this.getElement(this.defaultTab);

this.attachBehaviors();
};

Spry.Widget.TabbedPanels.prototype.getElement = function(ele)
{
if (ele && typeof ele == "string")
return document.getElementById(ele);
return ele;
};

Spry.Widget.TabbedPanels.prototype.getElementChildren = function(element)
{
var children = [];
var child = element.firstChild;
while (child)
{
if (child.nodeType == 1)
children.push(child);
child = child.nextSibling;
}
return children;
};

Spry.Widget.TabbedPanels.prototype.addClassName = function(ele, className)
{
if (!ele || !className || (ele.className && ele.className.search(new RegExp("\\b" + className + "\\b"))!= -1))
return;
ele.className += (ele.className ? " " : "")+ className;
};

Spry.Widget.TabbedPanels.prototype.removeClassName = function(ele, className)
{
if (!ele || !className || (ele.className && ele.className.search(new RegExp("\\b" + className + "\\b"))== -1))
return;
ele.className = ele.className.replace(new RegExp("\\s*\\b" + className + "\\b", "g"), "");
};

Spry.Widget.TabbedPanels.setOptions = function(obj, optionsObj, ignoreUndefinedProps)
{
if (!optionsObj)
return;
for (var optionName in optionsObj)
{
if (ignoreUndefinedProps && optionsObj[optionName] == undefined)
continue;
obj[optionName] = optionsObj[optionName];
}
};

Spry.Widget.TabbedPanels.prototype.getTabGroup = function()
{
if (this.element)
{
var children = this.getElementChildren(this.element);
if (children.length)
return children[0];
}
return null;
};

Spry.Widget.TabbedPanels.prototype.getTabs = function()
{
var tabs = [];
var tg = this.getTabGroup();
if (tg)
tabs = this.getElementChildren(tg);
return tabs;
};

Spry.Widget.TabbedPanels.prototype.getContentPanelGroup = function()
{
if (this.element)
{
var children = this.getElementChildren(this.element);
if (children.length > 1)
return children[1];
}
return null;
};

Spry.Widget.TabbedPanels.prototype.getContentPanels = function()
{
var panels = [];
var pg = this.getContentPanelGroup();
if (pg)
panels = this.getElementChildren(pg);
return panels;
};

Spry.Widget.TabbedPanels.prototype.getIndex = function(ele, arr)
{
ele = this.getElement(ele);
if (ele && arr && arr.length)
{
for (var i = 0; i < arr.length; i++)
{
if (ele == arr[i])
return i;
}
}
return -1;
};

Spry.Widget.TabbedPanels.prototype.getTabIndex = function(ele)
{
var i = this.getIndex(ele, this.getTabs());
if (i < 0)
i = this.getIndex(ele, this.getContentPanels());
return i;
};

Spry.Widget.TabbedPanels.prototype.getCurrentTabIndex = function()
{
return this.currentTabIndex;
};

Spry.Widget.TabbedPanels.prototype.getTabbedPanelCount = function(ele)
{
return Math.min(this.getTabs().length, this.getContentPanels().length);
};

Spry.Widget.TabbedPanels.addEventListener = function(element, eventType, handler, capture)
{
try
{
if (element.addEventListener)
element.addEventListener(eventType, handler, capture);
else if (element.attachEvent)
element.attachEvent("on" + eventType, handler);
}
catch (e){}
};

Spry.Widget.TabbedPanels.prototype.cancelEvent = function(e)
{
if (e.preventDefault)e.preventDefault();
else e.returnValue = false;
if (e.stopPropagation)e.stopPropagation();
else e.cancelBubble = true;

return false;
};

Spry.Widget.TabbedPanels.prototype.onTabClick = function(e, tab)
{
this.showPanel(tab);
return this.cancelEvent(e);
};

Spry.Widget.TabbedPanels.prototype.onTabMouseOver = function(e, tab)
{
this.addClassName(tab, this.tabHoverClass);
return false;
};

Spry.Widget.TabbedPanels.prototype.onTabMouseOut = function(e, tab)
{
this.removeClassName(tab, this.tabHoverClass);
return false;
};

Spry.Widget.TabbedPanels.prototype.onTabFocus = function(e, tab)
{
this.hasFocus = true;
this.addClassName(tab, this.tabFocusedClass);
return false;
};

Spry.Widget.TabbedPanels.prototype.onTabBlur = function(e, tab)
{
this.hasFocus = false;
this.removeClassName(tab, this.tabFocusedClass);
return false;
};

Spry.Widget.TabbedPanels.KEY_UP = 38;
Spry.Widget.TabbedPanels.KEY_DOWN = 40;
Spry.Widget.TabbedPanels.KEY_LEFT = 37;
Spry.Widget.TabbedPanels.KEY_RIGHT = 39;



Spry.Widget.TabbedPanels.prototype.onTabKeyDown = function(e, tab)
{
var key = e.keyCode;
if (!this.hasFocus || (key != this.previousPanelKeyCode && key != this.nextPanelKeyCode))
return true;

var tabs = this.getTabs();
for (var i =0; i < tabs.length; i++)
if (tabs[i] == tab)
{
var el = false;
if (key == this.previousPanelKeyCode && i > 0)
el = tabs[i-1];
else if (key == this.nextPanelKeyCode && i < tabs.length-1)
el = tabs[i+1];

if (el)
{
this.showPanel(el);
el.focus();
break;
}
}

return this.cancelEvent(e);
};

Spry.Widget.TabbedPanels.prototype.preorderTraversal = function(root, func)
{
var stopTraversal = false;
if (root)
{
stopTraversal = func(root);
if (root.hasChildNodes())
{
var child = root.firstChild;
while (!stopTraversal && child)
{
stopTraversal = this.preorderTraversal(child, func);
try { child = child.nextSibling; } catch (e){ child = null; }
}
}
}
return stopTraversal;
};

Spry.Widget.TabbedPanels.prototype.addPanelEventListeners = function(tab, panel)
{
var self = this;

if(tab.id != 'go_to_deals')
{
Spry.Widget.TabbedPanels.addEventListener(tab, "click", function(e){ return self.onTabClick(e, tab); }, false);
}
Spry.Widget.TabbedPanels.addEventListener(tab, "mouseover", function(e){ return self.onTabMouseOver(e, tab); }, false);
Spry.Widget.TabbedPanels.addEventListener(tab, "mouseout", function(e){ return self.onTabMouseOut(e, tab); }, false);

if (this.enableKeyboardNavigation)
{







var tabIndexEle = null;
var tabAnchorEle = null;

this.preorderTraversal(tab, function(node){
if (node.nodeType == 1)
{
var tabIndexAttr = tab.attributes.getNamedItem("tabindex");
if (tabIndexAttr)
{
tabIndexEle = node;
return true;
}
if (!tabAnchorEle && node.nodeName.toLowerCase()== "a")
tabAnchorEle = node;
}
return false;
});

if (tabIndexEle)
this.focusElement = tabIndexEle;
else if (tabAnchorEle)
this.focusElement = tabAnchorEle;

if (this.focusElement)
{
Spry.Widget.TabbedPanels.addEventListener(this.focusElement, "focus", function(e){ return self.onTabFocus(e, tab); }, false);
Spry.Widget.TabbedPanels.addEventListener(this.focusElement, "blur", function(e){ return self.onTabBlur(e, tab); }, false);
Spry.Widget.TabbedPanels.addEventListener(this.focusElement, "keydown", function(e){ return self.onTabKeyDown(e, tab); }, false);
}
}
};

Spry.Widget.TabbedPanels.prototype.showPanel = function(elementOrIndex)
{
var tpIndex = -1;

if (typeof elementOrIndex == "number")
tpIndex = elementOrIndex;
else 
tpIndex = this.getTabIndex(elementOrIndex);

if (!tpIndex < 0 || tpIndex >= this.getTabbedPanelCount())
return;

var tabs = this.getTabs();
var panels = this.getContentPanels();

var numTabbedPanels = Math.max(tabs.length, panels.length);

for (var i = 0; i < numTabbedPanels; i++)
{
if (i != tpIndex)
{
if (tabs[i])
this.removeClassName(tabs[i], this.tabSelectedClass);
if (panels[i])
{
this.removeClassName(panels[i], this.panelVisibleClass);
panels[i].style.display = "none";
}
}
}

this.addClassName(tabs[tpIndex], this.tabSelectedClass);
this.addClassName(panels[tpIndex], this.panelVisibleClass);

if(panels[tpIndex])
panels[tpIndex].style.display = "block";

this.currentTabIndex = tpIndex;
};

Spry.Widget.TabbedPanels.prototype.attachBehaviors = function(element)
{
var tabs = this.getTabs();
var panels = this.getContentPanels();
var panelCount = this.getTabbedPanelCount();

for (var i = 0; i < panelCount; i++)
this.addPanelEventListeners(tabs[i], panels[i]);

this.showPanel(this.defaultTab);
};


(function(c,j){function k(a){return!c(a).parents().andSelf().filter(function(){return c.curCSS(this,"visibility")==="hidden"||c.expr.filters.hidden(this)}).length}c.ui=c.ui||{};if(!c.ui.version){c.extend(c.ui,{version:"1.8.10",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,
NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});c.fn.extend({_focus:c.fn.focus,focus:function(a,b){return typeof a==="number"?this.each(function(){var d=this;setTimeout(function(){c(d).focus();b&&b.call(d)},a)}):this._focus.apply(this,arguments)},scrollParent:function(){var a;a=c.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(c.curCSS(this,
"position",1))&&/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!a.length?c(document):a},zIndex:function(a){if(a!==j)return this.css("zIndex",a);if(this.length){a=c(this[0]);for(var b;a.length&&a[0]!==document;){b=a.css("position");
if(b==="absolute"||b==="relative"||b==="fixed"){b=parseInt(a.css("zIndex"),10);if(!isNaN(b)&&b!==0)return b}a=a.parent()}}return 0},disableSelection:function(){return this.bind((c.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});c.each(["Width","Height"],function(a,b){function d(f,g,l,m){c.each(e,function(){g-=parseFloat(c.curCSS(f,"padding"+this,true))||0;if(l)g-=parseFloat(c.curCSS(f,
"border"+this+"Width",true))||0;if(m)g-=parseFloat(c.curCSS(f,"margin"+this,true))||0});return g}var e=b==="Width"?["Left","Right"]:["Top","Bottom"],h=b.toLowerCase(),i={innerWidth:c.fn.innerWidth,innerHeight:c.fn.innerHeight,outerWidth:c.fn.outerWidth,outerHeight:c.fn.outerHeight};c.fn["inner"+b]=function(f){if(f===j)return i["inner"+b].call(this);return this.each(function(){c(this).css(h,d(this,f)+"px")})};c.fn["outer"+b]=function(f,g){if(typeof f!=="number")return i["outer"+b].call(this,f);return this.each(function(){c(this).css(h,
d(this,f,true,g)+"px")})}});c.extend(c.expr[":"],{data:function(a,b,d){return!!c.data(a,d[3])},focusable:function(a){var b=a.nodeName.toLowerCase(),d=c.attr(a,"tabindex");if("area"===b){b=a.parentNode;d=b.name;if(!a.href||!d||b.nodeName.toLowerCase()!=="map")return false;a=c("img[usemap=#"+d+"]")[0];return!!a&&k(a)}return(/input|select|textarea|button|object/.test(b)?!a.disabled:"a"==b?a.href||!isNaN(d):!isNaN(d))&&k(a)},tabbable:function(a){var b=c.attr(a,"tabindex");return(isNaN(b)||b>=0)&&c(a).is(":focusable")}});
c(function(){var a=document.body,b=a.appendChild(b=document.createElement("div"));c.extend(b.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});c.support.minHeight=b.offsetHeight===100;c.support.selectstart="onselectstart"in b;a.removeChild(b).style.display="none"});c.extend(c.ui,{plugin:{add:function(a,b,d){a=c.ui[a].prototype;for(var e in d){a.plugins[e]=a.plugins[e]||[];a.plugins[e].push([b,d[e]])}},call:function(a,b,d){if((b=a.plugins[b])&&a.element[0].parentNode)for(var e=0;e<b.length;e++)a.options[b[e][0]]&&
b[e][1].apply(a.element,d)}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b)},hasScroll:function(a,b){if(c(a).css("overflow")==="hidden")return false;b=b&&b==="left"?"scrollLeft":"scrollTop";var d=false;if(a[b]>0)return true;a[b]=1;d=a[b]>0;a[b]=0;return d},isOverAxis:function(a,b,d){return a>b&&a<b+d},isOver:function(a,b,d,e,h,i){return c.ui.isOverAxis(a,d,h)&&c.ui.isOverAxis(b,e,i)}})}})(jQuery);

(function(b,j){if(b.cleanData){var k=b.cleanData;b.cleanData=function(a){for(var c=0,d;(d=a[c])!=null;c++)b(d).triggerHandler("remove");k(a)}}else{var l=b.fn.remove;b.fn.remove=function(a,c){return this.each(function(){if(!c)if(!a||b.filter(a,[this]).length)b("*",this).add([this]).each(function(){b(this).triggerHandler("remove")});return l.call(b(this),a,c)})}}b.widget=function(a,c,d){var e=a.split(".")[0],f;a=a.split(".")[1];f=e+"-"+a;if(!d){d=c;c=b.Widget}b.expr[":"][f]=function(h){return!!b.data(h,
a)};b[e]=b[e]||{};b[e][a]=function(h,g){arguments.length&&this._createWidget(h,g)};c=new c;c.options=b.extend(true,{},c.options);b[e][a].prototype=b.extend(true,c,{namespace:e,widgetName:a,widgetEventPrefix:b[e][a].prototype.widgetEventPrefix||a,widgetBaseClass:f},d);b.widget.bridge(a,b[e][a])};b.widget.bridge=function(a,c){b.fn[a]=function(d){var e=typeof d==="string",f=Array.prototype.slice.call(arguments,1),h=this;d=!e&&f.length?b.extend.apply(null,[true,d].concat(f)):d;if(e&&d.charAt(0)==="_")return h;
e?this.each(function(){var g=b.data(this,a),i=g&&b.isFunction(g[d])?g[d].apply(g,f):g;if(i!==g&&i!==j){h=i;return false}}):this.each(function(){var g=b.data(this,a);g?g.option(d||{})._init():b.data(this,a,new c(d,this))});return h}};b.Widget=function(a,c){arguments.length&&this._createWidget(a,c)};b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(a,c){b.data(c,this.widgetName,this);this.element=b(c);this.options=b.extend(true,{},this.options,
this._getCreateOptions(),a);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){return b.metadata&&b.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},
widget:function(){return this.element},option:function(a,c){var d=a;if(arguments.length===0)return b.extend({},this.options);if(typeof a==="string"){if(c===j)return this.options[a];d={};d[a]=c}this._setOptions(d);return this},_setOptions:function(a){var c=this;b.each(a,function(d,e){c._setOption(d,e)});return this},_setOption:function(a,c){this.options[a]=c;if(a==="disabled")this.widget()[c?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",c);return this},
enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(a,c,d){var e=this.options[a];c=b.Event(c);c.type=(a===this.widgetEventPrefix?a:this.widgetEventPrefix+a).toLowerCase();d=d||{};if(c.originalEvent){a=b.event.props.length;for(var f;a;){f=b.event.props[--a];c[f]=c.originalEvent[f]}}this.element.trigger(c,d);return!(b.isFunction(e)&&e.call(this.element[0],c,d)===false||c.isDefaultPrevented())}}})(jQuery);
(function ($, undefined){

$.extend($.ui, { timepicker: { version: "0.0.8"} });

var PROP_NAME = 'timepicker';
var tpuuid = new Date().getTime();



function Timepicker(){
this.debug = true; 
this._curInst = null; 
this._isInline = false; 
this._disabledInputs = []; 
this._timepickerShowing = false; 
this._inDialog = false; 
this._dialogClass = 'ui-timepicker-dialog'; 
this._mainDivId = 'ui-timepicker-div'; 
this._inlineClass = 'ui-timepicker-inline'; 
this._currentClass = 'ui-timepicker-current'; 
this._dayOverClass = 'ui-timepicker-days-cell-over'; 

this.regional = []; 
this.regional[''] = { 
hourText: 'Hour', 
minuteText: 'Minute', 
amPmText: ['AM', 'PM'] 
};
this._defaults = { 
showOn: 'focus',

showAnim: 'fadeIn', 
showOptions: {},
appendText: '', 
onSelect: null, 
onClose: null,
timeSeparator: ':', 
showPeriod: false,
showLeadingZero: true,
showMinutesLeadingZero: true, 
altField: '', 
defaultTime: '',


onHourShow: null,
onMinuteShow: null
};
$.extend(this._defaults, this.regional['']);

this.tpDiv = $('<div id="' + this._mainDivId + '" class="ui-timepicker ui-widget ui-helper-clearfix ui-corner-all " style="display: none"></div>');
}

$.extend(Timepicker.prototype, {

markerClassName: 'hasTimepicker',


log: function (){
if (this.debug)
console.log.apply('', arguments);
},


_widgetTimepicker: function (){
return this.tpDiv;
},


setDefaults: function (settings){
extendRemove(this._defaults, settings || {});
return this;
},


_attachTimepicker: function (target, settings){

var inlineSettings = null;
for (var attrName in this._defaults){
var attrValue = target.getAttribute('time:' + attrName);
if (attrValue){
inlineSettings = inlineSettings || {};
try {
inlineSettings[attrName] = eval(attrValue);
} catch (err){
inlineSettings[attrName] = attrValue;
}
}
}
var nodeName = target.nodeName.toLowerCase();
var inline = (nodeName == 'div' || nodeName == 'span');

if (!target.id){
this.uuid += 1;
target.id = 'tp' + this.uuid;
}
var inst = this._newInst($(target), inline);
inst.settings = $.extend({}, settings || {}, inlineSettings || {});
if (nodeName == 'input'){
this._connectTimepicker(target, inst);
} else if (inline){
this._inlineTimepicker(target, inst);
}
},


_newInst: function (target, inline){
var id = target[0].id.replace(/([^A-Za-z0-9_-])/g, '\\\\$1'); 
return { id: id, input: target, 
selectedDay: 0, selectedMonth: 0, selectedYear: 0, 
drawMonth: 0, drawYear: 0, 
inline: inline, 
tpDiv: (!inline ? this.tpDiv : 
$('<div class="' + this._inlineClass + ' ui-timepicker ui-widgetui-helper-clearfix"></div>'))
};
},


_connectTimepicker: function (target, inst){
var input = $(target);
inst.append = $([]);
inst.trigger = $([]);
if (input.hasClass(this.markerClassName)){ return; }
this._attachments(input, inst);
input.addClass(this.markerClassName).
keydown(this._doKeyDown).
keyup(this._doKeyUp).
bind("setData.timepicker", function (event, key, value){
inst.settings[key] = value;
}).
bind("getData.timepicker", function (event, key){
return this._get(inst, key);
});

$.data(target, PROP_NAME, inst);
},


_doKeyDown: function (event){
var inst = $.timepicker._getInst(event.target);
var handled = true;
inst._keyEvent = true;
if ($.timepicker._timepickerShowing){
switch (event.keyCode){
case 9: $.timepicker._hideTimepicker();
handled = false;
break; 
case 27: $.timepicker._hideTimepicker();
break; 
default: handled = false;
}
}
else if (event.keyCode == 36 && event.ctrlKey){ 
$.timepicker._showTimepicker(this);
}
else {
handled = false;
}
if (handled){
event.preventDefault();
event.stopPropagation();
}
},



_doKeyUp: function (event){
var inst = $.timepicker._getInst(event.target);
$.timepicker._setTimeFromField(inst);
$.timepicker._updateTimepicker(inst);
},


_attachments: function (input, inst){
var appendText = this._get(inst, 'appendText');
var isRTL = this._get(inst, 'isRTL');
if (inst.append){ inst.append.remove(); }
if (appendText){
inst.append = $('<span class="' + this._appendClass + '">' + appendText + '</span>');
input[isRTL ? 'before' : 'after'](inst.append);
}
input.unbind('focus', this._showTimepicker);
if (inst.trigger){ inst.trigger.remove(); }
var showOn = this._get(inst, 'showOn');
if (showOn == 'focus' || showOn == 'both'){ 
input.focus(this._showTimepicker);
}
if (showOn == 'button' || showOn == 'both'){ 
var buttonText = this._get(inst, 'buttonText');
var buttonImage = this._get(inst, 'buttonImage');
inst.trigger = $(this._get(inst, 'buttonImageOnly')?
$('<img/>').addClass(this._triggerClass).
attr({ src: buttonImage, alt: buttonText, title: buttonText }):
$('<button type="button"></button>').addClass(this._triggerClass).
html(buttonImage == '' ? buttonText : $('<img/>').attr(
{ src: buttonImage, alt: buttonText, title: buttonText })));
input[isRTL ? 'before' : 'after'](inst.trigger);
inst.trigger.click(function (){
if ($.timepicker._timepickerShowing && $.timepicker._lastInput == input[0]){ $.timepicker._hideTimepicker(); }
else { $.timepicker._showTimepicker(input[0]); }
return false;
});
}
},



_inlineTimepicker: function(target, inst){
var divSpan = $(target);
if (divSpan.hasClass(this.markerClassName))
return;
divSpan.addClass(this.markerClassName).append(inst.tpDiv).
bind("setData.timepicker", function(event, key, value){
inst.settings[key] = value;
}).bind("getData.timepicker", function(event, key){
return this._get(inst, key);
});
$.data(target, PROP_NAME, inst);

this._setTimeFromField(inst);
this._updateTimepicker(inst);
inst.tpDiv.show();
},


_showTimepicker: function (input){


input = input.target || input;
if (input.nodeName.toLowerCase()!= 'input'){ input = $('input', input.parentNode)[0]; } 
if ($.timepicker._isDisabledTimepicker(input)|| $.timepicker._lastInput == input){ return; } 


$.timepicker._hideTimepicker();

var inst = $.timepicker._getInst(input);
if ($.timepicker._curInst && $.timepicker._curInst != inst){
$.timepicker._curInst.tpDiv.stop(true, true);
}
var beforeShow = $.timepicker._get(inst, 'beforeShow');
extendRemove(inst.settings, (beforeShow ? beforeShow.apply(input, [input, inst]): {}));
inst.lastVal = null;
$.timepicker._lastInput = input;

$.timepicker._setTimeFromField(inst);
if ($.timepicker._inDialog){ input.value = ''; } 
if (!$.timepicker._pos){ 
$.timepicker._pos = $.timepicker._findPos(input);
$.timepicker._pos[1] += input.offsetHeight; 
}
var isFixed = false;
$(input).parents().each(function (){
isFixed |= $(this).css('position')== 'fixed';
return !isFixed;
});
if (isFixed && $.browser.opera){ 
$.timepicker._pos[0] -= document.documentElement.scrollLeft;
$.timepicker._pos[1] -= document.documentElement.scrollTop;
}
var offset = { left: $.timepicker._pos[0], top: $.timepicker._pos[1] };
$.timepicker._pos = null;

inst.tpDiv.css({ position: 'absolute', display: 'block', top: '-1000px' });
$.timepicker._updateTimepicker(inst);


inst._hoursClicked = false;
inst._minutesClicked = false;



offset = $.timepicker._checkOffset(inst, offset, isFixed);
inst.tpDiv.css({ position: ($.timepicker._inDialog && $.blockUI ?
'static' : (isFixed ? 'fixed' : 'absolute')), display: 'none',
left: offset.left + 'px', top: offset.top + 'px'
});
if (!inst.inline){
var showAnim = $.timepicker._get(inst, 'showAnim');
var duration = $.timepicker._get(inst, 'duration');
var postProcess = function (){
$.timepicker._timepickerShowing = true;
var borders = $.timepicker._getBorders(inst.tpDiv);
inst.tpDiv.find('iframe.ui-timepicker-cover'). 
css({ left: -borders[0], top: -borders[1],
width: inst.tpDiv.outerWidth(), height: inst.tpDiv.outerHeight()
});
};
inst.tpDiv.zIndex($(input).zIndex()+ 1);
if ($.effects && $.effects[showAnim]){
inst.tpDiv.show(showAnim, $.timepicker._get(inst, 'showOptions'), duration, postProcess);
}
else {
inst.tpDiv[showAnim || 'show']((showAnim ? duration : null), postProcess);
}
if (!showAnim || !duration){ postProcess(); }
if (inst.input.is(':visible')&& !inst.input.is(':disabled')){ inst.input.focus(); }
$.timepicker._curInst = inst;
}
},


_updateTimepicker: function (inst){
var self = this;
var borders = $.timepicker._getBorders(inst.tpDiv);
inst.tpDiv.empty().append(this._generateHTML(inst))
.find('iframe.ui-timepicker-cover')
.css({ left: -borders[0], top: -borders[1],
width: inst.tpDiv.outerWidth(), height: inst.tpDiv.outerHeight()
})
.end()
.find('.ui-timepicker td a')
.bind('mouseout', function (){
$(this).removeClass('ui-state-hover');
if (this.className.indexOf('ui-timepicker-prev')!= -1)$(this).removeClass('ui-timepicker-prev-hover');
if (this.className.indexOf('ui-timepicker-next')!= -1)$(this).removeClass('ui-timepicker-next-hover');
})
.bind('mouseover', function (){
if (!self._isDisabledTimepicker(inst.inline ? inst.tpDiv.parent()[0] : inst.input[0])){
$(this).parents('.ui-timepicker-calendar').find('a').removeClass('ui-state-hover');
$(this).addClass('ui-state-hover');
if (this.className.indexOf('ui-timepicker-prev')!= -1)$(this).addClass('ui-timepicker-prev-hover');
if (this.className.indexOf('ui-timepicker-next')!= -1)$(this).addClass('ui-timepicker-next-hover');
}
})
.end()
.find('.' + this._dayOverClass + ' a')
.trigger('mouseover')
.end();
},


_generateHTML: function (inst){
var h, m, html = '';
var showPeriod = (this._get(inst, 'showPeriod')== true);
var showLeadingZero = (this._get(inst, 'showLeadingZero')== true);

var amPmText = this._get(inst, 'amPmText');


html = '<table class="ui-timepicker-table ui-widget-content ui-corner-all"><tr>' +
 '<td class="ui-timepicker-hours">' +
 '<div class="ui-timepicker-title ui-widget-header ui-helper-clearfix ui-corner-all">' +
 this._get(inst, 'hourText')+ 
 '</div>' +
 '<table class="ui-timepicker">';


html += '<tr><th rowspan="2" class="periods">' + amPmText[0] + '</th>';
for (h = 0; h <= 5; h++){
html += this._generateHTMLHourCell(inst, h, showPeriod, showLeadingZero);
}

html += '</tr><tr>';
for (h = 6; h <= 11; h++){
html += this._generateHTMLHourCell(inst, h, showPeriod, showLeadingZero);
}


html += '</tr><tr><th rowspan="2" class="periods">' + amPmText[1] + '</th>';
for (h = 12; h <= 17; h++){
html += this._generateHTMLHourCell(inst, h, showPeriod, showLeadingZero);
}

html += '</tr><tr>';
for (h = 18; h <= 23; h++){
html += this._generateHTMLHourCell(inst, h, showPeriod, showLeadingZero);
}
html += '</tr></table>' + 
'</td>' + 
'<td class="ui-timepicker-minutes">';

html += this._generateHTMLMinutes(inst);

html += '</td></tr></table>';

return html;
},

 
_updateMinuteDisplay: function (inst){
var newHtml = this._generateHTMLMinutes(inst);
inst.tpDiv.find('td.ui-timepicker-minutes').html(newHtml);
},


_generateHTMLMinutes: function (inst){

var m;
var showMinutesLeadingZero = (this._get(inst, 'showMinutesLeadingZero')== true);
var onMinuteShow = this._get(inst, 'onMinuteShow');

if ( (onMinuteShow)){

if (onMinuteShow.apply((inst.input ? inst.input[0] : null), [inst.hours , inst.minutes])== false){

for (m = 0; m < 60; m += 5){
if (onMinuteShow.apply((inst.input ? inst.input[0] : null), [inst.hours, m])){
inst.minutes = m;
break;
}
}
}
}

var html = '' + 
 
 '<div class="ui-timepicker-title ui-widget-header ui-helper-clearfix ui-corner-all">' +
 this._get(inst, 'minuteText')+
 '</div>' +
 '<table class="ui-timepicker">' +
 '<tr>';
;

for (m = 0; m < 15; m += 5){
html += this._generateHTMLMinuteCell(inst, m, (m < 10)&& showMinutesLeadingZero ? "0" + m.toString(): m.toString());
}
html += '</tr><tr>';
for (m = 15; m < 30; m += 5){
html += this._generateHTMLMinuteCell(inst, m, m.toString());
}
html += '</tr><tr>';
for (m = 30; m < 45; m += 5){
html += this._generateHTMLMinuteCell(inst, m, m.toString());
}
html += '</tr><tr>';
for (m = 45; m < 60; m += 5){
html += this._generateHTMLMinuteCell(inst, m, m.toString());
}

html += '</tr></table>';

return html;
},


_generateHTMLHourCell: function (inst, hour, showPeriod, showLeadingZero){

var displayHour = hour;
if ((hour > 12)&& showPeriod){
displayHour = hour - 12;
}
if ((displayHour == 0)&& showPeriod){
displayHour = 12;
}
if ((displayHour < 10)&& showLeadingZero){
displayHour = '0' + displayHour;
}

var html = "";
var enabled = true;
var onHourShow = this._get(inst, 'onHourShow');
if (onHourShow){
enabled = onHourShow.apply((inst.input ? inst.input[0] : null), [hour]);
}

if (enabled){
html = '<td ' +
 'onclick="TP_jQuery_' + tpuuid + '.timepicker.selectHours(\'#' + inst.id + '\', ' + hour.toString()+ ', this); return false;" ' +
 'ondblclick="TP_jQuery_' + tpuuid + '.timepicker.selectHours(\'#' + inst.id + '\', ' + hour.toString()+ ', this, true); return false;" ' +
 '>' +
 '<a href="#" class="ui-state-default ' +
 (hour == inst.hours ? 'ui-state-active' : '')+
 '">' +
 displayHour.toString()+
 '</a></td>';
}
else {
html =
'<td>' +
'<span class="ui-state-default ui-state-disabled' +
(hour == inst.hours ? 'ui-state-active' : '')+
'">' +
displayHour.toString()+
'</span>' +
'</td>';
}
return html;
},


_generateHTMLMinuteCell: function (inst, minute, displayText){
 var html = "";
 var enabled = true;
 var onMinuteShow = this._get(inst, 'onMinuteShow');
 if (onMinuteShow){
 
 enabled = onMinuteShow.apply((inst.input ? inst.input[0] : null), [inst.hours,minute]);
 }

 if (enabled){
html = '<td ' +
 'onclick="TP_jQuery_' + tpuuid + '.timepicker.selectMinutes(\'#' + inst.id + '\', ' + minute.toString()+ ', this); return false;" ' +
 'ondblclick="TP_jQuery_' + tpuuid + '.timepicker.selectMinutes(\'#' + inst.id + '\', ' + minute.toString()+ ', this, true); return false;" ' +
 '>' +
 '<a href="#" class="ui-state-default ' +
 (minute == inst.minutes ? 'ui-state-active' : '')+
 '" >' +
 displayText +
 '</a></td>';
 }
 else {

html = '<td>' +
 '<span class="ui-state-default ui-state-disabled" >' +
 displayText +
 '</span>' +
 '</td>';
 }
 return html;
},


_isDisabledTimepicker: function (target){
if (!target){ return false; }
for (var i = 0; i < this._disabledInputs.length; i++){
if (this._disabledInputs[i] == target){ return true; }
}
return false;
},


_checkOffset: function (inst, offset, isFixed){
var tpWidth = inst.tpDiv.outerWidth();
var tpHeight = inst.tpDiv.outerHeight();
var inputWidth = inst.input ? inst.input.outerWidth(): 0;
var inputHeight = inst.input ? inst.input.outerHeight(): 0;
var viewWidth = document.documentElement.clientWidth + $(document).scrollLeft();
var viewHeight = document.documentElement.clientHeight + $(document).scrollTop();

offset.left -= (this._get(inst, 'isRTL')? (tpWidth - inputWidth): 0);
offset.left -= (isFixed && offset.left == inst.input.offset().left)? $(document).scrollLeft(): 0;
offset.top -= (isFixed && offset.top == (inst.input.offset().top + inputHeight))? $(document).scrollTop(): 0;


offset.left -= Math.min(offset.left, (offset.left + tpWidth > viewWidth && viewWidth > tpWidth)?
Math.abs(offset.left + tpWidth - viewWidth): 0);
offset.top -= Math.min(offset.top, (offset.top + tpHeight > viewHeight && viewHeight > tpHeight)?
Math.abs(tpHeight + inputHeight): 0);

return offset;
},


_findPos: function (obj){
var inst = this._getInst(obj);
var isRTL = this._get(inst, 'isRTL');
while (obj && (obj.type == 'hidden' || obj.nodeType != 1)){
obj = obj[isRTL ? 'previousSibling' : 'nextSibling'];
}
var position = $(obj).offset();
return [position.left, position.top];
},


_getBorders: function (elem){
var convert = function (value){
return { thin: 1, medium: 2, thick: 3}[value] || value;
};
return [parseFloat(convert(elem.css('border-left-width'))),
parseFloat(convert(elem.css('border-top-width')))];
},



_checkExternalClick: function (event){
if (!$.timepicker._curInst){ return; }
var $target = $(event.target);
if ($target[0].id != $.timepicker._mainDivId &&
$target.parents('#' + $.timepicker._mainDivId).length == 0 &&
!$target.hasClass($.timepicker.markerClassName)&&
!$target.hasClass($.timepicker._triggerClass)&&
$.timepicker._timepickerShowing && !($.timepicker._inDialog && $.blockUI))
$.timepicker._hideTimepicker();
},


_hideTimepicker: function (input){
var inst = this._curInst;
if (!inst || (input && inst != $.data(input, PROP_NAME))){ return; }
if (this._timepickerShowing){
var showAnim = this._get(inst, 'showAnim');
var duration = this._get(inst, 'duration');
var postProcess = function (){
$.timepicker._tidyDialog(inst);
this._curInst = null;
};
if ($.effects && $.effects[showAnim]){
inst.tpDiv.hide(showAnim, $.timepicker._get(inst, 'showOptions'), duration, postProcess);
}
else {
inst.tpDiv[(showAnim == 'slideDown' ? 'slideUp' :
(showAnim == 'fadeIn' ? 'fadeOut' : 'hide'))]((showAnim ? duration : null), postProcess);
}
if (!showAnim){ postProcess(); }
var onClose = this._get(inst, 'onClose');
if (onClose){
onClose.apply(
(inst.input ? inst.input[0] : null),
[(inst.input ? inst.input.val(): ''), inst]);
}
this._timepickerShowing = false;
this._lastInput = null;
if (this._inDialog){
this._dialogInput.css({ position: 'absolute', left: '0', top: '-100px' });
if ($.blockUI){
$.unblockUI();
$('body').append(this.tpDiv);
}
}
this._inDialog = false;
}
},


_tidyDialog: function (inst){
inst.tpDiv.removeClass(this._dialogClass).unbind('.ui-timepicker');
},


_getInst: function (target){
try {
return $.data(target, PROP_NAME);
}
catch (err){
throw 'Missing instance data for this timepicker';
}
},


_get: function (inst, name){
return inst.settings[name] !== undefined ?
inst.settings[name] : this._defaults[name];
},


_setTimeFromField: function (inst){
if (inst.input.val()== inst.lastVal){ return; }
var defaultTime = this._get(inst, 'defaultTime');


var timeToParse = this._getCurrentTimeRounded(inst);
if (defaultTime != ''){ timeToParse = defaultTime }
if ((inst.inline == false)&& (inst.input.val()!= '')){ timeToParse = inst.input.val()}

var timeVal = inst.lastVal = timeToParse;

var time = this.parseTime(inst, timeVal);
inst.hours = time.hours;
inst.minutes = time.minutes;

$.timepicker._updateTimepicker(inst);
},

_setTimeTimepicker: function(target, time){
var inst = this._getInst(target);
if (inst){
this._setTime(inst, time);
this._updateTimepicker(inst);
this._updateAlternate(inst);
}
},


_setTime: function(inst, time, noChange){
var clear = !time;
var origHours = inst.hours;
var origMinutes = inst.minutes;
var time = this.parseTime(inst, time);
inst.hours = time.hours;
inst.minutes = time.minutes;

if ((origHours != inst.hours || origMinutes != inst.minuts)&& !noChange){
inst.input.trigger('change');
}
this._updateTimepicker(inst);
this._updateSelectedValue(inst);
},


_getCurrentTimeRounded: function (inst){
var currentTime = new Date();
var timeSeparator = this._get(inst, 'timeSeparator');

var currentMinutes = currentTime.getMinutes();

currentMinutes = Math.round( currentMinutes / 5)* 5;

return currentTime.getHours().toString()+ timeSeparator + currentMinutes.toString();
},


parseTime: function (inst, timeVal){
var retVal = new Object();
retVal.hours = -1;
retVal.minutes = -1;

var timeSeparator = this._get(inst, 'timeSeparator');
var amPmText = this._get(inst, 'amPmText');
var p = timeVal.indexOf(timeSeparator);
if (p == -1){ return retVal; }

retVal.hours = parseInt(timeVal.substr(0, p), 10);
retVal.minutes = parseInt(timeVal.substr(p + 1), 10);

var showPeriod = (this._get(inst, 'showPeriod')== true);
var timeValUpper = timeVal.toUpperCase();
if ((retVal.hours < 12)&& (showPeriod)&& (timeValUpper.indexOf(amPmText[1].toUpperCase())!= -1)){
retVal.hours += 12;
}

if ((retVal.hours == 12)&& (showPeriod)&& (timeValUpper.indexOf(amPmText[0].toUpperCase())!= -1)){
retVal.hours = 0;
}

return retVal;
},



selectHours: function (id, newHours, td, fromDoubleClick){
var target = $(id);
var inst = this._getInst(target[0]);
$(td).parents('.ui-timepicker-hours:first').find('a').removeClass('ui-state-active');

$(td).children('a').addClass('ui-state-active');

inst.hours = newHours;
this._updateSelectedValue(inst);

inst._hoursClicked = true;
if ((inst._minutesClicked)|| (fromDoubleClick)){
$.timepicker._hideTimepicker();
return;
}

var onMinuteShow = this._get(inst, 'onMinuteShow');
if (onMinuteShow){ this._updateMinuteDisplay(inst); }
},

selectMinutes: function (id, newMinutes, td, fromDoubleClick){
var target = $(id);
var inst = this._getInst(target[0]);
$(td).parents('.ui-timepicker-minutes:first').find('a').removeClass('ui-state-active');
$(td).children('a').addClass('ui-state-active');

inst.minutes = newMinutes;
this._updateSelectedValue(inst);

inst._minutesClicked = true;
if ((inst._hoursClicked)|| (fromDoubleClick)){ $.timepicker._hideTimepicker(); }
},

_updateSelectedValue: function (inst){
if ((inst.hours < 0)|| (inst.hours > 23)){ inst.hours = 12; }
if ((inst.minutes < 0)|| (inst.minutes > 59)){ inst.minutes = 0; }

var period = "";
var showPeriod = (this._get(inst, 'showPeriod')== true);
var showLeadingZero = (this._get(inst, 'showLeadingZero')== true);
var amPmText = this._get(inst, 'amPmText');
var selectedHours = inst.hours ? inst.hours : 0;
var selectedMinutes = inst.minutes ? inst.minutes : 0;

var displayHours = selectedHours;
if ( ! displayHours){
displayHoyrs = 0;
}


if (showPeriod){
if (inst.hours == 0){
displayHours = 12;
}
if (inst.hours < 12){
period = amPmText[0];
}
else {
period = amPmText[1];
if (displayHours > 12){
displayHours -= 12;
}
}
}

var h = displayHours.toString();
if (showLeadingZero && (displayHours < 10)){ h = '0' + h; }


var m = selectedMinutes.toString();
if (selectedMinutes < 10){ m = '0' + m; }

var newTime = h + this._get(inst, 'timeSeparator')+ m;
if (period.length > 0){ newTime += " " + period; }

if (inst.input){
inst.input.val(newTime);
inst.input.trigger('change');
}

var onSelect = this._get(inst, 'onSelect');
if (onSelect){ onSelect.apply((inst.input ? inst.input[0] : null), [newTime, inst]); } 

this._updateAlternate(inst, newTime);

return newTime;
},


_updateAlternate: function(inst, newTime){
var altField = this._get(inst, 'altField');
if (altField){ 
$(altField).each(function(){ $(this).val(newTime); });
}
}
});




$.fn.timepicker = function (options){


if (!$.timepicker.initialized){
$(document).mousedown($.timepicker._checkExternalClick).
find('body').append($.timepicker.tpDiv);
$.timepicker.initialized = true;
}

var otherArgs = Array.prototype.slice.call(arguments, 1);
if (typeof options == 'string' && (options == 'isDisabled' || options == 'getTime' || options == 'widget'))
return $.timepicker['_' + options + 'Datepicker'].
apply($.timepicker, [this[0]].concat(otherArgs));
if (options == 'option' && arguments.length == 2 && typeof arguments[1] == 'string')
return $.timepicker['_' + options + 'Datepicker'].
apply($.timepicker, [this[0]].concat(otherArgs));
return this.each(function (){
typeof options == 'string' ?
$.timepicker['_' + options + 'Timepicker'].
apply($.timepicker, [this].concat(otherArgs)):
$.timepicker._attachTimepicker(this, options);
});
};


function extendRemove(target, props){
$.extend(target, props);
for (var name in props)
if (props[name] == null || props[name] == undefined)
target[name] = props[name];
return target;
};

$.timepicker = new Timepicker(); 
$.timepicker.initialized = false;
$.timepicker.uuid = new Date().getTime();
$.timepicker.version = "1.8.6";



window['TP_jQuery_' + tpuuid] = $;

})(jQuery);


(function(d,p){function u(){return++v}function w(){return++x}var v=0,x=0;d.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:false,cookie:null,collapsible:false,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"<div></div>",remove:null,select:null,show:null,spinner:"<em>Loading&#8230;</em>",tabTemplate:"<li><a href='#{href}'><span>#{label}</span></a></li>"},_create:function(){this._tabify(true)},_setOption:function(b,e){if(b=="selected")this.options.collapsible&&
e==this.options.selected||this.select(e);else{this.options[b]=e;this._tabify()}},_tabId:function(b){return b.title&&b.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+u()},_sanitizeSelector:function(b){return b.replace(/:/g,"\\:")},_cookie:function(){var b=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+w());return d.cookie.apply(null,[b].concat(d.makeArray(arguments)))},_ui:function(b,e){return{tab:b,panel:e,index:this.anchors.index(b)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var b=
d(this);b.html(b.data("label.tabs")).removeData("label.tabs")})},_tabify:function(b){function e(g,f){g.css("display","");!d.support.opacity&&f.opacity&&g[0].style.removeAttribute("filter")}var a=this,c=this.options,h=/^#.+/;this.list=this.element.find("ol,ul").eq(0);this.lis=d(" > li:has(a[href])",this.list);this.anchors=this.lis.map(function(){return d("a",this)[0]});this.panels=d([]);this.anchors.each(function(g,f){var i=d(f).attr("href"),l=i.split("#")[0],q;if(l&&(l===location.toString().split("#")[0]||
(q=d("base")[0])&&l===q.href)){i=f.hash;f.href=i}if(h.test(i))a.panels=a.panels.add(a.element.find(a._sanitizeSelector(i)));else if(i&&i!=="#"){d.data(f,"href.tabs",i);d.data(f,"load.tabs",i.replace(/#.*$/,""));i=a._tabId(f);f.href="#"+i;f=a.element.find("#"+i);if(!f.length){f=d(c.panelTemplate).attr("id",i).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(a.panels[g-1]||a.list);f.data("destroy.tabs",true)}a.panels=a.panels.add(f)}else c.disabled.push(g)});if(b){this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all");
this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.lis.addClass("ui-state-default ui-corner-top");this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom");if(c.selected===p){location.hash&&this.anchors.each(function(g,f){if(f.hash==location.hash){c.selected=g;return false}});if(typeof c.selected!=="number"&&c.cookie)c.selected=parseInt(a._cookie(),10);if(typeof c.selected!=="number"&&this.lis.filter(".ui-tabs-selected").length)c.selected=
this.lis.index(this.lis.filter(".ui-tabs-selected"));c.selected=c.selected||(this.lis.length?0:-1)}else if(c.selected===null)c.selected=-1;c.selected=c.selected>=0&&this.anchors[c.selected]||c.selected<0?c.selected:0;c.disabled=d.unique(c.disabled.concat(d.map(this.lis.filter(".ui-state-disabled"),function(g){return a.lis.index(g)}))).sort();d.inArray(c.selected,c.disabled)!=-1&&c.disabled.splice(d.inArray(c.selected,c.disabled),1);this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active");
if(c.selected>=0&&this.anchors.length){a.element.find(a._sanitizeSelector(a.anchors[c.selected].hash)).removeClass("ui-tabs-hide");this.lis.eq(c.selected).addClass("ui-tabs-selected ui-state-active");a.element.queue("tabs",function(){a._trigger("show",null,a._ui(a.anchors[c.selected],a.element.find(a._sanitizeSelector(a.anchors[c.selected].hash))[0]))});this.load(c.selected)}d(window).bind("unload",function(){a.lis.add(a.anchors).unbind(".tabs");a.lis=a.anchors=a.panels=null})}else c.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"));
this.element[c.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible");c.cookie&&this._cookie(c.selected,c.cookie);b=0;for(var j;j=this.lis[b];b++)d(j)[d.inArray(b,c.disabled)!=-1&&!d(j).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled");c.cache===false&&this.anchors.removeData("cache.tabs");this.lis.add(this.anchors).unbind(".tabs");if(c.event!=="mouseover"){var k=function(g,f){f.is(":not(.ui-state-disabled)")&&f.addClass("ui-state-"+g)},n=function(g,f){f.removeClass("ui-state-"+
g)};this.lis.bind("mouseover.tabs",function(){k("hover",d(this))});this.lis.bind("mouseout.tabs",function(){n("hover",d(this))});this.anchors.bind("focus.tabs",function(){k("focus",d(this).closest("li"))});this.anchors.bind("blur.tabs",function(){n("focus",d(this).closest("li"))})}var m,o;if(c.fx)if(d.isArray(c.fx)){m=c.fx[0];o=c.fx[1]}else m=o=c.fx;var r=o?function(g,f){d(g).closest("li").addClass("ui-tabs-selected ui-state-active");f.hide().removeClass("ui-tabs-hide").animate(o,o.duration||"normal",
function(){e(f,o);a._trigger("show",null,a._ui(g,f[0]))})}:function(g,f){d(g).closest("li").addClass("ui-tabs-selected ui-state-active");f.removeClass("ui-tabs-hide");a._trigger("show",null,a._ui(g,f[0]))},s=m?function(g,f){f.animate(m,m.duration||"normal",function(){a.lis.removeClass("ui-tabs-selected ui-state-active");f.addClass("ui-tabs-hide");e(f,m);a.element.dequeue("tabs")})}:function(g,f){a.lis.removeClass("ui-tabs-selected ui-state-active");f.addClass("ui-tabs-hide");a.element.dequeue("tabs")};
this.anchors.bind(c.event+".tabs",function(){var g=this,f=d(g).closest("li"),i=a.panels.filter(":not(.ui-tabs-hide)"),l=a.element.find(a._sanitizeSelector(g.hash));if(f.hasClass("ui-tabs-selected")&&!c.collapsible||f.hasClass("ui-state-disabled")||f.hasClass("ui-state-processing")||a.panels.filter(":animated").length||a._trigger("select",null,a._ui(this,l[0]))===false){this.blur();return false}c.selected=a.anchors.index(this);a.abort();if(c.collapsible)if(f.hasClass("ui-tabs-selected")){c.selected=
-1;c.cookie&&a._cookie(c.selected,c.cookie);a.element.queue("tabs",function(){s(g,i)}).dequeue("tabs");this.blur();return false}else if(!i.length){c.cookie&&a._cookie(c.selected,c.cookie);a.element.queue("tabs",function(){r(g,l)});a.load(a.anchors.index(this));this.blur();return false}c.cookie&&a._cookie(c.selected,c.cookie);if(l.length){i.length&&a.element.queue("tabs",function(){s(g,i)});a.element.queue("tabs",function(){r(g,l)});a.load(a.anchors.index(this))}else throw"jQuery UI Tabs: Mismatching fragment identifier.";
d.browser.msie&&this.blur()});this.anchors.bind("click.tabs",function(){return false})},_getIndex:function(b){if(typeof b=="string")b=this.anchors.index(this.anchors.filter("[href$="+b+"]"));return b},destroy:function(){var b=this.options;this.abort();this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs");this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.anchors.each(function(){var e=
d.data(this,"href.tabs");if(e)this.href=e;var a=d(this).unbind(".tabs");d.each(["href","load","cache"],function(c,h){a.removeData(h+".tabs")})});this.lis.unbind(".tabs").add(this.panels).each(function(){d.data(this,"destroy.tabs")?d(this).remove():d(this).removeClass("ui-state-default ui-corner-top ui-tabs-selected ui-state-active ui-state-hover ui-state-focus ui-state-disabled ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide")});b.cookie&&this._cookie(null,b.cookie);return this},add:function(b,
e,a){if(a===p)a=this.anchors.length;var c=this,h=this.options;e=d(h.tabTemplate.replace(/#\{href\}/g,b).replace(/#\{label\}/g,e));b=!b.indexOf("#")?b.replace("#",""):this._tabId(d("a",e)[0]);e.addClass("ui-state-default ui-corner-top").data("destroy.tabs",true);var j=c.element.find("#"+b);j.length||(j=d(h.panelTemplate).attr("id",b).data("destroy.tabs",true));j.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(a>=this.lis.length){e.appendTo(this.list);j.appendTo(this.list[0].parentNode)}else{e.insertBefore(this.lis[a]);
j.insertBefore(this.panels[a])}h.disabled=d.map(h.disabled,function(k){return k>=a?++k:k});this._tabify();if(this.anchors.length==1){h.selected=0;e.addClass("ui-tabs-selected ui-state-active");j.removeClass("ui-tabs-hide");this.element.queue("tabs",function(){c._trigger("show",null,c._ui(c.anchors[0],c.panels[0]))});this.load(0)}this._trigger("add",null,this._ui(this.anchors[a],this.panels[a]));return this},remove:function(b){b=this._getIndex(b);var e=this.options,a=this.lis.eq(b).remove(),c=this.panels.eq(b).remove();
if(a.hasClass("ui-tabs-selected")&&this.anchors.length>1)this.select(b+(b+1<this.anchors.length?1:-1));e.disabled=d.map(d.grep(e.disabled,function(h){return h!=b}),function(h){return h>=b?--h:h});this._tabify();this._trigger("remove",null,this._ui(a.find("a")[0],c[0]));return this},enable:function(b){b=this._getIndex(b);var e=this.options;if(d.inArray(b,e.disabled)!=-1){this.lis.eq(b).removeClass("ui-state-disabled");e.disabled=d.grep(e.disabled,function(a){return a!=b});this._trigger("enable",null,
this._ui(this.anchors[b],this.panels[b]));return this}},disable:function(b){b=this._getIndex(b);var e=this.options;if(b!=e.selected){this.lis.eq(b).addClass("ui-state-disabled");e.disabled.push(b);e.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[b],this.panels[b]))}return this},select:function(b){b=this._getIndex(b);if(b==-1)if(this.options.collapsible&&this.options.selected!=-1)b=this.options.selected;else return this;this.anchors.eq(b).trigger(this.options.event+".tabs");return this},
load:function(b){b=this._getIndex(b);var e=this,a=this.options,c=this.anchors.eq(b)[0],h=d.data(c,"load.tabs");this.abort();if(!h||this.element.queue("tabs").length!==0&&d.data(c,"cache.tabs"))this.element.dequeue("tabs");else{this.lis.eq(b).addClass("ui-state-processing");if(a.spinner){var j=d("span",c);j.data("label.tabs",j.html()).html(a.spinner)}this.xhr=d.ajax(d.extend({},a.ajaxOptions,{url:h,success:function(k,n){e.element.find(e._sanitizeSelector(c.hash)).html(k);e._cleanup();a.cache&&d.data(c,
"cache.tabs",true);e._trigger("load",null,e._ui(e.anchors[b],e.panels[b]));try{a.ajaxOptions.success(k,n)}catch(m){}},error:function(k,n){e._cleanup();e._trigger("load",null,e._ui(e.anchors[b],e.panels[b]));try{a.ajaxOptions.error(k,n,b,c)}catch(m){}}}));e.element.dequeue("tabs");return this}},abort:function(){this.element.queue([]);this.panels.stop(false,true);this.element.queue("tabs",this.element.queue("tabs").splice(-2,2));if(this.xhr){this.xhr.abort();delete this.xhr}this._cleanup();return this},
url:function(b,e){this.anchors.eq(b).removeData("cache.tabs").data("load.tabs",e);return this},length:function(){return this.anchors.length}});d.extend(d.ui.tabs,{version:"1.8.10"});d.extend(d.ui.tabs.prototype,{rotation:null,rotate:function(b,e){var a=this,c=this.options,h=a._rotate||(a._rotate=function(j){clearTimeout(a.rotation);a.rotation=setTimeout(function(){var k=c.selected;a.select(++k<a.anchors.length?k:0)},b);j&&j.stopPropagation()});e=a._unrotate||(a._unrotate=!e?function(j){j.clientX&&
a.rotate(null)}:function(){t=c.selected;h()});if(b){this.element.bind("tabsshow",h);this.anchors.bind(c.event+".tabs",e);h()}else{clearTimeout(a.rotation);this.element.unbind("tabsshow",h);this.anchors.unbind(c.event+".tabs",e);delete this._rotate;delete this._unrotate}return this}})})(jQuery);

(function(d,G){function K(){this.debug=false;this._curInst=null;this._keyEvent=false;this._disabledInputs=[];this._inDialog=this._datepickerShowing=false;this._mainDivId="ui-datepicker-div";this._inlineClass="ui-datepicker-inline";this._appendClass="ui-datepicker-append";this._triggerClass="ui-datepicker-trigger";this._dialogClass="ui-datepicker-dialog";this._disableClass="ui-datepicker-disabled";this._unselectableClass="ui-datepicker-unselectable";this._currentClass="ui-datepicker-current-day";this._dayOverClass=
"ui-datepicker-days-cell-over";this.regional=[];this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su",
"Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:false,showMonthAfterYear:false,yearSuffix:""};this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:false,hideIfNoPrevNext:false,navigationAsDateFormat:false,gotoCurrent:false,changeMonth:false,changeYear:false,yearRange:"c-10:c+10",showOtherMonths:false,selectOtherMonths:false,showWeek:false,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",
minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:true,showButtonPanel:false,autoSize:false};d.extend(this._defaults,this.regional[""]);this.dpDiv=d('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>')}function E(a,b){d.extend(a,b);for(var c in b)if(b[c]==
null||b[c]==G)a[c]=b[c];return a}d.extend(d.ui,{datepicker:{version:"1.8.10"}});var y=(new Date).getTime();d.extend(K.prototype,{markerClassName:"hasDatepicker",log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(a){E(this._defaults,a||{});return this},_attachDatepicker:function(a,b){var c=null;for(var e in this._defaults){var f=a.getAttribute("date:"+e);if(f){c=c||{};try{c[e]=eval(f)}catch(h){c[e]=f}}}e=a.nodeName.toLowerCase();
f=e=="div"||e=="span";if(!a.id){this.uuid+=1;a.id="dp"+this.uuid}var i=this._newInst(d(a),f);i.settings=d.extend({},b||{},c||{});if(e=="input")this._connectDatepicker(a,i);else f&&this._inlineDatepicker(a,i)},_newInst:function(a,b){return{id:a[0].id.replace(/([^A-Za-z0-9_-])/g,"\\\\$1"),input:a,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:b,dpDiv:!b?this.dpDiv:d('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>')}},
_connectDatepicker:function(a,b){var c=d(a);b.append=d([]);b.trigger=d([]);if(!c.hasClass(this.markerClassName)){this._attachments(c,b);c.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(e,f,h){b.settings[f]=h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});this._autoSize(b);d.data(a,"datepicker",b)}},_attachments:function(a,b){var c=this._get(b,"appendText"),e=this._get(b,"isRTL");b.append&&
b.append.remove();if(c){b.append=d('<span class="'+this._appendClass+'">'+c+"</span>");a[e?"before":"after"](b.append)}a.unbind("focus",this._showDatepicker);b.trigger&&b.trigger.remove();c=this._get(b,"showOn");if(c=="focus"||c=="both")a.focus(this._showDatepicker);if(c=="button"||c=="both"){c=this._get(b,"buttonText");var f=this._get(b,"buttonImage");b.trigger=d(this._get(b,"buttonImageOnly")?d("<img/>").addClass(this._triggerClass).attr({src:f,alt:c,title:c}):d('<button type="button"></button>').addClass(this._triggerClass).html(f==
""?c:d("<img/>").attr({src:f,alt:c,title:c})));a[e?"before":"after"](b.trigger);b.trigger.click(function(){d.datepicker._datepickerShowing&&d.datepicker._lastInput==a[0]?d.datepicker._hideDatepicker():d.datepicker._showDatepicker(a[0]);return false})}},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var b=new Date(2009,11,20),c=this._get(a,"dateFormat");if(c.match(/[DM]/)){var e=function(f){for(var h=0,i=0,g=0;g<f.length;g++)if(f[g].length>h){h=f[g].length;i=g}return i};b.setMonth(e(this._get(a,
c.match(/MM/)?"monthNames":"monthNamesShort")));b.setDate(e(this._get(a,c.match(/DD/)?"dayNames":"dayNamesShort"))+20-b.getDay())}a.input.attr("size",this._formatDate(a,b).length)}},_inlineDatepicker:function(a,b){var c=d(a);if(!c.hasClass(this.markerClassName)){c.addClass(this.markerClassName).append(b.dpDiv).bind("setData.datepicker",function(e,f,h){b.settings[f]=h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});d.data(a,"datepicker",b);this._setDate(b,this._getDefaultDate(b),
true);this._updateDatepicker(b);this._updateAlternate(b);b.dpDiv.show()}},_dialogDatepicker:function(a,b,c,e,f){a=this._dialogInst;if(!a){this.uuid+=1;this._dialogInput=d('<input type="text" id="'+("dp"+this.uuid)+'" style="position: absolute; top: -100px; width: 0px; z-index: -10;"/>');this._dialogInput.keydown(this._doKeyDown);d("body").append(this._dialogInput);a=this._dialogInst=this._newInst(this._dialogInput,false);a.settings={};d.data(this._dialogInput[0],"datepicker",a)}E(a.settings,e||{});
b=b&&b.constructor==Date?this._formatDate(a,b):b;this._dialogInput.val(b);this._pos=f?f.length?f:[f.pageX,f.pageY]:null;if(!this._pos)this._pos=[document.documentElement.clientWidth/2-100+(document.documentElement.scrollLeft||document.body.scrollLeft),document.documentElement.clientHeight/2-150+(document.documentElement.scrollTop||document.body.scrollTop)];this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px");a.settings.onSelect=c;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);
this._showDatepicker(this._dialogInput[0]);d.blockUI&&d.blockUI(this.dpDiv);d.data(this._dialogInput[0],"datepicker",a);return this},_destroyDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();d.removeData(a,"datepicker");if(e=="input"){c.append.remove();c.trigger.remove();b.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",
this._doKeyUp)}else if(e=="div"||e=="span")b.removeClass(this.markerClassName).empty()}},_enableDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();if(e=="input"){a.disabled=false;c.trigger.filter("button").each(function(){this.disabled=false}).end().filter("img").css({opacity:"1.0",cursor:""})}else if(e=="div"||e=="span")b.children("."+this._inlineClass).children().removeClass("ui-state-disabled");this._disabledInputs=d.map(this._disabledInputs,
function(f){return f==a?null:f})}},_disableDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();if(e=="input"){a.disabled=true;c.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0.5",cursor:"default"})}else if(e=="div"||e=="span")b.children("."+this._inlineClass).children().addClass("ui-state-disabled");this._disabledInputs=d.map(this._disabledInputs,function(f){return f==a?null:
f});this._disabledInputs[this._disabledInputs.length]=a}},_isDisabledDatepicker:function(a){if(!a)return false;for(var b=0;b<this._disabledInputs.length;b++)if(this._disabledInputs[b]==a)return true;return false},_getInst:function(a){try{return d.data(a,"datepicker")}catch(b){throw"Missing instance data for this datepicker";}},_optionDatepicker:function(a,b,c){var e=this._getInst(a);if(arguments.length==2&&typeof b=="string")return b=="defaults"?d.extend({},d.datepicker._defaults):e?b=="all"?d.extend({},
e.settings):this._get(e,b):null;var f=b||{};if(typeof b=="string"){f={};f[b]=c}if(e){this._curInst==e&&this._hideDatepicker();var h=this._getDateDatepicker(a,true);E(e.settings,f);this._attachments(d(a),e);this._autoSize(e);this._setDateDatepicker(a,h);this._updateDatepicker(e)}},_changeDatepicker:function(a,b,c){this._optionDatepicker(a,b,c)},_refreshDatepicker:function(a){(a=this._getInst(a))&&this._updateDatepicker(a)},_setDateDatepicker:function(a,b){if(a=this._getInst(a)){this._setDate(a,b);
this._updateDatepicker(a);this._updateAlternate(a)}},_getDateDatepicker:function(a,b){(a=this._getInst(a))&&!a.inline&&this._setDateFromField(a,b);return a?this._getDate(a):null},_doKeyDown:function(a){var b=d.datepicker._getInst(a.target),c=true,e=b.dpDiv.is(".ui-datepicker-rtl");b._keyEvent=true;if(d.datepicker._datepickerShowing)switch(a.keyCode){case 9:d.datepicker._hideDatepicker();c=false;break;case 13:c=d("td."+d.datepicker._dayOverClass+":not(."+d.datepicker._currentClass+")",b.dpDiv);c[0]?
d.datepicker._selectDay(a.target,b.selectedMonth,b.selectedYear,c[0]):d.datepicker._hideDatepicker();return false;case 27:d.datepicker._hideDatepicker();break;case 33:d.datepicker._adjustDate(a.target,a.ctrlKey?-d.datepicker._get(b,"stepBigMonths"):-d.datepicker._get(b,"stepMonths"),"M");break;case 34:d.datepicker._adjustDate(a.target,a.ctrlKey?+d.datepicker._get(b,"stepBigMonths"):+d.datepicker._get(b,"stepMonths"),"M");break;case 35:if(a.ctrlKey||a.metaKey)d.datepicker._clearDate(a.target);c=a.ctrlKey||
a.metaKey;break;case 36:if(a.ctrlKey||a.metaKey)d.datepicker._gotoToday(a.target);c=a.ctrlKey||a.metaKey;break;case 37:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,e?+1:-1,"D");c=a.ctrlKey||a.metaKey;if(a.originalEvent.altKey)d.datepicker._adjustDate(a.target,a.ctrlKey?-d.datepicker._get(b,"stepBigMonths"):-d.datepicker._get(b,"stepMonths"),"M");break;case 38:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,-7,"D");c=a.ctrlKey||a.metaKey;break;case 39:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,
e?-1:+1,"D");c=a.ctrlKey||a.metaKey;if(a.originalEvent.altKey)d.datepicker._adjustDate(a.target,a.ctrlKey?+d.datepicker._get(b,"stepBigMonths"):+d.datepicker._get(b,"stepMonths"),"M");break;case 40:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,+7,"D");c=a.ctrlKey||a.metaKey;break;default:c=false}else if(a.keyCode==36&&a.ctrlKey)d.datepicker._showDatepicker(this);else c=false;if(c){a.preventDefault();a.stopPropagation()}},_doKeyPress:function(a){var b=d.datepicker._getInst(a.target);if(d.datepicker._get(b,
"constrainInput")){b=d.datepicker._possibleChars(d.datepicker._get(b,"dateFormat"));var c=String.fromCharCode(a.charCode==G?a.keyCode:a.charCode);return a.ctrlKey||a.metaKey||c<" "||!b||b.indexOf(c)>-1}},_doKeyUp:function(a){a=d.datepicker._getInst(a.target);if(a.input.val()!=a.lastVal)try{if(d.datepicker.parseDate(d.datepicker._get(a,"dateFormat"),a.input?a.input.val():null,d.datepicker._getFormatConfig(a))){d.datepicker._setDateFromField(a);d.datepicker._updateAlternate(a);d.datepicker._updateDatepicker(a)}}catch(b){d.datepicker.log(b)}return true},
_showDatepicker:function(a){a=a.target||a;if(a.nodeName.toLowerCase()!="input")a=d("input",a.parentNode)[0];if(!(d.datepicker._isDisabledDatepicker(a)||d.datepicker._lastInput==a)){var b=d.datepicker._getInst(a);d.datepicker._curInst&&d.datepicker._curInst!=b&&d.datepicker._curInst.dpDiv.stop(true,true);var c=d.datepicker._get(b,"beforeShow");E(b.settings,c?c.apply(a,[a,b]):{});b.lastVal=null;d.datepicker._lastInput=a;d.datepicker._setDateFromField(b);if(d.datepicker._inDialog)a.value="";if(!d.datepicker._pos){d.datepicker._pos=
d.datepicker._findPos(a);d.datepicker._pos[1]+=a.offsetHeight}var e=false;d(a).parents().each(function(){e|=d(this).css("position")=="fixed";return!e});if(e&&d.browser.opera){d.datepicker._pos[0]-=document.documentElement.scrollLeft;d.datepicker._pos[1]-=document.documentElement.scrollTop}c={left:d.datepicker._pos[0],top:d.datepicker._pos[1]};d.datepicker._pos=null;b.dpDiv.empty();b.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});d.datepicker._updateDatepicker(b);c=d.datepicker._checkOffset(b,
c,e);b.dpDiv.css({position:d.datepicker._inDialog&&d.blockUI?"static":e?"fixed":"absolute",display:"none",left:c.left+"px",top:c.top+"px"});if(!b.inline){c=d.datepicker._get(b,"showAnim");var f=d.datepicker._get(b,"duration"),h=function(){d.datepicker._datepickerShowing=true;var i=b.dpDiv.find("iframe.ui-datepicker-cover");if(i.length){var g=d.datepicker._getBorders(b.dpDiv);i.css({left:-g[0],top:-g[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()})}};b.dpDiv.zIndex(d(a).zIndex()+1);d.effects&&
d.effects[c]?b.dpDiv.show(c,d.datepicker._get(b,"showOptions"),f,h):b.dpDiv[c||"show"](c?f:null,h);if(!c||!f)h();b.input.is(":visible")&&!b.input.is(":disabled")&&b.input.focus();d.datepicker._curInst=b}}},_updateDatepicker:function(a){var b=this,c=d.datepicker._getBorders(a.dpDiv);a.dpDiv.empty().append(this._generateHTML(a));var e=a.dpDiv.find("iframe.ui-datepicker-cover");e.length&&e.css({left:-c[0],top:-c[1],width:a.dpDiv.outerWidth(),height:a.dpDiv.outerHeight()});a.dpDiv.find("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a").bind("mouseout",
function(){d(this).removeClass("ui-state-hover");this.className.indexOf("ui-datepicker-prev")!=-1&&d(this).removeClass("ui-datepicker-prev-hover");this.className.indexOf("ui-datepicker-next")!=-1&&d(this).removeClass("ui-datepicker-next-hover")}).bind("mouseover",function(){if(!b._isDisabledDatepicker(a.inline?a.dpDiv.parent()[0]:a.input[0])){d(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");d(this).addClass("ui-state-hover");this.className.indexOf("ui-datepicker-prev")!=
-1&&d(this).addClass("ui-datepicker-prev-hover");this.className.indexOf("ui-datepicker-next")!=-1&&d(this).addClass("ui-datepicker-next-hover")}}).end().find("."+this._dayOverClass+" a").trigger("mouseover").end();c=this._getNumberOfMonths(a);e=c[1];e>1?a.dpDiv.addClass("ui-datepicker-multi-"+e).css("width",17*e+"em"):a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");a.dpDiv[(c[0]!=1||c[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");a.dpDiv[(this._get(a,
"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");a==d.datepicker._curInst&&d.datepicker._datepickerShowing&&a.input&&a.input.is(":visible")&&!a.input.is(":disabled")&&a.input[0]!=document.activeElement&&a.input.focus();if(a.yearshtml){var f=a.yearshtml;setTimeout(function(){f===a.yearshtml&&a.dpDiv.find("select.ui-datepicker-year:first").replaceWith(a.yearshtml);f=a.yearshtml=null},0)}},_getBorders:function(a){var b=function(c){return{thin:1,medium:2,thick:3}[c]||c};return[parseFloat(b(a.css("border-left-width"))),
parseFloat(b(a.css("border-top-width")))]},_checkOffset:function(a,b,c){var e=a.dpDiv.outerWidth(),f=a.dpDiv.outerHeight(),h=a.input?a.input.outerWidth():0,i=a.input?a.input.outerHeight():0,g=document.documentElement.clientWidth+d(document).scrollLeft(),j=document.documentElement.clientHeight+d(document).scrollTop();b.left-=this._get(a,"isRTL")?e-h:0;b.left-=c&&b.left==a.input.offset().left?d(document).scrollLeft():0;b.top-=c&&b.top==a.input.offset().top+i?d(document).scrollTop():0;b.left-=Math.min(b.left,
b.left+e>g&&g>e?Math.abs(b.left+e-g):0);b.top-=Math.min(b.top,b.top+f>j&&j>f?Math.abs(f+i):0);return b},_findPos:function(a){for(var b=this._get(this._getInst(a),"isRTL");a&&(a.type=="hidden"||a.nodeType!=1||d.expr.filters.hidden(a));)a=a[b?"previousSibling":"nextSibling"];a=d(a).offset();return[a.left,a.top]},_hideDatepicker:function(a){var b=this._curInst;if(!(!b||a&&b!=d.data(a,"datepicker")))if(this._datepickerShowing){a=this._get(b,"showAnim");var c=this._get(b,"duration"),e=function(){d.datepicker._tidyDialog(b);
this._curInst=null};d.effects&&d.effects[a]?b.dpDiv.hide(a,d.datepicker._get(b,"showOptions"),c,e):b.dpDiv[a=="slideDown"?"slideUp":a=="fadeIn"?"fadeOut":"hide"](a?c:null,e);a||e();if(a=this._get(b,"onClose"))a.apply(b.input?b.input[0]:null,[b.input?b.input.val():"",b]);this._datepickerShowing=false;this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if(d.blockUI){d.unblockUI();d("body").append(this.dpDiv)}}this._inDialog=false}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},
_checkExternalClick:function(a){if(d.datepicker._curInst){a=d(a.target);a[0].id!=d.datepicker._mainDivId&&a.parents("#"+d.datepicker._mainDivId).length==0&&!a.hasClass(d.datepicker.markerClassName)&&!a.hasClass(d.datepicker._triggerClass)&&d.datepicker._datepickerShowing&&!(d.datepicker._inDialog&&d.blockUI)&&d.datepicker._hideDatepicker()}},_adjustDate:function(a,b,c){a=d(a);var e=this._getInst(a[0]);if(!this._isDisabledDatepicker(a[0])){this._adjustInstDate(e,b+(c=="M"?this._get(e,"showCurrentAtPos"):
0),c);this._updateDatepicker(e)}},_gotoToday:function(a){a=d(a);var b=this._getInst(a[0]);if(this._get(b,"gotoCurrent")&&b.currentDay){b.selectedDay=b.currentDay;b.drawMonth=b.selectedMonth=b.currentMonth;b.drawYear=b.selectedYear=b.currentYear}else{var c=new Date;b.selectedDay=c.getDate();b.drawMonth=b.selectedMonth=c.getMonth();b.drawYear=b.selectedYear=c.getFullYear()}this._notifyChange(b);this._adjustDate(a)},_selectMonthYear:function(a,b,c){a=d(a);var e=this._getInst(a[0]);e._selectingMonthYear=
false;e["selected"+(c=="M"?"Month":"Year")]=e["draw"+(c=="M"?"Month":"Year")]=parseInt(b.options[b.selectedIndex].value,10);this._notifyChange(e);this._adjustDate(a)},_clickMonthYear:function(a){var b=this._getInst(d(a)[0]);b.input&&b._selectingMonthYear&&setTimeout(function(){b.input.focus()},0);b._selectingMonthYear=!b._selectingMonthYear},_selectDay:function(a,b,c,e){var f=d(a);if(!(d(e).hasClass(this._unselectableClass)||this._isDisabledDatepicker(f[0]))){f=this._getInst(f[0]);f.selectedDay=f.currentDay=
d("a",e).html();f.selectedMonth=f.currentMonth=b;f.selectedYear=f.currentYear=c;this._selectDate(a,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear))}},_clearDate:function(a){a=d(a);this._getInst(a[0]);this._selectDate(a,"")},_selectDate:function(a,b){a=this._getInst(d(a)[0]);b=b!=null?b:this._formatDate(a);a.input&&a.input.val(b);this._updateAlternate(a);var c=this._get(a,"onSelect");if(c)c.apply(a.input?a.input[0]:null,[b,a]);else a.input&&a.input.trigger("change");if(a.inline)this._updateDatepicker(a);
else{this._hideDatepicker();this._lastInput=a.input[0];typeof a.input[0]!="object"&&a.input.focus();this._lastInput=null}},_updateAlternate:function(a){var b=this._get(a,"altField");if(b){var c=this._get(a,"altFormat")||this._get(a,"dateFormat"),e=this._getDate(a),f=this.formatDate(c,e,this._getFormatConfig(a));d(b).each(function(){d(this).val(f)})}},noWeekends:function(a){a=a.getDay();return[a>0&&a<6,""]},iso8601Week:function(a){a=new Date(a.getTime());a.setDate(a.getDate()+4-(a.getDay()||7));var b=
a.getTime();a.setMonth(0);a.setDate(1);return Math.floor(Math.round((b-a)/864E5)/7)+1},parseDate:function(a,b,c){if(a==null||b==null)throw"Invalid arguments";b=typeof b=="object"?b.toString():b+"";if(b=="")return null;var e=(c?c.shortYearCutoff:null)||this._defaults.shortYearCutoff;e=typeof e!="string"?e:(new Date).getFullYear()%100+parseInt(e,10);for(var f=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,h=(c?c.dayNames:null)||this._defaults.dayNames,i=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,
g=(c?c.monthNames:null)||this._defaults.monthNames,j=c=-1,l=-1,u=-1,k=false,o=function(p){(p=z+1<a.length&&a.charAt(z+1)==p)&&z++;return p},m=function(p){var v=o(p);p=new RegExp("^\\d{1,"+(p=="@"?14:p=="!"?20:p=="y"&&v?4:p=="o"?3:2)+"}");p=b.substring(s).match(p);if(!p)throw"Missing number at position "+s;s+=p[0].length;return parseInt(p[0],10)},n=function(p,v,H){p=o(p)?H:v;for(v=0;v<p.length;v++)if(b.substr(s,p[v].length).toLowerCase()==p[v].toLowerCase()){s+=p[v].length;return v+1}throw"Unknown name at position "+
s;},r=function(){if(b.charAt(s)!=a.charAt(z))throw"Unexpected literal at position "+s;s++},s=0,z=0;z<a.length;z++)if(k)if(a.charAt(z)=="'"&&!o("'"))k=false;else r();else switch(a.charAt(z)){case "d":l=m("d");break;case "D":n("D",f,h);break;case "o":u=m("o");break;case "m":j=m("m");break;case "M":j=n("M",i,g);break;case "y":c=m("y");break;case "@":var w=new Date(m("@"));c=w.getFullYear();j=w.getMonth()+1;l=w.getDate();break;case "!":w=new Date((m("!")-this._ticksTo1970)/1E4);c=w.getFullYear();j=w.getMonth()+
1;l=w.getDate();break;case "'":if(o("'"))r();else k=true;break;default:r()}if(c==-1)c=(new Date).getFullYear();else if(c<100)c+=(new Date).getFullYear()-(new Date).getFullYear()%100+(c<=e?0:-100);if(u>-1){j=1;l=u;do{e=this._getDaysInMonth(c,j-1);if(l<=e)break;j++;l-=e}while(1)}w=this._daylightSavingAdjust(new Date(c,j-1,l));if(w.getFullYear()!=c||w.getMonth()+1!=j||w.getDate()!=l)throw"Invalid date";return w},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",
RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1E7,formatDate:function(a,b,c){if(!b)return"";var e=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,f=(c?c.dayNames:null)||this._defaults.dayNames,h=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort;c=(c?c.monthNames:null)||this._defaults.monthNames;var i=function(o){(o=k+1<a.length&&
a.charAt(k+1)==o)&&k++;return o},g=function(o,m,n){m=""+m;if(i(o))for(;m.length<n;)m="0"+m;return m},j=function(o,m,n,r){return i(o)?r[m]:n[m]},l="",u=false;if(b)for(var k=0;k<a.length;k++)if(u)if(a.charAt(k)=="'"&&!i("'"))u=false;else l+=a.charAt(k);else switch(a.charAt(k)){case "d":l+=g("d",b.getDate(),2);break;case "D":l+=j("D",b.getDay(),e,f);break;case "o":l+=g("o",(b.getTime()-(new Date(b.getFullYear(),0,0)).getTime())/864E5,3);break;case "m":l+=g("m",b.getMonth()+1,2);break;case "M":l+=j("M",
b.getMonth(),h,c);break;case "y":l+=i("y")?b.getFullYear():(b.getYear()%100<10?"0":"")+b.getYear()%100;break;case "@":l+=b.getTime();break;case "!":l+=b.getTime()*1E4+this._ticksTo1970;break;case "'":if(i("'"))l+="'";else u=true;break;default:l+=a.charAt(k)}return l},_possibleChars:function(a){for(var b="",c=false,e=function(h){(h=f+1<a.length&&a.charAt(f+1)==h)&&f++;return h},f=0;f<a.length;f++)if(c)if(a.charAt(f)=="'"&&!e("'"))c=false;else b+=a.charAt(f);else switch(a.charAt(f)){case "d":case "m":case "y":case "@":b+=
"0123456789";break;case "D":case "M":return null;case "'":if(e("'"))b+="'";else c=true;break;default:b+=a.charAt(f)}return b},_get:function(a,b){return a.settings[b]!==G?a.settings[b]:this._defaults[b]},_setDateFromField:function(a,b){if(a.input.val()!=a.lastVal){var c=this._get(a,"dateFormat"),e=a.lastVal=a.input?a.input.val():null,f,h;f=h=this._getDefaultDate(a);var i=this._getFormatConfig(a);try{f=this.parseDate(c,e,i)||h}catch(g){this.log(g);e=b?"":e}a.selectedDay=f.getDate();a.drawMonth=a.selectedMonth=
f.getMonth();a.drawYear=a.selectedYear=f.getFullYear();a.currentDay=e?f.getDate():0;a.currentMonth=e?f.getMonth():0;a.currentYear=e?f.getFullYear():0;this._adjustInstDate(a)}},_getDefaultDate:function(a){return this._restrictMinMax(a,this._determineDate(a,this._get(a,"defaultDate"),new Date))},_determineDate:function(a,b,c){var e=function(h){var i=new Date;i.setDate(i.getDate()+h);return i},f=function(h){try{return d.datepicker.parseDate(d.datepicker._get(a,"dateFormat"),h,d.datepicker._getFormatConfig(a))}catch(i){}var g=
(h.toLowerCase().match(/^c/)?d.datepicker._getDate(a):null)||new Date,j=g.getFullYear(),l=g.getMonth();g=g.getDate();for(var u=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,k=u.exec(h);k;){switch(k[2]||"d"){case "d":case "D":g+=parseInt(k[1],10);break;case "w":case "W":g+=parseInt(k[1],10)*7;break;case "m":case "M":l+=parseInt(k[1],10);g=Math.min(g,d.datepicker._getDaysInMonth(j,l));break;case "y":case "Y":j+=parseInt(k[1],10);g=Math.min(g,d.datepicker._getDaysInMonth(j,l));break}k=u.exec(h)}return new Date(j,
l,g)};if(b=(b=b==null||b===""?c:typeof b=="string"?f(b):typeof b=="number"?isNaN(b)?c:e(b):new Date(b.getTime()))&&b.toString()=="Invalid Date"?c:b){b.setHours(0);b.setMinutes(0);b.setSeconds(0);b.setMilliseconds(0)}return this._daylightSavingAdjust(b)},_daylightSavingAdjust:function(a){if(!a)return null;a.setHours(a.getHours()>12?a.getHours()+2:0);return a},_setDate:function(a,b,c){var e=!b,f=a.selectedMonth,h=a.selectedYear;b=this._restrictMinMax(a,this._determineDate(a,b,new Date));a.selectedDay=
a.currentDay=b.getDate();a.drawMonth=a.selectedMonth=a.currentMonth=b.getMonth();a.drawYear=a.selectedYear=a.currentYear=b.getFullYear();if((f!=a.selectedMonth||h!=a.selectedYear)&&!c)this._notifyChange(a);this._adjustInstDate(a);if(a.input)a.input.val(e?"":this._formatDate(a))},_getDate:function(a){return!a.currentYear||a.input&&a.input.val()==""?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay))},_generateHTML:function(a){var b=new Date;b=this._daylightSavingAdjust(new Date(b.getFullYear(),
b.getMonth(),b.getDate()));var c=this._get(a,"isRTL"),e=this._get(a,"showButtonPanel"),f=this._get(a,"hideIfNoPrevNext"),h=this._get(a,"navigationAsDateFormat"),i=this._getNumberOfMonths(a),g=this._get(a,"showCurrentAtPos"),j=this._get(a,"stepMonths"),l=i[0]!=1||i[1]!=1,u=this._daylightSavingAdjust(!a.currentDay?new Date(9999,9,9):new Date(a.currentYear,a.currentMonth,a.currentDay)),k=this._getMinMaxDate(a,"min"),o=this._getMinMaxDate(a,"max");g=a.drawMonth-g;var m=a.drawYear;if(g<0){g+=12;m--}if(o){var n=
this._daylightSavingAdjust(new Date(o.getFullYear(),o.getMonth()-i[0]*i[1]+1,o.getDate()));for(n=k&&n<k?k:n;this._daylightSavingAdjust(new Date(m,g,1))>n;){g--;if(g<0){g=11;m--}}}a.drawMonth=g;a.drawYear=m;n=this._get(a,"prevText");n=!h?n:this.formatDate(n,this._daylightSavingAdjust(new Date(m,g-j,1)),this._getFormatConfig(a));n=this._canAdjustMonth(a,-1,m,g)?'<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery_'+y+".datepicker._adjustDate('#"+a.id+"', -"+j+", 'M');\" title=\""+n+'"><span class="ui-icon ui-icon-circle-triangle-'+
(c?"e":"w")+'">'+n+"</span></a>":f?"":'<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+n+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"e":"w")+'">'+n+"</span></a>";var r=this._get(a,"nextText");r=!h?r:this.formatDate(r,this._daylightSavingAdjust(new Date(m,g+j,1)),this._getFormatConfig(a));f=this._canAdjustMonth(a,+1,m,g)?'<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery_'+y+".datepicker._adjustDate('#"+a.id+"', +"+j+", 'M');\" title=\""+r+'"><span class="ui-icon ui-icon-circle-triangle-'+
(c?"w":"e")+'">'+r+"</span></a>":f?"":'<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+r+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"w":"e")+'">'+r+"</span></a>";j=this._get(a,"currentText");r=this._get(a,"gotoCurrent")&&a.currentDay?u:b;j=!h?j:this.formatDate(j,r,this._getFormatConfig(a));h=!a.inline?'<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery_'+y+'.datepicker._hideDatepicker();">'+this._get(a,
"closeText")+"</button>":"";e=e?'<div class="ui-datepicker-buttonpane ui-widget-content">'+(c?h:"")+(this._isInRange(a,r)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery_'+y+".datepicker._gotoToday('#"+a.id+"');\">"+j+"</button>":"")+(c?"":h)+"</div>":"";h=parseInt(this._get(a,"firstDay"),10);h=isNaN(h)?0:h;j=this._get(a,"showWeek");r=this._get(a,"dayNames");this._get(a,"dayNamesShort");var s=this._get(a,"dayNamesMin"),z=
this._get(a,"monthNames"),w=this._get(a,"monthNamesShort"),p=this._get(a,"beforeShowDay"),v=this._get(a,"showOtherMonths"),H=this._get(a,"selectOtherMonths");this._get(a,"calculateWeek");for(var L=this._getDefaultDate(a),I="",C=0;C<i[0];C++){for(var M="",D=0;D<i[1];D++){var N=this._daylightSavingAdjust(new Date(m,g,a.selectedDay)),t=" ui-corner-all",x="";if(l){x+='<div class="ui-datepicker-group';if(i[1]>1)switch(D){case 0:x+=" ui-datepicker-group-first";t=" ui-corner-"+(c?"right":"left");break;case i[1]-
1:x+=" ui-datepicker-group-last";t=" ui-corner-"+(c?"left":"right");break;default:x+=" ui-datepicker-group-middle";t="";break}x+='">'}x+='<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'+t+'">'+(/all|left/.test(t)&&C==0?c?f:n:"")+(/all|right/.test(t)&&C==0?c?n:f:"")+this._generateMonthYearHeader(a,g,m,k,o,C>0||D>0,z,w)+'</div><table class="ui-datepicker-calendar"><thead><tr>';var A=j?'<th class="ui-datepicker-week-col">'+this._get(a,"weekHeader")+"</th>":"";for(t=0;t<7;t++){var q=
(t+h)%7;A+="<th"+((t+h+6)%7>=5?' class="ui-datepicker-week-end"':"")+'><span title="'+r[q]+'">'+s[q]+"</span></th>"}x+=A+"</tr></thead><tbody>";A=this._getDaysInMonth(m,g);if(m==a.selectedYear&&g==a.selectedMonth)a.selectedDay=Math.min(a.selectedDay,A);t=(this._getFirstDayOfMonth(m,g)-h+7)%7;A=l?6:Math.ceil((t+A)/7);q=this._daylightSavingAdjust(new Date(m,g,1-t));for(var O=0;O<A;O++){x+="<tr>";var P=!j?"":'<td class="ui-datepicker-week-col">'+this._get(a,"calculateWeek")(q)+"</td>";for(t=0;t<7;t++){var F=
p?p.apply(a.input?a.input[0]:null,[q]):[true,""],B=q.getMonth()!=g,J=B&&!H||!F[0]||k&&q<k||o&&q>o;P+='<td class="'+((t+h+6)%7>=5?" ui-datepicker-week-end":"")+(B?" ui-datepicker-other-month":"")+(q.getTime()==N.getTime()&&g==a.selectedMonth&&a._keyEvent||L.getTime()==q.getTime()&&L.getTime()==N.getTime()?" "+this._dayOverClass:"")+(J?" "+this._unselectableClass+" ui-state-disabled":"")+(B&&!v?"":" "+F[1]+(q.getTime()==u.getTime()?" "+this._currentClass:"")+(q.getTime()==b.getTime()?" ui-datepicker-today":
""))+'"'+((!B||v)&&F[2]?' title="'+F[2]+'"':"")+(J?"":' onclick="DP_jQuery_'+y+".datepicker._selectDay('#"+a.id+"',"+q.getMonth()+","+q.getFullYear()+', this);return false;"')+">"+(B&&!v?"&#xa0;":J?'<span class="ui-state-default">'+q.getDate()+"</span>":'<a class="ui-state-default'+(q.getTime()==b.getTime()?" ui-state-highlight":"")+(q.getTime()==u.getTime()?" ui-state-active":"")+(B?" ui-priority-secondary":"")+'" href="#">'+q.getDate()+"</a>")+"</td>";q.setDate(q.getDate()+1);q=this._daylightSavingAdjust(q)}x+=
P+"</tr>"}g++;if(g>11){g=0;m++}x+="</tbody></table>"+(l?"</div>"+(i[0]>0&&D==i[1]-1?'<div class="ui-datepicker-row-break"></div>':""):"");M+=x}I+=M}I+=e+(d.browser.msie&&parseInt(d.browser.version,10)<7&&!a.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>':"");a._keyEvent=false;return I},_generateMonthYearHeader:function(a,b,c,e,f,h,i,g){var j=this._get(a,"changeMonth"),l=this._get(a,"changeYear"),u=this._get(a,"showMonthAfterYear"),k='<div class="ui-datepicker-title">',
o="";if(h||!j)o+='<span class="ui-datepicker-month">'+i[b]+"</span>";else{i=e&&e.getFullYear()==c;var m=f&&f.getFullYear()==c;o+='<select class="ui-datepicker-month" onchange="DP_jQuery_'+y+".datepicker._selectMonthYear('#"+a.id+"', this, 'M');\" onclick=\"DP_jQuery_"+y+".datepicker._clickMonthYear('#"+a.id+"');\">";for(var n=0;n<12;n++)if((!i||n>=e.getMonth())&&(!m||n<=f.getMonth()))o+='<option value="'+n+'"'+(n==b?' selected="selected"':"")+">"+g[n]+"</option>";o+="</select>"}u||(k+=o+(h||!(j&&
l)?"&#xa0;":""));a.yearshtml="";if(h||!l)k+='<span class="ui-datepicker-year">'+c+"</span>";else{g=this._get(a,"yearRange").split(":");var r=(new Date).getFullYear();i=function(s){s=s.match(/c[+-].*/)?c+parseInt(s.substring(1),10):s.match(/[+-].*/)?r+parseInt(s,10):parseInt(s,10);return isNaN(s)?r:s};b=i(g[0]);g=Math.max(b,i(g[1]||""));b=e?Math.max(b,e.getFullYear()):b;g=f?Math.min(g,f.getFullYear()):g;for(a.yearshtml+='<select class="ui-datepicker-year" onchange="DP_jQuery_'+y+".datepicker._selectMonthYear('#"+
a.id+"', this, 'Y');\" onclick=\"DP_jQuery_"+y+".datepicker._clickMonthYear('#"+a.id+"');\">";b<=g;b++)a.yearshtml+='<option value="'+b+'"'+(b==c?' selected="selected"':"")+">"+b+"</option>";a.yearshtml+="</select>";if(d.browser.mozilla)k+='<select class="ui-datepicker-year"><option value="'+c+'" selected="selected">'+c+"</option></select>";else{k+=a.yearshtml;a.yearshtml=null}}k+=this._get(a,"yearSuffix");if(u)k+=(h||!(j&&l)?"&#xa0;":"")+o;k+="</div>";return k},_adjustInstDate:function(a,b,c){var e=
a.drawYear+(c=="Y"?b:0),f=a.drawMonth+(c=="M"?b:0);b=Math.min(a.selectedDay,this._getDaysInMonth(e,f))+(c=="D"?b:0);e=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(e,f,b)));a.selectedDay=e.getDate();a.drawMonth=a.selectedMonth=e.getMonth();a.drawYear=a.selectedYear=e.getFullYear();if(c=="M"||c=="Y")this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");b=c&&b<c?c:b;return b=a&&b>a?a:b},_notifyChange:function(a){var b=this._get(a,
"onChangeMonthYear");if(b)b.apply(a.input?a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){a=this._get(a,"numberOfMonths");return a==null?[1,1]:typeof a=="number"?[1,a]:a},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-this._daylightSavingAdjust(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,e){var f=this._getNumberOfMonths(a);
c=this._daylightSavingAdjust(new Date(c,e+(b<0?b:f[0]*f[1]),1));b<0&&c.setDate(this._getDaysInMonth(c.getFullYear(),c.getMonth()));return this._isInRange(a,c)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!a||b.getTime()<=a.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");b=typeof b!="string"?b:(new Date).getFullYear()%100+parseInt(b,10);return{shortYearCutoff:b,dayNamesShort:this._get(a,
"dayNamesShort"),dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,e){if(!b){a.currentDay=a.selectedDay;a.currentMonth=a.selectedMonth;a.currentYear=a.selectedYear}b=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(e,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),b,this._getFormatConfig(a))}});d.fn.datepicker=
function(a){if(!this.length)return this;if(!d.datepicker.initialized){d(document).mousedown(d.datepicker._checkExternalClick).find("body").append(d.datepicker.dpDiv);d.datepicker.initialized=true}var b=Array.prototype.slice.call(arguments,1);if(typeof a=="string"&&(a=="isDisabled"||a=="getDate"||a=="widget"))return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b));if(a=="option"&&arguments.length==2&&typeof arguments[1]=="string")return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,
[this[0]].concat(b));return this.each(function(){typeof a=="string"?d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this].concat(b)):d.datepicker._attachDatepicker(this,a)})};d.datepicker=new K;d.datepicker.initialized=false;d.datepicker.uuid=(new Date).getTime();d.datepicker.version="1.8.10";window["DP_jQuery_"+y]=d})(jQuery);


(function(i){var q={vertical:false,rtl:false,start:1,offset:1,size:null,scroll:3,visible:null,animation:"normal",easing:"swing",auto:0,wrap:null,initCallback:null,reloadCallback:null,itemLoadCallback:null,itemFirstInCallback:null,itemFirstOutCallback:null,itemLastInCallback:null,itemLastOutCallback:null,itemVisibleInCallback:null,itemVisibleOutCallback:null,buttonNextHTML:"<div></div>",buttonPrevHTML:"<div></div>",buttonNextEvent:"click",buttonPrevEvent:"click",buttonNextCallback:null,buttonPrevCallback:null, itemFallbackDimension:null},r=false;i(window).bind("load.jcarousel",function(){r=true});i.jcarousel=function(a,c){this.options=i.extend({},q,c||{});this.autoStopped=this.locked=false;this.buttonPrevState=this.buttonNextState=this.buttonPrev=this.buttonNext=this.list=this.clip=this.container=null;if(!c||c.rtl===undefined)this.options.rtl=(i(a).attr("dir")||i("html").attr("dir")||"").toLowerCase()=="rtl";this.wh=!this.options.vertical?"width":"height";this.lt=!this.options.vertical?this.options.rtl? "right":"left":"top";for(var b="",d=a.className.split(" "),f=0;f<d.length;f++)if(d[f].indexOf("jcarousel-skin")!=-1){i(a).removeClass(d[f]);b=d[f];break}if(a.nodeName.toUpperCase()=="UL"||a.nodeName.toUpperCase()=="OL"){this.list=i(a);this.container=this.list.parent();if(this.container.hasClass("jcarousel-clip")){if(!this.container.parent().hasClass("jcarousel-container"))this.container=this.container.wrap("<div></div>");this.container=this.container.parent()}else if(!this.container.hasClass("jcarousel-container"))this.container= this.list.wrap("<div></div>").parent()}else{this.container=i(a);this.list=this.container.find("ul,ol").eq(0)}b!==""&&this.container.parent()[0].className.indexOf("jcarousel-skin")==-1&&this.container.wrap('<div class=" '+b+'"></div>');this.clip=this.list.parent();if(!this.clip.length||!this.clip.hasClass("jcarousel-clip"))this.clip=this.list.wrap("<div></div>").parent();this.buttonNext=i(".jcarousel-next",this.container);if(this.buttonNext.size()===0&&this.options.buttonNextHTML!==null)this.buttonNext= this.clip.after(this.options.buttonNextHTML).next();this.buttonNext.addClass(this.className("jcarousel-next"));this.buttonPrev=i(".jcarousel-prev",this.container);if(this.buttonPrev.size()===0&&this.options.buttonPrevHTML!==null)this.buttonPrev=this.clip.after(this.options.buttonPrevHTML).next();this.buttonPrev.addClass(this.className("jcarousel-prev"));this.clip.addClass(this.className("jcarousel-clip")).css({overflow:"hidden",position:"relative"});this.list.addClass(this.className("jcarousel-list")).css({overflow:"hidden", position:"relative",top:0,margin:0,padding:0}).css(this.options.rtl?"right":"left",0);this.container.addClass(this.className("jcarousel-container")).css({position:"relative"});!this.options.vertical&&this.options.rtl&&this.container.addClass("jcarousel-direction-rtl").attr("dir","rtl");var j=this.options.visible!==null?Math.ceil(this.clipping()/this.options.visible):null;b=this.list.children("li");var e=this;if(b.size()>0){var g=0,k=this.options.offset;b.each(function(){e.format(this,k++);g+=e.dimension(this, j)});this.list.css(this.wh,g+100+"px");if(!c||c.size===undefined)this.options.size=b.size()}this.container.css("display","block");this.buttonNext.css("display","block");this.buttonPrev.css("display","block");this.funcNext=function(){e.next()};this.funcPrev=function(){e.prev()};this.funcResize=function(){e.reload()};this.options.initCallback!==null&&this.options.initCallback(this,"init");if(!r&&i.browser.safari){this.buttons(false,false);i(window).bind("load.jcarousel",function(){e.setup()})}else this.setup()}; var h=i.jcarousel;h.fn=h.prototype={jcarousel:"0.2.7"};h.fn.extend=h.extend=i.extend;h.fn.extend({setup:function(){this.prevLast=this.prevFirst=this.last=this.first=null;this.animating=false;this.tail=this.timer=null;this.inTail=false;if(!this.locked){this.list.css(this.lt,this.pos(this.options.offset)+"px");var a=this.pos(this.options.start,true);this.prevFirst=this.prevLast=null;this.animate(a,false);i(window).unbind("resize.jcarousel",this.funcResize).bind("resize.jcarousel",this.funcResize)}}, reset:function(){this.list.empty();this.list.css(this.lt,"0px");this.list.css(this.wh,"10px");this.options.initCallback!==null&&this.options.initCallback(this,"reset");this.setup()},reload:function(){this.tail!==null&&this.inTail&&this.list.css(this.lt,h.intval(this.list.css(this.lt))+this.tail);this.tail=null;this.inTail=false;this.options.reloadCallback!==null&&this.options.reloadCallback(this);if(this.options.visible!==null){var a=this,c=Math.ceil(this.clipping()/this.options.visible),b=0,d=0; this.list.children("li").each(function(f){b+=a.dimension(this,c);if(f+1<a.first)d=b});this.list.css(this.wh,b+"px");this.list.css(this.lt,-d+"px")}this.scroll(this.first,false)},lock:function(){this.locked=true;this.buttons()},unlock:function(){this.locked=false;this.buttons()},size:function(a){if(a!==undefined){this.options.size=a;this.locked||this.buttons()}return this.options.size},has:function(a,c){if(c===undefined||!c)c=a;if(this.options.size!==null&&c>this.options.size)c=this.options.size;for(var b= a;b<=c;b++){var d=this.get(b);if(!d.length||d.hasClass("jcarousel-item-placeholder"))return false}return true},get:function(a){return i(".jcarousel-item-"+a,this.list)},add:function(a,c){var b=this.get(a),d=0,f=i(c);if(b.length===0){var j,e=h.intval(a);for(b=this.create(a);;){j=this.get(--e);if(e<=0||j.length){e<=0?this.list.prepend(b):j.after(b);break}}}else d=this.dimension(b);if(f.get(0).nodeName.toUpperCase()=="LI"){b.replaceWith(f);b=f}else b.empty().append(c);this.format(b.removeClass(this.className("jcarousel-item-placeholder")), a);f=this.options.visible!==null?Math.ceil(this.clipping()/this.options.visible):null;d=this.dimension(b,f)-d;a>0&&a<this.first&&this.list.css(this.lt,h.intval(this.list.css(this.lt))-d+"px");this.list.css(this.wh,h.intval(this.list.css(this.wh))+d+"px");return b},remove:function(a){var c=this.get(a);if(!(!c.length||a>=this.first&&a<=this.last)){var b=this.dimension(c);a<this.first&&this.list.css(this.lt,h.intval(this.list.css(this.lt))+b+"px");c.remove();this.list.css(this.wh,h.intval(this.list.css(this.wh))- b+"px")}},next:function(){this.tail!==null&&!this.inTail?this.scrollTail(false):this.scroll((this.options.wrap=="both"||this.options.wrap=="last")&&this.options.size!==null&&this.last==this.options.size?1:this.first+this.options.scroll)},prev:function(){this.tail!==null&&this.inTail?this.scrollTail(true):this.scroll((this.options.wrap=="both"||this.options.wrap=="first")&&this.options.size!==null&&this.first==1?this.options.size:this.first-this.options.scroll)},scrollTail:function(a){if(!(this.locked|| this.animating||!this.tail)){this.pauseAuto();var c=h.intval(this.list.css(this.lt));c=!a?c-this.tail:c+this.tail;this.inTail=!a;this.prevFirst=this.first;this.prevLast=this.last;this.animate(c)}},scroll:function(a,c){if(!(this.locked||this.animating)){this.pauseAuto();this.animate(this.pos(a),c)}},pos:function(a,c){var b=h.intval(this.list.css(this.lt));if(this.locked||this.animating)return b;if(this.options.wrap!="circular")a=a<1?1:this.options.size&&a>this.options.size?this.options.size:a;for(var d= this.first>a,f=this.options.wrap!="circular"&&this.first<=1?1:this.first,j=d?this.get(f):this.get(this.last),e=d?f:f-1,g=null,k=0,l=false,m=0;d?--e>=a:++e<a;){g=this.get(e);l=!g.length;if(g.length===0){g=this.create(e).addClass(this.className("jcarousel-item-placeholder"));j[d?"before":"after"](g);if(this.first!==null&&this.options.wrap=="circular"&&this.options.size!==null&&(e<=0||e>this.options.size)){j=this.get(this.index(e));if(j.length)g=this.add(e,j.clone(true))}}j=g;m=this.dimension(g);if(l)k+= m;if(this.first!==null&&(this.options.wrap=="circular"||e>=1&&(this.options.size===null||e<=this.options.size)))b=d?b+m:b-m}f=this.clipping();var p=[],o=0,n=0;j=this.get(a-1);for(e=a;++o;){g=this.get(e);l=!g.length;if(g.length===0){g=this.create(e).addClass(this.className("jcarousel-item-placeholder"));j.length===0?this.list.prepend(g):j[d?"before":"after"](g);if(this.first!==null&&this.options.wrap=="circular"&&this.options.size!==null&&(e<=0||e>this.options.size)){j=this.get(this.index(e));if(j.length)g= this.add(e,j.clone(true))}}j=g;m=this.dimension(g);

if(this.options.wrap!="circular"&&this.options.size!==null&&e>this.options.size)p.push(g);else if(l)k+=m;n+=m;if(n>=f)break;e++}for(g=0;g<p.length;g++)p[g].remove();if(k>0){this.list.css(this.wh,this.dimension(this.list)+k+"px");if(d){b-=k;this.list.css(this.lt,h.intval(this.list.css(this.lt))-k+"px")}}k=a+o-1;if(this.options.wrap!="circular"&& this.options.size&&k>this.options.size)k=this.options.size;if(e>k){o=0;e=k;for(n=0;++o;){g=this.get(e--);if(!g.length)break;n+=this.dimension(g);if(n>=f)break}}e=k-o+1;if(this.options.wrap!="circular"&&e<1)e=1;if(this.inTail&&d){b+=this.tail;this.inTail=false}this.tail=null;if(this.options.wrap!="circular"&&k==this.options.size&&k-o+1>=1){d=h.margin(this.get(k),!this.options.vertical?"marginRight":"marginBottom");if(n-d>f)this.tail=n-f-d}if(c&&a===this.options.size&&this.tail){b-=this.tail;this.inTail= true}for(;a-- >e;)b+=this.dimension(this.get(a));this.prevFirst=this.first;this.prevLast=this.last;this.first=e;this.last=k;return b},animate:function(a,c){if(!(this.locked||this.animating)){this.animating=true;var b=this,d=function(){b.animating=false;a===0&&b.list.css(b.lt,0);if(!b.autoStopped&&(b.options.wrap=="circular"||b.options.wrap=="both"||b.options.wrap=="last"||b.options.size===null||b.last<b.options.size||b.last==b.options.size&&b.tail!==null&&!b.inTail))b.startAuto();b.buttons();b.notify("onAfterAnimation"); if(b.options.wrap=="circular"&&b.options.size!==null)for(var f=b.prevFirst;f<=b.prevLast;f++)if(f!==null&&!(f>=b.first&&f<=b.last)&&(f<1||f>b.options.size))b.remove(f)};this.notify("onBeforeAnimation");if(!this.options.animation||c===false){this.list.css(this.lt,a+"px");d()}else this.list.animate(!this.options.vertical?this.options.rtl?{right:a}:{left:a}:{top:a},this.options.animation,this.options.easing,d)}},startAuto:function(a){if(a!==undefined)this.options.auto=a;if(this.options.auto===0)return this.stopAuto(); if(this.timer===null){this.autoStopped=false;var c=this;this.timer=window.setTimeout(function(){c.next()},this.options.auto*1E3)}},stopAuto:function(){this.pauseAuto();this.autoStopped=true},pauseAuto:function(){if(this.timer!==null){window.clearTimeout(this.timer);this.timer=null}},buttons:function(a,c){if(a==null){a=!this.locked&&this.options.size!==0&&(this.options.wrap&&this.options.wrap!="first"||this.options.size===null||this.last<this.options.size);if(!this.locked&&(!this.options.wrap||this.options.wrap== "first")&&this.options.size!==null&&this.last>=this.options.size)a=this.tail!==null&&!this.inTail}if(c==null){c=!this.locked&&this.options.size!==0&&(this.options.wrap&&this.options.wrap!="last"||this.first>1);if(!this.locked&&(!this.options.wrap||this.options.wrap=="last")&&this.options.size!==null&&this.first==1)c=this.tail!==null&&this.inTail}var b=this;if(this.buttonNext.size()>0){this.buttonNext.unbind(this.options.buttonNextEvent+".jcarousel",this.funcNext);a&&this.buttonNext.bind(this.options.buttonNextEvent+ ".jcarousel",this.funcNext);this.buttonNext[a?"removeClass":"addClass"](this.className("jcarousel-next-disabled")).attr("disabled",a?false:true);this.options.buttonNextCallback!==null&&this.buttonNext.data("jcarouselstate")!=a&&this.buttonNext.each(function(){b.options.buttonNextCallback(b,this,a)}).data("jcarouselstate",a)}else this.options.buttonNextCallback!==null&&this.buttonNextState!=a&&this.options.buttonNextCallback(b,null,a);if(this.buttonPrev.size()>0){this.buttonPrev.unbind(this.options.buttonPrevEvent+ ".jcarousel",this.funcPrev);c&&this.buttonPrev.bind(this.options.buttonPrevEvent+".jcarousel",this.funcPrev);this.buttonPrev[c?"removeClass":"addClass"](this.className("jcarousel-prev-disabled")).attr("disabled",c?false:true);this.options.buttonPrevCallback!==null&&this.buttonPrev.data("jcarouselstate")!=c&&this.buttonPrev.each(function(){b.options.buttonPrevCallback(b,this,c)}).data("jcarouselstate",c)}else this.options.buttonPrevCallback!==null&&this.buttonPrevState!=c&&this.options.buttonPrevCallback(b, null,c);this.buttonNextState=a;this.buttonPrevState=c},notify:function(a){var c=this.prevFirst===null?"init":this.prevFirst<this.first?"next":"prev";this.callback("itemLoadCallback",a,c);if(this.prevFirst!==this.first){this.callback("itemFirstInCallback",a,c,this.first);this.callback("itemFirstOutCallback",a,c,this.prevFirst)}if(this.prevLast!==this.last){this.callback("itemLastInCallback",a,c,this.last);this.callback("itemLastOutCallback",a,c,this.prevLast)}this.callback("itemVisibleInCallback", a,c,this.first,this.last,this.prevFirst,this.prevLast);this.callback("itemVisibleOutCallback",a,c,this.prevFirst,this.prevLast,this.first,this.last)},callback:function(a,c,b,d,f,j,e){if(!(this.options[a]==null||typeof this.options[a]!="object"&&c!="onAfterAnimation")){var g=typeof this.options[a]=="object"?this.options[a][c]:this.options[a];if(i.isFunction(g)){var k=this;if(d===undefined)g(k,b,c);else if(f===undefined)this.get(d).each(function(){g(k,this,d,b,c)});else{a=function(m){k.get(m).each(function(){g(k, this,m,b,c)})};for(var l=d;l<=f;l++)l!==null&&!(l>=j&&l<=e)&&a(l)}}}},create:function(a){return this.format("<li></li>",a)},format:function(a,c){a=i(a);for(var b=a.get(0).className.split(" "),d=0;d<b.length;d++)b[d].indexOf("jcarousel-")!=-1&&a.removeClass(b[d]);a.addClass(this.className("jcarousel-item")).addClass(this.className("jcarousel-item-"+c)).css({"float":this.options.rtl?"right":"left","list-style":"none"}).attr("jcarouselindex",c);return a},className:function(a){return a+" "+a+(!this.options.vertical? "-horizontal":"-vertical")},dimension:function(a,c){var b=a.jquery!==undefined?a[0]:a,d=!this.options.vertical?(b.offsetWidth||h.intval(this.options.itemFallbackDimension))+h.margin(b,"marginLeft")+h.margin(b,"marginRight"):(b.offsetHeight||h.intval(this.options.itemFallbackDimension))+h.margin(b,"marginTop")+h.margin(b,"marginBottom");if(c==null||d==c)return d;d=!this.options.vertical?c-h.margin(b,"marginLeft")-h.margin(b,"marginRight"):c-h.margin(b,"marginTop")-h.margin(b,"marginBottom");i(b).css(this.wh, d+"px");return this.dimension(b)},clipping:function(){return!this.options.vertical?this.clip[0].offsetWidth-h.intval(this.clip.css("borderLeftWidth"))-h.intval(this.clip.css("borderRightWidth")):this.clip[0].offsetHeight-h.intval(this.clip.css("borderTopWidth"))-h.intval(this.clip.css("borderBottomWidth"))},index:function(a,c){if(c==null)c=this.options.size;return Math.round(((a-1)/c-Math.floor((a-1)/c))*c)+1}});h.extend({defaults:function(a){return i.extend(q,a||{})},margin:function(a,c){if(!a)return 0; var b=a.jquery!==undefined?a[0]:a;if(c=="marginRight"&&i.browser.safari){var d={display:"block","float":"none",width:"auto"},f,j;i.swap(b,d,function(){f=b.offsetWidth});d.marginRight=0;i.swap(b,d,function(){j=b.offsetWidth});return j-f}return h.intval(i.css(b,c))},intval:function(a){a=parseInt(a,10);return isNaN(a)?0:a}});i.fn.jcarousel=function(a){if(typeof a=="string"){var c=i(this).data("jcarousel"),b=Array.prototype.slice.call(arguments,1);return c[a].apply(c,b)}else return this.each(function(){i(this).data("jcarousel", new h(this,a))})}})(jQuery);

 
function mycarousel_1_initCallback(carousel){

jQuery('#what_is_happening_img').bind('click', function(){ carousel.next();changeCarouselState(carousel,'carousel_1', 'next'); carousel.startAuto(0);return false; });
jQuery('#what_is_happening').bind('click', function(){ carousel.next();changeCarouselState(carousel,'carousel_1', 'next'); carousel.startAuto(0);return false; });
jQuery('#mycarousel_1-next').bind('click', function(){ carousel.next(); changeCarouselState(carousel,'carousel_1', 'next'); carousel.startAuto(0);return false; });
jQuery('#mycarousel_1-prev').bind('click', function(){ carousel.prev(); changeCarouselState(carousel,'carousel_1', 'prev'); carousel.startAuto(0);return false; });


carousel.clip.hover(function(){
carousel.stopAuto();
}, function(){
carousel.startAuto();
});
};

function mycarousel_2_initCallback(carousel){

jQuery('#tomorrow2_img').bind('click', function(){ carousel.next(); changeCarouselState(carousel,'carousel_2', 'next'); carousel.startAuto(0);return false; });
jQuery('#tomorrow2').bind('click', function(){ carousel.next(); changeCarouselState(carousel,'carousel_2', 'next'); carousel.startAuto(0);return false; });
jQuery('#mycarousel_2-next').bind('click', function(){ carousel.next(); changeCarouselState(carousel,'carousel_2', 'next'); carousel.startAuto(0);return false; });
jQuery('#mycarousel_2-prev').bind('click', function(){ carousel.prev(); changeCarouselState(carousel,'carousel_2', 'prev'); carousel.startAuto(0);return false; });


carousel.clip.hover(function(){
carousel.stopAuto();
}, function(){
carousel.startAuto();
});
};

function mycarousel_3_initCallback(carousel){

jQuery('#upcoming_img').bind('click', function(){ carousel.next(); changeCarouselState(carousel,'carousel_3', 'next'); carousel.startAuto(0);return false; });
jQuery('#upcoming').bind('click', function(){ carousel.next(); changeCarouselState(carousel,'carousel_3', 'next'); carousel.startAuto(0);return false; });
jQuery('#mycarousel_3-next').bind('click', function(){ carousel.next(); changeCarouselState(carousel,'carousel_3', 'next'); carousel.startAuto(0);return false; });
jQuery('#mycarousel_3-prev').bind('click', function(){ carousel.prev(); changeCarouselState(carousel,'carousel_3', 'prev'); carousel.startAuto(0);return false; });




carousel.clip.hover(function(){
carousel.stopAuto();
}, function(){
carousel.startAuto();
});
};



function ajaxGetItemsPrev(carousel, date1, date2, limit_total,carousel_id, first)
{
if(first >= 0)
{

$.ajax({
url: URL_BASE +'new_ajax/getSpecialEvents.php',
type: 'GET',
dataType: 'html',
timeout: 5000,
error: function(){

},
data: { date1: date1,
date2: date2,
first: first, 
limit_total: limit_total
},
success: function(html){

mycarousel_itemAddCallback(carousel, first, html);

if(first < 3)
{
switch (carousel_id)
{
case 'mycarousel_1':
$("#home_prev_1").removeClass('prev-enabled');
$("#home_prev_1").addClass('prev-disabled');
break;
case 'mycarousel_2':
$("#home_prev_2").removeClass('prev-enabled');
$("#home_prev_2").addClass('prev-disabled');
break;
case 'mycarousel_3':
$("#home_prev_3").removeClass('prev-enabled');
$("#home_prev_3").addClass('prev-disabled');
break;
}
}
unblock(carousel_id);
}
});
 }
 else
 { 
 unblock(carousel_id);
 }

}



function ajaxGetItems(carousel, date1, date2, limit_total,carousel_id, first)
{

$.ajax({
url: URL_BASE +'new_ajax/getSpecialEvents.php',
type: 'GET',
dataType: 'html',
timeout: 5000,
error: function(){

},
data: { date1: date1,
date2: date2,
first: first, 
limit_total: limit_total
},
success: function(html){
mycarousel_itemAddCallback(carousel, first, html);

switch (carousel_id)
{
case 'mycarousel_1':
$("#home_prev_1").removeClass('prev-disabled');
$("#home_prev_1").addClass('prev-enabled');
break;
case 'mycarousel_2':
$("#home_prev_2").removeClass('prev-disabled');
$("#home_prev_2").addClass('prev-enabled');
break;
case 'mycarousel_3':
$("#home_prev_3").removeClass('prev-disabled');
$("#home_prev_3").addClass('prev-enabled');
break;
}


unblock(carousel_id);
}
});

}

function changeCarouselState(carousel,carousel_id, state)
{

$.ajax({
url: URL_BASE +'new_ajax/changeCarouselState.php',
type: 'GET',
dataType: 'html',
timeout: 5000,
error: function(){

},
data: { carousel_id: carousel_id,
state: state
},
success: function(html){

 var first = parseFloat(html);
var carousel_id = carousel.options.id;
var date1 = carousel.options.date1;
var date2 = carousel.options.date2;

if(state == 'prev' && carousel.first == 1 && carousel.last == 3)
{
block(carousel_id);
ajaxGetItemsPrev(carousel, date1, date2, LIMIT_TOTAL, carousel_id, first);
}
else
{ 
for (var i = carousel.first; i <= carousel.last; i++)
{
if(state == 'next')
{
block(carousel_id);
ajaxGetItems(carousel, date1, date2, LIMIT_TOTAL, carousel_id, first);
}

break;
}
}

}
});
} 

function mycarousel_itemAddCallback(carousel, first, data)
{
if(carousel.first == 1)
first = 0;

first = first +1;
$(data).each(function(i){
carousel.add(first + i, this);
});
};




jQuery(document).ready(function(){

jQuery("#mycarousel_1").jcarousel({
id: 'mycarousel_1',
initCallback: mycarousel_1_initCallback,
scroll: 3, 
wrap: 'last',
size: TOTAL_SPECIAL_EVENTS_TWO_WEEKS,
date1: TODAY_DATE,
date2: IN_TWO_WEEKS_DATE

});

jQuery("#mycarousel_2").jcarousel({
id: 'mycarousel_2',
initCallback: mycarousel_2_initCallback,
scroll: 3,
wrap: 'last',
size: TOTAL_SPECIAL_EVENTS_FOUR_WEEKS,
date1: IN_TWO_WEEKS_DATE,
date2: IN_FOUR_WEEKS_DATE
});

jQuery("#mycarousel_3").jcarousel({
id: 'mycarousel_3',
initCallback: mycarousel_3_initCallback,
scroll: 3,
wrap: 'last',
size: TOTAL_SPECIAL_EVENTS_FOUR_WEEKS_AND_MORE,
date1: IN_FOUR_WEEKS_DATE,
date2: -1
});


});

(function(d){var k=d.browser.msie&&parseInt(d.browser.version)===6&&typeof window.XMLHttpRequest!=="object",m=d.browser.msie&&parseInt(d.browser.version)===7,l=null,f=[];d.modal=function(a,b){return d.modal.impl.init(a,b)};d.modal.close=function(){d.modal.impl.close()};d.modal.focus=function(a){d.modal.impl.focus(a)};d.modal.setContainerDimensions=function(){d.modal.impl.setContainerDimensions()};d.modal.setPosition=function(){d.modal.impl.setPosition()};d.modal.update=function(a,b){d.modal.impl.update(a,
b)};d.fn.modal=function(a){return d.modal.impl.init(this,a)};d.modal.defaults={appendTo:"body",focus:true,opacity:50,overlayId:"simplemodal-overlay",overlayCss:{},containerId:"simplemodal-container",containerCss:{},dataId:"simplemodal-data",dataCss:{},minHeight:null,minWidth:null,maxHeight:null,maxWidth:null,autoResize:false,autoPosition:true,zIndex:1E3,close:true,closeHTML:'<a class="modalCloseImg" title="Close"></a>',closeClass:"simplemodal-close",escClose:true,overlayClose:false,position:null,
persist:false,modal:true,onOpen:null,onShow:null,onClose:null};d.modal.impl={d:{},init:function(a,b){var c=this;if(c.d.data)return false;l=d.browser.msie&&!d.boxModel;c.o=d.extend({},d.modal.defaults,b);c.zIndex=c.o.zIndex;c.occb=false;if(typeof a==="object"){a=a instanceof jQuery?a:d(a);c.d.placeholder=false;if(a.parent().parent().size()>0){a.before(d("<span></span>").attr("id","simplemodal-placeholder").css({display:"none"}));c.d.placeholder=true;c.display=a.css("display");if(!c.o.persist)c.d.orig=
a.clone(true)}}else if(typeof a==="string"||typeof a==="number")a=d("<div></div>").html(a);else{alert("SimpleModal Error: Unsupported data type: "+typeof a);return c}c.create(a);c.open();d.isFunction(c.o.onShow)&&c.o.onShow.apply(c,[c.d]);return c},create:function(a){var b=this;f=b.getDimensions();if(b.o.modal&&k)b.d.iframe=d('<iframe src="javascript:false;"></iframe>').css(d.extend(b.o.iframeCss,{display:"none",opacity:0,position:"fixed",height:f[0],width:f[1],zIndex:b.o.zIndex,top:0,left:0})).appendTo(b.o.appendTo);
b.d.overlay=d("<div></div>").attr("id",b.o.overlayId).addClass("simplemodal-overlay").css(d.extend(b.o.overlayCss,{display:"none",opacity:b.o.opacity/100,height:b.o.modal?f[0]:0,width:b.o.modal?f[1]:0,position:"fixed",left:0,top:0,zIndex:b.o.zIndex+1})).appendTo(b.o.appendTo);b.d.container=d("<div></div>").attr("id",b.o.containerId).addClass("simplemodal-container").css(d.extend(b.o.containerCss,{display:"none",position:"fixed",zIndex:b.o.zIndex+2})).append(b.o.close&&b.o.closeHTML?d(b.o.closeHTML).addClass(b.o.closeClass):
"").appendTo(b.o.appendTo);b.d.wrap=d("<div></div>").attr("tabIndex",-1).addClass("simplemodal-wrap").css({height:"100%",outline:0,width:"100%"}).appendTo(b.d.container);b.d.data=a.attr("id",a.attr("id")||b.o.dataId).addClass("simplemodal-data").css(d.extend(b.o.dataCss,{display:"none"})).appendTo("body");b.setContainerDimensions();b.d.data.appendTo(b.d.wrap);if(k||l)b.fixIE()},bindEvents:function(){var a=this;d("."+a.o.closeClass).bind("click.simplemodal",function(b){b.preventDefault();a.close()});
a.o.modal&&a.o.close&&a.o.overlayClose&&a.d.overlay.bind("click.simplemodal",function(b){b.preventDefault();a.close()});d(document).bind("keydown.simplemodal",function(b){if(a.o.modal&&b.keyCode===9)a.watchTab(b);else if(a.o.close&&a.o.escClose&&b.keyCode===27){b.preventDefault();a.close()}});d(window).bind("resize.simplemodal",function(){f=a.getDimensions();a.o.autoResize?a.setContainerDimensions():a.o.autoPosition&&a.setPosition();if(k||l)a.fixIE();else if(a.o.modal){a.d.iframe&&a.d.iframe.css({height:f[0],
width:f[1]});a.d.overlay.css({height:f[0],width:f[1]})}})},unbindEvents:function(){d("."+this.o.closeClass).unbind("click.simplemodal");d(document).unbind("keydown.simplemodal");d(window).unbind("resize.simplemodal");this.d.overlay.unbind("click.simplemodal")},fixIE:function(){var a=this,b=a.o.position;d.each([a.d.iframe||null,!a.o.modal?null:a.d.overlay,a.d.container],function(c,h){if(h){var g=h[0].style;g.position="absolute";if(c<2){g.removeExpression("height");g.removeExpression("width");g.setExpression("height",
'document.body.scrollHeight > document.body.clientHeight ? document.body.scrollHeight : document.body.clientHeight + "px"');g.setExpression("width",'document.body.scrollWidth > document.body.clientWidth ? document.body.scrollWidth : document.body.clientWidth + "px"')}else{var e;if(b&&b.constructor===Array){c=b[0]?typeof b[0]==="number"?b[0].toString():b[0].replace(/px/,""):h.css("top").replace(/px/,"");c=c.indexOf("%")===-1?c+' + (t = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop)+ "px"':
parseInt(c.replace(/%/,""))+' * ((document.documentElement.clientHeight || document.body.clientHeight)/ 100)+ (t = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop)+ "px"';if(b[1]){e=typeof b[1]==="number"?b[1].toString():b[1].replace(/px/,"");e=e.indexOf("%")===-1?e+' + (t = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft)+ "px"':parseInt(e.replace(/%/,""))+' * ((document.documentElement.clientWidth || document.body.clientWidth)/ 100)+ (t = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft)+ "px"'}}else{c=
'(document.documentElement.clientHeight || document.body.clientHeight)/ 2 - (this.offsetHeight / 2)+ (t = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop)+ "px"';e='(document.documentElement.clientWidth || document.body.clientWidth)/ 2 - (this.offsetWidth / 2)+ (t = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft)+ "px"'}g.removeExpression("top");g.removeExpression("left");g.setExpression("top",
c);g.setExpression("left",e)}}})},focus:function(a){var b=this;a=a&&d.inArray(a,["first","last"])!==-1?a:"first";var c=d(":input:enabled:visible:"+a,b.d.wrap);setTimeout(function(){c.length>0?c.focus():b.d.wrap.focus()},10)},getDimensions:function(){var a=d(window);return[d.browser.opera&&d.browser.version>"9.5"&&d.fn.jquery<"1.3"||d.browser.opera&&d.browser.version<"9.5"&&d.fn.jquery>"1.2.6"?a[0].innerHeight:a.height(),a.width()]},getVal:function(a,b){return a?typeof a==="number"?a:a==="auto"?0:
a.indexOf("%")>0?parseInt(a.replace(/%/,""))/100*(b==="h"?f[0]:f[1]):parseInt(a.replace(/px/,"")):null},update:function(a,b){var c=this;if(!c.d.data)return false;c.d.origHeight=c.getVal(a,"h");c.d.origWidth=c.getVal(b,"w");c.d.data.hide();a&&c.d.container.css("height",a);b&&c.d.container.css("width",b);c.setContainerDimensions();c.d.data.show();c.o.focus&&c.focus();c.unbindEvents();c.bindEvents()},setContainerDimensions:function(){var a=this,b=k||m,c=a.d.origHeight?a.d.origHeight:d.browser.opera?
a.d.container.height():a.getVal(b?a.d.container[0].currentStyle.height:a.d.container.css("height"),"h");b=a.d.origWidth?a.d.origWidth:d.browser.opera?a.d.container.width():a.getVal(b?a.d.container[0].currentStyle.width:a.d.container.css("width"),"w");var h=a.d.data.outerHeight(true),g=a.d.data.outerWidth(true);a.d.origHeight=a.d.origHeight||c;a.d.origWidth=a.d.origWidth||b;var e=a.o.maxHeight?a.getVal(a.o.maxHeight,"h"):null,i=a.o.maxWidth?a.getVal(a.o.maxWidth,"w"):null;e=e&&e<f[0]?e:f[0];i=i&&i<
f[1]?i:f[1];var j=a.o.minHeight?a.getVal(a.o.minHeight,"h"):"auto";c=c?a.o.autoResize&&c>e?e:c<j?j:c:h?h>e?e:a.o.minHeight&&j!=="auto"&&h<j?j:h:j;e=a.o.minWidth?a.getVal(a.o.minWidth,"w"):"auto";b=b?a.o.autoResize&&b>i?i:b<e?e:b:g?g>i?i:a.o.minWidth&&e!=="auto"&&g<e?e:g:e;a.d.container.css({height:c,width:b});a.d.wrap.css({overflow:h>c||g>b?"auto":"visible"});a.o.autoPosition&&a.setPosition()},setPosition:function(){var a=this,b,c;b=f[0]/2-a.d.container.outerHeight(true)/2;c=f[1]/2-a.d.container.outerWidth(true)/
2;if(a.o.position&&Object.prototype.toString.call(a.o.position)==="[object Array]"){b=a.o.position[0]||b;c=a.o.position[1]||c}else{b=b;c=c}a.d.container.css({left:c,top:b})},watchTab:function(a){var b=this;if(d(a.target).parents(".simplemodal-container").length>0){b.inputs=d(":input:enabled:visible:first, :input:enabled:visible:last",b.d.data[0]);if(!a.shiftKey&&a.target===b.inputs[b.inputs.length-1]||a.shiftKey&&a.target===b.inputs[0]||b.inputs.length===0){a.preventDefault();b.focus(a.shiftKey?"last":
"first")}}else{a.preventDefault();b.focus()}},open:function(){var a=this;a.d.iframe&&a.d.iframe.show();if(d.isFunction(a.o.onOpen))a.o.onOpen.apply(a,[a.d]);else{a.d.overlay.show();a.d.container.show();a.d.data.show()}a.o.focus&&a.focus();a.bindEvents()},close:function(){var a=this;if(!a.d.data)return false;a.unbindEvents();if(d.isFunction(a.o.onClose)&&!a.occb){a.occb=true;a.o.onClose.apply(a,[a.d])}else{if(a.d.placeholder){var b=d("#simplemodal-placeholder");if(a.o.persist)b.replaceWith(a.d.data.removeClass("simplemodal-data").css("display",
a.display));else{a.d.data.hide().remove();b.replaceWith(a.d.orig)}}else a.d.data.hide().remove();a.d.container.hide().remove();a.d.overlay.hide();a.d.iframe&&a.d.iframe.hide().remove();setTimeout(function(){a.d.overlay.remove();a.d={}},10)}}}})(jQuery);
$(document).ready(function(){



if(document.URL == URL_BASE)
checkGeoLocationCookie();

 
var tp1 = new Spry.Widget.TabbedPanels("tp1", { defaultTab: 0 });
var TabbedPanels1 = new Spry.Widget.TabbedPanels("TabbedPanels1");
var TabbedPanels2 = new Spry.Widget.TabbedPanels("TabbedPanels2");
var TabbedPanels3 = new Spry.Widget.TabbedPanels("TabbedPanels3");
var TabbedPanels4 = new Spry.Widget.TabbedPanels("TabbedPanels4");
var TabbedPanels6 = new Spry.Widget.TabbedPanels("TabbedPanels6");


var msie6 = $.browser == 'msie' && $.browser.version < 7;
var minimum_value_to_scroll_to = 500;
var value_tostract = 250;


$(function(){ $('img.lazy').jail(); });

if($('#advertisment').offset()!= null)
{



var BIG_BOX_OFFSET_TOP = $('.join-us').height()+$('#special_events_calendar').height()+ $('#deals-and-steals').height()+$('#facebook-feed').height()+ $('#tweeter-feed').height()+ $('#supplementary').height()+ 880;

if (!msie6)
{
var top = $('#advertisment').offset().top - parseFloat($('#advertisment').css('margin-top').replace(/auto/, 0))+ 470;
$(window).scroll(function (event)
{


var y = $(this).scrollTop();

if (y>= top)
{


new_value_to_scroll_to = $('#main_container').height()- value_tostract;
minimum_value_to_scroll_to = new_value_to_scroll_to;






if(y < (minimum_value_to_scroll_to +60))
{

$('#advertisment').addClass('fixed');
$('#advertisment').offset({ top: y+10 });
}
else
{
$('#advertisment').removeClass('fixed');
$('#advertisment').offset({ top: minimum_value_to_scroll_to +60});
}
} 
else 
{
$('#advertisment').removeClass('fixed');
$('#advertisment').offset({ top: BIG_BOX_OFFSET_TOP});

}
});
} 
}

var cat_id = $('#category_id_for_banners').val();
var cat_type = $('#category_type_for_banners').val();

if(cat_id != null)
{
loadBanners(null,cat_id,null,cat_type);

if($('#main_container').height()> BIG_BOX_OFFSET_TOP)
loadBanners_SMART(null,cat_id,null,cat_type);
}
else
{
loadBanners(null,null,null);
if($('#main_container').height()> BIG_BOX_OFFSET_TOP)
loadBanners_SMART(null,null,null);
}




 $('#join_us_input').bind('keyup', function(e){
if(e.keyCode == 13)
{
joinUsClicked('join_us_input');
joinUsClicked('join_us_input_not_logged_in');
}
});

});

function hideSmartBanners()
{

$('#advertisment').hide();
}

function showSmartBanners()
{

$('#advertisment').show();
}


function checkGeoLocation()
{
$.ajax({
url: URL_BASE + 'new_ajax/geoLocation/checkGeoLocation.php',
type: 'GET',
dataType: 'html',
timeout: 5000,
error: function(){

},
data: { 
},
success: function(html){
var myReturn = eval('(' + html + ')');

 if (myReturn.value == "update")
 {
 if(navigator.geolocation)
 {
navigator.geolocation.getCurrentPosition(renderPosition, renderError);
}
 } 
}
}); 
}


function renderPosition(position)
{

$.ajax({
url: URL_BASE + 'new_ajax/geoLocation/updateGeoLocation.php',
type: 'GET',
dataType: 'html',
timeout: 5000,
error: function(){

},
data: { 
latitude: position.coords.latitude,
longitude: position.coords.longitude
},
success: function(html)
{ 

}
});


}

function renderError()
{

}



function changeSiteLanguage(langId)
{
$.ajax({
url: URL_BASE + 'new_ajax/changeSiteLanguage.php',
type: 'GET',
dataType: 'html',
timeout: 5000,
error: function(){

},
data: { 
langId: langId
},
success: function(html){ 

window.location =window.location.pathname;
}
});
}

function scrollTo(scrollToId)
{

var target_offset = $("#" + scrollToId).offset();
var target_top = target_offset.top;


$('html, body').animate({scrollTop:target_top}, 500); 
}



function loadBanners_SMART(key_words,master_category_id,sub_category_id)
{
var banners=["big_box_1_banner_SMART","big_box_2_banner_SMART"];

for ( bannerId in banners)
{
myLoadBanner(key_words,master_category_id,sub_category_id,'activity',banners[bannerId]);
}

}

function loadBanners(key_words,category_id, sub_category_id, category_type)
{ 
var banners=["top_banner","big_box_1_banner","big_box_2_banner"]; 

for ( bannerId in banners)
{
myLoadBanner(key_words,category_id,sub_category_id,category_type,banners[bannerId]);
}
}

function myLoadBanner(key_words,category_id,sub_category_id,category_type, container_id)
{
block(container_id);

loadBanner(key_words,category_id, sub_category_id, category_type, container_id, function(html,banner_container_id){

$('#'+banner_container_id).html(html);



window.setTimeout(function(){
unblock(banner_container_id);
}, 2000);
});

}



function loadBanner(key_words, category_id,sub_category_id,category_type,container_id,callback)
{
$.ajax({
url: URL_BASE + 'new_ajax/banners/get_banner_iFrame.php',
type: 'GET',
async: true,
dataType: 'html',
timeout: 20000,
error: function(){

},
data: { 
banner_id: container_id,
category_id: category_id,
sub_category_id: sub_category_id,
category_type:category_type,
key_words: key_words
},
success: function(html){
if (callback && typeof(callback)=== "function")
{

callback(html,container_id);
}


}
});
}

function bannerLoadedCallback(container_id, html)
{
$('#'+container_id).html(html);



window.setTimeout(function(){
unblock(container_id);
}, 2000); 
}

function loadScoopCafe()
{
block('scoop_cafe');
$.ajax({
url: URL_BASE + 'new_ajax/scoopCafee.php',
type: 'GET',
dataType: 'html',
timeout: 5000,
error: function(){

},
data: { },
success: function(html){
$('#scoop_cafe').html(html);
$('#scoop_cafee').list_ticker({
speed:9000,
effect:'slide'
}); 

$('.scoop_cafe_timer').attr('src', URL_BASE+'new_img/timer_gray.gif');
unblock('scoop_cafe');
}
});
}


function block(container_id)
{
$('#'+container_id).addClass('blocked');
};

function unblock(container_id)
{
$('#'+container_id).removeClass('blocked');
};

function blink(container_id)
{
$('#'+container_id).fadeTo("fast", 0);
$('#'+container_id).fadeTo("fast", 1);
}

function isValidEmail(email)
{
var emailPattern = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/;
return emailPattern.test(email);
}

function clearEmail(inputId)
{
$('#'+inputId).removeClass('red');
$('#'+inputId).addClass('blue');

if($('#'+inputId).val()== Please_Enter_Your_Email)
$('#'+inputId).val('');

}

function clearLoginEmail()
{
 $('#login_username').removeClass('red'); 
 $('#login_username').addClass('blue');

if($('#login_username').val()== Please_Enter_Your_Email)
$('#login_username').val('');
 
}

function clearLoginEmail2(id)
{
 $('#'+id).removeClass('red'); 
 $('#'+id).addClass('blue');

if($('#'+id).val()== Please_Enter_Your_Email)
$('#'+id).val('');
 
}


function loginEmailEntered()
{
if($('#login_username').val()== '')
$('#login_username').val(Please_Enter_Your_Email);

if(!isValidEmail($('#login_username').val()))
{
$('#login_username').addClass('red');
$('#login_username').removeClass('blue');
}
}



function EmailEntered(inputId)
{
if($('#'+inputId).val()== '')
$('#'+inputId).val(Please_Enter_Your_Email);

if(!isValidEmail($('#'+inputId).val()))
{
$('#'+inputId).addClass('red');
$('#'+inputId).removeClass('blue');
} 
}


function joinUsClickedLogIn()
{

$('#basic-modal-content').load(URL_BASE + 'new_ajax/getJoinUs.php').modal({
minHeight:200,
minWidth: 680
});
 
}

function joinUsClicked(inputId)
{
if(isValidEmail($('#'+inputId).val()))
{
createParentAccount($('#'+inputId).val());
}
else
{
$('#basic-modal-content').load(URL_BASE + 'new_ajax/getJoinUsIncorrectEmail.php?email='+escape($('#'+inputId).val())).modal({
minHeight:350,
minWidth: 680
});
}
}

function forgotPasswordSentEmailClicked(inputId)
{
if(isValidEmail($('#'+inputId).val()))
{
$.ajax({
url: URL_BASE + 'new_ajax/sendForgottenPasswordEmail.php',
type: 'GET',
dataType: 'html',
timeout: 5000,
error: function(){
return Creation_Of_The_Parent_Acount_Failed;
},
data: {
email: $('#'+inputId).val()
 },
success: function(html){
var response = html.split('|');
if(response[0] != 'error')
{
$('#basic-modal-content').load(URL_BASE + 'new_ajax/showMessage.php?Msg='+escape(response[1])).modal({
minHeight:350,
minWidth: 400
});
}
else
{
$('#basic-modal-content').load(URL_BASE + 'new_ajax/showErrorMessage.php?errorMsg='+escape(response[1])).modal({
minHeight:350,
minWidth: 400
});
}
}
});
}
else
{
EmailEntered(inputId);
}
}

function showKSVideo()
{
$('#basic-modal-content').load(URL_BASE + 'new_ajax/showVideo.php').modal({
minHeight:410,
minWidth: 660
});
}

function addNewChildClicked()
{
window.location =window.location.pathname+'?child_profile_container_new_child';
}

function addMoreActivitiesClicked()
{
window.location =window.location.pathname+'?family';
}

function goToTheActivitiesClicked()
{
window.location =URL_BASE+'parent-profile/upcoming-events';
}

function openProfileCompletedMessage(childId)
{
$('#basic-modal-content').load(URL_BASE + 'new_ajax/getProfileCompletedMessage.php?'+childId).modal({
minHeight:300,
minWidth: 750
});
}

function openProfileNotCompletedMessage(shared)
{
$('#basic-modal-content').load(URL_BASE + 'new_ajax/getProfileNotCompletedMessage.php?shared='+shared).modal({
minHeight:370,
minWidth: 750
});
}

function openMissingChildrenInfoMessage()
{
$('#basic-modal-content').load(URL_BASE + 'new_ajax/getMissingChildrenInfoMessage.php').modal({
minHeight:310,
minWidth: 700
});

}

function createParentAccount(email)
{
var url_from = document.URL.split(URL_BASE)[1].split('/')[0];


$.ajax({
url: URL_BASE + 'new_ajax/createParentAccount.php',
type: 'GET',
dataType: 'html',
timeout: 5000,
error: function(){
$('#basic-modal-content').load(URL_BASE + 'new_ajax/showErrorMessage.php?errorMsg='+escape('Adding to Constant Contact Timed Out, Please Report this problem to the Administrator <a href="mailto:info@thekidscoop.com" >info@thekidscoop.com</a>')).modal({
minHeight:350,
minWidth: 500
}); 

},
data: {
email: email
 },
success: function(html){
if(!isNaN(html))
{
redirectToParentProfilePage(html);
checkCalendarSharing(email);


}
else
{
$('#basic-modal-content').load(URL_BASE + 'new_ajax/showErrorMessage.php?errorMsg='+escape(html)).modal({
minHeight:350,
minWidth: 500
});
}
}
}); 

}

function redirectToParentProfilePage(parentId)
{

window.location = URL_BASE+ 'thank-you-for-joining'; 
}

function showLoginWindow()
{
$('#login_form').slideDown();
}

function hideLoginWindow()
{
$('#login_form').slideUp();
}

function showForgotPasswordWindow()
{
$('#basic-modal-content').load(URL_BASE + 'new_ajax/showForgotPasswordWindow.php').modal({
minHeight:350,
minWidth: 400
});
}

function showLocations(inputId)
{
var masterLocationId = -1;
var locations= $('#input_'+inputId).html();

switch(inputId)
{
case 'country':
masterLocationId = 0;
$('#basic-modal-content').load(URL_BASE + 'new_ajax/getLocationsForVoken.php?inputId='+inputId+'&locations='+escape(locations)+'&masterLocationId='+masterLocationId+'&location_type='+inputId).modal({
minHeight:110,
minWidth: 400
});
break;
case 'state':
masterLocationId = $('#input_country').html();
if(masterLocationId != '')
{
$('#basic-modal-content').load(URL_BASE + 'new_ajax/getLocationsForVoken.php?inputId='+inputId+'&locations='+escape(locations)+'&masterLocationId='+masterLocationId+'&location_type='+inputId).modal({
minHeight:360,
minWidth: 640
});
}
else
{
var errorMsg = Please_Select_A_Contry_First; 
$('#basic-modal-content').load(URL_BASE + 'new_ajax/showErrorMessage.php?errorMsg='+escape(errorMsg)).modal({
minHeight:350,
minWidth: 400
});
}
break;
case 'city':
masterLocationId = $('#input_state').html();

if(masterLocationId != '')
{
$('#basic-modal-content').load(URL_BASE + 'new_ajax/getLocationsForVoken.php?inputId='+inputId+'&locations='+escape(locations)+'&masterLocationId='+masterLocationId+'&location_type='+inputId).modal({
minHeight:400,
minWidth: 400
});
}
else
{
var errorMsg = Please_Select_A_Province_First; 
$('#basic-modal-content').load(URL_BASE + 'new_ajax/showErrorMessage.php?errorMsg='+escape(errorMsg)).modal({
minHeight:350,
minWidth: 400
});
}
break;
} 
}

function selectMasterLocation(location_id)
{
$('#'+location_id).attr('checked',true);
}

function showMultipleLocations(inputId)
{
masterLocationId = $('#input_state').html();

if(masterLocationId != '')
{
var locations = $('#input_city').html().replace(/\|/g,'');
$('#basic-modal-content').load(URL_BASE + 'new_ajax/getMultipleLocationsForVoken.php?inputId='+inputId+'&locations='+escape(locations)+'&masterLocationId='+masterLocationId+'&location_type='+inputId).modal({
minHeight:450,
minWidth: 835
});
}
else
{
 var errorMsg = 'Please Select a Province first'; 
$('#basic-modal-content').load(URL_BASE + 'new_ajax/showErrorMessage.php?errorMsg='+escape(errorMsg)).modal({
minHeight:350,
minWidth: 400
});
}
}

function multipleCitiesSelected()
{
var cities = '';
var locationIds = '';
$('#content_locations_city input:checked').each(function()
{
var checked_info = $(this).val().split('|');
cities +=checked_info[0]+', ';
locationIds += '|'+checked_info[1]+'|,';
}); 

$('#city').html(cities);
$('#input_city').html(locationIds);
$.modal.close();
}

function singleLocationSelected(inputIdId, locationId, locationName)
{
$('#'+inputIdId).html(locationName);
$('#input_'+inputIdId).html(locationId);

switch(inputIdId)
{
case 'country':
$('#input_country').html(locationId);
$('#state').html('');
$('#input_state').html('');
$('#city').html('');
$('#input_city').html('');
break;
case 'state':
$('#input_state').html(locationId);
$('#city').html('');
$('#input_city').html('');
break;
case 'city':
break;
}

$.modal.close();
}

function saveParentInformation(isNewParent)
{

if($('#input_city').html()== '')
{
showMultipleLocations('city');
}
else
{
block('parent_info');

var lang = 'en';
if($('#parentProfile_language_en').attr('checked'))
lang = '2';
else if ($('#parentProfile_language_fr').attr('checked'))
lang = '1';

 $.ajax({
url: URL_BASE + 'new_ajax/saveParentProfile.php',
type: 'GET',
dataType: 'html',
timeout: 5000,
error: function(){

},
data: { 
parentProfile_email: $('#parentProfile_email').val(),
parentProfile_language: lang,
parentProfile_password: $('#parentProfile_password').val(),
parentProfile_password_confirm: $('#parentProfile_password_confirm').val(),
parentProfile_firstname: $('#parentProfile_firstname').val(),
parentProfile_lastname: $('#parentProfile_lastname').val(),
parentProfile_postal_code: $('#parentProfile_postal_code').val(),
input_country: $('#input_country').html(),
input_state: $('#input_state').html(),
input_city: $('#input_city').html()
},
success: function(html){
if(jQuery.trim(html)!= 'all_good')
{
$('#save_button').html(Not_Saved);
handleParentProfileErrors(html);
}
else
{
$('#save_button').html(Saved);
if(isNewParent != 'false')
{
window.location = URL_BASE + 'parent-profile/parent_family_information?family&parent=new';
}
}

unblock('parent_info');
}
});
 }
}

function handleParentProfileErrors(html)
{
var errors = $.parseJSON(html);
var error_postal_code = (typeof(errors.inputs.postal_code)== "undefined")?'': errors.inputs.postal_code;
var error_password = (typeof(errors.inputs.password)== "undefined")?'': errors.inputs.password;
var error_password_confirm = (typeof(errors.inputs.password_confirm)== "undefined")?'': errors.inputs.password_confirm;

var errorMsg = '<p>'+error_postal_code+'</p><p>'+error_password+'</p><p>'+error_password_confirm+'</p>';

$('#basic-modal-content').load(URL_BASE + 'new_ajax/showErrorMessage.php?errorMsg='+escape(errorMsg)).modal({
minHeight:350,
minWidth: 400
});
}

function addToSelected(categoryInfo, childId)
{

var categoryId = categoryInfo.split('|')[0];
var categoryName = categoryInfo.split('|')[1];

var master_optGroup_item_id = $('#unassociated_groups_'+childId+' option:selected').attr('class');
var master_optGroup_label = $('#'+master_optGroup_item_id).attr('label'); 
var master_optGroup_id = $('#'+master_optGroup_item_id).attr('id');



$('#unassociated_groups_'+childId+' option:selected').remove();


if($('#selected_'+master_optGroup_id).html()== null)
{
$('#associated_groups_'+childId).prepend($("<optgroup></optgroup>").attr("id",'selected_'+master_optGroup_id).attr("label",master_optGroup_label));
}

$('#selected_'+master_optGroup_id).prepend($("<option></option>").attr("value",categoryId+'|'+categoryName).attr("id",'selected_category_'+categoryId).attr("class",'selected_'+master_optGroup_id).text(categoryName));
}

function removeFromSelected(categoryInfo,childId)
{
var categoryId = categoryInfo.split('|')[0];
var categoryName = categoryInfo.split('|')[1];

var master_optGroup_item_id = $('#associated_groups_'+childId+' option:selected').attr('class');
var master_optGroup_label = $('#'+master_optGroup_item_id).attr('label');
var master_optGroup_id = $('#'+master_optGroup_item_id).attr('id');

$('#associated_groups_'+childId+' option:selected').remove();


if($('#'+master_optGroup_id).html()== null)
{
$('#unassociated_groups_'+childId).prepend($("<optgroup></optgroup>").attr("id",master_optGroup_id.replace('selected_','')).attr("label",master_optGroup_label));
}


$('#'+master_optGroup_id.replace('selected_','')).prepend($("<option></option>").attr("value",categoryId+'|'+categoryName).attr("id",'category_'+categoryId).attr("class",master_optGroup_id.replace('selected_','')).text(categoryName));


if($('#'+master_optGroup_id).children('option').length == 0)
$('#'+master_optGroup_id).remove();
}

function deleteChild(childId)
{
$( "#dialog-confirm_"+childId).dialog({
resizable: false,
height:110,
width:350,
modal: true,
buttons: {
Delete: function(){
ajaxDeleteChild(childId);
$( this).dialog( "close");
},
Cancel: function(){
$( this).dialog( "close");
}
}
});
}

function ajaxDeleteChild(childId)
{


block('child_profile_container_'+childId);

 $.ajax({
url: URL_BASE + 'new_ajax/deleteChildProfile.php',
type: 'POST',
dataType: 'html',
timeout: 5000,
error: function(){

},
data: { 
childId: childId
},
success: function(html){
if(html != '-1')
{
unblock('child_profile_container_'+childId);
$('#child_profile_container_'+childId).hide();
$('#child_separator_'+childId).hide();
$( "#dialog_"+childId+" p").html(html);
$( "#dialog_"+childId).dialog({
modal: true,
height: 100,
buttons: {
Ok: function(){
$( this).dialog( "close");
window.location =window.location.pathname;
}
}

});
}
else
{
$( "#dialog_"+childId+" p").html(Child_Not_Deleted);
$( "#dialog_"+childId).dialog({
modal: true,
height: 100,
buttons: {
Ok: function(){
$( this).dialog( "close");
}
}
});
unblock('child_profile_container_'+childId);
}
}
});

}

function savechild(childId)
{

var gender = '';
var interests = new Array();

if($('#child_gender_male'+childId).attr('checked'))
gender = $('#child_gender_male'+childId).val();
else if($('#child_gender_female'+childId).attr('checked'))
gender = $('#child_gender_female'+childId).val();

$('#associated_groups_'+childId+' option').each(function()
{
 interests.push($(this).val()); 
 });


if($('#child_name_'+childId).val()== '')
{
$( "#dialog_no_name_"+childId+" p").html('Please enter a Nick Name for your child, <br/><br/><b>We only need this to help you personalize your profile!</b><br/>&nbsp;<br/>');
$( "#dialog_no_name_"+childId).dialog({
modal: true,
height: 160,
buttons: {
Ok: function(){
$( this).dialog( "close");
}
}

});
}
else if(($('#child_birth_date_'+childId+'_year').val()== '0' || $('#child_birth_date_'+childId+'_month').val()== '0' || $('#child_birth_date_'+childId+'_day').val()== '0'))
{
$( "#dialog_no_birth_day_"+childId+" p").html('Please enter a Birth Date for your child, <br/><br/><b>We only need this to propose activities that match your kid\'s age.. not to send them a birthday gift!</b><br/>&nbsp;<br/>');
$( "#dialog_no_birth_day_"+childId).dialog({
modal: true,
height: 160,
buttons: {
Ok: function(){
$( this).dialog( "close");
}
}

});
}
else if(interests.length == 0)
{

$( "#dialog_no_interests_"+childId+" p").html('Please Add Some Activity Interests for your child, <br/><br/><b>We need this to propose activities that match your kid\'s Interests</b><br/>&nbsp;<br/>');
$( "#dialog_no_interests_"+childId).dialog({
modal: true,
height: 160,
buttons: {
Ok: function(){
$( this).dialog( "close");
}
}

});
}
else
{
var birth_date = '';
if(childId == 'new_child')
{
birth_date = $('#child_birth_date_'+childId+'_year').val()+'-'+$('#child_birth_date_'+childId+'_month').val()+'-'+$('#child_birth_date_'+childId+'_day').val();
}
else
birth_date = $('#child_birth_date_'+childId).val();

if(birth_date == '')
{
$( "#dialog_no_birth_day_"+childId+" p").html('Please enter a Birth Date for your child, <br/><br/><b>We only need this to propose activities that match your kid\'s age.. not to send them a birthday gift!</b><br/>&nbsp;<br/>');
$( "#dialog_no_birth_day_"+childId).dialog({
modal: true,
height: 160,
buttons: {
Ok: function(){
$( this).dialog( "close");
}
}

});
}
else
{

block('child_profile_container_'+childId);

 $.ajax({
url: URL_BASE + 'new_ajax/saveChildProfile.php',
type: 'POST',
dataType: 'html',
timeout: 5000,
error: function(){

},
data: { 
childId: childId,
nickName: $('#child_name_'+childId).val(),
gender: gender,
birthDate: birth_date,
parent_id: $('#parent_id_'+childId).val(),
interests: interests
},
success: function(html){


if(childId == 'new_child')
{
_gaq.push(['_trackEvent', 'Parent Logged In', 'New Child', 'Child Created']);
_gaq.push(['_trackEvent', 'Parent Logged In', 'New Child -Interests', interests]);
_gaq.push(['_trackEvent', 'Parent Logged In', 'New Child -BirthDay', birth_date]);
_gaq.push(['_trackEvent', 'Parent Logged In', 'New Child -Gender', gender]);

}
else
{
_gaq.push(['_trackEvent', 'Parent Logged In', 'Child Updated -Interests', interests]);
_gaq.push(['_trackEvent', 'Parent Logged In', 'Child Updated -BirthDay', birth_date]);
_gaq.push(['_trackEvent', 'Parent Logged In', 'Child Updated -Gender', gender]);
}

if(isNaN(jQuery.trim(html)))
{
$('#save_button_long_'+childId).html(Not_Saved);
handleParentProfileErrors(html);
}
else
{
window.location =window.location.pathname+'?child_saved='+html;
}

unblock('child_profile_container_'+childId);

}
});
}

}
}

function showImageChangeDiv(childId)
{
$('#image_change_'+childId).toggle('fast');
}

function ajaxFileUpload(upload_elemtent_childId, childId)
{
$.ajaxFileUpload
(
{
url: URL_BASE + 'new_ajax/fileUpload.php?childId='+childId, 
secureuri:false,
fileElementId:'fileToUpload_'+upload_elemtent_childId,
dataType: 'json',
success: function (data, status)
{
if(typeof(data.error)!= 'undefined')
{
if(data.error != '')
{
alert(data.error);
}else
{
$('#child_image_file_'+childId).attr('src',URL_BASE+'uploads/images/thumb1/parent_childs/'+data.msg);
$('#fileToUpload_'+childId).val('');
unblock('child_profile_img_'+childId);
$('#image_change_'+childId).hide('fast');






}
}
},
error: function (data, status, e)
{
alert(e);
}
}
)
}

function uploadChildImage(childId)
{




if($('#fileToUpload_'+childId).val()!= '')
{

block('child_profile_img_'+childId);

ajaxFileUpload(childId,childId);

}


}

function showScoopUpdateExample()
{
$('#scoop_update_example').slideDown('slow');
scrollTo('scoop_update_example');
}

function hideScoopUpdateExample()
{
$('#scoop_update_example').slideUp('slow');
}

function saveNewsletter(parentId)
{
var wantNewsLetter = 0;
if($('#parent_communication_want_newsletter_yes:checked').val()== 'on')
wantNewsLetter = 1;

block('parent_profile_table_newsletter');

 $.ajax({
url: URL_BASE + 'new_ajax/saveParentProfile.php',
type: 'POST',
dataType: 'html',
timeout: 5000,
error: function(){

},
data: { 
newsletter: wantNewsLetter
},
success: function(html){
if(isNaN(jQuery.trim(html)))
{
$('#save_news_letter').html(Not_Saved);
handleParentProfileErrors(html);
}
else
{
$('#save_news_letter').html(Saved);
}

unblock('parent_profile_table_newsletter');
}
});
}

function sentContactUsEmail()
{
var contact_sender_name = $('#contact_sender_name').val();
var contact_sender_email_address = $('#contact_sender_email_address').val();
var contact_sender_comments = $('#contact_sender_comments').val();
var receipient_email_address = $('#receipient_email_address').val();
var errorMsg = '';

if(contact_sender_name == '')
errorMsg +='<p>'+Please_Add_A_Name+'</p>';

if(contact_sender_email_address == '')
errorMsg +='<p>'+Please_Enter_Your_Email+'</p>';
else if(!isValidEmail(contact_sender_email_address))
errorMsg +='<p>'+Please_Enter_A_Correct_Email_Address+': <span class="blue">'+ contact_sender_email_address +'</span></p>';


if(contact_sender_comments == '')
errorMsg +='<p>'+Please_Enter_A_Comment+'</p>';

if(errorMsg != '')
$('#basic-modal-content').load(URL_BASE + 'new_ajax/showErrorMessage.php?errorMsg='+escape(errorMsg)).modal({
minHeight:350,
minWidth: 400
});
else
{

block('contact_us_table');

$.ajax({
url: URL_BASE + 'new_ajax/sendContactUsEmail.php',
type: 'GET',
dataType: 'html',
timeout: 5000,
error: function(){
unblock('contact_us_table');
},
data: { 
contact_sender_name: contact_sender_name,
contact_sender_email_address: contact_sender_email_address,
contact_sender_comments: contact_sender_comments,
receipient_email_address: receipient_email_address
},
success: function(html){
unblock('contact_us_table');
$('#contact_us_btn').html(html);
}
});
}

}

function goToDeals()
{
window.location =URL_BASE+'deals';
}

function dealFilterChanged()
{
var location_ids = new Array();
$("#deal_locations input:checked").each(function()
{
location_ids.push($(this).val());
});

var category_ids = new Array();
$("#deal_categories input:checked").each(function()
{
category_ids.push($(this).val());
});

block('all_sc_deals');
block('deal_categories_container');
block('deal_locations_container');

getAllScoopCardDealsAjax('',location_ids,category_ids,'false','false','all_sc_deals','all_sc_deals','deal_categories_container','deal_locations_container');

}

function getAllScoopCardDealsAjax(keywords,location_ids, category_ids, get_all_loc, get_all_cat, contained_id, toUnblock1, toUnblock2, toUnblock3)
{
$.ajax({
url: URL_BASE + 'new_ajax/getAllScoopCardDeals.php',
type: 'GET',
dataType: 'html',
timeout: 10000,
error: function(){
unblock(toUnblock1);
unblock(toUnblock2);
unblock(toUnblock3);
},
data: { 
location_ids: location_ids,
category_ids: category_ids,
get_all_loc: get_all_loc,
get_all_cat: get_all_cat,
keywords: keywords
},
success: function(html){
unblock(toUnblock1);
unblock(toUnblock2);
unblock(toUnblock3);
$('#'+contained_id).html(html);

if(html != '')
scrollTo('deals_header'); 
}
});
}

function submitArticle()
{
var author_name = $('#author_name').val();
var author_email = $('#author_email').val();
var city = $('#city').val();
var province = $('#province').val();
var author_bio = $('#author_bio').val();
var article_title = $('#article_title').val();
var article_text = $('#article_text').val();

var errorMsg = '';


if(author_name == '')
errorMsg +='<p>'+Please_Add_A_Name+'</p>';

if(author_email == '')
errorMsg +='<p>'+Please_Enter_An_Email_Address+'</p>';
else if(!isValidEmail(author_email))
errorMsg +='<p>'+Please_Enter_A_Correct_Email_Address+': <span class="blue">'+ author_email +'</span></p>';


if(city == '')
errorMsg +='<p>'+Please_Enter_A_City+'</p>';

if(province == '')
errorMsg +='<p>'+Please_Enter_A_Province+'</p>';

if(author_bio == '')
errorMsg +='<p>'+Please_Enter_A_Bio+'</p>';

if(article_title == '')
errorMsg +='<p>'+Please_Enter_A_Title+'</p>';

if(article_text == '')
errorMsg +='<p>'+Please_Enter_An_Article+'</p>';

if(errorMsg != '')
$('#basic-modal-content').load(URL_BASE + 'new_ajax/showErrorMessage.php?errorMsg='+escape(errorMsg)).modal({
minHeight:350,
minWidth: 400
});
else
{

block('submitArticle');

$.ajax({
url: URL_BASE + 'new_ajax/sendSubmitArticleEmail.php',
type: 'GET',
dataType: 'html',
timeout: 5000,
error: function(){
unblock('submitArticle');
},
data: {
 author_name: author_name,
 author_email: author_email,
 city: city,
 province: province,
 author_bio: author_bio,
 article_title: article_title,
 article_text: article_text 
},
success: function(html){
unblock('submitArticle');
$('#submitArticle_btn').html(html);
}
});
}
}

function submitBusiness()
{
var business_submiter_name = $('#business_submiter_name').val();
var business_submiter_email = $('#business_submiter_email').val();
var business_name = $('#business_name').val();
var business_address = $('#business_address').val();
var business_location = $('#business_location').val();
var business_phone = $('#business_phone').val();
var business_website = $('#business_website').val();
var business_contact = $('#business_contact').val();
var business_deal = $('#business_deal').val();

var errorMsg = '';


if(business_submiter_name == '')
errorMsg +='<p>'+Please_Add_A_Name+'</p>';

if(business_submiter_email == '')
errorMsg +='<p>'+Please_Enter_An_Email_Address+'</p>';
else if(!isValidEmail(business_submiter_email))
errorMsg +='<p>'+Please_Enter_A_Correct_Email_Address+': <span class="blue">'+ business_submiter_email +'</span></p>';


if(business_name == '')
errorMsg +='<p>'+Please_Enter_A_Business_Name+'</p>';

if(business_address == '')
errorMsg +='<p>'+Please_Enter_An_Address+'</p>';

if(business_location == '')
errorMsg +='<p>'+Please_Enter_A_Location+'</p>';

if(business_phone == '')
errorMsg +='<p>'+Please_Enter_A_Phone_Number+'</p>';

if(business_website == '')
errorMsg +='<p>'+Please_Enter_A_Website+'</p>';

if(business_contact == '')
errorMsg +='<p>'+Please_Enter_A_Contact_Name+'</p>';

if(errorMsg != '')
$('#basic-modal-content').load(URL_BASE + 'new_ajax/showErrorMessage.php?errorMsg='+escape(errorMsg)).modal({
minHeight:350,
minWidth: 400
});
else
{

block('submitBusiness');

$.ajax({
url: URL_BASE + 'new_ajax/sendSubmitBusinessEmail.php',
type: 'GET',
dataType: 'html',
timeout: 5000,
error: function(){
unblock('submitBusiness');
},
data: {
 business_submiter_name: business_submiter_name,
 business_submiter_email: business_submiter_email,
 business_name: business_name,
 business_address: business_address,
 business_location: business_location,
 business_phone: business_phone,
 business_website: business_website,
 business_contact: business_contact,
 business_deal: business_deal 
},
success: function(html){
unblock('submitBusiness');
$('#submitBusiness_btn').html(html);
}
});
}
}

function submitEvent()
{
var event_name = $('#event_name').val();
var address = $('#address').val();
var postal_code = $('#postal_code').val();
var event_description = $('#event_description').val();
var event_start_date = $('#event_start_date').val();
var event_start_time = $('#event_start_time').val();
var event_end_date = $('#event_end_date').val();
var event_end_time = $('#event_end_time').val();
var event_location = $('#event_location').val();
var event_category = $('#event_category').val();
var other_infos = $('#other_infos').val();
var registration_required = $('#registration_required').val();
var provider = $('#provider').val();
var provider_phone = $('#provider_phone').val();
var provider_website = $('#provider_website').val();
var organizer_name = $('#organizer_name').val();
var organizer_phone = $('#organizer_phone').val();
var organizer_email = $('#organizer_email').val();
var firstname = $('#firstname').val();
var lastname = $('#lastname').val();
var email = $('#email').val();
var phone = $('#phone').val();
var errorMsg = '';

if(event_name == '')
errorMsg +='<p>'+Please_Add_An_Event_Name+'</p>';
if(address == '')
errorMsg +='<p>'+Please_Add_An_Event_Address+'</p>';
if(postal_code == '')
errorMsg +='<p>'+Please_Add_A_Postal_Code+'</p>';
if(event_description == '')
errorMsg +='<p>'+Please_Add_A_Description+'</p>';
if(event_start_date == '')
errorMsg +='<p>'+Please_Add_A_Start_Date+'</p>';
if(event_start_time == '')
errorMsg +='<p>'+Please_Add_A_Start_Time+'</p>';
if(event_end_date == '')
errorMsg +='<p>'+Please_Add_A_End_Date+'</p>';
if(event_end_date < event_start_date)
errorMsg +='<p>'+Event_End_Date_Cannot_Be_Smaller_Than_Start_Date+'</p>';
if(event_end_time == '')
errorMsg +='<p>'+Please_Add_An_End_Time+'</p>';
if(event_location == '')
errorMsg +='<p>'+Please_Add_A_Location+'</p>';
if(event_category == '')
errorMsg +='<p>'+Please_Add_A_Category+'</p>';
if(email == '' || !isValidEmail(email))
errorMsg +='<p>'+Please_Enter_A_Correct_Email_Address+'</p>';


if(errorMsg != '')
$('#basic-modal-content').load(URL_BASE + 'new_ajax/showErrorMessage.php?errorMsg='+escape(errorMsg)).modal({
minHeight:350,
minWidth: 400
});
else
{
block('submitBusiness');

$.ajax({
url: URL_BASE + 'new_ajax/sendSubmitEventEmail.php',
type: 'GET',
dataType: 'html',
timeout: 5000,
error: function(){
unblock('contact_us_table');
},
data: {
event_name: event_name,
address: address,
postal_code: postal_code,
event_description: event_description,
event_start_date: event_start_date,
event_start_time: event_start_time,
event_end_date: event_end_date,
event_end_time: event_end_time,
event_location: event_location,
event_category: event_category,
other_infos: other_infos,
registration_required: registration_required,
provider: provider,
provider_phone: provider_phone,
provider_website: provider_website,
organizer_name: organizer_name,
organizer_phone: organizer_phone,
organizer_email: organizer_email,
firstname: firstname,
lastname: lastname,
email: email,
phone: phone 
},
success: function(html){
unblock('submitBusiness');
$('#submitEvent_btn').html(html);
}
});
}
}

function showOldEMT()
{
scrollTo('main');
changeSiteStatus('deactivate');

window.setTimeout(function(){
$('#basic-modal-content').load(URL_BASE + 'new_ajax/showOldEMT.php?height='+($(window).height()-40)).modal({
minHeight:$(window).height()-40,
minWidth: $(window).width()-50,
autoResize: true,
onClose: function ()
{
changeSiteStatus('activate');
$.modal.close(); 
}
});
 
$('#simplemodal-container').offset({ top: 14, left: 5 });
}, 1000); 


 
}

function changeSiteStatus(site_status)
{
$.ajax({
url: URL_BASE + 'new_ajax/changeSiteStatus.php',
type: 'GET',
dataType: 'html',
timeout: 5000,
error: function(){

},
data: { 
site_status: site_status
},
success: function(html){ 

}
});
}

function showDiv(divId)
{
$('#'+divId).show('fast');
}

function hideDiv(divId)
{
$('#'+divId).hide('fast');
}

function eventRegistyrationPopup(idCallback, winTitle, eventORCId, isLoggedIn, msg){


if(isLoggedIn)
{
_gaq.push(['_trackEvent', 'Deals', 'Click -Super Scoop Deal Buy (logged in)', winTitle+' ORC id = '+eventORCId]);
var height = ($(window).height()-120);
 
 $('#basic-modal-content').load(URL_BASE + 'new_ajax/showProviderEventRegistration.php?height='+height+'&serviceProviderName='+escape(winTitle)+'&eventId='+eventORCId).modal({
minHeight:$(window).height()-100,
minWidth: $(window).width()-100,
autoResize: true
});
}
else
{
_gaq.push(['_trackEvent', 'Deals', 'Click -Super Scoop Deal Buy (logged out)', winTitle+' ORC id = '+eventORCId]);

$('#basic-modal-content').load(URL_BASE + 'new_ajax/showUsserNotLoggedInMessage.php?msg='+escape(msg)).modal({
minHeight:350,
minWidth: 680
});

}

 
}

function showVideo(video)
{
$.modal('<center>'+video+'</center>',{
minHeight:410,
minWidth: 650,
autoResize: true
});
}


function setSelectedFilterCategory(filter_name)
{
$('#sp_categories a').removeClass('category_selected');
$('#sp_categories a').addClass('category_not_selected');

$('#filter_'+filter_name).removeClass('category_not_selected');
$('#filter_'+filter_name).addClass('category_selected');
}

function setSelectedFilterHood(filter_name)
{
$('#sp_hoods a').removeClass('hood_selected');
$('#sp_hoods a').addClass('hood_not_selected');

$('#filter_'+filter_name).removeClass('hood_not_selected');
$('#filter_'+filter_name).addClass('hood_selected');

}


function showEvents()
{


var category_name = 'all';
if(typeof $('.category_selected').attr('id')!= 'undefined')
category_name = $('.category_selected').attr('id').split('_')[1];

var hood_name = 'all';
if(typeof $('.hood_selected').attr('id')!= 'undefined')
hood_name = $('.hood_selected').attr('id').split('_')[1];


block('sp_events');


if(category_name == 'all' && hood_name == 'all')
{
$('.event_to_hide').show();
}
else
{
$('.event_to_hide').hide();
if(hood_name == 'all')
{
$('.'+category_name).show();
}
else if(category_name == 'all')
{
$('.'+hood_name).show();
}
else
{
$('.'+category_name+'.'+hood_name).show();
}
}


if(!$('#toggle_expired_events_cb').attr('checked'))
$('.expired').hide();

window.setTimeout(function(){
unblock('sp_events');
}, 500); 

$('#no_event_match').hide();
$('.catalogue_ul').each(function()
{
$(this).prev().show();
$(this).show();


if($(this).children('li:visible').size()== 0)
{
$(this).prev().hide();
$(this).hide();
}

});

if($('.catalogue_ul li:visible').size()== 0)
{
$('#no_event_match').show();
}
else
{
$('#events_cataloge_id_0').show('fast');
}
}

function toggleDiv(catalog_container_id)
{
$('#'+catalog_container_id).toggle('fast');
}


function toggleEvents(catalog_container_id)
{
$('#'+catalog_container_id).toggle('fast');

}

function goTo(url)
{
window.location = url;
}

function toggleEventsOtherExpired(catalog_container_id)
{
 

if($('#toggle_expired_events_cb').attr('checked'))
{
$('#toggleExpiredEvents').html(Show_Expired_Events);
$('#toggle_expired_events_cb').removeAttr('checked');
 $('#'+catalog_container_id).hide('fast');
 $('#'+catalog_container_id+' > li').hide('fast');

}
else
{
$('#toggleExpiredEvents').html(Hide_Expired_Events);
$('#toggle_expired_events_cb').attr('checked','checked');
 $('#'+catalog_container_id).show('fast');
 $('#'+catalog_container_id+' > li').show('fast');

}

}


function submitComment()
{
var contest_id = $('#contest_id').val();
var contest_comment_txt = $('#contest_comment_txt').val();
var user_id = $('#user_id').val();

$.ajax({
url: URL_BASE + 'new_ajax/submitContestComment.php',
type: 'GET',
dataType: 'html',
timeout: 5000,
error: function(){

},
data: { 
contest_id: contest_id,
contest_comment_txt: contest_comment_txt,
user_id: user_id
},
success: function(html){
 
$('#basic-modal-content').load(URL_BASE + 'new_ajax/showMessage.php?Msg='+escape(html)).modal({
minHeight:350,
minWidth: 400
});
window.setTimeout(function(){
window.location =window.location.pathname;
}, 2000); 

}
});

}

function dealPrint(isLoggedIn, userId, dealId, dealName, dealAddress, spLogo, store, msg)
{
if(isLoggedIn)
{
_gaq.push(['_trackEvent', 'Activity Provider', 'Click -Print Coupon (logged In)', dealName]);

$.ajax({
url: URL_BASE + 'new_ajax/trackCouponPrinting.php',
type: 'GET',
dataType: 'html',
timeout: 5000,
error: function(){

},
data: { 
userId: userId,
dealId: dealId,
dealName: dealName,
dealAddress: dealAddress,
spLogo: spLogo,
store: store
},
success: function()
{
var windowName = 'userConsole'; 
var popUp = window.open(URL_BASE+'new_ajax/scoopon.php?dealName='+dealName+'&dealAddress='+dealAddress+'&spLogo='+spLogo+'&store='+store,'SCOOPON','width=650,height=500,left=400,top=200,screenX=400,screenY=200');
if (popUp == null || typeof(popUp)=='undefined')
{ 
alert('Please disable your pop-up blocker and click the "Print this Coupon" link again.'); 
} 
else 
{ 
popUp.focus();
}

}
});
}
else
{
_gaq.push(['_trackEvent', 'Activity Provider', 'Click -Print Coupon (logged Out)', dealName]);

$('#basic-modal-content').load(URL_BASE + 'new_ajax/showUsserNotLoggedInMessage.php?msg='+msg).modal({
minHeight:350,
minWidth: 680
});

}
}

function gotoEvent(isLoggedIn, url, msg)
{
if(isLoggedIn)
{
_gaq.push(['_trackEvent', 'Activity Provider', 'Click -Go To Event (logged In)', url]);
window.location = url;
}
else
{
_gaq.push(['_trackEvent', 'Activity Provider', 'Click -Go To Event (logged out)', url]);

$('#basic-modal-content').load(URL_BASE + 'new_ajax/showUsserNotLoggedInMessage.php?msg='+msg+'&url='+url).modal({
minHeight:350,
minWidth: 680
});

}
}

function gotoSpecialEvent(isLoggedIn, url, msg,divEvId)
{
if(isLoggedIn)
{
_gaq.push(['_trackEvent', 'Home', 'Click - Special Events Calendar -Go To Event (logged In)', url]);
window.location = url;
}
else
{
_gaq.push(['_trackEvent', 'Home', 'Click - Special Events Calendar -Go To Event (logged Out)', url]);


$.modal.close();
removeEvent(divEvId+'_event_desc');




window.setTimeout(function()
{
$('#basic-modal-content').load(URL_BASE + 'new_ajax/showUsserNotLoggedInMessage.php?msg='+msg).modal({
minHeight:350,
minWidth: 680
}); 

$('#simplemodal-container').css('z-index','1006');
 
}, 100);



}
}


function setCookie(c_name,value,exdays)
{
var exdate=new Date();
exdate.setDate(exdate.getDate()+ exdays);
var c_value=escape(value)+ ((exdays==null)? "" : "; expires="+exdate.toUTCString());
document.cookie=c_name + "=" + c_value;
}

function getCookie(c_name)
{
var i,x,y,ARRcookies=document.cookie.split(";");
for (i=0;i<ARRcookies.length;i++)
{
x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("="));
y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1);
x=x.replace(/^\s+|\s+$/g,"");
if (x==c_name)
{
return unescape(y);
}
}
}


function checkGeoLocationCookie()
{

var theKidScoopGeoLocation_new = getCookie("theKidScoopGeoLocation_new2");

if (theKidScoopGeoLocation_new == null || theKidScoopGeoLocation_new == '')
{
showVokenAskingAboutLocation();
}
else
{
varlocation_name = 'montreal';
switch(theKidScoopGeoLocation_new)
{
case '4':
location_name = 'toronto';
break;
case '3':
location_name = 'montreal';
break;
default:
location_name = 'montreal';
break;
}
window.location =URL_BASE+location_name;
}
}

function getCurrentLocation()
{

var current_location = -1;
$.ajax({
url: URL_BASE + 'new_ajax/geoLocation/getCurrentLocation.php',
 async: true,
type: 'GET',
dataType: 'html',
timeout: 10000,
error: function(){
alert('Could not get current location');
return 3; 
},
data: { 
},
success: function(location){
current_location = location; 
}
});
return current_location;
}

function showVokenAskingAboutLocation()
{
$('#basic-modal-content').load(URL_BASE + 'new_ajax/geoLocation/getUserLocationsVoken.php').modal({
minHeight:360,
minWidth: 640
});
}

function citySelected(location,location_name)
{
$.modal.close();
setCookie('theKidScoopGeoLocation_new2',location,365);
window.location =URL_BASE+location_name;


}


function loadSuperScoopDealsHome()
{
if($('#ssd_home').html()== '')
{
$.ajax({
url: URL_BASE + 'new_ajax/getSuperScoopDeals.php',
type: 'GET',
dataType: 'html',
timeout: 5000,
error: function(){

},
data: {},
success: function(html)
{
$('#ssd_home').html(html);

}
});

}
}

function showMyCalender()
 {
 $('#basic-modal-content').load(URL_BASE + 'new_ajax/showMyCalender.php').modal({
minHeight:$(window).height()-40,
minWidth: 1000,
autoResize: true,
onClose: function ()
{
changeSiteStatus('activate');
$.modal.close(); 
}
});
 }
 
 function notImplementedYet()
 {
 alert('This functionality has not been Implemented Yet');
 }

function addToMyCalenderPopup(isLoggedIn, eventId, msg)
{
if(isLoggedIn)
{
$('#basic-modal-content').load(URL_BASE + 'new_ajax/addEventToParentCalenderPart1.php?eventId='+eventId).modal({
minHeight:250,
minWidth: 600,
onShow: function (dialog){

window.setTimeout(function()
{
 var new_width = ($('.add_to_cal_dates').width()+ 180);
var new_height = ($('.add_to_cal_dates').height()+ 150);

 $('#simplemodal-container').height(new_height);
 $('#simplemodal-container').width(new_width);
 $('#simplemodal-container').offset({ top: $('#simplemodal-container').position().top-20, left: ($('#simplemodal-container').position().left - 100)});
 
}, 1000);

}

});

 
}
else
{

$('#basic-modal-content').load(URL_BASE + 'new_ajax/showUsserNotLoggedInMessage.php?msg='+msg).modal({
minHeight:350,
minWidth: 680
});

}
}

function addEventToParentCalender(event_id)
{
block('add_to_calender_content');

var can_add_to_calender = true;
var date_time = $('#selected_date_time').val();
var child_ids = $('#selected_child_ids').val();
var event_type = $('#special_or_anytime').val();
var parentId = $('#parent_id').val();
var event_type = $('#event_type').val();

var event_start_date = $('#event_start_date').val();
var event_start_time = $('#event_start_time').val();
var event_end_date = $('#event_end_date').val();
var event_end_time = $('#event_end_time').val();

if(event_type == 'programs_and_classes')
{
event_start_date = $('#event_start_date').val();
event_start_time = $('#event_start_time').val();
event_end_date = $('#event_end_date').val();
event_end_time = $('#event_end_time').val();

}

if($('#event_type').val()!= 'programs_and_classes')
{
if(date_time == '')
{
alert('Please Select a Date');
can_add_to_calender = false;
}
}

if(child_ids == '')
{
alert('Please Select a Child');
can_add_to_calender = false;
}

 if(can_add_to_calender)
{
$.ajax({
url: URL_BASE + 'new_ajax/addEventToParentCalenderPart2.php',
type: 'GET',
dataType: 'html',
timeout: 5000,
error: function(){

},
data: {
event_id: event_id,
event_type: event_type,
parentId: parentId,
date_time: date_time,
child_ids: child_ids,
event_start_date: event_start_date,
event_start_time: event_start_time,
event_end_date: event_end_date,
event_end_time: event_end_time

},
success: function(html)
{
$('#simplemodal-container').height('100');

var new_html = '<br>&nbsp;<br><span class="blue">Your Event was added succesfully</span>&nbsp;&nbsp;&nbsp;<a onClick="_gaq.push([\'_trackEvent\', \'Calendar\', \'KS Event\', \'View My Calendar after adding an Event\']);" href="'+URL_BASE+'parent-profile/my-calender" class="button_orange" >Would you like to View your Calender ?</a></center>';
$('#add_to_calender_content').html(new_html);


_gaq.push(['_trackEvent', 'Calendar', 'KS Event', 'Added']);

unblock('add_to_calender_content');
}
});
}
}

function dateTimeSelected(date_time)
{
$('#selected_date_time').val(date_time);
}

function addEventToChild(childId,eventId,eventDate)
{
$('#selected_child_ids').val(childId);
}

function updateMovedEvent(eventId,eventStart,eventEnd,allDay,revertFunc)
{

var event_end = new Date();
 event_end = eventStart;
if(eventEnd != null)
{
event_end = eventEnd;
}

eventId = eventId.replace('parent_personal_','');
$.ajax({
url: URL_BASE + 'new_ajax/updatePersonalCalEvent.php',
type: 'GET',
dataType: 'html',
timeout: 10000,
error: function(){
alert('Error: Could not Update Personal Event: ' + eventId);
revertFunc();
},
data: { 
eventId: eventId,
eventStart: eventStart.getFullYear()+'-'+(eventStart.getMonth()+1)+'-'+eventStart.getDate()+' '+eventStart.getHours()+':'+eventStart.getMinutes()+':00',
eventEnd: event_end.getFullYear()+'-'+(event_end.getMonth()+1)+'-'+event_end.getDate()+' '+event_end.getHours()+':'+event_end.getMinutes()+':00',
allDay: allDay

},
success: function(html){
 
}
});

}

function getPersonalEventsDetailsForCal(eventId, left, top, assigned_to, can_delete)
{

eventId = eventId.replace('parent_personal_','');
$.ajax({
url: URL_BASE + 'new_ajax/getPersonalEventsDetailsForCal.php',
type: 'GET',
dataType: 'html',
timeout: 10000,
error: function(){
alert('Could not get Personal Event Details for Event: ' + eventId);
},
data: { 
event_id: eventId,
assigned_to: assigned_to,
can_delete: can_delete
},
success: function(html){
 var ID = 'parent_personal_'+eventId;
 var div = $('<div id='+ID+' style="position:absolute; top: '+top+'px; left: '+left +'px; display: block; z-index: 10; width:440px"><div class="event_close" onclick="removeEvent(\''+ID+'\');"></div>'+html+'</div>');
 $("body").prepend(div);


$(function(){$( "#tabs").tabs();});
 
}
});
}

function getEventsDetailsForCal(eventId, left, top,cal_ev_id, child_name,can_delete)
{

$.ajax({
url: URL_BASE + 'new_ajax/getEventsDetailsForCal.php',
type: 'GET',
dataType: 'html',
timeout: 10000,
error: function(){
alert('Could not get Event Details for Event: ' + eventId);
},
data: { 
event_id: eventId,
cal_ev_id: cal_ev_id,
child_name: child_name,
can_delete: can_delete
},
success: function(html){
 var ID = cal_ev_id+'_event_desc';
 var div = $('<div id='+ID+' style="position:absolute; top: '+top+'px; left: '+left +'px; display: block; z-index: 1005; width:440px"><div class="event_close" onclick="removeEvent(\''+ID+'\');"></div>'+html+'</div>');
 $("body").prepend(div);


$(function(){$( "#tabs").tabs();});
 
}
});

 }

function deleteEventFromCal(cal_ev_id, event_type)
{
$( "#dialog-confirm").dialog({
resizable: false,
height:110,
width:350,
modal: true,
buttons: {
Delete: function(){
if(event_type == 'personal')
{
ajaxDeletePersonalEventFromCal(cal_ev_id);
}
else
{
ajaxDeleteEventFromCal(cal_ev_id);
}
$( this).dialog( "close");
},
Cancel: function(){
$( this).dialog( "close");
}
}
});
}

function ajaxDeletePersonalEventFromCal(cal_ev_id)
{

$.ajax({
url: URL_BASE + 'new_ajax/deletePersonalEventFromCal.php',
type: 'GET',
dataType: 'html',
timeout: 10000,
error: function(){
alert('Could not get Event Details for Event: ' + cal_ev_id);
},
data: { 
cal_ev_id: cal_ev_id
},
success: function(){
 var ID = 'parent_personal_'+cal_ev_id; 
 $("#"+ID).remove();
 $('#calendar').fullCalendar('removeEvents', ID);
}
});
}

function ajaxDeleteEventFromCal(cal_ev_id)
{
$.ajax({
url: URL_BASE + 'new_ajax/deleteEventFromCal.php',
type: 'GET',
dataType: 'html',
timeout: 10000,
error: function(){
alert('Could not get Event Details for Event: ' + cal_ev_id);
},
data: { 
cal_ev_id: cal_ev_id
},
success: function(){
 var ID = cal_ev_id+'_event_desc';
 $("#"+ID).remove(); 
 $('#calendar').fullCalendar('removeEvents', cal_ev_id);
}
});
}

function addNewEventToCal(title, start, end, allDay)
{
var start_date = '';
var start_time = '';
var end_date = '';
var end_time = '';

if(typeof(start)!= 'undefined')
{
start_date = start.getFullYear()+'/'+(start.getMonth()+1)+ '/'+start.getDate();
start_time = start.getHours()+':'+start.getMinutes();
}

if(typeof(end)!= 'undefined')
{
end_date = end.getFullYear()+'/'+(end.getMonth()+1)+ '/'+end.getDate();
end_time = end.getHours()+':'+end.getMinutes();
}

$('#basic-modal-content').load(URL_BASE + 'new_ajax/addNewEventToParentCalenderPart1.php?title='+escape(title)+'&start_date='+escape(start_date)+'&start_time='+escape(start_time)+'&end_date='+escape(end_date)+'&end_time='+escape(end_time)+'&allDay='+escape(allDay)).modal({
minHeight: 350,
minWidth: 500
});

}

function addNewEventToParentCalender()
{
var parent_id = $('#parent_id').val();
var event_name = $('#event_name').val();
var assign_to = $("[name='child']:checked").val();
var event_start_date = $('#event_start_date').val();
var event_start_time = $('#event_start_time').val();
var event_end_date = $('#event_end_date').val();
var event_end_time = $('#event_end_time').val();
var allDay = $('#allDay').val();


var start = event_start_date+' '+event_start_time;
var end = event_end_date+' '+event_end_time;


if(event_start_time == '00:00:00' && event_end_time == '00:00:00')
allDay = true;
else
allDay = false;


$.ajax({
url: URL_BASE + 'new_ajax/addPersonalEventToCal.php',
type: 'GET',
dataType: 'html',
timeout: 10000,
error: function(){
alert('Could not get Event Details for Event: ' + eventId);
},
data: { 
parent_id: parent_id,
event_name: event_name,
assign_to: assign_to,
start:start,
end:end,
allDay:allDay
},
success: function(childIds){


var child_ids_array = childIds.split(',');
var child_event_info = '';
var color = '';

for (var key in child_ids_array)
{
child_event_info = child_ids_array[key].split('|');
color = $('#child_color_'+child_event_info[0]).val();

$('#calendar').fullCalendar('renderEvent',
{
id: 'parent_personal_'+child_event_info[1],
title: event_name,
start: start,
end: end,
color: color,
event_type: 'personal',
owner_name: child_event_info[2],
allDay: allDay
},
true 
);
}


_gaq.push(['_trackEvent', 'Calendar', 'Personal Event Added', '']);

$.modal.close();

}
});
}

function getSpecificFriendsCalendar(friend_id)
{
if(friend_id > 0)
{
block('friends_calendar_container');

$.ajax({
url: URL_BASE + 'new_ajax/getSpecificFriendsCalendar.php',
type: 'GET',
dataType: 'html',
timeout: 10000,
error: function(){
alert('Could not get Calenar for parent with ID: ' + friend_id);
},
data: { 
friend_id: friend_id
},
success: function(html){
$('#friends_calendar_container').html(html);
unblock('friends_calendar_container');
}
});
 }
 else
 {
 alert('Please Choose a Friend');
 }
}
 
function getFriendsCalendars(parent_id)
{

if($('#friends_calendar_container').html()== '')
{
block('friends_calendar_container');

$.ajax({
url: URL_BASE + 'new_ajax/getFreindsCalendars.php',
type: 'GET',
dataType: 'html',
timeout: 10000,
error: function(){
alert('Could not get Calenar for parent with ID: ' + parent_id);
},
data: { 
parent_id: parent_id
},
success: function(html){
$('#friends_calendar_container').html(html);
unblock('friends_calendar_container');
}
});
 }

}


function loadFriendCalendar(id, var_name)
{
$(document).ready(function(){

eval('var '+var_name+' = ""');

var_name = $('#calender_'+id).fullCalendar({
theme: true,
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
editable: false,

events: URL_BASE+"new_ajax/bildFriendsCalenderEvents.php?friend_id="+id,

 eventClick: function(calEvent, jsEvent, view){
 
 
 if(calEvent.event_type == 'personal')
 {
var ID = 'parent_personal_'+calEvent.id;

if(!document.getElementById(ID))
{
getPersonalEventsDetailsForCal(calEvent.id, jsEvent.pageX-60, jsEvent.pageY-225, calEvent.owner_name,'cannot_delete');
}
else
{
$("#"+ID).remove();
}
}
else
{
var ID = calEvent.id+'_event_desc';

if(!document.getElementById(ID))
{
getEventsDetailsForCal(calEvent.event_id, jsEvent.pageX-60, jsEvent.pageY-305,calEvent.id, calEvent.child_name,'cannot_delete');
}
else
{
$("#"+ID).remove();
}
}
}
});

});

}


function shareMyCalendar(parentId,parentEmail)
{
$('#basic-modal-content').load(URL_BASE + 'new_ajax/shareMyCalendar.php?parentEmail='+escape(parentEmail)+'&parentId='+escape(parentId)).modal({
minHeight:350,
minWidth: 680
});

}

function shareYourCalendarClicked(inputId, parentEmail,parentId)
{
 var calendar_sharer_email = $('#'+inputId).val();
if(isValidEmail(calendar_sharer_email))
{
$.ajax({
url: URL_BASE + 'new_ajax/shareCalendarWithAFreind.php',
type: 'GET',
dataType: 'html',
timeout: 10000,
error: function(){
alert('Could not share Calendar for parent with ID: ' + parentId +' with: '+ calendar_sharer_email);
},
data: { 
calendar_owner_email: parentEmail,
calendar_owner_id: parentId,
calendar_sharer_email: calendar_sharer_email
},
success: function(html){


_gaq.push(['_trackEvent', 'Calendar', 'Share', 'Sent']);

$('#share_calendar_voken_container').html(html);

}
});
}
else
{
EmailEntered(inputId);
}
}

function checkCalendarSharing(email)
{
$.ajax({
url: URL_BASE + 'new_ajax/checkShareCalendarWithAFreind.php',
type: 'GET',
dataType: 'html',
timeout: 10000,
error: function(){
alert('Could not share Calendar for parent with ID: ' + parentId +' with: '+ calendar_sharer_email);
},
data: { 
calendar_sharer_email: email
},
success: function(){

}
});
}

function showUpcomingEventsCalendar()
{
$('#basic-modal-content').load(URL_BASE + 'new_ajax/showUpcomingEventsCalendar.php?cal_height='+($(window).height()-50)).modal({
minHeight:$(window).height()-50,
minWidth: 900,
autoResize: true
});
}

function cityChanged()
{
var new_city = $('#new_city').val();


switch (new_city)
{
case '4':
citySelected(4,'toronto');

break;
case '3':

citySelected(3,'montreal');
break;
default:
break;
}

}

function changeDatabaseToNewCity(new_city)
{


if(getURLParameter('province_id')== '3' || getURLParameter('province_id')== '4')
{
setCookie('theKidScoopGeoLocation_new2',getURLParameter('province_id'),365);

}
else
{
setCookie('theKidScoopGeoLocation_new2',new_city,365);

$.ajax({
url: URL_BASE + 'new_ajax/changeToNewCity.php',
type: 'GET',
dataType: 'html',
timeout: 10000,
error: function(){
alert('Could not change DB to new city: ' + new_city);
},
data: { 
new_city: new_city
},
success: function(){
window.location = URL_BASE;
}
});
 }
}

function getURLParameter(name){
return decodeURI(
(RegExp(name + '=' + '(.+?)(&|$)').exec(location.search)||[,null])[1]
);
}



function getNewBlog()
{

$.ajax({
url: URL_BASE + 'new_ajax/blog/getNewBlog.php',
type: 'GET',
dataType: 'html',
timeout: 10000,
error: function(){

},
data: { },
success: function(html){

$('#new_blog').html(html);
}
});
}

function loadArticleContent(article_id,article_type)
{
$.ajax({
url: URL_BASE + 'new_ajax/blog/getArticleContent.php',
type: 'GET',
dataType: 'html',
timeout: 10000,
error: function(){

},
data: { 
article_id: article_id,
article_type: article_type
},
success: function(html){

$('#article_content').html(html);
}
});
}

function loadAddwords(ad_id)
{
$.ajax({
url: URL_BASE + 'new_ajax/adWords/getAd.php',
type: 'GET',
dataType: 'html',
timeout: 10000,
error: function(){

},
data: { 
ad_id: ad_id
},
success: function(html){

$('#ad_words').html(html);
}
});
}

function loginWithFacebook(email)
{

$.ajax({
url: URL_BASE + 'new_ajax/facebook/loginWithFacebook.php',
type: 'GET',
dataType: 'html',
timeout: 10000,
error: function(){

},
data: { 
email: email
},
success: function(html){
switch(html)
{
case 'logged_in':
window.location =window.location.pathname;

break;
case 'create_account':
createParentAccount(email);
break;
default:
$('#basic-modal-content').load(URL_BASE + 'new_ajax/showMessage.php?Msg='+escape(html)).modal({
minHeight:350,
minWidth: 400
});
break;
}
}
});
}

function showMoreCities()
{
$('.hiddenCities').show();
$('.moreCities').hide();
}

function showLessCities()
{
$('.hiddenCities').hide();
$('.moreCities').show();
}

function showMoreCategories()
{
$('.hiddenCategories').show();
$('.moreCategories').hide();
}

function showLessCategories()
{
$('.hiddenCategories').hide();
$('.moreCategories').show();
}

function showHoodHint()
{
$('#hood_hint').show('slow');
}

function shareClickedThankYou()
{
var can_send = false;

if(isValidEmail($('#sharer_email').val()))
{
if(isValidEmail($('#friend_1').val()))
can_send = true;

if(isValidEmail($('#friend_2').val()))
can_send = true;

if(isValidEmail($('#friend_3').val()))
can_send = true;

if(isValidEmail($('#friend_4').val()))
can_send = true;

if(isValidEmail($('#friend_5').val()))
can_send = true;

}
else
checkEmail('sharer_email');

if(can_send)
{

$.ajax({
url:URL_BASE + 'new_ajax/shareNewCity.php',
type: 'GET',
dataType: 'html',
timeout: 5000,
error: function(){
alert('Error Sharing, Please try again!');
},
data: {
sharer_email: $('#sharer_email').val(),
friend_1: $('#friend_1').val(),
friend_2: $('#friend_2').val(),
friend_3: $('#friend_3').val(),
friend_4: $('#friend_4').val(),
friend_5: $('#friend_5').val(),
new_city: $('#new_city').val()
},
success: function()
{
window.location =URL_BASE+'parent-profile/parent_family_information?parent=new&shared=true';
}
});
}
else
{
checkEmail('friend_1');
checkEmail('friend_2');
checkEmail('friend_3');
checkEmail('friend_4');
checkEmail('friend_5');
}


}

function goToProfileClicked()
{
window.location =URL_BASE+'parent-profile/parent_family_information?parent=new';
}
var GLOBAL_AGE_TOOL = 'all';
var AGE_CHANGED_TOOL = true;
var CATEGORY_CHANGED_TOOL = true;
var SEARCH_AGE_TOOL = '';
var SEARCH_CATEGORY_TOOL = '';
var SEARCH_CATEGORY_ID_TOOL = -1;
var SEARCH_SUB_CATEGORY_TOOL = '';
var SEARCH_SUB_CATEGORY_ID_TOOL = -1;
var SEARCH_LOCATION_TOOL = '';
var LOCATION_TOOL = '';
var SEARCH_CLICKED = 0;
var SEARCH_CLICKED_MAX = 10;

 $(document).ready(function(){
 
 $('#inner_search_input_key_words').bind('keyup', function(e){
if(e.keyCode == 13)
{
searchClicked();
}
});

$('#inner_search_input_key_words_2').bind('keyup', function(e){
if(e.keyCode == 13)
{
searchClicked2();
}
});
 });

function applyHover()
{
$('.search_2').css("text-decoration","underline");
$('.search_3').css("text-decoration","underline");
$('.search_4').css("text-decoration","underline");
}

function removeHover()
{
$('.search_2').css("text-decoration","none");
$('.search_3').css("text-decoration","none");
$('.search_4').css("text-decoration","none");
} 


function ageChangedTool(selectedValue,loadEvents, manual_search, callback)
{

SEARCH_AGE_TOOL = '';
SEARCH_CATEGORY_TOOL = '';
SEARCH_CATEGORY_ID_TOOL = -1;
SEARCH_SUB_CATEGORY_TOOL = '';
SEARCH_SUB_CATEGORY_ID_TOOL = -1;
SEARCH_LOCATION_TOOL = '';
LOCATION_TOOL = '';
$('#categories_tool').val(-1);
$('#locations_tool').val(-1);

GLOBAL_AGE_TOOL = selectedValue;
AGE_CHANGED_TOOL = true; 
 
getCategories_TOOL(callback);


SEARCH_AGE_TOOL = selectedValue;

if(loadEvents)
{
ajaxGetEvents_TOOL(SEARCH_CATEGORY_ID_TOOL, SEARCH_SUB_CATEGORY_ID_TOOL,GLOBAL_AGE_TOOL, LOCATION_TOOL, '', manual_search,'',true);
}
}

function getCategories_TOOL(callback)
{ 


if(AGE_CHANGED_TOOL)
{


block('categories_tool_container');
CATEGORY_CHANGED = true;
ajaxGetCategories_TOOL(GLOBAL_AGE_TOOL,callback);
}

block('locations_tool_container');
ajaxGetLocations_TOOL(GLOBAL_AGE_TOOL, -1,-1, null);



SEARCH_CATEGORY = '';
SEARCH_CATEGORY_ID = -1;
SEARCH_SUB_CATEGORY = '';
SEARCH_SUB_CATEGORY_ID = -1;
AGE_CHANGED_TOOL = false;
}

function ajaxGetCategories_TOOL(age,callback)
{
$.ajax({
url: URL_BASE + 'new_ajax/admin/getCategoriesAndSubCategories_TOOL.php',
type: 'GET',
dataType: 'html',
timeout: 10000,
error: function(){

},
data: { 
age: age
},
success: function(html){

$('#categories_tool_container').html(html);

if(callback != null)
callback();

unblock('categories_tool_container');
}
});
}

function categoriesChangedTool(selectedValue, loadEvents, callback)
{

var category_info = selectedValue.split('|');

if(category_info[1] == 'category')
{
SEARCH_CATEGORY_ID_TOOL = category_info[0];
SEARCH_SUB_CATEGORY_ID_TOOL = -1;
}
else if(category_info[1] == 'sub_category')
{
SEARCH_CATEGORY_ID_TOOL = category_info[2];
SEARCH_SUB_CATEGORY_ID_TOOL = category_info[0];
}
 
block('locations_tool_container');
ajaxGetLocations_TOOL(GLOBAL_AGE_TOOL, SEARCH_CATEGORY_ID_TOOL,SEARCH_SUB_CATEGORY_ID_TOOL, callback);

if(loadEvents)
ajaxGetEvents_TOOL(SEARCH_CATEGORY_ID_TOOL,SEARCH_SUB_CATEGORY_ID_TOOL,GLOBAL_AGE_TOOL,'','', true,'',true);
}

function ajaxGetLocations_TOOL(age, master_category_id,sub_category_id, callback)
{
$.ajax({
url: URL_BASE + 'new_ajax/admin/getLocationsAll_TOOL.php',
type: 'GET',
dataType: 'html',
timeout: 10000,
error: function(){

},
data: { 
master_category_id: master_category_id, 
sub_category_id: sub_category_id,
age: age
},
success: function(html){

$('#locations_tool_container').html(html);

if(callback != null)
callback();

unblock('locations_tool_container');
}
});
}

function locationsChangedTool(selectedValue, loadEvents)
{
var secondary_locations_info = selectedValue.split('|');
var secondary_locations_id = secondary_locations_info[1];

LOCATION_TOOL = secondary_locations_info[0];

var master_category_id = SEARCH_CATEGORY_ID_TOOL;
var sub_category_id = SEARCH_SUB_CATEGORY_ID_TOOL;
var age = GLOBAL_AGE_TOOL;
var location= LOCATION_TOOL;



if(loadEvents)
ajaxGetEvents_TOOL(master_category_id,sub_category_id,age,location, '', true,'',true,secondary_locations_id);
}


function trackSearchingInGA()
{

$('#for_ga').attr('src', URL_BASE+'?keywords=igar_is_testing');
}


function ajaxGetEvents_TOOL(master_category_id,sub_category_id,age,location, new_page, manual_search,search_key_words,clear_search_words,secondary_locations_id)
{
var show_expired = 'false';
var page = 1;
var group_events_together = $('#group_events_together').attr('checked');
var event_type_programs_and_classes = $('#event_type_programs_and_classes').attr('checked');
var event_type_special_events = $('#event_type_special_events').attr('checked');
var event_type_anytime_activities = $('#event_type_anytime_activities').attr('checked');
var small_box = $('#small_box').val();


search_key_words = unescape(search_key_words);

if(manual_search)
scrollTo('activity_search_heading');





showSmartBanners();
loadBanners_SMART(search_key_words, master_category_id,sub_category_id);

block('events_container_tool');

$('#results_heading_row').hide();
$('#activity_providers_row').hide();
$('#sponsored_advertisment').hide();

$('#events_container_tool').html('Please Wait...');


if(clear_search_words)
{
$('#inner_search_input_key_words').val(Quick_Search);
$('#inner_search_input_key_words_2').val(Quick_Search);
}
else
{
$('#inner_search_input_key_words').val(search_key_words);
$('#inner_search_input_key_words_2').val(search_key_words);
}

$('#events_container_tool').css('min-height',450);

if(new_page != '' && new_page != null)
page = new_page;

$.ajax({
url: URL_BASE + 'new_ajax/admin/getEventsAll_TOOL.php',
type: 'GET',
dataType: 'html',
timeout: 30000,
error: function(){
unblock('events_container_tool');
$('#events_container_tool').html('An Error Happened, Please Try again!');
},
data: { 
keywords: search_key_words,
master_category_id: master_category_id, 
sub_category_id: sub_category_id,
age: age,
location: location,
show_expired: show_expired,
current_page: page,
group_events_together: group_events_together,
event_type_programs_and_classes: event_type_programs_and_classes,
event_type_special_events: event_type_special_events,
event_type_anytime_activities: event_type_anytime_activities,
small_box: small_box,
secondary_locations_id:secondary_locations_id,
province_id: PROVINCE_ID

},
success: function(html){

$('#results_heading_row').show();
$('#activity_providers_row').show();
$('#events_container_tool').html(html); 
 
unblock('events_container_tool');
 
getArticles(search_key_words,master_category_id,sub_category_id,location,'articles_content');


activateScrolling();
 

if($('#create_an_account_reminder').html()!= null)
{
showReminder();
}
else
{
showSearchResults();
}
}
});

}



function ajaxGetEvents_TOOL_WithEventType(master_category_id,sub_category_id,age,location, new_page, manual_search,search_key_words,clear_search_words,secondary_locations_id,group_events_together,event_type_programs_and_classes,event_type_special_events,event_type_anytime_activities)
{
var show_expired = 'false';
var page = 1;
var small_box = $('#small_box').val();


search_key_words = unescape(search_key_words);

if(manual_search)
scrollTo('activity_search_heading');





loadBanners_SMART(search_key_words, master_category_id,sub_category_id);

block('events_container_tool');

$('#results_heading_row').hide();
$('#activity_providers_row').hide();
$('#sponsored_advertisment').hide();

$('#events_container_tool').html('Please Wait...');


if(clear_search_words)
{
$('#inner_search_input_key_words').val(Quick_Search);
$('#inner_search_input_key_words_2').val(Quick_Search);
}
else
{
$('#inner_search_input_key_words').val(search_key_words);
$('#inner_search_input_key_words_2').val(search_key_words);
}

$('#events_container_tool').css('min-height',450);

if(new_page != '' && new_page != null)
page = new_page;

$.ajax({
url: URL_BASE + 'new_ajax/admin/getEventsAll_TOOL.php',
type: 'GET',
dataType: 'html',
timeout: 30000,
error: function(){
unblock('events_container_tool');
$('#events_container_tool').html('An Error Happened, Please Try again!');
},
data: { 
keywords: search_key_words,
master_category_id: master_category_id, 
sub_category_id: sub_category_id,
age: age,
location: location,
show_expired: show_expired,
current_page: page,
group_events_together: group_events_together,
event_type_programs_and_classes: event_type_programs_and_classes,
event_type_special_events: event_type_special_events,
event_type_anytime_activities: event_type_anytime_activities,
small_box: small_box,
secondary_locations_id:secondary_locations_id,
province_id: PROVINCE_ID

},
success: function(html){

$('#results_heading_row').show();
$('#activity_providers_row').show();
$('#events_container_tool').html(html); 
 
unblock('events_container_tool');
 
getArticles(search_key_words,master_category_id,sub_category_id,location,'articles_content');


activateScrolling();
 

if($('#create_an_account_reminder').html()!= null)
{
showReminder();
}
else
{
showSearchResults();
}
}
});

}


function showReminder()
{ 
if(SEARCH_CLICKED >= SEARCH_CLICKED_MAX)
{
 $('#create_an_account_reminder').show();
 $('#events_container_tool').hide(); 
SEARCH_CLICKED = 0;
}
else
{
SEARCH_CLICKED++;
}
}

function showSearchResults()
{
$('#create_an_account_reminder').hide();
$('#events_container_tool').show();
}

function alreadyJoinedLogIn()
{
var msg = '';
$('#basic-modal-content').load(URL_BASE + 'new_ajax/showUsserNotLoggedInMessage.php?msg='+escape(msg)).modal({
minHeight:350,
minWidth: 680
});
}

function activateScrolling()
{


$(function (){

var msie6 = $.browser == 'msie' && $.browser.version < 7;

if (!msie6){


var BIG_BOX_OFFSET_TOP = $('#main').height()+ 100;
var FOOTER = ($('#footer').offset().top);



 
$(window).scroll(function (event)
{



var y = $(this).scrollTop();


if (y >= BIG_BOX_OFFSET_TOP){

if(y < FOOTER)
{
 if($('#events_container_tool').height()> 450)
 {

if(!$('#comment').hasClass('fixed'))
$('#comment').addClass('fixed');

$('#comment').css('margin-top','0px');
}

}
else
{
$('#comment').removeClass('fixed');
$('#commentWrapper').offset({top: FOOTER});

} 
}
else {
$('#comment').removeClass('fixed');

$('#commentWrapper').offset({top: $('#ages_tool').offset().top});

}
});



 
var y = $(this).scrollTop();


if (y >= BIG_BOX_OFFSET_TOP){

if(y < FOOTER)
{

if(!$('#comment').hasClass('fixed'))
$('#comment').addClass('fixed');

$('#comment').css('margin-top','0px');

}
else
{
$('#comment').removeClass('fixed');
$('#comment').css('margin-top','-460px');

} 
}
else {

$('#commentWrapper').offset({top: $('#ages_tool').offset().top});

}
$('#sponsored_advertisment').show();
}
});

 
}

function getArticles(search_key_words,master_category_id,sub_category_id,location,container)
{
block('scoop_cafe_articles');
$.ajax({
url: URL_BASE + 'new_ajax/admin/getArticles_TOOL.php',
type: 'GET',
dataType: 'html',
timeout: 30000,
error: function(){
unblock('events_container_tool');
$('#'+container).html('An Error Happened, Please Try again!');
},
data: { 
keywords: search_key_words,
master_category_id: master_category_id, 
sub_category_id: sub_category_id,
location: location
},
success: function(html){

$('#'+container).html(html);
unblock('scoop_cafe_articles');

}
});
}

function getArticlesForHomePage(container)
{
block('scoop_cafe_articles');
$.ajax({
url: URL_BASE + 'new_ajax/admin/getArticlesForHomePage_TOOL.php',
type: 'GET',
dataType: 'html',
timeout: 30000,
error: function(){
unblock('events_container_tool');
$('#'+container).html('An Error Happened, Please Try again!');
},
data: { 
},
success: function(html){

$('#'+container).html(html);
unblock('scoop_cafe_articles');

}
});
}


function searchClicked()
{
search_key_words = $('#inner_search_input_key_words').val();
if(search_key_words == Quick_Search)
search_key_words = '';


if(search_key_words != '')
{
_gaq.push(['_trackEvent', 'Activity Search', 'Main Search: Keyword', search_key_words]);
scrollTo('activity_search_heading');
ajaxGetEvents_TOOL(SEARCH_CATEGORY_ID_TOOL, SEARCH_SUB_CATEGORY_ID_TOOL,GLOBAL_AGE_TOOL, LOCATION_TOOL, 1, false,search_key_words,false);
}
else
{
$('#inner_search_input_key_words').val(Quick_Search);
$("#inner_search_text_key_words").fadeOut(100).fadeIn(300);
}
}

function searchClicked2()
{

search_key_words = $('#inner_search_input_key_words_2').val();
if(search_key_words == Quick_Search)
search_key_words = '';

if(search_key_words != '')
{
_gaq.push(['_trackEvent', 'Activity Search', 'Bottom Search: Keyword', search_key_words]);
scrollTo('activity_search_heading');
ajaxGetEvents_TOOL(SEARCH_CATEGORY_ID_TOOL, SEARCH_SUB_CATEGORY_ID_TOOL,GLOBAL_AGE_TOOL, LOCATION_TOOL, 1, false,search_key_words,false);
}
else
{

$('#inner_search_input_key_words_2').val(Quick_Search);
$("#inner_search_input_key_words_2").fadeOut(100).fadeIn(300);


$('#events_container_tool').hide();
var html = $('#results_heading').html();
$('#results_heading').html('Please wait...');

window.setTimeout(function(){
$('#results_heading').html(html);
$('#events_container_tool').show();
}, 1000);
}
}

function changePage(new_page,keywords)
{
scrollTo('activity_search_heading');
activityProviderFilterApplied(SEARCH_CATEGORY_ID_TOOL, SEARCH_SUB_CATEGORY_ID_TOOL,GLOBAL_AGE_TOOL, LOCATION_TOOL, new_page, true,keywords,false);
}

function eventTypeChange()
{
var new_page = 1;
var keywords = $('#inner_search_input_key_words_2').val();
var my_keywords = '';
if(keywords != '' && keywords != Quick_Search)
my_keywords = keywords;


activityProviderFilterApplied(SEARCH_CATEGORY_ID_TOOL, SEARCH_SUB_CATEGORY_ID_TOOL,GLOBAL_AGE_TOOL, LOCATION_TOOL, new_page, false,my_keywords,false);
}

function groupingChange()
{
var new_page = 1;
var keywords = $('#inner_search_input_key_words_2').val();
var my_keywords = '';
if(keywords != '' && keywords != Quick_Search)
my_keywords = keywords;

activityProviderFilterApplied(SEARCH_CATEGORY_ID_TOOL, SEARCH_SUB_CATEGORY_ID_TOOL,GLOBAL_AGE_TOOL, LOCATION_TOOL, new_page, false,my_keywords,false);
}

function activityProviderFilterApplied(master_category_id,sub_category_id,age,location, new_page, manual_search,search_key_words,clear_search_words)
{
var show_expired = 'false';
var page = 1;
var group_events_together = $('#group_events_together').attr('checked');
var event_type_programs_and_classes = $('#event_type_programs_and_classes').attr('checked');
var event_type_special_events = $('#event_type_special_events').attr('checked');
var event_type_anytime_activities = $('#event_type_anytime_activities').attr('checked');
var small_box = $('#small_box').val();



search_key_words = unescape(search_key_words);


block('activity_providers_container');
$('#activity_providers_container').html('Please Wait...');
$('#activity_providers_container').css('min-height',450);


if(clear_search_words)
{
$('#inner_search_input_key_words').val(Quick_Search);
$('#inner_search_input_key_words_2').val(Quick_Search);
}
else
{
$('#inner_search_input_key_words').val(search_key_words);
$('#inner_search_input_key_words_2').val(search_key_words);
}


if(new_page != '' && new_page != null)
page = new_page;

$.ajax({
url: URL_BASE + 'new_ajax/admin/getEventsActivityProviderFilterApplied_TOOL.php',
type: 'GET',
dataType: 'html',
timeout: 30000,
error: function(){
unblock('activity_providers_container');
$('#activity_providers_container').html('An Error Happened, Please Try again!');
},
data: { 
keywords: search_key_words,
master_category_id: master_category_id, 
sub_category_id: sub_category_id,
age: age,
location: location,
show_expired: show_expired,
current_page: page,
group_events_together: group_events_together,
event_type_programs_and_classes: event_type_programs_and_classes,
event_type_special_events: event_type_special_events,
event_type_anytime_activities: event_type_anytime_activities,
small_box: small_box,
province_id: PROVINCE_ID
},
success: function(html){
$('#activity_providers_container').html(html);
unblock('activity_providers_container');
}
});
}

function ageSelectionCleared()
{
$('#ages_tool').val(-1);
ajaxGetEvents_TOOL(SEARCH_CATEGORY_ID_TOOL, SEARCH_SUB_CATEGORY_ID_TOOL,'all', LOCATION_TOOL, 1, false,'',false);
}

function categorySelectionCleared()
{
$('#categories_tool').val(-1);
SEARCH_CATEGORY_ID_TOOL = -1;
SEARCH_SUB_CATEGORY_ID_TOOL = -1;

if(LOCATION_TOOL == '')
{
block('locations_tool_container');
ajaxGetLocations_TOOL(GLOBAL_AGE_TOOL, -1,-1);
}

ajaxGetEvents_TOOL(-1, -1,GLOBAL_AGE_TOOL, LOCATION_TOOL, 1, false,'',false);

}

function hoodSelectionCleared()
{
$('#locations_tool').val(-1);
LOCATION_TOOL = '';

ajaxGetEvents_TOOL(SEARCH_CATEGORY_ID_TOOL, SEARCH_SUB_CATEGORY_ID_TOOL,GLOBAL_AGE_TOOL, '', 1, false,'',false);
}

function empty_inner_search_input_key_words()
 {
 if($('#inner_search_input_key_words').val()== Quick_Search)
 {
$('#inner_search_input_key_words').val('');
 }
 }
 
 function fill_inner_search_input_key_words()
 {
 if($('#inner_search_input_key_words').val()== '')
 {
$('#inner_search_input_key_words').val(Quick_Search);
 }
 }


function empty_inner_search_input_key_words_2()
 {
 if($('#inner_search_input_key_words_2').val()== Quick_Search)
 {
$('#inner_search_input_key_words_2').val('');
 }
 }
 
 function fill_inner_search_input_key_words_2()
 {
 if($('#inner_search_input_key_words_2').val()== '')
 {
$('#inner_search_input_key_words_2').val(Quick_Search);
 }
 }
 
function loadKeyword(keyword)
{
$('#inner_search_input_key_words').val(keyword);
$("#inner_search_text_key_words").fadeOut(100).fadeIn(300);
}

function clearSearch()
{
 $('#inner_search_input_key_words').val(''); 
}

function clearSearch_2()
{
 $('#inner_search_input_key_words_2').val(''); 
}


function expandAllSelect()
{
$('#ages_tool').height(230);
$('#categories_tool').height(230);
$('#locations_tool').height(230);
}

(function($){
$.fn.list_ticker = function(options){

var defaults = {
speed:2000,
effect:'fade'
};

var options = $.extend(defaults, options);

return this.each(function(){

var obj = $(this);
var list = obj.children();
list.not(':first').hide();

setInterval(function(){

list = obj.children();
list.not(':first').hide();

var first_li = list.eq(0)
var second_li = list.eq(1)

if(options.effect == 'slide'){
first_li.slideUp();

$('.scoop_cafe_timer').attr('src', URL_BASE+'new_img/timer_gray.gif');
second_li.slideDown(function(){
first_li.remove().appendTo(obj);
});
} else if(options.effect == 'fade'){
first_li.fadeOut(function(){
obj.css('height',second_li.height());
second_li.fadeIn();
first_li.remove().appendTo(obj);
});
}
}, options.speed)
});
};
})(jQuery);var FEEDBACK_TYPE = Idea;

function showFeedback()
{
$('#basic-modal-content').load(URL_BASE + 'new_ajax/getFeedbackContent.php').modal({
minHeight:350,
minWidth: 820
});
}

function feedback_clicked(item_id)
{
$('#feedback_idea').removeClass('selected_feedback_item');
$('#feedback_idea_arrow').hide();
$('#feedback_question').removeClass('selected_feedback_item');
$('#feedback_question_arrow').hide();
$('#feedback_problem').removeClass('selected_feedback_item');
$('#feedback_problem_arrow').hide();
$('#feedback_praise').removeClass('selected_feedback_item');
$('#feedback_praise_arrow').hide();
$('#'+item_id).addClass('selected_feedback_item');
$('#'+item_id+'_arrow').show();
$('#feedback_title1').hide();
$('#feedback_title2').hide();
$('#feedback_title3').hide();
$('#feedback_content').show();

oHandler = $(".mydds").msDropDown().data("dd");
oHandler.visible(true);

switch(item_id)
{
case 'feedback_idea':
FEEDBACK_TYPE = Idea;
break;
case 'feedback_question':
FEEDBACK_TYPE = Question;
break;
case 'feedback_problem':
FEEDBACK_TYPE = Problem;
break;
case 'feedback_praise':
FEEDBACK_TYPE = Praise;
break;
}

block('feedback_content');
setTimeout(function(){
unblock('feedback_content');
}, 500);
}

function feedback_mouseover(item_id)
{
$('#'+item_id).addClass('hover_feedback_item');
}

function feedback_mouseout(item_id)
{
$('#'+item_id).removeClass('hover_feedback_item');
}

function sendFeedback()
{
var feedback_type = FEEDBACK_TYPE;
var subject = '';
var description = '';
var email = '';
var anonymus = 'false';
var feeling = $('#msdrpdd20').val();
var ErrorMsg = false;

$('#feedback_subject').removeClass('required');
$('#feedback_email').removeClass('required');
$('#feedback_description').removeClass('required');


if($('#feedback_subject').val()== '' || $('#feedback_subject').val()== Please_Enter_A_Title)
{
$('#feedback_subject').addClass('required');
$('#feedback_subject').val(Please_Enter_A_Title);
ErrorMsg = true;
}
else
{
subject = $('#feedback_subject').val();
}


if(!$('#feedback_anonymus_checkbox').is(':checked'))
{ 
if($('#feedback_email').val()== '' ||$('#feedback_email').val()== Please_Enter_Your_Email)
{
$('#feedback_email').addClass('required');
$('#feedback_email').val(Please_Enter_Your_Email);
ErrorMsg = true;
}
else
{
if(isValidEmail($('#feedback_email').val()))
{
email = $('#feedback_email').val();
}
else
{
$('#feedback_email').addClass('required');
ErrorMsg = true;
}
}
}
else
{
anonymus = 'true';
}

if($('#feedback_description').val()== '' || $('#feedback_description').val()== How_Would_You_Describe_It)
{
$('#feedback_description').addClass('required');
$('#feedback_description').val(How_Would_You_Describe_It);
ErrorMsg = true;
}
else
{
description = $('#feedback_description').val();
}

if(ErrorMsg)
{
$('#submit_feedback').html(Please_Add_Some_Information_About_your_Feedback);
$('#submit_feedback').addClass('feedback_btn_error');
}
else
{

block('feedback_content');
sendFeedbackEmailAjax(feedback_type,subject,description,email,anonymus,feeling)

}
}

function sendFeedbackEmailAjax(feedback_type,subject,description,email,anonymus,feeling)
{
$.ajax({
url: URL_BASE + 'new_ajax/sendFeedbackEmail.php',
type: 'GET',
dataType: 'html',
timeout: 5000,
error: function(){
$('#submit_feedback').html(There_Was_A_Problem+' <a href="mailto:info@thekidscoop.com">info@thekidscoop.com</a>');
$('#submit_feedback').addClass('feedback_btn_error');
unblock('feedback_content');
},
data: { 
feedback_type: feedback_type,
subject: subject,
description: description,
email: email,
anonymus: anonymus,
feeling: feeling
},
success: function(html){
$('#submit_feedback').html(html);
$('#submit_feedback').addClass('feedback_btn_sent');
unblock('feedback_content');
}
});
}

function clearFeedbackSubject()
{
if($('#feedback_subject').val()== Please_Enter_A_Title)
{
$('#feedback_subject').val('');
$('#feedback_subject').removeClass('required');
} 
}

function clearFeedbackEmail()
{
if($('#feedback_email').val()== Please_Enter_Your_Email)
{
$('#feedback_email').val('');
$('#feedback_email').removeClass('required');
}
}

function clearFeedbackDescription()
{ 
if($('#feedback_description').val()== How_Would_You_Describe_It)
{
$('#feedback_description').val('');
$('#feedback_description').removeClass('required');
}
}

function checkValidDescription()
{
if($('#feedback_description').val()== '')
{
$('#feedback_description').val(How_Would_You_Describe_It);

}
}

function checkValidSubject()
{
if($('#feedback_subject').val()== '')
{
$('#feedback_subject').val(Please_Enter_A_Title);

}
}

function checkValidEmail()
{
if($('#feedback_email').val()== '')
{
$('#feedback_email').val(Please_Enter_Your_Email);

}
}





(function($){
var $window = $(window);

$.fn.asynchImageLoader = $.fn.jail = function(options){


options = $.extend({
timeout : 10,
effect : false,
speed : 400,
selector: null,
offset : 0,
event : 'load+scroll',
callback : jQuery.noop,
callbackAfterEachImage : jQuery.noop,
placeholder : false
}, options);

var images = this;

$.jail.initialStack = this;


this.data('triggerEl', (options.selector)? $(options.selector): $window);


if (options.placeholder !== false){
images.each(function(){
$(this).attr("src", options.placeholder);
});
}


if(/^load/.test(options.event)){
$.asynchImageLoader.later.call(this, options);
} else {
$.asynchImageLoader.onEvent.call(this, options, images);
}

return this;
};


$.asynchImageLoader = $.jail = {



_purgeStack : function(stack){

var i = 0;

while(true){
if(i === stack.length){
break;
} else {
if(stack[i].getAttribute('data-href')){
i++;
} else {
stack.splice(i, 1);
}
}
}
},



_loadOnEvent : function(e){
var $img = $(this),
options = e.data.options,
images = e.data.images;


$.asynchImageLoader._loadImage(options, $img);


$img.unbind( options.event, $.asynchImageLoader._loadOnEvent);

$.asynchImageLoader._purgeStack( images);

if (!!options.callback){
$.asynchImageLoader._purgeStack( $.jail.initialStack);
$.asynchImageLoader._launchCallback($.jail.initialStack, options);
}
},




_bufferedEventListener : function(e){
var images = e.data.images,
options = e.data.options,
triggerEl = images.data('triggerEl');

clearTimeout(images.data('poller'));
images.data('poller', setTimeout(function(){
images.each(function _imageLoader(){
$.asynchImageLoader._loadImageIfVisible(options, this, triggerEl);
});

$.asynchImageLoader._purgeStack( images);

if (!!options.callback){
$.asynchImageLoader._purgeStack( $.jail.initialStack);
$.asynchImageLoader._launchCallback($.jail.initialStack, options);
}

}, options.timeout));

},


onEvent : function(options, images){
images = images || this;

if (options.event === 'scroll' || options.selector){
var triggerEl = images.data('triggerEl');

if(images.length > 0){


triggerEl.bind( options.event, { images:images, options:options }, $.asynchImageLoader._bufferedEventListener);

if (options.event === 'scroll' || !options.selector){
$window.resize({ images:images, options:options }, $.asynchImageLoader._bufferedEventListener);
}
return;
} else {
if (!!triggerEl){
triggerEl.unbind( options.event, $.asynchImageLoader._bufferedEventListener);
}
}
} else {

images.bind(options.event, { options:options, images:images }, $.asynchImageLoader._loadOnEvent);
}
},


later : function(options){
var images = this;


if (options.event === 'load'){
images.each(function(){
$.asynchImageLoader._loadImageIfVisible(options, this, images.data('triggerEl'));
});
}
$.asynchImageLoader._purgeStack(images);

$.asynchImageLoader._launchCallback(images, options);


setTimeout(function(){

if (options.event === 'load'){
images.each(function(){
$.asynchImageLoader._loadImage(options, $(this));
});
} else {

images.each(function(){
$.asynchImageLoader._loadImageIfVisible(options, this, images.data('triggerEl'));
});
}

$.asynchImageLoader._purgeStack( images);

$.asynchImageLoader._launchCallback(images, options);

if (options.event === 'load+scroll'){
options.event = 'scroll';
$.asynchImageLoader.onEvent( options, images);
}
}, options.timeout);
},

_launchCallback : function(images, options){
if (images.length === 0 && !$.jail.isCallback){

options.callback.call(this, options);
$.jail.isCallback = true;
}
},


_loadImageIfVisible : function(options, image, triggerEl){
var $img = $(image),
container = (options.event === 'scroll' ? triggerEl : $window);

if ($.asynchImageLoader._isInTheScreen (container, $img, options.offset)){
$.asynchImageLoader._loadImage(options, $img);
}

},


_isInTheScreen : function($ct, $img, optionOffset){
var is_ct_window= $ct[0] === window,
ct_offset= (is_ct_window ? { top:0, left:0 } : $ct.offset()),
ct_top = ct_offset.top + ( is_ct_window ? $ct.scrollTop(): 0),
ct_left= ct_offset.left + ( is_ct_window ? $ct.scrollLeft(): 0),
ct_right = ct_left + $ct.width(),
ct_bottom= ct_top + $ct.height(),
img_offset = $img.offset(),
img_width = $img.width(),
img_height = $img.height();

return (ct_top - optionOffset)<= (img_offset.top + img_height)&&
(ct_bottom + optionOffset)>= img_offset.top &&
(ct_left - optionOffset)<= (img_offset.left + img_width)&&
(ct_right + optionOffset)>= img_offset.left;
},


_loadImage : function(options, $img){

$img.hide();
$img.attr("src", $img.attr("data-href"));
$img.removeAttr('data-href');


if(options.effect){
if (options.speed){
$img[options.effect](options.speed);
} else {
$img[options.effect]();
}
} else {
$img.show();
}


options.callbackAfterEachImage.call(this, options);
}
};
}(jQuery));






var _ga = _ga || {};



var _gaq = _gaq || [];



_ga.trackSocial = function(opt_pageUrl, opt_trackerName){
_ga.trackFacebook(opt_pageUrl, opt_trackerName);
_ga.trackTwitter(opt_pageUrl, opt_trackerName);
};



_ga.trackFacebook = function(opt_pageUrl, opt_trackerName){
var trackerName = _ga.buildTrackerName_(opt_trackerName);
try {
if (FB && FB.Event && FB.Event.subscribe){
FB.Event.subscribe('edge.create', function(targetUrl){
_gaq.push([trackerName + '_trackSocial', 'facebook', 'like',
targetUrl, opt_pageUrl]);
});
FB.Event.subscribe('edge.remove', function(targetUrl){
_gaq.push([trackerName + '_trackSocial', 'facebook', 'unlike',
targetUrl, opt_pageUrl]);
});
FB.Event.subscribe('message.send', function(targetUrl){
_gaq.push([trackerName + '_trackSocial', 'facebook', 'send',
targetUrl, opt_pageUrl]);
});
}
} catch (e){}
};



_ga.buildTrackerName_ = function(opt_trackerName){
return opt_trackerName ? opt_trackerName + '.' : '';
};



_ga.trackTwitter = function(opt_pageUrl, opt_trackerName){
var trackerName = _ga.buildTrackerName_(opt_trackerName);
try {
if (twttr && twttr.events && twttr.events.bind){
twttr.events.bind('tweet', function(event){
if (event){
var targetUrl; 
if (event.target && event.target.nodeName == 'IFRAME'){
targetUrl = _ga.extractParamFromUri_(event.target.src, 'url');
}
_gaq.push([trackerName + '_trackSocial', 'twitter', 'tweet',
targetUrl, opt_pageUrl]);
}
});
}
} catch (e){}
};



_ga.extractParamFromUri_ = function(uri, paramName){
if (!uri){
return;
}
var uri = uri.split('#')[0];
var parts = uri.split('?');
if (parts.length == 1){
return;
}
var query = decodeURI(parts[1]);


paramName += '=';
var params = query.split('&');
for (var i = 0, param; param = params[i]; ++i){
if (param.indexOf(paramName)=== 0){
return unescape(param.split('=')[1]);
}
}
return;
};

;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 1J="";3 34=5(p,q){3 r=p;3 s=1b;3 q=$.35({1g:3S,2g:7,3a:23,1K:11,1L:3T,3b:\'1Y\',1M:15,3c:\'3U\',2A:\'\',1k:\'\'},q);1b.1U=2h 3d();3 t="";3 u={};u.2B=11;u.2i=15;u.2j=1m;3 v=15;3 w={2C:\'3V\',1N:\'3W\',1O:\'3X\',1P:\'3Y\',1f:\'3Z\',2D:\'41\',2E:\'42\',43:\'44\',2k:\'45\',3e:\'46\'};3 x={1Y:q.3b,2F:\'2F\',2G:\'2G\',2H:\'2H\',1q:\'1q\',1j:.30,2I:\'2I\',2l:\'2l\',2m:\'2m\'};3 y={3f:"2n,2J,2K,1Q,2o,2p,1r,1B,2q,1R,47,1Z,2L",48:"1C,1s,1j,49"};1b.1D=2h 3d();3 z=$(r).12("19");4(3g(z)=="1a"||z.1c<=0){z="4a"+$.1S.3h++;$(r).12("19",z)};3 A=$(r).12("1k");q.1k+=(A==1a)?"":A;3 B=$(r).3i();v=($(r).12("1C")>1||$(r).12("1s")==11)?11:15;4(v){q.2g=$(r).12("1C")};3 C={};3 D=5(a){18 z+w[a]};3 E=5(a){3 b=a;3 c=$(b).12("1k");18 c};3 F=5(a){3 b=$("#"+z+" 2r:8");4(b.1c>1){1t(3 i=0;i<b.1c;i++){4(a==b[i].1h){18 11}}}1d 4(b.1c==1){4(b[0].1h==a){18 11}};18 15};3 G=5(a,b,c,d){3 e="";3 f=(d=="2M")?D("2E"):D("2D");3 g=(d=="2M")?f+"2N"+(b)+"2N"+(c):f+"2N"+(b);3 h="";3 i="";4(q.1M!=15){i=\' \'+q.1M+\' \'+a.3j}1d{h=$(a).12("1V");h=(h.1c==0)?"":\'<3k 3l="\'+h+\'" 3m="3n" /> \'};3 j=$(a).1o();3 k=$(a).4b();3 l=($(a).12("1j")==11)?"1j":"21";C[g]={1E:h+j,22:k,1o:j,1h:a.1h,19:g};3 m=E(a);4(F(a.1h)==11){e+=\'<a 3o="3p:3q(0);" 1p="8 \'+l+i+\'"\'}1d{e+=\'<a  3o="3p:3q(0);" 1p="\'+l+i+\'"\'};4(m!==15&&m!==1a){e+=" 1k=\'"+m+"\'"};e+=\' 19="\'+g+\'">\';e+=h+\'<1u 1p="\'+x.1q+\'">\'+j+\'</1u></a>\';18 e};3 H=5(){3 f=B;4(f.1c==0)18"";3 g="";3 h=D("2D");3 i=D("2E");f.2O(5(c){3 d=f[c];4(d.4c=="4d"){g+="<1v 1p=\'4e\'>";g+="<1u 1k=\'3r-4f:4g;3r-1k:4h; 4i:4j;\'>"+$(d).12("4k")+"</1u>";3 e=$(d).3i();e.2O(5(a){3 b=e[a];g+=G(b,c,a,"2M")});g+="</1v>"}1d{g+=G(d,c,"","")}});18 g};3 I=5(){3 a=D("1N");3 b=D("1f");3 c=q.1k;1W="";1W+=\'<1v 19="\'+b+\'" 1p="\'+x.2H+\'"\';4(!v){1W+=(c!="")?\' 1k="\'+c+\'"\':\'\'}1d{1W+=(c!="")?\' 1k="2s-1w:4l 4m #4n;1x:2t;1y:2P;\'+c+\'"\':\'\'};1W+=\'>\';18 1W};3 J=5(){3 a=D("1O");3 b=D("2k");3 c=D("1P");3 d=D("3e");3 e="";3 f="";4(6.9(z).1F.1c>0){e=$("#"+z+" 2r:8").1o();f=$("#"+z+" 2r:8").12("1V")};f=(f.1c==0||f==1a||q.1K==15||q.1M!=15)?"":\'<3k 3l="\'+f+\'" 3m="3n" /> \';3 g=\'<1v 19="\'+a+\'" 1p="\'+x.2F+\'"\';g+=\'>\';g+=\'<1u 19="\'+b+\'" 1p="\'+x.2G+\'"></1u><1u 1p="\'+x.1q+\'" 19="\'+c+\'">\'+f+\'<1u 1p="\'+x.1q+\'">\'+e+\'</1u></1u></1v>\';18 g};3 K=5(){3 c=D("1f");$("#"+c+" a.21").1I("1Q");$("#"+c+" a.21").1e("1Q",5(a){a.24();N(1b);4(!v){$("#"+c).1I("1B");P(15);3 b=(q.1K==15)?$(1b).1o():$(1b).1E();T(b);s.25()};X()})};3 L=5(){3 d=15;3 e=D("1N");3 f=D("1O");3 g=D("1P");3 h=D("1f");3 i=D("2k");3 j=$("#"+z).2Q();j=j+2;3 k=q.1k;4($("#"+e).1c>0){$("#"+e).2u();d=11};3 l=\'<1v 19="\'+e+\'" 1p="\'+x.1Y+\'"\';l+=(k!="")?\' 1k="\'+k+\'"\':\'\';l+=\'>\';l+=J();l+=I();l+=H();l+="</1v>";l+="</1v>";4(d==11){3 m=D("2C");$("#"+m).2R(l)}1d{$("#"+z).2R(l)};4(v){3 f=D("1O");$("#"+f).2v()};$("#"+e).14("2Q",j+"1T");$("#"+h).14("2Q",(j-2)+"1T");4(B.1c>q.2g){3 n=26($("#"+h+" a:3s").14("28-3t"))+26($("#"+h+" a:3s").14("28-1w"));3 o=((q.3a)*q.2g)-n;$("#"+h).14("1g",o+"1T")}1d 4(v){3 o=$("#"+z).1g();$("#"+h).14("1g",o+"1T")};4(d==15){S();O(z)};4($("#"+z).12("1j")==11){$("#"+e).14("2w",x.1j)};R();$("#"+f).1e("1B",5(a){2S(1)});$("#"+f).1e("1R",5(a){2S(0)});K();$("#"+h+" a.1j").14("2w",x.1j);4(v){$("#"+h).1e("1B",5(c){4(!u.2i){u.2i=11;$(6).1e("1Z",5(a){3 b=a.3u;u.2j=b;4(b==39||b==40){a.24();a.2x();U();X()};4(b==37||b==38){a.24();a.2x();V();X()}})}})};$("#"+h).1e("1R",5(a){P(15);$(6).1I("1Z");u.2i=15;u.2j=1m});$("#"+f).1e("1Q",5(b){P(15);4($("#"+h+":3v").1c==1){$("#"+h).1I("1B")}1d{$("#"+h).1e("1B",5(a){P(11)});s.3w()}});$("#"+f).1e("1R",5(a){P(15)});4(q.1K&&q.1M!=15){W()}};3 M=5(a){1t(3 i 2y C){4(C[i].1h==a){18 C[i]}};18-1};3 N=5(a){3 b=D("1f");4($("#"+b+" a.8").1c==1){t=$("#"+b+" a.8").1o()};4(!v){$("#"+b+" a.8").1G("8")};3 c=$("#"+b+" a.8").12("19");4(c!=1a){3 d=(u.1X==1a||u.1X==1m)?C[c].1h:u.1X};4(a&&!v){$(a).1z("8")};4(v){3 e=u.2j;4($("#"+z).12("1s")==11){4(e==17){u.1X=C[$(a).12("19")].1h;$(a).4o("8")}1d 4(e==16){$("#"+b+" a.8").1G("8");$(a).1z("8");3 f=$(a).12("19");3 g=C[f].1h;1t(3 i=2T.4p(d,g);i<=2T.4q(d,g);i++){$("#"+M(i).19).1z("8")}}1d{$("#"+b+" a.8").1G("8");$(a).1z("8");u.1X=C[$(a).12("19")].1h}}1d{$("#"+b+" a.8").1G("8");$(a).1z("8");u.1X=C[$(a).12("19")].1h}}};3 O=5(a){3 b=a;6.9(b).4r=5(e){$("#"+b).1S(q)}};3 P=5(a){u.2B=a};3 Q=5(){18 u.2B};3 R=5(){3 b=D("1N");3 c=y.3f.4s(",");1t(3 d=0;d<c.1c;d++){3 e=c[d];3 f=Y(e);4(f==11){3x(e){1n"2n":$("#"+b).1e("4t",5(a){6.9(z).2n()});1i;1n"1Q":$("#"+b).1e("1Q",5(a){$("#"+z).1H("1Q")});1i;1n"2o":$("#"+b).1e("2o",5(a){$("#"+z).1H("2o")});1i;1n"2p":$("#"+b).1e("2p",5(a){$("#"+z).1H("2p")});1i;1n"1r":$("#"+b).1e("1r",5(a){$("#"+z).1H("1r")});1i;1n"1B":$("#"+b).1e("1B",5(a){$("#"+z).1H("1B")});1i;1n"2q":$("#"+b).1e("2q",5(a){$("#"+z).1H("2q")});1i;1n"1R":$("#"+b).1e("1R",5(a){$("#"+z).1H("1R")});1i}}}};3 S=5(){3 a=D("2C");$("#"+z).2R("<1v 1p=\'"+x.2I+"\' 1k=\'1g:4u;4v:4w;1y:3y;\' 19=\'"+a+"\'></1v>");$("#"+z).4x($("#"+a))};3 T=5(a){3 b=D("1P");$("#"+b).1E(a)};3 U=5(){3 a=D("1P");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("19");4($(e).3z("8")&&d<c.1c-1){$("#"+b+" a.8").1G("8");$(c[d+1]).1z("8");3 g=$("#"+b+" a.8").12("19");4(!v){3 h=(q.1K==15)?C[g].1o:C[g].1E;T(h)};4(26(($("#"+g).1y().1w+$("#"+g).1g()))>=26($("#"+b).1g())){$("#"+b).29(($("#"+b).29())+$("#"+g).1g()+$("#"+g).1g())};1i}}};3 V=5(){3 a=D("1P");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("19");4($(e).3z("8")&&d!=0){$("#"+b+" a.8").1G("8");$(c[d-1]).1z("8");3 g=$("#"+b+" a.8").12("19");4(!v){3 h=(q.1K==15)?C[g].1o:C[g].1E;T(h)};4(26(($("#"+g).1y().1w+$("#"+g).1g()))<=0){$("#"+b).29(($("#"+b).29()-$("#"+b).1g())-$("#"+g).1g())};1i}}};3 W=5(){4(q.1M!=15){3 a=D("1P");3 b=6.9(z).1F[6.9(z).1l].3j;4(b.1c>0){3 c=D("1f");3 d=$("#"+c+" a."+b).12("19");3 e=$("#"+d).14("2a-4y");3 f=$("#"+d).14("2a-1y");3 g=$("#"+d).14("28-3A");4(e!=1a){$("#"+a).2b("."+x.1q).12(\'1k\',"2a:"+e)};4(f!=1a){$("#"+a).2b("."+x.1q).14(\'2a-1y\',f)};4(g!=1a){$("#"+a).2b("."+x.1q).14(\'28-3A\',g)};$("#"+a).2b("."+x.1q).14(\'2a-3B\',\'4z-3B\');$("#"+a).2b("."+x.1q).14(\'28-3t\',\'4A\')}}};3 X=5(){3 a=D("1f");3 b=$("#"+a+" a.8");4(b.1c==1){3 c=$("#"+a+" a.8").1o();3 d=$("#"+a+" a.8").12("19");4(d!=1a){3 e=C[d].22;6.9(z).1l=C[d].1h};4(q.1K&&q.1M!=15)W()}1d 4(b.1c>1){3 f=$("#"+z+" > 2r:8").4B("8");1t(3 i=0;i<b.1c;i++){3 d=$(b[i]).12("19");3 g=C[d].1h;6.9(z).1F[g].8="8"}};3 h=6.9(z).1l;s.1U["1l"]=h};3 Y=5(a){4($("#"+z).12("4C"+a)!=1a){18 11};3 b=$("#"+z).2U("4D");4(b&&b[a]){18 11};18 15};3 Z=5(){3 b=D("1f");4(Y(\'2K\')==11){3 c=C[$("#"+b+" a.8").12("19")].1o;4($.3C(t)!==$.3C(c)&&t!==""){$("#"+z).1H("2K")}};4(Y(\'1r\')==11){$("#"+z).1H("1r")};4(Y(\'2J\')==11){$(6).1e("1r",5(a){$("#"+z).2n();$("#"+z)[0].2J();X();$(6).1I("1r")})}};3 2S=5(a){3 b=D("2k");4(a==1)$("#"+b).14({3D:\'0 4E%\'});1d $("#"+b).14({3D:\'0 0\'})};3 3E=5(){1t(3 i 2y 6.9(z)){4(3g(6.9(z)[i])!=\'5\'&&6.9(z)[i]!==1a&&6.9(z)[i]!==1m){s.1A(i,6.9(z)[i],11)}}};3 3F=5(a,b){4(M(b)!=-1){6.9(z)[a]=b;3 c=D("1f");$("#"+c+" a.8").1G("8");$("#"+M(b).19).1z("8");3 d=M(6.9(z).1l).1E;T(d)}};3 3G=5(i,a){4(a==\'d\'){1t(3 b 2y C){4(C[b].1h==i){4F C[b];1i}}};3 c=0;1t(3 b 2y C){C[b].1h=c;c++}};3 2V=5(){3 a=D("1f");3 b=D("1N");3 c=$("#"+b).1y();3 d=$("#"+b).1g();3 e=$(3H).1g();3 f=$(3H).29();3 g=$("#"+a).1g();3 h={1L:q.1L,1w:(c.1w+d)+"1T",1x:"2c"};3 i=q.3c;3 j=15;3 k=x.2m;$("#"+a).1G(x.2m);$("#"+a).1G(x.2l);4((e+f)<2T.4G(g+d+c.1w)){3 l=c.1w-g;4((c.1w-g)<0){l=10};h={1L:q.1L,1w:l+"1T",1x:"2c"};i="2W";j=11;k=x.2l};18{2X:j,3I:i,14:h,2s:k}};1b.3w=5(){4((s.2d("1j",11)==11)||(s.2d("1F",11).1c==0))18;3 c=D("1f");4(1J!=""&&c!=1J){$("#"+1J).3J("2Y");$("#"+1J).14({1L:\'0\'})};4($("#"+c).14("1x")=="2c"){t=C[$("#"+c+" a.8").12("19")].1o;$(6).1e("1Z",5(a){3 b=a.3u;4(b==39||b==40){a.24();a.2x();U()};4(b==37||b==38){a.24();a.2x();V()};4(b==27||b==13){s.25();X()};4($("#"+z).12("3K")!=1a){6.9(z).3K()}});$(6).1e("2L",5(a){4($("#"+z).12("3L")!=1a){6.9(z).3L()}});$(6).1e("1r",5(a){4(Q()==15){s.25()}});3 d=2V();$("#"+c).14(d.14);4(d.2X==11){$("#"+c).14({1x:\'2t\'});$("#"+c).1z(d.2s);4(s.1D["2z"]!=1m){2e(s.1D["2z"])(s)}}1d{$("#"+c)[d.3I]("2Y",5(){$("#"+c).1z(d.2s);4(s.1D["2z"]!=1m){2e(s.1D["2z"])(s)}})};4(c!=1J){1J=c}}};1b.25=5(){3 b=D("1f");$(6).1I("1Z");$(6).1I("2L");$(6).1I("1r");3 c=2V();4(c.2X==11){$("#"+b).14("1x","2c")};$("#"+b).3J("2Y",5(a){Z();$("#"+b).14({1L:\'0\'});4(s.1D["3M"]!=1m){2e(s.1D["3M"])(s)}})};1b.1l=5(i){s.1A("1l",i)};1b.1A=5(a,b,c){4(a==1a||b==1a)3N{3O:"1A 4H 4I?"};s.1U[a]=b;4(c!=11){3x(a){1n"1l":3F(a,b);1i;1n"1j":s.1j(b,11);1i;1n"1s":6.9(z)[a]=b;v=($(r).12("1C")>0||$(r).12("1s")==11)?11:15;4(v){3 d=$("#"+z).1g();3 f=D("1f");$("#"+f).14("1g",d+"1T");3 g=D("1O");$("#"+g).2v();3 f=D("1f");$("#"+f).14({1x:\'2t\',1y:\'2P\'});K()};1i;1n"1C":6.9(z)[a]=b;4(b==0){6.9(z).1s=15};v=($(r).12("1C")>0||$(r).12("1s")==11)?11:15;4(b==0){3 g=D("1O");$("#"+g).2W();3 f=D("1f");$("#"+f).14({1x:\'2c\',1y:\'3y\'});3 h="";4(6.9(z).1l>=0){3 i=M(6.9(z).1l);h=i.1E;N($("#"+i.19))};T(h)}1d{3 g=D("1O");$("#"+g).2v();3 f=D("1f");$("#"+f).14({1x:\'2t\',1y:\'2P\'})};1i;4J:4K{6.9(z)[a]=b}4L(e){};1i}}};1b.2d=5(a,b){4(a==1a&&b==1a){18 s.1U};4(a!=1a&&b==1a){18(s.1U[a]!=1a)?s.1U[a]:1m};4(a!=1a&&b!=1a){18 6.9(z)[a]}};1b.3v=5(a){3 b=D("1N");4(a==11){$("#"+b).2W()}1d 4(a==15){$("#"+b).2v()}1d{18 $("#"+b).14("1x")}};1b.4M=5(a,b){3 c=a;3 d=c.1o;3 e=(c.22==1a||c.22==1m)?d:c.22;3 f=(c["1V"]==1a||c["1V"]==1m)?\'\':c["1V"];3 i=(b==1a||b==1m)?6.9(z).1F.1c:b;6.9(z).1F[i]=2h 4N(d,e);4(f!=\'\')6.9(z).1F[i]["1V"]=f;3 g=M(i);4(g!=-1){3 h=G(6.9(z).1F[i],i,"","");$("#"+g.19).1E(h)}1d{3 h=G(6.9(z).1F[i],i,"","");3 j=D("1f");$("#"+j).4O(h);K()}};1b.2u=5(i){6.9(z).2u(i);4((M(i))!=-1){$("#"+M(i).19).2u();3G(i,\'d\')};4(6.9(z).1c==0){T("")}1d{3 a=M(6.9(z).1l).1E;T(a)};s.1A("1l",6.9(z).1l)};1b.1j=5(a,b){6.9(z).1j=a;3 c=D("1N");4(a==11){$("#"+c).14("2w",x.1j);s.25()}1d 4(a==15){$("#"+c).14("2w",1)};4(b!=11){s.1A("1j",a)}};1b.2Z=5(){18(6.9(z).2Z==1a)?1m:6.9(z).2Z};1b.31=5(){4(2f.1c==1){18 6.9(z).31(2f[0])}1d 4(2f.1c==2){18 6.9(z).31(2f[0],2f[1])}1d{3N{3O:"4P 1h 4Q 4R!"}}};1b.3P=5(a){18 6.9(z).3P(a)};1b.1s=5(a){4(a==1a){18 s.2d("1s")}1d{s.1A("1s",a)}};1b.1C=5(a){4(a==1a){18 s.2d("1C")}1d{s.1A("1C",a)}};1b.4S=5(a,b){s.1D[a]=b};1b.4T=5(a){2e(s.1D[a])(s)};3 3Q=5(){s.1A("32",$.1S.32);s.1A("33",$.1S.33)};3 3R=5(){L();3E();3Q();4(q.2A!=\'\'){2e(q.2A)(s)}};3R()};$.1S={32:2.36,33:"4U 4V",3h:20,4W:5(a,b){18 $(a).1S(b).2U("1Y")}};$.4X.35({1S:5(b){18 1b.2O(5(){3 a=2h 34(1b,b);$(1b).2U(\'1Y\',a)})}})})(4Y);',62,309,'|||var|if|function|document||selected|getElementById||||||||||||||||||||||||||||||||||||||||||||||||||||||true|attr||css|false|||return|id|undefined|this|length|else|bind|postChildID|height|index|break|disabled|style|selectedIndex|null|case|text|class|ddTitleText|mouseup|multiple|for|span|div|top|display|position|addClass|set|mouseover|size|onActions|html|options|removeClass|trigger|unbind|bh|showIcon|zIndex|useSprite|postID|postTitleID|postTitleTextID|click|mouseout|msDropDown|px|ddProp|title|sDiv|oldIndex|dd|keydown||enabled|value||preventDefault|close|parseInt||padding|scrollTop|background|find|none|get|eval|arguments|visibleRows|new|keyboardAction|currentKey|postArrowID|borderTop|noBorderTop|focus|dblclick|mousedown|mousemove|option|border|block|remove|hide|opacity|stopPropagation|in|onOpen|onInit|insideWindow|postElementHolder|postAID|postOPTAID|ddTitle|arrow|ddChild|ddOutOfVision|blur|change|keyup|opt|_|each|relative|width|after|bj|Math|data|bn|show|opp|fast|form||item|version|author|bi|extend|||||rowHeight|mainCSS|animStyle|Object|postInputhidden|actions|typeof|counter|children|className|img|src|align|absmiddle|href|javascript|void|font|first|bottom|keyCode|visible|open|switch|absolute|hasClass|left|repeat|trim|backgroundPosition|bk|bl|bm|window|ani|slideUp|onkeydown|onkeyup|onClose|throw|message|namedItem|bo|bp|120|9999|slideDown|_msddHolder|_msdd|_title|_titletext|_child||_msa|_msopta|postInputID|_msinput|_arrow|_inp|keypress|prop|tabindex|msdrpdd|val|nodeName|OPTGROUP|opta|weight|bold|italic|clear|both|label|1px|solid|c3c3c3|toggleClass|min|max|refresh|split|mouseenter|0px|overflow|hidden|appendTo|image|no|2px|removeAttr|on|events|100|delete|floor|to|what|default|try|catch|add|Option|append|An|is|required|addMyEvent|fireEvent|Marghoob|Suleman|create|fn|jQuery'.split('|'),0,{}))
