// /JavaScript/JQuery/jquery-1.2.6.min.js (function(){var _jQuery=window.jQuery,_$=window.$;var jQuery=window.jQuery=window.$=function(selector,context){return new jQuery.fn.init(selector,context);};var quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/,isSimple=/^.[^:#\[\.]*$/,undefined;jQuery.fn=jQuery.prototype={init:function(selector,context){selector=selector||document;if(selector.nodeType){this[0]=selector;this.length=1;return this;}if(typeof selector=="string"){var match=quickExpr.exec(selector);if(match&&(match[1]||!context)){if(match[1])selector=jQuery.clean([match[1]],context);else{var elem=document.getElementById(match[3]);if(elem){if(elem.id!=match[3])return jQuery().find(selector);return jQuery(elem);}selector=[];}}else return jQuery(context).find(selector);}else if(jQuery.isFunction(selector))return jQuery(document)[jQuery.fn.ready?"ready":"load"](selector);return this.setArray(jQuery.makeArray(selector));},jquery:"1.2.6",size:function(){return this.length;},length:0,get:function(num){return num==undefined?jQuery.makeArray(this):this[num];},pushStack:function(elems){var ret=jQuery(elems);ret.prevObject=this;return ret;},setArray:function(elems){this.length=0;Array.prototype.push.apply(this,elems);return this;},each:function(callback,args){return jQuery.each(this,callback,args);},index:function(elem){var ret=-1;return jQuery.inArray(elem&&elem.jquery?elem[0]:elem,this);},attr:function(name,value,type){var options=name;if(name.constructor==String)if(value===undefined)return this[0]&&jQuery[type||"attr"](this[0],name);else{options={};options[name]=value;}return this.each(function(i){for(name in options)jQuery.attr(type?this.style:this,name,jQuery.prop(this,options[name],type,i,name));});},css:function(key,value){if((key=='width'||key=='height')&&parseFloat(value)<0)value=undefined;return this.attr(key,value,"curCSS");},text:function(text){if(typeof text!="object"&&text!=null)return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(text));var ret="";jQuery.each(text||this,function(){jQuery.each(this.childNodes,function(){if(this.nodeType!=8)ret+=this.nodeType!=1?this.nodeValue:jQuery.fn.text([this]);});});return ret;},wrapAll:function(html){if(this[0])jQuery(html,this[0].ownerDocument).clone().insertBefore(this[0]).map(function(){var elem=this;while(elem.firstChild)elem=elem.firstChild;return elem;}).append(this);return this;},wrapInner:function(html){return this.each(function(){jQuery(this).contents().wrapAll(html);});},wrap:function(html){return this.each(function(){jQuery(this).wrapAll(html);});},append:function(){return this.domManip(arguments,true,false,function(elem){if(this.nodeType==1)this.appendChild(elem);});},prepend:function(){return this.domManip(arguments,true,true,function(elem){if(this.nodeType==1)this.insertBefore(elem,this.firstChild);});},before:function(){return this.domManip(arguments,false,false,function(elem){this.parentNode.insertBefore(elem,this);});},after:function(){return this.domManip(arguments,false,true,function(elem){this.parentNode.insertBefore(elem,this.nextSibling);});},end:function(){return this.prevObject||jQuery([]);},find:function(selector){var elems=jQuery.map(this,function(elem){return jQuery.find(selector,elem);});return this.pushStack(/[^+>] [^+>]/.test(selector)||selector.indexOf("..")>-1?jQuery.unique(elems):elems);},clone:function(events){var ret=this.map(function(){if(jQuery.browser.msie&&!jQuery.isXMLDoc(this)){var clone=this.cloneNode(true),container=document.createElement("div");container.appendChild(clone);return jQuery.clean([container.innerHTML])[0];}else return this.cloneNode(true);});var clone=ret.find("*").andSelf().each(function(){if(this[expando]!=undefined)this[expando]=null;});if(events===true)this.find("*").andSelf().each(function(i){if(this.nodeType==3)return;var events=jQuery.data(this,"events");for(var type in events)for(var handler in events[type])jQuery.event.add(clone[i],type,events[type][handler],events[type][handler].data);});return ret;},filter:function(selector){return this.pushStack(jQuery.isFunction(selector)&&jQuery.grep(this,function(elem,i){return selector.call(elem,i);})||jQuery.multiFilter(selector,this));},not:function(selector){if(selector.constructor==String)if(isSimple.test(selector))return this.pushStack(jQuery.multiFilter(selector,this,true));else selector=jQuery.multiFilter(selector,this);var isArrayLike=selector.length&&selector[selector.length-1]!==undefined&&!selector.nodeType;return this.filter(function(){return isArrayLike?jQuery.inArray(this,selector)<0:this!=selector;});},add:function(selector){return this.pushStack(jQuery.unique(jQuery.merge(this.get(),typeof selector=='string'?jQuery(selector):jQuery.makeArray(selector))));},is:function(selector){return!!selector&&jQuery.multiFilter(selector,this).length>0;},hasClass:function(selector){return this.is("."+selector);},val:function(value){if(value==undefined){if(this.length){var elem=this[0];if(jQuery.nodeName(elem,"select")){var index=elem.selectedIndex,values=[],options=elem.options,one=elem.type=="select-one";if(index<0)return null;for(var i=one?index:0,max=one?index+1:options.length;i=0||jQuery.inArray(this.name,value)>=0);else if(jQuery.nodeName(this,"select")){var values=jQuery.makeArray(value);jQuery("option",this).each(function(){this.selected=(jQuery.inArray(this.value,values)>=0||jQuery.inArray(this.text,values)>=0);});if(!values.length)this.selectedIndex=-1;}else this.value=value;});},html:function(value){return value==undefined?(this[0]?this[0].innerHTML:null):this.empty().append(value);},replaceWith:function(value){return this.after(value).remove();},eq:function(i){return this.slice(i,i+1);},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments));},map:function(callback){return this.pushStack(jQuery.map(this,function(elem,i){return callback.call(elem,i,elem);}));},andSelf:function(){return this.add(this.prevObject);},data:function(key,value){var parts=key.split(".");parts[1]=parts[1]?"."+parts[1]:"";if(value===undefined){var data=this.triggerHandler("getData"+parts[1]+"!",[parts[0]]);if(data===undefined&&this.length)data=jQuery.data(this[0],key);return data===undefined&&parts[1]?this.data(parts[0]):data;}else return this.trigger("setData"+parts[1]+"!",[parts[0],value]).each(function(){jQuery.data(this,key,value);});},removeData:function(key){return this.each(function(){jQuery.removeData(this,key);});},domManip:function(args,table,reverse,callback){var clone=this.length>1,elems;return this.each(function(){if(!elems){elems=jQuery.clean(args,this.ownerDocument);if(reverse)elems.reverse();}var obj=this;if(table&&jQuery.nodeName(this,"table")&&jQuery.nodeName(elems[0],"tr"))obj=this.getElementsByTagName("tbody")[0]||this.appendChild(this.ownerDocument.createElement("tbody"));var scripts=jQuery([]);jQuery.each(elems,function(){var elem=clone?jQuery(this).clone(true)[0]:this;if(jQuery.nodeName(elem,"script"))scripts=scripts.add(elem);else{if(elem.nodeType==1)scripts=scripts.add(jQuery("script",elem).remove());callback.call(obj,elem);}});scripts.each(evalScript);});}};jQuery.fn.init.prototype=jQuery.fn;function evalScript(i,elem){if(elem.src)jQuery.ajax({url:elem.src,async:false,dataType:"script"});else jQuery.globalEval(elem.text||elem.textContent||elem.innerHTML||"");if(elem.parentNode)elem.parentNode.removeChild(elem);}function now(){return+new Date;}jQuery.extend=jQuery.fn.extend=function(){var target=arguments[0]||{},i=1,length=arguments.length,deep=false,options;if(target.constructor==Boolean){deep=target;target=arguments[1]||{};i=2;}if(typeof target!="object"&&typeof target!="function")target={};if(length==i){target=this;--i;}for(;i-1;}},swap:function(elem,options,callback){var old={};for(var name in options){old[name]=elem.style[name];elem.style[name]=options[name];}callback.call(elem);for(var name in options)elem.style[name]=old[name];},css:function(elem,name,force){if(name=="width"||name=="height"){var val,props={position:"absolute",visibility:"hidden",display:"block"},which=name=="width"?["Left","Right"]:["Top","Bottom"];function getWH(){val=name=="width"?elem.offsetWidth:elem.offsetHeight;var padding=0,border=0;jQuery.each(which,function(){padding+=parseFloat(jQuery.curCSS(elem,"padding"+this,true))||0;border+=parseFloat(jQuery.curCSS(elem,"border"+this+"Width",true))||0;});val-=Math.round(padding+border);}if(jQuery(elem).is(":visible"))getWH();else jQuery.swap(elem,props,getWH);return Math.max(0,val);}return jQuery.curCSS(elem,name,force);},curCSS:function(elem,name,force){var ret,style=elem.style;function color(elem){if(!jQuery.browser.safari)return false;var ret=defaultView.getComputedStyle(elem,null);return!ret||ret.getPropertyValue("color")=="";}if(name=="opacity"&&jQuery.browser.msie){ret=jQuery.attr(style,"opacity");return ret==""?"1":ret;}if(jQuery.browser.opera&&name=="display"){var save=style.outline;style.outline="0 solid black";style.outline=save;}if(name.match(/float/i))name=styleFloat;if(!force&&style&&style[name])ret=style[name];else if(defaultView.getComputedStyle){if(name.match(/float/i))name="float";name=name.replace(/([A-Z])/g,"-$1").toLowerCase();var computedStyle=defaultView.getComputedStyle(elem,null);if(computedStyle&&!color(elem))ret=computedStyle.getPropertyValue(name);else{var swap=[],stack=[],a=elem,i=0;for(;a&&color(a);a=a.parentNode)stack.unshift(a);for(;i]*?)\/>/g,function(all,front,tag){return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?all:front+">";});var tags=jQuery.trim(elem).toLowerCase(),div=context.createElement("div");var wrap=!tags.indexOf("",""]||!tags.indexOf("",""]||tags.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"","
"]||!tags.indexOf("",""]||(!tags.indexOf("",""]||!tags.indexOf("",""]||jQuery.browser.msie&&[1,"div
","
"]||[0,"",""];div.innerHTML=wrap[1]+elem+wrap[2];while(wrap[0]--)div=div.lastChild;if(jQuery.browser.msie){var tbody=!tags.indexOf(""&&tags.indexOf("=0;--j)if(jQuery.nodeName(tbody[j],"tbody")&&!tbody[j].childNodes.length)tbody[j].parentNode.removeChild(tbody[j]);if(/^\s/.test(elem))div.insertBefore(context.createTextNode(elem.match(/^\s*/)[0]),div.firstChild);}elem=jQuery.makeArray(div.childNodes);}if(elem.length===0&&(!jQuery.nodeName(elem,"form")&&!jQuery.nodeName(elem,"select")))return;if(elem[0]==undefined||jQuery.nodeName(elem,"form")||elem.options)ret.push(elem);else ret=jQuery.merge(ret,elem);});return ret;},attr:function(elem,name,value){if(!elem||elem.nodeType==3||elem.nodeType==8)return undefined;var notxml=!jQuery.isXMLDoc(elem),set=value!==undefined,msie=jQuery.browser.msie;name=notxml&&jQuery.props[name]||name;if(elem.tagName){var special=/href|src|style/.test(name);if(name=="selected"&&jQuery.browser.safari)elem.parentNode.selectedIndex;if(name in elem&¬xml&&!special){if(set){if(name=="type"&&jQuery.nodeName(elem,"input")&&elem.parentNode)throw"type property can't be changed";elem[name]=value;}if(jQuery.nodeName(elem,"form")&&elem.getAttributeNode(name))return elem.getAttributeNode(name).nodeValue;return elem[name];}if(msie&¬xml&&name=="style")return jQuery.attr(elem.style,"cssText",value);if(set)elem.setAttribute(name,""+value);var attr=msie&¬xml&&special?elem.getAttribute(name,2):elem.getAttribute(name);return attr===null?undefined:attr;}if(msie&&name=="opacity"){if(set){elem.zoom=1;elem.filter=(elem.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(value)+''=="NaN"?"":"alpha(opacity="+value*100+")");}return elem.filter&&elem.filter.indexOf("opacity=")>=0?(parseFloat(elem.filter.match(/opacity=([^)]*)/)[1])/100)+'':"";}name=name.replace(/-([a-z])/ig,function(all,letter){return letter.toUpperCase();});if(set)elem[name]=value;return elem[name];},trim:function(text){return(text||"").replace(/^\s+|\s+$/g,"");},makeArray:function(array){var ret=[];if(array!=null){var i=array.length;if(i==null||array.split||array.setInterval||array.call)ret[0]=array;else while(i)ret[--i]=array[i];}return ret;},inArray:function(elem,array){for(var i=0,length=array.length;i*",this).remove();while(this.firstChild)this.removeChild(this.firstChild);}},function(name,fn){jQuery.fn[name]=function(){return this.each(fn,arguments);};});jQuery.each(["Height","Width"],function(i,name){var type=name.toLowerCase();jQuery.fn[type]=function(size){return this[0]==window?jQuery.browser.opera&&document.body["client"+name]||jQuery.browser.safari&&window["inner"+name]||document.compatMode=="CSS1Compat"&&document.documentElement["client"+name]||document.body["client"+name]:this[0]==document?Math.max(Math.max(document.body["scroll"+name],document.documentElement["scroll"+name]),Math.max(document.body["offset"+name],document.documentElement["offset"+name])):size==undefined?(this.length?jQuery.css(this[0],type):null):this.css(type,size.constructor==String?size:size+"px");};});function num(elem,prop){return elem[0]&&parseInt(jQuery.curCSS(elem[0],prop,true),10)||0;}var chars=jQuery.browser.safari&&parseInt(jQuery.browser.version)<417?"(?:[\\w*_-]|\\\\.)":"(?:[\\w\u0128-\uFFFF*_-]|\\\\.)",quickChild=new RegExp("^>\\s*("+chars+"+)"),quickID=new RegExp("^("+chars+"+)(#)("+chars+"+)"),quickClass=new RegExp("^([#.]?)("+chars+"*)");jQuery.extend({expr:{"":function(a,i,m){return m[2]=="*"||jQuery.nodeName(a,m[2]);},"#":function(a,i,m){return a.getAttribute("id")==m[2];},":":{lt:function(a,i,m){return im[3]-0;},nth:function(a,i,m){return m[3]-0==i;},eq:function(a,i,m){return m[3]-0==i;},first:function(a,i){return i==0;},last:function(a,i,m,r){return i==r.length-1;},even:function(a,i){return i%2==0;},odd:function(a,i){return i%2;},"first-child":function(a){return a.parentNode.getElementsByTagName("*")[0]==a;},"last-child":function(a){return jQuery.nth(a.parentNode.lastChild,1,"previousSibling")==a;},"only-child":function(a){return!jQuery.nth(a.parentNode.lastChild,2,"previousSibling");},parent:function(a){return a.firstChild;},empty:function(a){return!a.firstChild;},contains:function(a,i,m){return(a.textContent||a.innerText||jQuery(a).text()||"").indexOf(m[3])>=0;},visible:function(a){return"hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden";},hidden:function(a){return"hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden";},enabled:function(a){return!a.disabled;},disabled:function(a){return a.disabled;},checked:function(a){return a.checked;},selected:function(a){return a.selected||jQuery.attr(a,"selected");},text:function(a){return"text"==a.type;},radio:function(a){return"radio"==a.type;},checkbox:function(a){return"checkbox"==a.type;},file:function(a){return"file"==a.type;},password:function(a){return"password"==a.type;},submit:function(a){return"submit"==a.type;},image:function(a){return"image"==a.type;},reset:function(a){return"reset"==a.type;},button:function(a){return"button"==a.type||jQuery.nodeName(a,"button");},input:function(a){return/input|select|textarea|button/i.test(a.nodeName);},has:function(a,i,m){return jQuery.find(m[3],a).length;},header:function(a){return/h\d/i.test(a.nodeName);},animated:function(a){return jQuery.grep(jQuery.timers,function(fn){return a==fn.elem;}).length;}}},parse:[/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,new RegExp("^([:.#]*)("+chars+"+)")],multiFilter:function(expr,elems,not){var old,cur=[];while(expr&&expr!=old){old=expr;var f=jQuery.filter(expr,elems,not);expr=f.t.replace(/^\s*,\s*/,"");cur=not?elems=f.r:jQuery.merge(cur,f.r);}return cur;},find:function(t,context){if(typeof t!="string")return[t];if(context&&context.nodeType!=1&&context.nodeType!=9)return[];context=context||document;var ret=[context],done=[],last,nodeName;while(t&&last!=t){var r=[];last=t;t=jQuery.trim(t);var foundToken=false,re=quickChild,m=re.exec(t);if(m){nodeName=m[1].toUpperCase();for(var i=0;ret[i];i++)for(var c=ret[i].firstChild;c;c=c.nextSibling)if(c.nodeType==1&&(nodeName=="*"||c.nodeName.toUpperCase()==nodeName))r.push(c);ret=r;t=t.replace(re,"");if(t.indexOf(" ")==0)continue;foundToken=true;}else{re=/^([>+~])\s*(\w*)/i;if((m=re.exec(t))!=null){r=[];var merge={};nodeName=m[2].toUpperCase();m=m[1];for(var j=0,rl=ret.length;j=0;if(!not&&pass||not&&!pass)tmp.push(r[i]);}return tmp;},filter:function(t,r,not){var last;while(t&&t!=last){last=t;var p=jQuery.parse,m;for(var i=0;p[i];i++){m=p[i].exec(t);if(m){t=t.substring(m[0].length);m[2]=m[2].replace(/\\/g,"");break;}}if(!m)break;if(m[1]==":"&&m[2]=="not")r=isSimple.test(m[3])?jQuery.filter(m[3],r,true).r:jQuery(r).not(m[3]);else if(m[1]==".")r=jQuery.classFilter(r,m[2],not);else if(m[1]=="["){var tmp=[],type=m[3];for(var i=0,rl=r.length;i=0)^not)tmp.push(a);}r=tmp;}else if(m[1]==":"&&m[2]=="nth-child"){var merge={},tmp=[],test=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(m[3]=="even"&&"2n"||m[3]=="odd"&&"2n+1"||!/\D/.test(m[3])&&"0n+"+m[3]||m[3]),first=(test[1]+(test[2]||1))-0,last=test[3]-0;for(var i=0,rl=r.length;i=0)add=true;if(add^not)tmp.push(node);}r=tmp;}else{var fn=jQuery.expr[m[1]];if(typeof fn=="object")fn=fn[m[2]];if(typeof fn=="string")fn=eval("false||function(a,i){return "+fn+";}");r=jQuery.grep(r,function(elem,i){return fn(elem,i,m,r);},not);}}return{r:r,t:t};},dir:function(elem,dir){var matched=[],cur=elem[dir];while(cur&&cur!=document){if(cur.nodeType==1)matched.push(cur);cur=cur[dir];}return matched;},nth:function(cur,result,dir,elem){result=result||1;var num=0;for(;cur;cur=cur[dir])if(cur.nodeType==1&&++num==result)break;return cur;},sibling:function(n,elem){var r=[];for(;n;n=n.nextSibling){if(n.nodeType==1&&n!=elem)r.push(n);}return r;}});jQuery.event={add:function(elem,types,handler,data){if(elem.nodeType==3||elem.nodeType==8)return;if(jQuery.browser.msie&&elem.setInterval)elem=window;if(!handler.guid)handler.guid=this.guid++;if(data!=undefined){var fn=handler;handler=this.proxy(fn,function(){return fn.apply(this,arguments);});handler.data=data;}var events=jQuery.data(elem,"events")||jQuery.data(elem,"events",{}),handle=jQuery.data(elem,"handle")||jQuery.data(elem,"handle",function(){if(typeof jQuery!="undefined"&&!jQuery.event.triggered)return jQuery.event.handle.apply(arguments.callee.elem,arguments);});handle.elem=elem;jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];handler.type=parts[1];var handlers=events[type];if(!handlers){handlers=events[type]={};if(!jQuery.event.special[type]||jQuery.event.special[type].setup.call(elem)===false){if(elem.addEventListener)elem.addEventListener(type,handle,false);else if(elem.attachEvent)elem.attachEvent("on"+type,handle);}}handlers[handler.guid]=handler;jQuery.event.global[type]=true;});elem=null;},guid:1,global:{},remove:function(elem,types,handler){if(elem.nodeType==3||elem.nodeType==8)return;var events=jQuery.data(elem,"events"),ret,index;if(events){if(types==undefined||(typeof types=="string"&&types.charAt(0)=="."))for(var type in events)this.remove(elem,type+(types||""));else{if(types.type){handler=types.handler;types=types.type;}jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];if(events[type]){if(handler)delete events[type][handler.guid];else for(handler in events[type])if(!parts[1]||events[type][handler].type==parts[1])delete events[type][handler];for(ret in events[type])break;if(!ret){if(!jQuery.event.special[type]||jQuery.event.special[type].teardown.call(elem)===false){if(elem.removeEventListener)elem.removeEventListener(type,jQuery.data(elem,"handle"),false);else if(elem.detachEvent)elem.detachEvent("on"+type,jQuery.data(elem,"handle"));}ret=null;delete events[type];}}});}for(ret in events)break;if(!ret){var handle=jQuery.data(elem,"handle");if(handle)handle.elem=null;jQuery.removeData(elem,"events");jQuery.removeData(elem,"handle");}}},trigger:function(type,data,elem,donative,extra){data=jQuery.makeArray(data);if(type.indexOf("!")>=0){type=type.slice(0,-1);var exclusive=true;}if(!elem){if(this.global[type])jQuery("*").add([window,document]).trigger(type,data);}else{if(elem.nodeType==3||elem.nodeType==8)return undefined;var val,ret,fn=jQuery.isFunction(elem[type]||null),event=!data[0]||!data[0].preventDefault;if(event){data.unshift({type:type,target:elem,preventDefault:function(){},stopPropagation:function(){},timeStamp:now()});data[0][expando]=true;}data[0].type=type;if(exclusive)data[0].exclusive=true;var handle=jQuery.data(elem,"handle");if(handle)val=handle.apply(elem,data);if((!fn||(jQuery.nodeName(elem,'a')&&type=="click"))&&elem["on"+type]&&elem["on"+type].apply(elem,data)===false)val=false;if(event)data.shift();if(extra&&jQuery.isFunction(extra)){ret=extra.apply(elem,val==null?data:data.concat(val));if(ret!==undefined)val=ret;}if(fn&&donative!==false&&val!==false&&!(jQuery.nodeName(elem,'a')&&type=="click")){this.triggered=true;try{elem[type]();}catch(e){}}this.triggered=false;}return val;},handle:function(event){var val,ret,namespace,all,handlers;event=arguments[0]=jQuery.event.fix(event||window.event);namespace=event.type.split(".");event.type=namespace[0];namespace=namespace[1];all=!namespace&&!event.exclusive;handlers=(jQuery.data(this,"events")||{})[event.type];for(var j in handlers){var handler=handlers[j];if(all||handler.type==namespace){event.handler=handler;event.data=handler.data;ret=handler.apply(this,arguments);if(val!==false)val=ret;if(ret===false){event.preventDefault();event.stopPropagation();}}}return val;},fix:function(event){if(event[expando]==true)return event;var originalEvent=event;event={originalEvent:originalEvent};var props="altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target timeStamp toElement type view wheelDelta which".split(" ");for(var i=props.length;i;i--)event[props[i]]=originalEvent[props[i]];event[expando]=true;event.preventDefault=function(){if(originalEvent.preventDefault)originalEvent.preventDefault();originalEvent.returnValue=false;};event.stopPropagation=function(){if(originalEvent.stopPropagation)originalEvent.stopPropagation();originalEvent.cancelBubble=true;};event.timeStamp=event.timeStamp||now();if(!event.target)event.target=event.srcElement||document;if(event.target.nodeType==3)event.target=event.target.parentNode;if(!event.relatedTarget&&event.fromElement)event.relatedTarget=event.fromElement==event.target?event.toElement:event.fromElement;if(event.pageX==null&&event.clientX!=null){var doc=document.documentElement,body=document.body;event.pageX=event.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc.clientLeft||0);event.pageY=event.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc.clientTop||0);}if(!event.which&&((event.charCode||event.charCode===0)?event.charCode:event.keyCode))event.which=event.charCode||event.keyCode;if(!event.metaKey&&event.ctrlKey)event.metaKey=event.ctrlKey;if(!event.which&&event.button)event.which=(event.button&1?1:(event.button&2?3:(event.button&4?2:0)));return event;},proxy:function(fn,proxy){proxy.guid=fn.guid=fn.guid||proxy.guid||this.guid++;return proxy;},special:{ready:{setup:function(){bindReady();return;},teardown:function(){return;}},mouseenter:{setup:function(){if(jQuery.browser.msie)return false;jQuery(this).bind("mouseover",jQuery.event.special.mouseenter.handler);return true;},teardown:function(){if(jQuery.browser.msie)return false;jQuery(this).unbind("mouseover",jQuery.event.special.mouseenter.handler);return true;},handler:function(event){if(withinElement(event,this))return true;event.type="mouseenter";return jQuery.event.handle.apply(this,arguments);}},mouseleave:{setup:function(){if(jQuery.browser.msie)return false;jQuery(this).bind("mouseout",jQuery.event.special.mouseleave.handler);return true;},teardown:function(){if(jQuery.browser.msie)return false;jQuery(this).unbind("mouseout",jQuery.event.special.mouseleave.handler);return true;},handler:function(event){if(withinElement(event,this))return true;event.type="mouseleave";return jQuery.event.handle.apply(this,arguments);}}}};jQuery.fn.extend({bind:function(type,data,fn){return type=="unload"?this.one(type,data,fn):this.each(function(){jQuery.event.add(this,type,fn||data,fn&&data);});},one:function(type,data,fn){var one=jQuery.event.proxy(fn||data,function(event){jQuery(this).unbind(event,one);return(fn||data).apply(this,arguments);});return this.each(function(){jQuery.event.add(this,type,one,fn&&data);});},unbind:function(type,fn){return this.each(function(){jQuery.event.remove(this,type,fn);});},trigger:function(type,data,fn){return this.each(function(){jQuery.event.trigger(type,data,this,true,fn);});},triggerHandler:function(type,data,fn){return this[0]&&jQuery.event.trigger(type,data,this[0],false,fn);},toggle:function(fn){var args=arguments,i=1;while(i=0){var selector=url.slice(off,url.length);url=url.slice(0,off);}callback=callback||function(){};var type="GET";if(params)if(jQuery.isFunction(params)){callback=params;params=null;}else{params=jQuery.param(params);type="POST";}var self=this;jQuery.ajax({url:url,type:type,dataType:"html",data:params,complete:function(res,status){if(status=="success"||status=="notmodified")self.html(selector?jQuery("
").append(res.responseText.replace(//g,"")).find(selector):res.responseText);self.each(callback,[res.responseText,status,res]);}});return this;},serialize:function(){return jQuery.param(this.serializeArray());},serializeArray:function(){return this.map(function(){return jQuery.nodeName(this,"form")?jQuery.makeArray(this.elements):this;}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type));}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:val.constructor==Array?jQuery.map(val,function(val,i){return{name:elem.name,value:val};}):{name:elem.name,value:val};}).get();}});jQuery.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(i,o){jQuery.fn[o]=function(f){return this.bind(o,f);};});var jsc=now();jQuery.extend({get:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data=null;}return jQuery.ajax({type:"GET",url:url,data:data,success:callback,dataType:type});},getScript:function(url,callback){return jQuery.get(url,null,callback,"script");},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json");},post:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data={};}return jQuery.ajax({type:"POST",url:url,data:data,success:callback,dataType:type});},ajaxSetup:function(settings){jQuery.extend(jQuery.ajaxSettings,settings);},ajaxSettings:{url:location.href,global:true,type:"GET",timeout:0,contentType:"application/x-www-form-urlencoded",processData:true,async:true,data:null,username:null,password:null,accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(s){s=jQuery.extend(true,s,jQuery.extend(true,{},jQuery.ajaxSettings,s));var jsonp,jsre=/=\?(&|$)/g,status,data,type=s.type.toUpperCase();if(s.data&&s.processData&&typeof s.data!="string")s.data=jQuery.param(s.data);if(s.dataType=="jsonp"){if(type=="GET"){if(!s.url.match(jsre))s.url+=(s.url.match(/\?/)?"&":"?")+(s.jsonp||"callback")+"=?";}else if(!s.data||!s.data.match(jsre))s.data=(s.data?s.data+"&":"")+(s.jsonp||"callback")+"=?";s.dataType="json";}if(s.dataType=="json"&&(s.data&&s.data.match(jsre)||s.url.match(jsre))){jsonp="jsonp"+jsc++;if(s.data)s.data=(s.data+"").replace(jsre,"="+jsonp+"$1");s.url=s.url.replace(jsre,"="+jsonp+"$1");s.dataType="script";window[jsonp]=function(tmp){data=tmp;success();complete();window[jsonp]=undefined;try{delete window[jsonp];}catch(e){}if(head)head.removeChild(script);};}if(s.dataType=="script"&&s.cache==null)s.cache=false;if(s.cache===false&&type=="GET"){var ts=now();var ret=s.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+ts+"$2");s.url=ret+((ret==s.url)?(s.url.match(/\?/)?"&":"?")+"_="+ts:"");}if(s.data&&type=="GET"){s.url+=(s.url.match(/\?/)?"&":"?")+s.data;s.data=null;}if(s.global&&!jQuery.active++)jQuery.event.trigger("ajaxStart");var remote=/^(?:\w+:)?\/\/([^\/?#]+)/;if(s.dataType=="script"&&type=="GET"&&remote.test(s.url)&&remote.exec(s.url)[1]!=location.host){var head=document.getElementsByTagName("head")[0];var script=document.createElement("script");script.src=s.url;if(s.scriptCharset)script.charset=s.scriptCharset;if(!jsonp){var done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){done=true;success();complete();head.removeChild(script);}};}head.appendChild(script);return undefined;}var requestDone=false;var xhr=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();if(s.username)xhr.open(type,s.url,s.async,s.username,s.password);else xhr.open(type,s.url,s.async);try{if(s.data)xhr.setRequestHeader("Content-Type",s.contentType);if(s.ifModified)xhr.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url]||"Thu, 01 Jan 1970 00:00:00 GMT");xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");xhr.setRequestHeader("Accept",s.dataType&&s.accepts[s.dataType]?s.accepts[s.dataType]+", */*":s.accepts._default);}catch(e){}if(s.beforeSend&&s.beforeSend(xhr,s)===false){s.global&&jQuery.active--;xhr.abort();return false;}if(s.global)jQuery.event.trigger("ajaxSend",[xhr,s]);var onreadystatechange=function(isTimeout){if(!requestDone&&xhr&&(xhr.readyState==4||isTimeout=="timeout")){requestDone=true;if(ival){clearInterval(ival);ival=null;}status=isTimeout=="timeout"&&"timeout"||!jQuery.httpSuccess(xhr)&&"error"||s.ifModified&&jQuery.httpNotModified(xhr,s.url)&&"notmodified"||"success";if(status=="success"){try{data=jQuery.httpData(xhr,s.dataType,s.dataFilter);}catch(e){status="parsererror";}}if(status=="success"){var modRes;try{modRes=xhr.getResponseHeader("Last-Modified");}catch(e){}if(s.ifModified&&modRes)jQuery.lastModified[s.url]=modRes;if(!jsonp)success();}else jQuery.handleError(s,xhr,status);complete();if(s.async)xhr=null;}};if(s.async){var ival=setInterval(onreadystatechange,13);if(s.timeout>0)setTimeout(function(){if(xhr){xhr.abort();if(!requestDone)onreadystatechange("timeout");}},s.timeout);}try{xhr.send(s.data);}catch(e){jQuery.handleError(s,xhr,null,e);}if(!s.async)onreadystatechange();function success(){if(s.success)s.success(data,status);if(s.global)jQuery.event.trigger("ajaxSuccess",[xhr,s]);}function complete(){if(s.complete)s.complete(xhr,status);if(s.global)jQuery.event.trigger("ajaxComplete",[xhr,s]);if(s.global&&!--jQuery.active)jQuery.event.trigger("ajaxStop");}return xhr;},handleError:function(s,xhr,status,e){if(s.error)s.error(xhr,status,e);if(s.global)jQuery.event.trigger("ajaxError",[xhr,s,e]);},active:0,httpSuccess:function(xhr){try{return!xhr.status&&location.protocol=="file:"||(xhr.status>=200&&xhr.status<300)||xhr.status==304||xhr.status==1223||jQuery.browser.safari&&xhr.status==undefined;}catch(e){}return false;},httpNotModified:function(xhr,url){try{var xhrRes=xhr.getResponseHeader("Last-Modified");return xhr.status==304||xhrRes==jQuery.lastModified[url]||jQuery.browser.safari&&xhr.status==undefined;}catch(e){}return false;},httpData:function(xhr,type,filter){var ct=xhr.getResponseHeader("content-type"),xml=type=="xml"||!type&&ct&&ct.indexOf("xml")>=0,data=xml?xhr.responseXML:xhr.responseText;if(xml&&data.documentElement.tagName=="parsererror")throw"parsererror";if(filter)data=filter(data,type);if(type=="script")jQuery.globalEval(data);if(type=="json")data=eval("("+data+")");return data;},param:function(a){var s=[];if(a.constructor==Array||a.jquery)jQuery.each(a,function(){s.push(encodeURIComponent(this.name)+"="+encodeURIComponent(this.value));});else for(var j in a)if(a[j]&&a[j].constructor==Array)jQuery.each(a[j],function(){s.push(encodeURIComponent(j)+"="+encodeURIComponent(this));});else s.push(encodeURIComponent(j)+"="+encodeURIComponent(jQuery.isFunction(a[j])?a[j]():a[j]));return s.join("&").replace(/%20/g,"+");}});jQuery.fn.extend({show:function(speed,callback){return speed?this.animate({height:"show",width:"show",opacity:"show"},speed,callback):this.filter(":hidden").each(function(){this.style.display=this.oldblock||"";if(jQuery.css(this,"display")=="none"){var elem=jQuery("<"+this.tagName+" />").appendTo("body");this.style.display=elem.css("display");if(this.style.display=="none")this.style.display="block";elem.remove();}}).end();},hide:function(speed,callback){return speed?this.animate({height:"hide",width:"hide",opacity:"hide"},speed,callback):this.filter(":visible").each(function(){this.oldblock=this.oldblock||jQuery.css(this,"display");this.style.display="none";}).end();},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){return jQuery.isFunction(fn)&&jQuery.isFunction(fn2)?this._toggle.apply(this,arguments):fn?this.animate({height:"toggle",width:"toggle",opacity:"toggle"},fn,fn2):this.each(function(){jQuery(this)[jQuery(this).is(":hidden")?"show":"hide"]();});},slideDown:function(speed,callback){return this.animate({height:"show"},speed,callback);},slideUp:function(speed,callback){return this.animate({height:"hide"},speed,callback);},slideToggle:function(speed,callback){return this.animate({height:"toggle"},speed,callback);},fadeIn:function(speed,callback){return this.animate({opacity:"show"},speed,callback);},fadeOut:function(speed,callback){return this.animate({opacity:"hide"},speed,callback);},fadeTo:function(speed,to,callback){return this.animate({opacity:to},speed,callback);},animate:function(prop,speed,easing,callback){var optall=jQuery.speed(speed,easing,callback);return this[optall.queue===false?"each":"queue"](function(){if(this.nodeType!=1)return false;var opt=jQuery.extend({},optall),p,hidden=jQuery(this).is(":hidden"),self=this;for(p in prop){if(prop[p]=="hide"&&hidden||prop[p]=="show"&&!hidden)return opt.complete.call(this);if(p=="height"||p=="width"){opt.display=jQuery.css(this,"display");opt.overflow=this.style.overflow;}}if(opt.overflow!=null)this.style.overflow="hidden";opt.curAnim=jQuery.extend({},prop);jQuery.each(prop,function(name,val){var e=new jQuery.fx(self,opt,name);if(/toggle|show|hide/.test(val))e[val=="toggle"?hidden?"show":"hide":val](prop);else{var parts=val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),start=e.cur(true)||0;if(parts){var end=parseFloat(parts[2]),unit=parts[3]||"px";if(unit!="px"){self.style[name]=(end||1)+unit;start=((end||1)/e.cur(true))*start;self.style[name]=start+unit;}if(parts[1])end=((parts[1]=="-="?-1:1)*end)+start;e.custom(start,end,unit);}else e.custom(start,val,"");}});return true;});},queue:function(type,fn){if(jQuery.isFunction(type)||(type&&type.constructor==Array)){fn=type;type="fx";}if(!type||(typeof type=="string"&&!fn))return queue(this[0],type);return this.each(function(){if(fn.constructor==Array)queue(this,type,fn);else{queue(this,type).push(fn);if(queue(this,type).length==1)fn.call(this);}});},stop:function(clearQueue,gotoEnd){var timers=jQuery.timers;if(clearQueue)this.queue([]);this.each(function(){for(var i=timers.length-1;i>=0;i--)if(timers[i].elem==this){if(gotoEnd)timers[i](true);timers.splice(i,1);}});if(!gotoEnd)this.dequeue();return this;}});var queue=function(elem,type,array){if(elem){type=type||"fx";var q=jQuery.data(elem,type+"queue");if(!q||array)q=jQuery.data(elem,type+"queue",jQuery.makeArray(array));}return q;};jQuery.fn.dequeue=function(type){type=type||"fx";return this.each(function(){var q=queue(this,type);q.shift();if(q.length)q[0].call(this);});};jQuery.extend({speed:function(speed,easing,fn){var opt=speed&&speed.constructor==Object?speed:{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&easing.constructor!=Function&&easing};opt.duration=(opt.duration&&opt.duration.constructor==Number?opt.duration:jQuery.fx.speeds[opt.duration])||jQuery.fx.speeds.def;opt.old=opt.complete;opt.complete=function(){if(opt.queue!==false)jQuery(this).dequeue();if(jQuery.isFunction(opt.old))opt.old.call(this);};return opt;},easing:{linear:function(p,n,firstNum,diff){return firstNum+diff*p;},swing:function(p,n,firstNum,diff){return((-Math.cos(p*Math.PI)/2)+0.5)*diff+firstNum;}},timers:[],timerId:null,fx:function(elem,options,prop){this.options=options;this.elem=elem;this.prop=prop;if(!options.orig)options.orig={};}});jQuery.fx.prototype={update:function(){if(this.options.step)this.options.step.call(this.elem,this.now,this);(jQuery.fx.step[this.prop]||jQuery.fx.step._default)(this);if(this.prop=="height"||this.prop=="width")this.elem.style.display="block";},cur:function(force){if(this.elem[this.prop]!=null&&this.elem.style[this.prop]==null)return this.elem[this.prop];var r=parseFloat(jQuery.css(this.elem,this.prop,force));return r&&r>-10000?r:parseFloat(jQuery.curCSS(this.elem,this.prop))||0;},custom:function(from,to,unit){this.startTime=now();this.start=from;this.end=to;this.unit=unit||this.unit||"px";this.now=this.start;this.pos=this.state=0;this.update();var self=this;function t(gotoEnd){return self.step(gotoEnd);}t.elem=this.elem;jQuery.timers.push(t);if(jQuery.timerId==null){jQuery.timerId=setInterval(function(){var timers=jQuery.timers;for(var i=0;ithis.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var done=true;for(var i in this.options.curAnim)if(this.options.curAnim[i]!==true)done=false;if(done){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(jQuery.css(this.elem,"display")=="none")this.elem.style.display="block";}if(this.options.hide)this.elem.style.display="none";if(this.options.hide||this.options.show)for(var p in this.options.curAnim)jQuery.attr(this.elem.style,p,this.options.orig[p]);}if(done)this.options.complete.call(this.elem);return false;}else{var n=t-this.startTime;this.state=n/this.options.duration;this.pos=jQuery.easing[this.options.easing||(jQuery.easing.swing?"swing":"linear")](this.state,n,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update();}return true;}};jQuery.extend(jQuery.fx,{speeds:{slow:600,fast:200,def:400},step:{scrollLeft:function(fx){fx.elem.scrollLeft=fx.now;},scrollTop:function(fx){fx.elem.scrollTop=fx.now;},opacity:function(fx){jQuery.attr(fx.elem.style,"opacity",fx.now);},_default:function(fx){fx.elem.style[fx.prop]=fx.now+fx.unit;}}});jQuery.fn.offset=function(){var left=0,top=0,elem=this[0],results;if(elem)with(jQuery.browser){var parent=elem.parentNode,offsetChild=elem,offsetParent=elem.offsetParent,doc=elem.ownerDocument,safari2=safari&&parseInt(version)<522&&!/adobeair/i.test(userAgent),css=jQuery.curCSS,fixed=css(elem,"position")=="fixed";if(elem.getBoundingClientRect){var box=elem.getBoundingClientRect();add(box.left+Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),box.top+Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));add(-doc.documentElement.clientLeft,-doc.documentElement.clientTop);}else{add(elem.offsetLeft,elem.offsetTop);while(offsetParent){add(offsetParent.offsetLeft,offsetParent.offsetTop);if(mozilla&&!/^t(able|d|h)$/i.test(offsetParent.tagName)||safari&&!safari2)border(offsetParent);if(!fixed&&css(offsetParent,"position")=="fixed")fixed=true;offsetChild=/^body$/i.test(offsetParent.tagName)?offsetChild:offsetParent;offsetParent=offsetParent.offsetParent;}while(parent&&parent.tagName&&!/^body|html$/i.test(parent.tagName)){if(!/^inline|table.*$/i.test(css(parent,"display")))add(-parent.scrollLeft,-parent.scrollTop);if(mozilla&&css(parent,"overflow")!="visible")border(parent);parent=parent.parentNode;}if((safari2&&(fixed||css(offsetChild,"position")=="absolute"))||(mozilla&&css(offsetChild,"position")!="absolute"))add(-doc.body.offsetLeft,-doc.body.offsetTop);if(fixed)add(Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));}results={top:top,left:left};}function border(elem){add(jQuery.curCSS(elem,"borderLeftWidth",true),jQuery.curCSS(elem,"borderTopWidth",true));}function add(l,t){left+=parseInt(l,10)||0;top+=parseInt(t,10)||0;}return results;};jQuery.fn.extend({position:function(){var left=0,top=0,results;if(this[0]){var offsetParent=this.offsetParent(),offset=this.offset(),parentOffset=/^body|html$/i.test(offsetParent[0].tagName)?{top:0,left:0}:offsetParent.offset();offset.top-=num(this,'marginTop');offset.left-=num(this,'marginLeft');parentOffset.top+=num(offsetParent,'borderTopWidth');parentOffset.left+=num(offsetParent,'borderLeftWidth');results={top:offset.top-parentOffset.top,left:offset.left-parentOffset.left};}return results;},offsetParent:function(){var offsetParent=this[0].offsetParent;while(offsetParent&&(!/^body|html$/i.test(offsetParent.tagName)&&jQuery.css(offsetParent,'position')=='static'))offsetParent=offsetParent.offsetParent;return jQuery(offsetParent);}});jQuery.each(['Left','Top'],function(i,name){var method='scroll'+name;jQuery.fn[method]=function(val){if(!this[0])return;return val!=undefined?this.each(function(){this==window||this==document?window.scrollTo(!i?val:jQuery(window).scrollLeft(),i?val:jQuery(window).scrollTop()):this[method]=val;}):this[0]==window||this[0]==document?self[i?'pageYOffset':'pageXOffset']||jQuery.boxModel&&document.documentElement[method]||document.body[method]:this[0][method];};});jQuery.each(["Height","Width"],function(i,name){var tl=i?"Left":"Top",br=i?"Right":"Bottom";jQuery.fn["inner"+name]=function(){return this[name.toLowerCase()]()+num(this,"padding"+tl)+num(this,"padding"+br);};jQuery.fn["outer"+name]=function(margin){return this["inner"+name]()+num(this,"border"+tl+"Width")+num(this,"border"+br+"Width")+(margin?num(this,"margin"+tl)+num(this,"margin"+br):0);};});})(); // /JavaScript/JQuery/jquery.autogrow.js (function(jQuery){var self=null;jQuery.fn.autogrow=function(o) {return this.each(function(){new jQuery.autogrow(this,o);});};jQuery.autogrow=function(e,o) {this.options=o||{};this.dummy=null;this.interval=null;this.line_height=this.options.lineHeight||parseInt(jQuery(e).css('line-height'));this.min_height=this.options.minHeight||parseInt(jQuery(e).css('min-height'));this.max_height=this.options.maxHeight||parseInt(jQuery(e).css('max-height'));;this.textarea=jQuery(e);if(this.line_height==NaN) this.line_height=0;this.init();};jQuery.autogrow.fn=jQuery.autogrow.prototype={autogrow:'1.2.2'};jQuery.autogrow.fn.extend=jQuery.autogrow.extend=jQuery.extend;jQuery.autogrow.fn.extend({init:function(){var self=this;this.textarea.css({overflow:'hidden',display:'block'});this.textarea.bind('focus',function(){self.startExpand()}).bind('blur',function(){self.stopExpand()});this.checkExpand();},startExpand:function(){var self=this;this.interval=window.setInterval(function(){self.checkExpand()},400);},stopExpand:function(){clearInterval(this.interval);},checkExpand:function(){if(this.dummy==null) {this.dummy=jQuery('
');this.dummy.css({'font-size':this.textarea.css('font-size'),'font-family':this.textarea.css('font-family'),'width':this.textarea.css('width'),'padding':this.textarea.css('padding'),'line-height':this.line_height+'px','overflow-x':'hidden','position':'absolute','top':0,'left':-9999}).appendTo('body');} var html=this.textarea.val().replace(/(<|>)/g,'');if($.browser.msie) {html=html.replace(/\n/g,'
new');} else {html=html.replace(/\n/g,'
new');} if(this.dummy.html()!=html) {this.dummy.html(html);if(this.max_height>0&&(this.dummy.height()+this.line_height>this.max_height)) {this.textarea.css('overflow-y','auto');} else {this.textarea.css('overflow-y','hidden');if(this.textarea.height()-1<4){var h=g[i];if(!this.settings[h]){if(((h=="tr"||h=="tl")&&this.topContainer!=null)||((h=="br"||h=="bl")&&this.bottomContainer!=null)){var l=document.createElement("div");$(l).css({position:"relative","font-size":"1px",overflow:"hidden"});if(this.bgImage=="")$(l).css("background-color",this.boxColour);else $(l).css("background-image",this.bgImage).css("background-color",this.boxColour);switch(h){case"tl":$(l).css({height:a-this.borderWidth,"margin-right":this.settings.tr.radius-(this.borderWidth*2),"border-left":this.borderString,"border-top":this.borderString,left:-this.borderWidth+"px","background-repeat":$(this.box).css("background-repeat"),"background-position":this.borderWidth+"px 0px"});break;case"tr":$(l).css({height:a-this.borderWidth,"margin-left":this.settings.tl.radius-(this.borderWidth*2),"border-right":this.borderString,"border-top":this.borderString,left:this.borderWidth+"px","background-repeat":$(this.box).css("background-repeat"),"background-position":"-"+(a+this.borderWidth)+"px 0px"});break;case"bl":if(a>0)$(l).css({height:b-this.borderWidth,"margin-right":this.settings.br.radius-(this.borderWidth*2),"border-left":this.borderString,"border-bottom":this.borderString,left:-this.borderWidth+"px","background-repeat":$(this.box).css("background-repeat"),"background-position":"0px -"+($(this.box).height()+a-this.borderWidth+1)+"px"});else $(l).css({height:b-this.borderWidth,"margin-right":this.settings.br.radius-(this.borderWidth*2),"border-left":this.borderString,"border-bottom":this.borderString,left:-this.borderWidth+"px","background-repeat":$(this.box).css("background-repeat"),"background-position":"0px -"+($(this.box).height())+"px"});break;case"br":if(a>0)$(l).css({height:b-this.borderWidth,"margin-left":this.settings.bl.radius-(this.borderWidth*2),"border-right":this.borderString,"border-bottom":this.borderString,left:this.borderWidth+"px","background-repeat":$(this.box).css("background-repeat"),"background-position":"-"+this.settings.bl.radius+this.borderWidth+"px -"+($(this.box).height()+a-this.borderWidth+1)+"px"});else $(l).css({height:b-this.borderWidth,"margin-left":this.settings.bl.radius-(this.borderWidth*2),"border-right":this.borderString,"border-bottom":this.borderString,left:this.borderWidth+"px","background-repeat":$(this.box).css("background-repeat"),"background-position":"-"+this.settings.bl.radius+this.borderWidth+"px -"+($(this.box).height())+"px"});break}}}else{if(this.masterCorners[this.settings[h].radius]){var l=this.masterCorners[this.settings[h].radius].cloneNode(true)}else{var l=document.createElement("DIV");$(l).css({height:this.settings[h].radius,width:this.settings[h].radius,position:"absolute","font-size":"1px",overflow:"hidden"});var m=parseInt(this.settings[h].radius-this.borderWidth);for(var n=0,j=this.settings[h].radius;n=m)var o=-1;else var o=(Math.floor(Math.sqrt(Math.pow(m,2)-Math.pow((n+1),2)))-1);if(m!=j){if((n)>=m)var p=-1;else var p=Math.ceil(Math.sqrt(Math.pow(m,2)-Math.pow(n,2)));if((n+1)>=j)var q=-1;else var q=(Math.floor(Math.sqrt(Math.pow(j,2)-Math.pow((n+1),2)))-1)};if((n)>=j)var r=-1;else var r=Math.ceil(Math.sqrt(Math.pow(j,2)-Math.pow(n,2)));if(o>-1)this.drawPixel(n,0,this.boxColour,100,(o+1),l,-1,this.settings[h].radius,0);if(m!=j){for(var s=(o+1);s=p){if(p==-1)p=0;this.drawPixel(n,p,this.borderColour,100,(q-p+1),l,0,0,1)}}else{if(q>=o){this.drawPixel(n,(o+1),this.borderColour,100,(q-o),l,0,0,1)}};var w=this.borderColour}else{var w=this.boxColour;var q=o};if(this.settings.antiAlias){for(var s=(q+1);s0)?0:-1),this.settings[h].radius,1)}}};this.masterCorners[this.settings[h].radius]=l.cloneNode(true)};if(h!="br"){for(var t=0,k=l.childNodes.length;t0)$(x).css("background-position","-"+Math.abs((this.settings[h].radius-A-1)-this.borderWidth)+"px -"+Math.abs(($(this.box).height()+a-this.borderWidth+1))+"px");else $(x).css("background-position","-"+Math.abs((this.settings[h].radius-A-1)-this.borderWidth)+"px -"+Math.abs(($(this.box).height()))+"px");break}}}};if(l){switch(h){case"tl":if($(l).css("position")=="absolute")$(l).css("top","0");if($(l).css("position")=="absolute")$(l).css("left","0");if(this.topContainer)this.topContainer.appendChild(l);break;case"tr":if($(l).css("position")=="absolute")$(l).css("top","0");if($(l).css("position")=="absolute")$(l).css("right","0");if(this.topContainer)this.topContainer.appendChild(l);break;case"bl":if($(l).css("position")=="absolute")$(l).css("bottom","0");if(l.style.position=="absolute")$(l).css("left","0");if(this.bottomContainer)this.bottomContainer.appendChild(l);break;case"br":if($(l).css("position")=="absolute")$(l).css("bottom","0");if($(l).css("position")=="absolute")$(l).css("right","0");if(this.bottomContainer)this.bottomContainer.appendChild(l);break}}}};var C=new Array();C["t"]=Math.abs(this.settings.tl.radius-this.settings.tr.radius);C["b"]=Math.abs(this.settings.bl.radius-this.settings.br.radius);for(z in C){if(z=="t"||z=="b"){if(C[z]){var D=((this.settings[z+"l"].radius0)$(F).css("background-position","-"+(this.settings.bl.radius-this.borderWidth)+"px -"+($(this.box).height()+a-this.borderWidth+1)+"px");else $(F).css("background-position","-"+(this.settings.bl.radius-this.borderWidth)+"px -"+($(this.box).height())+"px").addClass('hasBackgroundColor');this.bottomContainer.appendChild(F)}};break}}}};this.drawPixel=function(a,b,c,d,e,f,g,h,i){var j=document.createElement("div");$(j).css({height:e,width:"1px",position:"absolute","font-size":"1px",overflow:"hidden"});var k=Math.max(this.settings["tr"].radius,this.settings["tl"].radius);if(g==-1&&this.bgImage!=""){if(k>0)$(j).css("background-position","-"+((this.boxWidth-h-this.borderWidth)+a)+"px -"+(($(this.box).height()+k-this.borderWidth)-b)+"px");else $(j).css("background-position","-"+((this.boxWidth-h-this.borderWidth)+a)+"px -"+(($(this.box).height())-b)+"px");$(j).css({"background-image":this.bgImage,"background-repeat":$(this.box).css("background-repeat"),"background-color":c})}else{if(!i)$(j).css("background-color",c).addClass('hasBackgroundColor');else $(j).css("background-color",c)};if(d!=100)setOpacity(j,d);$(j).css({top:b+"px",left:a+"px"});f.appendChild(j)}};function BlendColour(a,b,c){var d=parseInt(a.substr(1,2),16);var e=parseInt(a.substr(3,2),16);var f=parseInt(a.substr(5,2),16);var g=parseInt(b.substr(1,2),16);var h=parseInt(b.substr(3,2),16);var i=parseInt(b.substr(5,2),16);if(c>1||c<0)c=1;var j=Math.round((d*c)+(g*(1-c)));if(j>255)j=255;if(j<0)j=0;var k=Math.round((e*c)+(h*(1-c)));if(k>255)k=255;if(k<0)k=0;var l=Math.round((f*c)+(i*(1-c)));if(l>255)l=255;if(l<0)l=0;return"#"+IntToHex(j)+IntToHex(k)+IntToHex(l)};function IntToHex(a){base=a/16;rem=a%16;base=base-(rem/16);baseS=MakeHex(base);remS=MakeHex(rem);return baseS+''+remS};function MakeHex(x){if((x>=0)&&(x<=9)){return x}else{switch(x){case 10:return"A";case 11:return"B";case 12:return"C";case 13:return"D";case 14:return"E";case 15:return"F"}}};function pixelFraction(x,y,r){var a=0;var b=new Array(1);var c=new Array(1);var d=0;var e="";var f=Math.sqrt((Math.pow(r,2)-Math.pow(x,2)));if((f>=y)&&(f<(y+1))){e="Left";b[d]=0;c[d]=f-y;d=d+1};var f=Math.sqrt((Math.pow(r,2)-Math.pow(y+1,2)));if((f>=x)&&(f<(x+1))){e=e+"Top";b[d]=f-x;c[d]=1;d=d+1};var f=Math.sqrt((Math.pow(r,2)-Math.pow(x+1,2)));if((f>=y)&&(f<(y+1))){e=e+"Right";b[d]=1;c[d]=f-y;d=d+1};var f=Math.sqrt((Math.pow(r,2)-Math.pow(y,2)));if((f>=x)&&(f<(x+1))){e=e+"Bottom";b[d]=f-x;c[d]=0};switch(e){case"LeftRight":a=Math.min(c[0],c[1])+((Math.max(c[0],c[1])-Math.min(c[0],c[1]))/2);break;case"TopRight":a=1-(((1-b[0])*(1-c[1]))/2);break;case"TopBottom":a=Math.min(b[0],b[1])+((Math.max(b[0],b[1])-Math.min(b[0],b[1]))/2);break;case"LeftBottom":a=(c[0]*b[1])/2;break;default:a=1};return a};function rgb2Hex(a){try{var b=rgb2Array(a);var c=parseInt(b[0]);var d=parseInt(b[1]);var f=parseInt(b[2]);var g="#"+IntToHex(c)+IntToHex(d)+IntToHex(f)}catch(e){alert("There was an error converting the RGB value to Hexadecimal in function rgb2Hex")};return g};function rgb2Array(a){var b=a.substring(4,a.indexOf(")"));var c=b.split(", ");return c};function setOpacity(a,b){b=(b==100)?99.999:b;if($.browser.safari&&a.tagName!="IFRAME"){var c=rgb2Array(a.style.backgroundColor);var d=parseInt(c[0]);var e=parseInt(c[1]);var f=parseInt(c[2]);a.style.backgroundColor="rgba("+d+", "+e+", "+f+", "+b/100+")"}else if(typeof(a.style.opacity)!="undefined"){a.style.opacity=b/100}else if(typeof(a.style.MozOpacity)!="undefined"){a.style.MozOpacity=b/100}else if(typeof(a.style.filter)!="undefined"){a.style.filter="alpha(opacity:"+b+")"}else if(typeof(a.style.KHTMLOpacity)!="undefined"){a.style.KHTMLOpacity=b/100}};function format_colour(a){var b="transparent";if(a!=""&&a!="transparent"){if(a.substr(0,3)=="rgb"){b=rgb2Hex(a)}else if(a.length==4){b="#"+a.substring(1,2)+a.substring(1,2)+a.substring(2,3)+a.substring(2,3)+a.substring(3,4)+a.substring(3,4)}else{b=a}};return b};function strip_px(a){return parseInt(((a!="auto"&&a.indexOf("%")==-1&&a!=""&&a.indexOf("px")!==-1)?a.slice(0,a.indexOf("px")):0))}})(jQuery); // /JavaScript/JQuery/jquery.hoverIntent.js (function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY;};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))
');$cluetipTitle=$('

');$cluetipOuter=$('
').append($cluetipInner).prepend($cluetipTitle);$cluetip=$('
').css({zIndex:opts.cluezIndex}).append($cluetipOuter).append('
')[insertionType](insertionElement).hide();$('
').css({position:'absolute',zIndex:cluezIndex-1}).insertBefore('#cluetip').hide();$cluetip.css({position:'absolute',zIndex:cluezIndex});$cluetipOuter.css({position:'relative',zIndex:cluezIndex+1});$cluetipArrows=$('
').css({zIndex:cluezIndex+1}).appendTo('#cluetip');} var dropShadowSteps=(opts.dropShadow)?+opts.dropShadowSteps:0;if(!$dropShadow){$dropShadow=$([]);for(var i=0;i').css({zIndex:cluezIndex-i-1,opacity:.1,top:1+i,left:1+i}));};$dropShadow.css({position:'absolute',backgroundColor:'#000'}).prependTo($cluetip);} var tipAttribute=$this.attr(opts.attribute),ctClass=opts.cluetipClass;if(!tipAttribute&&!opts.splitTitle&&!js)return true;if(opts.local&&opts.hideLocal){$(tipAttribute+':first').hide();} var tOffset=parseInt(opts.topOffset,10),lOffset=parseInt(opts.leftOffset,10);var tipHeight,wHeight;var defHeight=isNaN(parseInt(opts.height,10))?'auto':(/\D/g).test(opts.height)?opts.height:opts.height+'px';var sTop,linkTop,posY,tipY,mouseY,baseline;var tipInnerWidth=isNaN(parseInt(opts.width,10))?275:parseInt(opts.width,10);var tipWidth=tipInnerWidth+(parseInt($cluetip.css('paddingLeft'))||0)+(parseInt($cluetip.css('paddingRight'))||0)+dropShadowSteps;var linkWidth=this.offsetWidth;var linkLeft,posX,tipX,mouseX,winWidth;var tipParts;var tipTitle=(opts.attribute!='title')?$this.attr(opts.titleAttribute):'';if(opts.splitTitle){if(tipTitle==undefined){tipTitle='';} tipParts=tipTitle.split(opts.splitTitle);tipTitle=tipParts.shift();} var localContent;var activate=function(event){if(!opts.onActivate($this)){return false;} isActive=true;$cluetip.removeClass().css({width:tipInnerWidth});if(tipAttribute==$this.attr('href')){$this.css('cursor',opts.cursor);} $this.attr('title','');if(opts.hoverClass){$this.addClass(opts.hoverClass);} linkTop=posY=$this.offset().top;linkLeft=$this.offset().left;mouseX=event.pageX;mouseY=event.pageY;if($this[0].tagName.toLowerCase()!='area'){sTop=$(document).scrollTop();winWidth=$(window).width();} if(opts.positionBy=='fixed'){posX=linkWidth+linkLeft+lOffset;$cluetip.css({left:posX});}else{posX=(linkWidth>linkLeft&&linkLeft>tipWidth)||linkLeft+linkWidth+tipWidth+lOffset>winWidth?linkLeft-tipWidth-lOffset:linkWidth+linkLeft+lOffset;if($this[0].tagName.toLowerCase()=='area'||opts.positionBy=='mouse'||linkWidth+tipWidth>winWidth){if(mouseX+20+tipWidth>winWidth){$cluetip.addClass(' cluetip-'+ctClass);posX=(mouseX-tipWidth-lOffset)>=0?mouseX-tipWidth-lOffset-parseInt($cluetip.css('marginLeft'),10)+parseInt($cluetipInner.css('marginRight'),10):mouseX-(tipWidth/2);}else{posX=mouseX+lOffset;}} var pY=posX<0?event.pageY+tOffset:event.pageY;$cluetip.css({left:(posX>0&&opts.positionBy!='bottomTop')?posX:(mouseX+(tipWidth/2)>winWidth)?winWidth/2-tipWidth/2:Math.max(mouseX-(tipWidth/2),0)});} wHeight=$(window).height();if(js){$cluetipInner.html(js);cluetipShow(pY);} else if(tipParts){var tpl=tipParts.length;for(var i=0;i'+tipParts[i]+'');}};cluetipShow(pY);} else if(!opts.local&&tipAttribute.indexOf('#')!=0){if(cluetipContents&&opts.ajaxCache){$cluetipInner.html(cluetipContents);cluetipShow(pY);} else{var ajaxSettings=opts.ajaxSettings;ajaxSettings.url=tipAttribute;ajaxSettings.beforeSend=function(){$cluetipOuter.children().empty();if(opts.waitImage){$('#cluetip-waitimage').css({top:mouseY+20,left:mouseX+20}).show();}};ajaxSettings.error=function(){if(isActive){$cluetipInner.html('sorry, the contents could not be loaded');}};ajaxSettings.success=function(data){cluetipContents=opts.ajaxProcess(data);if(isActive){$cluetipInner.html(cluetipContents);}};ajaxSettings.complete=function(){imgCount=$('#cluetip-inner img').length;if(imgCount&&!$.browser.opera){$('#cluetip-inner img').load(function(){imgCount--;if(imgCount<1){$('#cluetip-waitimage').hide();if(isActive)cluetipShow(pY);}});}else{$('#cluetip-waitimage').hide();if(isActive)cluetipShow(pY);}};$.ajax(ajaxSettings);}}else if(opts.local){var $localContent=$(tipAttribute+':first');var localCluetip=$.fn.wrapInner?$localContent.wrapInner('
').children().clone(true):$localContent.html();$.fn.wrapInner?$cluetipInner.empty().append(localCluetip):$cluetipInner.html(localCluetip);cluetipShow(pY);}};var cluetipShow=function(bpY){$cluetip.addClass('cluetip-'+ctClass);if(opts.truncate){var $truncloaded=$cluetipInner.text().slice(0,opts.truncate)+'...';$cluetipInner.html($truncloaded);} function doNothing(){};tipTitle?$cluetipTitle.show().html(tipTitle):(opts.showTitle)?$cluetipTitle.show().html(' '):$cluetipTitle.hide();if(opts.sticky){var $closeLink=$('');(opts.closePosition=='bottom')?$closeLink.appendTo($cluetipInner):(opts.closePosition=='title')?$closeLink.prependTo($cluetipTitle):$closeLink.prependTo($cluetipInner);$closeLink.click(function(){cluetipClose();return false;});if(opts.mouseOutClose){if($.fn.hoverIntent&&opts.hoverIntent){$cluetip.hoverIntent({over:doNothing,timeout:opts.hoverIntent.timeout,out:function(){$closeLink.trigger('click');}});}else{$cluetip.hover(doNothing,function(){$closeLink.trigger('click');});}}else{$cluetip.unbind('mouseout');}} var direction='';$cluetipOuter.css({overflow:defHeight=='auto'?'visible':'auto',height:defHeight});tipHeight=defHeight=='auto'?Math.max($cluetip.outerHeight(),$cluetip.height()):parseInt(defHeight,10);tipY=posY;baseline=sTop+wHeight;if(opts.positionBy=='fixed'){tipY=posY-opts.dropShadowSteps+tOffset;}else if((posXmouseX)||opts.positionBy=='bottomTop'){if(posY+tipHeight+tOffset>baseline&&mouseY-sTop>tipHeight+tOffset){tipY=mouseY-tipHeight-tOffset;direction='top';}else{tipY=mouseY+tOffset;direction='bottom';}}else if(posY+tipHeight+tOffset>baseline){tipY=(tipHeight>=wHeight)?sTop:baseline-tipHeight-tOffset;}else if($this.css('display')=='block'||$this[0].tagName.toLowerCase()=='area'||opts.positionBy=="mouse"){tipY=bpY-tOffset;}else{tipY=posY-opts.dropShadowSteps;} if(direction==''){posX=0&&bgY>0)?bgY+'px':/(left|right)/.test(direction)?0:''}).show();}else{$cluetipArrows.hide();} $dropShadow.hide();$cluetip.hide()[opts.fx.open](opts.fx.open!='show'&&opts.fx.openSpeed);if(opts.dropShadow)$dropShadow.css({height:tipHeight,width:tipInnerWidth}).show();if($.fn.bgiframe){$cluetip.bgiframe();} if(opts.delayedClose>0){closeOnDelay=setTimeout(cluetipClose,opts.delayedClose);} opts.onShow($cluetip,$cluetipInner);};var inactivate=function(){isActive=false;$('#cluetip-waitimage').hide();if(!opts.sticky||(/click|toggle/).test(opts.activation)){cluetipClose();clearTimeout(closeOnDelay);};if(opts.hoverClass){$this.removeClass(opts.hoverClass);} $('.cluetip-clicked').removeClass('cluetip-clicked');};var cluetipClose=function(){$cluetipOuter.parent().hide().removeClass().end().children().empty();if(tipTitle){$this.attr(opts.titleAttribute,tipTitle);} $this.css('cursor','');if(opts.arrows)$cluetipArrows.css({top:''});};if((/click|toggle/).test(opts.activation)){$this.click(function(event){if($cluetip.is(':hidden')||!$this.is('.cluetip-clicked')){activate(event);$('.cluetip-clicked').removeClass('cluetip-clicked');$this.addClass('cluetip-clicked');}else{inactivate(event);} this.blur();return false;});}else if(opts.activation=='focus'){$this.focus(function(event){activate(event);});$this.blur(function(event){inactivate(event);});}else{$this.click(function(){if($this.attr('href')&&$this.attr('href')==tipAttribute&&!opts.clickThrough){return false;}});var mouseTracks=function(evt){if(opts.tracking==true){var trackX=posX-evt.pageX;var trackY=tipY?tipY-evt.pageY:posY-evt.pageY;$this.mousemove(function(evt){$cluetip.css({left:evt.pageX+trackX,top:evt.pageY+trackY});});}};if($.fn.hoverIntent&&opts.hoverIntent){$this.mouseover(function(){$this.attr('title','');}).hoverIntent({sensitivity:opts.hoverIntent.sensitivity,interval:opts.hoverIntent.interval,over:function(event){activate(event);mouseTracks(event);},timeout:opts.hoverIntent.timeout,out:function(event){inactivate(event);$this.unbind('mousemove');}});}else{$this.hover(function(event){activate(event);mouseTracks(event);},function(event){inactivate(event);$this.unbind('mousemove');});}}});};$.fn.cluetip.defaults={width:275,height:'auto',cluezIndex:97,positionBy:'auto',topOffset:15,leftOffset:15,local:false,hideLocal:true,attribute:'rel',titleAttribute:'title',splitTitle:'',showTitle:true,cluetipClass:'default',hoverClass:'',waitImage:true,cursor:'help',arrows:false,dropShadow:true,dropShadowSteps:6,sticky:false,mouseOutClose:false,activation:'hover',clickThrough:false,tracking:false,delayedClose:0,closePosition:'top',closeText:'Close',truncate:0,fx:{open:'show',openSpeed:''},hoverIntent:{sensitivity:3,interval:50,timeout:0},onActivate:function(e){return true;},onShow:function(ct,c){},ajaxCache:true,ajaxProcess:function(data){data=data.replace(//g,'').replace(/<(link|title)(.|\s)*?\/(link|title)>/g,'');return data;},ajaxSettings:{dataType:'html'},debug:false};var insertionType='appendTo',insertionElement='body';$.cluetip={};$.cluetip.setup=function(options){if(options&&options.insertionType&&(options.insertionType).match(/appendTo|prependTo|insertBefore|insertAfter/)){insertionType=options.insertionType;} if(options&&options.insertionElement){insertionElement=options.insertionElement;}};})(jQuery); // /JavaScript/JQuery/jquery.dimensions.js (function($){$.dimensions={version:'1.2'};$.each(['Height','Width'],function(i,name){$.fn['inner'+name]=function(){if(!this[0])return;var torl=name=='Height'?'Top':'Left',borr=name=='Height'?'Bottom':'Right';return this.is(':visible')?this[0]['client'+name]:num(this,name.toLowerCase())+num(this,'padding'+torl)+num(this,'padding'+borr);};$.fn['outer'+name]=function(options){if(!this[0])return;var torl=name=='Height'?'Top':'Left',borr=name=='Height'?'Bottom':'Right';options=$.extend({margin:false},options||{});var val=this.is(':visible')?this[0]['offset'+name]:num(this,name.toLowerCase()) +num(this,'border'+torl+'Width')+num(this,'border'+borr+'Width') +num(this,'padding'+torl)+num(this,'padding'+borr);return val+(options.margin?(num(this,'margin'+torl)+num(this,'margin'+borr)):0);};});$.each(['Left','Top'],function(i,name){$.fn['scroll'+name]=function(val){if(!this[0])return;return val!=undefined?this.each(function(){this==window||this==document?window.scrollTo(name=='Left'?val:$(window)['scrollLeft'](),name=='Top'?val:$(window)['scrollTop']()):this['scroll'+name]=val;}):this[0]==window||this[0]==document?self[(name=='Left'?'pageXOffset':'pageYOffset')]||$.boxModel&&document.documentElement['scroll'+name]||document.body['scroll'+name]:this[0]['scroll'+name];};});$.fn.extend({position:function(){var left=0,top=0,elem=this[0],offset,parentOffset,offsetParent,results;if(elem){offsetParent=this.offsetParent();offset=this.offset();parentOffset=offsetParent.offset();offset.top-=num(elem,'marginTop');offset.left-=num(elem,'marginLeft');parentOffset.top+=num(offsetParent,'borderTopWidth');parentOffset.left+=num(offsetParent,'borderLeftWidth');results={top:offset.top-parentOffset.top,left:offset.left-parentOffset.left};} return results;},offsetParent:function(){var offsetParent=this[0].offsetParent;while(offsetParent&&(!/^body|html$/i.test(offsetParent.tagName)&&$.css(offsetParent,'position')=='static')) offsetParent=offsetParent.offsetParent;return $(offsetParent);}});function num(el,prop){return parseInt($.curCSS(el.jquery?el[0]:el,prop,true))||0;};})(jQuery); // /JavaScript/JQuery/jquery.bd.js jQuery.fn.xShow=function(){return $(this).css('visibility','').css('display','');} jQuery.fn.xHide=function(){return $(this).css('visibility','hidden').css('display','none');} jQuery.fn.xShowBlock=function(){return $(this).css('visibility','visible').css('display','block');} jQuery.fn.xHtml=function(theHtml){return $(this).attr('innerHTML',theHtml);} // /JavaScript/JQuery/urlencode.js function URLEncode(unencodedValue) {var SAFECHARS="0123456789"+"ABCDEFGHIJKLMNOPQRSTUVWXYZ"+"abcdefghijklmnopqrstuvwxyz"+"-_.!~*'()";var HEX="0123456789ABCDEF";var plaintext=unencodedValue;var encoded="";for(var i=0;i255){alert("Unicode Character '" +ch +"' cannot be encoded using standard URL encoding.\n"+"(URL encoding only supports 8-bit characters.)\n"+"A space (+) will be substituted.");encoded+="+";}else{encoded+="%";encoded+=HEX.charAt((charCode>>4)&0xF);encoded+=HEX.charAt(charCode&0xF);}}} return encoded;};function URLDecode(encodedValue) {var HEXCHARS="0123456789ABCDEFabcdef";var encoded=encodedValue var plaintext="";var i=0;while(i-1){var strQueryString=strHref.substr(strHref.indexOf("?")+1);var aQueryString=strQueryString.split("&");for(var iParam=0;iParam
");$("#TB_overlay").click(tb_remove);}}else{if(document.getElementById("TB_overlay")===null){$("body").append("
");$("#TB_overlay").click(tb_remove);}} if(tb_detectMacXFF()){$("#TB_overlay").addClass("TB_overlayMacFFBGHack");}else{$("#TB_overlay").addClass("TB_overlayBG");} if(caption===null){caption="";} $("body").append("
");$('#TB_load').show();var baseURL;if(url.indexOf("?")!==-1){baseURL=url.substr(0,url.indexOf("?"));}else{baseURL=url;} var urlString=/\.jpg$|\.jpeg$|\.png$|\.gif$|\.bmp$/;var urlType=baseURL.toLowerCase().match(urlString);if(urlType=='.jpg'||urlType=='.jpeg'||urlType=='.png'||urlType=='.gif'||urlType=='.bmp'){TB_PrevCaption="";TB_PrevURL="";TB_PrevHTML="";TB_NextCaption="";TB_NextURL="";TB_NextHTML="";TB_imageCount="";TB_FoundURL=false;if(imageGroup){TB_TempArray=$("a[@rel="+imageGroup+"]").get();for(TB_Counter=0;((TB_Counter  Next >";}else{TB_PrevCaption=TB_TempArray[TB_Counter].title;TB_PrevURL=TB_TempArray[TB_Counter].href;TB_PrevHTML="  < Prev";}}else{TB_FoundURL=true;TB_imageCount="Image "+(TB_Counter+1)+" of "+(TB_TempArray.length);}}} imgPreloader=new Image();imgPreloader.onload=function(){imgPreloader.onload=null;var pagesize=tb_getPageSize();var x=pagesize[0]-150;var y=pagesize[1]-150;var imageWidth=imgPreloader.width;var imageHeight=imgPreloader.height;if(imageWidth>x){imageHeight=imageHeight*(x/imageWidth);imageWidth=x;if(imageHeight>y){imageWidth=imageWidth*(y/imageHeight);imageHeight=y;}}else if(imageHeight>y){imageWidth=imageWidth*(y/imageHeight);imageHeight=y;if(imageWidth>x){imageHeight=imageHeight*(x/imageWidth);imageWidth=x;}} TB_WIDTH=imageWidth+30;TB_HEIGHT=imageHeight+60;$("#TB_window").append(""+caption+""+"
"+caption+"
"+TB_imageCount+TB_PrevHTML+TB_NextHTML+"
close or Esc Key
");$("#TB_closeWindowButton").click(tb_remove);if(!(TB_PrevHTML==="")){function goPrev(){if($(document).unbind("click",goPrev)){$(document).unbind("click",goPrev);} $("#TB_window").remove();$("body").append("
");tb_show(TB_PrevCaption,TB_PrevURL,imageGroup);return false;} $("#TB_prev").click(goPrev);} if(!(TB_NextHTML==="")){function goNext(){$("#TB_window").remove();$("body").append("
");tb_show(TB_NextCaption,TB_NextURL,imageGroup);return false;} $("#TB_next").click(goNext);} document.onkeydown=function(e){if(e==null){keycode=event.keyCode;}else{keycode=e.which;} if(keycode==27){tb_remove();}else if(keycode==190){if(!(TB_NextHTML=="")){document.onkeydown="";goNext();}}else if(keycode==188){if(!(TB_PrevHTML=="")){document.onkeydown="";goPrev();}}};tb_position();$("#TB_load").remove();$("#TB_ImageOff").click(tb_remove);$("#TB_window").css({display:"block"});};imgPreloader.src=url;}else{var queryString=url.replace(/^[^\?]+\??/,'');var params=tb_parseQuery(queryString);TB_WIDTH=(params['width']*1)+30||630;TB_HEIGHT=(params['height']*1)+40||440;ajaxContentW=TB_WIDTH-30;ajaxContentH=TB_HEIGHT-45;if(url.indexOf('TB_iframe')!=-1){urlNoQuery=url.split('TB_');$("#TB_iframeContent").remove();if(params['modal']!="true"){$("#TB_window").append("
"+caption+"
close or Esc Key
");}else{$("#TB_overlay").unbind();$("#TB_window").append("");}}else{if($("#TB_window").css("display")!="block"){if(params['modal']!="true"){$("#TB_window").append("
"+caption+"
close or Esc Key
");}else{$("#TB_overlay").unbind();$("#TB_window").append("
");}}else{$("#TB_ajaxContent")[0].style.width=ajaxContentW+"px";$("#TB_ajaxContent")[0].style.height=ajaxContentH+"px";$("#TB_ajaxContent")[0].scrollTop=0;$("#TB_ajaxWindowTitle").html(caption);}} $("#TB_closeWindowButton").click(tb_remove);if(url.indexOf('TB_inline')!=-1){$("#TB_ajaxContent").append($('#'+params['inlineId']).children());$("#TB_window").unload(function(){$('#'+params['inlineId']).append($("#TB_ajaxContent").children());});tb_position();$("#TB_load").remove();$("#TB_window").css({display:"block"});}else if(url.indexOf('TB_iframe')!=-1){tb_position();if($.browser.safari){$("#TB_load").remove();$("#TB_window").css({display:"block"});}}else{$("#TB_ajaxContent").load(url+="&random="+(new Date().getTime()),function(){tb_position();$("#TB_load").remove();tb_init("#TB_ajaxContent a.thickbox");$("#TB_window").css({display:"block"});});}} if(!params['modal']){document.onkeyup=function(e){if(e==null){keycode=event.keyCode;}else{keycode=e.which;} if(keycode==27){tb_remove();}};}}catch(e){}} function tb_showIframe(){$("#TB_load").remove();$("#TB_window").css({display:"block"});} function tb_remove(){$("#TB_imageOff").unbind("click");$("#TB_closeWindowButton").unbind("click");$("#TB_window").fadeOut("fast",function(){$('#TB_window,#TB_overlay,#TB_HideSelect').trigger("unload").unbind().remove();});$("#TB_load").remove();if(typeof document.body.style.maxHeight=="undefined"){$("body","html").css({height:"auto",width:"auto"});$("html").css("overflow","");} document.onkeydown="";document.onkeyup="";return false;} function tb_position(){$("#TB_window").css({marginLeft:'-'+parseInt((TB_WIDTH/2),10)+'px',width:TB_WIDTH+'px'});if(!(jQuery.browser.msie&&jQuery.browser.version<7)){$("#TB_window").css({marginTop:'-'+parseInt((TB_HEIGHT/2),10)+'px'});}} function tb_parseQuery(query){var Params={};if(!query){return Params;} var Pairs=query.split(/[;&]/);for(var i=0;i');$(this).before($.rating.groups[n].valueElem);if($.rating.groups[n].readOnly||settings.required){} else{$(this).before($('').mouseover(function(){$.rating.event.drain(n,this,settings);$(this).addClass('star_on');}).mouseout(function(){$.rating.event.reset(n,this,settings);$(this).removeClass('star_on');}).click(function(){$.rating.event.click(n,this,settings);}));}};eStar=$('');$(this).after(eStar);if(settings.half)settings.split=2;if(typeof settings.split=='number'&&settings.split>0){var stw=($.fn.width?$(eStar).width():0)||settings.starWidth;var spi=(i%settings.split),spw=Math.floor(stw/settings.split);$(eStar).width(spw).find('a').css({'margin-left':'-'+(spi*spw)+'px'})};$(eStar).addClass('star_group_'+n);if($.rating.groups[n].readOnly) $(eStar).addClass('star_readonly');else $(eStar).addClass('star_live').mouseover(function(){$.rating.event.drain(n,this,settings);$.rating.event.fill(n,this,settings,'hover');}).mouseout(function(){$.rating.event.drain(n,this,settings);$.rating.event.reset(n,this,settings);}).click(function(){$.rating.event.click(n,this,settings);});if(this.checked)$.rating.groups[n].current=eStar;$(this).remove();if(i+1==this.length)$.rating.event.reset(n,this,settings);});for(n in $.rating.groups) (function(c,v,n){if(!c)return;$.rating.event.fill(n,c,instanceSettings||{},'on');$(v).val($(c).children('a').text());}) ($.rating.groups[n].current,$.rating.groups[n].valueElem,n);return this;};})(jQuery); // /JavaScript/JQuery/jquery.prettycomments.js $.fn.prettyComments=function(settings){settings=jQuery.extend({animate:false,animationSpeed:'fast',maxHeight:500,alreadyAnimated:false,init:true},settings);$('body').append('
');var setCSS=function(which){$("#comment_hidden").css({'position':'absolute','top':-10000,'left':-10000,'width':$(which).width(),'min-height':$(which).height(),'font-family':$(which).css('font-family'),'font-size':$(which).css('font-size'),'line-height':$(which).css('line-height')});if($.browser.msie&&parseFloat($.browser.version)<7){$("#comment_hidden").css('height',$(which).height());};};var copyContent=function(which){theValue=$(which).attr('value')||"";theValue=theValue.replace(/\n/g,'
');$("#comment_hidden").html(theValue+'
');if(!settings.init){if($("#comment_hidden").height()>$(which).height()){if($('#comment_hidden').height()>settings.maxHeight){$(which).css('overflow-y','scroll');}else{$(which).css('overflow-y','hidden');expand(which);};}else if($("#comment_hidden").height()<$(which).height()){if($('#comment_hidden').height()>settings.maxHeight){$(which).css('overflow-y','scroll');}else{$(which).css('overflow-y','hidden');shrink(which);};};};};var expand=function(which){if(settings.animate&&!settings.alreadyAnimated){settings.alreadyAnimated=true;$(which).animate({'height':$("#comment_hidden").height()},settings.animationSpeed,function(){settings.alreadyAnimated=false;});}else if(!settings.animate&&!settings.alreadyAnimated){$(which).height($("#comment_hidden").height());};};var shrink=function(which){if(settings.animate&&!settings.alreadyAnimated){settings.alreadyAnimated=true;$(which).animate({'height':$("#comment_hidden").height()},settings.animationSpeed,function(){settings.alreadyAnimated=false;});}else{$(which).height($("#comment_hidden").height());};};$(this).each(function(){$(this).css({'overflow':'hidden'}).bind('keyup',function(){copyContent($(this));});setCSS(this);copyContent($(this));if($("#comment_hidden").height()>settings.maxHeight){$(this).css({'overflow-y':'scroll','height':settings.maxHeight});}else{$(this).height($("#comment_hidden").height());};settings.init=false;});}; // /JavaScript/BrowserDetect.js var BrowserDetect={init:function(){this.browser=this.searchString(this.dataBrowser)||"An unknown browser";this.version=this.searchVersion(navigator.userAgent)||this.searchVersion(navigator.appVersion)||"an unknown version";this.OS=this.searchString(this.dataOS)||"an unknown OS";},searchString:function(data){for(var i=0;i');} if($get(rowId)!=null) SetupToolTip(rowId,errString);} SetErrorHtml(String(retResult.length)+' errors have occured - hover over rows for more info');}} function LastCellKeyPress(rowId){var tableId=tableIdFromRow(rowId);var tableEl=$get(tableId+'_table');var tableRows=new Array();var curId;var lastRowId;var footerId=String(tableId+'_footer');for(var i=(tableEl.rows.length-1);i>=2;i--){curId=tableEl.rows[i].id;if((curId!=null)&&(curId!='')&&(curId!=footerId)){if(!rowIsDeleted(curId)){lastRowId=curId;break;}}} if(rowId==lastRowId)AddNewRecord(tableId);} function AddNewRecord(tableId){var templateEl=$get(String(tableId)+'_clone');var templateClone=templateEl.cloneNode(true);m_newUniqueRecordId--;templateClone.id="row_"+String(tableId)+'_'+String(m_newUniqueRecordId);$(templateClone).css('visibility','').css('display','');if(tableId=='editRoutineTable') CloneProcessing_WorkoutRoutine(templateClone);else if(tableId.indexOf('workout')!=-1) CloneProcessing_Workout(templateClone);var tableEl=$get(tableId+'_table');var lastRow=tableEl.rows[tableEl.rows.length-1];var hasFooter=(lastRow.id==String(tableId+'_footer'));var tableBody=tableBodyFromTableId(tableId);tableBody.insertBefore(templateClone,(hasFooter?lastRow:lastRow.nextSibling));m_tableController[templateClone.id]=null;m_tableController[templateClone.id]=new Array(tableId,jsPrefixFromRow(templateEl.id),m_newUniqueRecordId,'1','new','0','0');MarkAsChanged(templateClone);if((tableId.indexOf('workout')!=-1)||(tableId.indexOf('Routine')!=-1)) RegisterForDragDrop(tableId);m_curEvent_RowId=templateClone.id;if(tableId=='editRoutineTable'){PostCloneProcessing_WorkoutRoutine(templateClone);}else if(tableId.indexOf('workout')!=-1){PostCloneProcessing_Workout(templateClone);}else if(tableId.indexOf('editMealPlanTable')!=-1){PostCloneProcessing_MealPlanner(templateClone);}else if(tableId.indexOf('MealList')!=-1){if(tableId.indexOf('CommonMealList')==-1) PostCloneProcessing_Meal(templateClone);} if(BrowserDetect.browser=='Opera'){templateClone.childNodes[0].childNodes[0].focus();templateClone.childNodes[0].childNodes[0].select();}} function CloneProcessing_WorkoutRoutine(templateClone){templateClone.childNodes[0].childNodes[1].id=('suggestResultsContainer'+templateClone.id);templateClone.childNodes[0].childNodes[1].childNodes[0].id=('suggestResults'+templateClone.id);} function CloneProcessing_Workout(templateClone){templateClone.childNodes[0].childNodes[1].id=('suggestResultsContainer'+templateClone.id);templateClone.childNodes[0].childNodes[1].childNodes[0].id=('suggestResults'+templateClone.id);} function PostCloneProcessing_Workout(clonedRow){var rowId=clonedRow.id;var tbodyNode=clonedRow.parentNode;var isFacebook=false;if((m_curEvent_TableId!=null)&&(m_curEvent_TableId.indexOf('fb')!=-1)) isFacebook=true;for(var rowCount=tbodyNode.childNodes.length-2;rowCount>1;rowCount--){var candRow=tbodyNode.childNodes[rowCount];var isDeleted=(rowIsDeleted(candRow.id));if(!isDeleted){if(row_getIsResistance(candRow.id)=='1'){SelectExercise(row_getActivityId(candRow.id),false);var reps=(isFacebook?fbworkout_getReps(candRow):workout_getReps(candRow));var weight=(isFacebook?fbworkout_getWeight(candRow):workout_getWeight(candRow));var metric=(isFacebook?fbworkout_getWeightMetric(candRow):workout_getWeightMetric(candRow));if(isFacebook){fbworkout_setReps(clonedRow,reps);fbworkout_setWeight(clonedRow,weight);fbworkout_setWeightMetric(clonedRow,metric);}else{workout_setReps(clonedRow,reps);workout_setWeight(clonedRow,weight);workout_setWeightMetric(clonedRow,metric);}} break;}}} function PostCloneProcessing_WorkoutRoutine(clonedRow){var rowId=clonedRow.id;var tbodyNode=clonedRow.parentNode;for(var rowCount=tbodyNode.childNodes.length-2;rowCount>1;rowCount--){var candRow=tbodyNode.childNodes[rowCount];var isDeleted=(rowIsDeleted(candRow.id));if(!isDeleted){SelectWorkoutRoutineExercise(row_getActivityId(candRow.id),false);break;}}} function PostCloneProcessing_MealPlanner(clonedRow){var rowId=clonedRow.id;var tbodyNode=clonedRow.parentNode;for(var rowCount=tbodyNode.childNodes.length-3;rowCount>1;rowCount--){var candRow=tbodyNode.childNodes[rowCount];var isDeleted=(rowIsDeleted(candRow.id));if((rowIsDeleted(candRow.id))){mealplan_setTime(clonedRow,mealplan_getTime(candRow));break;}}} function PostCloneProcessing_Meal(clonedRow){var rowId=clonedRow.id;var tbodyNode=clonedRow.parentNode;for(var rowCount=tbodyNode.childNodes.length-3;rowCount>1;rowCount--){var candRow=tbodyNode.childNodes[rowCount];var isDeleted=(rowIsDeleted(candRow.id));if(!isDeleted){meal_setTime(clonedRow,meal_getTime(candRow));break;}}} function DeleteCell(deleteLink){var theRow=findParentRow(deleteLink);var needsAreYouSure=false;if(theRow.id.indexOf('ExerciseList')!=-1){needsAreYouSure=true;m_customActivityToUse=theRow.id.replace('row_ExerciseList_','');} if(needsAreYouSure) AreYouSure(deleteLink,'Delete exercise?','Yes','No',125,50,'AreYouSureDeleteCell(\''+theRow.id+'\');');else AreYouSureDeleteCell(theRow.id);} function AreYouSureDeleteCell(rowId){var theRow=$get(rowId);MarkAsChanged(theRow);markRowAsDeleted(theRow.id);$(theRow).css('visibility','hidden').css('display','none');} function getCountryList(){var countryId=$get('SelectCountry').value;if(countryId!='0') FitJournal_UI.WebServices.BodyDaemonWs.UserMgt_GetCityHtml(countryId,function(res){$get('selectCityContainer').innerHTML=res;},OnError,OnTimeout);} function DontShowHint(hintId){$('#Hint'+String(hintId)).css('visibility','hidden').css('display','none');FitJournal_UI.WebServices.BodyDaemonWs.DontShowHelpfulHint(hintId,User_LoggedInID,User_SecurityToken,DoNothing,OnError,OnTimeout);} function DoNothing(retResult){return true;} function HandleArticlePost(senderId){var txt=$get(senderId).value;var curArticleId=$get(ID_ArticleIDContainer).value;if((txt==null)||(txt.length==0)) alert('you havent typed anything');else FitJournal_UI.WebServices.BodyDaemonWs.PostArticleComment(txt,curArticleId,User_LoggedInID,User_SecurityToken,function(res){HandlePagingMenuClick(PAGINGID_ARTICLE_FEEDBACK,1);$get(senderId).value='';},OnError,OnTimeout);} function DeleteArticleMessage(msgId,curPage){FitJournal_UI.WebServices.BodyDaemonWs.DeleteArticleMessage(msgId,curPage,PAGINGID_ARTICLE_FEEDBACK,$get(ID_ArticleIDContainer).value,User_LoggedInID,User_SecurityToken,HandlePagingFeedbackResult,OnError,OnTimeout);} function editProfileEnterTag(){if($get('txtTagName').value=='- enter the tag name here -')$get('txtTagName').value='';} function LoadUrl(url){window.open(url,'BodyDaemon','width=600,height=600,resizable=yes,scrollbars=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,left=200,top=200');return true;} function createSingleWorkout(routineId){var dat=$get(ID_WorkoutDatePicker).value;if(dat=='') alert('No date has been entered.');else FitJournal_UI.WebServices.BodyDaemonWs.CreateWorkoutFromRoutine(routineId,dat,User_LoggedInID,User_SecurityToken,function(res){if((res==null)||(res=='')) $get('spanCreate').innerHTML='Workout has been created and populated with this routine.';else alert('There was a problem: '+res);},OnError,OnTimeout);} function loadJournalTimeline(timelineUrl){$get('iframeTimeline').src='/'+timelineUrl;} function SetElementModified(sender,newClass){sender.className=newClass;if($get('bodySaveMsgContainer')!=null){$('#bodySaveMsgContainer').css('visibility','visible').css('display','');$get('bodySaveMsg').innerHTML='Changes have not yet been saved.';if(sender.id=='selectWeightMetric') HandleBodyMetricChange(sender.value);}} function HandleBodyMetricChange(newMetric){if(newMetric=='3'){$('#bodyWeightStoneLbs').xShow();$('#bodyWeightStoneLbsLabel').xShow();}else{$('#bodyWeightStoneLbs').xHide();$('#bodyWeightStoneLbsLabel').xHide();} if((m_oldBodyWeightMetric!=null)&&(newMetric!=null)&&(m_oldBodyWeightMetric!='')&&(newMetric!='')){if((m_oldBodyWeightMetric!='0')&&(newMetric!='0')){}} m_oldBodyWeightMetric=newMetric;} function changeBodyPref(sender,enumToChange){if((null!=sender)&&(null!=sender.checked)) FitJournal_UI.WebServices.BodyDaemonWs.Body_ChangePreference(enumToChange,sender.checked,User_JournalID,User_LoggedInID,User_SecurityToken,DoNothing,DoNothing,DoNothing);} function saveBodyComp(){FitJournal_UI.WebServices.BodyDaemonWs.Body_SaveChanges(bodyCompFromScreen(),User_JournalID,User_LoggedInID,User_SecurityToken,bodyCompSaveComplete,OnError,OnTimeout);} function bodyCompSaveComplete(res){if((res==null)||(res=='')){bodyCompSaveSuccess();} else{for(i=0;i');} $('#'+validationFailedElementId).attr('class','').addClass('verysmall').addClass('FormElements').addClass('failState');SetupToolTip(validationFailedElementId,errString);} $get('bodySaveMsg').innerHTML=(m_doingBodyImageUpload?'Please resolve errors before uploading image(s).':'1 or more errors occured, please resolve them');}} function bodyCompSaveSuccess(){if((m_inFaceBook==null)||(m_inFaceBook==false)){$get('bodySaveMsg').innerHTML='Saved OK - updating view.';FitJournal_UI.WebServices.BodyDaemonWs.Body_GetEditHtml(GetJournalDate(),User_JournalID,User_LoggedInID,User_SecurityToken,function(res){$get('BodyCompositionDetails').innerHTML=res;$get('bodySaveMsg').innerHTML='Changes saved OK';},OnError,OnTimeout);}else{fbBodyCompSavePostAction();}} function bodyCompFromScreen(){var bc=new FitJournal_DS.DS_BodyComp();var journalDate=GetJournalDate();var el_weight=$get('bodyWeight');var el_weightRemainder=$get('bodyWeightStoneLbs');var el_notes=$get('bodyNotes');var el_bodyfat=$get('bodyFat');var el_waist=$get('bodyWaist');var el_chest=$get('bodyChest');var el_neck=$get('bodyNeck');var el_leftArm=$get('bodyLeftArm');var el_rightArm=$get('bodyRightArm');var el_leftQuad=$get('bodyLeftQuad');var el_rightQuad=$get('bodyRightQuad');var el_leftCalf=$get('bodyLeftCalf');var el_rightCalf=$get('bodyRightCalf');var el_weightMetric=$get('selectWeightMetric');var el_sizeMetric=$get('selectSizeMetric');bc.NeedsSaving_Weight=(el_weight!=null);bc.NeedsSaving_Bodyfat=(el_bodyfat!=null);bc.NeedsSaving_Notes=(el_notes!=null);bc.NeedsSaving_Waist=(el_waist!=null);bc.NeedsSaving_Chest=(el_chest!=null);bc.NeedsSaving_Neck=(el_neck!=null);bc.NeedsSaving_Arms_Left=(el_leftArm!=null);bc.NeedsSaving_Arms_Right=(el_rightArm!=null);bc.NeedsSaving_Legs_Left=(el_leftQuad!=null);bc.NeedsSaving_Legs_Right=(el_rightQuad!=null);bc.NeedsSaving_Calves_Left=(el_leftCalf!=null);bc.NeedsSaving_Calves_Right=(el_rightCalf!=null);bc.Date_AsString=journalDate;bc.UserID=User_JournalID;bc.Notes=(null==el_notes?'':el_notes.value);bc.BodyCompID=$get('bodyCompId').value;bc.Weight_AsString=(null==el_weight?'':el_weight.value);bc.Weight_AsString_ID=(null==el_weight?'':el_weight.id);bc.WeightRemainder_AsString=(null==el_weightRemainder?'':el_weightRemainder.value);bc.WeightRemainder_AsString_ID=(null==el_weightRemainder?'':el_weightRemainder.id);bc.Notes_AsString=(null==el_notes?'':el_notes.value);bc.Notes_AsString_ID=(null==el_notes?'':el_notes.id);bc.Neck_AsString=(null==el_neck?'':el_neck.value);bc.Neck_AsString_ID=(null==el_neck?'':el_neck.id);bc.Chest_AsString=(null==el_chest?'':el_chest.value);bc.Chest_AsString_ID=(null==el_chest?'':el_chest.id);bc.BodyFat_AsString=(null==el_bodyfat?'':el_bodyfat.value);bc.BodyFat_AsString_ID=(null==el_bodyfat?'':el_bodyfat.id);bc.Waist_AsString=(null==el_waist?'':el_waist.value);bc.Waist_AsString_ID=(null==el_waist?'':el_waist.id);bc.LeftArm_AsString=(null==el_leftArm?'':el_leftArm.value);bc.LeftArm_AsString_ID=(null==el_leftArm?'':el_leftArm.id);bc.RightArm_AsString=(null==el_rightArm?'':el_rightArm.value);bc.RightArm_AsString_ID=(null==el_rightArm?'':el_rightArm.id);bc.LeftQuad_AsString=(null==el_leftQuad?'':el_leftQuad.value);bc.LeftQuad_AsString_ID=(null==el_leftQuad?'':el_leftQuad.id);bc.RightQuad_AsString=(null==el_rightQuad?'':el_rightQuad.value);bc.RightQuad_AsString_ID=(null==el_rightQuad?'':el_rightQuad.id);bc.LeftCalf_AsString=(null==el_leftCalf?'':el_leftCalf.value);bc.LeftCalf_AsString_ID=(null==el_leftCalf?'':el_leftCalf.id);bc.RightCalf_AsString=(null==el_rightCalf?'':el_rightCalf.value);bc.RightCalf_AsString_ID=(null==el_rightCalf?'':el_rightCalf.id);bc.WeightMetric_AsString=(null==el_weightMetric?'':el_weightMetric.value);bc.SizeMetric_AsString=(null==el_sizeMetric?'':el_sizeMetric.value);return bc;} function HandleFitDirUpload(linkId){FitJournal_UI.WebServices.BodyDaemonWs.GetFitDirectoryPhotos(linkId,User_LoggedInID,User_SecurityToken,HandleFitDirUpload_Rx,OnError,OnTimeout);} function HandleFitDirUpload_Rx(res){$get('divPhotos').innerHTML=res;} function HandleBodyUpload(){FitJournal_UI.WebServices.BodyDaemonWs.GetTodaysPhotos(User_JournalID,GetJournalDate(),User_LoggedInID,User_SecurityToken,GetTodaysPhotos_Rx,OnError,OnTimeout);} function GetTodaysPhotos_Rx(retResult){$get('divTodaysPhotos').innerHTML=retResult;tb_init('[isBodyCompImageFromWs]');} function RemoveFitDirXref(imageId,linkId,sender){AreYouSure(sender,'Remove Image?','Yes','No',125,50,'RemoveFitDirXrefYes('+String(imageId)+','+String(linkId)+');');} function RemoveFitDirXrefYes(imageId,linkId){FitJournal_UI.WebServices.BodyDaemonWs.RemoveFitDirImageXref(linkId,imageId,User_LoggedInID,User_SecurityToken,HandleFitDirUpload_Rx,OnError,OnTimeout);} function RemoveBdix(imageId,sender){AreYouSure(sender,'Remove Image?','Yes','No',125,50,'RemoveBdixYes('+String(imageId)+');');} function RemoveBdixYes(imageId){FitJournal_UI.WebServices.BodyDaemonWs.DeleteBodyPhoto(imageId,User_JournalID,GetJournalDate(),User_LoggedInID,User_SecurityToken,GetTodaysPhotos_Rx,OnError,OnTimeout);} function RemoveBdixHistory(imageId,sender){AreYouSure(sender,'Remove Image?','Yes','No',125,50,'RemoveBdixHistoryYes('+String(imageId)+');');} function RemoveBdixHistoryYes(imageId){FitJournal_UI.WebServices.BodyDaemonWs.DeleteBodyPhotoHistory(imageId,User_JournalID,GetJournalDate(),User_LoggedInID,User_SecurityToken,GetTodaysPhotosHistory_Rx,OnError,OnTimeout);} function GetTodaysPhotosHistory_Rx(retResult){$get('divRecentPhotos').innerHTML=retResult;} function GetInjuryProgress(injuryId){$get('hiddenInjuryId').value=injuryId;FitJournal_UI.WebServices.BodyDaemonWs.GetInjuryProgress(injuryId,User_LoggedInID,User_SecurityToken,GetJournalDate(),function(res){$('#divSelectedInjury').attr('innerHTML',res).css('visibility','visible').css('display','block');if($('#trInjuryError')!=null) $('#trInjuryError').css('visibility','').css('display','');if($get('txtProgress')!=null){$get('txtProgress').focus();$get('txtProgress').select();} $get('divInjuryHistoryHeader').scrollIntoView(true);},OnError,OnTimeout);} function SaveInjuryProgress(dateToSave){FitJournal_UI.WebServices.BodyDaemonWs.SaveInjuryProgress($get('hiddenInjuryId').value,$get('txtProgress').value,$get('txtComments').value,dateToSave,User_LoggedInID,User_SecurityToken,function(res){if((res!=null)&&(res.length>0)){$('#trInjuryError').css('visibility','').css('display','');$('#tdInjuryError').attr('innerHTML',''+res+'');}else{$('#trInjuryError').css('visibility','').css('display','');$('#tdInjuryError').attr('innerHTML','Progress saved succesfully.');$('#txtProgress').attr('class','').addClass('FormElements').addClass('verysmall');$('#txtComments').attr('class','').addClass('FormElements').addClass('injuryProg');FitJournal_UI.WebServices.BodyDaemonWs.GetInjuryTable(User_LoggedInID,User_JournalID,User_SecurityToken,GetJournalDate(),function(innerRes){$('#injuryListContainer').attr('innerHTML',innerRes);},OnError,OnTimeout);}},OnError,OnTimeout);} function SetupToolTip(elementId,toolTipContents){if(Browser_Firefox()) $get(elementId).setAttribute('onmouseover','Tip(\''+toolTipContents+'\') ');else $get(elementId).attachEvent('onmouseover',function(){Tip(toolTipContents);});} function GetNiceDate(year,month,day){return String(day)+' '+m_names[Number(month)-1]+' '+String(year);} function GetNiceJournalDate(year,month,day){var sup='';switch(Number(day)) {case 1:case 21:case 31:sup='st';break;case 21:sup='st';break;case 2:case 22:sup='nd';break;case 3:case 23:sup='rd';break;default:sup='th';break;} var jDate=new Date();jDate.setFullYear(year);jDate.setMonth(month-1);jDate.setDate(day);return('

'+m_dayNames[jDate.getDay()]+' '+String(day)+''+sup+' '+m_names[jDate.getMonth()]+'

');} function OnError(retResult){alert('There was an unexpected problem (error). Please try again.');} function OnTimeout(retResult){alert('There was an unexpected problem (timeout). Please try again.');} function getQueryStringArgs(){var args=new Object();var query=location.search.substring(1);var pairs=query.split("&");for(var i=0;i0){}else{eval(m_areYouSureEval);}}else{eval(m_areYouSureEval);}} HideAreYouSure();} function HandleGenericGoalClick(sender){var goalId=sender.id.replace('genericgoal','');FitJournal_UI.WebServices.BodyDaemonWs.SaveGenericGoal(goalId,sender.checked,User_JournalID,User_LoggedInID,User_SecurityToken,DoNothing,OnError,OnTimeout);} function DeleteGoal(goalId,sender){AreYouSure(sender,'Delete Goal?','Yes','No',125,50,'DeleteGoalYes('+String(goalId)+');');} function DeleteGoalYes(goalId){FitJournal_UI.WebServices.BodyDaemonWs.DeleteGoal(goalId,User_LoggedInID,User_SecurityToken,GetJournalDate(),function(res){$get('currentGoals').innerHTML=res;$get('divGoalDetail').innerHTML='';},OnError,OnTimeout);} function SelectGoalDetail(goalId){FitJournal_UI.WebServices.BodyDaemonWs.SelectGoalDetail(goalId,User_LoggedInID,User_SecurityToken,GetJournalDate(),function(res){$('#divGoalDetail').attr('innerHTML',res);var tableBody=$get('goalListTable').childNodes[0];for(var goalRow=0;goalRow' +'
' +'Loading' +'
' +'Please wait - loading..' +'';$('#'+curDivContent).xHtml(loadingDiv);}catch(ex){} switch(pagingMenuId){case PAGINGID_JOURNAL_FEEDBACK:ProcessJournalFeedbackPaging(pageNo);break;case PAGINGID_ALLUSERS:ProcessAllUsersPaging(pageNo);break;case PAGINGID_ADMIN_USERMGT:ProcessUserMgtPaging(pageNo);break;case PAGINGID_EXERCISE_MGT:ProcessExerciseMgtPaging(pageNo);break;case PAGINGID_BUDDYLIST:ProcessBuddyListPaging(pageNo);break;case PAGINGID_BLOG:ProcessBlogListPaging(pageNo);break;case PAGINGID_ADMIN_ERRORS:ParseErrorLogSearchCriteria(pageNo);break;case PAGINGID_GROUPMESSAGES:ProcessGroupMessagePaging(pageNo);break;case PAGINGID_WORKOUTHISTORY:ProcessWorkoutHistoryPaging(pageNo);break;case PAGINGID_BODYGALLERY:ProcessBodyGalleryPaging(pageNo);break;case PAGINGID_ARTICLE_FEEDBACK:ProcessArticlePaging(pageNo);break;case PAGINGID_FITDIR_FEEDBACK:ProcessFitDirFeedback(pageNo);break;case PAGINGID_FITDIR_LISTING:ProcessFitDirListing(pageNo);break;}} function ProcessFitDirListing(pageNo){var speciality='-1';if($get('ddlSpeciality')!=null) speciality=$get('ddlSpeciality').value;FitJournal_UI.WebServices.BodyDaemonWs.FitDir_GetListingPage(pageNo,PAGINGID_FITDIR_LISTING,curFdEntityType,$get('ddlCountry').value,$get('ddlCity').value,$get('txtAddress').value,$get('txtName').value,speciality,User_LoggedInID,User_SecurityToken,HandlePagingFeedbackResult,OnError,OnTimeout);} function ProcessFitDirFeedback(pageNo){FitJournal_UI.WebServices.BodyDaemonWs.FitDir_GetFeedbackPage(pageNo,PAGINGID_FITDIR_FEEDBACK,curFdEntityId,User_LoggedInID,User_SecurityToken,HandlePagingFeedbackResult,OnError,OnTimeout);} function ProcessJournalFeedbackPaging(pageNo){FitJournal_UI.WebServices.BodyDaemonWs.Feedback_GetFeedbackPage(pageNo,PAGINGID_JOURNAL_FEEDBACK,User_JournalID,User_LoggedInID,User_SecurityToken,HandlePagingFeedbackResult,OnError,OnTimeout);} function ProcessAllUsersPaging(pageNo){var genericGoals=new Array();var goalContainer=$get('genericGoalTBody');var counter=0;for(var i=0;i0)){var curCheckbox=curCell.childNodes[0];if((curCheckbox.id!=null)&&(curCheckbox.id.indexOf('genericgoal')!=-1)){if(curCheckbox.checked){genericGoals[counter]=curCheckbox.value;counter+=1;}}}}} if(genericGoals.length>3){alert('To keep searches fast, a maximum of 3 goals/interests may be chosen (you chose '+String(genericGoals.length)+').');}else{for(var i=counter;i<3;i++){genericGoals[i]=0;} FitJournal_UI.WebServices.BodyDaemonWs.Users_GetJournalListing(pageNo,PAGINGID_ALLUSERS,User_LoggedInID,$('#OrderResultsBy').val(),User_SecurityToken,$('#SelectCountry').val(),$('#SelectCity').val(),$('#UserNameFilter').val(),$('#GenderFilter').val(),genericGoals[0],genericGoals[1],genericGoals[2],HandlePagingFeedbackResult,OnError,OnTimeout);}} function ProcessUserMgtPaging(pageNo){FitJournal_UI.WebServices.BodyDaemonWs.UserMgt_GetList(pageNo,PAGINGID_ADMIN_USERMGT,User_LoggedInID,User_SecurityToken,$('#UserStatusFilter').val(),$('#UserNameFilter').val(),$('#OrderResultsBy').val(),HandlePagingFeedbackResult,OnError,OnTimeout);} function ProcessBuddyListPaging(pageNo){var txtSearch=(($get('txtFriendSearch')!=null)&&($('#txtFriendSearch').val()!='- enter a name to search for -'))?$('#txtFriendSearch').val():'';FitJournal_UI.WebServices.BodyDaemonWs.Users_GetBuddyList(txtSearch,pageNo,PAGINGID_BUDDYLIST,User_LoggedInID,User_JournalID,User_SecurityToken,HandlePagingFeedbackResult,OnError,OnTimeout);} function ProcessBlogListPaging(pageNo){FitJournal_UI.WebServices.BodyDaemonWs.GetBlogPosts(pageNo,PAGINGID_BLOG,User_LoggedInID,User_JournalID,User_SecurityToken,HandlePagingFeedbackResult,OnError,OnTimeout);} function ProcessWorkoutHistoryPaging(pageNo){FitJournal_UI.WebServices.BodyDaemonWs.GetWorkoutHistoryPaging(User_JournalID,pageNo,PAGINGID_WORKOUTHISTORY,User_LoggedInID,User_SecurityToken,HandlePagingFeedbackResult,OnError,OnTimeout);} function LogCriteriaFromScreen(){var logCriteria=new FitJournal_DS.DS_Ajax_LoggingSearchCriteria();logCriteria.MinDate=$('#txtMinDate').val();logCriteria.MaxDate=$('#txtMaxDate').val();logCriteria.Level=$('#txtLevel').val();logCriteria.Logger=$('#txtLogger').val();logCriteria.Message=$('#txtMessage').val();logCriteria.LogException=$('#txtException').val();logCriteria.ErrorTicketFilter=$('#txtErrorTicket').val();return logCriteria;} function ParseErrorLogSearchCriteria(pageNo){FitJournal_UI.WebServices.FitEngineAdmin.ValidateErrorLogSearchCriteria(LogCriteriaFromScreen(),function(res){if((res!=null)&&(res.length>0)){$('#errMsgContainer').css('visibility','visible').css('display','block');$('#errMsg').attr('innerHTML',res);}else{$('#errMsgContainer').css('visibility','hidden').css('display','none');FitJournal_UI.WebServices.FitEngineAdmin.GetErrorLogs(pageNo,LogCriteriaFromScreen(),PAGINGID_ADMIN_ERRORS,User_LoggedInID,User_SecurityToken,HandlePagingFeedbackResult,OnError,OnTimeout);}},OnError,OnTimeout);} function ProcessArticlePaging(pageNo){FitJournal_UI.WebServices.BodyDaemonWs.GetArticleCommentPaging($('#'+ID_ArticleIDContainer).val(),pageNo,PAGINGID_ARTICLE_FEEDBACK,User_LoggedInID,User_SecurityToken,HandlePagingFeedbackResult,OnError,OnTimeout);} function GetMainContentId(thePagMenuId){var res='';switch(thePagMenuId){case PAGINGID_JOURNAL_FEEDBACK:res='journalComments';break;case PAGINGID_ARTICLE_FEEDBACK:res='articleComments';break;case PAGINGID_ALLUSERS:res='allUserList';break;case PAGINGID_ADMIN_USERMGT:res='divUserTable';break;case PAGINGID_EXERCISE_MGT:res='divExerciseTable';break;case PAGINGID_IMAGEAPPROVAL:res='divImgPagingContent';break;case PAGINGID_BUDDYLIST:res='divBuddyPagingContent';break;case PAGINGID_BLOG:res='blogPagingContent';break;case PAGINGID_ADMIN_ERRORS:res='pagingErrorContent';break;case PAGINGID_WORKOUTHISTORY:res='workoutContent';break;case PAGINGID_BODYGALLERY:res='bodyPagingContent';break;case PAGINGID_FITDIR_FEEDBACK:res='divComments';break;case PAGINGID_FITDIR_LISTING:res='divPagingContent';break;} return res;} function HandlePagingFeedbackResult(res){var pagTop=null;var pagBot=null;var pagMain=null;var pagCounter=null;var scrollTo=null;switch(res.PagingMenuId){case PAGINGID_JOURNAL_FEEDBACK:pagTop='journalFeedbackTopPagingMenu';pagBot='journalFeedbackBottomPagingMenu';pagMain='journalComments';scrollTo='journalFeedbackTopPagingMenu';break;case PAGINGID_ARTICLE_FEEDBACK:pagTop='articleFeedbackTopPagingMenu';pagBot='articleFeedbackBottomPagingMenu';pagMain='articleComments';break;case PAGINGID_ALLUSERS:pagMain='allUserList';if($get('allUserListTopPagingMenu')!=null)pagTop='allUserListTopPagingMenu';if($get('allUserListBottomPagingMenu')!=null)pagBot='allUserListBottomPagingMenu';if($get('userCountContainer')!=null)pagCounter='userCountContainer';scrollTo='userCountContainer';break;case PAGINGID_ADMIN_USERMGT:pagTop='divUserPagingTop';pagBot='divUserPagingBottom';pagMain='divUserTable';pagCounter='resultCount';break;case PAGINGID_EXERCISE_MGT:pagTop='divExercisePagingTop';pagBot='divExercisePagingBottom';pagMain='divExerciseTable';pagCounter='resultCount';break;case PAGINGID_IMAGEAPPROVAL:pagTop='divImgPagingTop';pagBot='divImgPagingBottom';pagMain='divImgPagingContent';pagCounter='resultCount';break;case PAGINGID_BUDDYLIST:if($get('divBuddyPagingContent')!=null)pagMain='divBuddyPagingContent';if($get('divBuddyPagingTop')!=null)pagTop='divBuddyPagingTop';if($get('divBuddyPagingBottom')!=null)pagBot='divBuddyPagingBottom';scrollTo='divFriendsHeaderId';break;case PAGINGID_BLOG:pagTop='blogPagingUpper';pagBot='blogPagingLower';pagMain='blogPagingContent';pagCounter='blogCount';break;case PAGINGID_ADMIN_ERRORS:pagTop='pagingErrorUpper';pagBot='pagingErrorLower';pagMain='pagingErrorContent';pagCounter='pagingErrorCount';break;case PAGINGID_WORKOUTHISTORY:pagTop='workoutTopPaging';pagBot='workoutBottomPaging';pagMain='workoutContent';pagCounter='recordCountMessage';break;case PAGINGID_BODYGALLERY:pagTop='bodyPagingMenu';pagMain='bodyPagingContent';break;case PAGINGID_FITDIR_FEEDBACK:pagTop='feedbackTopPagingMenu';pagMain='divComments';pagBot='feedbackBottomPagingMenu';break;case PAGINGID_FITDIR_LISTING:pagTop='topPagingMenu';pagBot='bottomPagingMenu';pagMain='divPagingContent';pagCounter='countMsg';break;} if(pagTop!=null)$('#'+pagTop).attr('innerHTML',res.PagingMenuHtml);if(pagBot!=null)$('#'+pagBot).attr('innerHTML',res.PagingMenuHtml);if(pagMain!=null){try{$('#'+pagMain).hide().xHtml(res.ContentHtml).fadeIn('slow');}catch(ex){$('#'+pagMain).attr('innerHTML',res.ContentHtml);}} if(pagCounter!=null)$('#'+pagCounter).attr('innerHTML',res.RecordCountMsg);if(scrollTo!=null)$get(scrollTo).scrollIntoView(true);if(res.PagingMenuId==PAGINGID_WORKOUTHISTORY)$('a.clueLink').cluetip({dropShadow:false});} function meal_getTime(mealRow){return mealRow.childNodes[0].childNodes[0].value;} function meal_setTime(mealRow,val){mealRow.childNodes[0].childNodes[0].value=val;} function meal_getDescription(mealRow){return mealRow.childNodes[1].childNodes[0].value;} function meal_getDescriptionEl(mealRow){return mealRow.childNodes[1].childNodes[0];} function meal_setDescription(mealRow,val){mealRow.childNodes[1].childNodes[0].value=val;} function meal_getCarbs(mealRow){return mealRow.childNodes[4].childNodes[0].value;} function meal_setCarbs(mealRow,val){mealRow.childNodes[4].childNodes[0].value=val;} function meal_getFat(mealRow){return mealRow.childNodes[5].childNodes[0].value;} function meal_setFat(mealRow,val){mealRow.childNodes[5].childNodes[0].value=val;} function meal_getProtein(mealRow){return mealRow.childNodes[6].childNodes[0].value;} function meal_setProtein(mealRow,val){mealRow.childNodes[6].childNodes[0].value=val;} function meal_getCalories(mealRow){return mealRow.childNodes[7].childNodes[0].value;} function meal_setCalories(mealRow,val){mealRow.childNodes[7].childNodes[0].value=val;} function mealplan_getTime(mealRow){return mealRow.childNodes[0].childNodes[0].value;} function mealplan_setTime(mealRow,val){mealRow.childNodes[0].childNodes[0].value=val;} function mealplan_getDescription(mealRow){return mealRow.childNodes[1].childNodes[0].value;} function mealplan_getDescriptionEl(mealRow){return mealRow.childNodes[1].childNodes[0];} function mealplan_setDescription(mealRow,val){mealRow.childNodes[1].childNodes[0].value=val;} function mealplan_getCarbs(mealRow){return mealRow.childNodes[2].childNodes[0].value;} function mealplan_setCarbs(mealRow,val){mealRow.childNodes[2].childNodes[0].value=val;} function mealplan_getFat(mealRow){return mealRow.childNodes[4].childNodes[0].value;} function mealplan_setFat(mealRow,val){mealRow.childNodes[4].childNodes[0].value=val;} function mealplan_getProtein(mealRow){return mealRow.childNodes[3].childNodes[0].value;} function mealplan_setProtein(mealRow,val){mealRow.childNodes[3].childNodes[0].value=val;} function mealplan_getCalories(mealRow){return mealRow.childNodes[5].childNodes[0].value;} function mealplan_setCalories(mealRow,val){mealRow.childNodes[5].childNodes[0].value=val;} function commonMeal_getDescription(mealRow){return mealRow.childNodes[0].childNodes[0].value;} function commonMeal_getDescriptionEl(mealRow){return mealRow.childNodes[0].childNodes[0];} function commonMeal_setDescription(mealRow,val){mealRow.childNodes[0].childNodes[0].value=val;} function commonMeal_getCarbs(mealRow){return mealRow.childNodes[1].childNodes[0].value;} function commonMeal_setCarbs(mealRow,val){mealRow.childNodes[1].childNodes[0].value=val;} function commonMeal_getFat(mealRow){return mealRow.childNodes[2].childNodes[0].value;} function commonMeal_setFat(mealRow,val){mealRow.childNodes[2].childNodes[0].value=val;} function commonMeal_getProtein(mealRow){return mealRow.childNodes[3].childNodes[0].value;} function commonMeal_setProtein(mealRow,val){mealRow.childNodes[3].childNodes[0].value=val;} function commonMeal_getCalories(mealRow){return mealRow.childNodes[4].childNodes[0].value;} function commonMeal_setCalories(mealRow,val){mealRow.childNodes[4].childNodes[0].value=val;} function meal_FromRow(mealRowId){return meal_FromRowEl($get(mealRowId));} function meal_FromRowEl(mealRow){var meal=new FitJournal_DS.DS_Meal();meal.MealID=entityIdFromRow(mealRow.id);meal.AjaxIsDeleted=(rowIsDeleted(mealRow.id));meal.Time_AsString=meal_getTime(mealRow);if((m_inFaceBook==null)||(m_inFaceBook==false)) meal.Date_AsString=GetJournalDate();else meal.Date_AsString=$get('curFbDate').value;meal.UserID=User_JournalID;meal.Description=meal_getDescription(mealRow);meal.Carbs_AsString=meal_getCarbs(mealRow);meal.Fat_AsString=mealRow.childNodes[5].childNodes[0].value;meal.Protein_AsString=mealRow.childNodes[6].childNodes[0].value;meal.Calories_As_String=mealRow.childNodes[7].childNodes[0].value;meal.IsCommonMeal=false;meal.AjaxRowId=mealRow.id;return meal;} function commonmeal_FromRow(mealRowId){return commonmeal_FromRowEl($get(mealRowId));} function commonmeal_FromRowEl(mealRow){var meal=new FitJournal_DS.DS_Meal();meal.MealID=entityIdFromRow(mealRow.id);meal.AjaxIsDeleted=(rowIsDeleted(mealRow.id));meal.Date_AsString=GetJournalDate();meal.Description=commonMeal_getDescription(mealRow);meal.Carbs_AsString=commonMeal_getCarbs(mealRow);meal.Fat_AsString=commonMeal_getFat(mealRow);meal.Protein_AsString=commonMeal_getProtein(mealRow);meal.Calories_As_String=commonMeal_getCalories(mealRow);meal.IsCommonMeal=true;meal.UserID=User_JournalID;meal.AjaxRowId=mealRow.id;return meal;} function SelectCommonMeal(itemId){FitJournal_UI.WebServices.BodyDaemonWs.Food_GetCommonMeal(itemId,$('#txtFavePortions').val(),User_JournalID,User_SecurityToken,CommonMealRx,OnError,OnTimeout);} function CommonMealRx(res){var mealRow=$get(m_curEvent_RowId);if(null!=res){var curDesc=meal_getDescription(mealRow);var newDesc='';var newProtein=meal_getProtein(mealRow);var newCarbs=meal_getCarbs(mealRow);var newFat=meal_getFat(mealRow);var newCalorie=meal_getCalories(mealRow);newProtein=Number((IsNumeric(newProtein)?newProtein:'0'))+res.Protein;newCarbs=Number((IsNumeric(newCarbs)?newCarbs:'0'))+res.Carbs;newFat=Number((IsNumeric(newFat)?newFat:'0'))+res.Fat;newCalorie=Number((IsNumeric(newCalorie)?newCalorie:'0'))+res.Calorie;if((curDesc!=null)&&(curDesc!='')) newDesc=(curDesc+', ');newDesc=(newDesc+res.Description);meal_setDescription(mealRow,newDesc);meal_setProtein(mealRow,newProtein);meal_setCarbs(mealRow,newCarbs);meal_setFat(mealRow,newFat);meal_setCalories(mealRow,newCalorie);MarkAsChanged(mealRow);}} function ClearMeal(sender){var mealRow=findParentRow(sender);meal_setDescription(mealRow,'');$(meal_getDescriptionEl(mealRow)).css('height','20px');meal_setProtein(mealRow,'0');meal_setFat(mealRow,'0');meal_setCarbs(mealRow,'0');meal_setCalories(mealRow,'0');} function UpdateMealTotals(tableId){$get('MealList_footer').childNodes[0].innerHTML='Totals
Will be recalculated after next save)';} function GetCals(meal){var carbs=0;var protein=0;var fat=0;var calories=0;if(IsNumeric(meal.Carbs_AsString))carbs=Number(meal.Carbs_AsString);if(IsNumeric(meal.Fat_AsString))fat=Number(meal.Fat_AsString);if(IsNumeric(meal.Protein_AsString))protein=Number(meal.Protein_AsString);calories=(Number(carbs)*4)+(Number(protein)*4)+(Number(fat)*9) return calories;} function CommonMacroNutrientChange(mealNutrientInputField){var theRow=findParentRow(mealNutrientInputField);if($get('MealEdit_CalculateCalories').checked) commonMeal_setCalories(theRow,GetCals(commonmeal_FromRowEl(theRow)));MarkAsChanged(theRow);} function MacroNutrientChange(mealNutrientInputField){var theRow=findParentRow(mealNutrientInputField);if($get('MealEdit_CalculateCalories').checked) meal_setCalories(theRow,GetCals(meal_FromRowEl(theRow)));MarkAsChanged(theRow);} function MealPlanDay_MacroNutrientChange(mealNutrientInputField){var theRow=findParentRow(mealNutrientInputField);if($get('MealEdit_CalculateCalories').checked) mealplan_setCalories(theRow,GetCals(mealplanday_FromRowEl(theRow)));MarkAsChanged(theRow);} function RefreshFoodEditView(){FitJournal_UI.WebServices.BodyDaemonWs.Food_GetTableHtml_Edit(GetJournalDate(),User_JournalID,User_LoggedInID,User_SecurityToken,RefreshDataOnComplete,OnError,OnTimeout);} function RefreshCommonFoodEditView(refreshContext){m_refreshCommonMealContext=refreshContext;FitJournal_UI.WebServices.BodyDaemonWs.CommonFood_GetTableHtml_Edit(User_JournalID,User_LoggedInID,User_SecurityToken,RefreshDataOnComplete,OnError,OnTimeout);} function EditMealPostRefreshProcess(){FitJournal_UI.WebServices.BodyDaemonWs.Food_GetMealObservations(GetJournalDate(),User_JournalID,User_LoggedInID,User_SecurityToken,MealObservationOnComplete,OnError,OnTimeout);} function MealObservationOnComplete(res){if($get('MealObservations')!=null)$('#MealObservations').attr('innerHTML',res);} function EditCommonMealPostRefreshProcess(){} function IsNumeric(sText){var ValidChars="0123456789.";var IsNumber=true;for(numberI=0;numberI');} SetElementFailedValidation(validationFailedElementId);SetupToolTip(validationFailedElementId,errString);}}} function SaveMealDayInfoSuccess(){if((m_inFaceBook==null)||(m_inFaceBook==false)) FitJournal_UI.WebServices.BodyDaemonWs.Food_GetMealDayInfoHtml(GetJournalDate(),User_JournalID,User_LoggedInID,User_SecurityToken,function(res){$('#mealDayInfo').attr('innerHTML',res);},OnError,OnTimeout);else RefreshMealDayInfoEditFb();} function RefreshFoodDbList(){var searchFor=$('#txtSearchFoodName').val();if(searchFor.length>=3) FitJournal_UI.WebServices.BodyDaemonWs.Food_GetUsdaFoods(searchFor,function(res){$('#usdaSearchResults').attr('innerHTML',res);},OnError,OnTimeout);else alert('Must be at least 3 characters.');} function ShowUsdaResult(mealId){$('#curMealId').val(mealId);FitJournal_UI.WebServices.BodyDaemonWs.Food_GetSingleUsdaFood(mealId,function(res){$('#singleUsdaContainer').css('visibility','visible').css('display','block');$('#portionControlContainer').attr('innerHTML',res.WeightControlHtml);$('#nutrientTableContainer').attr('innerHTML',res.NutrientTableHtml);},OnError,OnTimeout);} function GetNutrientTable(){FitJournal_UI.WebServices.BodyDaemonWs.Food_GetUsdaFoodNutrientTable($('#curMealId').val(),$('#chosenWeight').val(),function(res){$('#nutrientTableContainer').attr('innerHTML',res);},OnError,OnTimeout);} function SelectUsdaFood(){var selectedMealId=$('#curMealId').val();var weightId=$('#chosenWeight').val();var numMeals=Number($('#txtNumPortions').val());var errMsg='';if(selectedMealId=='0') errMsg='No food has been selected from the list.';if(isNaN(numMeals)){errMsg='# portions not numeric.';}else{if(numMeals<=0) errMsg='# portions is less than, or equal to, zero.';} if(errMsg!=''){$('#usdaErrorMsg').attr('innerHTML',''+errMsg+'');$('#usdaErrorRow').css('visibility','visible').css('display','block');}else{FitJournal_UI.WebServices.BodyDaemonWs.Food_GetUsdaAsNormalMeal(selectedMealId,weightId,numMeals,CommonMealRx,OnError,OnTimeout);TidyUpUsdaPicker();closeLightBox('foodDbLightBoxWindow');}} function CancelSelectUsdaFood(){TidyUpUsdaPicker();closeLightBox('foodDbLightBoxWindow');} function TidyUpUsdaPicker(){$('#usdaSearchResults').attr('innerHTML','
  • - search results go here -
');$('#curMealId').val('0');$('#portionControlContainer').attr('innerHTML','Once a food has been selected, it\'s nutritional value will be shown here.');$('#nutrientTableContainer').attr('innerHTML','');} function cancelFoodPicker(){closeLightBox('commonFoodPickerLightBox');} function ImportMealDayToJournal(mealDayId){FitJournal_UI.WebServices.BodyDaemonWs.MealPlan_ImportToJournal(mealDayId,User_LoggedInID,User_SecurityToken,function(res){alert('Day imported to journal succesfully');},OnError,OnTimeout);} function SelectEditMealPlanDay(mealDayId){FitJournal_UI.WebServices.BodyDaemonWs.MealPlanner_GetEditMealPlanDayHtml(mealDayId,User_JournalID,User_LoggedInID,User_SecurityToken,function(res){$('#mealPlanDay').attr('innerHTML',res.TableHtml);eval(res.ControllerJs);MakeMealPlanDayContainerVisible();HighlightCurrentMealPlanDay();$get('divMealPlanDayHeader').scrollIntoView(true);},OnError,OnTimeout);} function SelectViewMealPlanDay(mealDayId){FitJournal_UI.WebServices.BodyDaemonWs.MealPlanner_GetViewMealPlanDayHtml(mealDayId,User_JournalID,User_LoggedInID,User_SecurityToken,function(res){$get('mealPlanDay').innerHTML=res.TableHtml;MakeMealPlanDayContainerVisible();HighlightCurrentMealPlanDay();$get('divMealPlanDayHeader').scrollIntoView(true);},OnError,OnTimeout);} function MakeMealPlanDayContainerVisible(){$('#mealPlanDay').css('visibility','visible').css('display','block');} function HighlightCurrentMealPlanDay(){var curMealDayId='0';var curMealDayCtrl=$get('currentMealPlanDayId');if(curMealDayCtrl!=null) curMealDayId=curMealDayCtrl.value;var tableBody=$get('mealDayListTable').childNodes[0];for(var mealRow=0;mealRow0)) alert(res);else HandleFeedbackPost();},OnError,OnTimeout);} function HandleFeedbackPost(){var senderId=m_feedback_senderId;var txt=$get(senderId).value;if((txt==null)||(txt.length==0)){alert('you havent typed anything');}else{FitJournal_UI.WebServices.BodyDaemonWs.PostJournalComment(txt,User_JournalID,User_LoggedInID,User_SecurityToken,function(res){HandlePagingMenuClick(PAGINGID_JOURNAL_FEEDBACK,1);ReloadRecentActivity();},OnError,OnTimeout);$get(senderId).value='';}} function ReloadRecentActivity(){if($get('divRecentActivity')!=null) FitJournal_UI.WebServices.BodyDaemonWs.GetRecentActivity(User_JournalID,User_LoggedInID,User_SecurityToken,function(res){$('#divRecentActivity').xHtml(res);},OnError,OnTimeout);} function DeleteMessageInbox(msgId){FitJournal_UI.WebServices.BodyDaemonWs.DeleteInboxMessage(msgId,User_LoggedInID,User_SecurityToken,function(res){$('#'+('msgRow'+String(res))).xHide();UpdateInboxCount();},OnError,OnTimeout);} function DeleteSentMessage(msgId){FitJournal_UI.WebServices.BodyDaemonWs.DeleteSentMessage(msgId,User_LoggedInID,User_SecurityToken,function(res){$('#'+('msgRow'+String(res))).xHide();UpdateInboxCount},OnError,OnTimeout);} function UpdateInboxCount(){FitJournal_UI.WebServices.BodyDaemonWs.GetInboxCount(User_LoggedInID,User_SecurityToken,function(res){if($get('ChildLink8005')!=null) $('#ChildLink8005').xHtml(res);},OnError,OnTimeout);} function DeleteFeedbackMessage(msgId,curPage){FitJournal_UI.WebServices.BodyDaemonWs.DeleteFeedbackMessage(msgId,curPage,PAGINGID_JOURNAL_FEEDBACK,User_JournalID,User_LoggedInID,User_SecurityToken,HandlePagingFeedbackResult,OnError,OnTimeout);} function DeleteBlogPost(blogId,curPage,sender){AreYouSure(sender,'Delete Blog Post?','Yes','No',175,50,'DeleteBlogPostYes('+String(blogId)+','+String(curPage)+');');} function DeleteBlogPostYes(blogId,curPage){FitJournal_UI.WebServices.BodyDaemonWs.DeleteBlogPost(blogId,curPage,PAGINGID_BLOG,User_JournalID,User_LoggedInID,User_SecurityToken,HandlePagingFeedbackResult,OnError,OnTimeout);} function RemoveClientUser(userId,sender){AreYouSure(sender,'Are you sure you want to remove this client?','Yes','No',200,75,'RemoveClientUserYes('+String(userId)+');');} function RemoveClientUserYes(userId){FitJournal_UI.WebServices.BodyDaemonWs.RemoveExpertAssociation(userId,User_LoggedInID,User_LoggedInID,User_SecurityToken,function(res){$('#divClientTableContainer').xHtml(res);},OnError,OnTimeout);} function RemoveExpertUser(userId,sender){AreYouSure(sender,'Are you sure you want to remove this coach?','Yes','No',200,75,'RemoveExpertUserYes('+String(userId)+');');} function RemoveExpertUserYes(userId){FitJournal_UI.WebServices.BodyDaemonWs.RemoveExpertAssociation(User_LoggedInID,userId,User_LoggedInID,User_SecurityToken,function(res){$('#divExpertTableContainer').xHtml(res);},OnError,OnTimeout);} function RemoveTag(tagId){FitJournal_UI.WebServices.BodyDaemonWs.DeleteTag(tagId,User_LoggedInID,User_SecurityToken,ChangeTags_Rx,OnError,OnTimeout);} function AddTag(){var tagName=$get('txtTagName').value;if((tagName==null)||(tagName.length<3)||(tagName.length>50)){$('#tagError').xShowBlock().xHtml('Tags must be at least 3, and no more than 50, characters in length.');}else{$('#tagError').xHide();$('#txtTagName').val('');FitJournal_UI.WebServices.BodyDaemonWs.AddTag(tagName,User_LoggedInID,User_SecurityToken,ChangeTags_Rx,OnError,OnTimeout);}} function ChangeTags_Rx(res){$('#divTagList').xHtml(res);} function HandleAvatarUpload(){FitJournal_UI.WebServices.BodyDaemonWs.GetAvatar(User_LoggedInID,User_LoggedInID,User_SecurityToken,function(res){$('#avatarContainerDiv').xHtml(res.UploadControlPreview);$('#mainAvatarContainer').xHtml(res.JournalAvatarImg);},OnError,OnTimeout);} function HandleHeightChange(){if($('#heightMetric').val()=='2'){$('#txtHeightInch').xShow();$('#spanHeightInch').xShow();}else{$('#txtHeightInch').xHide();$('#spanHeightInch').xHide();}} function ReActivateHints(){FitJournal_UI.WebServices.BodyDaemonWs.ResetHelpfulHints(User_LoggedInID,User_SecurityToken,function(res){$('#resetHintResult').xShowBlock().xHtml('All hints have been reset, and will be re-shown');},OnError,OnTimeout);} function enterFriendSearch(){if(($get('txtFriendSearch')!=null)&&($('#txtFriendSearch').val()=='- enter a name to search for -')) $('#txtFriendSearch').val('');} function addFriendEmail(){var curTbody=$get('emailFriendTbody');var newRow=curTbody.rows[0].cloneNode(true);if((newRow.cells==null)||(newRow.cells.length==null)) newRow.childNodes[0].childNodes[0].value='- enter e-mail address -';else newRow.cells[0].childNodes[0].value='- enter e-mail address -';curTbody.appendChild(newRow);} function checkEmailAddr(sender){if(sender.value=='- enter e-mail address -')sender.value='';} function checkEmailMsg(sender){if(sender.value=='If you want to include an optional message, type it here.') sender.value='';if((sender.value!='')){$('#extraMsg').xShowBlock();$('#extraMsgContent').xHtml(sender.value);}else{$('#extraMsg').xHide();}} function removeEmailRow(sender){var row=sender.parentNode.parentNode;var curTbody=$get('emailFriendTbody');if(curTbody.rows.length>1) curTbody.removeChild(row);} function DoFriendEmail(){var all=new Array();var curTbody=$get('emailFriendTbody');var idx=0;if((curTbody.rows[0].cells==null)||(curTbody.rows[0].cells.length==null)){for(i=0;i<=curTbody.rows.length-1;i++){var val=curTbody.rows[i].childNodes[0].childNodes[0].value;if((val!=null)&&(val!='')&&(val!='- enter e-mail address -')){all[idx]=val;idx++;}}}else{for(i=0;i<=curTbody.rows.length-1;i++){val=curTbody.rows[i].cells[0].childNodes[0].value;if((val!=null)&&(val!='')&&(val!='- enter e-mail address -')){all[idx]=val;idx++;}}} var curMsg=$get('curEmail').innerHTML;var friendsTicked=$get('chkFriends').checked;var clientsTicked=$get('chkClients').checked;if((!friendsTicked)&&(!clientsTicked)){$('#emailResult').xShowBlock().xHtml('Please tick either "Friends" or "Clients"');}else{FitJournal_UI.WebServices.BodyDaemonWs.SendEmailToFriends(all,friendsTicked,clientsTicked,curMsg,User_LoggedInID,User_SecurityToken,function(res){$('#emailResult').xShowBlock().xHtml(res);if((res==null)||(res=='')){$('#emailResult').xHtml('E-mail(s) sent - thanks for recommending BodyDaemon.');$('#sendLink').xHide();}},OnError,OnTimeout);}} function workoutRoutine_setName(exRow,val){exRow.childNodes[0].childNodes[0].value=val;} function workoutRoutine_getName(exRow){return exRow.childNodes[0].childNodes[0].value;} function workoutRoutine_getNotesEl(exRow){return exRow.childNodes[2].childNodes[0];} function workoutRoutine_getNotes(exRow){return exRow.childNodes[2].childNodes[0].value;} function WorkoutRoutine_NameChange(routineId){m_curEvent_TableId='editRoutineTable';$('#workoutRoutineChanged').val('1');$('#routineName').attr('class','').addClass('FormElements').addClass('verylarge').addClass('changeState');showSaveChangesWarning();} function WorkoutRoutine_DescChange(routineId){m_curEvent_TableId='editRoutineTable';$('#workoutRoutineChanged').val('1');$('#routineDesc').attr('class','').addClass('FormElements').addClass('txtWorkoutDescTextArea').addClass('changeState');showSaveChangesWarning();} function RefreshWorkoutRoutineEditView(){FitJournal_UI.WebServices.BodyDaemonWs.Workout_GetEditWorkoutRoutineHtml($('#currentRoutineId').val(),User_JournalID,User_LoggedInID,User_SecurityToken,function(res){$('#workoutRoutine').xHtml(res.TableHtml);eval(res.ControllerJs);RegisterForDragDrop('editRoutineTable');RefreshWorkoutRoutineList();},OnError,OnTimeout);} function WorkoutRoutineSaveChanges(entitiesToUpdate){FitJournal_UI.WebServices.BodyDaemonWs.Workout_SaveWorkoutRoutine($('#currentRoutineId').val(),entitiesToUpdate,'routineName',$('#routineName').val(),'routineDesc',$('#routineDesc').val(),User_LoggedInID,User_SecurityToken,UpdateItemOnComplete,OnError,OnTimeout);} function SelectWorkoutRoutineExercise(exerciseId,shiftToNextField){var rowId=m_curEvent_RowId;var exRow=$get(rowId);if(activityPool[exerciseId]!=null){var exerciseName=activityPool[exerciseId][0];var isResistance=activityPool[exerciseId][1];workoutRoutine_setName(exRow,exerciseName);row_setActivityId(rowId,exerciseId);row_setIsResistance(rowId,isResistance);MarkAsChanged(exRow);if(shiftToNextField){var notesEl=workoutRoutine_getNotesEl(exRow);notesEl.focus();notesEl.select();}}} function SelectEditWorkoutRoutine(routineId){m_curEvent_TableId='editRoutineTable';FitJournal_UI.WebServices.BodyDaemonWs.Workout_GetEditWorkoutRoutineHtml(routineId,User_JournalID,User_LoggedInID,User_SecurityToken,function(res){$('#workoutRoutine').xHtml(res.TableHtml);eval(res.ControllerJs);MakeWorkoutContainerVisible();HighlightCurrentWorkoutRoutine();RegisterForDragDrop('editRoutineTable');$get('WorkoutRoutineHeaderDiv').scrollIntoView(true);},OnError,OnTimeout);} function SelectViewWorkoutRoutine(routineId){FitJournal_UI.WebServices.BodyDaemonWs.Workout_GetViewWorkoutRoutineHtml(routineId,User_JournalID,User_LoggedInID,User_SecurityToken,function(res){$('#workoutRoutine').xHtml(res);MakeWorkoutContainerVisible();HighlightCurrentWorkoutRoutine();$get('WorkoutRoutineHeaderDiv').scrollIntoView(true);$('a.clueLink').cluetip({dropShadow:false});},OnError,OnTimeout);} function RefreshWorkoutRoutineList(){FitJournal_UI.WebServices.BodyDaemonWs.Workout_RefreshWorkoutRoutineList(User_LoggedInID,User_JournalID,User_SecurityToken,RefreshWorkoutRoutineRx,OnError,OnTimeout);} function RefreshWorkoutRoutineRx(res){$('#workoutRoutineList').xHtml(res);HighlightCurrentWorkoutRoutine();} function DeleteWorkoutRoutine(routineId,sender){AreYouSure(sender,'Delete Workout Routine?','Yes','No',175,50,'DeleteWorkoutRoutineYes('+String(routineId)+');');} function DeleteWorkoutRoutineYes(routineId){var currentRoutineInput=$get('currentRoutineId');var currentRoutineId='';if((currentRoutineInput!=null)&&(currentRoutineInput.id!=null)&&(currentRoutineInput.id!='')) currentRoutineId=currentRoutineInput.value;if(routineId==currentRoutineId) $('#workoutRoutine').xHide().xHtml('');FitJournal_UI.WebServices.BodyDaemonWs.Workout_DeleteWorkoutRoutine(routineId,User_LoggedInID,User_JournalID,User_SecurityToken,RefreshWorkoutRoutineRx,OnError,OnTimeout);} function workoutroutine_FromRowEl(routineRow){var routineRowId=routineRow.id;var templateActivity=new FitJournal_DS.DS_WorkoutTemplate_Activity_Ajax();if(rowIsDeleted(routineRowId)) templateActivity.AjaxIsDeleted=true;templateActivity.ActivityId=row_getActivityId(routineRowId);templateActivity.AjaxRowId=routineRowId;templateActivity.UniqueID=entityIdFromRow(routineRowId);templateActivity.Notes=workoutRoutine_getNotes(routineRow);var parentTableId=tableIdFromRow(routineRowId);var parentTBody=$get(parentTableId).childNodes[0].childNodes[0];for(var i=0;i0)){$('#divRoutineFromWorkoutWarning').xShow().xHtml('There was a problem!
'+res);}else{m_lightboxWorkoutId=0;$('#divRoutineFromWorkout').xHide();$('#divRoutineFromWorkoutWarning').xHide();$('#divRoutineFromWorkoutDone').xShow();$('txtRoutineFromWorkoutName').val('');}},OnError,OnTimeout);} function CloseRoutineFromWorkout(){m_lightboxWorkoutId=0;$('#txtRoutineFromWorkoutName').val('');$('#divRoutineFromWorkout').xShow();$('#divRoutineFromWorkoutWarning').xHide();$('#divRoutineFromWorkoutDone').xHide();closeLightBox('RoutineFromWorkoutLightbox');} function closeLightBox(lightBoxModeName){$get(lightBoxModeName).style.display=$get('modalBackground').style.display='none';if(document.all) {var type=$get('hideType').value;if(type=='iframe') $get('modalIframe').style.display='none';} m_curLightBox='';if((m_lightBoxSender!=null)){m_lightBoxSender.focus();} m_lightBoxSender=null;m_curLightBox='';} function closeCurrentLightBox(){if($get(m_curLightBox)!=null)closeLightBox(m_curLightBox);} function showLightBox(sender,lightBoxModeName,rowId){m_lightBoxSender=sender;if((rowId!=null)&&(rowId!='')) InitFromRow(rowId);m_curLightBox=lightBoxModeName;$get(lightBoxModeName).style.display=$get('modalBackground').style.display='block';var browserIsIE=(BrowserDetect.browser=='Explorer');if(browserIsIE) {var type=$get('hideType').value;if(type=='iframe') $get('modalIframe').style.display='block';} center($get(lightBoxModeName));if(browserIsIE){var modalBg=$get('modalBackground');var my_width=document.documentElement.clientWidth;var my_height=document.body.clientHeight;modalBg.style.position='absolute';modalBg.style.width=my_width;modalBg.style.height=my_height;} switch(lightBoxModeName){case'foodDbLightBoxWindow':$get('txtSearchFoodName').value='- type the name of food and hit enter -';$get('txtSearchFoodName').focus();$get('txtSearchFoodName').select();break;case'commonFoodPickerLightBox':$get('txtFavePortions').focus();$get('txtFavePortions').select();break;} $('#'+lightBoxModeName).corner();} function center(element){var my_width=0;var my_height=0;if(typeof(window.innerWidth)=='number'){my_width=window.innerWidth;my_height=window.innerHeight;}else if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){my_width=document.documentElement.clientWidth;my_height=document.documentElement.clientHeight;} else if(document.body&&(document.body.clientWidth||document.body.clientHeight)){my_width=document.body.clientWidth;my_height=document.body.clientHeight;} element.style.position='absolute';element.style.zIndex=1002;var scrollY=0;if(document.documentElement&&document.documentElement.scrollTop){scrollY=document.documentElement.scrollTop;} else if(document.body&&document.body.scrollTop){scrollY=document.body.scrollTop;}else if(window.pageYOffset){scrollY=window.pageYOffset;}else if(window.scrollY){scrollY=window.scrollY;} var setX=(my_width-element.clientWidth)/2;var setY=(my_height-element.clientHeight)/2+scrollY;setX=(setX<0)?0:setX;setY=(setY<0)?0:setY;element.style.left=setX+"px";element.style.top=setY+"px";element.style.display='block';} function cancelGenericLightBox(){var imgEl=$get('genericImage');imgEl.src='';closeLightBox('genericShowImageLightBox');} function LoadExtJsCss(src,ext){var ref=null;if(ext=="js"){ref=document.createElement('script');ref.setAttribute("type","text/javascript");ref.setAttribute("src",src);} else if(ext=="css"){ref=document.createElement("link");ref.setAttribute("rel","stylesheet");ref.setAttribute("type","text/css");ref.setAttribute("href",src);} if(ref!=null) document.getElementsByTagName("head")[0].appendChild(ref);return false;} function ProposePublicCustomExercise(wikiId){FitJournal_UI.WebServices.BodyDaemonWs.ProposePublicCustomExercise(wikiId,User_LoggedInID,User_SecurityToken,function(res){alert(res);},OnError,OnTimeout);} function ChangeFeaturedArticle(){FitJournal_UI.WebServices.BodyDaemonWs.GetNextRandomArticle(function(res){if(res!=null){$('#featuredHeader').xHtml(res.ArticleHeaderLink);$('#featuredComments').xHtml(res.ArticleComments);$('#featureContentMain').xHtml(res.ArticleImageHtml);}},OnError,OnTimeout);} function ChangeFeaturedExercise(){FitJournal_UI.WebServices.BodyDaemonWs.GetNextRandomFlashExVideo(function(res){if(res!=null){$('#featuredHeader').xHtml(res.VideoHeaderLink);$('#featuredComments').xHtml(res.VideoComments);flashembed('featureContentMain',{src:'/FlowPlayer/FlowPlayerDark.swf',width:165,height:165},{config:{autoPlay:false,autoBuffering:false,controlBarBackgroundColor:'0x2e8860',initialScale:'scale',videoFile:res.VideoLocation,hideControls:true}});}},OnError,OnTimeout);} function LoadVideoLibraryItem(vidType,vidId){FitJournal_UI.WebServices.BodyDaemonWs.GetVideoLibraryItem(vidType,vidId,function(res){if(res!=null){$('#vidLibraryCurHeader').xHtml(res.VideoHeaderLink);$('#vidLibraryCurFooter').xHtml(res.VideoComments);document.title=(res.VideoHeaderLink+' - BodyDaemon | Free Online Fitness Journal');$('.videoLibraryList ul li').attr('class','');$('#Vid_'+String(vidType)+'_'+String(vidId)).addClass('selected');$('#vidPermalink').xHtml('Permalink:
');flashembed('vidLibraryCurContent',{src:'/FlowPlayer/FlowPlayerDark.swf',width:300,height:300},{config:{autoPlay:false,autoBuffering:false,controlBarBackgroundColor:'0x2e8860',initialScale:'scale',videoFile:res.VideoLocation}});}},OnError,OnTimeout);} function ShowInbox(){$('#divSentItems').fadeOut('fast',function(){$('#divInbox').fadeIn('fast');$('#sentItemsLink').css('font-weight','normal');$('#inboxLink').css('font-weight','bold');});} function ShowSentItems(){$('#divInbox').fadeOut('fast',function(){$('#divSentItems').fadeIn('fast');$('#sentItemsLink').css('font-weight','bold');$('#inboxLink').css('font-weight','normal');});} function MyMediaDetail(imgId){$('#txtUploadPhotoId').val(imgId);$('#divUploadPhoto').fadeOut('fast');$('#divViewPhoto').fadeIn('fast');FitJournal_UI.WebServices.BodyDaemonWs.GetMyMediaImageDetail(imgId,User_JournalID,User_LoggedInID,User_SecurityToken,function(res){$('#divViewPhotoIntro').fadeOut('fast');$('#divViewPhotoDetail').fadeIn('fast',function(){$('#divViewPhotoImg').html(res.ImageHtml);if(res.CanEditDetail){$('#photoDetailEdit_BodyDatePicker').hide();$get('photoDetailEdit_Body').checked=false;$get('photoDetailEdit_Avatar').checked=false;$get('photoDetailEdit_Comments').value='';$('#divViewPhotoDetailReadOnly').hide();$('#divViewPhotoDetailEdit').hide();$('#divViewPhotoDetailEdit').fadeIn('fast');$get('photoDetailEdit_Comments').value=res.ImageComments;$('[isEditBodyDateHack]').val(res.BodyCompDate);if(Number(res.ImageType)==2){$get('photoDetailEdit_Body').checked=true;$('#photoDetailEdit_BodyDatePicker').show();}else if(Number(res.ImageType)==1){$get('photoDetailEdit_Avatar').checked=true;}}else{$('#divViewPhotoDetailEdit').hide();$('#divViewPhotoDetailReadOnly').hide();$('#divViewPhotoDetailReadOnly').fadeIn('fast');$('#divViewPhotoDetailReadOnly_Desc').html(res.ImageDescription);if((res.ImageComments==null)||(res.ImageComments.length==0)){$('#divViewPhotoDetailReadOnly_Comment').html(res.ImageAuthorName+' has not added any comments for this photo.');}else{$('#divViewPhotoDetailReadOnly_Comment').html(res.ImageAuthorName+' commented on this photo:
"'+res.ImageComments+'"');}} $('#hrefImgView').attr('href','').attr('href','/Pages/ViewImage.aspx?height=500&width=600&modal=false&ImageID='+imgId+'&UserID='+User_LoggedInID+'&Token='+User_SecurityToken);});},OnError,OnTimeout);} function MyMediaAddNew(){$('#divViewPhoto').fadeOut('fast',function(){$('#divUploadPhotoDesc').show();$('#divUploadPhotoChooseFile').show();$('#divUploadPhotoDetails').hide();$('#divUploadPhotoAllDone').hide();$get('txtMyMediaUploadPhotoComments').value='';$get('chkMyMediaUploadAvatar').checked=false;$get('chkMyMediaIsBodyComposition').checked=false;$('[isBodyDateHack]').val('');$get('txtUploadPhotoId').value='';$('#divUploadPhotoPickDate').hide();$('#divUploadPhotoSaveDetailsErr').hide();$('#divUploadPhoto').fadeIn('fast');});} function HandleMyMediaPhotoUpload(imgId){$get('txtUploadPhotoId').value=imgId;$('#divUploadPhotoChooseFile').hide();$('#divUploadPhotoDesc').hide();$('#divUploadPhotoDetails').show();FitJournal_UI.WebServices.BodyDaemonWs.GetMyMediaPhotoPreviewHtml(imgId,User_LoggedInID,User_SecurityToken,function(res){$('#divUploadPhotoPreview').html(res);},OnError,OnTimeout);} function MyMediaUploadChangeAvatar(){$get('chkMyMediaIsBodyComposition').checked=false;$('#divUploadPhotoPickDate').fadeOut('fast');} function MyMediaUploadChangeBody(){$get('chkMyMediaUploadAvatar').checked=false;if($get('chkMyMediaIsBodyComposition').checked){$('#divUploadPhotoPickDate').fadeIn('fast');}else{$('#divUploadPhotoPickDate').fadeOut('fast');}} function MyMediaUploadPhotoSaveDetails(){var imgId=$get('txtUploadPhotoId').value;var isAvatar=$get('chkMyMediaUploadAvatar').checked;var isBody=$get('chkMyMediaIsBodyComposition').checked;var bodyDate=$('[isBodyDateHack]').val();var comments=$get('txtMyMediaUploadPhotoComments').value;FitJournal_UI.WebServices.BodyDaemonWs.SaveMediaPhotoDetails(User_LoggedInID,User_SecurityToken,imgId,isAvatar,isBody,bodyDate,comments,function(res){if((res!=null)&&(res!='')){$('#divUploadPhotoSaveDetailsErr').fadeIn('fast').html(''+res+'');}else{$('#divUploadPhotoDetails').fadeOut('fast',function(){$('#divUploadPhotoAllDone').fadeIn('fast');GetMyMediaPhotos(1);});}},OnError,OnTimeout);} function MyMediaEditPhotoSaveDetails(){var imgId=$get('txtUploadPhotoId').value;var isAvatar=$get('photoDetailEdit_Avatar').checked;var isBody=$get('photoDetailEdit_Body').checked;var bodyDate=$('[isEditBodyDateHack]').val();var comments=$get('photoDetailEdit_Comments').value;FitJournal_UI.WebServices.BodyDaemonWs.SaveMediaPhotoDetails(User_LoggedInID,User_SecurityToken,imgId,isAvatar,isBody,bodyDate,comments,function(res){if((res!=null)&&(res!='')){$('#photoDetailEdit_Error').fadeIn('fast').html(''+res+'');}else{$('#divViewPhotoDetailEdit').fadeOut('fast',function(){$('#divViewPhotoDetailEdit_SavedOK').fadeIn('fast').html('The photo has been updated.');});}},OnError,OnTimeout);} function MyMediaEditChangeAvatar(){$get('photoDetailEdit_Body').checked=false;$('#photoDetailEdit_BodyDatePicker').fadeOut('fast');} function MyMediaEditChangeBody(){$get('photoDetailEdit_Avatar').checked=false;if($get('photoDetailEdit_Body').checked){$('#photoDetailEdit_BodyDatePicker').fadeIn('fast');}else{$('#photoDetailEdit_BodyDatePicker').fadeOut('fast');}} function GetMyMediaPhotos(pageNo){FitJournal_UI.WebServices.BodyDaemonWs.GetMyMediaPhotosPaging(pageNo,User_JournalID,User_LoggedInID,User_SecurityToken,function(res){$('#mymediaContent').html(res.ContentHtml);$('#mymediaBottomPaging').html(res.PagingMenuHtml);},OnError,OnTimeout);} function DeleteMyMediaPhoto(sender){var photoId=$('#txtUploadPhotoId').val();AreYouSure(sender,'Remove Photo?','Yes','No',125,50,'DeleteMyMediaPhotoYes('+String(photoId)+');');} function DeleteMyMediaPhotoYes(imgId){FitJournal_UI.WebServices.BodyDaemonWs.RemoveMyMediaPhoto(imgId,User_JournalID,User_LoggedInID,User_SecurityToken,function(res){$('#divViewPhotoDetailEdit').fadeOut('fast',function(){$('#divViewPhotoDetailEdit_SavedOK').fadeIn('fast').html('The photo has been removed.');$('#divViewPhotoImg').html('');GetMyMediaPhotos(1);});},OnError,OnTimeout);} function UpsertMyMediaVideo(vidId){$('#txtCurMyMediaVideoId').val(vidId);$('#divViewVideo').fadeOut('fast',function(){$('#txtMyMediaVideoTitle').val('');$('#txtMyMediaVideoOriginalUrl').val('');$('#txtMyMediaVideoEmbedCode').val('');$('#divMyMediaVideoErr').hide();if(Number(vidId)>0){FitJournal_UI.WebServices.BodyDaemonWs.GetMyMediaVideo(vidId,User_LoggedInID,User_SecurityToken,function(res){$('#txtMyMediaVideoTitle').val(res.Title);$('#txtMyMediaVideoOriginalUrl').val(res.OriginalUrl);$('#txtMyMediaVideoEmbedCode').val(res.EmbedCode);},OnError,OnTimeout);} $('#divEditVideo').fadeIn('fast');});} function SaveMyMediaVideoDetails(){var vidId=$('#txtCurMyMediaVideoId').val();var title=$('#txtMyMediaVideoTitle').val();var originalUrl=$('#txtMyMediaVideoOriginalUrl').val();var embedCode=$('#txtMyMediaVideoEmbedCode').val();FitJournal_UI.WebServices.BodyDaemonWs.SaveMyMediaVideo(vidId,title,originalUrl,embedCode,User_LoggedInID,User_SecurityToken,function(res){if((res.ErrorMessage!=null)&&(res.ErrorMessage!='')){$('#divMyMediaVideoErr').fadeIn('fast').html('There was a problem saving the video:
'+res.ErrorMessage+'
');}else{FitJournal_UI.WebServices.BodyDaemonWs.GetMyMediaVideoList(User_JournalID,User_LoggedInID,User_SecurityToken,function(listHtml){$('#myMediaVideoUList').html(listHtml);ViewMyMediaVideo(res.VideoID);},OnError,OnTimeout);}},OnError,OnTimeout);} function ViewMyMediaVideo(vidId){$('#txtCurMyMediaVideoId').val(vidId);$('[myMediaVideoListItem]').css('font-weight','normal');$('#myMediaVideoLink'+String(vidId)).css('font-weight','bold');$('#divEditVideo').fadeOut('fast');$('#divViewVideo').fadeOut('fast',function(){FitJournal_UI.WebServices.BodyDaemonWs.GetMyMediaVideoHtml(vidId,User_LoggedInID,User_SecurityToken,function(res){$('#divViewVideo').fadeIn('fast',function(){document.getElementById('divViewVideo').innerHTML=res;});},OnError,OnTimeout);});} function DeleteMyMediaVideo(sender){var vidId=$('#txtCurMyMediaVideoId').val();AreYouSure(sender,'Remove Video?','Yes','No',125,50,'DeleteMyMediaVideoYes('+String(vidId)+');');} function DeleteMyMediaVideoYes(vidId){FitJournal_UI.WebServices.BodyDaemonWs.RemoveMyMediaVideo(vidId,User_JournalID,User_LoggedInID,User_SecurityToken,function(res){FitJournal_UI.WebServices.BodyDaemonWs.GetMyMediaVideoList(User_JournalID,User_LoggedInID,User_SecurityToken,function(listHtml){$('#myMediaVideoUList').html(listHtml);$('#divEditVideo').fadeOut('fast');$('#divViewVideo').fadeIn('fast').html('');},OnError,OnTimeout);},OnError,OnTimeout);} function HandleRatingVal(nam,val){var desc='';var inDs=false;switch(val){case'1':desc='Very Poor';break;case'2':desc='Poor';break;case'3':desc='Average';break;case'4':desc='Good';break;case'5':desc='Very Good';break;} if(nam.indexOf('dsActivityInput')!=-1){$('#spanDsActivity').html(desc);inDs=true;}else if(nam.indexOf('dsFoodInput')!=-1){$('#spanDsFood').html(desc);inDs=true;}else if(nam.indexOf('dsMoodInput')!=-1){$('#spanDsMood').html(desc);inDs=true;} if(inDs){$('#divChangesNotSaved').fadeIn('fast');}} function HandleDsNotesChange(sender){if(sender.value!=''){$('#divChangesNotSaved').fadeIn('fast');if(sender.value.length>=512) sender.value=(sender.value.substring(0,511));}} function SaveDailySummary(){var activVal='';var foodVal='';var moodVal='';var notesVal='';$('input[@type=hidden]').each(function(){if(this.name!=null){if(this.name.indexOf('dsActivityInput')!=-1) activVal=this.value;else if(this.name.indexOf('dsFoodInput')!=-1) foodVal=this.value;else if(this.name.indexOf('dsMoodInput')!=-1) moodVal=this.value;}});activVal=(activVal==''?'0':activVal);foodVal=(foodVal==''?'0':foodVal);moodVal=(moodVal==''?'0':moodVal);if($get('txtDsNotes').value!='Enter any notes or thoughts for the day.') notesVal=$get('txtDsNotes').value;FitJournal_UI.WebServices.BodyDaemonWs.SaveDailySummary(User_JournalID,GetJournalDate(),activVal,foodVal,moodVal,notesVal,User_LoggedInID,User_SecurityToken,function(res){$('#divChangesNotSaved').html('Changed saved OK');GenerateDailySummaryReport();},OnError,OnTimeout);} function DsNotesFocus(sender){if(sender.value=='Enter any notes or thoughts for the day.') sender.value='';} function EnsureStarsOK(){$('.star').mouseover().mouseout();} function RecordNewBodyWeight(){var curVal=$('#dsBodyWeightExplanation').data('slidestate');if((curVal==null)||(curVal='')) $('#dsBodyWeightExplanation').data('slidestate','up');curVal=$('#dsBodyWeightExplanation').data('slidestate');if(curVal=='up'){$('#dsBodyWeightExplanation').slideDown('normal');$('#dsBodyWeightExplanation').data('slidestate','down');}else{$('#dsBodyWeightExplanation').slideUp('normal');$('#dsBodyWeightExplanation').data('slidestate','up');}} function ShowYouTubeFaq(){var curState=$('#divYouTubeFaq').data('slidestate');if((curState==null)||(curState=='')) curState='up';if(curState=='up'){$('#divYouTubeFaq').load('/Pages/Popups/YouTubeVideoFaq.aspx').slideDown('normal');$('#divYouTubeFaq').data('slidestate','down');}else{$('#divYouTubeFaq').slideUp('normal');$('#divYouTubeFaq').data('slidestate','up');}} function WhatsNewNextPage(){var curPage=$('#divWhatsNewContent').data('curPage');var itemsToShow=$('#divWhatsNewContent').data('itemsToShow');var newPage=(curPage+1);var startRow=((curPage*itemsToShow)+1);var endRow=(startRow+itemsToShow-1);FitJournal_UI.WebServices.BodyDaemonWs.GetWhatsNewWidgetContent(startRow,endRow,function(res){$('#divWhatsNewContent').fadeOut('normal',function(){$('#divWhatsNewContent').html(res).fadeIn('normal');$('#divWhatsNewContent').data('curPage',newPage);});},OnError,OnTimeout);} function ShowBodyWeightPercentages(updatePendingId,workoutId){var curHtml=$('#'+updatePendingId).html();if((curHtml!=null)&&(curHtml.indexOf('Changes have not yet been saved.')!=-1)){alert('Please save your changes first! Thanks.');}else{tb_show('Bodyweight Percentages','/Pages/Popups/WorkoutBodyWeight.aspx?WorkoutID='+workoutId+'&UserID='+User_LoggedInID+'&Token='+User_SecurityToken,'');}} function WorkoutShowBodyPartsPieChart(updatePendingId,workoutId){var curHtml=$('#'+updatePendingId).html();if((curHtml!=null)&&(curHtml.indexOf('Changes have not yet been saved.')!=-1)){alert('Please save your changes first! Thanks.');}else{tb_show('Muscle Group Analysis','/Pages/Popups/WorkoutShowBodyPartsPieChart.aspx?WorkoutID='+workoutId+'&UserID='+User_LoggedInID+'&Token='+User_SecurityToken,'');}} function WorkoutPreviousCompare(updatePendingId,workoutId){var curHtml=$('#'+updatePendingId).html();if((curHtml!=null)&&(curHtml.indexOf('Changes have not yet been saved.')!=-1)){alert('Please save your changes first! Thanks.');}else{tb_show('Performance across recent workouts','/Pages/Popups/WorkoutsComparePrevious.aspx?WorkoutID='+workoutId+'&UserID='+User_LoggedInID+'&Token='+User_SecurityToken,'');}} function WorkoutPreviousPerformance(workoutId,sender){var exerciseId=sender.value;FitJournal_UI.WebServices.BodyDaemonWs.GetPreviousWorkoutPerformanceComparison(workoutId,exerciseId,User_LoggedInID,User_SecurityToken,function(res){$('#popupPreviousWorkoutContent').fadeOut('normal',function(){$('#popupPreviousWorkoutContent').html(res).fadeIn('normal');});},OnError,OnTimeout);} function WorkoutPopulateFromRoutine(workoutId){m_workoutTableId=workoutId;tb_show('','/Pages/Popups/WorkoutPopulateFromRoutine.aspx?width=400&height=300&modal=false&JournalID='+User_JournalID+'&UserID='+User_LoggedInID+'&Token='+User_SecurityToken,'');} function PopupPopulateWorkoutWithRoutine(routineId){$('#popupRoutineList').fadeOut('normal').html('

Please wait - populating the workout...


').fadeIn('normal',function(){PopulateWorkoutWithRoutine(routineId);tb_remove();});} // /JavaScript/JournalPages/GoogleMaps.js function LoadGoogleIncludes(){if(!m_googleMapsLoaded){LoadExtJsCss('http://www.google.com/uds/css/gsearch.css','css');LoadExtJsCss('http://maps.google.com/maps?file=api&v=2&async=2&callback=loadMap&key=ABQIAAAABWRZNzz9fgH7uaES1A_-WRStXPl6jgxFCEDfMcrcgGWWknfW-xS54nPXIItUJq6zlQglLY-v0V9oWA','js');alert('Please be patient - it takes a little while to load the Google Maps tool for the first time...');m_googleMapsLoaded=true;} return false;} var map=null;var mapdiv=document.getElementById("map_canvas");var poly;var count=0;var points=new Array();var markers=new Array();var icon_url="http://labs.google.com/ridefinder/images/";var tooltip;var lineColor="#0000af";var fillColor="#335599";var lineWeight=3;var lineOpacity=.8;var fillOpacity=.2;var report=document.getElementById('reportStatus');var routePickerSenderRow;function closeRoutePicker(res){$('#map_canvas').xHtml('');closeLightBox('routePickerLightbox');} function useRoute(){var routeDistance=$('#hiddenRouteKm').val();var distanceMetric=workout_getDistanceMetric(routePickerSenderRow);if((distanceMetric==null)||(distanceMetric=='2')){workout_setDistance(routePickerSenderRow,routeDistance);}else{if((routeDistance!=null)&&(Number(routeDistance)>0)){routeDistance=(routeDistance*0.62137);workout_setDistance(routePickerSenderRow,routeDistance.toFixed(2));}} var c=map.getCenter();FitJournal_UI.WebServices.BodyDaemonWs.SetLatLongHomeCoords(c.lat().toFixed(15),c.lng().toFixed(15),User_JournalID,User_LoggedInID,User_SecurityToken,closeRoutePicker,closeRoutePicker,closeRoutePicker);} function openRoutePicker(sender,lat,lng){LoadGoogleIncludes();routePickerSenderRow=sender.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode;showLightBox(sender,'routePickerLightbox',sender.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.id) initialize(lat,lng);clearMap();return false;} function initialize(lat,lng){if(GBrowserIsCompatible()){map=new GMap2(document.getElementById("map_canvas"),{googleBarOptions:{showOnLoad:true},draggableCursor:"auto",draggingCursor:"move"});if((lat==null)||(lng==null)) map.setCenter(new GLatLng(37.4419,-122.1419),13);else map.setCenter(new GLatLng(Number(lat),Number(lng)),13);var mapType=new GMapTypeControl();map.addControl(mapType);var mapControl=new GLargeMapControl();map.addControl(mapControl);map.enableGoogleBar();tooltip=document.createElement("div");tooltip.className="tooltip";map.getPane(G_MAP_MARKER_PANE).appendChild(tooltip);var hierarchy=new GHierarchicalMapTypeControl();hierarchy.addRelationship(G_SATELLITE_MAP,G_HYBRID_MAP,"Labels",true);map.addControl(hierarchy);map.disableDoubleClickZoom();GEvent.addListener(map,"click",leftClick);}} function leftClick(overlay,point){if(point){count++;if(count%2!=0){var icon=new GIcon();icon.image="lightblue.png";addIcon(icon);} else{var icon=new GIcon();icon.image=icon_url+"mm_20_purple.png";addIcon(icon);} var marker=new GMarker(point,{icon:icon,draggable:true,bouncy:false,dragCrossMove:true});map.addOverlay(marker);marker.content=count;markers.push(marker);marker.tooltip="Point "+count;GEvent.addListener(marker,"mouseout",function(){tooltip.style.display="none";});GEvent.addListener(marker,"drag",function(){tooltip.style.display="none";drawOverlay();});GEvent.addListener(marker,"click",function(){tooltip.style.display="none";for(var n=0;nself.oldY;self.oldY=y;self.dragObject.style.backgroundColor="#BBBBBB";var currentRow=self.findDropTargetRow(y);if(currentRow){if((currentRow.id!=null)&&(currentRow.id.indexOf('_header')==-1)&&(currentRow.id.indexOf('_footer')==-1)){if(movingDown&&self.dragObject.parentNode!=currentRow){self.dragObject.parentNode.parentNode.insertBefore(self.dragObject.parentNode,currentRow.nextSibling);}else if(!movingDown&&self.dragObject.parentNode!=currentRow){self.dragObject.parentNode.parentNode.insertBefore(self.dragObject.parentNode,currentRow);}}}} return false;}};document.onmouseup=function(ev){if(self.dragObject!=null){var droppedRow=self.dragObject.parentNode;droppedRow.cells[droppedRow.cells.length-1].style.backgroundColor='transparent';self.dragObject=null;self.onDrop(self.table,droppedRow);}};} this.onDrop=function(table,droppedRow){MarkAsChanged(droppedRow);} this.getPosition=function(e){var left=0;var top=0;while(e.offsetParent){left+=e.offsetLeft;top+=e.offsetTop;e=e.offsetParent;} left+=e.offsetLeft;top+=e.offsetTop;return{x:left,y:top};} this.mouseCoords=function(ev){if(ev.pageX||ev.pageY){return{x:ev.pageX,y:ev.pageY};} return{x:ev.clientX+document.body.scrollLeft-document.body.clientLeft,y:ev.clientY+document.body.scrollTop-document.body.clientTop};} this.getMouseOffset=function(target,ev){ev=ev||window.event;var docPos=this.getPosition(target);var mousePos=this.mouseCoords(ev);return{x:mousePos.x-docPos.x,y:mousePos.y-docPos.y};} this.makeDraggable=function(item){if(!item)return;var self=this;item.onmousedown=function(ev){self.dragObject=this;self.mouseOffset=self.getMouseOffset(this,ev);return false;} item.style.cursor="move";} this.findDropTargetRow=function(y){var rows=this.table.tBodies[0].rows;for(var i=0;irowY-rowHeight)&&(y<(rowY+rowHeight))){return row;}} return null;}} // /JavaScript/JournalPages/AC_RunActiveContent.js var isIE=(navigator.appVersion.indexOf("MSIE")!=-1)?true:false;var isWin=(navigator.appVersion.toLowerCase().indexOf("win")!=-1)?true:false;var isOpera=(navigator.userAgent.indexOf("Opera")!=-1)?true:false;function ControlVersion() {var version;var axo;var e;try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");version=axo.GetVariable("$version");}catch(e){} if(!version) {try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");version="WIN 6,0,21,0";axo.AllowScriptAccess="always";version=axo.GetVariable("$version");}catch(e){}} if(!version) {try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");version=axo.GetVariable("$version");}catch(e){}} if(!version) {try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");version="WIN 3,0,18,0";}catch(e){}} if(!version) {try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");version="WIN 2,0,0,11";}catch(e){version=-1;}} return version;} function GetSwfVer(){var flashVer=-1;if(navigator.plugins!=null&&navigator.plugins.length>0){if(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]){var swVer2=navigator.plugins["Shockwave Flash 2.0"]?" 2.0":"";var flashDescription=navigator.plugins["Shockwave Flash"+swVer2].description;var descArray=flashDescription.split(" ");var tempArrayMajor=descArray[2].split(".");var versionMajor=tempArrayMajor[0];var versionMinor=tempArrayMajor[1];var versionRevision=descArray[3];if(versionRevision==""){versionRevision=descArray[4];} if(versionRevision[0]=="d"){versionRevision=versionRevision.substring(1);}else if(versionRevision[0]=="r"){versionRevision=versionRevision.substring(1);if(versionRevision.indexOf("d")>0){versionRevision=versionRevision.substring(0,versionRevision.indexOf("d"));}} var flashVer=versionMajor+"."+versionMinor+"."+versionRevision;}} else if(navigator.userAgent.toLowerCase().indexOf("webtv/2.6")!=-1)flashVer=4;else if(navigator.userAgent.toLowerCase().indexOf("webtv/2.5")!=-1)flashVer=3;else if(navigator.userAgent.toLowerCase().indexOf("webtv")!=-1)flashVer=2;else if(isIE&&isWin&&!isOpera){flashVer=ControlVersion();} return flashVer;} function DetectFlashVer(reqMajorVer,reqMinorVer,reqRevision) {versionStr=GetSwfVer();if(versionStr==-1){return false;}else if(versionStr!=0){if(isIE&&isWin&&!isOpera){tempArray=versionStr.split(" ");tempString=tempArray[1];versionArray=tempString.split(",");}else{versionArray=versionStr.split(".");} var versionMajor=versionArray[0];var versionMinor=versionArray[1];var versionRevision=versionArray[2];if(versionMajor>parseFloat(reqMajorVer)){return true;}else if(versionMajor==parseFloat(reqMajorVer)){if(versionMinor>parseFloat(reqMinorVer)) return true;else if(versionMinor==parseFloat(reqMinorVer)){if(versionRevision>=parseFloat(reqRevision)) return true;}} return false;}} function AC_AddExtension(src,ext) {if(src.indexOf('?')!=-1) return src.replace(/\?/,ext+'?');else return src+ext;} function AC_Generateobj(objAttrs,params,embedAttrs) {var str='';if(isIE&&isWin&&!isOpera) {str+=' ';} str+='';} else {str+=' ';} str+='';} else {str+='The report will be shown here when loaded.

');$('#divReportDetailEntry').xHtml('Loading.....');$('#divInputTitle').xHtml('Loading.....');FitJournal_UI.WebServices.BodyDaemonWs.GetQuickReportDataEntryMarkup(reportType,User_JournalID,User_LoggedInID,User_SecurityToken,function(res){$('#divReportDetailEntry').xHtml(res.DetailedInputHtml);$('#divInputTitle').xHtml(res.TitleHtml);$('#reportNav1').attr('class','');$('#reportNav2').fadeIn('fast');$('#reportArrow2').fadeIn('fast');$('#reportNav2').addClass('curNav');$('#reportPage2').fadeIn('normal',function(){});},OnError,OnTimeout);});} function GenerateDailySummaryReport(){var reportType=$('#ddlDsReportType').val();var urlBase='';var swfLoc='/FusionCharts/Charts/MSLine.swf';var qsParams='?TargetUserID='+String(User_JournalID) +'&UserID='+String(User_LoggedInID) +'&Token='+User_SecurityToken +'&StartDate='+$get(dsReportStartDateId).value +'&EndDate='+$get(dsReportEndDateId).value;var keepGoing=true;var startDate=$get(dsReportStartDateId).value;var endDate=$get(dsReportEndDateId).value;try{var startYear=startDate.substring(6,10);var endYear=endDate.substring(6,10);var yearGap=Number(endYear)-Number(startYear);if(yearGap>5){alert('Report cannot be more than 5 years in duration');keepGoing=false;}}catch(ex){keepGoing=false;alert('Ensure dates are in the correct format - dd/mm/yyyy');} switch(reportType){case'100':urlBase='/AjaxReports/DailySummary_Main.aspx';qsParams+='&Mode=ALL';break;case'101':urlBase='/AjaxReports/DailySummary_Main.aspx';qsParams+='&Mode=ACTIVITY';break;case'102':urlBase='/AjaxReports/DailySummary_Main.aspx';qsParams+='&Mode=FOOD';break;case'103':urlBase='/AjaxReports/DailySummary_Main.aspx';qsParams+='&Mode=MOOD';break;case'104':urlBase='/AjaxReports/DailySummary_Bodyweight.aspx';break;case'105':swfLoc='/FusionCharts/Charts/Bar2D.swf';urlBase='/AjaxReports/DailySummary_WorkoutCountsLast12Months.aspx';qsParams+=("&JournalDate="+GetJournalDate());break;} var requestUri=escape(urlBase+qsParams);if(keepGoing){$('#divReportGoesHere').fadeOut('normal',function(){$('#divReportGoesHere').fadeIn('normal',function(){var chart1=new FusionCharts(swfLoc,"divReportGoesHere","350","225","0","1");chart1.setDataURL(requestUri);chart1.render("divReportGoesHere");});});}} function GenerateWorkoutBpAnalysis(workoutId,divId){var swfLoc='/FusionCharts/Charts/Pie2D.swf';var qsParams='?WorkoutID='+String(workoutId) +'&UserID='+String(User_LoggedInID) +'&Token='+User_SecurityToken;var urlBase='/AjaxReports/Workout_MuscleGroupAnalysis.aspx';var requestUri=escape(urlBase+qsParams);$('#'+divId).fadeOut('normal',function(){$('#'+divId).fadeIn('normal',function(){var chart1=new FusionCharts(swfLoc,divId,"500","350","0","1");chart1.setDataURL(requestUri);chart1.render(divId);});});} function FrontPagePieChart(){var swfLoc='/FusionCharts/Charts/Pie2D.swf';var urlBase='/AjaxReports/Ajax_GenericGoalWholeSite.aspx';$('#usagePieChart').fadeOut('normal',function(){$('#usagePieChart').fadeIn('normal',function(){var myPieChart=new FusionCharts(swfLoc,"usagePieChart","550","275","0","1");myPieChart.setDataURL(urlBase);myPieChart.render("usagePieChart");});});} // /Controls/ReportUI/swfobject.js if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="";_19+="";var _1d=this.getParams();for(var key in _1d){_19+="";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="";}_19+="";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.majorfv.major){return true;}if(this.minorfv.minor){return true;}if(this.rev=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject; // /JavaScript/AutoSuggest/ajaxSuggestions.js var ajaxSuggestions={elmIdToPresentResultsIn:"search-results",elmIdResultsContainer:"search-result-suggestions",charactersBeforeSearch:2,timeBeforeSuggest:200,sameWidthAsInputElm:false,offsetLeft:0,offsetTop:0,urlExt:"search=",addSearchTermToQueryString:true,addKeyNavigationEvents:true,hideResultsOnDocumentClick:true,itemClassName:"item",itemSelectedClassName:"selected",itemInsertValueIntoInputClassName:"choose-value",itemInsertValueSetFocusToInput:true,hideResultsWhenInsertValueIsSelected:true,itemSeparator:";",turnAutoCompleteOff:true,xmlHttp:null,elements:[],timer:null,currentElm:null,currentKeyEvent:null,suggestionsForElm:null,elmToPresentResultsIn:null,elmResultsContainer:null,suggestions:[],resultIndex:0,selectedItem:-1,resultsAreVisible:false,valueAddedFromResultsListToInput:false,eventsAdded:false,init:function(){this.xmlHttp=this.createXmlHttp();if(this.xmlHttp){if(typeof document.getElementsByClassName!="function"){document.getElementsByClassName=this.elmByClass;} this.elements=document.getElementsByClassName("ajax-suggestion","input");this.applyEvents();this.elmToPresentResultsIn=document.getElementById(this.elmIdToPresentResultsIn);this.elmResultsContainer=document.getElementById(this.elmIdResultsContainer);if(this.addKeyNavigationEvents){if((this.eventsAdded==false)){this.safeRemoveEvent(document,"keydown",this.preventDefaultForArrowKeys);this.safeRemoveEvent(document,"keypress",this.preventDefaultForArrowKeys);this.safeRemoveEvent(document,"keyup",this.navigateResults);this.addEvent(document,"keydown",this.preventDefaultForArrowKeys);this.addEvent(document,"keypress",this.preventDefaultForArrowKeys);this.addEvent(document,"keyup",this.navigateResults);this.eventsAdded=true;}} if(this.hideResultsOnDocumentClick){this.safeRemoveEvent(document,"click",this.clearResultsElement);this.addEvent(document,"click",this.clearResultsElement);}}},createXmlHttp:function(){this.xmlHttp=null;if(typeof XMLHttpRequest!="undefined"){this.xmlHttp=new XMLHttpRequest();} else if(typeof window.ActiveXObject!="undefined"){try{this.xmlHttp=new ActiveXObject("Msxml2.XMLHTTP.4.0");} catch(e){try{this.xmlHttp=new ActiveXObject("MSXML2.XMLHTTP");} catch(e){try{this.xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");} catch(e){this.xmlHttp=null;}}}} return this.xmlHttp;},applyEvents:function(){var element;for(var i=0;ithis.charactersBeforeSearch&&url.length>0){this.makeSuggestionCall(value,url);} else if(value.length==0||!this.valueAddedFromResultsListToInput){ajaxSuggestions.clearResults();}}},makeSuggestionCall:function(value,url){var isHack=((url=='workoutHack')||(url=='workoutRoutineHack'));if(isHack){if(url=='workoutRoutineHack'){var valueUpper=value.toUpperCase();var mockResult='
    ';var matches=0;for(var activityId in activityPool){var exName=String(activityPool[activityId][0]);var exNameUpper=exName.toUpperCase();var isPublic=String(activityPool[activityId][2]);var postFix=(isPublic=='1'?'':'
    (custom exercise)');if(exNameUpper.indexOf(valueUpper)!=-1){mockResult+=('
  • '+exName+postFix+''+'
  • ');matches+=1;}} if(matches==0){mockResult+=('
  • No matches for '+value+'
  • ');} mockResult+=('
  • -- close exercise picker --
  • ');mockResult+(mockResult+('
'));this.resultIndex=this.suggestions.length;this.suggestions.push([this.currentValue,mockResult,this.currentURL]);this.presentResult();} if(url=='workoutHack'){var valueUpper=value.toUpperCase();var mockResult='
    ';var matches=0;for(var activityId in activityPool){var exName=String(activityPool[activityId][0]);var exNameUpper=exName.toUpperCase();var isPublic=String(activityPool[activityId][2]);var postFix=(isPublic=='1'?'':'
    (custom exercise)');if(exNameUpper.indexOf(valueUpper)!=-1){mockResult+=('
  • '+exName+postFix+''+'
  • ');matches+=1;}} if(matches==0){mockResult+=('
  • No matches for '+value+'
  • ');} mockResult+=('
  • -- close exercise picker --
  • ');mockResult+(mockResult+('
'));this.resultIndex=this.suggestions.length;this.suggestions.push([this.currentValue,mockResult,this.currentURL]);this.presentResult();}} if(!isHack){var regExpValue=new RegExp(("^"+value+"$"),"i");var exists=false;var suggestionItem;var url=url+((/\?/.test(url))?"&":"?")+this.urlExt+((this.addSearchTermToQueryString)?value:"");url=(url+'&UserID='+User_LoggedInID+'&Token='+User_SecurityToken);for(var i=0;i0){ajaxSuggestions.loadResults();}},loadResults:function(){this.resultIndex=this.suggestions.length;this.suggestions.push([this.currentValue,this.xmlHttp.responseText,this.currentURL]);this.presentResult();},presentResult:function(){this.elmToPresentResultsIn.innerHTML=this.suggestions[this.resultIndex][1];var coordinates=this.getCoordinates();var elm=this.elmResultsContainer.style;elm.left=coordinates[0]+this.offsetLeft+"px";elm.top=coordinates[1]+this.currentElm.offsetHeight+this.offsetTop+"px";if(this.sameWidthAsInputElm){elm.width=this.currentElm.offsetWidth+"px";} this.applyResultEvents();elm.display="block";this.resultsAreVisible=true;if(this.addKeyNavigationEvents&&/38|40/.test(this.currentKeyEvent)){if(!this.valueAddedFromResultsListToInput){this.selectedItem=-1;} this.navigateResults(null,this.currentKeyEvent);}},clearResults:function(justClear){if(this.elmResultsContainer&&this.elmToPresentResultsIn){if(!justClear){this.elmResultsContainer.style.display="none";this.resultsAreVisible=false;} this.elmToPresentResultsIn.innerHTML="";this.selectedItem=-1;}},clearResultsElement:function(){ajaxSuggestions.clearResults();},navigateResults:function(evt,keyCode){if(ajaxSuggestions.currentElm&&ajaxSuggestions.elmToPresentResultsIn){var event=(typeof evt!="undefined")?evt:event;if(typeof ajaxSuggestions.elmToPresentResultsIn.getElementsByClassName!="function"){ajaxSuggestions.elmToPresentResultsIn.getElementsByClassName=ajaxSuggestions.elmByClass;} var results=ajaxSuggestions.elmToPresentResultsIn.getElementsByClassName(ajaxSuggestions.itemClassName);var selectedItem=(!evt&&keyCode==38)?results.length:ajaxSuggestions.selectedItem;var keyCode=keyCode||event.keyCode;var navigateUp=keyCode==37||keyCode==38;var navigateDown=keyCode==39||keyCode==40;if(results.length>0&&(navigateUp||navigateDown)){if(navigateUp){if((selectedItem-1)>=0){selectedItem--;} else{selectedItem=-1;}} else if(navigateDown){if((selectedItem+1)-1){var currentItem=results[selectedItem];var currentClass=item.className;if(!new RegExp(ajaxSuggestions.itemSelectedClassName,"i").test(currentClass)){currentItem.className=currentClass+((currentClass.length>0)?" ":"")+ajaxSuggestions.itemSelectedClassName;} elmToFocus=results[selectedItem];} try{elmToFocus.focus();} catch(e){} if(event){if(event.preventDefault){event.preventDefault();} else{event.returnValue=false;} if(event.stopPropagation){event.stopPropagation();} else{event.cancelBubble=true;}} return false;} else if((keyCode==27)){ajaxSuggestions.clearResults();try{ajaxSuggestions.currentElm.focus();} catch(e){}}}},applyResultEvents:function(){if(typeof this.elmToPresentResultsIn.getElementsByClassName!="function"){this.elmToPresentResultsIn.getElementsByClassName=this.elmByClass;} var insertValueItems=this.elmToPresentResultsIn.getElementsByClassName(this.itemInsertValueIntoInputClassName,"a");var item;for(var i=0;i0){offsetTop-=elm.scrollTop;} elm=elm.offsetParent;} return[offsetLeft,offsetTop];},closeSession:function(){delete ajaxSuggestions;ajaxSuggestions=null;},elmByClass:function(className,tag){return ajaxSuggestions.getElementsByClassName.call(this,className,tag);},getElementsByClassName:function(className,tag){var elms=((!tag||tag=="*")&&this.all)?this.all:this.getElementsByTagName(tag||"*");var returnElms=[];var className=className.replace(/\-/g,"\\-");var regExp=new RegExp("(^|\\s)"+className+"(\\s|$)");var elm;for(var i=0;i","/":"?","\\":"|"} var special_keys={'esc':27,'escape':27,'tab':9,'space':32,'return':13,'enter':13,'backspace':8,'scrolllock':145,'scroll_lock':145,'scroll':145,'capslock':20,'caps_lock':20,'caps':20,'numlock':144,'num_lock':144,'num':144,'pause':19,'break':19,'insert':45,'home':36,'delete':46,'end':35,'pageup':33,'page_up':33,'pu':33,'pagedown':34,'page_down':34,'pd':34,'left':37,'up':38,'right':39,'down':40,'f1':112,'f2':113,'f3':114,'f4':115,'f5':116,'f6':117,'f7':118,'f8':119,'f9':120,'f10':121,'f11':122,'f12':123} var modifiers={shift:{wanted:false,pressed:false},ctrl:{wanted:false,pressed:false},alt:{wanted:false,pressed:false},meta:{wanted:false,pressed:false}};if(e.ctrlKey)modifiers.ctrl.pressed=true;if(e.shiftKey)modifiers.shift.pressed=true;if(e.altKey)modifiers.alt.pressed=true;if(e.metaKey)modifiers.meta.pressed=true;for(var i=0;k=keys[i],i1){if(special_keys[k]==code)kp++;}else if(opt['keycode']){if(opt['keycode']==code)kp++;}else{if(character==k)kp++;else{if(shift_nums[character]&&e.shiftKey){character=shift_nums[character];if(character==k)kp++;}}}} if(kp==keys.length&&modifiers.ctrl.pressed==modifiers.ctrl.wanted&&modifiers.shift.pressed==modifiers.shift.wanted&&modifiers.alt.pressed==modifiers.alt.wanted&&modifiers.meta.pressed==modifiers.meta.wanted){callback(e);if(!opt['propagate']){e.cancelBubble=true;e.returnValue=false;if(e.stopPropagation){e.stopPropagation();e.preventDefault();} return false;}}} this.all_shortcuts[shortcut_combination]={'callback':func,'target':ele,'event':opt['type']};if(ele.addEventListener)ele.addEventListener(opt['type'],func,false);else if(ele.attachEvent)ele.attachEvent('on'+opt['type'],func);else ele['on'+opt['type']]=func;},'remove':function(shortcut_combination){shortcut_combination=shortcut_combination.toLowerCase();var binding=this.all_shortcuts[shortcut_combination];delete(this.all_shortcuts[shortcut_combination]) if(!binding)return;var type=binding['event'];var ele=binding['target'];var callback=binding['callback'];if(ele.detachEvent)ele.detachEvent('on'+type,callback);else if(ele.removeEventListener)ele.removeEventListener(type,callback,false);else ele['on'+type]=false;}} function getSafeSender(e){var targ;if(!e)var e=window.event;if(e.target)targ=e.target;else if(e.srcElement)targ=e.srcElement;if(targ.nodeType==3) targ=targ.parentNode;return targ;} function DotNetCheck(jsElement,dotNetName){if(jsElement.id!=null){if((jsElement.id.indexOf('ct')!=-1)&&(jsElement.id.indexOf(dotNetName)!=-1)){return true;}} return false;} function DomCheck(jsElement,domId){if(jsElement.id!=null){if(jsElement.id==domId) return true;} return false;} shortcut.add("Enter",function(args){var sender=getSafeSender(args);if((sender!=null)&&(sender.id!=null)){if(DotNetCheck(sender,'txtLoginScreenPassword')){PasswordEnterClicked();}else if(DotNetCheck(sender,'txtTrialDemoUser')){TrialEnterClicked();}else if(DomCheck(sender,'txtSearchFoodName')){RefreshFoodDbList();}else if(DomCheck(sender,'txtShoppingName')){AddShoppingItem();}else if(DomCheck(sender,'txtFriendSearch')){HandlePagingMenuClick(PAGINGID_BUDDYLIST,1);}}},{'propagate':true});shortcut.add("esc",function(args){closeCurrentLightBox();});shortcut.add("tab",function(args){if(ajaxSuggestions!=null) ajaxSuggestions.clearResults();var sender=getSafeSender(args);if(sender.innerHTML!=null){var srcHtml=sender.innerHTML.toUpperCase();var delCanHaveFocus=true;var curBrowser=BrowserDetect.browser;var doNewRow=false;if((curBrowser=='Safari')||(curBrowser=='Opera')){delCanHaveFocus=false;} if(delCanHaveFocus){if((srcHtml=='DELETE')||((srcHtml.indexOf('16_DELETE')!=-1)&&(srcHtml.indexOf('vDayOfWeek) vCurUTC=vCurUTC-((vDayOfWeek-vFDOW+7)*86400000);else vCurUTC=vCurUTC-((vDayOfWeek-vFDOW)*86400000);vDateOfCell=new Date(vCurUTC);vMonth=vDateOfCell.getUTCMonth();vYear=vDateOfCell.getUTCFullYear();vDay=vDateOfCell.getUTCDate();vMonthPos=vThisMonth-1;} else vMonthPos=vThisMonth;var vSelUTC=-1;if(PDP_GetById(pCalCId+"_Day").value!="0") {var vSelDate=PDP_MakeUTCDate(PDP_GetById(pCalCId+"_Year").value,PDP_GetById(pCalCId+"_Month").value,PDP_GetById(pCalCId+"_Day").value);vSelUTC=vSelDate.valueOf();} var vTodayDate=PDP_MakeUTCDate(vAO.TodayY,vAO.TodayM,vAO.TodayD);var vTodayUTC=vTodayDate.valueOf();var vSpUTC=-1;var vSpDate=PDP_MakeUTCDate(vAO.SpecialY,vAO.SpecialM,vAO.SpecialD);if(vSpDate!=null) vSpUTC=vSpDate.valueOf();var vMinUTC=-1;var vMinDate=PDP_MakeUTCDate(vAO.MinY,vAO.MinM,vAO.MinD);if(vMinDate!=null) vMinUTC=vMinDate.valueOf();var vHasMin=vMinUTC!=-1;var vMaxUTC=-1;var vMaxDate=PDP_MakeUTCDate(vAO.MaxY,vAO.MaxM,vAO.MaxD);if(vMaxDate!=null) vMaxUTC=vMaxDate.valueOf();var vHasMax=vMaxUTC!=-1;var vBSD=null;if(vSDId!="") SD_InitSequentialSearch(vSDId);var vNewVisibleRows=0;var vOldVisibleRows=0;var vDayCellHeight=0;var vHiddenWeek=false;var vSelCId="";var vLastHadBorder=new Array(true,true,true,true,true,true,true);var vCurWkNum=1;var vLastWkNum=100;if(vWkNm) {var vWkNmRl=vAO.WkNmRl;vCurWkNum=PDP_GetWeekNum(vDateOfCell,vWkNmRl,vFDOW);if(vCurWkNum>44) {var vDate2=PDP_GetFirstWeekNumDate(vDateOfCell.getUTCFullYear()+1,vWkNmRl,vFDOW);vLastWkNum=PDP_GetWeekNum(new Date(vDate2-(86400000*7)),vWkNmRl,vFDOW);}} var vRows=null;var vRowsMode=false;var vByTagNameMode=false;var vGetChildNodesMode=false;var vDayCellIdCount=1;var vWkNumSpace=vWkNm?1:0;if(vWRTbl.rows&&!gPDP_Safari) {vRows=vWRTbl.rows;vRowsMode=true;} else if(vWRTbl.getElementsByTagName) {vRows=vWRTbl.getElementsByTagName("TR");vByTagNameMode=true;} else {vRows=PDPUtil_GetChildNodes(vWRTbl,"TBODY",1);vGetChildNodesMode=true;} for(vRowCount=0;vRowCount<6;vRowCount++) {var vWeekRow=null;if(vRowsMode) vWeekRow=vWRTbl.rows[vRowCount];else if(vByTagNameMode) vWeekRow=vRows.item(vRowCount);else vWeekRow=PDPUtil_GetChildNodes(vRows,"TR",vRowCount+1);if(vWeekRow.style.display!="none") vOldVisibleRows++;vWeekRow.style.display="";if(vMonthPos<=vThisMonth) vNewVisibleRows++;else if(!vAO.OMWks) {vWeekRow.style.display="none";vHiddenWeek=true;} if(vWkNm) {var vWNDC=null;if(vRowsMode) vWNDC=vWeekRow.cells[0];else if(vByTagNameMode) vWNDC=PDP_GetById(pCalCId+"_WK"+vRowCount);else vWNDC=PDPUtil_GetChildNodes(vWeekRow,"TD",1);PDP_SetInnerHTML(vWNDC,vCurWkNum);vCurWkNum++;if(vCurWkNum>vLastWkNum) vCurWkNum=1;} for(vDayCount=0;vDayCount<7;vDayCount++) {var vDC=null;if(vRowsMode) vDC=vWeekRow.cells[vDayCount+vWkNumSpace];else if(vByTagNameMode) vDC=PDP_GetById(pCalCId+"_"+vDayCellIdCount);else vDC=PDPUtil_GetChildNodes(vWeekRow,"TD",vDayCount+1+vWkNumSpace);var vDayLbl="";if(vAO.LZDays&&(vDay<10)) vDayLbl="0"+vDay.toString();else vDayLbl=vDay.toString();var vDefaultStyle="";var vDCFmt=vAO.DCFmt;var vBlank=false;var vSelectableCell=true;var vSDUnsel=false;if(vDayCellHeight==0) {var vSv=vAO.CellHeight;if(vSv==null) {vSv=vDC.clientHeight;vAO.CellHeight=vSv;} vDayCellHeight=vSv;} var vIsWE=(vWEDay1==vDayCount)||(vWEDay2==vDayCount);if(!vDC.WkE) vDC.WkE=vIsWE;PDP_SetBkColor(vDC,"");vDC.style.fontWeight="";vDC.style.color="";if(vDayCellHeight>0) vDC.style.height=vDayCellHeight+"px";vDC.title="";var vSupportsWeekend=false;var vOutOfRange=(vHasMin&&(vCurUTCvThisMonth) vRole=11;else if(vMonthPosvThisMonth) vMO=1;else if(vMonthPos0) {vDC.style.borderLeft="1px solid "+vColor;if(vCellsHaveSpacing||(vDayCount==6)) vDC.style.borderRight="1px solid "+vColor;}} vLastHadBorder[vDayCount]=true;} else if(vMonthPos=vThisMonth)) {if(vDCBrdSd>0) if(!vCellsHaveSpacing&&(vDayCount>0)&&vLastHadBorder[vDayCount-1]) vDC.style.borderLeft="1px solid "+vDCBrdC;for(var vI=0;vI<7;vI++) vLastHadBorder[vI]=false;}} var vFnc="";vFnc=vFnc+"vDC.style.color='"+vDC.style.color+"';";if(vCellsHaveSpacing) if(gPDP_Safari) if(vDCBrdC!="") vFnc=vFnc+"vDC.style.borderColor='"+vDCBrdC+"';";else vFnc=vFnc+"vDC.style.borderLeftColor='';vDC.style.borderRightColor='';vDC.style.borderTopColor='';vDC.style.borderBottomColor='';";else vFnc=vFnc+"vDC.style.borderColor='"+vDC.style.borderColor+"'";PDP_SetAtt(vDC,"MouseOutCode",vFnc);vCurUTC=vCurUTC+86400000;vDateOfCell=new Date(vCurUTC);vMonth=vDateOfCell.getUTCMonth();vYear=vDateOfCell.getUTCFullYear();vDay=vDateOfCell.getUTCDate();if(vDay==1) vMonthPos++;vDayCellIdCount++;}} CSC_FillInMonthHeader(pCalCId);if(pDrawDateLabel) CSC_DrawDateLabel(vCal);vAO.SelCell=vSelCId;if(vMinDate!=null) {var vCmd=PDP_GetById(pCalCId+"_JumpBack");var vHidden=(vThisYearvMaxDate.getUTCFullYear())||((vThisYear==vMaxDate.getUTCFullYear())&&(vThisMonth>=vMaxDate.getUTCMonth()));if(vCmd!=null) vCmd.style.visibility=vHidden?"hidden":"inherit";vCmd=PDP_GetById(pCalCId+"_NextMonth");if(vCmd!=null) vCmd.style.visibility=vHidden?"hidden":"inherit";} vAO.MonthLoaded=true;} function CSC_Initialize(pCalCId,pFillInMonth) {if(!gPDP_SupportsInnerHTML) return;var vCal=PDP_GetById(pCalCId);var vAO=vCal.AO;if(vAO.Inited) return;if(vAO.IsPopup&&(gPDP_IEMac51||gPDP_IEMacOSX||!gPDP_IEMac)) {PDP_RelocatePopup(vCal);if(this.PM_InitializeOne) {PM_InitializeOne(pCalCId);PM_InitializeOne(pCalCId+"_Help");} var vCal=PDP_GetById(pCalCId);} var vWRTbl=PDP_GetById(pCalCId+"_WeekRows");if(!vAO.FC) {var vMouseOverActive=(vAO.MOFC!="")||(vAO.MOBdrC!="");var vCellsHaveSpacing=vWRTbl.cellSpacing!="0";var vRows=null;var vRowsMode=false;var vByTagNameMode=false;var vGetChildNodesMode=false;var vDayCellIdCount=1;var vWkNumSpace=vAO.WkNm?1:0;if(vWRTbl.rows&&!gPDP_Safari) {vRows=vWRTbl.rows;vRowsMode=true;} else if(vWRTbl.getElementsByTagName) {vRows=vWRTbl.getElementsByTagName("TR");vByTagNameMode=true;} else {vRows=PDPUtil_GetChildNodes(vWRTbl,"TBODY",1);vGetChildNodesMode=true;} for(vRowCount=0;vRowCount<6;vRowCount++) {var vWeekRow=null;if(vRowsMode) vWeekRow=vWRTbl.rows[vRowCount];else if(vByTagNameMode) vWeekRow=vRows.item(vRowCount);else vWeekRow=PDPUtil_GetChildNodes(vRows,"TR",vRowCount+1);for(vDayCount=0;vDayCount<7;vDayCount++) {var vDC=null;if(vRowsMode) vDC=vWeekRow.cells[vDayCount+vWkNumSpace];else if(vByTagNameMode) vDC=PDP_GetById(pCalCId+"_"+vDayCellIdCount);else vDC=PDPUtil_GetChildNodes(vWeekRow,"TD",vDayCount+1+vWkNumSpace);vDC.onclick=new Function("CSC_ChangeDay('"+pCalCId+"','"+vDC.id+"', true);");if(vMouseOverActive) {vDC.onmouseover=new Function("CSC_MouseOverEffect('"+pCalCId+"', '"+vDC.id+"', "+vCellsHaveSpacing+");");vDC.onmouseout=new Function("CSC_MouseOutEffect('"+vDC.id+"');");} vDC.onfocus=new Function("CSC_FocusOnCalendar('"+pCalCId+"');");vDayCellIdCount++;}}} if(vWRTbl.focus) {var vFBC=vAO.FBrdC;if((vFBC!=null)&&(vFBC!="")) {vWRTbl.onfocus=new Function("CSC_FocusBorderColor('"+pCalCId+"','"+vFBC+"')");vWRTbl.onblur=new Function("CSC_FocusBorderColor('"+pCalCId+"','"+vWRTbl.style.borderTopColor+"')");}} if(gPDP_SupportsFocusOnTable&&(vCal.attachEvent!=null)) {vCal.attachEvent("onkeydown",new Function("return CSC_OnKeyDownIE('"+pCalCId+"');"));vCal.attachEvent("onkeypress",new Function("return CSC_OnKeyPressIE('"+pCalCId+"');"));vCal.onfocus=new Function("CSC_FocusOnCalendar('"+pCalCId+"');");} else if(vCal.addEventListener!=null) {var vOnPopup=PDP_GetAtt(vCal,"onpopup","");if(vOnPopup=="") vOnPopup="CSC_AttachKeyboardNS();";else vOnPopup=vOnPopup+"CSC_AttachKeyboardNS();";PDP_SetAtt(vCal,"onpopup",vOnPopup);var vOnPopdown=PDP_GetAtt(vCal,"onpopdown","");if(vOnPopdown=="") vOnPopdown="CSC_DetachKeyboardNS();";else vOnPopdown=vOnPopdown+"CSC_DetachKeyboardNS();";PDP_SetAtt(vCal,"onpopdown",vOnPopdown);} if(gPDP_IEMac&&vAO.IsPopup) {var vPopupFnc=PDP_GetAtt(vCal,"onpopup",'');vPopupFnc=vPopupFnc+"if (!vPUC.AO.InitSize){vPUC.style.width = '"+vCal.style.width+"';CSC_InitSize(vPUC);}";vCal.setAttribute("onpopup",vPopupFnc,0);} else if(vWRTbl.offsetWidth!=0) CSC_InitSize(vCal);if(pFillInMonth) CSC_FillInMonth(pCalCId,true);vAO.Inited=true;} function CSC_TestInitializing(pCalCId,pMsg) {var vCal=PDP_GetById(pCalCId);if(vCal.AO.Inited) return true;alert(pMsg);return false;} function CSC_InitSize(pCField) {if(pCField.AO.InitSize==true) return;var vCId=pCField.id;var vWRTbl=PDP_GetById(vCId+"_WeekRows");var vCommonWidth=vWRTbl.offsetWidth;var vDayHeaderTable=PDP_GetById(vCId+"_DayHeader");if((vDayHeaderTable!=null)&&(vDayHeaderTable.offsetWidth>vCommonWidth)) vCommonWidth=vDayHeaderTable.offsetWidth;var vHeaderTable1=PDP_GetById(vCId+"_Header1");if((vHeaderTable1!=null)&&(vHeaderTable1.offsetWidth>vCommonWidth)) vCommonWidth=vHeaderTable1.offsetWidth;var vHeaderTable2=PDP_GetById(vCId+"_Header2");if((vHeaderTable2!=null)&&(vHeaderTable2.offsetWidth>vCommonWidth)) vCommonWidth=vHeaderTable2.offsetWidth;var vHeaderTable3=PDP_GetById(vCId+"_Header3");if((vHeaderTable3!=null)&&(vHeaderTable3.offsetWidth>vCommonWidth)) vCommonWidth=vHeaderTable3.offsetWidth;var vFooterTable1=PDP_GetById(vCId+"_Footer1");if((vFooterTable1!=null)&&(vFooterTable1.offsetWidth>vCommonWidth)) vCommonWidth=vFooterTable1.offsetWidth;var vFooterTable2=PDP_GetById(vCId+"_Footer2");if((vFooterTable2!=null)&&(vFooterTable2.offsetWidth>vCommonWidth)) vCommonWidth=vFooterTable2.offsetWidth;var vFooterTable3=PDP_GetById(vCId+"_Footer3");if((vFooterTable3!=null)&&(vFooterTable3.offsetWidth>vCommonWidth)) vCommonWidth=vFooterTable3.offsetWidth;var vCalendarClientWidth=0;if(pCField.clientWidth) vCalendarClientWidth=pCField.clientWidth;else vCalendarClientWidth=pCField.offsetWidth;if(vCalendarClientWidth>vCommonWidth) vCommonWidth=vCalendarClientWidth;if(gPDP_Opera7) {pCField.style.width=(vCommonWidth+PDP_GetLeftBorder(pCField)*2)+"px";vCommonWidth=vCommonWidth+"px";} else {vCommonWidth=vCommonWidth+"px";pCField.style.width=vCommonWidth;} vWRTbl.style.width=vCommonWidth;if(vDayHeaderTable!=null) vDayHeaderTable.style.width=vCommonWidth;if(vHeaderTable1!=null) vHeaderTable1.style.width=vCommonWidth;if(vHeaderTable2!=null) vHeaderTable2.style.width=vCommonWidth;if(vHeaderTable3!=null) vHeaderTable3.style.width=vCommonWidth;if(vFooterTable1!=null) vFooterTable1.style.width=vCommonWidth;if(vFooterTable2!=null) vFooterTable2.style.width=vCommonWidth;if(vFooterTable3!=null) vFooterTable3.style.width=vCommonWidth;pCField.AO.InitSize=true;} function CSC_Show(pCSCId) {var vCFld=PDP_GetById(pCSCId);if(!vCFld.AO)return;var vC=vCFld.style.width.charAt(0);if((vC=="")||(vC=="0")) {vCFld.AO.InitSize=false;CSC_InitSize(vCFld);}} function CSC_AttachKeyboardNS() {document.addEventListener("keydown",CSC_OnKeyDownDOM,false);document.addEventListener("keypress",CSC_OnKeyPressDOM,false);} function CSC_DetachKeyboardNS() {document.removeEventListener("keydown",CSC_OnKeyDownDOM,false);document.removeEventListener("keypress",CSC_OnKeyPressDOM,false);} function CSC_ChangeDay(pCalCId,pDCId,pFeedback) {var vCal=PDP_GetById(pCalCId);var vAO=vCal.AO;var vSelCId=vAO.SelCell;if(pDCId!=vSelCId) {var vNewDC=null;var vNewRole=0;if(pDCId!="") {vNewDC=PDP_GetById(pDCId);vNewRole=parseInt(PDP_GetAtt(vNewDC,"CellRole","0"));if(vNewRole>=12) return;} if((vSelCId!=null)&&(vSelCId!="")) {var vDC=PDP_GetById(vSelCId);var vRole=parseInt(PDP_GetAtt(vDC,"CellRole","0"));PDP_SetBkColor(vDC,"");vDC.style.fontWeight="";vDC.style.color="";if(vDC.background) vDC.background="";vDC.className="";var vSupportsWeekend=false;switch(vRole) {case 0:vDC.className=vAO.WDCSS;vSupportsWeekend=true;break;case 2:vDC.className=vAO.TCSS;if(vDC.className=="") vDC.style.fontWeight="bold";vSupportsWeekend=vAO.WEBGTC;break;case 3:vDC.className=vAO.SpCSS;vSupportsWeekend=vAO.WEBGSpC;break;case 10:case 11:vDC.className=vAO.OMCSS;if(vDC.className=="") vDC.style.color="gray";vSupportsWeekend=vAO.WEBGOM;break;} if(vSupportsWeekend&&(eval(PDP_GetAtt(vDC,"WkE")))) PDP_SetBkColor(vDC,vAO.WEBG);if(vAO.SDId!="") {var vUTCDate=PDP_MakeUTCDate(CSC_GetYear(pCalCId),CSC_GetMonth(pCalCId),CSC_GetDay(pCalCId));var vBSD=SD_FindDate(vAO.SDId,vUTCDate);if(vBSD!=null) {if((vBSD.CssClass!="")&&(vRole<10)) vDC.className=vBSD.CssClass;else if((vBSD.OMCssClass!="")&&(vRole>=10)) vDC.className=vBSD.OMCssClass;}} if(vDC.onmouseout!=null) {if(document.createEvent!=null) {var evt=document.createEvent('MouseEvents');evt.initEvent('mouseout',false,false);vDC.dispatchEvent(evt);} else if(vDC.fireEvent!=null) vDC.fireEvent('onmouseout');else {var vFnc=vDC.getAttribute("onmouseout").toString();if(vFnc!="") {var vIndex=vFnc.indexOf('CSC_MouseOutEffect');vFnc=vFnc.substring(vIndex,vFnc.length-1);vIndex=vFnc.indexOf(')');vFnc=vFnc.substring(0,vIndex+1);eval(vFnc+';');}}}} if(vNewDC!=null) {PDP_SetBkColor(vNewDC,"");vNewDC.style.fontWeight="";if(vNewDC.background) vNewDC.background="";if(vNewRole==2) {vNewDC.className=vAO.SelTCSS;if(vNewDC.className=="") vNewDC.style.fontWeight="bold";} else {vNewDC.className=vAO.SelCSS;} if(vNewDC.className=="") PDP_SetBkColor(vNewDC,"gold");vAO.SelCell=pDCId;var vDayValue=PDP_GetAtt(vNewDC,"Day",0);PDP_GetById(pCalCId+"_Day").value=vDayValue;var vMO=parseInt(PDP_GetAtt(vNewDC,"MonthOffset","0"));var vYear=vAO.Year;var vMonth=vAO.Month;if((vMonth==0)&&(vMO<0)) {vMonth=11;vYear--;} else if((vMonth==11)&&(vMO>0)) {vMonth=0;vYear++;} else vMonth=vMonth+vMO;PDP_GetById(pCalCId+"_Year").value=vYear.toString();PDP_GetById(pCalCId+"_Month").value=vMonth.toString();} else {vAO.SelCell="";PDP_GetById(pCalCId+"_Year").value="0";PDP_GetById(pCalCId+"_Month").value="0";PDP_GetById(pCalCId+"_Day").value="0";} CSC_DrawDateLabel(vCal);if(pFeedback) CSC_OnSelectionChanged(vCal,false);} else if(pFeedback&&(pDCId!="")&&vAO.IsPopup) CSC_OnSelectionChanged(vCal,true);} function CSC_OnSelectionChanged(pCalFld,pApply) {var vAO=pCalFld.AO;if(!pApply) {if(vAO.AChgN) pApply=true;} if(pApply) {if(vAO.OnSelChg) eval(vAO.OnSelChg);if(vAO.C2UID!="") {var vC2U=PDP_GetById(vAO.C2UID);if(vC2U) {var vYear=parseInt(PDP_GetById(pCalFld.id+"_Year").value);var vMonth=parseInt(PDP_GetById(pCalFld.id+"_Month").value);var vDay=parseInt(PDP_GetById(pCalFld.id+"_Day").value);var vValue=PDP_FmtDate(vYear,vMonth,vDay,vAO.DPC2U,vAO.DFC2U);if((vC2U.value!=null)&&(vC2U.nodeName=="INPUT")) {if(!vC2U.isMultiLine) vC2U.value=vValue;} else {vC2U.innerHTML=vValue}}} switch(vAO.SelChgC) {case"yes":PDP_ClosePopup();break;case"noapplycmd":if(!vAO.ApMd) PDP_ClosePopup();break;}}} function CSC_FocusBorderColor(pCalCId,pColor) {var vWRTbl=PDP_GetById(pCalCId+"_WeekRows");vWRTbl.style.borderColor=pColor;} function CSC_MouseOverEffect(pCalCId,pDCId,pCellsHaveSpacing) {var vCal=PDP_GetById(pCalCId);var vAO=vCal.AO;if(!vAO)return;var vDC=PDP_GetById(pDCId);var vRole=parseInt(PDP_GetAtt(vDC,"CellRole","0"));if(vRole>=12) return;var vSelCId=vAO.SelCell;if(pCellsHaveSpacing&&(vAO.MOBdrC!="")) vDC.style.borderColor=vAO.MOBdrC;if(vAO.MOFC!="") vDC.style.color=vAO.MOFC;} function CSC_MouseOutEffect(pDCId) {var vDC=PDP_GetById(pDCId);var vCode=PDP_GetAtt(vDC,"MouseOutCode","");eval(vCode);} function CSC_OnKeyDownIE(pCalCId) {return CSC_OnKeyDownBody(window.event,pCalCId);} function CSC_OnKeyDownDOM(pE) {if((gPUNPos==-1)||(gPopupCId[gPUNPos]=="")) return false;var vCalCId=gPopupCId[gPUNPos];var vWRT=document.getElementById(vCalCId+"_WeekRows");if(vWRT!=null) return CSC_OnKeyDownBody(pE,vCalCId);else return false;} function CSC_OnKeyDownBody(pE,pCalCId) {var vKeyCode=PDP_GetKeyCode(pE);var vShift=PDP_IsShift(pE);var vCtrl=PDP_IsCtrl(pE);if(vCtrl||((vKeyCode>=33)&&(vKeyCode<=47))||(vKeyCode==27)) {var vCal=PDP_GetById(pCalCId);if(CSC_ArrowKeyProcessing(vCal,vKeyCode)) PDP_StopEvent(pE);else if(CSC_CommandKeyProcessing(vCal,vKeyCode,vShift,vCtrl,!vCtrl)) PDP_StopEvent(pE);return false;} else if(vKeyCode==9) {var vCal=PDP_GetById(pCalCId);if(vCal.AO.IsPopup) {PDP_CloseAllPopups();PDP_StopEvent(pE);return false;}} else return true;} function CSC_OnKeyPressIE(pCalCId) {return CSC_OnKeyPressBody(window.event,pCalCId);} function CSC_OnKeyPressDOM(pE) {if((gPUNPos==-1)||(gPopupCId[gPUNPos]=="")) return false;var vCalCId=gPopupCId[gPUNPos];var vWRT=document.getElementById(vCalCId+"_WeekRows");if(vWRT!=null) return CSC_OnKeyPressBody(pE,vCalCId);else return false;} function CSC_OnKeyPressBody(pE,pCalCId) {var vKeyCode=PDP_GetKeyCode(pE);var vShift=PDP_IsShift(pE);var vCtrl=PDP_IsCtrl(pE);if(((vKeyCode<33)||(vKeyCode>47))&&(vKeyCode!=27)) {var vCal=PDP_GetById(pCalCId);var vTemp=CSC_DigitKeyProcessing(vCal,vKeyCode)||CSC_CommandKeyProcessing(vCal,vKeyCode,vShift,vCtrl,false);} PDP_StopEvent(pE);return false;} function CSC_ArrowKeyProcessing(pCalFld,pKeyCode) {var vAO=pCalFld.AO;switch(pKeyCode) {case 38:if(vAO.UDMd>0) CSC_MoveSelection(pCalFld.id,-7,vAO.UDMd==2,true);break;case 40:if(vAO.UDMd>0) CSC_MoveSelection(pCalFld.id,7,vAO.UDMd==2,true);break;case 37:if(vAO.LRMd>0) CSC_MoveSelection(pCalFld.id,-1,vAO.LRMd==2,true);break;case 39:if(vAO.LRMd>0) CSC_MoveSelection(pCalFld.id,1,vAO.LRMd==2,true);break;default:return false;} return true;} function CSC_DigitKeyProcessing(pCalFld,pKeyCode) {if((pKeyCode>=48)&&(pKeyCode<=57)) {var vKeyCodeStr=String.fromCharCode(pKeyCode);CSC_TypeToDate(pCalFld,vKeyCodeStr);return true;} else return false;} function CSC_CommandKeyProcessing(pCalFld,pKeyCode,pShiftKey,pCtrlKey,pIsOnKeyDown) {var vResult=true;var vAO=pCalFld.AO;var vCmdId=PDP_GetCmdId(vAO.CmdKeys,pKeyCode,pCtrlKey,pShiftKey,pIsOnKeyDown);switch(vCmdId) {case"1":CSC_ViewMonthByCount(pCalFld.id,-1);break;case"2":CSC_ViewMonthByCount(pCalFld.id,1);break;case"3":CSC_ViewMonthByCount(pCalFld.id,-vAO.JBy);break;case"4":CSC_ViewMonthByCount(pCalFld.id,vAO.JBy);break;case"10":CSC_ShowToday(pCalFld.id,true);break;case"11":CSC_SetNoSelection(pCalFld.id,false,true);break;case"12":CSC_ShowSelection(pCalFld.id);break;case"13":CSC_Apply(pCalFld.id);break;case"14":CSC_ShowSpecial(pCalFld.id,true);break;case"20":PDP_ClosePopup();break;case"21":PDP_OpenPopup(pCalFld.id+"_Help",pCalFld.id+"_CM",false);break;case"22":CSC_OnPopupMonthYearPicker(pCalFld.id,pCalFld.id+"_MYP_PN");PDP_OpenPopup(pCalFld.id+"_MYP_TG",pCalFld.id+"_MYP_PN",false);break;default:vResult=false;break;} return vResult;} var gTypeToDate="";var gTypeToDateTimer=0;function CSC_TypeToDate(pCalFld,pKeyCodeStr) {if(gTypeToDateTimer!=0) {window.clearInterval(gTypeToDateTimer);gTypeToDateTimer=0;} if(gTypeToDate.length==2) gTypeToDate=pKeyCodeStr;else if((pKeyCodeStr!="0")||(gTypeToDate.length==1)) gTypeToDate=gTypeToDate+pKeyCodeStr;var vDayOfMonth=parseInt(gTypeToDate);if(vDayOfMonth>31) vDayOfMonth=parseInt(pKeyCodeStr);if(vDayOfMonth==0) {gTypeToDate="";return;} CSC_AssignDate(pCalFld,vDayOfMonth,true);if(gTypeToDate.length==1) gTypeToDateTimer=window.setInterval("gTypeToDate = '';",1500);else gTypeToDateTimer=0;} function CSC_AssignDate(pCalFld,pDayOfMonth,pFeedback) {vWRTbl=PDP_GetById(pCalFld.id+"_WeekRows");var vWkNm=pCalFld.AO.WkNm;var vWkNumSpace=vWkNm?1:0;var vWeekRow=null;for(var vRowCount=0;vRowCount<6;vRowCount++) {if(vWRTbl.rows&&!gPDP_Safari) vWeekRow=vWRTbl.rows[vRowCount];else {var vRows=PDPUtil_GetChildNodes(vWRTbl,"TBODY",1);vWeekRow=PDPUtil_GetChildNodes(vRows,"TR",vRowCount+1);} for(var vCellCount=0;vCellCount<7;vCellCount++) {var vDC=null;if(vWeekRow.cells&&!gPDP_Safari) vDC=vWeekRow.cells[vCellCount+vWkNumSpace];else vDC=PDPUtil_GetChildNodes(vWeekRow,"TD",vCellCount+1+vWkNumSpace);var vRole=parseInt(PDP_GetAtt(vDC,"CellRole","0"));if(vRole<10) {var vDay=PDP_GetAtt(vDC,"Day",0);if(vDay==pDayOfMonth) {CSC_ChangeDay(pCalFld.id,vDC.id,pFeedback);return;}}}}} function CSC_FillInMonthHeader(pCalCId) {var vMYFld=PDP_GetById(pCalCId+"_MonthYearLabel");if(vMYFld) {var vCal=PDP_GetById(pCalCId);var vAO=vCal.AO;var vYearLabel=PDP_GetById(pCalCId+"_YearLabel");var vAbbrevMonths=eval(PDP_GetAtt(vCal,"AbbrevMonthNames",false));var vMYText="";var vYear=vAO.Year;var vMonth=vAO.Month;if(vAbbrevMonths) vMYText=PDP_AbbrevMonths[vMonth];else vMYText=PDP_Months[vMonth];switch(vAO.ShowYear) {case"rightofmonth":vMYText=vMYText+" "+vYear;break;case"leftofmonth":vMYText=vYear+" "+vMYText;break;case"belowmonth":if(vYearLabel) {vYearLabel.innerHTML=vYear;} break;} vMYFld.innerHTML=vMYText;}} function CSC_DrawDateLabel(pCalFld) {var vFld=PDP_GetById(pCalFld.id+"_CurrentDate");if(vFld) {var vY=parseInt(PDP_GetById(pCalFld.id+"_Year").value);var vM=parseInt(PDP_GetById(pCalFld.id+"_Month").value);var vD=parseInt(PDP_GetById(pCalFld.id+"_Day").value);var vValue=PDP_FmtDate(vY,vM,vD,pCalFld.AO.CurDPat,pCalFld.AO.CurDFmt);vFld.innerHTML=vValue;}} function CSC_IsCurrentMonth(pCalFld,pYear,pMonth) {if(pMonth!=pCalFld.AO.Month) return false;return(pYear==pCalFld.AO.Year);} function CSC_OnClickMonthChangeCommands(pCalCId,pCommandId,pMonthCount) {var vCmdFld=PDP_GetById(pCommandId);if(vCmdFld.style.visibility!="hidden") {CSC_ViewMonthByCount(pCalCId,pMonthCount);CSC_FocusOnCalendar(pCalCId);}} function CSC_TransferMonthYearToCalendar(pCalCId,pMYPId) {var vCal=PDP_GetById(pCalCId);var vMonth=MYP_GetMonth(pMYPId);var vYear=MYP_GetYear(pMYPId);if((vMonth>0)||(vYear>0)) if(vYear==0) CSC_ViewMonth(pCalCId,vMonth-1) else if(vMonth==0) CSC_ViewYear(pCalCId,vYear) else CSC_ViewDate(pCalCId,vYear,vMonth-1);} function CSC_OnPopupMonthYearPicker(pCalCId,pMYPId) {var vCal=PDP_GetById(pCalCId);MYP_SelectMonthYear(pMYPId,vCal.AO.Month+1,vCal.AO.Year);} function CSC_DateSelectable(pCalFld,pYear,pMonth,pDay) {var vResult=true;if(pCalFld.AO.SDId!="") {var vSD=SD_FindDate(pCalFld.AO.SDId,PDP_MakeUTCDate(pYear,pMonth,pDay));if((vSD!=null)&&!vSD.Selectable) vResult=false;} return vResult;} function CSC_GetDate(pCalCId) {var vDateValue=PDP_GetById(pCalCId+"_Day").value;if(vDateValue=="0") return null;else return new Date(PDP_GetById(pCalCId+"_Year").value,PDP_GetById(pCalCId+"_Month").value,vDateValue);} function CSC_GetDateString(pCalCId,pPattern,pFormat) {var vYear=parseInt(PDP_GetById(pCalCId+"_Year").value);var vMonth=parseInt(PDP_GetById(pCalCId+"_Month").value);var vDay=parseInt(PDP_GetById(pCalCId+"_Day").value);return PDP_FmtDate(vYear,vMonth,vDay,pPattern,pFormat)} function CSC_GetYear(pCalCId) {if(PDP_GetById(pCalCId+"_Day").value=="0") return-1;else return parseInt(PDP_GetById(pCalCId+"_Year").value);} function CSC_GetMonth(pCalCId) {if(PDP_GetById(pCalCId+"_Day").value=="0") return-1;else return parseInt(PDP_GetById(pCalCId+"_Month").value);} function CSC_GetDay(pCalCId) {var vDayValue=PDP_GetById(pCalCId+"_Day").value;if(vDayValue=="0") return-1;else return parseInt(PDP_GetById(pCalCId+"_Day").value);} function CSC_SetDate(pCalCId,pYear,pMonth,pDay,pChangeMonth,pFeedback) {var vCal=PDP_GetById(pCalCId);var vAO=vCal.AO;var vValidDate=true;if(!CSC_DateSelectable(vCal,pYear,pMonth,pDay)) {vValidDate=false;PDP_GetById(pCalCId+"_Year").value="0";PDP_GetById(pCalCId+"_Month").value="0";PDP_GetById(pCalCId+"_Day").value="0";} if(vValidDate) {PDP_GetById(pCalCId+"_Year").value=pYear;PDP_GetById(pCalCId+"_Month").value=pMonth;PDP_GetById(pCalCId+"_Day").value=pDay;} if(vValidDate&&vAO.MonthLoaded&&CSC_IsCurrentMonth(vCal,pYear,pMonth)) {CSC_AssignDate(vCal,pDay,pFeedback);} else {if(pChangeMonth) {vAO.Month=pMonth;vAO.Year=pYear;} CSC_FillInMonth(pCalCId,true);if(pChangeMonth) CSC_Callback(vCal);} if(pFeedback) CSC_OnSelectionChanged(vCal,false);return true;} function CSC_SetNoSelection(pCalCId,pShowTodayMonth,pFeedback) {var vCal=PDP_GetById(pCalCId);var vAO=vCal.AO;PDP_GetById(pCalCId+"_Year").value="0";PDP_GetById(pCalCId+"_Month").value="0";PDP_GetById(pCalCId+"_Day").value="0";if(pFeedback) {CSC_OnSelectionChanged(vCal,false);if(vCal.style.visibility=="hidden") return;} if(pShowTodayMonth) {vAO.Month=vAO.TodayM;vAO.Year=vAO.TodayY;} CSC_FillInMonth(pCalCId,true);if(pShowTodayMonth) CSC_Callback(vCal);} function CSC_ViewDate(pCalCId,pYear,pMonth) {var vCal=PDP_GetById(pCalCId);var vAO=vCal.AO;if((vAO.Year==pYear)&&(vAO.Month==pMonth)) return;vAO.Month=pMonth;vAO.Year=pYear;CSC_FillInMonth(pCalCId,false);CSC_Callback(vCal);} function CSC_ViewMonth(pCalCId,pMonth) {var vCal=PDP_GetById(pCalCId);var vAO=vCal.AO;if(vAO.Month==pMonth) return;vAO.Month=pMonth;CSC_FillInMonth(pCalCId,false);CSC_Callback(vCal);} function CSC_ViewYear(pCalCId,pYear) {var vCal=PDP_GetById(pCalCId);var vAO=vCal.AO;if(vAO.Year==pYear) return;vAO.Year=pYear;CSC_FillInMonth(pCalCId,false);CSC_Callback(vCal);} function CSC_ViewMonthByCount(pCalCId,pJumpMonths) {if(pJumpMonths==0) return;var vCal=PDP_GetById(pCalCId);var vAO=vCal.AO;var vYear=vAO.Year;var vMonth=vAO.Month;if(pJumpMonths>0) {vMonth=vMonth+pJumpMonths;var vIncYears=Math.round((vMonth/12)-0.5);vYear=vYear+vIncYears;vMonth=vMonth%12;var vMaxDate=PDP_MakeUTCDate(vAO.MaxY,vAO.MaxM,vAO.MaxD);if(vMaxDate!=null) if((vYear>vMaxDate.getUTCFullYear())||((vYear==vMaxDate.getUTCFullYear())&&(vMonth>vMaxDate.getUTCMonth()))) {vYear=vMaxDate.getUTCFullYear();vMonth=vMaxDate.getUTCMonth();}} else {vMonth=11-vMonth;vMonth=vMonth-pJumpMonths;var vIncYears=Math.round((vMonth/12)-0.5);vYear=vYear-vIncYears;vMonth=11-(vMonth%12);var vMinDate=PDP_MakeUTCDate(vAO.MinY,vAO.MinM,vAO.MinD);if(vMinDate!=null) if((vYear=0) for(var vPos=1;(vRole>=12)&&(vPos<42);vPos++) {vNewSelCId=pCalCId+"_"+vPos;var vRole=parseInt(PDP_GetAtt(PDP_GetById(vNewSelCId),"CellRole","0"));} else for(var vPos=42;(vRole>=12)&&(vPos>0);vPos--) {vNewSelCId=pCalCId+"_"+vPos;var vRole=parseInt(PDP_GetAtt(PDP_GetById(vNewSelCId),"CellRole","0"));} CSC_ChangeDay(pCalCId,vNewSelCId,pFeedback);return true;} var vCNum=0;var vCellParts=vSelCId.split('_');vCNum=parseInt(vCellParts[vCellParts.length-1]);vCNum=vCNum+pNumDays;var vNewSelCId=pCalCId+"_"+vCNum;var vChangeMonths=false;if((vCNum>=1)&&(vCNum<=42)) {var vRole=parseInt(PDP_GetAtt(PDP_GetById(vNewSelCId),"CellRole","0"));if((vRole==14)||(vRole==12)) return false;else vChangeMonths=vRole>=12;} else vChangeMonths=true;if(!vChangeMonths) {CSC_ChangeDay(pCalCId,vNewSelCId,pFeedback);} else if(pChangeViewsAllowed) {var vSelDate=PDP_MakeUTCDate(PDP_GetById(pCalCId+"_Year").value,PDP_GetById(pCalCId+"_Month").value,PDP_GetById(pCalCId+"_Day").value);vSelUTC=vSelDate.valueOf();vSelUTC=vSelUTC+(pNumDays*86400000);var vMinDate=PDP_MakeUTCDate(vAO.MinY,vAO.MinM,vAO.MinD);if((vMinDate!=null)&&(vSelUTC-1)||(gPDP_UAgent.indexOf("msie 5.2")>-1)) gPDP_IEMacOSX=true;else if(gPDP_UAgent.indexOf("msie 5.1")>-1) gPDP_IEMac51=true;} else if(gPDP_IEWin) {if((gPDP_UAgent.indexOf("msie 5.5")>-1)||(gPDP_UAgent.indexOf("msie 6")>-1)) gPDP_IEWin55=true;} else if(gPDP_Opera) {if(parseInt(gPDP_BrowserVers)>=7) {gPDP_Opera7=true;gPDP_Opera=false;}} gPDP_SupportsOnKeyPress=!gPDP_Opera&&!gPDP_Konqueror;gPDP_SupportsFocusOnTable=gPDP_IEWin;function PDP_ChkBrws(pID,pSetVer) {var vPos=gPDP_UAgent.indexOf(pID)+1;if(pSetVer&&vPos) {gPDP_BrowserVers=parseFloat(gPDP_UAgent.substring(vPos+pID.length));if(isNaN(gPDP_BrowserVers)) gPDP_BrowserVers=gPDP_UAgent.charAt(vPos+pID.length);} return vPos;} var gPDP_FormName="";var gPDP_NS4RegEx=new RegExp(":","g");var gPDP_ObjInited=false;function PDP_InitObjects(pForce) {if(!pForce&&gPDP_ObjInited) return;gPDP_ObjInited=true;if(window.gPDP_Objects) for(var vI=0;vI-1) {var vEFldId=pFId.substr(0,vPos);var vEFld=PDP_GetById(vEFldId);if((vEFld!=null)&&(((vEFld.readonly!=null)&&(vEFld.readonly))||((vEFld.disabled!=null)&&(vEFld.disabled)))) return false;} return true;} function PDP_SetBkColor(pElement,pColor) {if(gPDP_Opera) {if(pColor=="") pColor="white";pElement.style.background=pColor;} else pElement.style.backgroundColor=pColor;} function PDP_GetKeyCode(pE) {var vKeyCode=null;if(pE.keyCode) vKeyCode=pE.keyCode;else if(pE.which) vKeyCode=pE.which;return vKeyCode;} function PDP_IsShift(pE) {var vShiftKey=false;if(pE.shiftKey!=null) vShiftKey=pE.shiftKey else if(pE.modifiers!=null) vShiftKey=(pE.modifiers|4)!=0;return vShiftKey;} function PDP_IsCtrl(pE) {var vCtrlKey=false;if(pE.ctrlKey!=null) vCtrlKey=pE.ctrlKey else if(pE.modifiers!=null) vCtrlKey=(pE.modifiers|2)!=0;return vCtrlKey;} function PDP_StopEvent(pE) {if(pE.cancelBubble!=null) pE.cancelBubble=true;if(pE.stopPropagation) pE.stopPropagation();if(pE.preventDefault) pE.preventDefault();} function PDP_Trunc(pDecimal) {var vStr=pDecimal.toString();var vPos=vStr.indexOf(".");if(vPos==-1) return parseInt(vStr) else return parseInt(vStr.substr(0,vPos));} function PDP_FmtDate(pYear,pMonth,pDay,pPattern,pFormat) {if(pDay==0) return"";var vResult="";vResult=pPattern.replace("yyyy",pYear.toString());if(vResult.indexOf("yy")!=-1) {var vShortYear=pYear%100;if(vShortYear>9) vResult=vResult.replace("yy",vShortYear.toString());else vResult=vResult.replace("yy","0"+vShortYear.toString());} if(vResult.indexOf("dd")!=-1) {if(pDay>9) vResult=vResult.replace("dd",pDay.toString());else vResult=vResult.replace("dd","0"+pDay.toString());} else vResult=vResult.replace("d",pDay.toString());if(pFormat==0) {var vAdjMonth=pMonth+1;if(vResult.indexOf("MM")!=-1) {if(vAdjMonth>9) vResult=vResult.replace("MM",vAdjMonth.toString());else vResult=vResult.replace("MM","0"+vAdjMonth.toString());} else vResult=vResult.replace("M",vAdjMonth.toString());} else if(pFormat==1) {var vDate=new Date(pYear,pMonth,pDay);var vDayOfWeek=vDate.getDay();vResult=vResult.replace("MMMM",PDP_AbbrevMonths[pMonth]);vResult=vResult.replace("ww",PDP_AbbrevDaysOfWeek[vDayOfWeek]);} else {var vDate=new Date(pYear,pMonth,pDay);var vDayOfWeek=vDate.getDay();vResult=vResult.replace("MMMM",PDP_Months[pMonth]);vResult=vResult.replace("ww",PDP_DaysOfWeek[vDayOfWeek]);} return vResult;} function PDP_GetCmdId(pCmdKeys,pKeyCode,pCtrlKey,pShiftKey,pIsOnKeyDown) {var vCommandId="0";var vModifiers=pCtrlKey?"C":"";var vMod2=pShiftKey?"S":"";vModifiers=vModifiers+vMod2;var vFirstToken="{#"+pKeyCode+vModifiers;var vPos=pCmdKeys.indexOf(vFirstToken);if(vPos>-1) {var vEndPos=pCmdKeys.indexOf("}",vPos+vFirstToken.length+1);if(vEndPos>-1) vCommandId=pCmdKeys.substring(vPos+vFirstToken.length+1,vEndPos);} else if(!pIsOnKeyDown) {var vKeyCodeStr=String.fromCharCode(pKeyCode);vKeyCodeStr=vKeyCodeStr.toUpperCase();vFirstToken="{"+vKeyCodeStr+vModifiers;vPos=pCmdKeys.indexOf(vFirstToken);if(vPos>-1) {var vEndPos=pCmdKeys.indexOf("}",vPos+vFirstToken.length+1);if(vEndPos>-1) vCommandId=pCmdKeys.substring(vPos+vFirstToken.length+1,vEndPos);}} return vCommandId;} function ButtonEffect(pFldWStyle,pNewStyle,pFieldID_WithImage,pImageUrl) {if(!PDP_CanEditParent(pFldWStyle.id))return;if(pFldWStyle&&pFldWStyle.className) pFldWStyle.className=pNewStyle;if((pImageUrl!="")&&(pFieldID_WithImage!="")) {vFieldWithImage=PDP_GetById(pFieldID_WithImage);if(vFieldWithImage&&vFieldWithImage.src) vFieldWithImage.src=pImageUrl;}} function PDP_CtlInited(pFld) {if(!pFld.AO) {alert('Page is loading. Please wait.');return false;} return true;} var gPopupCId=new Array("","","","","");var gToggleCId=new Array("","","","","");var gPUNPos=-1;function PDP_TogglePopup(pTglCId,pPUCId,pOnPopup) {var vPUC=PDP_GetById(pPUCId);if(vPUC.style.visibility=="inherit") {PDP_ClosePopup();} else {PDP_OpenPopup(pTglCId,pPUCId,true,pOnPopup);}} var gPDP_InOP=false;function PDP_OpenPopup(pTglCId,pPUCId,pClick,pOnPopup) {var vTglC=null;if(pTglCId!="") vTglC=PDP_GetById(pTglCId);if(vTglC!=null) if(vTglC.disabled) return;if(pClick&&window.event) PDP_TestCaptureNS6(window.event);if(gPUNPos>=gPopupCId.length) return;if(gPDP_InOP) return;gPDP_InOP=true;var vPUC=PDP_GetById(pPUCId);var vOPUFnc="";if(pOnPopup!=null) vOPUFnc=pOnPopup;else if(vPUC.PO) vOPUFnc=vPUC.PO.onpopup;if((vOPUFnc!=null)&&(vOPUFnc!="")) {var vResult=true;eval(vOPUFnc);if(vResult==false) {gPDP_InOP=false;return;}} gPUNPos++;gPopupCId[gPUNPos]=pPUCId;gToggleCId[gPUNPos]=pTglCId;if(vTglC!=null) PDP_PositionPopupToToggle(vTglC,vPUC);PDP_MSIEFixPopupOpen(vPUC);vPUC.style.visibility="inherit";vPUC.Poppedup=true;if(vPUC.focus) setTimeout("javascript:var vPUC2 = PDP_GetById('"+pPUCId+"'); if (vPUC2.Poppedup && (vPUC2.style.visibility = 'inherit')) vPUC2.focus();",50);if(document.attachEvent) {if(gPUNPos==0) document.attachEvent("onmousedown",PDP_TestCaptureIE5);} else if(document.addEventListener) {if(gPUNPos==0) document.addEventListener("mousedown",PDP_TestCaptureNS6,false);} else document.onmousedown=PDP_TestCaptureIE5;gPDP_InOP=false;} function PDP_OpenPopupAtMousePoint(pPUCId,pE) {if((document.body.scrollTop==null)&&(window.pageXOffset)) return;PDP_TestCaptureNS6(pE);if(gPUNPos>=gPopupCId.length) return;var vPUC=PDP_GetById(pPUCId);vPUC.style.position="absolute";var vClientX=PDP_GetScrolledX(vPUC,pE.clientX,true);var vClientY=PDP_GetScrolledY(vPUC,pE.clientY,true);if(true) {vClientX=PDP_GetOffsetX(vPUC,vClientX,-1);vClientY=PDP_GetOffsetY(vPUC,vClientY,-1);} if(gPDP_IEMac) {vClientX=vClientX+10;vClientY=vClientY+15;} if(gPDP_Safari) {vClientX=vClientX+document.body.offsetLeft;vClientY=vClientY+document.body.offsetTop;} PDP_SetLeftPos(vPUC,vClientX);PDP_SetTopPos(vPUC,vClientY);vPUC.style.zIndex=30000+gPUNPos+1;if((gPUNPos==-1)||(gPopupCId[gPUNPos]!=pPUCId)) PDP_OpenPopup("",pPUCId,true);} function PDP_GetScrolledX(pPUC,pX,pLimit) {if(document.body.scrollLeft!=null) {var vDE=document.documentElement;if(pLimit) {var vOW=(vDE&&vDE.offsetWidth)?vDE.offsetWidth:document.body.offsetWidth;if(pX+pPUC.offsetWidth>vOW) pX=pX-pPUC.offsetWidth;if(pX<0) pX=0;} for(var vPar=PDP_ParentNode(pPUC);(vPar!=document.body)&&(vPar!=null);vPar=PDP_ParentNode(vPar)) {if(vPar.scrollLeft!=null) pX=pX+vPar.scrollLeft;} if(vDE&&vDE.scrollLeft) pX=pX+vDE.scrollLeft;else pX=pX+document.body.scrollLeft;} else if(window.pageXOffset!=null) {pX=pX+window.pageXOffset;} return pX;} function PDP_GetScrolledY(pPUC,pY,pLimit) {if(document.body.scrollTop!=null) {var vDE=document.documentElement;if(pLimit) {var vOH=(vDE&&vDE.offsetHeight)?vDE.offsetHeight:document.body.offsetHeight;if(pY+pPUC.offsetHeight>vOH) pY=pY-pPUC.offsetHeight;if(pY<0) pY=0;} for(var vPar=PDP_ParentNode(pPUC);(vPar!=document.body)&&(vPar!=null);vPar=PDP_ParentNode(vPar)) {if(vPar.scrollTop!=null) pY=pY+vPar.scrollTop;} if(vDE&&vDE.scrollTop) pY=pY+vDE.scrollTop;else pY=pY+document.body.scrollTop;} else if(window.pageXOffset!=null) {pY=pY+window.pageYOffset;} return pY;} function PDP_GetOffsetX(pControl,pIPos,pDir,pTstBrd) {var vLeftPos=pIPos;if(pTstBrd) vLeftPos=vLeftPos+pDir*PDP_GetLeftBorder(pControl);if(pControl.offsetParent) for(var vPar=pControl.offsetParent;(vPar!=null);vPar=vPar.offsetParent) {if(!gPDP_Opera7||(vPar.style.display!="inline-block")) vLeftPos=vLeftPos+pDir*vPar.offsetLeft;if(!gPDP_Safari||(vPar!=document.body)) vLeftPos=vLeftPos+pDir*PDP_GetLeftBorder(vPar);if(gPDP_Safari&&(vPar.style.position=="absolute")) break;} else for(var vPar=pControl.parentNode;(vPar!=document.body)&&(vPar!=null);vPar=vPar.parentNode) {if(vPar.style.position=="absolute") {vLeftPos=vLeftPos+pDir*vPar.offsetLeft;break;}} return vLeftPos;} function PDP_GetOffsetY(pControl,pIPos,pDir,pTstBrd) {var vTopPos=pIPos;if(pTstBrd) vTopPos=vTopPos+pDir*PDP_GetTopBorder(pControl);if(pControl.offsetParent) for(var vPar=pControl.offsetParent;(vPar!=null);vPar=vPar.offsetParent) {if(!gPDP_Opera7||(vPar.style.display!="inline-block")) vTopPos=vTopPos+pDir*vPar.offsetTop;if(!gPDP_Safari||(vPar!=document.body)) vTopPos=vTopPos+pDir*PDP_GetTopBorder(vPar);if(gPDP_Safari&&(vPar.style.position=="absolute")) break;} else for(var vPar=pControl.parentNode;(vPar!=document.body)&&(vPar!=null);vPar=vPar.parentNode) {if(vPar.style.position=="absolute") {vTopPos=vTopPos+pDir*vPar.offsetTop;break;}} return vTopPos;} function PDP_GetLeftBorder(pC) {if(pC.currentStyle) {var vBrd=parseInt(pC.currentStyle.borderLeftWidth);return isNaN(vBrd)?0:vBrd;} else if(window.getComputedStyle) {var vBrd=parseInt(document.defaultView.getComputedStyle(pC,null).getPropertyValue("border-left-width"));return isNaN(vBrd)?0:vBrd;} else if(gPDP_Safari) {var vBrd=(pC.offsetWidth-pC.clientWidth)/2;return isNaN(vBrd)?0:vBrd;} return 0;} function PDP_GetTopBorder(pC) {if(pC.currentStyle) {var vBrd=parseInt(pC.currentStyle.borderTopWidth);return isNaN(vBrd)?0:vBrd;} else if(window.getComputedStyle) {var vBrd=parseInt(document.defaultView.getComputedStyle(pC,null).getPropertyValue("border-top-width"));return isNaN(vBrd)?0:vBrd;} else if(gPDP_Safari) {var vBrd=(pC.offsetHeight-pC.clientHeight)/2;return isNaN(vBrd)?0:vBrd;} return 0;} function PDP_AbsParent(pPUC) {if(pPUC.offsetParent) for(var vPar=pPUC.offsetParent;(vPar!=document.body)&&(vPar!=null);vPar=vPar.offsetParent) {if(vPar.style.position=="absolute") {return true;}} else for(var vPar=pPUC.parentNode;(vPar!=document.body)&&(vPar!=null);vPar=vPar.parentNode) {if(vPar.style.position=="absolute") {return true;}} return false;} function PDP_ClosePopup() {if(gPUNPos==-1) return;if(gPDP_InOP) return;gPDP_InOP=true;var vPUC=PDP_GetById(gPopupCId[gPUNPos]);if(vPUC.PO&&vPUC.PO.onpopdown) eval(vPUC.PO.onpopdown);vPUC.style.visibility="hidden";vPUC.Poppedup=false;if(document.detachEvent) {if(gPUNPos==0) document.detachEvent("onmousedown",PDP_TestCaptureIE5);} else if(document.removeEventListener) {if(gPUNPos==0) document.removeEventListener("mousedown",PDP_TestCaptureNS6,false);} PDP_MSIEFixPopupClose(vPUC);gPopupCId[gPUNPos]="";gToggleCId[gPUNPos]="";gPUNPos--;if(gPUNPos>-1) {var vLwrPC=PDP_GetById(gPopupCId[gPUNPos]);if((vLwrPC.style.visibility!="hidden")&&(vLwrPC.focus!=null)) vLwrPC.focus();} gPDP_InOP=false;} function PDP_CloseAllPopups() {while(gPUNPos>-1) PDP_ClosePopup();} function PDP_PositionPopupToToggle(pTglC,pPUC) {var vHorizPos="leftsidesalign";var vVertPos="popupbelow";var vHorzOffset=0;var vVertOffset=0;var vPO=pPUC.PO;if(vPO!=null) {vHorizPos=vPO.HPos;vVertPos=vPO.VPos;vHorzOffset=vPO.HPosOf;vVertOffset=vPO.VPosOf;} var vLeftPos=pTglC.offsetLeft;var vTopPos=pTglC.offsetTop;vLeftPos=PDP_GetOffsetX(pTglC,pTglC.offsetLeft,1);vTopPos=PDP_GetOffsetY(pTglC,pTglC.offsetTop,1);if(gPDP_IEMac) {vLeftPos=vLeftPos+10;vTopPos=vTopPos+15;} if(gPDP_Safari) {vLeftPos=vLeftPos+document.body.offsetLeft;vTopPos=vTopPos+document.body.offsetTop;} var vToggleWidth=pTglC.offsetWidth;var vPopupWidth=pPUC.offsetWidth;if(pPUC.clientWidth&&(pPUC.clientWidthvLDE) vLeftPos=vLeftPos-(vLP-vLDE);var vTP=vTopPos+pPUC.offsetHeight;var vTDE=(vDE.scrollTop?vDE.scrollTop:vDB.scrollTop)+vDE.offsetHeight+vSY;if(vTP>vTDE) vTopPos=vTopPos-(vTP-vTDE);} if((window.__smartNav==null)||(!PDP_AbsParent(pPUC))) {if(vLeftPos<0) vLeftPos=0;if(vTopPos<0) vTopPos=0;} pPUC.style.position="absolute";PDP_SetLeftPos(pPUC,vLeftPos);PDP_SetTopPos(pPUC,vTopPos);pPUC.style.zIndex=30000+gPUNPos;if(gPDP_IEMac) {if(pPUC.style.pixelWidth=="") pPUC.style.pixelWidth=pPUC.offsetWidth;if(pPUC.style.pixelHeight=="") pPUC.style.pixelHeight=pPUC.offsetHeight;}} function PDP_TestCaptureIE5() {PDP_TestCaptureNS6(window.event);} function PDP_TestCaptureNS6(e) {if(gPUNPos==-1) return;if(gPDP_InOP) return;var vEndCaptureB=false;var vPUC=PDP_GetById(gPopupCId[gPUNPos]);var vX=gPDP_Safari?e.clientX:PDP_GetScrolledX(vPUC,e.clientX,false);var vY=gPDP_Safari?e.clientY:PDP_GetScrolledY(vPUC,e.clientY,false);if(gPDP_IEMac&&!gPDP_IEMacOSX) {vX=vX-10;vY=vY-15;} if(gPDP_Safari) {vX=vX+document.body.offsetLeft;vY=vY+document.body.offsetTop;} var vLeftPos=vPUC.offsetLeft;var vTopPos=vPUC.offsetTop;vLeftPos=PDP_GetOffsetX(vPUC,vPUC.offsetLeft,1);vTopPos=PDP_GetOffsetY(vPUC,vPUC.offsetTop,1);if(gPDP_Opera7) {vLeftPos=vLeftPos-PDP_GetLeftBorder(document.body);vTopPos=vTopPos-PDP_GetTopBorder(document.body);} if(vXvLeftPos+vPUC.offsetWidth) {vEndCaptureB=true;} else if(vYvTopPos+vPUC.offsetHeight) {vEndCaptureB=true;} if(vEndCaptureB&&(gToggleCId[gPUNPos]!="")) {var vTglC=PDP_GetById(gToggleCId[gPUNPos]);var vTL=vTglC.offsetLeft-PDP_GetLeftBorder(vTglC);var vTT=vTglC.offsetTop-PDP_GetTopBorder(vTglC);if((vX>=vTL)&&(vX<=vTL+vTglC.offsetWidth)&&(vY>=vTT)&&(vY<=vTT+vTglC.offsetHeight)) vEndCaptureB=false;} if(vEndCaptureB) {PDP_ClosePopup();if(gPUNPos>-1) PDP_TestCaptureNS6(e);}} function PDP_MSIEFixPopupOpen(pFld) {if(gPDP_IEWin55&&pFld.PO.IEFix) {var vIFrNm="PDP_ZIndexFix_"+pFld.id;if(!document.all[vIFrNm]) {var vIFrame="";var vElement=pFld.parentElement;vElement.insertAdjacentHTML('beforeEnd',vIFrame);} if(document.all[vIFrNm]) {var vStyle=document.all[vIFrNm].style;vStyle.pixelTop=pFld.style.pixelTop;vStyle.pixelLeft=pFld.style.pixelLeft;vStyle.pixelWidth=pFld.offsetWidth+6;vStyle.pixelHeight=pFld.offsetHeight+6;var vZIndex=29990-gPUNPos;vStyle.zIndex=vZIndex;vStyle.filter='progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)';vStyle.display='block';}}} function PDP_MSIEFixPopupClose(pFld) {if(gPDP_IEWin55&&pFld.PO.IEFix) {var vIFrNm="PDP_ZIndexFix_"+pFld.id;if(document.all[vIFrNm]) {document.all[vIFrNm].style.display='none';}}} function PDP_SetLeftPos(pFld,pLeftPos) {if(pFld.style.pixelLeft) pFld.style.pixelLeft=pLeftPos;else if(pFld.style.posLeft) pFld.style.posLeft=pLeftPos.toString()+"px";else pFld.style.left=pLeftPos.toString()+"px";} function PDP_SetTopPos(pFld,pTopPos) {if(pFld.style.pixelTop) pFld.style.pixelTop=pTopPos;else if(pFld.style.posTop) pFld.style.posTop=pTopPos.toString()+"px";else pFld.style.top=pTopPos.toString()+"px";} function PDP_HideFocus(pControlID,pValue) {var vField=PDP_GetById(pControlID);if(vField.hideFocus!=null) vField.hideFocus=pValue;} function PDP_GetAtt(pElement,pAttributeName,pDefaultValue) {if(gPDP_Safari) pAttributeName=pAttributeName.replace("_","");if(gPDP_Opera7) {var vResult=eval("pElement."+pAttributeName);if(vResult==null) vResult=pElement.getAttribute(pAttributeName,0);if((vResult==null)||(vResult=="")) vResult=pDefaultValue;return vResult;} else if(pElement.getAttribute) {var vResult=pElement.getAttribute(pAttributeName,0);if(!gPDP_IEWin&&(vResult==null)) vResult=eval("pElement."+pAttributeName);if(vResult==null) vResult=pDefaultValue;else if((vResult=="")&&(!document.all)) vResult=pDefaultValue;return vResult;} else {var vId=pElement.name.replace(gPDP_NS4RegEx,"_");var vVarName=vId+"_"+pAttributeName;var vResult=eval(vVarName);if((vResult==null)||(vResult=="")) vResult=pDefaultValue;return vResult;}} function PDP_SetAtt(pElement,pAttributeName,pAttributeValue) {if(gPDP_Opera7) {eval("pElement."+pAttributeName+"=pAttributeValue");} else if(pElement.setAttribute) pElement.setAttribute(pAttributeName,pAttributeValue,0);else {var vVarName=pElement.name+"_"+pAttributeName;eval("vVarName = pAttributeValue.toString();");}} var gPDP_ProcessingError=false;function PDP_ShowError(pFldId,pErrorCode,pShowAlert) {if(!gPDP_ProcessingError) {var vCode="javascript:PDP_ShowErrorBody('"+pFldId+"', "+pErrorCode+","+pShowAlert+")";setTimeout(vCode,10);}} function PDP_ShowErrorBody(pFldId,pErrorCode,pShowAlert) {if(gPDP_ProcessingError) return;gPDP_ProcessingError=true;var vFld=PDP_GetById(pFldId);var vAO=vFld.AO;if(vFld.style) {if(vAO.ErrFC!='') vFld.style.color=vAO.ErrFC;if(vAO.ErrBC!='') PDP_SetBkColor(vFld,vAO.ErrBC);} else pShowAlert=true;if(!gPDP_SupportsOnKeyPress) pShowAlert=true;if(vFld.focus&&vFld.select) {if(vAO.FOErr) {vFld.focus();vFld.select();}} if(pShowAlert) {var vEM="";switch(pErrorCode) {case 1:vEM=vAO.InvalidMsg;break;case 2:vEM=vAO.OutOfRangeMsg;break;} if(vEM!='') alert(vEM);} gPDP_ProcessingError=false;} function PDP_ClearError(pFldId) {var vTBFld=PDP_GetById(pFldId);if(vTBFld.style) {vTBFld.style.color=vTBFld.AO.OrigFC;PDP_SetBkColor(vTBFld,vTBFld.AO.OrigBC);}} function PDP_ParseInt(pValue) {if((pValue=='0')||(pValue=='00')) return 0;else return parseInt(pValue.replace(/^0*/,''));} function PDP_MakeUTCDate(pYear,pMonth,pDay) {if((pYear==null)||(pMonth==null)||(pDay==null)) return null;var vDate=new Date(0);vDate.setUTCFullYear(pYear,pMonth,pDay);vDate.setUTCHours(0,0,0,0);return vDate;} function PDP_AddMonths(pDate,pNumMonths) {var vMonth=pDate.getMonth();var vYear=pDate.getFullYear();var vDay=pDate.getDate();if(pNumMonths>0) {vMonth=vMonth+pNumMonths;var vIncYears=Math.round((vMonth/12)-0.5);vYear=vYear+vIncYears;vMonth=vMonth%12;} else {vMonth=11-vMonth;vMonth=vMonth-pNumMonths;var vIncYears=Math.round((vMonth/12)-0.5);vYear=vYear-vIncYears;vMonth=11-(vMonth%12);} do {vNewDate=new Date(vYear,vMonth,vDay);vDay--;} while(vNewDate.getMonth()!=vMonth) return vNewDate;} function PDP_GetWeekNum(pDate,pRule,pFDOW) {var vDate1=PDP_GetFirstWeekNumDate(pDate.getUTCFullYear(),pRule,pFDOW);var vWkNum=Math.round(1+((pDate-vDate1)/(86400000*7)));if(vWkNum>52) {var vDate2=PDP_GetFirstWeekNumDate(pDate.getUTCFullYear()+1,pRule,pFDOW);if(vDate2<=pDate) vWkNum=1;} return vWkNum;} function PDP_GetFirstWeekNumDate(pYear,pRule,pFDOW) {var vDate=PDP_MakeUTCDate(pYear,0,1);var vDOW=vDate.getUTCDay();switch(pRule) {case 0:if(vDOW==pFDOW) return vDate;else {var vUTC=vDate.valueOf();if(pFDOW>vDOW) vUTC=vUTC-((vDOW-pFDOW+7)*86400000);else vUTC=vUTC-((vDOW-pFDOW)*86400000);return new Date(vUTC);} break;case 1:if(vDOW==pFDOW) return vDate;else return PDP_MakeUTCDate(pYear,0,1+(pFDOW+7-vDOW));break;default:if(pFDOW>3) pFDOW=pFDOW+4;if(vDOW<=pFDOW+3) {if(vDOW==pFDOW) return vDate;else return PDP_MakeUTCDate(pYear,0,1+(pFDOW-vDOW));} else return PDP_MakeUTCDate(pYear,0,1+(pFDOW+7-vDOW));break;}} function PDP_RelocatePopup(pPF) {var vPN=pPF.parentNode;if((vPN!=null)&&(vPN!=document.body)&&(vPN.tagName!="FORM")&&(window.__smartNav==null)) {if((document.body.removeChild!=null)&&((document.body.appendChild!=null)||(document.body.outerHTML!=null))) {var vMoving=vPN.removeChild(pPF);if(!gPDP_Opera7&&(vMoving.outerHTML!=null)) {document.write(vMoving.outerHTML);} else document.body.appendChild(vMoving);PDP_InitObjects(true);}}}