/*
 * JSMin
 * Javascript Compressor
 * http://www.crockford.com/
 * http://www.smallsharptools.com/Projects/Packer/
*/

// all.js

(function(){var
window=this,undefined,_jQuery=window.jQuery,_$=window.$,jQuery=window.jQuery=window.$=function(selector,context){return new jQuery.fn.init(selector,context);},quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,isSimple=/^.[^:#\[\.,]*$/;jQuery.fn=jQuery.prototype={init:function(selector,context){selector=selector||document;if(selector.nodeType){this[0]=selector;this.length=1;this.context=selector;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&&elem.id!=match[3])
return jQuery().find(selector);var ret=jQuery(elem||[]);ret.context=document;ret.selector=selector;return ret;}}else
return jQuery(context).find(selector);}else if(jQuery.isFunction(selector))
return jQuery(document).ready(selector);if(selector.selector&&selector.context){this.selector=selector.selector;this.context=selector.context;}
return this.setArray(jQuery.makeArray(selector));},selector:"",jquery:"1.3.1",size:function(){return this.length;},get:function(num){return num===undefined?jQuery.makeArray(this):this[num];},pushStack:function(elems,name,selector){var ret=jQuery(elems);ret.prevObject=this;ret.context=this.context;if(name==="find")
ret.selector=this.selector+(this.selector?" ":"")+selector;else if(name)
ret.selector=this.selector+"."+name+"("+selector+")";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){return jQuery.inArray(elem&&elem.jquery?elem[0]:elem,this);},attr:function(name,value,type){var options=name;if(typeof name==="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]){var wrap=jQuery(html,this[0].ownerDocument).clone();if(this[0].parentNode)
wrap.insertBefore(this[0]);wrap.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,function(elem){if(this.nodeType==1)
this.appendChild(elem);});},prepend:function(){return this.domManip(arguments,true,function(elem){if(this.nodeType==1)
this.insertBefore(elem,this.firstChild);});},before:function(){return this.domManip(arguments,false,function(elem){this.parentNode.insertBefore(elem,this);});},after:function(){return this.domManip(arguments,false,function(elem){this.parentNode.insertBefore(elem,this.nextSibling);});},end:function(){return this.prevObject||jQuery([]);},push:[].push,find:function(selector){if(this.length===1&&!/,/.test(selector)){var ret=this.pushStack([],"find",selector);ret.length=0;jQuery.find(selector,this[0],ret);return ret;}else{var elems=jQuery.map(this,function(elem){return jQuery.find(selector,elem);});return this.pushStack(/[^+>] [^+>]/.test(selector)?jQuery.unique(elems):elems,"find",selector);}},clone:function(events){var ret=this.map(function(){if(!jQuery.support.noCloneEvent&&!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,jQuery.grep(this,function(elem){return elem.nodeType===1;})),"filter",selector);},closest:function(selector){var pos=jQuery.expr.match.POS.test(selector)?jQuery(selector):null;return this.map(function(){var cur=this;while(cur&&cur.ownerDocument){if(pos?pos.index(cur)>-1:jQuery(cur).is(selector))
return cur;cur=cur.parentNode;}});},not:function(selector){if(typeof selector==="string")
if(isSimple.test(selector))
return this.pushStack(jQuery.multiFilter(selector,this,true),"not",selector);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!!selector&&this.is("."+selector);},val:function(value){if(value===undefined){var elem=this[0];if(elem){if(jQuery.nodeName(elem,'option'))
return(elem.attributes.value||{}).specified?elem.value:elem.text;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<max;i++){var option=options[i];if(option.selected){value=jQuery(option).val();if(one)
return value;values.push(value);}}
return values;}
return(elem.value||"").replace(/\r/g,"");}
return undefined;}
if(typeof value==="number")
value+='';return this.each(function(){if(this.nodeType!=1)
return;if(jQuery.isArray(value)&&/radio|checkbox/.test(this.type))
this.checked=(jQuery.inArray(this.value,value)>=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),"slice",Array.prototype.slice.call(arguments).join(","));},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);},domManip:function(args,table,callback){if(this[0]){var fragment=(this[0].ownerDocument||this[0]).createDocumentFragment(),scripts=jQuery.clean(args,(this[0].ownerDocument||this[0]),fragment),first=fragment.firstChild,extra=this.length>1?fragment.cloneNode(true):fragment;if(first)
for(var i=0,l=this.length;i<l;i++)
callback.call(root(this[i],first),i>0?extra.cloneNode(true):fragment);if(scripts)
jQuery.each(scripts,evalScript);}
return this;function root(elem,cur){return table&&jQuery.nodeName(elem,"table")&&jQuery.nodeName(cur,"tr")?(elem.getElementsByTagName("tbody")[0]||elem.appendChild(elem.ownerDocument.createElement("tbody"))):elem;}}};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(typeof target==="boolean"){deep=target;target=arguments[1]||{};i=2;}
if(typeof target!=="object"&&!jQuery.isFunction(target))
target={};if(length==i){target=this;--i;}
for(;i<length;i++)
if((options=arguments[i])!=null)
for(var name in options){var src=target[name],copy=options[name];if(target===copy)
continue;if(deep&&copy&&typeof copy==="object"&&!copy.nodeType)
target[name]=jQuery.extend(deep,src||(copy.length!=null?[]:{}),copy);else if(copy!==undefined)
target[name]=copy;}
return target;};var exclude=/z-?index|font-?weight|opacity|zoom|line-?height/i,defaultView=document.defaultView||{},toString=Object.prototype.toString;jQuery.extend({noConflict:function(deep){window.$=_$;if(deep)
window.jQuery=_jQuery;return jQuery;},isFunction:function(obj){return toString.call(obj)==="[object Function]";},isArray:function(obj){return toString.call(obj)==="[object Array]";},isXMLDoc:function(elem){return elem.nodeType===9&&elem.documentElement.nodeName!=="HTML"||!!elem.ownerDocument&&jQuery.isXMLDoc(elem.ownerDocument);},globalEval:function(data){data=jQuery.trim(data);if(data){var head=document.getElementsByTagName("head")[0]||document.documentElement,script=document.createElement("script");script.type="text/javascript";if(jQuery.support.scriptEval)
script.appendChild(document.createTextNode(data));else
script.text=data;head.insertBefore(script,head.firstChild);head.removeChild(script);}},nodeName:function(elem,name){return elem.nodeName&&elem.nodeName.toUpperCase()==name.toUpperCase();},each:function(object,callback,args){var name,i=0,length=object.length;if(args){if(length===undefined){for(name in object)
if(callback.apply(object[name],args)===false)
break;}else
for(;i<length;)
if(callback.apply(object[i++],args)===false)
break;}else{if(length===undefined){for(name in object)
if(callback.call(object[name],name,object[name])===false)
break;}else
for(var value=object[0];i<length&&callback.call(value,i,value)!==false;value=object[++i]){}}
return object;},prop:function(elem,value,type,i,name){if(jQuery.isFunction(value))
value=value.call(elem,i);return typeof value==="number"&&type=="curCSS"&&!exclude.test(name)?value+"px":value;},className:{add:function(elem,classNames){jQuery.each((classNames||"").split(/\s+/),function(i,className){if(elem.nodeType==1&&!jQuery.className.has(elem.className,className))
elem.className+=(elem.className?" ":"")+className;});},remove:function(elem,classNames){if(elem.nodeType==1)
elem.className=classNames!==undefined?jQuery.grep(elem.className.split(/\s+/),function(className){return!jQuery.className.has(classNames,className);}).join(" "):"";},has:function(elem,className){return elem&&jQuery.inArray(className,(elem.className||elem).toString().split(/\s+/))>-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;if(name=="opacity"&&!jQuery.support.opacity){ret=jQuery.attr(style,"opacity");return ret==""?"1":ret;}
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)
ret=computedStyle.getPropertyValue(name);if(name=="opacity"&&ret=="")
ret="1";}else if(elem.currentStyle){var camelCase=name.replace(/\-(\w)/g,function(all,letter){return letter.toUpperCase();});ret=elem.currentStyle[name]||elem.currentStyle[camelCase];if(!/^\d+(px)?$/i.test(ret)&&/^\d/.test(ret)){var left=style.left,rsLeft=elem.runtimeStyle.left;elem.runtimeStyle.left=elem.currentStyle.left;style.left=ret||0;ret=style.pixelLeft+"px";style.left=left;elem.runtimeStyle.left=rsLeft;}}
return ret;},clean:function(elems,context,fragment){context=context||document;if(typeof context.createElement==="undefined")
context=context.ownerDocument||context[0]&&context[0].ownerDocument||document;if(!fragment&&elems.length===1&&typeof elems[0]==="string"){var match=/^<(\w+)\s*\/?>$/.exec(elems[0]);if(match)
return[context.createElement(match[1])];}
var ret=[],scripts=[],div=context.createElement("div");jQuery.each(elems,function(i,elem){if(typeof elem==="number")
elem+='';if(!elem)
return;if(typeof elem==="string"){elem=elem.replace(/(<(\w+)[^>]*?)\/>/g,function(all,front,tag){return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?all:front+"></"+tag+">";});var tags=jQuery.trim(elem).toLowerCase();var wrap=!tags.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!tags.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||tags.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!tags.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!tags.indexOf("<td")||!tags.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!tags.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!jQuery.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];div.innerHTML=wrap[1]+elem+wrap[2];while(wrap[0]--)
div=div.lastChild;if(!jQuery.support.tbody){var tbody=!tags.indexOf("<table")&&tags.indexOf("<tbody")<0?div.firstChild&&div.firstChild.childNodes:wrap[1]=="<table>"&&tags.indexOf("<tbody")<0?div.childNodes:[];for(var j=tbody.length-1;j>=0;--j)
if(jQuery.nodeName(tbody[j],"tbody")&&!tbody[j].childNodes.length)
tbody[j].parentNode.removeChild(tbody[j]);}
if(!jQuery.support.leadingWhitespace&&/^\s/.test(elem))
div.insertBefore(context.createTextNode(elem.match(/^\s*/)[0]),div.firstChild);elem=jQuery.makeArray(div.childNodes);}
if(elem.nodeType)
ret.push(elem);else
ret=jQuery.merge(ret,elem);});if(fragment){for(var i=0;ret[i];i++){if(jQuery.nodeName(ret[i],"script")&&(!ret[i].type||ret[i].type.toLowerCase()==="text/javascript")){scripts.push(ret[i].parentNode?ret[i].parentNode.removeChild(ret[i]):ret[i]);}else{if(ret[i].nodeType===1)
ret.splice.apply(ret,[i+1,0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script"))));fragment.appendChild(ret[i]);}}
return scripts;}
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;name=notxml&&jQuery.props[name]||name;if(elem.tagName){var special=/href|src|style/.test(name);if(name=="selected"&&elem.parentNode)
elem.parentNode.selectedIndex;if(name in elem&&notxml&&!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;if(name=="tabIndex"){var attributeNode=elem.getAttributeNode("tabIndex");return attributeNode&&attributeNode.specified?attributeNode.value:elem.nodeName.match(/(button|input|object|select|textarea)/i)?0:elem.nodeName.match(/^(a|area)$/i)&&elem.href?0:undefined;}
return elem[name];}
if(!jQuery.support.style&&notxml&&name=="style")
return jQuery.attr(elem.style,"cssText",value);if(set)
elem.setAttribute(name,""+value);var attr=!jQuery.support.hrefNormalized&&notxml&&special?elem.getAttribute(name,2):elem.getAttribute(name);return attr===null?undefined:attr;}
if(!jQuery.support.opacity&&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||typeof array==="string"||jQuery.isFunction(array)||array.setInterval)
ret[0]=array;else
while(i)
ret[--i]=array[i];}
return ret;},inArray:function(elem,array){for(var i=0,length=array.length;i<length;i++)
if(array[i]===elem)
return i;return-1;},merge:function(first,second){var i=0,elem,pos=first.length;if(!jQuery.support.getAll){while((elem=second[i++])!=null)
if(elem.nodeType!=8)
first[pos++]=elem;}else
while((elem=second[i++])!=null)
first[pos++]=elem;return first;},unique:function(array){var ret=[],done={};try{for(var i=0,length=array.length;i<length;i++){var id=jQuery.data(array[i]);if(!done[id]){done[id]=true;ret.push(array[i]);}}}catch(e){ret=array;}
return ret;},grep:function(elems,callback,inv){var ret=[];for(var i=0,length=elems.length;i<length;i++)
if(!inv!=!callback(elems[i],i))
ret.push(elems[i]);return ret;},map:function(elems,callback){var ret=[];for(var i=0,length=elems.length;i<length;i++){var value=callback(elems[i],i);if(value!=null)
ret[ret.length]=value;}
return ret.concat.apply([],ret);}});var userAgent=navigator.userAgent.toLowerCase();jQuery.browser={version:(userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,'0'])[1],safari:/webkit/.test(userAgent),opera:/opera/.test(userAgent),msie:/msie/.test(userAgent)&&!/opera/.test(userAgent),mozilla:/mozilla/.test(userAgent)&&!/(compatible|webkit)/.test(userAgent)};jQuery.each({parent:function(elem){return elem.parentNode;},parents:function(elem){return jQuery.dir(elem,"parentNode");},next:function(elem){return jQuery.nth(elem,2,"nextSibling");},prev:function(elem){return jQuery.nth(elem,2,"previousSibling");},nextAll:function(elem){return jQuery.dir(elem,"nextSibling");},prevAll:function(elem){return jQuery.dir(elem,"previousSibling");},siblings:function(elem){return jQuery.sibling(elem.parentNode.firstChild,elem);},children:function(elem){return jQuery.sibling(elem.firstChild);},contents:function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.makeArray(elem.childNodes);}},function(name,fn){jQuery.fn[name]=function(selector){var ret=jQuery.map(this,fn);if(selector&&typeof selector=="string")
ret=jQuery.multiFilter(selector,ret);return this.pushStack(jQuery.unique(ret),name,selector);};});jQuery.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(name,original){jQuery.fn[name]=function(){var args=arguments;return this.each(function(){for(var i=0,length=args.length;i<length;i++)
jQuery(args[i])[original](this);});};});jQuery.each({removeAttr:function(name){jQuery.attr(this,name,"");if(this.nodeType==1)
this.removeAttribute(name);},addClass:function(classNames){jQuery.className.add(this,classNames);},removeClass:function(classNames){jQuery.className.remove(this,classNames);},toggleClass:function(classNames,state){if(typeof state!=="boolean")
state=!jQuery.className.has(this,classNames);jQuery.className[state?"add":"remove"](this,classNames);},remove:function(selector){if(!selector||jQuery.filter(selector,[this]).length){jQuery("*",this).add([this]).each(function(){jQuery.event.remove(this);jQuery.removeData(this);});if(this.parentNode)
this.parentNode.removeChild(this);}},empty:function(){jQuery(">*",this).remove();while(this.firstChild)
this.removeChild(this.firstChild);}},function(name,fn){jQuery.fn[name]=function(){return this.each(fn,arguments);};});function num(elem,prop){return elem[0]&&parseInt(jQuery.curCSS(elem[0],prop,true),10)||0;}
var expando="jQuery"+now(),uuid=0,windowData={};jQuery.extend({cache:{},data:function(elem,name,data){elem=elem==window?windowData:elem;var id=elem[expando];if(!id)
id=elem[expando]=++uuid;if(name&&!jQuery.cache[id])
jQuery.cache[id]={};if(data!==undefined)
jQuery.cache[id][name]=data;return name?jQuery.cache[id][name]:id;},removeData:function(elem,name){elem=elem==window?windowData:elem;var id=elem[expando];if(name){if(jQuery.cache[id]){delete jQuery.cache[id][name];name="";for(name in jQuery.cache[id])
break;if(!name)
jQuery.removeData(elem);}}else{try{delete elem[expando];}catch(e){if(elem.removeAttribute)
elem.removeAttribute(expando);}
delete jQuery.cache[id];}},queue:function(elem,type,data){if(elem){type=(type||"fx")+"queue";var q=jQuery.data(elem,type);if(!q||jQuery.isArray(data))
q=jQuery.data(elem,type,jQuery.makeArray(data));else if(data)
q.push(data);}
return q;},dequeue:function(elem,type){var queue=jQuery.queue(elem,type),fn=queue.shift();if(!type||type==="fx")
fn=queue[0];if(fn!==undefined)
fn.call(elem);}});jQuery.fn.extend({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);});},queue:function(type,data){if(typeof type!=="string"){data=type;type="fx";}
if(data===undefined)
return jQuery.queue(this[0],type);return this.each(function(){var queue=jQuery.queue(this,type,data);if(type=="fx"&&queue.length==1)
queue[0].call(this);});},dequeue:function(type){return this.each(function(){jQuery.dequeue(this,type);});}});(function(){var chunker=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]+['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[]+)+|[>+~])(\s*,\s*)?/g,done=0,toString=Object.prototype.toString;var Sizzle=function(selector,context,results,seed){results=results||[];context=context||document;if(context.nodeType!==1&&context.nodeType!==9)
return[];if(!selector||typeof selector!=="string"){return results;}
var parts=[],m,set,checkSet,check,mode,extra,prune=true;chunker.lastIndex=0;while((m=chunker.exec(selector))!==null){parts.push(m[1]);if(m[2]){extra=RegExp.rightContext;break;}}
if(parts.length>1&&origPOS.exec(selector)){if(parts.length===2&&Expr.relative[parts[0]]){set=posProcess(parts[0]+parts[1],context);}else{set=Expr.relative[parts[0]]?[context]:Sizzle(parts.shift(),context);while(parts.length){selector=parts.shift();if(Expr.relative[selector])
selector+=parts.shift();set=posProcess(selector,set);}}}else{var ret=seed?{expr:parts.pop(),set:makeArray(seed)}:Sizzle.find(parts.pop(),parts.length===1&&context.parentNode?context.parentNode:context,isXML(context));set=Sizzle.filter(ret.expr,ret.set);if(parts.length>0){checkSet=makeArray(set);}else{prune=false;}
while(parts.length){var cur=parts.pop(),pop=cur;if(!Expr.relative[cur]){cur="";}else{pop=parts.pop();}
if(pop==null){pop=context;}
Expr.relative[cur](checkSet,pop,isXML(context));}}
if(!checkSet){checkSet=set;}
if(!checkSet){throw"Syntax error, unrecognized expression: "+(cur||selector);}
if(toString.call(checkSet)==="[object Array]"){if(!prune){results.push.apply(results,checkSet);}else if(context.nodeType===1){for(var i=0;checkSet[i]!=null;i++){if(checkSet[i]&&(checkSet[i]===true||checkSet[i].nodeType===1&&contains(context,checkSet[i]))){results.push(set[i]);}}}else{for(var i=0;checkSet[i]!=null;i++){if(checkSet[i]&&checkSet[i].nodeType===1){results.push(set[i]);}}}}else{makeArray(checkSet,results);}
if(extra){Sizzle(extra,context,results,seed);}
return results;};Sizzle.matches=function(expr,set){return Sizzle(expr,null,null,set);};Sizzle.find=function(expr,context,isXML){var set,match;if(!expr){return[];}
for(var i=0,l=Expr.order.length;i<l;i++){var type=Expr.order[i],match;if((match=Expr.match[type].exec(expr))){var left=RegExp.leftContext;if(left.substr(left.length-1)!=="\\"){match[1]=(match[1]||"").replace(/\\/g,"");set=Expr.find[type](match,context,isXML);if(set!=null){expr=expr.replace(Expr.match[type],"");break;}}}}
if(!set){set=context.getElementsByTagName("*");}
return{set:set,expr:expr};};Sizzle.filter=function(expr,set,inplace,not){var old=expr,result=[],curLoop=set,match,anyFound;while(expr&&set.length){for(var type in Expr.filter){if((match=Expr.match[type].exec(expr))!=null){var filter=Expr.filter[type],found,item;anyFound=false;if(curLoop==result){result=[];}
if(Expr.preFilter[type]){match=Expr.preFilter[type](match,curLoop,inplace,result,not);if(!match){anyFound=found=true;}else if(match===true){continue;}}
if(match){for(var i=0;(item=curLoop[i])!=null;i++){if(item){found=filter(item,match,i,curLoop);var pass=not^!!found;if(inplace&&found!=null){if(pass){anyFound=true;}else{curLoop[i]=false;}}else if(pass){result.push(item);anyFound=true;}}}}
if(found!==undefined){if(!inplace){curLoop=result;}
expr=expr.replace(Expr.match[type],"");if(!anyFound){return[];}
break;}}}
expr=expr.replace(/\s*,\s*/,"");if(expr==old){if(anyFound==null){throw"Syntax error, unrecognized expression: "+expr;}else{break;}}
old=expr;}
return curLoop;};var Expr=Sizzle.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(elem){return elem.getAttribute("href");}},relative:{"+":function(checkSet,part){for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){var cur=elem.previousSibling;while(cur&&cur.nodeType!==1){cur=cur.previousSibling;}
checkSet[i]=typeof part==="string"?cur||false:cur===part;}}
if(typeof part==="string"){Sizzle.filter(part,checkSet,true);}},">":function(checkSet,part,isXML){if(typeof part==="string"&&!/\W/.test(part)){part=isXML?part:part.toUpperCase();for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){var parent=elem.parentNode;checkSet[i]=parent.nodeName===part?parent:false;}}}else{for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){checkSet[i]=typeof part==="string"?elem.parentNode:elem.parentNode===part;}}
if(typeof part==="string"){Sizzle.filter(part,checkSet,true);}}},"":function(checkSet,part,isXML){var doneName="done"+(done++),checkFn=dirCheck;if(!part.match(/\W/)){var nodeCheck=part=isXML?part:part.toUpperCase();checkFn=dirNodeCheck;}
checkFn("parentNode",part,doneName,checkSet,nodeCheck,isXML);},"~":function(checkSet,part,isXML){var doneName="done"+(done++),checkFn=dirCheck;if(typeof part==="string"&&!part.match(/\W/)){var nodeCheck=part=isXML?part:part.toUpperCase();checkFn=dirNodeCheck;}
checkFn("previousSibling",part,doneName,checkSet,nodeCheck,isXML);}},find:{ID:function(match,context,isXML){if(typeof context.getElementById!=="undefined"&&!isXML){var m=context.getElementById(match[1]);return m?[m]:[];}},NAME:function(match,context,isXML){if(typeof context.getElementsByName!=="undefined"&&!isXML){return context.getElementsByName(match[1]);}},TAG:function(match,context){return context.getElementsByTagName(match[1]);}},preFilter:{CLASS:function(match,curLoop,inplace,result,not){match=" "+match[1].replace(/\\/g,"")+" ";var elem;for(var i=0;(elem=curLoop[i])!=null;i++){if(elem){if(not^(" "+elem.className+" ").indexOf(match)>=0){if(!inplace)
result.push(elem);}else if(inplace){curLoop[i]=false;}}}
return false;},ID:function(match){return match[1].replace(/\\/g,"");},TAG:function(match,curLoop){for(var i=0;curLoop[i]===false;i++){}
return curLoop[i]&&isXML(curLoop[i])?match[1]:match[1].toUpperCase();},CHILD:function(match){if(match[1]=="nth"){var test=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(match[2]=="even"&&"2n"||match[2]=="odd"&&"2n+1"||!/\D/.test(match[2])&&"0n+"+match[2]||match[2]);match[2]=(test[1]+(test[2]||1))-0;match[3]=test[3]-0;}
match[0]="done"+(done++);return match;},ATTR:function(match){var name=match[1].replace(/\\/g,"");if(Expr.attrMap[name]){match[1]=Expr.attrMap[name];}
if(match[2]==="~="){match[4]=" "+match[4]+" ";}
return match;},PSEUDO:function(match,curLoop,inplace,result,not){if(match[1]==="not"){if(match[3].match(chunker).length>1){match[3]=Sizzle(match[3],null,null,curLoop);}else{var ret=Sizzle.filter(match[3],curLoop,inplace,true^not);if(!inplace){result.push.apply(result,ret);}
return false;}}else if(Expr.match.POS.test(match[0])){return true;}
return match;},POS:function(match){match.unshift(true);return match;}},filters:{enabled:function(elem){return elem.disabled===false&&elem.type!=="hidden";},disabled:function(elem){return elem.disabled===true;},checked:function(elem){return elem.checked===true;},selected:function(elem){elem.parentNode.selectedIndex;return elem.selected===true;},parent:function(elem){return!!elem.firstChild;},empty:function(elem){return!elem.firstChild;},has:function(elem,i,match){return!!Sizzle(match[3],elem).length;},header:function(elem){return/h\d/i.test(elem.nodeName);},text:function(elem){return"text"===elem.type;},radio:function(elem){return"radio"===elem.type;},checkbox:function(elem){return"checkbox"===elem.type;},file:function(elem){return"file"===elem.type;},password:function(elem){return"password"===elem.type;},submit:function(elem){return"submit"===elem.type;},image:function(elem){return"image"===elem.type;},reset:function(elem){return"reset"===elem.type;},button:function(elem){return"button"===elem.type||elem.nodeName.toUpperCase()==="BUTTON";},input:function(elem){return/input|select|textarea|button/i.test(elem.nodeName);}},setFilters:{first:function(elem,i){return i===0;},last:function(elem,i,match,array){return i===array.length-1;},even:function(elem,i){return i%2===0;},odd:function(elem,i){return i%2===1;},lt:function(elem,i,match){return i<match[3]-0;},gt:function(elem,i,match){return i>match[3]-0;},nth:function(elem,i,match){return match[3]-0==i;},eq:function(elem,i,match){return match[3]-0==i;}},filter:{CHILD:function(elem,match){var type=match[1],parent=elem.parentNode;var doneName=match[0];if(parent&&(!parent[doneName]||!elem.nodeIndex)){var count=1;for(var node=parent.firstChild;node;node=node.nextSibling){if(node.nodeType==1){node.nodeIndex=count++;}}
parent[doneName]=count-1;}
if(type=="first"){return elem.nodeIndex==1;}else if(type=="last"){return elem.nodeIndex==parent[doneName];}else if(type=="only"){return parent[doneName]==1;}else if(type=="nth"){var add=false,first=match[2],last=match[3];if(first==1&&last==0){return true;}
if(first==0){if(elem.nodeIndex==last){add=true;}}else if((elem.nodeIndex-last)%first==0&&(elem.nodeIndex-last)/first>=0){add=true;}
return add;}},PSEUDO:function(elem,match,i,array){var name=match[1],filter=Expr.filters[name];if(filter){return filter(elem,i,match,array);}else if(name==="contains"){return(elem.textContent||elem.innerText||"").indexOf(match[3])>=0;}else if(name==="not"){var not=match[3];for(var i=0,l=not.length;i<l;i++){if(not[i]===elem){return false;}}
return true;}},ID:function(elem,match){return elem.nodeType===1&&elem.getAttribute("id")===match;},TAG:function(elem,match){return(match==="*"&&elem.nodeType===1)||elem.nodeName===match;},CLASS:function(elem,match){return match.test(elem.className);},ATTR:function(elem,match){var result=Expr.attrHandle[match[1]]?Expr.attrHandle[match[1]](elem):elem[match[1]]||elem.getAttribute(match[1]),value=result+"",type=match[2],check=match[4];return result==null?type==="!=":type==="="?value===check:type==="*="?value.indexOf(check)>=0:type==="~="?(" "+value+" ").indexOf(check)>=0:!match[4]?result:type==="!="?value!=check:type==="^="?value.indexOf(check)===0:type==="$="?value.substr(value.length-check.length)===check:type==="|="?value===check||value.substr(0,check.length+1)===check+"-":false;},POS:function(elem,match,i,array){var name=match[2],filter=Expr.setFilters[name];if(filter){return filter(elem,i,match,array);}}}};var origPOS=Expr.match.POS;for(var type in Expr.match){Expr.match[type]=RegExp(Expr.match[type].source+/(?![^\[]*\])(?![^\(]*\))/.source);}
var makeArray=function(array,results){array=Array.prototype.slice.call(array);if(results){results.push.apply(results,array);return results;}
return array;};try{Array.prototype.slice.call(document.documentElement.childNodes);}catch(e){makeArray=function(array,results){var ret=results||[];if(toString.call(array)==="[object Array]"){Array.prototype.push.apply(ret,array);}else{if(typeof array.length==="number"){for(var i=0,l=array.length;i<l;i++){ret.push(array[i]);}}else{for(var i=0;array[i];i++){ret.push(array[i]);}}}
return ret;};}
(function(){var form=document.createElement("form"),id="script"+(new Date).getTime();form.innerHTML="<input name='"+id+"'/>";var root=document.documentElement;root.insertBefore(form,root.firstChild);if(!!document.getElementById(id)){Expr.find.ID=function(match,context,isXML){if(typeof context.getElementById!=="undefined"&&!isXML){var m=context.getElementById(match[1]);return m?m.id===match[1]||typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id").nodeValue===match[1]?[m]:undefined:[];}};Expr.filter.ID=function(elem,match){var node=typeof elem.getAttributeNode!=="undefined"&&elem.getAttributeNode("id");return elem.nodeType===1&&node&&node.nodeValue===match;};}
root.removeChild(form);})();(function(){var div=document.createElement("div");div.appendChild(document.createComment(""));if(div.getElementsByTagName("*").length>0){Expr.find.TAG=function(match,context){var results=context.getElementsByTagName(match[1]);if(match[1]==="*"){var tmp=[];for(var i=0;results[i];i++){if(results[i].nodeType===1){tmp.push(results[i]);}}
results=tmp;}
return results;};}
div.innerHTML="<a href='#'></a>";if(div.firstChild&&div.firstChild.getAttribute("href")!=="#"){Expr.attrHandle.href=function(elem){return elem.getAttribute("href",2);};}})();if(document.querySelectorAll)(function(){var oldSizzle=Sizzle,div=document.createElement("div");div.innerHTML="<p class='TEST'></p>";if(div.querySelectorAll&&div.querySelectorAll(".TEST").length===0){return;}
Sizzle=function(query,context,extra,seed){context=context||document;if(!seed&&context.nodeType===9&&!isXML(context)){try{return makeArray(context.querySelectorAll(query),extra);}catch(e){}}
return oldSizzle(query,context,extra,seed);};Sizzle.find=oldSizzle.find;Sizzle.filter=oldSizzle.filter;Sizzle.selectors=oldSizzle.selectors;Sizzle.matches=oldSizzle.matches;})();if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){Expr.order.splice(1,0,"CLASS");Expr.find.CLASS=function(match,context){return context.getElementsByClassName(match[1]);};}
function dirNodeCheck(dir,cur,doneName,checkSet,nodeCheck,isXML){for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){elem=elem[dir];var match=false;while(elem&&elem.nodeType){var done=elem[doneName];if(done){match=checkSet[done];break;}
if(elem.nodeType===1&&!isXML)
elem[doneName]=i;if(elem.nodeName===cur){match=elem;break;}
elem=elem[dir];}
checkSet[i]=match;}}}
function dirCheck(dir,cur,doneName,checkSet,nodeCheck,isXML){for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){elem=elem[dir];var match=false;while(elem&&elem.nodeType){if(elem[doneName]){match=checkSet[elem[doneName]];break;}
if(elem.nodeType===1){if(!isXML)
elem[doneName]=i;if(typeof cur!=="string"){if(elem===cur){match=true;break;}}else if(Sizzle.filter(cur,[elem]).length>0){match=elem;break;}}
elem=elem[dir];}
checkSet[i]=match;}}}
var contains=document.compareDocumentPosition?function(a,b){return a.compareDocumentPosition(b)&16;}:function(a,b){return a!==b&&(a.contains?a.contains(b):true);};var isXML=function(elem){return elem.nodeType===9&&elem.documentElement.nodeName!=="HTML"||!!elem.ownerDocument&&isXML(elem.ownerDocument);};var posProcess=function(selector,context){var tmpSet=[],later="",match,root=context.nodeType?[context]:context;while((match=Expr.match.PSEUDO.exec(selector))){later+=match[0];selector=selector.replace(Expr.match.PSEUDO,"");}
selector=Expr.relative[selector]?selector+"*":selector;for(var i=0,l=root.length;i<l;i++){Sizzle(selector,root[i],tmpSet);}
return Sizzle.filter(later,tmpSet);};jQuery.find=Sizzle;jQuery.filter=Sizzle.filter;jQuery.expr=Sizzle.selectors;jQuery.expr[":"]=jQuery.expr.filters;Sizzle.selectors.filters.hidden=function(elem){return"hidden"===elem.type||jQuery.css(elem,"display")==="none"||jQuery.css(elem,"visibility")==="hidden";};Sizzle.selectors.filters.visible=function(elem){return"hidden"!==elem.type&&jQuery.css(elem,"display")!=="none"&&jQuery.css(elem,"visibility")!=="hidden";};Sizzle.selectors.filters.animated=function(elem){return jQuery.grep(jQuery.timers,function(fn){return elem===fn.elem;}).length;};jQuery.multiFilter=function(expr,elems,not){if(not){expr=":not("+expr+")";}
return Sizzle.matches(expr,elems);};jQuery.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;};jQuery.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;};jQuery.sibling=function(n,elem){var r=[];for(;n;n=n.nextSibling){if(n.nodeType==1&&n!=elem)
r.push(n);}
return r;};return;window.Sizzle=Sizzle;})();jQuery.event={add:function(elem,types,handler,data){if(elem.nodeType==3||elem.nodeType==8)
return;if(elem.setInterval&&elem!=window)
elem=window;if(!handler.guid)
handler.guid=this.guid++;if(data!==undefined){var fn=handler;handler=this.proxy(fn);handler.data=data;}
var events=jQuery.data(elem,"events")||jQuery.data(elem,"events",{}),handle=jQuery.data(elem,"handle")||jQuery.data(elem,"handle",function(){return typeof jQuery!=="undefined"&&!jQuery.event.triggered?jQuery.event.handle.apply(arguments.callee.elem,arguments):undefined;});handle.elem=elem;jQuery.each(types.split(/\s+/),function(index,type){var namespaces=type.split(".");type=namespaces.shift();handler.type=namespaces.slice().sort().join(".");var handlers=events[type];if(jQuery.event.specialAll[type])
jQuery.event.specialAll[type].setup.call(elem,data,namespaces);if(!handlers){handlers=events[type]={};if(!jQuery.event.special[type]||jQuery.event.special[type].setup.call(elem,data,namespaces)===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 namespaces=type.split(".");type=namespaces.shift();var namespace=RegExp("(^|\\.)"+namespaces.slice().sort().join(".*\\.")+"(\\.|$)");if(events[type]){if(handler)
delete events[type][handler.guid];else
for(var handle in events[type])
if(namespace.test(events[type][handle].type))
delete events[type][handle];if(jQuery.event.specialAll[type])
jQuery.event.specialAll[type].teardown.call(elem,namespaces);for(ret in events[type])break;if(!ret){if(!jQuery.event.special[type]||jQuery.event.special[type].teardown.call(elem,namespaces)===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(event,data,elem,bubbling){var type=event.type||event;if(!bubbling){event=typeof event==="object"?event[expando]?event:jQuery.extend(jQuery.Event(type),event):jQuery.Event(type);if(type.indexOf("!")>=0){event.type=type=type.slice(0,-1);event.exclusive=true;}
if(!elem){event.stopPropagation();if(this.global[type])
jQuery.each(jQuery.cache,function(){if(this.events&&this.events[type])
jQuery.event.trigger(event,data,this.handle.elem);});}
if(!elem||elem.nodeType==3||elem.nodeType==8)
return undefined;event.result=undefined;event.target=elem;data=jQuery.makeArray(data);data.unshift(event);}
event.currentTarget=elem;var handle=jQuery.data(elem,"handle");if(handle)
handle.apply(elem,data);if((!elem[type]||(jQuery.nodeName(elem,'a')&&type=="click"))&&elem["on"+type]&&elem["on"+type].apply(elem,data)===false)
event.result=false;if(!bubbling&&elem[type]&&!event.isDefaultPrevented()&&!(jQuery.nodeName(elem,'a')&&type=="click")){this.triggered=true;try{elem[type]();}catch(e){}}
this.triggered=false;if(!event.isPropagationStopped()){var parent=elem.parentNode||elem.ownerDocument;if(parent)
jQuery.event.trigger(event,data,parent,true);}},handle:function(event){var all,handlers;event=arguments[0]=jQuery.event.fix(event||window.event);var namespaces=event.type.split(".");event.type=namespaces.shift();all=!namespaces.length&&!event.exclusive;var namespace=RegExp("(^|\\.)"+namespaces.slice().sort().join(".*\\.")+"(\\.|$)");handlers=(jQuery.data(this,"events")||{})[event.type];for(var j in handlers){var handler=handlers[j];if(all||namespace.test(handler.type)){event.handler=handler;event.data=handler.data;var ret=handler.apply(this,arguments);if(ret!==undefined){event.result=ret;if(ret===false){event.preventDefault();event.stopPropagation();}}
if(event.isImmediatePropagationStopped())
break;}}},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 toElement view wheelDelta which".split(" "),fix:function(event){if(event[expando])
return event;var originalEvent=event;event=jQuery.Event(originalEvent);for(var i=this.props.length,prop;i;){prop=this.props[--i];event[prop]=originalEvent[prop];}
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=proxy||function(){return fn.apply(this,arguments);};proxy.guid=fn.guid=fn.guid||proxy.guid||this.guid++;return proxy;},special:{ready:{setup:bindReady,teardown:function(){}}},specialAll:{live:{setup:function(selector,namespaces){jQuery.event.add(this,namespaces[0],liveHandler);},teardown:function(namespaces){if(namespaces.length){var remove=0,name=RegExp("(^|\\.)"+namespaces[0]+"(\\.|$)");jQuery.each((jQuery.data(this,"events").live||{}),function(){if(name.test(this.type))
remove++;});if(remove<1)
jQuery.event.remove(this,namespaces[0],liveHandler);}}}}};jQuery.Event=function(src){if(!this.preventDefault)
return new jQuery.Event(src);if(src&&src.type){this.originalEvent=src;this.type=src.type;}else
this.type=src;this.timeStamp=now();this[expando]=true;};function returnFalse(){return false;}
function returnTrue(){return true;}
jQuery.Event.prototype={preventDefault:function(){this.isDefaultPrevented=returnTrue;var e=this.originalEvent;if(!e)
return;if(e.preventDefault)
e.preventDefault();e.returnValue=false;},stopPropagation:function(){this.isPropagationStopped=returnTrue;var e=this.originalEvent;if(!e)
return;if(e.stopPropagation)
e.stopPropagation();e.cancelBubble=true;},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=returnTrue;this.stopPropagation();},isDefaultPrevented:returnFalse,isPropagationStopped:returnFalse,isImmediatePropagationStopped:returnFalse};var withinElement=function(event){var parent=event.relatedTarget;while(parent&&parent!=this)
try{parent=parent.parentNode;}
catch(e){parent=this;}
if(parent!=this){event.type=event.data;jQuery.event.handle.apply(this,arguments);}};jQuery.each({mouseover:'mouseenter',mouseout:'mouseleave'},function(orig,fix){jQuery.event.special[fix]={setup:function(){jQuery.event.add(this,orig,withinElement,fix);},teardown:function(){jQuery.event.remove(this,orig,withinElement);}};});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){return this.each(function(){jQuery.event.trigger(type,data,this);});},triggerHandler:function(type,data){if(this[0]){var event=jQuery.Event(type);event.preventDefault();event.stopPropagation();jQuery.event.trigger(event,data,this[0]);return event.result;}},toggle:function(fn){var args=arguments,i=1;while(i<args.length)
jQuery.event.proxy(fn,args[i++]);return this.click(jQuery.event.proxy(fn,function(event){this.lastToggle=(this.lastToggle||0)%i;event.preventDefault();return args[this.lastToggle++].apply(this,arguments)||false;}));},hover:function(fnOver,fnOut){return this.mouseenter(fnOver).mouseleave(fnOut);},ready:function(fn){bindReady();if(jQuery.isReady)
fn.call(document,jQuery);else
jQuery.readyList.push(fn);return this;},live:function(type,fn){var proxy=jQuery.event.proxy(fn);proxy.guid+=this.selector+type;jQuery(document).bind(liveConvert(type,this.selector),this.selector,proxy);return this;},die:function(type,fn){jQuery(document).unbind(liveConvert(type,this.selector),fn?{guid:fn.guid+this.selector+type}:null);return this;}});function liveHandler(event){var check=RegExp("(^|\\.)"+event.type+"(\\.|$)"),stop=true,elems=[];jQuery.each(jQuery.data(this,"events").live||[],function(i,fn){if(check.test(fn.type)){var elem=jQuery(event.target).closest(fn.data)[0];if(elem)
elems.push({elem:elem,fn:fn});}});jQuery.each(elems,function(){if(this.fn.call(this.elem,event,this.fn.data)===false)
stop=false;});return stop;}
function liveConvert(type,selector){return["live",type,selector.replace(/\./g,"`").replace(/ /g,"|")].join(".");}
jQuery.extend({isReady:false,readyList:[],ready:function(){if(!jQuery.isReady){jQuery.isReady=true;if(jQuery.readyList){jQuery.each(jQuery.readyList,function(){this.call(document,jQuery);});jQuery.readyList=null;}
jQuery(document).triggerHandler("ready");}}});var readyBound=false;function bindReady(){if(readyBound)return;readyBound=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);jQuery.ready();},false);}else if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);jQuery.ready();}});if(document.documentElement.doScroll&&typeof window.frameElement==="undefined")(function(){if(jQuery.isReady)return;try{document.documentElement.doScroll("left");}catch(error){setTimeout(arguments.callee,0);return;}
jQuery.ready();})();}
jQuery.event.add(window,"load",jQuery.ready);}
jQuery.each(("blur,focus,load,resize,scroll,unload,click,dblclick,"+"mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,"+"change,select,submit,keydown,keypress,keyup,error").split(","),function(i,name){jQuery.fn[name]=function(fn){return fn?this.bind(name,fn):this.trigger(name);};});jQuery(window).bind('unload',function(){for(var id in jQuery.cache)
if(id!=1&&jQuery.cache[id].handle)
jQuery.event.remove(jQuery.cache[id].handle.elem);});(function(){jQuery.support={};var root=document.documentElement,script=document.createElement("script"),div=document.createElement("div"),id="script"+(new Date).getTime();div.style.display="none";div.innerHTML='   <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var all=div.getElementsByTagName("*"),a=div.getElementsByTagName("a")[0];if(!all||!all.length||!a){return;}
jQuery.support={leadingWhitespace:div.firstChild.nodeType==3,tbody:!div.getElementsByTagName("tbody").length,objectAll:!!div.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!div.getElementsByTagName("link").length,style:/red/.test(a.getAttribute("style")),hrefNormalized:a.getAttribute("href")==="/a",opacity:a.style.opacity==="0.5",cssFloat:!!a.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};script.type="text/javascript";try{script.appendChild(document.createTextNode("window."+id+"=1;"));}catch(e){}
root.insertBefore(script,root.firstChild);if(window[id]){jQuery.support.scriptEval=true;delete window[id];}
root.removeChild(script);if(div.attachEvent&&div.fireEvent){div.attachEvent("onclick",function(){jQuery.support.noCloneEvent=false;div.detachEvent("onclick",arguments.callee);});div.cloneNode(true).fireEvent("onclick");}
jQuery(function(){var div=document.createElement("div");div.style.width="1px";div.style.paddingLeft="1px";document.body.appendChild(div);jQuery.boxModel=jQuery.support.boxModel=div.offsetWidth===2;document.body.removeChild(div);});})();var styleFloat=jQuery.support.cssFloat?"cssFloat":"styleFloat";jQuery.props={"for":"htmlFor","class":"className","float":styleFloat,cssFloat:styleFloat,styleFloat:styleFloat,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};jQuery.fn.extend({_load:jQuery.fn.load,load:function(url,params,callback){if(typeof url!=="string")
return this._load(url);var off=url.indexOf(" ");if(off>=0){var selector=url.slice(off,url.length);url=url.slice(0,off);}
var type="GET";if(params)
if(jQuery.isFunction(params)){callback=params;params=null;}else if(typeof params==="object"){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("<div/>").append(res.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(selector):res.responseText);if(callback)
self.each(callback,[res.responseText,status,res]);}});return this;},serialize:function(){return jQuery.param(this.serializeArray());},serializeArray:function(){return this.map(function(){return this.elements?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:jQuery.isArray(val)?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",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();},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 parts=/^(\w+:)?\/\/([^\/?#]+)/.exec(s.url);if(s.dataType=="script"&&type=="GET"&&parts&&(parts[1]&&parts[1]!=location.protocol||parts[2]!=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=s.xhr();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){if(s.global&&!--jQuery.active)
jQuery.event.trigger("ajaxStop");xhr.abort();return false;}
if(s.global)
jQuery.event.trigger("ajaxSend",[xhr,s]);var onreadystatechange=function(isTimeout){if(xhr.readyState==0){if(ival){clearInterval(ival);ival=null;if(s.global&&!--jQuery.active)
jQuery.event.trigger("ajaxStop");}}else 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);}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(isTimeout)
xhr.abort();if(s.async)
xhr=null;}};if(s.async){var ival=setInterval(onreadystatechange,13);if(s.timeout>0)
setTimeout(function(){if(xhr&&!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;}catch(e){}
return false;},httpNotModified:function(xhr,url){try{var xhrRes=xhr.getResponseHeader("Last-Modified");return xhr.status==304||xhrRes==jQuery.lastModified[url];}catch(e){}
return false;},httpData:function(xhr,type,s){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(s&&s.dataFilter)
data=s.dataFilter(data,type);if(typeof data==="string"){if(type=="script")
jQuery.globalEval(data);if(type=="json")
data=window["eval"]("("+data+")");}
return data;},param:function(a){var s=[];function add(key,value){s[s.length]=encodeURIComponent(key)+'='+encodeURIComponent(value);};if(jQuery.isArray(a)||a.jquery)
jQuery.each(a,function(){add(this.name,this.value);});else
for(var j in a)
if(jQuery.isArray(a[j]))
jQuery.each(a[j],function(){add(j,this);});else
add(j,jQuery.isFunction(a[j])?a[j]():a[j]);return s.join("&").replace(/%20/g,"+");}});var elemdisplay={},timerId,fxAttrs=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function genFx(type,num){var obj={};jQuery.each(fxAttrs.concat.apply([],fxAttrs.slice(0,num)),function(){obj[this]=type;});return obj;}
jQuery.fn.extend({show:function(speed,callback){if(speed){return this.animate(genFx("show",3),speed,callback);}else{for(var i=0,l=this.length;i<l;i++){var old=jQuery.data(this[i],"olddisplay");this[i].style.display=old||"";if(jQuery.css(this[i],"display")==="none"){var tagName=this[i].tagName,display;if(elemdisplay[tagName]){display=elemdisplay[tagName];}else{var elem=jQuery("<"+tagName+" />").appendTo("body");display=elem.css("display");if(display==="none")
display="block";elem.remove();elemdisplay[tagName]=display;}
this[i].style.display=jQuery.data(this[i],"olddisplay",display);}}
return this;}},hide:function(speed,callback){if(speed){return this.animate(genFx("hide",3),speed,callback);}else{for(var i=0,l=this.length;i<l;i++){var old=jQuery.data(this[i],"olddisplay");if(!old&&old!=="none")
jQuery.data(this[i],"olddisplay",jQuery.css(this[i],"display"));this[i].style.display="none";}
return this;}},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){var bool=typeof fn==="boolean";return jQuery.isFunction(fn)&&jQuery.isFunction(fn2)?this._toggle.apply(this,arguments):fn==null||bool?this.each(function(){var state=bool?fn:jQuery(this).is(":hidden");jQuery(this)[state?"show":"hide"]();}):this.animate(genFx("toggle",3),fn,fn2);},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(){var opt=jQuery.extend({},optall),p,hidden=this.nodeType==1&&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")&&this.style){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;});},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;}});jQuery.each({slideDown:genFx("show",1),slideUp:genFx("hide",1),slideToggle:genFx("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(name,props){jQuery.fn[name]=function(speed,callback){return this.animate(props,speed,callback);};});jQuery.extend({speed:function(speed,easing,fn){var opt=typeof speed==="object"?speed:{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&!jQuery.isFunction(easing)&&easing};opt.duration=jQuery.fx.off?0:typeof opt.duration==="number"?opt.duration:jQuery.fx.speeds[opt.duration]||jQuery.fx.speeds._default;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:[],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)
this.elem.style.display="block";},cur:function(force){if(this.elem[this.prop]!=null&&(!this.elem.style||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;var self=this;function t(gotoEnd){return self.step(gotoEnd);}
t.elem=this.elem;if(t()&&jQuery.timers.push(t)==1){timerId=setInterval(function(){var timers=jQuery.timers;for(var i=0;i<timers.length;i++)
if(!timers[i]())
timers.splice(i--,1);if(!timers.length){clearInterval(timerId);}},13);}},show:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());jQuery(this.elem).show();},hide:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0);},step:function(gotoEnd){var t=now();if(gotoEnd||t>=this.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)
jQuery(this.elem).hide();if(this.options.hide||this.options.show)
for(var p in this.options.curAnim)
jQuery.attr(this.elem.style,p,this.options.orig[p]);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,_default:400},step:{opacity:function(fx){jQuery.attr(fx.elem.style,"opacity",fx.now);},_default:function(fx){if(fx.elem.style&&fx.elem.style[fx.prop]!=null)
fx.elem.style[fx.prop]=fx.now+fx.unit;else
fx.elem[fx.prop]=fx.now;}}});if(document.documentElement["getBoundingClientRect"])
jQuery.fn.offset=function(){if(!this[0])return{top:0,left:0};if(this[0]===this[0].ownerDocument.body)return jQuery.offset.bodyOffset(this[0]);var box=this[0].getBoundingClientRect(),doc=this[0].ownerDocument,body=doc.body,docElem=doc.documentElement,clientTop=docElem.clientTop||body.clientTop||0,clientLeft=docElem.clientLeft||body.clientLeft||0,top=box.top+(self.pageYOffset||jQuery.boxModel&&docElem.scrollTop||body.scrollTop)-clientTop,left=box.left+(self.pageXOffset||jQuery.boxModel&&docElem.scrollLeft||body.scrollLeft)-clientLeft;return{top:top,left:left};};else
jQuery.fn.offset=function(){if(!this[0])return{top:0,left:0};if(this[0]===this[0].ownerDocument.body)return jQuery.offset.bodyOffset(this[0]);jQuery.offset.initialized||jQuery.offset.initialize();var elem=this[0],offsetParent=elem.offsetParent,prevOffsetParent=elem,doc=elem.ownerDocument,computedStyle,docElem=doc.documentElement,body=doc.body,defaultView=doc.defaultView,prevComputedStyle=defaultView.getComputedStyle(elem,null),top=elem.offsetTop,left=elem.offsetLeft;while((elem=elem.parentNode)&&elem!==body&&elem!==docElem){computedStyle=defaultView.getComputedStyle(elem,null);top-=elem.scrollTop,left-=elem.scrollLeft;if(elem===offsetParent){top+=elem.offsetTop,left+=elem.offsetLeft;if(jQuery.offset.doesNotAddBorder&&!(jQuery.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(elem.tagName)))
top+=parseInt(computedStyle.borderTopWidth,10)||0,left+=parseInt(computedStyle.borderLeftWidth,10)||0;prevOffsetParent=offsetParent,offsetParent=elem.offsetParent;}
if(jQuery.offset.subtractsBorderForOverflowNotVisible&&computedStyle.overflow!=="visible")
top+=parseInt(computedStyle.borderTopWidth,10)||0,left+=parseInt(computedStyle.borderLeftWidth,10)||0;prevComputedStyle=computedStyle;}
if(prevComputedStyle.position==="relative"||prevComputedStyle.position==="static")
top+=body.offsetTop,left+=body.offsetLeft;if(prevComputedStyle.position==="fixed")
top+=Math.max(docElem.scrollTop,body.scrollTop),left+=Math.max(docElem.scrollLeft,body.scrollLeft);return{top:top,left:left};};jQuery.offset={initialize:function(){if(this.initialized)return;var body=document.body,container=document.createElement('div'),innerDiv,checkDiv,table,td,rules,prop,bodyMarginTop=body.style.marginTop,html='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';rules={position:'absolute',top:0,left:0,margin:0,border:0,width:'1px',height:'1px',visibility:'hidden'};for(prop in rules)container.style[prop]=rules[prop];container.innerHTML=html;body.insertBefore(container,body.firstChild);innerDiv=container.firstChild,checkDiv=innerDiv.firstChild,td=innerDiv.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(checkDiv.offsetTop!==5);this.doesAddBorderForTableAndCells=(td.offsetTop===5);innerDiv.style.overflow='hidden',innerDiv.style.position='relative';this.subtractsBorderForOverflowNotVisible=(checkDiv.offsetTop===-5);body.style.marginTop='1px';this.doesNotIncludeMarginInBodyOffset=(body.offsetTop===0);body.style.marginTop=bodyMarginTop;body.removeChild(container);this.initialized=true;},bodyOffset:function(body){jQuery.offset.initialized||jQuery.offset.initialize();var top=body.offsetTop,left=body.offsetLeft;if(jQuery.offset.doesNotIncludeMarginInBodyOffset)
top+=parseInt(jQuery.curCSS(body,'marginTop',true),10)||0,left+=parseInt(jQuery.curCSS(body,'marginLeft',true),10)||0;return{top:top,left:left};}};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||document.body;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 null;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);};var type=name.toLowerCase();jQuery.fn[type]=function(size){return this[0]==window?document.compatMode=="CSS1Compat"&&document.documentElement["client"+name]||document.body["client"+name]:this[0]==document?Math.max(document.documentElement["client"+name],document.body["scroll"+name],document.documentElement["scroll"+name],document.body["offset"+name],document.documentElement["offset"+name]):size===undefined?(this.length?jQuery.css(this[0],type):null):this.css(type,typeof size==="string"?size:size+"px");};});})();if(!document.createElement("canvas").getContext){(function(){var R=Math;var S=R.round;var O=R.sin;var a=R.cos;var J=R.abs;var Y=R.sqrt;var A=10;var K=A/2;function G(){return this.context_||(this.context_=new M(this))}var Q=Array.prototype.slice;function b(c,d,e){var Z=Q.call(arguments,2);return function(){return c.apply(d,Z.concat(Q.call(arguments)))}}var H={init:function(Z){if(/MSIE/.test(navigator.userAgent)&&!window.opera){var c=Z||document;c.createElement("canvas");c.attachEvent("onreadystatechange",b(this.init_,this,c))}},init_:function(e){if(!e.namespaces.g_vml_){e.namespaces.add("g_vml_","urn:schemas-microsoft-com:vml","#default#VML")}if(!e.namespaces.g_o_){e.namespaces.add("g_o_","urn:schemas-microsoft-com:office:office","#default#VML")}if(!e.styleSheets.ex_canvas_){var d=e.createStyleSheet();d.owningElement.id="ex_canvas_";d.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}g_vml_\\:*{behavior:url(#default#VML)}g_o_\\:*{behavior:url(#default#VML)}"}var c=e.getElementsByTagName("canvas");for(var Z=0;Z<c.length;Z++){this.initElement(c[Z])}},initElement:function(c){if(!c.getContext){c.getContext=G;c.innerHTML="";c.attachEvent("onpropertychange",X);c.attachEvent("onresize",B);var Z=c.attributes;if(Z.width&&Z.width.specified){c.style.width=Z.width.nodeValue+"px"}else{c.width=c.clientWidth}if(Z.height&&Z.height.specified){c.style.height=Z.height.nodeValue+"px"}else{c.height=c.clientHeight}}return c}};function X(c){var Z=c.srcElement;switch(c.propertyName){case"width":Z.style.width=Z.attributes.width.nodeValue+"px";Z.getContext().clearRect();break;case"height":Z.style.height=Z.attributes.height.nodeValue+"px";Z.getContext().clearRect();break}}function B(c){var Z=c.srcElement;if(Z.firstChild){Z.firstChild.style.width=Z.clientWidth+"px";Z.firstChild.style.height=Z.clientHeight+"px"}}H.init();var E=[];for(var V=0;V<16;V++){for(var U=0;U<16;U++){E[V*16+U]=V.toString(16)+U.toString(16)}}function N(){return[[1,0,0],[0,1,0],[0,0,1]]}function D(e,d){var c=N();for(var Z=0;Z<3;Z++){for(var h=0;h<3;h++){var f=0;for(var g=0;g<3;g++){f+=e[Z][g]*d[g][h]}c[Z][h]=f}}return c}function T(c,Z){Z.fillStyle=c.fillStyle;Z.lineCap=c.lineCap;Z.lineJoin=c.lineJoin;Z.lineWidth=c.lineWidth;Z.miterLimit=c.miterLimit;Z.shadowBlur=c.shadowBlur;Z.shadowColor=c.shadowColor;Z.shadowOffsetX=c.shadowOffsetX;Z.shadowOffsetY=c.shadowOffsetY;Z.strokeStyle=c.strokeStyle;Z.globalAlpha=c.globalAlpha;Z.arcScaleX_=c.arcScaleX_;Z.arcScaleY_=c.arcScaleY_;Z.lineScale_=c.lineScale_}function C(c){var f,e=1;c=String(c);if(c.substring(0,3)=="rgb"){var h=c.indexOf("(",3);var Z=c.indexOf(")",h+1);var g=c.substring(h+1,Z).split(",");f="#";for(var d=0;d<3;d++){f+=E[Number(g[d])]}if(g.length==4&&c.substr(3,1)=="a"){e=g[3]}}else{f=c}return{color:f,alpha:e}}function P(Z){switch(Z){case"butt":return"flat";case"round":return"round";case"square":default:return"square"}}function M(c){this.m_=N();this.mStack_=[];this.aStack_=[];this.currentPath_=[];this.strokeStyle="#000";this.fillStyle="#000";this.lineWidth=1;this.lineJoin="miter";this.lineCap="butt";this.miterLimit=A*1;this.globalAlpha=1;this.canvas=c;var Z=c.ownerDocument.createElement("div");Z.style.width=c.clientWidth+"px";Z.style.height=c.clientHeight+"px";Z.style.overflow="hidden";Z.style.position="absolute";c.appendChild(Z);this.element_=Z;this.arcScaleX_=1;this.arcScaleY_=1;this.lineScale_=1}var I=M.prototype;I.clearRect=function(){this.element_.innerHTML=""};I.beginPath=function(){this.currentPath_=[]};I.moveTo=function(c,Z){var d=this.getCoords_(c,Z);this.currentPath_.push({type:"moveTo",x:d.x,y:d.y});this.currentX_=d.x;this.currentY_=d.y};I.lineTo=function(c,Z){var d=this.getCoords_(c,Z);this.currentPath_.push({type:"lineTo",x:d.x,y:d.y});this.currentX_=d.x;this.currentY_=d.y};I.bezierCurveTo=function(d,c,j,i,h,f){var Z=this.getCoords_(h,f);var g=this.getCoords_(d,c);var e=this.getCoords_(j,i);L(this,g,e,Z)};function L(Z,e,d,c){Z.currentPath_.push({type:"bezierCurveTo",cp1x:e.x,cp1y:e.y,cp2x:d.x,cp2y:d.y,x:c.x,y:c.y});Z.currentX_=c.x;Z.currentY_=c.y}I.quadraticCurveTo=function(h,d,c,Z){var g=this.getCoords_(h,d);var f=this.getCoords_(c,Z);var i={x:this.currentX_+2/3*(g.x-this.currentX_),y:this.currentY_+2/3*(g.y-this.currentY_)};var e={x:i.x+(f.x-this.currentX_)/3,y:i.y+(f.y-this.currentY_)/3};L(this,i,e,f)};I.arc=function(k,i,j,f,c,d){j*=A;var o=d?"at":"wa";var l=k+a(f)*j-K;var n=i+O(f)*j-K;var Z=k+a(c)*j-K;var m=i+O(c)*j-K;if(l==Z&&!d){l+=0.125}var e=this.getCoords_(k,i);var h=this.getCoords_(l,n);var g=this.getCoords_(Z,m);this.currentPath_.push({type:o,x:e.x,y:e.y,radius:j,xStart:h.x,yStart:h.y,xEnd:g.x,yEnd:g.y})};I.rect=function(d,c,Z,e){this.moveTo(d,c);this.lineTo(d+Z,c);this.lineTo(d+Z,c+e);this.lineTo(d,c+e);this.closePath()};I.strokeRect=function(d,c,Z,e){var f=this.currentPath_;this.beginPath();this.moveTo(d,c);this.lineTo(d+Z,c);this.lineTo(d+Z,c+e);this.lineTo(d,c+e);this.closePath();this.stroke();this.currentPath_=f};I.fillRect=function(d,c,Z,e){var f=this.currentPath_;this.beginPath();this.moveTo(d,c);this.lineTo(d+Z,c);this.lineTo(d+Z,c+e);this.lineTo(d,c+e);this.closePath();this.fill();this.currentPath_=f};I.createLinearGradient=function(c,e,Z,d){var f=new W("gradient");f.x0_=c;f.y0_=e;f.x1_=Z;f.y1_=d;return f};I.createRadialGradient=function(e,g,d,c,f,Z){var h=new W("gradientradial");h.x0_=e;h.y0_=g;h.r0_=d;h.x1_=c;h.y1_=f;h.r1_=Z;return h};I.drawImage=function(s,e){var l,j,n,AA,q,o,u,AC;var m=s.runtimeStyle.width;var r=s.runtimeStyle.height;s.runtimeStyle.width="auto";s.runtimeStyle.height="auto";var k=s.width;var y=s.height;s.runtimeStyle.width=m;s.runtimeStyle.height=r;if(arguments.length==3){l=arguments[1];j=arguments[2];q=o=0;u=n=k;AC=AA=y}else{if(arguments.length==5){l=arguments[1];j=arguments[2];n=arguments[3];AA=arguments[4];q=o=0;u=k;AC=y}else{if(arguments.length==9){q=arguments[1];o=arguments[2];u=arguments[3];AC=arguments[4];l=arguments[5];j=arguments[6];n=arguments[7];AA=arguments[8]}else{throw Error("Invalid number of arguments")}}}var AB=this.getCoords_(l,j);var f=u/2;var c=AC/2;var z=[];var Z=10;var i=10;z.push(" <g_vml_:group",' coordsize="',A*Z,",",A*i,'"',' coordorigin="0,0"',' style="width:',Z,"px;height:",i,"px;position:absolute;");if(this.m_[0][0]!=1||this.m_[0][1]){var g=[];g.push("M11=",this.m_[0][0],",","M12=",this.m_[1][0],",","M21=",this.m_[0][1],",","M22=",this.m_[1][1],",","Dx=",S(AB.x/A),",","Dy=",S(AB.y/A),"");var x=AB;var v=this.getCoords_(l+n,j);var t=this.getCoords_(l,j+AA);var p=this.getCoords_(l+n,j+AA);x.x=R.max(x.x,v.x,t.x,p.x);x.y=R.max(x.y,v.y,t.y,p.y);z.push("padding:0 ",S(x.x/A),"px ",S(x.y/A),"px 0;filter:progid:DXImageTransform.Microsoft.Matrix(",g.join(""),", sizingmethod='clip');")}else{z.push("top:",S(AB.y/A),"px;left:",S(AB.x/A),"px;")}z.push(' ">','<g_vml_:image src="',s.src,'"',' style="width:',A*n,"px;"," height:",A*AA,'px;"',' cropleft="',q/k,'"',' croptop="',o/y,'"',' cropright="',(k-q-u)/k,'"',' cropbottom="',(y-o-AC)/y,'"'," />","</g_vml_:group>");this.element_.insertAdjacentHTML("BeforeEnd",z.join(""))};I.stroke=function(AE){var j=[];var k=false;var AP=C(AE?this.fillStyle:this.strokeStyle);var AA=AP.color;var AK=AP.alpha*this.globalAlpha;var f=10;var m=10;j.push("<g_vml_:shape",' filled="',!!AE,'"',' style="position:absolute;width:',f,"px;height:",m,'px;"',' coordorigin="0 0" coordsize="',A*f," ",A*m,'"',' stroked="',!AE,'"',' path="');var l=false;var AO={x:null,y:null};var w={x:null,y:null};for(var AJ=0;AJ<this.currentPath_.length;AJ++){var AI=this.currentPath_[AJ];var AN;switch(AI.type){case"moveTo":AN=AI;j.push(" m ",S(AI.x),",",S(AI.y));break;case"lineTo":j.push(" l ",S(AI.x),",",S(AI.y));break;case"close":j.push(" x ");AI=null;break;case"bezierCurveTo":j.push(" c ",S(AI.cp1x),",",S(AI.cp1y),",",S(AI.cp2x),",",S(AI.cp2y),",",S(AI.x),",",S(AI.y));break;case"at":case"wa":j.push(" ",AI.type," ",S(AI.x-this.arcScaleX_*AI.radius),",",S(AI.y-this.arcScaleY_*AI.radius)," ",S(AI.x+this.arcScaleX_*AI.radius),",",S(AI.y+this.arcScaleY_*AI.radius)," ",S(AI.xStart),",",S(AI.yStart)," ",S(AI.xEnd),",",S(AI.yEnd));break}if(AI){if(AO.x==null||AI.x<AO.x){AO.x=AI.x}if(w.x==null||AI.x>w.x){w.x=AI.x}if(AO.y==null||AI.y<AO.y){AO.y=AI.y}if(w.y==null||AI.y>w.y){w.y=AI.y}}}j.push(' ">');if(!AE){var v=this.lineScale_*this.lineWidth;if(v<1){AK*=v}j.push("<g_vml_:stroke",' opacity="',AK,'"',' joinstyle="',this.lineJoin,'"',' miterlimit="',this.miterLimit,'"',' endcap="',P(this.lineCap),'"',' weight="',v,'px"',' color="',AA,'" />')}else{if(typeof this.fillStyle=="object"){var n=this.fillStyle;var t=0;var AH={x:0,y:0};var AB=0;var r=1;if(n.type_=="gradient"){var q=n.x0_/this.arcScaleX_;var d=n.y0_/this.arcScaleY_;var o=n.x1_/this.arcScaleX_;var AQ=n.y1_/this.arcScaleY_;var AM=this.getCoords_(q,d);var AL=this.getCoords_(o,AQ);var h=AL.x-AM.x;var g=AL.y-AM.y;t=Math.atan2(h,g)*180/Math.PI;if(t<0){t+=360}if(t<0.000001){t=0}}else{var AM=this.getCoords_(n.x0_,n.y0_);var Z=w.x-AO.x;var e=w.y-AO.y;AH={x:(AM.x-AO.x)/Z,y:(AM.y-AO.y)/e};Z/=this.arcScaleX_*A;e/=this.arcScaleY_*A;var AG=R.max(Z,e);AB=2*n.r0_/AG;r=2*n.r1_/AG-AB}var z=n.colors_;z.sort(function(i,c){return i.offset-c.offset});var u=z.length;var y=z[0].color;var x=z[u-1].color;var AD=z[0].alpha*this.globalAlpha;var AC=z[u-1].alpha*this.globalAlpha;var AF=[];for(var AJ=0;AJ<u;AJ++){var s=z[AJ];AF.push(s.offset*r+AB+" "+s.color)}j.push('<g_vml_:fill type="',n.type_,'"',' method="none" focus="100%"',' color="',y,'"',' color2="',x,'"',' colors="',AF.join(","),'"',' opacity="',AC,'"',' g_o_:opacity2="',AD,'"',' angle="',t,'"',' focusposition="',AH.x,",",AH.y,'" />')}else{j.push('<g_vml_:fill color="',AA,'" opacity="',AK,'" />')}}j.push("</g_vml_:shape>");this.element_.insertAdjacentHTML("beforeEnd",j.join(""))};I.fill=function(){this.stroke(true)};I.closePath=function(){this.currentPath_.push({type:"close"})};I.getCoords_=function(d,c){var Z=this.m_;return{x:A*(d*Z[0][0]+c*Z[1][0]+Z[2][0])-K,y:A*(d*Z[0][1]+c*Z[1][1]+Z[2][1])-K}};I.save=function(){var Z={};T(this,Z);this.aStack_.push(Z);this.mStack_.push(this.m_);this.m_=D(N(),this.m_)};I.restore=function(){T(this.aStack_.pop(),this);this.m_=this.mStack_.pop()};I.translate=function(d,c){var Z=[[1,0,0],[0,1,0],[d,c,1]];this.m_=D(Z,this.m_)};I.rotate=function(d){var f=a(d);var e=O(d);var Z=[[f,e,0],[-e,f,0],[0,0,1]];this.m_=D(Z,this.m_)};I.scale=function(f,e){this.arcScaleX_*=f;this.arcScaleY_*=e;var c=[[f,0,0],[0,e,0],[0,0,1]];var Z=this.m_=D(c,this.m_);var d=Z[0][0]*Z[1][1]-Z[0][1]*Z[1][0];this.lineScale_=Y(J(d))};I.clip=function(){};I.arcTo=function(){};I.createPattern=function(){return new F};function W(Z){this.type_=Z;this.x0_=0;this.y0_=0;this.r0_=0;this.x1_=0;this.y1_=0;this.r1_=0;this.colors_=[]}W.prototype.addColorStop=function(c,Z){Z=C(Z);this.colors_.push({offset:c,color:Z.color,alpha:Z.alpha})};function F(){}G_vmlCanvasManager=H;CanvasRenderingContext2D=M;CanvasGradient=W;CanvasPattern=F})()};(function($){$.fn.hint=function(blurClass){if(!blurClass){blurClass='blur';}
return this.each(function(){var $input=$(this),$win=$(window);function remove(){if($input.hasClass(blurClass)){$input.val('').removeClass(blurClass).css("color","#000");}}
if($input.hasClass('textstyle')){if($input.attr('title')!=''){$input.blur(function(){if(this.value===''){$input.val($input.attr('title')).addClass(blurClass).css("color","#f00");;}}).focus(remove).blur();$win.unload(remove);}
else
$input.removeClass(blurClass);}});};})(jQuery);(function($){var pasteEventName=($.browser.msie?'paste':'input')+".mask";var iPhone=(window.orientation!=undefined);$.mask={definitions:{'9':"[0-9]",'a':"[A-Za-z]",'*':"[A-Za-z0-9]"}};$.fn.extend({caret:function(begin,end){if(this.length==0)return;if(typeof begin=='number'){end=(typeof end=='number')?end:begin;return this.each(function(){if(this.setSelectionRange){this.focus();this.setSelectionRange(begin,end);}else if(this.createTextRange){var range=this.createTextRange();range.collapse(true);range.moveEnd('character',end);range.moveStart('character',begin);range.select();}});}else{if(this[0].setSelectionRange){begin=this[0].selectionStart;end=this[0].selectionEnd;}else if(document.selection&&document.selection.createRange){var range=document.selection.createRange();begin=0-range.duplicate().moveStart('character',-100000);end=begin+range.text.length;}
return{begin:begin,end:end};}},unmask:function(){return this.trigger("unmask");},mask:function(mask,settings){if(!mask&&this.length>0){var input=$(this[0]);var tests=input.data("tests");return $.map(input.data("buffer"),function(c,i){return tests[i]?c:null;}).join('');}
settings=$.extend({placeholder:"_",completed:null},settings);var defs=$.mask.definitions;var tests=[];var partialPosition=mask.length;var firstNonMaskPos=null;var len=mask.length;$.each(mask.split(""),function(i,c){if(c=='?'){len--;partialPosition=i;}else if(defs[c]){tests.push(new RegExp(defs[c]));if(firstNonMaskPos==null)
firstNonMaskPos=tests.length-1;}else{tests.push(null);}});return this.each(function(){var input=$(this);var buffer=$.map(mask.split(""),function(c,i){if(c!='?')return defs[c]?settings.placeholder:c});var ignore=false;var focusText=input.val();input.data("buffer",buffer).data("tests",tests);function seekNext(pos){while(++pos<=len&&!tests[pos]);return pos;};function shiftL(pos){while(!tests[pos]&&--pos>=0);for(var i=pos;i<len;i++){if(tests[i]){buffer[i]=settings.placeholder;var j=seekNext(i);if(j<len&&tests[i].test(buffer[j])){buffer[i]=buffer[j];}else
break;}}
writeBuffer();input.caret(Math.max(firstNonMaskPos,pos));};function shiftR(pos){for(var i=pos,c=settings.placeholder;i<len;i++){if(tests[i]){var j=seekNext(i);var t=buffer[i];buffer[i]=c;if(j<len&&tests[j].test(t))
c=t;else
break;}}};function keydownEvent(e){var pos=$(this).caret();var k=e.keyCode;ignore=(k<16||(k>16&&k<32)||(k>32&&k<41));if((pos.begin-pos.end)!=0&&(!ignore||k==8||k==46))
clearBuffer(pos.begin,pos.end);if(k==13){ret38Click("ret38",38,0,0);flashBtn("ret38",38,0,0);return false;}
if(k==8||k==46||(iPhone&&k==127)){shiftL(pos.begin+(k==46?0:-1));return false;}else if(k==27){input.val(focusText);input.caret(0,checkVal());return false;}};function keypressEvent(e){if(ignore){ignore=false;return(e.keyCode==8)?false:null;}
e=e||window.event;var k=e.charCode||e.keyCode||e.which;var pos=$(this).caret();if(e.ctrlKey||e.altKey||e.metaKey){return true;}else if((k>=32&&k<=125)||k>186){var p=seekNext(pos.begin-1);if(p<len){var c=String.fromCharCode(k);if(tests[p].test(c)){shiftR(p);buffer[p]=c;writeBuffer();var next=seekNext(p);$(this).caret(next);if(settings.completed&&next==len)
settings.completed.call(input);}}}
return false;};function clearBuffer(start,end){for(var i=start;i<end&&i<len;i++){if(tests[i])
buffer[i]=settings.placeholder;}};function writeBuffer(){return input.val(buffer.join('')).val();};function checkVal(allow){var test=input.val();var lastMatch=-1;for(var i=0,pos=0;i<len;i++){if(tests[i]){buffer[i]=settings.placeholder;while(pos++<test.length){var c=test.charAt(pos-1);if(tests[i].test(c)){buffer[i]=c;lastMatch=i;break;}}
if(pos>test.length)
break;}else if(buffer[i]==test[pos]&&i!=partialPosition){pos++;lastMatch=i;}}
if(!allow&&lastMatch+1<partialPosition){clearBuffer(0,len);}else if(allow||lastMatch+1>=partialPosition){writeBuffer();if(!allow)input.val(input.val().substring(0,lastMatch+1));}
return(partialPosition?i:firstNonMaskPos);};if(!input.attr("readonly"))
input.one("unmask",function(){input.unbind(".mask").removeData("buffer").removeData("tests");}).bind("focus.mask",function(){focusText=input.val();var pos=checkVal();writeBuffer();setTimeout(function(){if(pos==mask.length)
input.caret(0,pos);else
input.caret(pos);},0);}).bind("blur.mask",function(){checkVal();if(input.val()!=focusText)
input.change();}).bind("keydown.mask",keydownEvent).bind("keypress.mask",keypressEvent).bind(pasteEventName,function(){setTimeout(function(){input.caret(checkVal(true));},0);});checkVal();});}});})(jQuery);if(jQuery)(function(){$.extend($.fn,{rightClick:function(handler){$(this).each(function(){$(this).mousedown(function(e){var evt=e;$(this).mouseup(function(){$(this).unbind('mouseup');if(evt.button==2){handler.call($(this),evt);return false;}else{return true;}});});$(this)[0].oncontextmenu=function(){return false;}});return $(this);},rightMouseDown:function(handler){$(this).each(function(){$(this).mousedown(function(e){if(e.button==2){handler.call($(this),e);return false;}else{return true;}});$(this)[0].oncontextmenu=function(){return false;}});return $(this);},rightMouseUp:function(handler){$(this).each(function(){$(this).mouseup(function(e){if(e.button==2){handler.call($(this),e);return false;}else{return true;}});$(this)[0].oncontextmenu=function(){return false;}});return $(this);},noContext:function(){$(this).each(function(){$(this)[0].oncontextmenu=function(){return false;}});return $(this);}});})(jQuery);(function($){function Plot(target_,data_,options_){var srange;var series=[],options={colors:["#ff0000","#00cae1","#edc240","#afd8f8","#cb4b4b","#4da74d","#9440ed"],legend:{show:true,noColumns:1,labelFormatter:null,labelBoxBorderColor:"#ccc",container:null,position:"ne",margin:5,backgroundColor:null,backgroundOpacity:0.85},xaxis:{mode:null,min:null,max:null,autoscaleMargin:null,ticks:null,tickFormatter:null,labelWidth:null,labelHeight:null,tickDecimals:null,tickSize:null,minTickSize:null,monthNames:null,timeformat:null},yaxis:{min:0,max:4},x2axis:{autoscaleMargin:null,min:0,max:24*60*60*1000,mode:"time",tickSize:[1.5,"hour"]},y2axis:{autoscaleMargin:0.02},points:{show:false,radius:1,lineWidth:0,fill:true,fillColor:"#ffffff"},lines:{lineWidth:15,fill:false,fillColor:null,steps:false},bars:{show:false,lineWidth:2,barWidth:1,fill:true,fillColor:null,align:"left",horizontal:false},threshold:null,grid:{color:"#ffffff",backgroundColor:null,tickColor:"#ffffff",labelMargin:5,borderWidth:2,borderColor:null,markings:null,markingsColor:"#f4f4f4",markingsLineWidth:2,clickable:false,hoverable:false,autoHighlight:true,mouseActiveRadius:10},selection:{mode:null,color:"#101010"},crosshair:{mode:null,color:"#ffff00"}},canvas=null,overlay=null,overlay1=null,eventHolder=null,ctx=null,octx=null,octx1=null,target=$(target_),axes={xaxis:{},yaxis:{},x2axis:{},y2axis:{}},plotOffset={left:0,right:0,top:0,bottom:0},canvasWidth=0,canvasHeight=0,plotWidth=0,plotHeight=0,cap={x:0,width:20,tx:-1},dragbar=0,workarounds={};this.setData=setData;this.setupGrid=setupGrid;this.draw=draw;this.clearSelection=clearSelection;this.setSelection=setSelection;this.triggerPause=triggerPause;this.triggerResume=triggerResume;this.getCanvas=function(){return canvas;};this.getPlotOffset=function(){return plotOffset;};this.getData=function(){return series;};this.getAxes=function(){return axes;};this.setCrosshair=setCrosshair;this.drawMark=drawMark;this.clearCrosshair=function(){setCrosshair(null);};this.highlight=highlight;this.unhighlight=unhighlight;parseOptions(options_);setData(data_);constructCanvas();setupGrid();draw();function setData(d){series=parseData(d);fillInSeriesOptions();processData();}
function parseData(d){var res=[];for(var i=0;i<d.length;++i){var s;if(d[i].data){s={};for(var v in d[i])
s[v]=d[i][v];}
else{s={data:d[i]};}
res.push(s);}
return res;}
function parseOptions(o){$.extend(true,options,o);if(options.grid.borderColor==null)
options.grid.borderColor=options.grid.color
if(options.xaxis.noTicks&&options.xaxis.ticks==null)
options.xaxis.ticks=options.xaxis.noTicks;if(options.yaxis.noTicks&&options.yaxis.ticks==null)
options.yaxis.ticks=options.yaxis.noTicks;if(options.grid.coloredAreas)
options.grid.markings=options.grid.coloredAreas;if(options.grid.coloredAreasColor)
options.grid.markingsColor=options.grid.coloredAreasColor;}
function fillInSeriesOptions(){var i;var neededColors=series.length,usedColors=[],assignedColors=[];for(i=0;i<series.length;++i){var sc=series[i].color;if(sc!=null){--neededColors;if(typeof sc=="number")
assignedColors.push(sc);else
usedColors.push(parseColor(series[i].color));}}
for(i=0;i<assignedColors.length;++i){neededColors=Math.max(neededColors,assignedColors[i]+1);}
var colors=[],variation=0;i=0;while(colors.length<neededColors){var c;if(options.colors.length==i)
c=new Color(100,100,100);else
c=parseColor(options.colors[i]);var sign=variation%2==1?-1:1;var factor=1+sign*Math.ceil(variation/2)*0.2;c.scale(factor,factor,factor);colors.push(c);++i;if(i>=options.colors.length){i=0;++variation;}}
var colori=0,s;for(i=0;i<series.length;++i){s=series[i];if(s.color==null){s.color=colors[colori].toString();++colori;}
else if(typeof s.color=="number")
s.color=colors[s.color].toString();s.lines=$.extend(true,{},options.lines,s.lines);s.points=$.extend(true,{},options.points,s.points);s.bars=$.extend(true,{},options.bars,s.bars);if(s.lines.show==null&&!s.bars.show&&!s.points.show)
s.lines.show=true;if(s.shadowSize==null)
s.shadowSize=options.shadowSize;if(!s.xaxis)
s.xaxis=axes.xaxis;if(s.xaxis==1)
s.xaxis=axes.xaxis;else if(s.xaxis==2)
s.xaxis=axes.x2axis;if(!s.yaxis)
s.yaxis=axes.yaxis;if(s.yaxis==1)
s.yaxis=axes.yaxis;else if(s.yaxis==2)
s.yaxis=axes.y2axis;if(!s.threshold)
s.threshold=options.threshold;s.subseries=null;}}
function processData(){var topSentry=Number.POSITIVE_INFINITY,bottomSentry=Number.NEGATIVE_INFINITY,axis,i,j,k,m,s;for(axis in axes){axes[axis].datamin=topSentry;axes[axis].datamax=bottomSentry;axes[axis].min=options[axis].min;axes[axis].max=options[axis].max;axes[axis].used=false;}
axes.x2axis.used=true;for(i=0;i<series.length;++i){s=series[i];s.datapoints={points:[],incr:2};var data=s.data,points=s.datapoints.points,axisx=s.xaxis,axisy=s.yaxis,xmin=topSentry,xmax=bottomSentry,ymin=topSentry,ymax=bottomSentry,x,y,p,incr,format=[];if(s.bars.show){s.datapoints.incr=3;format.push({d:0});}
axisx.used=true;axisy.used=false;incr=s.datapoints.incr;for(j=k=0;j<data.length;++j,k+=incr){p=data[j];x=null;y=null;if(data[j]!=null){x=p[0];y=p[1];}
if(x!=null&&!isNaN(x=+x)){if(x<xmin)
xmin=x;if(x>xmax)
xmax=x}
else
x=null;if(y!=null&&!isNaN(y=+y)){if(y<ymin)
ymin=y;if(y>ymax)
ymax=y;}
else
y=null;if(x==null||y==null)
x=y=null;for(m=2;m<incr;++m)
points[k+m]=p[m]==null?format[m-2].d:p[m];points[k+1]=y;points[k]=x;}
if(s.bars.show){var delta=s.bars.align=="left"?0:-s.bars.barWidth/2;if(s.bars.horizontal){ymin+=delta;ymax+=delta+s.bars.barWidth;}
else{xmin+=delta;xmax+=delta+s.bars.barWidth;}}
axisx.datamin=Math.min(axisx.datamin,xmin);axisx.datamax=Math.max(axisx.datamax,xmax);axisy.datamin=Math.min(axisy.datamin,ymin);axisy.datamax=Math.max(axisy.datamax,ymax);if(s.lines.show&&s.lines.steps){p=[];for(j=k=0;j<points.length;j+=incr,k+=incr){x=points[j];y=points[j+1];if(j>0&&points[j-incr]!=null&&x!=null&&points[j-incr+1]!=y){p[k]=x;p[k+1]=points[j-incr+1];k+=incr;}
p[k]=x;p[k+1]=y;}
s.datapoints.linespoints=p;}
if(s.threshold){var orig=$.extend({},s),thresholded=$.extend({},s);orig.datapoints={points:[],incr:incr};thresholded.datapoints={points:[],incr:incr};thresholded.color=s.threshold.color;var below=s.threshold.below,origpoints=orig.datapoints.points,threspoints=thresholded.datapoints.points;for(j=0;j<points.length;j+=incr){x=points[j];y=points[j+1];if(y<below)
p=threspoints;else
p=origpoints;p.push(x);p.push(y);}
if(s.lines.show){var lp=s.datapoints.linespoints||points;origpoints=[];threspoints=[];p=origpoints;for(j=0;j<lp.length;j+=incr){x=lp[j];y=lp[j+1];var prevp=p;if(y!=null){if(y<below)
p=threspoints;else
p=origpoints;}
if(p!=prevp&&x!=null&&j>0&&lp[j-incr]!=null){k=(x-lp[j-incr])/(y-lp[j-incr+1])*(below-y)+x;prevp.push(k);prevp.push(below);p.push(null);p.push(null);p.push(k);p.push(below);}
p.push(x);p.push(y);}
orig.datapoints.linespoints=origpoints
thresholded.datapoints.linespoints=threspoints;}
s.subseries=[orig,thresholded];}}}
function constructCanvas(){function makeCanvas(width,height){var c=document.createElement('canvas');c.width=width;c.height=height;if($.browser.msie)
c=window.G_vmlCanvasManager.initElement(c);return c;}
canvasWidth=target.width();canvasHeight=target.height();target.html("");if(target.css("position")=='static')
target.css("position","relative");if(canvasWidth<=0||canvasHeight<=0)
throw"Invalid dimensions for plot, width = "+canvasWidth+", height = "+canvasHeight;canvas=$(makeCanvas(canvasWidth,canvasHeight)).appendTo(target).get(0);ctx=canvas.getContext("2d");overlay=$(makeCanvas(canvasWidth,canvasHeight)).css({position:'absolute',left:0,top:0}).appendTo(target).get(0);octx=overlay.getContext("2d");overlay1=$(makeCanvas(canvasWidth,canvasHeight)).css({position:'absolute',left:0,top:0}).appendTo(target).get(0);octx1=overlay1.getContext("2d");eventHolder=$([overlay,overlay1,canvas]);if(options.selection.mode!=null||options.crosshair.mode!=null||options.grid.hoverable){eventHolder.each(function(){this.onmousemove=onMouseMove;});if(options.selection.mode!=null)
eventHolder.mousedown(onMouseDown);}
if(options.crosshair.mode!=null)
eventHolder.mouseout(onMouseOut);if(options.grid.clickable)
eventHolder.click(onClick);}
function setupGrid(){function setupAxis(axis,options){setRange(axis,options);prepareTickGeneration(axis,options);setTicks(axis,options);if(axis==axes.xaxis||axis==axes.x2axis){axis.p2c=function(p){return(p-axis.min)*axis.scale;};axis.c2p=function(c){return axis.min+c/axis.scale;};}
else{axis.p2c=function(p){return(axis.max-p)*axis.scale;};axis.c2p=function(p){return axis.max-p/axis.scale;};}}
for(var axis in axes)
setupAxis(axes[axis],options[axis]);setSpacing();insertLabels();insertLegend();}
function setRange(axis,axisOptions){var min=axisOptions.min!=null?+axisOptions.min:axis.datamin,max=axisOptions.max!=null?+axisOptions.max:axis.datamax;if(min==Number.POSITIVE_INFINITY)
min=0;if(max==Number.NEGATIVE_INFINITY)
max=1;if(max-min==0.0){var widen=max==0?1:0.01;if(axisOptions.min==null)
min-=widen;if(axisOptions.max==null||axisOptions.min!=null)
max+=widen;}
else{var margin=axisOptions.autoscaleMargin;if(margin!=null){if(axisOptions.min==null){min-=(max-min)*margin;if(min<0&&axis.datamin>=0)
min=0;}
if(axisOptions.max==null){max+=(max-min)*margin;if(max>0&&axis.datamax<=0)
max=0;}}}
axis.min=min;axis.max=max;}
function prepareTickGeneration(axis,axisOptions){var noTicks;if(typeof axisOptions.ticks=="number"&&axisOptions.ticks>0)
noTicks=axisOptions.ticks;else if(axis==axes.xaxis||axis==axes.x2axis)
noTicks=canvasWidth/100;else
noTicks=canvasHeight/60;var delta=(axis.max-axis.min)/noTicks;var size,generator,unit,formatter,i,magn,norm;if(axisOptions.mode=="time"){var timeUnitSize={"second":1000,"minute":60*1000,"hour":60*60*1000,"day":24*60*60*1000,"month":30*24*60*60*1000,"year":365.2425*24*60*60*1000};var spec=[[1,"second"],[2,"second"],[5,"second"],[10,"second"],[30,"second"],[1,"minute"],[2,"minute"],[5,"minute"],[10,"minute"],[30,"minute"],[1,"hour"],[2,"hour"],[4,"hour"],[8,"hour"],[12,"hour"],[1,"day"],[2,"day"],[3,"day"],[0.25,"month"],[0.5,"month"],[1,"month"],[2,"month"],[3,"month"],[6,"month"],[1,"year"]];var minSize=0;if(axisOptions.minTickSize!=null){if(typeof axisOptions.tickSize=="number")
minSize=axisOptions.tickSize;else
minSize=axisOptions.minTickSize[0]*timeUnitSize[axisOptions.minTickSize[1]];}
for(i=0;i<spec.length-1;++i)
if(delta<(spec[i][0]*timeUnitSize[spec[i][1]]
+spec[i+1][0]*timeUnitSize[spec[i+1][1]])/2&&spec[i][0]*timeUnitSize[spec[i][1]]>=minSize)
break;size=spec[i][0];unit=spec[i][1];if(unit=="year"){magn=Math.pow(10,Math.floor(Math.log(delta/timeUnitSize.year)/Math.LN10));norm=(delta/timeUnitSize.year)/magn;if(norm<1.5)
size=1;else if(norm<3)
size=2;else if(norm<7.5)
size=5;else
size=10;size*=magn;}
if(axisOptions.tickSize){size=axisOptions.tickSize[0];unit=axisOptions.tickSize[1];}
generator=function(axis){var ticks=[],tickSize=axis.tickSize[0],unit=axis.tickSize[1],d=new Date(axis.min);var step=tickSize*timeUnitSize[unit];if(unit=="second")
d.setUTCSeconds(floorInBase(d.getUTCSeconds(),tickSize));if(unit=="minute")
d.setUTCMinutes(floorInBase(d.getUTCMinutes(),tickSize));if(unit=="hour")
d.setUTCHours(floorInBase(d.getUTCHours(),tickSize));if(unit=="month")
d.setUTCMonth(floorInBase(d.getUTCMonth(),tickSize));if(unit=="year")
d.setUTCFullYear(floorInBase(d.getUTCFullYear(),tickSize));d.setUTCMilliseconds(0);if(step>=timeUnitSize.minute)
d.setUTCSeconds(0);if(step>=timeUnitSize.hour)
d.setUTCMinutes(0);if(step>=timeUnitSize.day)
d.setUTCHours(0);if(step>=timeUnitSize.day*4)
d.setUTCDate(1);if(step>=timeUnitSize.year)
d.setUTCMonth(0);var carry=0,v=Number.NaN,prev;do{prev=v;v=d.getTime();ticks.push({v:v,label:axis.tickFormatter(v,axis)});if(unit=="month"){if(tickSize<1){d.setUTCDate(1);var start=d.getTime();d.setUTCMonth(d.getUTCMonth()+1);var end=d.getTime();d.setTime(v+carry*timeUnitSize.hour+(end-start)*tickSize);carry=d.getUTCHours();d.setUTCHours(0);}
else
d.setUTCMonth(d.getUTCMonth()+tickSize);}
else if(unit=="year"){d.setUTCFullYear(d.getUTCFullYear()+tickSize);}
else
d.setTime(v+step);}while(v<axis.max&&v!=prev);return ticks;};formatter=function(v,axis){var d=new Date(v);if(axisOptions.timeformat!=null)
return $.plot.formatDate(d,axisOptions.timeformat,axisOptions.monthNames);var t=axis.tickSize[0]*timeUnitSize[axis.tickSize[1]];var span=axis.max-axis.min;if(t<timeUnitSize.minute)
fmt="%h:%M:%S";else if(t<timeUnitSize.day){if(span<2*timeUnitSize.day)
fmt="%h:%M";else
fmt="%b %d %h:%M";}
else if(t<timeUnitSize.month)
fmt="%b %d";else if(t<timeUnitSize.year){if(span<timeUnitSize.year)
fmt="%b";else
fmt="%b %y";}
else
fmt="%y";return $.plot.formatDate(d,fmt,axisOptions.monthNames);};}
else{var maxDec=axisOptions.tickDecimals;var dec=-Math.floor(Math.log(delta)/Math.LN10);if(maxDec!=null&&dec>maxDec)
dec=maxDec;magn=Math.pow(10,-dec);norm=delta/magn;if(norm<1.5)
size=1;else if(norm<3){size=2;if(norm>2.25&&(maxDec==null||dec+1<=maxDec)){size=2.5;++dec;}}
else if(norm<7.5)
size=5;else
size=10;size*=magn;if(axisOptions.minTickSize!=null&&size<axisOptions.minTickSize)
size=axisOptions.minTickSize;if(axisOptions.tickSize!=null)
size=axisOptions.tickSize;axis.tickDecimals=Math.max(0,(maxDec!=null)?maxDec:dec);generator=function(axis){var ticks=[];var start=floorInBase(axis.min,axis.tickSize),i=0,v=Number.NaN,prev;do{prev=v;v=start+i*axis.tickSize;ticks.push({v:v,label:axis.tickFormatter(v,axis)});++i;}while(v<axis.max&&v!=prev);return ticks;};formatter=function(v,axis){return v.toFixed(axis.tickDecimals);};}
axis.tickSize=unit?[size,unit]:size;axis.tickGenerator=generator;if($.isFunction(axisOptions.tickFormatter))
axis.tickFormatter=function(v,axis){return""+axisOptions.tickFormatter(v,axis);};else
axis.tickFormatter=formatter;if(axisOptions.labelWidth!=null)
axis.labelWidth=axisOptions.labelWidth;if(axisOptions.labelHeight!=null)
axis.labelHeight=axisOptions.labelHeight;}
function setTicks(axis,axisOptions){axis.ticks=[];if(!axis.used)
return;if(axisOptions.ticks==null)
axis.ticks=axis.tickGenerator(axis);else if(typeof axisOptions.ticks=="number"){if(axisOptions.ticks>0)
axis.ticks=axis.tickGenerator(axis);}
else if(axisOptions.ticks){var ticks=axisOptions.ticks;if($.isFunction(ticks))
ticks=ticks({min:axis.min,max:axis.max});var i,v;for(i=0;i<ticks.length;++i){var label=null;var t=ticks[i];if(typeof t=="object"){v=t[0];if(t.length>1)
label=t[1];}
else
v=t;if(label==null)
label=axis.tickFormatter(v,axis);axis.ticks[i]={v:v,label:label};}}
if(axisOptions.autoscaleMargin!=null&&axis.ticks.length>0){if(axisOptions.min==null)
axis.min=Math.min(axis.min,axis.ticks[0].v);if(axisOptions.max==null&&axis.ticks.length>1)
axis.max=Math.min(axis.max,axis.ticks[axis.ticks.length-1].v);}}
function setSpacing(){function measureXLabels(axis){if(axis.labelWidth==null)
axis.labelWidth=canvasWidth/6;if(axis.labelHeight==null){labels=[];for(i=0;i<axis.ticks.length;++i){l=axis.ticks[i].label;if(l)
labels.push('<div class="tickLabel" style="float:left;width:'+axis.labelWidth+'px">'+l+'</div>');}
axis.labelHeight=0;if(labels.length>0){var dummyDiv=$('<div style="position:absolute;top:-10000px;width:10000px;font-size:smaller;font-family:impact">'
+labels.join("")+'<div style="clear:left"></div></div>').appendTo(target);axis.labelHeight=dummyDiv.height();dummyDiv.remove();}}}
function measureYLabels(axis){if(axis.labelWidth==null||axis.labelHeight==null){var i,labels=[],l;for(i=0;i<axis.ticks.length;++i){l=axis.ticks[i].label;if(l)
labels.push('<div class="tickLabel">'+l+'</div>');}
if(labels.length>0){var dummyDiv=$('<div style="position:absolute;top:-10000px;font-size:smaller;font-family:impact">'
+labels.join("")+'</div>').appendTo(target);if(axis.labelWidth==null)
axis.labelWidth=dummyDiv.width();if(axis.labelHeight==null)
axis.labelHeight=dummyDiv.find("div").height();dummyDiv.remove();}
if(axis.labelWidth==null)
axis.labelWidth=0;if(axis.labelHeight==null)
axis.labelHeight=0;}}
measureXLabels(axes.xaxis);measureYLabels(axes.yaxis);measureXLabels(axes.x2axis);measureYLabels(axes.y2axis);var maxOutset=options.grid.borderWidth;for(i=0;i<series.length;++i)
maxOutset=Math.max(maxOutset,2*(series[i].points.radius+series[i].points.lineWidth/2));plotOffset.left=plotOffset.right=plotOffset.top=plotOffset.bottom=maxOutset;var margin=options.grid.labelMargin+options.grid.borderWidth;if(axes.xaxis.labelHeight>0)
plotOffset.bottom=Math.max(maxOutset,axes.xaxis.labelHeight+margin);if(axes.yaxis.labelWidth>0)
plotOffset.left=Math.max(maxOutset,axes.yaxis.labelWidth+margin);axes.x2axis.labelHeight=axes.xaxis.labelHeight;if(axes.x2axis.labelHeight>0)
plotOffset.top=Math.max(maxOutset,axes.x2axis.labelHeight+margin+15);if(axes.y2axis.labelWidth>0)
plotOffset.right=Math.max(maxOutset,axes.y2axis.labelWidth+margin);plotOffset.left=plotOffset.left+10;plotOffset.right=plotOffset.right+10;plotOffset.bottom=plotOffset.bottom+10;plotWidth=canvasWidth-plotOffset.left-plotOffset.right;plotHeight=canvasHeight-plotOffset.bottom-plotOffset.top+10;axes.xaxis.scale=plotWidth/(axes.xaxis.max-axes.xaxis.min);axes.yaxis.scale=plotHeight/(axes.yaxis.max-axes.yaxis.min);axes.x2axis.scale=plotWidth/(axes.x2axis.max-axes.x2axis.min);axes.y2axis.scale=plotHeight/(axes.y2axis.max-axes.y2axis.min);}
function draw(){drawGrid();for(var i=0;i<series.length;++i){var s=series[i];if(s.subseries)
for(var j=0;j<s.subseries.length;++j)
drawSeries(s.subseries[j]);else
drawSeries(s);}}
function extractRange(ranges,coord){var firstAxis=coord+"axis",secondaryAxis=coord+"2axis",axis,from,to,reverse;if(ranges[firstAxis]){axis=axes[firstAxis];from=ranges[firstAxis].from;to=ranges[firstAxis].to;}
else if(ranges[secondaryAxis]){axis=axes[secondaryAxis];from=ranges[secondaryAxis].from;to=ranges[secondaryAxis].to;}
else{axis=axes[firstAxis];from=ranges[coord+"1"];to=ranges[coord+"2"];}
if(from!=null&&to!=null&&from>to)
return{from:to,to:from,axis:axis};return{from:from,to:to,axis:axis};}
function drawGrid(){var i;ctx.save();ctx.clearRect(0,0,canvasWidth,canvasHeight);ctx.translate(plotOffset.left,plotOffset.top);if(options.grid.backgroundColor){ctx.fillStyle=getColorOrGradient(options.grid.backgroundColor,plotHeight,0,"rgba(255, 255, 255, 0)");ctx.fillRect(0,0,plotWidth,plotHeight);}
var markings=options.grid.markings;if(markings){if($.isFunction(markings))
markings=markings({xmin:axes.xaxis.min,xmax:axes.xaxis.max,ymin:axes.yaxis.min,ymax:axes.yaxis.max,xaxis:axes.xaxis,yaxis:axes.yaxis,x2axis:axes.x2axis,y2axis:axes.y2axis});for(i=0;i<markings.length;++i){var m=markings[i],xrange=extractRange(m,"x"),yrange=extractRange(m,"y");if(xrange.from==null)
xrange.from=xrange.axis.min;if(xrange.to==null)
xrange.to=xrange.axis.max;if(yrange.from==null)
yrange.from=yrange.axis.min;if(yrange.to==null)
yrange.to=yrange.axis.max;if(xrange.to<xrange.axis.min||xrange.from>xrange.axis.max||yrange.to<yrange.axis.min||yrange.from>yrange.axis.max)
continue;xrange.from=Math.max(xrange.from,xrange.axis.min);xrange.to=Math.min(xrange.to,xrange.axis.max);yrange.from=Math.max(yrange.from,yrange.axis.min);yrange.to=Math.min(yrange.to,yrange.axis.max);if(xrange.from==xrange.to&&yrange.from==yrange.to)
continue;xrange.from=xrange.axis.p2c(xrange.from);xrange.to=xrange.axis.p2c(xrange.to);yrange.from=yrange.axis.p2c(yrange.from);yrange.to=yrange.axis.p2c(yrange.to);if(xrange.from==xrange.to||yrange.from==yrange.to){ctx.strokeStyle=m.color||options.grid.markingsColor;ctx.beginPath();ctx.lineWidth=m.lineWidth||options.grid.markingsLineWidth;ctx.moveTo(xrange.from,yrange.from);ctx.lineTo(xrange.to,yrange.to);ctx.stroke();}
else{ctx.fillStyle=m.color||options.grid.markingsColor;ctx.fillRect(xrange.from,yrange.to,xrange.to-xrange.from,yrange.from-yrange.to);}}}
ctx.lineWidth=1;ctx.strokeStyle=options.grid.tickColor;ctx.beginPath();var v,axis=axes.xaxis;for(i=0;i<axis.ticks.length;++i){v=axis.ticks[i].v;if(v<=axis.min||v>=axes.xaxis.max)
continue;ctx.moveTo(Math.floor(axis.p2c(v))+ctx.lineWidth/2,0);ctx.lineTo(Math.floor(axis.p2c(v))+ctx.lineWidth/2,plotHeight);}
axis=axes.yaxis;for(i=0;i<axis.ticks.length;++i){v=axis.ticks[i].v;if(v<=axis.min||v>=axis.max)
continue;ctx.moveTo(0,Math.floor(axis.p2c(v))+ctx.lineWidth/2);ctx.lineTo(plotWidth,Math.floor(axis.p2c(v))+ctx.lineWidth/2);}
axis=axes.x2axis;for(i=0;i<axis.ticks.length;++i){v=axis.ticks[i].v;if(v<=axis.min||v>=axis.max)
continue;ctx.moveTo(Math.floor(axis.p2c(v))+ctx.lineWidth/2,-10);ctx.lineTo(Math.floor(axis.p2c(v))+ctx.lineWidth/2,-5);}
axis=axes.y2axis;for(i=0;i<axis.ticks.length;++i){v=axis.ticks[i].v;if(v<=axis.min||v>=axis.max)
continue;ctx.moveTo(plotWidth-5,Math.floor(axis.p2c(v))+ctx.lineWidth/2);ctx.lineTo(plotWidth+5,Math.floor(axis.p2c(v))+ctx.lineWidth/2);}
ctx.stroke();if(options.grid.borderWidth){var bw=options.grid.borderWidth;ctx.lineWidth=bw;ctx.strokeStyle=options.grid.borderColor;ctx.strokeRect(-bw/2,-bw/2,plotWidth+bw,plotHeight+bw);ctx.strokeStyle=options.grid.tickColor;ctx.strokeRect(0,-20,plotWidth,10);if(d2.length>0){ctx.strokeStyle='#70ff70'
ctx.lineCap="butt";ctx.lineWidth=6;ctx.beginPath();for(i=0;i<tAry.length;i++){ctx.moveTo(axes.x2axis.p2c(tAry[i][0]),-15);ctx.lineTo(axes.x2axis.p2c(tAry[i][1])+1,-15);}
ctx.stroke();}
redrawCap();}
ctx.restore();}
function redrawCap(){octx1.save();octx1.translate(plotOffset.left,plotOffset.top);octx1.clearRect(0,-20,plotWidth,10);if(d2.length>0){if(cap.x<0)
cap.x=0;if((cap.x+cap.width)>plotWidth)
cap.x=plotWidth-cap.width;octx1.lineWidth=2;octx1.strokeStyle='#000000';octx1.strokeRect(cap.x,-20,cap.width,10);}
octx1.restore();}
function insertLabels(){target.find(".tickLabels").remove();var html=['<div class="tickLabels" style="font-size:smaller;font-family:impact;color:'+options.grid.color+'">'];function addLabels(axis,labelGenerator){for(var i=0;i<axis.ticks.length;++i){var tick=axis.ticks[i];if(!tick.label||tick.v<axis.min||tick.v>axis.max)
continue;html.push(labelGenerator(tick,axis));}}
var margin=options.grid.labelMargin+options.grid.borderWidth;addLabels(axes.xaxis,function(tick,axis){return'<div style="position:absolute;cursor:default;top:'+(plotOffset.top+plotHeight+margin)+'px;left:'+Math.round(plotOffset.left+axis.p2c(tick.v)-axis.labelWidth/2)+'px;width:'+axis.labelWidth+'px;text-align:center" class="tickLabel">'+tick.label+"</div>";});addLabels(axes.yaxis,function(tick,axis){return'<div style="position:absolute;top:'+Math.round(plotOffset.top+axis.p2c(tick.v)-axis.labelHeight/2)+'px;right:'+(plotOffset.right+plotWidth+margin)+'px;width:'+axis.labelWidth+'px;text-align:right" class="tickLabel">'+tick.label+"</div>";});addLabels(axes.x2axis,function(tick,axis){return'<div style="position:absolute;bottom:'+(plotOffset.bottom+plotHeight+margin-2+5)+'px;left:'+Math.round(plotOffset.left+axis.p2c(tick.v)-axis.labelWidth/2)+'px;width:'+axis.labelWidth+'px;text-align:center" class="tickLabel">'+tick.label+"</div>";});addLabels(axes.y2axis,function(tick,axis){return'<div style="position:absolute;top:'+Math.round(plotOffset.top+axis.p2c(tick.v)-axis.labelHeight/2)+'px;left:'+(plotOffset.left+plotWidth+margin)+'px;width:'+axis.labelWidth+'px;text-align:left" class="tickLabel">'+tick.label+"</div>";});html.push('</div>');target.append(html.join(""));}
function drawSeries(series){if(series.lines.show)
drawSeriesLines(series);if(series.bars.show)
drawSeriesBars(series);if(series.points.show)
drawSeriesPoints(series);}
function drawSeriesLines(series){function plotLine(datapoints,xoffset,yoffset,axisx,axisy){var points=datapoints.linespoints||datapoints.points,incr=datapoints.incr,prevx=null,prevy=null;ctx.beginPath();for(var i=incr;i<points.length;i+=incr){var x1=points[i-incr],y1=points[i-incr+1],x2=points[i],y2=points[i+1];if(x1==null||x2==null)
continue;if(y1<=y2&&y1<axisy.min){if(y2<axisy.min)
continue;x1=(axisy.min-y1)/(y2-y1)*(x2-x1)+x1;y1=axisy.min;}
else if(y2<=y1&&y2<axisy.min){if(y1<axisy.min)
continue;x2=(axisy.min-y1)/(y2-y1)*(x2-x1)+x1;y2=axisy.min;}
if(y1>=y2&&y1>axisy.max){if(y2>axisy.max)
continue;x1=(axisy.max-y1)/(y2-y1)*(x2-x1)+x1;y1=axisy.max;}
else if(y2>=y1&&y2>axisy.max){if(y1>axisy.max)
continue;x2=(axisy.max-y1)/(y2-y1)*(x2-x1)+x1;y2=axisy.max;}
if(x1<=x2&&x1<axisx.min){if(x2<axisx.min)
continue;y1=(axisx.min-x1)/(x2-x1)*(y2-y1)+y1;x1=axisx.min;}
else if(x2<=x1&&x2<axisx.min){if(x1<axisx.min)
continue;y2=(axisx.min-x1)/(x2-x1)*(y2-y1)+y1;x2=axisx.min;}
if(x1>=x2&&x1>axisx.max){if(x2>axisx.max)
continue;y1=(axisx.max-x1)/(x2-x1)*(y2-y1)+y1;x1=axisx.max;}
else if(x2>=x1&&x2>axisx.max){if(x1>axisx.max)
continue;y2=(axisx.max-x1)/(x2-x1)*(y2-y1)+y1;x2=axisx.max;}
if(x1!=prevx||y1!=prevy){ctx.moveTo(axisx.p2c(x1)+xoffset,axisy.p2c(y1)+yoffset);}
prevx=x2;prevy=y2;ctx.lineTo(axisx.p2c(x2)+xoffset+1,axisy.p2c(y2)+yoffset);}
ctx.stroke();}
function plotLineArea(datapoints,axisx,axisy){var points=datapoints.linespoints||datapoints.points,incr=datapoints.incr,bottom=Math.min(Math.max(0,axisy.min),axisy.max),top,lastX=0,areaOpen=false;for(var i=incr;i<points.length;i+=incr){var x1=points[i-incr],y1=points[i-incr+1],x2=points[i],y2=points[i+1];if(areaOpen&&x1!=null&&x2==null){ctx.lineTo(axisx.p2c(lastX),axisy.p2c(bottom));ctx.fill();areaOpen=false;continue;}
if(x1==null||x2==null)
continue;if(x1<=x2&&x1<axisx.min){if(x2<axisx.min)
continue;y1=(axisx.min-x1)/(x2-x1)*(y2-y1)+y1;x1=axisx.min;}
else if(x2<=x1&&x2<axisx.min){if(x1<axisx.min)
continue;y2=(axisx.min-x1)/(x2-x1)*(y2-y1)+y1;x2=axisx.min;}
if(x1>=x2&&x1>axisx.max){if(x2>axisx.max)
continue;y1=(axisx.max-x1)/(x2-x1)*(y2-y1)+y1;x1=axisx.max;}
else if(x2>=x1&&x2>axisx.max){if(x1>axisx.max)
continue;y2=(axisx.max-x1)/(x2-x1)*(y2-y1)+y1;x2=axisx.max;}
if(!areaOpen){ctx.beginPath();ctx.moveTo(axisx.p2c(x1),axisy.p2c(bottom));areaOpen=true;}
if(y1>=axisy.max&&y2>=axisy.max){ctx.lineTo(axisx.p2c(x1),axisy.p2c(axisy.max));ctx.lineTo(axisx.p2c(x2),axisy.p2c(axisy.max));lastX=x2;continue;}
else if(y1<=axisy.min&&y2<=axisy.min){ctx.lineTo(axisx.p2c(x1),axisy.p2c(axisy.min));ctx.lineTo(axisx.p2c(x2),axisy.p2c(axisy.min));lastX=x2;continue;}
var x1old=x1,x2old=x2;if(y1<=y2&&y1<axisy.min&&y2>=axisy.min){x1=(axisy.min-y1)/(y2-y1)*(x2-x1)+x1;y1=axisy.min;}
else if(y2<=y1&&y2<axisy.min&&y1>=axisy.min){x2=(axisy.min-y1)/(y2-y1)*(x2-x1)+x1;y2=axisy.min;}
if(y1>=y2&&y1>axisy.max&&y2<=axisy.max){x1=(axisy.max-y1)/(y2-y1)*(x2-x1)+x1;y1=axisy.max;}
else if(y2>=y1&&y2>axisy.max&&y1<=axisy.max){x2=(axisy.max-y1)/(y2-y1)*(x2-x1)+x1;y2=axisy.max;}
if(x1!=x1old){if(y1<=axisy.min)
top=axisy.min;else
top=axisy.max;ctx.lineTo(axisx.p2c(x1old),axisy.p2c(top));ctx.lineTo(axisx.p2c(x1),axisy.p2c(top));}
ctx.lineTo(axisx.p2c(x1),axisy.p2c(y1));ctx.lineTo(axisx.p2c(x2),axisy.p2c(y2));if(x2!=x2old){if(y2<=axisy.min)
top=axisy.min;else
top=axisy.max;ctx.lineTo(axisx.p2c(x2),axisy.p2c(top));ctx.lineTo(axisx.p2c(x2old),axisy.p2c(top));}
lastX=Math.max(x2,x2old);}
if(areaOpen){ctx.lineTo(axisx.p2c(lastX),axisy.p2c(bottom));ctx.fill();}}
ctx.save();ctx.translate(plotOffset.left,plotOffset.top);ctx.lineCap="butt";var lw=series.lines.lineWidth,sw=series.shadowSize;if(lw>0&&sw>0){ctx.lineWidth=sw;ctx.strokeStyle="rgba(0,0,0,0.1)";var xoffset=1;plotLine(series.datapoints,xoffset,Math.sqrt((lw/2+sw/2)*(lw/2+sw/2)-xoffset*xoffset),series.xaxis,series.yaxis);ctx.lineWidth=sw/2;plotLine(series.datapoints,xoffset,Math.sqrt((lw/2+sw/4)*(lw/2+sw/4)-xoffset*xoffset),series.xaxis,series.yaxis);}
ctx.lineWidth=lw;ctx.strokeStyle=series.color;var fillStyle=getFillStyle(series.lines,series.color,0,plotHeight);if(fillStyle){ctx.fillStyle=fillStyle;plotLineArea(series.datapoints,series.xaxis,series.yaxis);}
if(lw>0)
plotLine(series.datapoints,0,0,series.xaxis,series.yaxis);ctx.restore();}
function drawSeriesPoints(series){function plotPoints(datapoints,radius,fillStyle,offset,circumference,axisx,axisy){var points=datapoints.points,incr=datapoints.incr;for(var i=0;i<points.length;i+=incr){var x=points[i],y=points[i+1];if(x==null||x<axisx.min||x>axisx.max||y<axisy.min||y>axisy.max)
continue;ctx.beginPath();ctx.arc(axisx.p2c(x),axisy.p2c(y)+offset,radius,0,circumference,true);if(fillStyle){ctx.fillStyle=fillStyle;ctx.fill();}
ctx.stroke();}}
ctx.save();ctx.translate(plotOffset.left,plotOffset.top);var lw=series.lines.lineWidth,sw=series.shadowSize,radius=series.points.radius;if(lw>0&&sw>0){var w=sw/2;ctx.lineWidth=w;ctx.strokeStyle="rgba(0,0,0,0.1)";plotPoints(series.datapoints,radius,null,w+w/2,2*Math.PI,series.xaxis,series.yaxis);ctx.strokeStyle="rgba(0,0,0,0.2)";plotPoints(series.datapoints,radius,null,w/2,2*Math.PI,series.xaxis,series.yaxis);}
ctx.lineWidth=lw;ctx.strokeStyle=series.color;plotPoints(series.datapoints,radius,getFillStyle(series.points,series.color),0,2*Math.PI,series.xaxis,series.yaxis);ctx.restore();}
function drawBar(x,y,b,barLeft,barRight,offset,fillStyleCallback,axisx,axisy,c,horizontal){var left,right,bottom,top,drawLeft,drawRight,drawTop,drawBottom,tmp;if(horizontal){drawBottom=drawRight=drawTop=true;drawLeft=false;left=b;right=x;top=y+barLeft;bottom=y+barRight;if(right<left){tmp=right;right=left;left=tmp;drawLeft=true;drawRight=false;}}
else{drawLeft=drawRight=drawTop=true;drawBottom=false;left=x+barLeft;right=x+barRight;bottom=b;top=y;if(top<bottom){tmp=top;top=bottom;bottom=tmp;drawBottom=true;drawTop=false;}}
if(right<axisx.min||left>axisx.max||top<axisy.min||bottom>axisy.max)
return;if(left<axisx.min){left=axisx.min;drawLeft=false;}
if(right>axisx.max){right=axisx.max;drawRight=false;}
if(bottom<axisy.min){bottom=axisy.min;drawBottom=false;}
if(top>axisy.max){top=axisy.max;drawTop=false;}
left=axisx.p2c(left);bottom=axisy.p2c(bottom);right=axisx.p2c(right);top=axisy.p2c(top);if(fillStyleCallback){c.beginPath();c.moveTo(left,bottom);c.lineTo(left,top);c.lineTo(right,top);c.lineTo(right,bottom);c.fillStyle=fillStyleCallback(bottom,top);c.fill();}
if(drawLeft||drawRight||drawTop||drawBottom){c.beginPath();c.moveTo(left,bottom+offset);if(drawLeft)
c.lineTo(left,top+offset);else
c.moveTo(left,top+offset);if(drawTop)
c.lineTo(right,top+offset);else
c.moveTo(right,top+offset);if(drawRight)
c.lineTo(right,bottom+offset);else
c.moveTo(right,bottom+offset);if(drawBottom)
c.lineTo(left,bottom+offset);else
c.moveTo(left,bottom+offset);c.stroke();}}
function drawSeriesBars(series){function plotBars(datapoints,barLeft,barRight,offset,fillStyleCallback,axisx,axisy){var points=datapoints.points,incr=datapoints.incr;for(var i=0;i<points.length;i+=incr){if(points[i]==null)
continue;drawBar(points[i],points[i+1],points[i+2],barLeft,barRight,offset,fillStyleCallback,axisx,axisy,ctx,series.bars.horizontal);}}
ctx.save();ctx.translate(plotOffset.left,plotOffset.top);ctx.lineWidth=series.bars.lineWidth;ctx.strokeStyle=series.color;var barLeft=series.bars.align=="left"?0:-series.bars.barWidth/2;var fillStyleCallback=series.bars.fill?function(bottom,top){return getFillStyle(series.bars,series.color,bottom,top);}:null;plotBars(series.datapoints,barLeft,barLeft+series.bars.barWidth,0,fillStyleCallback,series.xaxis,series.yaxis);ctx.restore();}
function getFillStyle(filloptions,seriesColor,bottom,top){var fill=filloptions.fill;if(!fill)
return null;if(filloptions.fillColor)
return getColorOrGradient(filloptions.fillColor,bottom,top,seriesColor);var c=parseColor(seriesColor);c.a=typeof fill=="number"?fill:0.4;c.normalize();return c.toString();}
function insertLegend(){target.find(".legend").remove();if(!options.legend.show)
return;var fragments=[],rowStarted=false,lf=options.legend.labelFormatter,s,label;for(i=0;i<series.length;++i){s=series[i];label=s.label;if(!label)
continue;if(i%options.legend.noColumns==0){if(rowStarted)
fragments.push('</tr>');fragments.push('<tr>');rowStarted=true;}
if(lf)
label=lf(label,s);fragments.push('<td class="legendColorBox"><div style="border:1px solid '+options.legend.labelBoxBorderColor+';padding:1px"><div style="width:4px;height:0;border:5px solid '+s.color+';overflow:hidden"></div></div></td>'+'<td class="legendLabel">'+label+'</td>');}
if(rowStarted)
fragments.push('</tr>');if(fragments.length==0)
return;var table='<table style="font-size:smaller;font-family:impact;color:'+options.grid.color+'">'+fragments.join("")+'</table>';if(options.legend.container!=null)
$(options.legend.container).html(table);else{var pos="",p=options.legend.position,m=options.legend.margin;if(m[0]==null)
m=[m,m];if(p.charAt(0)=="n")
pos+='top:'+(m[1]+plotOffset.top)+'px;';else if(p.charAt(0)=="s")
pos+='bottom:'+(m[1]+plotOffset.bottom)+'px;';if(p.charAt(1)=="e")
pos+='right:'+(m[0]+plotOffset.right)+'px;';else if(p.charAt(1)=="w")
pos+='left:'+(m[0]+plotOffset.left)+'px;';var legend=$('<div class="legend">'+table.replace('style="','style="position:absolute;'+pos+';')+'</div>').appendTo(target);if(options.legend.backgroundOpacity!=0.0){var c=options.legend.backgroundColor;if(c==null){var tmp;if(options.grid.backgroundColor&&typeof options.grid.backgroundColor=="string")
tmp=options.grid.backgroundColor;else
tmp=extractColor(legend);c=parseColor(tmp).adjust(null,null,null,1).toString();}
var div=legend.children();$('<div style="position:absolute;width:'+div.width()+'px;height:'+div.height()+'px;'+pos+'background-color:'+c+';"> </div>').prependTo(legend).css('opacity',options.legend.backgroundOpacity);}}}
var lastMousePos={pageX:null,pageY:null},selection={first:{x:-1,y:-1},second:{x:-1,y:-1},show:false,active:false},crosshair={pos:{x:-1,y:-1}},highlights=[],clickIsMouseUp=false,redrawTimeout=null,hoverTimeout=null;function findNearbyItem(mouseX,mouseY,seriesFilter){var maxDistance=options.grid.mouseActiveRadius,lowestDistance=maxDistance*maxDistance+1,item=null,foundPoint=false,i,j;for(var i=0;i<series.length;++i){if(!seriesFilter(series[i]))
continue;var s=series[i],axisx=s.xaxis,axisy=s.yaxis,points=s.datapoints.points,incr=s.datapoints.incr,mx=axisx.c2p(mouseX),my=axisy.c2p(mouseY),maxx=maxDistance/axisx.scale,maxy=maxDistance/axisy.scale;if(s.lines.show||s.points.show){for(j=0;j<points.length;j+=incr){var x=points[j],y=points[j+1];if(x==null)
continue;if(x-mx>maxx||x-mx<-maxx||y-my>maxy||y-my<-maxy)
continue;var dx=Math.abs(axisx.p2c(x)-mouseX),dy=Math.abs(axisy.p2c(y)-mouseY),dist=dx*dx+dy*dy;if(dist<lowestDistance){lowestDistance=dist;item=[i,j/incr];}}}
if(s.bars.show&&!item){var barLeft=s.bars.align=="left"?0:-s.bars.barWidth/2,barRight=barLeft+s.bars.barWidth;for(j=0;j<points.length;j+=incr){var x=points[j],y=points[j+1],b=points[j+2];if(x==null)
continue;if(series[i].bars.horizontal?(mx<=Math.max(b,x)&&mx>=Math.min(b,x)&&my>=y+barLeft&&my<=y+barRight):(mx>=x+barLeft&&mx<=x+barRight&&my>=Math.min(b,y)&&my<=Math.max(b,y)))
item=[i,j/incr];}}}
if(item){i=item[0];j=item[1];return{datapoint:series[i].data[j],dataIndex:j,series:series[i],seriesIndex:i}}
return null;}
function onMouseMove(ev){var e=ev||window.event;if(e.pageX==null&&e.clientX!=null){var de=document.documentElement,b=document.body;lastMousePos.pageX=e.clientX+(de&&de.scrollLeft||b.scrollLeft||0)-(de.clientLeft||0);lastMousePos.pageY=e.clientY+(de&&de.scrollTop||b.scrollTop||0)-(de.clientTop||0);x=e.clientX-eventHolder.offset().left-plotOffset.left;y=e.clientY-eventHolder.offset().top-plotOffset.top;}
else{lastMousePos.pageX=e.pageX;lastMousePos.pageY=e.pageY;x=e.pageX-eventHolder.offset().left-plotOffset.left;y=e.pageY-eventHolder.offset().top-plotOffset.top;}
if(x<0)
x=0;if(x>plotWidth)
x=plotWidth;if(cap.tx>=0){if(y>0)
cap.tx=-1;else{cap.x=x-cap.tx+cap.x;cap.tx=x;redrawCap();}
return;}
if(options.grid.hoverable)
triggerClickHoverEvent("plothover",lastMousePos,function(s){return s["hoverable"]!=false;});if(dragbar==1){selection.first.x=x;if((crosshair.pos.x<x)||(selection.second.x<crosshair.pos.x))
crosshair.pos.x=x;triggerRedrawOverlay();}
else
if(dragbar==2){if((crosshair.pos.x<selection.first.x)||(x<crosshair.pos.x))
crosshair.pos.x=selection.first.x;selection.second.x=x;triggerRedrawOverlay();}
else
if(dragbar==3){if(x<selection.first.x)
x=selection.first.x;else
if(x>selection.second.x)
x=selection.second.x-2;crosshair.pos.x=x;triggerRedrawOverlay();}
if(options.crosshair.mode!=null){if(!selection.active){setPositionFromEvent(crosshair.pos,lastMousePos);triggerRedrawOverlay();}
else
crosshair.pos.x=-1;}}
function onMouseDown(e){target.trigger("plotpaused");x=e.pageX-eventHolder.offset().left-plotOffset.left;dy=e.pageY-eventHolder.offset().top-plotOffset.top;if(e.which!=1){if(dy<=0){ctx.save();ctx.translate(plotOffset.left,plotOffset.top);ctx.strokeStyle='#646464';ctx.lineCap="butt";ctx.lineWidth=6;ctx.beginPath();ctx.moveTo(2,-15);ctx.lineTo(plotWidth-2,-15);ctx.stroke();ctx.restore();target.trigger("plotclean");target.trigger("plotresume");return true;}
else
if(selectionIsSane()){var rr=getSelectionForEvent();var r={};if((Math.abs(x-selection.first.x)<4)||(Math.abs(x-selection.second.x)<4)){d=rr.xaxis.to-rr.xaxis.from;if(d<=30000)
v=10000;else
if(d<=60000)
v=20000;else
if(d<=300000)
v=30000;else
if(d<=600000)
v=60000;else
if(d<=1800000)
v=180000;else
if(d<=3600000)
v=300000;else
v=d/5;r.xaxis={from:(rr.xaxis.from-v),to:(rr.xaxis.to+v)};target.trigger("plotrselected",[rr,r]);target.trigger("plotresume");}
else{d=axes.xaxis.max-axes.xaxis.min;if(d<=60000)
v=60000;else
if(d<=300000)
v=300000;else
if(d<=900000)
v=900000;else
if(d<=1800000)
v=1800000;else
if(d<=3600000)
v=3600000;else
v=7200000;r.xaxis={from:(axes.xaxis.min-v),to:(axes.xaxis.max+v)};target.trigger("plotrselected",[rr,r]);target.trigger("plotresume");}
return true;}}
document.body.focus();if(document.onselectstart!==undefined&&workarounds.onselectstart==null){workarounds.onselectstart=document.onselectstart;document.onselectstart=function(){return false;};}
if(document.ondrag!==undefined&&workarounds.ondrag==null){workarounds.ondrag=document.ondrag;document.ondrag=function(){return false;};}
cap.tx=-1;if(dy>0){if(selection.show){if((dy>10)&&(dy<((selection.second.y-selection.first.y)-10))){if(Math.abs(x-selection.first.x)<5){dragbar=1;if((crosshair.pos.x<x)||(selection.second.x<crosshair.pos.x))
crosshair.pos.x=x;setSelectionPos(selection.first,e);if(selectionIsSane()){triggerRedrawOverlay();}
$(document).one("mouseup",onDragMouseUp);return;}
else
if(Math.abs(x-selection.second.x)<5){if((crosshair.pos.x<selection.first.x)||(x<crosshair.pos.x))
crosshair.pos.x=selection.first.x;dragbar=2;setSelectionPos(selection.second,e);if(selectionIsSane()){triggerRedrawOverlay();}
$(document).one("mouseup",onDragMouseUp);return;}}
if(Math.abs(x-crosshair.pos.x)<5){dragbar=3;if(selectionIsSane()){triggerRedrawOverlay();}
$(document).one("mouseup",onDragMouseUp);return;}};if((x>selection.second.x)||(x<selection.first.x)){d=selection.second.x-selection.first.x;selection.first.x=x;selection.second.x=x+d;}
else{dragbar=3;crosshair.pos.x=x;if(selectionIsSane()){triggerRedrawOverlay();}
$(document).one("mouseup",onDragMouseUp);return;}
selection.active=true;lastMousePos.pageX=null;$(document).one("mouseup",onSelectionMouseUp);}
else{if((x<cap.x)||(x>(cap.x+cap.width))){cap.x=x;redrawCap();cap.tx=x;}
else{lastMousePos.pageX=null;cap.tx=x;}
$(document).one("mouseup",onCapMouseUp);}}
function onMouseOut(ev){if(options.crosshair.mode!=null&&crosshair.pos.x!=-1){crosshair.pos.x=-1;triggerRedrawOverlay();}}
function onClick(e){if(clickIsMouseUp){clickIsMouseUp=false;return;}
triggerClickHoverEvent("plotclick",e,function(s){return s["clickable"]!=false;});}
function triggerClickHoverEvent(eventname,event,seriesFilter){var offset=eventHolder.offset(),pos={pageX:event.pageX,pageY:event.pageY},canvasX=event.pageX-offset.left-plotOffset.left,canvasY=event.pageY-offset.top-plotOffset.top;if(axes.xaxis.used)
pos.x=axes.xaxis.c2p(canvasX);if(axes.yaxis.used)
pos.y=axes.yaxis.c2p(canvasY);if(axes.x2axis.used)
pos.x2=axes.x2axis.c2p(canvasX);if(axes.y2axis.used)
pos.y2=axes.y2axis.c2p(canvasY);var item=findNearbyItem(canvasX,canvasY,seriesFilter);if(item){item.pageX=parseInt(item.series.xaxis.p2c(item.datapoint[0])+offset.left+plotOffset.left);item.pageY=parseInt(item.series.yaxis.p2c(item.datapoint[1])+offset.top+plotOffset.top);}
if(options.grid.autoHighlight){for(var i=0;i<highlights.length;++i){var h=highlights[i];if(h.auto==eventname&&!(item&&h.series==item.series&&h.point==item.datapoint))
unhighlight(h.series,h.point);}
if(item)
highlight(item.series,item.datapoint,eventname);}
target.trigger(eventname,[pos,item]);}
function triggerRedrawOverlay(){if(!redrawTimeout)
redrawTimeout=setTimeout(redrawOverlay,30);}
function redrawOverlay(){redrawTimeout=null;octx.save();octx.clearRect(0,0,canvasWidth,canvasHeight);octx.translate(plotOffset.left,plotOffset.top);var i,hi;for(i=0;i<highlights.length;++i){hi=highlights[i];if(hi.series.bars.show)
drawBarHighlight(hi.series,hi.point);else
drawPointHighlight(hi.series,hi.point);}
if(d2.length!=0){var pos=crosshair.pos,mode=options.crosshair.mode;if(pos.x!=-1){octx.strokeStyle=options.crosshair.color;octx.lineWidth=6;octx.lineCap="butt";octx.beginPath();octx.moveTo(pos.x,1);octx.lineTo(pos.x,plotHeight-1);octx.stroke();}
if(selection.show&&selectionIsSane()){octx.lineWidth=1;octx.lineCap="butt";octx.fillStyle=parseColor(options.selection.color).scale(null,null,null,0.4).toString();var x=Math.min(selection.first.x,selection.second.x),y=Math.min(selection.first.y,selection.second.y),w=Math.abs(selection.second.x-selection.first.x),h=Math.abs(selection.second.y-selection.first.y);if(x>0)
octx.fillRect(0,y+11,x,h-22);d=plotWidth-x-w;if(d>0)
octx.fillRect(x+w,y+11,d,h-22);octx.fillStyle="#000000"
octx.fillRect(x-3,y+10,6,h-19);octx.fillRect(x+w-3,y+10,6,h-19);}}
octx.restore();if(d2.length!=0){octx1.save();octx1.translate(plotOffset.left,plotOffset.top);octx1.clearRect(0,-20,plotWidth,10);octx1.lineWidth=2;octx1.strokeStyle='#000000';octx1.strokeRect(cap.x,-20,cap.width,10);octx1.restore();}}
function highlight(s,point,auto){if(typeof s=="number")
s=series[s];if(typeof point=="number")
point=s.data[point];var i=indexOfHighlight(s,point);if(i==-1){highlights.push({series:s,point:point,auto:auto});triggerRedrawOverlay();}
else if(!auto)
highlights[i].auto=false;}
function unhighlight(s,point){if(typeof s=="number")
s=series[s];if(typeof point=="number")
point=s.data[point];var i=indexOfHighlight(s,point);if(i!=-1){highlights.splice(i,1);triggerRedrawOverlay();}}
function indexOfHighlight(s,p){for(var i=0;i<highlights.length;++i){var h=highlights[i];if(h.series==s&&h.point[0]==p[0]&&h.point[1]==p[1])
return i;}
return-1;}
function drawPointHighlight(series,point){var x=point[0],y=point[1],axisx=series.xaxis,axisy=series.yaxis;if(x<axisx.min||x>axisx.max||y<axisy.min||y>axisy.max)
return;var pointRadius=series.points.radius+series.points.lineWidth/2;octx.lineWidth=pointRadius;octx.strokeStyle=parseColor(series.color).scale(1,1,1,0.5).toString();var radius=1.5*pointRadius;octx.beginPath();octx.arc(axisx.p2c(x),axisy.p2c(y),radius,0,2*Math.PI,true);octx.stroke();}
function drawBarHighlight(series,point){octx.lineWidth=series.bars.lineWidth;octx.strokeStyle=parseColor(series.color).scale(1,1,1,0.5).toString();var fillStyle=parseColor(series.color).scale(1,1,1,0.5).toString();var barLeft=series.bars.align=="left"?0:-series.bars.barWidth/2;drawBar(point[0],point[1],point[2]||0,barLeft,barLeft+series.bars.barWidth,0,function(){return fillStyle;},series.xaxis,series.yaxis,octx,series.bars.horizontal);}
function setPositionFromEvent(pos,e){var offset=eventHolder.offset();pos.x=clamp(0,e.pageX-offset.left-plotOffset.left,plotWidth);pos.y=clamp(0,e.pageY-offset.top-plotOffset.top,plotHeight);}
function drawMark(pos){ctx.save();ctx.translate(plotOffset.left,plotOffset.top);ctx.strokeStyle='#70ff70'
ctx.lineCap="butt";ctx.lineWidth=6;ctx.beginPath();ctx.moveTo(axes.x2axis.p2c(pos.x1),-15);ctx.lineTo(axes.x2axis.p2c(pos.x2)+1,-15);ctx.stroke();ctx.restore();}
function setCrosshair(pos){if(pos==null){crosshair.pos.x=-1;}
else{crosshair.pos.x=clamp(0,pos.x!=null?axes.xaxis.p2c(pos.x):axes.x2axis.p2c(pos.x2),plotWidth);crosshair.pos.y=clamp(0,pos.y!=null?axes.yaxis.p2c(pos.y):axes.y2axis.p2c(pos.y2),plotHeight);}
triggerRedrawOverlay();}
function getSelectionForEvent(){var x1=Math.min(selection.first.x,selection.second.x),x2=Math.max(selection.first.x,selection.second.x),y1=Math.max(selection.first.y,selection.second.y),y2=Math.min(selection.first.y,selection.second.y);var r={};if(axes.xaxis.used)
r.xaxis={from:axes.xaxis.c2p(x1),to:axes.xaxis.c2p(x2)};if(axes.x2axis.used)
r.x2axis={from:axes.x2axis.c2p(x1),to:axes.x2axis.c2p(x2)};if(axes.yaxis.used)
r.yaxis={from:axes.yaxis.c2p(y1),to:axes.yaxis.c2p(y2)};if(axes.y2axis.used)
r.y2axis={from:axes.y2axis.c2p(y1),to:axes.y2axis.c2p(y2)};return r;}
function triggerSelectedEvent(){var r=getSelectionForEvent();target.trigger("plotselected",[r]);if(axes.xaxis.used&&axes.yaxis.used)
target.trigger("selected",[{x1:r.xaxis.from,y1:r.yaxis.from,x2:r.xaxis.to,y2:r.yaxis.to}]);}
function onCapMouseUp(e){cap.tx=-1;var r={};r.xaxis={from:axes.x2axis.c2p(cap.x),to:axes.x2axis.c2p(cap.x+cap.width)};target.trigger("plotselected",[r]);target.trigger("plotresume");return false;}
function onDragMouseUp(e){if(dragbar==3){target.trigger("crosshairmoved",[axes.xaxis.c2p(crosshair.pos.x)]);}
else{target.trigger("plotmoved",[getSelectionForEvent()]);}
dragbar=0;target.trigger("plotresume");return false;}
function onSelectionMouseUp(e){if(document.onselectstart!==undefined)
document.onselectstart=workarounds.onselectstart;if(document.ondrag!==undefined)
document.ondrag=workarounds.ondrag;if((e.pageY-eventHolder.offset().top-plotOffset.top)>0){selection.active=false;if(selectionIsSane()){triggerSelectedEvent();clickIsMouseUp=true;}
else{target.trigger("plotunselected",[]);target.trigger("plotselecting",[null]);}}
target.trigger("plotresume");return false;}
function setSelectionPos(pos,e){setPositionFromEvent(pos,e);if(options.selection.mode=="y"){if(pos==selection.first)
pos.x=0;else
pos.x=plotWidth;}
if(options.selection.mode=="x"){if(pos==selection.first)
pos.y=0;else
pos.y=plotHeight;}}
function updateSelection(pos){if(pos.pageX==null)
return;setSelectionPos(selection.second,pos);if(selectionIsSane()){selection.show=true;triggerRedrawOverlay();}
else
clearSelection(true);}
function clearSelection(preventEvent){if(selection.show){selection.show=false;triggerRedrawOverlay();if(!preventEvent)
target.trigger("plotunselected",[]);}}
function triggerPause(){target.trigger("plotpaused");}
function triggerResume(){target.trigger("plotresume");}
function setSelection(ranges,preventEvent){var range;srange=ranges;if(options.selection.mode=="y"){selection.first.x=0;selection.second.x=plotWidth;}
else{range=extractRange(ranges,"x");selection.first.x=range.axis.p2c(range.from);selection.second.x=range.axis.p2c(range.to);if(isStopped)
crosshair.pos.x=selection.first.x;cap.x=axes.x2axis.p2c(range.from);cap.width=axes.x2axis.p2c(range.to)-cap.x;}
if(options.selection.mode=="x"){selection.first.y=0;selection.second.y=plotHeight;}
else{range=extractRange(ranges,"y");selection.first.y=range.axis.p2c(range.from);selection.second.y=range.axis.p2c(range.to);}
selection.show=true;triggerRedrawOverlay();if(!preventEvent)
triggerSelectedEvent();}
function selectionIsSane(){var minSize=5;return Math.abs(selection.second.x-selection.first.x)>=minSize&&Math.abs(selection.second.y-selection.first.y)>=minSize;}
function getColorOrGradient(spec,bottom,top,defaultColor){if(typeof spec=="string")
return spec;else{var gradient=ctx.createLinearGradient(0,top,0,bottom);for(var i=0,l=spec.colors.length;i<l;++i){var c=spec.colors[i];gradient.addColorStop(i/(l-1),typeof c=="string"?c:parseColor(defaultColor).scale(c.brightness,c.brightness,c.brightness,c.opacity));}
return gradient;}}}
$.plot=function(target,data,options){var plot=new Plot(target,data,options);return plot;};$.plot.formatDate=function(d,fmt,monthNames){var leftPad=function(n){n=""+n;return n.length==1?"0"+n:n;};var r=[];var escape=false;if(monthNames==null)
monthNames=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];for(var i=0;i<fmt.length;++i){var c=fmt.charAt(i);if(escape){switch(c){case'h':c=""+d.getUTCHours();break;case'H':c=leftPad(d.getUTCHours());break;case'M':c=leftPad(d.getUTCMinutes());break;case'S':c=leftPad(d.getUTCSeconds());break;case'd':c=""+d.getUTCDate();break;case'm':c=""+(d.getUTCMonth()+1);break;case'y':c=""+d.getUTCFullYear();break;case'b':c=""+monthNames[d.getUTCMonth()];break;}
r.push(c);escape=false;}
else{if(c=="%")
escape=true;else
r.push(c);}}
return r.join("");};function floorInBase(n,base){return base*Math.floor(n/base);}
function clamp(min,value,max){if(value<min)
return min;else if(value>max)
return max;else
return value;}
function Color(r,g,b,a){var rgba=['r','g','b','a'];var x=4;while(-1<--x){this[rgba[x]]=arguments[x]||((x==3)?1.0:0);}
this.toString=function(){if(this.a>=1.0){return"rgb("+[this.r,this.g,this.b].join(",")+")";}else{return"rgba("+[this.r,this.g,this.b,this.a].join(",")+")";}};this.scale=function(rf,gf,bf,af){x=4;while(-1<--x){if(arguments[x]!=null)
this[rgba[x]]*=arguments[x];}
return this.normalize();};this.adjust=function(rd,gd,bd,ad){x=4;while(-1<--x){if(arguments[x]!=null)
this[rgba[x]]+=arguments[x];}
return this.normalize();};this.clone=function(){return new Color(this.r,this.b,this.g,this.a);};var limit=function(val,minVal,maxVal){return Math.max(Math.min(val,maxVal),minVal);};this.normalize=function(){this.r=clamp(0,parseInt(this.r),255);this.g=clamp(0,parseInt(this.g),255);this.b=clamp(0,parseInt(this.b),255);this.a=clamp(0,this.a,1);return this;};this.normalize();}
var lookupColors={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0]};function extractColor(element){var color,elem=element;do{color=elem.css("background-color").toLowerCase();if(color!=''&&color!='transparent')
break;elem=elem.parent();}while(!$.nodeName(elem.get(0),"body"));if(color=="rgba(0, 0, 0, 0)")
return"transparent";return color;}
function parseColor(str){var result;if(result=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(str))
return new Color(parseInt(result[1],10),parseInt(result[2],10),parseInt(result[3],10));if(result=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(str))
return new Color(parseInt(result[1],10),parseInt(result[2],10),parseInt(result[3],10),parseFloat(result[4]));if(result=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(str))
return new Color(parseFloat(result[1])*2.55,parseFloat(result[2])*2.55,parseFloat(result[3])*2.55);if(result=/rgba\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(str))
return new Color(parseFloat(result[1])*2.55,parseFloat(result[2])*2.55,parseFloat(result[3])*2.55,parseFloat(result[4]));if(result=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(str))
return new Color(parseInt(result[1],16),parseInt(result[2],16),parseInt(result[3],16));if(result=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(str))
return new Color(parseInt(result[1]+result[1],16),parseInt(result[2]+result[2],16),parseInt(result[3]+result[3],16));var name=$.trim(str).toLowerCase();if(name=="transparent")
return new Color(255,255,255,0);else{result=lookupColors[name];return new Color(result[0],result[1],result[2]);}}})(jQuery);(function($){var types=['DOMMouseScroll','mousewheel'];$.event.special.mousewheel={setup:function(){if(this.addEventListener)
for(var i=types.length;i;)
this.addEventListener(types[--i],handler,false);else
this.onmousewheel=handler;},teardown:function(){if(this.removeEventListener)
for(var i=types.length;i;)
this.removeEventListener(types[--i],handler,false);else
this.onmousewheel=null;}};$.fn.extend({mousewheel:function(fn){return fn?this.bind("mousewheel",fn):this.trigger("mousewheel");},unmousewheel:function(fn){return this.unbind("mousewheel",fn);}});function handler(event){var args=[].slice.call(arguments,2),delta=0,x=0,returnValue=true;event=$.event.fix(event||window.event);event.type="mousewheel";x=event.pageX;if(event.wheelDelta)delta=event.wheelDelta/120;if(event.detail)delta=-event.detail/3;args.unshift(event,delta,x);return $.event.handle.apply(this,args);}})(jQuery);var EC_HALT='disable',EC_RUN='enable',EC_KILL='destroy',EC_CHANGE='change',EC_CLOCK=0,EC_COUNTDOWN=1,EC_COUNTUP=2,EC_ROLLOVER=3,EC_EXPIRE=4,EC_LOOP=5,EC_STOPWATCH=6,EC_HOLDUP=7;;(function($){var defaults={epiClock:{offset:{hours:0,minutes:0,seconds:0,days:0,years:0},arbitrary:{days:0,years:0},gmt:false,target:null,onTimer:null,onKill:null,onRender:function(v,val){v.html(val)},format:null,frame:{},dead:false,displace:0,modifier:0,variance:0,daysadded:0,paused:0,tolerance:0,selfLoc:-1,mode:EC_COUNTDOWN},formats:['F j, Y, g:i:s a','V{d} x{h} i{m} s{s}','Q{y} K{d} x{h} i{m} s{s}','V{d} x{h} i{m} s{s}','x{h} i{m} s{s}','i{m} s{s}','x{h} i{m} s{s}','Q{y} K{d} x{h} i{m} s{s}']},current=null,loop=null,clocks=[],eclkNow;$.epiclockNow=function(){return eclkNow;}
$.epiclock=function(mode,precision){mode=mode||EC_RUN;precision=precision||5e2;if(mode==current)return;switch(mode){case EC_CHANGE:$.each(clocks,function(i){this.data('epiClock').render1(precision);});break;case EC_KILL:$.each(clocks,function(){this.removeData('epiClock');});clocks=[];case EC_HALT:if(loop){clearInterval(loop);loop=null;}
current=mode;break;case EC_RUN:if(!loop){cycleClocks();loop=setInterval(cycleClocks,precision);}
current=mode;break;}
return this;}
function cycleClocks(){$.each(clocks,function(i){this.data('epiClock').render();})}
$.fn.epiclock=function(options){switch(options){case'destroy':return this.each(function(){var jQ=$(this);if(jQ.data('epiClock')instanceof epiClock)
jQ.data('epiClock').kill();})
case'disable':return this.each(function(){var jQ=$(this);if(jQ.data('epiClock')instanceof epiClock)
jQ.data('epiClock').pause();})
case'enable':return this.each(function(){var jQ=$(this);if(jQ.data('epiClock')instanceof epiClock)
jQ.data('epiClock').resume();})
default:options=$.extend(true,{},defaults.epiClock,options);break;}
this.each(function(){var object=$(this),format=(options.format||defaults.formats[options.mode]).split(''),isBuffering=false,label='<label class="epiClock"></label>',span='<span class="epiClock"></span>',buffer='',clock=new epiClock(options,object);object.data('epiClock',clock);$.each(format,function(){x=this+'';switch(x){case' ':if(!isBuffering)
$(span).addClass('ecSpacer').appendTo(object);else buffer+=x;break;case'{':isBuffering=true;break;case'}':isBuffering=false;$(label).html(buffer).appendTo(object);buffer='';break;default:if(isBuffering)buffer+=x;else if(Date.prototype[x]||clock[x]){clock.frame[x]=$(span).attr('ref',x).appendTo(object);}
else
$(label).addClass('ecSeparator').html(x).appendTo(object);break;}});clock.selfLoc=clocks.push(object)-1;})
return this;}
function epiClock(options,element){if(this instanceof epiClock)
return this.init(options,element);else return new epiClock(options,element);}
epiClock.prototype={Q:function(){return this.arbitrary.years},E:function(){return this.arbitrary.days},e:function(){return this.arbitrary.days.pad(0)},zero:new Date(0),pause:function(){if(this.dead)return;this.paused=new Date().valueOf();this.dead=true;},resume:function(){if(!this.dead)return;if(this.mode==EC_STOPWATCH)
this.displace+=(this.paused-new Date().valueOf());this.paused=0;this.dead=false;},kill:function(){clocks.splice(this.selfLoc,1);$.each(clocks,function(i){this.data('epiClock').selfLoc=i});if($.isFunction(this.onKill))this.onKill();this.dead=true;},init:function(options,element){if(options.mode<EC_CLOCK||options.mode>EC_HOLDUP)
throw new Exception('Invalid Clock Mode.');var clock=this;$.each(options,function(k,v){clock[k]=v;});switch(this.mode){case EC_LOOP:case EC_EXPIRE:this.target=this.target||new Date();case EC_COUNTDOWN:case EC_ROLLOVER:this.modifier=-1;this.variance=1;break;case EC_STOPWATCH:this.displace+=-1*new Date().valueOf();return;case EC_HOLDUP:this.variance=-1;this.modifier=1;break;default:this.modifier=1;this.variance=0;break;}
if(this.gmt)
this.normalize();switch(true){case this.target instanceof Date:this.target=this.target.valueOf();break;case typeof this.target=='string':this.target=new Date(this.target).valueOf();break;}
this.displace+=this.modifier*this.calculateOffset();},calculateOffset:function(offset){offset=offset||this.offset;return(offset.years*3157056e4+
offset.days*864e5+
offset.hours*36e5+
offset.minutes*6e4+
(this.variance+offset.seconds)*1e3);},normalize:function(){this.displace+=new Date().getTimezoneOffset()*6e4;},render:function(){if(!this.tick())return;var clock=this,time=(this.mode==EC_HOLDUP)?this.zero:this.now;eclkNow=this.now;$.each(this.frame,function(k,v){var val=($.isFunction(time[k])?time[k]():clock[k]())+'';if(v.data('last')!=val)clock.onRender(v,val);v.data('last',val)})},render1:function(delta){this.now.setMinutes(this.now.getMinutes()+delta);var clock=this,time=this.now;eclkNow=this.now;$.each(this.frame,function(k,v){var val=($.isFunction(time[k])?time[k]():clock[k]())+'';clock.onRender(v,val);v.data('last',val)})},tick:function(){if(this.dead)return false;var now=new Date().valueOf()+this.displace;switch(this.mode){case EC_HOLDUP:if(this.target<now)this.mode=EC_COUNTUP;case EC_COUNTUP:now-=this.target;break;case EC_ROLLOVER:if(now>this.target)now=now-this.target;else now=this.target-now;break;case EC_COUNTDOWN:case EC_EXPIRE:case EC_LOOP:now=this.target-now;if(now<this.tolerance)return this.timerEnd();break;}
this.now=new Date(now);var days=this.now.V();if(days<=this.daysadded)return true;this.daysadded=days;this.arbitrary.days+=days;if(this.arbitrary.days<365)return true;this.arbitrary.years+=Math.floor(this.arbitrary.days/365.4%365.4);this.arbitrary.days=Math.floor(this.arbitrary.days%365.4);return true;},timerEnd:function(){if($.isFunction(this.onTimer))this.onTimer();switch(this.mode){case EC_COUNTDOWN:this.now=new Date(0);current=EC_HALT;this.dead=true;return true;case EC_EXPIRE:this.kill();break;case EC_LOOP:this.displace+=this.modifier*this.calculateOffset();return this.render();case EC_ROLLOVER:this.mode=EC_COUNTUP;return true;}
this.now=new Date(0);return true;}};$.extend(String.prototype,{pad:function(s,l){l=l||2;return this.length<l?new Array(1+l-this.length).join(s)+this:this},rpad:function(s,l){l=l||2;return this.length<l?this+new Array(1+l-this.length).join(s):this}})
$.extend(Number.prototype,{pad:function(s,l){return(this+'').pad(s,l)},rpad:function(s,l){return(this+'').rpad(s,l)}})
$.extend(Date.prototype,{modCalc:function(mod1,mod2){return(Math.floor(Math.floor(this.valueOf()/1e3)/mod1)%mod2)},months:['January','February','March','April','May','June','July','August','September','October','November','December'],days:['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'],suffix:[null,'st','nd','rd'],V:function(){return this.modCalc(864e2,1e5)},v:function(){return this.V().pad(0)},K:function(){return this.V()%365},k:function(){return this.K().pad(0)},X:function(){return this.modCalc(36e2,24)},x:function(){return this.X().pad(0)},d:function(){return this.getDate().pad('0')},D:function(){return this.days[this.getDay()].substring(0,3)},j:function(){return this.getDate()},l:function(){return this.days[this.getDay()]},N:function(){return this.getDay()+1},S:function(){return this.suffix[this.getDate()]||'th'},w:function(){return this.getDay()},z:function(){return Math.round((this-this.f())/864e5)},W:function(){return Math.ceil(((((this-this.f())/864e5)+this.f().w())/7))},F:function(){return this.months[this.getMonth()];},m:function(){return(this.getMonth()+1).pad(0)},M:function(){return this.months[this.getMonth()].substring(0,3)},n:function(){return this.getMonth()+1},L:function(){var Y=this.Y();return Y%4?false:Y%100?true:Y%400?false:true},f:function(){return new Date(this.getFullYear(),0,1)},Y:function(){return this.getFullYear()},y:function(){return(''+this.getFullYear()).substr(2)},a:function(){return this.getHours()<12?'am':'pm'},A:function(){return this.a().toUpperCase()},B:function(){return Math.floor((((this.getHours())*36e5)+(this.getMinutes()*6e4)+(this.getSeconds()*1e3))/864e2).pad(0,3)},g:function(){return this.getHours()%12||12},G:function(){return this.getHours()},h:function(){return this.g().pad('0')},H:function(){return this.getHours().pad('0')},i:function(){return this.getMinutes().pad(0)},s:function(){return this.getSeconds().pad('0')},u:function(){return this.getTime()%1000},O:function(){var t=this.getTimezoneOffset()/60;return(t>=0?'+':'-')+Math.abs(t).pad(0).rpad(0,4)},P:function(){var t=this.O();return t.substr(0,3)+':'+t.substr(3)},Z:function(){return this.getTimezoneOffset()*60;},c:function(){return this.Y()+'-'+this.m()+'-'+this.d()+'T'+this.H()+':'+this.i()+':'+this.s()+this.P()},r:function(){return this.toString()},U:function(){return this.getTime()/1000}});})(jQuery);(function($){var menu,shadow,trigger,content,hash,currentTarget;var defaults={menuStyle:{listStyle:'none',padding:'1px',margin:'0px',backgroundColor:'#646464',border:'1px solid #999',width:'50px'},itemStyle:{margin:'0px',color:'#000',display:'block',cursor:'default',padding:'3px',border:'1px solid #000000',backgroundColor:'transparent'},itemHoverStyle:{border:'1px solid #ffff00',backgroundColor:'#000000'},eventPosX:'pageX',eventPosY:'pageY',shadow:true,onContextMenu:null,onShowMenu:null};$.fn.contextMenu=function(id,options){if(!menu){menu=$('<div id="jqContextMenu"></div>').hide().css({position:'absolute',zIndex:'500'}).appendTo('body').bind('click',function(e){e.stopPropagation();});}
if(!shadow){shadow=$('<div></div>').css({backgroundColor:'#000',position:'absolute',opacity:0.2,zIndex:499}).appendTo('body').hide();}
hash=hash||[];hash.push({id:id,menuStyle:$.extend({},defaults.menuStyle,options.menuStyle||{}),itemStyle:$.extend({},defaults.itemStyle,options.itemStyle||{}),itemHoverStyle:$.extend({},defaults.itemHoverStyle,options.itemHoverStyle||{}),bindings:options.bindings||{},shadow:options.shadow||options.shadow===false?options.shadow:defaults.shadow,onContextMenu:options.onContextMenu||defaults.onContextMenu,onShowMenu:options.onShowMenu||defaults.onShowMenu,eventPosX:options.eventPosX||defaults.eventPosX,eventPosY:options.eventPosY||defaults.eventPosY});var index=hash.length-1;$(this).bind('click',function(e){var bShowContext=(!!hash[index].onContextMenu)?hash[index].onContextMenu(e):true;if(bShowContext)display(index,this,e,options);return false;});$(this).bind('contextmenu',function(e){var bShowContext=(!!hash[index].onContextMenu)?hash[index].onContextMenu(e):true;if(bShowContext)display(index,this,e,options);return false;});return this;};function display(index,trigger,e,options){var cur=hash[index];content=$('#'+cur.id).find('ul:first').clone(true);content.css(cur.menuStyle).find('li').css(cur.itemStyle).hover(function(){$(this).css(cur.itemHoverStyle);},function(){$(this).css(cur.itemStyle);}).find('img').css({verticalAlign:'middle',paddingRight:'10px'});menu.html(content);if(!!cur.onShowMenu)menu=cur.onShowMenu(e,menu);$.each(cur.bindings,function(id,func){$('#'+id,menu).bind('click',function(e){hide();func(trigger,currentTarget);});});menu.css({'left':e[cur.eventPosX]-50,'top':e[cur.eventPosY]-menu.height()-20}).show();if(cur.shadow)shadow.css({width:menu.width(),height:menu.height(),left:e.pageX+2-50,top:e.pageY+2-menu.height()-20}).show();$(document).one('click',hide);}
function hide(){menu.hide();shadow.hide();}
$.contextMenu={defaults:function(userDefaults){$.each(userDefaults,function(i,val){if(typeof val=='object'&&defaults[i]){$.extend(defaults[i],val);}
else defaults[i]=val;});}};})(jQuery);$(function(){$('div.contextMenu').hide();});var flip_clock={format:'H{<img src="flip_clock/sep.gif"/>}i',onRender:function(e,val){var digits=val.substring(1)=='m'?[val]:val.split('').reverse();var last=e.data('last');var cmp=last?last.split('').reverse():[];var img=$.makeArray(e.children('img')).reverse();var prefix=last?'d':'s';if(prefix=='d'){d=val-last;x=Math.abs(d);if((x>1)&&(x!=10))
prefix='s';else
if(d>0)
prefix='d';else
prefix='u';}
$.each(digits,function(i){var x=this+'',i;if(x==cmp[i])return;i=img[i]||$('<img/>').prependTo(e);i=$(i);i.attr({src:'flip_clock/'+prefix+x+'.gif',ref:'flip_clock/s'+x+'.gif'});setTimeout(function(){i.attr('src',i.attr('ref'))},350)})}}
function AutoSuggest(divname,elem,suggestions,callback)
{var me=this;this.elem=elem;this.suggestions=suggestions;this.eligible=new Array();this.inputText=null;this.highlighted=-1;this.div=document.getElementById(divname);var TAB=9;var ESC=27;var KEYUP=38;var KEYDN=40;var RET=13;elem.setAttribute("autocomplete","off");if(!elem.id)
{var id="autosuggest"+idCounter;idCounter++;elem.id=id;}
elem.onkeydown=function(ev)
{var key=me.getKeyCode(ev);switch(key)
{case RET:case TAB:me.useSuggestion();break;case ESC:me.hideDiv();break;case KEYUP:if(me.highlighted>0)
{me.highlighted--;}
me.changeHighlight(key);break;case KEYDN:if(me.highlighted<(me.eligible.length-1))
{me.highlighted++;}
me.changeHighlight(key);break;}};elem.onkeyup=function(ev)
{var key=me.getKeyCode(ev);switch(key)
{case TAB:case ESC:case KEYUP:case KEYDN:return;case RET:{return;}
default:if(this.value!=me.inputText&&this.value.length>0)
{me.inputText=this.value;me.getEligible();me.createDiv();me.positionDiv();me.showDiv();}
else
{me.hideDiv();}}};this.useSuggestion=function()
{if(this.highlighted>-1)
{this.elem.value=this.eligible[this.highlighted];this.hideDiv();setTimeout("document.getElementById('"+this.elem.id+"').focus()",0);}};this.showDiv=function()
{this.div.style.display='block';};this.hideDiv=function()
{this.div.style.display='none';this.highlighted=-1;};this.changeHighlight=function()
{var lis=this.div.getElementsByTagName('LI');for(i in lis)
{var li=lis[i];if(this.highlighted==i)
{li.className="selected";}
else
{li.className="";}}};this.positionDiv=function()
{var el=this.elem;var x=0;var y=el.offsetHeight;while(el.offsetParent&&el.tagName.toUpperCase()!='BODY')
{x+=el.offsetLeft;y+=el.offsetTop;el=el.offsetParent;}
x+=el.offsetLeft;y+=el.offsetTop;this.div.style.left=x+'px';this.div.style.top=y+'px';};this.createDiv=function()
{var ul=document.createElement('ul');for(i in this.eligible)
{var word=this.eligible[i];var li=document.createElement('li');var a=document.createElement('a');a.href="javascript:false";a.innerHTML=word;li.appendChild(a);if(me.highlighted==i)
{li.className="selected";}
ul.appendChild(li);}
this.div.replaceChild(ul,this.div.childNodes[0]);ul.onmouseover=function(ev)
{var target=me.getEventSource(ev);while(target.parentNode&&target.tagName.toUpperCase()!='LI')
{target=target.parentNode;}
var lis=me.div.getElementsByTagName('LI');for(i in lis)
{var li=lis[i];if(li==target)
{me.highlighted=i;break;}}
me.changeHighlight();};ul.onclick=function(ev)
{me.useSuggestion();me.hideDiv();me.cancelEvent(ev);return false;};this.div.className="suggestion_list";this.div.style.position='absolute';};this.getEligible=function()
{this.eligible=new Array();for(i in this.suggestions)
{var suggestion=this.suggestions[i];if(suggestion.toLowerCase().indexOf(this.inputText.toLowerCase())=="0")
{this.eligible[this.eligible.length]=suggestion;}}};this.getKeyCode=function(ev)
{if(ev)
{return ev.keyCode;}
if(window.event)
{return window.event.keyCode;}};this.getEventSource=function(ev)
{if(ev)
{return ev.target;}
if(window.event)
{return window.event.srcElement;}};this.cancelEvent=function(ev)
{if(ev)
{ev.preventDefault();ev.stopPropagation();}
if(window.event)
{window.event.returnValue=false;}}}
var idCounter=0;jQuery.cookie=function(name,value,options){if(typeof value!='undefined'){options=options||{};if(value===null){value='';options=$.extend({},options);options.expires=-1;}
var expires='';if(options.expires&&(typeof options.expires=='number'||options.expires.toUTCString)){var date;if(typeof options.expires=='number'){date=new Date();date.setTime(date.getTime()+(options.expires*24*60*60*1000));}else{date=options.expires;}
expires='; expires='+date.toUTCString();}
var path=options.path?'; path='+(options.path):'';var domain=options.domain?'; domain='+(options.domain):'';var secure=options.secure?'; secure':'';document.cookie=[name,'=',encodeURIComponent(value),expires,path,domain,secure].join('');}else{var cookieValue=null;if(document.cookie&&document.cookie!=''){var cookies=document.cookie.split(';');for(var i=0;i<cookies.length;i++){var cookie=jQuery.trim(cookies[i]);if(cookie.substring(0,name.length+1)==(name+'=')){cookieValue=decodeURIComponent(cookie.substring(name.length+1));break;}}}
return cookieValue;}};;(function($){$.extend($.fn,{swapClass:function(c1,c2){var c1Elements=this.filter('.'+c1);this.filter('.'+c2).removeClass(c2).addClass(c1);c1Elements.removeClass(c1).addClass(c2);return this;},replaceClass:function(c1,c2){return this.filter('.'+c1).removeClass(c1).addClass(c2).end();},hoverClass:function(className){className=className||"hover";return this.hover(function(){$(this).addClass(className);},function(){$(this).removeClass(className);});},hoverClass1:function(className){className=className||"hover1";return this.hover(function(){$(this).addClass(className);},function(){$(this).removeClass(className);});},heightToggle:function(animated,callback){animated?this.animate({height:"toggle"},animated,callback):this.each(function(){jQuery(this)[jQuery(this).is(":hidden")?"show":"hide"]();if(callback)
callback.apply(this,arguments);});},heightHide:function(animated,callback){if(animated){this.animate({height:"hide"},animated,callback);}else{this.hide();if(callback)
this.each(callback);}},prepareBranches:function(settings){if(!settings.prerendered){this.filter(":last-child:not(ul)").addClass(CLASSES.last);this.filter((settings.collapsed?"":"."+CLASSES.closed)+":not(."+CLASSES.open+")").find(">ul").hide();}
return this.filter(":has(>ul)");},applyClasses:function(settings,toggler){this.filter(":has(>ul):not(:has(>a))").find(">span").click(function(event){toggler.apply($(this).next());}).add($("a",this)).hoverClass();if(!settings.prerendered){this.filter(":has(>ul:hidden)").addClass(CLASSES.expandable).replaceClass(CLASSES.last,CLASSES.lastExpandable);this.not(":has(>ul:hidden)").addClass(CLASSES.collapsable).replaceClass(CLASSES.last,CLASSES.lastCollapsable);this.prepend("<div class=\""+CLASSES.hitarea+"\"/>").find("div."+CLASSES.hitarea).each(function(){var classes="";$.each($(this).parent().attr("class").split(" "),function(){classes+=this+"-hitarea ";});$(this).addClass(classes);});}
this.find("div."+CLASSES.hitarea).click(toggler);},treeview:function(settings){settings=$.extend({cookieId:"treeview"},settings);if(settings.add){return this.trigger("add",[settings.add]);}
if(settings.toggle){var callback=settings.toggle;settings.toggle=function(){return callback.apply($(this).parent()[0],arguments);};}
function treeController(tree,control){function handler(filter){return function(){toggler.apply($("div."+CLASSES.hitarea,tree).filter(function(){return filter?$(this).parent("."+filter).length:true;}));return false;};}
$("a:eq(0)",control).click(handler(CLASSES.collapsable));$("a:eq(1)",control).click(handler(CLASSES.expandable));$("a:eq(2)",control).click(handler());}
function toggler(){$(this).parent().find(">.hitarea").swapClass(CLASSES.collapsableHitarea,CLASSES.expandableHitarea).swapClass(CLASSES.lastCollapsableHitarea,CLASSES.lastExpandableHitarea).end().swapClass(CLASSES.collapsable,CLASSES.expandable).swapClass(CLASSES.lastCollapsable,CLASSES.lastExpandable).find(">ul").heightToggle(settings.animated,settings.toggle);if(settings.unique){$(this).parent().siblings().find(">.hitarea").replaceClass(CLASSES.collapsableHitarea,CLASSES.expandableHitarea).replaceClass(CLASSES.lastCollapsableHitarea,CLASSES.lastExpandableHitarea).end().replaceClass(CLASSES.collapsable,CLASSES.expandable).replaceClass(CLASSES.lastCollapsable,CLASSES.lastExpandable).find(">ul").heightHide(settings.animated,settings.toggle);}}
function serialize(){function binary(arg){return arg?1:0;}
var data=[];branches.each(function(i,e){data[i]=$(e).is(":has(>ul:visible)")?1:0;});$.cookie(settings.cookieId,data.join(""));}
function deserialize(){var stored=$.cookie(settings.cookieId);if(stored){var data=stored.split("");branches.each(function(i,e){$(e).find(">ul")[parseInt(data[i])?"show":"hide"]();});}}
this.addClass("treeview");var branches=this.find("li").prepareBranches(settings);switch(settings.persist){case"cookie":var toggleCallback=settings.toggle;settings.toggle=function(){serialize();if(toggleCallback){toggleCallback.apply(this,arguments);}};deserialize();break;case"location":var current=this.find("a").filter(function(){return this.href.toLowerCase()==location.href.toLowerCase();});if(current.length){current.addClass("selected").parents("ul, li").add(current.next()).show();}
break;}
branches.applyClasses(settings,toggler);if(settings.control){treeController(this,settings.control);$(settings.control).show();}
return this.bind("add",function(event,branches){$(branches).prev().removeClass(CLASSES.last).removeClass(CLASSES.lastCollapsable).removeClass(CLASSES.lastExpandable).find(">.hitarea").removeClass(CLASSES.lastCollapsableHitarea).removeClass(CLASSES.lastExpandableHitarea);$(branches).find("li").andSelf().prepareBranches(settings).applyClasses(settings,toggler);});}});var CLASSES=$.fn.treeview.classes={open:"open",closed:"closed",expandable:"expandable",expandableHitarea:"expandable-hitarea",lastExpandableHitarea:"lastExpandable-hitarea",collapsable:"collapsable",collapsableHitarea:"collapsable-hitarea",lastCollapsableHitarea:"lastCollapsable-hitarea",lastCollapsable:"lastCollapsable",lastExpandable:"lastExpandable",last:"last",hitarea:"hitarea"};$.fn.Treeview=$.fn.treeview;})(jQuery);Date.dayNames=['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'];Date.abbrDayNames=['Sun','Mon','Tue','Wed','Thu','Fri','Sat'];Date.monthNames=['January','February','March','April','May','June','July','August','September','October','November','December'];Date.abbrMonthNames=['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];Date.firstDayOfWeek=0;Date.format='dd/mm/yyyy';Date.fullYearStart='20';(function(){function add(name,method){if(!Date.prototype[name]){Date.prototype[name]=method;}};add("isLeapYear",function(){var y=this.getFullYear();return(y%4==0&&y%100!=0)||y%400==0;});add("isWeekend",function(){return this.getDay()==0||this.getDay()==6;});add("isWeekDay",function(){return!this.isWeekend();});add("getDaysInMonth",function(){return[31,(this.isLeapYear()?29:28),31,30,31,30,31,31,30,31,30,31][this.getMonth()];});add("getDayName",function(abbreviated){return abbreviated?Date.abbrDayNames[this.getDay()]:Date.dayNames[this.getDay()];});add("getMonthName",function(abbreviated){return abbreviated?Date.abbrMonthNames[this.getMonth()]:Date.monthNames[this.getMonth()];});add("getDayOfYear",function(){var tmpdtm=new Date("1/1/"+this.getFullYear());return Math.floor((this.getTime()-tmpdtm.getTime())/86400000);});add("getWeekOfYear",function(){return Math.ceil(this.getDayOfYear()/7);});add("setDayOfYear",function(day){this.setMonth(0);this.setDate(day);return this;});add("addYears",function(num){this.setFullYear(this.getFullYear()+num);return this;});add("addMonths",function(num){var tmpdtm=this.getDate();this.setMonth(this.getMonth()+num);if(tmpdtm>this.getDate())
this.addDays(-this.getDate());return this;});add("addDays",function(num){this.setTime(this.getTime()+(num*86400000));return this;});add("addHours",function(num){this.setHours(this.getHours()+num);return this;});add("addMinutes",function(num){this.setMinutes(this.getMinutes()+num);return this;});add("addSeconds",function(num){this.setSeconds(this.getSeconds()+num);return this;});add("zeroTime",function(){this.setMilliseconds(0);this.setSeconds(0);this.setMinutes(0);this.setHours(0);return this;});add("asString",function(format){var r=format||Date.format;return r.split('yyyy').join(this.getFullYear()).split('yy').join((this.getFullYear()+'').substring(2)).split('mmmm').join(this.getMonthName(false)).split('mmm').join(this.getMonthName(true)).split('mm').join(_zeroPad(this.getMonth()+1)).split('dd').join(_zeroPad(this.getDate()));});Date.fromString=function(s)
{var f=Date.format;var d=new Date('01/01/1977');var mLength=0;var iM=f.indexOf('mmmm');if(iM>-1){for(var i=0;i<Date.monthNames.length;i++){var mStr=s.substr(iM,Date.monthNames[i].length);if(Date.monthNames[i]==mStr){mLength=Date.monthNames[i].length-4;break;}}
d.setMonth(i);}else{iM=f.indexOf('mmm');if(iM>-1){var mStr=s.substr(iM,3);for(var i=0;i<Date.abbrMonthNames.length;i++){if(Date.abbrMonthNames[i]==mStr)break;}
d.setMonth(i);}else{d.setMonth(Number(s.substr(f.indexOf('mm'),2))-1);}}
var iY=f.indexOf('yyyy');if(iY>-1){if(iM<iY)
{iY+=mLength;}
d.setFullYear(Number(s.substr(iY,4)));}else{if(iM<iY)
{iY+=mLength;}
d.setFullYear(Number(Date.fullYearStart+s.substr(f.indexOf('yy'),2)));}
var iD=f.indexOf('dd');if(iM<iD)
{iD+=mLength;}
d.setDate(Number(s.substr(iD,2)));if(isNaN(d.getTime())){return false;}
return d;};var _zeroPad=function(num){var s='0'+num;return s.substring(s.length-2)};})();(function($){$.fn.extend({renderCalendar:function(s)
{var dc=function(a)
{return document.createElement(a);};s=$.extend({},$.fn.datePicker.defaults,s);if(s.showHeader!=$.dpConst.SHOW_HEADER_NONE){var headRow=$(dc('tr'));for(var i=Date.firstDayOfWeek;i<Date.firstDayOfWeek+7;i++){var weekday=i%7;var day=Date.dayNames[weekday];headRow.append(jQuery(dc('th')).attr({'scope':'col','abbr':day,'title':day,'class':(weekday==0||weekday==6?'weekend':'weekday')}).html(s.showHeader==$.dpConst.SHOW_HEADER_SHORT?day.substr(0,1):day));}};var calendarTable=$(dc('table')).attr({'cellspacing':2}).addClass('jCalendar').append((s.showHeader!=$.dpConst.SHOW_HEADER_NONE?$(dc('thead')).append(headRow):dc('thead')));var tbody=$(dc('tbody'));var today=(new Date()).zeroTime();var month=s.month==undefined?today.getMonth():s.month;var year=s.year||today.getFullYear();var currentDate=new Date(year,month,1);var firstDayOffset=Date.firstDayOfWeek-currentDate.getDay()+1;if(firstDayOffset>1)firstDayOffset-=7;var weeksToDraw=6;currentDate.addDays(firstDayOffset-1);var doHover=function(firstDayInBounds)
{return function()
{if(s.hoverClass){var $this=$(this);if(!s.selectWeek){if(!$this.is('.disabled')){$this.css("border","2px solid #fff");}}else if(firstDayInBounds&&!$this.is('.disabled')){}}}};var unHover=function()
{if(s.hoverClass){var $this=$(this);if($this.hasClass("disabled"))
$this.css("border","2px solid #777");else
if($this.hasClass("today"))
$this.css("border","2px solid #f00");else
if(($this.text()==cDay)&&(currentDate.getMonth()==cMonth))
$this.css("border","2px solid #ff0");else
$this.css("border","2px solid #ccc");$this.parent().removeClass('activeWeekHover');}};var w=0;while(w++<weeksToDraw){var r=jQuery(dc('tr'));var firstDayInBounds=s.dpController?currentDate>s.dpController.startDate:false;for(var i=0;i<7;i++){var thisMonth=currentDate.getMonth()==month;var d=$(dc('td')).text(currentDate.getDate()+'').addClass((thisMonth?'current-month ':'other-month ')+
(currentDate.isWeekend()?'weekend ':'weekday ')+
(thisMonth&&currentDate.getTime()==today.getTime()?'today ':'')).data('datePickerDate',currentDate.asString()).hover(doHover(firstDayInBounds),unHover);r.append(d);if(s.renderCallback){s.renderCallback(d,currentDate,month,year);}
currentDate.addDays(1);}
tbody.append(r);}
calendarTable.append(tbody);return this.each(function()
{$(this).empty().append(calendarTable);});},datePicker:function(s)
{if(!$.event._dpCache)$.event._dpCache=[];s=$.extend({},$.fn.datePicker.defaults,s);return this.each(function()
{var $this=$(this);var alreadyExists=true;if(!this._dpId){this._dpId=$.event.guid++;$.event._dpCache[this._dpId]=new DatePicker(this);alreadyExists=false;}
if(s.inline){s.createButton=false;s.displayClose=false;s.closeOnSelect=false;$this.empty();}
var controller=$.event._dpCache[this._dpId];controller.init(s);if(!alreadyExists&&s.createButton){controller.button=$('<a href="#" class="dp-choose-date" title="'+$.dpText.TEXT_CHOOSE_DATE+'">'+$.dpText.TEXT_CHOOSE_DATE+'</a>').bind('click',function()
{$this.dpDisplay(this);this.blur();return false;});$this.after(controller.button);}
if(!alreadyExists&&$this.is(':text')){$this.bind('dateSelected',function(e,selectedDate,$td)
{this.value=selectedDate.asString();}).bind('change',function()
{if(this.value==''){controller.clearSelected();}else{var d=Date.fromString(this.value);if(d){controller.setSelected(d,true,true);}}});if(s.clickInput){$this.bind('click',function()
{$this.trigger('change');$this.dpDisplay();});}
var d=Date.fromString(this.value);if(this.value!=''&&d){controller.setSelected(d,true,true);}}
$this.addClass('dp-applied');})},dpSetDisabled:function(s)
{return _w.call(this,'setDisabled',s);},dpSetStartDate:function(d)
{return _w.call(this,'setStartDate',d);},dpSetEndDate:function(d)
{return _w.call(this,'setEndDate',d);},dpGetSelected:function()
{var c=_getController(this[0]);if(c){return c.getSelected();}
return null;},dpSetSelected:function(d,v,m,e)
{if(v==undefined)v=true;if(m==undefined)m=true;if(e==undefined)e=true;return _w.call(this,'setSelected',Date.fromString(d),v,m,e);},dpSetDisplayedMonth:function(m,y)
{return _w.call(this,'setDisplayedMonth',Number(m),Number(y),true);},dpDisplay:function(e)
{return _w.call(this,'display',e);},dpSetChangeCallback:function(a)
{return _w.call(this,'setChangeCallback',a);},dpSetRenderCallback:function(a)
{return _w.call(this,'setRenderCallback',a);},dpSetPosition:function(v,h)
{return _w.call(this,'setPosition',v,h);},dpSetOffset:function(v,h)
{return _w.call(this,'setOffset',v,h);},dpClose:function()
{return _w.call(this,'_closeCalendar',false,this[0]);},_dpDestroy:function()
{}});var _w=function(f,a1,a2,a3,a4)
{return this.each(function()
{var c=_getController(this);if(c){c[f](a1,a2,a3,a4);}});};function DatePicker(ele)
{this.ele=ele;this.cMonth=null;this.cYear=null;this.displayedMonth=null;this.displayedYear=null;this.startDate=null;this.endDate=null;this.showYearNavigation=null;this.closeOnSelect=null;this.displayClose=null;this.rememberViewedMonth=null;this.selectMultiple=null;this.numSelectable=null;this.numSelected=null;this.verticalPosition=null;this.horizontalPosition=null;this.verticalOffset=null;this.horizontalOffset=null;this.button=null;this.renderCallback=[];this.changeCallback=null;this.selectedDates={};this.inline=null;this.context='#dp-popup';this.settings={};};$.extend(DatePicker.prototype,{init:function(s)
{this.setStartDate(s.startDate);this.setEndDate(s.endDate);this.cMonth=s.month;this.cYear=s.year;this.setDisplayedMonth(Number(s.month),Number(s.year));this.setRenderCallback(s.renderCallback);this.showYearNavigation=s.showYearNavigation;this.closeOnSelect=s.closeOnSelect;this.displayClose=s.displayClose;this.rememberViewedMonth=s.rememberViewedMonth;this.selectMultiple=s.selectMultiple;this.numSelectable=s.selectMultiple?s.numSelectable:1;this.numSelected=0;this.verticalPosition=s.verticalPosition;this.horizontalPosition=s.horizontalPosition;this.hoverClass=s.hoverClass;this.setOffset(s.verticalOffset,s.horizontalOffset);this.inline=s.inline;this.settings=s;if(this.inline){this.context=this.ele;this.display();}},setStartDate:function(d)
{if(d){this.startDate=Date.fromString(d);}
if(!this.startDate){this.startDate=(new Date()).zeroTime();}
this.setDisplayedMonth(this.displayedMonth,this.displayedYear);},setEndDate:function(d)
{if(d){this.endDate=Date.fromString(d);}
if(!this.endDate){this.endDate=(new Date('12/31/2999'));}
if(this.endDate.getTime()<this.startDate.getTime()){this.endDate=this.startDate;}
this.setDisplayedMonth(this.displayedMonth,this.displayedYear);},setPosition:function(v,h)
{this.verticalPosition=v;this.horizontalPosition=h;},setOffset:function(v,h)
{this.verticalOffset=parseInt(v)||0;this.horizontalOffset=parseInt(h)||0;},setDisabled:function(s)
{$e=$(this.ele);$e[s?'addClass':'removeClass']('dp-disabled');if(this.button){$but=$(this.button);$but[s?'addClass':'removeClass']('dp-disabled');$but.attr('title',s?'':$.dpText.TEXT_CHOOSE_DATE);}
if($e.is(':text')){$e.attr('disabled',s?'disabled':'');}},setDisplayedMonth:function(m,y,rerender)
{if(this.startDate==undefined||this.endDate==undefined){return;}
var s=new Date(this.startDate.getTime());s.setDate(1);var e=new Date(this.endDate.getTime());e.setDate(1);var t;if((!m&&!y)||(isNaN(m)&&isNaN(y))){t=new Date().zeroTime();t.setDate(1);}else if(isNaN(m)){t=new Date(y,this.displayedMonth,1);}else if(isNaN(y)){t=new Date(this.displayedYear,m,1);}else{t=new Date(y,m,1)}
if(t.getTime()<s.getTime()){t=s;}else if(t.getTime()>e.getTime()){t=e;}
var oldMonth=this.displayedMonth;var oldYear=this.displayedYear;this.displayedMonth=t.getMonth();this.displayedYear=t.getFullYear();if(rerender&&(this.displayedMonth!=oldMonth||this.displayedYear!=oldYear))
{this._rerenderCalendar();$(this.ele).trigger('dpMonthChanged',[this.displayedMonth,this.displayedYear]);}},setSelected:function(d,v,moveToMonth,dispatchEvents)
{if(d<this.startDate||d>this.endDate){return;}
var s=this.settings;if(s.selectWeek)
{d=d.addDays(-(d.getDay()-Date.firstDayOfWeek+7)%7);if(d<this.startDate)
{return;}}
if(moveToMonth&&(this.displayedMonth!=d.getMonth()||this.displayedYear!=d.getFullYear())){this.setDisplayedMonth(d.getMonth(),d.getFullYear(),true);}
this.selectedDates[d.toString()]=v;this.numSelected+=v?1:-1;var selectorString='td.'+(d.getMonth()==this.displayedMonth?'current-month':'other-month');var $td;$(selectorString,this.context).each(function()
{if($(this).data('datePickerDate')==d.asString()){$td=$(this);if(s.selectWeek)
{$td.parent()[v?'addClass':'removeClass']('selectedWeek');};$td[v?'addClass':'removeClass']('selected');}});$('td',this.context).not('.selected')[this.selectMultiple&&this.numSelected==this.numSelectable?'addClass':'removeClass']('unselectable');if(dispatchEvents)
{var s=this.isSelected(d);$e=$(this.ele);var dClone=Date.fromString(d.asString());if((typeof c$td)!='undefined'){if(c$td.hasClass("disabled"))
c$td.css("border","2px solid #777");else
if(c$td.hasClass("today"))
c$td.css("border","2px solid #f00");else
c$td.css("border","2px solid #ccc");}
$e.trigger('dateSelected',[dClone,$td,s]);$e.trigger('change');}},isSelected:function(d)
{return this.selectedDates[d.toString()];},getSelected:function()
{var r=[];for(s in this.selectedDates){if(this.selectedDates[s]==true){r.push(Date.parse(s));}}
return r;},clearSelected:function()
{this.selectedDates={};this.numSelected=0;$('td.selected',this.context).removeClass('selected').parent().removeClass('selectedWeek');},display:function(eleAlignTo)
{if($(this.ele).is('.dp-disabled'))return;eleAlignTo=eleAlignTo||this.ele;var c=this;var $ele=$(eleAlignTo);var eleOffset=$ele.offset();var $createIn;var attrs;var attrsCalendarHolder;var cssRules;if(c.inline){$createIn=$(this.ele);attrs={'id':'calendar-'+this.ele._dpId,'class':'dp-popup dp-popup-inline'};$('.dp-popup',$createIn).remove();cssRules={};}else{$createIn=$('body');attrs={'id':'dp-popup','class':'dp-popup'};cssRules={'top':eleOffset.top+c.verticalOffset,'left':eleOffset.left+c.horizontalOffset};var _checkMouse=function(e)
{var el=e.target;var cal=$('#dp-popup')[0];while(true){if(el==cal){return true;}else if(el==document){c._closeCalendar();return false;}else{el=$(el).parent()[0];}}};this._checkMouse=_checkMouse;c._closeCalendar(true);$(document).bind('keydown.datepicker',function(event)
{if(event.keyCode==27){c._closeCalendar();}});}
if(!c.rememberViewedMonth)
{var selectedDate=this.getSelected()[0];if(selectedDate){selectedDate=new Date(selectedDate);this.setDisplayedMonth(selectedDate.getMonth(),selectedDate.getFullYear(),false);}}
$createIn.append($('<div></div>').attr(attrs).css(cssRules).append($('<h2></h2>'),$('<div class="dp-nav-prev"></div>').append($('<a class="dp-nav-prev-year" style="padding:1px;" href="#" title="'+$.dpText.TEXT_PREV_YEAR+'">&lt;&lt;</a>').bind('click',function()
{return c._displayNewMonth.call(c,this,0,-1);}),$('<a class="dp-nav-prev-month" style="padding:1px 12px;" href="#" title="'+$.dpText.TEXT_PREV_MONTH+'">&lt;</a>').bind('click',function()
{return c._displayNewMonth.call(c,this,-1,0);})),$('<div class="dp-nav-next"></div>').append($('<a class="dp-nav-next-year" href="#" style="padding:1px;" title="'+$.dpText.TEXT_NEXT_YEAR+'">&gt;&gt;</a>').bind('click',function()
{return c._displayNewMonth.call(c,this,0,1);}),$('<a class="dp-nav-next-month" href="#" style="padding:1px 12px;" title="'+$.dpText.TEXT_NEXT_MONTH+'">&gt;</a>').bind('click',function()
{return c._displayNewMonth.call(c,this,1,0);})),$('<div class="dp-calendar"></div>')).bgIframe());var $pop=this.inline?$('.dp-popup',this.context):$('#dp-popup');if(this.showYearNavigation==false){$('.dp-nav-prev-year, .dp-nav-next-year',c.context).css('display','none');}
if(this.displayClose){$pop.append($('<a href="#" id="dp-close">'+$.dpText.TEXT_CLOSE+'</a>').bind('click',function()
{c._closeCalendar();return false;}));}
c._renderCalendar();$(this.ele).trigger('dpDisplayed',$pop);if(!c.inline){if(this.verticalPosition==$.dpConst.POS_BOTTOM){$pop.css('top',eleOffset.top+$ele.height()-$pop.height()+c.verticalOffset);}
if(this.horizontalPosition==$.dpConst.POS_RIGHT){$pop.css('left',eleOffset.left+$ele.width()-$pop.width()+c.horizontalOffset);}
$(document).bind('mousedown.datepicker',this._checkMouse);}},setChangeCallback:function(a)
{if(a==null)return;if(a&&typeof(a)=='function'){this.changeCallback=a;}},setRenderCallback:function(a)
{if(a==null)return;if(a&&typeof(a)=='function'){a=[a];}
this.renderCallback=this.renderCallback.concat(a);},cellRender:function($td,thisDate,month,year){var c=this.dpController;var d=new Date(thisDate.getTime());$td.bind('click',function()
{var $this=$(this);if(!$this.is('.disabled')){if($this.is('.selected'))
c.setSelected(d,true,false,true);if(c.closeOnSelect){c._closeCalendar();}
if(!$.browser.msie)
{$(c.ele).trigger('focus',[$.dpConst.DP_INTERNAL_FOCUS]);}}});if(c.isSelected(d)){$td.addClass('selected');if(c.settings.selectWeek)
{$td.parent().addClass('selectedWeek');}}else if(c.selectMultiple&&c.numSelected==c.numSelectable){$td.addClass('unselectable');}},_applyRenderCallbacks:function()
{var c=this;$('td',this.context).each(function()
{for(var i=0;i<c.renderCallback.length;i++){$td=$(this);c.renderCallback[i].apply(this,[$td,Date.fromString($td.data('datePickerDate')),c.displayedMonth,c.displayedYear]);}});return;},_displayNewMonth:function(ele,m,y)
{if(this.changeCallback){this.changeCallback(this,this.cMonth+m,this.cYear+y);};if(!$(ele).is('.disabled')){this.setDisplayedMonth(this.displayedMonth+m,this.displayedYear+y,true);}
ele.blur();return false;},_rerenderCalendar:function()
{this._clearCalendar();this._renderCalendar();},_renderCalendar:function()
{$('h2',this.context).html((new Date(this.displayedYear,this.displayedMonth,1)).asString($.dpText.HEADER_FORMAT));this.cMonth=this.displayedMonth+1;this.cYear=this.displayedYear;$('.dp-calendar',this.context).renderCalendar($.extend({},this.settings,{month:this.displayedMonth,year:this.displayedYear,renderCallback:this.cellRender,dpController:this,hoverClass:this.hoverClass}));if(this.displayedYear==this.startDate.getFullYear()&&this.displayedMonth==this.startDate.getMonth()){$('.dp-nav-prev-year',this.context).addClass('disabled');$('.dp-nav-prev-month',this.context).addClass('disabled');$('.dp-calendar td.other-month',this.context).each(function()
{var $this=$(this);if(Number($this.text())>20){$this.addClass('disabled');}});var d=this.startDate.getDate();$('.dp-calendar td.current-month',this.context).each(function()
{var $this=$(this);if(Number($this.text())<d){$this.addClass('disabled');}});}else{$('.dp-nav-prev-year',this.context).removeClass('disabled');$('.dp-nav-prev-month',this.context).removeClass('disabled');var d=this.startDate.getDate();if(d>20){var st=this.startDate.getTime();var sd=new Date(st);sd.addMonths(1);if(this.displayedYear==sd.getFullYear()&&this.displayedMonth==sd.getMonth()){$('.dp-calendar td.other-month',this.context).each(function()
{var $this=$(this);if(Date.fromString($this.data('datePickerDate')).getTime()<st){$this.addClass('disabled');}});}}}
if(this.displayedYear==this.endDate.getFullYear()&&this.displayedMonth==this.endDate.getMonth()){$('.dp-nav-next-year',this.context).addClass('disabled');$('.dp-nav-next-month',this.context).addClass('disabled');$('.dp-calendar td.other-month',this.context).each(function()
{var $this=$(this);if(Number($this.text())<14){$this.addClass('disabled');}});var d=this.endDate.getDate();$('.dp-calendar td.current-month',this.context).each(function()
{var $this=$(this);if(Number($this.text())>d){$this.addClass('disabled');}});}else{$('.dp-nav-next-year',this.context).removeClass('disabled');$('.dp-nav-next-month',this.context).removeClass('disabled');var d=this.endDate.getDate();if(d<13){var ed=new Date(this.endDate.getTime());ed.addMonths(-1);if(this.displayedYear==ed.getFullYear()&&this.displayedMonth==ed.getMonth()){$('.dp-calendar td.other-month',this.context).each(function()
{var $this=$(this);if(Number($this.text())>d){$this.addClass('disabled');}});}}}
this._applyRenderCallbacks();},_closeCalendar:function(programatic,ele)
{if(!ele||ele==this.ele)
{$(document).unbind('mousedown.datepicker');$(document).unbind('keydown.datepicker');this._clearCalendar();$('#dp-popup a').unbind();$('#dp-popup').empty().remove();if(!programatic){$(this.ele).trigger('dpClosed',[this.getSelected()]);}}},_clearCalendar:function()
{$('.dp-calendar td',this.context).unbind();$('.dp-calendar',this.context).empty();}});$.dpConst={SHOW_HEADER_NONE:0,SHOW_HEADER_SHORT:1,SHOW_HEADER_LONG:2,POS_TOP:0,POS_BOTTOM:1,POS_LEFT:0,POS_RIGHT:1,DP_INTERNAL_FOCUS:'dpInternalFocusTrigger'};$.dpText={TEXT_PREV_YEAR:'Previous year',TEXT_PREV_MONTH:'Previous month',TEXT_NEXT_YEAR:'Next year',TEXT_NEXT_MONTH:'Next month',TEXT_CLOSE:'Close',TEXT_CHOOSE_DATE:'Choose date',HEADER_FORMAT:'mmmm yyyy'};$.dpVersion='$Id: all.js,v 1.1 2009/11/25 09:41:59 small2 Exp $';$.fn.datePicker.defaults={cMonth:undefined,cYear:undefined,month:undefined,year:undefined,showHeader:$.dpConst.SHOW_HEADER_SHORT,startDate:undefined,endDate:undefined,inline:false,renderCallback:null,createButton:true,showYearNavigation:true,closeOnSelect:true,displayClose:false,selectMultiple:true,numSelectable:Number.MAX_VALUE,clickInput:false,rememberViewedMonth:true,selectWeek:false,verticalPosition:$.dpConst.POS_TOP,horizontalPosition:$.dpConst.POS_LEFT,verticalOffset:0,horizontalOffset:0,hoverClass:'dp-hover'};function _getController(ele)
{if(ele._dpId)return $.event._dpCache[ele._dpId];return false;};if($.fn.bgIframe==undefined){$.fn.bgIframe=function(){return this;};};$(window).bind('unload',function(){var els=$.event._dpCache||[];for(var i in els){$(els[i].ele)._dpDestroy();}});})(jQuery);
