﻿(function($){$.fn.autocomplete=function(options){return this.each(function(){return new Autocomplete(this,options);
});};var reEscape=new RegExp("(\\"+["/",".","*","+","?","|","(",")","[","]","{","}","\\"].join("|\\")+")","g");
var fnFormatResult=function(value,data,currentValue){var pattern="("+currentValue.replace(reEscape,"\\$1")+")";
return value.replace(new RegExp(pattern,"gi"),"<strong>$1</strong>");};var Autocomplete=function(el,options){this.el=$(el);
this.el.attr("autocomplete","off");this.suggestions=[];this.data=[];this.badQueries=[];
this.selectedIndex=-1;this.currentValue=this.el.val();this.intervalId=0;this.cachedResponse=[];
this.onChangeInterval=null;this.ignoreValueChange=false;this.serviceUrl=options.serviceUrl;
this.isLocal=false;this.options={autoSubmit:false,minChars:1,maxHeight:300,deferRequestBy:0,width:0,highlight:true,params:{},fnFormatResult:fnFormatResult,delimiter:null};
if(options){$.extend(this.options,options);}if(this.options.lookup){this.isLocal=true;
if($.isArray(this.options.lookup)){this.options.lookup={suggestions:this.options.lookup,data:[]};
}}this.initialize();};Autocomplete.prototype={killerFn:null,initialize:function(){var me,zindex;
me=this;zindex=Math.max.apply(null,$.map($("body > *"),function(e,n){if($(e).css("position")==="absolute"){return parseInt($(e).css("z-index"),10)||1;
}}));this.killerFn=function(e){if($(e.target).parents(".autocomplete").size()===0){me.killSuggestions();
me.disableKillerFn();}};var uid=new Date().getTime();var autocompleteElId="Autocomplete_"+uid;
if(!this.options.width){this.options.width=this.el.width();}this.mainContainerId="AutocompleteContainter_"+uid;
zindex=10004;$('<div id="'+this.mainContainerId+'" style="position:absolute;z-index:'+zindex+'"><div class="autocomplete-w1"><div class="autocomplete" id="'+autocompleteElId+'" style="display:none; width:'+this.options.width+'px;"></div></div></div>').appendTo("body");
this.container=$("#"+autocompleteElId);this.fixPosition();if(window.opera){this.el.keypress(function(e){me.onKeyPress(e);
});}else{this.el.keydown(function(e){me.onKeyPress(e);});}this.el.keyup(function(e){me.onKeyUp(e);
});this.el.blur(function(){me.enableKillerFn();});this.el.focus(function(){me.fixPosition();
});this.container.css({maxHeight:this.options.maxHeight+"px"});},fixPosition:function(){$("#"+this.mainContainerId).css({zIndex:10004});
var offset=this.el.offset();$("#"+this.mainContainerId).css({top:(offset.top+this.el.innerHeight()+5)+"px",left:offset.left+"px"});
},enableKillerFn:function(){var me=this;$(document).bind("click",me.killerFn);},disableKillerFn:function(){var me=this;
$(document).unbind("click",me.killerFn);},killSuggestions:function(){var me=this;
this.stopKillSuggestions();this.intervalId=window.setInterval(function(){me.hide();
me.stopKillSuggestions();},300);},stopKillSuggestions:function(){window.clearInterval(this.intervalId);
},onKeyPress:function(e){if(!this.enabled){return;}switch(e.keyCode){case 27:this.el.val(this.currentValue);
this.hide();break;case 9:case 13:if(this.selectedIndex===-1){this.hide();return;}this.select(this.selectedIndex);
if(e.keyCode===9){return;}break;case 38:this.moveUp();break;case 40:this.moveDown();
break;default:return;}e.stopImmediatePropagation();e.preventDefault();},onKeyUp:function(e){switch(e.keyCode){case 38:case 40:return;
}clearInterval(this.onChangeInterval);if(this.currentValue!==this.el.val()){if(this.options.deferRequestBy>0){var me=this;
this.onChangeInterval=setInterval(function(){me.onValueChange();},this.options.deferRequestBy);
}else{this.onValueChange();}}},onValueChange:function(){clearInterval(this.onChangeInterval);
this.currentValue=this.el.val();var q=this.getQuery(this.currentValue);this.selectedIndex=-1;
if(this.ignoreValueChange){this.ignoreValueChange=false;return;}if(q===""||q.length<this.options.minChars){this.hide();
}else{this.getSuggestions(q);}},getQuery:function(val){var d,arr;d=this.options.delimiter;
if(!d){return $.trim(val);}arr=val.split(d);return $.trim(arr[arr.length-1]);},getSuggestionsLocal:function(q){var ret,arr,len,val;
arr=this.options.lookup;len=arr.suggestions.length;ret={suggestions:[],data:[]};for(var i=0;
i<len;i++){val=arr.suggestions[i];if(val.toLowerCase().indexOf(q.toLowerCase())===0){ret.suggestions.push(val);
ret.data.push(arr.data[i]);}}return ret;},getSuggestions:function(q){var cr,me,ls;
cr=this.isLocal?this.getSuggestionsLocal(q):this.cachedResponse[q];if(cr&&$.isArray(cr.suggestions)){this.suggestions=cr.suggestions;
this.data=cr.data;this.suggest();}else{if(!this.isBadQuery(q)){me=this;me.options.params.query=q;
if(me.options.params.method=="POST"){$.post(this.serviceUrl,me.options.params,function(txt){me.processResponse(txt);
},"text");}else{$.get(this.serviceUrl,me.options.params,function(txt){me.processResponse(txt);
},"text");}}}},isBadQuery:function(q){var i=this.badQueries.length;while(i--){if(q.indexOf(this.badQueries[i])===0){return true;
}}return false;},hide:function(){this.enabled=false;this.selectedIndex=-1;this.container.hide();
},suggest:function(){if(this.suggestions.length===0){this.hide();return;}var me,len,div,f;
me=this;len=this.suggestions.length;f=this.options.fnFormatResult;v=this.getQuery(this.currentValue);
this.container.hide().empty();for(var i=0;i<len;i++){div=$((me.selectedIndex===i?'<div class="selected"':"<div")+' title="'+this.suggestions[i]+'">'+f(this.suggestions[i],this.data[i],v)+"</div>");
div.mouseover((function(xi){return function(){me.activate(xi);};})(i));div.click((function(xi){return function(){me.select(xi);
};})(i));this.container.append(div);}this.enabled=true;this.container.show();},processResponse:function(text){var response;
response=eval("("+text+")");if(!$.isArray(response.data)){response.data=[];}this.suggestions=response.suggestions;
this.data=response.data;this.cachedResponse[response.query]=response;if(response.suggestions.length===0){this.badQueries.push(response.query);
}if(response.query===this.getQuery(this.currentValue)){this.suggest();}},activate:function(index){var divs=this.container.children();
var activeItem;if(this.selectedIndex!==-1&&divs.length>this.selectedIndex){$(divs.get(this.selectedIndex)).attr("class","");
}this.selectedIndex=index;if(this.selectedIndex!==-1&&divs.length>this.selectedIndex){activeItem=divs.get(this.selectedIndex);
$(activeItem).attr("class","selected");}return activeItem;},deactivate:function(div,index){div.className="";
if(this.selectedIndex===index){this.selectedIndex=-1;}},select:function(i){var selectedValue=this.suggestions[i];
if(selectedValue){this.el.val(selectedValue);if(this.options.autoSubmit){var f=this.el.parents("form");
if(f.length>0){f.get(0).submit();}}this.ignoreValueChange=true;this.hide();this.onSelect(i);
}},moveUp:function(){if(this.selectedIndex===-1){return;}if(this.selectedIndex===0){this.container.children().get(0).className="";
this.selectedIndex=-1;this.el.val(this.currentValue);return;}this.adjustScroll(this.selectedIndex-1);
},moveDown:function(){if(this.selectedIndex===(this.suggestions.length-1)){return;
}this.adjustScroll(this.selectedIndex+1);},adjustScroll:function(i){var activeItem,offsetTop,upperBound,lowerBound;
activeItem=this.activate(i);offsetTop=activeItem.offsetTop;upperBound=this.container.scrollTop();
lowerBound=upperBound+this.options.maxHeight-25;if(offsetTop<upperBound){this.container.scrollTop(offsetTop);
}else{if(offsetTop>lowerBound){this.container.scrollTop(offsetTop-this.options.maxHeight+25);
}}},onSelect:function(i){var me,onSelect,getValue,s,d;me=this;onSelect=me.options.onSelect;
getValue=function(value){var del,currVal;del=me.options.delimiter;currVal=me.currentValue;
if(!del){return value;}var arr=currVal.split(del);if(arr.length===1){return value;
}return currVal.substr(0,currVal.length-arr[arr.length-1].length)+value;};s=me.suggestions[i];
d=me.data[i];me.el.val(getValue(s));if($.isFunction(onSelect)){onSelect(s,d);}}};
})(jQuery);
(function(b){b.fn.jcarousel=function(d){return this.each(function(){new c(this,d);
});};var a={vertical: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};
b.jcarousel=function(l,h){this.options=b.extend({},a,h||{});this.locked=false;this.container=null;
this.clip=null;this.list=null;this.buttonNext=null;this.buttonPrev=null;this.wh=!this.options.vertical?"width":"height";
this.lt=!this.options.vertical?"left":"top";var m="",j=l.className.split(" ");for(var d=0;
d<j.length;d++){if(j[d].indexOf("jcarousel-skin")!=-1){b(l).removeClass(j[d]);var m=j[d];
break;}}if(l.nodeName=="UL"||l.nodeName=="OL"){this.list=b(l);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=b(l);this.list=b(l).find(">ul,>ol,div>ul,div>ol");}if(m!=""&&this.container.parent()[0].className.indexOf("jcarousel-skin")==-1){this.container.wrap('<div class=" '+m+'"></div>');
}this.clip=this.list.parent();if(!this.clip.length||!this.clip.hasClass("jcarousel-clip")){this.clip=this.list.wrap("<div></div>").parent();
}this.buttonPrev=b(".jcarousel-prev",this.container);if(this.buttonPrev.size()==0&&this.options.buttonPrevHTML!=null){this.buttonPrev=this.clip.before(this.options.buttonPrevHTML).prev();
}this.buttonPrev.addClass(this.className("jcarousel-prev"));this.buttonNext=b(".jcarousel-next",this.container);
if(this.buttonNext.size()==0&&this.options.buttonNextHTML!=null){this.buttonNext=this.clip.before(this.options.buttonNextHTML).prev();
}this.buttonNext.addClass(this.className("jcarousel-next"));this.clip.addClass(this.className("jcarousel-clip"));
this.list.addClass(this.className("jcarousel-list"));this.container.addClass(this.className("jcarousel-container"));
var g=this.options.visible!=null?Math.ceil(this.clipping()/this.options.visible):null;
var f=this.list.children("li");var n=this;if(f.size()>0){var k=0,d=this.options.offset;
f.each(function(){n.format(this,d++);k+=n.dimension(this,g);});this.list.css(this.wh,(k+300)+"px");
if(!h||h.size===undefined){this.options.size=f.size();}}this.container.css("display","block");
this.buttonNext.css("display","block");this.buttonPrev.css("display","block");this.funcNext=function(){n.next();
};this.funcPrev=function(){n.prev();};this.funcResize=function(){n.reload();};if(this.options.initCallback!=null){this.options.initCallback(this,"init");
}if(b.browser.safari){this.buttons(false,false);b(window).bind("load",function(){n.setup();
});}else{this.setup();}};var c=b.jcarousel;c.fn=c.prototype={jcarousel:"0.2.3"};c.fn.extend=c.extend=b.extend;
c.fn.extend({setup:function(){this.first=null;this.last=null;this.prevFirst=null;
this.prevLast=null;this.animating=false;this.timer=null;this.tail=null;this.inTail=false;
if(this.locked){return;}this.list.css(this.lt,this.pos(this.options.offset)+"px");
var d=this.pos(this.options.start);this.prevFirst=this.prevLast=null;this.animate(d,false);
b(window).unbind("resize",this.funcResize).bind("resize",this.funcResize);},reset:function(){this.list.empty();
this.list.css(this.lt,"0px");this.list.css(this.wh,"10px");if(this.options.initCallback!=null){this.options.initCallback(this,"reset");
}this.setup();},reload:function(){if(this.tail!=null&&this.inTail){this.list.css(this.lt,c.intval(this.list.css(this.lt))+this.tail);
}this.tail=null;this.inTail=false;if(this.options.reloadCallback!=null){this.options.reloadCallback(this);
}if(this.options.visible!=null){var e=this;var f=Math.ceil(this.clipping()/this.options.visible),d=0,g=0;
b("li",this.list).each(function(h){d+=e.dimension(this,f);if(h+1<e.first){g=d;}});
this.list.css(this.wh,d+"px");this.list.css(this.lt,-g+"px");}this.scroll(this.first,false);
},lock:function(){this.locked=true;this.buttons();},unlock:function(){this.locked=false;
this.buttons();},size:function(d){if(d!=undefined){this.options.size=d;if(!this.locked){this.buttons();
}}return this.options.size;},has:function(g,d){if(d==undefined||!d){d=g;}if(this.options.size!==null&&d>this.options.size){d=this.options.size;
}for(var h=g;h<=d;h++){var f=this.get(h);if(!f.length||f.hasClass("jcarousel-item-placeholder")){return false;
}}return true;},get:function(d){return b(".jcarousel-item-"+d,this.list);},add:function(d,o){var n=this.get(d),g=0,l=0;
if(n.length==0){var m,n=this.create(d),f=c.intval(d);while(m=this.get(--f)){if(f<=0||m.length){f<=0?this.list.prepend(n):m.after(n);
break;}}}else{g=this.dimension(n);}n.removeClass(this.className("jcarousel-item-placeholder"));
typeof o=="string"?n.html(o):n.empty().append(o);var h=this.options.visible!=null?Math.ceil(this.clipping()/this.options.visible):null;
var k=this.dimension(n,h)-g;if(d>0&&d<this.first){this.list.css(this.lt,c.intval(this.list.css(this.lt))-k+"px");
}this.list.css(this.wh,c.intval(this.list.css(this.wh))+k+"px");return n;},remove:function(g){var h=this.get(g);
if(!h.length||(g>=this.first&&g<=this.last)){return;}var f=this.dimension(h);if(g<this.first){this.list.css(this.lt,c.intval(this.list.css(this.lt))+f+"px");
}h.remove();this.list.css(this.wh,c.intval(this.list.css(this.wh))-f+"px");},next:function(){this.stopAuto();
if(this.tail!=null&&!this.inTail){this.scrollTail(false);}else{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.stopAuto();if(this.tail!=null&&this.inTail){this.scrollTail(true);
}else{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(e){if(this.locked||this.animating||!this.tail){return;}var d=c.intval(this.list.css(this.lt));
!e?d-=this.tail:d+=this.tail;this.inTail=!e;this.prevFirst=this.first;this.prevLast=this.last;
this.animate(d);},scroll:function(e,d){if(this.locked||this.animating){return;}this.animate(this.pos(e),d);
},pos:function(o){if(this.locked||this.animating){return;}if(this.options.wrap!="circular"){o=o<1?1:(this.options.size&&o>this.options.size?this.options.size:o);
}var A=this.first>o;var D=c.intval(this.list.css(this.lt));var z=this.options.wrap!="circular"&&this.first<=1?1:this.first;
var u=A?this.get(z):this.get(this.last);var q=A?z:z-1;var y=null,r=0,g=false,w=0;
while(A?--q>=o:++q<o){y=this.get(q);g=!y.length;if(y.length==0){y=this.create(q).addClass(this.className("jcarousel-item-placeholder"));
u[A?"before":"after"](y);}u=y;w=this.dimension(y);if(g){r+=w;}if(this.first!=null&&(this.options.wrap=="circular"||(q>=1&&(this.options.size==null||q<=this.options.size)))){D=A?D+w:D-w;
}}var t=this.clipping();var B=[];var C=0,q=o,n=0;var u=this.get(o-1);while(++C){y=this.get(q);
g=!y.length;if(y.length==0){y=this.create(q).addClass(this.className("jcarousel-item-placeholder"));
u.length==0?this.list.prepend(y):u[A?"before":"after"](y);}u=y;var w=this.dimension(y);
if(w==0){alert("jCarousel: No width/height set for items. This will cause an infinite loop. Aborting...");
return 0;}if(this.options.wrap!="circular"&&this.options.size!==null&&q>this.options.size){B.push(y);
}else{if(g){r+=w;}}n+=w;if(n>=t){break;}q++;}for(var E=0;E<B.length;E++){B[E].remove();
}if(r>0){this.list.css(this.wh,this.dimension(this.list)+r+"px");if(A){D-=r;this.list.css(this.lt,c.intval(this.list.css(this.lt))-r+"px");
}}var h=o+C-1;if(this.options.wrap!="circular"&&this.options.size&&h>this.options.size){h=this.options.size;
}if(q>h){C=0,q=h,n=0;while(++C){var y=this.get(q--);if(!y.length){break;}n+=this.dimension(y);
if(n>=t){break;}}}var k=h-C+1;if(this.options.wrap!="circular"&&k<1){k=1;}if(this.inTail&&A){D+=this.tail;
this.inTail=false;}this.tail=null;if(this.options.wrap!="circular"&&h==this.options.size&&(h-C+1)>=1){var s=c.margin(this.get(h),!this.options.vertical?"marginRight":"marginBottom");
if((n-s)>t){this.tail=n-t-s;}}while(o-->k){D+=this.dimension(this.get(o));}this.prevFirst=this.first;
this.prevLast=this.last;this.first=k;this.last=h;return D;},animate:function(h,f){if(this.locked||this.animating){return;
}this.animating=true;var g=this;var d=function(){g.animating=false;if(h==0){g.list.css(g.lt,0);
}if(g.options.wrap=="both"||g.options.wrap=="last"||g.options.size==null||g.last<g.options.size){g.startAuto();
}g.buttons();g.notify("onAfterAnimation");};this.notify("onBeforeAnimation");if(!this.options.animation||f==false){this.list.css(this.lt,h+"px");
d();}else{var e=!this.options.vertical?{left:h}:{top:h};this.list.animate(e,this.options.animation,this.options.easing,d);
}},startAuto:function(d){if(d!=undefined){this.options.auto=d;}if(this.options.auto==0){return this.stopAuto();
}if(this.timer!=null){return;}var e=this;this.timer=setTimeout(function(){e.next();
},this.options.auto*1000);},stopAuto:function(){if(this.timer==null){return;}clearTimeout(this.timer);
this.timer=null;},buttons:function(d,f){if(d==undefined||d==null){var d=!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){d=this.tail!=null&&!this.inTail;
}}if(f==undefined||f==null){var f=!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){f=this.tail!=null&&this.inTail;
}}var e=this;this.buttonNext[d?"bind":"unbind"](this.options.buttonNextEvent,this.funcNext)[d?"removeClass":"addClass"](this.className("jcarousel-next-disabled")).attr("disabled",d?false:true);
this.buttonPrev[f?"bind":"unbind"](this.options.buttonPrevEvent,this.funcPrev)[f?"removeClass":"addClass"](this.className("jcarousel-prev-disabled")).attr("disabled",f?false:true);
if(this.buttonNext.length>0&&(this.buttonNext[0].jcarouselstate==undefined||this.buttonNext[0].jcarouselstate!=d)&&this.options.buttonNextCallback!=null){this.buttonNext.each(function(){e.options.buttonNextCallback(e,this,d);
});this.buttonNext[0].jcarouselstate=d;}if(this.buttonPrev.length>0&&(this.buttonPrev[0].jcarouselstate==undefined||this.buttonPrev[0].jcarouselstate!=f)&&this.options.buttonPrevCallback!=null){this.buttonPrev.each(function(){e.options.buttonPrevCallback(e,this,f);
});this.buttonPrev[0].jcarouselstate=f;}},notify:function(e){var d=this.prevFirst==null?"init":(this.prevFirst<this.first?"next":"prev");
this.callback("itemLoadCallback",e,d);if(this.prevFirst!==this.first){this.callback("itemFirstInCallback",e,d,this.first);
this.callback("itemFirstOutCallback",e,d,this.prevFirst);}if(this.prevLast!==this.last){this.callback("itemLastInCallback",e,d,this.last);
this.callback("itemLastOutCallback",e,d,this.prevLast);}this.callback("itemVisibleInCallback",e,d,this.first,this.last,this.prevFirst,this.prevLast);
this.callback("itemVisibleOutCallback",e,d,this.prevFirst,this.prevLast,this.first,this.last);
},callback:function(k,f,g,j,e,h,l){if(this.options[k]==undefined||(typeof this.options[k]!="object"&&f!="onAfterAnimation")){return;
}var n=typeof this.options[k]=="object"?this.options[k][f]:this.options[k];if(!b.isFunction(n)){return;
}var m=this;if(j===undefined){n(m,g,f);}else{if(e===undefined){this.get(j).each(function(){n(m,this,j,g,f);
});}else{for(var d=j;d<=e;d++){if(d!==null&&!(d>=h&&d<=l)){this.get(d).each(function(){n(m,this,d,g,f);
});}}}}},create:function(d){return this.format("<li></li>",d);},format:function(g,f){var d=b(g).addClass(this.className("jcarousel-item")).addClass(this.className("jcarousel-item-"+f));
d.attr("jcarouselindex",f);return d;},className:function(d){return d+" "+d+(!this.options.vertical?"-horizontal":"-vertical");
},dimension:function(j,i){var f=j.jquery!=undefined?j[0]:j;var g=!this.options.vertical?f.offsetWidth+c.margin(f,"marginLeft")+c.margin(f,"marginRight"):f.offsetHeight+c.margin(f,"marginTop")+c.margin(f,"marginBottom");
if(i==undefined||g==i){return g;}var h=!this.options.vertical?i-c.margin(f,"marginLeft")-c.margin(f,"marginRight"):i-c.margin(f,"marginTop")-c.margin(f,"marginBottom");
b(f).css(this.wh,h+"px");return this.dimension(f);},clipping:function(){return !this.options.vertical?this.clip[0].offsetWidth-c.intval(this.clip.css("borderLeftWidth"))-c.intval(this.clip.css("borderRightWidth")):this.clip[0].offsetHeight-c.intval(this.clip.css("borderTopWidth"))-c.intval(this.clip.css("borderBottomWidth"));
},index:function(e,d){if(d==undefined){d=this.options.size;}return Math.round((((e-1)/d)-Math.floor((e-1)/d))*d)+1;
}});c.extend({defaults:function(e){return b.extend(a,e||{});},margin:function(i,j){if(!i){return 0;
}var f=i.jquery!=undefined?i[0]:i;if(j=="marginRight"&&b.browser.safari){var g={display:"block","float":"none",width:"auto"},d,h;
b.swap(f,g,function(){d=f.offsetWidth;});g.marginRight=0;b.swap(f,g,function(){h=f.offsetWidth;
});return h-d;}return c.intval(b.css(f,j));},intval:function(d){d=parseInt(d);return isNaN(d)?0:d;
}});})(jQuery);
(function(c){var e=window,d=document,a="",b="object";c.flashPlayerVersion=(function(){var h,f=null,m=false,l="ShockwaveFlash.ShockwaveFlash";
if(!(h=navigator.plugins["Shockwave Flash"])){try{f=new ActiveXObject(l+".7");}catch(k){try{f=new ActiveXObject(l+".6");
h=[6,0,21];f.AllowScriptAccess="always";}catch(j){if(h&&h[0]===6){m=true;}}if(!m){try{f=new ActiveXObject(l);
}catch(i){h="X 0,0,0";}}}if(!m&&f){try{h=f.GetVariable("$version");}catch(g){}}}else{h=h.description;
}h=h.match(/^[A-Za-z\s]*?(\d+)(\.|,)(\d+)(\s+r|,)(\d+)/);return[h[1]*1,h[3]*1,h[5]*1];
}());c.flashExpressInstaller="expressInstall.swf";c.hasFlashPlayer=(c.flashPlayerVersion[0]!==0);
c.hasFlashPlayerVersion=function(f){var g=c.flashPlayerVersion;f=(/string|integer/.test(typeof f))?f.toString().split("."):f;
f=[f.major||f[0]||g[0],f.minor||f[1]||g[1],f.release||f[2]||g[2]];return(c.hasFlashPlayer&&(f[0]>g[0]||(f[0]===g[0]&&(f[1]>g[1]||(f[1]===g[1]&&f[2]>=g[2])))));
};c.flash=function(h){if(!c.hasFlashPlayer){return false;}var g=h.swf||a,p=h.params||{},j=d.createElement("body"),f,q,m,i,o,n,l,k;
h.height=h.height||180;h.width=h.width||320;if(h.hasVersion&&!c.hasFlashPlayerVersion(h.hasVersion)){c.extend(h,{id:"/Templates/swfObjectExprInst",height:Math.max(h.height,137),width:Math.max(h.width,214)});
g=h.expressInstaller||c.flashExpressInstaller;p={flashvars:{MMredirectURL:e.location.href,MMplayerType:(c.browser.msie&&c.browser.win)?"ActiveX":"PlugIn",MMdoctitle:d.title.slice(0,47)+" - Flash Player Installation"}};
}if(typeof p===b){if(h.flashvars){p.flashvars=h.flashvars;}if(h.wmode){p.wmode=h.wmode;
}}for(o in (n=["/Templates/swf","expressInstall","hasVersion","params","flashvars","wmode"])){delete h[n[o]];
}f=[];for(o in h){if(typeof h[o]===b){q=[];for(n in h[o]){q.push(n.replace(/([A-Z])/,"-$1").toLowerCase()+":"+h[o][n]+";");
}h[o]=q.join(a);}f.push(o+'="'+h[o]+'"');}h=f.join(" ");if(typeof p===b){f=[];for(o in p){if(typeof p[o]===b){q=[];
for(n in p[o]){if(typeof p[o][n]===b){m=[];for(l in p[o][n]){if(typeof p[o][n][l]===b){i=[];
for(k in p[o][n][l]){i.push([k.replace(/([A-Z])/,"-$1").toLowerCase(),":",p[o][n][l][k],";"].join(a));
}p[o][n][l]=i.join(a);}m.push([l,"{",p[o][n][l],"}"].join(a));}p[o][n]=m.join(a);
}q.push([n,"=",e.escape(e.escape(p[o][n]))].join(a));}p[o]=q.join("&amp;");}f.push(['<PARAM NAME="',o,'" VALUE="',p[o],'">'].join(a));
}p=f.join(a);}if(!(/style=/.test(h))){h+=' style="vertical-align:text-top;"';}if(!(/style=(.*?)vertical-align/.test(h))){h=h.replace(/style="/,'style="vertical-align:text-top;');
}if(c.browser.msie){h+=' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';p='<PARAM NAME="movie" VALUE="'+g+'">'+p;
}else{h+=' type="application/x-shockwave-flash" data="'+g+'"';}j.innerHTML=["<OBJECT ",h,">",p,"</OBJECT>"].join(a);
return c(j.firstChild);};c.fn.flash=function(f){if(!c.hasFlashPlayer){return this;
}var h=0,g;while((g=this.eq(h++))[0]){g.html(c.flash(c.extend({},f)));if(document.getElementById("/Templates/swfObjectExprInst")){h=this.length;
}}return this;};}(jQuery));(function(l){var s=true,a=false,o="",e="height",h="width",w="offsetHeight",g="offsetWidth",j="color",z="cursor",d="font",u="fontSize",q="fontWeight",v="lineHeight",m="textAlign",c="textTransform",t="childNodes",n="parentNode",y="children",i="content",b="sIFR-replaced",r=function(A){return parseInt(A,10);
},p=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"],x={aqua:"0FF",azure:"F0FFFF",beige:"F5F5DC",black:"000",blue:"00F",brown:"A52A2A",cyan:"0FF",darkblue:"00008B",darkcyan:"008B8B",darkgrey:"A9A9A9",darkgreen:"006400",darkkhaki:"BDB76B",darkmagenta:"8B008B",darkolivegreen:"556B2F",darkorange:"FF8C00",darkorchid:"9932CC",darkred:"8B0000",darksalmon:"E9967A",darkviolet:"9400D3",fuchsia:"F0F",gold:"FFD700",green:"008000",indigo:"4B0082",khaki:"F0E68C",lightblue:"ADD8E6",lightcyan:"E0FFFF",lightgreen:"90EE90",lightgrey:"D3D3D3",lightpink:"FFB6C1",lightyellow:"FFFFE0",lime:"0F0",magenta:"F0F",maroon:"800000",navy:"000080",olive:"808000",orange:"FFA500",pink:"FFC0CB",purple:"800080",violet:"800080",red:"F00",silver:"C0C0C0",white:"FFF",yellow:"FF0",transparent:"FFF"},f=function(A){return isNaN(A)?"00":p[(A-A%16)/16]+p[A%16];
},k=function(A){var B;return"#"+((A)?(B=x[A.toLowerCase()])?B:(B=A.match(/rgb\((\d+),\s(\d+),\s(\d+)\)/))?f(B[1])+f(B[2])+f(B[3]):A:"000").replace(/^#{0,}(\w)(\w)(\w)$|^#/,"$1$1$2$2$3$3").toUpperCase();
};l.sifrNodeList=l(document).not(document);l.sifr=function(F){var E,D,C,G=arguments.callee,A,B;
F=l.extend({},G.options,F);if(F.save){delete F.save;G.options=l.extend({},F);}F[d]=(F.path||o).replace(/([^\/])$/,"$1/")+(F[d]||o).replace(/\.swf$|$/,".swf");
switch(F[c]){case"lowercase":F[i]=F[i].toLowerCase();break;case"uppercase":F[i]=F[i].toUpperCase();
break;case"capitalize":E=F[i].split(/(\s|\>)/);F[i]=o;for(A in E){F[i]+=E[A].charAt(0).toUpperCase()+E[A].substr(1);
}}if(r(F.version)===3){B={content:F[i],cursor:F[z],css:l.extend({".sIFR-root":l.extend({color:k(F[j]),fontWeight:F[q]||"normal",lineHeight:F[v]||12,textAlign:F[m]||"left"},F.style),a:{},"a:hover":{}},F.css),delayrun:F.delayRun||a,events:F.events||a,fitexactly:F.fitExactly||a,fixhover:F.fixHover||s,forcesingleline:F.forceSingleLine||a,gridfittype:F.gridFitType||"pixel",height:(F[e]*F.overY)||14,offsetleft:F.offsetLeft||0,offsettop:F.offsetTop||0,opacity:F.opacity||100,preventwrap:F.preventWrap||a,size:F[u]||12,tuneheight:F.tuneHeight||0,tunewidth:F.tuneWidth||0,version:F.build||436,width:(F[h]*F.overX)||320};
B.css.a[j]=B.css.a[j]||k(F.linkColor||F[j]);B.css["a:hover"][j]=B.css["a:hover"][j]||k(F.hoverColor||B.css.a[j]||F[j]);
B.selectable=F.selectable||((/arrow|pointer/.test(B[z]))?a:s);if(typeof F.filter==="object"){D=[];
for(E in F.filter){if(typeof F.filter[E]==="object"){C=[];for(A in F.filter[E]){C.push(A.replace(/([A-Z])/,"-$1").toLowerCase()+":"+((/color/.test(A))?'"0x'+k(F.filter[E][A]).substr(1)+'"':F.filter[E][A]));
}F.filter[E]=C.join(",");}D.push(E+"Filter,"+F.filter[E]);}B.flashfilters=D.join(",");
}}else{B={h:(F[e]*F.zoom)||14,leading:Math.max(F[v]-F[u],0),offsetTop:Math.max((F[v]-F[u])/2,0),textAlign:F[m]||"left",textColor:k(F[j]),txt:F[i],w:(F[h]*F.zoom)||320};
B.linkColor=k(F.linkColor||F[j]);B.hoverColor=k(F.hoverColor||B.linkColor||F[j]);
if(F.underline===s){B.underline=s;}}if(F.link){B.link=F.link;}return l.flash({flashvars:B,height:(F[e]*F.overY)||14,params:{wmode:"transparent"},swf:F[d],width:(F[h]*F.overX)||320});
};l.fn.sifr=function(D){if(!l.hasFlashPlayer){return a;}var H,C,F,G=this,E=0,A,B;
D=l.extend({},D);while((C=G.eq(E++))[0]){B=l.extend({},(A=l.extend({},C.data("options"),D)));
if(C.hasClass(b)){C.unsifr();}C.addClass(b)[0].innerHTML=['<span style="display:inline-block;position:relative;"><span class="sIFR-alternate" ',((B.debug)?"":'style="'+((l.browser.msie)?"zoom:1;filter:alpha(opacity=0)":"opacity:0")+';"'),">",C[0].innerHTML,'</span><span class="sIFR-flash" style="position:absolute;top:0;left:0;right:0;bottom:0;"></span></span>'].join(o);
H=C[y]()[y]().eq(0);F=C[y]()[y]().eq(1);B[i]=B[i]||l.trim(H[0].innerHTML);B[c]=B[c]||H.css(c).toLowerCase();
B.zoom=B.zoom||1;B.overX=(B.overX||1)*(B.over||1);B.overY=(B.overY||1)*(B.over||1);
B[e]=B[e]||Math.max(H[0][w]||H[0][n][w],r(H.css(v).replace(/normal/,r(H.css(u))*1.25)));
B[h]=B[h]||H[0][g]||H[0][n][g];B[d]=B[d]||C.css("fontFamily").replace(/^\s+|\s+$|,[\S|\s]+|'|"|(,)\s+/g,"$1");
B[j]=B[j]||H.css(j);B[z]=B[z]||H.css(z);B[q]=(B[q]||H.css(q).toString()).replace("400","normal").replace("700","bold");
B[u]=(B[u]||r(H.css(u)))*B.zoom;B[v]=r(B[v]||H.css(v).replace(/normal/,B[u]*1.25))||B[e];
B[m]=B[m]||H.css(m).toString();if(B[m]==="center"){F.css("marginLeft",(B[h]-(B[h]*B.overX))/2);
}if(B.resizable){l.sifrNodeList=l.sifrNodeList.add(C.data("options",l.extend({offsetHeight:H[0][w],offsetWidth:H[0][g]},A)));
}F.html(l.sifr(B));}return G;};l.fn.unsifr=function(){var C=this,A,B=0;while(((A=C.eq(B++))[0])&&A.hasClass(b)){A.removeClass(b)[0].innerHTML=A[0][t][0][t][0].innerHTML;
l.sifrNodeList=l.sifrNodeList.not(A);}return C;};l(window).resize(function(){l.sifrNodeList.filter(function(C){var B,D=this[t][0][t][0],A=(B=l(this)).data("options");
if(D[w]!==A[w]||D[g]!==A[g]){A[w]=D[w];A[g]=D[g];B.data("options",A);return s;}return a;
}).sifr();});}(jQuery));
(function(c){var e=window,d=document,a="",b="object";c.flashPlayerVersion=(function(){var h,f=null,m=false,l="ShockwaveFlash.ShockwaveFlash";
if(!(h=navigator.plugins["Shockwave Flash"])){try{f=new ActiveXObject(l+".7");}catch(k){try{f=new ActiveXObject(l+".6");
h=[6,0,21];f.AllowScriptAccess="always";}catch(j){if(h&&h[0]===6){m=true;}}if(!m){try{f=new ActiveXObject(l);
}catch(i){h="X 0,0,0";}}}if(!m&&f){try{h=f.GetVariable("$version");}catch(g){}}}else{h=h.description;
}h=h.match(/^[A-Za-z\s]*?(\d+)(\.|,)(\d+)(\s+r|,)(\d+)/);return[h[1]*1,h[3]*1,h[5]*1];
}());c.flashExpressInstaller="expressInstall.swf";c.hasFlashPlayer=(c.flashPlayerVersion[0]!==0);
c.hasFlashPlayerVersion=function(f){var g=c.flashPlayerVersion;f=(/string|integer/.test(typeof f))?f.toString().split("."):f;
f=[f.major||f[0]||g[0],f.minor||f[1]||g[1],f.release||f[2]||g[2]];return(c.hasFlashPlayer&&(f[0]>g[0]||(f[0]===g[0]&&(f[1]>g[1]||(f[1]===g[1]&&f[2]>=g[2])))));
};c.flash=function(h){if(!c.hasFlashPlayer){return false;}var g=h.swf||a,p=h.params||{},j=d.createElement("body"),f,q,m,i,o,n,l,k;
h.height=h.height||180;h.width=h.width||320;if(h.hasVersion&&!c.hasFlashPlayerVersion(h.hasVersion)){c.extend(h,{id:"/Templates/swfObjectExprInst",height:Math.max(h.height,137),width:Math.max(h.width,214)});
g=h.expressInstaller||c.flashExpressInstaller;p={flashvars:{MMredirectURL:e.location.href,MMplayerType:(c.browser.msie&&c.browser.win)?"ActiveX":"PlugIn",MMdoctitle:d.title.slice(0,47)+" - Flash Player Installation"}};
}if(typeof p===b){if(h.flashvars){p.flashvars=h.flashvars;}if(h.wmode){p.wmode=h.wmode;
}}for(o in (n=["/Templates/swf","expressInstall","hasVersion","params","flashvars","wmode"])){delete h[n[o]];
}f=[];for(o in h){if(typeof h[o]===b){q=[];for(n in h[o]){q.push(n.replace(/([A-Z])/,"-$1").toLowerCase()+":"+h[o][n]+";");
}h[o]=q.join(a);}f.push(o+'="'+h[o]+'"');}h=f.join(" ");if(typeof p===b){f=[];for(o in p){if(typeof p[o]===b){q=[];
for(n in p[o]){if(typeof p[o][n]===b){m=[];for(l in p[o][n]){if(typeof p[o][n][l]===b){i=[];
for(k in p[o][n][l]){i.push([k.replace(/([A-Z])/,"-$1").toLowerCase(),":",p[o][n][l][k],";"].join(a));
}p[o][n][l]=i.join(a);}m.push([l,"{",p[o][n][l],"}"].join(a));}p[o][n]=m.join(a);
}q.push([n,"=",e.escape(e.escape(p[o][n]))].join(a));}p[o]=q.join("&amp;");}f.push(['<PARAM NAME="',o,'" VALUE="',p[o],'">'].join(a));
}p=f.join(a);}if(!(/style=/.test(h))){h+=' style="vertical-align:text-top;"';}if(!(/style=(.*?)vertical-align/.test(h))){h=h.replace(/style="/,'style="vertical-align:text-top;');
}if(c.browser.msie){h+=' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';p='<PARAM NAME="movie" VALUE="'+g+'">'+p;
}else{h+=' type="application/x-shockwave-flash" data="'+g+'"';}j.innerHTML=["<OBJECT ",h,">",p,"</OBJECT>"].join(a);
return c(j.firstChild);};c.fn.flash=function(f){if(!c.hasFlashPlayer){return this;
}var h=0,g;while((g=this.eq(h++))[0]){g.html(c.flash(c.extend({},f)));if(document.getElementById("/Templates/swfObjectExprInst")){h=this.length;
}}return this;};}(jQuery));
$(document).ready(function(){$("#show-holder").hide();$("#toggle-site").click(function(a){a.preventDefault();
$("#show-holder").toggle(0);if($("#show-holder").css("display")=="block"){$("#show-holder").css({position:"absolute",top:"498px"}).css("z-index","10000");
$(this).css("background-position","0px -94px");$("select").each(function(){$(this).hide();
});}else{$(this).css("background-position","0px 0px");$("select").each(function(){$(this).show();
});}});$("#toggle-site").mouseover(function(){if($("#show-holder").css("display")!="block"){$(this).css("background-position","0px -47px");
}});$("#toggle-site").mouseout(function(){if($("#show-holder").css("display")!="block"){$(this).css("background-position","0px 0px");
}});});
var GBW={EDITORTYPE:"tiny",REST_Services:{searchsuggestions:"/REST.ful/search/suggestions"},BBCodeEditor:{TinyPastePreprocess:function(c,b){var a=b.content;
a=a.replace(/<H[1-9]>/ig,"<b>");a=a.replace(/<\/H[1-9]>/ig,"</b>");a=a.replace(/\n/ig,"");
a=a.replace(/\r/ig,"");b.content=a;},UpdatePanelFix:function(a){},Validate:function(a){tinyMCE.triggerSave();
var b=$("#"+a).val();b=$.trim(b).split("&nbsp;").join("");return b!=""?true:false;
}},GetQueryParam:function(a){a=a.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var b="[\\?&]"+a+"=([^&#]*)";
var c=new RegExp(b);var d=c.exec(window.location.href);if(d==null){return"";}else{return d[1];
}}};$(document).ready(function(){$(".searchInput").autocomplete({serviceUrl:GBW.REST_Services.searchsuggestions,width:106,minChars:2,params:{numitems:8,method:"POST"}});
$(".searchPageInput").autocomplete({serviceUrl:GBW.REST_Services.searchsuggestions,minChars:2,params:{numitems:8,method:"POST"}});
});if(window.attachEvent){window.attachEvent("onbeforeunload",function(){window.__flash__removeCallback=function(b,a){if(b){b[a]=null;
}};});}
$(document).ready(function(){$("html").addClass("JS");function a(h){tallest=0;h.each(function(){thisHeight=$(this).height();
if(thisHeight>tallest){tallest=thisHeight;}});if($.browser.msie&&$.browser.version<7){h.height(tallest);
}else{h.css("min-height",tallest);}}a($(".eH1"));a($(".eH2"));a($(".eH3"));a($(".eH4"));
$(".box h2 span").sifr({font:"/Templates/swf/sifr-karlson.swf",version:3,build:"340",width:"207",fontSize:"13",lineHeight:"13"});
$("#yourClub h2 span").sifr({font:"/Templates/swf/sifr-karlson.swf",version:3,build:"340",width:"167",fontSize:"13",lineHeight:"13"});
$(".box.w025 h2.wrap span").sifr({font:"/Templates/swf/sifr-karlson.swf",version:3,build:"340",width:"146",fontSize:"13",lineHeight:"13"});
$(".box .stageRelated p.yourStageResults").sifr({font:"/Templates/swf/sifr-karlson.swf",version:3,build:"340",width:"626",fontSize:"13",lineHeight:"13"});
$(".trying-box h2 span, .pregnant-box h2 span, .toddler-box h2 span, .baby-box h2 span").sifr({font:"/Templates/swf/sifr-karlson.swf",version:3,build:"340",width:"440",fontSize:"15",lineHeight:"15"});
$("span.written span").sifr({font:"/Templates/swf/sifr-karlson.swf",version:3,build:"340",width:"100",fontSize:"13",lineHeight:"13"});
function g(h){$(".nav-carousel li.item:first-child").addClass("active");h.container.prev().find("li.item a").bind("click",function(){var j=jQuery.jcarousel.intval(jQuery(this).text());
if($(this).parents(".nav-browse").next().find(".carousel3").length){j=((j-1)*3)+1;
var i=(jQuery.jcarousel.intval($(this).parent().siblings(".active").text())-1)*3;
if(j>h.size()+1){j=h.size+1;}else{if(j<0){j=0;}}}h.scroll(j);$(this).parent().addClass("active");
$(this).parent().siblings(".active").removeClass("active");return false;});h.container.prev().find("li.next a").bind("click",function(){h.next();
if($(this).parent().parent().find("li.item:last").hasClass("active")){$(this).parent().parent().find("li.item.active").removeClass("active");
$(this).parent().parent().find("li.item:first").addClass("active");}else{$(this).parent().parent().find("li.item.active").removeClass("active").next("li.item").addClass("active");
}return false;});h.container.prev().find("li.previous a").bind("click",function(){h.prev();
if($(this).parent().parent().find("li.item:first").hasClass("active")){$(this).parent().parent().find("li.item.active").removeClass("active");
$(this).parent().parent().find("li.item:last").addClass("active");}else{$(this).parent().parent().find("li.item.active").removeClass("active").prev("li.item").addClass("active");
}return false;});}$(".carousel1").jcarousel({scroll:1,wrap:"both",initCallback:g,buttonNextHTML:null,buttonPrevHTML:null});
$(".carousel3").jcarousel({scroll:3,wrap:"both",initCallback:g,buttonNextHTML:null,buttonPrevHTML:null});
$(".nav-browser").append('<div id="product_controls"><div class="inner"><a class="previous" href="#">Previous</a><ul class="indicators"></ul><a class="next" href="#">Next</a></div></div>');
for(var e=1;e<=$("#product_carousel li").length;e++){if((e%3)==1){$("#product_controls ul.indicators").append('<li class="item"><a href="#">'+e+"</a></li>");
}}var b=$("#product_controls ul.indicators li").length*15;if(b+70<115){b=115-70;}$("#product_controls ul.indicators").css("width",b+"px");
$("#product_controls").css("width",(b+70)+"px");$("#product_carousel").jcarousel({scroll:3,wrap:"both",initCallback:c,buttonNextHTML:null,buttonPrevHTML:null});
function c(h){$("#product_controls ul li.item:first").addClass("active");h.container.next().find("li.item a").bind("click",function(){h.scroll(jQuery.jcarousel.intval(jQuery(this).text()));
$(this).parent().addClass("active");$(this).parent().siblings(".active").removeClass("active");
return false;});h.container.next().find("a.next").bind("click",function(){h.next();
if($(this).parent().parent().find("li.item:last").hasClass("active")){$(this).parent().parent().find("li.item.active").removeClass("active");
$(this).parent().parent().find("li.item:first").addClass("active");}else{$(this).parent().parent().find("li.item.active").removeClass("active").next("li.item").addClass("active");
}return false;});h.container.next().find("a.previous").bind("click",function(){h.prev();
if($(this).parent().parent().find("li.item:first").hasClass("active")){$(this).parent().parent().find("li.item.active").removeClass("active");
$(this).parent().parent().find("li.item:last").addClass("active");}else{$(this).parent().parent().find("li.item.active").removeClass("active").prev("li.item").addClass("active");
}return false;});}$("#footerBaby").html("<img src='/Templates/Styles/GBWImages/footer_baby.gif'>");
$("#header").next("#flash").prev("#header").addClass("overFlash").append("<div class='gfx-l'></div><div class='gfx-c'></div><div class='gfx-r'></div>");
$("table tr th:first-child span").prepend("<div class='gfx-tL'></div><div class='gfx-bL'></div>");
$("table tr th:last-child span").prepend("<div class='gfx-tR'></div><div class='gfx-bR'></div>");
$("dl.results dd .bar").prepend("<div class='gfx-l'></div><div class='gfx-r'></div>");
if($.browser.msie&&$.browser.version<=7){$(".box .image, .box > .box, ul.comments > li, ul.replies > li, ul.messages > li, #profile .box, .post .box, .poll .box, .side .box, .content .box").prepend("<div class='gfx-tL'></div><div class='gfx-tR'></div><div class='gfx-bL'></div><div class='gfx-bR'></div>");
}else{$(".box .image, .box .box").prepend("<div class='gfx-tL'></div><div class='gfx-tR'></div><div class='gfx-bL'></div><div class='gfx-bR'></div>");
}var f=9900;$(".box .nav-box li").each(function(){$(this).css("zIndex",f);f-=10;});
$("div.profile div.details .gfx-b").remove();$("#content > .box > .gfx-b, #side > .box > .gfx-b").remove();
$("#content > .box, #side > .box, div.profile div.details, .round-corner-inner-box").wrapInner("<div class='container'></div>").append("<div class='gfx-b'></div>");
$(".box .box:last-child, .box p:last-child, .box ul:last-child, .box ol:last-child, .box dl:last-child, .box .box dl dd:last-child").addClass("nM");
$("#side .box .box:last-child, #side .box p:last-child, #side .box ul:last-child, #side .box ol:last-child, #side .box dl:last-child, #side .box .box dl dd:last-child").css("position","relative").css("z-index","999");
$("div.profile div.details .avatar").prepend("<div class='gfx-x'></div>");$("div.profile div.details .avatar").prepend("<div class='gfx-f'></div>");
$("div.profile div.details .avatar").click(function(){$(this).parent().parent().parent().addClass("visible");
$(this).before("<div class='gfx'></div>");$(this).parents(".jcarousel-container").addClass("profileShown");
if($.browser.msie&&$.browser.version<7){$(this).parent().parent().bgiframe();$(this).parent().parent().find(".gfx-b").bgiframe();
}$(this).parent().parent().hover(function(){},function(){$(this).parent().removeClass("visible");
$(this).parent().find(".gfx").remove();$(this).parents(".jcarousel-container").removeClass("profileShown");
});return false;});var d=$("#search input, input.cV, textarea.cV").each(function(){var h=$(this).attr("value");
$(this).bind("focus",{defaultValue:h},function(i){if($(this).attr("value")==i.data.defaultValue){$(this).attr("value","");
}});$(this).bind("blur",{defaultValue:h},function(i){if($(this).attr("value")==""){$(this).attr("value",i.data.defaultValue);
}});});$("table").prev(".nav-list").addClass("beforeTable");$("table").next(".nav-list").addClass("afterTable");
$("table.pointsHistory").prev(".nav-list").css("border","0").css("padding-top","0");
$("table.pointsHistory").next(".nav-list").css("border","0").css("padding-bottom","0");
$("ul.comments").prev(".nav-list").addClass("beforeComments");$("ul.comments").next(".nav-list").addClass("afterComments");
$("ul.replies").prev(".nav-list").addClass("beforeReplies");$("ul.replies").next(".nav-list").addClass("afterReplies");
$("ul.members").prev(".nav-list").addClass("beforeMembers");$("ul.members").find("> li:nth-child(1n+4)").css("padding","10px 0 0");
$(".jcarousel-container ul.members").find("> li:nth-child(1n+4)").css("padding","0");
$("ul.members").find("> li:nth-child(3n+4)").css("position","relative").prepend("<div class='gfx-s'></div>");
$("ul.members").next(".nav-list").addClass("afterMembers");$(".box.w075 ul.topics > li").css("margin-right","30px");
$(".box.w075 ul.topics > li:nth-child(3n)").css("margin-right","0");$(".box.w075 .jcarousel-container ul.topics > li").css("margin-right","30px");
$(".box.w075 ul.products > li").css("margin-right","30px");$(".box.w075 ul.products > li:nth-child(3n)").css("margin-right","0");
$(".box.w075 .jcarousel-container ul.products > li:nth-child(3n)").css("margin-right","30px");
$(".box.w075 .box ul.products > li").css("margin-right","20px");$(".box.w075 .box ul.products > li:nth-child(3n)").css("margin-right","0");
$(".box.w075 ul.steps > li").css("margin-right","30px");$(".box.w075 ul.steps > li:nth-child(3n)").css("margin-right","0");
$(".box.w075 ul.members > li").css("margin-right","30px");$(".box.w075 ul.members > li:nth-child(3n)").css("margin-right","0");
$(".box.w075 .jcarousel-container ul.members > li").css("margin-right","30px");$(".box.w075 ul.polls > li").css("margin-right","30px");
$(".box.w075 ul.polls > li:nth-child(3n)").css("margin-right","0");$(".box.w075 ul.polls > li:nth-child(3n+1)").css("position","relative").prepend("<div class='gfx-s'></div>").addClass("cB");
$(".box.w075 ul.avatars > li").css("margin-right","13px");$(".box.w075 ul.avatars > li:nth-child(3n+3)").css("margin-right","14px");
$(".box.w075 ul.avatars > li:nth-child(10n)").css("margin-right","0");if($.browser.safari&&parseFloat($.browser.version)<=419.3){$("#content > .box > .container, #side > .box > .container").wrapInner("<div></div>");
$(".box").css("position","relative");$("a.more").hover(function(){$(this).css("background","url(/Templates/Styles/GBWImages/icon-more_safari2.png) -18px 2px no-repeat");
},function(){$(this).css("background","url(/Templates/Styles/GBWImages/icon-more.png) -18px 2px no-repeat");
});$("#nav-sub li").addClass("child");$("#nav-sub li:first-child").addClass("first-child");
$("#nav-sub li:last-child").addClass("last-child");}if($.browser.opera&&parseFloat($.browser.version)<=9.6){$("#nav-status li a").css("opacity",1);
$("#main h1").css("color","#522d80");}if($.browser.mozilla&&parseFloat($.browser.version)<=1.8){$("a.action").css("padding-left","24px");
$("a.action.add").css("padding-left","28px");}$("a.video-overlay").click(showVideoOverlay);
});function sectonChange(){thisMovie("home_phase2").updateSection("baby",null);}function userDataChange(){thisMovie("home_phase2").updateUserData();
}function initNewPost(){thisMovie("home_phase2").initNewPost();}function newPostCancel(){thisMovie("home_phase2").newPostCancel();
}function newPostComplete(){thisMovie("home_phase2").newPostComplete();}function thisMovie(a){return document.getElementById(a);
}function hideExploreSite(){$("#show-holder").css({display:"none"});}function showExploreSite(){$("#show-holder").css({display:"block"}).css("z-index","10000");
}var signupURL="";$(document).ready(function(){signupURL=$("#signUp a").attr("href");
});function signupClicked(){document.location.href=signupURL;}$(document).ready(function(){$("#nav-sub").parent().parent().find("#show-holder").addClass("menu");
});function showVideoOverlay(){$.ajax({url:"/General/Video-overlay",cache:false,success:function(a){showModal(a);
}});return false;}function showModal(a){$("body").prepend('<div id="modal-overlay"></div><div id="modal-overlay-content">'+a+"</div>");
var b=$("#modal-overlay-content").height()/2;$("#modal-overlay-content").css("top",$(window).scrollTop()+($(window).height()/2-b)+"px");
$("#modal-overlay-close").click(hideModal);}function hideModal(){$("#modal-overlay, #modal-overlay-content").remove();
return false;}$(document).ready(function(){function a(b,c){$(".box h2 span").sifr({font:"/Templates/swf/sifr-karlson.swf",version:3,build:"340",width:"207",fontSize:"13",lineHeight:"13"});
}Sys.WebForms.PageRequestManager.getInstance().add_endRequest(a);});
$(function(){if($("#container").find("object").length>0){$("#tabs-trying, #date-selector, #calculate-due-date, #add-your-due-date").hide();
}});$(function(){var b={signup_dict:"Вход",font_size:"10",y_offset:"-4"};var a={wmode:"opaque"};
var c={};swfobject.embedSWF("/Templates/swf/sign_up/sign_up_libero_karlson.swf","signUp","233","116","9.0.0",false,b,a,c);
swfobject.createCSS("#signUp","outline:none");});$(function(){var b={};var a={wmode:"transparent"};
var c={};swfobject.embedSWF("/Templates/swf/footer/footer.swf","footerBaby","98","117","9.0.0",false,b,a,c);
swfobject.createCSS("#footerBaby","outline:none");});$(function(){var b={open_dict:"Изучить сайт&close_dict=Скрыть",font_size:"20"};
var a={wmode:"transparent"};var c={};swfobject.embedSWF("/Templates/swf/explore_site/explore_site_libero_karlson.swf","exploreSite","380","70","9.0.0",false,b,a,c);
swfobject.createCSS("#exploreSite","outline:none");});
jQuery.iPikaChoose={build:function(a){var b={show_captions:true,slide_enabled:false,auto_play:false,show_prev_next:true,slide_speed:5000,thumb_width:56,thumb_height:56,buttons_text:{play:"",stop:"",previous:"Previous",next:"Next"},delay_caption:false,user_thumbs:true,mouse_hover_navigation:false,image_index_text:{of:"of",images:"images"}};
return jQuery(this).each(function(){function x(){jQuery(this).bind("load",function(){jQuery(this).prev("img").remove();
t=jQuery(this).parents("ul").find(".image > img");var L=jQuery(this).width();var M=jQuery(this).height();
if(L===0){L=jQuery(this).attr("width");}if(M===0){M=jQuery(this).attr("height");}var J=e.thumb_width/L;
var D=e.thumb_height/M;var K;if(J<D){K=D;var G=((L*K-e.thumb_width)/2)*-1;G=Math.round(G);
jQuery(this).css({left:G});}else{K=J;var F=0;jQuery(this).css({top:F});}var E=Math.round(L*K);
var H=Math.round(M*K);jQuery(this).css("position","relative");jQuery(this).width(E).height(H);
var I={width:E,height:H};jQuery(this).css(I);if(jQuery(this).hasClass("pika_first")){jQuery(this).trigger("click",["auto"]);
}});var C=jQuery(this).clone(true).insertAfter(this);jQuery(this).hide();t=l.children("li").find(".image > img");
}var e=jQuery.extend(b,a);var t=jQuery(this).children("li").find(".image > img");
var c=t.length;t.fadeOut(1);var l=jQuery(this);t.each(x);jQuery(this).before("<div class='pika_main'></div>");
var f=jQuery(this).prev(".pika_main");if(e.slide_enabled){f.append("<div class='pika_play'></div>");
var m=jQuery(this).prev(".pika_main").children(".pika_play");m.html("<a class='pika_play_button'>"+e.buttons_text.play+"</a><a class='pika_stop_button'>"+e.buttons_text.stop+"</a>");
m.fadeOut(1);var g=m.children("a:first");var y=m.children("a:last");}f.append("<div class='pika_subdiv'></div>");
var n=f.children(".pika_subdiv");n.append("<div class='pika_back_img image'><img /></div><div class='pika_main_img image'><img /></div>");
var q=n.find(".pika_main_img > img");var p=n.find(".pika_back_img > img");n.append("<div class='pika_prev_hover'></div><div class='pika_next_hover'></div>");
var j=n.find(".pika_prev_hover");var d=n.find(".pika_next_hover");j.hide();d.hide();
if(e.show_captions){f.before("<div class='pika_caption'></div>");var o=f.parent().children(".pika_caption");
}jQuery(this).before("<div class='pika_navigation nav-browse'></div>");var z=jQuery(this).prev(".pika_navigation");
z.prepend("<span class='image-index'></span><ul class='nav-carousel nM'><li class='previous'><a>"+e.buttons_text.previous+"</a></li><li class='next'><a>"+e.buttons_text.next+"</a></li></ul>");
var i=z.children(".image-index");var u=z.find(".previous");var s=z.find(".next");
if(!e.show_prev_next||c<=1){z.css("display","none");}if(c<=1){jQuery(this).hide();
}var B=e.auto_play;q.wrap("<a></a>");var k=q.parent("a");function w(){t.bind("click",r);
if(e.slide_enabled){if(e.auto_play){B=true;g.hide();y.show();}else{g.show();y.hide();
}}l.children("li:last").find(".image > img").addClass("pika_last");l.children("li:first").find(".image > img").addClass("pika_first");
l.children("li").each(function(){jQuery(this).children("span").hide();});var C={width:e.thumb_width+"px",height:e.thumb_height+"px","list-style":"none",overflow:"hidden"};
var D={"list-style":"none",overflow:"hidden"};t.each(function(){jQuery(this).parent("li").css(D);
if(jQuery(this).attr("complete")===true&&jQuery(this).css("display")=="none"){jQuery(this).css({display:"inline"});
}});u.bind("click",A);j.bind("click",A);s.bind("click",v);d.bind("click",v);if(e.mouse_hover_navigation){n.mousemove(function(G){var F=n.width();
var E=G.pageX-n.offset().left;if(E<F*0.3){j.fadeIn("fast");}else{j.fadeOut("fast");
}if(E>F*0.7){d.fadeIn("fast");}else{d.fadeOut("fast");}});}if(e.mouse_hover_navigation){n.mouseleave(function(){j.fadeOut("fast");
d.fadeOut("fast");});}}function r(F,E){if(E!="auto"){if(e.slide_enabled){y.hide();
g.show();B=false;}q.stop();q.dequeue();if(e.show_captions){o.stop();o.dequeue();}}if(e.user_thumbs){var D=jQuery(this).parent().children(".image-ref").html();
}else{var D=this.src;}var G=jQuery(this).attr("rel");var I=jQuery(this).parent().next("span").html();
t.filter(".pika_selected").removeClass("pika_selected");l.find("li.active").removeClass("active");
jQuery(this).addClass("pika_selected");jQuery(this).parent().parent("li").addClass("active");
if(e.show_captions){if(e.delay_caption){o.fadeTo(500,0);}o.fadeTo(500,0,function(){o.html(I);
o.fadeTo(500,1);});}var H=l.find(".image > img").index(jQuery(this))+1;i.html(H+" "+e.image_index_text.of+" "+c+" "+e.image_index_text.images);
var C=100;if(q.attr("opacity")<0.8){C=500;}p.attr("src",q.attr("src"));q.fadeTo(C,0,function(){q.unbind("load");
q.bind("load",function(){q.fadeTo(800,1,function(){if(B){jQuery(this).animate({opactiy:1},e.slide_speed,function(){if(B){s.trigger("click",["auto"]);
}});}p.attr("src",q.attr("src"));});});q.attr("src",D);k.attr("href",G);});}function v(D,C){if(t.filter(".pika_selected").hasClass("pika_last")){t.filter(":first").trigger("click",C);
}else{t.filter(".pika_selected").parents("li").next("li").find(".image > img").trigger("click",C);
}}function A(D,C){if(t.filter(".pika_selected").hasClass("pika_first")){t.filter(":last").trigger("click",C);
}else{t.filter(".pika_selected").parents("li").prev("li").find(".image > img").trigger("click",C);
}}function h(){f.hover(function(){m.fadeIn(400);},function(){m.fadeOut(400);});g.bind("click",function(){q.stop();
q.dequeue();if(e.show_captions){o.stop();o.dequeue();}B=true;s.trigger("click",["auto"]);
jQuery(this).hide();y.show();});y.bind("click",function(){B=false;jQuery(this).hide();
g.show();});}if(e.slide_enabled){h();}w();});}};jQuery.fn.PikaChoose=jQuery.iPikaChoose.build;

jQuery.ui||(function(c){var h=c.fn.remove,a=c.browser.mozilla&&(parseFloat(c.browser.version)<1.9);
c.ui={version:"1.7.2",plugin:{add:function(l,m,j){var k=c.ui[l].prototype;for(var n in j){k.plugins[n]=k.plugins[n]||[];
k.plugins[n].push([m,j[n]]);}},call:function(m,k,l){var j=m.plugins[k];if(!j||!m.element[0].parentNode){return;
}for(var n=0;n<j.length;n++){if(m.options[j[n][0]]){j[n][1].apply(m.element,l);}}}},contains:function(j,k){return document.compareDocumentPosition?j.compareDocumentPosition(k)&16:j!==k&&j.contains(k);
},hasScroll:function(j,k){if(c(j).css("overflow")=="hidden"){return false;}var l=(k&&k=="left")?"scrollLeft":"scrollTop",m=false;
if(j[l]>0){return true;}j[l]=1;m=(j[l]>0);j[l]=0;return m;},isOverAxis:function(k,l,j){return(k>l)&&(k<(l+j));
},isOver:function(k,j,l,o,m,n){return c.ui.isOverAxis(k,l,m)&&c.ui.isOverAxis(j,o,n);
},keyCode:{BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,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}};
if(a){var b=c.attr,d=c.fn.removeAttr,g="http://www.w3.org/2005/07/aaa",e=/^aria-/,i=/^wairole:/;
c.attr=function(l,k,m){var j=m!==undefined;return(k=="role"?(j?b.call(this,l,k,"wairole:"+m):(b.apply(this,arguments)||"").replace(i,"")):(e.test(k)?(j?l.setAttributeNS(g,k.replace(e,"aaa:"),m):b.call(this,l,k.replace(e,"aaa:"))):b.apply(this,arguments)));
};c.fn.removeAttr=function(j){return(e.test(j)?this.each(function(){this.removeAttributeNS(g,j.replace(e,""));
}):d.call(this,j));};}c.fn.extend({remove:function(){c("*",this).add(this).each(function(){c(this).triggerHandler("remove");
});return h.apply(this,arguments);},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","").unbind("selectstart.ui");
},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false;
});},scrollParent:function(){var j;if((c.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){j=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);}else{j=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"))||!j.length?c(document):j;}});
c.extend(c.expr[":"],{data:function(k,l,j){return !!c.data(k,j[3]);},focusable:function(l){var j=l.nodeName.toLowerCase(),k=c.attr(l,"tabindex");
return(/input|select|textarea|button|object/.test(j)?!l.disabled:"a"==j||"area"==j?l.href||!isNaN(k):!isNaN(k))&&!c(l)["area"==j?"parents":"closest"](":hidden").length;
},tabbable:function(k){var j=c.attr(k,"tabindex");return(isNaN(j)||j>=0)&&c(k).is(":focusable");
}});function f(j,n,k,l){function m(q){var p=c[j][n][q]||[];return(typeof p=="string"?p.split(/,?\s+/):p);
}var o=m("getter");if(l.length==1&&typeof l[0]=="string"){o=o.concat(m("getterSetter"));
}return(c.inArray(k,o)!=-1);}c.widget=function(k,l){var j=k.split(".")[0];k=k.split(".")[1];
c.fn[k]=function(p){var n=(typeof p=="string"),m=Array.prototype.slice.call(arguments,1);
if(n&&p.substring(0,1)=="_"){return this;}if(n&&f(j,k,p,m)){var o=c.data(this[0],k);
return(o?o[p].apply(o,m):undefined);}return this.each(function(){var q=c.data(this,k);
(!q&&!n&&c.data(this,k,new c[j][k](this,p))._init());(q&&n&&c.isFunction(q[p])&&q[p].apply(q,m));
});};c[j]=c[j]||{};c[j][k]=function(n,o){var m=this;this.namespace=j;this.widgetName=k;
this.widgetEventPrefix=c[j][k].eventPrefix||k;this.widgetBaseClass=j+"-"+k;this.options=c.extend({},c.widget.defaults,c[j][k].defaults,c.metadata&&c.metadata.get(n)[k],o);
this.element=c(n).bind("setData."+k,function(r,q,p){if(r.target==n){return m._setData(q,p);
}}).bind("getData."+k,function(q,p){if(q.target==n){return m._getData(p);}}).bind("remove",function(){return m.destroy();
});};c[j][k].prototype=c.extend({},c.widget.prototype,l);c[j][k].getterSetter="option";
};c.widget.prototype={_init:function(){},destroy:function(){this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").removeAttr("aria-disabled");
},option:function(k,j){var m=k,l=this;if(typeof k=="string"){if(j===undefined){return this._getData(k);
}m={};m[k]=j;}c.each(m,function(o,n){l._setData(o,n);});},_getData:function(j){return this.options[j];
},_setData:function(k,j){this.options[k]=j;if(k=="disabled"){this.element[j?"addClass":"removeClass"](this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").attr("aria-disabled",j);
}},enable:function(){this._setData("disabled",false);},disable:function(){this._setData("disabled",true);
},_trigger:function(l,p,m){var k=this.options[l],o=(l==this.widgetEventPrefix?l:this.widgetEventPrefix+l);
p=c.Event(p);p.type=o;if(p.originalEvent){for(var n=c.event.props.length,j;n;){j=c.event.props[--n];
p[j]=p.originalEvent[j];}}this.element.trigger(p,m);return !(c.isFunction(k)&&k.call(this.element[0],p,m)===false||p.isDefaultPrevented());
}};c.widget.defaults={disabled:false};c.ui.mouse={_mouseInit:function(){var j=this;
this.element.bind("mousedown."+this.widgetName,function(k){return j._mouseDown(k);
}).bind("click."+this.widgetName,function(k){if(j._preventClickEvent){j._preventClickEvent=false;
k.stopImmediatePropagation();return false;}});if(c.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");
this.element.attr("unselectable","on");}this.started=false;},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);
(c.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable));},_mouseDown:function(k){k.originalEvent=k.originalEvent||{};
if(k.originalEvent.mouseHandled){return;}(this._mouseStarted&&this._mouseUp(k));this._mouseDownEvent=k;
var l=this,j=(k.which==1),m=(typeof this.options.cancel=="string"?c(k.target).parents().add(k.target).filter(this.options.cancel).length:false);
if(!j||m||!this._mouseCapture(k)){return true;}this.mouseDelayMet=!this.options.delay;
if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){l.mouseDelayMet=true;
},this.options.delay);}if(this._mouseDistanceMet(k)&&this._mouseDelayMet(k)){this._mouseStarted=(this._mouseStart(k)!==false);
if(!this._mouseStarted){k.preventDefault();return true;}}this._mouseMoveDelegate=function(n){return l._mouseMove(n);
};this._mouseUpDelegate=function(n){return l._mouseUp(n);};c(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);
(c.browser.safari||k.preventDefault());k.originalEvent.mouseHandled=true;return true;
},_mouseMove:function(j){if(c.browser.msie&&!j.button){return this._mouseUp(j);}if(this._mouseStarted){this._mouseDrag(j);
return j.preventDefault();}if(this._mouseDistanceMet(j)&&this._mouseDelayMet(j)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,j)!==false);
(this._mouseStarted?this._mouseDrag(j):this._mouseUp(j));}return !this._mouseStarted;
},_mouseUp:function(j){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);
if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=(j.target==this._mouseDownEvent.target);
this._mouseStop(j);}return false;},_mouseDistanceMet:function(j){return(Math.max(Math.abs(this._mouseDownEvent.pageX-j.pageX),Math.abs(this._mouseDownEvent.pageY-j.pageY))>=this.options.distance);
},_mouseDelayMet:function(j){return this.mouseDelayMet;},_mouseStart:function(j){},_mouseDrag:function(j){},_mouseStop:function(j){},_mouseCapture:function(j){return true;
}};c.ui.mouse.defaults={cancel:null,distance:1,delay:0};})(jQuery);
(function($){$.extend($.ui,{datepicker:{version:"1.7.2"}});var PROP_NAME="datepicker";
function Datepicker(){this.debug=false;this._curInst=null;this._keyEvent=false;this._disabledInputs=[];
this._datepickerShowing=false;this._inDialog=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"],dateFormat:"mm/dd/yy",firstDay:0,isRTL:false};
this._defaults={showOn:"focus",showAnim:"show",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:false,hideIfNoPrevNext:false,navigationAsDateFormat:false,gotoCurrent:false,changeMonth:false,changeYear:false,showMonthAfterYear:false,yearRange:"-10:+10",showOtherMonths:false,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"normal",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:true,showButtonPanel:false};
$.extend(this._defaults,this.regional[""]);this.dpDiv=$('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all ui-helper-hidden-accessible"></div>');
}$.extend(Datepicker.prototype,{markerClassName:"hasDatepicker",log:function(){if(this.debug){console.log.apply("",arguments);
}},setDefaults:function(settings){extendRemove(this._defaults,settings||{});return this;
},_attachDatepicker:function(target,settings){var inlineSettings=null;for(var attrName in this._defaults){var attrValue=target.getAttribute("date:"+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){target.id="dp"+(++this.uuid);
}var inst=this._newInst($(target),inline);inst.settings=$.extend({},settings||{},inlineSettings||{});
if(nodeName=="input"){this._connectDatepicker(target,inst);}else{if(inline){this._inlineDatepicker(target,inst);
}}},_newInst:function(target,inline){var id=target[0].id.replace(/([:\[\]\.])/g,"\\\\$1");
return{id:id,input:target,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:inline,dpDiv:(!inline?this.dpDiv:$('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))};
},_connectDatepicker:function(target,inst){var input=$(target);inst.append=$([]);
inst.trigger=$([]);if(input.hasClass(this.markerClassName)){return;}var appendText=this._get(inst,"appendText");
var isRTL=this._get(inst,"isRTL");if(appendText){inst.append=$('<span class="'+this._appendClass+'">'+appendText+"</span>");
input[isRTL?"before":"after"](inst.append);}var showOn=this._get(inst,"showOn");if(showOn=="focus"||showOn=="both"){input.focus(this._showDatepicker);
}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($.datepicker._datepickerShowing&&$.datepicker._lastInput==target){$.datepicker._hideDatepicker();
}else{$.datepicker._showDatepicker(target);}return false;});}input.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).bind("setData.datepicker",function(event,key,value){inst.settings[key]=value;
}).bind("getData.datepicker",function(event,key){return this._get(inst,key);});$.data(target,PROP_NAME,inst);
},_inlineDatepicker:function(target,inst){var divSpan=$(target);if(divSpan.hasClass(this.markerClassName)){return;
}divSpan.addClass(this.markerClassName).append(inst.dpDiv).bind("setData.datepicker",function(event,key,value){inst.settings[key]=value;
}).bind("getData.datepicker",function(event,key){return this._get(inst,key);});$.data(target,PROP_NAME,inst);
this._setDate(inst,this._getDefaultDate(inst));this._updateDatepicker(inst);this._updateAlternate(inst);
},_dialogDatepicker:function(input,dateText,onSelect,settings,pos){var inst=this._dialogInst;
if(!inst){var id="dp"+(++this.uuid);this._dialogInput=$('<input type="text" id="'+id+'" size="1" style="position: absolute; top: -100px;"/>');
this._dialogInput.keydown(this._doKeyDown);$("body").append(this._dialogInput);inst=this._dialogInst=this._newInst(this._dialogInput,false);
inst.settings={};$.data(this._dialogInput[0],PROP_NAME,inst);}extendRemove(inst.settings,settings||{});
this._dialogInput.val(dateText);this._pos=(pos?(pos.length?pos:[pos.pageX,pos.pageY]):null);
if(!this._pos){var browserWidth=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;
var browserHeight=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;
var scrollX=document.documentElement.scrollLeft||document.body.scrollLeft;var scrollY=document.documentElement.scrollTop||document.body.scrollTop;
this._pos=[(browserWidth/2)-100+scrollX,(browserHeight/2)-150+scrollY];}this._dialogInput.css("left",this._pos[0]+"px").css("top",this._pos[1]+"px");
inst.settings.onSelect=onSelect;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);
this._showDatepicker(this._dialogInput[0]);if($.blockUI){$.blockUI(this.dpDiv);}$.data(this._dialogInput[0],PROP_NAME,inst);
return this;},_destroyDatepicker:function(target){var $target=$(target);var inst=$.data(target,PROP_NAME);
if(!$target.hasClass(this.markerClassName)){return;}var nodeName=target.nodeName.toLowerCase();
$.removeData(target,PROP_NAME);if(nodeName=="input"){inst.append.remove();inst.trigger.remove();
$target.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress);
}else{if(nodeName=="div"||nodeName=="span"){$target.removeClass(this.markerClassName).empty();
}}},_enableDatepicker:function(target){var $target=$(target);var inst=$.data(target,PROP_NAME);
if(!$target.hasClass(this.markerClassName)){return;}var nodeName=target.nodeName.toLowerCase();
if(nodeName=="input"){target.disabled=false;inst.trigger.filter("button").each(function(){this.disabled=false;
}).end().filter("img").css({opacity:"1.0",cursor:""});}else{if(nodeName=="div"||nodeName=="span"){var inline=$target.children("."+this._inlineClass);
inline.children().removeClass("ui-state-disabled");}}this._disabledInputs=$.map(this._disabledInputs,function(value){return(value==target?null:value);
});},_disableDatepicker:function(target){var $target=$(target);var inst=$.data(target,PROP_NAME);
if(!$target.hasClass(this.markerClassName)){return;}var nodeName=target.nodeName.toLowerCase();
if(nodeName=="input"){target.disabled=true;inst.trigger.filter("button").each(function(){this.disabled=true;
}).end().filter("img").css({opacity:"0.5",cursor:"default"});}else{if(nodeName=="div"||nodeName=="span"){var inline=$target.children("."+this._inlineClass);
inline.children().addClass("ui-state-disabled");}}this._disabledInputs=$.map(this._disabledInputs,function(value){return(value==target?null:value);
});this._disabledInputs[this._disabledInputs.length]=target;},_isDisabledDatepicker:function(target){if(!target){return false;
}for(var i=0;i<this._disabledInputs.length;i++){if(this._disabledInputs[i]==target){return true;
}}return false;},_getInst:function(target){try{return $.data(target,PROP_NAME);}catch(err){throw"Missing instance data for this datepicker";
}},_optionDatepicker:function(target,name,value){var inst=this._getInst(target);if(arguments.length==2&&typeof name=="string"){return(name=="defaults"?$.extend({},$.datepicker._defaults):(inst?(name=="all"?$.extend({},inst.settings):this._get(inst,name)):null));
}var settings=name||{};if(typeof name=="string"){settings={};settings[name]=value;
}if(inst){if(this._curInst==inst){this._hideDatepicker(null);}var date=this._getDateDatepicker(target);
extendRemove(inst.settings,settings);this._setDateDatepicker(target,date);this._updateDatepicker(inst);
}},_changeDatepicker:function(target,name,value){this._optionDatepicker(target,name,value);
},_refreshDatepicker:function(target){var inst=this._getInst(target);if(inst){this._updateDatepicker(inst);
}},_setDateDatepicker:function(target,date,endDate){var inst=this._getInst(target);
if(inst){this._setDate(inst,date,endDate);this._updateDatepicker(inst);this._updateAlternate(inst);
}},_getDateDatepicker:function(target){var inst=this._getInst(target);if(inst&&!inst.inline){this._setDateFromField(inst);
}return(inst?this._getDate(inst):null);},_doKeyDown:function(event){var inst=$.datepicker._getInst(event.target);
var handled=true;var isRTL=inst.dpDiv.is(".ui-datepicker-rtl");inst._keyEvent=true;
if($.datepicker._datepickerShowing){switch(event.keyCode){case 9:$.datepicker._hideDatepicker(null,"");
break;case 13:var sel=$("td."+$.datepicker._dayOverClass+", td."+$.datepicker._currentClass,inst.dpDiv);
if(sel[0]){$.datepicker._selectDay(event.target,inst.selectedMonth,inst.selectedYear,sel[0]);
}else{$.datepicker._hideDatepicker(null,$.datepicker._get(inst,"duration"));}return false;
break;case 27:$.datepicker._hideDatepicker(null,$.datepicker._get(inst,"duration"));
break;case 33:$.datepicker._adjustDate(event.target,(event.ctrlKey?-$.datepicker._get(inst,"stepBigMonths"):-$.datepicker._get(inst,"stepMonths")),"M");
break;case 34:$.datepicker._adjustDate(event.target,(event.ctrlKey?+$.datepicker._get(inst,"stepBigMonths"):+$.datepicker._get(inst,"stepMonths")),"M");
break;case 35:if(event.ctrlKey||event.metaKey){$.datepicker._clearDate(event.target);
}handled=event.ctrlKey||event.metaKey;break;case 36:if(event.ctrlKey||event.metaKey){$.datepicker._gotoToday(event.target);
}handled=event.ctrlKey||event.metaKey;break;case 37:if(event.ctrlKey||event.metaKey){$.datepicker._adjustDate(event.target,(isRTL?+1:-1),"D");
}handled=event.ctrlKey||event.metaKey;if(event.originalEvent.altKey){$.datepicker._adjustDate(event.target,(event.ctrlKey?-$.datepicker._get(inst,"stepBigMonths"):-$.datepicker._get(inst,"stepMonths")),"M");
}break;case 38:if(event.ctrlKey||event.metaKey){$.datepicker._adjustDate(event.target,-7,"D");
}handled=event.ctrlKey||event.metaKey;break;case 39:if(event.ctrlKey||event.metaKey){$.datepicker._adjustDate(event.target,(isRTL?-1:+1),"D");
}handled=event.ctrlKey||event.metaKey;if(event.originalEvent.altKey){$.datepicker._adjustDate(event.target,(event.ctrlKey?+$.datepicker._get(inst,"stepBigMonths"):+$.datepicker._get(inst,"stepMonths")),"M");
}break;case 40:if(event.ctrlKey||event.metaKey){$.datepicker._adjustDate(event.target,+7,"D");
}handled=event.ctrlKey||event.metaKey;break;default:handled=false;}}else{if(event.keyCode==36&&event.ctrlKey){$.datepicker._showDatepicker(this);
}else{handled=false;}}if(handled){event.preventDefault();event.stopPropagation();
}},_doKeyPress:function(event){var inst=$.datepicker._getInst(event.target);if($.datepicker._get(inst,"constrainInput")){var chars=$.datepicker._possibleChars($.datepicker._get(inst,"dateFormat"));
var chr=String.fromCharCode(event.charCode==undefined?event.keyCode:event.charCode);
return event.ctrlKey||(chr<" "||!chars||chars.indexOf(chr)>-1);}},_showDatepicker:function(input){input=input.target||input;
if(input.nodeName.toLowerCase()!="input"){input=$("input",input.parentNode)[0];}if($.datepicker._isDisabledDatepicker(input)||$.datepicker._lastInput==input){return;
}var inst=$.datepicker._getInst(input);var beforeShow=$.datepicker._get(inst,"beforeShow");
extendRemove(inst.settings,(beforeShow?beforeShow.apply(input,[input,inst]):{}));
$.datepicker._hideDatepicker(null,"");$.datepicker._lastInput=input;$.datepicker._setDateFromField(inst);
if($.datepicker._inDialog){input.value="";}if(!$.datepicker._pos){$.datepicker._pos=$.datepicker._findPos(input);
$.datepicker._pos[1]+=input.offsetHeight;}var isFixed=false;$(input).parents().each(function(){isFixed|=$(this).css("position")=="fixed";
return !isFixed;});if(isFixed&&$.browser.opera){$.datepicker._pos[0]-=document.documentElement.scrollLeft;
$.datepicker._pos[1]-=document.documentElement.scrollTop;}var offset={left:$.datepicker._pos[0],top:$.datepicker._pos[1]};
$.datepicker._pos=null;inst.rangeStart=null;inst.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});
$.datepicker._updateDatepicker(inst);offset=$.datepicker._checkOffset(inst,offset,isFixed);
inst.dpDiv.css({position:($.datepicker._inDialog&&$.blockUI?"static":(isFixed?"fixed":"absolute")),display:"none",left:offset.left+"px",top:offset.top+"px"});
if(!inst.inline){var showAnim=$.datepicker._get(inst,"showAnim")||"show";var duration=$.datepicker._get(inst,"duration");
var postProcess=function(){$.datepicker._datepickerShowing=true;if($.browser.msie&&parseInt($.browser.version,10)<7){$("iframe.ui-datepicker-cover").css({width:inst.dpDiv.width()+4,height:inst.dpDiv.height()+4});
}};if($.effects&&$.effects[showAnim]){inst.dpDiv.show(showAnim,$.datepicker._get(inst,"showOptions"),duration,postProcess);
}else{inst.dpDiv[showAnim](duration,postProcess);}if(duration==""){postProcess();
}if(inst.input[0].type!="hidden"){inst.input[0].focus();}$.datepicker._curInst=inst;
}},_updateDatepicker:function(inst){var dims={width:inst.dpDiv.width()+4,height:inst.dpDiv.height()+4};
var self=this;inst.dpDiv.empty().append(this._generateHTML(inst)).find("iframe.ui-datepicker-cover").css({width:dims.width,height:dims.height}).end().find("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a").bind("mouseout",function(){$(this).removeClass("ui-state-hover");
if(this.className.indexOf("ui-datepicker-prev")!=-1){$(this).removeClass("ui-datepicker-prev-hover");
}if(this.className.indexOf("ui-datepicker-next")!=-1){$(this).removeClass("ui-datepicker-next-hover");
}}).bind("mouseover",function(){if(!self._isDisabledDatepicker(inst.inline?inst.dpDiv.parent()[0]:inst.input[0])){$(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");
$(this).addClass("ui-state-hover");if(this.className.indexOf("ui-datepicker-prev")!=-1){$(this).addClass("ui-datepicker-prev-hover");
}if(this.className.indexOf("ui-datepicker-next")!=-1){$(this).addClass("ui-datepicker-next-hover");
}}}).end().find("."+this._dayOverClass+" a").trigger("mouseover").end();var numMonths=this._getNumberOfMonths(inst);
var cols=numMonths[1];var width=17;if(cols>1){inst.dpDiv.addClass("ui-datepicker-multi-"+cols).css("width",(width*cols)+"em");
}else{inst.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");
}inst.dpDiv[(numMonths[0]!=1||numMonths[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");
inst.dpDiv[(this._get(inst,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");
if(inst.input&&inst.input[0].type!="hidden"&&inst==$.datepicker._curInst){$(inst.input[0]).focus();
}},_checkOffset:function(inst,offset,isFixed){var dpWidth=inst.dpDiv.outerWidth();
var dpHeight=inst.dpDiv.outerHeight();var inputWidth=inst.input?inst.input.outerWidth():0;
var inputHeight=inst.input?inst.input.outerHeight():0;var viewWidth=(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)+$(document).scrollLeft();
var viewHeight=(window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight)+$(document).scrollTop();
offset.left-=(this._get(inst,"isRTL")?(dpWidth-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-=(offset.left+dpWidth>viewWidth&&viewWidth>dpWidth)?Math.abs(offset.left+dpWidth-viewWidth):0;
offset.top-=(offset.top+dpHeight>viewHeight&&viewHeight>dpHeight)?Math.abs(offset.top+dpHeight+inputHeight*2-viewHeight):0;
return offset;},_findPos:function(obj){while(obj&&(obj.type=="hidden"||obj.nodeType!=1)){obj=obj.nextSibling;
}var position=$(obj).offset();return[position.left,position.top];},_hideDatepicker:function(input,duration){var inst=this._curInst;
if(!inst||(input&&inst!=$.data(input,PROP_NAME))){return;}if(inst.stayOpen){this._selectDate("#"+inst.id,this._formatDate(inst,inst.currentDay,inst.currentMonth,inst.currentYear));
}inst.stayOpen=false;if(this._datepickerShowing){duration=(duration!=null?duration:this._get(inst,"duration"));
var showAnim=this._get(inst,"showAnim");var postProcess=function(){$.datepicker._tidyDialog(inst);
};if(duration!=""&&$.effects&&$.effects[showAnim]){inst.dpDiv.hide(showAnim,$.datepicker._get(inst,"showOptions"),duration,postProcess);
}else{inst.dpDiv[(duration==""?"hide":(showAnim=="slideDown"?"slideUp":(showAnim=="fadeIn"?"fadeOut":"hide")))](duration,postProcess);
}if(duration==""){this._tidyDialog(inst);}var onClose=this._get(inst,"onClose");if(onClose){onClose.apply((inst.input?inst.input[0]:null),[(inst.input?inst.input.val():""),inst]);
}this._datepickerShowing=false;this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});
if($.blockUI){$.unblockUI();$("body").append(this.dpDiv);}}this._inDialog=false;}this._curInst=null;
},_tidyDialog:function(inst){inst.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar");
},_checkExternalClick:function(event){if(!$.datepicker._curInst){return;}var $target=$(event.target);
if(($target.parents("#"+$.datepicker._mainDivId).length==0)&&!$target.hasClass($.datepicker.markerClassName)&&!$target.hasClass($.datepicker._triggerClass)&&$.datepicker._datepickerShowing&&!($.datepicker._inDialog&&$.blockUI)){$.datepicker._hideDatepicker(null,"");
}},_adjustDate:function(id,offset,period){var target=$(id);var inst=this._getInst(target[0]);
if(this._isDisabledDatepicker(target[0])){return;}this._adjustInstDate(inst,offset+(period=="M"?this._get(inst,"showCurrentAtPos"):0),period);
this._updateDatepicker(inst);},_gotoToday:function(id){var target=$(id);var inst=this._getInst(target[0]);
if(this._get(inst,"gotoCurrent")&&inst.currentDay){inst.selectedDay=inst.currentDay;
inst.drawMonth=inst.selectedMonth=inst.currentMonth;inst.drawYear=inst.selectedYear=inst.currentYear;
}else{var date=new Date();inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();
inst.drawYear=inst.selectedYear=date.getFullYear();}this._notifyChange(inst);this._adjustDate(target);
},_selectMonthYear:function(id,select,period){var target=$(id);var inst=this._getInst(target[0]);
inst._selectingMonthYear=false;inst["selected"+(period=="M"?"Month":"Year")]=inst["draw"+(period=="M"?"Month":"Year")]=parseInt(select.options[select.selectedIndex].value,10);
this._notifyChange(inst);this._adjustDate(target);},_clickMonthYear:function(id){var target=$(id);
var inst=this._getInst(target[0]);if(inst.input&&inst._selectingMonthYear&&!$.browser.msie){inst.input[0].focus();
}inst._selectingMonthYear=!inst._selectingMonthYear;},_selectDay:function(id,month,year,td){var target=$(id);
if($(td).hasClass(this._unselectableClass)||this._isDisabledDatepicker(target[0])){return;
}var inst=this._getInst(target[0]);inst.selectedDay=inst.currentDay=$("a",td).html();
inst.selectedMonth=inst.currentMonth=month;inst.selectedYear=inst.currentYear=year;
if(inst.stayOpen){inst.endDay=inst.endMonth=inst.endYear=null;}this._selectDate(id,this._formatDate(inst,inst.currentDay,inst.currentMonth,inst.currentYear));
if(inst.stayOpen){inst.rangeStart=this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay));
this._updateDatepicker(inst);}},_clearDate:function(id){var target=$(id);var inst=this._getInst(target[0]);
inst.stayOpen=false;inst.endDay=inst.endMonth=inst.endYear=inst.rangeStart=null;this._selectDate(target,"");
},_selectDate:function(id,dateStr){var target=$(id);var inst=this._getInst(target[0]);
dateStr=(dateStr!=null?dateStr:this._formatDate(inst));if(inst.input){inst.input.val(dateStr);
}this._updateAlternate(inst);var onSelect=this._get(inst,"onSelect");if(onSelect){onSelect.apply((inst.input?inst.input[0]:null),[dateStr,inst]);
}else{if(inst.input){inst.input.trigger("change");}}if(inst.inline){this._updateDatepicker(inst);
}else{if(!inst.stayOpen){this._hideDatepicker(null,this._get(inst,"duration"));this._lastInput=inst.input[0];
if(typeof(inst.input[0])!="object"){inst.input[0].focus();}this._lastInput=null;}}},_updateAlternate:function(inst){var altField=this._get(inst,"altField");
if(altField){var altFormat=this._get(inst,"altFormat")||this._get(inst,"dateFormat");
var date=this._getDate(inst);dateStr=this.formatDate(altFormat,date,this._getFormatConfig(inst));
$(altField).each(function(){$(this).val(dateStr);});}},noWeekends:function(date){var day=date.getDay();
return[(day>0&&day<6),""];},iso8601Week:function(date){var checkDate=new Date(date.getFullYear(),date.getMonth(),date.getDate());
var firstMon=new Date(checkDate.getFullYear(),1-1,4);var firstDay=firstMon.getDay()||7;
firstMon.setDate(firstMon.getDate()+1-firstDay);if(firstDay<4&&checkDate<firstMon){checkDate.setDate(checkDate.getDate()-3);
return $.datepicker.iso8601Week(checkDate);}else{if(checkDate>new Date(checkDate.getFullYear(),12-1,28)){firstDay=new Date(checkDate.getFullYear()+1,1-1,4).getDay()||7;
if(firstDay>4&&(checkDate.getDay()||7)<firstDay-3){return 1;}}}return Math.floor(((checkDate-firstMon)/86400000)/7)+1;
},parseDate:function(format,value,settings){if(format==null||value==null){throw"Invalid arguments";
}value=(typeof value=="object"?value.toString():value+"");if(value==""){return null;
}var shortYearCutoff=(settings?settings.shortYearCutoff:null)||this._defaults.shortYearCutoff;
var dayNamesShort=(settings?settings.dayNamesShort:null)||this._defaults.dayNamesShort;
var dayNames=(settings?settings.dayNames:null)||this._defaults.dayNames;var monthNamesShort=(settings?settings.monthNamesShort:null)||this._defaults.monthNamesShort;
var monthNames=(settings?settings.monthNames:null)||this._defaults.monthNames;var year=-1;
var month=-1;var day=-1;var doy=-1;var literal=false;var lookAhead=function(match){var matches=(iFormat+1<format.length&&format.charAt(iFormat+1)==match);
if(matches){iFormat++;}return matches;};var getNumber=function(match){lookAhead(match);
var origSize=(match=="@"?14:(match=="y"?4:(match=="o"?3:2)));var size=origSize;var num=0;
while(size>0&&iValue<value.length&&value.charAt(iValue)>="0"&&value.charAt(iValue)<="9"){num=num*10+parseInt(value.charAt(iValue++),10);
size--;}if(size==origSize){throw"Missing number at position "+iValue;}return num;
};var getName=function(match,shortNames,longNames){var names=(lookAhead(match)?longNames:shortNames);
var size=0;for(var j=0;j<names.length;j++){size=Math.max(size,names[j].length);}var name="";
var iInit=iValue;while(size>0&&iValue<value.length){name+=value.charAt(iValue++);
for(var i=0;i<names.length;i++){if(name==names[i]){return i+1;}}size--;}throw"Unknown name at position "+iInit;
};var checkLiteral=function(){if(value.charAt(iValue)!=format.charAt(iFormat)){throw"Unexpected literal at position "+iValue;
}iValue++;};var iValue=0;for(var iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)=="'"&&!lookAhead("'")){literal=false;
}else{checkLiteral();}}else{switch(format.charAt(iFormat)){case"d":day=getNumber("d");
break;case"D":getName("D",dayNamesShort,dayNames);break;case"o":doy=getNumber("o");
break;case"m":month=getNumber("m");break;case"M":month=getName("M",monthNamesShort,monthNames);
break;case"y":year=getNumber("y");break;case"@":var date=new Date(getNumber("@"));
year=date.getFullYear();month=date.getMonth()+1;day=date.getDate();break;case"'":if(lookAhead("'")){checkLiteral();
}else{literal=true;}break;default:checkLiteral();}}}if(year==-1){year=new Date().getFullYear();
}else{if(year<100){year+=new Date().getFullYear()-new Date().getFullYear()%100+(year<=shortYearCutoff?0:-100);
}}if(doy>-1){month=1;day=doy;do{var dim=this._getDaysInMonth(year,month-1);if(day<=dim){break;
}month++;day-=dim;}while(true);}var date=this._daylightSavingAdjust(new Date(year,month-1,day));
if(date.getFullYear()!=year||date.getMonth()+1!=month||date.getDate()!=day){throw"Invalid date";
}return date;},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",TIMESTAMP:"@",W3C:"yy-mm-dd",formatDate:function(format,date,settings){if(!date){return"";
}var dayNamesShort=(settings?settings.dayNamesShort:null)||this._defaults.dayNamesShort;
var dayNames=(settings?settings.dayNames:null)||this._defaults.dayNames;var monthNamesShort=(settings?settings.monthNamesShort:null)||this._defaults.monthNamesShort;
var monthNames=(settings?settings.monthNames:null)||this._defaults.monthNames;var lookAhead=function(match){var matches=(iFormat+1<format.length&&format.charAt(iFormat+1)==match);
if(matches){iFormat++;}return matches;};var formatNumber=function(match,value,len){var num=""+value;
if(lookAhead(match)){while(num.length<len){num="0"+num;}}return num;};var formatName=function(match,value,shortNames,longNames){return(lookAhead(match)?longNames[value]:shortNames[value]);
};var output="";var literal=false;if(date){for(var iFormat=0;iFormat<format.length;
iFormat++){if(literal){if(format.charAt(iFormat)=="'"&&!lookAhead("'")){literal=false;
}else{output+=format.charAt(iFormat);}}else{switch(format.charAt(iFormat)){case"d":output+=formatNumber("d",date.getDate(),2);
break;case"D":output+=formatName("D",date.getDay(),dayNamesShort,dayNames);break;
case"o":var doy=date.getDate();for(var m=date.getMonth()-1;m>=0;m--){doy+=this._getDaysInMonth(date.getFullYear(),m);
}output+=formatNumber("o",doy,3);break;case"m":output+=formatNumber("m",date.getMonth()+1,2);
break;case"M":output+=formatName("M",date.getMonth(),monthNamesShort,monthNames);
break;case"y":output+=(lookAhead("y")?date.getFullYear():(date.getYear()%100<10?"0":"")+date.getYear()%100);
break;case"@":output+=date.getTime();break;case"'":if(lookAhead("'")){output+="'";
}else{literal=true;}break;default:output+=format.charAt(iFormat);}}}}return output;
},_possibleChars:function(format){var chars="";var literal=false;for(var iFormat=0;
iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)=="'"&&!lookAhead("'")){literal=false;
}else{chars+=format.charAt(iFormat);}}else{switch(format.charAt(iFormat)){case"d":case"m":case"y":case"@":chars+="0123456789";
break;case"D":case"M":return null;case"'":if(lookAhead("'")){chars+="'";}else{literal=true;
}break;default:chars+=format.charAt(iFormat);}}}return chars;},_get:function(inst,name){return inst.settings[name]!==undefined?inst.settings[name]:this._defaults[name];
},_setDateFromField:function(inst){var dateFormat=this._get(inst,"dateFormat");var dates=inst.input?inst.input.val():null;
inst.endDay=inst.endMonth=inst.endYear=null;var date=defaultDate=this._getDefaultDate(inst);
var settings=this._getFormatConfig(inst);try{date=this.parseDate(dateFormat,dates,settings)||defaultDate;
}catch(event){this.log(event);date=defaultDate;}inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();
inst.drawYear=inst.selectedYear=date.getFullYear();inst.currentDay=(dates?date.getDate():0);
inst.currentMonth=(dates?date.getMonth():0);inst.currentYear=(dates?date.getFullYear():0);
this._adjustInstDate(inst);},_getDefaultDate:function(inst){var date=this._determineDate(this._get(inst,"defaultDate"),new Date());
var minDate=this._getMinMaxDate(inst,"min",true);var maxDate=this._getMinMaxDate(inst,"max");
date=(minDate&&date<minDate?minDate:date);date=(maxDate&&date>maxDate?maxDate:date);
return date;},_determineDate:function(date,defaultDate){var offsetNumeric=function(offset){var date=new Date();
date.setDate(date.getDate()+offset);return date;};var offsetString=function(offset,getDaysInMonth){var date=new Date();
var year=date.getFullYear();var month=date.getMonth();var day=date.getDate();var pattern=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g;
var matches=pattern.exec(offset);while(matches){switch(matches[2]||"d"){case"d":case"D":day+=parseInt(matches[1],10);
break;case"w":case"W":day+=parseInt(matches[1],10)*7;break;case"m":case"M":month+=parseInt(matches[1],10);
day=Math.min(day,getDaysInMonth(year,month));break;case"y":case"Y":year+=parseInt(matches[1],10);
day=Math.min(day,getDaysInMonth(year,month));break;}matches=pattern.exec(offset);
}return new Date(year,month,day);};date=(date==null?defaultDate:(typeof date=="string"?offsetString(date,this._getDaysInMonth):(typeof date=="number"?(isNaN(date)?defaultDate:offsetNumeric(date)):date)));
date=(date&&date.toString()=="Invalid Date"?defaultDate:date);if(date){date.setHours(0);
date.setMinutes(0);date.setSeconds(0);date.setMilliseconds(0);}return this._daylightSavingAdjust(date);
},_daylightSavingAdjust:function(date){if(!date){return null;}date.setHours(date.getHours()>12?date.getHours()+2:0);
return date;},_setDate:function(inst,date,endDate){var clear=!(date);var origMonth=inst.selectedMonth;
var origYear=inst.selectedYear;date=this._determineDate(date,new Date());inst.selectedDay=inst.currentDay=date.getDate();
inst.drawMonth=inst.selectedMonth=inst.currentMonth=date.getMonth();inst.drawYear=inst.selectedYear=inst.currentYear=date.getFullYear();
if(origMonth!=inst.selectedMonth||origYear!=inst.selectedYear){this._notifyChange(inst);
}this._adjustInstDate(inst);if(inst.input){inst.input.val(clear?"":this._formatDate(inst));
}},_getDate:function(inst){var startDate=(!inst.currentYear||(inst.input&&inst.input.val()=="")?null:this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));
return startDate;},_generateHTML:function(inst){var today=new Date();today=this._daylightSavingAdjust(new Date(today.getFullYear(),today.getMonth(),today.getDate()));
var isRTL=this._get(inst,"isRTL");var showButtonPanel=this._get(inst,"showButtonPanel");
var hideIfNoPrevNext=this._get(inst,"hideIfNoPrevNext");var navigationAsDateFormat=this._get(inst,"navigationAsDateFormat");
var numMonths=this._getNumberOfMonths(inst);var showCurrentAtPos=this._get(inst,"showCurrentAtPos");
var stepMonths=this._get(inst,"stepMonths");var stepBigMonths=this._get(inst,"stepBigMonths");
var isMultiMonth=(numMonths[0]!=1||numMonths[1]!=1);var currentDate=this._daylightSavingAdjust((!inst.currentDay?new Date(9999,9,9):new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));
var minDate=this._getMinMaxDate(inst,"min",true);var maxDate=this._getMinMaxDate(inst,"max");
var drawMonth=inst.drawMonth-showCurrentAtPos;var drawYear=inst.drawYear;if(drawMonth<0){drawMonth+=12;
drawYear--;}if(maxDate){var maxDraw=this._daylightSavingAdjust(new Date(maxDate.getFullYear(),maxDate.getMonth()-numMonths[1]+1,maxDate.getDate()));
maxDraw=(minDate&&maxDraw<minDate?minDate:maxDraw);while(this._daylightSavingAdjust(new Date(drawYear,drawMonth,1))>maxDraw){drawMonth--;
if(drawMonth<0){drawMonth=11;drawYear--;}}}inst.drawMonth=drawMonth;inst.drawYear=drawYear;
var prevText=this._get(inst,"prevText");prevText=(!navigationAsDateFormat?prevText:this.formatDate(prevText,this._daylightSavingAdjust(new Date(drawYear,drawMonth-stepMonths,1)),this._getFormatConfig(inst)));
var prev=(this._canAdjustMonth(inst,-1,drawYear,drawMonth)?'<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery.datepicker._adjustDate(\'#'+inst.id+"', -"+stepMonths+", 'M');\" title=\""+prevText+'"><span class="ui-icon ui-icon-circle-triangle-'+(isRTL?"e":"w")+'">'+prevText+"</span></a>":(hideIfNoPrevNext?"":'<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+prevText+'"><span class="ui-icon ui-icon-circle-triangle-'+(isRTL?"e":"w")+'">'+prevText+"</span></a>"));
var nextText=this._get(inst,"nextText");nextText=(!navigationAsDateFormat?nextText:this.formatDate(nextText,this._daylightSavingAdjust(new Date(drawYear,drawMonth+stepMonths,1)),this._getFormatConfig(inst)));
var next=(this._canAdjustMonth(inst,+1,drawYear,drawMonth)?'<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery.datepicker._adjustDate(\'#'+inst.id+"', +"+stepMonths+", 'M');\" title=\""+nextText+'"><span class="ui-icon ui-icon-circle-triangle-'+(isRTL?"w":"e")+'">'+nextText+"</span></a>":(hideIfNoPrevNext?"":'<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+nextText+'"><span class="ui-icon ui-icon-circle-triangle-'+(isRTL?"w":"e")+'">'+nextText+"</span></a>"));
var currentText=this._get(inst,"currentText");var gotoDate=(this._get(inst,"gotoCurrent")&&inst.currentDay?currentDate:today);
currentText=(!navigationAsDateFormat?currentText:this.formatDate(currentText,gotoDate,this._getFormatConfig(inst)));
var controls=(!inst.inline?'<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery.datepicker._hideDatepicker();">'+this._get(inst,"closeText")+"</button>":"");
var buttonPanel=(showButtonPanel)?'<div class="ui-datepicker-buttonpane ui-widget-content">'+(isRTL?controls:"")+(this._isInRange(inst,gotoDate)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery.datepicker._gotoToday(\'#'+inst.id+"');\">"+currentText+"</button>":"")+(isRTL?"":controls)+"</div>":"";
var firstDay=parseInt(this._get(inst,"firstDay"),10);firstDay=(isNaN(firstDay)?0:firstDay);
var dayNames=this._get(inst,"dayNames");var dayNamesShort=this._get(inst,"dayNamesShort");
var dayNamesMin=this._get(inst,"dayNamesMin");var monthNames=this._get(inst,"monthNames");
var monthNamesShort=this._get(inst,"monthNamesShort");var beforeShowDay=this._get(inst,"beforeShowDay");
var showOtherMonths=this._get(inst,"showOtherMonths");var calculateWeek=this._get(inst,"calculateWeek")||this.iso8601Week;
var endDate=inst.endDay?this._daylightSavingAdjust(new Date(inst.endYear,inst.endMonth,inst.endDay)):currentDate;
var defaultDate=this._getDefaultDate(inst);var html="";for(var row=0;row<numMonths[0];
row++){var group="";for(var col=0;col<numMonths[1];col++){var selectedDate=this._daylightSavingAdjust(new Date(drawYear,drawMonth,inst.selectedDay));
var cornerClass=" ui-corner-all";var calender="";if(isMultiMonth){calender+='<div class="ui-datepicker-group ui-datepicker-group-';
switch(col){case 0:calender+="first";cornerClass=" ui-corner-"+(isRTL?"right":"left");
break;case numMonths[1]-1:calender+="last";cornerClass=" ui-corner-"+(isRTL?"left":"right");
break;default:calender+="middle";cornerClass="";break;}calender+='">';}calender+='<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'+cornerClass+'">'+(/all|left/.test(cornerClass)&&row==0?(isRTL?next:prev):"")+(/all|right/.test(cornerClass)&&row==0?(isRTL?prev:next):"")+this._generateMonthYearHeader(inst,drawMonth,drawYear,minDate,maxDate,selectedDate,row>0||col>0,monthNames,monthNamesShort)+'</div><table class="ui-datepicker-calendar"><thead><tr>';
var thead="";for(var dow=0;dow<7;dow++){var day=(dow+firstDay)%7;thead+="<th"+((dow+firstDay+6)%7>=5?' class="ui-datepicker-week-end"':"")+'><span title="'+dayNames[day]+'">'+dayNamesMin[day]+"</span></th>";
}calender+=thead+"</tr></thead><tbody>";var daysInMonth=this._getDaysInMonth(drawYear,drawMonth);
if(drawYear==inst.selectedYear&&drawMonth==inst.selectedMonth){inst.selectedDay=Math.min(inst.selectedDay,daysInMonth);
}var leadDays=(this._getFirstDayOfMonth(drawYear,drawMonth)-firstDay+7)%7;var numRows=(isMultiMonth?6:Math.ceil((leadDays+daysInMonth)/7));
var printDate=this._daylightSavingAdjust(new Date(drawYear,drawMonth,1-leadDays));
for(var dRow=0;dRow<numRows;dRow++){calender+="<tr>";var tbody="";for(var dow=0;dow<7;
dow++){var daySettings=(beforeShowDay?beforeShowDay.apply((inst.input?inst.input[0]:null),[printDate]):[true,""]);
var otherMonth=(printDate.getMonth()!=drawMonth);var unselectable=otherMonth||!daySettings[0]||(minDate&&printDate<minDate)||(maxDate&&printDate>maxDate);
tbody+='<td class="'+((dow+firstDay+6)%7>=5?" ui-datepicker-week-end":"")+(otherMonth?" ui-datepicker-other-month":"")+((printDate.getTime()==selectedDate.getTime()&&drawMonth==inst.selectedMonth&&inst._keyEvent)||(defaultDate.getTime()==printDate.getTime()&&defaultDate.getTime()==selectedDate.getTime())?" "+this._dayOverClass:"")+(unselectable?" "+this._unselectableClass+" ui-state-disabled":"")+(otherMonth&&!showOtherMonths?"":" "+daySettings[1]+(printDate.getTime()>=currentDate.getTime()&&printDate.getTime()<=endDate.getTime()?" "+this._currentClass:"")+(printDate.getTime()==today.getTime()?" ui-datepicker-today":""))+'"'+((!otherMonth||showOtherMonths)&&daySettings[2]?' title="'+daySettings[2]+'"':"")+(unselectable?"":" onclick=\"DP_jQuery.datepicker._selectDay('#"+inst.id+"',"+drawMonth+","+drawYear+', this);return false;"')+">"+(otherMonth?(showOtherMonths?printDate.getDate():"&#xa0;"):(unselectable?'<span class="ui-state-default">'+printDate.getDate()+"</span>":'<a class="ui-state-default'+(printDate.getTime()==today.getTime()?" ui-state-highlight":"")+(printDate.getTime()>=currentDate.getTime()&&printDate.getTime()<=endDate.getTime()?" ui-state-active":"")+'" href="#">'+printDate.getDate()+"</a>"))+"</td>";
printDate.setDate(printDate.getDate()+1);printDate=this._daylightSavingAdjust(printDate);
}calender+=tbody+"</tr>";}drawMonth++;if(drawMonth>11){drawMonth=0;drawYear++;}calender+="</tbody></table>"+(isMultiMonth?"</div>"+((numMonths[0]>0&&col==numMonths[1]-1)?'<div class="ui-datepicker-row-break"></div>':""):"");
group+=calender;}html+=group;}html+=buttonPanel+($.browser.msie&&parseInt($.browser.version,10)<7&&!inst.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>':"");
inst._keyEvent=false;return html;},_generateMonthYearHeader:function(inst,drawMonth,drawYear,minDate,maxDate,selectedDate,secondary,monthNames,monthNamesShort){minDate=(inst.rangeStart&&minDate&&selectedDate<minDate?selectedDate:minDate);
var changeMonth=this._get(inst,"changeMonth");var changeYear=this._get(inst,"changeYear");
var showMonthAfterYear=this._get(inst,"showMonthAfterYear");var html='<div class="ui-datepicker-title">';
var monthHtml="";if(secondary||!changeMonth){monthHtml+='<span class="ui-datepicker-month">'+monthNames[drawMonth]+"</span> ";
}else{var inMinYear=(minDate&&minDate.getFullYear()==drawYear);var inMaxYear=(maxDate&&maxDate.getFullYear()==drawYear);
monthHtml+='<select class="ui-datepicker-month" onchange="DP_jQuery.datepicker._selectMonthYear(\'#'+inst.id+"', this, 'M');\" onclick=\"DP_jQuery.datepicker._clickMonthYear('#"+inst.id+"');\">";
for(var month=0;month<12;month++){if((!inMinYear||month>=minDate.getMonth())&&(!inMaxYear||month<=maxDate.getMonth())){monthHtml+='<option value="'+month+'"'+(month==drawMonth?' selected="selected"':"")+">"+monthNamesShort[month]+"</option>";
}}monthHtml+="</select>";}if(!showMonthAfterYear){html+=monthHtml+((secondary||changeMonth||changeYear)&&(!(changeMonth&&changeYear))?"&#xa0;":"");
}if(secondary||!changeYear){html+='<span class="ui-datepicker-year">'+drawYear+"</span>";
}else{var years=this._get(inst,"yearRange").split(":");var year=0;var endYear=0;if(years.length!=2){year=drawYear-10;
endYear=drawYear+10;}else{if(years[0].charAt(0)=="+"||years[0].charAt(0)=="-"){year=drawYear+parseInt(years[0],10);
endYear=drawYear+parseInt(years[1],10);}else{year=parseInt(years[0],10);endYear=parseInt(years[1],10);
}}year=(minDate?Math.max(year,minDate.getFullYear()):year);endYear=(maxDate?Math.min(endYear,maxDate.getFullYear()):endYear);
html+='<select class="ui-datepicker-year" onchange="DP_jQuery.datepicker._selectMonthYear(\'#'+inst.id+"', this, 'Y');\" onclick=\"DP_jQuery.datepicker._clickMonthYear('#"+inst.id+"');\">";
for(;year<=endYear;year++){html+='<option value="'+year+'"'+(year==drawYear?' selected="selected"':"")+">"+year+"</option>";
}html+="</select>";}if(showMonthAfterYear){html+=(secondary||changeMonth||changeYear?"&#xa0;":"")+monthHtml;
}html+="</div>";return html;},_adjustInstDate:function(inst,offset,period){var year=inst.drawYear+(period=="Y"?offset:0);
var month=inst.drawMonth+(period=="M"?offset:0);var day=Math.min(inst.selectedDay,this._getDaysInMonth(year,month))+(period=="D"?offset:0);
var date=this._daylightSavingAdjust(new Date(year,month,day));var minDate=this._getMinMaxDate(inst,"min",true);
var maxDate=this._getMinMaxDate(inst,"max");date=(minDate&&date<minDate?minDate:date);
date=(maxDate&&date>maxDate?maxDate:date);inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();
inst.drawYear=inst.selectedYear=date.getFullYear();if(period=="M"||period=="Y"){this._notifyChange(inst);
}},_notifyChange:function(inst){var onChange=this._get(inst,"onChangeMonthYear");
if(onChange){onChange.apply((inst.input?inst.input[0]:null),[inst.selectedYear,inst.selectedMonth+1,inst]);
}},_getNumberOfMonths:function(inst){var numMonths=this._get(inst,"numberOfMonths");
return(numMonths==null?[1,1]:(typeof numMonths=="number"?[1,numMonths]:numMonths));
},_getMinMaxDate:function(inst,minMax,checkRange){var date=this._determineDate(this._get(inst,minMax+"Date"),null);
return(!checkRange||!inst.rangeStart?date:(!date||inst.rangeStart>date?inst.rangeStart:date));
},_getDaysInMonth:function(year,month){return 32-new Date(year,month,32).getDate();
},_getFirstDayOfMonth:function(year,month){return new Date(year,month,1).getDay();
},_canAdjustMonth:function(inst,offset,curYear,curMonth){var numMonths=this._getNumberOfMonths(inst);
var date=this._daylightSavingAdjust(new Date(curYear,curMonth+(offset<0?offset:numMonths[1]),1));
if(offset<0){date.setDate(this._getDaysInMonth(date.getFullYear(),date.getMonth()));
}return this._isInRange(inst,date);},_isInRange:function(inst,date){var newMinDate=(!inst.rangeStart?null:this._daylightSavingAdjust(new Date(inst.selectedYear,inst.selectedMonth,inst.selectedDay)));
newMinDate=(newMinDate&&inst.rangeStart<newMinDate?inst.rangeStart:newMinDate);var minDate=newMinDate||this._getMinMaxDate(inst,"min");
var maxDate=this._getMinMaxDate(inst,"max");return((!minDate||date>=minDate)&&(!maxDate||date<=maxDate));
},_getFormatConfig:function(inst){var shortYearCutoff=this._get(inst,"shortYearCutoff");
shortYearCutoff=(typeof shortYearCutoff!="string"?shortYearCutoff:new Date().getFullYear()%100+parseInt(shortYearCutoff,10));
return{shortYearCutoff:shortYearCutoff,dayNamesShort:this._get(inst,"dayNamesShort"),dayNames:this._get(inst,"dayNames"),monthNamesShort:this._get(inst,"monthNamesShort"),monthNames:this._get(inst,"monthNames")};
},_formatDate:function(inst,day,month,year){if(!day){inst.currentDay=inst.selectedDay;
inst.currentMonth=inst.selectedMonth;inst.currentYear=inst.selectedYear;}var date=(day?(typeof day=="object"?day:this._daylightSavingAdjust(new Date(year,month,day))):this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));
return this.formatDate(this._get(inst,"dateFormat"),date,this._getFormatConfig(inst));
}});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;}function isArray(a){return(a&&(($.browser.safari&&typeof a=="object"&&a.length)||(a.constructor&&a.constructor.toString().match(/\Array\(\)/))));
}$.fn.datepicker=function(options){if(!$.datepicker.initialized){$(document).mousedown($.datepicker._checkExternalClick).find("body").append($.datepicker.dpDiv);
$.datepicker.initialized=true;}var otherArgs=Array.prototype.slice.call(arguments,1);
if(typeof options=="string"&&(options=="isDisabled"||options=="getDate")){return $.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this[0]].concat(otherArgs));
}if(options=="option"&&arguments.length==2&&typeof arguments[1]=="string"){return $.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this[0]].concat(otherArgs));
}return this.each(function(){typeof options=="string"?$.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this].concat(otherArgs)):$.datepicker._attachDatepicker(this,options);
});};$.datepicker=new Datepicker();$.datepicker.initialized=false;$.datepicker.uuid=new Date().getTime();
$.datepicker.version="1.7.2";window.DP_jQuery=$;})(jQuery);
$(document).ready(function(){function a(b,c){try{$(".photo-gallery").PikaChoose();
}catch(d){}$("div.profile div.details .avatar").prepend("<div class='gfx-x'></div>");
$("div.profile div.details .avatar").prepend("<div class='gfx-f'></div>");$("div.profile div.details .avatar").click(function(){$(this).parent().parent().parent().addClass("visible");
$(this).before("<div class='gfx'></div>");if($.browser.msie&&$.browser.version<7){$(this).parent().parent().bgiframe();
$(this).parent().parent().find(".gfx-b").bgiframe();}$(this).parent().parent().hover(function(){},function(){$(this).parent().removeClass("visible");
$(this).parent().find(".gfx").remove();});return false;});$("table tr th:first-child span").prepend("<div class='gfx-tL'></div><div class='gfx-bL'></div>");
$("table tr th:last-child span").prepend("<div class='gfx-tR'></div><div class='gfx-bR'></div>");
$("dl.results dd .bar").prepend("<div class='gfx-l'></div><div class='gfx-r'></div>");
$(".box .image, .box .box").prepend("<div class='gfx-tL'></div><div class='gfx-tR'></div><div class='gfx-bL'></div><div class='gfx-bR'></div>");
fixContentIframeHeight();}Sys.WebForms.PageRequestManager.getInstance().add_endRequest(a);
jQuery.fn.center=function(){this.css("position","fixed");this.css("top",($(window).height()-this.height())/2+$(window).scrollTop()+"px");
this.css("left",($(window).width()-this.width())/2+$(window).scrollLeft()+"px");this.css("z-index",100001);
return this;};jQuery.fn.autoHeight=function(){this.css("height",$(window).height()-($(window).height()*0.2)+"px");
return this;};});function consolelog(a){if(typeof(console)!="undefined"){console.log(a);
}}Date.prototype.lastday=function(){var a=new Date(this.getFullYear(),this.getMonth()+1,0);
return a.getDate();};Date.prototype.getMonthsBetween=function(f){var j,e;var c=this.getFullYear()*12+this.getMonth();
var g=f.getFullYear()*12+f.getMonth();var a;var b=0;if(this==f){b=0;}else{if(c==g){b=(f.getDate()-this.getDate())/this.lastday();
}else{if(c<g){j=this;e=f;a=1;}else{j=f;e=this;a=-1;}var k=j.lastday()-j.getDate();
var h=e.getDate();var l=(k+h)/j.lastday()-1;b=Math.abs(g-c)+l;b=(b*a);}}return b;
};function validateDate(c,e,b){var d=document.getElementById(c);var h=document.getElementById(e);
var f=document.getElementById(b);var k=true;if(d.selectedIndex>0&&h.selectedIndex>0&&f.selectedIndex>0){var a=parseInt(d.options[d.selectedIndex].value);
var g=parseInt(h.options[h.selectedIndex].value);var j=parseInt(f.options[f.selectedIndex].value);
return validateDate2(a,g,j);}else{k=false;}return k;}function validateDate2(d,a,b){var c=true;
if(isNaN(d)||isNaN(a)||isNaN(b)){return false;}d=parseInt(d);a=parseInt(a);b=parseInt(b);
switch(a){case 1:case 3:case 5:case 7:case 8:case 10:case 12:break;case 4:case 6:case 9:case 11:if(d>30){c=false;
}break;case 2:if(d>28){if(((b%4)==0&&(b%100)!=0)||(b%400)==0){if(d>29){c=false;}}else{c=false;
}}else{c=true;}break;}return c;}function replaceZeros(a){return a.replace(/^[0]+/g,"");
}function isValidChars(a,c){for(var b=0;b<a.length;b++){if(c.indexOf(a.charAt(b))==-1){return false;
}}return true;}function dateDiffInDays(b,a,c){return dateDiffInDays2(new Date(b,a-1,c,0,0,0),new Date());
}function dateDiffInDays2(d,c){var a=new Date();a.setTime(Math.abs(d.getTime()-c.getTime()));
var b=a.getTime();var e=Math.floor(b/(1000*60*60*24));b-=e*(1000*60*60*24);return e;
}function isNumeric(b){var a="0123456789";for(i=0;i<b.length;i++){if(a.indexOf(b.charAt(i))==-1){return false;
}}return true;}function fixIE6(){if($.browser.msie&&$.browser.version<7){$(".fixIE6").addClass("dummyfix");
$(".fixIE6").removeClass("dummyfix");}}var TimelinePosting={};function ShowHideAddFriendSetup(){$(".hide-add-friend").click(function(){$("#add-friend").animate({opacity:"hide",height:"hide"},"slow");
return false;});$(".show-add-friend").click(function(){$("#add-friend").animate({opacity:"show",height:"show"},"slow");
return false;});$(".hide2-add-friend").click(function(){$("#add-friend").animate({opacity:"hide",height:"hide"},"slow");
return true;});}function showAddToTimeline(){$(".add-to-timeline").animate({opacity:"show",height:"show"},"slow",function(){fixContentIframeHeight();
});return false;}function hideAddToTimeline(){$(".add-to-timeline").animate({opacity:"hide",height:"hide"},"slow",function(){fixContentIframeHeight();
});TimelineFlash.newPostCancel();$("#errormessageDiv").addClass("hide");$("#errormessage").text("");
return false;}function showTimelineHelp(){if($.browser.msie){var a=$(".add-to-timeline").css("z-index");
$(".timeline-help").css("z-index",a+1000);}$(".timeline-help").animate({opacity:"show",height:"show"},"slow");
return false;}function hideTimelineHelp(){$(".timeline-help").animate({opacity:"hide",height:"hide"},"slow");
return false;}function activateTimelineTab(b,a){$(".add-to-timeline .action-list li").each(function(){$(this).removeClass("active");
});$(a).addClass("active");$(".timeline-diary").hide();$(".timeline-milestone").hide();
$(".timeline-pictures").hide();$(".timeline-stats").hide();$("."+b).fadeIn("fast");
}function showPhotoTagList(a){$("#timeline-photo-tag-list-"+a).animate({opacity:"show",height:"show"},"slow");
$("#show-timeline-photo-tag-list-"+a).addClass("hide");$("#hide-timeline-photo-tag-list-"+a).removeClass("hide");
return false;}function hidePhotoTagList(a){$("#timeline-photo-tag-list-"+a).animate({opacity:"hide",height:"hide"},"slow");
$("#hide-timeline-photo-tag-list-"+a).addClass("hide");$("#show-timeline-photo-tag-list-"+a).removeClass("hide");
return false;}function addOptions(b,c){b.options.length=0;var d=c.length;for(var a=0;
a<d;a++){b.options[a]=new Option(c[a].text,c[a].value,(a==0),false);}}function dumpSlots(){for(var a=0;
a<5;a++){consolelog("Slot: "+a+" = "+TimelinePosting.PhotoSlots[a]);}}function addAnotherPhotoToTimeline(g){consolelog("addAnotherPhotoToTimeline("+g+")");
var f=$("#photo-list").children().size();f=f+1;if(f>5){return false;}var e=0;var a=[0,1,2,3,4];
for(var c=0;c<5;c++){if(TimelinePosting.PhotoSlots[c]!=null){a[TimelinePosting.PhotoSlots[c]]=null;
}}for(var c=0;c<5;c++){consolelog("freeSlots: "+c+" = "+a[c]);}for(var c=0;c<5;c++){if(a[c]!=null){e=a[c];
TimelinePosting.PhotoSlots[c]=e;break;}}dumpSlots();consolelog("Use slot: "+e);var d='class="active"';
if(g){d="";}var b="<li "+d+"><span>"+f+"</span></li>";if(!g){$("#photo-list li").removeClass("active");
}$("#photo-list").append(b);if(!g){$("#photo-fieldset-container fieldset").hide();
$("#photo-fieldset-container fieldset:nth-child("+(e+1)+")").show();}$("#photo-list li").unbind("click");
$("#photo-list li").each(function(h){$(this).click(function(){$("#photo-list li").removeClass("active");
$(this).addClass("active");var j=TimelinePosting.PhotoSlots[h];$("#photo-fieldset-container fieldset").hide();
$("#photo-fieldset-container fieldset:nth-child("+(j+1)+")").show();});});if($("#photo-list").children().size()==5){$(".add-another-photo").css("visibility","hidden");
}}function removePhotoFromTimeline(){consolelog("removePhotoFromTimeline()");var d=$("#photo-list li").index($("#photo-list li.active"));
$("#photo-list li:last-child").remove();$("#photo-list li.active").removeClass("active");
var c=TimelinePosting.PhotoSlots[d];consolelog("Active is photoNumber: "+d+", using slot: "+c);
dumpSlots();consolelog("Move photoslots one step");if(d<5){for(var a=d;a<5;a++){TimelinePosting.PhotoSlots[a]=TimelinePosting.PhotoSlots[a+1];
}TimelinePosting.PhotoSlots[4]=null;}dumpSlots();$("#photo-fieldset-container fieldset:nth-child("+(c+1)+")").hide();
$("#photo-list .photoDeleted"+(c+1)).val("1");$(".photoPreview"+(c+1)).attr("src","");
$(".photoPreview"+(c+1)).addClass("hide");$(".photoUpload"+(c+1)).removeClass("hide");
$(".photoCaption"+(c+1)).val("");$(".photoTags"+(c+1)).each(function(){$(this).attr("checked",false);
});var b=$("#photo-list").children().size();if(d>=b){d=b-1;}if(d>=0){if(d==b){c=TimelinePosting.PhotoSlots[d-1];
d=d-1;}else{c=TimelinePosting.PhotoSlots[d];}consolelog("New activate "+d+", photo slot "+c);
$("#photo-list li:nth-child("+(d+1)+")").addClass("active");$("#photo-fieldset-container fieldset:nth-child("+(c+1)+")").show();
}else{consolelog("All photos removed, add new");addAnotherPhotoToTimeline(false);
}if($("#photo-list").children().size()<5){$(".add-another-photo").css("visibility","visible");
}return false;}var StageTypes_Trying=0;var StageTypes_Pregnant=1;var StageTypes_Baby=2;
var StageTypes_Toddler=3;var StageTypes_None=4;var StageIntervals={};function calcStageIntervals(a,c,f,h){var e=h.split("/");
h=new Date(e[2],e[0]-1,e[1]);var b=null;var d=null;var j=null;var g=null;if(f==null){var l=new Date(h);
var k=280;l.add(-k).day();b=l;pregnantEndDate=new Date(l);pregnantEndDate.add(43*7).day();
}else{j=new Date(h);g=new Date(h);g.add(48).months();pregnancyStartDate=new Date(h);
pregnancyStartDate.add(-(43*7)).day();d=new Date(h);}StageIntervals={StagePregnantStartDate:pregnancyStartDate,StagePregnantEndDate:d,StageBabyToddlerStartDate:j,StageBabyToddlerEndDate:g};
consolelog("StagePregnantStartDate: "+StageIntervals.StagePregnantStartDate);consolelog("StagePregnantEndDate: "+StageIntervals.StagePregnantEndDate);
consolelog("StageBabyToddlerStartDate: "+StageIntervals.StageBabyToddlerStartDate);
consolelog("StageBabyToddlerEndDate: "+StageIntervals.StageBabyToddlerEndDate);}function xmlParser(b){var a=null;
var c='½?xml version="1.0" encoding="UTF-8"?§';b=c.replace("½","<").replace("§",">")+b;
if(window.DOMParser){parser=new DOMParser();a=parser.parseFromString(b,"text/xml");
}else{a=new ActiveXObject("Microsoft.XMLDOM");a.async="false";a.loadXML(b);}return a;
}function getStatisticXML(a){consolelog("getStatisticXML ajax call");$.ajax({url:"/WebService/TimelinePost.asmx/GetStatisticXML",data:"{}",contentType:"application/json; charset=utf-8",dataType:"json",type:"post",success:function(b){consolelog("getStatisticXML received "+b.d);
TimelinePosting.StatsXml=b.d;setupStats2(a);return;}});}function setupStats(a){if(TimelinePosting.StatsXml==null||TimelinePosting.StatsXml==""){getStatisticXML(a);
}else{setupStats2(a);}}function setupStats2(f){var a=new Array();var h=0;a[h++]=new Opt("","");
var k=xmlParser(TimelinePosting.StatsXml);var c=k.getElementsByTagName("statistic");
for(var d=0;d<c.length;d++){var j=c[d].getAttribute("stage").split(",");for(var g=0;
g<j.length;g++){if(j[g]==f){var b=c[d].getAttribute("id");var e=c[d].getElementsByTagName("text");
if(e[0].textContent===undefined){a[h++]=new Opt(b,e[0].text);}else{a[h++]=new Opt(b,e[0].textContent);
}}}}addOptions($(".timelinepost_ddlStatisticType")[0],a);$("#statisticInputDiv1").hide();
$("#statisticInputDiv2").hide();$("#statisticOptionDiv1").hide();$("#statisticOptionDiv2").hide();
$(".timelinepost_txtStatisticValue1").val("");$(".timelinepost_txtStatisticValue2").val("");
$(".timelinepost_ddlStatisticValue1").val("");$(".timelinepost_ddlStatisticValue2").val("");
}function newPost2(c,b,g,n){consolelog("timelinepost-newPost2(stage: "+c+", period: "+b+", childID: "+g+", dueDateOrBirthDate: "+n);
calcStageIntervals(c,b,g,n);setupStats(c);populateMilestones(c,true);resetAddToTimeline();
if(n==""){var o=Date.today().getFullYear();var f=new Array();var m=0;for(var j=o-1;
j<o+4;j++){f[m++]=new Opt(j,j);}addOptions($(".timelinepost_ddlDateYear")[0],f);var p=new Date();
timelineSetDate(p.getFullYear(),p.getMonth()+1,p.getDate());consolelog("dueDateOrBirthDate is null, set date to today: "+p.toLocaleDateString());
}else{var s=n.split("/");n=new Date(s[2],s[0]-1,s[1]);var t=new Date(n);t.add(-(7*43)).day();
var l=new Date(n);l.add(48).month();if(Date.today()<l){l=Date.today();}var f=new Array();
for(var j=0;j<10;j++){f[j]=new Opt(t.getFullYear(),t.getFullYear());if(t.getFullYear()>=l.getFullYear()){break;
}t.add(1).year();}addOptions($(".timelinepost_ddlDateYear")[0],f);if(c==StageTypes_Pregnant){var q=new Date(n);
var r=280;q.add(-r).day();consolelog("pregnant stage, duedate: "+n.toLocaleDateString()+", calculate pregnancy date to: "+q.toLocaleDateString());
var p=new Date(q);if(b>4){p.add(b*7).day();consolelog("after adding period "+b+" to pregnancy date: "+q.toLocaleDateString());
}var a=new Date();var k=dateDiffInDays2(q,a);var e=parseInt(k/7);k=dateDiffInDays2(q,p);
var h=parseInt(k/7);consolelog("Current pregnancy period is "+e+", selected pregnancy period is "+h);
if(e==h){consolelog("Selected pregnancy period "+h+" is same as current pregnancy period, use todays date: "+a.toLocaleDateString());
p=new Date(a);}else{consolelog("Selected pregnancy period "+h+" is different from current pregnancy period, use first day in selected period "+p.toLocaleDateString());
}consolelog("set date to: "+p.toLocaleDateString());timelineSetDate(p.getFullYear(),p.getMonth()+1,p.getDate());
}else{if(c==StageTypes_Baby||c==StageTypes_Toddler){consolelog("baby/toddler stage, birth date is: "+n.toLocaleDateString());
var p=new Date(n);if(b>0){p.add(parseInt(b)).month();consolelog("baby/toddler stage, after added "+b+" months date is: "+p.toLocaleDateString());
var a=new Date();var e=Math.floor(n.getMonthsBetween(a));var h=Math.floor(n.getMonthsBetween(p));
consolelog("Child current period is "+e+", selected period is "+h);if(e==h){consolelog("Selected period "+h+" is same as childs current period, use todays date: "+a.toLocaleDateString());
p=new Date(a);}else{consolelog("Selected period "+h+" is different from childs period, use first day in selected period "+p.toLocaleDateString());
}}consolelog("set date to: "+p.toLocaleDateString());timelineSetDate(p.getFullYear(),p.getMonth()+1,p.getDate());
}}}$("#"+TimelinePosting.HiddenTimelinePostIDClientID).val("");$("#"+TimelinePosting.HiddenStageClientID).val(c);
$("#"+TimelinePosting.HiddenPeriodClientID).val(b);$("#"+TimelinePosting.HiddenChildIDClientID).val(g);
showAddToTimeline();}function editPost2(a,G,B,E,M,z,I,F,n,v,c,d,e,H,y,g,x,u,K,o,p,q,r,s,m,L,w,l,J,f,C,b,D,h,j,A,t){consolelog("timelinepost-editPost2(timelinePostID: "+G+", stage: "+B+", period: "+E+", childID: "+M+", dueDateOrBirthDate: "+z);
calcStageIntervals(B,E,M,z);setupStats(a);populateMilestones(B,false);resetAddToTimeline();
$("#"+TimelinePosting.HiddenTimelinePostIDClientID).val(G);$(".timelinepost_txtTitle").val(I);
tinyMCE.get($(".editor-diary")[0].id).setContent(d);var k=B;if(B==StageTypes_Toddler){k=StageTypes_Baby;
}$(".timelinepost_ddlMilestone").val(k+"-"+e);tinyMCE.get($(".editor-milestone")[0].id).setContent(H);
$(".timelinepost_ddlStatisticType").val(j);if(j!=null){ddlStatisticType_OnChange($(".timelinepost_ddlStatisticType")[0],A,t);
}if(y!=null){$(".photoId1").val(y);TimelinePosting.PhotoSlots[0]=0;}if(g!=null){$(".photoId2").val(g);
addAnotherPhotoToTimeline(true);}if(x!=null){$(".photoId3").val(x);addAnotherPhotoToTimeline(true);
}if(u!=null){$(".photoId4").val(u);addAnotherPhotoToTimeline(true);}if(K!=null){$(".photoId5").val(K);
addAnotherPhotoToTimeline(true);}dumpSlots();if(o!="null"){$(".photoCaption1").val(o);
}if(p!="null"){$(".photoCaption2").val(p);}if(q!="null"){$(".photoCaption3").val(q);
}if(r!="null"){$(".photoCaption4").val(r);}if(s!="null"){$(".photoCaption5").val(s);
}if(m!="null"){$(".photoPreview1").attr("src",m);$(".photoPreview1").removeClass("hide");
$(".photoUpload1").addClass("hide");}if(L!="null"){$(".photoPreview2").attr("src",L);
$(".photoPreview2").removeClass("hide");$(".photoUpload2").addClass("hide");}if(w!="null"){$(".photoPrview3").attr("src",w);
$(".photoPreview3").removeClass("hide");$(".photoUpload3").addClass("hide");}if(l!="null"){$(".photoPreview4").attr("src",l);
$(".photoPreview4").removeClass("hide");$(".photoUpload4").addClass("hide");}if(J!="null"){$(".photoPreview5").attr("src",J);
$(".photoPreview5").removeClass("hide");$(".photoUpload5").addClass("hide");}if(f!="null"){$(".photoTags1").each(function(){if(f.indexOf(this.value+",")){$(this).attr("checked",true);
}});}if(C!="null"){$(".photoTags2").each(function(){if(C.indexOf(this.value+",")){$(this).attr("checked",true);
}});}if(b!="null"){$(".photoTags3").each(function(){if(b.indexOf(this.value+",")){$(this).attr("checked",true);
}});}if(D!="null"){$(".photoTags4").each(function(){if(D.indexOf(this.value+",")){$(this).attr("checked",true);
}});}if(h!="null"){$(".photoTags5").each(function(){if(h.indexOf(this.value+",")){$(this).attr("checked",true);
}});}timelineSetDate(F,n,v);$(".timelinepost_ddlVisibilityTo").val(c);showAddToTimeline();
}function resetAddToTimeline(){activateTimelineTab("timeline-diary",$("#tab-timeline-diary")[0]);
$("#"+TimelinePosting.HiddenTimelinePostIdClientID).val(null);$(".timelinepost_txtTitle").val("");
tinyMCE.get($(".editor-diary")[0].id).setContent("");$(".timelinepost_ddlMilestone").val(null);
tinyMCE.get($(".editor-milestone")[0].id).setContent("");TimelinePosting.PhotoSlots=new Array();
for(var b=0;b<5;b++){TimelinePosting.PhotoSlots[b]=null;}for(var b=1;b<6;b++){$(".photoId"+b).val("");
$(".photoCaption"+b).val("");$(".photoPreview"+b).attr("src","");$(".photoPreview"+b).addClass("hide");
$(".photoUpload"+b).removeClass("hide");$(".photoTags"+b).each(function(){$(this).attr("checked",false);
});}var a=$("#photo-list").children().size();for(var b=0;b<a;b++){$("#photo-list li:last-child").remove();
$("#photo-list li:last-child").removeClass("active");$("#photo-fieldset-container fieldset:nth-child("+b+")").hide();
$("#photo-list .photoDeleted"+b).val("0");}$(".add-another-photo").css("visibility","visible");
addAnotherPhotoToTimeline(false);}function timelineSetDate(b,a,c){$(".timelinepost_ddlDateDay").val(c);
$(".timelinepost_ddlDateMonth").val(a);$(".timelinepost_ddlDateYear").val(b);}function populateMilestones(f,b){if(f==StageTypes_Toddler){f=StageTypes_Baby;
}var d=new Array();d[0]=new Opt("","");for(var e=0,c=1;e<milestones.length;e++){if(milestones[e].value.split("-")[0]==f){var a=false;
for(var g=0;g<usedMilestones.length;g++){if(milestones[e].value==usedMilestones[g].value){a=true;
break;}}if(!a||!b){d[c]=milestones[e];c++;}}}addOptions($(".timelinepost_ddlMilestone")[0],d);
}var VisibilityEnum_Everyone=0;var VisibilityEnum_FriendsOnly=1;var VisibilityEnum_OnlyYou=2;
function ddlVisibleTo_onChange(a){consolelog(TimelinePosting.CurrentUserTimelinePrivacy!=VisibilityEnum_OnlyYou);
if($("#"+a.id).val()==VisibilityEnum_OnlyYou){$("#"+TimelinePosting.chkShareOnFacebookClientID).attr("checked",false);
$("#"+TimelinePosting.chkShareOnFacebookClientID).attr("disabled",true);}else{$("#"+TimelinePosting.chkShareOnFacebookClientID).removeAttr("disabled");
if(TimelinePosting.CurrentUserTimelinePrivacy!=VisibilityEnum_OnlyYou){$("#"+TimelinePosting.chkShareOnFacebookClientID).attr("checked",true);
}}}function timelinePostDate_onChange(f){var e=$("#"+TimelinePosting.HiddenTimelinePostIDClientID).val()=="";
var d=$("#"+TimelinePosting.DdlDateDayClientID).val();var a=$("#"+TimelinePosting.DdlDateMonthClientID).val();
var b=$("#"+TimelinePosting.DdlDateYearClientID).val();if(!validateDate2(d,a,b)){return;
}var c=new Date(b,a-1,d);if(c>=StageIntervals.StagePregnantStartDate&&c<StageIntervals.StagePregnantEndDate){consolelog("Setup stats and milstone to Pregnant stages");
setupStats(StageTypes_Pregnant);populateMilestones(StageTypes_Pregnant,e);}else{if(c>=StageIntervals.StageBabyToddlerStartDate&&c<StageIntervals.StageBabyToddlerEndDate){consolelog("Setup stats and milstone to Baby Toddler stages");
setupStats(StageTypes_Baby);populateMilestones(StageTypes_Baby,e);}else{consolelog("Date "+c+" is outside stages date span!");
}}}function ddlStatisticType_OnChange(p,c,a){$("#statisticInputDiv1").hide();$("#statisticInputDiv2").hide();
$("#statisticOptionDiv1").hide();$("#statisticOptionDiv2").hide();var g=xmlParser(TimelinePosting.StatsXml);
var s=g.getElementsByTagName("statistic");for(var h=0;h<s.length;h++){if(p.options[p.selectedIndex].value==s[h].getAttribute("id")&&s[h].getAttribute("enabled")=="true"){var t=[];
var m=0;var r=s[h].getElementsByTagName("input");for(var d=0;d<r.length;d++){if(r[d].textContent===undefined){t[m++]=r[d].text;
}else{t[m++]=r[d].textContent;}}$(".timelinepost_txtStatisticValue1").val("");$(".timelinepost_txtStatisticValue2").val("");
if(t.length==0){$("#statisticInputDiv1").hide();$("#statisticInputDiv2").hide();}else{if(t.length==1){$("#statisticInputDiv1").show();
$("#statisticInputDiv2").hide();$("#statisticInputLabel1").html(t[0]);if(c!="undefined"&&c!=""&&c!=null&&c!="null"){$(".timelinepost_txtStatisticValue1").val(c);
}if(a!="undefined"&&a!=""&&a!=null&&a!="null"){$(".timelinepost_txtStatisticValue2").val(a);
}}else{if(t.length==2){$("#statisticInputDiv1").show();$("#statisticInputDiv2").show();
$("#statisticInputLabel1").html(t[0]);$("#statisticInputLabel2").html(t[1]);if(a!="undefined"&&a!=""&&a!=null&&a!="null"){$(".timelinepost_txtStatisticValue2").val(a);
}}}}var e=[];var m=0;$(".timelinepost_txtStatisticValue1")[0].selectedIndex=0;$(".timelinepost_txtStatisticValue2")[0].selectedIndex=0;
var o=s[h].getElementsByTagName("options");for(var d=0;d<o.length;d++){var f=o[d].getElementsByTagName("text");
if(f[0].textContent===undefined){e[m++]=f[0].text;}else{e[m++]=f[0].textContent;}var l=new Array();
var q=0;var b=o[d].getElementsByTagName("item");for(var j=0;j<b.length;j++){if(b[j].getAttribute("enabled")=="true"){if(b[j].textContent===undefined){l[q++]=new Opt(b[j].getAttribute("id"),b[j].text);
}else{l[q++]=new Opt(b[j].getAttribute("id"),b[j].textContent);}}}if(t.length==0&&e.length>0){addOptions($(".timelinepost_ddlStatisticValue1")[0],l);
if(c!="undefined"&&c!=""&&c!=null&&c!="null"){$(".timelinepost_ddlStatisticValue1").val(c);
}}else{if(e.length>0){addOptions($(".timelinepost_ddlStatisticValue2")[0],l);if(a!="undefined"&&a!=""&&a!=null&&a!="null"){$(".timelinepost_ddlStatisticValue2").val(a);
}}}}if(e.length==0){$("#statisticOptionDiv1").hide();$("#statisticOptionDiv2").hide();
}else{if(e.length==1){$("#statisticOptionDiv1").show();$("#statisticOptionDiv2").hide();
$("#statisticOptionLabel1").html(e[0]);}else{if(e.length==2){$("#statisticOptionDiv1").show();
$("#statisticOptionDiv2").show();$("#statisticOptionLabel1").html(e[0]);$("#statisticOptionLabel2").html(e[1]);
}}}}}}function timelinePostValidateTitle(a){if(a==null||a==""||jQuery.trim(a)==""){consolelog("TimelinePostValidateTitle: Title field is empty!");
return TimelinePosting.MissingTitleErrorMessage;}return null;}function timelinePostValidateDate(){var a=$("#"+TimelinePosting.DdlDateDayClientID).val();
var f=$("#"+TimelinePosting.DdlDateMonthClientID).val();var g=$("#"+TimelinePosting.DdlDateYearClientID).val();
var h=validateDate2(a,f,g);if(h){var b=new Date(g,f-1,a);var c=$("#"+TimelinePosting.HiddenChildIDClientID).val();
var e=new Date($("#"+TimelinePosting.HiddenDueDateOrBirthDateClientID).val());if(b>new Date()){consolelog("TimelinePostValidateDate "+b+" is in the future!");
return TimelinePosting.InvalidDateFutureErrorMessage;}else{if(b>=StageIntervals.StagePregnantStartDate&&b<StageIntervals.StagePregnantEndDate){consolelog("Date "+b+" is valid and within pregnant period ("+StageIntervals.StagePregnantStartDate+" - "+StageIntervals.StagePregnantEndDate+")");
}else{if(b>=StageIntervals.StageBabyToddlerStartDate&&b<StageIntervals.StageBabyToddlerEndDate){consolelog("Date "+b+" is valid and within baby or toddler period ("+StageIntervals.StageBabyToddlerStartDate+" - "+StageIntervals.StageBabyToddlerEndDate+")");
}else{consolelog("TimelinePostValidateDate "+b+" is outside stages date span!");var d=TimelinePosting.InvalidDateMustBeWithinTimelineErrorMessage;
if(c==null){d=d.replace("{0}",StageIntervals.StagePregnantStartDate.toLocaleDateString());
d=d.replace("{1}",new Date().toLocaleDateString());}else{d=d.replace("{0}",StageIntervals.StagePregnantStartDate.toLocaleDateString());
d=d.replace("{1}",new Date().toLocaleDateString());}return d;}}}}else{consolelog("TimelinePostValidateDate: Date is invalid format!");
return TimelinePosting.InvalidDate;}return null;}function pickedTimelinePostDate(a){consolelog("pickedTimelinePostDate: "+a);
var b=a.split("/");$("#"+TimelinePosting.DdlDateDayClientID).val(replaceZeros(b[0]));
$("#"+TimelinePosting.DdlDateMonthClientID).val(replaceZeros(b[1]));$("#"+TimelinePosting.DdlDateYearClientID).val(replaceZeros(b[2]));
}
(function(a){a.fn.breakWords=function(){this.each(function(){if(this.nodeType!==1){return;
}if(this.currentStyle&&typeof this.currentStyle.wordBreak==="string"){this.runtimeStyle.wordBreak="break-all";
}else{if(document.createTreeWalker){var g=function(h){h=h.replace(/^\s\s*/,"");var j=/\s/,c=h.length;
while(j.test(h.charAt(--c))){}return h.slice(0,c+1);};var d=document.createTreeWalker(this,NodeFilter.SHOW_TEXT,null,false);
var f,b,e=String.fromCharCode("8203");while(d.nextNode()){f=d.currentNode;b=g(f.nodeValue).split("").join(e);
f.nodeValue=b;}}}});return this;};})(jQuery);
(function(b){var c=b.scrollTo=function(d,f,g){b(window).scrollTo(d,f,g);};c.defaults={axis:"xy",duration:parseFloat(b.fn.jquery)>=1.3?0:1};
c.window=function(d){return b(window)._scrollable();};b.fn._scrollable=function(){return this.map(function(){var d=this,f=!d.nodeName||b.inArray(d.nodeName.toLowerCase(),["iframe","#document","html","body"])!=-1;
if(!f){return d;}var g=(d.contentWindow||d).document||d.ownerDocument||d;return b.browser.safari||g.compatMode=="BackCompat"?g.body:g.documentElement;
});};b.fn.scrollTo=function(d,f,e){if(typeof f=="object"){e=f;f=0;}if(typeof e=="function"){e={onAfter:e};
}if(d=="max"){d=9000000000;}e=b.extend({},c.defaults,e);f=f||e.speed||e.duration;
e.queue=e.queue&&e.axis.length>1;if(e.queue){f/=2;}e.offset=a(e.offset);e.over=a(e.over);
return this._scrollable().each(function(){var n=this,h=b(n),m=d,i,l={},k=h.is("html,body");
switch(typeof m){case"number":case"string":if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(m)){m=a(m);
break;}m=b(m,this);case"object":if(m.is||m.style){i=(m=b(m)).offset();}}b.each(e.axis.split(""),function(s,g){var u=g=="x"?"Left":"Top",v=u.toLowerCase(),t="scroll"+u,p=n[t],q=c.max(n,g);
if(i){l[t]=i[v]+(k?0:p-h.offset()[v]);if(e.margin){l[t]-=parseInt(m.css("margin"+u))||0;
l[t]-=parseInt(m.css("border"+u+"Width"))||0;}l[t]+=e.offset[v]||0;if(e.over[v]){l[t]+=m[g=="x"?"width":"height"]()*e.over[v];
}}else{var r=m[v];l[t]=r.slice&&r.slice(-1)=="%"?parseFloat(r)/100*q:r;}if(/^\d+$/.test(l[t])){l[t]=l[t]<=0?0:Math.min(l[t],q);
}if(!s&&e.queue){if(p!=l[t]){j(e.onAfterFirst);}delete l[t];}});j(e.onAfter);function j(g){h.animate(l,f,e.easing,g&&function(){g.call(this,d,e);
});}}).end();};c.max=function(g,k){var n=k=="x"?"Width":"Height",j="scroll"+n;if(!b(g).is("html,body")){return g[j]-b(g)[n.toLowerCase()]();
}var f="client"+n,o=g.ownerDocument.documentElement,d=g.ownerDocument.body;return Math.max(o[j],d[j])-Math.min(o[f],d[f]);
};function a(d){return typeof d=="object"?d:{top:d,left:d};}})(jQuery);
Date.CultureInfo={name:"en-US",englishName:"English (United States)",nativeName:"English (United States)",dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],abbreviatedDayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],shortestDayNames:["Su","Mo","Tu","We","Th","Fr","Sa"],firstLetterDayNames:["S","M","T","W","T","F","S"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],abbreviatedMonthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],amDesignator:"AM",pmDesignator:"PM",firstDayOfWeek:0,twoDigitYearMax:2029,dateElementOrder:"mdy",formatPatterns:{shortDate:"M/d/yyyy",longDate:"dddd, MMMM dd, yyyy",shortTime:"h:mm tt",longTime:"h:mm:ss tt",fullDateTime:"dddd, MMMM dd, yyyy h:mm:ss tt",sortableDateTime:"yyyy-MM-ddTHH:mm:ss",universalSortableDateTime:"yyyy-MM-dd HH:mm:ssZ",rfc1123:"ddd, dd MMM yyyy HH:mm:ss GMT",monthDay:"MMMM dd",yearMonth:"MMMM, yyyy"},regexPatterns:{jan:/^jan(uary)?/i,feb:/^feb(ruary)?/i,mar:/^mar(ch)?/i,apr:/^apr(il)?/i,may:/^may/i,jun:/^jun(e)?/i,jul:/^jul(y)?/i,aug:/^aug(ust)?/i,sep:/^sep(t(ember)?)?/i,oct:/^oct(ober)?/i,nov:/^nov(ember)?/i,dec:/^dec(ember)?/i,sun:/^su(n(day)?)?/i,mon:/^mo(n(day)?)?/i,tue:/^tu(e(s(day)?)?)?/i,wed:/^we(d(nesday)?)?/i,thu:/^th(u(r(s(day)?)?)?)?/i,fri:/^fr(i(day)?)?/i,sat:/^sa(t(urday)?)?/i,future:/^next/i,past:/^last|past|prev(ious)?/i,add:/^(\+|after|from)/i,subtract:/^(\-|before|ago)/i,yesterday:/^yesterday/i,today:/^t(oday)?/i,tomorrow:/^tomorrow/i,now:/^n(ow)?/i,millisecond:/^ms|milli(second)?s?/i,second:/^sec(ond)?s?/i,minute:/^min(ute)?s?/i,hour:/^h(ou)?rs?/i,week:/^w(ee)?k/i,month:/^m(o(nth)?s?)?/i,day:/^d(ays?)?/i,year:/^y((ea)?rs?)?/i,shortMeridian:/^(a|p)/i,longMeridian:/^(a\.?m?\.?|p\.?m?\.?)/i,timezone:/^((e(s|d)t|c(s|d)t|m(s|d)t|p(s|d)t)|((gmt)?\s*(\+|\-)\s*\d\d\d\d?)|gmt)/i,ordinalSuffix:/^\s*(st|nd|rd|th)/i,timeContext:/^\s*(\:|a|p)/i},abbreviatedTimeZoneStandard:{GMT:"-000",EST:"-0400",CST:"-0500",MST:"-0600",PST:"-0700"},abbreviatedTimeZoneDST:{GMT:"-000",EDT:"-0500",CDT:"-0600",MDT:"-0700",PDT:"-0800"}};
Date.getMonthNumberFromName=function(b){var e=Date.CultureInfo.monthNames,a=Date.CultureInfo.abbreviatedMonthNames,c=b.toLowerCase();
for(var d=0;d<e.length;d++){if(e[d].toLowerCase()==c||a[d].toLowerCase()==c){return d;
}}return -1;};Date.getDayNumberFromName=function(b){var f=Date.CultureInfo.dayNames,a=Date.CultureInfo.abbreviatedDayNames,c=Date.CultureInfo.shortestDayNames,d=b.toLowerCase();
for(var e=0;e<f.length;e++){if(f[e].toLowerCase()==d||a[e].toLowerCase()==d){return e;
}}return -1;};Date.isLeapYear=function(a){return(((a%4===0)&&(a%100!==0))||(a%400===0));
};Date.getDaysInMonth=function(b,a){return[31,(Date.isLeapYear(b)?29:28),31,30,31,30,31,31,30,31,30,31][a];
};Date.getTimezoneOffset=function(a,b){return(b||false)?Date.CultureInfo.abbreviatedTimeZoneDST[a.toUpperCase()]:Date.CultureInfo.abbreviatedTimeZoneStandard[a.toUpperCase()];
};Date.getTimezoneAbbreviation=function(c,d){var a=(d||false)?Date.CultureInfo.abbreviatedTimeZoneDST:Date.CultureInfo.abbreviatedTimeZoneStandard,b;
for(b in a){if(a[b]===c){return b;}}return null;};Date.prototype.clone=function(){return new Date(this.getTime());
};Date.prototype.compareTo=function(a){if(isNaN(this)){throw new Error(this);}if(a instanceof Date&&!isNaN(a)){return(this>a)?1:(this<a)?-1:0;
}else{throw new TypeError(a);}};Date.prototype.equals=function(a){return(this.compareTo(a)===0);
};Date.prototype.between=function(b,c){var a=this.getTime();return a>=b.getTime()&&a<=c.getTime();
};Date.prototype.addMilliseconds=function(a){this.setMilliseconds(this.getMilliseconds()+a);
return this;};Date.prototype.addSeconds=function(a){return this.addMilliseconds(a*1000);
};Date.prototype.addMinutes=function(a){return this.addMilliseconds(a*60000);};Date.prototype.addHours=function(a){return this.addMilliseconds(a*3600000);
};Date.prototype.addDays=function(a){return this.addMilliseconds(a*86400000);};Date.prototype.addWeeks=function(a){return this.addMilliseconds(a*604800000);
};Date.prototype.addMonths=function(a){var b=this.getDate();this.setDate(1);this.setMonth(this.getMonth()+a);
this.setDate(Math.min(b,this.getDaysInMonth()));return this;};Date.prototype.addYears=function(a){return this.addMonths(a*12);
};Date.prototype.add=function(b){if(typeof b=="number"){this._orient=b;return this;
}var a=b;if(a.millisecond||a.milliseconds){this.addMilliseconds(a.millisecond||a.milliseconds);
}if(a.second||a.seconds){this.addSeconds(a.second||a.seconds);}if(a.minute||a.minutes){this.addMinutes(a.minute||a.minutes);
}if(a.hour||a.hours){this.addHours(a.hour||a.hours);}if(a.month||a.months){this.addMonths(a.month||a.months);
}if(a.year||a.years){this.addYears(a.year||a.years);}if(a.day||a.days){this.addDays(a.day||a.days);
}return this;};Date._validate=function(a,b,d,c){if(typeof a!="number"){throw new TypeError(a+" is not a Number.");
}else{if(a<b||a>d){throw new RangeError(a+" is not a valid value for "+c+".");}}return true;
};Date.validateMillisecond=function(a){return Date._validate(a,0,999,"milliseconds");
};Date.validateSecond=function(a){return Date._validate(a,0,59,"seconds");};Date.validateMinute=function(a){return Date._validate(a,0,59,"minutes");
};Date.validateHour=function(a){return Date._validate(a,0,23,"hours");};Date.validateDay=function(a,c,b){return Date._validate(a,1,Date.getDaysInMonth(c,b),"days");
};Date.validateMonth=function(a){return Date._validate(a,0,11,"months");};Date.validateYear=function(a){return Date._validate(a,1,9999,"seconds");
};Date.prototype.set=function(b){var a=b;if(!a.millisecond&&a.millisecond!==0){a.millisecond=-1;
}if(!a.second&&a.second!==0){a.second=-1;}if(!a.minute&&a.minute!==0){a.minute=-1;
}if(!a.hour&&a.hour!==0){a.hour=-1;}if(!a.day&&a.day!==0){a.day=-1;}if(!a.month&&a.month!==0){a.month=-1;
}if(!a.year&&a.year!==0){a.year=-1;}if(a.millisecond!=-1&&Date.validateMillisecond(a.millisecond)){this.addMilliseconds(a.millisecond-this.getMilliseconds());
}if(a.second!=-1&&Date.validateSecond(a.second)){this.addSeconds(a.second-this.getSeconds());
}if(a.minute!=-1&&Date.validateMinute(a.minute)){this.addMinutes(a.minute-this.getMinutes());
}if(a.hour!=-1&&Date.validateHour(a.hour)){this.addHours(a.hour-this.getHours());
}if(a.month!==-1&&Date.validateMonth(a.month)){this.addMonths(a.month-this.getMonth());
}if(a.year!=-1&&Date.validateYear(a.year)){this.addYears(a.year-this.getFullYear());
}if(a.day!=-1&&Date.validateDay(a.day,this.getFullYear(),this.getMonth())){this.addDays(a.day-this.getDate());
}if(a.timezone){this.setTimezone(a.timezone);}if(a.timezoneOffset){this.setTimezoneOffset(a.timezoneOffset);
}return this;};Date.prototype.clearTime=function(){this.setHours(0);this.setMinutes(0);
this.setSeconds(0);this.setMilliseconds(0);return this;};Date.prototype.isLeapYear=function(){var a=this.getFullYear();
return(((a%4===0)&&(a%100!==0))||(a%400===0));};Date.prototype.isWeekday=function(){return !(this.is().sat()||this.is().sun());
};Date.prototype.getDaysInMonth=function(){return Date.getDaysInMonth(this.getFullYear(),this.getMonth());
};Date.prototype.moveToFirstDayOfMonth=function(){return this.set({day:1});};Date.prototype.moveToLastDayOfMonth=function(){return this.set({day:this.getDaysInMonth()});
};Date.prototype.moveToDayOfWeek=function(c,a){var b=(c-this.getDay()+7*(a||+1))%7;
return this.addDays((b===0)?b+=7*(a||+1):b);};Date.prototype.moveToMonth=function(b,a){var c=(b-this.getMonth()+12*(a||+1))%12;
return this.addMonths((c===0)?c+=12*(a||+1):c);};Date.prototype.getDayOfYear=function(){return Math.floor((this-new Date(this.getFullYear(),0,1))/86400000);
};Date.prototype.getWeekOfYear=function(i){var c=this.getFullYear(),a=this.getMonth(),f=this.getDate();
var e=i||Date.CultureInfo.firstDayOfWeek;var j=7+1-new Date(c,0,1).getDay();if(j==8){j=1;
}var h=((Date.UTC(c,a,f,0,0,0)-Date.UTC(c,0,1,0,0,0))/86400000)+1;var g=Math.floor((h-j+7)/7);
if(g===e){c--;var b=7+1-new Date(c,0,1).getDay();if(b==2||b==8){g=53;}else{g=52;}}return g;
};Date.prototype.isDST=function(){console.log("isDST");return this.toString().match(/(E|C|M|P)(S|D)T/)[2]=="D";
};Date.prototype.getTimezone=function(){return Date.getTimezoneAbbreviation(this.getUTCOffset,this.isDST());
};Date.prototype.setTimezoneOffset=function(b){var c=this.getTimezoneOffset(),a=Number(b)*-6/10;
this.addMinutes(a-c);return this;};Date.prototype.setTimezone=function(a){return this.setTimezoneOffset(Date.getTimezoneOffset(a));
};Date.prototype.getUTCOffset=function(){var b=this.getTimezoneOffset()*-10/6,a;if(b<0){a=(b-10000).toString();
return a[0]+a.substr(2);}else{a=(b+10000).toString();return"+"+a.substr(1);}};Date.prototype.getDayName=function(a){return a?Date.CultureInfo.abbreviatedDayNames[this.getDay()]:Date.CultureInfo.dayNames[this.getDay()];
};Date.prototype.getMonthName=function(a){return a?Date.CultureInfo.abbreviatedMonthNames[this.getMonth()]:Date.CultureInfo.monthNames[this.getMonth()];
};Date.prototype._toString=Date.prototype.toString;Date.prototype.toString=function(a){var b=this;
var c=function c(d){return(d.toString().length==1)?"0"+d:d;};return a?a.replace(/dd?d?d?|MM?M?M?|yy?y?y?|hh?|HH?|mm?|ss?|tt?|zz?z?/g,function(d){switch(d){case"hh":return c(b.getHours()<13?b.getHours():(b.getHours()-12));
case"h":return b.getHours()<13?b.getHours():(b.getHours()-12);case"HH":return c(b.getHours());
case"H":return b.getHours();case"mm":return c(b.getMinutes());case"m":return b.getMinutes();
case"ss":return c(b.getSeconds());case"s":return b.getSeconds();case"yyyy":return b.getFullYear();
case"yy":return b.getFullYear().toString().substring(2,4);case"dddd":return b.getDayName();
case"ddd":return b.getDayName(true);case"dd":return c(b.getDate());case"d":return b.getDate().toString();
case"MMMM":return b.getMonthName();case"MMM":return b.getMonthName(true);case"MM":return c((b.getMonth()+1));
case"M":return b.getMonth()+1;case"t":return b.getHours()<12?Date.CultureInfo.amDesignator.substring(0,1):Date.CultureInfo.pmDesignator.substring(0,1);
case"tt":return b.getHours()<12?Date.CultureInfo.amDesignator:Date.CultureInfo.pmDesignator;
case"zzz":case"zz":case"z":return"";}}):this._toString();};Date.now=function(){return new Date();
};Date.today=function(){return Date.now().clearTime();};Date.prototype._orient=+1;
Date.prototype.next=function(){this._orient=+1;return this;};Date.prototype.last=Date.prototype.prev=Date.prototype.previous=function(){this._orient=-1;
return this;};Date.prototype._is=false;Date.prototype.is=function(){this._is=true;
return this;};Number.prototype._dateElement="day";Number.prototype.fromNow=function(){var a={};
a[this._dateElement]=this;return Date.now().add(a);};Number.prototype.ago=function(){var a={};
a[this._dateElement]=this*-1;return Date.now().add(a);};(function(){var n=Date.prototype,h=Number.prototype;
var l=("sunday monday tuesday wednesday thursday friday saturday").split(/\s/),d=("january february march april may june july august september october november december").split(/\s/),m=("Millisecond Second Minute Hour Day Week Month Year").split(/\s/),p;
var e=function(i){return function(){if(this._is){this._is=false;return this.getDay()==i;
}return this.moveToDayOfWeek(i,this._orient);};};for(var a=0;a<l.length;a++){n[l[a]]=n[l[a].substring(0,3)]=e(a);
}var g=function(i){return function(){if(this._is){this._is=false;return this.getMonth()===i;
}return this.moveToMonth(i,this._orient);};};for(var b=0;b<d.length;b++){n[d[b]]=n[d[b].substring(0,3)]=g(b);
}var f=function(i){return function(){if(i.substring(i.length-1)!="s"){i+="s";}return this["add"+i](this._orient);
};};var o=function(i){return function(){this._dateElement=i;return this;};};for(var c=0;
c<m.length;c++){p=m[c].toLowerCase();n[p]=n[p+"s"]=f(m[c]);h[p]=h[p+"s"]=o(p);}}());
Date.prototype.toJSONString=function(){return this.toString("yyyy-MM-ddThh:mm:ssZ");
};Date.prototype.toShortDateString=function(){return this.toString(Date.CultureInfo.formatPatterns.shortDatePattern);
};Date.prototype.toLongDateString=function(){return this.toString(Date.CultureInfo.formatPatterns.longDatePattern);
};Date.prototype.toShortTimeString=function(){return this.toString(Date.CultureInfo.formatPatterns.shortTimePattern);
};Date.prototype.toLongTimeString=function(){return this.toString(Date.CultureInfo.formatPatterns.longTimePattern);
};Date.prototype.getOrdinal=function(){switch(this.getDate()){case 1:case 21:case 31:return"st";
case 2:case 22:return"nd";case 3:case 23:return"rd";default:return"th";}};(function(){Date.Parsing={Exception:function(i){this.message="Parse error at '"+i.substring(0,10)+" ...'";
}};var f=Date.Parsing;var c=f.Operators={rtoken:function(i){return function(j){var k=j.match(i);
if(k){return([k[0],j.substring(k[0].length)]);}else{throw new f.Exception(j);}};},token:function(i){return function(j){return c.rtoken(new RegExp("^s*"+j+"s*"))(j);
};},stoken:function(i){return c.rtoken(new RegExp("^"+i));},until:function(i){return function(j){var m=[],k=null;
while(j.length){try{k=i.call(this,j);}catch(l){m.push(k[0]);j=k[1];continue;}break;
}return[m,j];};},many:function(i){return function(k){var l=[],j=null;while(k.length){try{j=i.call(this,k);
}catch(m){return[l,k];}l.push(j[0]);k=j[1];}return[l,k];};},optional:function(i){return function(k){var j=null;
try{j=i.call(this,k);}catch(l){return[null,k];}return[j[0],j[1]];};},not:function(i){return function(j){try{i.call(this,j);
}catch(k){return[null,j];}throw new f.Exception(j);};},ignore:function(i){return i?function(k){var j=null;
j=i.call(this,k);return[null,j[1]];}:null;},product:function(){var j=arguments[0],k=Array.prototype.slice.call(arguments,1),l=[];
for(var m=0;m<j.length;m++){l.push(c.each(j[m],k));}return l;},cache:function(k){var j={},i=null;
return function(l){try{i=j[l]=(j[l]||k.call(this,l));}catch(m){i=j[l]=m;}if(i instanceof f.Exception){throw i;
}else{return i;}};},any:function(){var i=arguments;return function(k){var j=null;
for(var l=0;l<i.length;l++){if(i[l]==null){continue;}try{j=(i[l].call(this,k));}catch(m){j=null;
}if(j){return j;}}throw new f.Exception(k);};},each:function(){var i=arguments;return function(k){var l=[],j=null;
for(var m=0;m<i.length;m++){if(i[m]==null){continue;}try{j=(i[m].call(this,k));}catch(n){throw new f.Exception(k);
}l.push(j[0]);k=j[1];}return[l,k];};},all:function(){var i=arguments,j=j;return j.each(j.optional(i));
},sequence:function(i,k,j){k=k||c.rtoken(/^\s*/);j=j||null;if(i.length==1){return i[0];
}return function(u){var t=null,p=null;var v=[];for(var l=0;l<i.length;l++){try{t=i[l].call(this,u);
}catch(m){break;}v.push(t[0]);try{p=k.call(this,t[1]);}catch(o){p=null;break;}u=p[1];
}if(!t){throw new f.Exception(u);}if(p){throw new f.Exception(p[1]);}if(j){try{t=j.call(this,t[1]);
}catch(n){throw new f.Exception(t[1]);}}return[v,(t?t[1]:u)];};},between:function(j,l,i){i=i||j;
var k=c.each(c.ignore(j),l,c.ignore(i));return function(m){var n=k.call(this,m);return[[n[0][0],r[0][2]],n[1]];
};},list:function(k,j,i){j=j||c.rtoken(/^\s*/);i=i||null;return(k instanceof Array?c.each(c.product(k.slice(0,-1),c.ignore(j)),k.slice(-1),c.ignore(i)):c.each(c.many(c.each(k,c.ignore(j))),px,c.ignore(i)));
},set:function(i,k,j){k=k||c.rtoken(/^\s*/);j=j||null;return function(A){var z=null,x=null,y=null,u=null,n=[[],A],B=false;
for(var l=0;l<i.length;l++){y=null;x=null;z=null;B=(i.length==1);try{z=i[l].call(this,A);
}catch(v){continue;}u=[[z[0]],z[1]];if(z[1].length>0&&!B){try{y=k.call(this,z[1]);
}catch(o){B=true;}}else{B=true;}if(!B&&y[1].length===0){B=true;}if(!B){var t=[];for(var m=0;
m<i.length;m++){if(l!=m){t.push(i[m]);}}x=c.set(t,k).call(this,y[1]);if(x[0].length>0){u[0]=u[0].concat(x[0]);
u[1]=x[1];}}if(u[1].length<n[1].length){n=u;}if(n[1].length===0){break;}}if(n[0].length===0){return n;
}if(j){try{y=j.call(this,n[1]);}catch(w){throw new f.Exception(n[1]);}n[1]=y[1];}return n;
};},forward:function(i,j){return function(k){return i[j].call(this,k);};},replace:function(j,i){return function(l){var k=j.call(this,l);
return[i,k[1]];};},process:function(j,i){return function(l){var k=j.call(this,l);
return[i.call(this,k[0]),k[1]];};},min:function(i,j){return function(k){var l=j.call(this,k);
if(l[0].length<i){throw new f.Exception(k);}return l;};}};var d=function(i){return function(){var k=null,j=[];
if(arguments.length>1){k=Array.prototype.slice.call(arguments);}else{if(arguments[0] instanceof Array){k=arguments[0];
}}if(k){for(var l=0,m=k.shift();l<m.length;l++){k.unshift(m[l]);j.push(i.apply(null,k));
k.shift();return j;}}else{return i.apply(null,arguments);}};};var g="optional not ignore cache".split(/\s/);
for(var a=0;a<g.length;a++){c[g[a]]=d(c[g[a]]);}var e=function(i){return function(){if(arguments[0] instanceof Array){return i.apply(null,arguments[0]);
}else{return i.apply(null,arguments);}};};var h="each any all".split(/\s/);for(var b=0;
b<h.length;b++){c[h[b]]=e(c[h[b]]);}}());(function(){var i=function(j){var g=[];for(var k=0;
k<j.length;k++){if(j[k] instanceof Array){g=g.concat(i(j[k]));}else{if(j[k]){g.push(j[k]);
}}}return g;};Date.Grammar={};Date.Translator={hour:function(g){return function(){this.hour=Number(g);
};},minute:function(g){return function(){this.minute=Number(g);};},second:function(g){return function(){this.second=Number(g);
};},meridian:function(g){return function(){this.meridian=g.slice(0,1).toLowerCase();
};},timezone:function(g){return function(){var j=g.replace(/[^\d\+\-]/g,"");if(j.length){this.timezoneOffset=Number(j);
}else{this.timezone=g.toLowerCase();}};},day:function(g){var j=g[0];return function(){this.day=Number(j.match(/\d+/)[0]);
};},month:function(g){return function(){this.month=((g.length==3)?Date.getMonthNumberFromName(g):(Number(g)-1));
};},year:function(g){return function(){var j=Number(g);this.year=((g.length>2)?j:(j+(((j+2000)<Date.CultureInfo.twoDigitYearMax)?2000:1900)));
};},rday:function(g){return function(){switch(g){case"yesterday":this.days=-1;break;
case"tomorrow":this.days=1;break;case"today":this.days=0;break;case"now":this.days=0;
this.now=true;break;}};},finishExact:function(j){j=(j instanceof Array)?j:[j];var l=new Date();
this.year=l.getFullYear();this.month=l.getMonth();this.day=1;this.hour=0;this.minute=0;
this.second=0;for(var k=0;k<j.length;k++){if(j[k]){j[k].call(this);}}this.hour=(this.meridian=="p"&&this.hour<13)?this.hour+12:this.hour;
if(this.day>Date.getDaysInMonth(this.year,this.month)){throw new RangeError(this.day+" is not a valid value for days.");
}var g=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second);
if(this.timezone){g.set({timezone:this.timezone});}else{if(this.timezoneOffset){g.set({timezoneOffset:this.timezoneOffset});
}}return g;},finish:function(l){l=(l instanceof Array)?i(l):[l];if(l.length===0){return null;
}for(var g=0;g<l.length;g++){if(typeof l[g]=="function"){l[g].call(this);}}if(this.now){return new Date();
}var p=Date.today();var m=null;var j=!!(this.days!=null||this.orient||this.operator);
if(j){var n,k,o;o=((this.orient=="past"||this.operator=="subtract")?-1:1);if(this.weekday){this.unit="day";
n=(Date.getDayNumberFromName(this.weekday)-p.getDay());k=7;this.days=n?((n+(o*k))%k):(o*k);
}if(this.month){this.unit="month";n=(this.month-p.getMonth());k=12;this.months=n?((n+(o*k))%k):(o*k);
this.month=null;}if(!this.unit){this.unit="day";}if(this[this.unit+"s"]==null||this.operator!=null){if(!this.value){this.value=1;
}if(this.unit=="week"){this.unit="day";this.value=this.value*7;}this[this.unit+"s"]=this.value*o;
}return p.add(this);}else{if(this.meridian&&this.hour){this.hour=(this.hour<13&&this.meridian=="p")?this.hour+12:this.hour;
}if(this.weekday&&!this.day){this.day=(p.addDays((Date.getDayNumberFromName(this.weekday)-p.getDay()))).getDate();
}if(this.month&&!this.day){this.day=1;}return p.set(this);}}};var b=Date.Parsing.Operators,f=Date.Grammar,h=Date.Translator,c;
f.datePartDelimiter=b.rtoken(/^([\s\-\.\,\/\x27]+)/);f.timePartDelimiter=b.stoken(":");
f.whiteSpace=b.rtoken(/^\s*/);f.generalDelimiter=b.rtoken(/^(([\s\,]|at|on)+)/);var d={};
f.ctoken=function(j){var g=d[j];if(!g){var k=Date.CultureInfo.regexPatterns;var m=j.split(/\s+/),l=[];
for(var n=0;n<m.length;n++){l.push(b.replace(b.rtoken(k[m[n]]),m[n]));}g=d[j]=b.any.apply(null,l);
}return g;};f.ctoken2=function(g){return b.rtoken(Date.CultureInfo.regexPatterns[g]);
};f.h=b.cache(b.process(b.rtoken(/^(0[0-9]|1[0-2]|[1-9])/),h.hour));f.hh=b.cache(b.process(b.rtoken(/^(0[0-9]|1[0-2])/),h.hour));
f.H=b.cache(b.process(b.rtoken(/^([0-1][0-9]|2[0-3]|[0-9])/),h.hour));f.HH=b.cache(b.process(b.rtoken(/^([0-1][0-9]|2[0-3])/),h.hour));
f.m=b.cache(b.process(b.rtoken(/^([0-5][0-9]|[0-9])/),h.minute));f.mm=b.cache(b.process(b.rtoken(/^[0-5][0-9]/),h.minute));
f.s=b.cache(b.process(b.rtoken(/^([0-5][0-9]|[0-9])/),h.second));f.ss=b.cache(b.process(b.rtoken(/^[0-5][0-9]/),h.second));
f.hms=b.cache(b.sequence([f.H,f.mm,f.ss],f.timePartDelimiter));f.t=b.cache(b.process(f.ctoken2("shortMeridian"),h.meridian));
f.tt=b.cache(b.process(f.ctoken2("longMeridian"),h.meridian));f.z=b.cache(b.process(b.rtoken(/^(\+|\-)?\s*\d\d\d\d?/),h.timezone));
f.zz=b.cache(b.process(b.rtoken(/^(\+|\-)\s*\d\d\d\d/),h.timezone));f.zzz=b.cache(b.process(f.ctoken2("timezone"),h.timezone));
f.timeSuffix=b.each(b.ignore(f.whiteSpace),b.set([f.tt,f.zzz]));f.time=b.each(b.optional(b.ignore(b.stoken("T"))),f.hms,f.timeSuffix);
f.d=b.cache(b.process(b.each(b.rtoken(/^([0-2]\d|3[0-1]|\d)/),b.optional(f.ctoken2("ordinalSuffix"))),h.day));
f.dd=b.cache(b.process(b.each(b.rtoken(/^([0-2]\d|3[0-1])/),b.optional(f.ctoken2("ordinalSuffix"))),h.day));
f.ddd=f.dddd=b.cache(b.process(f.ctoken("sun mon tue wed thu fri sat"),function(g){return function(){this.weekday=g;
};}));f.M=b.cache(b.process(b.rtoken(/^(1[0-2]|0\d|\d)/),h.month));f.MM=b.cache(b.process(b.rtoken(/^(1[0-2]|0\d)/),h.month));
f.MMM=f.MMMM=b.cache(b.process(f.ctoken("jan feb mar apr may jun jul aug sep oct nov dec"),h.month));
f.y=b.cache(b.process(b.rtoken(/^(\d\d?)/),h.year));f.yy=b.cache(b.process(b.rtoken(/^(\d\d)/),h.year));
f.yyy=b.cache(b.process(b.rtoken(/^(\d\d?\d?\d?)/),h.year));f.yyyy=b.cache(b.process(b.rtoken(/^(\d\d\d\d)/),h.year));
c=function(){return b.each(b.any.apply(null,arguments),b.not(f.ctoken2("timeContext")));
};f.day=c(f.d,f.dd);f.month=c(f.M,f.MMM);f.year=c(f.yyyy,f.yy);f.orientation=b.process(f.ctoken("past future"),function(g){return function(){this.orient=g;
};});f.operator=b.process(f.ctoken("add subtract"),function(g){return function(){this.operator=g;
};});f.rday=b.process(f.ctoken("yesterday tomorrow today now"),h.rday);f.unit=b.process(f.ctoken("minute hour day week month year"),function(g){return function(){this.unit=g;
};});f.value=b.process(b.rtoken(/^\d\d?(st|nd|rd|th)?/),function(g){return function(){this.value=g.replace(/\D/g,"");
};});f.expression=b.set([f.rday,f.operator,f.value,f.unit,f.orientation,f.ddd,f.MMM]);
c=function(){return b.set(arguments,f.datePartDelimiter);};f.mdy=c(f.ddd,f.month,f.day,f.year);
f.ymd=c(f.ddd,f.year,f.month,f.day);f.dmy=c(f.ddd,f.day,f.month,f.year);f.date=function(g){return((f[Date.CultureInfo.dateElementOrder]||f.mdy).call(this,g));
};f.format=b.process(b.many(b.any(b.process(b.rtoken(/^(dd?d?d?|MM?M?M?|yy?y?y?|hh?|HH?|mm?|ss?|tt?|zz?z?)/),function(g){if(f[g]){return f[g];
}else{throw Date.Parsing.Exception(g);}}),b.process(b.rtoken(/^[^dMyhHmstz]+/),function(g){return b.ignore(b.stoken(g));
}))),function(g){return b.process(b.each.apply(null,g),h.finishExact);});var e={};
var a=function(g){return e[g]=(e[g]||f.format(g)[0]);};f.formats=function(g){if(g instanceof Array){var j=[];
for(var k=0;k<g.length;k++){j.push(a(g[k]));}return b.any.apply(null,j);}else{return a(g);
}};f._formats=f.formats(["yyyy-MM-ddTHH:mm:ss","ddd, MMM dd, yyyy H:mm:ss tt","ddd MMM d yyyy HH:mm:ss zzz","d"]);
f._start=b.process(b.set([f.date,f.time,f.expression],f.generalDelimiter,f.whiteSpace),h.finish);
f.start=function(j){try{var g=f._formats.call({},j);if(g[1].length===0){return g;
}}catch(k){}return f._start.call({},j);};}());Date._parse=Date.parse;Date.parse=function(b){var a=null;
if(!b){return null;}try{a=Date.Grammar.start.call({},b);}catch(c){return null;}return((a[1].length===0)?a[0]:null);
};Date.getParseFunction=function(a){var b=Date.Grammar.formats(a);return function(d){var c=null;
try{c=b.call({},d);}catch(f){return null;}return((c[1].length===0)?c[0]:null);};};
Date.parseExact=function(b,a){return Date.getParseFunction(a)(b);};
function fixContentIframeHeight(){var a=parent.document.getElementById("ContentFrame");
if(a!=null&&/\bautoHeight\b/.test(a.className)){setHeight(a);}}function doIframe(){o=document.getElementsByTagName("iframe");
for(i=0;i<o.length;i++){if(/\bautoHeight\b/.test(o[i].className)){setHeight(o[i]);
addEvent(o[i],"load",doIframe);}}}function setHeight(a){if(a.contentDocument){a.height=a.contentDocument.body.offsetHeight;
}else{a.height=a.contentWindow.document.body.scrollHeight;}}function addEvent(d,c,a){if(d.addEventListener){d.addEventListener(c,a,false);
return true;}else{if(d.attachEvent){var b=d.attachEvent("on"+c,a);return b;}else{return false;
}}}if(document.getElementById&&document.createTextNode){addEvent(window,"load",doIframe);
}
(function(a){a.fn.addOption=function(){var c=function(m,r,q,l){var p=document.createElement("option");
p.value=r,p.text=q;var k=m.options;var n=k.length;if(!m.cache){m.cache={};for(var j=0;
j<n;j++){m.cache[k[j].value]=j;}}if(typeof m.cache[r]=="undefined"){m.cache[r]=n;
}m.options[m.cache[r]]=p;if(l){p.selected=true;}};var e=arguments;if(e.length==0){return this;
}var h=true;var b=false;var f,g,d;if(typeof(e[0])=="object"){b=true;f=e[0];}if(e.length>=2){if(typeof(e[1])=="boolean"){h=e[1];
}else{if(typeof(e[2])=="boolean"){h=e[2];}}if(!b){g=e[0];d=e[1];}}this.each(function(){if(this.nodeName.toLowerCase()!="select"){return;
}if(b){for(var i in f){c(this,i,f[i],h);}}else{c(this,g,d,h);}});return this;};a.fn.ajaxAddOption=function(d,b,c,e,f){if(typeof(d)!="string"){return this;
}if(typeof(b)!="object"){b={};}if(typeof(c)!="boolean"){c=true;}this.each(function(){var g=this;
a.getJSON(d,b,function(h){a(g).addOption(h,c);if(typeof e=="function"){if(typeof f=="object"){e.apply(g,f);
}else{e.call(g);}}});});return this;};a.fn.removeOption=function(){var c=arguments;
if(c.length==0){return this;}var f=typeof(c[0]);var b,g;if(f=="string"||f=="object"||f=="function"){b=c[0];
if(b.constructor==Array){var d=b.length;for(var e=0;e<d;e++){this.removeOption(b[e],c[1]);
}return this;}}else{if(f=="number"){g=c[0];}else{return this;}}this.each(function(){if(this.nodeName.toLowerCase()!="select"){return;
}if(this.cache){this.cache=null;}var j=false;var h=this.options;if(!!b){var l=h.length;
for(var k=l-1;k>=0;k--){if(b.constructor==RegExp){if(h[k].value.match(b)){j=true;
}}else{if(h[k].value==b){j=true;}}if(j&&c[1]===true){j=h[k].selected;}if(j){h[k]=null;
}j=false;}}else{if(c[1]===true){j=h[g].selected;}else{j=true;}if(j){this.remove(g);
}}});return this;};a.fn.sortOptions=function(c){var d=a(this).selectedValues();var b=typeof(c)=="undefined"?true:!!c;
this.each(function(){if(this.nodeName.toLowerCase()!="select"){return;}var e=this.options;
var f=e.length;var h=[];for(var g=0;g<f;g++){h[g]={v:e[g].value,t:e[g].text};}h.sort(function(i,j){o1t=i.t.toLowerCase(),o2t=j.t.toLowerCase();
if(o1t==o2t){return 0;}if(b){return o1t<o2t?-1:1;}else{return o1t>o2t?-1:1;}});for(var g=0;
g<f;g++){e[g].text=h[g].t;e[g].value=h[g].v;}}).selectOptions(d,true);return this;
};a.fn.selectOptions=function(b,e){var f=b;var d=typeof(b);if(d=="object"&&f.constructor==Array){var h=this;
a.each(f,function(){h.selectOptions(this,e);});}var g=e||false;if(d!="string"&&d!="function"&&d!="object"){return this;
}this.each(function(){if(this.nodeName.toLowerCase()!="select"){return this;}var c=this.options;
var j=c.length;for(var k=0;k<j;k++){if(f.constructor==RegExp){if(c[k].value.match(f)){c[k].selected=true;
}else{if(g){c[k].selected=false;}}}else{if(c[k].value==f){c[k].selected=true;}else{if(g){c[k].selected=false;
}}}}});return this;};a.fn.copyOptions=function(c,b){var d=b||"selected";if(a(c).size()==0){return this;
}this.each(function(){if(this.nodeName.toLowerCase()!="select"){return this;}var e=this.options;
var f=e.length;for(var g=0;g<f;g++){if(d=="all"||(d=="selected"&&e[g].selected)){a(c).addOption(e[g].value,e[g].text);
}}});return this;};a.fn.containsOption=function(c,b){var e=false;var g=c;var d=typeof(g);
var f=typeof(b);if(d!="string"&&d!="function"&&d!="object"){return f=="function"?this:e;
}this.each(function(){if(this.nodeName.toLowerCase()!="select"){return this;}if(e&&f!="function"){return false;
}var h=this.options;var j=h.length;for(var k=0;k<j;k++){if(g.constructor==RegExp){if(h[k].value.match(g)){e=true;
if(f=="function"){b.call(h[k],k);}}}else{if(h[k].value==g){e=true;if(f=="function"){b.call(h[k],k);
}}}}});return f=="function"?this:e;};a.fn.selectedValues=function(){var b=[];this.selectedOptions().each(function(){b[b.length]=this.value;
});return b;};a.fn.selectedTexts=function(){var b=[];this.selectedOptions().each(function(){b[b.length]=this.text;
});return b;};a.fn.selectedOptions=function(){return this.find("option:selected");
};})(jQuery);
