/*
 * jQuery JavaScript Library v1.3.2
 * http://jquery.com/
 *
 * Copyright (c) 2009 John Resig
 * Dual licensed under the MIT and GPL licenses.
 * http://docs.jquery.com/License
 *
 * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009)
 * Revision: 6246
 */
(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.isArray(selector)?selector:jQuery.makeArray(selector))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(num){return num===undefined?Array.prototype.slice.call(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,sort:[].sort,splice:[].splice,find:function(selector){if(this.length===1){var ret=this.pushStack([],"find",selector);ret.length=0;jQuery.find(selector,this[0],ret);return ret}else{return this.pushStack(jQuery.unique(jQuery.map(this,function(elem){return jQuery.find(selector,elem)})),"find",selector)}},clone:function(events){var ret=this.map(function(){if(!jQuery.support.noCloneEvent&&!jQuery.isXMLDoc(this)){var html=this.outerHTML;if(!html){var div=this.ownerDocument.createElement("div");div.appendChild(this.cloneNode(true));html=div.innerHTML}return jQuery.clean([html.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(events===true){var orig=this.find("*").andSelf(),i=0;ret.find("*").andSelf().each(function(){if(this.nodeName!==orig[i].nodeName){return }var events=jQuery.data(orig[i],"events");for(var type in events){for(var handler in events[type]){jQuery.event.add(this,type,events[type][handler],events[type][handler].data)}}i++})}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,closer=0;return this.map(function(){var cur=this;while(cur&&cur.ownerDocument){if(pos?pos.index(cur)>-1:jQuery(cur).is(selector)){jQuery.data(cur,"closest",closer);return cur}cur=cur.parentNode;closer++}})},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.replace(/ jQuery\d+="(?:\d+|null)"/g,""):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;if(first){for(var i=0,l=this.length;i<l;i++){callback.call(root(this[i],first),this.length>1||i>0?fragment.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){if(data&&/\S/.test(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,extra){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;if(extra==="border"){return }jQuery.each(which,function(){if(!extra){val-=parseFloat(jQuery.curCSS(elem,"padding"+this,true))||0}if(extra==="margin"){val+=parseFloat(jQuery.curCSS(elem,"margin"+this,true))||0}else{val-=parseFloat(jQuery.curCSS(elem,"border"+this+"Width",true))||0}})}if(elem.offsetWidth!==0){getWH()}else{jQuery.swap(elem,props,getWH)}return Math.max(0,Math.round(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=elem.replace(/^\s+/,"").substring(0,10).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 hasBody=/<tbody/i.test(elem),tbody=!tags.indexOf("<table")&&!hasBody?div.firstChild&&div.firstChild.childNodes:wrap[1]=="<table>"&&!hasBody?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(selector){var ret=[],insert=jQuery(selector);for(var i=0,l=insert.length;i<l;i++){var elems=(i>0?this.clone(true):this).get();jQuery.fn[original].apply(jQuery(insert[i]),elems);ret=ret.concat(elems)}return this.pushStack(ret,name,selector)}});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).children().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)})}});
/*
 * Sizzle CSS Selector Engine - v0.9.3
 *  Copyright 2009, The Dojo Foundation
 *  Released under the MIT, BSD, and GPL Licenses.
 *  More information: http://sizzlejs.com/
 */
(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);if(sortOrder){hasDuplicate=false;results.sort(sortOrder);if(hasDuplicate){for(var i=1;i<results.length;i++){if(results[i]===results[i-1]){results.splice(i--,1)}}}}}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,isXMLFilter=set&&set[0]&&isXML(set[0]);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,isXMLFilter);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}}}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,isXML){var isPartStr=typeof part==="string",isTag=isPartStr&&!/\W/.test(part),isPartStrNotTag=isPartStr&&!isTag;if(isTag&&!isXML){part=part.toUpperCase()}for(var i=0,l=checkSet.length,elem;i<l;i++){if((elem=checkSet[i])){while((elem=elem.previousSibling)&&elem.nodeType!==1){}checkSet[i]=isPartStrNotTag||elem&&elem.nodeName===part?elem||false:elem===part}}if(isPartStrNotTag){Sizzle.filter(part,checkSet,true)}},">":function(checkSet,part,isXML){var isPartStr=typeof part==="string";if(isPartStr&&!/\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]=isPartStr?elem.parentNode:elem.parentNode===part}}if(isPartStr){Sizzle.filter(part,checkSet,true)}}},"":function(checkSet,part,isXML){var doneName=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++,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"){var ret=[],results=context.getElementsByName(match[1]);for(var i=0,l=results.length;i<l;i++){if(results[i].getAttribute("name")===match[1]){ret.push(results[i])}}return ret.length===0?null:ret}},TAG:function(match,context){return context.getElementsByTagName(match[1])}},preFilter:{CLASS:function(match,curLoop,inplace,result,not,isXML){match=" "+match[1].replace(/\\/g,"")+" ";if(isXML){return match}for(var i=0,elem;(elem=curLoop[i])!=null;i++){if(elem){if(not^(elem.className&&(" "+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++;return match},ATTR:function(match,curLoop,inplace,result,not,isXML){var name=match[1].replace(/\\/g,"");if(!isXML&&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||/^\w/.test(match[3])){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])||Expr.match.CHILD.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:{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}}}},CHILD:function(elem,match){var type=match[1],node=elem;switch(type){case"only":case"first":while(node=node.previousSibling){if(node.nodeType===1){return false}}if(type=="first"){return true}node=elem;case"last":while(node=node.nextSibling){if(node.nodeType===1){return false}}return true;case"nth":var first=match[2],last=match[3];if(first==1&&last==0){return true}var doneName=match[0],parent=elem.parentNode;if(parent&&(parent.sizcache!==doneName||!elem.nodeIndex)){var count=0;for(node=parent.firstChild;node;node=node.nextSibling){if(node.nodeType===1){node.nodeIndex=++count}}parent.sizcache=doneName}var diff=elem.nodeIndex-last;if(first==0){return diff==0}else{return(diff%first==0&&diff/first>=0)}}},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(" "+(elem.className||elem.getAttribute("class"))+" ").indexOf(match)>-1},ATTR:function(elem,match){var name=match[1],result=Expr.attrHandle[name]?Expr.attrHandle[name](elem):elem[name]!=null?elem[name]:elem.getAttribute(name),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:!check?value&&result!==false: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}}var sortOrder;if(document.documentElement.compareDocumentPosition){sortOrder=function(a,b){var ret=a.compareDocumentPosition(b)&4?-1:a===b?0:1;if(ret===0){hasDuplicate=true}return ret}}else{if("sourceIndex" in document.documentElement){sortOrder=function(a,b){var ret=a.sourceIndex-b.sourceIndex;if(ret===0){hasDuplicate=true}return ret}}else{if(document.createRange){sortOrder=function(a,b){var aRange=a.ownerDocument.createRange(),bRange=b.ownerDocument.createRange();aRange.selectNode(a);aRange.collapse(true);bRange.selectNode(b);bRange.collapse(true);var ret=aRange.compareBoundaryPoints(Range.START_TO_END,bRange);if(ret===0){hasDuplicate=true}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&&typeof div.firstChild.getAttribute!=="undefined"&&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){(function(){var div=document.createElement("div");div.innerHTML="<div class='test e'></div><div class='test'></div>";if(div.getElementsByClassName("e").length===0){return }div.lastChild.className="e";if(div.getElementsByClassName("e").length===1){return }Expr.order.splice(1,0,"CLASS");Expr.find.CLASS=function(match,context,isXML){if(typeof context.getElementsByClassName!=="undefined"&&!isXML){return context.getElementsByClassName(match[1])}}})()}function dirNodeCheck(dir,cur,doneName,checkSet,nodeCheck,isXML){var sibDir=dir=="previousSibling"&&!isXML;for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){if(sibDir&&elem.nodeType===1){elem.sizcache=doneName;elem.sizset=i}elem=elem[dir];var match=false;while(elem){if(elem.sizcache===doneName){match=checkSet[elem.sizset];break}if(elem.nodeType===1&&!isXML){elem.sizcache=doneName;elem.sizset=i}if(elem.nodeName===cur){match=elem;break}elem=elem[dir]}checkSet[i]=match}}}function dirCheck(dir,cur,doneName,checkSet,nodeCheck,isXML){var sibDir=dir=="previousSibling"&&!isXML;for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){if(sibDir&&elem.nodeType===1){elem.sizcache=doneName;elem.sizset=i}elem=elem[dir];var match=false;while(elem){if(elem.sizcache===doneName){match=checkSet[elem.sizset];break}if(elem.nodeType===1){if(!isXML){elem.sizcache=doneName;elem.sizset=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 elem.offsetWidth===0||elem.offsetHeight===0};Sizzle.selectors.filters.visible=function(elem){return elem.offsetWidth>0||elem.offsetHeight>0};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);event.currentTarget=this;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})}}});elems.sort(function(a,b){return jQuery.data(a.elem,"closest")-jQuery.data(b.elem,"closest")});jQuery.each(elems,function(){if(this.fn.call(this.elem,event,this.fn.data)===false){return(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&&window==window.top){(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=div.style.paddingLeft="1px";document.body.appendChild(div);jQuery.boxModel=jQuery.support.boxModel=div.offsetWidth===2;document.body.removeChild(div).style.display="none"})})();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|search/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();script.onload=script.onreadystatechange=null;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}jQuery.data(this[i],"olddisplay",display)}}for(var i=0,l=this.length;i<l;i++){this[i].style.display=jQuery.data(this[i],"olddisplay")||""}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"))}}for(var i=0,l=this.length;i<l;i++){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)&&!timerId){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);timerId=undefined}},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",lower=name.toLowerCase();jQuery.fn["inner"+name]=function(){return this[0]?jQuery.css(this[0],lower,false,"padding"):null};jQuery.fn["outer"+name]=function(margin){return this[0]?jQuery.css(this[0],lower,false,margin?"margin":"border"):null};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")}})})();jQuery.ui||(function(C){var I=C.fn.remove,D=C.browser.mozilla&&(parseFloat(C.browser.version)<1.9);C.ui={version:"1.7.2",plugin:{add:function(K,L,N){var M=C.ui[K].prototype;for(var J in N){M.plugins[J]=M.plugins[J]||[];M.plugins[J].push([L,N[J]])}},call:function(J,L,K){var N=J.plugins[L];if(!N||!J.element[0].parentNode){return }for(var M=0;M<N.length;M++){if(J.options[N[M][0]]){N[M][1].apply(J.element,K)}}}},contains:function(K,J){return document.compareDocumentPosition?K.compareDocumentPosition(J)&16:K!==J&&K.contains(J)},hasScroll:function(M,K){if(C(M).css("overflow")=="hidden"){return false}var J=(K&&K=="left")?"scrollLeft":"scrollTop",L=false;if(M[J]>0){return true}M[J]=1;L=(M[J]>0);M[J]=0;return L},isOverAxis:function(K,J,L){return(K>J)&&(K<(J+L))},isOver:function(O,K,N,M,J,L){return C.ui.isOverAxis(O,N,J)&&C.ui.isOverAxis(K,M,L)},keyCode:{BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}};if(D){var F=C.attr,E=C.fn.removeAttr,H="http://www.w3.org/2005/07/aaa",A=/^aria-/,B=/^wairole:/;C.attr=function(K,J,L){var M=L!==undefined;return(J=="role"?(M?F.call(this,K,J,"wairole:"+L):(F.apply(this,arguments)||"").replace(B,"")):(A.test(J)?(M?K.setAttributeNS(H,J.replace(A,"aaa:"),L):F.call(this,K,J.replace(A,"aaa:"))):F.apply(this,arguments)))};C.fn.removeAttr=function(J){return(A.test(J)?this.each(function(){this.removeAttributeNS(H,J.replace(A,""))}):E.call(this,J))}}C.fn.extend({remove:function(){C("*",this).add(this).each(function(){C(this).triggerHandler("remove")});return I.apply(this,arguments)},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","").unbind("selectstart.ui")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false})},scrollParent:function(){var J;if((C.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){J=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(C.curCSS(this,"position",1))&&(/(auto|scroll)/).test(C.curCSS(this,"overflow",1)+C.curCSS(this,"overflow-y",1)+C.curCSS(this,"overflow-x",1))}).eq(0)}else{J=this.parents().filter(function(){return(/(auto|scroll)/).test(C.curCSS(this,"overflow",1)+C.curCSS(this,"overflow-y",1)+C.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!J.length?C(document):J}});C.extend(C.expr[":"],{data:function(L,K,J){return !!C.data(L,J[3])},focusable:function(K){var L=K.nodeName.toLowerCase(),J=C.attr(K,"tabindex");return(/input|select|textarea|button|object/.test(L)?!K.disabled:"a"==L||"area"==L?K.href||!isNaN(J):!isNaN(J))&&!C(K)["area"==L?"parents":"closest"](":hidden").length},tabbable:function(K){var J=C.attr(K,"tabindex");return(isNaN(J)||J>=0)&&C(K).is(":focusable")}});function G(M,N,O,L){function K(Q){var P=C[M][N][Q]||[];return(typeof P=="string"?P.split(/,?\s+/):P)}var J=K("getter");if(L.length==1&&typeof L[0]=="string"){J=J.concat(K("getterSetter"))}return(C.inArray(O,J)!=-1)}C.widget=function(K,J){var L=K.split(".")[0];K=K.split(".")[1];C.fn[K]=function(P){var N=(typeof P=="string"),O=Array.prototype.slice.call(arguments,1);if(N&&P.substring(0,1)=="_"){return this}if(N&&G(L,K,P,O)){var M=C.data(this[0],K);return(M?M[P].apply(M,O):undefined)}return this.each(function(){var Q=C.data(this,K);(!Q&&!N&&C.data(this,K,new C[L][K](this,P))._init());(Q&&N&&C.isFunction(Q[P])&&Q[P].apply(Q,O))})};C[L]=C[L]||{};C[L][K]=function(O,N){var M=this;this.namespace=L;this.widgetName=K;this.widgetEventPrefix=C[L][K].eventPrefix||K;this.widgetBaseClass=L+"-"+K;this.options=C.extend({},C.widget.defaults,C[L][K].defaults,C.metadata&&C.metadata.get(O)[K],N);this.element=C(O).bind("setData."+K,function(Q,P,R){if(Q.target==O){return M._setData(P,R)}}).bind("getData."+K,function(Q,P){if(Q.target==O){return M._getData(P)}}).bind("remove",function(){return M.destroy()})};C[L][K].prototype=C.extend({},C.widget.prototype,J);C[L][K].getterSetter="option"};C.widget.prototype={_init:function(){},destroy:function(){this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").removeAttr("aria-disabled")},option:function(L,M){var K=L,J=this;if(typeof L=="string"){if(M===undefined){return this._getData(L)}K={};K[L]=M}C.each(K,function(N,O){J._setData(N,O)})},_getData:function(J){return this.options[J]},_setData:function(J,K){this.options[J]=K;if(J=="disabled"){this.element[K?"addClass":"removeClass"](this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").attr("aria-disabled",K)}},enable:function(){this._setData("disabled",false)},disable:function(){this._setData("disabled",true)},_trigger:function(L,M,N){var P=this.options[L],J=(L==this.widgetEventPrefix?L:this.widgetEventPrefix+L);M=C.Event(M);M.type=J;if(M.originalEvent){for(var K=C.event.props.length,O;K;){O=C.event.props[--K];M[O]=M.originalEvent[O]}}this.element.trigger(M,N);return !(C.isFunction(P)&&P.call(this.element[0],M,N)===false||M.isDefaultPrevented())}};C.widget.defaults={disabled:false};C.ui.mouse={_mouseInit:function(){var J=this;this.element.bind("mousedown."+this.widgetName,function(K){return J._mouseDown(K)}).bind("click."+this.widgetName,function(K){if(J._preventClickEvent){J._preventClickEvent=false;K.stopImmediatePropagation();return false}});if(C.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");this.element.attr("unselectable","on")}this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);(C.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable))},_mouseDown:function(L){L.originalEvent=L.originalEvent||{};if(L.originalEvent.mouseHandled){return }(this._mouseStarted&&this._mouseUp(L));this._mouseDownEvent=L;var K=this,M=(L.which==1),J=(typeof this.options.cancel=="string"?C(L.target).parents().add(L.target).filter(this.options.cancel).length:false);if(!M||J||!this._mouseCapture(L)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){K.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(L)&&this._mouseDelayMet(L)){this._mouseStarted=(this._mouseStart(L)!==false);if(!this._mouseStarted){L.preventDefault();return true}}this._mouseMoveDelegate=function(N){return K._mouseMove(N)};this._mouseUpDelegate=function(N){return K._mouseUp(N)};C(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);(C.browser.safari||L.preventDefault());L.originalEvent.mouseHandled=true;return true},_mouseMove:function(J){if(C.browser.msie&&!J.button){return this._mouseUp(J)}if(this._mouseStarted){this._mouseDrag(J);return J.preventDefault()}if(this._mouseDistanceMet(J)&&this._mouseDelayMet(J)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,J)!==false);(this._mouseStarted?this._mouseDrag(J):this._mouseUp(J))}return !this._mouseStarted},_mouseUp:function(J){C(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=(J.target==this._mouseDownEvent.target);this._mouseStop(J)}return false},_mouseDistanceMet:function(J){return(Math.max(Math.abs(this._mouseDownEvent.pageX-J.pageX),Math.abs(this._mouseDownEvent.pageY-J.pageY))>=this.options.distance)},_mouseDelayMet:function(J){return this.mouseDelayMet},_mouseStart:function(J){},_mouseDrag:function(J){},_mouseStop:function(J){},_mouseCapture:function(J){return true}};C.ui.mouse.defaults={cancel:null,distance:1,delay:0}})(jQuery);(function(A){A.widget("ui.draggable",A.extend({},A.ui.mouse,{_init:function(){if(this.options.helper=="original"&&!(/^(?:r|a|f)/).test(this.element.css("position"))){this.element[0].style.position="relative"}(this.options.addClasses&&this.element.addClass("ui-draggable"));(this.options.disabled&&this.element.addClass("ui-draggable-disabled"));this._mouseInit()},destroy:function(){if(!this.element.data("draggable")){return }this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy()},_mouseCapture:function(B){var C=this.options;if(this.helper||C.disabled||A(B.target).is(".ui-resizable-handle")){return false}this.handle=this._getHandle(B);if(!this.handle){return false}return true},_mouseStart:function(B){var C=this.options;this.helper=this._createHelper(B);this._cacheHelperProportions();if(A.ui.ddmanager){A.ui.ddmanager.current=this}this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};A.extend(this.offset,{click:{left:B.pageX-this.offset.left,top:B.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(B);this.originalPageX=B.pageX;this.originalPageY=B.pageY;if(C.cursorAt){this._adjustOffsetFromHelper(C.cursorAt)}if(C.containment){this._setContainment()}this._trigger("start",B);this._cacheHelperProportions();if(A.ui.ddmanager&&!C.dropBehaviour){A.ui.ddmanager.prepareOffsets(this,B)}this.helper.addClass("ui-draggable-dragging");this._mouseDrag(B,true);return true},_mouseDrag:function(B,D){this.position=this._generatePosition(B);this.positionAbs=this._convertPositionTo("absolute");if(!D){var C=this._uiHash();this._trigger("drag",B,C);this.position=C.position}if(!this.options.axis||this.options.axis!="y"){this.helper[0].style.left=this.position.left+"px"}if(!this.options.axis||this.options.axis!="x"){this.helper[0].style.top=this.position.top+"px"}if(A.ui.ddmanager){A.ui.ddmanager.drag(this,B)}return false},_mouseStop:function(C){var D=false;if(A.ui.ddmanager&&!this.options.dropBehaviour){D=A.ui.ddmanager.drop(this,C)}if(this.dropped){D=this.dropped;this.dropped=false}if((this.options.revert=="invalid"&&!D)||(this.options.revert=="valid"&&D)||this.options.revert===true||(A.isFunction(this.options.revert)&&this.options.revert.call(this.element,D))){var B=this;A(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){B._trigger("stop",C);B._clear()})}else{this._trigger("stop",C);this._clear()}return false},_getHandle:function(B){var C=!this.options.handle||!A(this.options.handle,this.element).length?true:false;A(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==B.target){C=true}});return C},_createHelper:function(C){var D=this.options;var B=A.isFunction(D.helper)?A(D.helper.apply(this.element[0],[C])):(D.helper=="clone"?this.element.clone():this.element);if(!B.parents("body").length){B.appendTo((D.appendTo=="parent"?this.element[0].parentNode:D.appendTo))}if(B[0]!=this.element[0]&&!(/(fixed|absolute)/).test(B.css("position"))){B.css("position","absolute")}return B},_adjustOffsetFromHelper:function(B){if(B.left!=undefined){this.offset.click.left=B.left+this.margins.left}if(B.right!=undefined){this.offset.click.left=this.helperProportions.width-B.right+this.margins.left}if(B.top!=undefined){this.offset.click.top=B.top+this.margins.top}if(B.bottom!=undefined){this.offset.click.top=this.helperProportions.height-B.bottom+this.margins.top}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var B=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&A.ui.contains(this.scrollParent[0],this.offsetParent[0])){B.left+=this.scrollParent.scrollLeft();B.top+=this.scrollParent.scrollTop()}if((this.offsetParent[0]==document.body)||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&A.browser.msie)){B={top:0,left:0}}return{top:B.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:B.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var B=this.element.position();return{top:B.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:B.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else{return{top:0,left:0}}},_cacheMargins:function(){this.margins={left:(parseInt(this.element.css("marginLeft"),10)||0),top:(parseInt(this.element.css("marginTop"),10)||0)}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var E=this.options;if(E.containment=="parent"){E.containment=this.helper[0].parentNode}if(E.containment=="document"||E.containment=="window"){this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,A(E.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(A(E.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]}if(!(/^(document|window|parent)$/).test(E.containment)&&E.containment.constructor!=Array){var C=A(E.containment)[0];if(!C){return }var D=A(E.containment).offset();var B=(A(C).css("overflow")!="hidden");this.containment=[D.left+(parseInt(A(C).css("borderLeftWidth"),10)||0)+(parseInt(A(C).css("paddingLeft"),10)||0)-this.margins.left,D.top+(parseInt(A(C).css("borderTopWidth"),10)||0)+(parseInt(A(C).css("paddingTop"),10)||0)-this.margins.top,D.left+(B?Math.max(C.scrollWidth,C.offsetWidth):C.offsetWidth)-(parseInt(A(C).css("borderLeftWidth"),10)||0)-(parseInt(A(C).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,D.top+(B?Math.max(C.scrollHeight,C.offsetHeight):C.offsetHeight)-(parseInt(A(C).css("borderTopWidth"),10)||0)-(parseInt(A(C).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}else{if(E.containment.constructor==Array){this.containment=E.containment}}},_convertPositionTo:function(E,G){if(!G){G=this.position}var C=E=="absolute"?1:-1;var D=this.options,B=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&A.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,F=(/(html|body)/i).test(B[0].tagName);return{top:(G.top+this.offset.relative.top*C+this.offset.parent.top*C-(A.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(F?0:B.scrollTop()))*C)),left:(G.left+this.offset.relative.left*C+this.offset.parent.left*C-(A.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():F?0:B.scrollLeft())*C))}},_generatePosition:function(E){var H=this.options,B=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&A.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,I=(/(html|body)/i).test(B[0].tagName);if(this.cssPosition=="relative"&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0])){this.offset.relative=this._getRelativeOffset()}var D=E.pageX;var C=E.pageY;if(this.originalPosition){if(this.containment){if(E.pageX-this.offset.click.left<this.containment[0]){D=this.containment[0]+this.offset.click.left}if(E.pageY-this.offset.click.top<this.containment[1]){C=this.containment[1]+this.offset.click.top}if(E.pageX-this.offset.click.left>this.containment[2]){D=this.containment[2]+this.offset.click.left}if(E.pageY-this.offset.click.top>this.containment[3]){C=this.containment[3]+this.offset.click.top}}if(H.grid){var G=this.originalPageY+Math.round((C-this.originalPageY)/H.grid[1])*H.grid[1];C=this.containment?(!(G-this.offset.click.top<this.containment[1]||G-this.offset.click.top>this.containment[3])?G:(!(G-this.offset.click.top<this.containment[1])?G-H.grid[1]:G+H.grid[1])):G;var F=this.originalPageX+Math.round((D-this.originalPageX)/H.grid[0])*H.grid[0];D=this.containment?(!(F-this.offset.click.left<this.containment[0]||F-this.offset.click.left>this.containment[2])?F:(!(F-this.offset.click.left<this.containment[0])?F-H.grid[0]:F+H.grid[0])):F}}return{top:(C-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(A.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(I?0:B.scrollTop())))),left:(D-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(A.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():I?0:B.scrollLeft())))}},_clear:function(){this.helper.removeClass("ui-draggable-dragging");if(this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval){this.helper.remove()}this.helper=null;this.cancelHelperRemoval=false},_trigger:function(B,C,D){D=D||this._uiHash();A.ui.plugin.call(this,B,[C,D]);if(B=="drag"){this.positionAbs=this._convertPositionTo("absolute")}return A.widget.prototype._trigger.call(this,B,C,D)},plugins:{},_uiHash:function(B){return{helper:this.helper,position:this.position,absolutePosition:this.positionAbs,offset:this.positionAbs}}}));A.extend(A.ui.draggable,{version:"1.7.2",eventPrefix:"drag",defaults:{addClasses:true,appendTo:"parent",axis:false,cancel:":input,option",connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,delay:0,distance:1,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false}});A.ui.plugin.add("draggable","connectToSortable",{start:function(C,E){var D=A(this).data("draggable"),F=D.options,B=A.extend({},E,{item:D.element});D.sortables=[];A(F.connectToSortable).each(function(){var G=A.data(this,"sortable");if(G&&!G.options.disabled){D.sortables.push({instance:G,shouldRevert:G.options.revert});G._refreshItems();G._trigger("activate",C,B)}})},stop:function(C,E){var D=A(this).data("draggable"),B=A.extend({},E,{item:D.element});A.each(D.sortables,function(){if(this.instance.isOver){this.instance.isOver=0;D.cancelHelperRemoval=true;this.instance.cancelHelperRemoval=false;if(this.shouldRevert){this.instance.options.revert=true}this.instance._mouseStop(C);this.instance.options.helper=this.instance.options._helper;if(D.options.helper=="original"){this.instance.currentItem.css({top:"auto",left:"auto"})}}else{this.instance.cancelHelperRemoval=false;this.instance._trigger("deactivate",C,B)}})},drag:function(C,F){var E=A(this).data("draggable"),B=this;var D=function(I){var N=this.offset.click.top,M=this.offset.click.left;var G=this.positionAbs.top,K=this.positionAbs.left;var J=I.height,L=I.width;var O=I.top,H=I.left;return A.ui.isOver(G+N,K+M,O,H,J,L)};A.each(E.sortables,function(G){this.instance.positionAbs=E.positionAbs;this.instance.helperProportions=E.helperProportions;this.instance.offset.click=E.offset.click;if(this.instance._intersectsWith(this.instance.containerCache)){if(!this.instance.isOver){this.instance.isOver=1;this.instance.currentItem=A(B).clone().appendTo(this.instance.element).data("sortable-item",true);this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return F.helper[0]};C.target=this.instance.currentItem[0];this.instance._mouseCapture(C,true);this.instance._mouseStart(C,true,true);this.instance.offset.click.top=E.offset.click.top;this.instance.offset.click.left=E.offset.click.left;this.instance.offset.parent.left-=E.offset.parent.left-this.instance.offset.parent.left;this.instance.offset.parent.top-=E.offset.parent.top-this.instance.offset.parent.top;E._trigger("toSortable",C);E.dropped=this.instance.element;E.currentItem=E.element;this.instance.fromOutside=E}if(this.instance.currentItem){this.instance._mouseDrag(C)}}else{if(this.instance.isOver){this.instance.isOver=0;this.instance.cancelHelperRemoval=true;this.instance.options.revert=false;this.instance._trigger("out",C,this.instance._uiHash(this.instance));this.instance._mouseStop(C,true);this.instance.options.helper=this.instance.options._helper;this.instance.currentItem.remove();if(this.instance.placeholder){this.instance.placeholder.remove()}E._trigger("fromSortable",C);E.dropped=false}}})}});A.ui.plugin.add("draggable","cursor",{start:function(C,D){var B=A("body"),E=A(this).data("draggable").options;if(B.css("cursor")){E._cursor=B.css("cursor")}B.css("cursor",E.cursor)},stop:function(B,C){var D=A(this).data("draggable").options;if(D._cursor){A("body").css("cursor",D._cursor)}}});A.ui.plugin.add("draggable","iframeFix",{start:function(B,C){var D=A(this).data("draggable").options;A(D.iframeFix===true?"iframe":D.iframeFix).each(function(){A('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1000}).css(A(this).offset()).appendTo("body")})},stop:function(B,C){A("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});A.ui.plugin.add("draggable","opacity",{start:function(C,D){var B=A(D.helper),E=A(this).data("draggable").options;if(B.css("opacity")){E._opacity=B.css("opacity")}B.css("opacity",E.opacity)},stop:function(B,C){var D=A(this).data("draggable").options;if(D._opacity){A(C.helper).css("opacity",D._opacity)}}});A.ui.plugin.add("draggable","scroll",{start:function(C,D){var B=A(this).data("draggable");if(B.scrollParent[0]!=document&&B.scrollParent[0].tagName!="HTML"){B.overflowOffset=B.scrollParent.offset()}},drag:function(D,E){var C=A(this).data("draggable"),F=C.options,B=false;if(C.scrollParent[0]!=document&&C.scrollParent[0].tagName!="HTML"){if(!F.axis||F.axis!="x"){if((C.overflowOffset.top+C.scrollParent[0].offsetHeight)-D.pageY<F.scrollSensitivity){C.scrollParent[0].scrollTop=B=C.scrollParent[0].scrollTop+F.scrollSpeed}else{if(D.pageY-C.overflowOffset.top<F.scrollSensitivity){C.scrollParent[0].scrollTop=B=C.scrollParent[0].scrollTop-F.scrollSpeed}}}if(!F.axis||F.axis!="y"){if((C.overflowOffset.left+C.scrollParent[0].offsetWidth)-D.pageX<F.scrollSensitivity){C.scrollParent[0].scrollLeft=B=C.scrollParent[0].scrollLeft+F.scrollSpeed}else{if(D.pageX-C.overflowOffset.left<F.scrollSensitivity){C.scrollParent[0].scrollLeft=B=C.scrollParent[0].scrollLeft-F.scrollSpeed}}}}else{if(!F.axis||F.axis!="x"){if(D.pageY-A(document).scrollTop()<F.scrollSensitivity){B=A(document).scrollTop(A(document).scrollTop()-F.scrollSpeed)}else{if(A(window).height()-(D.pageY-A(document).scrollTop())<F.scrollSensitivity){B=A(document).scrollTop(A(document).scrollTop()+F.scrollSpeed)}}}if(!F.axis||F.axis!="y"){if(D.pageX-A(document).scrollLeft()<F.scrollSensitivity){B=A(document).scrollLeft(A(document).scrollLeft()-F.scrollSpeed)}else{if(A(window).width()-(D.pageX-A(document).scrollLeft())<F.scrollSensitivity){B=A(document).scrollLeft(A(document).scrollLeft()+F.scrollSpeed)}}}}if(B!==false&&A.ui.ddmanager&&!F.dropBehaviour){A.ui.ddmanager.prepareOffsets(C,D)}}});A.ui.plugin.add("draggable","snap",{start:function(C,D){var B=A(this).data("draggable"),E=B.options;B.snapElements=[];A(E.snap.constructor!=String?(E.snap.items||":data(draggable)"):E.snap).each(function(){var G=A(this);var F=G.offset();if(this!=B.element[0]){B.snapElements.push({item:this,width:G.outerWidth(),height:G.outerHeight(),top:F.top,left:F.left})}})},drag:function(N,K){var E=A(this).data("draggable"),L=E.options;var R=L.snapTolerance;var Q=K.offset.left,P=Q+E.helperProportions.width,D=K.offset.top,C=D+E.helperProportions.height;for(var O=E.snapElements.length-1;O>=0;O--){var M=E.snapElements[O].left,J=M+E.snapElements[O].width,I=E.snapElements[O].top,T=I+E.snapElements[O].height;if(!((M-R<Q&&Q<J+R&&I-R<D&&D<T+R)||(M-R<Q&&Q<J+R&&I-R<C&&C<T+R)||(M-R<P&&P<J+R&&I-R<D&&D<T+R)||(M-R<P&&P<J+R&&I-R<C&&C<T+R))){if(E.snapElements[O].snapping){(E.options.snap.release&&E.options.snap.release.call(E.element,N,A.extend(E._uiHash(),{snapItem:E.snapElements[O].item})))}E.snapElements[O].snapping=false;continue}if(L.snapMode!="inner"){var B=Math.abs(I-C)<=R;var S=Math.abs(T-D)<=R;var G=Math.abs(M-P)<=R;var H=Math.abs(J-Q)<=R;if(B){K.position.top=E._convertPositionTo("relative",{top:I-E.helperProportions.height,left:0}).top-E.margins.top}if(S){K.position.top=E._convertPositionTo("relative",{top:T,left:0}).top-E.margins.top}if(G){K.position.left=E._convertPositionTo("relative",{top:0,left:M-E.helperProportions.width}).left-E.margins.left}if(H){K.position.left=E._convertPositionTo("relative",{top:0,left:J}).left-E.margins.left}}var F=(B||S||G||H);if(L.snapMode!="outer"){var B=Math.abs(I-D)<=R;var S=Math.abs(T-C)<=R;var G=Math.abs(M-Q)<=R;var H=Math.abs(J-P)<=R;if(B){K.position.top=E._convertPositionTo("relative",{top:I,left:0}).top-E.margins.top}if(S){K.position.top=E._convertPositionTo("relative",{top:T-E.helperProportions.height,left:0}).top-E.margins.top}if(G){K.position.left=E._convertPositionTo("relative",{top:0,left:M}).left-E.margins.left}if(H){K.position.left=E._convertPositionTo("relative",{top:0,left:J-E.helperProportions.width}).left-E.margins.left}}if(!E.snapElements[O].snapping&&(B||S||G||H||F)){(E.options.snap.snap&&E.options.snap.snap.call(E.element,N,A.extend(E._uiHash(),{snapItem:E.snapElements[O].item})))}E.snapElements[O].snapping=(B||S||G||H||F)}}});A.ui.plugin.add("draggable","stack",{start:function(B,C){var E=A(this).data("draggable").options;var D=A.makeArray(A(E.stack.group)).sort(function(G,F){return(parseInt(A(G).css("zIndex"),10)||E.stack.min)-(parseInt(A(F).css("zIndex"),10)||E.stack.min)});A(D).each(function(F){this.style.zIndex=E.stack.min+F});this[0].style.zIndex=E.stack.min+D.length}});A.ui.plugin.add("draggable","zIndex",{start:function(C,D){var B=A(D.helper),E=A(this).data("draggable").options;if(B.css("zIndex")){E._zIndex=B.css("zIndex")}B.css("zIndex",E.zIndex)},stop:function(B,C){var D=A(this).data("draggable").options;if(D._zIndex){A(C.helper).css("zIndex",D._zIndex)}}})})(jQuery);(function(A){A.widget("ui.droppable",{_init:function(){var C=this.options,B=C.accept;this.isover=0;this.isout=1;this.options.accept=this.options.accept&&A.isFunction(this.options.accept)?this.options.accept:function(D){return D.is(B)};this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight};A.ui.ddmanager.droppables[this.options.scope]=A.ui.ddmanager.droppables[this.options.scope]||[];A.ui.ddmanager.droppables[this.options.scope].push(this);(this.options.addClasses&&this.element.addClass("ui-droppable"))},destroy:function(){var B=A.ui.ddmanager.droppables[this.options.scope];for(var C=0;C<B.length;C++){if(B[C]==this){B.splice(C,1)}}this.element.removeClass("ui-droppable ui-droppable-disabled").removeData("droppable").unbind(".droppable")},_setData:function(B,C){if(B=="accept"){this.options.accept=C&&A.isFunction(C)?C:function(D){return D.is(C)}}else{A.widget.prototype._setData.apply(this,arguments)}},_activate:function(C){var B=A.ui.ddmanager.current;if(this.options.activeClass){this.element.addClass(this.options.activeClass)}(B&&this._trigger("activate",C,this.ui(B)))},_deactivate:function(C){var B=A.ui.ddmanager.current;if(this.options.activeClass){this.element.removeClass(this.options.activeClass)}(B&&this._trigger("deactivate",C,this.ui(B)))},_over:function(C){var B=A.ui.ddmanager.current;if(!B||(B.currentItem||B.element)[0]==this.element[0]){return }if(this.options.accept.call(this.element[0],(B.currentItem||B.element))){if(this.options.hoverClass){this.element.addClass(this.options.hoverClass)}this._trigger("over",C,this.ui(B))}},_out:function(C){var B=A.ui.ddmanager.current;if(!B||(B.currentItem||B.element)[0]==this.element[0]){return }if(this.options.accept.call(this.element[0],(B.currentItem||B.element))){if(this.options.hoverClass){this.element.removeClass(this.options.hoverClass)}this._trigger("out",C,this.ui(B))}},_drop:function(C,D){var B=D||A.ui.ddmanager.current;if(!B||(B.currentItem||B.element)[0]==this.element[0]){return false}var E=false;this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function(){var F=A.data(this,"droppable");if(F.options.greedy&&A.ui.intersect(B,A.extend(F,{offset:F.element.offset()}),F.options.tolerance)){E=true;return false}});if(E){return false}if(this.options.accept.call(this.element[0],(B.currentItem||B.element))){if(this.options.activeClass){this.element.removeClass(this.options.activeClass)}if(this.options.hoverClass){this.element.removeClass(this.options.hoverClass)}this._trigger("drop",C,this.ui(B));return this.element}return false},ui:function(B){return{draggable:(B.currentItem||B.element),helper:B.helper,position:B.position,absolutePosition:B.positionAbs,offset:B.positionAbs}}});A.extend(A.ui.droppable,{version:"1.7.2",eventPrefix:"drop",defaults:{accept:"*",activeClass:false,addClasses:true,greedy:false,hoverClass:false,scope:"default",tolerance:"intersect"}});A.ui.intersect=function(O,I,M){if(!I.offset){return false}var D=(O.positionAbs||O.position.absolute).left,C=D+O.helperProportions.width,L=(O.positionAbs||O.position.absolute).top,K=L+O.helperProportions.height;var F=I.offset.left,B=F+I.proportions.width,N=I.offset.top,J=N+I.proportions.height;switch(M){case"fit":return(F<D&&C<B&&N<L&&K<J);break;case"intersect":return(F<D+(O.helperProportions.width/2)&&C-(O.helperProportions.width/2)<B&&N<L+(O.helperProportions.height/2)&&K-(O.helperProportions.height/2)<J);break;case"pointer":var G=((O.positionAbs||O.position.absolute).left+(O.clickOffset||O.offset.click).left),H=((O.positionAbs||O.position.absolute).top+(O.clickOffset||O.offset.click).top),E=A.ui.isOver(H,G,N,F,I.proportions.height,I.proportions.width);return E;break;case"touch":return((L>=N&&L<=J)||(K>=N&&K<=J)||(L<N&&K>J))&&((D>=F&&D<=B)||(C>=F&&C<=B)||(D<F&&C>B));break;default:return false;break}};A.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(E,G){var B=A.ui.ddmanager.droppables[E.options.scope];var F=G?G.type:null;var H=(E.currentItem||E.element).find(":data(droppable)").andSelf();droppablesLoop:for(var D=0;D<B.length;D++){if(B[D].options.disabled||(E&&!B[D].options.accept.call(B[D].element[0],(E.currentItem||E.element)))){continue}for(var C=0;C<H.length;C++){if(H[C]==B[D].element[0]){B[D].proportions.height=0;continue droppablesLoop}}B[D].visible=B[D].element.css("display")!="none";if(!B[D].visible){continue}B[D].offset=B[D].element.offset();B[D].proportions={width:B[D].element[0].offsetWidth,height:B[D].element[0].offsetHeight};if(F=="mousedown"){B[D]._activate.call(B[D],G)}}},drop:function(B,C){var D=false;A.each(A.ui.ddmanager.droppables[B.options.scope],function(){if(!this.options){return }if(!this.options.disabled&&this.visible&&A.ui.intersect(B,this,this.options.tolerance)){D=this._drop.call(this,C)}if(!this.options.disabled&&this.visible&&this.options.accept.call(this.element[0],(B.currentItem||B.element))){this.isout=1;this.isover=0;this._deactivate.call(this,C)}});return D},drag:function(B,C){if(B.options.refreshPositions){A.ui.ddmanager.prepareOffsets(B,C)}A.each(A.ui.ddmanager.droppables[B.options.scope],function(){if(this.options.disabled||this.greedyChild||!this.visible){return }var E=A.ui.intersect(B,this,this.options.tolerance);var G=!E&&this.isover==1?"isout":(E&&this.isover==0?"isover":null);if(!G){return }var F;if(this.options.greedy){var D=this.element.parents(":data(droppable):eq(0)");if(D.length){F=A.data(D[0],"droppable");F.greedyChild=(G=="isover"?1:0)}}if(F&&G=="isover"){F.isover=0;F.isout=1;F._out.call(F,C)}this[G]=1;this[G=="isout"?"isover":"isout"]=0;this[G=="isover"?"_over":"_out"].call(this,C);if(F&&G=="isout"){F.isout=0;F.isover=1;F._over.call(F,C)}})}}})(jQuery);(function(A){A.widget("ui.sortable",A.extend({},A.ui.mouse,{_init:function(){var B=this.options;this.containerCache={};this.element.addClass("ui-sortable");this.refresh();this.floating=this.items.length?(/left|right/).test(this.items[0].item.css("float")):false;this.offset=this.element.offset();this._mouseInit()},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable");this._mouseDestroy();for(var B=this.items.length-1;B>=0;B--){this.items[B].item.removeData("sortable-item")}},_mouseCapture:function(E,F){if(this.reverting){return false}if(this.options.disabled||this.options.type=="static"){return false}this._refreshItems(E);var D=null,C=this,B=A(E.target).parents().each(function(){if(A.data(this,"sortable-item")==C){D=A(this);return false}});if(A.data(E.target,"sortable-item")==C){D=A(E.target)}if(!D){return false}if(this.options.handle&&!F){var G=false;A(this.options.handle,D).find("*").andSelf().each(function(){if(this==E.target){G=true}});if(!G){return false}}this.currentItem=D;this._removeCurrentsFromItems();return true},_mouseStart:function(E,F,B){var G=this.options,C=this;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(E);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");A.extend(this.offset,{click:{left:E.pageX-this.offset.left,top:E.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(E);this.originalPageX=E.pageX;this.originalPageY=E.pageY;if(G.cursorAt){this._adjustOffsetFromHelper(G.cursorAt)}this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};if(this.helper[0]!=this.currentItem[0]){this.currentItem.hide()}this._createPlaceholder();if(G.containment){this._setContainment()}if(G.cursor){if(A("body").css("cursor")){this._storedCursor=A("body").css("cursor")}A("body").css("cursor",G.cursor)}if(G.opacity){if(this.helper.css("opacity")){this._storedOpacity=this.helper.css("opacity")}this.helper.css("opacity",G.opacity)}if(G.zIndex){if(this.helper.css("zIndex")){this._storedZIndex=this.helper.css("zIndex")}this.helper.css("zIndex",G.zIndex)}if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){this.overflowOffset=this.scrollParent.offset()}this._trigger("start",E,this._uiHash());if(!this._preserveHelperProportions){this._cacheHelperProportions()}if(!B){for(var D=this.containers.length-1;D>=0;D--){this.containers[D]._trigger("activate",E,C._uiHash(this))}}if(A.ui.ddmanager){A.ui.ddmanager.current=this}if(A.ui.ddmanager&&!G.dropBehaviour){A.ui.ddmanager.prepareOffsets(this,E)}this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(E);return true},_mouseDrag:function(F){this.position=this._generatePosition(F);this.positionAbs=this._convertPositionTo("absolute");if(!this.lastPositionAbs){this.lastPositionAbs=this.positionAbs}if(this.options.scroll){var G=this.options,B=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){if((this.overflowOffset.top+this.scrollParent[0].offsetHeight)-F.pageY<G.scrollSensitivity){this.scrollParent[0].scrollTop=B=this.scrollParent[0].scrollTop+G.scrollSpeed}else{if(F.pageY-this.overflowOffset.top<G.scrollSensitivity){this.scrollParent[0].scrollTop=B=this.scrollParent[0].scrollTop-G.scrollSpeed}}if((this.overflowOffset.left+this.scrollParent[0].offsetWidth)-F.pageX<G.scrollSensitivity){this.scrollParent[0].scrollLeft=B=this.scrollParent[0].scrollLeft+G.scrollSpeed}else{if(F.pageX-this.overflowOffset.left<G.scrollSensitivity){this.scrollParent[0].scrollLeft=B=this.scrollParent[0].scrollLeft-G.scrollSpeed}}}else{if(F.pageY-A(document).scrollTop()<G.scrollSensitivity){B=A(document).scrollTop(A(document).scrollTop()-G.scrollSpeed)}else{if(A(window).height()-(F.pageY-A(document).scrollTop())<G.scrollSensitivity){B=A(document).scrollTop(A(document).scrollTop()+G.scrollSpeed)}}if(F.pageX-A(document).scrollLeft()<G.scrollSensitivity){B=A(document).scrollLeft(A(document).scrollLeft()-G.scrollSpeed)}else{if(A(window).width()-(F.pageX-A(document).scrollLeft())<G.scrollSensitivity){B=A(document).scrollLeft(A(document).scrollLeft()+G.scrollSpeed)}}}if(B!==false&&A.ui.ddmanager&&!G.dropBehaviour){A.ui.ddmanager.prepareOffsets(this,F)}}this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!="y"){this.helper[0].style.left=this.position.left+"px"}if(!this.options.axis||this.options.axis!="x"){this.helper[0].style.top=this.position.top+"px"}for(var D=this.items.length-1;D>=0;D--){var E=this.items[D],C=E.item[0],H=this._intersectsWithPointer(E);if(!H){continue}if(C!=this.currentItem[0]&&this.placeholder[H==1?"next":"prev"]()[0]!=C&&!A.ui.contains(this.placeholder[0],C)&&(this.options.type=="semi-dynamic"?!A.ui.contains(this.element[0],C):true)){this.direction=H==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(E)){this._rearrange(F,E)}else{break}this._trigger("change",F,this._uiHash());break}}this._contactContainers(F);if(A.ui.ddmanager){A.ui.ddmanager.drag(this,F)}this._trigger("sort",F,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(C,D){if(!C){return }if(A.ui.ddmanager&&!this.options.dropBehaviour){A.ui.ddmanager.drop(this,C)}if(this.options.revert){var B=this;var E=B.placeholder.offset();B.reverting=true;A(this.helper).animate({left:E.left-this.offset.parent.left-B.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:E.top-this.offset.parent.top-B.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){B._clear(C)})}else{this._clear(C,D)}return false},cancel:function(){var B=this;if(this.dragging){this._mouseUp();if(this.options.helper=="original"){this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else{this.currentItem.show()}for(var C=this.containers.length-1;C>=0;C--){this.containers[C]._trigger("deactivate",null,B._uiHash(this));if(this.containers[C].containerCache.over){this.containers[C]._trigger("out",null,B._uiHash(this));this.containers[C].containerCache.over=0}}}if(this.placeholder[0].parentNode){this.placeholder[0].parentNode.removeChild(this.placeholder[0])}if(this.options.helper!="original"&&this.helper&&this.helper[0].parentNode){this.helper.remove()}A.extend(this,{helper:null,dragging:false,reverting:false,_noFinalSort:null});if(this.domPosition.prev){A(this.domPosition.prev).after(this.currentItem)}else{A(this.domPosition.parent).prepend(this.currentItem)}return true},serialize:function(D){var B=this._getItemsAsjQuery(D&&D.connected);var C=[];D=D||{};A(B).each(function(){var E=(A(D.item||this).attr(D.attribute||"id")||"").match(D.expression||(/(.+)[-=_](.+)/));if(E){C.push((D.key||E[1]+"[]")+"="+(D.key&&D.expression?E[1]:E[2]))}});return C.join("&")},toArray:function(D){var B=this._getItemsAsjQuery(D&&D.connected);var C=[];D=D||{};B.each(function(){C.push(A(D.item||this).attr(D.attribute||"id")||"")});return C},_intersectsWith:function(K){var D=this.positionAbs.left,C=D+this.helperProportions.width,J=this.positionAbs.top,I=J+this.helperProportions.height;var E=K.left,B=E+K.width,L=K.top,H=L+K.height;var M=this.offset.click.top,G=this.offset.click.left;var F=(J+M)>L&&(J+M)<H&&(D+G)>E&&(D+G)<B;if(this.options.tolerance=="pointer"||this.options.forcePointerForContainers||(this.options.tolerance!="pointer"&&this.helperProportions[this.floating?"width":"height"]>K[this.floating?"width":"height"])){return F}else{return(E<D+(this.helperProportions.width/2)&&C-(this.helperProportions.width/2)<B&&L<J+(this.helperProportions.height/2)&&I-(this.helperProportions.height/2)<H)}},_intersectsWithPointer:function(D){var E=A.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,D.top,D.height),C=A.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,D.left,D.width),G=E&&C,B=this._getDragVerticalDirection(),F=this._getDragHorizontalDirection();if(!G){return false}return this.floating?(((F&&F=="right")||B=="down")?2:1):(B&&(B=="down"?2:1))},_intersectsWithSides:function(E){var C=A.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,E.top+(E.height/2),E.height),D=A.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,E.left+(E.width/2),E.width),B=this._getDragVerticalDirection(),F=this._getDragHorizontalDirection();if(this.floating&&F){return((F=="right"&&D)||(F=="left"&&!D))}else{return B&&((B=="down"&&C)||(B=="up"&&!C))}},_getDragVerticalDirection:function(){var B=this.positionAbs.top-this.lastPositionAbs.top;return B!=0&&(B>0?"down":"up")},_getDragHorizontalDirection:function(){var B=this.positionAbs.left-this.lastPositionAbs.left;return B!=0&&(B>0?"right":"left")},refresh:function(B){this._refreshItems(B);this.refreshPositions()},_connectWith:function(){var B=this.options;return B.connectWith.constructor==String?[B.connectWith]:B.connectWith},_getItemsAsjQuery:function(B){var J=this;var G=[];var E=[];var H=this._connectWith();if(H&&B){for(var D=H.length-1;D>=0;D--){var I=A(H[D]);for(var C=I.length-1;C>=0;C--){var F=A.data(I[C],"sortable");if(F&&F!=this&&!F.options.disabled){E.push([A.isFunction(F.options.items)?F.options.items.call(F.element):A(F.options.items,F.element).not(".ui-sortable-helper"),F])}}}}E.push([A.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):A(this.options.items,this.element).not(".ui-sortable-helper"),this]);for(var D=E.length-1;D>=0;D--){E[D][0].each(function(){G.push(this)})}return A(G)},_removeCurrentsFromItems:function(){var D=this.currentItem.find(":data(sortable-item)");for(var C=0;C<this.items.length;C++){for(var B=0;B<D.length;B++){if(D[B]==this.items[C].item[0]){this.items.splice(C,1)}}}},_refreshItems:function(B){this.items=[];this.containers=[this];var H=this.items;var N=this;var F=[[A.isFunction(this.options.items)?this.options.items.call(this.element[0],B,{item:this.currentItem}):A(this.options.items,this.element),this]];var J=this._connectWith();if(J){for(var E=J.length-1;E>=0;E--){var K=A(J[E]);for(var D=K.length-1;D>=0;D--){var G=A.data(K[D],"sortable");if(G&&G!=this&&!G.options.disabled){F.push([A.isFunction(G.options.items)?G.options.items.call(G.element[0],B,{item:this.currentItem}):A(G.options.items,G.element),G]);this.containers.push(G)}}}}for(var E=F.length-1;E>=0;E--){var I=F[E][1];var C=F[E][0];for(var D=0,L=C.length;D<L;D++){var M=A(C[D]);M.data("sortable-item",I);H.push({item:M,instance:I,width:0,height:0,left:0,top:0})}}},refreshPositions:function(B){if(this.offsetParent&&this.helper){this.offset.parent=this._getParentOffset()}for(var D=this.items.length-1;D>=0;D--){var E=this.items[D];if(E.instance!=this.currentContainer&&this.currentContainer&&E.item[0]!=this.currentItem[0]){continue}var C=this.options.toleranceElement?A(this.options.toleranceElement,E.item):E.item;if(!B){E.width=C.outerWidth();E.height=C.outerHeight()}var F=C.offset();E.left=F.left;E.top=F.top}if(this.options.custom&&this.options.custom.refreshContainers){this.options.custom.refreshContainers.call(this)}else{for(var D=this.containers.length-1;D>=0;D--){var F=this.containers[D].element.offset();this.containers[D].containerCache.left=F.left;this.containers[D].containerCache.top=F.top;this.containers[D].containerCache.width=this.containers[D].element.outerWidth();this.containers[D].containerCache.height=this.containers[D].element.outerHeight()}}},_createPlaceholder:function(D){var B=D||this,E=B.options;if(!E.placeholder||E.placeholder.constructor==String){var C=E.placeholder;E.placeholder={element:function(){var F=A(document.createElement(B.currentItem[0].nodeName)).addClass(C||B.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];if(!C){F.style.visibility="hidden"}return F},update:function(F,G){if(C&&!E.forcePlaceholderSize){return }if(!G.height()){G.height(B.currentItem.innerHeight()-parseInt(B.currentItem.css("paddingTop")||0,10)-parseInt(B.currentItem.css("paddingBottom")||0,10))}if(!G.width()){G.width(B.currentItem.innerWidth()-parseInt(B.currentItem.css("paddingLeft")||0,10)-parseInt(B.currentItem.css("paddingRight")||0,10))}}}}B.placeholder=A(E.placeholder.element.call(B.element,B.currentItem));B.currentItem.after(B.placeholder);E.placeholder.update(B,B.placeholder)},_contactContainers:function(D){for(var C=this.containers.length-1;C>=0;C--){if(this._intersectsWith(this.containers[C].containerCache)){if(!this.containers[C].containerCache.over){if(this.currentContainer!=this.containers[C]){var H=10000;var G=null;var E=this.positionAbs[this.containers[C].floating?"left":"top"];for(var B=this.items.length-1;B>=0;B--){if(!A.ui.contains(this.containers[C].element[0],this.items[B].item[0])){continue}var F=this.items[B][this.containers[C].floating?"left":"top"];if(Math.abs(F-E)<H){H=Math.abs(F-E);G=this.items[B]}}if(!G&&!this.options.dropOnEmpty){continue}this.currentContainer=this.containers[C];G?this._rearrange(D,G,null,true):this._rearrange(D,null,this.containers[C].element,true);this._trigger("change",D,this._uiHash());this.containers[C]._trigger("change",D,this._uiHash(this));this.options.placeholder.update(this.currentContainer,this.placeholder)}this.containers[C]._trigger("over",D,this._uiHash(this));this.containers[C].containerCache.over=1}}else{if(this.containers[C].containerCache.over){this.containers[C]._trigger("out",D,this._uiHash(this));this.containers[C].containerCache.over=0}}}},_createHelper:function(C){var D=this.options;var B=A.isFunction(D.helper)?A(D.helper.apply(this.element[0],[C,this.currentItem])):(D.helper=="clone"?this.currentItem.clone():this.currentItem);if(!B.parents("body").length){A(D.appendTo!="parent"?D.appendTo:this.currentItem[0].parentNode)[0].appendChild(B[0])}if(B[0]==this.currentItem[0]){this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}}if(B[0].style.width==""||D.forceHelperSize){B.width(this.currentItem.width())}if(B[0].style.height==""||D.forceHelperSize){B.height(this.currentItem.height())}return B},_adjustOffsetFromHelper:function(B){if(B.left!=undefined){this.offset.click.left=B.left+this.margins.left}if(B.right!=undefined){this.offset.click.left=this.helperProportions.width-B.right+this.margins.left}if(B.top!=undefined){this.offset.click.top=B.top+this.margins.top}if(B.bottom!=undefined){this.offset.click.top=this.helperProportions.height-B.bottom+this.margins.top}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var B=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&A.ui.contains(this.scrollParent[0],this.offsetParent[0])){B.left+=this.scrollParent.scrollLeft();B.top+=this.scrollParent.scrollTop()}if((this.offsetParent[0]==document.body)||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&A.browser.msie)){B={top:0,left:0}}return{top:B.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:B.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var B=this.currentItem.position();return{top:B.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:B.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else{return{top:0,left:0}}},_cacheMargins:function(){this.margins={left:(parseInt(this.currentItem.css("marginLeft"),10)||0),top:(parseInt(this.currentItem.css("marginTop"),10)||0)}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var E=this.options;if(E.containment=="parent"){E.containment=this.helper[0].parentNode}if(E.containment=="document"||E.containment=="window"){this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,A(E.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(A(E.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]}if(!(/^(document|window|parent)$/).test(E.containment)){var C=A(E.containment)[0];var D=A(E.containment).offset();var B=(A(C).css("overflow")!="hidden");this.containment=[D.left+(parseInt(A(C).css("borderLeftWidth"),10)||0)+(parseInt(A(C).css("paddingLeft"),10)||0)-this.margins.left,D.top+(parseInt(A(C).css("borderTopWidth"),10)||0)+(parseInt(A(C).css("paddingTop"),10)||0)-this.margins.top,D.left+(B?Math.max(C.scrollWidth,C.offsetWidth):C.offsetWidth)-(parseInt(A(C).css("borderLeftWidth"),10)||0)-(parseInt(A(C).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,D.top+(B?Math.max(C.scrollHeight,C.offsetHeight):C.offsetHeight)-(parseInt(A(C).css("borderTopWidth"),10)||0)-(parseInt(A(C).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(E,G){if(!G){G=this.position}var C=E=="absolute"?1:-1;var D=this.options,B=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&A.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,F=(/(html|body)/i).test(B[0].tagName);return{top:(G.top+this.offset.relative.top*C+this.offset.parent.top*C-(A.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(F?0:B.scrollTop()))*C)),left:(G.left+this.offset.relative.left*C+this.offset.parent.left*C-(A.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():F?0:B.scrollLeft())*C))}},_generatePosition:function(E){var H=this.options,B=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&A.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,I=(/(html|body)/i).test(B[0].tagName);if(this.cssPosition=="relative"&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0])){this.offset.relative=this._getRelativeOffset()}var D=E.pageX;var C=E.pageY;if(this.originalPosition){if(this.containment){if(E.pageX-this.offset.click.left<this.containment[0]){D=this.containment[0]+this.offset.click.left}if(E.pageY-this.offset.click.top<this.containment[1]){C=this.containment[1]+this.offset.click.top}if(E.pageX-this.offset.click.left>this.containment[2]){D=this.containment[2]+this.offset.click.left}if(E.pageY-this.offset.click.top>this.containment[3]){C=this.containment[3]+this.offset.click.top}}if(H.grid){var G=this.originalPageY+Math.round((C-this.originalPageY)/H.grid[1])*H.grid[1];C=this.containment?(!(G-this.offset.click.top<this.containment[1]||G-this.offset.click.top>this.containment[3])?G:(!(G-this.offset.click.top<this.containment[1])?G-H.grid[1]:G+H.grid[1])):G;var F=this.originalPageX+Math.round((D-this.originalPageX)/H.grid[0])*H.grid[0];D=this.containment?(!(F-this.offset.click.left<this.containment[0]||F-this.offset.click.left>this.containment[2])?F:(!(F-this.offset.click.left<this.containment[0])?F-H.grid[0]:F+H.grid[0])):F}}return{top:(C-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(A.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(I?0:B.scrollTop())))),left:(D-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(A.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():I?0:B.scrollLeft())))}},_rearrange:function(G,F,C,E){C?C[0].appendChild(this.placeholder[0]):F.item[0].parentNode.insertBefore(this.placeholder[0],(this.direction=="down"?F.item[0]:F.item[0].nextSibling));this.counter=this.counter?++this.counter:1;var D=this,B=this.counter;window.setTimeout(function(){if(B==D.counter){D.refreshPositions(!E)}},0)},_clear:function(D,E){this.reverting=false;var F=[],B=this;if(!this._noFinalSort&&this.currentItem[0].parentNode){this.placeholder.before(this.currentItem)}this._noFinalSort=null;if(this.helper[0]==this.currentItem[0]){for(var C in this._storedCSS){if(this._storedCSS[C]=="auto"||this._storedCSS[C]=="static"){this._storedCSS[C]=""}}this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else{this.currentItem.show()}if(this.fromOutside&&!E){F.push(function(G){this._trigger("receive",G,this._uiHash(this.fromOutside))})}if((this.fromOutside||this.domPosition.prev!=this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!=this.currentItem.parent()[0])&&!E){F.push(function(G){this._trigger("update",G,this._uiHash())})}if(!A.ui.contains(this.element[0],this.currentItem[0])){if(!E){F.push(function(G){this._trigger("remove",G,this._uiHash())})}for(var C=this.containers.length-1;C>=0;C--){if(A.ui.contains(this.containers[C].element[0],this.currentItem[0])&&!E){F.push((function(G){return function(H){G._trigger("receive",H,this._uiHash(this))}}).call(this,this.containers[C]));F.push((function(G){return function(H){G._trigger("update",H,this._uiHash(this))}}).call(this,this.containers[C]))}}}for(var C=this.containers.length-1;C>=0;C--){if(!E){F.push((function(G){return function(H){G._trigger("deactivate",H,this._uiHash(this))}}).call(this,this.containers[C]))}if(this.containers[C].containerCache.over){F.push((function(G){return function(H){G._trigger("out",H,this._uiHash(this))}}).call(this,this.containers[C]));this.containers[C].containerCache.over=0}}if(this._storedCursor){A("body").css("cursor",this._storedCursor)}if(this._storedOpacity){this.helper.css("opacity",this._storedOpacity)}if(this._storedZIndex){this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex)}this.dragging=false;if(this.cancelHelperRemoval){if(!E){this._trigger("beforeStop",D,this._uiHash());for(var C=0;C<F.length;C++){F[C].call(this,D)}this._trigger("stop",D,this._uiHash())}return false}if(!E){this._trigger("beforeStop",D,this._uiHash())}this.placeholder[0].parentNode.removeChild(this.placeholder[0]);if(this.helper[0]!=this.currentItem[0]){this.helper.remove()}this.helper=null;if(!E){for(var C=0;C<F.length;C++){F[C].call(this,D)}this._trigger("stop",D,this._uiHash())}this.fromOutside=false;return true},_trigger:function(){if(A.widget.prototype._trigger.apply(this,arguments)===false){this.cancel()}},_uiHash:function(C){var B=C||this;return{helper:B.helper,placeholder:B.placeholder||A([]),position:B.position,absolutePosition:B.positionAbs,offset:B.positionAbs,item:B.currentItem,sender:C?C.element:null}}}));A.extend(A.ui.sortable,{getter:"serialize toArray",version:"1.7.2",eventPrefix:"sort",defaults:{appendTo:"parent",axis:false,cancel:":input,option",connectWith:false,containment:false,cursor:"auto",cursorAt:false,delay:0,distance:1,dropOnEmpty:true,forcePlaceholderSize:false,forceHelperSize:false,grid:false,handle:false,helper:"original",items:"> *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1000}})})(jQuery);(function(A){A.widget("ui.slider",A.extend({},A.ui.mouse,{_init:function(){var B=this,C=this.options;this._keySliding=false;this._handleIndex=null;this._detectOrientation();this._mouseInit();this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget ui-widget-content ui-corner-all");this.range=A([]);if(C.range){if(C.range===true){this.range=A("<div></div>");if(!C.values){C.values=[this._valueMin(),this._valueMin()]}if(C.values.length&&C.values.length!=2){C.values=[C.values[0],C.values[0]]}}else{this.range=A("<div></div>")}this.range.appendTo(this.element).addClass("ui-slider-range");if(C.range=="min"||C.range=="max"){this.range.addClass("ui-slider-range-"+C.range)}this.range.addClass("ui-widget-header")}if(A(".ui-slider-handle",this.element).length==0){A('<a href="#"></a>').appendTo(this.element).addClass("ui-slider-handle")}if(C.values&&C.values.length){while(A(".ui-slider-handle",this.element).length<C.values.length){A('<a href="#"></a>').appendTo(this.element).addClass("ui-slider-handle")}}this.handles=A(".ui-slider-handle",this.element).addClass("ui-state-default ui-corner-all");this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(D){D.preventDefault()}).hover(function(){if(!C.disabled){A(this).addClass("ui-state-hover")}},function(){A(this).removeClass("ui-state-hover")}).focus(function(){if(!C.disabled){A(".ui-slider .ui-state-focus").removeClass("ui-state-focus");A(this).addClass("ui-state-focus")}else{A(this).blur()}}).blur(function(){A(this).removeClass("ui-state-focus")});this.handles.each(function(D){A(this).data("index.ui-slider-handle",D)});this.handles.keydown(function(I){var F=true;var E=A(this).data("index.ui-slider-handle");if(B.options.disabled){return }switch(I.keyCode){case A.ui.keyCode.HOME:case A.ui.keyCode.END:case A.ui.keyCode.UP:case A.ui.keyCode.RIGHT:case A.ui.keyCode.DOWN:case A.ui.keyCode.LEFT:F=false;if(!B._keySliding){B._keySliding=true;A(this).addClass("ui-state-active");B._start(I,E)}break}var G,D,H=B._step();if(B.options.values&&B.options.values.length){G=D=B.values(E)}else{G=D=B.value()}switch(I.keyCode){case A.ui.keyCode.HOME:D=B._valueMin();break;case A.ui.keyCode.END:D=B._valueMax();break;case A.ui.keyCode.UP:case A.ui.keyCode.RIGHT:if(G==B._valueMax()){return }D=G+H;break;case A.ui.keyCode.DOWN:case A.ui.keyCode.LEFT:if(G==B._valueMin()){return }D=G-H;break}B._slide(I,E,D);return F}).keyup(function(E){var D=A(this).data("index.ui-slider-handle");if(B._keySliding){B._stop(E,D);B._change(E,D);B._keySliding=false;A(this).removeClass("ui-state-active")}});this._refreshValue()},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider");this._mouseDestroy()},_mouseCapture:function(D){var E=this.options;if(E.disabled){return false}this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();var H={x:D.pageX,y:D.pageY};var J=this._normValueFromMouse(H);var C=this._valueMax()-this._valueMin()+1,F;var K=this,I;this.handles.each(function(L){var M=Math.abs(J-K.values(L));if(C>M){C=M;F=A(this);I=L}});if(E.range==true&&this.values(1)==E.min){F=A(this.handles[++I])}this._start(D,I);K._handleIndex=I;F.addClass("ui-state-active").focus();var G=F.offset();var B=!A(D.target).parents().andSelf().is(".ui-slider-handle");this._clickOffset=B?{left:0,top:0}:{left:D.pageX-G.left-(F.width()/2),top:D.pageY-G.top-(F.height()/2)-(parseInt(F.css("borderTopWidth"),10)||0)-(parseInt(F.css("borderBottomWidth"),10)||0)+(parseInt(F.css("marginTop"),10)||0)};J=this._normValueFromMouse(H);this._slide(D,I,J);return true},_mouseStart:function(B){return true},_mouseDrag:function(D){var B={x:D.pageX,y:D.pageY};var C=this._normValueFromMouse(B);this._slide(D,this._handleIndex,C);return false},_mouseStop:function(B){this.handles.removeClass("ui-state-active");this._stop(B,this._handleIndex);this._change(B,this._handleIndex);this._handleIndex=null;this._clickOffset=null;return false},_detectOrientation:function(){this.orientation=this.options.orientation=="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(D){var C,H;if("horizontal"==this.orientation){C=this.elementSize.width;H=D.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{C=this.elementSize.height;H=D.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}var F=(H/C);if(F>1){F=1}if(F<0){F=0}if("vertical"==this.orientation){F=1-F}var E=this._valueMax()-this._valueMin(),I=F*E,B=I%this.options.step,G=this._valueMin()+I-B;if(B>(this.options.step/2)){G+=this.options.step}return parseFloat(G.toFixed(5))},_start:function(D,C){var B={handle:this.handles[C],value:this.value()};if(this.options.values&&this.options.values.length){B.value=this.values(C);B.values=this.values()}this._trigger("start",D,B)},_slide:function(F,E,D){var G=this.handles[E];if(this.options.values&&this.options.values.length){var B=this.values(E?0:1);if((this.options.values.length==2&&this.options.range===true)&&((E==0&&D>B)||(E==1&&D<B))){D=B}if(D!=this.values(E)){var C=this.values();C[E]=D;var H=this._trigger("slide",F,{handle:this.handles[E],value:D,values:C});var B=this.values(E?0:1);if(H!==false){this.values(E,D,(F.type=="mousedown"&&this.options.animate),true)}}}else{if(D!=this.value()){var H=this._trigger("slide",F,{handle:this.handles[E],value:D});if(H!==false){this._setData("value",D,(F.type=="mousedown"&&this.options.animate))}}}},_stop:function(D,C){var B={handle:this.handles[C],value:this.value()};if(this.options.values&&this.options.values.length){B.value=this.values(C);B.values=this.values()}this._trigger("stop",D,B)},_change:function(D,C){var B={handle:this.handles[C],value:this.value()};if(this.options.values&&this.options.values.length){B.value=this.values(C);B.values=this.values()}this._trigger("change",D,B)},value:function(B){if(arguments.length){this._setData("value",B);this._change(null,0)}return this._value()},values:function(B,E,C,D){if(arguments.length>1){this.options.values[B]=E;this._refreshValue(C);if(!D){this._change(null,B)}}if(arguments.length){if(this.options.values&&this.options.values.length){return this._values(B)}else{return this.value()}}else{return this._values()}},_setData:function(B,D,C){A.widget.prototype._setData.apply(this,arguments);switch(B){case"disabled":if(D){this.handles.filter(".ui-state-focus").blur();this.handles.removeClass("ui-state-hover");this.handles.attr("disabled","disabled")}else{this.handles.removeAttr("disabled")}case"orientation":this._detectOrientation();this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation);this._refreshValue(C);break;case"value":this._refreshValue(C);break}},_step:function(){var B=this.options.step;return B},_value:function(){var B=this.options.value;if(B<this._valueMin()){B=this._valueMin()}if(B>this._valueMax()){B=this._valueMax()}return B},_values:function(B){if(arguments.length){var C=this.options.values[B];if(C<this._valueMin()){C=this._valueMin()}if(C>this._valueMax()){C=this._valueMax()}return C}else{return this.options.values}},_valueMin:function(){var B=this.options.min;return B},_valueMax:function(){var B=this.options.max;return B},_refreshValue:function(C){var F=this.options.range,D=this.options,L=this;if(this.options.values&&this.options.values.length){var I,H;this.handles.each(function(P,N){var O=(L.values(P)-L._valueMin())/(L._valueMax()-L._valueMin())*100;var M={};M[L.orientation=="horizontal"?"left":"bottom"]=O+"%";A(this).stop(1,1)[C?"animate":"css"](M,D.animate);if(L.options.range===true){if(L.orientation=="horizontal"){(P==0)&&L.range.stop(1,1)[C?"animate":"css"]({left:O+"%"},D.animate);(P==1)&&L.range[C?"animate":"css"]({width:(O-lastValPercent)+"%"},{queue:false,duration:D.animate})}else{(P==0)&&L.range.stop(1,1)[C?"animate":"css"]({bottom:(O)+"%"},D.animate);(P==1)&&L.range[C?"animate":"css"]({height:(O-lastValPercent)+"%"},{queue:false,duration:D.animate})}}lastValPercent=O})}else{var J=this.value(),G=this._valueMin(),K=this._valueMax(),E=K!=G?(J-G)/(K-G)*100:0;var B={};B[L.orientation=="horizontal"?"left":"bottom"]=E+"%";this.handle.stop(1,1)[C?"animate":"css"](B,D.animate);(F=="min")&&(this.orientation=="horizontal")&&this.range.stop(1,1)[C?"animate":"css"]({width:E+"%"},D.animate);(F=="max")&&(this.orientation=="horizontal")&&this.range[C?"animate":"css"]({width:(100-E)+"%"},{queue:false,duration:D.animate});(F=="min")&&(this.orientation=="vertical")&&this.range.stop(1,1)[C?"animate":"css"]({height:E+"%"},D.animate);(F=="max")&&(this.orientation=="vertical")&&this.range[C?"animate":"css"]({height:(100-E)+"%"},{queue:false,duration:D.animate})}}}));A.extend(A.ui.slider,{getter:"value values",version:"1.7.2",eventPrefix:"slide",defaults:{animate:false,delay:0,distance:0,max:100,min:0,orientation:"horizontal",range:false,step:1,value:0,values:null}})})(jQuery);(function($){$.extend($.ui,{datepicker:{version:"1.7.2"}});var PROP_NAME="datepicker";function Datepicker(){this.debug=false;this._curInst=null;this._keyEvent=false;this._disabledInputs=[];this._datepickerShowing=false;this._inDialog=false;this._mainDivId="ui-datepicker-div";this._inlineClass="ui-datepicker-inline";this._appendClass="ui-datepicker-append";this._triggerClass="ui-datepicker-trigger";this._dialogClass="ui-datepicker-dialog";this._disableClass="ui-datepicker-disabled";this._unselectableClass="ui-datepicker-unselectable";this._currentClass="ui-datepicker-current-day";this._dayOverClass="ui-datepicker-days-cell-over";this.regional=[];this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],dateFormat:"mm/dd/yy",firstDay:0,isRTL:false};this._defaults={showOn:"focus",showAnim:"show",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:false,hideIfNoPrevNext:false,navigationAsDateFormat:false,gotoCurrent:false,changeMonth:false,changeYear:false,showMonthAfterYear:false,yearRange:"-10:+10",showOtherMonths:false,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"normal",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:true,showButtonPanel:false};$.extend(this._defaults,this.regional[""]);this.dpDiv=$('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all ui-helper-hidden-accessible"></div>')}$.extend(Datepicker.prototype,{markerClassName:"hasDatepicker",log:function(){if(this.debug){console.log.apply("",arguments)}},setDefaults:function(settings){extendRemove(this._defaults,settings||{});return this},_attachDatepicker:function(target,settings){var inlineSettings=null;for(var attrName in this._defaults){var attrValue=target.getAttribute("date:"+attrName);if(attrValue){inlineSettings=inlineSettings||{};try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}}var nodeName=target.nodeName.toLowerCase();var inline=(nodeName=="div"||nodeName=="span");if(!target.id){target.id="dp"+(++this.uuid)}var inst=this._newInst($(target),inline);inst.settings=$.extend({},settings||{},inlineSettings||{});if(nodeName=="input"){this._connectDatepicker(target,inst)}else{if(inline){this._inlineDatepicker(target,inst)}}},_newInst:function(target,inline){var id=target[0].id.replace(/([:\[\]\.])/g,"\\\\$1");return{id:id,input:target,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:inline,dpDiv:(!inline?this.dpDiv:$('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))}},_connectDatepicker:function(target,inst){var input=$(target);inst.append=$([]);inst.trigger=$([]);if(input.hasClass(this.markerClassName)){return }var appendText=this._get(inst,"appendText");var isRTL=this._get(inst,"isRTL");if(appendText){inst.append=$('<span class="'+this._appendClass+'">'+appendText+"</span>");input[isRTL?"before":"after"](inst.append)}var showOn=this._get(inst,"showOn");if(showOn=="focus"||showOn=="both"){input.focus(this._showDatepicker)}if(showOn=="button"||showOn=="both"){var buttonText=this._get(inst,"buttonText");var buttonImage=this._get(inst,"buttonImage");inst.trigger=$(this._get(inst,"buttonImageOnly")?$("<img/>").addClass(this._triggerClass).attr({src:buttonImage,alt:buttonText,title:buttonText}):$('<button type="button"></button>').addClass(this._triggerClass).html(buttonImage==""?buttonText:$("<img/>").attr({src:buttonImage,alt:buttonText,title:buttonText})));input[isRTL?"before":"after"](inst.trigger);inst.trigger.click(function(){if($.datepicker._datepickerShowing&&$.datepicker._lastInput==target){$.datepicker._hideDatepicker()}else{$.datepicker._showDatepicker(target)}return false})}input.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).bind("setData.datepicker",function(event,key,value){inst.settings[key]=value}).bind("getData.datepicker",function(event,key){return this._get(inst,key)});$.data(target,PROP_NAME,inst)},_inlineDatepicker:function(target,inst){var divSpan=$(target);if(divSpan.hasClass(this.markerClassName)){return }divSpan.addClass(this.markerClassName).append(inst.dpDiv).bind("setData.datepicker",function(event,key,value){inst.settings[key]=value}).bind("getData.datepicker",function(event,key){return this._get(inst,key)});$.data(target,PROP_NAME,inst);this._setDate(inst,this._getDefaultDate(inst));this._updateDatepicker(inst);this._updateAlternate(inst)},_dialogDatepicker:function(input,dateText,onSelect,settings,pos){var inst=this._dialogInst;if(!inst){var id="dp"+(++this.uuid);this._dialogInput=$('<input type="text" id="'+id+'" size="1" style="position: absolute; top: -100px;"/>');this._dialogInput.keydown(this._doKeyDown);$("body").append(this._dialogInput);inst=this._dialogInst=this._newInst(this._dialogInput,false);inst.settings={};$.data(this._dialogInput[0],PROP_NAME,inst)}extendRemove(inst.settings,settings||{});this._dialogInput.val(dateText);this._pos=(pos?(pos.length?pos:[pos.pageX,pos.pageY]):null);if(!this._pos){var browserWidth=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;var browserHeight=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;var scrollX=document.documentElement.scrollLeft||document.body.scrollLeft;var scrollY=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[(browserWidth/2)-100+scrollX,(browserHeight/2)-150+scrollY]}this._dialogInput.css("left",this._pos[0]+"px").css("top",this._pos[1]+"px");inst.settings.onSelect=onSelect;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);if($.blockUI){$.blockUI(this.dpDiv)}$.data(this._dialogInput[0],PROP_NAME,inst);return this},_destroyDatepicker:function(target){var $target=$(target);var inst=$.data(target,PROP_NAME);if(!$target.hasClass(this.markerClassName)){return }var nodeName=target.nodeName.toLowerCase();$.removeData(target,PROP_NAME);if(nodeName=="input"){inst.append.remove();inst.trigger.remove();$target.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress)}else{if(nodeName=="div"||nodeName=="span"){$target.removeClass(this.markerClassName).empty()}}},_enableDatepicker:function(target){var $target=$(target);var inst=$.data(target,PROP_NAME);if(!$target.hasClass(this.markerClassName)){return }var nodeName=target.nodeName.toLowerCase();if(nodeName=="input"){target.disabled=false;inst.trigger.filter("button").each(function(){this.disabled=false}).end().filter("img").css({opacity:"1.0",cursor:""})}else{if(nodeName=="div"||nodeName=="span"){var inline=$target.children("."+this._inlineClass);inline.children().removeClass("ui-state-disabled")}}this._disabledInputs=$.map(this._disabledInputs,function(value){return(value==target?null:value)})},_disableDatepicker:function(target){var $target=$(target);var inst=$.data(target,PROP_NAME);if(!$target.hasClass(this.markerClassName)){return }var nodeName=target.nodeName.toLowerCase();if(nodeName=="input"){target.disabled=true;inst.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0.5",cursor:"default"})}else{if(nodeName=="div"||nodeName=="span"){var inline=$target.children("."+this._inlineClass);inline.children().addClass("ui-state-disabled")}}this._disabledInputs=$.map(this._disabledInputs,function(value){return(value==target?null:value)});this._disabledInputs[this._disabledInputs.length]=target},_isDisabledDatepicker:function(target){if(!target){return false}for(var i=0;i<this._disabledInputs.length;i++){if(this._disabledInputs[i]==target){return true}}return false},_getInst:function(target){try{return $.data(target,PROP_NAME)}catch(err){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(target,name,value){var inst=this._getInst(target);if(arguments.length==2&&typeof name=="string"){return(name=="defaults"?$.extend({},$.datepicker._defaults):(inst?(name=="all"?$.extend({},inst.settings):this._get(inst,name)):null))}var settings=name||{};if(typeof name=="string"){settings={};settings[name]=value}if(inst){if(this._curInst==inst){this._hideDatepicker(null)}var date=this._getDateDatepicker(target);extendRemove(inst.settings,settings);this._setDateDatepicker(target,date);this._updateDatepicker(inst)}},_changeDatepicker:function(target,name,value){this._optionDatepicker(target,name,value)},_refreshDatepicker:function(target){var inst=this._getInst(target);if(inst){this._updateDatepicker(inst)}},_setDateDatepicker:function(target,date,endDate){var inst=this._getInst(target);if(inst){this._setDate(inst,date,endDate);this._updateDatepicker(inst);this._updateAlternate(inst)}},_getDateDatepicker:function(target){var inst=this._getInst(target);if(inst&&!inst.inline){this._setDateFromField(inst)}return(inst?this._getDate(inst):null)},_doKeyDown:function(event){var inst=$.datepicker._getInst(event.target);var handled=true;var isRTL=inst.dpDiv.is(".ui-datepicker-rtl");inst._keyEvent=true;if($.datepicker._datepickerShowing){switch(event.keyCode){case 9:$.datepicker._hideDatepicker(null,"");break;case 13:var sel=$("td."+$.datepicker._dayOverClass+", td."+$.datepicker._currentClass,inst.dpDiv);if(sel[0]){$.datepicker._selectDay(event.target,inst.selectedMonth,inst.selectedYear,sel[0])}else{$.datepicker._hideDatepicker(null,$.datepicker._get(inst,"duration"))}return false;break;case 27:$.datepicker._hideDatepicker(null,$.datepicker._get(inst,"duration"));break;case 33:$.datepicker._adjustDate(event.target,(event.ctrlKey?-$.datepicker._get(inst,"stepBigMonths"):-$.datepicker._get(inst,"stepMonths")),"M");break;case 34:$.datepicker._adjustDate(event.target,(event.ctrlKey?+$.datepicker._get(inst,"stepBigMonths"):+$.datepicker._get(inst,"stepMonths")),"M");break;case 35:if(event.ctrlKey||event.metaKey){$.datepicker._clearDate(event.target)}handled=event.ctrlKey||event.metaKey;break;case 36:if(event.ctrlKey||event.metaKey){$.datepicker._gotoToday(event.target)}handled=event.ctrlKey||event.metaKey;break;case 37:if(event.ctrlKey||event.metaKey){$.datepicker._adjustDate(event.target,(isRTL?+1:-1),"D")}handled=event.ctrlKey||event.metaKey;if(event.originalEvent.altKey){$.datepicker._adjustDate(event.target,(event.ctrlKey?-$.datepicker._get(inst,"stepBigMonths"):-$.datepicker._get(inst,"stepMonths")),"M")}break;case 38:if(event.ctrlKey||event.metaKey){$.datepicker._adjustDate(event.target,-7,"D")}handled=event.ctrlKey||event.metaKey;break;case 39:if(event.ctrlKey||event.metaKey){$.datepicker._adjustDate(event.target,(isRTL?-1:+1),"D")}handled=event.ctrlKey||event.metaKey;if(event.originalEvent.altKey){$.datepicker._adjustDate(event.target,(event.ctrlKey?+$.datepicker._get(inst,"stepBigMonths"):+$.datepicker._get(inst,"stepMonths")),"M")}break;case 40:if(event.ctrlKey||event.metaKey){$.datepicker._adjustDate(event.target,+7,"D")}handled=event.ctrlKey||event.metaKey;break;default:handled=false}}else{if(event.keyCode==36&&event.ctrlKey){$.datepicker._showDatepicker(this)}else{handled=false}}if(handled){event.preventDefault();event.stopPropagation()}},_doKeyPress:function(event){var inst=$.datepicker._getInst(event.target);if($.datepicker._get(inst,"constrainInput")){var chars=$.datepicker._possibleChars($.datepicker._get(inst,"dateFormat"));var chr=String.fromCharCode(event.charCode==undefined?event.keyCode:event.charCode);return event.ctrlKey||(chr<" "||!chars||chars.indexOf(chr)>-1)}},_showDatepicker:function(input){input=input.target||input;if(input.nodeName.toLowerCase()!="input"){input=$("input",input.parentNode)[0]}if($.datepicker._isDisabledDatepicker(input)||$.datepicker._lastInput==input){return }var inst=$.datepicker._getInst(input);var beforeShow=$.datepicker._get(inst,"beforeShow");extendRemove(inst.settings,(beforeShow?beforeShow.apply(input,[input,inst]):{}));$.datepicker._hideDatepicker(null,"");$.datepicker._lastInput=input;$.datepicker._setDateFromField(inst);if($.datepicker._inDialog){input.value=""}if(!$.datepicker._pos){$.datepicker._pos=$.datepicker._findPos(input);$.datepicker._pos[1]+=input.offsetHeight}var isFixed=false;$(input).parents().each(function(){isFixed|=$(this).css("position")=="fixed";return !isFixed});if(isFixed&&$.browser.opera){$.datepicker._pos[0]-=document.documentElement.scrollLeft;$.datepicker._pos[1]-=document.documentElement.scrollTop}var offset={left:$.datepicker._pos[0],top:$.datepicker._pos[1]};$.datepicker._pos=null;inst.rangeStart=null;inst.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});$.datepicker._updateDatepicker(inst);offset=$.datepicker._checkOffset(inst,offset,isFixed);inst.dpDiv.css({position:($.datepicker._inDialog&&$.blockUI?"static":(isFixed?"fixed":"absolute")),display:"none",left:offset.left+"px",top:offset.top+"px"});if(!inst.inline){var showAnim=$.datepicker._get(inst,"showAnim")||"show";var duration=$.datepicker._get(inst,"duration");var postProcess=function(){$.datepicker._datepickerShowing=true;if($.browser.msie&&parseInt($.browser.version,10)<7){$("iframe.ui-datepicker-cover").css({width:inst.dpDiv.width()+4,height:inst.dpDiv.height()+4})}};if($.effects&&$.effects[showAnim]){inst.dpDiv.show(showAnim,$.datepicker._get(inst,"showOptions"),duration,postProcess)}else{inst.dpDiv[showAnim](duration,postProcess)}if(duration==""){postProcess()}if(inst.input[0].type!="hidden"){inst.input[0].focus()}$.datepicker._curInst=inst}},_updateDatepicker:function(inst){var dims={width:inst.dpDiv.width()+4,height:inst.dpDiv.height()+4};var self=this;inst.dpDiv.empty().append(this._generateHTML(inst)).find("iframe.ui-datepicker-cover").css({width:dims.width,height:dims.height}).end().find("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a").bind("mouseout",function(){$(this).removeClass("ui-state-hover");if(this.className.indexOf("ui-datepicker-prev")!=-1){$(this).removeClass("ui-datepicker-prev-hover")}if(this.className.indexOf("ui-datepicker-next")!=-1){$(this).removeClass("ui-datepicker-next-hover")}}).bind("mouseover",function(){if(!self._isDisabledDatepicker(inst.inline?inst.dpDiv.parent()[0]:inst.input[0])){$(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");$(this).addClass("ui-state-hover");if(this.className.indexOf("ui-datepicker-prev")!=-1){$(this).addClass("ui-datepicker-prev-hover")}if(this.className.indexOf("ui-datepicker-next")!=-1){$(this).addClass("ui-datepicker-next-hover")}}}).end().find("."+this._dayOverClass+" a").trigger("mouseover").end();var numMonths=this._getNumberOfMonths(inst);var cols=numMonths[1];var width=17;if(cols>1){inst.dpDiv.addClass("ui-datepicker-multi-"+cols).css("width",(width*cols)+"em")}else{inst.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("")}inst.dpDiv[(numMonths[0]!=1||numMonths[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");inst.dpDiv[(this._get(inst,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");if(inst.input&&inst.input[0].type!="hidden"&&inst==$.datepicker._curInst){$(inst.input[0]).focus()}},_checkOffset:function(inst,offset,isFixed){var dpWidth=inst.dpDiv.outerWidth();var dpHeight=inst.dpDiv.outerHeight();var inputWidth=inst.input?inst.input.outerWidth():0;var inputHeight=inst.input?inst.input.outerHeight():0;var viewWidth=(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)+$(document).scrollLeft();var viewHeight=(window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight)+$(document).scrollTop();offset.left-=(this._get(inst,"isRTL")?(dpWidth-inputWidth):0);offset.left-=(isFixed&&offset.left==inst.input.offset().left)?$(document).scrollLeft():0;offset.top-=(isFixed&&offset.top==(inst.input.offset().top+inputHeight))?$(document).scrollTop():0;offset.left-=(offset.left+dpWidth>viewWidth&&viewWidth>dpWidth)?Math.abs(offset.left+dpWidth-viewWidth):0;offset.top-=(offset.top+dpHeight>viewHeight&&viewHeight>dpHeight)?Math.abs(offset.top+dpHeight+inputHeight*2-viewHeight):0;return offset},_findPos:function(obj){while(obj&&(obj.type=="hidden"||obj.nodeType!=1)){obj=obj.nextSibling}var position=$(obj).offset();return[position.left,position.top]},_hideDatepicker:function(input,duration){var inst=this._curInst;if(!inst||(input&&inst!=$.data(input,PROP_NAME))){return }if(inst.stayOpen){this._selectDate("#"+inst.id,this._formatDate(inst,inst.currentDay,inst.currentMonth,inst.currentYear))}inst.stayOpen=false;if(this._datepickerShowing){duration=(duration!=null?duration:this._get(inst,"duration"));var showAnim=this._get(inst,"showAnim");var postProcess=function(){$.datepicker._tidyDialog(inst)};if(duration!=""&&$.effects&&$.effects[showAnim]){inst.dpDiv.hide(showAnim,$.datepicker._get(inst,"showOptions"),duration,postProcess)}else{inst.dpDiv[(duration==""?"hide":(showAnim=="slideDown"?"slideUp":(showAnim=="fadeIn"?"fadeOut":"hide")))](duration,postProcess)}if(duration==""){this._tidyDialog(inst)}var onClose=this._get(inst,"onClose");if(onClose){onClose.apply((inst.input?inst.input[0]:null),[(inst.input?inst.input.val():""),inst])}this._datepickerShowing=false;this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if($.blockUI){$.unblockUI();$("body").append(this.dpDiv)}}this._inDialog=false}this._curInst=null},_tidyDialog:function(inst){inst.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(event){if(!$.datepicker._curInst){return }var $target=$(event.target);if(($target.parents("#"+$.datepicker._mainDivId).length==0)&&!$target.hasClass($.datepicker.markerClassName)&&!$target.hasClass($.datepicker._triggerClass)&&$.datepicker._datepickerShowing&&!($.datepicker._inDialog&&$.blockUI)){$.datepicker._hideDatepicker(null,"")}},_adjustDate:function(id,offset,period){var target=$(id);var inst=this._getInst(target[0]);if(this._isDisabledDatepicker(target[0])){return }this._adjustInstDate(inst,offset+(period=="M"?this._get(inst,"showCurrentAtPos"):0),period);this._updateDatepicker(inst)},_gotoToday:function(id){var target=$(id);var inst=this._getInst(target[0]);if(this._get(inst,"gotoCurrent")&&inst.currentDay){inst.selectedDay=inst.currentDay;inst.drawMonth=inst.selectedMonth=inst.currentMonth;inst.drawYear=inst.selectedYear=inst.currentYear}else{var date=new Date();inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear()}this._notifyChange(inst);this._adjustDate(target)},_selectMonthYear:function(id,select,period){var target=$(id);var inst=this._getInst(target[0]);inst._selectingMonthYear=false;inst["selected"+(period=="M"?"Month":"Year")]=inst["draw"+(period=="M"?"Month":"Year")]=parseInt(select.options[select.selectedIndex].value,10);this._notifyChange(inst);this._adjustDate(target)},_clickMonthYear:function(id){var target=$(id);var inst=this._getInst(target[0]);if(inst.input&&inst._selectingMonthYear&&!$.browser.msie){inst.input[0].focus()}inst._selectingMonthYear=!inst._selectingMonthYear},_selectDay:function(id,month,year,td){var target=$(id);if($(td).hasClass(this._unselectableClass)||this._isDisabledDatepicker(target[0])){return }var inst=this._getInst(target[0]);inst.selectedDay=inst.currentDay=$("a",td).html();inst.selectedMonth=inst.currentMonth=month;inst.selectedYear=inst.currentYear=year;if(inst.stayOpen){inst.endDay=inst.endMonth=inst.endYear=null}this._selectDate(id,this._formatDate(inst,inst.currentDay,inst.currentMonth,inst.currentYear));if(inst.stayOpen){inst.rangeStart=this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay));this._updateDatepicker(inst)}},_clearDate:function(id){var target=$(id);var inst=this._getInst(target[0]);inst.stayOpen=false;inst.endDay=inst.endMonth=inst.endYear=inst.rangeStart=null;this._selectDate(target,"")},_selectDate:function(id,dateStr){var target=$(id);var inst=this._getInst(target[0]);dateStr=(dateStr!=null?dateStr:this._formatDate(inst));if(inst.input){inst.input.val(dateStr)}this._updateAlternate(inst);var onSelect=this._get(inst,"onSelect");if(onSelect){onSelect.apply((inst.input?inst.input[0]:null),[dateStr,inst])}else{if(inst.input){inst.input.trigger("change")}}if(inst.inline){this._updateDatepicker(inst)}else{if(!inst.stayOpen){this._hideDatepicker(null,this._get(inst,"duration"));this._lastInput=inst.input[0];if(typeof (inst.input[0])!="object"){inst.input[0].focus()}this._lastInput=null}}},_updateAlternate:function(inst){var altField=this._get(inst,"altField");if(altField){var altFormat=this._get(inst,"altFormat")||this._get(inst,"dateFormat");var date=this._getDate(inst);dateStr=this.formatDate(altFormat,date,this._getFormatConfig(inst));$(altField).each(function(){$(this).val(dateStr)})}},noWeekends:function(date){var day=date.getDay();return[(day>0&&day<6),""]},iso8601Week:function(date){var checkDate=new Date(date.getFullYear(),date.getMonth(),date.getDate());var firstMon=new Date(checkDate.getFullYear(),1-1,4);var firstDay=firstMon.getDay()||7;firstMon.setDate(firstMon.getDate()+1-firstDay);if(firstDay<4&&checkDate<firstMon){checkDate.setDate(checkDate.getDate()-3);return $.datepicker.iso8601Week(checkDate)}else{if(checkDate>new Date(checkDate.getFullYear(),12-1,28)){firstDay=new Date(checkDate.getFullYear()+1,1-1,4).getDay()||7;if(firstDay>4&&(checkDate.getDay()||7)<firstDay-3){return 1}}}return Math.floor(((checkDate-firstMon)/86400000)/7)+1},parseDate:function(format,value,settings){if(format==null||value==null){throw"Invalid arguments"}value=(typeof value=="object"?value.toString():value+"");if(value==""){return null}var shortYearCutoff=(settings?settings.shortYearCutoff:null)||this._defaults.shortYearCutoff;var dayNamesShort=(settings?settings.dayNamesShort:null)||this._defaults.dayNamesShort;var dayNames=(settings?settings.dayNames:null)||this._defaults.dayNames;var monthNamesShort=(settings?settings.monthNamesShort:null)||this._defaults.monthNamesShort;var monthNames=(settings?settings.monthNames:null)||this._defaults.monthNames;var year=-1;var month=-1;var day=-1;var doy=-1;var literal=false;var lookAhead=function(match){var matches=(iFormat+1<format.length&&format.charAt(iFormat+1)==match);if(matches){iFormat++}return matches};var getNumber=function(match){lookAhead(match);var origSize=(match=="@"?14:(match=="y"?4:(match=="o"?3:2)));var size=origSize;var num=0;while(size>0&&iValue<value.length&&value.charAt(iValue)>="0"&&value.charAt(iValue)<="9"){num=num*10+parseInt(value.charAt(iValue++),10);size--}if(size==origSize){throw"Missing number at position "+iValue}return num};var getName=function(match,shortNames,longNames){var names=(lookAhead(match)?longNames:shortNames);var size=0;for(var j=0;j<names.length;j++){size=Math.max(size,names[j].length)}var name="";var iInit=iValue;while(size>0&&iValue<value.length){name+=value.charAt(iValue++);for(var i=0;i<names.length;i++){if(name==names[i]){return i+1}}size--}throw"Unknown name at position "+iInit};var checkLiteral=function(){if(value.charAt(iValue)!=format.charAt(iFormat)){throw"Unexpected literal at position "+iValue}iValue++};var iValue=0;for(var iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)=="'"&&!lookAhead("'")){literal=false}else{checkLiteral()}}else{switch(format.charAt(iFormat)){case"d":day=getNumber("d");break;case"D":getName("D",dayNamesShort,dayNames);break;case"o":doy=getNumber("o");break;case"m":month=getNumber("m");break;case"M":month=getName("M",monthNamesShort,monthNames);break;case"y":year=getNumber("y");break;case"@":var date=new Date(getNumber("@"));year=date.getFullYear();month=date.getMonth()+1;day=date.getDate();break;case"'":if(lookAhead("'")){checkLiteral()}else{literal=true}break;default:checkLiteral()}}}if(year==-1){year=new Date().getFullYear()}else{if(year<100){year+=new Date().getFullYear()-new Date().getFullYear()%100+(year<=shortYearCutoff?0:-100)}}if(doy>-1){month=1;day=doy;do{var dim=this._getDaysInMonth(year,month-1);if(day<=dim){break}month++;day-=dim}while(true)}var date=this._daylightSavingAdjust(new Date(year,month-1,day));if(date.getFullYear()!=year||date.getMonth()+1!=month||date.getDate()!=day){throw"Invalid date"}return date},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TIMESTAMP:"@",W3C:"yy-mm-dd",formatDate:function(format,date,settings){if(!date){return""}var dayNamesShort=(settings?settings.dayNamesShort:null)||this._defaults.dayNamesShort;var dayNames=(settings?settings.dayNames:null)||this._defaults.dayNames;var monthNamesShort=(settings?settings.monthNamesShort:null)||this._defaults.monthNamesShort;var monthNames=(settings?settings.monthNames:null)||this._defaults.monthNames;var lookAhead=function(match){var matches=(iFormat+1<format.length&&format.charAt(iFormat+1)==match);if(matches){iFormat++}return matches};var formatNumber=function(match,value,len){var num=""+value;if(lookAhead(match)){while(num.length<len){num="0"+num}}return num};var formatName=function(match,value,shortNames,longNames){return(lookAhead(match)?longNames[value]:shortNames[value])};var output="";var literal=false;if(date){for(var iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)=="'"&&!lookAhead("'")){literal=false}else{output+=format.charAt(iFormat)}}else{switch(format.charAt(iFormat)){case"d":output+=formatNumber("d",date.getDate(),2);break;case"D":output+=formatName("D",date.getDay(),dayNamesShort,dayNames);break;case"o":var doy=date.getDate();for(var m=date.getMonth()-1;m>=0;m--){doy+=this._getDaysInMonth(date.getFullYear(),m)}output+=formatNumber("o",doy,3);break;case"m":output+=formatNumber("m",date.getMonth()+1,2);break;case"M":output+=formatName("M",date.getMonth(),monthNamesShort,monthNames);break;case"y":output+=(lookAhead("y")?date.getFullYear():(date.getYear()%100<10?"0":"")+date.getYear()%100);break;case"@":output+=date.getTime();break;case"'":if(lookAhead("'")){output+="'"}else{literal=true}break;default:output+=format.charAt(iFormat)}}}}return output},_possibleChars:function(format){var chars="";var literal=false;for(var iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)=="'"&&!lookAhead("'")){literal=false}else{chars+=format.charAt(iFormat)}}else{switch(format.charAt(iFormat)){case"d":case"m":case"y":case"@":chars+="0123456789";break;case"D":case"M":return null;case"'":if(lookAhead("'")){chars+="'"}else{literal=true}break;default:chars+=format.charAt(iFormat)}}}return chars},_get:function(inst,name){return inst.settings[name]!==undefined?inst.settings[name]:this._defaults[name]},_setDateFromField:function(inst){var dateFormat=this._get(inst,"dateFormat");var dates=inst.input?inst.input.val():null;inst.endDay=inst.endMonth=inst.endYear=null;var date=defaultDate=this._getDefaultDate(inst);var settings=this._getFormatConfig(inst);try{date=this.parseDate(dateFormat,dates,settings)||defaultDate}catch(event){this.log(event);date=defaultDate}inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear();inst.currentDay=(dates?date.getDate():0);inst.currentMonth=(dates?date.getMonth():0);inst.currentYear=(dates?date.getFullYear():0);this._adjustInstDate(inst)},_getDefaultDate:function(inst){var date=this._determineDate(this._get(inst,"defaultDate"),new Date());var minDate=this._getMinMaxDate(inst,"min",true);var maxDate=this._getMinMaxDate(inst,"max");date=(minDate&&date<minDate?minDate:date);date=(maxDate&&date>maxDate?maxDate:date);return date},_determineDate:function(date,defaultDate){var offsetNumeric=function(offset){var date=new Date();date.setDate(date.getDate()+offset);return date};var offsetString=function(offset,getDaysInMonth){var date=new Date();var year=date.getFullYear();var month=date.getMonth();var day=date.getDate();var pattern=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g;var matches=pattern.exec(offset);while(matches){switch(matches[2]||"d"){case"d":case"D":day+=parseInt(matches[1],10);break;case"w":case"W":day+=parseInt(matches[1],10)*7;break;case"m":case"M":month+=parseInt(matches[1],10);day=Math.min(day,getDaysInMonth(year,month));break;case"y":case"Y":year+=parseInt(matches[1],10);day=Math.min(day,getDaysInMonth(year,month));break}matches=pattern.exec(offset)}return new Date(year,month,day)};date=(date==null?defaultDate:(typeof date=="string"?offsetString(date,this._getDaysInMonth):(typeof date=="number"?(isNaN(date)?defaultDate:offsetNumeric(date)):date)));date=(date&&date.toString()=="Invalid Date"?defaultDate:date);if(date){date.setHours(0);date.setMinutes(0);date.setSeconds(0);date.setMilliseconds(0)}return this._daylightSavingAdjust(date)},_daylightSavingAdjust:function(date){if(!date){return null}date.setHours(date.getHours()>12?date.getHours()+2:0);return date},_setDate:function(inst,date,endDate){var clear=!(date);var origMonth=inst.selectedMonth;var origYear=inst.selectedYear;date=this._determineDate(date,new Date());inst.selectedDay=inst.currentDay=date.getDate();inst.drawMonth=inst.selectedMonth=inst.currentMonth=date.getMonth();inst.drawYear=inst.selectedYear=inst.currentYear=date.getFullYear();if(origMonth!=inst.selectedMonth||origYear!=inst.selectedYear){this._notifyChange(inst)}this._adjustInstDate(inst);if(inst.input){inst.input.val(clear?"":this._formatDate(inst))}},_getDate:function(inst){var startDate=(!inst.currentYear||(inst.input&&inst.input.val()=="")?null:this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));return startDate},_generateHTML:function(inst){var today=new Date();today=this._daylightSavingAdjust(new Date(today.getFullYear(),today.getMonth(),today.getDate()));var isRTL=this._get(inst,"isRTL");var showButtonPanel=this._get(inst,"showButtonPanel");var hideIfNoPrevNext=this._get(inst,"hideIfNoPrevNext");var navigationAsDateFormat=this._get(inst,"navigationAsDateFormat");var numMonths=this._getNumberOfMonths(inst);var showCurrentAtPos=this._get(inst,"showCurrentAtPos");var stepMonths=this._get(inst,"stepMonths");var stepBigMonths=this._get(inst,"stepBigMonths");var isMultiMonth=(numMonths[0]!=1||numMonths[1]!=1);var currentDate=this._daylightSavingAdjust((!inst.currentDay?new Date(9999,9,9):new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));var minDate=this._getMinMaxDate(inst,"min",true);var maxDate=this._getMinMaxDate(inst,"max");var drawMonth=inst.drawMonth-showCurrentAtPos;var drawYear=inst.drawYear;if(drawMonth<0){drawMonth+=12;drawYear--}if(maxDate){var maxDraw=this._daylightSavingAdjust(new Date(maxDate.getFullYear(),maxDate.getMonth()-numMonths[1]+1,maxDate.getDate()));maxDraw=(minDate&&maxDraw<minDate?minDate:maxDraw);while(this._daylightSavingAdjust(new Date(drawYear,drawMonth,1))>maxDraw){drawMonth--;if(drawMonth<0){drawMonth=11;drawYear--}}}inst.drawMonth=drawMonth;inst.drawYear=drawYear;var prevText=this._get(inst,"prevText");prevText=(!navigationAsDateFormat?prevText:this.formatDate(prevText,this._daylightSavingAdjust(new Date(drawYear,drawMonth-stepMonths,1)),this._getFormatConfig(inst)));var prev=(this._canAdjustMonth(inst,-1,drawYear,drawMonth)?'<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery.datepicker._adjustDate(\'#'+inst.id+"', -"+stepMonths+", 'M');\" title=\""+prevText+'"><span class="ui-icon ui-icon-circle-triangle-'+(isRTL?"e":"w")+'">'+prevText+"</span></a>":(hideIfNoPrevNext?"":'<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+prevText+'"><span class="ui-icon ui-icon-circle-triangle-'+(isRTL?"e":"w")+'">'+prevText+"</span></a>"));var nextText=this._get(inst,"nextText");nextText=(!navigationAsDateFormat?nextText:this.formatDate(nextText,this._daylightSavingAdjust(new Date(drawYear,drawMonth+stepMonths,1)),this._getFormatConfig(inst)));var next=(this._canAdjustMonth(inst,+1,drawYear,drawMonth)?'<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery.datepicker._adjustDate(\'#'+inst.id+"', +"+stepMonths+", 'M');\" title=\""+nextText+'"><span class="ui-icon ui-icon-circle-triangle-'+(isRTL?"w":"e")+'">'+nextText+"</span></a>":(hideIfNoPrevNext?"":'<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+nextText+'"><span class="ui-icon ui-icon-circle-triangle-'+(isRTL?"w":"e")+'">'+nextText+"</span></a>"));var currentText=this._get(inst,"currentText");var gotoDate=(this._get(inst,"gotoCurrent")&&inst.currentDay?currentDate:today);currentText=(!navigationAsDateFormat?currentText:this.formatDate(currentText,gotoDate,this._getFormatConfig(inst)));var controls=(!inst.inline?'<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery.datepicker._hideDatepicker();">'+this._get(inst,"closeText")+"</button>":"");var buttonPanel=(showButtonPanel)?'<div class="ui-datepicker-buttonpane ui-widget-content">'+(isRTL?controls:"")+(this._isInRange(inst,gotoDate)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery.datepicker._gotoToday(\'#'+inst.id+"');\">"+currentText+"</button>":"")+(isRTL?"":controls)+"</div>":"";var firstDay=parseInt(this._get(inst,"firstDay"),10);firstDay=(isNaN(firstDay)?0:firstDay);var dayNames=this._get(inst,"dayNames");var dayNamesShort=this._get(inst,"dayNamesShort");var dayNamesMin=this._get(inst,"dayNamesMin");var monthNames=this._get(inst,"monthNames");var monthNamesShort=this._get(inst,"monthNamesShort");var beforeShowDay=this._get(inst,"beforeShowDay");var showOtherMonths=this._get(inst,"showOtherMonths");var calculateWeek=this._get(inst,"calculateWeek")||this.iso8601Week;var endDate=inst.endDay?this._daylightSavingAdjust(new Date(inst.endYear,inst.endMonth,inst.endDay)):currentDate;var defaultDate=this._getDefaultDate(inst);var html="";for(var row=0;row<numMonths[0];row++){var group="";for(var col=0;col<numMonths[1];col++){var selectedDate=this._daylightSavingAdjust(new Date(drawYear,drawMonth,inst.selectedDay));var cornerClass=" ui-corner-all";var calender="";if(isMultiMonth){calender+='<div class="ui-datepicker-group ui-datepicker-group-';switch(col){case 0:calender+="first";cornerClass=" ui-corner-"+(isRTL?"right":"left");break;case numMonths[1]-1:calender+="last";cornerClass=" ui-corner-"+(isRTL?"left":"right");break;default:calender+="middle";cornerClass="";break}calender+='">'}calender+='<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'+cornerClass+'">'+(/all|left/.test(cornerClass)&&row==0?(isRTL?next:prev):"")+(/all|right/.test(cornerClass)&&row==0?(isRTL?prev:next):"")+this._generateMonthYearHeader(inst,drawMonth,drawYear,minDate,maxDate,selectedDate,row>0||col>0,monthNames,monthNamesShort)+'</div><table class="ui-datepicker-calendar"><thead><tr>';var thead="";for(var dow=0;dow<7;dow++){var day=(dow+firstDay)%7;thead+="<th"+((dow+firstDay+6)%7>=5?' class="ui-datepicker-week-end"':"")+'><span title="'+dayNames[day]+'">'+dayNamesMin[day]+"</span></th>"}calender+=thead+"</tr></thead><tbody>";var daysInMonth=this._getDaysInMonth(drawYear,drawMonth);if(drawYear==inst.selectedYear&&drawMonth==inst.selectedMonth){inst.selectedDay=Math.min(inst.selectedDay,daysInMonth)}var leadDays=(this._getFirstDayOfMonth(drawYear,drawMonth)-firstDay+7)%7;var numRows=(isMultiMonth?6:Math.ceil((leadDays+daysInMonth)/7));var printDate=this._daylightSavingAdjust(new Date(drawYear,drawMonth,1-leadDays));for(var dRow=0;dRow<numRows;dRow++){calender+="<tr>";var tbody="";for(var dow=0;dow<7;dow++){var daySettings=(beforeShowDay?beforeShowDay.apply((inst.input?inst.input[0]:null),[printDate]):[true,""]);var otherMonth=(printDate.getMonth()!=drawMonth);var unselectable=otherMonth||!daySettings[0]||(minDate&&printDate<minDate)||(maxDate&&printDate>maxDate);tbody+='<td class="'+((dow+firstDay+6)%7>=5?" ui-datepicker-week-end":"")+(otherMonth?" ui-datepicker-other-month":"")+((printDate.getTime()==selectedDate.getTime()&&drawMonth==inst.selectedMonth&&inst._keyEvent)||(defaultDate.getTime()==printDate.getTime()&&defaultDate.getTime()==selectedDate.getTime())?" "+this._dayOverClass:"")+(unselectable?" "+this._unselectableClass+" ui-state-disabled":"")+(otherMonth&&!showOtherMonths?"":" "+daySettings[1]+(printDate.getTime()>=currentDate.getTime()&&printDate.getTime()<=endDate.getTime()?" "+this._currentClass:"")+(printDate.getTime()==today.getTime()?" ui-datepicker-today":""))+'"'+((!otherMonth||showOtherMonths)&&daySettings[2]?' title="'+daySettings[2]+'"':"")+(unselectable?"":" onclick=\"DP_jQuery.datepicker._selectDay('#"+inst.id+"',"+drawMonth+","+drawYear+', this);return false;"')+">"+(otherMonth?(showOtherMonths?printDate.getDate():"&#xa0;"):(unselectable?'<span class="ui-state-default">'+printDate.getDate()+"</span>":'<a class="ui-state-default'+(printDate.getTime()==today.getTime()?" ui-state-highlight":"")+(printDate.getTime()>=currentDate.getTime()&&printDate.getTime()<=endDate.getTime()?" ui-state-active":"")+'" href="#">'+printDate.getDate()+"</a>"))+"</td>";printDate.setDate(printDate.getDate()+1);printDate=this._daylightSavingAdjust(printDate)}calender+=tbody+"</tr>"}drawMonth++;if(drawMonth>11){drawMonth=0;drawYear++}calender+="</tbody></table>"+(isMultiMonth?"</div>"+((numMonths[0]>0&&col==numMonths[1]-1)?'<div class="ui-datepicker-row-break"></div>':""):"");group+=calender}html+=group}html+=buttonPanel+($.browser.msie&&parseInt($.browser.version,10)<7&&!inst.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>':"");inst._keyEvent=false;return html},_generateMonthYearHeader:function(inst,drawMonth,drawYear,minDate,maxDate,selectedDate,secondary,monthNames,monthNamesShort){minDate=(inst.rangeStart&&minDate&&selectedDate<minDate?selectedDate:minDate);var changeMonth=this._get(inst,"changeMonth");var changeYear=this._get(inst,"changeYear");var showMonthAfterYear=this._get(inst,"showMonthAfterYear");var html='<div class="ui-datepicker-title">';var monthHtml="";if(secondary||!changeMonth){monthHtml+='<span class="ui-datepicker-month">'+monthNames[drawMonth]+"</span> "}else{var inMinYear=(minDate&&minDate.getFullYear()==drawYear);var inMaxYear=(maxDate&&maxDate.getFullYear()==drawYear);monthHtml+='<select class="ui-datepicker-month" onchange="DP_jQuery.datepicker._selectMonthYear(\'#'+inst.id+"', this, 'M');\" onclick=\"DP_jQuery.datepicker._clickMonthYear('#"+inst.id+"');\">";for(var month=0;month<12;month++){if((!inMinYear||month>=minDate.getMonth())&&(!inMaxYear||month<=maxDate.getMonth())){monthHtml+='<option value="'+month+'"'+(month==drawMonth?' selected="selected"':"")+">"+monthNamesShort[month]+"</option>"}}monthHtml+="</select>"}if(!showMonthAfterYear){html+=monthHtml+((secondary||changeMonth||changeYear)&&(!(changeMonth&&changeYear))?"&#xa0;":"")}if(secondary||!changeYear){html+='<span class="ui-datepicker-year">'+drawYear+"</span>"}else{var years=this._get(inst,"yearRange").split(":");var year=0;var endYear=0;if(years.length!=2){year=drawYear-10;endYear=drawYear+10}else{if(years[0].charAt(0)=="+"||years[0].charAt(0)=="-"){year=drawYear+parseInt(years[0],10);endYear=drawYear+parseInt(years[1],10)}else{year=parseInt(years[0],10);endYear=parseInt(years[1],10)}}year=(minDate?Math.max(year,minDate.getFullYear()):year);endYear=(maxDate?Math.min(endYear,maxDate.getFullYear()):endYear);html+='<select class="ui-datepicker-year" onchange="DP_jQuery.datepicker._selectMonthYear(\'#'+inst.id+"', this, 'Y');\" onclick=\"DP_jQuery.datepicker._clickMonthYear('#"+inst.id+"');\">";for(;year<=endYear;year++){html+='<option value="'+year+'"'+(year==drawYear?' selected="selected"':"")+">"+year+"</option>"}html+="</select>"}if(showMonthAfterYear){html+=(secondary||changeMonth||changeYear?"&#xa0;":"")+monthHtml}html+="</div>";return html},_adjustInstDate:function(inst,offset,period){var year=inst.drawYear+(period=="Y"?offset:0);var month=inst.drawMonth+(period=="M"?offset:0);var day=Math.min(inst.selectedDay,this._getDaysInMonth(year,month))+(period=="D"?offset:0);var date=this._daylightSavingAdjust(new Date(year,month,day));var minDate=this._getMinMaxDate(inst,"min",true);var maxDate=this._getMinMaxDate(inst,"max");date=(minDate&&date<minDate?minDate:date);date=(maxDate&&date>maxDate?maxDate:date);inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear();if(period=="M"||period=="Y"){this._notifyChange(inst)}},_notifyChange:function(inst){var onChange=this._get(inst,"onChangeMonthYear");if(onChange){onChange.apply((inst.input?inst.input[0]:null),[inst.selectedYear,inst.selectedMonth+1,inst])}},_getNumberOfMonths:function(inst){var numMonths=this._get(inst,"numberOfMonths");return(numMonths==null?[1,1]:(typeof numMonths=="number"?[1,numMonths]:numMonths))},_getMinMaxDate:function(inst,minMax,checkRange){var date=this._determineDate(this._get(inst,minMax+"Date"),null);return(!checkRange||!inst.rangeStart?date:(!date||inst.rangeStart>date?inst.rangeStart:date))},_getDaysInMonth:function(year,month){return 32-new Date(year,month,32).getDate()},_getFirstDayOfMonth:function(year,month){return new Date(year,month,1).getDay()},_canAdjustMonth:function(inst,offset,curYear,curMonth){var numMonths=this._getNumberOfMonths(inst);var date=this._daylightSavingAdjust(new Date(curYear,curMonth+(offset<0?offset:numMonths[1]),1));if(offset<0){date.setDate(this._getDaysInMonth(date.getFullYear(),date.getMonth()))}return this._isInRange(inst,date)},_isInRange:function(inst,date){var newMinDate=(!inst.rangeStart?null:this._daylightSavingAdjust(new Date(inst.selectedYear,inst.selectedMonth,inst.selectedDay)));newMinDate=(newMinDate&&inst.rangeStart<newMinDate?inst.rangeStart:newMinDate);var minDate=newMinDate||this._getMinMaxDate(inst,"min");var maxDate=this._getMinMaxDate(inst,"max");return((!minDate||date>=minDate)&&(!maxDate||date<=maxDate))},_getFormatConfig:function(inst){var shortYearCutoff=this._get(inst,"shortYearCutoff");shortYearCutoff=(typeof shortYearCutoff!="string"?shortYearCutoff:new Date().getFullYear()%100+parseInt(shortYearCutoff,10));return{shortYearCutoff:shortYearCutoff,dayNamesShort:this._get(inst,"dayNamesShort"),dayNames:this._get(inst,"dayNames"),monthNamesShort:this._get(inst,"monthNamesShort"),monthNames:this._get(inst,"monthNames")}},_formatDate:function(inst,day,month,year){if(!day){inst.currentDay=inst.selectedDay;inst.currentMonth=inst.selectedMonth;inst.currentYear=inst.selectedYear}var date=(day?(typeof day=="object"?day:this._daylightSavingAdjust(new Date(year,month,day))):this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));return this.formatDate(this._get(inst,"dateFormat"),date,this._getFormatConfig(inst))}});function extendRemove(target,props){$.extend(target,props);for(var name in props){if(props[name]==null||props[name]==undefined){target[name]=props[name]}}return target}function isArray(a){return(a&&(($.browser.safari&&typeof a=="object"&&a.length)||(a.constructor&&a.constructor.toString().match(/\Array\(\)/))))}$.fn.datepicker=function(options){if(!$.datepicker.initialized){$(document).mousedown($.datepicker._checkExternalClick).find("body").append($.datepicker.dpDiv);$.datepicker.initialized=true}var otherArgs=Array.prototype.slice.call(arguments,1);if(typeof options=="string"&&(options=="isDisabled"||options=="getDate")){return $.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this[0]].concat(otherArgs))}if(options=="option"&&arguments.length==2&&typeof arguments[1]=="string"){return $.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this[0]].concat(otherArgs))}return this.each(function(){typeof options=="string"?$.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this].concat(otherArgs)):$.datepicker._attachDatepicker(this,options)})};$.datepicker=new Datepicker();$.datepicker.initialized=false;$.datepicker.uuid=new Date().getTime();$.datepicker.version="1.7.2";window.DP_jQuery=$})(jQuery);jQuery(function(A){A.datepicker.regional.pl={clearText:"Wyczyść",clearStatus:"Wyczyść obecną datę",closeText:"Zamknij",closeStatus:"Zamknij bez zapisywania",prevText:"&#x3c;Poprzedni",prevStatus:"Pokaż poprzedni miesiąc",prevBigText:"&#x3c;&#x3c;",prevBigStatus:"",nextText:"Następny&#x3e;",nextStatus:"Pokaż następny miesiąc",nextBigText:"&#x3e;&#x3e;",nextBigStatus:"",currentText:"Dziś",currentStatus:"Pokaż aktualny miesiąc",monthNames:["Styczeń","Luty","Marzec","Kwiecień","Maj","Czerwiec","Lipiec","Sierpień","Wrzesień","Październik","Listopad","Grudzień"],monthNamesShort:["Sty","Lu","Mar","Kw","Maj","Cze","Lip","Sie","Wrz","Pa","Lis","Gru"],monthStatus:"Pokaż inny miesiąc",yearStatus:"Pokaż inny rok",weekHeader:"Tydz",weekStatus:"Tydzień roku",dayNames:["Niedziela","Poniedzialek","Wtorek","Środa","Czwartek","Piątek","Sobota"],dayNamesShort:["Nie","Pn","Wt","Śr","Czw","Pt","So"],dayNamesMin:["N","Pn","Wt","Śr","Cz","Pt","So"],dayStatus:"Ustaw DD jako pierwszy dzień tygodnia",dateStatus:"Wybierz D, M d",dateFormat:"yy-mm-dd",firstDay:1,initStatus:"Wybierz datę",isRTL:false};A.datepicker.setDefaults(A.datepicker.regional.pl)});jQuery(function(A){A.datepicker.regional.fr={clearText:"Effacer",clearStatus:"",closeText:"Fermer",closeStatus:"Fermer sans modifier",prevText:"&#x3c;Préc",prevStatus:"Voir le mois précédent",prevBigText:"&#x3c;&#x3c;",prevBigStatus:"",nextText:"Suiv&#x3e;",nextStatus:"Voir le mois suivant",nextBigText:"&#x3e;&#x3e;",nextBigStatus:"",currentText:"Courant",currentStatus:"Voir le mois courant",monthNames:["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"],monthNamesShort:["Jan","Fév","Mar","Avr","Mai","Jun","Jul","Aoû","Sep","Oct","Nov","Déc"],monthStatus:"Voir un autre mois",yearStatus:"Voir un autre année",weekHeader:"Sm",weekStatus:"",dayNames:["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi"],dayNamesShort:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],dayNamesMin:["Di","Lu","Ma","Me","Je","Ve","Sa"],dayStatus:"Utiliser DD comme premier jour de la semaine",dateStatus:"Choisir le DD, MM d",dateFormat:"dd/mm/yy",firstDay:0,initStatus:"Choisir la date",isRTL:false};A.datepicker.setDefaults(A.datepicker.regional.fr)});(function(B){B.fn.caret=function(E,C){if(this.length==0){return }if(typeof E=="number"){C=(typeof C=="number")?C:E;return this.each(function(){if(this.setSelectionRange){this.focus();this.setSelectionRange(E,C)}else{if(this.createTextRange){var F=this.createTextRange();F.collapse(true);F.moveEnd("character",C);F.moveStart("character",E);F.select()}}})}else{if(this[0].setSelectionRange){E=this[0].selectionStart;C=this[0].selectionEnd}else{if(document.selection&&document.selection.createRange){var D=document.selection.createRange();E=0-D.duplicate().moveStart("character",-100000);C=E+D.text.length}}return{begin:E,end:C}}};var A={"9":"[0-9]",a:"[A-Za-z]","*":"[A-Za-z0-9]","+":"[+-]"};B.mask={addPlaceholder:function(D,C){A[D]=C}};B.fn.unmask=function(){return this.trigger("unmask")};B.fn.mask=function(C,E){E=B.extend({placeholder:"_",completed:null},E);var D=new RegExp("^"+B.map(C.split(""),function(G,F){return A[G]||((/[A-Za-z0-9]/.test(G)?"":"\\")+G)}).join("")+"$");return this.each(function(){var O=B(this);var I=new Array(C.length);var J=new Array(C.length);var F=false;var N=false;var Q=null;B.each(C.split(""),function(S,T){J[S]=(A[T]==null);I[S]=J[S]?T:E.placeholder;if(!J[S]&&Q==null){Q=S}});function P(){H();L();setTimeout(function(){B(O[0]).caret(F?C.length:Q)},0)}function K(T){var U=B(this).caret();var S=T.keyCode;N=(S<16||(S>16&&S<32)||(S>32&&S<41));if((U.begin-U.end)!=0&&(!N||S==8||S==46)){G(U.begin,U.end)}if(S==8){while(U.begin-->=0){if(!J[U.begin]){I[U.begin]=E.placeholder;if(B.browser.opera){s=L();O.val(s.substring(0,U.begin)+" "+s.substring(U.begin));B(this).caret(U.begin+1)}else{L();B(this).caret(Math.max(Q,U.begin))}return false}}}else{if(S==46){G(U.begin,U.begin+1);L();B(this).caret(Math.max(Q,U.begin));return false}else{if(S==27){G(0,C.length);L();B(this).caret(Q);return false}}}}function R(V){if(N){N=false;return(V.keyCode==8)?false:null}V=V||window.event;var S=V.charCode||V.keyCode||V.which;var W=B(this).caret();if(V.ctrlKey||V.altKey){return true}else{if((S>=41&&S<=122)||S==32||S>186){var U=M(W.begin-1);if(U<C.length){if(new RegExp(A[C.charAt(U)]).test(String.fromCharCode(S))){I[U]=String.fromCharCode(S);L();var T=M(U);B(this).caret(T);if(E.completed&&T==C.length){E.completed.call(O)}}}}}return false}function G(U,S){for(var T=U;T<S&&T<C.length;T++){if(!J[T]){I[T]=E.placeholder}}}function L(){return O.val(I.join("")).val()}function H(){var W=O.val();var V=0;for(var T=0;T<C.length;T++){if(!J[T]){I[T]=E.placeholder;while(V++<W.length){var S=new RegExp(A[C.charAt(T)]);if(W.charAt(V-1).match(S)){I[T]=W.charAt(V-1);break}}}}var U=L();if(!U.match(D)){O.val("");G(0,C.length);F=false}else{F=true}}function M(S){while(++S<C.length){if(!J[S]){return S}}return C.length}O.one("unmask",function(){O.unbind("focus",P);O.unbind("blur",H);O.unbind("keydown",K);O.unbind("keypress",R);if(B.browser.msie){this.onpaste=null}else{if(B.browser.mozilla){this.removeEventListener("input",H,false)}}});O.bind("focus",P);O.bind("blur",H);O.bind("keydown",K);O.bind("keypress",R);if(B.browser.msie){this.onpaste=function(){setTimeout(H,0)}}else{if(B.browser.mozilla){this.addEventListener("input",H,false)}}H()})}})(jQuery);(function(A){A.extend(A.fn,{validate:function(B){if(!this.length){B&&B.debug&&window.console&&console.warn("nothing selected, can't validate, returning nothing");return }var C=A.data(this[0],"validator");if(C){return C}C=new A.validator(B,this[0]);A.data(this[0],"validator",C);if(C.settings.onsubmit){this.find("input, button").filter(".cancel").click(function(){C.cancelSubmit=true});if(C.settings.submitHandler){this.find("input, button").filter(":submit").click(function(){C.submitButton=this})}this.submit(function(D){if(C.settings.debug){D.preventDefault()}function E(){if(C.settings.submitHandler){if(C.submitButton){var F=A("<input type='hidden'/>").attr("name",C.submitButton.name).val(C.submitButton.value).appendTo(C.currentForm)}C.settings.submitHandler.call(C,C.currentForm);if(C.submitButton){F.remove()}return false}return true}if(C.cancelSubmit){C.cancelSubmit=false;return E()}if(C.form()){if(C.pendingRequest){C.formSubmitted=true;return false}return E()}else{C.focusInvalid();return false}})}return C},valid:function(){if(A(this[0]).is("form")){return this.validate().form()}else{var C=true;var B=A(this[0].form).validate();this.each(function(){C&=B.element(this)});return C}},removeAttrs:function(D){var B={},C=this;A.each(D.split(/\s/),function(E,F){B[F]=C.attr(F);C.removeAttr(F)});return B},rules:function(E,B){var G=this[0];if(E){var D=A.data(G.form,"validator").settings;var I=D.rules;var J=A.validator.staticRules(G);switch(E){case"add":A.extend(J,A.validator.normalizeRule(B));I[G.name]=J;if(B.messages){D.messages[G.name]=A.extend(D.messages[G.name],B.messages)}break;case"remove":if(!B){delete I[G.name];return J}var H={};A.each(B.split(/\s/),function(K,L){H[L]=J[L];delete J[L]});return H}}var F=A.validator.normalizeRules(A.extend({},A.validator.metadataRules(G),A.validator.classRules(G),A.validator.attributeRules(G),A.validator.staticRules(G)),G);if(F.required){var C=F.required;delete F.required;F=A.extend({required:C},F)}return F}});A.extend(A.expr[":"],{blank:function(B){return !A.trim(B.value)},filled:function(B){return !!A.trim(B.value)},unchecked:function(B){return !B.checked}});A.validator=function(B,C){this.settings=A.extend({},A.validator.defaults,B);this.currentForm=C;this.init()};A.validator.format=function(B,C){if(arguments.length==1){return function(){var D=A.makeArray(arguments);D.unshift(B);return A.validator.format.apply(this,D)}}if(arguments.length>2&&C.constructor!=Array){C=A.makeArray(arguments).slice(1)}if(C.constructor!=Array){C=[C]}A.each(C,function(D,E){B=B.replace(new RegExp("\\{"+D+"\\}","g"),E)});return B};A.extend(A.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",validClass:"valid",errorElement:"label",focusInvalid:true,errorContainer:A([]),errorLabelContainer:A([]),onsubmit:true,ignore:[],ignoreTitle:false,onfocusin:function(B){this.lastActive=B;if(this.settings.focusCleanup&&!this.blockFocusCleanup){this.settings.unhighlight&&this.settings.unhighlight.call(this,B,this.settings.errorClass,this.settings.validClass);this.errorsFor(B).hide()}},onfocusout:function(B){if(!this.checkable(B)&&(B.name in this.submitted||!this.optional(B))){this.element(B)}},onkeyup:function(B){if(B.name in this.submitted||B==this.lastElement){this.element(B)}},onclick:function(B){if(B.name in this.submitted){this.element(B)}},highlight:function(D,B,C){A(D).addClass(B).removeClass(C)},unhighlight:function(D,B,C){A(D).removeClass(B).addClass(C)}},setDefaults:function(B){A.extend(A.validator.defaults,B)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",dateDE:"Bitte geben Sie ein gültiges Datum ein.",number:"Please enter a valid number.",numberDE:"Bitte geben Sie eine Nummer ein.",digits:"Please enter only digits",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",accept:"Please enter a value with a valid extension.",maxlength:A.validator.format("Please enter no more than {0} characters."),minlength:A.validator.format("Please enter at least {0} characters."),rangelength:A.validator.format("Please enter a value between {0} and {1} characters long."),range:A.validator.format("Please enter a value between {0} and {1}."),max:A.validator.format("Please enter a value less than or equal to {0}."),min:A.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:false,prototype:{init:function(){this.labelContainer=A(this.settings.errorLabelContainer);this.errorContext=this.labelContainer.length&&this.labelContainer||A(this.currentForm);this.containers=A(this.settings.errorContainer).add(this.settings.errorLabelContainer);this.submitted={};this.valueCache={};this.pendingRequest=0;this.pending={};this.invalid={};this.reset();var B=(this.groups={});A.each(this.settings.groups,function(E,F){A.each(F.split(/\s/),function(H,G){B[G]=E})});var D=this.settings.rules;A.each(D,function(E,F){D[E]=A.validator.normalizeRule(F)});function C(F){var E=A.data(this[0].form,"validator");E.settings["on"+F.type]&&E.settings["on"+F.type].call(E,this[0])}A(this.currentForm).delegate("focusin focusout keyup",":text, :password, :file, select, textarea",C).delegate("click",":radio, :checkbox",C);if(this.settings.invalidHandler){A(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler)}},form:function(){this.checkForm();A.extend(this.submitted,this.errorMap);this.invalid=A.extend({},this.errorMap);if(!this.valid()){A(this.currentForm).triggerHandler("invalid-form",[this])}this.showErrors();return this.valid()},checkForm:function(){this.prepareForm();for(var B=0,C=(this.currentElements=this.elements());C[B];B++){this.check(C[B])}return this.valid()},element:function(C){C=this.clean(C);this.lastElement=C;this.prepareElement(C);this.currentElements=A(C);var B=this.check(C);if(B){delete this.invalid[C.name]}else{this.invalid[C.name]=true}if(!this.numberOfInvalids()){this.toHide=this.toHide.add(this.containers)}this.showErrors();return B},showErrors:function(C){if(C){A.extend(this.errorMap,C);this.errorList=[];for(var B in C){this.errorList.push({message:C[B],element:this.findByName(B)[0]})}this.successList=A.grep(this.successList,function(D){return !(D.name in C)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){if(A.fn.resetForm){A(this.currentForm).resetForm()}this.submitted={};this.prepareForm();this.hideErrors();this.elements().removeClass(this.settings.errorClass)},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(D){var C=0;for(var B in D){C++}return C},hideErrors:function(){this.addWrapper(this.toHide).hide()},valid:function(){return this.size()==0},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid){try{A(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus()}catch(B){}}},findLastActive:function(){var B=this.lastActive;return B&&A.grep(this.errorList,function(C){return C.element.name==B.name}).length==1&&B},elements:function(){var C=this,B={};return A([]).add(this.currentForm.elements).filter(":input").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){!this.name&&C.settings.debug&&window.console&&console.error("%o has no name assigned",this);if(this.name in B||!C.objectLength(A(this).rules())){return false}B[this.name]=true;return true})},clean:function(B){return A(B)[0]},errors:function(){return A(this.settings.errorElement+"."+this.settings.errorClass,this.errorContext)},reset:function(){this.successList=[];this.errorList=[];this.errorMap={};this.toShow=A([]);this.toHide=A([]);this.formSubmitted=false;this.currentElements=A([])},prepareForm:function(){this.reset();this.toHide=this.errors().add(this.containers)},prepareElement:function(B){this.reset();this.toHide=this.errorsFor(B)},check:function(C){C=this.clean(C);if(this.checkable(C)){C=this.findByName(C.name)[0]}var G=A(C).rules();var D=false;for(method in G){var F={method:method,parameters:G[method]};try{var B=A.validator.methods[method].call(this,C.value.replace(/\r/g,""),C,F.parameters);if(B=="dependency-mismatch"){D=true;continue}D=false;if(B=="pending"){this.toHide=this.toHide.not(this.errorsFor(C));return }if(!B){this.formatAndAdd(C,F);return false}}catch(E){this.settings.debug&&window.console&&console.log("exception occured when checking element "+C.id+", check the '"+F.method+"' method");throw E}}if(D){return }if(this.objectLength(G)){this.successList.push(C)}return true},customMetaMessage:function(B,D){if(!A.metadata){return }var C=this.settings.meta?A(B).metadata()[this.settings.meta]:A(B).metadata();return C&&C.messages&&C.messages[D]},customMessage:function(C,D){var B=this.settings.messages[C];return B&&(B.constructor==String?B:B[D])},findDefined:function(){for(var B=0;B<arguments.length;B++){if(arguments[B]!==undefined){return arguments[B]}}return undefined},defaultMessage:function(B,C){return this.findDefined(this.customMessage(B.name,C),this.customMetaMessage(B,C),!this.settings.ignoreTitle&&B.title||undefined,A.validator.messages[C],"<strong>Warning: No message defined for "+B.name+"</strong>")},formatAndAdd:function(B,D){var C=this.defaultMessage(B,D.method);if(typeof C=="function"){C=C.call(this,D.parameters,B)}this.errorList.push({message:C,element:B});this.errorMap[B.name]=C;this.submitted[B.name]=C},addWrapper:function(B){if(this.settings.wrapper){B=B.add(B.parent(this.settings.wrapper))}return B},defaultShowErrors:function(){for(var C=0;this.errorList[C];C++){var B=this.errorList[C];this.settings.highlight&&this.settings.highlight.call(this,B.element,this.settings.errorClass,this.settings.validClass);this.showLabel(B.element,B.message)}if(this.errorList.length){this.toShow=this.toShow.add(this.containers)}if(this.settings.success){for(var C=0;this.successList[C];C++){this.showLabel(this.successList[C])}}if(this.settings.unhighlight){for(var C=0,D=this.validElements();D[C];C++){this.settings.unhighlight.call(this,D[C],this.settings.errorClass,this.settings.validClass)}}this.toHide=this.toHide.not(this.toShow);this.hideErrors();this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return A(this.errorList).map(function(){return this.element})},showLabel:function(C,D){var B=this.errorsFor(C);if(B.length){B.removeClass().addClass(this.settings.errorClass);B.attr("generated")&&B.html(D)}else{B=A("<"+this.settings.errorElement+"/>").attr({"for":this.idOrName(C),generated:true}).addClass(this.settings.errorClass).html(D||"");if(this.settings.wrapper){B=B.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()}if(!this.labelContainer.append(B).length){this.settings.errorPlacement?this.settings.errorPlacement(B,A(C)):B.insertAfter(C)}}if(!D&&this.settings.success){B.text("");typeof this.settings.success=="string"?B.addClass(this.settings.success):this.settings.success(B)}this.toShow=this.toShow.add(B)},errorsFor:function(B){return this.errors().filter("[for='"+this.idOrName(B)+"']")},idOrName:function(B){return this.groups[B.name]||(this.checkable(B)?B.name:B.id||B.name)},checkable:function(B){return/radio|checkbox/i.test(B.type)},findByName:function(B){var C=this.currentForm;return A(document.getElementsByName(B)).map(function(D,E){return E.form==C&&E.name==B&&E||null})},getLength:function(C,B){switch(B.nodeName.toLowerCase()){case"select":return A("option:selected",B).length;case"input":if(this.checkable(B)){return this.findByName(B.name).filter(":checked").length}}return C.length},depend:function(C,B){return this.dependTypes[typeof C]?this.dependTypes[typeof C](C,B):true},dependTypes:{"boolean":function(C,B){return C},string:function(C,B){return !!A(C,B.form).length},"function":function(C,B){return C(B)}},optional:function(B){return !A.validator.methods.required.call(this,A.trim(B.value),B)&&"dependency-mismatch"},startRequest:function(B){if(!this.pending[B.name]){this.pendingRequest++;this.pending[B.name]=true}},stopRequest:function(B,C){this.pendingRequest--;if(this.pendingRequest<0){this.pendingRequest=0}delete this.pending[B.name];if(C&&this.pendingRequest==0&&this.formSubmitted&&this.form()){A(this.currentForm).submit()}else{if(!C&&this.pendingRequest==0&&this.formSubmitted){A(this.currentForm).triggerHandler("invalid-form",[this])}}},previousValue:function(B){return A.data(B,"previousValue")||A.data(B,"previousValue",previous={old:null,valid:true,message:this.defaultMessage(B,"remote")})}},classRuleSettings:{required:{required:true},email:{email:true},url:{url:true},date:{date:true},dateISO:{dateISO:true},dateDE:{dateDE:true},number:{number:true},numberDE:{numberDE:true},digits:{digits:true},creditcard:{creditcard:true}},addClassRules:function(B,C){B.constructor==String?this.classRuleSettings[B]=C:A.extend(this.classRuleSettings,B)},classRules:function(C){var D={};var B=A(C).attr("class");B&&A.each(B.split(" "),function(){if(this in A.validator.classRuleSettings){A.extend(D,A.validator.classRuleSettings[this])}});return D},attributeRules:function(C){var E={};var B=A(C);for(method in A.validator.methods){var D=B.attr(method);if(D){E[method]=D}}if(E.maxlength&&/-1|2147483647|524288/.test(E.maxlength)){delete E.maxlength}return E},metadataRules:function(B){if(!A.metadata){return{}}var C=A.data(B.form,"validator").settings.meta;return C?A(B).metadata()[C]:A(B).metadata()},staticRules:function(C){var D={};var B=A.data(C.form,"validator");if(B.settings.rules){D=A.validator.normalizeRule(B.settings.rules[C.name])||{}}return D},normalizeRules:function(C,B){A.each(C,function(F,E){if(E===false){delete C[F];return }if(E.param||E.depends){var D=true;switch(typeof E.depends){case"string":D=!!A(E.depends,B.form).length;break;case"function":D=E.depends.call(B,B);break}if(D){C[F]=E.param!==undefined?E.param:true}else{delete C[F]}}});A.each(C,function(D,E){C[D]=A.isFunction(E)?E(B):E});A.each(["minlength","maxlength","min","max"],function(){if(C[this]){C[this]=Number(C[this])}});A.each(["rangelength","range"],function(){if(C[this]){C[this]=[Number(C[this][0]),Number(C[this][1])]}});if(A.validator.autoCreateRanges){if(C.min&&C.max){C.range=[C.min,C.max];delete C.min;delete C.max}if(C.minlength&&C.maxlength){C.rangelength=[C.minlength,C.maxlength];delete C.minlength;delete C.maxlength}}if(C.messages){delete C.messages}return C},normalizeRule:function(C){if(typeof C=="string"){var B={};A.each(C.split(/\s/),function(){B[this]=true});C=B}return C},addMethod:function(B,D,C){A.validator.methods[B]=D;A.validator.messages[B]=C||A.validator.messages[B];if(D.length<3){A.validator.addClassRules(B,A.validator.normalizeRule(B))}},methods:{required:function(D,C,E){if(!this.depend(E,C)){return"dependency-mismatch"}switch(C.nodeName.toLowerCase()){case"select":var B=A("option:selected",C);return B.length>0&&(C.type=="select-multiple"||(A.browser.msie&&!(B[0].attributes.value.specified)?B[0].text:B[0].value).length>0);case"input":if(this.checkable(C)){return this.getLength(D,C)>0}default:return A.trim(D).length>0}},remote:function(F,C,G){if(this.optional(C)){return"dependency-mismatch"}var D=this.previousValue(C);if(!this.settings.messages[C.name]){this.settings.messages[C.name]={}}this.settings.messages[C.name].remote=typeof D.message=="function"?D.message(F):D.message;G=typeof G=="string"&&{url:G}||G;if(D.old!==F){D.old=F;var B=this;this.startRequest(C);var E={};E[C.name]=F;A.ajax(A.extend(true,{url:G,mode:"abort",port:"validate"+C.name,dataType:"json",data:E,success:function(I){var J=I===true;if(J){var H=B.formSubmitted;B.prepareElement(C);B.formSubmitted=H;B.successList.push(C);B.showErrors()}else{var K={};K[C.name]=D.message=I||B.defaultMessage(C,"remote");B.showErrors(K)}D.valid=J;B.stopRequest(C,J)}},G));return"pending"}else{if(this.pending[C.name]){return"pending"}}return D.valid},minlength:function(C,B,D){return this.optional(B)||this.getLength(A.trim(C),B)>=D},maxlength:function(C,B,D){return this.optional(B)||this.getLength(A.trim(C),B)<=D},rangelength:function(D,B,E){var C=this.getLength(A.trim(D),B);return this.optional(B)||(C>=E[0]&&C<=E[1])},min:function(C,B,D){return this.optional(B)||C>=D},max:function(C,B,D){return this.optional(B)||C<=D},range:function(C,B,D){return this.optional(B)||(C>=D[0]&&C<=D[1])},email:function(C,B){return this.optional(B)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(C)},url:function(C,B){return this.optional(B)||/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(C)},date:function(C,B){return this.optional(B)||!/Invalid|NaN/.test(new Date(C))},dateISO:function(C,B){return this.optional(B)||/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(C)},dateDE:function(C,B){return this.optional(B)||/^\d\d?\.\d\d?\.\d\d\d?\d?$/.test(C)},number:function(C,B){return this.optional(B)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(C)},numberDE:function(C,B){return this.optional(B)||/^-?(?:\d+|\d{1,3}(?:\.\d{3})+)(?:,\d+)?$/.test(C)},digits:function(C,B){return this.optional(B)||/^\d+$/.test(C)},creditcard:function(F,C){if(this.optional(C)){return"dependency-mismatch"}if(/[^0-9-]+/.test(F)){return false}var G=0,E=0,B=false;F=F.replace(/\D/g,"");for(n=F.length-1;n>=0;n--){var D=F.charAt(n);var E=parseInt(D,10);if(B){if((E*=2)>9){E-=9}}G+=E;B=!B}return(G%10)==0},accept:function(C,B,D){D=typeof D=="string"?D.replace(/,/g,"|"):"png|jpe?g|gif";return this.optional(B)||C.match(new RegExp(".("+D+")$","i"))},equalTo:function(C,B,D){return C==A(D).val()}}});A.format=A.validator.format})(jQuery);(function(C){var B=C.ajax;var A={};C.ajax=function(E){E=C.extend(E,C.extend({},C.ajaxSettings,E));var D=E.port;if(E.mode=="abort"){if(A[D]){A[D].abort()}return(A[D]=B.apply(this,arguments))}return B.apply(this,arguments)}})(jQuery);(function(A){A.each({focus:"focusin",blur:"focusout"},function(C,B){A.event.special[B]={setup:function(){if(A.browser.msie){return false}this.addEventListener(C,A.event.special[B].handler,true)},teardown:function(){if(A.browser.msie){return false}this.removeEventListener(C,A.event.special[B].handler,true)},handler:function(D){arguments[0]=A.event.fix(D);arguments[0].type=B;return A.event.handle.apply(this,arguments)}}});A.extend(A.fn,{delegate:function(D,C,B){return this.bind(D,function(E){var F=A(E.target);if(F.is(C)){return B.apply(F,arguments)}})},triggerEvent:function(B,C){return this.triggerHandler(B,[A.event.fix({type:B,target:C})])}})})(jQuery);jQuery.fn.selectOptions=function(A){this.each(function(){if(this.nodeName.toLowerCase()!="select"){return }var B=this.options.length;for(var C=0;C<B;C++){if(this.options[C].value==A){this.options[C].selected=true}}});return this};var SWFUpload;if(SWFUpload==undefined){SWFUpload=function(A){this.initSWFUpload(A)}}SWFUpload.prototype.initSWFUpload=function(B){try{this.customSettings={};this.settings=B;this.eventQueue=[];this.movieName="SWFUpload_"+SWFUpload.movieCount++;this.movieElement=null;SWFUpload.instances[this.movieName]=this;this.initSettings();this.loadFlash();this.displayDebugInfo()}catch(A){delete SWFUpload.instances[this.movieName];throw A}};SWFUpload.instances={};SWFUpload.movieCount=0;SWFUpload.version="2.2.0 2009-03-25";SWFUpload.QUEUE_ERROR={QUEUE_LIMIT_EXCEEDED:-100,FILE_EXCEEDS_SIZE_LIMIT:-110,ZERO_BYTE_FILE:-120,INVALID_FILETYPE:-130};SWFUpload.UPLOAD_ERROR={HTTP_ERROR:-200,MISSING_UPLOAD_URL:-210,IO_ERROR:-220,SECURITY_ERROR:-230,UPLOAD_LIMIT_EXCEEDED:-240,UPLOAD_FAILED:-250,SPECIFIED_FILE_ID_NOT_FOUND:-260,FILE_VALIDATION_FAILED:-270,FILE_CANCELLED:-280,UPLOAD_STOPPED:-290};SWFUpload.FILE_STATUS={QUEUED:-1,IN_PROGRESS:-2,ERROR:-3,COMPLETE:-4,CANCELLED:-5};SWFUpload.BUTTON_ACTION={SELECT_FILE:-100,SELECT_FILES:-110,START_UPLOAD:-120};SWFUpload.CURSOR={ARROW:-1,HAND:-2};SWFUpload.WINDOW_MODE={WINDOW:"window",TRANSPARENT:"transparent",OPAQUE:"opaque"};SWFUpload.completeURL=function(A){if(typeof (A)!=="string"||A.match(/^https?:\/\//i)||A.match(/^\//)){return A}var C=window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:"");var B=window.location.pathname.lastIndexOf("/");if(B<=0){path="/"}else{path=window.location.pathname.substr(0,B)+"/"}return path+A};SWFUpload.prototype.initSettings=function(){this.ensureDefault=function(B,A){this.settings[B]=(this.settings[B]==undefined)?A:this.settings[B]};this.ensureDefault("upload_url","");this.ensureDefault("preserve_relative_urls",false);this.ensureDefault("file_post_name","Filedata");this.ensureDefault("post_params",{});this.ensureDefault("use_query_string",false);this.ensureDefault("requeue_on_error",false);this.ensureDefault("http_success",[]);this.ensureDefault("assume_success_timeout",0);this.ensureDefault("file_types","*.*");this.ensureDefault("file_types_description","All Files");this.ensureDefault("file_size_limit",0);this.ensureDefault("file_upload_limit",0);this.ensureDefault("file_queue_limit",0);this.ensureDefault("flash_url","swfupload.swf");this.ensureDefault("prevent_swf_caching",true);this.ensureDefault("button_image_url","");this.ensureDefault("button_width",1);this.ensureDefault("button_height",1);this.ensureDefault("button_text","");this.ensureDefault("button_text_style","color: #000000; font-size: 16pt;");this.ensureDefault("button_text_top_padding",0);this.ensureDefault("button_text_left_padding",0);this.ensureDefault("button_action",SWFUpload.BUTTON_ACTION.SELECT_FILES);this.ensureDefault("button_disabled",false);this.ensureDefault("button_placeholder_id","");this.ensureDefault("button_placeholder",null);this.ensureDefault("button_cursor",SWFUpload.CURSOR.ARROW);this.ensureDefault("button_window_mode",SWFUpload.WINDOW_MODE.WINDOW);this.ensureDefault("debug",false);this.settings.debug_enabled=this.settings.debug;this.settings.return_upload_start_handler=this.returnUploadStart;this.ensureDefault("swfupload_loaded_handler",null);this.ensureDefault("file_dialog_start_handler",null);this.ensureDefault("file_queued_handler",null);this.ensureDefault("file_queue_error_handler",null);this.ensureDefault("file_dialog_complete_handler",null);this.ensureDefault("upload_start_handler",null);this.ensureDefault("upload_progress_handler",null);this.ensureDefault("upload_error_handler",null);this.ensureDefault("upload_success_handler",null);this.ensureDefault("upload_complete_handler",null);this.ensureDefault("debug_handler",this.debugMessage);this.ensureDefault("custom_settings",{});this.customSettings=this.settings.custom_settings;if(!!this.settings.prevent_swf_caching){this.settings.flash_url=this.settings.flash_url+(this.settings.flash_url.indexOf("?")<0?"?":"&")+"preventswfcaching="+new Date().getTime()}if(!this.settings.preserve_relative_urls){this.settings.upload_url=SWFUpload.completeURL(this.settings.upload_url);this.settings.button_image_url=SWFUpload.completeURL(this.settings.button_image_url)}delete this.ensureDefault};SWFUpload.prototype.loadFlash=function(){var A,B;if(document.getElementById(this.movieName)!==null){throw"ID "+this.movieName+" is already in use. The Flash Object could not be added"}A=document.getElementById(this.settings.button_placeholder_id)||this.settings.button_placeholder;if(A==undefined){throw"Could not find the placeholder element: "+this.settings.button_placeholder_id}B=document.createElement("div");B.innerHTML=this.getFlashHTML();A.parentNode.replaceChild(B.firstChild,A);if(window[this.movieName]==undefined){window[this.movieName]=this.getMovieElement()}};SWFUpload.prototype.getFlashHTML=function(){return['<object id="',this.movieName,'" type="application/x-shockwave-flash" data="',this.settings.flash_url,'" width="',this.settings.button_width,'" height="',this.settings.button_height,'" class="swfupload">','<param name="wmode" value="',this.settings.button_window_mode,'" />','<param name="movie" value="',this.settings.flash_url,'" />','<param name="quality" value="high" />','<param name="menu" value="false" />','<param name="allowScriptAccess" value="always" />','<param name="flashvars" value="'+this.getFlashVars()+'" />',"</object>"].join("")};SWFUpload.prototype.getFlashVars=function(){var B=this.buildParamString();var A=this.settings.http_success.join(",");return["movieName=",encodeURIComponent(this.movieName),"&amp;uploadURL=",encodeURIComponent(this.settings.upload_url),"&amp;useQueryString=",encodeURIComponent(this.settings.use_query_string),"&amp;requeueOnError=",encodeURIComponent(this.settings.requeue_on_error),"&amp;httpSuccess=",encodeURIComponent(A),"&amp;assumeSuccessTimeout=",encodeURIComponent(this.settings.assume_success_timeout),"&amp;params=",encodeURIComponent(B),"&amp;filePostName=",encodeURIComponent(this.settings.file_post_name),"&amp;fileTypes=",encodeURIComponent(this.settings.file_types),"&amp;fileTypesDescription=",encodeURIComponent(this.settings.file_types_description),"&amp;fileSizeLimit=",encodeURIComponent(this.settings.file_size_limit),"&amp;fileUploadLimit=",encodeURIComponent(this.settings.file_upload_limit),"&amp;fileQueueLimit=",encodeURIComponent(this.settings.file_queue_limit),"&amp;debugEnabled=",encodeURIComponent(this.settings.debug_enabled),"&amp;buttonImageURL=",encodeURIComponent(this.settings.button_image_url),"&amp;buttonWidth=",encodeURIComponent(this.settings.button_width),"&amp;buttonHeight=",encodeURIComponent(this.settings.button_height),"&amp;buttonText=",encodeURIComponent(this.settings.button_text),"&amp;buttonTextTopPadding=",encodeURIComponent(this.settings.button_text_top_padding),"&amp;buttonTextLeftPadding=",encodeURIComponent(this.settings.button_text_left_padding),"&amp;buttonTextStyle=",encodeURIComponent(this.settings.button_text_style),"&amp;buttonAction=",encodeURIComponent(this.settings.button_action),"&amp;buttonDisabled=",encodeURIComponent(this.settings.button_disabled),"&amp;buttonCursor=",encodeURIComponent(this.settings.button_cursor)].join("")};SWFUpload.prototype.getMovieElement=function(){if(this.movieElement==undefined){this.movieElement=document.getElementById(this.movieName)}if(this.movieElement===null){throw"Could not find Flash element"}return this.movieElement};SWFUpload.prototype.buildParamString=function(){var C=this.settings.post_params;var B=[];if(typeof (C)==="object"){for(var A in C){if(C.hasOwnProperty(A)){B.push(encodeURIComponent(A.toString())+"="+encodeURIComponent(C[A].toString()))}}}return B.join("&amp;")};SWFUpload.prototype.destroy=function(){try{this.cancelUpload(null,false);var A=null;A=this.getMovieElement();if(A&&typeof (A.CallFunction)==="unknown"){for(var C in A){try{if(typeof (A[C])==="function"){A[C]=null}}catch(E){}}try{A.parentNode.removeChild(A)}catch(B){}}window[this.movieName]=null;SWFUpload.instances[this.movieName]=null;delete SWFUpload.instances[this.movieName];this.movieElement=null;this.settings=null;this.customSettings=null;this.eventQueue=null;this.movieName=null;return true}catch(D){return false}};SWFUpload.prototype.displayDebugInfo=function(){this.debug(["---SWFUpload Instance Info---\n","Version: ",SWFUpload.version,"\n","Movie Name: ",this.movieName,"\n","Settings:\n","\t","upload_url:               ",this.settings.upload_url,"\n","\t","flash_url:                ",this.settings.flash_url,"\n","\t","use_query_string:         ",this.settings.use_query_string.toString(),"\n","\t","requeue_on_error:         ",this.settings.requeue_on_error.toString(),"\n","\t","http_success:             ",this.settings.http_success.join(", "),"\n","\t","assume_success_timeout:   ",this.settings.assume_success_timeout,"\n","\t","file_post_name:           ",this.settings.file_post_name,"\n","\t","post_params:              ",this.settings.post_params.toString(),"\n","\t","file_types:               ",this.settings.file_types,"\n","\t","file_types_description:   ",this.settings.file_types_description,"\n","\t","file_size_limit:          ",this.settings.file_size_limit,"\n","\t","file_upload_limit:        ",this.settings.file_upload_limit,"\n","\t","file_queue_limit:         ",this.settings.file_queue_limit,"\n","\t","debug:                    ",this.settings.debug.toString(),"\n","\t","prevent_swf_caching:      ",this.settings.prevent_swf_caching.toString(),"\n","\t","button_placeholder_id:    ",this.settings.button_placeholder_id.toString(),"\n","\t","button_placeholder:       ",(this.settings.button_placeholder?"Set":"Not Set"),"\n","\t","button_image_url:         ",this.settings.button_image_url.toString(),"\n","\t","button_width:             ",this.settings.button_width.toString(),"\n","\t","button_height:            ",this.settings.button_height.toString(),"\n","\t","button_text:              ",this.settings.button_text.toString(),"\n","\t","button_text_style:        ",this.settings.button_text_style.toString(),"\n","\t","button_text_top_padding:  ",this.settings.button_text_top_padding.toString(),"\n","\t","button_text_left_padding: ",this.settings.button_text_left_padding.toString(),"\n","\t","button_action:            ",this.settings.button_action.toString(),"\n","\t","button_disabled:          ",this.settings.button_disabled.toString(),"\n","\t","custom_settings:          ",this.settings.custom_settings.toString(),"\n","Event Handlers:\n","\t","swfupload_loaded_handler assigned:  ",(typeof this.settings.swfupload_loaded_handler==="function").toString(),"\n","\t","file_dialog_start_handler assigned: ",(typeof this.settings.file_dialog_start_handler==="function").toString(),"\n","\t","file_queued_handler assigned:       ",(typeof this.settings.file_queued_handler==="function").toString(),"\n","\t","file_queue_error_handler assigned:  ",(typeof this.settings.file_queue_error_handler==="function").toString(),"\n","\t","upload_start_handler assigned:      ",(typeof this.settings.upload_start_handler==="function").toString(),"\n","\t","upload_progress_handler assigned:   ",(typeof this.settings.upload_progress_handler==="function").toString(),"\n","\t","upload_error_handler assigned:      ",(typeof this.settings.upload_error_handler==="function").toString(),"\n","\t","upload_success_handler assigned:    ",(typeof this.settings.upload_success_handler==="function").toString(),"\n","\t","upload_complete_handler assigned:   ",(typeof this.settings.upload_complete_handler==="function").toString(),"\n","\t","debug_handler assigned:             ",(typeof this.settings.debug_handler==="function").toString(),"\n"].join(""))};SWFUpload.prototype.addSetting=function(B,C,A){if(C==undefined){return(this.settings[B]=A)}else{return(this.settings[B]=C)}};SWFUpload.prototype.getSetting=function(A){if(this.settings[A]!=undefined){return this.settings[A]}return""};SWFUpload.prototype.callFlash=function(functionName,argumentArray){argumentArray=argumentArray||[];var movieElement=this.getMovieElement();var returnValue,returnString;try{returnString=movieElement.CallFunction('<invoke name="'+functionName+'" returntype="javascript">'+__flash__argumentsToXML(argumentArray,0)+"</invoke>");returnValue=eval(returnString)}catch(ex){throw"Call to "+functionName+" failed"}if(returnValue!=undefined&&typeof returnValue.post==="object"){returnValue=this.unescapeFilePostParams(returnValue)}return returnValue};SWFUpload.prototype.selectFile=function(){this.callFlash("SelectFile")};SWFUpload.prototype.selectFiles=function(){this.callFlash("SelectFiles")};SWFUpload.prototype.startUpload=function(A){this.callFlash("StartUpload",[A])};SWFUpload.prototype.cancelUpload=function(A,B){if(B!==false){B=true}this.callFlash("CancelUpload",[A,B])};SWFUpload.prototype.stopUpload=function(){this.callFlash("StopUpload")};SWFUpload.prototype.getStats=function(){return this.callFlash("GetStats")};SWFUpload.prototype.setStats=function(A){this.callFlash("SetStats",[A])};SWFUpload.prototype.getFile=function(A){if(typeof (A)==="number"){return this.callFlash("GetFileByIndex",[A])}else{return this.callFlash("GetFile",[A])}};SWFUpload.prototype.addFileParam=function(A,B,C){return this.callFlash("AddFileParam",[A,B,C])};SWFUpload.prototype.removeFileParam=function(A,B){this.callFlash("RemoveFileParam",[A,B])};SWFUpload.prototype.setUploadURL=function(A){this.settings.upload_url=A.toString();this.callFlash("SetUploadURL",[A])};SWFUpload.prototype.setPostParams=function(A){this.settings.post_params=A;this.callFlash("SetPostParams",[A])};SWFUpload.prototype.addPostParam=function(A,B){this.settings.post_params[A]=B;this.callFlash("SetPostParams",[this.settings.post_params])};SWFUpload.prototype.removePostParam=function(A){delete this.settings.post_params[A];this.callFlash("SetPostParams",[this.settings.post_params])};SWFUpload.prototype.setFileTypes=function(A,B){this.settings.file_types=A;this.settings.file_types_description=B;this.callFlash("SetFileTypes",[A,B])};SWFUpload.prototype.setFileSizeLimit=function(A){this.settings.file_size_limit=A;this.callFlash("SetFileSizeLimit",[A])};SWFUpload.prototype.setFileUploadLimit=function(A){this.settings.file_upload_limit=A;this.callFlash("SetFileUploadLimit",[A])};SWFUpload.prototype.setFileQueueLimit=function(A){this.settings.file_queue_limit=A;this.callFlash("SetFileQueueLimit",[A])};SWFUpload.prototype.setFilePostName=function(A){this.settings.file_post_name=A;this.callFlash("SetFilePostName",[A])};SWFUpload.prototype.setUseQueryString=function(A){this.settings.use_query_string=A;this.callFlash("SetUseQueryString",[A])};SWFUpload.prototype.setRequeueOnError=function(A){this.settings.requeue_on_error=A;this.callFlash("SetRequeueOnError",[A])};SWFUpload.prototype.setHTTPSuccess=function(A){if(typeof A==="string"){A=A.replace(" ","").split(",")}this.settings.http_success=A;this.callFlash("SetHTTPSuccess",[A])};SWFUpload.prototype.setAssumeSuccessTimeout=function(A){this.settings.assume_success_timeout=A;this.callFlash("SetAssumeSuccessTimeout",[A])};SWFUpload.prototype.setDebugEnabled=function(A){this.settings.debug_enabled=A;this.callFlash("SetDebugEnabled",[A])};SWFUpload.prototype.setButtonImageURL=function(A){if(A==undefined){A=""}this.settings.button_image_url=A;this.callFlash("SetButtonImageURL",[A])};SWFUpload.prototype.setButtonDimensions=function(C,A){this.settings.button_width=C;this.settings.button_height=A;var B=this.getMovieElement();if(B!=undefined){B.style.width=C+"px";B.style.height=A+"px"}this.callFlash("SetButtonDimensions",[C,A])};SWFUpload.prototype.setButtonText=function(A){this.settings.button_text=A;this.callFlash("SetButtonText",[A])};SWFUpload.prototype.setButtonTextPadding=function(B,A){this.settings.button_text_top_padding=A;this.settings.button_text_left_padding=B;this.callFlash("SetButtonTextPadding",[B,A])};SWFUpload.prototype.setButtonTextStyle=function(A){this.settings.button_text_style=A;this.callFlash("SetButtonTextStyle",[A])};SWFUpload.prototype.setButtonDisabled=function(A){this.settings.button_disabled=A;this.callFlash("SetButtonDisabled",[A])};SWFUpload.prototype.setButtonAction=function(A){this.settings.button_action=A;this.callFlash("SetButtonAction",[A])};SWFUpload.prototype.setButtonCursor=function(A){this.settings.button_cursor=A;this.callFlash("SetButtonCursor",[A])};SWFUpload.prototype.queueEvent=function(B,C){if(C==undefined){C=[]}else{if(!(C instanceof Array)){C=[C]}}var A=this;if(typeof this.settings[B]==="function"){this.eventQueue.push(function(){this.settings[B].apply(this,C)});setTimeout(function(){A.executeNextEvent()},0)}else{if(this.settings[B]!==null){throw"Event handler "+B+" is unknown or is not a function"}}};SWFUpload.prototype.executeNextEvent=function(){var A=this.eventQueue?this.eventQueue.shift():null;if(typeof (A)==="function"){A.apply(this)}};SWFUpload.prototype.unescapeFilePostParams=function(C){var E=/[$]([0-9a-f]{4})/i;var F={};var D;if(C!=undefined){for(var A in C.post){if(C.post.hasOwnProperty(A)){D=A;var B;while((B=E.exec(D))!==null){D=D.replace(B[0],String.fromCharCode(parseInt("0x"+B[1],16)))}F[D]=C.post[A]}}C.post=F}return C};SWFUpload.prototype.testExternalInterface=function(){try{return this.callFlash("TestExternalInterface")}catch(A){return false}};SWFUpload.prototype.flashReady=function(){var A=this.getMovieElement();if(!A){this.debug("Flash called back ready but the flash movie can't be found.");return }this.cleanUp(A);this.queueEvent("swfupload_loaded_handler")};SWFUpload.prototype.cleanUp=function(A){try{if(this.movieElement&&typeof (A.CallFunction)==="unknown"){this.debug("Removing Flash functions hooks (this should only run in IE and should prevent memory leaks)");for(var C in A){try{if(typeof (A[C])==="function"){A[C]=null}}catch(B){}}}}catch(D){}window.__flash__removeCallback=function(E,F){try{if(E){E[F]=null}}catch(G){}}};SWFUpload.prototype.fileDialogStart=function(){this.queueEvent("file_dialog_start_handler")};SWFUpload.prototype.fileQueued=function(A){A=this.unescapeFilePostParams(A);this.queueEvent("file_queued_handler",A)};SWFUpload.prototype.fileQueueError=function(A,C,B){A=this.unescapeFilePostParams(A);this.queueEvent("file_queue_error_handler",[A,C,B])};SWFUpload.prototype.fileDialogComplete=function(B,C,A){this.queueEvent("file_dialog_complete_handler",[B,C,A])};SWFUpload.prototype.uploadStart=function(A){A=this.unescapeFilePostParams(A);this.queueEvent("return_upload_start_handler",A)};SWFUpload.prototype.returnUploadStart=function(A){var B;if(typeof this.settings.upload_start_handler==="function"){A=this.unescapeFilePostParams(A);B=this.settings.upload_start_handler.call(this,A)}else{if(this.settings.upload_start_handler!=undefined){throw"upload_start_handler must be a function"}}if(B===undefined){B=true}B=!!B;this.callFlash("ReturnUploadStart",[B])};SWFUpload.prototype.uploadProgress=function(A,C,B){A=this.unescapeFilePostParams(A);this.queueEvent("upload_progress_handler",[A,C,B])};SWFUpload.prototype.uploadError=function(A,C,B){A=this.unescapeFilePostParams(A);this.queueEvent("upload_error_handler",[A,C,B])};SWFUpload.prototype.uploadSuccess=function(B,A,C){B=this.unescapeFilePostParams(B);this.queueEvent("upload_success_handler",[B,A,C])};SWFUpload.prototype.uploadComplete=function(A){A=this.unescapeFilePostParams(A);this.queueEvent("upload_complete_handler",A)};SWFUpload.prototype.debug=function(A){this.queueEvent("debug_handler",A)};SWFUpload.prototype.debugMessage=function(C){if(this.settings.debug){var A,D=[];if(typeof C==="object"&&typeof C.name==="string"&&typeof C.message==="string"){for(var B in C){if(C.hasOwnProperty(B)){D.push(B+": "+C[B])}}A=D.join("\n")||"";D=A.split("\n");A="EXCEPTION: "+D.join("\nEXCEPTION: ");SWFUpload.Console.writeLine(A)}else{SWFUpload.Console.writeLine(C)}}};SWFUpload.Console={};SWFUpload.Console.writeLine=function(D){var B,A;try{B=document.getElementById("SWFUpload_Console");if(!B){A=document.createElement("form");document.getElementsByTagName("body")[0].appendChild(A);B=document.createElement("textarea");B.id="SWFUpload_Console";B.style.fontFamily="monospace";B.setAttribute("wrap","off");B.wrap="off";B.style.overflow="auto";B.style.width="700px";B.style.height="350px";B.style.margin="5px";A.appendChild(B)}B.value+=D+"\n";B.scrollTop=B.scrollHeight-B.clientHeight}catch(C){alert("Exception: "+C.name+" Message: "+C.message)}};
/* Copyright (c) 2009 Brandon Aaron (http://brandonaaron.net)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
 * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
 *
 * Version: 3.0.2
 * 
 * Requires: 1.2.2+
 */
(function(C){var A=["DOMMouseScroll","mousewheel"];C.event.special.mousewheel={setup:function(){if(this.addEventListener){for(var D=A.length;D;){this.addEventListener(A[--D],B,false)}}else{this.onmousewheel=B}},teardown:function(){if(this.removeEventListener){for(var D=A.length;D;){this.removeEventListener(A[--D],B,false)}}else{this.onmousewheel=null}}};C.fn.extend({mousewheel:function(D){return D?this.bind("mousewheel",D):this.trigger("mousewheel")},unmousewheel:function(D){return this.unbind("mousewheel",D)}});function B(F){var D=[].slice.call(arguments,1),G=0,E=true;F=C.event.fix(F||window.event);F.type="mousewheel";if(F.wheelDelta){G=F.wheelDelta/120}if(F.detail){G=-F.detail/3}D.unshift(F,G);return C.event.handle.apply(this,D)}})(jQuery);(function(A){A.jScrollPane={active:[]};A.fn.jScrollPane=function(C){C=A.extend({},A.fn.jScrollPane.defaults,C);var B=function(){return false};return this.each(function(){var O=A(this);O.css("overflow","hidden");var X=this;if(A(this).parent().is(".jScrollPaneContainer")){var AH=C.maintainPosition?O.position().top:0;var L=A(this).parent();var d=L.innerWidth();var AI=L.outerHeight();var M=AI;A(">.jScrollPaneTrack, >.jScrollArrowUp, >.jScrollArrowDown",L).remove();O.css({top:0})}else{var AH=0;this.originalPadding=O.css("paddingTop")+" "+O.css("paddingRight")+" "+O.css("paddingBottom")+" "+O.css("paddingLeft");this.originalSidePaddingTotal=(parseInt(O.css("paddingLeft"))||0)+(parseInt(O.css("paddingRight"))||0);var d=O.innerWidth();var AI=O.innerHeight();var M=AI;O.wrap(A("<div></div>").attr({className:"jScrollPaneContainer"}).css({height:AI+"px",width:d+"px"}));A(document).bind("emchange",function(AJ,AK,p){O.jScrollPane(C)})}if(C.reinitialiseOnImageLoad){var N=A.data(X,"jScrollPaneImagesToLoad")||A("img",O);var G=[];if(N.length){N.each(function(p,AJ){A(this).bind("load",function(){if(A.inArray(p,G)==-1){G.push(AJ);N=A.grep(N,function(AL,AK){return AL!=AJ});A.data(X,"jScrollPaneImagesToLoad",N);C.reinitialiseOnImageLoad=false;O.jScrollPane(C)}}).each(function(AK,AL){if(this.complete||this.complete===undefined){this.src=this.src}})})}}var u=this.originalSidePaddingTotal;var q={height:"auto",width:d-C.scrollbarWidth-C.scrollbarMargin-u+"px"};if(C.scrollbarOnLeft){q.paddingLeft=C.scrollbarMargin+C.scrollbarWidth+"px"}else{q.paddingRight=C.scrollbarMargin+"px"}O.css(q);var r=O.outerHeight();var l=AI/r;if(l<0.99){var H=O.parent();H.append(A("<div></div>").attr({className:"jScrollPaneTrack"}).css({width:C.scrollbarWidth+"px"}).append(A("<div></div>").attr({className:"jScrollPaneDrag"}).css({width:C.scrollbarWidth+"px"}).append(A("<div></div>").attr({className:"jScrollPaneDragTop"}).css({width:C.scrollbarWidth+"px"}),A("<div></div>").attr({className:"jScrollPaneDragBottom"}).css({width:C.scrollbarWidth+"px"}))));var AE=A(">.jScrollPaneTrack",H);var P=A(">.jScrollPaneTrack .jScrollPaneDrag",H);if(C.showArrows){var g;var AG;var S;var w;var m=function(){if(w>4||w%4==0){AD(z+AG*b)}w++};var K=function(p){A("html").unbind("mouseup",K);g.removeClass("jScrollActiveArrowButton");clearInterval(S)};var Z=function(){A("html").bind("mouseup",K);g.addClass("jScrollActiveArrowButton");w=0;m();S=setInterval(m,100)};H.append(A("<a></a>").attr({href:"javascript:;",className:"jScrollArrowUp"}).css({width:C.scrollbarWidth+"px"}).html("Scroll up").bind("mousedown",function(){g=A(this);AG=-1;Z();this.blur();return false}).bind("click",B),A("<a></a>").attr({href:"javascript:;",className:"jScrollArrowDown"}).css({width:C.scrollbarWidth+"px"}).html("Scroll down").bind("mousedown",function(){g=A(this);AG=1;Z();this.blur();return false}).bind("click",B));var Q=A(">.jScrollArrowUp",H);var J=A(">.jScrollArrowDown",H);if(C.arrowSize){M=AI-C.arrowSize-C.arrowSize;AE.css({height:M+"px",top:C.arrowSize+"px"})}else{var x=Q.height();C.arrowSize=x;M=AI-x-J.height();AE.css({height:M+"px",top:x+"px"})}}var AB=A(this).css({position:"absolute",overflow:"visible"});var D;var Y;var b;var z=0;var V=l*AI/2;var a=function(AJ,AL){var AK=AL=="X"?"Left":"Top";return AJ["page"+AL]||(AJ["client"+AL]+(document.documentElement["scroll"+AK]||document.body["scroll"+AK]))||0};var f=function(){return false};var AA=function(){t();D=P.offset(false);D.top-=z;Y=M-P[0].offsetHeight;b=2*C.wheelSpeed*Y/r};var E=function(p){AA();V=a(p,"Y")-z-D.top;A("html").bind("mouseup",T).bind("mousemove",k);if(A.browser.msie){A("html").bind("dragstart",f).bind("selectstart",f)}return false};var T=function(){A("html").unbind("mouseup",T).unbind("mousemove",k);V=l*AI/2;if(A.browser.msie){A("html").unbind("dragstart",f).unbind("selectstart",f)}};var AD=function(AJ){AJ=AJ<0?0:(AJ>Y?Y:AJ);z=AJ;P.css({top:AJ+"px"});var AK=AJ/Y;AB.css({top:((AI-r)*AK)+"px"});O.trigger("scroll");if(C.showArrows){Q[AJ==0?"addClass":"removeClass"]("disabled");J[AJ==Y?"addClass":"removeClass"]("disabled")}};var k=function(p){AD(a(p,"Y")-D.top-V)};var v=Math.max(Math.min(l*(AI-C.arrowSize*2),C.dragMaxHeight),C.dragMinHeight);P.css({height:v+"px"}).bind("mousedown",E);var o;var R;var I;var y=function(){if(R>8||R%4==0){AD((z-((z-I)/2)))}R++};var AF=function(){clearInterval(o);A("html").unbind("mouseup",AF).unbind("mousemove",e)};var e=function(p){I=a(p,"Y")-D.top-V};var U=function(p){AA();e(p);R=0;A("html").bind("mouseup",AF).bind("mousemove",e);o=setInterval(y,100);y()};AE.bind("mousedown",U);H.bind("mousewheel",function(AJ,AL){AA();t();var AK=z;AD(z-AL*b);var p=AK!=z;return !p});var F;var W;function c(){var p=(F-z)/C.animateStep;if(p>1||p<-1){AD(z+p)}else{AD(F);t()}}var t=function(){if(W){clearInterval(W);delete F}};var AC=function(AK,p){if(typeof AK=="string"){$e=A(AK,O);if(!$e.length){return }AK=$e.offset().top-O.offset().top}H.scrollTop(0);t();var AJ=-AK/(AI-r)*Y;if(p||!C.animateTo){AD(AJ)}else{F=AJ;W=setInterval(c,C.animateInterval)}};O[0].scrollTo=AC;O[0].scrollBy=function(AJ){var p=-parseInt(AB.css("top"))||0;AC(p+AJ)};AA();AC(-AH,true);A("*",this).bind("focus",function(AM){var AL=A(this);var AO=0;while(AL[0]!=O[0]){AO+=AL.position().top;AL=AL.offsetParent()}var p=-parseInt(AB.css("top"))||0;var AN=p+AI;var AK=AO>p&&AO<AN;if(!AK){var AJ=AO-C.scrollbarMargin;if(AO>p){AJ+=A(this).height()+15+C.scrollbarMargin-AI}AC(AJ)}});if(location.hash){AC(location.hash)}A(document).bind("click",function(AJ){$target=A(AJ.target);if($target.is("a")){var p=$target.attr("href");if(p.substr(0,1)=="#"){AC(p)}}});A.jScrollPane.active.push(O[0])}else{O.css({height:AI+"px",width:d-this.originalSidePaddingTotal+"px",padding:this.originalPadding});O.parent().unbind("mousewheel")}})};A.fn.jScrollPane.defaults={scrollbarWidth:10,scrollbarMargin:5,wheelSpeed:18,showArrows:false,arrowSize:0,animateTo:false,dragMinHeight:1,dragMaxHeight:99999,animateInterval:100,animateStep:3,maintainPosition:true,scrollbarOnLeft:false,reinitialiseOnImageLoad:false};A(window).bind("unload",function(){var C=A.jScrollPane.active;for(var B=0;B<C.length;B++){C[B].scrollTo=C[B].scrollBy=null}})})(jQuery);(function(D){var B={},J,L,N,I=D.browser.msie&&/MSIE\s(5\.5|6\.)/.test(navigator.userAgent),A=false;D.Tooltip={blocked:false,defaults:{delay:200,showURL:true,extraClass:"",top:15,left:15},block:function(){D.Tooltip.blocked=!D.Tooltip.blocked}};D.fn.extend({Tooltip:function(O){O=D.extend({},D.Tooltip.defaults,O);G();return this.each(function(){this.tSettings=O;this.tooltipText=this.title;D(this).removeAttr("title");this.alt=""}).hover(K,E).click(E)},fixPNG:I?function(){return this.each(function(){var O=D(this).css("backgroundImage");if(O.match(/^url\(["']?(.*\.png)["']?\)$/i)){O=RegExp.$1;D(this).css({backgroundImage:"none",filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop, src='"+O+"')"}).each(function(){var P=D(this).css("position");if(P!="absolute"&&P!="relative"){D(this).css("position","relative")}})}})}:function(){return this},unfixPNG:I?function(){return this.each(function(){D(this).css({filter:"",backgroundImage:""})})}:function(){return this},hideWhenEmpty:function(){return this.each(function(){D(this)[D(this).html()?"show":"hide"]()})},url:function(){return this.attr("href")||this.attr("src")}});function G(){if(B.parent){return }B.parent=D('<div id="tooltip"><h3></h3><div class="body"></div><div class="url"></div></div>').hide().appendTo("body");if(D.fn.bgiframe){B.parent.bgiframe()}B.title=D("h3",B.parent);B.body=D("div.body",B.parent);B.url=D("div.url",B.parent)}function F(O){if(this.tSettings.delay){N=setTimeout(M,this.tSettings.delay)}else{M()}A=!!this.tSettings.track;D("body").bind("mousemove",C);C(O)}function K(){if(D.Tooltip.blocked||this==J||!this.tooltipText){return }J=this;L=this.tooltipText;if(this.tSettings.bodyHandler){B.title.hide();B.body.html(this.tSettings.bodyHandler.call(this)).show()}else{if(this.tSettings.showBody){var Q=L.split(this.tSettings.showBody);B.title.html(Q.shift()).show();B.body.empty();for(var P=0,O;O=Q[P];P++){if(P>0){B.body.append("<br/>")}B.body.append(O)}B.body.hideWhenEmpty()}else{B.title.html(L).show();B.body.hide()}}if(this.tSettings.showURL&&D(this).url()){B.url.html(D(this).url().replace("http://","")).show()}else{B.url.hide()}B.parent.addClass(this.tSettings.extraClass);if(this.tSettings.fixPNG){B.parent.fixPNG()}F.apply(this,arguments)}function M(){N=null;B.parent.show();C()}function C(Q){if(D.Tooltip.blocked){return }if(!A&&B.parent.is(":visible")){D("body").unbind("mousemove",C)}if(J==null){D("body").unbind("mousemove",C);return }var S=B.parent[0].offsetLeft;var R=B.parent[0].offsetTop;if(Q){S=Q.pageX+J.tSettings.left;R=Q.pageY+J.tSettings.top;B.parent.css({left:S+"px",top:R+"px"})}var O=H(),P=B.parent[0];if(O.x+O.cx<P.offsetLeft+P.offsetWidth){S-=P.offsetWidth+20+J.tSettings.left;B.parent.css({left:S+"px"})}if(O.y+O.cy<P.offsetTop+P.offsetHeight){R-=P.offsetHeight+20+J.tSettings.top;B.parent.css({top:R+"px"})}}function H(){return{x:D(window).scrollLeft(),y:D(window).scrollTop(),cx:D(window).width(),cy:D(window).height()}}function E(O){if(D.Tooltip.blocked){return }if(N){clearTimeout(N)}J=null;B.parent.hide().removeClass(this.tSettings.extraClass);if(this.tSettings.fixPNG){B.parent.unfixPNG()}}})(jQuery);eval(function(E,A,F,B,D,C){D=function(G){return(G<A?"":D(parseInt(G/A)))+((G=G%A)>35?String.fromCharCode(G+29):G.toString(36))};if(!"".replace(/^/,String)){while(F--){C[D(F)]=B[F]||D(F)}B=[function(G){return C[G]}];D=function(){return"\\w+"};F=1}while(F--){if(B[F]){E=E.replace(new RegExp("\\b"+D(F)+"\\b","g"),B[F])}}return E}("(6($){$.2L.3f=6(4){4=1W.2F({2x:'#32',2e:0.8,1O:'V/5-3e-T.Z',2i:'V/5-1t-2S.Z',23:'V/5-1t-2O.Z',1V:'V/5-1t-2I.Z',19:'V/5-2G.Z',17:10,1I:2B,2z:'1f',2p:'33',2m:'c',2h:'p',2c:'n',h:[],9:0},4);f E=C;6 20(){1Z(C,E);D 1g}6 1Z(1a,E){$('1R, 1Q, 1N').k({'1M':'2D'});1K();4.h.y=0;4.9=0;7(E.y==1){4.h.1F(u 1h(1a.16('H'),1a.16('2v')))}m{36(f i=0;i<E.y;i++){4.h.1F(u 1h(E[i].16('H'),E[i].16('2v')))}}2n(4.h[4.9][0]!=1a.16('H')){4.9++}J()}6 1K(){$('l').31('<e g=\"r-N\"></e><e g=\"r-5\"><e g=\"5-t-d-v\"><e g=\"5-t-d\"><1s g=\"5-d\"><e 2V=\"\" g=\"5-j\"><a H=\"#\" g=\"5-j-13\"></a><a H=\"#\" g=\"5-j-X\"></a></e><e g=\"5-T\"><a H=\"#\" g=\"5-T-25\"><1s P=\"'+4.1O+'\"></a></e></e></e><e g=\"5-t-d-Y-v\"><e g=\"5-t-d-Y\"><e g=\"5-d-F\"><1c g=\"5-d-F-1p\"></1c><1c g=\"5-d-F-1o\"></1c></e><e g=\"5-1B\"><a H=\"#\" g=\"5-1B-1Y\"><1s P=\"'+4.1V+'\"></a></e></e></e></e>');f w=1m();$('#r-N').k({2J:4.2x,2H:4.2e,Q:w[0],I:w[1]}).1S();f L=1l();$('#r-5').k({1P:L[1]+(w[3]/10),1k:L[0]}).B();$('#r-N,#r-5').K(6(){18()});$('#5-T-25,#5-1B-1Y').K(6(){18();D 1g});$(A).2E(6(){f w=1m();$('#r-N').k({Q:w[0],I:w[1]});f L=1l();$('#r-5').k({1P:L[1]+(w[3]/10),1k:L[0]})})}6 J(){$('#5-T').B();$('#5-d,#5-j,#5-j-13,#5-j-X,#5-t-d-Y-v,#5-d-F-1o').1j();f M=u 1f();M.1L=6(){$('#5-d').2C('P',4.h[4.9][0]);1J(M.Q,M.I);M.1L=6(){}};M.P=4.h[4.9][0]};6 1J(1n,1i){f 1H=$('#5-t-d-v').Q();f 1G=$('#5-t-d-v').I();f 1q=(1n+(4.17*2));f 1r=(1i+(4.17*2));f 1E=1H-1q;f 26=1G-1r;$('#5-t-d-v').3d({Q:1q,I:1r},4.1I,6(){2y()});7((1E==0)&&(26==0)){7($.3c.3b){1C(3a)}m{1C(38)}}$('#5-j-13,#5-j-X').k({I:1i+(4.17*2)});$('#5-t-d-Y-v').k({Q:1n})};6 2y(){$('#5-T').1j();$('#5-d').1S(6(){2u();2s()});2r()};6 2u(){$('#5-t-d-Y-v').35('34');$('#5-d-F-1p').1j();7(4.h[4.9][1]){$('#5-d-F-1p').2o(4.h[4.9][1]).B()}7(4.h.y>1){$('#5-d-F-1o').2o(4.2z+' '+(4.9+1)+' '+4.2p+' '+4.h.y).B()}}6 2s(){$('#5-j').B();$('#5-j-13,#5-j-X').k({'11':'1y U('+4.19+') 12-14'});7(4.9!=0){$('#5-j-13').1d().2l(6(){$(C).k({'11':'U('+4.2i+') 1k 15% 12-14'})},6(){$(C).k({'11':'1y U('+4.19+') 12-14'})}).B().2k('K',6(){4.9=4.9-1;J();D 1g})}7(4.9!=(4.h.y-1)){$('#5-j-X').1d().2l(6(){$(C).k({'11':'U('+4.23+') 30 15% 12-14'})},6(){$(C).k({'11':'1y U('+4.19+') 12-14'})}).B().2k('K',6(){4.9=4.9+1;J();D 1g})}2j()}6 2j(){$(b).2Z(6(O){2g(O)})}6 1w(){$(b).1d()}6 2g(O){7(O==2f){S=2Y.2d;1u=27}m{S=O.2d;1u=O.2X}W=2W.2U(S).2T();7((W==4.2m)||(W=='x')||(S==1u)){18()}7((W==4.2h)||(S==37)){7(4.9!=0){4.9=4.9-1;J();1w()}}7((W==4.2c)||(S==39)){7(4.9!=(4.h.y-1)){4.9=4.9+1;J();1w()}}}6 2r(){7((4.h.y-1)>4.9){2a=u 1f();2a.P=4.h[4.9+1][0]}7(4.9>0){29=u 1f();29.P=4.h[4.9-1][0]}}6 18(){$('#r-5').28();$('#r-N').2R(6(){$('#r-N').28()});$('1R, 1Q, 1N').k({'1M':'2Q'})}6 1m(){f q,o;7(A.1b&&A.24){q=A.22+A.2P;o=A.1b+A.24}m 7(b.l.21>b.l.2b){q=b.l.2N;o=b.l.21}m{q=b.l.2M;o=b.l.2b}f z,G;7(R.1b){7(b.s.1e){z=b.s.1e}m{z=R.22}G=R.1b}m 7(b.s&&b.s.1v){z=b.s.1e;G=b.s.1v}m 7(b.l){z=b.l.1e;G=b.l.1v}7(o<G){1x=G}m{1x=o}7(q<z){1A=q}m{1A=z}1X=u 1h(1A,1x,z,G);D 1X};6 1l(){f q,o;7(R.2A){o=R.2A;q=R.2K}m 7(b.s&&b.s.1z){o=b.s.1z;q=b.s.2t}m 7(b.l){o=b.l.1z;q=b.l.2t}2q=u 1h(q,o);D 2q};6 1C(1U){f 2w=u 1T();1D=2f;3g{f 1D=u 1T()}2n(1D-2w<1U)};D C.1d('K').K(20)}})(1W);",62,203,"||||settings|lightbox|function|if||activeImage||document||image|div|var|id|imageArray||nav|css|body|else||yScroll||xScroll|jquery|documentElement|container|new|box|arrPageSizes||length|windowWidth|window|show|this|return|jQueryMatchedObj|details|windowHeight|href|height|_set_image_to_view|click|arrPageScroll|objImagePreloader|overlay|objEvent|src|width|self|keycode|loading|url|images|key|btnNext|data|gif||background|no|btnPrev|repeat||getAttribute|containerBorderSize|_finish|imageBlank|objClicked|innerHeight|span|unbind|clientWidth|Image|false|Array|intImageHeight|hide|left|___getPageScroll|___getPageSize|intImageWidth|currentNumber|caption|intWidth|intHeight|img|btn|escapeKey|clientHeight|_disable_keyboard_navigation|pageHeight|transparent|scrollTop|pageWidth|secNav|___pause|curDate|intDiffW|push|intCurrentHeight|intCurrentWidth|containerResizeSpeed|_resize_container_image_box|_set_interface|onload|visibility|select|imageLoading|top|object|embed|fadeIn|Date|ms|imageBtnClose|jQuery|arrayPageSize|btnClose|_start|_initialize|scrollHeight|innerWidth|imageBtnNext|scrollMaxY|link|intDiffH||remove|objPrev|objNext|offsetHeight|keyToNext|keyCode|overlayOpacity|null|_keyboard_action|keyToPrev|imageBtnPrev|_enable_keyboard_navigation|bind|hover|keyToClose|while|html|txtOf|arrayPageScroll|_preload_neighbor_images|_set_navigation|scrollLeft|_show_image_data|title|date|overlayBgColor|_show_image|txtImage|pageYOffset|400|attr|hidden|resize|extend|blank|opacity|close|backgroundColor|pageXOffset|fn|offsetWidth|scrollWidth|next|scrollMaxX|visible|fadeOut|prev|toLowerCase|fromCharCode|style|String|DOM_VK_ESCAPE|event|keydown|right|append|000|of|fast|slideDown|for||100||250|msie|browser|animate|ico|lightBox|do".split("|"),0,{}));PolylineEncoder=function(C,B,E,D){var A;if(!C){C=18}if(!B){B=2}if(!E){E=0.00001}if(!D){D=true}this.numLevels=C;this.zoomFactor=B;this.verySmall=E;this.forceEndpoints=D;this.zoomLevelBreaks=new Array(C);for(A=0;A<C;A++){this.zoomLevelBreaks[A]=E*Math.pow(B,C-A-1)}};PolylineEncoder.prototype.dpEncode=function(M){var K=0;var J=[];var H=new Array(M.length);var G,B,N,F,L,I;var E,A,D;var C;if(M.length>2){J.push([0,M.length-1]);while(J.length>0){I=J.pop();G=0;C=Math.pow(M[I[1]].lat()-M[I[0]].lat(),2)+Math.pow(M[I[1]].lng()-M[I[0]].lng(),2);for(E=I[0]+1;E<I[1];E++){N=this.distance(M[E],M[I[0]],M[I[1]],C);if(N>G){G=N;B=E;if(G>K){K=G}}}if(G>this.verySmall){H[B]=G;J.push([I[0],B]);J.push([B,I[1]])}}}A=this.createEncodings(M,H);D=this.encodeLevels(M,H,K);return{encodedPoints:A,encodedLevels:D,encodedPointsLiteral:A.replace(/\\/g,"\\\\")}};PolylineEncoder.prototype.dpEncodeToJSON=function(D,B,E,C){var A;if(!C){C=0.9}if(!E){E=3}if(!B){B="#0000ff"}A=this.dpEncode(D);return{color:B,weight:E,opacity:C,points:A.encodedPoints,levels:A.encodedLevels,numLevels:this.numLevels,zoomFactor:this.zoomFactor}};PolylineEncoder.prototype.dpEncodeToGPolyline=function(C,A,D,B){if(!B){B=0.9}if(!D){D=3}if(!A){A="#0000ff"}return new GPolyline.fromEncoded(this.dpEncodeToJSON(C,A,D,B))};PolylineEncoder.prototype.dpEncodeToGPolygon=function(G,C,F,H,B,I,J,A){var E,D;if(!C){C="#0000ff"}if(!F){F=3}if(!H){H=0.9}if(!B){B=C}if(!I){I=H/3}if(J==undefined){J=true}if(A==undefined){A=true}D=new Array(0);for(E=0;E<G.length;E++){D.push(this.dpEncodeToJSON(G[E],C,F,H))}return new GPolygon.fromEncoded({polylines:D,color:B,opacity:I,fill:J,outline:A})};PolylineEncoder.prototype.distance=function(F,E,D,A){var C,B;if(E.lat()===D.lat()&&E.lng()===D.lng()){B=Math.sqrt(Math.pow(D.lat()-F.lat(),2)+Math.pow(D.lng()-F.lng(),2))}else{C=((F.lat()-E.lat())*(D.lat()-E.lat())+(F.lng()-E.lng())*(D.lng()-E.lng()))/A;if(C<=0){B=Math.sqrt(Math.pow(F.lat()-E.lat(),2)+Math.pow(F.lng()-E.lng(),2))}if(C>=1){B=Math.sqrt(Math.pow(F.lat()-D.lat(),2)+Math.pow(F.lng()-D.lng(),2))}if(0<C&&C<1){B=Math.sqrt(Math.pow(F.lat()-E.lat()-C*(D.lat()-E.lat()),2)+Math.pow(F.lng()-E.lng()-C*(D.lng()-E.lng()),2))}}return B};PolylineEncoder.prototype.createEncodings=function(M,F){var B,G,H;var D=0;var E=0;var C="";for(B=0;B<M.length;B++){if(F[B]!=undefined||B==0||B==M.length-1){var K=M[B];var I=K.lat();var J=K.lng();var A=Math.floor(I*100000);var L=Math.floor(J*100000);G=A-D;H=L-E;D=A;E=L;C+=this.encodeSignedNumber(G)+this.encodeSignedNumber(H)}}return C};PolylineEncoder.prototype.computeLevel=function(A){var B;if(A>this.verySmall){B=0;while(A<this.zoomLevelBreaks[B]){B++}return B}};PolylineEncoder.prototype.encodeLevels=function(D,E,B){var A;var C="";if(this.forceEndpoints){C+=this.encodeNumber(this.numLevels-1)}else{C+=this.encodeNumber(this.numLevels-this.computeLevel(B)-1)}for(A=1;A<D.length-1;A++){if(E[A]!=undefined){C+=this.encodeNumber(this.numLevels-this.computeLevel(E[A])-1)}}if(this.forceEndpoints){C+=this.encodeNumber(this.numLevels-1)}else{C+=this.encodeNumber(this.numLevels-this.computeLevel(B)-1)}return C};PolylineEncoder.prototype.encodeNumber=function(B){var A="";var C,D;while(B>=32){C=(32|(B&31))+63;A+=(String.fromCharCode(C));B>>=5}D=B+63;A+=(String.fromCharCode(D));return A};PolylineEncoder.prototype.encodeSignedNumber=function(A){var B=A<<1;if(A<0){B=~(B)}return(this.encodeNumber(B))};PolylineEncoder.latLng=function(B,A){this.y=B;this.x=A};PolylineEncoder.latLng.prototype.lat=function(){return this.y};PolylineEncoder.latLng.prototype.lng=function(){return this.x};PolylineEncoder.pointsToLatLngs=function(B){var A,C;C=new Array(0);for(A=0;A<B.length;A++){C.push(new PolylineEncoder.latLng(B[A][0],B[A][1]))}return C};PolylineEncoder.pointsToGLatLngs=function(C){var B,A;A=new Array(0);for(B=0;B<C.length;B++){A.push(new GLatLng(C[B][0],C[B][1]))}return A};jQuery.fn.rating=function(){return this.each(function(){ratingAffects=$(this).attr("rel");var B=jQuery("<div/>").attr({title:this.title,className:this.className}).insertAfter(this);jQuery(this).find("select option").each(function(){B.append(this.value=="0"?"<div class='cancel'><a href='#0' title='Cancel Rating'>Cancel Rating</a></div>":"<div class='star'><a href='#"+this.value+"' title='Give it a "+this.value+" Star Rating'>"+this.value+"</a></div>")});var H=this.title.split(/:\s*/)[1].split("."),C=this.action,J=H[0],F=H[1];if(F<9){F=1}var D=B.find("div.star").mouseover(E).focus(E).mouseout(A).blur(A).click(N);B.find("div.cancel").mouseover(K).focus(K).mouseout(L).blur(L).click(N);I();function E(){G();M(this)}function A(){G();I()}function L(){I();jQuery(this).removeClass("on")}function K(){G();jQuery(this).addClass("on")}function N(){J=D.index(this)+1;F=0;if(J==0){G()}rating=jQuery(this).find("a")[0].href.slice(-1);mapness.ev.sendRating(ratingAffects,rating,C);return false}function M(O){D.find("a").css("width","100%");D.slice(0,D.index(O)+1).addClass("hover")}function G(){D.removeClass("on hover")}function I(){var Q=D.slice(0,J);Q.addClass("on");var P=F?F*10:0;if(P>0&&Q.length<5){var O=D[J];$(O).addClass("on").children("a").css("width",(P)/10+"%")}}}).remove()};if(jQuery.browser.msie==true){document.execCommand("BackgroundImageCache",false,true)}json_parse=function(){var D,B,A={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},M,K=function(N){throw {name:"SyntaxError",message:N,at:D,text:M}},G=function(N){if(N&&N!==B){K("Expected '"+N+"' instead of '"+B+"'")}B=M.charAt(D);D+=1;return B},F=function(){var O,N="";if(B==="-"){N="-";G("-")}while(B>="0"&&B<="9"){N+=B;G()}if(B==="."){N+=".";while(G()&&B>="0"&&B<="9"){N+=B}}if(B==="e"||B==="E"){N+=B;G();if(B==="-"||B==="+"){N+=B;G()}while(B>="0"&&B<="9"){N+=B;G()}}O=+N;if(isNaN(O)){K("Bad number")}else{return O}},H=function(){var Q,P,O="",N;if(B==='"'){while(G()){if(B==='"'){G();return O}else{if(B==="\\"){G();if(B==="u"){N=0;for(P=0;P<4;P+=1){Q=parseInt(G(),16);if(!isFinite(Q)){break}N=N*16+Q}O+=String.fromCharCode(N)}else{if(typeof A[B]==="string"){O+=A[B]}else{break}}}else{O+=B}}}}K("Bad string")},J=function(){while(B&&B<=" "){G()}},C=function(){switch(B){case"t":G("t");G("r");G("u");G("e");return true;case"f":G("f");G("a");G("l");G("s");G("e");return false;case"n":G("n");G("u");G("l");G("l");return null}K("Unexpected '"+B+"'")},L,I=function(){var N=[];if(B==="["){G("[");J();if(B==="]"){G("]");return N}while(B){N.push(L());J();if(B==="]"){G("]");return N}G(",");J()}}K("Bad array")},E=function(){var O,N={};if(B==="{"){G("{");J();if(B==="}"){G("}");return N}while(B){O=H();J();G(":");if(Object.hasOwnProperty.call(N,O)){K('Duplicate key "'+O+'"')}N[O]=L();J();if(B==="}"){G("}");return N}G(",");J()}}K("Bad object")};L=function(){J();switch(B){case"{":return E();case"[":return I();case'"':return H();case"-":return F();default:return B>="0"&&B<="9"?F():C()}};return function(Q,O){var N;M=Q;D=0;B=" ";N=L();J();if(B){K("Syntax error")}return typeof O==="function"?function P(U,T){var S,R,V=U[T];if(V&&typeof V==="object"){for(S in V){if(Object.hasOwnProperty.call(V,S)){R=P(V,S);if(R!==undefined){V[S]=R}else{delete V[S]}}}}return O.call(U,T,V)}({"":N},""):N}}();(function(C){var A=C.scrollTo=function(D,E,F){C(window).scrollTo(D,E,F)};A.defaults={axis:"xy",duration:parseFloat(C.fn.jquery)>=1.3?0:1};A.window=function(D){return C(window)._scrollable()};C.fn._scrollable=function(){return this.map(function(){var D=this,E=!D.nodeName||C.inArray(D.nodeName.toLowerCase(),["iframe","#document","html","body"])!=-1;if(!E){return D}var F=(D.contentWindow||D).document||D.ownerDocument||D;return C.browser.safari||F.compatMode=="BackCompat"?F.body:F.documentElement})};C.fn.scrollTo=function(F,E,D){if(typeof E=="object"){D=E;E=0}if(typeof D=="function"){D={onAfter:D}}if(F=="max"){F=9000000000}D=C.extend({},A.defaults,D);E=E||D.speed||D.duration;D.queue=D.queue&&D.axis.length>1;if(D.queue){E/=2}D.offset=B(D.offset);D.over=B(D.over);return this._scrollable().each(function(){var M=this,K=C(M),L=F,I,J={},G=K.is("html,body");switch(typeof L){case"number":case"string":if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(L)){L=B(L);break}L=C(L,this);case"object":if(L.is||L.style){I=(L=C(L)).offset()}}C.each(D.axis.split(""),function(P,Q){var S=Q=="x"?"Left":"Top",R=S.toLowerCase(),U="scroll"+S,O=M[U],N=A.max(M,Q);if(I){J[U]=I[R]+(G?0:O-K.offset()[R]);if(D.margin){J[U]-=parseInt(L.css("margin"+S))||0;J[U]-=parseInt(L.css("border"+S+"Width"))||0}J[U]+=D.offset[R]||0;if(D.over[R]){J[U]+=L[Q=="x"?"width":"height"]()*D.over[R]}}else{var T=L[R];J[U]=T.slice&&T.slice(-1)=="%"?parseFloat(T)/100*N:T}if(/^\d+$/.test(J[U])){J[U]=J[U]<=0?0:Math.min(J[U],N)}if(!P&&D.queue){if(O!=J[U]){H(D.onAfterFirst)}delete J[U]}});H(D.onAfter);function H(N){K.animate(J,E,D.easing,N&&function(){N.call(this,F,D)})}}).end()};A.max=function(F,G){var I=G=="x"?"Width":"Height",H="scroll"+I;if(!C(F).is("html,body")){return F[H]-C(F)[I.toLowerCase()]()}var J="client"+I,E=F.ownerDocument.documentElement,D=F.ownerDocument.body;return Math.max(E[H],D[H])-Math.min(E[J],D[J])};function B(D){return typeof D=="object"?D:{top:D,left:D}}})(jQuery);if(!mapness){var mapness={}}var DOMcache={get:function(A){if(DOMcache[A]==undefined){DOMcache[A]=$(A)}return DOMcache[A]}};jQuery.fn.delegate=function(A,B){return this.bind(A,function(E){var D=$(E.target);for(var C in B){if(D.is(C)){return B[C].apply(this,arguments)}}})};String.prototype.entityify=function(){return this.replace(/onabort/gi,"illegal").replace(/onblur/gi,"illegal").replace(/onchange/gi,"illegal").replace(/onclick/gi,"illegal").replace(/ondblclick/gi,"illegal").replace(/onerror/gi,"illegal").replace(/onfocus/gi,"illegal").replace(/onkeydown/gi,"illegal").replace(/onkeypress/gi,"illegal").replace(/onkeyup/gi,"illegal").replace(/onload/gi,"illegal").replace(/onmouse/gi,"illegal").replace(/onreset/gi,"illegal").replace(/onresize/gi,"illegal").replace(/onselect/gi,"illegal").replace(/onsubmit/gi,"illegal").replace(/onunload/gi,"illegal")};String.prototype.quote=function(){var D,B,A=this.length,C='"';for(B=0;B<A;B+=1){D=this.charAt(B);if(D>=" "){if(D==="\\"||D==='"'){C+="\\"}C+=D}else{switch(D){case"\b":C+="\\b";break;case"\f":C+="\\f";break;case"\n":C+="\\n";break;case"\r":C+="\\r";break;case"\t":C+="\\t";break;default:D=D.charCodeAt();C+="\\u00"+Math.floor(D/16).toString(16)+(D%16).toString(16)}}}return C+'"'};function addslashes(A){A=A.replace(/\'/g,"&#39;");A=A.replace(/\"/g,"&#34;");return A}function gethash(){return location.hash.replace(/^.*#/,"")}mapness.util={stopEventBubbling:function(A){if(!A){var A=window.event}A.cancelBubble=true;if(A.stopPropagation){A.stopPropagation()}},addslashes:function(A){A=A.replace(/\'/g,"&#39;");A=A.replace(/\"/g,"&#34;");return A},nl2br:function(A){return A.replace(/\n/g,"<br/>")},br2nl:function(A){return A.replace(/<br\/>/g,"\n")},submitEnterIE:function(){if(jQuery.browser.msie){$("input").keydown(function(A){if(A.keyCode==13){$(this).parents("form").submit();return false}})}},getEventTarget:function(B){var A;if(!B){var B=window.event}if(B.target){A=B.target}else{if(B.srcElement){A=B.srcElement}}if(A.nodeType==3){A=A.parentNode}return A},limitText:function(B,A){if(B.value.length>A){B.value=B.value.substring(0,A)}}};RequestO=function(A,B,F,E){var H=null;var K=0;var G={"0":"No error","-1":"Unable to create XMLHttpRequestObject","-2":"Unsupported http method"};var C=["uninitialized","loading","loaded","interactive","complete"];if(window.XMLHttpRequest){H=new XMLHttpRequest()}else{try{H=new ActiveXObject("Msxml2.XMLHTTP")}catch(J){try{H=new ActiveXObject("Microsoft.XMLHTTP")}catch(J){K=-1;return }}}var N=new Array();var I=0;if(F){for(var D in F){N[I++]=encodeURIComponent(D)+"="+encodeURIComponent(F[D])}}query=N.join("&");var M={XMLHTTPRequest:H,RequestO:this};H.onreadystatechange=function(){var O=M.RequestO;switch(H.readyState){case 0:if(E[C[0]]){O.prevState=C[0];E[C[0]](H,O)}break;case 1:if(E[C[1]]&&O.prevState!=C[1]){O.prevState=C[1];E[C[1]](H,O)}break;case 2:if(E[C[2]]&&O.prevState!=C[2]){O.prevState=C[2];E[C[2]](H,O)}break;case 3:break;case 4:var P=H.responseText;if(E[C[4]]&&O.prevState!=C[4]){O.prevState=C[4];E[C[4]](H.responseText,H,O)}break}};this.xhttp=H;this.contentSize=0;this.error=K;this.handlers=E;this.stateString=C;this.errorString=G;switch(A.toUpperCase()){case"POST":H.open(A,B,true);H.setRequestHeader("Content-Type","application/x-www-form-urlencoded");H.send(query);break;case"GET":var L=B;if(query.length>0){L+="?"+query}H.open(A,L,true);H.send(null);break;default:K=-2;return }};function Jmap(A){var B=this;this.jmap=null;this.zoomChanged=false;this.gdir=new GDirections();this.conn_tester=new GDirections();this.pair_point_conn_tester=new GDirections();this.geoAddress=new GClientGeocoder();this.lastPoint;this.gmapPoints=[];this.lastRendered=0;this.dir_start_point=0;this.r_connection=0;this.icons=[];this.lineSettings={color:"#006fff",weight:4,opacity:0.7};this.pointMarkers=[];this.polypoints=[];this.directions=[];this.vertexes=[];this.isLastRendering=false;this.isRedraw=false;this.lastDirections=[];this.oSnap=null;this.bounds=new GLatLngBounds();this.mapMode=0;this.setMapMode=function(C){if(C==1){B.jmap.disableDoubleClickZoom();if(B.oSnap){B.oSnap._oMarker.hide();B.jmap.addOverlay(B.oSnap._oMarker)}}else{B.jmap.enableDoubleClickZoom();if(B.oSnap){B.jmap.removeOverlay(B.oSnap._oMarker)}B.oSnap=null}B.mapMode=C};this.clearMap=function(){B.clearListeners();B.jmap.clearOverlays();for(var C in mapness.journey.points){mapness.journey.points[C].j_marker.marker=null}};this.clearListeners=function(){for(i in mapness.journey.points){if(mapness.journey.points.hasOwnProperty(i)){GEvent.clearInstanceListeners(mapness.journey.points[i].j_marker)}}};this.connTester=function(D,C){if(D===undefined||C===undefined){var F=new GLatLng(mapness.journey.getRoute(-1).r_lat,mapness.journey.getRoute(-1).r_lng);if(mapness.journey.getRoute(-2)!=undefined){var E=new GLatLng(mapness.journey.getRoute(-2).r_lat,mapness.journey.getRoute(-2).r_lng)}else{var E=""}B.conn_tester.loadFromWaypoints(new Array(F,E))}else{var F=new GLatLng(D.r_lat,D.r_lng);var E=new GLatLng(C.r_lat,C.r_lng);B.pair_point_conn_tester.loadFromWaypoints(new Array(F,E))}};this.addListeners=function(){GEvent.addListener(B.gdir,"error",B.handleErrors);GEvent.addListener(B.gdir,"load",B.onGDirectionsLoad);GEvent.addListener(B.conn_tester,"error",function(){mapness.journey.setLastRConn(0);mapness.ui.showNewRouteForm(mapness.journey.getRoute(-1))});GEvent.addListener(B.conn_tester,"load",function(){mapness.journey.setLastRConn(1);mapness.ui.showNewRouteForm(mapness.journey.getRoute(-1))});GEvent.addListener(B.pair_point_conn_tester,"error",function(){mapness.ui.activateConnection(false)});GEvent.addListener(B.pair_point_conn_tester,"load",function(){mapness.ui.activateConnection(true)});GEvent.addListener(B.jmap,"zoomend",function(){B.zoomChanged=true});GEvent.addListener(B.jmap,"dblclick",function(D,C){if(mapness.journey.points.length>0&&mapness.journey.points[mapness.journey.points.length-1].r_id===null){mapness.journey.removeLastRoute()}B.lastPoint=C;if(mapness.journey.j_id){j_id=mapness.journey.j_id;route=mapness.journey.addRoute(C);route.newRouteFormMode=true;B.connTester()}else{DOMcache.get("#journeyFormHolder").show().find("#j_name").focus()}})};this.renderDirections=function(E,C){B.lastRendered=C;var D=B.gdir.loadFromWaypoints(E,{getPolyline:true,preserveViewport:true})};this.onGDirectionsLoad=function(){var E=B.gdir.getPolyline();var D=[];mapness.journey.addDistance(B.gdir.getDistance().meters);if(!mapness.customSettings||!mapness.customSettings.map||!mapness.customSettings.map.line){E.color=B.lineSettings.color;E.opacity=B.lineSettings.opacity;E.weight=B.lineSettings.weight}else{E.color=mapness.customSettings.map.line.color;E.opacity=mapness.customSettings.map.line.opacity;E.weight=mapness.customSettings.map.line.weight}var D=[];for(var C=0;C<E.getVertexCount();C++){D.push(E.getVertex(C))}B.renderPoly(D);B.zoomChanged=false;if(B.gmapPoints.length>0){B.renderJourney(B.gmapPoints,B.lastRendered)}};this.renderPoly=function(C){var D=new PolylineEncoder(19,2.1,0.000001);var E=D.dpEncode(C);if(!mapness.customSettings||!mapness.customSettings.map||!mapness.customSettings.map.line){polyline=new GPolyline.fromEncoded({color:B.lineSettings.color,weight:B.lineSettings.weight,opacity:B.lineSettings.opacity,points:E.encodedPoints,levels:E.encodedLevels,numLevels:19,zoomFactor:2.1})}else{polyline=new GPolyline.fromEncoded({color:mapness.customSettings.map.line.color,weight:mapness.customSettings.map.line.weight,opacity:mapness.customSettings.map.line.opacity,points:E.encodedPoints,levels:E.encodedLevels,numLevels:19,zoomFactor:2.1})}B.vertexes=B.vertexes.concat(C);if(!B.isRedraw||B.isLastRendering){B.encodeVertexes()}mapness.journey.addDistance(polyline.getLength());B.jmap.addOverlay(polyline);B.zoomChanged=false};this.snapToPolyline=function(D){if(B.mapMode==0){if(B.oSnap){B.oSnap.clearSnapListener()}return false}if(!B.oSnap){B.oSnap=new cSnapToRoute();var C=new GMarker(new GLatLng(0,0),{icon:B.ikonka1});B.jmap.addOverlay(C);B.oSnap.init(B.jmap,C,D,25)}B.oSnap.updateTargets(B.oSnap._oMarker,D)};this.directionTester=function(D,E){var C=new GDirections();for(i=E;i<D.length;i++){if(i>0){test_dir=new Array(D[i-1],D[i]);C.loadFromWaypoints(test_dir);break}}GEvent.addListener(C,"error",function(F){var G=mapness.journey.points;var H=B.dir_start_point+i;G[H].r_connection=0;if(mapness.journey.getEditMode()===1){G[H].sendUpdateData()}else{G[H].sendDirErrorData()}B.directions=new Array();B.gmapPoints=new Array();B.polypoints=new Array();B.lastDirections=new Array();B.clearMap();B.renderJourney(G,0)});GEvent.addListener(C,"load",function(){B.directionTester(D,i+1)})};this.handleErrors=function(D){var C="Directions Error. Code: "+B.gdir.getStatus().code;B.directionTester(B.lastDirections,0)};this.renderMarker=function(D,G,F,E){var C=new JMarker();C.createMarker(D,G,F,E);C.placeOnMap();C.addAllEvents();D.j_marker=C;return C};this.toggleDraggableMarkers=function(){for(j=0;j<mapness.journey.points.length;j++){if(mapness.journey.points[j].r_id!==null){if(mapness.journey.points[j].j_marker.marker.draggingEnabled()){mapness.journey.points[j].j_marker.marker.disableDragging()}else{mapness.journey.points[j].j_marker.marker.enableDragging()}}}};this.clickMarker=function(D){var C=mapness.journey.getRoute(D);if(mapness.journey.points[D]!==undefined&&mapness.journey.points[D].j_marker.marker!==null){if(!B.zoomChanged){mapness.map.zoomToPoint(D)}mapness.journey.points[D].j_marker.marker.openInfoWindowHtml('<p style="margin-top:20px;">'+C.r_name+"</p>",{maxWidth:350});mapness.map.jmap.setCenter(new GLatLng(mapness.journey.points[D].r_lat,mapness.journey.points[D].r_lng))}};this.zoomToPoint=function(D){if(mapness.map.jmap.getZoom()<11){var C=mapness.journey.getRoute(D);mapness.map.jmap.panTo(new GLatLng(C.r_lat,C.r_lng));mapness.map.jmap.setCenter(new GLatLng(C.r_lat,C.r_lng),11)}};this.encodeVertexes=function(){var C=new PolylineEncoder(19,2.1,0.000001);var D=C.dpEncode(B.vertexes);new RequestO("post","/xhr/encodePopylines.php",{journeyId:mapness.journey.j_id,encodedPoints:D.encodedPoints,encodedLevels:D.encodedLevels},{loading:{}});B.isLastRendering=false};this.renderJourney=function(G,J){if(J==0){B.vertexes=[];B.isRedraw=true}B.gmapPoints=G;var E=0;var I;var F;var H;var D;var C=null;if(J===0&&G.length>0&&!B.zoomChanged){B.jmap.setCenter(new GLatLng(G[0].r_lat,G[0].r_lng),4);B.directions=new Array();B.polypoints=new Array()}for(i=J;i<G.length;i++){E++;point_title=G[i].r_name;if(i===0){G[0].r_connection=0}if(G[i].r_connection==0){if(B.directions.length>1){B.renderDirections(B.directions,i);B.lastDirections=B.directions;B.directions=new Array();if(H!=undefined){B.polypoints[0]=H}B.lastRendered=i;return }point=new GLatLng(G[i].r_lat,G[i].r_lng);B.bounds.extend(point);B.polypoints.push(point);C=B.renderMarker(G[i],point,i,point_title);if(G[i].j_marker.marker!==null){C.marker.enableDragging()}D=point}else{if(B.polypoints.length>1){B.renderPoly(B.polypoints);B.polypoints=new Array();B.dir_start_point=i-1}if(D!=undefined){B.directions[0]=D}point=new GLatLng(G[i].r_lat,G[i].r_lng);B.directions.push(point);B.bounds.extend(point);H=point;if(B.directions.length>24){B.lastRendered=i;B.renderDirections(B.directions,i);B.lastDirections=B.directions;B.directions=new Array();if(G.length>i+2){if(G[i+1].r_connection==1){B.directions[0]=H}else{B.polypoints[0]=H}}return }else{C=B.renderMarker(G[i],point,i,point_title);if(G[i].j_marker.marker!==null){C.marker.enableDragging()}}}}if(B.polypoints.length>1){B.isLastRendering=true;B.renderPoly(B.polypoints);B.polypoints=new Array()}if(B.directions.length>1){B.isLastRendering=true;B.renderDirections(B.directions,G.length-1);B.lastDirections=B.directions;B.directions=new Array();B.gmapPoints=new Array()}mapness.journey.checkIfEditable();if(!B.zoomChanged){B.jmap.setCenter(B.bounds.getCenter(),B.jmap.getBoundsZoomLevel(B.bounds))}mapness.ui.journeyInfo()};this.panTo=function(E,D){var C=new GLatLng(E,D);B.jmap.panTo(C)};this.showAddress=function(){var C=DOMcache.get("#ShowOnTheMapAddress").val();B.geoAddress.getLocations(C,function(D){if(D.Status.code==G_GEO_SUCCESS){if(D.Placemark.length>1){mapness.ui.listAddresses(D)}else{DOMcache.get("#addressList").html("");var E=D.Placemark[0].Point.coordinates;B.panTo(E[1],E[0])}}else{DOMcache.get("#addressList").html(mapness.dict.words.address_not_found)}})}}function JMarker(){var A=this;this.dotIcon=new GIcon();A.dotIcon.iconSize=new GSize(44,44);A.dotIcon.shadowSize=null;A.dotIcon.iconAnchor=new GPoint(22,22);A.dotIcon.infoWindowAnchor=new GPoint(22,22);this.pinIcon=new GIcon();A.pinIcon.iconSize=new GSize(44,44);A.pinIcon.shadowSize=null;A.pinIcon.iconAnchor=new GPoint(22,22);A.pinIcon.infoWindowAnchor=new GPoint(22,22);this.ikonka1=new GIcon(A.dotIcon,"/images/map_point_01.png",null,null);this.ikonka8=new GIcon(A.pinIcon,"/images/map_pin_01.png",null,null);this.ikonka9=new GIcon(A.pinIcon,"/images/map_pin_02.png",null,null);this.ikonka10=new GIcon(A.pinIcon,"/images/map_pin_03.png",null,null);this.marker=null;this.parentRoute=null;this.html="";this.icon=null;this.title=null;this.mouseOnImage=null;this.mouseOutImage=null;this.createMarker=function(B,F,D,E,C){A.icon=(D==null)?1:D;A.html=(C==null)?"":C;A.title=E;A.parentRoute=B;A.marker=new GMarker(F,{icon:A.createIcon(),draggable:true,title:(A.title)});A.marker.clickIndex=A.parentRoute.checkRouteNumber();A.mouseOutImage=A.marker.getIcon();A.mouseOutImage=A.mouseOutImage.image;A.mouseOnImage=A.mouseOutImage.split(".");A.mouseOnImage=A.mouseOnImage[0]+"_on.png";if(mapness.journey.getEditMode()==1&&B.r_id!==null){A.marker.enableDragging()}else{A.marker.disableDragging()}};this.createIcon=function(){var C="waypoint";if(A.parentRoute.medias.length===0&&A.parentRoute.r_description!=""){C="description"}else{for(var D in A.parentRoute.medias){if(A.parentRoute.medias[D].m_type==2||A.parentRoute.medias[D].m_type==1){C="video";break}else{if(A.parentRoute.medias[D].m_type==0){C="image"}}}}var B=null;switch(C){case"waypoint":if(!mapness.customSettings||!mapness.customSettings.map||!mapness.customSettings.map.markers||!mapness.customSettings.map.markers.waypoint){B=A.ikonka1}else{var B=new GIcon();B.iconSize=new GSize(mapness.customSettings.map.markers.waypoint.size.width,mapness.customSettings.map.markers.waypoint.size.height);B.shadowSize=new GSize(mapness.customSettings.map.markers.waypoint.shadowSize.width,mapness.customSettings.map.markers.waypoint.shadowSize.height);B.iconAnchor=new GPoint(mapness.customSettings.map.markers.waypoint.iconAnchor.x,mapness.customSettings.map.markers.waypoint.iconAnchor.y);B.infoWindowAnchor=new GPoint(mapness.customSettings.map.markers.waypoint.infoWindowAnchor.x,mapness.customSettings.map.markers.waypoint.infoWindowAnchor.y);B.image=mapness.customSettings.map.markers.waypoint.image;B.shadow=mapness.customSettings.map.markers.waypoint.shadow}break;case"description":if(!mapness.customSettings||!mapness.customSettings.map||!mapness.customSettings.map.markers||!mapness.customSettings.map.markers.description){B=A.ikonka8}else{var B=new GIcon();B.iconSize=new GSize(mapness.customSettings.map.markers.description.size.width,mapness.customSettings.map.markers.description.size.height);B.shadowSize=new GSize(mapness.customSettings.map.markers.description.shadowSize.width,mapness.customSettings.map.markers.description.shadowSize.height);B.iconAnchor=new GPoint(mapness.customSettings.map.markers.description.iconAnchor.x,mapness.customSettings.map.markers.description.iconAnchor.y);B.infoWindowAnchor=new GPoint(mapness.customSettings.map.markers.description.infoWindowAnchor.x,mapness.customSettings.map.markers.description.infoWindowAnchor.y);B.image=mapness.customSettings.map.markers.description.image;B.shadow=mapness.customSettings.map.markers.description.shadow}break;case"image":if(!mapness.customSettings||!mapness.customSettings.map||!mapness.customSettings.map.markers||!mapness.customSettings.map.markers.image){B=A.ikonka9}else{var B=new GIcon();B.iconSize=new GSize(mapness.customSettings.map.markers.image.size.width,mapness.customSettings.map.markers.image.size.height);B.shadowSize=new GSize(mapness.customSettings.map.markers.image.shadowSize.width,mapness.customSettings.map.markers.image.shadowSize.height);B.iconAnchor=new GPoint(mapness.customSettings.map.markers.image.iconAnchor.x,mapness.customSettings.map.markers.image.iconAnchor.y);B.infoWindowAnchor=new GPoint(mapness.customSettings.map.markers.image.infoWindowAnchor.x,mapness.customSettings.map.markers.image.infoWindowAnchor.y);B.image=mapness.customSettings.map.markers.image.image;B.shadow=mapness.customSettings.map.markers.image.shadow}break;case"video":if(!mapness.customSettings||!mapness.customSettings.map||!mapness.customSettings.map.markers||!mapness.customSettings.map.markers.video){B=A.ikonka10}else{var B=new GIcon();B.iconSize=new GSize(mapness.customSettings.map.markers.video.size.width,mapness.customSettings.map.markers.video.size.height);B.shadowSize=new GSize(mapness.customSettings.map.markers.video.shadowSize.width,mapness.customSettings.map.markers.video.shadowSize.height);B.iconAnchor=new GPoint(mapness.customSettings.map.markers.video.iconAnchor.x,mapness.customSettings.map.markers.video.iconAnchor.y);B.infoWindowAnchor=new GPoint(mapness.customSettings.map.markers.video.infoWindowAnchor.x,mapness.customSettings.map.markers.video.infoWindowAnchor.y);B.shadow=mapness.customSettings.map.markers.video.shadow}break}if(A.parentRoute.comments.length>0){B.image=B.image.split(".")[0]+"_com."+B.image.split(".")[1]}return B};this.placeOnMap=function(){mapness.map.jmap.addOverlay(A.marker)};this.addAllEvents=function(){A.addClickAction();A.addDragEndAction();A.addMouseOverAction();A.addMouseOutImage();A.addEditAction()};this.addClickAction=function(){if(A.parentRoute.r_id!==null){GEvent.addListener(A.marker,"click",function(){mapness.journey.setActivePoint(A.marker.clickIndex);mapness.ui.showRouteInfo(A.marker.clickIndex)})}};this.addDragEndAction=function(){if(A.parentRoute.r_id!==null){GEvent.addListener(A.marker,"dragend",function(){var B=A.marker.getLatLng().lng();var C=A.marker.getLatLng().lat();A.parentRoute.setLatLng(C,B);mapness.map.clearMap();mapness.journey.resetDistance();mapness.map.renderJourney(mapness.journey.points,0);A.parentRoute.sendUpdateData()})}};this.addMouseOverAction=function(){GEvent.addListener(A.marker,"mouseover",function(){if(mapness.journey.getEditMode()===1&&A.parentRoute.r_id!==null){$(this.Nm).css("cursor","move")}A.marker.setImage(A.mouseOnImage)})};this.addMouseOutImage=function(){GEvent.addListener(A.marker,"mouseout",function(){A.marker.setImage(A.mouseOutImage)})};this.addEditAction=function(){}}if(!mapness){var mapness={}}mapness.uiState={routeValidatorInstance:null,journeyValidaterInstance:null};if(!mapness){var mapness={}}mapness.profile=new function Profile(){var E=this;var A="";var C="";var B="";var D="";this.id=null;this.about=null;this.name=null;this.login=null;this.birth=null;this.sex=null;this.street=null;this.city=null;this.country=null;this.languages=[];this.website=null;this.interests=null;this.interestsCountries=null;this.bestExperience=null;this.worstExperience=null;this.initialize=function(F){if(F){E.id=F.id;E.about=F.about;E.name=F.name;E.birth=F.birth;E.sex=F.sex;E.city=F.city;E.country=F.country;E.languages=F.languages;E.website=(F.website===null?"":F.website);if(F.interests){E.interests=F.interests.interest;E.interestsCountries=F.interests.country}E.bestExperience=(F.bestExperience===null?"":F.bestExperience);E.worstExperience=(F.worstExperience===null?"":F.worstExperience)}};this.sendAbout=function(){if(E.about===null||E.id===null){return false}else{var F=new RequestO("post","/xhr/edit_profile-about.php",{"profile[id]":E.id,"profile[about]":E.about},{loading:function(){mapness.ui.hideError($("#profile-aboutInfo"));$("#profile-aboutInfo").prepend('<div class="loaderHolder"></div>');mapness.ui.showLoader($("#profile-aboutInfo div.loaderHolder"),"aboutInfo-loader")},complete:function(G){var G=json_parse(G);mapness.ui.hideLoader($("#profile-aboutInfo"));if(G.isSuccess){mapness.ui.toggleEditProfileInfo("profile-aboutInfo")}else{mapness.ui.displayError($("#profile-aboutInfo  h2"),G.callback)}}})}};this.sendPersonalInfo=function(){if(E.id===null){return false}else{var F=new RequestO("post","/xhr/edit_profile-personalInfo.php",{"profile[id]":E.id,"profile[name]":E.name,"profile[birth]":E.birth,"profile[sex]":E.sex,"profile[street]":E.street,"profile[city]":E.city,"profile[country]":E.country,"profile[languages]":E.languages,"profile[website]":E.website},{loading:function(){mapness.ui.hideError($("#personalInfo-name"));$("#profile-personalInfo").prepend('<div class="loaderHolder"></div>');mapness.ui.showLoader($("#profile-personalInfo div.loaderHolder"),"personalInfo-loader")},complete:function(G){var G=json_parse(G);mapness.ui.hideLoader($("#profile-personalInfo"));if(G.isSuccess){mapness.ui.toggleEditProfileInfo("profile-personalInfo");mapness.ui.handleProfileInfoCallback(G.callback)}else{mapness.ui.displayError($("#profile-personalInfo h2"),G.callback.error)}}})}};this.sendInterests=function(){if(E.id===null){return false}else{var F=new RequestO("post","/xhr/edit_profile-interests.php",{"profile[id]":E.id,"profile[interests]":E.interests,"profile[interestsCountries]":E.interestsCountries,"profile[bestExperience]":E.bestExperience,"profile[worstExperience]":E.worstExperience},{loading:function(){mapness.ui.hideError($("#profile-interests"));$("#profile-interests").prepend('<div class="loaderHolder"></div>');mapness.ui.showLoader($("#profile-interests div.loaderHolder"),"interests-loader")},complete:function(G){var G=json_parse(G);mapness.ui.hideLoader($("#profile-interests"));if(G.isSuccess){mapness.ui.toggleEditProfileInfo("profile-interests");mapness.ui.handleProfileInterestsCallback(G.callback)}else{mapness.ui.displayError($("#profile-interests h2"),G.callback.error)}}})}};this.sendNewData=function(){if(mapness.journey.j_id!=null&&mapness.journey.au_id==0){var F=mapness.journey.j_id}else{var F=""}var G=new RequestO("post","/xhr/new_user.php",{"profile[au_login]":login,"profile[au_email]":B,"profile[au_npassword]":C,"profile[au_cpassword]":A,"profile[j_id]":F},{loading:function(){mapness.ui.showLoading(DOMcache.get("#profileFormError"),DOMcache.get("#profileForm"),1,"center")},complete:function(I){if(jQuery.browser.msie){var H=new ActiveXObject("Microsoft.XMLDOM");H.loadXML(I)}else{H=I}if($("error",H).size()===0){DOMcache.get("#profileFormSuccess").show();DOMcache.get("#profileFormHolder").find(".jsLoginForm").hide()}else{E.errorHandler(H,DOMcache.get("#profileForm"))}}})};this.sendLoginData=function(){var F;if(mapness.journey.j_id!=null&&mapness.journey.au_id==0){F=mapness.journey.j_id}else{F=""}var G=new RequestO("post","/xhr/login.php",{login:login,pass:D,mode:2,j_id:F},{loading:function(){mapness.ui.showLoading(DOMcache.get("#loginFormError"),DOMcache.get("#loginForm"),1,"center")},complete:function(I){if(jQuery.browser.msie){var H=new ActiveXObject("Microsoft.XMLDOM");H.loadXML(I)}else{H=I}if($("error",H).size()===0){E.profileLoggedIn()}else{E.errorHandler(H,DOMcache.get("#loginForm"))}}});return false};this.profileLoggedIn=function(){var G=window.location.hostname;var F="http://"+G+"/journey/";if(mapness.journey.j_id===null){window.location=F}else{window.location=F+mapness.journey.j_id}};this.errorHandler=function(G,F){$("error",G).each(function(){var H=$(this).text();DOMcache.get("#"+F.attr("id")+"Error").html(H+"<br/>").show();F.show()})};this.setData=function(F){if(F=="register"){login=DOMcache.get("#au_login").val().entityify();B=DOMcache.get("#au_email").val().entityify();C=DOMcache.get("#au_npassword").val().entityify();A=DOMcache.get("#au_cpassword").val().entityify()}else{login=DOMcache.get("#login").val().entityify();D=DOMcache.get("#pass").val().entityify()}};this.ev={};this.ev.submitProfile=function(){$("#profileForm").validate({debug:true,rules:{"profile[au_login]":{required:true,minlength:3,maxlength:16},"profile[au_email]":{required:true,email:true},"profile[au_npassword]":{required:function(){if(mapness.profile.au_id==0){return true}},minlength:4},"profile[terms]":{required:function(){if(mapness.profile.id===0){return"required"}}},"profile[au_cpassword]":{required:function(){if(DOMcache.get("#au_npassword").val()!=""){return true}else{return false}},equalTo:"#au_npassword"},"profile[au_password]":{required:function(){if(DOMcache.get("#au_npassword").val().entityify()!=""||mapness.profile.email!=DOMcache.get("#au_email").val().entityify()){return true}else{return false}},minLength:4}},messages:{"profile[terms]":{required:mapness.dict.words.required_terms_accept},"profile[au_login]":{required:mapness.dict.words.required_login,minlength:mapness.dict.words.required_min_login_length,maxlength:mapness.dict.words.required_max_login_length},"profile[au_email]":{required:mapness.dict.words.required_email,email:mapness.dict.words.required_email},"profile[au_npassword]":{required:mapness.dict.words.required_confirm_password,equalTo:mapness.dict.words.required_equal_password,minlength:mapness.dict.words.required_min_pass_length,maxlength:mapness.dict.words.required_max_pass_length},"profile[au_password]":mapness.dict.words.required_confirm_password,"profile[au_cpassword]":mapness.dict.words.required_equal_password},submitHandler:function(){mapness.profile.setData("register");if(mapness.profile.id===0){mapness.profile.sendNewData()}}})};this.ev.submitLogin=function(){if(mapness.profile.id===0){DOMcache.get("#loginForm").validate({rules:{login:"required",pass:"required"},submitHandler:function(){mapness.profile.setData("login");mapness.profile.sendLoginData()}})}}};if(!mapness){var mapness={}}mapness.journey=new function Journey(){var D=this;var I=0;var A=0;var F="";var K="";var B="";var G="";var E="";var C="00:00";var J=0;var H=0;this.swfObject=null;this.owner_name="";this.activeIframes=[];this.j_id=null;this.au_id="";this.j_name="";this.j_description="-";this.j_start="";this.j_finish="";this.j_transport="";this.j_status="";this.j_rating="";this.j_newest_date="0000-00-00 00:00";this.all_transpors=[];this.points=[];this.currentlyEditedObject=[];this.currentlyEditedObject.route=null;this.mediaMode;this.comments=[];this.currentActive=-1;this.getDuration=function(){if(mapness.create_date_from_XML(D.getFinish())<mapness.create_date_from_XML(D.j_newest_date)){var N=D.j_newest_date;D.j_finish=D.j_newest_date}else{var N=D.getFinish()}var M=mapness.create_date_from_XML(D.getStart());var P=mapness.create_date_from_XML(N);var Q=Math.floor((P-M)/(1000*60*60*24));var L=Math.floor(((P-M)/(1000*60*60*24)-Q)*24);var O=Math.floor((((P-M)/(1000*60*60*24)-Q)*24-L)*60);if(isNaN(O)||Q<0||L<0||O<0){C=""}else{C=Q+"d "+L+"h "+O+" m"}return C};this.getFinish=function(L){var M=D.j_finish.split(" ");if(L==="date"){if(M[0]==="0000-00-00"){return""}else{return M[0]}}else{if(L==="time"){if(M[1]!=undefined){return M[1].substr(0,5)}else{return""}}else{return D.j_finish}}};this.AddTransport=function(M){var L=false;for(j=0;j<D.all_transpors.length;j++){if(D.all_transpors[j]===M){L=true}}if(L===false){D.all_transpors.push(M)}};this.getDistance=function(){if(mapness.data.profile.metric==="k"){return A/1000}else{return A/1609.344}};this.resetDistance=function(){A=0};this.addDistance=function(L){A+=L;mapness.ui.journeyStats()};this.setEditMode=function(L){H=L;mapness.map.setMapMode(L)};this.setLastLatLng=function(L,M){D.points[D.points.length-1].setLatLng(L,M)};this.setLastGPoint=function(L){D.points[D.points.length-1].r_gpoint=L};this.setLastRConn=function(L){D.points[D.points.length-1].r_connection=L};this.setRouteModified=function(L){D.points[L].r_modified=1};this.getEditMode=function(){return H};this.getPoints=function(L){if(L===undefined){return D.points}else{return D.points[L]}};this.getPointById=function(M){for(var L in D.points){if(D.points[L].r_id===M){return D.points[L]}}};this.getPointIndex=function(L){for(var M in D.points){if(D.points[M]===L){return M}}};this.setCurrentlyEditedObject=function(M,L){D.currentlyEditedObject.route=M;D.currentlyEditedObject.media=L};this.getStart=function(L){var M=D.j_start.split(" ");if(L==="date"){return M[0]}else{if(L==="time"){return M[1].substr(0,5)}else{return D.j_start}}};this.getOwner=function(){return I};this.getRoute=function(L){if(L<0){return D.points[D.points.length+L]}else{if(L<D.points.length){return D.points[L]}else{return false}}};this.addRoute=function(M){var L=new Route(D);L.r_gpoint=M;L.setLatLng(M.lat(),M.lng());D.points.push(L);return L};this.removeLastRoute=function(){D.points.pop()};this.removeRoute=function(){if(D.points.length>1&&D.currentActive<=0&&D.points[1].r_connection==1){D.points[1].r_connection=0;D.points[1].sendUpdateData()}D.points.splice(D.currentActive,1);if(D.points.length<D.currentActive+1){D.currentActive=D.points.length-1}mapness.map.clearMap();D.drawJourney();mapness.ui.initialiseScrollPane();if(D.points.length==0){mapness.ui.journeyInfo()}else{window.location.hash="#"+D.currentActive}};this.isEditable=function(){if(J==1){return true}else{return false}};this.checkIfEditable=function(){if(D.isEditable()&&(D.getEditMode()===0)){mapness.map.setMapMode(1)}};this.setActivePoint=function(M){if(D.points.length>0){var N=D.currentActive;if(typeof (M)=="string"){switch(M){case"prev":M=(D.currentActive>0)?D.currentActive-1:0;if(D.points[M].isWaypoint&&D.getEditMode()==0){D.currentActive=M;D.setActivePoint("prev");return false}break;case"next":M=(D.currentActive<D.points.length-1)?parseInt(D.currentActive)+1:D.points.length-1;if(D.points[M].isWaypoint&&D.getEditMode()==0){D.currentActive=M;D.setActivePoint("next");return false}break;case"last":M=D.points.length-1;if(D.points[M].isWaypoint&&D.getEditMode()==0){D.currentActive=M;D.setActivePoint("prev");return false}break}}D.currentActive=M;if(D.getEditMode()===0){var L=window.location.hash.split("-");if(L.length>1){window.location.hash="#"+(parseInt(D.currentActive,10)+1)+"-"+L[1]}else{window.location.hash="#"+(parseInt(D.currentActive,10)+1)}}mapness.map.clickMarker(M);mapness.ui.showRouteInfo(M);mapness.ui.makeJMenuActive(M)}return false};this.setData=function(){D.j_name=DOMcache.get("#j_name").val().entityify();D.j_description=mapness.util.nl2br(DOMcache.get("#j_description").val().entityify());D.j_start=DOMcache.get("#j_start").val().entityify()+" "+DOMcache.get("#j_start_time").val().entityify();J=1;D.checkIfEditable()};this.errorHandler=function(L){$("error",L).each(function(){var M=$(this).text();mapness.ui.displayError(M,DOMcache.get("#journeyForm"),"journey")})};this.journeyAdded=function(L){D.j_id=$("insert_id",L).text();D.au_id=mapness.profile.id;DOMcache.get("#r_date").val(DOMcache.get("#j_start").val());DOMcache.get("#r_date_time").val(DOMcache.get("#j_start_time").val());mapness.initJourney();mapness.ui.makeSortablePointList();if(mapness.profile.id!==0){mapness.upload.createFlashUploader()}I=(mapness.data.profile.name==""?mapness.data.profile.login:mapness.data.profile.name);DOMcache.get("#topMessage a:first").attr("href","/traveler/"+mapness.data.profile.login);mapness.journey.setEditMode(1);mapness.map.toggleDraggableMarkers();DOMcache.get("body").addClass("journeyEditMode");DOMcache.get("#kmlButton").show();DOMcache.get("#saveJourney").show();DOMcache.get("#editJourney").hide();mapness.ui.journeyInfo()};this.recreatePointList=function(O,Q){tempPoints=new Array();for(var P=0;P<O.length;P++){tempPoints[P]=D.points[O[P]]}for(var N=0;N<tempPoints.length;N++){if(tempPoints[N].r_order!=D.points[N].r_order){tempPoints[N].r_modified=1}}D.points=new Array();D.points=tempPoints;D.points[0].r_connection=0;var M=[];for(P=0;P<D.points.length;P++){M.push(D.points[P].r_id);D.points[P].r_order=P}var L=D.getPointById(Q).r_order;D.currentActive=L;D.saveJourneyOrder(M);D.drawJourney()};this.saveJourneyOrder=function(L){var M=new RequestO("post","/xhr/order_route.php",{"journey[au_id]":mapness.profile.id,"journey[r_id]":L},{loading:"",complete:null})};this.singleJourney=function(M){var L=0;D.au_id=M.owner_id;D.j_id=M.id;D.j_name=M.name;D.j_description=M.description;D.j_start=M.start;D.j_status=M.status;if(M.owner_instance.name===""){I=M.owner_instance.login}else{I=M.owner_instance.name}D.j_rating=M.rating;J=M.can_edit;C=M.duration;if(D.j_status==0&&J==1){DOMcache.get("#publishJourney").show()}else{DOMcache.get("#publishJourney").hide()}mapness.map.setMapMode(1);mapness.ui.journeyInfo();if(M.route.length>0){$(M.route).each(function(){var N=new Route(D);N.setDataFromXML($(this));D.points.push(N)});D.drawJourney()}};this.drawJourney=function(){mapness.map.clearMap();D.resetDistance();mapness.map.renderJourney(D.points,0);mapness.ui.populateJMenu(D.points)};this.appendRoute=function(M){D.points[D.points.length-1].r_id=$("insert_id",M).text();var O=new GLatLng(D.points[D.points.length-1].r_lat,D.points[D.points.length-1].r_lng);mapness.map.renderMarker(D.points[D.points.length-1],O,D.points.length-1,D.points[D.points.length-1].r_name);DOMcache.get("#routeFormHolder").fadeOut("fast").find("#routeFormSuccess").hide().find("#routeFormError").hide();mapness.ui.populateJMenu(D.points);if(D.points.length>1){var N=new GLatLng(D.points[D.points.length-2].r_lat,D.points[D.points.length-2].r_lng);var P=new Array(N,O);var L=D.points[D.points.length-1].r_connection;mapness.map.isRedraw=false;if(L==1){mapness.map.renderDirections(P,D.points.length-1)}else{mapness.map.renderPoly(P)}}mapness.ui.initialiseScrollPane();mapness.map.clickMarker(D.points.length-1);mapness.ui.showRouteInfo(D.points.length-1);mapness.ui.makeJMenuActive(D.points.length-1);mapness.journey.currentActive=D.points.length-1};this.sendData=function(){var L=new RequestO("post","/xhr/new_journey.php",{"journey[au_id]":mapness.profile.id,"journey[j_name]":D.j_name,"journey[j_description]":D.j_description,"journey[j_start]":D.j_start},{loading:function(){mapness.ui.showLoading(DOMcache.get("#journeyFormError"),DOMcache.get("#journeyForm"),1,"center")},complete:function(M){if(jQuery.browser.msie){var N=new ActiveXObject("Microsoft.XMLDOM");N.loadXML(M)}else{N=M}if($("error",N).size()==0){D.journeyAdded(N);DOMcache.get("#journeyFormHolder").fadeOut("fast")}else{D.errorHandler(N)}}})};this.sendUpdateData=function(){var L=new RequestO("post","/xhr/edit_journey.php",{"journey[j_id]":D.j_id,"journey[au_id]":mapness.profile.id,"journey[j_name]":D.j_name,"journey[j_description]":D.j_description,"journey[j_start]":D.j_start,"journey[j_status]":D.j_status},{loading:function(){mapness.ui.showLoading(DOMcache.get("#journeyFormError"),DOMcache.get("#journeyForm"),1,"center")},complete:function(M){if(jQuery.browser.msie){var N=new ActiveXObject("Microsoft.XMLDOM");N.loadXML(M)}else{N=M}if($("error",N).size()===0){mapness.ui.journeyInfo();DOMcache.get("#journeyFormHolder").fadeOut("fast")}else{D.errorHandler(N)}}})};this.deleteJourney=function(){var L=new RequestO("post","/xhr/del_journey.php",{"journey[j_id]":D.j_id},{loading:function(){mapness.ui.showLoading(DOMcache.get("#deleteFormError"),DOMcache.get("#deleteForm"),1,"center")},complete:function(M){if(jQuery.browser.msie){var N=new ActiveXObject("Microsoft.XMLDOM");N.loadXML(M)}else{N=M}if($("error",N).size()==0){DOMcache.get("#deleteFormError").html(mapness.dict.words.delete_success);document.location.href="/"}else{DOMcache.get("#deleteFormError").html($("error",N).text())}}})};this.publishJourney=function(M){if(mapness.profile.id===0){DOMcache.get("#register_j_id").val(mapness.journey.j_id);mapness.ui.showForm(DOMcache.get("#profileForm"),DOMcache.get("#au_name"),"profile");DOMcache.get("#profileFormError").html(mapness.dict.words.please_register);DOMcache.get("#profileFormError").show()}else{DOMcache.get("#profileFormError").hide();var L=new RequestO("post","/xhr/end_journey.php",{"journey[j_id]":mapness.journey.j_id},{loading:function(){DOMcache.get("#publishJourney").hide();mapness.ui.showLoading(DOMcache.get("#publishHolder"),"","S1","center");mapness.ui.showLoading(DOMcache.get("#finishEditingForm"),"","1","center")},complete:function(N){if(jQuery.browser.msie){var O=new ActiveXObject("Microsoft.XMLDOM");O.loadXML(N)}else{O=N}if($("error",O).size()==0){if(M){window.location="/journey/"+mapness.journey.j_id}else{mapness.journey.j_status=1;DOMcache.get("#publishHolder").html(mapness.dict.words.journey_published);DOMcache.get("#publishHolder").fadeOut(2000);DOMcache.get("#shareJourneyForm .jsShareIntro").show();DOMcache.get("#shareJourneyService").show();DOMcache.get("#shareJourneyForm .jsEffect").html(mapness.dict.words.journey_effectPublished);DOMcache.get("#finishEditingFormHolder").fadeOut("fast");DOMcache.get("#shareJourneyFormHolder").fadeIn("fast")}}else{DOMcache.get("#publishHolder").html($("error",O).text()+'<img class="editTools" id="publishJourney" src="/images/'+mapness.dict.lang+'/but_publish.gif" onclick="mapness.journey.publishJourney();" style="display:block">');DOMcache.get("#publishJourney").show()}}})}};this.addReplyComment=function(N){var P=[];var L=[];var O=0;var Q=0;for(var M in D.comments){if(D.comments[M].id==N.replyTo){O=M}if(N.replyTo==D.comments[M].replyTo){Q++}}P=D.comments.slice(0,parseInt(O,10)+1+Q);P.push(N);L=D.comments.slice(parseInt(O,10)+1+Q);D.comments=P.concat(L)}};if(!mapness.ui){mapness.ui={}}mapness.ui.hideNewJourneyForm=function(){DOMcache.get("#journeyFormHolder").fadeOut("fast")};mapness.ui.journeyInfo=function(){DOMcache.get("#journeyTitle").html(mapness.journey.j_name+'<a class="journeyInfoButton" href="javascript:;" onclick="mapness.ui.journeyInfo();"><span>'+mapness.dict.words.journey_infoButton+"</span></a>");DOMcache.get("#descGallery").html(mapness.journey.j_description);DOMcache.get("#menuImages").hide();DOMcache.get("#menuVideos").hide();DOMcache.get("#images").hide();DOMcache.get("#videos").hide();DOMcache.get("#right h2.title").hide();DOMcache.get("#journeySummary").show();DOMcache.get("#routeSummary").hide();var A=DOMcache.get("body").height()-142-DOMcache.get("#journeySummary").height();DOMcache.get("#mediaContainer").height(A);DOMcache.get("#journeyOwner").html(mapness.journey.getOwner());DOMcache.get("#journeyDuration").html(mapness.journey.getDuration());var B=mapness.journey.j_start;DOMcache.get("#journeyStart").html(B.substr(0,16));mapness.ui.journeyStats();if(mapness.journey.currentActive>=0){mapness.journey.points[mapness.journey.currentActive].j_marker.marker.closeInfoWindow();$("#pointNo"+mapness.journey.currentActive).removeClass("active");mapness.journey.currentActive=-1}};mapness.ui.journeyStats=function(){var E=mapness.getTransportationNames();var C=mapness.journey.all_transpors;var F="";$(C).each(function(){F+=E[this]+" "});DOMcache.get("#journeyTransport").html(F);if(mapness.data.profile.metric==="m"){var D=mapness.dict.words.unit_miles}else{var D="km"}if(mapness.create_date_from_XML(mapness.journey.getFinish())<mapness.create_date_from_XML(mapness.journey.j_newest_date)){var B=mapness.journey.j_newest_date}else{var B=mapness.journey.getFinish()}if(B==="0000-00-00 00:00:00"||B===""){var A=mapness.dict.words.journey_due}else{if(mapness.create_date_from_XML(B)>new Date()){var A=B.substr(0,16)+"("+mapness.dict.words.journey_due+")"}else{DOMcache.get("#journeyDuration").html("("+mapness.journey.getDuration()+")");var A=B.substr(0,16)}}DOMcache.get("#journeyFinish").html(A);DOMcache.get("#journeyDistance").html(mapness.journey.getDistance().toFixed(2)+" "+D)};mapness.ui.populateJMenu=function(D){var B="";DOMcache.get("#left_points").html("");var A=1;for(var C=0;C<D.length;C++){B+="<div class='left_point sortable "+(D[C]==mapness.journey.points[mapness.journey.currentActive]?"active":"")+"' id='pointNo"+C+"' rel='"+D[C].r_id+"'>";B+="<span class='title'>";B+='<a class="vNumber" href="javascript:;" title="'+D[C].r_name+'" onclick="mapness.journey.setActivePoint('+C+');">'+A+"</a>";B+='<a class="vDate" href="javascript:;" title="'+D[C].r_name+'" onclick="mapness.journey.setActivePoint('+C+');">'+D[C].getRDate("date")+"</a></span></div>";A++;DOMcache.get("#left_points").append(document.getElementById("pointNo"+C))}DOMcache.get("#left_points").append(B);B="";$("#right .addMedia").css("display","inline");mapness.ui.makeSortablePointList()};mapness.ui.makeJMenuActive=function(C){var B=0;DOMcache.get("#left_points").find("div.left_point").removeClass("active");var F=parseInt($("#left_points div.left_point:last").attr("id").split("No")[1],10);var G=DOMcache.get("#left_points").height();var E=parseInt(((C/(F))*G),10);var A=0-parseInt(DOMcache.get("#left_points").css("top"),10);var D=DOMcache.get("#left_content").height();if((A)>E-D){B=E-A-(D/2);if(B<(-(G-D))){B=-(G-D)}}else{B=E-A-D+(D/2);if(B>(G-D)){B=G-D}}$("#left_points div[id=pointNo"+C+"]").addClass("active");if($(".jScrollPaneTrack").html()!=null){DOMcache.get("#left_points")[0].scrollBy(B)}};mapness.ui.showEditJourney=function(){DOMcache.get("#journeyFormHolder h1:first").html(mapness.dict.words.edit_journey_action);DOMcache.get("#journeyFormButton").html("<span>"+mapness.dict.words.save+"</span>").attr("class","button2 search save");DOMcache.get("#journeyFormError").hide();DOMcache.get("#journeyForm").show();DOMcache.get("#j_name").val(mapness.journey.j_name);DOMcache.get("#j_description").val(mapness.util.br2nl(mapness.journey.j_description));DOMcache.get("#j_start").val(mapness.journey.getStart("date"));DOMcache.get("#j_start_time").val(mapness.journey.getStart("time"));DOMcache.get("#journeyFormSubmit").attr("src","/images/"+mapness.dict.lang+"/but_save.gif");DOMcache.get("#journeyFormHolder").fadeIn("fast").find("#j_name").focus()};if(!mapness.ev){mapness.ev={}}mapness.ev.submitJourney=function(){DOMcache.get("#journeyForm").validate({rules:{"journey[au_id]":"required","journey[j_name]":"required","journey[j_start]":"required"},submitHandler:function(){if(mapness.journey.j_id===null){mapness.journey.setData();mapness.journey.sendData()}else{mapness.journey.setData();mapness.journey.sendUpdateData()}},wrapper:"p"})};mapness.ui.shareJourney=function(){var A=window.location.host;DOMcache.get("#shareHolderInput").attr("value","http://"+A+"/journey/"+mapness.journey.j_id)};if(!mapness){var mapness={}}function Route(C){var B=C;var A=this;this.swfUploadQueue={};this.hasSwfLoader=null;this.editMode="new";this.newRouteFormMode=true;this.isWaypoint=true;this.r_id=null;this.r_name="";this.r_lng="";this.r_lat="";this.r_order="";this.r_description="";this.r_date="";this.r_transport="";this.r_connection="";this.r_preffered="";this.r_gmarker;this.r_gpoint;this.j_marker=new JMarker();this.m_type=[];this.medias=[];this.r_modified=0;this.comments=[];this.checkRouteNumber=function(){for(var D in mapness.journey.points){if(mapness.journey.points[D]==this){A.r_order=D;return D}}};this.setLatLng=function(E,D){A.r_lat=E;A.r_lng=D};this.getRDate=function(D){var E;E=A.r_date.split(" ");if(D==="date"){if(E[0]==="0000-00-00"){return""}else{return E[0]}}else{if(D==="time"){if(E[1]===undefined){return E[0].substr(0,5)}else{return E[1].substr(0,5)}}else{return A.r_date}}};this.appendMedia=function(D){A.isWaypoint=false;A.medias.push(D)};this.setData=function(){A.r_name=DOMcache.get("#r_name").val().entityify();A.r_lng=DOMcache.get("#r_lng").val().entityify();A.r_lat=DOMcache.get("#r_lat").val().entityify();A.r_description=mapness.util.nl2br(DOMcache.get("#r_description").val().entityify());if(DOMcache.get("#r_date").val()!=""){A.r_date=DOMcache.get("#r_date").val().entityify()+" "+DOMcache.get("#r_date_time").val().entityify()}mapness.journey.j_newest_date="0000-00-00 00:00";if(mapness.create_date_from_XML(mapness.journey.j_newest_date)<mapness.create_date_from_XML(A.r_date)){mapness.journey.j_newest_date=A.r_date}A.r_transport=DOMcache.get("#r_transport").val();if(A.r_transport!=""){mapness.journey.AddTransport(A.r_transport)}if(DOMcache.get("#r_connection1 input").is(":checked")){A.r_connection=1}else{A.r_connection=0}if(A===mapness.journey.points[0]){A.r_connection=0}if(A.r_name!==""||A.r_description!==""){A.isWaypoint=false}};this.setDataFromXML=function(D){var E=D;A.r_id=E[0].id;A.r_name=E[0].name;if(A.r_name!=""){A.isWaypoint=false}A.r_lng=E[0].lng;A.r_lat=E[0].lat;A.r_order=E[0].order;A.r_description=E[0].description;if(A.r_description!=""){A.isWaypoint=false}A.r_date=E[0].date;if(mapness.create_date_from_XML(mapness.journey.j_newest_date)<mapness.create_date_from_XML(A.r_date)){mapness.journey.j_newest_date=A.r_date}A.r_transport=E[0].transport;if(A.r_order!=0&&A.r_transport!==""&&A.r_transport!==null){mapness.journey.AddTransport(A.r_transport)}A.r_connection=E[0].connection;$(E[0].mediaList).each(function(){if(this.type!=undefined){A.isWaypoint=false;var F=new Media(A);F.setDataFromXML($(this));A.medias.push(F)}})};this.routeAdded=function(D){mapness.journey.appendRoute(D)};this.errorHandler=function(D){$("error",D).each(function(){var E=$(this).text();mapness.ui.displayError(E,DOMcache.get("#routeForm"),"route")})};this.sendUpdateData=function(){if(A.r_date==="0000-00-00 00:00:00"){A.r_date=""}var D=new RequestO("post","/xhr/edit_route.php",{"route[r_id]":A.r_id,"route[au_id]":mapness.profile.id,"route[j_id]":mapness.journey.j_id,"route[r_name]":A.r_name,"route[r_lon]":A.r_lng,"route[r_lat]":A.r_lat,"route[r_order]":A.r_order,"route[r_description]":A.r_description,"route[r_date]":A.r_date,"route[r_transport]":A.r_transport,"route[r_connection]":A.r_connection},{loading:function(){mapness.ui.showLoading(DOMcache.get("#routeFormError"),DOMcache.get("#routeForm"),1,"center")},complete:function(F){if(jQuery.browser.msie){var E=new ActiveXObject("Microsoft.XMLDOM");E.loadXML(F)}else{E=F}if($("error",E).size()===0){if(!A.newRouteFormMode){DOMcache.get("#routeFormHolder").fadeOut("fast");mapness.journey.drawJourney();mapness.ui.showRouteInfo(A.checkRouteNumber())}A.newRouteFormMode=true}else{if(!A.newRouteFormMode){A.errorHandler(E)}}}})};this.sendDirErrorData=function(){var D=new RequestO("post","/xhr/gerror.php",{"route[r_id]":A.r_id,"route[au_id]":mapness.profile.id},{loading:null,complete:null})};this.sendData=function(){var D=new RequestO("post","/xhr/new_route.php",{"route[au_id]":mapness.profile.id,"route[j_id]":mapness.journey.j_id,"route[r_name]":A.r_name,"route[r_lon]":A.r_lng,"route[r_lat]":A.r_lat,"route[r_order]":A.r_order,"route[r_description]":A.r_description,"route[r_date]":A.r_date,"route[r_transport]":A.r_transport,"route[r_connection]":A.r_connection},{loading:function(){mapness.ui.showLoading(DOMcache.get("#routeFormError"),DOMcache.get("#routeForm"),1,"center")},complete:function(F){if(jQuery.browser.msie){var E=new ActiveXObject("Microsoft.XMLDOM");E.loadXML(F)}else{E=F}if($("error",E).size()===0){A.routeAdded(E);DOMcache.get("#routeFormHolder").fadeOut("fast").find("#routeFormSuccess").hide().find("#routeFormError").hide()}else{A.errorHandler(E)}}})};this.deleteRoute=function(){var D=new RequestO("post","/xhr/del_route.php",{r_id:A.r_id},{loading:function(){mapness.ui.showLoading(DOMcache.get("#deleteFormError"),DOMcache.get("#deleteForm"),1,"center")},complete:function(F){if(jQuery.browser.msie){var E=new ActiveXObject("Microsoft.XMLDOM");E.loadXML(F)}else{E=F}if($("error",E).size()===0){DOMcache.get("#deleteFormError").html(mapness.dict.words.delete_success);DOMcache.get("#deleteFormHolder").fadeOut("fast");mapness.journey.removeRoute()}else{DOMcache.get("#deleteFormError").html($("error",E).text())}}})};this.removeMedia=function(){var D=mapness.journey.currentlyEditedObject.media;A.medias.splice(D,1);mapness.ui.showRouteInfo(mapness.journey.currentActive)};this.reorderMedia=function(D,E){var F=new RequestO("post","/xhr/order_media.php",{mediaOrder:D},{loading:"",complete:function(){var G=[];for(var H in D){G.push(A.getMediaById(D[H]))}A.medias=G}})};this.getMediaById=function(E){for(var D in A.medias){if(A.medias[D].m_id==E){return A.medias[D]}}};this.addReplyComment=function(F){var H=[];var D=[];var G=0;var I=0;for(var E in A.comments){if(A.comments[E].id==F.replyTo){G=E}if(F.replyTo==A.comments[E].replyTo){I++}}H=A.comments.slice(0,parseInt(G,10)+1+I);H.push(F);D=A.comments.slice(parseInt(G,10)+1+I);A.comments=H.concat(D)}}mapness.ui.showRouteInfo=function(K){var J=mapness.journey.points;var N=new Array();var G=new Array();var L=new Array();var F=new Array();var B=0;var O=0;var D=J[K].medias;var Q=mapness.getTransportationNames();var E=mapness.journey.au_id;var S=mapness.journey.j_id;var C=J[K].r_id;var H=J[K].r_transport;DOMcache.get("#journeySummary").hide();DOMcache.get("#routeSummary").show();if(K==0){DOMcache.get("#routeSummary").hide()}else{DOMcache.get("#routeSummary").show();DOMcache.get("#routeTime").prev().html(mapness.dict.words.route_time);DOMcache.get("#routeTransport").html(Q[J[K].r_transport]);DOMcache.get(".jsRouteStart").show()}if(J[K].r_transport===""||J[K].r_transport===null){DOMcache.get(".jsRouteTransport").hide()}else{DOMcache.get(".jsRouteTransport").show()}var A=J[K].getRDate().substr(0,16);if(K===0){DOMcache.get("#routeTime").html(mapness.journey.j_start);DOMcache.get("#routeTime").prev().html(mapness.dict.words.route_time_start)}else{if(mapness.create_date_from_XML(A)>new Date()){A+=" ("+mapness.dict.words.journey_timePlanned+")"}else{if(A==="0000-00-00 00:00"){DOMcache.get(".jsRouteStart").hide()}}}DOMcache.get("#routeTime").html(A);DOMcache.get("#right h2.title").show().html("<a id='routeEditButton' class='button2 editTools editText editButton edit tip' title='"+mapness.dict.words.tip_editroute+"' href='#' onclick='mapness.ui.editRoute("+K+")'><span>"+mapness.dict.words.editRoute+"</span></a><a id='routeDeleteButton' class='button2 editTools tip' title='"+mapness.dict.words.tip_deleteroute+"' href='#' onclick='mapness.ui.deleteForm(\"route\","+K+")'><span>"+mapness.dict.words.deleteRoute+"</span></a>"+J[K].r_name);DOMcache.get("#descGallery").html(J[K].r_description);DOMcache.get("#pointGallery").html("");DOMcache.get("#moviesGallery").html("");var I=0;$(D).each(function(){if(this.m_type==0){B++;var V='<div id="img'+this.m_id+'" class="galImage">';V+="<img class='editTools dragImg' src='/images/button_image_move.gif' />";V+="<img onclick='mapness.ui.editMedia("+I+");' class='editTools editImg' src='/images/button_image_desc.gif' />";if(!mapness.customSettings||!mapness.customSettings.images||!mapness.customSettings.images.maxSize){V+='<a rel="lightbox" title="'+addslashes(this.m_description)+'" href="/uimages/'+E+"/"+S+"/"+this.m_source+'"><img alt="" src="/uimages/'+E+"/"+S+"/thumb/"+this.m_source+'"></a>'}else{V+='<a rel="lightbox" title="'+mapness.dict.words.journey_seeFullImages+" <a href='http://mapvivo.com/journey/"+S+"'>http://mapvivo.com/journey/"+S+'</a>" href="/xhr/widget/image.php?url=/uimages/'+E+"/"+S+"/"+this.m_source+"&w="+mapness.customSettings.images.maxSize.width+"&h="+mapness.customSettings.images.maxSize.height+'"><img alt="" src="/uimages/'+E+"/"+S+"/thumb/"+this.m_source+'"></a>'}V+="<img onclick='mapness.ui.delMedia("+I+");' class='editTools delImg' src='/images/button_image_del.gif' /></div>";DOMcache.get("#pointGallery").append(V)}else{if(this.m_type==1||this.m_type==2){O++;var U="<div class='galImage'>";if(this.m_type==1){var T=this.m_source;T=T.split("v=");T=T[1];T=T.split("&");T=T[0];U+="<img onclick='mapness.ui.editMedia("+I+");' class='editTools editImg'  src='/images/button_image_desc.gif' />";U+="<a onclick=\"mapness.ui.showVideo(1,'"+T+"','"+mapness.util.addslashes(this.m_description)+"'); return false;\" title='"+this.m_description+"' href='#'><img alt='film' src='http://img.youtube.com/vi/"+T+"/default.jpg'></a>";U+="<img onclick='mapness.ui.delMedia("+I+");' class='editTools delImg' src='/images/button_image_del.gif' /></div>";DOMcache.get("#moviesGallery").append(U)}else{if(this.getType()==2){U+="<img onclick='mapness.ui.editMedia("+I+");' class='editTools editImg' src='/images/button_image_desc.gif' />";U+="<a rel='imagebox-"+C+"' title='"+this.m_description+"' href='/uimages/"+E+"/"+S+"/"+this.m_source+"'><img alt='film' src='/uimages/"+mapness.profile.au_id+"/"+S+"/thumb/"+this.m_source+"'></a>";U+="<img onclick='mapness.ui.delMedia("+I+");' class='editTools delImg' src='/images/button_image_del.gif' /></div>";DOMcache.get("#moviesGallery").append(U)}}}}I++});DOMcache.get("#pointGallery").append("<div class='clearer'></div>");if(mapness.journey.swfUpload){for(var M in mapness.upload.queue["q_"+C]){var P=mapness.journey.swfUpload.getFile(mapness.upload.queue["q_"+C][M].file.index);if(P.filestatus==-1||P.filestatus==-2){mapness.upload.queue["q_"+C][M].buildLoaderHtml(DOMcache.get("#pointGallery"));if(P.filestatus==-1){mapness.upload.queue["q_"+C][M].changeStatus(mapness.dict.words.uploader_queued)}else{mapness.upload.queue["q_"+C][M].changeStatus(mapness.dict.words.uploader_uploading)}}}}if(J[K].r_description!==""){DOMcache.get("#menuDesc").show()}else{DOMcache.get("#menuDesc").hide()}if(B>0||mapness.journey.getEditMode()==1){DOMcache.get("#images").show()}else{DOMcache.get("#images").hide()}if(O>0||mapness.journey.getEditMode()==1){DOMcache.get("#videos").show()}else{DOMcache.get("#videos").hide()}if(B>0){DOMcache.get("#menuImages").show().css("display","inline").find("a").html(mapness.dict.words.images+"<span class='mCount'> ( "+B+" )</span>")}else{DOMcache.get("#menuImages").hide()}if(O>0){DOMcache.get("#menuVideos").show().css("display","inline").find("a").html(mapness.dict.words.video+"<span class='mCount'> ( "+O+" )</span>")}else{DOMcache.get("#menuVideos").hide()}DOMcache.get("#mediaContainer").height(h-142-DOMcache.get("#journeySummary").height());$("#ImageBoxOverlay").remove();$("#ImageBoxOuterContainer").remove();mapness.ui.initImageBox();mapness.ui.mapLayout();DOMcache.get("#mediaContainer").scrollTo(0);if(mapness.journey.getEditMode()!=1&&window.location.hash.split("-").length>1){var R=window.location.hash.split("-")[1];$("#mediaContainer").scrollTo("#com_"+window.location.hash.split("-")[1],200);window.location.hash=window.location.hash.split("-")[0]}if(mapness.journey.getEditMode()==1){mapness.ui.makeImagesSortable()}};mapness.ui.makeImagesSortable=function(){$(".galImage").addClass("sortable");$("#pointGallery").sortable({accept:"sortable",activeclass:"sortableactive",hoverclass:"sortablehover",helperclass:"sorthelper",placeholder:"imageMovePlaceholder",forceHelperSize:true,tolerance:"pointer",handle:".dragImg",opacity:0.5,fit:false,items:".galImage",update:function(D,E){var F=E.item.attr("id").split("img")[1];var C=$("#pointGallery").sortable("toArray");var B=new Array();for(i=0;i<C.length;i++){var A=C[i].split("img")[1];B.push(A)}mapness.journey.points[mapness.journey.currentActive].reorderMedia(B,F)}})};mapness.ui.hideNewRouteForm=function(){DOMcache.get("#routeFormHolder").fadeOut("fast");if(!mapness.journey.currentlyEditedObject.route){mapness.journey.removeLastRoute()}};mapness.ui.showNewRouteForm=function(A){mapness.uiState.routeValidatorInstance.resetForm();mapness.journey.currentlyEditedObject.route=null;DOMcache.get("#routeFormHolder .form h1").html(mapness.dict.words.new_route);DOMcache.get("#routeForm").show();DOMcache.get("#routeFormHolder #routeSubmit").html("<span>"+mapness.dict.words.button_addroute+"</span>");DOMcache.get("#routeFormHolder #routeSubmit").attr("class","button2 search");DOMcache.get("#routeFormHolder").fadeIn("fast").find("#r_name").focus();DOMcache.get("#routeFormError").html("");if(A.r_connection===0){DOMcache.get("#noConnection").show();DOMcache.get("#r_connection1 input").attr("checked","").parent().hide();DOMcache.get("#r_connection0 input").attr("checked","checked")}else{DOMcache.get("#noConnection").hide();DOMcache.get("#r_connection1 input").parent().show()}if(!mapness.journey.getRoute(-2)){DOMcache.get("#routeForm .connectionHolder").hide();DOMcache.get("#noConnection").hide()}else{DOMcache.get("#routeForm .connectionHolder").show()}DOMcache.get("#r_name").val("");DOMcache.get("#r_description").val("");DOMcache.get("#r_lat").val(A.r_lat);DOMcache.get("#r_lng").val(A.r_lng);mapness.ui.recalculateCoordinates("sex")};mapness.ui.initMaskedInput=function(){jQuery(function(A){DOMcache.get("#j_start").mask("9999-99-99",{placeholder:" "})})};mapness.ui.initValidCoordinates=function(){DOMcache.get("#r_lon_sex_deg").blur(function(){mapness.ui.recalculateCoordinates("dec")});DOMcache.get("#r_lon_sex_min").blur(function(){mapness.ui.recalculateCoordinates("dec")});DOMcache.get("#r_lon_sex_sec").blur(function(){mapness.ui.recalculateCoordinates("dec")});DOMcache.get("#r_lat_sex_deg").blur(function(){mapness.ui.recalculateCoordinates("dec")});DOMcache.get("#r_lat_sex_min").blur(function(){mapness.ui.recalculateCoordinates("dec")});DOMcache.get("#r_lat_sex_sec").blur(function(){mapness.ui.recalculateCoordinates("dec")})};mapness.ui.changeCoordinates=function(A){if(A==="sex"){DOMcache.get("#routeFormCoordDec").hide();DOMcache.get("#routeFormCoordSex").show();DOMcache.get("#r_lng").hide();DOMcache.get("#r_lat").hide();mapness.ui.recalculateCoordinates(A);DOMcache.get(".notationSex").show()}if(A==="dec"){DOMcache.get("#routeFormCoordSex").hide();DOMcache.get("#routeFormCoordDec").show();DOMcache.get(".notationSex").hide();mapness.ui.recalculateCoordinates(A);DOMcache.get("#r_lng").show();DOMcache.get("#r_lat").show()}};mapness.ui.recalculateCoordinates=function(R){if(R==="sex"){var H=DOMcache.get("#r_lng").val();var J=DOMcache.get("#r_lat").val();var G=1;var D=1;if(J<0){G=-1}var I=Math.abs(Math.round(J*1000000));if(H<0){D=-1}var U=Math.abs(Math.round(H*1000000));DOMcache.get("#r_lon_sex_deg").val((Math.floor(U/1000000)*D));DOMcache.get("#r_lon_sex_min").val(Math.floor(((U/1000000)-Math.floor(U/1000000))*60));DOMcache.get("#r_lon_sex_sec").val(Math.round(Math.floor(((((U/1000000)-Math.floor(U/1000000))*60)-Math.floor(((U/1000000)-Math.floor(U/1000000))*60))*100000)*60/100000));DOMcache.get("#r_lat_sex_deg").val((Math.floor(I/1000000)*G));DOMcache.get("#r_lat_sex_min").val(Math.floor(((I/1000000)-Math.floor(I/1000000))*60));DOMcache.get("#r_lat_sex_sec").val(Math.round(Math.floor(((((I/1000000)-Math.floor(I/1000000))*60)-Math.floor(((I/1000000)-Math.floor(I/1000000))*60))*100000)*60/100000))}if(R==="dec"){var E=DOMcache.get("#r_lat_sex_deg").val();var K=DOMcache.get("#r_lat_sex_min").val();var M=DOMcache.get("#r_lat_sex_sec").val();var N=DOMcache.get("#r_lon_sex_deg").val();var P=DOMcache.get("#r_lon_sex_min").val();var A=DOMcache.get("#r_lon_sex_sec").val();var L=1;var S=1;if(E<0){L=-1}var Q=Math.abs(Math.round(E*1000000));DOMcache.get("#r_lat_sex_min").val(Math.abs(Math.round(DOMcache.get("#r_lat_sex_min").val()*1000000)/1000000));var F=Math.abs(Math.round(DOMcache.get("#r_lat_sex_min").val()*1000000));DOMcache.get("#r_lat_sex_sec").val(Math.abs(Math.round(DOMcache.get("#r_lat_sex_sec").val()*1000000)/1000000));var C=Math.abs(Math.round(DOMcache.get("#r_lat_sex_sec").val()*1000000));DOMcache.get("#r_lat").val(Math.round(Q+(F/60)+(C/3600))*L/1000000);if(N<0){S=-1}var O=Math.abs(Math.round(N*1000000));DOMcache.get("#r_lon_sex_min").val(Math.abs(Math.round(DOMcache.get("#r_lon_sex_min").val()*1000000)/1000000));var B=Math.abs(Math.round(DOMcache.get("#r_lon_sex_min").val()*1000000));DOMcache.get("#r_lon_sex_sec").val(Math.abs(Math.round(DOMcache.get("#r_lon_sex_sec").val()*1000000)/1000000));var T=Math.abs(Math.round(DOMcache.get("#r_lon_sex_sec").val()*1000000));if(Q>(90*1000000)){DOMcache.get("#routeFormError").html("Degrees Latitude must be in the range of -90 to 90.").show();DOMcache.get("#r_lat_sex_deg").val("").focus()}else{if(F>=(60*1000000)){DOMcache.get("#routeFormError").html("Minutes Latitude must be in the range of 0 to 59.").show();DOMcache.get("#r_lat_sex_min").val("").focus()}else{if(C>(59.99999999*1000000)){DOMcache.get("#routeFormError").html("Seconds Latitude must be 0 or greater and less than 60.").show();DOMcache.get("#r_lat_sex_sec").val("").focus()}else{if(O>(180*1000000)){DOMcache.get("#routeFormError").html("Degrees Longitude must be in the range of -180 to 180.").show();DOMcache.get("#r_lon_sex_deg").val("").focus()}else{if(B>=(60*1000000)){DOMcache.get("#routeFormError").html("Minutes Longitude must be in the range of 0 to 59.").show();DOMcache.get("#r_lon_sex_min").val("").focus()}else{if(T>(59.99999999*1000000)){DOMcache.get("#routeFormError").html("Seconds Longitude must be 0 or greater and less than 60.").show();DOMcache.get("#r_lon_sex_sec").val("").focus()}else{DOMcache.get("#routeFormError").html("").hide()}}}}}}DOMcache.get("#r_lng").val(Math.round(O+(B/60)+(T/3600))*S/1000000)}};mapness.ui.editRoute=function(A){mapness.uiState.routeValidatorInstance.resetForm();var B=mapness.journey.points;B[A].newRouteFormMode=false;DOMcache.get("#routeForm").show();DOMcache.get("#routeFormHolder").fadeIn("fast").find("#r_name").focus();mapness.journey.currentlyEditedObject.route=B[A];DOMcache.get("#routeFormHolder .form h1").html(mapness.dict.words.edit_route_action);DOMcache.get("#routeFormHolder #routeSubmit").html("<span>"+mapness.dict.words.save+"</span>");DOMcache.get("#routeFormHolder #routeSubmit").attr("class","button2 search editButton");DOMcache.get("#r_name").val(B[A].r_name);DOMcache.get("#r_lng").val(B[A].r_lng);DOMcache.get("#r_lat").val(B[A].r_lat);DOMcache.get("#r_description").val(mapness.util.br2nl(B[A].r_description));DOMcache.get("#r_date").val(B[A].getRDate("date"));DOMcache.get("#r_date_time").val(B[A].getRDate("time"));DOMcache.get("#routeFormError").html("");mapness.ui.recalculateCoordinates("sex");if(A===0){DOMcache.get("#routeForm .connectionHolder").hide()}else{DOMcache.get("#routeForm .connectionHolder").show();mapness.map.connTester(B[A-1],B[A]);if(B[A].r_connection==1){DOMcache.get("#r_connection1 input").attr("checked",true).parent().show()}else{DOMcache.get("#r_connection0 input").attr("checked",true)}}DOMcache.get("#r_transport").selectOptions(B[A].r_transport)};mapness.ui.activateConnection=function(A){if(A){DOMcache.get("#noConnection").hide()}else{DOMcache.get("#noConnection").show()}};mapness.ev.submitRoute=function(){mapness.uiState.routeValidatorInstance=DOMcache.get("#routeForm").validate({rules:{"route[r_lng]":"required","route[r_lat]":"required"},submitHandler:function(){if(mapness.journey.currentlyEditedObject.route===null){mapness.journey.getRoute(-1).setData();mapness.journey.getRoute(-1).sendData()}else{mapness.journey.currentlyEditedObject.route.setData();mapness.journey.currentlyEditedObject.route.sendUpdateData()}}})};if(!mapness){var mapness={}}function Media(B){var A=this;this.parentObj=B;this.m_id="";this.m_type="";this.m_source="";this.m_description="";this.setDataFromXML=function(D){var C=D;A.m_id=C[0].id;A.m_type=C[0].type;A.m_source=C[0].source;A.m_description=C[0].description};this.setData=function(E,D){if(E===undefined){A.m_source=DOMcache.get("#m_source").val().entityify();A.m_type=$("input[name=m_type]:checked").val().entityify()}else{var C=E.split("|");A.m_source=C[0];A.m_id=C[1];A.m_type=D}};this.sendData=function(){var C=new RequestO("post","/xhr/new_media.php",{"media[r_id]":mapness.journey.points[mapness.journey.currentActive].r_id,"media[m_type]":A.m_type,"media[m_source]":A.m_source,"media[m_description]":A.m_description},{loading:function(){mapness.ui.showLoading(DOMcache.get("#mediaFormError"),DOMcache.get("#mediaForm"),1,"center")},complete:function(E){if(jQuery.browser.msie){var D=new ActiveXObject("Microsoft.XMLDOM");D.loadXML(E)}else{D=E}mapness.ui.hideLoading(DOMcache.get("#mediaFormError"));if($("error",D).size()===0){A.m_id=$("insert_id",D).text();DOMcache.get("#mediaFormHolder").fadeOut("fast");mapness.journey.points[mapness.journey.currentActive].appendMedia(A);mapness.ui.showRouteInfo(mapness.journey.currentActive)}else{A.errorHandler(D)}}})};this.sendUpdateData=function(){var C=new RequestO("post","/xhr/edit_media.php",{"media[r_id]":mapness.journey.points[mapness.journey.currentActive].r_id,"media[m_id]":A.m_id,"media[m_description]":A.m_description},{loading:function(){mapness.ui.showLoading(DOMcache.get("#mediaFormError"),DOMcache.get("#mediaForm"),1,"center")},complete:function(E){if(jQuery.browser.msie){var D=new ActiveXObject("Microsoft.XMLDOM");D.loadXML(E)}else{D=E}if($("error",D).size()===0){DOMcache.get("#mediaFormHolder").fadeOut("fast");mapness.ui.showRouteInfo(mapness.journey.currentActive);DOMcache.get("#image_upload_m_description").val("")}else{A.errorHandler(D)}mapness.ui.hideLoading(DOMcache.get("#mediaFormError"))}})};this.deleteMedia=function(){var C=new RequestO("post","/xhr/del_media.php",{r_id:mapness.journey.points[mapness.journey.currentActive].r_id,m_id:A.m_id},{loading:function(){mapness.ui.showLoading(DOMcache.get("#deleteFormError"),DOMcache.get("#deleteForm"),1,"center")},complete:function(E){if(jQuery.browser.msie){var D=new ActiveXObject("Microsoft.XMLDOM");D.loadXML(E)}else{D=E}if($("error",D).size()===0){DOMcache.get("#deleteFormError").html(mapness.dict.words.delete_success);DOMcache.get("#deleteFormHolder").fadeOut("fast");points=mapness.journey.getPoints(mapness.journey.currentActive);points.removeMedia()}else{DOMcache.get("#deleteFormError").html($("error",D).text())}}})};this.errorHandler=function(C){$("error",C).each(function(){var D=$(this).text();DOMcache.get("#mediaFormError").html(D);DOMcache.get("#mediaFormError").show();DOMcache.get("#mediaForm").show()})};this.handleUploadedImage=function(C,G){if(C.split("|").length==1){var D=C.split("|")[0];DOMcache.get("#mediaFormError").html(D);DOMcache.get("#mediaFormError").show();DOMcache.get("#mediaForm").show()}else{A.setData(C,0);A.parentObj.appendMedia(A);if(G!==undefined&&mapness.journey.points[mapness.journey.currentActive]===A.parentObj){var E=mapness.upload.getQueueElementByFileId(G);var F=E.domHtml;A.createThumbnail(F)}else{if(!mapness.upload.initialized){mapness.ui.showRouteInfo(mapness.journey.currentActive);mapness.ui.hideLoading(DOMcache.get("#mediaFormError"));DOMcache.get("#mediaFormHolder").fadeOut("fast")}}}};this.createThumbnail=function(E){for(var D in A.parentObj.medias){if(A===A.parentObj.medias[D]){var C=D}}var F='<div id="img'+A.m_id+'" class="galImage sortable">';F+="<img class='editTools dragImg' src='/images/button_image_move.gif' />";F+="<a rel='lightbox' title='"+addslashes(this.m_description)+"' href='/uimages/"+mapness.journey.au_id+"/"+mapness.journey.j_id+"/"+A.m_source+"'><img alt='' src='/uimages/"+mapness.journey.au_id+"/"+mapness.journey.j_id+"/thumb/"+A.m_source+"'></a>";F+='<img src="/images/button_image_del.gif" class="editTools delImg" onclick="mapness.ui.delMedia('+C+');" style="display: inline;"/>';F+='<img src="/images/button_image_desc.gif" class="editTools editImg" onclick="mapness.ui.editMedia('+C+');" style="display: inline;"/>';if(E===undefined){DOMcache.get("#pointGallery").append(F)}else{E.replaceWith(F)}mapness.ui.initImageBox()};this.checkMediaNumber=function(C){for(var D in C.medias){if(C.medias[D]==this){return D}}}}mapness.ui.showVideo=function(A,B,C){DOMcache.get("#videoBkg").fadeIn("fast");DOMcache.get("#videoHolder").fadeIn("fast");if(A===1){DOMcache.get("#videoHolder #movie").html('<object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/'+B+'&rel=1"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/'+B+'&rel=1" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object>');DOMcache.get("#videoHolder #movieDesc").html(C)}return false};mapness.ui.hideVideo=function(){DOMcache.get("#videoHolder").fadeOut("fast",function(){DOMcache.get("#videoHolder #movie").html("");DOMcache.get("#videoHolder #movieDesc").html("")});DOMcache.get("#videoBkg").fadeOut("fast")};mapness.ui.uploadLoading=function(A){mapness.ui.showLoading(DOMcache.get("#mediaFormError"),DOMcache.get("#mediaForm"),1,"center")};mapness.ui.handleUploadedImage=function(B,A){mapness.ui.showLoading(DOMcache.get("#mediaFormError"),DOMcache.get("#mediaForm"),1,"center")};mapness.ui.showMediaForm=function(D){mapness.ui.cleanUpIframes();DOMcache.get("#mediaFormError").html("").hide();DOMcache.get("#mediaFormSuccess").html("").hide();DOMcache.get("#mediaForm").show();var C=mapness.journey.points;if(mapness.profile.id===0){DOMcache.get("#profileFormHolder").fadeIn("fast").find("#au_name").focus();DOMcache.get("#profileFormError").html(mapness.dict.words.please_register);DOMcache.get("#profileFormError").show()}else{mapness.journey.currentlyEditedObject.route=C[mapness.journey.currentActive];mapness.journey.mediaMode=D;var E=new Media(C[mapness.journey.currentActive]);if(D==="image"){DOMcache.get("#mediaFormHolder h1.formHdr").html(mapness.dict.words.add_pictures);DOMcache.get("#videoSource").hide();DOMcache.get("#imageSource").show();var A=mapness.ui.createIframe("upload_iframe","imageUploader");A.load(function(){mapness.ui.hideLoading(DOMcache.get("#mediaFormError"));var I=new Media(C[mapness.journey.currentActive]);var F=$(this).contents();if(jQuery.browser.msie){var H=A.attr("id");var J=document.getElementById(H);var G={};if(J.contentWindow){G.responseXML=J.contentWindow.document.XMLDocument?J.contentWindow.document.XMLDocument:J.contentWindow.document}else{if(J.contentDocument){G.responseXML=J.contentDocument.document.XMLDocument?J.contentDocument.document.XMLDocument:J.contentDocument.document}}F=$("error",G.responseXML).text()}else{F=$(this).contents().find("error").text()}I.m_description=mapness.util.nl2br(DOMcache.get("#image_upload_m_description").val().entityify());I.handleUploadedImage(F)});DOMcache.get("#image_upload_m_description").val("");DOMcache.get("#mediaFormHolder h1.formHdr").html(mapness.dict.words.add_pictures);DOMcache.get(".videoSource").hide();DOMcache.get(".imageSource").show();DOMcache.get("#mediaFormHolder").fadeIn("fast").find("#imageToUpload").focus()}else{if(D==="video"){DOMcache.get("#mediaVideoBtn").css("background-image","url(/images/"+mapness.dict.lang+"/but_add_b.gif)");DOMcache.get("#m_source").val("");DOMcache.get("#image_upload_m_description").val("");DOMcache.get("#mediaFormHolder h1.formHdr").html(mapness.dict.words.add_video);DOMcache.get(".videoSource").show();DOMcache.get("#imageToUpload").val("");DOMcache.get(".imageSource").hide();DOMcache.get("#mediaFormHolder").fadeIn("fast").find("#m_source").focus()}else{if(D==="umedia"){var B=C[mapness.journey.currentlyEditedObject.route.checkRouteNumber()].medias[mapness.journey.currentlyEditedObject.media];DOMcache.get("#image_upload_m_description").val(mapness.util.br2nl(B.m_description));DOMcache.get("#mediaFormHolder h1.formHdr").html(mapness.dict.words.journey_editMediaDescription);DOMcache.get(".imageSource").hide();DOMcache.get(".videoSource").hide();DOMcache.get("#mediaVideoBtn").css("background-image","url(/images/"+mapness.dict.lang+"/but_save.gif)");DOMcache.get("#mediaVideoBtn").parent().parent().show();DOMcache.get("#mediaFormHolder").fadeIn("fast").find("#image_upload_m_description").focus()}}}}};mapness.ui.delMedia=function(A){mapness.ui.deleteForm("media",A)};mapness.ui.editMedia=function(A){DOMcache.get("#mediaFormBtn").attr("src","/images/"+mapness.dict.lang+"/but_save.gif");var B=mapness.journey.getPoints();var C=B[mapness.journey.currentActive].medias;mapness.journey.currentlyEditedObject.route=mapness.journey.currentActive;mapness.journey.currentlyEditedObject.media=A;mapness.ui.showMediaForm("umedia")};mapness.ev.mediaSubmit=function(){DOMcache.get("#mediaForm").validate({rules:{"media[m_source]":{required:function(){if(mapness.journey.mediaMode==="video"){return true}else{return false}}},fileToUpload:{required:function(){if(mapness.journey.mediaMode==="image"){return true}else{return false}},accept:true}},messages:{fileToUpload:{accept:mapness.dict.words.required_file_extension}},submitHandler:function(){if(mapness.journey.mediaMode==="umedia"){var A=mapness.journey.currentlyEditedObject.route;var B=A.medias[mapness.journey.currentlyEditedObject.media];B.m_description=DOMcache.get("#image_upload_m_description").val().entityify();B.sendUpdateData()}else{if(mapness.journey.mediaMode==="image"){mapness.upload.iframeUpload(document.getElementById("imageToUpload"))}else{var B=new Media;B.setData();B.m_description=mapness.util.nl2br(DOMcache.get("#image_upload_m_description").val().entityify());B.sendData()}}}})};if(!mapness){var mapness={}}mapness.kml=new function Kml(){var that=this;this.kmlResp=null;this.exportIframe=null;this.tempPoints=[];this.kmlNumPoints=null;this.selectedPointsNo=null;this.kmlUpload=function(upload_field){var re_text=/\.kml/i;var filename=upload_field.value;if(filename.search(re_text)==-1){alert("File does not have propper extension");upload_field.form.reset();return false}upload_field.form.submit();mapness.ui.showLoading(DOMcache.get("#KmlFormError"),DOMcache.get("#KmlForm"),1,"center");return true};this.exportKml=function(){if(that.exportIframe===null){that.exportIframe=mapness.ui.createIframe("exportKML","exportKMl")}that.exportIframe[0].src="http://"+window.location.host+"/xhr/exportkml.php?jid="+mapness.journey.j_id;DOMcache.get("#KmlFormError").html("KML export finished.");mapness.ui.hideKmlForm()};this.sendNumPoints=function(){var request=new RequestO("post","/xhr/kml.php",{kmlNumPoints:that.selectedPointsNo},{loading:function(){mapness.ui.showLoading(DOMcache.get("#KmlFormError"),DOMcache.get("#KmlForm"),1,"center")},complete:function(response){that.tempPoints=[];mapness.kml.kmlResp=eval("("+response+")");$(mapness.kml.kmlResp.route_point).each(function(){var point=new Route(that);point.r_lng=this.r_lon;point.r_lat=this.r_lat;that.tempPoints.push(point)});mapness.map.clearMap();mapness.map.renderJourney(mapness.journey.points.concat(mapness.kml.tempPoints),0,true,true);that.startKmlUndo();mapness.ui.hideLoading(DOMcache.get("#KmlFormError"));DOMcache.get("#KmlFormHolder").fadeOut("slow",function(){mapness.map.jmap.setZoom(mapness.map.jmap.getBoundsZoomLevel(mapness.map.bounds));mapness.map.jmap.panTo(mapness.map.bounds.getCenter())})}})};this.importKml=function(){DOMcache.get("#KmlPointsNumber").html(that.kmlNumPoints);DOMcache.get("#KmlForm").hide();DOMcache.get("#KmlPoints").show();if(that.selectedPointsNo===null){var startVal=Math.ceil(that.kmlNumPoints/2)}else{var startVal=that.selectedPointsNo}DOMcache.get("#KmlPointsSliderCurrent").html(startVal);DOMcache.get("#KmlPointsSlider").find("div.ui-slider").slider({min:1,max:that.kmlNumPoints,startValue:startVal,slide:function(e,ui){DOMcache.get("#KmlPointsSliderCurrent").html(ui.value);that.selectedPointsNo=ui.value}})};this.startKmlUndo=function(){DOMcache.get("#undoStrip").show();var undoTxt=that.selectedPointsNo+" points added to your route. Please check if everything is ok and click <a href='javascript:;' onclick='mapness.kml.saveKmlRoute();'><strong>Save</strong></a> or click <a href='javascript:;' onclick='mapness.kml.undoKml()';><strong>Undo</strong></a> to go back and refine the number of points.";DOMcache.get("#undoMsg").html(undoTxt)};this.saveKmlRoute=function(){var request=new RequestO("post","/xhr/kml.php",{acceptKml:true,j_id:mapness.journey.j_id},{loading:function(){},complete:function(response){DOMcache.get("#undoStrip").hide();mapness.kml.kmlResp=eval("("+response+")");for(var i=0;i<mapness.kml.kmlResp.length;i++){mapness.kml.tempPoints[i].r_id=mapness.kml.kmlResp[i]}mapness.journey.points=mapness.journey.points.concat(mapness.kml.tempPoints);mapness.journey.drawJourney();mapness.ui.initialiseScrollPane()}})};this.undoKml=function(){DOMcache.get("#KmlFormHolder").show();DOMcache.get("#undoStrip").hide();that.importKml()}};mapness.ui.showKmlForm=function(){var listen=false;DOMcache.get("#KmlFormHolder").fadeIn("fast");mapness.ui.cleanUpIframes();DOMcache.get("#KmlImportFile").val("");var iFrame=mapness.ui.createIframe("kmlIframe","kmlIframe");iFrame.load(function(){if(jQuery.browser.msie){var iFrameId=iFrame.attr("id");var io=document.getElementById(iFrameId);mapness.kml.kmlResp=eval("("+$("body",$(io).contents()).text()+")");mapness.kml.kmlNumPoints=mapness.kml.kmlResp.kmlNumPoints;mapness.kml.importKml();mapness.ui.hideLoading(DOMcache.get("#KmlFormError"))}else{if(listen){var response=$(this).contents();mapness.kml.kmlResp=eval("("+$("body",$(this).contents()).text()+")");mapness.kml.kmlNumPoints=mapness.kml.kmlResp.kmlNumPoints;mapness.kml.importKml();mapness.ui.hideLoading(DOMcache.get("#KmlFormError"))}else{listen=true}}})};mapness.ui.kmlEvents=function(){DOMcache.get("#KmlFormHolder").delegate("click",{"#exportKml":function(){mapness.kml.exportKml()},".exportKml":function(){mapness.kml.exportKml()},"#importKml":function(){mapness.kml.importKml()},".importKml":function(){mapness.kml.importKml()}})};mapness.ui.hideKmlForm=function(){DOMcache.get("#KmlFormHolder").fadeOut("fast");mapness.journey.drawJourney();DOMcache.get("#KmlPoints").hide()};if(!mapness){var mapness={}}mapness.upload=new function(){var A=this;this.queue=[];this.filetypes={jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",png:"image/png"};this.initialized=false;this.createFlashUploader=function(){var B={file_post_name:"fileToUpload",flash_url:"/libraries/swfupload.swf",upload_url:"/xhr/mupload.php",post_params:{PHPSESSID:mapness.data.session_id,j_id:mapness.journey.j_id},file_size_limit:"1000000000",file_types:"*.jpg;*.jpeg;*.gif;*.png;",file_types_description:mapness.dict.words.images,file_upload_limit:100,file_queue_limit:0,prevent_swf_caching:true,assume_success_timeout:8,custom_settings:{progressTarget:"pointGallery",cancelButtonId:"btnCancel"},button_window_mode:SWFUpload.WINDOW_MODE.TRANSPARENT,button_cursor:SWFUpload.CURSOR.HAND,button_placeholder_id:"uploadBtnHolder",button_width:36,button_height:36,debug:false,swfupload_loaded_handler:A.flashLoaded,file_dialog_start_handler:A.fileDialogStart,file_queued_handler:A.fileQueued,file_queue_error_handler:A.fileQueueError,file_dialog_complete_handler:A.fileDialogComplete,upload_start_handler:A.uploadStart,upload_progress_handler:A.uploadProgress,upload_error_handler:A.uploadError,upload_success_handler:A.uploadSuccess,upload_complete_handler:A.uploadComplete};if(!mapness.journey.swfUpload){mapness.journey.swfUpload=new SWFUpload(B)}};this.flashLoaded=function(){DOMcache.get("#flashUploadTempHolder").css("top",-100).css("left",-100);$("#images div.addMedia").mouseover(function(B){DOMcache.get("#flashUploadTempHolder").css("top",B.clientY-(DOMcache.get("#flashUploadTempHolder").height()/2)).css("left",B.clientX-DOMcache.get("#flashUploadTempHolder").width()/2)});DOMcache.get("#flashUploadTempHolder").mouseout(function(){$(this).css("top",-100).css("left",-100)});A.initialized=true};this.fileDialogStart=function(){};this.fileQueued=function(B){var C=new queueElement();C.file=B;C.r_id=mapness.journey.points[mapness.journey.currentActive].r_id;if(!A.queue["q_"+mapness.journey.points[mapness.journey.currentActive].r_id]){A.queue["q_"+mapness.journey.points[mapness.journey.currentActive].r_id]=[]}C.buildLoaderHtml(DOMcache.get("#pointGallery"));C.changeStatus(mapness.dict.words.uploader_queued);A.queue["q_"+mapness.journey.points[mapness.journey.currentActive].r_id].push(C)};this.fileQueueError=function(){};this.fileDialogComplete=function(B,C,D){DOMcache.get("#flashUploadTempHolder").css("top",-100).css("left",-100);if(C>0){mapness.journey.swfUpload.startUpload()}};this.uploadStart=function(C){var D=A.getQueueElementByFileId(C.id);mapness.journey.swfUpload.setPostParams({r_id:D.r_id,PHPSESSID:mapness.data.session_id,j_id:mapness.journey.j_id});if(C.type===""){mapness.journey.swfUpload.addPostParam("file_type",mapness.upload.filetypes[C.name.split(".")[1].toLowerCase()])}else{var B=C.type.split(".");if(B.length===1){B=B[0].toLowerCase()}else{B=B[1].toLowerCase()}mapness.journey.swfUpload.addPostParam("file_type",mapness.upload.filetypes[B])}D.changeStatus(mapness.dict.words.uploader_uploading,0)};this.uploadProgress=function(B,E,D){var C=Math.ceil((E/D)*100);var F=A.getQueueElementByFileId(B.id);F.changeStatus(mapness.dict.words.uploader_uploading,C)};this.uploadError=function(B,E,C){var D=A.getQueueElementByFileId(B.id);D.setError();switch(E){case SWFUpload.UPLOAD_ERROR.HTTP_ERROR:D.changeStatus(mapness.dict.words.upload_error+" "+C,0);break;case SWFUpload.UPLOAD_ERROR.UPLOAD_FAILED:D.changeStatus(mapness.dict.words.upload_failed+" "+C,0);break;case SWFUpload.UPLOAD_ERROR.IO_ERROR:D.changeStatus(mapness.dict.words.upload_io_error+" "+C,0);break;case SWFUpload.UPLOAD_ERROR.SECURITY_ERROR:D.changeStatus(mapness.dict.words.upload_unknown_error+" "+C+" "+E,0);break;case SWFUpload.UPLOAD_ERROR.UPLOAD_LIMIT_EXCEEDED:D.changeStatus(mapness.dict.words.upload_unknown_error+" "+C+" "+E,0);break;case SWFUpload.UPLOAD_ERROR.FILE_VALIDATION_FAILED:D.changeStatus(mapness.dict.words.upload_unknown_error+" "+C+" "+E,0);break;case SWFUpload.UPLOAD_ERROR.FILE_CANCELLED:D.changeStatus(mapness.dict.words.upload_unknown_error+" "+C+" "+E,0);break;case SWFUpload.UPLOAD_ERROR.UPLOAD_STOPPED:D.changeStatus(mapness.dict.words.upload_unknown_error+" "+C+" "+E,0);break;default:D.changeStatus(mapness.dict.words.upload_unknown_error+" "+C+" "+E,0);break}};this.uploadSuccess=function(D,F,G){var H=A.getQueueElementByFileId(D.id);var C=mapness.journey.getPointById(H.r_id);var I=new Media(C);var E;if(jQuery.browser.msie){var B=new ActiveXObject("Microsoft.XMLDOM");B.loadXML(F)}else{B=F}E=$("error",B).text();I.handleUploadedImage(E,D.id)};this.uploadComplete=function(){mapness.journey.swfUpload.startUpload()};this.iframeUpload=function(C){if($("#image_upload_j_id").val()==""){$("#image_upload_j_id").val(mapness.journey.j_id)}$("#media_upload_r_id").val(mapness.journey.currentlyEditedObject.route.r_id);var D=/\.jpg|\.jpeg|\.gif|\.png/i;var B=C.value;if(B.search(D)==-1){alert("File does not have propper extension");C.form.reset();return false}C.form.submit();mapness.ui.showLoading(DOMcache.get("#mediaFormError"),DOMcache.get("#mediaForm"),1,"center");return true};this.getQueueElementByFileId=function(D){for(var C in A.queue){for(var B in A.queue[C]){if(A.queue[C][B].file.id==D){return A.queue[C][B]}}}}};function queueElement(){var A=this;this.file;this.domHtml=false;this.r_id;this.buildLoaderHtml=function(B){if(!A.domHtml){A.domHtml='<div class="progressContainer galImage" id="'+A.file.id+'"> 						<a class="progressCancel" href="javascript:;" style="visibility: visible;"> </a> 						<div class="progressName">'+this.file.name+'</div>						<div class="progressBarStatus">'+this.file.status+'</div>						<div class="progressBarInProgress"></div>					</div>';A.domHtml=$(A.domHtml)}B.find(".clearer").before(A.domHtml)};this.changeStatus=function(B,C){if(C==null){C=0}A.domHtml.find(".progressBarStatus").html(B);A.domHtml.find(".progressBarInProgress").width(C+"%")};this.bindEvents=function(){A.domHtml.find(".progressCancel").click(function(){})};this.setError=function(){A.domHtml.find(".progressContainer").addClass("error")}}mapness.ui.createIframe=function(A,E){var D=new Date();var C=D.getTime();if(jQuery.browser.msie){var B=document.createElement('<iframe name="'+A+'" id="'+E+"-"+C+'" style="display:none;"/>');document.body.appendChild(B)}else{var B=document.createElement("iframe");$(B).attr("id",E+"-"+C);$(B).attr("style","display:none");$(B).attr("name",A);document.body.appendChild(B)}mapness.journey.activeIframes.push($("#"+E+"-"+C));return $("#"+E+"-"+C)};var h=0;mapness.create_date_from_XML=function(C){if(C===""||C===undefined){C="0000-00-00 00:00"}var F=C;var B=parseInt(F.substr(8,2),10);var E=parseInt(F.substr(5,2),10)-1;var A=parseInt(F.substr(0,4),10);var D=parseInt(F.substr(11,2),10);var G=parseInt(F.substr(14,2),10);F=new Date(A,E,B,D,G);return F};mapness.getTransportationNames=function(){var A=[mapness.dict.words.by_foot,mapness.dict.words.by_bike,mapness.dict.words.by_motorcycle,mapness.dict.words.by_car,mapness.dict.words.by_train,mapness.dict.words.by_plane,mapness.dict.words.by_boat,mapness.dict.words.hitch_hiking,mapness.dict.words.by_bus,mapness.dict.words.by_subway,mapness.dict.words.by_ferry];return A};mapness.ui.mapLayout=function(){var B=DOMcache.get("body").outerHeight();var A=$("#titleSummary").outerHeight();var E=DOMcache.get("#top").outerHeight();var F=DOMcache.get("#bottom").outerHeight();var D=DOMcache.get("#mediaMenu").outerHeight()+10;if(!mapness.customSettings.layout||!mapness.customSettings.layout.scrollOffset){var C=162}else{var C=mapness.customSettings.layout.scrollOffset}DOMcache.get("#jmap").height(B-E-F);DOMcache.get("#right").height(B-E-F);DOMcache.get("#mapWrapper").height(B-E-F);DOMcache.get("#mediaContainer").height(B-E-D-A-F);DOMcache.get("#left_content").height(B-C);$(".jScrollPaneContainer").height(B-C);mapness.ui.initialiseScrollPane()};mapness.ui.monitorDimensions=function(){var A=null;$(window).resize(function(){if(A){clearTimeout(A)}A=setTimeout(function(){mapness.ui.mapLayout()},100)})};mapness.ui.startEditing=function(){mapness.journey.setEditMode(1);mapness.ui.populateJMenu(mapness.journey.points);DOMcache.get("#kmlButton").show();mapness.ui.makeSortablePointList();$("#left_points").addClass("moveEdit");DOMcache.get("#left_points").css("cursor","move").find("span").css("cursor","move").find("a").css("cursor","move");$(".editTools").show();$("#right .addMedia").css("display","inline");DOMcache.get("#saveJourney").show();DOMcache.get("body").addClass("journeyEditMode");DOMcache.get("#jmap").find("img[width='34px']").css("cursor","move");DOMcache.get("#jmap").find("img[width='29px']").css("cursor","move");if(mapness.journey.j_status==1){DOMcache.get("#publishJourney").hide()}if(mapness.profile.id!==0&&mapness.journey.j_id!==null){mapness.upload.createFlashUploader()}mapness.ui.mapLayout()};mapness.ui.finishEditing=function(){if(mapness.profile.id==0){DOMcache.get("#profileFormHolder").fadeIn("fast").find("#au_name").focus();DOMcache.get("#profileFormError").html(mapness.dict.words.please_register)}else{if(mapness.journey.j_status==0){mapness.ui.showPublishForm()}else{document.location="/journey/"+mapness.journey.j_id}}};mapness.ui.makeSortablePointList=function(){DOMcache.get("#left_points").sortable({accept:"sortable",activeclass:"sortableactive",hoverclass:"sortablehover",helperclass:"sorthelper",axis:"verticaly",opacity:0.5,fit:false,update:function(D,E){var F=E.item.attr("rel");mapness.map.clearMap();var C=DOMcache.get("#left_points").sortable("toArray");var B=new Array();for(i=0;i<C.length;i++){var A=C[i].split("pointNo")[1];B.push(A)}mapness.journey.recreatePointList(B,F)}})};mapness.ui.highlight=function(A){DOMcache.get("#mediaContainer").scrollTo(A,200);A.animate({backgroundColor:"#fffd7e"},500).animate({backgroundColor:"transparent",borderColor:"transparent"},2000)};mapness.ui.showEdit=function(){DOMcache.get("#editJourney").show()};mapness.ui.showLoading=function(C,A,B,D){if(A!=0){A.hide()}C.html('<div id="loader" style="text-align:'+D+'"><img src="/images/ajax-loader'+B+'.gif" alt=""></div>');C.show()};mapness.ui.hideLoading=function(A){A.html("")};mapness.ui.deleteForm=function(B,A){DOMcache.get("#deleteFormError").html("");DOMcache.get("#deleteForm").show();DOMcache.get("#deleteFormHolder").fadeIn("fast");if(B==="route"){DOMcache.get("#deleteFormError").html(mapness.dict.words.tip_deleteroute);DOMcache.get("#deleteFormError").show()}if(B==="journey"){DOMcache.get("#deleteFormError").html(mapness.dict.words.tip_deletejourney);DOMcache.get("#deleteFormError").show()}mapness.journey.currentlyEdited=B;if(B==="media"){mapness.journey.currentlyEditedObject.route=mapness.journey.currentActive;mapness.journey.currentlyEditedObject.media=A}};mapness.ui.listAddresses=function(A){DOMcache.get("#addressList").html("").attr("title","findAddress");DOMcache.get("#ShowOnTheMapHolder").css("background-color","#fff");for(var B=0;B<A.Placemark.length;B++){var C=A.Placemark[B].Point.coordinates;DOMcache.get("#addressList").append('<li title="findAddress"><a href="javascript:;" title="findAddress"  class="addressItem" onclick="mapness.map.panTo('+C[1]+","+C[0]+');">'+A.Placemark[B].address+"</a></li>")}mapness.ui.closeOnClickOutside("findAddress",DOMcache.get("#addressList"))};mapness.ev.showOnTheMapSubmit=function(){$("#ShowOnTheMap").submit(function(){mapness.map.showAddress();return false})};mapness.ui.closeOnClickOutside=function(B,A){$(document).one("click",function(C){if($(C.target).attr("title")!=B||$(C.target).attr("title")===undefined){A.html("")}else{mapness.ui.closeOnClickOutside(B,A)}})};mapness.ev.submitDelete=function(){DOMcache.get("#deleteForm").submit(function(){if(mapness.journey.currentlyEdited==="journey"){mapness.journey.deleteJourney()}else{if(mapness.journey.currentlyEdited==="route"){mapness.journey.points[mapness.journey.currentActive].deleteRoute()}else{if(mapness.journey.currentlyEdited==="media"){var A=mapness.journey.points[mapness.journey.currentActive];var B=A.medias[mapness.journey.currentlyEditedObject.media];B.deleteMedia()}}}return false})};mapness.ui.cleanUpIframes=function(){if(mapness.journey.activeIframes.length>0){mapness.journey.activeIframes[0].remove();mapness.journey.activeIframes.splice(0,1)}};mapness.ev.sendRating=function(E,C,D){var B="";var A="";switch(E){case"journey":B=mapness.journey.j_id;A="null";break;case"user":break;case"point":break;default:}var F=new RequestO("post",D,{j_id:B,r_id:A,rating:C,rAffects:E},{complete:function(H){if(jQuery.browser.msie){var G=new ActiveXObject("Microsoft.XMLDOM");G.loadXML(H)}else{G=H}if($("error",G).size()===0){DOMcache.get("#rateJourney").html(mapness.dict.words.journey_rate)}}});return false};mapness.ui.initialiseScrollPane=function(){if(mapness.journey.j_id!=null){DOMcache.get("#left_points").jScrollPane({showArrows:true,maintainPosition:true,wheelSpeed:40})}if($(".jScrollPaneTrack").html()==null){DOMcache.get("#moveUp").hide();DOMcache.get("#moveDown").hide()}else{DOMcache.get("#moveUp").show();DOMcache.get("#moveDown").show()}};mapness.ui.ArrowScrollClick=function(A){var B=A*(parseInt(DOMcache.get("#left_content").height(),10)/2);DOMcache.get("#left_points")[0].scrollBy(B);return false};mapness.ui.clearInput=function(){if(DOMcache.get("#ShowOnTheMapAddress").attr("class")=="virgin"){DOMcache.get("#ShowOnTheMapAddress").val("");DOMcache.get("#ShowOnTheMapAddress").removeClass("virgin")}};mapness.ui.toggleComments=function(){if(mapness.profile.id===0){DOMcache.get(".anonymous").show();DOMcache.get(".love").hide();DOMcache.get(".hate").hide()}};mapness.ui.showPublishForm=function(){var A=0;for(var B in mapness.journey.points){A+=mapness.journey.points[B].medias.length}if(A>10){DOMcache.get("input[value=public]").attr("checked",true)}else{DOMcache.get("input[value=private]").attr("checked",true)}DOMcache.get("#finishEditingFormHolder").show()};if(!mapness){var mapness={}}mapness.share=new function Share(){var that=this;this.emailCounter=0;this.emailMax=50;this.url=window.location.href;this.buildUrl=function(){if(!mapness.journey||!mapness.journey.j_id||mapness.journey.j_id==null){that.url="http://"+window.location}else{that.url="http://"+window.location.hostname+"/journey/"+mapness.journey.j_id}};this.addNewTargetInput=function(email){if(this.emailCounter<=this.emailMax){var moreBoxHeight=$(".share-emailMoreBox").height();if(moreBoxHeight<150){$(".share-emailMoreBox").height(moreBoxHeight+25)}$(".shareTarget:last").parent().after('<div class="share-emailInput"><label>'+mapness.dict.words.global_shareByEmailAlsoSend+'</label><input type="text" class="text shareTarget"></div>');$(".shareTarget:last").val(email);$(".shareTarget:last").focus();this.emailCounter++;if(this.emailCounter==this.emailMax){$("#share-emailMore").hide()}}};this.authMail=function(mail){var link=$.ajax({url:"/xhr/authMail.php",async:false,data:{link:mail}}).responseText;window.open(link,"Authorization","width=800,height=600,toolbar=false,locationbar=false,directories=false,status=false,menubar=false,scrollbars=true,resizable=false,copyhistory=false")};$.fn.addEmail=function(){var email=$(this).children(".share-emailAddress").text();$(this).children(".share-actionEmail").text("Remove");$(this).addClass("selected");$(this).click(function(){$(this).removeEmail()});mapness.share.addNewTargetInput(email)};$.fn.removeEmail=function(){var email=$(this).children(".share-emailAddress").text();$(this).children(".share-actionEmail").text("Add");$(this).removeClass("selected");$(this).click(function(){$(this).addEmail()});$(".shareTarget").each(function(){if($(this).val()==email&&$(this).val()!=""){$(this).parent().remove()}});var moreBoxHeight=$(".share-emailMoreBox").height();if(moreBoxHeight>150){$(".share-emailMoreBox").height(moreBoxHeight-50)}mapness.share.emailCounter=-2};this.emailFilter=function(){$("#share-emailList li").each(function(){var t=$(this).text().toLowerCase();$("<span class='share-index'></span>").hide().text(t).appendTo(this)});$("#share-emailFilter").keyup(function(){var s=$(this).val().toLowerCase().split(" ");$("#share-emailList li:hidden").show();$.each(s,function(){$("#share-emailList li:visible .share-index:not(:contains('"+this+"'))").parent().hide()})})};this.importContacts=function(contacts){var list=eval(contacts);$.each(list,function(){$("#share-emailList").append("<li>"+this.name+"<br/> "+this.email+' <span class="share-emailAddress">'+this.email+'</span> <a class="share-actionEmail" href="javascript:;">Add</a></li>')});$("#share-Services").hide();$("#share-List").show();$("#share-emailList li").click(function(){$(this).addEmail()});mapness.share.emailFilter()};this.shareByEmail=function(){that.buildUrl();var targets=[];$(".share-box").parent().find(".error").remove();$(".shareTarget").each(function(){targets.push($(this).val())});var message=$(".global_shareByEmailMessageLabel textarea").val();var shareTempContent=$(".share-box").html();var request=new RequestO("post","/xhr/share.php",{method:"email",email:targets,message:message,url:that.url},{loading:function(){$(".share-box").html('<div class="share-sending"><img src="/images/ajax-loader2.gif"><span class="note">'+mapness.dict.words.global_sending+"</span></div>")},complete:function(response){var response=json_parse(response);if(response.isSuccess){$(".share-box").html('<div class="success">'+mapness.dict.words.global_shareByEmailSuccess+"</div>");pageTracker._trackPageview("/sharing/email-share");setTimeout(function(){mapness.ui.modal.destroy()},3000)}else{$(".share-box").html(shareTempContent);$(".global_shareByEmailMessageLabel textarea").val(message);var i=0;$(".shareTarget").each(function(){$(this).val(targets[i]);i++});$(".share-box").prepend('<div class="error">'+response.callback.error+"</div>")}}})};this.shareByTwitter=function(){that.buildUrl();var targets=[];$(".share-box").parent().find(".error").remove();var message=$(".share-shareMessage textarea").val();var login=$("#twitterLogin").val();var password=$("#twitterPassword").val();var shareTempContent=$(".share-box").html();var request=new RequestO("post","/xhr/share.php",{method:"twitter",login:login,password:password,message:message,url:that.url},{loading:function(){$(".share-box").html('<div class="share-sending"><img src="/images/ajax-loader2.gif"><span class="note">'+mapness.dict.words.global_sending+"</span></div>")},complete:function(response){var response=json_parse(response);if(response.isSuccess){$(".share-box").html('<div class="success">'+mapness.dict.words.global_shareByTwitterSuccess+"</div><p>"+message+"</p>");pageTracker._trackPageview("/sharing/twitter-share");setTimeout(function(){mapness.ui.modal.destroy()},3000)}else{$(".share-box").html(shareTempContent);$("#twitterLogin").val(login);$(".share-shareMessage textarea").val(message);$(".share-box").prepend('<div class="error">'+response.callback.error+"</div>")}}})};this.byFacebook=function(){that.buildUrl();var facebookWindow=window.open("http://www.facebook.com/sharer.php?u="+encodeURIComponent(that.url)+"&t="+encodeURIComponent(document.title),"MapnessShare","toolbar=0,status=0,width=706,height=436,resizable=1")};this.byTwitter=function(mode,draggable){that.buildUrl();if(!mode){var draggable=true;var defaultMsg=mapness.dict.words.global_shareByTwitterMessage}else{var draggable=false;var defaultMsg=mapness.dict.words.journey_shareByTwitterMessage}var formHtml='<div class="share-twitterIconBig"></div><h2 class="share">'+mapness.dict.words.global_shareByTwitterHeader+'</h2><p class="minor">'+mapness.dict.words.global_shareByTwitterNotice+'</p><div class="share-twitterBox share-box"><div class="share-login"><label>'+mapness.dict.words.global_shareByTwitterLogin+'</label><input type="text" class="text" id="twitterLogin"></div><div class="share-pass"><label>'+mapness.dict.words.global_shareByTwitterPassword+'</label><input type="password" class="text" id="twitterPassword"></div><div class="share-shareMessage"><label>'+mapness.dict.words.global_shareByTwitterMessageLabel+'</label><textarea onKeyUp="mapness.util.limitText(this, 120);" onKeyDown="mapness.util.limitText(this, 120)">'+defaultMsg+'</textarea><div class="clearer"></div></div><div class="share-bodyNote"><p class="minor">'+mapness.dict.words.global_shareByTwitterMessageNote+'</p></div><div class="share-submit"><a class="button2 send" onclick="mapness.share.shareByTwitter();" href="javascript:;"><span>'+mapness.dict.words.global_shareByTwitterSend+"</span></a></div></div>";mapness.ui.modal.init(formHtml,{width:440,height:330,addOverlay:false,draggable:draggable})};this.byEmail=function(mode){that.buildUrl();this.emailCounter=0;if(!mode){var draggable=true;var defaultMsg=mapness.dict.words.global_shareByEmailMessage}else{var draggable=false;var defaultMsg=mapness.dict.words.journey_shareByEmailMessage}var formHtml='<div class="share-emailIconBig"></div> 						<h2 class="share">'+mapness.dict.words.global_shareByEmailHeader+'</h2> 						<div class="share-emailBox share-box"> 							<div class="global_shareByEmailMessageLabel"> 								<label>'+mapness.dict.words.global_shareByEmailMessageLabel+"</label> 								<textarea>"+defaultMsg+'</textarea> 								<div class="clearer"></div> 							</div> 							<div class="share-emailMoreBox"> 								<div class="share-emailInput"> 									<label>'+mapness.dict.words.global_shareByEmailSendToLabel+'</label> 									<input type="text" class="text shareTarget"> 								</div>								<a id="share-emailMore" class="button2 add" href="javascript:;" onclick="mapness.share.addNewTargetInput();"><span>'+mapness.dict.words.global_shareByEmailAddMore+'</span></a>								<div class="clearer"></div>							</div>							<div class="share-submit">								<a class="button2 send" onclick="mapness.share.shareByEmail();" href="javascript:;"><span>'+mapness.dict.words.global_shareByEmailSend+'</span></a>							</div>						</div>						<div class="share-emailImport">							<div id="share-Services">								<h3 class="note2">Add recipients from your email address book:</h3>								<ul class="note2 minor">									<li><a href="javascript:;" onclick="mapness.share.authMail(\'gmail\');">Gmail</a></li>									<li><a href="javascript:;" onclick="mapness.share.authMail(\'hotmail\');">Hotmail</a></li>									<li><a href="javascript:;" onclick="mapness.share.authMail(\'yahoo\');">Yahoo mail</a></li>								</ul>							</div>							<div id="share-List">								<h3 class="note2">Add recipients from address book:</h3>								<input type="text" class="text" id="share-emailFilter" name="share-emailFilter" />								<div class="share-emailImportContacts minor">									<ul id="share-emailList"></ul>								</div>							</div>						</div>';mapness.ui.modal.init(formHtml,{width:740,height:435,addOverlay:false,draggable:draggable})}};if(!mapness){var mapness={}}if(!mapness.ui){mapness.ui={}}mapness.ui.modal={content:"",modal:null,settings:{height:300,width:300,addOverlay:true,draggable:false},addOverlay:function(){$("body").append($([this.modalOverlay=$('<div id="modalBackgroundOverlayMV" />')[0]]))},addContainer:function(){var A=this.settings.height;var B=this.settings.width;$("body").append($([this.modal=$('<div id="colorboxMV" />')[0]]));$(this.modal).css({display:"block",paddingBottom:"42px",paddingRight:"42px",height:A+"px",width:B+"px"});$(this.modal).append($([this.modalWrap=$('<div id="modalWrapMV" />')[0]]));$(this.modalWrap).append($([$('<div><div id="borderTopLeftMV"></div><div id="borderTopCenterMV"></div><div id="borderTopRightMV"></div></div>')[0],this.bml=$('<div id="borderMiddleLeftMV" />')[0],this.modalContent=$('<div id="modalContentMV" />')[0],this.bmr=$('<div id="borderMiddleRightMV" />')[0],$('<div><div id="borderBottomLeftMV"></div><div id="borderBottomCenterMV"></div><div id="borderBottomRightMV"></div></div>')[0]]));this.btc=$("#borderTopCenterMV")[0];$(this.btc).css({width:B+"px"});$(this.bml).css({height:A+"px"});$(this.modalContent).css({height:A+"px",width:B+"px"});$(this.bmr).css({height:A+"px"});this.bbc=$("#borderBottomCenterMV")[0];$(this.bbc).css({width:B+"px"});$(this.modalContent).append($([this.modalClose=$('<a id="modalCloseMV" href="javascript:;"></a>')[0]]))},addContent:function(){$(this.modalContent).append(this.content)},center:function(){var C=this.settings.height;var E=this.settings.width;var B=document.documentElement.clientHeight;var D=B/2-C/2+$(window).scrollTop();var A=document.documentElement.clientWidth/2-E/2+$(window).scrollLeft();if(C>B){D-=(C-B)}if(D<0){D=0}if(A<0){A=0}$(this.modal).css({top:D,left:A})},addListeners:function(){var A=this;$(this.modalClose).click(mapness.ui.modal.destroy);if(this.settings.draggable){$(this.modal).draggable({handle:"#borderTopCenterMV"})}},destroy:function(A){if(!A){$(mapness.ui.modal.modal).remove();$(mapness.ui.modal.modalOverlay).remove()}else{$(mapness.ui.modal.modal).fadeOut(500,function(){$(this).remove()});if(mapness.ui.modal.settings.addOverlay){$(mapness.ui.modal.modalOverlay).fadeOut(700,function(){$(this).remove()})}}mapness.ui.modal.modal=null;mapness.ui.modal.content=""},init:function(B,A){if(mapness.ui.modal.modal!==null){this.destroy()}this.content=B;this.settings=$(this.settings).extend({},this.settings,A);if(this.settings.addOverlay){this.addOverlay()}this.addContainer();this.addContent();this.center();this.addListeners()},displayImage:function(B,A){mapness.ui.modal.init('<div class="image-loading"><img src="/images/ajax-loader2.gif"></div>',{width:300,height:300,addOverlay:false,draggable:true});var C=document.createElement("img");C.src=B;C.onload=function(){mapness.ui.modal.init('<div class="modal-lightbox"><div class="modal-image"><img src="'+B+'"></div><div class="modal-caption">'+A+"</div></div>",{width:C.width,height:(C.height+40),addOverlay:true,draggable:true})}}};if(!mapness){var mapness={}}function initObjects(){mapness.profile.initialize(mapness.data.profile);initJmap();if(typeof (mapness.data.journey)!="undefined"&&mapness.data.journey.id!==null){mapness.initJourney();mapness.journey.singleJourney(mapness.data.journey)}initDisplay();mapness.ui.startEditing()}function initJmap(){var E=$("body").outerHeight();$("#mapWrapper").height(E);mapness.map=new Jmap();mapness.map.jmap=new GMap2(document.getElementById("jmap"));var B=new GMapTypeControl();if(!mapness.customSettings||!mapness.customSettings.map||!mapness.customSettings.map.controls){var H=new GControlPosition(G_ANCHOR_TOP_RIGHT,new GSize(43,5))}else{var H=new GControlPosition(G_ANCHOR_TOP_RIGHT,new GSize(mapness.customSettings.map.controls.x,mapness.customSettings.map.controls.y))}var F=new GMapUIOptions();if(!mapness.customSettings||!mapness.customSettings.map||!mapness.customSettings.map.controls){F.zoom={doubleclick:true,scrollwheel:true};F.maptypes={normal:true,satellite:true,hybrid:true,physical:true};F.controls={largemapcontrol3d:false};var A=new GLargeMapControl3D();var D=new GControlPosition(G_ANCHOR_TOP_LEFT,new GSize(4,32));mapness.map.jmap.addControl(A,D)}else{F.maptypes={satellite:false};F.zoom={doubleclick:true,scrollwheel:true};F.controls={};F.controls[mapness.customSettings.map.controls.navtype]=true;mapness.map.jmap.setMapType(mapness.customSettings.map.defaultType);if(mapness.customSettings.map.controls.maptype.length>1){for(var C in mapness.customSettings.map.controls.maptype){F.maptypes[mapness.customSettings.map.controls.maptype[C]]=true}}}mapness.map.jmap.setUI(F);mapness.map.jmap.addControl(B,H);if((!mapness.map.jmap.isLoaded()&&mapness.data.journey.id==null)||mapness.data.journey.route.length==0){var G=new GClientGeocoder();G.getLatLng(mapness.data.fromCountry,function(I){if(!I){mapness.map.jmap.setCenter(new GLatLng(27,0),2)}else{mapness.map.jmap.setCenter(I,6)}})}$("#rateJourney").css("display","none");$("#journey_j_id").val("");$("#j_name").val("");$("#j_description").val("");$("#j_start").val("");$("#j_start_time").val("9:00");mapness.map.addListeners();mapness.ui.mapLayout()}mapness.initJourney=function(){mapness.ui.initJTooltip();DOMcache.get("#shareJourney").show()};function initDisplay(){mapness.ev.submitRoute();mapness.util.submitEnterIE();mapness.ui.mapLayout();mapness.ui.monitorDimensions();mapness.ev.mediaSubmit();mapness.ev.submitJourney();mapness.ev.submitDelete();mapness.profile.ev.submitProfile();mapness.profile.ev.submitLogin();mapness.ui.initTooltips();mapness.ui.initMaskedInput();mapness.ui.kmlEvents();mapness.ui.initValidate();mapness.ui.initValidCoordinates();mapness.ev.showOnTheMapSubmit();mapness.ev.bindEvents();DOMcache.get("#j_name").focus();var C=new Date();var B=C.getFullYear();var A=(parseInt(B,10)-110)+":"+B;if(mapness.dict.lang!="en"){$.datepicker.setDefaults($.datepicker.regional[mapness.dict.lang])}else{$.datepicker.setDefaults($.datepicker.regional[""])}$("#routeForm .dataInput").datepicker({autoPopUp:"both",changeYear:true,changeMonth:true,firstDay:1,yearRange:(parseInt(B,10)-50)+":"+(parseInt(B,10)+10),dateFormat:"yy-mm-dd"});$("#journeyForm .dataInput").datepicker({autoPopUp:"both",changeYear:true,changeMonth:true,firstDay:1,yearRange:(parseInt(B,10)-50)+":"+(parseInt(B,10)+10),dateFormat:"yy-mm-dd"});mapness.ui.initialiseScrollPane()}mapness.ui.initImageBox=function(){$("a[rel=lightbox]").lightBox({overlayBgColor:"#000",overlayOpacity:0.6,imageLoading:"/images/"+mapness.dict.lang+"/lightbox-ico-loading.gif",imageBtnClose:"/images/"+mapness.dict.lang+"/lightbox-btn-close.gif",imageBtnPrev:"/images/"+mapness.dict.lang+"/lightbox-btn-prev.gif",imageBtnNext:"/images/"+mapness.dict.lang+"/lightbox-btn-next.gif",imageBlank:"/images/lightbox-blank.gif",containerResizeSpeed:350,txtImage:mapness.dict.words.images,txtOf:"/"})};mapness.ui.initTooltips=function(){DOMcache.get(".tip").Tooltip({delay:0,track:true,fixPNG:true,showURL:false})};mapness.ui.initJTooltip=function(){DOMcache.get("#jmap").bind("mouseover",function(){DOMcache.get("#jmap div div").eq(0).css("cursor","crosshair");DOMcache.get("#jmapTip").show()});DOMcache.get("#jmap").bind("mouseout",function(){DOMcache.get("#jmapTip").hide()});DOMcache.get("#jmapTip").bind("mouseover",function(){DOMcache.get("#jmapTip").show()})};mapness.ui.initRatings=function(){var B;var A=mapness.journey.j_rating;DOMcache.get("form.rating").attr("title","Average Rating: "+A);B=$("form.rating").rating();DOMcache.get("#rateJourney").show()};mapness.ui.initValidate=function(){var A=new Array();A.required=mapness.dict.words.required;A.email=mapness.dict.words.required_email;A.url=mapness.dict.words.required_www;A.date=mapness.dict.words.required_date;A.dateISO=mapness.dict.words.required_date;A.number=mapness.dict.words.required_number;A.digits=mapness.dict.words.required_digits;jQuery.each(jQuery.validator.messages,function(B){jQuery.validator.messages[B]=A[B]})};if(!mapness.user){mapness.user={}}mapness.ev.bindEvents=function(){$("li.jsLogin a").click(function(){DOMcache.get("#profileFormHolder").show();DOMcache.get("#profileFormError").html("");DOMcache.get("#loginFormError").html("");return false});$(".jsShare").mouseover(function(){mapness.ui.shareJourney()});$("#finishEditingForm .jsFinish").click(function(){var A=$("#finishEditingForm input:checked").attr("value");if(A==="public"){mapness.journey.publishJourney(true)}else{document.location="/journey/"+mapness.journey.j_id}});$("#finishEditingForm .jsContinue").click(function(){$("#finishEditingFormHolder").fadeOut("fast")})};mapness.user.id=0;$(document).ready(initObjects);if(!mapness){var mapness={}}mapness.debug={show:true,trace:false,console:function(A){if(show){console.debug(A)}if(trace){console.trace()}}};window.onerror=reportError;function reportError(D,B,A){var C=new RequestO("post","/xhr/jsError.php",{error:D,script:B,line:A},{loading:null,complete:null});return true};
