(function(){var _jQuery=window.jQuery,_$=window.$;var jQuery=window.jQuery=window.$=function(selector,context){return new jQuery.fn.init(selector,context)};var quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/,isSimple=/^.[^:#\[\.]*$/,undefined;jQuery.fn=jQuery.prototype={init:function(selector,context){selector=selector||document;if(selector.nodeType){this[0]=selector;this.length=1;return this}if(typeof selector=="string"){var match=quickExpr.exec(selector);if(match&&(match[1]||!context)){if(match[1]){selector=jQuery.clean([match[1]],context)}else{var elem=document.getElementById(match[3]);if(elem){if(elem.id!=match[3]){return jQuery().find(selector)}return jQuery(elem)}selector=[]}}else{return jQuery(context).find(selector)}}else{if(jQuery.isFunction(selector)){return jQuery(document)[jQuery.fn.ready?"ready":"load"](selector)}}return this.setArray(jQuery.makeArray(selector))},jquery:"1.2.6",size:function(){return this.length},length:0,get:function(num){return num==undefined?jQuery.makeArray(this):this[num]},pushStack:function(elems){var ret=jQuery(elems);ret.prevObject=this;return ret},setArray:function(elems){this.length=0;Array.prototype.push.apply(this,elems);return this},each:function(callback,args){return jQuery.each(this,callback,args)},index:function(elem){var ret=-1;return jQuery.inArray(elem&&elem.jquery?elem[0]:elem,this)},attr:function(name,value,type){var options=name;if(name.constructor==String){if(value===undefined){return this[0]&&jQuery[type||"attr"](this[0],name)}else{options={};options[name]=value}}return this.each(function(i){for(name in options){jQuery.attr(type?this.style:this,name,jQuery.prop(this,options[name],type,i,name))}})},css:function(key,value){if((key=="width"||key=="height")&&parseFloat(value)<0){value=undefined}return this.attr(key,value,"curCSS")},text:function(text){if(typeof text!="object"&&text!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(text))}var ret="";jQuery.each(text||this,function(){jQuery.each(this.childNodes,function(){if(this.nodeType!=8){ret+=this.nodeType!=1?this.nodeValue:jQuery.fn.text([this])}})});return ret},wrapAll:function(html){if(this[0]){jQuery(html,this[0].ownerDocument).clone().insertBefore(this[0]).map(function(){var elem=this;while(elem.firstChild){elem=elem.firstChild}return elem}).append(this)}return this},wrapInner:function(html){return this.each(function(){jQuery(this).contents().wrapAll(html)})},wrap:function(html){return this.each(function(){jQuery(this).wrapAll(html)})},append:function(){return this.domManip(arguments,true,false,function(elem){if(this.nodeType==1){this.appendChild(elem)}})},prepend:function(){return this.domManip(arguments,true,true,function(elem){if(this.nodeType==1){this.insertBefore(elem,this.firstChild)}})},before:function(){return this.domManip(arguments,false,false,function(elem){this.parentNode.insertBefore(elem,this)})},after:function(){return this.domManip(arguments,false,true,function(elem){this.parentNode.insertBefore(elem,this.nextSibling)})},end:function(){return this.prevObject||jQuery([])},find:function(selector){var elems=jQuery.map(this,function(elem){return jQuery.find(selector,elem)});return this.pushStack(/[^+>] [^+>]/.test(selector)||selector.indexOf("..")>-1?jQuery.unique(elems):elems)},clone:function(events){var ret=this.map(function(){if(jQuery.browser.msie&&!jQuery.isXMLDoc(this)){var clone=this.cloneNode(true),container=document.createElement("div");container.appendChild(clone);return jQuery.clean([container.innerHTML])[0]}else{return this.cloneNode(true)}});var clone=ret.find("*").andSelf().each(function(){if(this[expando]!=undefined){this[expando]=null}});if(events===true){this.find("*").andSelf().each(function(i){if(this.nodeType==3){return }var events=jQuery.data(this,"events");for(var type in events){for(var handler in events[type]){jQuery.event.add(clone[i],type,events[type][handler],events[type][handler].data)}}})}return ret},filter:function(selector){return this.pushStack(jQuery.isFunction(selector)&&jQuery.grep(this,function(elem,i){return selector.call(elem,i)})||jQuery.multiFilter(selector,this))},not:function(selector){if(selector.constructor==String){if(isSimple.test(selector)){return this.pushStack(jQuery.multiFilter(selector,this,true))}else{selector=jQuery.multiFilter(selector,this)}}var isArrayLike=selector.length&&selector[selector.length-1]!==undefined&&!selector.nodeType;return this.filter(function(){return isArrayLike?jQuery.inArray(this,selector)<0:this!=selector})},add:function(selector){return this.pushStack(jQuery.unique(jQuery.merge(this.get(),typeof selector=="string"?jQuery(selector):jQuery.makeArray(selector))))},is:function(selector){return !!selector&&jQuery.multiFilter(selector,this).length>0},hasClass:function(selector){return this.is("."+selector)},val:function(value){if(value==undefined){if(this.length){var elem=this[0];if(jQuery.nodeName(elem,"select")){var index=elem.selectedIndex,values=[],options=elem.options,one=elem.type=="select-one";if(index<0){return null}for(var i=one?index:0,max=one?index+1:options.length;i<max;i++){var option=options[i];if(option.selected){value=jQuery.browser.msie&&!option.attributes.value.specified?option.text:option.value;if(one){return value}values.push(value)}}return values}else{return(this[0].value||"").replace(/\r/g,"")}}return undefined}if(value.constructor==Number){value+=""}return this.each(function(){if(this.nodeType!=1){return }if(value.constructor==Array&&/radio|checkbox/.test(this.type)){this.checked=(jQuery.inArray(this.value,value)>=0||jQuery.inArray(this.name,value)>=0)}else{if(jQuery.nodeName(this,"select")){var values=jQuery.makeArray(value);jQuery("option",this).each(function(){this.selected=(jQuery.inArray(this.value,values)>=0||jQuery.inArray(this.text,values)>=0)});if(!values.length){this.selectedIndex=-1}}else{this.value=value}}})},html:function(value){return value==undefined?(this[0]?this[0].innerHTML:null):this.empty().append(value)},replaceWith:function(value){return this.after(value).remove()},eq:function(i){return this.slice(i,i+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments))},map:function(callback){return this.pushStack(jQuery.map(this,function(elem,i){return callback.call(elem,i,elem)}))},andSelf:function(){return this.add(this.prevObject)},data:function(key,value){var parts=key.split(".");parts[1]=parts[1]?"."+parts[1]:"";if(value===undefined){var data=this.triggerHandler("getData"+parts[1]+"!",[parts[0]]);if(data===undefined&&this.length){data=jQuery.data(this[0],key)}return data===undefined&&parts[1]?this.data(parts[0]):data}else{return this.trigger("setData"+parts[1]+"!",[parts[0],value]).each(function(){jQuery.data(this,key,value)})}},removeData:function(key){return this.each(function(){jQuery.removeData(this,key)})},domManip:function(args,table,reverse,callback){var clone=this.length>1,elems;return this.each(function(){if(!elems){elems=jQuery.clean(args,this.ownerDocument);if(reverse){elems.reverse()}}var obj=this;if(table&&jQuery.nodeName(this,"table")&&jQuery.nodeName(elems[0],"tr")){obj=this.getElementsByTagName("tbody")[0]||this.appendChild(this.ownerDocument.createElement("tbody"))}var scripts=jQuery([]);jQuery.each(elems,function(){var elem=clone?jQuery(this).clone(true)[0]:this;if(jQuery.nodeName(elem,"script")){scripts=scripts.add(elem)}else{if(elem.nodeType==1){scripts=scripts.add(jQuery("script",elem).remove())}callback.call(obj,elem)}});scripts.each(evalScript)})}};jQuery.fn.init.prototype=jQuery.fn;function evalScript(i,elem){if(elem.src){jQuery.ajax({url:elem.src,async:false,dataType:"script"})}else{jQuery.globalEval(elem.text||elem.textContent||elem.innerHTML||"")}if(elem.parentNode){elem.parentNode.removeChild(elem)}}function now(){return +new Date}jQuery.extend=jQuery.fn.extend=function(){var target=arguments[0]||{},i=1,length=arguments.length,deep=false,options;if(target.constructor==Boolean){deep=target;target=arguments[1]||{};i=2}if(typeof target!="object"&&typeof target!="function"){target={}}if(length==i){target=this;--i}for(;i<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 expando="jQuery"+now(),uuid=0,windowData={},exclude=/z-?index|font-?weight|opacity|zoom|line-?height/i,defaultView=document.defaultView||{};jQuery.extend({noConflict:function(deep){window.$=_$;if(deep){window.jQuery=_jQuery}return jQuery},isFunction:function(fn){return !!fn&&typeof fn!="string"&&!fn.nodeName&&fn.constructor!=Array&&/^[\s[]?function/.test(fn+"")},isXMLDoc:function(elem){return elem.documentElement&&!elem.body||elem.tagName&&elem.ownerDocument&&!elem.ownerDocument.body},globalEval:function(data){data=jQuery.trim(data);if(data){var head=document.getElementsByTagName("head")[0]||document.documentElement,script=document.createElement("script");script.type="text/javascript";if(jQuery.browser.msie){script.text=data}else{script.appendChild(document.createTextNode(data))}head.insertBefore(script,head.firstChild);head.removeChild(script)}},nodeName:function(elem,name){return elem.nodeName&&elem.nodeName.toUpperCase()==name.toUpperCase()},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]}},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 value&&value.constructor==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 jQuery.inArray(className,(elem.className||elem).toString().split(/\s+/))>-1}},swap:function(elem,options,callback){var old={};for(var name in options){old[name]=elem.style[name];elem.style[name]=options[name]}callback.call(elem);for(var name in options){elem.style[name]=old[name]}},css:function(elem,name,force){if(name=="width"||name=="height"){var val,props={position:"absolute",visibility:"hidden",display:"block"},which=name=="width"?["Left","Right"]:["Top","Bottom"];function getWH(){val=name=="width"?elem.offsetWidth:elem.offsetHeight;var padding=0,border=0;jQuery.each(which,function(){padding+=parseFloat(jQuery.curCSS(elem,"padding"+this,true))||0;border+=parseFloat(jQuery.curCSS(elem,"border"+this+"Width",true))||0});val-=Math.round(padding+border)}if(jQuery(elem).is(":visible")){getWH()}else{jQuery.swap(elem,props,getWH)}return Math.max(0,val)}return jQuery.curCSS(elem,name,force)},curCSS:function(elem,name,force){var ret,style=elem.style;function color(elem){if(!jQuery.browser.safari){return false}var ret=defaultView.getComputedStyle(elem,null);return !ret||ret.getPropertyValue("color")==""}if(name=="opacity"&&jQuery.browser.msie){ret=jQuery.attr(style,"opacity");return ret==""?"1":ret}if(jQuery.browser.opera&&name=="display"){var save=style.outline;style.outline="0 solid black";style.outline=save}if(name.match(/float/i)){name=styleFloat}if(!force&&style&&style[name]){ret=style[name]}else{if(defaultView.getComputedStyle){if(name.match(/float/i)){name="float"}name=name.replace(/([A-Z])/g,"-$1").toLowerCase();var computedStyle=defaultView.getComputedStyle(elem,null);if(computedStyle&&!color(elem)){ret=computedStyle.getPropertyValue(name)}else{var swap=[],stack=[],a=elem,i=0;for(;a&&color(a);a=a.parentNode){stack.unshift(a)}for(;i<stack.length;i++){if(color(stack[i])){swap[i]=stack[i].style.display;stack[i].style.display="block"}}ret=name=="display"&&swap[stack.length-1]!=null?"none":(computedStyle&&computedStyle.getPropertyValue(name))||"";for(i=0;i<swap.length;i++){if(swap[i]!=null){stack[i].style.display=swap[i]}}}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){var ret=[];context=context||document;if(typeof context.createElement=="undefined"){context=context.ownerDocument||context[0]&&context[0].ownerDocument||document}jQuery.each(elems,function(i,elem){if(!elem){return }if(elem.constructor==Number){elem+=""}if(typeof elem=="string"){elem=elem.replace(/(<(\w+)[^>]*?)\/>/g,function(all,front,tag){return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?all:front+"></"+tag+">"});var tags=jQuery.trim(elem).toLowerCase(),div=context.createElement("div");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.browser.msie&&[1,"div<div>","</div>"]||[0,"",""];div.innerHTML=wrap[1]+elem+wrap[2];while(wrap[0]--){div=div.lastChild}if(jQuery.browser.msie){var tbody=!tags.indexOf("<table")&&tags.indexOf("<tbody")<0?div.firstChild&&div.firstChild.childNodes:wrap[1]=="<table>"&&tags.indexOf("<tbody")<0?div.childNodes:[];for(var j=tbody.length-1;j>=0;--j){if(jQuery.nodeName(tbody[j],"tbody")&&!tbody[j].childNodes.length){tbody[j].parentNode.removeChild(tbody[j])}}if(/^\s/.test(elem)){div.insertBefore(context.createTextNode(elem.match(/^\s*/)[0]),div.firstChild)}}elem=jQuery.makeArray(div.childNodes)}if(elem.length===0&&(!jQuery.nodeName(elem,"form")&&!jQuery.nodeName(elem,"select"))){return }if(elem[0]==undefined||jQuery.nodeName(elem,"form")||elem.options){ret.push(elem)}else{ret=jQuery.merge(ret,elem)}});return ret},attr:function(elem,name,value){if(!elem||elem.nodeType==3||elem.nodeType==8){return undefined}var notxml=!jQuery.isXMLDoc(elem),set=value!==undefined,msie=jQuery.browser.msie;name=notxml&&jQuery.props[name]||name;if(elem.tagName){var special=/href|src|style/.test(name);if(name=="selected"&&jQuery.browser.safari){elem.parentNode.selectedIndex}if(name in elem&&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}return elem[name]}if(msie&&notxml&&name=="style"){return jQuery.attr(elem.style,"cssText",value)}if(set){elem.setAttribute(name,""+value)}var attr=msie&&notxml&&special?elem.getAttribute(name,2):elem.getAttribute(name);return attr===null?undefined:attr}if(msie&&name=="opacity"){if(set){elem.zoom=1;elem.filter=(elem.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(value)+""=="NaN"?"":"alpha(opacity="+value*100+")")}return elem.filter&&elem.filter.indexOf("opacity=")>=0?(parseFloat(elem.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}name=name.replace(/-([a-z])/ig,function(all,letter){return letter.toUpperCase()});if(set){elem[name]=value}return elem[name]},trim:function(text){return(text||"").replace(/^\s+|\s+$/g,"")},makeArray:function(array){var ret=[];if(array!=null){var i=array.length;if(i==null||array.split||array.setInterval||array.call){ret[0]=array}else{while(i){ret[--i]=array[i]}}}return ret},inArray:function(elem,array){for(var i=0,length=array.length;i<length;i++){if(array[i]===elem){return i}}return -1},merge:function(first,second){var i=0,elem,pos=first.length;if(jQuery.browser.msie){while(elem=second[i++]){if(elem.nodeType!=8){first[pos++]=elem}}}else{while(elem=second[i++]){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.]+)/)||[])[1],safari:/webkit/.test(userAgent),opera:/opera/.test(userAgent),msie:/msie/.test(userAgent)&&!/opera/.test(userAgent),mozilla:/mozilla/.test(userAgent)&&!/(compatible|webkit)/.test(userAgent)};var styleFloat=jQuery.browser.msie?"styleFloat":"cssFloat";jQuery.extend({boxModel:!jQuery.browser.msie||document.compatMode=="CSS1Compat",props:{"for":"htmlFor","class":"className","float":styleFloat,cssFloat:styleFloat,styleFloat:styleFloat,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing"}});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))}});jQuery.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(name,original){jQuery.fn[name]=function(){var args=arguments;return this.each(function(){for(var i=0,length=args.length;i<length;i++){jQuery(args[i])[original](this)}})}});jQuery.each({removeAttr:function(name){jQuery.attr(this,name,"");if(this.nodeType==1){this.removeAttribute(name)}},addClass:function(classNames){jQuery.className.add(this,classNames)},removeClass:function(classNames){jQuery.className.remove(this,classNames)},toggleClass:function(classNames){jQuery.className[jQuery.className.has(this,classNames)?"remove":"add"](this,classNames)},remove:function(selector){if(!selector||jQuery.filter(selector,[this]).r.length){jQuery("*",this).add(this).each(function(){jQuery.event.remove(this);jQuery.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){jQuery(">*",this).remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(name,fn){jQuery.fn[name]=function(){return this.each(fn,arguments)}});jQuery.each(["Height","Width"],function(i,name){var type=name.toLowerCase();jQuery.fn[type]=function(size){return this[0]==window?jQuery.browser.opera&&document.body["client"+name]||jQuery.browser.safari&&window["inner"+name]||document.compatMode=="CSS1Compat"&&document.documentElement["client"+name]||document.body["client"+name]:this[0]==document?Math.max(Math.max(document.body["scroll"+name],document.documentElement["scroll"+name]),Math.max(document.body["offset"+name],document.documentElement["offset"+name])):size==undefined?(this.length?jQuery.css(this[0],type):null):this.css(type,size.constructor==String?size:size+"px")}});function num(elem,prop){return elem[0]&&parseInt(jQuery.curCSS(elem[0],prop,true),10)||0}var chars=jQuery.browser.safari&&parseInt(jQuery.browser.version)<417?"(?:[\\w*_-]|\\\\.)":"(?:[\\w\u0128-\uFFFF*_-]|\\\\.)",quickChild=new RegExp("^>\\s*("+chars+"+)"),quickID=new RegExp("^("+chars+"+)(#)("+chars+"+)"),quickClass=new RegExp("^([#.]?)("+chars+"*)");jQuery.extend({expr:{"":function(a,i,m){return m[2]=="*"||jQuery.nodeName(a,m[2])},"#":function(a,i,m){return a.getAttribute("id")==m[2]},":":{lt:function(a,i,m){return i<m[3]-0},gt:function(a,i,m){return i>m[3]-0},nth:function(a,i,m){return m[3]-0==i},eq:function(a,i,m){return m[3]-0==i},first:function(a,i){return i==0},last:function(a,i,m,r){return i==r.length-1},even:function(a,i){return i%2==0},odd:function(a,i){return i%2},"first-child":function(a){return a.parentNode.getElementsByTagName("*")[0]==a},"last-child":function(a){return jQuery.nth(a.parentNode.lastChild,1,"previousSibling")==a},"only-child":function(a){return !jQuery.nth(a.parentNode.lastChild,2,"previousSibling")},parent:function(a){return a.firstChild},empty:function(a){return !a.firstChild},contains:function(a,i,m){return(a.textContent||a.innerText||jQuery(a).text()||"").indexOf(m[3])>=0},visible:function(a){return"hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden"},hidden:function(a){return"hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden"},enabled:function(a){return !a.disabled},disabled:function(a){return a.disabled},checked:function(a){return a.checked},selected:function(a){return a.selected||jQuery.attr(a,"selected")},text:function(a){return"text"==a.type},radio:function(a){return"radio"==a.type},checkbox:function(a){return"checkbox"==a.type},file:function(a){return"file"==a.type},password:function(a){return"password"==a.type},submit:function(a){return"submit"==a.type},image:function(a){return"image"==a.type},reset:function(a){return"reset"==a.type},button:function(a){return"button"==a.type||jQuery.nodeName(a,"button")},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},has:function(a,i,m){return jQuery.find(m[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},animated:function(a){return jQuery.grep(jQuery.timers,function(fn){return a==fn.elem}).length}}},parse:[/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,new RegExp("^([:.#]*)("+chars+"+)")],multiFilter:function(expr,elems,not){var old,cur=[];while(expr&&expr!=old){old=expr;var f=jQuery.filter(expr,elems,not);expr=f.t.replace(/^\s*,\s*/,"");cur=not?elems=f.r:jQuery.merge(cur,f.r)}return cur},find:function(t,context){if(typeof t!="string"){return[t]}if(context&&context.nodeType!=1&&context.nodeType!=9){return[]}context=context||document;var ret=[context],done=[],last,nodeName;while(t&&last!=t){var r=[];last=t;t=jQuery.trim(t);var foundToken=false,re=quickChild,m=re.exec(t);if(m){nodeName=m[1].toUpperCase();for(var i=0;ret[i];i++){for(var c=ret[i].firstChild;c;c=c.nextSibling){if(c.nodeType==1&&(nodeName=="*"||c.nodeName.toUpperCase()==nodeName)){r.push(c)}}}ret=r;t=t.replace(re,"");if(t.indexOf(" ")==0){continue}foundToken=true}else{re=/^([>+~])\s*(\w*)/i;if((m=re.exec(t))!=null){r=[];var merge={};nodeName=m[2].toUpperCase();m=m[1];for(var j=0,rl=ret.length;j<rl;j++){var n=m=="~"||m=="+"?ret[j].nextSibling:ret[j].firstChild;for(;n;n=n.nextSibling){if(n.nodeType==1){var id=jQuery.data(n);if(m=="~"&&merge[id]){break}if(!nodeName||n.nodeName.toUpperCase()==nodeName){if(m=="~"){merge[id]=true}r.push(n)}if(m=="+"){break}}}}ret=r;t=jQuery.trim(t.replace(re,""));foundToken=true}}if(t&&!foundToken){if(!t.indexOf(",")){if(context==ret[0]){ret.shift()}done=jQuery.merge(done,ret);r=ret=[context];t=" "+t.substr(1,t.length)}else{var re2=quickID;var m=re2.exec(t);if(m){m=[0,m[2],m[3],m[1]]}else{re2=quickClass;m=re2.exec(t)}m[2]=m[2].replace(/\\/g,"");var elem=ret[ret.length-1];if(m[1]=="#"&&elem&&elem.getElementById&&!jQuery.isXMLDoc(elem)){var oid=elem.getElementById(m[2]);if((jQuery.browser.msie||jQuery.browser.opera)&&oid&&typeof oid.id=="string"&&oid.id!=m[2]){oid=jQuery('[@id="'+m[2]+'"]',elem)[0]}ret=r=oid&&(!m[3]||jQuery.nodeName(oid,m[3]))?[oid]:[]}else{for(var i=0;ret[i];i++){var tag=m[1]=="#"&&m[3]?m[3]:m[1]!=""||m[0]==""?"*":m[2];if(tag=="*"&&ret[i].nodeName.toLowerCase()=="object"){tag="param"}r=jQuery.merge(r,ret[i].getElementsByTagName(tag))}if(m[1]=="."){r=jQuery.classFilter(r,m[2])}if(m[1]=="#"){var tmp=[];for(var i=0;r[i];i++){if(r[i].getAttribute("id")==m[2]){tmp=[r[i]];break}}r=tmp}ret=r}t=t.replace(re2,"")}}if(t){var val=jQuery.filter(t,r);ret=r=val.r;t=jQuery.trim(val.t)}}if(t){ret=[]}if(ret&&context==ret[0]){ret.shift()}done=jQuery.merge(done,ret);return done},classFilter:function(r,m,not){m=" "+m+" ";var tmp=[];for(var i=0;r[i];i++){var pass=(" "+r[i].className+" ").indexOf(m)>=0;if(!not&&pass||not&&!pass){tmp.push(r[i])}}return tmp},filter:function(t,r,not){var last;while(t&&t!=last){last=t;var p=jQuery.parse,m;for(var i=0;p[i];i++){m=p[i].exec(t);if(m){t=t.substring(m[0].length);m[2]=m[2].replace(/\\/g,"");break}}if(!m){break}if(m[1]==":"&&m[2]=="not"){r=isSimple.test(m[3])?jQuery.filter(m[3],r,true).r:jQuery(r).not(m[3])}else{if(m[1]=="."){r=jQuery.classFilter(r,m[2],not)}else{if(m[1]=="["){var tmp=[],type=m[3];for(var i=0,rl=r.length;i<rl;i++){var a=r[i],z=a[jQuery.props[m[2]]||m[2]];if(z==null||/href|src|selected/.test(m[2])){z=jQuery.attr(a,m[2])||""}if((type==""&&!!z||type=="="&&z==m[5]||type=="!="&&z!=m[5]||type=="^="&&z&&!z.indexOf(m[5])||type=="$="&&z.substr(z.length-m[5].length)==m[5]||(type=="*="||type=="~=")&&z.indexOf(m[5])>=0)^not){tmp.push(a)}}r=tmp}else{if(m[1]==":"&&m[2]=="nth-child"){var merge={},tmp=[],test=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(m[3]=="even"&&"2n"||m[3]=="odd"&&"2n+1"||!/\D/.test(m[3])&&"0n+"+m[3]||m[3]),first=(test[1]+(test[2]||1))-0,last=test[3]-0;for(var i=0,rl=r.length;i<rl;i++){var node=r[i],parentNode=node.parentNode,id=jQuery.data(parentNode);if(!merge[id]){var c=1;for(var n=parentNode.firstChild;n;n=n.nextSibling){if(n.nodeType==1){n.nodeIndex=c++}}merge[id]=true}var add=false;if(first==0){if(node.nodeIndex==last){add=true}}else{if((node.nodeIndex-last)%first==0&&(node.nodeIndex-last)/first>=0){add=true}}if(add^not){tmp.push(node)}}r=tmp}else{var fn=jQuery.expr[m[1]];if(typeof fn=="object"){fn=fn[m[2]]}if(typeof fn=="string"){fn=eval("false||function(a,i){return "+fn+";}")}r=jQuery.grep(r,function(elem,i){return fn(elem,i,m,r)},not)}}}}}return{r:r,t:t}},dir:function(elem,dir){var matched=[],cur=elem[dir];while(cur&&cur!=document){if(cur.nodeType==1){matched.push(cur)}cur=cur[dir]}return matched},nth:function(cur,result,dir,elem){result=result||1;var num=0;for(;cur;cur=cur[dir]){if(cur.nodeType==1&&++num==result){break}}return cur},sibling:function(n,elem){var r=[];for(;n;n=n.nextSibling){if(n.nodeType==1&&n!=elem){r.push(n)}}return r}});jQuery.event={add:function(elem,types,handler,data){if(elem.nodeType==3||elem.nodeType==8){return }if(jQuery.browser.msie&&elem.setInterval){elem=window}if(!handler.guid){handler.guid=this.guid++}if(data!=undefined){var fn=handler;handler=this.proxy(fn,function(){return fn.apply(this,arguments)});handler.data=data}var events=jQuery.data(elem,"events")||jQuery.data(elem,"events",{}),handle=jQuery.data(elem,"handle")||jQuery.data(elem,"handle",function(){if(typeof jQuery!="undefined"&&!jQuery.event.triggered){return jQuery.event.handle.apply(arguments.callee.elem,arguments)}});handle.elem=elem;jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];handler.type=parts[1];var handlers=events[type];if(!handlers){handlers=events[type]={};if(!jQuery.event.special[type]||jQuery.event.special[type].setup.call(elem)===false){if(elem.addEventListener){elem.addEventListener(type,handle,false)}else{if(elem.attachEvent){elem.attachEvent("on"+type,handle)}}}}handlers[handler.guid]=handler;jQuery.event.global[type]=true});elem=null},guid:1,global:{},remove:function(elem,types,handler){if(elem.nodeType==3||elem.nodeType==8){return }var events=jQuery.data(elem,"events"),ret,index;if(events){if(types==undefined||(typeof types=="string"&&types.charAt(0)==".")){for(var type in events){this.remove(elem,type+(types||""))}}else{if(types.type){handler=types.handler;types=types.type}jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];if(events[type]){if(handler){delete events[type][handler.guid]}else{for(handler in events[type]){if(!parts[1]||events[type][handler].type==parts[1]){delete events[type][handler]}}}for(ret in events[type]){break}if(!ret){if(!jQuery.event.special[type]||jQuery.event.special[type].teardown.call(elem)===false){if(elem.removeEventListener){elem.removeEventListener(type,jQuery.data(elem,"handle"),false)}else{if(elem.detachEvent){elem.detachEvent("on"+type,jQuery.data(elem,"handle"))}}}ret=null;delete events[type]}}})}for(ret in events){break}if(!ret){var handle=jQuery.data(elem,"handle");if(handle){handle.elem=null}jQuery.removeData(elem,"events");jQuery.removeData(elem,"handle")}}},trigger:function(type,data,elem,donative,extra){data=jQuery.makeArray(data);if(type.indexOf("!")>=0){type=type.slice(0,-1);var exclusive=true}if(!elem){if(this.global[type]){jQuery("*").add([window,document]).trigger(type,data)}}else{if(elem.nodeType==3||elem.nodeType==8){return undefined}var val,ret,fn=jQuery.isFunction(elem[type]||null),event=!data[0]||!data[0].preventDefault;if(event){data.unshift({type:type,target:elem,preventDefault:function(){},stopPropagation:function(){},timeStamp:now()});data[0][expando]=true}data[0].type=type;if(exclusive){data[0].exclusive=true}var handle=jQuery.data(elem,"handle");if(handle){val=handle.apply(elem,data)}if((!fn||(jQuery.nodeName(elem,"a")&&type=="click"))&&elem["on"+type]&&elem["on"+type].apply(elem,data)===false){val=false}if(event){data.shift()}if(extra&&jQuery.isFunction(extra)){ret=extra.apply(elem,val==null?data:data.concat(val));if(ret!==undefined){val=ret}}if(fn&&donative!==false&&val!==false&&!(jQuery.nodeName(elem,"a")&&type=="click")){this.triggered=true;try{elem[type]()}catch(e){}}this.triggered=false}return val},handle:function(event){var val,ret,namespace,all,handlers;event=arguments[0]=jQuery.event.fix(event||window.event);namespace=event.type.split(".");event.type=namespace[0];namespace=namespace[1];all=!namespace&&!event.exclusive;handlers=(jQuery.data(this,"events")||{})[event.type];for(var j in handlers){var handler=handlers[j];if(all||handler.type==namespace){event.handler=handler;event.data=handler.data;ret=handler.apply(this,arguments);if(val!==false){val=ret}if(ret===false){event.preventDefault();event.stopPropagation()}}}return val},fix:function(event){if(event[expando]==true){return event}var originalEvent=event;event={originalEvent:originalEvent};var props="altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target timeStamp toElement type view wheelDelta which".split(" ");for(var i=props.length;i;i--){event[props[i]]=originalEvent[props[i]]}event[expando]=true;event.preventDefault=function(){if(originalEvent.preventDefault){originalEvent.preventDefault()}originalEvent.returnValue=false};event.stopPropagation=function(){if(originalEvent.stopPropagation){originalEvent.stopPropagation()}originalEvent.cancelBubble=true};event.timeStamp=event.timeStamp||now();if(!event.target){event.target=event.srcElement||document}if(event.target.nodeType==3){event.target=event.target.parentNode}if(!event.relatedTarget&&event.fromElement){event.relatedTarget=event.fromElement==event.target?event.toElement:event.fromElement}if(event.pageX==null&&event.clientX!=null){var doc=document.documentElement,body=document.body;event.pageX=event.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc.clientLeft||0);event.pageY=event.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc.clientTop||0)}if(!event.which&&((event.charCode||event.charCode===0)?event.charCode:event.keyCode)){event.which=event.charCode||event.keyCode}if(!event.metaKey&&event.ctrlKey){event.metaKey=event.ctrlKey}if(!event.which&&event.button){event.which=(event.button&1?1:(event.button&2?3:(event.button&4?2:0)))}return event},proxy:function(fn,proxy){proxy.guid=fn.guid=fn.guid||proxy.guid||this.guid++;return proxy},special:{ready:{setup:function(){bindReady();return },teardown:function(){return }},mouseenter:{setup:function(){if(jQuery.browser.msie){return false}jQuery(this).bind("mouseover",jQuery.event.special.mouseenter.handler);return true},teardown:function(){if(jQuery.browser.msie){return false}jQuery(this).unbind("mouseover",jQuery.event.special.mouseenter.handler);return true},handler:function(event){if(withinElement(event,this)){return true}event.type="mouseenter";return jQuery.event.handle.apply(this,arguments)}},mouseleave:{setup:function(){if(jQuery.browser.msie){return false}jQuery(this).bind("mouseout",jQuery.event.special.mouseleave.handler);return true},teardown:function(){if(jQuery.browser.msie){return false}jQuery(this).unbind("mouseout",jQuery.event.special.mouseleave.handler);return true},handler:function(event){if(withinElement(event,this)){return true}event.type="mouseleave";return jQuery.event.handle.apply(this,arguments)}}}};jQuery.fn.extend({bind:function(type,data,fn){return type=="unload"?this.one(type,data,fn):this.each(function(){jQuery.event.add(this,type,fn||data,fn&&data)})},one:function(type,data,fn){var one=jQuery.event.proxy(fn||data,function(event){jQuery(this).unbind(event,one);return(fn||data).apply(this,arguments)});return this.each(function(){jQuery.event.add(this,type,one,fn&&data)})},unbind:function(type,fn){return this.each(function(){jQuery.event.remove(this,type,fn)})},trigger:function(type,data,fn){return this.each(function(){jQuery.event.trigger(type,data,this,true,fn)})},triggerHandler:function(type,data,fn){return this[0]&&jQuery.event.trigger(type,data,this[0],false,fn)},toggle:function(fn){var args=arguments,i=1;while(i<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.bind("mouseenter",fnOver).bind("mouseleave",fnOut)},ready:function(fn){bindReady();if(jQuery.isReady){fn.call(document,jQuery)}else{jQuery.readyList.push(function(){return fn.call(this,jQuery)})}return this}});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.readyList=null}jQuery(document).triggerHandler("ready")}}});var readyBound=false;function bindReady(){if(readyBound){return }readyBound=true;if(document.addEventListener&&!jQuery.browser.opera){document.addEventListener("DOMContentLoaded",jQuery.ready,false)}if(jQuery.browser.msie&&window==top){(function(){if(jQuery.isReady){return }try{document.documentElement.doScroll("left")}catch(error){setTimeout(arguments.callee,0);return }jQuery.ready()})()}if(jQuery.browser.opera){document.addEventListener("DOMContentLoaded",function(){if(jQuery.isReady){return }for(var i=0;i<document.styleSheets.length;i++){if(document.styleSheets[i].disabled){setTimeout(arguments.callee,0);return }}jQuery.ready()},false)}if(jQuery.browser.safari){var numStyles;(function(){if(jQuery.isReady){return }if(document.readyState!="loaded"&&document.readyState!="complete"){setTimeout(arguments.callee,0);return }if(numStyles===undefined){numStyles=jQuery("style, link[rel=stylesheet]").length}if(document.styleSheets.length!=numStyles){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,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)}});var withinElement=function(event,elem){var parent=event.relatedTarget;while(parent&&parent!=elem){try{parent=parent.parentNode}catch(error){parent=elem}}return parent==elem};jQuery(window).bind("unload",function(){jQuery("*").add(document).unbind()});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)}callback=callback||function(){};var type="GET";if(params){if(jQuery.isFunction(params)){callback=params;params=null}else{params=jQuery.param(params);type="POST"}}var self=this;jQuery.ajax({url:url,type:type,dataType:"html",data:params,complete:function(res,status){if(status=="success"||status=="notmodified"){self.html(selector?jQuery("<div/>").append(res.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(selector):res.responseText)}self.each(callback,[res.responseText,status,res])}});return this},serialize:function(){return jQuery.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return jQuery.nodeName(this,"form")?jQuery.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type))}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:val.constructor==Array?jQuery.map(val,function(val,i){return{name:elem.name,value:val}}):{name:elem.name,value:val}}).get()}});jQuery.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(i,o){jQuery.fn[o]=function(f){return this.bind(o,f)}});var jsc=now();jQuery.extend({get:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data=null}return jQuery.ajax({type:"GET",url:url,data:data,success:callback,dataType:type})},getScript:function(url,callback){return jQuery.get(url,null,callback,"script")},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json")},post:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data={}}return jQuery.ajax({type:"POST",url:url,data:data,success:callback,dataType:type})},ajaxSetup:function(settings){jQuery.extend(jQuery.ajaxSettings,settings)},ajaxSettings:{url:location.href,global:true,type:"GET",timeout:0,contentType:"application/x-www-form-urlencoded",processData:true,async:true,data:null,username:null,password:null,accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(s){s=jQuery.extend(true,s,jQuery.extend(true,{},jQuery.ajaxSettings,s));var jsonp,jsre=/=\?(&|$)/g,status,data,type=s.type.toUpperCase();if(s.data&&s.processData&&typeof s.data!="string"){s.data=jQuery.param(s.data)}if(s.dataType=="jsonp"){if(type=="GET"){if(!s.url.match(jsre)){s.url+=(s.url.match(/\?/)?"&":"?")+(s.jsonp||"callback")+"=?"}}else{if(!s.data||!s.data.match(jsre)){s.data=(s.data?s.data+"&":"")+(s.jsonp||"callback")+"=?"}}s.dataType="json"}if(s.dataType=="json"&&(s.data&&s.data.match(jsre)||s.url.match(jsre))){jsonp="jsonp"+jsc++;if(s.data){s.data=(s.data+"").replace(jsre,"="+jsonp+"$1")}s.url=s.url.replace(jsre,"="+jsonp+"$1");s.dataType="script";window[jsonp]=function(tmp){data=tmp;success();complete();window[jsonp]=undefined;try{delete window[jsonp]}catch(e){}if(head){head.removeChild(script)}}}if(s.dataType=="script"&&s.cache==null){s.cache=false}if(s.cache===false&&type=="GET"){var ts=now();var ret=s.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+ts+"$2");s.url=ret+((ret==s.url)?(s.url.match(/\?/)?"&":"?")+"_="+ts:"")}if(s.data&&type=="GET"){s.url+=(s.url.match(/\?/)?"&":"?")+s.data;s.data=null}if(s.global&&!jQuery.active++){jQuery.event.trigger("ajaxStart")}var remote=/^(?:\w+:)?\/\/([^\/?#]+)/;if(s.dataType=="script"&&type=="GET"&&remote.test(s.url)&&remote.exec(s.url)[1]!=location.host){var head=document.getElementsByTagName("head")[0];var script=document.createElement("script");script.src=s.url;if(s.scriptCharset){script.charset=s.scriptCharset}if(!jsonp){var done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){done=true;success();complete();head.removeChild(script)}}}head.appendChild(script);return undefined}var requestDone=false;var xhr=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();if(s.username){xhr.open(type,s.url,s.async,s.username,s.password)}else{xhr.open(type,s.url,s.async)}try{if(s.data){xhr.setRequestHeader("Content-Type",s.contentType)}if(s.ifModified){xhr.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");xhr.setRequestHeader("Accept",s.dataType&&s.accepts[s.dataType]?s.accepts[s.dataType]+", */*":s.accepts._default)}catch(e){}if(s.beforeSend&&s.beforeSend(xhr,s)===false){s.global&&jQuery.active--;xhr.abort();return false}if(s.global){jQuery.event.trigger("ajaxSend",[xhr,s])}var onreadystatechange=function(isTimeout){if(!requestDone&&xhr&&(xhr.readyState==4||isTimeout=="timeout")){requestDone=true;if(ival){clearInterval(ival);ival=null}status=isTimeout=="timeout"&&"timeout"||!jQuery.httpSuccess(xhr)&&"error"||s.ifModified&&jQuery.httpNotModified(xhr,s.url)&&"notmodified"||"success";if(status=="success"){try{data=jQuery.httpData(xhr,s.dataType,s.dataFilter)}catch(e){status="parsererror"}}if(status=="success"){var modRes;try{modRes=xhr.getResponseHeader("Last-Modified")}catch(e){}if(s.ifModified&&modRes){jQuery.lastModified[s.url]=modRes}if(!jsonp){success()}}else{jQuery.handleError(s,xhr,status)}complete();if(s.async){xhr=null}}};if(s.async){var ival=setInterval(onreadystatechange,13);if(s.timeout>0){setTimeout(function(){if(xhr){xhr.abort();if(!requestDone){onreadystatechange("timeout")}}},s.timeout)}}try{xhr.send(s.data)}catch(e){jQuery.handleError(s,xhr,null,e)}if(!s.async){onreadystatechange()}function success(){if(s.success){s.success(data,status)}if(s.global){jQuery.event.trigger("ajaxSuccess",[xhr,s])}}function complete(){if(s.complete){s.complete(xhr,status)}if(s.global){jQuery.event.trigger("ajaxComplete",[xhr,s])}if(s.global&&!--jQuery.active){jQuery.event.trigger("ajaxStop")}}return xhr},handleError:function(s,xhr,status,e){if(s.error){s.error(xhr,status,e)}if(s.global){jQuery.event.trigger("ajaxError",[xhr,s,e])}},active:0,httpSuccess:function(xhr){try{return !xhr.status&&location.protocol=="file:"||(xhr.status>=200&&xhr.status<300)||xhr.status==304||xhr.status==1223||jQuery.browser.safari&&xhr.status==undefined}catch(e){}return false},httpNotModified:function(xhr,url){try{var xhrRes=xhr.getResponseHeader("Last-Modified");return xhr.status==304||xhrRes==jQuery.lastModified[url]||jQuery.browser.safari&&xhr.status==undefined}catch(e){}return false},httpData:function(xhr,type,filter){var ct=xhr.getResponseHeader("content-type"),xml=type=="xml"||!type&&ct&&ct.indexOf("xml")>=0,data=xml?xhr.responseXML:xhr.responseText;if(xml&&data.documentElement.tagName=="parsererror"){throw"parsererror"}if(filter){data=filter(data,type)}if(type=="script"){jQuery.globalEval(data)}if(type=="json"){data=eval("("+data+")")}return data},param:function(a){var s=[];if(a.constructor==Array||a.jquery){jQuery.each(a,function(){s.push(encodeURIComponent(this.name)+"="+encodeURIComponent(this.value))})}else{for(var j in a){if(a[j]&&a[j].constructor==Array){jQuery.each(a[j],function(){s.push(encodeURIComponent(j)+"="+encodeURIComponent(this))})}else{s.push(encodeURIComponent(j)+"="+encodeURIComponent(jQuery.isFunction(a[j])?a[j]():a[j]))}}}return s.join("&").replace(/%20/g,"+")}});jQuery.fn.extend({show:function(speed,callback){return speed?this.animate({height:"show",width:"show",opacity:"show"},speed,callback):this.filter(":hidden").each(function(){this.style.display=this.oldblock||"";if(jQuery.css(this,"display")=="none"){var elem=jQuery("<"+this.tagName+" />").appendTo("body");this.style.display=elem.css("display");if(this.style.display=="none"){this.style.display="block"}elem.remove()}}).end()},hide:function(speed,callback){return speed?this.animate({height:"hide",width:"hide",opacity:"hide"},speed,callback):this.filter(":visible").each(function(){this.oldblock=this.oldblock||jQuery.css(this,"display");this.style.display="none"}).end()},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){return jQuery.isFunction(fn)&&jQuery.isFunction(fn2)?this._toggle.apply(this,arguments):fn?this.animate({height:"toggle",width:"toggle",opacity:"toggle"},fn,fn2):this.each(function(){jQuery(this)[jQuery(this).is(":hidden")?"show":"hide"]()})},slideDown:function(speed,callback){return this.animate({height:"show"},speed,callback)},slideUp:function(speed,callback){return this.animate({height:"hide"},speed,callback)},slideToggle:function(speed,callback){return this.animate({height:"toggle"},speed,callback)},fadeIn:function(speed,callback){return this.animate({opacity:"show"},speed,callback)},fadeOut:function(speed,callback){return this.animate({opacity:"hide"},speed,callback)},fadeTo:function(speed,to,callback){return this.animate({opacity:to},speed,callback)},animate:function(prop,speed,easing,callback){var optall=jQuery.speed(speed,easing,callback);return this[optall.queue===false?"each":"queue"](function(){if(this.nodeType!=1){return false}var opt=jQuery.extend({},optall),p,hidden=jQuery(this).is(":hidden"),self=this;for(p in prop){if(prop[p]=="hide"&&hidden||prop[p]=="show"&&!hidden){return opt.complete.call(this)}if(p=="height"||p=="width"){opt.display=jQuery.css(this,"display");opt.overflow=this.style.overflow}}if(opt.overflow!=null){this.style.overflow="hidden"}opt.curAnim=jQuery.extend({},prop);jQuery.each(prop,function(name,val){var e=new jQuery.fx(self,opt,name);if(/toggle|show|hide/.test(val)){e[val=="toggle"?hidden?"show":"hide":val](prop)}else{var parts=val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),start=e.cur(true)||0;if(parts){var end=parseFloat(parts[2]),unit=parts[3]||"px";if(unit!="px"){self.style[name]=(end||1)+unit;start=((end||1)/e.cur(true))*start;self.style[name]=start+unit}if(parts[1]){end=((parts[1]=="-="?-1:1)*end)+start}e.custom(start,end,unit)}else{e.custom(start,val,"")}}});return true})},queue:function(type,fn){if(jQuery.isFunction(type)||(type&&type.constructor==Array)){fn=type;type="fx"}if(!type||(typeof type=="string"&&!fn)){return queue(this[0],type)}return this.each(function(){if(fn.constructor==Array){queue(this,type,fn)}else{queue(this,type).push(fn);if(queue(this,type).length==1){fn.call(this)}}})},stop:function(clearQueue,gotoEnd){var timers=jQuery.timers;if(clearQueue){this.queue([])}this.each(function(){for(var i=timers.length-1;i>=0;i--){if(timers[i].elem==this){if(gotoEnd){timers[i](true)}timers.splice(i,1)}}});if(!gotoEnd){this.dequeue()}return this}});var queue=function(elem,type,array){if(elem){type=type||"fx";var q=jQuery.data(elem,type+"queue");if(!q||array){q=jQuery.data(elem,type+"queue",jQuery.makeArray(array))}}return q};jQuery.fn.dequeue=function(type){type=type||"fx";return this.each(function(){var q=queue(this,type);q.shift();if(q.length){q[0].call(this)}})};jQuery.extend({speed:function(speed,easing,fn){var opt=speed&&speed.constructor==Object?speed:{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&easing.constructor!=Function&&easing};opt.duration=(opt.duration&&opt.duration.constructor==Number?opt.duration:jQuery.fx.speeds[opt.duration])||jQuery.fx.speeds.def;opt.old=opt.complete;opt.complete=function(){if(opt.queue!==false){jQuery(this).dequeue()}if(jQuery.isFunction(opt.old)){opt.old.call(this)}};return opt},easing:{linear:function(p,n,firstNum,diff){return firstNum+diff*p},swing:function(p,n,firstNum,diff){return((-Math.cos(p*Math.PI)/2)+0.5)*diff+firstNum}},timers:[],timerId:null,fx:function(elem,options,prop){this.options=options;this.elem=elem;this.prop=prop;if(!options.orig){options.orig={}}}});jQuery.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(jQuery.fx.step[this.prop]||jQuery.fx.step._default)(this);if(this.prop=="height"||this.prop=="width"){this.elem.style.display="block"}},cur:function(force){if(this.elem[this.prop]!=null&&this.elem.style[this.prop]==null){return this.elem[this.prop]}var r=parseFloat(jQuery.css(this.elem,this.prop,force));return r&&r>-10000?r:parseFloat(jQuery.curCSS(this.elem,this.prop))||0},custom:function(from,to,unit){this.startTime=now();this.start=from;this.end=to;this.unit=unit||this.unit||"px";this.now=this.start;this.pos=this.state=0;this.update();var self=this;function t(gotoEnd){return self.step(gotoEnd)}t.elem=this.elem;jQuery.timers.push(t);if(jQuery.timerId==null){jQuery.timerId=setInterval(function(){var timers=jQuery.timers;for(var i=0;i<timers.length;i++){if(!timers[i]()){timers.splice(i--,1)}}if(!timers.length){clearInterval(jQuery.timerId);jQuery.timerId=null}},13)}},show:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.show=true;this.custom(0,this.cur());if(this.prop=="width"||this.prop=="height"){this.elem.style[this.prop]="1px"}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){this.elem.style.display="none"}if(this.options.hide||this.options.show){for(var p in this.options.curAnim){jQuery.attr(this.elem.style,p,this.options.orig[p])}}}if(done){this.options.complete.call(this.elem)}return false}else{var n=t-this.startTime;this.state=n/this.options.duration;this.pos=jQuery.easing[this.options.easing||(jQuery.easing.swing?"swing":"linear")](this.state,n,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};jQuery.extend(jQuery.fx,{speeds:{slow:600,fast:200,def:400},step:{scrollLeft:function(fx){fx.elem.scrollLeft=fx.now},scrollTop:function(fx){fx.elem.scrollTop=fx.now},opacity:function(fx){jQuery.attr(fx.elem.style,"opacity",fx.now)},_default:function(fx){fx.elem.style[fx.prop]=fx.now+fx.unit}}});jQuery.fn.offset=function(){var left=0,top=0,elem=this[0],results;if(elem){with(jQuery.browser){var parent=elem.parentNode,offsetChild=elem,offsetParent=elem.offsetParent,doc=elem.ownerDocument,safari2=safari&&parseInt(version)<522&&!/adobeair/i.test(userAgent),css=jQuery.curCSS,fixed=css(elem,"position")=="fixed";if(elem.getBoundingClientRect){var box=elem.getBoundingClientRect();add(box.left+Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),box.top+Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));add(-doc.documentElement.clientLeft,-doc.documentElement.clientTop)}else{add(elem.offsetLeft,elem.offsetTop);while(offsetParent){add(offsetParent.offsetLeft,offsetParent.offsetTop);if(mozilla&&!/^t(able|d|h)$/i.test(offsetParent.tagName)||safari&&!safari2){border(offsetParent)}if(!fixed&&css(offsetParent,"position")=="fixed"){fixed=true}offsetChild=/^body$/i.test(offsetParent.tagName)?offsetChild:offsetParent;offsetParent=offsetParent.offsetParent}while(parent&&parent.tagName&&!/^body|html$/i.test(parent.tagName)){if(!/^inline|table.*$/i.test(css(parent,"display"))){add(-parent.scrollLeft,-parent.scrollTop)}if(mozilla&&css(parent,"overflow")!="visible"){border(parent)}parent=parent.parentNode}if((safari2&&(fixed||css(offsetChild,"position")=="absolute"))||(mozilla&&css(offsetChild,"position")!="absolute")){add(-doc.body.offsetLeft,-doc.body.offsetTop)}if(fixed){add(Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),Math.max(doc.documentElement.scrollTop,doc.body.scrollTop))}}results={top:top,left:left}}}function border(elem){add(jQuery.curCSS(elem,"borderLeftWidth",true),jQuery.curCSS(elem,"borderTopWidth",true))}function add(l,t){left+=parseInt(l,10)||0;top+=parseInt(t,10)||0}return results};jQuery.fn.extend({position:function(){var left=0,top=0,results;if(this[0]){var offsetParent=this.offsetParent(),offset=this.offset(),parentOffset=/^body|html$/i.test(offsetParent[0].tagName)?{top:0,left:0}:offsetParent.offset();offset.top-=num(this,"marginTop");offset.left-=num(this,"marginLeft");parentOffset.top+=num(offsetParent,"borderTopWidth");parentOffset.left+=num(offsetParent,"borderLeftWidth");results={top:offset.top-parentOffset.top,left:offset.left-parentOffset.left}}return results},offsetParent:function(){var offsetParent=this[0].offsetParent;while(offsetParent&&(!/^body|html$/i.test(offsetParent.tagName)&&jQuery.css(offsetParent,"position")=="static")){offsetParent=offsetParent.offsetParent}return jQuery(offsetParent)}});jQuery.each(["Left","Top"],function(i,name){var method="scroll"+name;jQuery.fn[method]=function(val){if(!this[0]){return }return val!=undefined?this.each(function(){this==window||this==document?window.scrollTo(!i?val:jQuery(window).scrollLeft(),i?val:jQuery(window).scrollTop()):this[method]=val}):this[0]==window||this[0]==document?self[i?"pageYOffset":"pageXOffset"]||jQuery.boxModel&&document.documentElement[method]||document.body[method]:this[0][method]}});jQuery.each(["Height","Width"],function(i,name){var tl=i?"Left":"Top",br=i?"Right":"Bottom";jQuery.fn["inner"+name]=function(){return this[name.toLowerCase()]()+num(this,"padding"+tl)+num(this,"padding"+br)};jQuery.fn["outer"+name]=function(margin){return this["inner"+name]()+num(this,"border"+tl+"Width")+num(this,"border"+br+"Width")+(margin?num(this,"margin"+tl)+num(this,"margin"+br):0)}})})();jQuery.extend({createUploadIframe:function(D,B){var A="jUploadFrame"+D;if(window.ActiveXObject){var C=document.createElement('<iframe id="'+A+'" name="'+A+'" />');if(typeof B=="boolean"){C.src="javascript:false"}else{if(typeof B=="string"){C.src=B}}}else{var C=document.createElement("iframe");C.id=A;C.name=A}C.style.position="absolute";C.style.top="-1000px";C.style.left="-1000px";document.body.appendChild(C);return C},createUploadForm:function(G,B){var E="jUploadForm"+G;var A="jUploadFile"+G;var D=$('<form  action="" method="POST" name="'+E+'" id="'+E+'" encoding="multipart/form-data" enctype="multipart/form-data"></form>');var C=$("#"+B);var F=$(C).clone();$(C).attr("id",A);$(C).before(F);$(C).appendTo(D);$(D).css("position","absolute");$(D).css("top","-1200px");$(D).css("left","-1200px");$(D).appendTo("body");return D},ajaxFileUpload:function(J){J=jQuery.extend({},jQuery.ajaxSettings,J);var A=new Date().getTime();var B=jQuery.createUploadForm(A,J.fileElementId);var H=jQuery.createUploadIframe(A,J.secureuri);var G="jUploadFrame"+A;var I="jUploadForm"+A;if(J.global&&!jQuery.active++){jQuery.event.trigger("ajaxStart")}var C=false;var E={};if(J.global){jQuery.event.trigger("ajaxSend",[E,J])}var D=function(K){var O=document.getElementById(G);try{if(O.contentWindow){E.responseText=O.contentWindow.document.body?O.contentWindow.document.body.innerHTML:null;E.responseXML=O.contentWindow.document.XMLDocument?O.contentWindow.document.XMLDocument:O.contentWindow.document}else{if(O.contentDocument){E.responseText=O.contentDocument.document.body?O.contentDocument.document.body.innerHTML:null;E.responseXML=O.contentDocument.document.XMLDocument?O.contentDocument.document.XMLDocument:O.contentDocument.document}}}catch(N){jQuery.handleError(J,E,null,N)}if(E||K=="timeout"){C=true;var L;try{L=K!="timeout"?"success":"error";if(L!="error"){var M=jQuery.uploadHttpData(E,J.dataType);if(J.success){J.success(M,L)}if(J.global){jQuery.event.trigger("ajaxSuccess",[E,J])}}else{jQuery.handleError(J,E,L)}}catch(N){L="error";jQuery.handleError(J,E,L,N)}if(J.global){jQuery.event.trigger("ajaxComplete",[E,J])}if(J.global&&!--jQuery.active){jQuery.event.trigger("ajaxStop")}if(J.complete){J.complete(E,L)}jQuery(O).unbind();setTimeout(function(){try{$(O).remove();$(B).remove()}catch(P){jQuery.handleError(J,E,null,P)}},100);E=null}};if(J.timeout>0){setTimeout(function(){if(!C){D("timeout")}},J.timeout)}try{var B=$("#"+I);$(B).attr("action",J.url);$(B).attr("method","POST");$(B).attr("target",G);if(B.encoding){B.encoding="multipart/form-data"}else{B.enctype="multipart/form-data"}$(B).submit()}catch(F){jQuery.handleError(J,E,null,F)}if(window.attachEvent){document.getElementById(G).attachEvent("onload",D)}else{document.getElementById(G).addEventListener("load",D,false)}return{abort:function(){}}},uploadHttpData:function(r,type){var data=!type;data=type=="xml"||data?r.responseXML:r.responseText;if(type=="script"){jQuery.globalEval(data)}if(type=="json"){eval("data = "+data)}if(type=="html"){jQuery("<div>").html(data).evalScripts()}return data}});(function(F){if(/1\.(0|1|2)\.(0|1|2)/.test(F.fn.jquery)||/^1.1/.test(F.fn.jquery)){alert("blockUI requires jQuery v1.2.3 or later!  You are using v"+F.fn.jquery);return }F.blockUI=function(M){C(window,M)};F.unblockUI=function(M){G(window,M)};F.fn.block=function(M){return this.each(function(){if(F.css(this,"position")=="static"){this.style.position="relative"}if(F.browser.msie){this.style.zoom=1}C(this,M)})};F.fn.unblock=function(M){return this.each(function(){G(this,M)})};F.blockUI.version=2.08;F.blockUI.defaults={message:"<h1>Please wait...</h1>",css:{padding:0,margin:0,width:"30%",top:"40%",left:"35%",textAlign:"center",color:"#000",border:"3px solid #aaa",backgroundColor:"#fff",cursor:"wait"},overlayCSS:{backgroundColor:"#000",opacity:"0.6"},baseZ:1000,centerX:true,centerY:true,allowBodyStretch:true,constrainTabKey:true,fadeOut:400,focusInput:true,applyPlatformOpacityRules:true,onUnblock:null};var D=F.browser.msie&&/MSIE 6.0/.test(navigator.userAgent);var B=null;var E=[];function C(O,M){var X=(O==window);var P=M&&M.message!==undefined?M.message:undefined;M=F.extend({},F.blockUI.defaults,M||{});M.overlayCSS=F.extend({},F.blockUI.defaults.overlayCSS,M.overlayCSS||{});var W=F.extend({},F.blockUI.defaults.css,M.css||{});P=P===undefined?M.message:P;if(X&&B){G(window,{fadeOut:0})}if(P&&typeof P!="string"&&(P.parentNode||P.jquery)){var R=P.jquery?P[0]:P;var V={};F(O).data("blockUI.history",V);V.el=R;V.parent=R.parentNode;V.display=R.style.display;V.position=R.style.position;V.parent.removeChild(R)}var Y=M.baseZ;var U=(F.browser.msie)?F('<iframe class="blockUI" style="z-index:'+Y+++';border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="javascript:false;"></iframe>'):F('<div class="blockUI" style="display:none"></div>');var T=F('<div class="blockUI" style="z-index:'+Y+++';cursor:default;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>');var Q=X?F('<div class="blockUI blockMsg blockPage" style="z-index:'+Y+';position:fixed"></div>'):F('<div class="blockUI blockMsg blockElement" style="z-index:'+Y+';display:none;position:absolute"></div>');if(P){Q.css(W)}if(!M.applyPlatformOpacityRules||!(F.browser.mozilla&&/Linux/.test(navigator.platform))){T.css(M.overlayCSS)}T.css("position",X?"fixed":"absolute");if(F.browser.msie){U.css("opacity","0.0")}F([U[0],T[0],Q[0]]).appendTo(X?"body":O);var a=F.browser.msie&&(!F.boxModel||F("object,embed",X?null:O).length>0);if(D||a){if(X&&M.allowBodyStretch&&F.boxModel){F("html,body").css("height","100%")}if((D||!F.boxModel)&&!X){var b=J(O,"borderTopWidth"),S=J(O,"borderLeftWidth");var Z=b?"(0 - "+b+")":0;var N=S?"(0 - "+S+")":0}F.each([U,T,Q],function(c,e){var d=e[0].style;d.position="absolute";if(c<2){X?d.setExpression("height",'document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + "px"'):d.setExpression("height",'this.parentNode.offsetHeight + "px"');X?d.setExpression("width",'jQuery.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"'):d.setExpression("width",'this.parentNode.offsetWidth + "px"');if(N){d.setExpression("left",N)}if(Z){d.setExpression("top",Z)}}else{if(M.centerY){if(X){d.setExpression("top",'(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"')}d.marginTop=0}}})}Q.append(P).show();if(P&&(P.jquery||P.nodeType)){F(P).show()}I(1,O,M);if(X){B=Q[0];E=F(":input:enabled:visible",B);if(M.focusInput){setTimeout(L,20)}}else{A(Q[0],M.centerX,M.centerY)}}function G(O,P){var N=O==window;var Q=F(O).data("blockUI.history");P=F.extend({},F.blockUI.defaults,P||{});I(0,O,P);var M=N?F("body").children().filter(".blockUI"):F(".blockUI",O);if(N){B=E=null}if(P.fadeOut){M.fadeOut(P.fadeOut);setTimeout(function(){H(M,Q,P,O)},P.fadeOut)}else{H(M,Q,P,O)}}function H(M,P,O,N){M.each(function(Q,R){if(this.parentNode){this.parentNode.removeChild(this)}});if(P&&P.el){P.el.style.display=P.display;P.el.style.position=P.position;P.parent.appendChild(P.el);F(P.el).removeData("blockUI.history")}if(typeof O.onUnblock=="function"){O.onUnblock(N,O)}}function I(M,Q,R){var P=Q==window,O=F(Q);if(!M&&(P&&!B||!P&&!O.data("blockUI.isBlocked"))){return }if(!P){O.data("blockUI.isBlocked",M)}var N="mousedown mouseup keydown keypress click";M?F(document).bind(N,R,K):F(document).unbind(N,K)}function K(P){if(P.keyCode&&P.keyCode==9){if(B&&P.data.constrainTabKey){var O=E;var N=!P.shiftKey&&P.target==O[O.length-1];var M=P.shiftKey&&P.target==O[0];if(N||M){setTimeout(function(){L(M)},10);return false}}}if(F(P.target).parents("div.blockMsg").length>0){return true}return F(P.target).parents().children().filter("div.blockUI").length==0}function L(M){if(!E){return }var N=E[M===true?E.length-1:0];if(N){N.focus()}}function A(Q,M,S){var R=Q.parentNode,P=Q.style;var N=((R.offsetWidth-Q.offsetWidth)/2)-J(R,"borderLeftWidth");var O=((R.offsetHeight-Q.offsetHeight)/2)-J(R,"borderTopWidth");if(M){P.left=N>0?(N+"px"):"0"}if(S){P.top=O>0?(O+"px"):"0"}}function J(M,N){return parseInt(F.css(M,N))||0}})(jQuery);jQuery.extend(jQuery.fn,{validate:function(A){if(!this.length){A&&A.debug&&window.console&&console.warn("nothing selected, can't validate, returning nothing");return }var B=jQuery.data(this[0],"validator");if(B){return B}B=new jQuery.validator(A,this[0]);jQuery.data(this[0],"validator",B);if(B.settings.onsubmit){this.find("input.cancel:submit").click(function(){B.cancelSubmit=true});this.submit(function(C){if(B.settings.debug){C.preventDefault()}function D(){if(B.settings.submitHandler){B.settings.submitHandler.call(B,B.currentForm);return false}return true}if(B.cancelSubmit){B.cancelSubmit=false;return D()}if(B.form()){if(B.pendingRequest){B.formSubmitted=true;return false}return D()}else{B.focusInvalid();return false}})}return B},valid:function(){if(jQuery(this[0]).is("form")){return this.validate().form()}else{var B=true;var A=jQuery(this[0].form).validate();this.each(function(){B=A.element(this)&&B});return B}},rules:function(){var A=this[0];var B=jQuery.validator.normalizeRules(jQuery.extend({},jQuery.validator.metadataRules(A),jQuery.validator.classRules(A),jQuery.validator.attributeRules(A),jQuery.validator.staticRules(A)),A);var C=[];if(B.required){C.push({method:"required",parameters:B.required});delete B.required}jQuery.each(B,function(E,D){C.push({method:E,parameters:D})});return C},push:function(A){return this.setArray(this.add(A).get())}});jQuery.extend(jQuery.expr[":"],{blank:"!jQuery.trim(a.value)",filled:"!!jQuery.trim(a.value)",unchecked:"!a.checked"});jQuery.format=function(A,B){if(arguments.length==1){return function(){var C=jQuery.makeArray(arguments);C.unshift(A);return jQuery.format.apply(this,C)}}if(arguments.length>2&&B.constructor!=Array){B=jQuery.makeArray(arguments).slice(1)}if(B.constructor!=Array){B=[B]}jQuery.each(B,function(C,D){A=A.replace(new RegExp("\\{"+C+"\\}","g"),D)});return A};jQuery.validator=function(A,B){this.settings=jQuery.extend({},jQuery.validator.defaults,A);this.currentForm=B;this.init()};jQuery.extend(jQuery.validator,{defaults:{messages:{},errorClass:"error",errorElement:"label",focusInvalid:true,errorContainer:jQuery([]),errorLabelContainer:jQuery([]),onsubmit:true,ignore:[],onfocusin:function(A){this.lastActive=A;if(this.settings.focusCleanup&&!this.blockFocusCleanup){this.settings.unhighlight&&this.settings.unhighlight.call(this,A,this.settings.errorClass);this.errorsFor(A).hide()}},onfocusout:function(A){if(!this.checkable(A)&&(A.name in this.submitted||!this.optional(A))){this.element(A)}},onkeyup:function(A){if(A.name in this.submitted||A==this.lastElement){this.element(A)}},onclick:function(A){if(A.name in this.submitted){this.element(A)}},highlight:function(B,A){jQuery(B).addClass(A)},unhighlight:function(B,A){jQuery(B).removeClass(A)}},setDefaults:function(A){jQuery.extend(jQuery.validator.defaults,A)},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.",equalTo:"Please enter the same value again.",accept:"Please enter a value with a valid extension.",maxlength:jQuery.format("Please enter no more than {0} characters."),maxLength:jQuery.format("Please enter no more than {0} characters."),minlength:jQuery.format("Please enter at least {0} characters."),minLength:jQuery.format("Please enter at least {0} characters."),rangelength:jQuery.format("Please enter a value between {0} and {1} characters long."),rangeLength:jQuery.format("Please enter a value between {0} and {1} characters long."),rangeValue:jQuery.format("Please enter a value between {0} and {1}."),range:jQuery.format("Please enter a value between {0} and {1}."),maxValue:jQuery.format("Please enter a value less than or equal to {0}."),max:jQuery.format("Please enter a value less than or equal to {0}."),minValue:jQuery.format("Please enter a value greater than or equal to {0}."),min:jQuery.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:false,prototype:{init:function(){this.labelContainer=jQuery(this.settings.errorLabelContainer);this.errorContext=this.labelContainer.length&&this.labelContainer||jQuery(this.currentForm);this.containers=jQuery(this.settings.errorContainer).add(this.settings.errorLabelContainer);this.submitted={};this.valueCache={};this.pendingRequest=0;this.pending={};this.invalid={};this.reset();function A(C){var B=jQuery.data(this[0].form,"validator");B.settings["on"+C.type]&&B.settings["on"+C.type].call(B,this[0])}jQuery(this.currentForm).delegate("focusin focusout keyup",":text, :password, :file, select, textarea",A).delegate("click",":radio, :checkbox",A)},form:function(){this.prepareForm();var B=this.elements();for(var A=0;B[A];A++){this.check(B[A])}jQuery.extend(this.submitted,this.errorMap);this.invalid=jQuery.extend({},this.errorMap);jQuery(this.currentForm).triggerHandler("invalid-form.validate",[this]);this.showErrors();return this.valid()},element:function(B){B=this.clean(B);this.lastElement=B;this.prepareElement(B);var A=this.check(B);if(A){delete this.invalid[B.name]}else{this.invalid[B.name]=true}if(!this.numberOfInvalids()){this.toHide.push(this.containers)}this.showErrors();return A},showErrors:function(B){if(B){jQuery.extend(this.errorMap,B);this.errorList=[];for(var A in B){this.errorList.push({message:B[A],element:this.findByName(A)[0]})}this.successList=jQuery.grep(this.successList,function(C){return !(C.name in B)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){if(jQuery.fn.resetForm){jQuery(this.currentForm).resetForm()}this.prepareForm();this.hideErrors();this.elements().removeClass(this.settings.errorClass)},numberOfInvalids:function(){var B=0;for(var A in this.invalid){B++}return B},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{jQuery(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus()}catch(A){}}},findLastActive:function(){var A=this.lastActive;return A&&jQuery.grep(this.errorList,function(B){return B.element.name==A.name}).length==1&&A},elements:function(){var B=this;var A={};return jQuery([]).add(this.currentForm.elements).filter("input, select, textarea").not(":submit, :reset, [disabled]").not(this.settings.ignore).filter(function(){!this.name&&B.settings.debug&&window.console&&console.error("%o has no name assigned",this);if(this.name in A||!jQuery(this).rules().length){return false}A[this.name]=true;return true})},clean:function(A){return jQuery(A)[0]},errors:function(){return jQuery(this.settings.errorElement+"."+this.settings.errorClass,this.errorContext)},reset:function(){this.successList=[];this.errorList=[];this.errorMap={};this.toShow=jQuery([]);this.toHide=jQuery([]);this.formSubmitted=false},prepareForm:function(){this.reset();this.toHide=this.errors().push(this.containers)},prepareElement:function(A){this.reset();this.toHide=this.errorsFor(this.clean(A))},check:function(C){C=this.clean(C);this.settings.unhighlight&&this.settings.unhighlight.call(this,C,this.settings.errorClass);var F=jQuery(C).rules();for(var B=0;F[B];B++){var E=F[B];try{var A=jQuery.validator.methods[E.method].call(this,jQuery.trim(C.value),C,E.parameters);if(A=="dependency-mismatch"){return }if(A=="pending"){this.toHide=this.toHide.not(this.errorsFor(C));return }if(!A){this.formatAndAdd(C,E);return false}}catch(D){this.settings.debug&&window.console&&console.warn("exception occured when checking element "+C.id+", check the '"+E.method+"' method");throw D}}if(F.length){this.successList.push(C)}return true},customMessage:function(B,C){var A=this.settings.messages[B];return A&&(A.constructor==String?A:A[C])},findDefined:function(){for(var A=0;A<arguments.length;A++){if(arguments[A]!==undefined){return arguments[A]}}return undefined},defaultMessage:function(A,B){return this.findDefined(this.customMessage(A.name,B),A.title||undefined,jQuery.validator.messages[B],"<strong>Warning: No message defined for "+A.name+"</strong>")},formatAndAdd:function(A,C){var B=this.defaultMessage(A,C.method);if(typeof B=="function"){B=B.call(this,C.parameters,A)}this.errorList.push({message:B,element:A});this.errorMap[A.name]=B;this.submitted[A.name]=B},addWrapper:function(A){if(this.settings.wrapper){A.push(A.parents(this.settings.wrapper))}return A},defaultShowErrors:function(){for(var B=0;this.errorList[B];B++){var A=this.errorList[B];this.settings.highlight&&this.settings.highlight.call(this,A.element,this.settings.errorClass);this.showLabel(A.element,A.message)}if(this.errorList.length){this.toShow.push(this.containers)}if(this.settings.success){for(var B=0;this.successList[B];B++){this.showLabel(this.successList[B])}}this.toHide=this.toHide.not(this.toShow);this.hideErrors();this.addWrapper(this.toShow).show()},showLabel:function(B,C){var A=this.errorsFor(B);if(A.length){A.removeClass().addClass(this.settings.errorClass);A.attr("generated")&&A.html(C)}else{A=jQuery("<"+this.settings.errorElement+"/>").attr({"for":this.idOrName(B),generated:true}).addClass(this.settings.errorClass).html(C||"");if(this.settings.wrapper){A=A.hide().show().wrap("<"+this.settings.wrapper+">").parent()}if(!this.labelContainer.append(A).length){this.settings.errorPlacement?this.settings.errorPlacement(A,jQuery(B)):A.insertAfter(B)}}if(!C&&this.settings.success){A.text("");typeof this.settings.success=="string"?A.addClass(this.settings.success):this.settings.success(A)}this.toShow.push(A)},errorsFor:function(A){return this.errors().filter("[@for='"+this.idOrName(A)+"']")},idOrName:function(A){return this.checkable(A)?A.name:A.id||A.name},rules:function(A){return jQuery(A).rules()},checkable:function(A){return/radio|checkbox/i.test(A.type)},findByName:function(A){var B=this.currentForm;return jQuery(document.getElementsByName(A)).map(function(C,D){return D.form==B&&D||null})},getLength:function(B,A){switch(A.nodeName.toLowerCase()){case"select":return jQuery("option:selected",A).length;case"input":if(this.checkable(A)){return this.findByName(A.name).filter(":checked").length}}return B.length},depend:function(B,A){return this.dependTypes[typeof B]?this.dependTypes[typeof B](B,A):true},dependTypes:{"boolean":function(B,A){return B},string:function(B,A){return !!jQuery(B,A.form).length},"function":function(B,A){return B(A)}},optional:function(A){return !jQuery.validator.methods.required.call(this,jQuery.trim(A.value),A)&&"dependency-mismatch"},startRequest:function(A){if(!this.pending[A.name]){this.pendingRequest++;this.pending[A.name]=true}},stopRequest:function(A,B){this.pendingRequest--;if(this.pendingRequest<0){this.pendingRequest=0}delete this.pending[A.name];if(B&&this.pendingRequest==0&&this.formSubmitted&&this.form()){jQuery(this.currentForm).submit()}},previousValue:function(A){return jQuery.data(A,"previousValue")||jQuery.data(A,"previousValue",previous={old:null,valid:true,message:this.defaultMessage(A,"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(A,B){A.constructor==String?this.classRuleSettings[A]=B:jQuery.extend(this.classRuleSettings,A)},classRules:function(B){var C={};var A=jQuery(B).attr("class");A&&jQuery.each(A.split(" "),function(){if(this in jQuery.validator.classRuleSettings){jQuery.extend(C,jQuery.validator.classRuleSettings[this])}});return C},attributeRules:function(B){var D={};var A=jQuery(B);for(method in jQuery.validator.methods){var C=A.attr(method);if(C!==undefined&&C!==""){D[method]=C}}if(D.maxlength&&/-1|2147483647|524288/.test(D.maxlength)){delete D.maxlength;delete D.maxLength}return D},metadataRules:function(A){if(!jQuery.metadata){return{}}var B=jQuery.data(A.form,"validator").settings.meta;return B?jQuery(A).metadata()[B]:jQuery(A).metadata()},staticRules:function(B){var C={};var A=jQuery.data(B.form,"validator");if(A.settings.rules){C=jQuery.validator.normalizeRule(A.settings.rules[B.name])||{}}return C},normalizeRules:function(B,A){jQuery.each({minLength:"minlength",maxLength:"maxlength",rangeLength:"rangelength",minValue:"min",maxValue:"max",rangeValue:"range"},function(D,C){if(B[D]){B[C]=B[D];delete B[D]}});jQuery.each(B,function(C,D){B[C]=jQuery.isFunction(D)?D(A):D});jQuery.each(["minlength","maxlength","min","max"],function(){if(B[this]){B[this]=Number(B[this])}});jQuery.each(["rangelength","range"],function(){if(B[this]){B[this]=[Number(B[this][0]),Number(B[this][1])]}});if(jQuery.validator.autoCreateRanges){if(B.min&&B.max){B.range=[B.min,B.max];delete B.min;delete B.max}if(B.minlength&&B.maxlength){B.rangelength=[B.minlength,B.maxlength];delete B.minlength;delete B.maxlength}}return B},normalizeRule:function(B){if(typeof B=="string"){var A={};A[B]=true;B=A}return B},addMethod:function(A,C,B){jQuery.validator.methods[A]=C;jQuery.validator.messages[A]=B;if(C.length<3){jQuery.validator.addClassRules(A,jQuery.validator.normalizeRule(A))}},methods:{required:function(C,B,D){if(!this.depend(D,B)){return"dependency-mismatch"}switch(B.nodeName.toLowerCase()){case"select":var A=jQuery("option:selected",B);return A.length>0&&(B.type=="select-multiple"||(jQuery.browser.msie&&!(A[0].attributes.value.specified)?A[0].text:A[0].value).length>0);case"input":if(this.checkable(B)){return this.getLength(C,B)>0}default:return C.length>0}},remote:function(E,B,F){if(this.optional(B)){return"dependency-mismatch"}var C=this.previousValue(B);if(!this.settings.messages[B.name]){this.settings.messages[B.name]={}}this.settings.messages[B.name].remote=typeof C.message=="function"?C.message(E):C.message;if(C.old!==E){C.old=E;var A=this;this.startRequest(B);var D={};D[B.name]=E;jQuery.ajax({url:F,mode:"abort",port:"validate"+B.name,dataType:"json",data:D,success:function(H){if(!H){var I={};I[B.name]=H||A.defaultMessage(B,"remote");A.showErrors(I)}else{var G=A.formSubmitted;A.prepareElement(B);A.formSubmitted=G;A.successList.push(B);A.showErrors()}C.valid=H;A.stopRequest(B,H)}});return"pending"}else{if(this.pending[B.name]){return"pending"}}return C.valid},minlength:function(B,A,C){return this.optional(A)||this.getLength(B,A)>=C},minLength:function(B,A,C){return jQuery.validator.methods.minlength.apply(this,arguments)},maxlength:function(B,A,C){return this.optional(A)||this.getLength(B,A)<=C},maxLength:function(B,A,C){return jQuery.validator.methods.maxlength.apply(this,arguments)},rangelength:function(C,A,D){var B=this.getLength(C,A);return this.optional(A)||(B>=D[0]&&B<=D[1])},rangeLength:function(B,A,C){return jQuery.validator.methods.rangelength.apply(this,arguments)},min:function(B,A,C){return this.optional(A)||B>=C},minValue:function(){return jQuery.validator.methods.min.apply(this,arguments)},max:function(B,A,C){return this.optional(A)||B<=C},maxValue:function(){return jQuery.validator.methods.max.apply(this,arguments)},range:function(B,A,C){return this.optional(A)||(B>=C[0]&&B<=C[1])},rangeValue:function(){return jQuery.validator.methods.range.apply(this,arguments)},email:function(B,A){return this.optional(A)||/^((([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(B)},url:function(B,A){return this.optional(A)||/^(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(B)},date:function(B,A){return this.optional(A)||!/Invalid|NaN/.test(new Date(B))},dateISO:function(B,A){return this.optional(A)||/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(B)},dateDE:function(B,A){return this.optional(A)||/^\d\d?\.\d\d?\.\d\d\d?\d?$/.test(B)},number:function(B,A){return this.optional(A)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(B)},numberDE:function(B,A){return this.optional(A)||/^-?(?:\d+|\d{1,3}(?:\.\d{3})+)(?:,\d+)?$/.test(B)},digits:function(B,A){return this.optional(A)||/^\d+$/.test(B)},creditcard:function(E,B){if(this.optional(B)){return"dependency-mismatch"}var F=0,D=0,A=false;E=E.replace(/\D/g,"");for(n=E.length-1;n>=0;n--){var C=E.charAt(n);var D=parseInt(C,10);if(A){if((D*=2)>9){D-=9}}F+=D;A=!A}return(F%10)==0},accept:function(B,A,C){C=typeof C=="string"?C:"png|jpe?g|gif";return this.optional(A)||B.match(new RegExp(".("+C+")$","i"))},equalTo:function(B,A,C){return B==jQuery(C).val()}}});(function(C){var B=C.ajax;var A={};C.ajax=function(E){E=jQuery.extend(E,jQuery.extend({},jQuery.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.extend(A.event.special,{focusin:{setup:function(){if(A.browser.msie){return false}this.addEventListener("focus",A.event.special.focusin.handler,true)},teardown:function(){if(A.browser.msie){return false}this.removeEventListener("focus",A.event.special.focusin.handler,true)},handler:function(C){var B=Array.prototype.slice.call(arguments,1);B.unshift(A.extend(A.event.fix(C),{type:"focusin"}));return A.event.handle.apply(this,B)}},focusout:{setup:function(){if(A.browser.msie){return false}this.addEventListener("blur",A.event.special.focusout.handler,true)},teardown:function(){if(A.browser.msie){return false}this.removeEventListener("blur",A.event.special.focusout.handler,true)},handler:function(C){var B=Array.prototype.slice.call(arguments,1);B.unshift(A.extend(A.event.fix(C),{type:"focusout"}));return A.event.handle.apply(this,B)}}});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,[jQuery.event.fix({type:B,target:C})])}})})(jQuery);(function(A){A.fn.charCounter=function(B,C){B=B||100;C=A.extend({container:"<span></span>",classname:"charcounter",format:"(%1 characters remaining)",pulse:true,delay:0},C);var G,F;function E(I,H){I=A(I);if(I.val().length>B){I.val(I.val().substring(0,B));if(C.pulse&&!G){D(H,true)}}if(C.delay>0){if(F){window.clearTimeout(F)}F=window.setTimeout(function(){H.html(C.format.replace(/%1/,(B-I.val().length)))},C.delay)}else{H.html(C.format.replace(/%1/,(B-I.val().length)))}}function D(H,I){if(G){window.clearTimeout(G);G=null}H.animate({opacity:0.1},100,function(){A(this).animate({opacity:1},100)});if(I){G=window.setTimeout(function(){D(H)},200)}}return this.each(function(){var H=(!C.container.match(/^<.+>$/))?A(C.container):A(C.container).insertAfter(this).addClass(C.classname);A(this).bind("keydown",function(){E(this,H)}).bind("keypress",function(){E(this,H)}).bind("keyup",function(){E(this,H)}).bind("focus",function(){E(this,H)}).bind("mouseover",function(){E(this,H)}).bind("mouseout",function(){E(this,H)}).bind("paste",function(){var I=this;setTimeout(function(){E(I,H)},10)});if(this.addEventListener){this.addEventListener("input",function(){E(this,H)},false)}E(this,H)})}})(jQuery);if(!window.loc){var loc={}}if(loc.DEBUG===undefined){loc.DEBUG=false}loc.console={debug:loc.DEBUG&&$.browser.firefox&&window.console&&console.debug?console.debug:function(){}};loc.mail=function(){var B="mail";var A=":";window.location=B+"to"+A+" "+loc.cfg.mail.user+"@"+loc.cfg.mail.subdomain+"."+loc.cfg.mail.domain};loc.frame={minlat:9999,minlng:9999,maxlat:-9999,maxlng:-9999,zoom:9999,mode:9999,set:function(C,B,F,D,A,E){this.minlat=C;this.minlng=B;this.maxlat=F;this.maxlng=D;this.zoom=A;this.mode=E},isOutside:function(C,B,F,D,A,E){if(B<this.minlng||C<this.minlat||F>this.maxlat||D>this.maxlng||A!=this.zoom||E!=this.mode){return true}return false}};loc.scroller={loadNext:function(B,A){if(A.content){if(!A.content.isLoading&&!(A.content.commentsCount==A.content.comments.length)){if(B.scrollTop()+80>B.attr("scrollHeight")-B.height()){A.content.getComments();A.content.showCommentLoader()}}}},setOnBottom:function(A){if(A!==null){A.animate({scrollTop:300},1000)}}};loc.notices={notices:[],add:function(A){notices.push(A)},removeAll:function(){this.notices=[]}};var NoGoogleMaps=function(){};loc.cfg={host:"http://www.locatik.com",imgDir:"/img/",version:"1.1.15"};loc.cfg.message={maxLength:100};loc.cfg.path={cmd:"/~xhr/"};loc.cfg.mail={user:"locatik",subdomain:"psiloc",domain:"com"};loc.cfg.map={drawZeroRange:true,zeroRadius:0.01,nowSpan:2*60,markerText:"<span class='contentLogin'>{0} </span> <span style='color:#FFFFFF'>|</span> <span class='contentTime'> {1}</span>",markerHeight:75,zoomUnit:0.1};loc.cfg.thumbnail={unclickable:["res/imgP0_0_0","res/imgA99999999_0_0"],singleOpen:"_64x64S",singleOpen_Width:"64px",singleOpen_Height:"64px",singleClose:"_40x40S",singleClose_Width:"40px",singleClose_Height:"40px",getLink:function(C,A){var B={};switch(A){case"singleOpen":B.src=C+loc.cfg.thumbnail.singleOpen;break;case"singleClose":B.src=C+loc.cfg.thumbnail.singleClose;break}if($(loc.cfg.thumbnail.unclickable).index(C)!=-1){B.clickable=true}else{B.clickable=false}return B}};loc.cfg.image={loader_photo:"http://www.locatik.com/static/1.1.15/image/load_f_white.gif"};loc.cfg.avatar={def:"res/imgA0_0_0",commentSize:"_34x34S",panelSize:"_64x64S",markerSize:"_64x64S",listSize:"_32x32S",multiSize:"_28x28S",getAvatarLink:function(A,B){var C="";switch(B){case"marker":C=A+loc.cfg.avatar.markerSize;break;case"list":C="/"+A+loc.cfg.avatar.listSize;break;case"multi":C="/"+A+loc.cfg.avatar.multiSize;break;case"comment":C=A+loc.cfg.avatar.commentSize;break;case"default":C=this.def+loc.cfg.avatar;break;default:console.deubg("eeeeeeeerrrrrrrrror type"+B)}return C}};loc.cfg.ui={animTime:400,changeMarkerTime:10000,reFrTime:5000,listRefTime:20000};loc.cfg.overlay={rangeDefault:{border:3,strokeColor:"#FFFFFF",strokeOpacity:0.5},minWidth:10,svgHide:(1<<15)-1,svgLow:1<<9,vmlLow:1<<9,vmlPrecision:20,svgNamespace:"http://www.w3.org/2000/svg"};loc.util={myDebug:function(A){},dayformat:function(B){var A="";switch(B){case 1:A="in "+B+" day";case 0:A="today";default:A="in "+B+" days"}return A},dumpObject:function(C){var A=0;for(var B in C){A++}},getSnippet:function(B,C){if(B.length>C){var A=loc.util.skipTags(B);if(A.length>C){return A.substr(0,C)+"..."}return B}else{return B}},skipTags:function(C){var B="";var A=0;for(var D=0;D<C.length;D++){if(C.charAt(D)=="<"){A=1}else{if(C.charAt(D)==">"){A=0}else{if(!A){B+=C.charAt(D)}}}}return B},getAgoString:function(D,F){if(D<loc.cfg.map.nowSpan){return loc.lang.time.now}var I=[24*3600,3600,60];var C=loc.lang.time.units;var H=[];var G="";var B=0;var E=1;for(var A=0;A<3&&B<E;++A){H[A]=Math.floor(D/I[A]);D-=H[A]*I[A];if(H[A]>0){if(B++>0){G+=loc.lang.time.glue}G+=H[A].toString()+" ";if(H[A]===1){G+=C[A][0]}else{G+=C[A][1]}}}return G+loc.lang.time.ago},formatString:function(B,A){return B.replace(/\{(\d)\}/g,function(F,E,D,C){if(E<A.length){return A[E]}else{return""}})},validatePhoneNo:function(B){var E="0123456789";var C="()- ";var A=C+"+";var D=20;if((B===null)||(B==="")){return false}if(!loc.util.checkInternationalPhone(B,A)){return false}return true},checkInternationalPhone:function(B,A){var C=loc.util.checkChars(B,A);return(!NaN(C)&&C.length>=length)},createDiv:function(A,B){var C=document.createElement("div");if(A&&A!=""){C.className=A}if(B&&B!=""){C.id=B}return C},checkChars:function(C,D){var B;var A="";for(B=0;B<C.length;B++){var E=C.charAt(B);if(D.indexOf(E)==-1){A+=E}}return A},getWindowSize:function(){var B=0,A=0;if(typeof window.innerWidth=="number"){B=window.innerWidth;A=window.innerHeight}else{if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){B=document.documentElement.clientWidth;A=document.documentElement.clientHeight}else{if(document.body&&(document.body.clientWidth||document.body.clientHeight)){B=document.body.clientWidth;A=document.body.clientHeight}}}return{width:B,height:A}},stopEventBubbling:function(A){if(!A){var A=window.event}A.cancelBubble=true;if(A.stopPropagation){A.stopPropagation()}},stopMapEvents:function(B,A){B=$(B);handler=this.stopEventBubbling;if(A==null||A==true){B.bind("mousewheel",handler);B.bind("DOMMouseScroll",handler)}B.bind("mousedown",handler);B.bind("dblclick",handler);B.bind("click",handler)}};loc.lang={TwitterLogged:"Logged as {0}",TwitterNotLogged:"Currently not logged",messageText:"Messages({0})",messageTextZero:"Messages",emptyInbox:"You have currently 0 messages",emptyMsg:"write a message...",waitingForMsgData:"waiting for data...",self:"Me",unavailable:"Has not updated yet",addfrd:"Add as friend",addfav:"Add as favourite",acceptfrd:"Accept",denyfrd:"Deny",remfav:"Remove From Favourites",remfrd:"Remove From Friends",requested:"Friend request pending",pending:"Accept as Firend?",denied:"declined your friend request",emptyNote:'<p>You currently have no friends or favorites. You can add your frineds here by running friends discovery on your phone, or by clicking the "Add as Friend" on the person\'s marker on the website.</p>',modalTitle:["Success","Failure","Notice"],message:{noContent:"The message is empty! Please write it"},success:{register:"Registration successful! Check your inbox for an activation e-mail and further instructions. You should get an SMS with a download link",remind:"Email sent. Please check your inbox!",newPassword:"Password was successfuly changed!",smskey:"Phone number successfully confirmed!"},error:{server:"Internal server error. Please try again later",connect:"Server is offline, try again later",load:"Username and Password do not match. Please try again",noPosition:"{0} has not updated position yet!",noYourPosition:"You have not updated your position yet!",oldPhoneNoConfirmed:"You have not confirmed your phone number yet!",newPhoneNoConfirmed:"You have not confirmed your new phone number yet!",noUser:"{0} is not an registered user!",noPhoneNo:"You have not set your phone number yet!",noActivated:"You have not activated your account yet! It will expire {0}",noAvatar:"You have not set your avatar yet!"},valPhoneNo:"Please correct your phone number",time:{units:[["Day","Days"],["Hour","Hours"],["Minute","Minutes"]],glue:" ",ago:" Ago",now:"Now!"},view:{loading:{caption:"Loading...",body:"Please Wait",errorCaption:"Load failed",errorBody:"Server is busy, try again by refreshing this page"}},headers:{owner:"Map Owner",user:"Myself",friends:"Friends",pending:"Friends - Pending",favoritue:"Favoritues",friendlist:"Friends & Favourites"},button:{removefrd:"Remove Friend",resignfrd:"Resign",removefav:"Remove Favourite",accept:"Confirm Friendship",deny:"Deny Friendship",addfriend:"Add as Friend",addfav:"Add as Favourite",addPlace:"Add place",newMess:"New message"},icotitles:{user:"This is Me",owner:"You can add {0} to your friends or favourites right now",fav:"{0} is your favourite",friend:"{0} is your friend",pending:"{0} wants to be your friend",request:"{0} has not replied to your request yet",denied:"{0} has rejected your friend request",unavailable:"{0} has not updated his position yet"}};DivMarker.prototype=new GMarker(new GLatLng(0,0));function DivMarker(C,A){this.data=A.data;this.UI={};this.UI.createDiv=null;this.UI.markercontentText=null;this.UI.markercontentAvatar=null;this.UI.contentTime=null;this.UI.navigationLinks=null;this.UI.rightButton=null;this.UI.div=null;this.User={};this.User.login=A.data[0];this.User.id=A.data[1];this.User.tikTime=A.data[5];this.User.who=A.data[6];this.User.avatar=A.data[7]==""?loc.cfg.host+"/res/imgA0_0_0":loc.cfg.host+"/"+A.data[7];this.User.accuracy=A.data[4];this.User.latlng=C;this.User.Msg={};var B=A.data[10]!=undefined?A.data[10]:[0,0];if(!B){B[0]=0;B[1]=0}this.User.Msg={};this.User.Msg.newest=B[0];this.User.Msg.all=B[1];this.latlng=C;this.point=new GPoint(A.data[2],A.data[3]);this.id=A.data[1];this.isSelected=A.isSelected||false;this.isOpen=A.isOpen||false;this.enableRange=A.enableRange||true;this.showRangeAlways=A.showRangeAlways||true;this.clickable=A.clickable||false;this.markerParent=A.markerParent||null;this.isEmpty=A.isEmpty;this.onTop=false;this.isMulti=false;this.Message=null;GMarker.apply(this,arguments)}DivMarker.prototype.initialize=function(D){var A=this;this.map=D;GMarker.prototype.initialize.call(this,this.map);this.UI.div=loc.util.createDiv("marker");this.UI.div.innerHTML='<div class="border top left   tileset-main     sprite-user-topleft"> </div><div class="border top center tileset-vertical sprite-user-top">     </div><div class="border top right  tileset-main     sprite-user-topright"></div><div class="border middle right tileset-main sprite-user-right"></div><div class="border middle left  tileset-main sprite-user-left"> </div><div class="border bottom left   tileset-main     sprite-user-bottomleft"></div><div class="border bottom center tileset-vertical sprite-user-bottom"><div class="kurzypazur         tileset-main     sprite-user-kurzypazur"></div></div><div class="border bottom right  tileset-main     sprite-user-bottomright"></div>';var C=loc.util.createDiv("markercontent tileset-vertical sprite-user-middle");this.UI.markercontentAvatar=loc.util.createDiv("markercontentAvatar");this.UI.markercontentAvatar.innerHTML='<img src="'+loc.cfg.avatar.getAvatarLink(this.User.avatar,"marker")+'" class="markerAvatar" />';this.UI.markercontentText=loc.util.createDiv("markercontentText");C.appendChild(this.UI.markercontentAvatar);C.appendChild(this.UI.markercontentText);this.UI.div.appendChild(C);this.UI.div.ondblclick=loc.util.stopEventBubbling;if(this.clickable){var B=$(this.UI.div).find(".border.middle.right").get(0);$(this.UI.div).addClass("clickable");this.UI.markercontentAvatar.onclick=B.onclick=function(E){loc.util.stopEventBubbling(E);A.showOnTop();A.changeMarkerTab();A.setSelected()};this.UI.markercontentAvatar.ondblclick=B.ondblclick=loc.util.stopEventBubbling}if(this.isOpen){$(this.UI.div).addClass("opened");this.updateData();this.showRange()}C.onmouseover=function(){A.setZindex()};this.map.getPane(G_MAP_MARKER_PANE).appendChild(this.UI.div)};DivMarker.prototype.redraw=function(A){if(!A){return }GMarker.prototype.redraw.call(this,loc.map.map);var B=this.map.fromLatLngToDivPixel(this.latlng);this.UI.div.style.left=B.x+"px";this.UI.div.style.top=B.y+"px";this.UI.div.style.display="block";this.showOnTop()};DivMarker.prototype.remove=function(){this.hideRange();$(this.UI.div).remove()};DivMarker.prototype.show=function(){loc.map.map.addOverlay(this)};DivMarker.prototype.changeContentStatus=function(B){var A=B===undefined?this.User.tikTime:B;if(this.UI.contentTime===null){$(this.UI.markercontentText).append(loc.util.formatString(loc.cfg.map.markerText,[this.User.login.toLowerCase(),A]));this.UI.contentTime=$(this.UI.markercontentText).find(".contentTime")}else{$(this.UI.contentTime).text(A)}};DivMarker.prototype.updateData=function(){if(!this.isEmpty){var A=false;for(var B=0;B<loc.srv.FriendData.friends.length;B++){if(loc.srv.FriendData.friends[B][1]==this.User.id){this.User.Msg.newest=loc.srv.FriendData.friends[B][10][0];this.User.Msg.all=loc.srv.FriendData.friends[B][10][1];this.User.who=loc.srv.FriendData.friends[B][6];this.User.tikTime=loc.srv.FriendData.friends[B][5];A=true;break}}if(!A){if(loc.srv.FriendData.acc_to){if(loc.srv.FriendData.acc_to[0][1]==this.User.id){this.User.Msg.newest=loc.srv.FriendData.acc_to[0][10][0];this.User.Msg.all=loc.srv.FriendData.acc_to[0][10][1];this.User.who=loc.srv.FriendData.acc_to[0][6];this.User.tikTime=loc.srv.FriendData.acc_to[0][5];A=true}}}if(!A){}if(this.isOpen){this.changeContentStatus();this.refreshNavi()}}else{this.changeContentStatus()}};DivMarker.prototype.hideNavi=function(){$(this.UI.markercontentText).find(".navigationLinks").hide();$(this.UI.markercontentText).find(".navigationLinksStatic").hide()};DivMarker.prototype.showNavi=function(){if(!this.isEmpty){if($(this.UI.markercontentText).find(".navigationLinks").count>0){$(this.UI.markercontentText).find(".navigationLinks").show();$(this.UI.markercontentText).find(".navigationLinksStatic").show()}else{this.refreshNavi()}}};DivMarker.prototype.refreshNavi=function(){if(!this.isEmpty){for(var A=0;A<loc.srv.FriendData.friends.length;A++){if(loc.srv.FriendData.friends[A][1]==this.id){this.User.Msg.newest=loc.srv.FriendData.friends[A][10][0];this.User.Msg.all=loc.srv.FriendData.friends[A][10][1]}}var B=loc.ui.panel.buildNavi(this.User.who,this.User.id,this.User.Msg.newest);if(B!=null){$(this.UI.markercontentText).find(".navigationLinks").remove();$(this.UI.markercontentText).find(".navigationLinksStatic").remove();$(this.UI.markercontentText).append(B)}}};DivMarker.prototype.changeMarkerTab=function(){if(this.isOpen){this.closeMarkerTab()}else{this.openMarkerTab()}};DivMarker.prototype.openMarkerTab=function(){loc.map.closeAllMarkerTab(this.id);if(!this.isOpen){this.isOpen=true;this.showRange();this.updateData();this.showOnTop();$(this.UI.div).addClass("opened")}};DivMarker.prototype.closeMarkerTab=function(){if(this.isOpen){this.isOpen=false;this.hideRange();$(this.UI.div).removeClass("opened");if(this.Message!=null){this.Message.hide()}}};DivMarker.prototype.setZindex=function(){var A=loc.map.getMaxZindex();this.zIndex=A;this.UI.div.style.zIndex=A};DivMarker.prototype.showOnTop=function(){this.setZindex()};DivMarker.prototype.setSelected=function(){selectedId=this.id;this.isSelected=true;this.currentVisibleOpen=this.id};DivMarker.prototype.changeContentAvatar=function(A){$(this.UI.markercontentAvatar).find(img).attr("src",A)};DivMarker.prototype.updateMarkerTime=function(A){$(this.UI.div).find(".contentTime").text(A)};DivMarker.prototype.changeContentNavi=function(){$(this.UI.markercontentText).children(".navigationLinks").remove();$("#naviLoading"+this.id).css("display","none");var A=loc.ui.panel.buildNavi(this.User.who,this.User.id,this.User.Msg.newest);if(A!=undefined){$(this.UI.markercontentText).append(A)}};DivMarker.prototype.changeContentMessage=function(){var C;var A=$("#userMsgButton"+this.id);var B=this.User.Msg.newest;if(B>0){C=loc.util.formatString(loc.lang.messageText,[B])}else{C=loc.lang.messageTextZero}A.html(C)};DivMarker.prototype.getPoint=function(){return this.point};DivMarker.prototype.getLatlng=function(){return this.latlng};DivMarker.prototype.drawRange=function(){if(this.drawRange&&this.User.accuracy>0||loc.cfg.map.drawZeroRange){if(this.User.accuracy==0){this.User.accuracy=loc.cfg.map.zeroRadius}this.range=new loc.map.Range(this.latlng,this.User.accuracy)}};DivMarker.prototype.showRange=function(){if(this.enableRange){loc.map.removeAllMarkerRanges();if(!this.range){this.drawRange()}if(this.range){this.range.Show()}}};DivMarker.prototype.hideRange=function(){if(this.range){this.range.Hide()}};var markerType={};markerType.normal=function(){this.isOpen=false;this.isSelected=true;this.enableRange=true;this.showRangeAlways=false;this.clickable=true;this.type="normal";this.isEmpty=false;this.icon=loc.map.MarkerGoogleIcon};markerType.multi=function(){this.isOpen=false;this.isSelected=true;this.enableRange=false;this.showRangeAlways=false;this.clickable=true;this.type="multi";this.markerList=[];this.isEmpty=false;this.icon=loc.map.MarkerGoogleIcon};markerType.random=function(){this.isOpen=true;this.isSelected=true;this.enableRange=true;this.showRangeAlways=true;this.clickable=true;this.type="random";this.isEmpty=true;this.icon=loc.map.MarkerGoogleIcon};markerType.current=function(){this.isOpen=true;this.isSelected=true;this.enableRange=true;this.showRangeAlways=false;this.clickable=true;this.content="";this.id=0;this.point=0;this.userName="";this.status="";this.avatar="";this.type="current";this.isEmpty=true;this.icon=loc.map.MarkerGoogleIcon};var counterMax=0;var counter=0;var currentMarker;var flag=false;loc.selectedObj={id:0,type:null,reset:function(){this.id=0;this.type=null}};loc.map={MarkerGoogleIcon:null,MaxZIndex:-999999,miniMap:null,markers:[],bounds:new GLatLngBounds(),create:function(A){if(!GBrowserIsCompatible()){throw new NoGoogleMaps()}this.map=new GMap2(A);this.setupMap(this.map)},setupMap:function(A){A.addMapType(G_PHYSICAL_MAP);A.addControl(new GLargeMapControl(),new GControlPosition(G_ANCHOR_TOP_LEFT,new GSize(7,100)));A.addControl(new GMapTypeControl(),new GControlPosition(G_ANCHOR_TOP_LEFT,new GSize(7,55)));loc.map.miniMap=new GOverviewMapControl();A.addControl(loc.map.miniMap);A.addControl(new GScaleControl());A.enableDoubleClickZoom();A.enableScrollWheelZoom();A.enableContinuousZoom();A.setCenter(new GLatLng(0,0));A.setZoom(2);loc.map.MarkerGoogleIcon=new GIcon(G_DEFAULT_ICON);loc.map.MarkerGoogleIcon.iconSize=new GSize(0,0);loc.map.MarkerGoogleIcon.shadowSize=new GSize(0,0);GEvent.addListener(A,"moveend",function(){if(loc.user.isLogged){var B=loc.map.getCorners();loc.places.getPlaces(loc.user.PlacesMode,B,A.getZoom(),"")}});loc.ui.panel.inituserPanelResizer()},getCorners:function(){var A=new Array();var B=this.map.getBounds();A.push(B.getNorthEast().lng());A.push(B.getNorthEast().lat());A.push(B.getSouthWest().lng());A.push(B.getSouthWest().lat());return A},displaySingle:function(C){if(C==null){var A=loc.ui.modal;A.message(A.NOTICE,loc.util.formatString(loc.lang.error.noUser,[loc.user.FriendName]));return }var D=new markerType.current();var A=loc.map.addMarker(C,D);if(A!=null){this.centerOnMarker(A);A.show()}else{var B=loc.ui.modal;B.message(B.NOTICE,loc.util.formatString(loc.lang.error.noPosition,[C[0]]))}},displayBatch:function(C){if(C.length>0){var B=0;bounds_global=new GLatLngBounds();this.map.setZoom(5);var D=new markerType.random();var A=loc.map.addMarker(C[B],D);if(A){loc.map.map.panTo(A.getLatlng());bounds_global.extend(A.getLatlng());A.show()}setInterval(function(){loc.map.removeAllMarkers();if(C.length-1>B){B++}else{B=0}var F=new markerType.random();var E=loc.map.addMarker(C[B],F);if(E){E.show();loc.map.map.panTo(E.getLatlng());bounds_global.extend(E.getLatlng())}},loc.cfg.ui.changeMarkerTime)}},centerOnMarker:function(A){if(!A){return }loc.console.debug("centerOnMarker",A.User.login,A.isMulti);var B=11;var C=loc.map.map.getZoom();if(C>B){B=C}this.map.setCenter(A.User.latlng,B);this.map.savePosition()},addMarker:function(E,B){if(E[2]==0&&E[3]==0){return null}for(var C=0;C<this.markers.length;C++){if(this.markers[C][0]==E[1]){this.markers[C][1].remove();return null}}var D=new GLatLng(E[2],E[3]);B.data=E;if(E[0]===""){var A=new DivMultiMarker(D,B)}else{var A=new DivMarker(D,B)}this.markers.push([E[1],A]);return A},closeAllMarkerTab:function(B){if(B===null){for(var A=0;A<loc.map.markers.length;A++){loc.map.markers[A][1].closeMarkerTab()}}else{for(var A=0;A<loc.map.markers.length;A++){if(loc.map.markers[A][0]!=B){loc.map.markers[A][1].closeMarkerTab()}}}},getMarkerById:function(D){var A=null;for(var C=0;C<this.markers.length;C++){if(this.markers[C][0]==D){return this.markers[C][1]}if(this.markers[C][1].isMulti){for(var B=0;B<this.markers[C][1].markerList.length;B++){if(this.markers[C][1].markerList[B][1]==D){return this.markers[C][1]}}}}return null},getMarkerByLogin:function(B){var A=null;for(var D=0;D<this.markers.length;D++){if(!this.markers[D][1].isMulti){if(this.markers[D][1].User.login==B){return this.markers[D][1]}}else{for(var C=0;C<this.markers[D][1].markerList.length;C++){if(this.markers[D][1].markerList[C][0]==B){return this.markers[D][1]}}}}return null},removeAllMarkerRanges:function(){for(var A=0;A<this.markers.length;A++){this.markers[A][1].hideRange()}},removeAllMarkers:function(){for(var A=0;A<this.markers.length;A++){this.markers[A][1].remove()}loc.map.markers=[]},getStatusFromRawData:function(C){for(var B=0,A=loc.srv.FriendData.friends.length;B<A;B++){if(loc.srv.FriendData.friends[B][1]==C){return loc.srv.FriendData.friends[B][6]}}},getMaxZindex:function(){this.MaxZIndex++;return this.MaxZIndex}};loc.map.Range=function(B,A){this.options={};this.options=loc.cfg.overlay.rangeDefault;this.border=this.options.border;this.strokeColor=this.options.strokeColor;this.strokeOpacity=this.options.strokeOpacity;this._point=B;this._accuracy=A;this.usesVml=navigator.userAgent.indexOf("MSIE")!=-1;this.usesCairo=navigator.userAgent.indexOf("Firefox")!=-1;this.map=loc.map.map};loc.map.Range.prototype=new GOverlay();loc.map.Range.prototype.constructor=loc.map.Range;loc.map.Range.prototype={Show:function(){this.map.addOverlay(this)},Hide:function(){this.map.removeOverlay(this)},CalculateBounds:function(){var B=0.01;var D=new GLatLng(this._point.lat()+B,this._point.lng());var A=this._point.distanceFrom(D)*0.001;var E=new GLatLng(this._point.lat(),this._point.lng()+B);var C=this._point.distanceFrom(E)*0.001;var G=this._accuracy*B/A;var H=this._accuracy*B/C;var F=new GLatLng(this._point.lat()+G,this._point.lng()+H);var I=new GLatLng(this._point.lat()-G,this._point.lng()-H);return new GLatLngBounds(F,I)},initialize:function(F){this._bounds=this.CalculateBounds();if(this.usesVml){this.vmlRoot=document.createElement("vml:group");this.vmlRoot.style.position="absolute";this.vmlRoot.coordorigin="0,0";this.vmlRoot.coordsize="5000,5000";var B=2500;var D=20;this.vmlCircle=document.createElement("vml:oval");this.vmlCircle.style.position="absolute";this.vmlCircle.style.top=0;this.vmlCircle.style.left=0;this.vmlCircle.style.width=B*2;this.vmlCircle.style.height=B*2;this.vmlCircle.filled=false;var E=document.createElement("vml:stroke");E.color="#FFFFFF";E.opacity="0.7";E.weight="6px";this.vmlCircle.appendChild(E);this.vmlCircle1=document.createElement("vml:oval");this.vmlCircle1.style.position="absolute";this.vmlCircle1.style.top=12;this.vmlCircle1.style.left=12;this.vmlCircle1.style.width=(B*2)-24;this.vmlCircle1.style.height=(B*2)-24;this.vmlCircle1.filled=false;var C=document.createElement("vml:stroke");C.color="#509b05";C.opacity="0.7";C.weight="4px";this.vmlCircle1.appendChild(C);this.vmlCircle2=document.createElement("vml:oval");this.vmlCircle2.style.position="absolute";this.vmlCircle2.style.top=22;this.vmlCircle2.style.left=22;this.vmlCircle2.style.width=(B*2)-44;this.vmlCircle2.style.height=(B*2)-44;this.vmlCircle2.filled=false;var A=document.createElement("vml:stroke");A.color="#FFFFFF";A.opacity="0.7";A.weight="6px";this.vmlCircle2.appendChild(A);this.vmlRoot.appendChild(this.vmlCircle2);this.vmlRoot.appendChild(this.vmlCircle);this.vmlRoot.appendChild(this.vmlCircle1);F.getPane(G_MAP_MAP_PANE).appendChild(this.vmlRoot)}else{var G=loc.cfg.overlay.svgNamespace;this.svgRoot=document.createElementNS(G,"svg");this.svgRoot.style.position="absolute";F.getPane(G_MAP_MAP_PANE).appendChild(this.svgRoot);this.svgCircle=document.createElementNS(G,"circle");this.svgCircle.setAttribute("stroke","#FFFFFF");this.svgCircle.setAttribute("stroke-opacity","0.7");this.svgCircle.setAttribute("fill","none");this.svgCircle.setAttribute("stroke-width","4px");this.svgCircle1=document.createElementNS(G,"circle");this.svgCircle1.setAttribute("stroke","#509b05");this.svgCircle1.setAttribute("stroke-opacity","0.7");this.svgCircle1.setAttribute("fill","none");this.svgCircle1.setAttribute("stroke-width","4px");this.svgCircle2=document.createElementNS(G,"circle");this.svgCircle2.setAttribute("stroke","#FFFFFF");this.svgCircle2.setAttribute("stroke-opacity","0.7");this.svgCircle2.setAttribute("fill","none");this.svgCircle2.setAttribute("stroke-width","4px");this.svgCircle.setAttribute("visibility","hidden");this.svgCircle1.setAttribute("visibility","hidden");this.svgCircle2.setAttribute("visibility","hidden");this.svgRoot.appendChild(this.svgCircle);this.svgRoot.appendChild(this.svgCircle1);this.svgRoot.appendChild(this.svgCircle2)}},remove:function(){if(this.svgRoot!=null){this.map.getPane(G_MAP_MAP_PANE).removeChild(this.svgRoot);this.svgRoot=null}else{if(this.vmlRoot!=null){this.map.getPane(G_MAP_MAP_PANE).removeChild(this.vmlRoot);this.vmlRoot=null}}},copy:function(){return new MapRangeOverlay(this.bounds)},redraw:function(D){if(!D){return }var B=this.map.fromLatLngToDivPixel(this._bounds.getSouthWest());var G=this.map.fromLatLngToDivPixel(this._bounds.getNorthEast());var C=Math.floor(Math.abs(G.x-B.x));var F=Math.min(G.x,B.x);var E=Math.min(G.y,B.y);if(this.usesVml){if(C>loc.cfg.overlay.vmlLow){}else{if(C>=loc.cfg.overlay.minWidth){this.vmlRoot.style.visibility="visible"}else{}}this.vmlRoot.style.width=C;this.vmlRoot.style.height=C;this.vmlRoot.style.left=F;this.vmlRoot.style.top=E}else{this.svgRoot.setAttribute("visibility","hidden");this.svgRoot.setAttribute("width",C+"px");this.svgRoot.setAttribute("height",C+"px");this.svgRoot.setAttribute("viewBox","0 0 "+C+" "+C);this.svgRoot.style.left=F+"px";this.svgRoot.style.top=E+"px";var A=Math.floor((C-this.border)*0.5);this.svgCircle.setAttribute("r",A);this.svgCircle.setAttribute("cx",C*0.5);this.svgCircle.setAttribute("cy",C*0.5);this.svgCircle1.setAttribute("r",A-4);this.svgCircle1.setAttribute("cx",C*0.5);this.svgCircle1.setAttribute("cy",C*0.5);this.svgCircle2.setAttribute("r",A-8);this.svgCircle2.setAttribute("cx",C*0.5);this.svgCircle2.setAttribute("cy",C*0.5);if((this.usesCairo&&C>loc.cfg.overlay.svgHide)||C<loc.cfg.overlay.minWidth){this.svgRoot.setAttribute("visibility","hidden");this.svgRoot.setAttribute("width","0px");this.svgRoot.setAttribute("height","0px");return }else{this.svgRoot.setAttribute("visibility","visible")}this.svgCircle.setAttribute("visibility","visible");this.svgCircle1.setAttribute("visibility","visible");this.svgCircle2.setAttribute("visibility","visible");this.svgRoot.setAttribute("visibility","visible")}}};loc.srv={FriendData:new Array(),seq:0,lastSuccReq:0,IssueCommand:function(command,parameters,onreturn,callback){var options={};if(parameters){options.parameters=parameters}else{options.parameters={}}$.ajax({type:"POST",url:loc.cfg.path.cmd+command,data:options.parameters,global:false,cache:false,complete:function(xhr,textStatus){if(textStatus!="success"){if(callback){callback(false,loc.lang.error.connect)}return }var response=eval("("+xhr.responseText+")");if(response.h!=null){if(response.h.r!=null){window.location=response.h.r;return }if(response.h.e!=null){if(callback){callback(false,response.h.e)}return }}if(command=="GetPlaces"){if(response.b.seq>=loc.srv.lastSuccReq){loc.srv.lastSuccReq=response.b.seq}else{return }}if(onreturn){onreturn(response.b)}if(callback){callback(true,null,response.b)}}});if(command=="GetPlaces"){loc.srv.seq++}},Command:function(B,A,C){callback=function(I,H,G){switch(B){case"Login":$("#Login_loading").css("visibility","hidden");break;case"ChangePassword":$("#ChangePassword_loading").css("visibility","hidden");break;case"ChangePhoneNo":$("#ChangePhoneNo_loading").css("visibility","hidden");break;case"EnterSmsKey ":$("#EnterSmsKey_loading").css("visibility","hidden");break;case"Signup":$("#Signup_loading").css("visibility","hidden");break;case"LostPassword":$("#LostPassword_loading").css("visibility","hidden");break;case"SetNewPassword":$("#SetNewPass_loading").css("visibility","hidden");break;case"ChangePlaceMode":$("#ChangePlaceMode_loading").css("visibility","hidden");break;case"SetPosition":$("#SetPos_loading").css("visibility","hidden");break}if(!I){loc.validator.showError(B,H)}else{var E=loc.ui.modal;switch(B){case"Signup":loc.ui.switcher.close();E.message(E.SUCCESS,loc.lang.success.register);break;case"SetPosition":if(!loc.user.LastUpdate){loc.user.LastUpdate=true}var F=loc.map.map.getZoom();var D=new GLatLng(G.position[1],G.position[0]);loc.map.map.setCenter(D,F);loc.map.map.savePosition();if($("#window_infoWindow").css("display")=="block"){loc.load.setInfoWindow()}break;case"LostPassword":loc.ui.switcher.close();E.message(E.SUCCESS,loc.lang.success.remind);loc.ui.switcher.to("window_login");break;case"SetNewPassword":loc.ui.switcher.close();E.message(E.SUCCESS,loc.lang.success.newPassword);loc.ui.switcher.to("window_login");break;case"ChangePhoneNo":loc.user.phoneNo=A.phoneNo;switch(loc.user.phoneStatus){case loc.phoneNoStatus.NONE:loc.user.phoneStatus=loc.phoneNoStatus.CONFIRM_OLD;break;case loc.phoneNoStatus.CONFIRM_OLD:case loc.phoneNoStatus.CONFIRM_NEW:loc.user.phoneStatus=loc.phoneNoStatus.CONFIRM_NEW;break}$("#enterSmsKey_form").show();this.phoneType=loc.phoneType.NoSYMBIAN;loc.load.setInfoWindow();break;case"EnterSmsKey":loc.user.phoneStatus=loc.phoneNoStatus.CONFIRMED;loc.user.phoneNo=A.Phone;loc.load.setInfoWindow();$("#enterSmsKey_form").hide();break}}};if(loc.validator.validate(B)){this.IssueCommand(B,A,C,callback);switch(B){case"Login":$("#Login_loading").css("visibility","visible");break;case"ChangePassword":$("#ChangePassword_loading").css("visibility","visible");break;case"ChangePhoneNo":$("#ChangePhoneNo_loading").css("visibility","visible");break;case"EnterSmsKey ":$("#EnterSmsKey_loading").css("visibility","visible");break;case"Signup":$("#Signup_loading").css("visibility","visible");break;case"LostPassword":$("#LostPassword_loading").css("visibility","visible");break;case"Logout":$("#logoutPanel").fadeIn(500);break;case"SetNewPassword":$("#SetNewPass_loading").css("visibility","visible");break;case"ChangePlaceMode":$("#ChangePlaceMode_loading").css("visibility","visible");break;case"SetPosition":$("#SetPos_loading").css("visibility","visible");break}}},UpdateMessage:function(B,A){callback=function(H,G,F){if(H){if(B=="PostMessage"){var E=$("#messCreateDiv"+A.to);var D=function(){A.message.hide();E.remove()};$(".msgSending").find("img").css("display","none");$("#msgSendingText"+A.to).css("display","block");if(jQuery.browser.msie){D()}else{E.fadeOut(2000);setTimeout(D,2000)}}}else{if(B=="PostMessage"){$(".msgSending").fadeOut(500);var C=loc.ui.modal;C.message(C.FAILURE,"Unable to send message")}}};this.IssueCommand(B,A,null,callback)},UpdateFriends:function(command,parameters){var param=eval("("+parameters+")");callback=function(success,text,data){switch(command){case"AddFavourite":case"AddFriend":case"RemFriend":case"RemFavourite":case"AcceptFriend":case"DenyFriend":$("#naviLoading"+param.id).css("display","none");break}if(success){loc.userMarker.updateCache(data.user,{who:data.status});loc.userMarker.updateMarkerContent(data.user,data.status);var mode=loc.user.PlacesMode;var arr=loc.map.getCorners();var zoom=loc.map.map.getZoom();loc.places.getPlaces(mode,arr,zoom,"",true)}};switch(command){case"AddFavourite":case"AddFriend":case"RemFriend":case"RemFavourite":case"AcceptFriend":case"DenyFriend":$("#naviLoading"+param.id).css("display","block");break}this.IssueCommand(command,param,null,callback)},getFriendData:function(C,B,A){if(B!=null){B(true)}},ajaxFileUpload:function(A,B){$("#loading").ajaxStart(function(){$(this).show()}).ajaxComplete(function(){$(this).hide()});$.ajaxFileUpload({url:"/~xhr/"+A,secureuri:false,fileElementId:A,dataType:"json",success:function(E,C){if(E.b.success){if(B=="avatar"){loc.ui.setCurrentAvatar(E.b.file)}else{loc.place.newPlace.content.photoNr=0;var F=new Date();var D=F.getTime();var G="/"+D+""+E.b.file;$("#imagePlaceHolder").attr("src",G);$("#UploadPlacePhoto_loading").css("visibility","hidden")}return false}else{if(B=="avatar"){}else{$("#UploadPlacePhoto_loading").css("visibility","hidden");if(loc.place.newPlace!==null){loc.place.newPlace.content.photoNr=0}}return false}return false},error:function(D,C,E){loc.console.debug("e ",D,C);if(B=="avatar"){}else{$("#UploadPlacePhoto_loading").css("visibility","hidden");if(loc.place.newPlace!==null){loc.place.newPlace.content.photoNr=0}}return false}});return false}};loc.ui={initialize:function(A){loc.ui.modal.initialize(A)},setCurrentAvatar:function(D){loc.user.Avatar=D;if(D!==undefined&&D!=""){var C=D.substr(0,D.length-7);C=loc.cfg.avatar.getAvatarLink(C,"list");$("#currentAvatar").attr("src",loc.cfg.host+"/"+D);$(".itemowner").find(".userico").find("img").attr("src",C)}var B=loc.map.getMarkerByLogin(loc.user.Name);if(B){if(B.isMulti){var A=marker._marker.markerList.length;for(var E=0;E<=A-1;E++){if(B.markerList[E][0]==loc.user.Name){B.markerList[E][7]=D;var F=loc.cfg.avatar.getAvatarLink(D,"multi");$("#markercontentTable"+marker._idUser).children("div").children("a, .listAvatar").eq(E).children("img").attr("src",F)}}}else{B.changeContentAvatar(D)}}},resizeList:function(){$("#user_panel").slideToggle(500);$("#menulink_resize").toggleClass("minimized")},initDeviceList:function(A){var B="";if(!loc.user.isLogged){B=document.getElementById("sign_phoneModel")}else{B=document.getElementById("change_phoneModel")}var D=$(B).find("option");D.attr("image","incoming.jpg");for(var C=1;C<A.length;C++){device=A[C];var D=document.createElement("option");D.id=C;B.appendChild(D);$("#"+C).attr("image",device[1]);$("#"+C).attr("id",C);$("#"+C).attr("value",C);D.innerHTML=device[0]}},onchagneDeviceList:function(){var B="";var C="";var A="";if(!loc.user.isLogged){B=document.getElementById("sign_phoneModel");C=document.getElementById("sign_phoneModel_Img");A=$("#sign_phoneModel option[@selected]")}else{B=document.getElementById("change_phoneModel");C=document.getElementById("change_phoneModel_Img");A=$("#change_phoneModel option[@selected]")}C.src="http://www.locatik.com/static/1.1.15/image/dev/"+A.attr("image")}};loc.ui.action={focusById:function(A){var B=document.getElementById(""+A);if((B!=null&&B.style.display!="none")){B.focus()}},onEnterClick:function(B,C,A,D){if(loc.ui.action.getKeyNum(B)==13){loc.srv.Command("Login",{username:$("#log_username").val(),password:$("#log_password").val(),remember:document.getElementById("log_remember").checked,redirect:$("#redirect").val()})}},onEnterClickError:function(C,B){if(loc.ui.action.getKeyNum(C)==13){var A=document.getElementById(""+B);A.focus();loc.ui.modal.hide()}},clear:function(A){},getKeyNum:function(A){var B=0;if(window.event){B=A.keyCode}else{if(A.which){B=A.which}}return B}};loc.ui.forms={setFields:function(D){if(D!=null&&D!=""){var B=this.getFields(D);var C;for(var A=0;A<B.length;A++){C=B[A]}}},getFields:function(E){var E=document.getElementById("signupform");if(E=="undefined"||E==null){return }var C=new Array();var A=0;var D=E.childNodes;for(var B=0;B<D.length;B++){if(D[B].type=="text"){C[A]=bodyElement;A++}}return C}};loc.ui.panel={isResized:false,user_panel:null,userList:[],userList_hash:0,inituserPanelResizer:function(){var B=true;var A=window.setInterval(function(){$("#map_overview").find("img").each(function(D){var C=(this.src).indexOf("mapcontrols2.png");if(C>0&&B){A=window.clearInterval(A);B=false;$(this).bind("click",function(){loc.ui.panel.resizeUserPanel()})}})},2000)},resizeUserPanel:function(){if(loc.ui.panel.user_panel===null){loc.ui.panel.user_panel=$("#user_panel");loc.ui.panel.isResized=false}if(loc.ui.panel.isResized){loc.ui.panel.isResized=false;loc.ui.panel.user_panel.css("bottom","130px")}else{loc.ui.panel.isResized=true;loc.ui.panel.user_panel.css("bottom","20px")}},updateFriendsList:function(C){for(var B=0;B<this.userList.length;B++){for(var A=0;A<C.friends.length;A++){if(C.friends[A][1]==this.userList[B].id){var D=this.userList[B].timeElem;$(D).text(C.friends[A][5])}}}},buildButton:function(E,D,C){var A=document.createElement("a");A.className="";A.setAttribute("id","userButton"+C.id);A.title=E;A.innerHTML=""+E;var B=loc.ui.panel.buildString(C);A.onclick=function(){loc.srv.UpdateFriends(D,B);return false};return A},buildMsgButton:function(B,C){var D;var A;if(C>0){D=loc.util.formatString(loc.lang.messageText,[C])}else{D=loc.lang.messageTextZero}A=document.createElement("a");A.setAttribute("id","userMsgButton"+B);A.className="message";A.title="Messages";A.innerHTML=D;A.onclick=function(){writeMessage(B);return false};return A},buildConfirmButton:function(E,D,C){var A=document.createElement("a");A.setAttribute("id","userButton"+C.id);A.title=E;A.innerHTML=""+E;var B=loc.ui.panel.buildString(C);A.onclick=function(){loc.ui.modal.confirmationWindow(D,B);return false};return A},buildFriends:function(F){if(this.userList_hash==F.hashish){this.updateFriendsList(F);return }this.userList_hash=F.hashish;if(!this.hasOwnProperty("firstTime")){this.firstTime=true}this.icons=new Array();this.added=new Array();this.isOdd=false;loc.ui.panel.data=F;var B=document.getElementById("user_content");B.innerHTML="";var H=document.getElementById("user_panel_me");H.innerHTML="";if(!F.acc_to){F.acc_to=null}else{if(F.acc_to.length==0){F.acc_to=null}}if(F.friends.length>0){if(F.friends.length==1){this.buildEmptyListNote(B,loc.lang.emptyNote)}for(var G=0,D=F.friends.length;G<D;G++){switch(F.friends[G][6]){case 32:this.buildItem(H,"user",F.friends[G],null);break;case 0:this.buildItem(B,"public",F.friends[G],null);break;case 1:this.buildItem(B,"friend",F.friends[G],null);break;case 2:this.buildItem(B,"pending",F.friends[G],null);break;case 3:this.buildItem(B,"request",F.friends[G],null);break;case 4:this.buildItem(B,"denied",F.friends[G],null);break;case 6:this.buildItem(B,"favourite",F.friends[G],null);break;case 5:this.buildItem(B,"pending",F.friends[G],null);break}}}if(F.acc_to!=null){var C=loc.map.getMarkerById(F.acc_to[0][1]);if(C==null){var E=new markerType.normal();C=loc.map.addMarker(F.acc_to[0],E);if(C){if(this.firstTime){C.show();C.openMarkerTab();C.showOnTop();if(loc.user.User_Place===null){loc.map.centerOnMarker(C)}}loc.userMarker.openMarkers.push({id:C.User.id,msg:(C.Message&&C.Message.isOpen)?true:false})}else{if(this.firstTime&&F.acc_to[0][0]!=loc.user.Name){var I=loc.ui.modal;var J=loc.util.formatString(loc.lang.error.noPosition,[loc.user.FriendName]);I.message(I.NOTICE,J)}}}else{}}else{if(this.firstTime){if(loc.user.FriendName!=""){var C=loc.ui.modal;var J=loc.util.formatString(loc.lang.error.noUser,[loc.user.FriendName]);C.message(C.NOTICE,J)}else{if(loc.user.User_Place===null){var C=loc.map.getMarkerById(F.friends[0][1]);var A;if(C){A=C.latlng;C.openMarkerTab()}else{A=new GLatLng(F.friends[0][2],F.friends[0][3])}loc.map.map.setCenter(A,12)}}}}this.firstTime=false},buildEmptyListNote:function(C,B){var A=document.createElement("span");A.className="emptyNote";A.setAttribute("id","noteId");C.appendChild(A);document.getElementById("noteId").innerHTML=B},buildItem:function(D,J,F){var M=document.createElement("div");M.className="left_panel";this.added.push(F[1]);var C=document.createElement("div");if(J=="user"){C.className="itemowner"}else{if(this.isOdd){C.className="item2"}else{C.className="item"}this.isOdd=!this.isOdd}var K=document.createElement("a");var H=document.createElement("img");K.className="userico";if(F[2]==0&&F[3]==0){H.className="unavailable"}if(J!="public"&&J!="user"){var E=document.createElement("div");E.id="imageType"+F[1];switch(J){case"favourite":E.className="imageType tileset-main sprite-status-favourite";E.title=loc.util.formatString(loc.lang.icotitles.fav,[F[0]]);break;case"friend":E.className="imageType tileset-main sprite-status-friend";E.title=loc.util.formatString(loc.lang.icotitles.friend,[F[0]]);break;case"pending":E.className="imageType tileset-main sprite-status-request";E.title=loc.util.formatString(loc.lang.icotitles.pending,[F[0]]);break;case"request":E.className="imageType tileset-main sprite-status-pending";E.title=loc.util.formatString(loc.lang.icotitles.request,[F[0]]);break}M.appendChild(E)}if(J!="user"&&F[10]!=null){if(F[10][0]>0){var B=document.createElement("div");B.className="newMess tileset-main sprite-icon-msg";B.id="newMess"+F[1];B.onclick=function(){if(F[2]!=0&&F[3]!=0){loc.ui.panel.buildOnclickList(F,"msg")}return false};M.appendChild(B)}}H.src=loc.cfg.avatar.getAvatarLink(F[7],"list");this.icons.push([F[1],H]);H.onclick=function(){if(F[2]!=0&&F[3]!=0){loc.ui.panel.buildOnclickList(F,"avatar")}return false};K.appendChild(H);C.appendChild(K);C.appendChild(M);var I=document.createElement("div");I.className="inner_item";var L=document.createElement("div");L.className="item_upper";var A=document.createElement("span");A.innerHTML=F[0];L.appendChild(A);I.appendChild(L);var G=document.createElement("div");G.className="item_lower";loc.ui.panel.userList.push({id:F[1],timeElem:G});G.innerHTML=F[5];I.appendChild(G);C.appendChild(I);D.appendChild(C);C.style.display="block";C.userId=F[1];D.style.display="block"},buildOnclickList:function(B,C){var A=loc.map.getMarkerById(B[1]);if(!A){var E=new markerType.normal();A=loc.map.addMarker(B,E);if(A){A.show();A.openMarkerTab()}}else{if(A.isMulti){A.setCurrentId(B[1]);if(A.isOpen){A.changeContent(B)}else{A.openMarkerTab()}}else{A.openMarkerTab()}}var D=false;loc.userMarker.openMarkers=[];if(C=="msg"){writeMessage(B[1]);D=true}loc.map.centerOnMarker(A);A.showOnTop();loc.userMarker.openMarkers.push({id:B[1],msg:D})},buildHeader:function(C,D,B){var A=document.createElement("div");A.className="header";A.appendChild(document.createTextNode(D));C.appendChild(A)},buildString:function(C){var B="";if(C.id!=null){B+="id:"+C.id+","}if(C.name!=null){B+='name : "'+C.name+'",'}if(C.accept!=null){B+='accept:"'+C.accept+'",'}if(C.addPlace!=null){B+='addPlace: "'+C.addPlace+'",'}var A=B.substring(0,B.length-1);return"{"+A+"}"},isInvalid:function(A){if(A[2]==0&&A[3]==0){return true}return false},buildNavi:function(A,F,G){var E=null;var C=document.createElement("p");C.appendChild(loc.ui.panel.buildMsgButton(F,G));switch(A){case 0:var B=document.createElement("div");B.className="navigationLinks";if(F<0){var D=document.createElement("a");D.innerHTML="Zoom to see more...";D.title="Zoom to see more...";D.style.visibility="visible";D.onclick=function(J){loc.util.stopEventBubbling(J);var I=loc.map.getMarkerById(F);if(I){loc.map.map.setCenter(I.latlng,loc.map.map.getZoom()+2)}return false};B.appendChild(D)}else{B.appendChild(C);var H=this.buildButton(loc.lang.button.addfriend,"AddFriend",{id:F});B.appendChild(H);H=document.createElement("span");H.className="separator";H.innerHTML="|";B.appendChild(H);H=this.buildButton(loc.lang.button.addfav,"AddFavourite",{id:F});B.appendChild(H);H=loc.ui.panel.buildNaviLoading(F);B.appendChild(H)}E=B;break;case 1:B=document.createElement("div");B.className="navigationLinks";B.appendChild(C);H=this.buildConfirmButton(loc.lang.button.removefrd,"RemFriend",{id:F});B.appendChild(H);H=loc.ui.panel.buildNaviLoading(F);B.appendChild(H);E=B;break;case 2:var B=document.createElement("div");B.className="navigationLinks";B.appendChild(C);var H=this.buildButton(loc.lang.button.accept,"AcceptFriend",{id:F,accept:"1"});B.appendChild(H);H=document.createElement("span");H.className="separator";H.innerHTML="|";B.appendChild(H);H=this.buildButton(loc.lang.button.deny,"AcceptFriend",{accept:"0",id:F});B.appendChild(H);H=loc.ui.panel.buildNaviLoading(F);B.appendChild(H);E=B;break;case 3:B=document.createElement("div");B.className="navigationLinks";B.appendChild(C);H=document.createElement("span");H.innerHTML="Waiting for response";B.appendChild(H);H=document.createElement("span");H.className="separator";H.innerHTML="|";B.appendChild(H);H=loc.ui.panel.buildConfirmButton(loc.lang.button.resignfrd,"RemFriend",{id:F});B.appendChild(H);E=B;break;case 4:B=document.createElement("div");B.className="navigationLinks";B.appendChild(C);H=this.buildButton(loc.lang.button.deny,"AcceptFriend",{accept:"0",id:F});B.appendChild(H);H=loc.ui.panel.buildNaviLoading(F);B.appendChild(H);E=B;break;case 6:B=document.createElement("div");B.className="navigationLinks";B.appendChild(C);H=this.buildConfirmButton(loc.lang.button.removefav,"RemFavourite",{id:F});B.appendChild(H);H=document.createElement("span");H.className="separator";H.innerHTML="|";B.appendChild(H);H=this.buildButton(loc.lang.button.addfriend,"AddFriend",{id:F});B.appendChild(H);H=loc.ui.panel.buildNaviLoading(F);B.appendChild(H);E=B;break;case 32:break}return E},buildNaviLoading:function(B){var A=document.createElement("div");A.id="naviLoading"+B;A.className="naviLoading";return A},icons:new Array(),added:new Array(),selected:new Array(),isOdd:false,firstRun:true,counter:0,data:new Array()};loc.ui.panel.overlay=function(){};loc.ui.panel.overlay.prototype=new GOverlay();loc.ui.panel.overlay.prototype.initialize=function(B){this.container=loc.util.createDiv("","user_panel");var A=loc.util.createDiv("user_content","user_content");setInterval(function(){loc.util.stopMapEvents(A)},500);this.container.appendChild(A);B.getPane(G_MAP_MARKER_MOUSE_TARGET_PANE).appendChild(this.container);return this.container};loc.ui.panel.overlay.prototype.remove=function(){this.container.parentNode.removeChild(this.container)};loc.ui.panel.overlay.prototype.redraw=function(A){};loc.ui.modal={SUCCESS:0,FAILURE:1,NOTICE:2,cssClasses:["success","failure","notice"],confirm:null,window:null,header:null,text:null,_blockCss:{border:"none",cursor:"default",textAlign:"left"},initialize:function(A){this.window=$(A.modal);this.confirm=$(A.confirm);var B=this.window.find(".content");this.header=B.find(">h3");this.text=B.find(">span");var C=function(){loc.ui.modal.hide();return false};this.window.find(".button_close").click(C);B.find(">input").click(C);this.confirm.find(".button_close").click(C);this.confirm.find(".cancel").click(C)},confirmationWindow:function(command,param){var params=eval("("+param+")");var okButton=this.confirm.find(".ok");this.confirm.find(".ok").click(function(){if((command=="RemFriend")||(command=="RemFavourite")){loc.ui.modal.hide();loc.srv.UpdateFriends(command,param,"Refresh")}okButton.unbind();return false});jQuery.blockUI({message:this.confirm,css:this._blockCss})},hide:function(){jQuery.unblockUI()},message:function(A,B){this.header.html(loc.lang.modalTitle[A]);this.text.removeClass();this.text.addClass(this.cssClasses[A]);this.text.html(B);jQuery.blockUI({message:this.window,css:this._blockCss})}};loc.ui.remember={rememberSignUp:function(){loc.ui.remember.remember=true;loc.ui.remember.sign_username=$("#sign_username").val();loc.ui.remember.sign_password=$("#sign_password").val();loc.ui.remember.sign_confirm=document.getElementById("sign_confirm").value;loc.ui.remember.sign_email=document.getElementById("sign_email").value;loc.ui.remember.sign_phoneNo=document.getElementById("sign_phoneNo").value;loc.ui.remember.sign_phoneModel=document.getElementById("sign_phoneModel").value;loc.ui.remember.sign_terms=document.getElementById("sign_terms").value},recoverSignUp:function(){if(loc.ui.remember.remember){$("#sign_username").val(loc.ui.remember.sign_username);$("#sign_confirm").val(loc.ui.remember.sign_confirm);$("#sign_password").val(loc.ui.remember.sign_password);$("#sign_email").val(loc.ui.remember.sign_email);$("#sign_phoneNo").val(loc.ui.remember.sign_phoneNo);$("#sign_phoneModel").val(loc.ui.remember.sign_phoneModel);$("#sign_terms").val(loc.ui.remember.sign_terms);loc.ui.onchagneDeviceList();loc.ui.remember.remember=false}},terms:{signUpLinkHide:function(A){if(A){document.getElementById("signUpLink").style.display="none"}else{document.getElementById("signUpLink").style.display="block"}}}};loc.ui.switcher={register:function(A){for(var B=0;B<A.length;++B){var C=document.getElementById(A[B]);this._panels.push([A[B],C])}},to:function(A){this.toggle(A)},toggle:function(B){var A=this.getPanel(B);if(A.isOpen){this.closePanel(A)}else{this.close();this.openPanel(A)}},close:function(){for(var A=0;A<this._panels.length;++A){if(this._panels[A][1].isOpen){this.closePanel(this._panels[A][1])}}},closePanel:function(A){$(A).fadeOut(100);A.isOpen=false;loc.ui.switcher.clearPanel()},openPanel:function(A){loc.ui.switcher.clearPanel();$(A).fadeIn(100);if(window.ActiveXObject){A.style.filter="alpha(opacity=0)"}A.isOpen=true},getPanel:function(A){for(var B=0;B<this._panels.length;++B){if(this._panels[B][0]==A){return this._panels[B][1]}}return null},clearPanel:function(){for(var A=0;A<this._panels.length;++A){$("#"+loc.ui.switcher._panels[A][0]).find("input[@type='text']").val("");$("#"+loc.ui.switcher._panels[A][0]).find("input[@type='hidden']").val("");$("#"+loc.ui.switcher._panels[A][0]).find("input[@type='password']").val("")}for(A=0;A<loc.validator.validators.length;A++){if(loc.validator.validators[A].validator!=null){loc.validator.validators[A].validator.resetForm()}}},_panels:new Array()};loc.phoneType={SYMBIAN:0,NOSYBIAN:1,IPHONE:2};loc.phoneNoStatus={CONFIRM_NEW:0,CONFIRM_OLD:1,CONFIRMED:2,NONE:3};loc.user={initailize:function(){this.phoneNo=null;this.phoneType=null;this.ConfirmedPhoneNo=null;this.isLogged=loc.init.data.isLogged!==null&&loc.init.data.isLogged===1?true:false;this.FriendName=loc.init.data.User_FriendName!==null?loc.init.data.User_FriendName:"";this.User_Place=loc.init.data.Place!==undefined?loc.init.data.Place:null;this.Place_ScrollTo=loc.init.data.Place_ScrollTo!==undefined?loc.init.data.Place_ScrollTo:null;if(this.Place_ScrollTo!==null&&this.User_Place!==null){this.User_Place[0].places[0].Place_ScrollTo=this.Place_ScrollTo}var A=loc.init.data.User_UnconfirmedSymbian!==undefined?loc.init.data.User_UnconfirmedSymbian:null;if(this.isLogged){this.Name=loc.init.data.User_Name;this.FriendDiscovery=loc.init.data.User_FriendDiscovery==="1";this.PlacesMode=loc.init.data.User_PlacesMode;this.AuthKey=loc.init.data.User_AuthKey;this.Internal=loc.init.data.User_Internal==="1";this.Avatar=loc.init.data.User_Avatar;this.TwitterLogin=loc.init.data.User_TwitterLogin;this.Acc_To=loc.init.data.Acc_To;this.AccountExpires=loc.init.data.User_AccountExpires!==undefined?loc.init.data.User_AccountExpires:null;this.ConfirmedPhoneNo=loc.init.data.User_ConfirmedPhoneNo!==undefined?loc.init.data.User_ConfirmedPhoneNo:null;this.LastUpdate=loc.init.data.User_LastUpdate!==undefined?loc.init.data.User_LastUpdate:null;this.UnconfirmedPhoneNo=loc.init.data.User_UnconfirmedPhoneNo!==undefined?loc.init.data.User_UnconfirmedPhoneNo:null;this.phoneNo=null;this.phoneType=A?loc.phoneType.SYMBIAN:loc.phoneType.NOSYMBIAN;if(this.ConfirmedPhoneNo!=null&&this.UnconfirmedPhoneNo!=null){this.phoneNo=this.UnconfirmedPhoneNo;this.phoneStatus=loc.phoneNoStatus.CONFIRM_NEW}if(this.ConfirmedPhoneNo==null&&this.UnconfirmedPhoneNo!=null){this.phoneNo=this.UnconfirmedPhoneNo;this.phoneStatus=loc.phoneNoStatus.CONFIRM_OLD}if(this.ConfirmedPhoneNo!=null&&this.UnconfirmedPhoneNo==null){this.phoneNo=this.ConfirmedPhoneNo;this.phoneStatus=loc.phoneNoStatus.CONFIRMED}if(this.ConfirmedPhoneNo==null&&this.UnconfirmedPhoneNo==null){this.phoneNo=null;this.phoneStatus=loc.phoneNoStatus.NONE}this.User_Friends={};this.User_Friends.friends=loc.init.data.friends;this.User_Friends.acc_to=this.Acc_To;loc.places.selectModeCombo(this.PlacesMode);loc.ui.setCurrentAvatar(this.Avatar);loc.twitter.init()}if(this.phoneType==loc.phoneType.SYMBIAN||this.phoneStatus==loc.phoneNoStatus.CONFIRMED||this.phoneStatus==loc.phoneNoStatus.NONE){$("#enterSmsKey_form").hide()}loc.ui.initDeviceList(loc.init.data.App_Devices);loc.load.setInfoWindow()},setPostion:function(){loc.srv.SetPositionOnMap("SetPosition",{address:$("#address").val()})}};loc.load={onload:function(A){loc.user.initailize();this.status=A.status;this.options=A;loc.ui.initialize(A);loc.map.create(this.options.map);this.task=-1;this.nextTask(true)},onunload:function(){GUnload()},callback:function(A){loc.load.nextTask(A)},nextTask:function(A){if(!A){this.status.innerHTML=loc.lang.error.server;return }this.status.innerHTML="Loading "+this.tasks[++this.task][1]+"...";this.tasks[this.task][0].call(this)},reload:function(){loc.srv.IssueCommand("lastActive",null,this.savedata,this.callback)},getData:function(){if(loc.user.isLogged){loc.console.debug("loc.user.User_Place",loc.user.User_Place);loc.srv.FriendData=loc.user.User_Friends;if(loc.user.User_Place!==null){loc.place.setPlaceData(loc.user.User_Place);var A=loc.place.getPlaceById(loc.user.User_Place[0].places[0][0]);A.showOnTop();A.open()}loc.load.finish();loc.map.map.addOverlay(new loc.ui.panel.overlay());loc.ui.panel.buildFriends(loc.user.User_Friends)}else{if(loc.user.FriendName!=""){loc.srv.IssueCommand("lastPosition","username="+loc.user.FriendName,this.savedata,this.callback)}else{if(loc.user.User_Place!==null){loc.place.setPlaceData(loc.user.User_Place);var A=loc.place.getPlaceById(loc.user.User_Place[0].places[0][0]);A.showOnTop();A.open();loc.place.centerOnPlace(A);loc.load.finish()}else{loc.srv.IssueCommand("lastActive",null,this.savedata,this.callback)}}}},savedata:function(A){loc.load.data=A?A:null},setInfoWindow:function(){var D=[];var G="";var E="<p>";var C=' <a title="Learn More" target="_blank" href="~help/FAQ.aspx" onmousedown="return false">more...</a>';if(loc.user.isLogged){switch(loc.user.phoneStatus){case loc.phoneNoStatus.CONFIRM_NEW:D.push(["newPhoneNoConfirmed",loc.util.formatString(loc.lang.error.newPhoneNoConfirmed,[])+C]);break;case loc.phoneNoStatus.CONFIRM_OLD:D.push(["oldPhoneNoConfirmed",loc.util.formatString(loc.lang.error.oldPhoneNoConfirmed,[])+C]);break;case loc.phoneNoStatus.NONE:D.push(["",loc.util.formatString(loc.lang.error.noPhoneNo,[])+C]);break}if(loc.user.AccountExpires){var F=loc.util.dayformat(loc.user.AccountExpires);D.push(["noActivated",loc.util.formatString(loc.lang.error.noActivated,[F])+C])}if(!loc.user.LastUpdate){var B=loc.util.formatString(loc.lang.error.noYourPosition,[])+C;B=B+'<form id="setPos_form" class="preferences" action="" method="post"><div class="item">     <label for="setPos_address">Enter address</label>    <input type="text" maxlength="100" id="setPos_address" name="setPos_address"/> <input type="submit" value="Set" id="setPos_button" onclick=""/> </div><div class="summary">  <input type="hidden" id="setPos_err" name="setPos_err"/> </div><div class="loading">  <img class="invisible" id="SetPos_loading" src="http://www.locatik.com/static/1.1.15/image/load_f.gif" alt="Loading progress"/> </div>';"</form>";D.push(["noYourPosition",B])}if(D.length==0){return }for(var A in D){G=G+E+D[A][1]}$("#window_infoWindow").css("right","198px");$("#window_infoWindow").find("div.info").html(G);if(!loc.user.LastUpdate){loc.validator.init("SetPosition")}}else{}$("#window_infoWindow").css("display","block")},finish:function(){if(!loc.user.isLogged){if(loc.user.FriendName!=""){loc.map.displaySingle(this.data?this.data.user:null)}else{if(loc.user.User_Place!==null){}else{loc.map.displayBatch(this.data.positions)}}}if(this.options.hide){for(var A=0;A<this.options.hide.length;++A){$(this.options.hide[A]).remove()}}if(this.options.workspace){this.options.workspace[0].style.visibility="visible"}}};loc.load.tasks=[[loc.load.getData,"position data"],[loc.load.finish,"map"]];loc.place={places:[],newPlace:[],currentlyOpen:null,mouseOnList:null,Icon:null,openPlaces:[],getPlaces:function(D,B,A,F,C){loc.places.setListRef(D,B,A,F);if(D==-1||D==3){loc.place.hideAll();loc.place.places=[];return }if(!C){if(!loc.frame.isOutside(B[2],B[3],B[0],B[1],A,D)){return }}var G=function(H){loc.ui.panel.buildFriends(H);loc.place.setPlaceData(H.places);loc.userMarker.setMarkerData(H);loc.userMarker.updateMarkersTime(H);loc.frame.set(H.valid_coords[0],H.valid_coords[1],H.valid_coords[2],H.valid_coords[3],A,D)};var E=loc.util.getWindowSize();loc.srv.IssueCommand("GetPlaces",{placeMode:D,categoryId:1,minLon:B[2],minLat:B[3],maxLon:B[0],maxLat:B[1],zoomLevel:A,userName:loc.user.FriendName,width:E.width,height:E.height,seq:loc.srv.seq},G,null)},setPlaceData:function(F){if(F!==undefined){var A;var C=null;var I=null;var G=null;var J=false;var K=null;var H=loc.place.cachePlaces(F);for(var E=0;E<H.length;E++){C=null;if(H[E].places.length==1){A=H[E].places[0][0];var K=loc.place.getPlaceById(A.toString());if(K===null){I=new GLatLng(H[E].places[0][2],H[E].places[0][3]);J=H[E].places[0][6]=="- zoom in -"?true:false;C=new Place(I,{data:H[E].places[0],isMulti:false,isOpen:false,isZoomIn:J,icon:loc.map.MarkerGoogleIcon});G=new Content(H[E].places[0],C)}}else{A=H[E].info[1];var K=loc.place.getPlaceById(A.toString());if(K===null){I=new GLatLng(H[E].info[2],H[E].info[3]);J=H[E].places[0][6]=="- zoom in -"?true:false;C=new Place(I,{data:H[E].places,isMulti:true,isOpen:false,acc:H[E].info[4],currentDisplayed:H[E].places[0][0],idMultiPlace:H[E].info[1],isZoomIn:false,icon:loc.map.MarkerGoogleIcon});G=new Content(H[E].places[0],C)}}if(C!==null){loc.map.map.addOverlay(C);loc.place.places.push({id:A,place:C});for(var D=0;D<loc.place.openPlaces.length;D++){if(C.isMulti){for(var B=0;B<C.contents.length;B++){if(loc.place.openPlaces[D].id==C.contents[B][0]){C.updateClosedContent(C.contents[B][0]);C.open();loc.place.openPlaces=[];break}}}else{if(loc.place.openPlaces[D].id==A){C.open();loc.place.openPlaces=[];break}}}}}}},cachePlaces:function(F){var B=null;var G=0;var A=false;var E=0;for(var D=loc.place.places.length-1;D>=0;D--){A=false;for(var C=F.length-1;C>=0;C--){G=F[C].places.length==1?F[C].places[0][0]:F[C].info[1];if(loc.place.places[D].id==G){F.splice(C,1);A=true;break}}if(!A){B=loc.place.places[D].place;if(B.isOpen){E=B.isMulti?B.currentDisplayed:B.id;loc.place.openPlaces.push({id:E})}loc.place.places[D].place.remove();loc.place.places.splice(D,1)}}return F},getPlaceById:function(A){for(var B in loc.place.places){if(loc.place.places[B].id==A){return loc.place.places[B].place}}return null},onclick:function(B,C,E,D){var A=null;switch(C){case"p":A=loc.place.getPlaceById(E);break;case"c":A=loc.place.getPlaceById(E);break;case"newp":A=loc.place.newPlace;break}if(A==null){return }switch(B){case"open":A.open();break;case"close":A.close();break;case"toggle":A.toggle();break;case"comment":if(A.content!=null){A.content.comment()}case"zoomIn":loc.place.zoomAndCenter(A);break;case"comment":if(A.content!=null){A.content.comment()}break;case"sendcomment":if(A.content!=null){A.content.sendComment()}break;case"cancelcomment":if(A.content!=null){A.content.cancelComment()}break;case"showNextPlace":if(A.content!=null){A.showPrv()}break;case"showPrvPlace":if(A.content!=null){A.showNext()}break;case"startMove":if(A.place!==null){A.startMove()}break;case"stopMove":if(A.place!==null){A.stopMove()}break;case"showCommentPhoto":if(A.content!==null){A.content.showCommentPhoto(D.commentId)}break;case"closeNewPlace":loc.place.newPlace.remove();loc.place.newPlace=null;break}},centerOnPlace:function(B){var A=loc.map.map.fromLatLngToDivPixel(B.latlng);A.y=A.y-30;var A=loc.map.map.fromDivPixelToLatLng(A);loc.map.map.setCenter(A,loc.map.map.getZoom()+2);loc.map.map.savePosition()},zoomAndCenter:function(B){var A=loc.map.map.fromLatLngToDivPixel(B.latlng);A.y=A.y-30;var A=loc.map.map.fromDivPixelToLatLng(A);loc.map.map.setCenter(A,loc.map.map.getZoom()+2);loc.map.map.savePosition()},closeAll:function(B){for(var A=this.places.length-1;A>=0;A--){if(this.places[A].place.isOpen&&A!=B){this.places[A].place.close()}}},hideAll:function(){for(var A=this.places.length-1;A>=0;A--){this.places[A].place.remove();this.places.splice(A,1)}},addPlace:function(){if(loc.place.hasOwnProperty("newPlace")){if(loc.place.newPlace!==null){if(loc.place.newPlace.hasOwnProperty("id")){loc.place.newPlace.panToPlace();return }}}var B=loc.map.map.getCenter();var A=new Place(B,{data:["New",null,B.lat(),B.lng(),0,"Just now","","",0,0,null,0,"",null,null],isMulti:false,isOpen:false,acc:0,currentDisplayed:null,idMultiPlace:0,icon:loc.map.MarkerGoogleIcon});this.newPlace={};this.newPlace=A;this.newPlace.initialize();this.newPlace.content=new newContent(this.newPlace);this.newPlace.open();return A}};loc.places={mode:-1,icon:"",pdata:"",places:new Array(),isEdited:false,copyMarker:"",flag:true,arr:new Array(),setListRef:function(C,B,A,D){clearInterval(loc.map.ListRef);loc.map.ListRef=setInterval(function(){loc.places.getPlaces(C,B,A,D,true)},40000)},changePlaceMode:function(){for(var A=0;A<4;A++){if(document.getElementById("plaSelect"+A).selected==true){loc.user.PlacesMode=A;break}}var B=function(E){document.getElementById("plaChangedMess").innerHTML="place mode change to: "+document.getElementById("plaSelect"+loc.user.PlacesMode).text;if(loc.user.PlacesMode==3){loc.place.hideAll();loc.place.places=[]}else{var C=loc.map.getCorners();var D=loc.map.map.getZoom();loc.places.getPlaces(E.placeMode,C,D,loc.user.FriendName)}loc.user.PlacesMode=E.placeMode};loc.srv.Command("ChangePlaceMode",{placeMode:loc.user.PlacesMode},B,null)},selectModeCombo:function(B){var A=document.getElementById("plaSelect");A[B].selected=true;document.getElementById("plaSelect"+B).selected=true;this.mode=B},getPlaces:function(D,B,A,E,C){loc.place.getPlaces(D,B,A,E,C)}};Place.prototype=new GMarker(new GLatLng(0,0));function Place(A,B){this.latlng=A;this.labelOffset=new GSize(0,0);this.commentsLoadNumber=B.data.Place_ScrollTo!==undefined?B.data.Place_ScrollTo:0;this.content=null;this.id=B.data[0];this.idMultiPlace=B.data[1];this.lat=B.data[2];this.lng=B.data[3];this.acc=B.data[4];this.isMulti=B.isMulti;this.isOpen=B.isOpen;this.isZoomIn=B.isZoomIn;this.clickable=true;this.div="";this.zIndex=-9999999;this.contentAnchor="";this.clickable=true;this.lastId=0;if(this.isMulti){this.currentDisplayed=B.currentDisplayed;this.currentDisplayedIndex=0;this.contents=B.data;this.acc=B.acc;this.id=B.idMultiPlace}this.UI={};this.UI.header=null;this.UI.title=null;this.UI.left=null;this.UI.right=null;this.UI.middle=null;this.draggableIcon=null;this.isIcon=false;GMarker.apply(this,arguments)}Place.prototype.toggle=function(){if(this.isOpen){this.close()}else{this.open()}};Place.prototype.open=function(){if(this.isZoomIn){return }var C=this;if(this.isOpen){this.showOnTop();return }loc.place.closeAll();this.setSelected();loc.place.currentlyOpen=loc.place.places[this.id];if(this.UI.header===null){var F=loc.util.createDiv("header","");if(this.isMulti){var A=loc.util.createDiv("showNext tileset-main sprite-icon-left","");A.onclick=function(G){loc.place.onclick("showNextPlace","p",C.id)};A.ondblclick=function(G){loc.util.stopEventBubbling(G)};F.appendChild(A);var E=loc.util.createDiv("title","");E.innerHTML=this.getHeaderContent();F.appendChild(E);this.UI.title=E;var B=loc.util.createDiv("showPrv tileset-main sprite-icon-right","");B.onclick=function(G){loc.place.onclick("showPrvPlace","p",C.id)};B.ondblclick=function(G){loc.util.stopEventBubbling(G)};F.appendChild(B)}var D=loc.util.createDiv("close tileset-main sprite-icon-close","");this.div.appendChild(D);D.onclick=function(G){loc.util.stopEventBubbling(G);if(C.id=="New"){loc.place.onclick("closeNewPlace","newp")}else{loc.place.onclick("close","p",C.id)}};F.appendChild(D);this.UI.header=F;this.UI.header.ondblclick=loc.util.stopEventBubbling;this.div.appendChild(F)}this.panToPlace();loc.place.closeAll(this.id);this.isOpen=true;this.redraw(true);this.openCSS();this.content.open();this.showOnTop();$(this.div).addClass("extended")};Place.prototype.setSelected=function(){loc.selectedObj.id=this.id;loc.selectedObj.type="place"};Place.prototype.panToPlace=function(){var B=this.map.fromLatLngToDivPixel(this.latlng);var D=(B.y-this.labelOffset.height-371/2);var A=(B.x+this.labelOffset.width+531/2);var C=this.map.fromDivPixelToLatLng(new GPoint(A,D));loc.map.map.panTo(C)};Place.prototype.close=function(){if(!this.isOpen){return }loc.place.openPlaces=[];this.isOpen=false;this.content.close();this.redraw(true);this.closeCSS();$(this.div).removeClass("extended")};Place.prototype.getHeaderContent=function(){var A=this.currentDisplayedIndex+1;return"Place "+A+" of "+this.contents.length};Place.prototype.updateHeaderContent=function(){var A=this.currentDisplayedIndex+1;this.UI.title.innerHTML="Place "+A+" of "+this.contents.length};Place.prototype.openCSS=function(){this.UI.header.style.display="block";if(this.isMulti){this.UI.left.className="tileset-main leftOpen sprite-place-multileftOpen";this.UI.right.className="tileset-main rightOpen sprite-place-multirightOpen";this.UI.middle.className="tileset-vertical middleOpen sprite-place-multi-middle-open"}else{this.UI.left.className="tileset-main leftOpen sprite-place-singleleftOpen";this.UI.right.className="tileset-main rightOpen sprite-place-singlerightOpen";this.UI.middle.className="tileset-vertical middleOpen sprite-place-single-middle-open"}};Place.prototype.closeCSS=function(){this.UI.header.style.display="none";if(this.isMulti){this.UI.left.className="tileset-main left sprite-place-multileft";this.UI.right.className="tileset-main right sprite-place-multiright";this.UI.middle.className="tileset-vertical middle sprite-place-multi-middle"}else{this.UI.left.className="tileset-main left sprite-place-singleleft";this.UI.right.className="tileset-main right sprite-place-singleright";this.UI.middle.className="tileset-vertical middle sprite-place-single-middle"}};Place.prototype.setZindex=function(){var A=loc.map.getMaxZindex();this.zIndex=A;this.div.style.zIndex=A};Place.prototype.showOnTop=function(){this.setZindex()};Place.prototype.appendContent=function(){this.div.appendChild(this.content.div)};Place.prototype.removeContent=function(){this.content.remove()};Place.prototype.hideContent=function(){this.contentAnchor.style.display="none";this.content.isOpen=false};Place.prototype.initialize=function(){var F=this;if(this.isOpen){this.initializeOpen();return }GMarker.prototype.initialize.call(this,loc.map.map);var G;var E;var D;var A="singleplace";if(this.isMulti){A="multiplace";G=loc.util.createDiv("left tileset-main sprite-place-multileft","");E=loc.util.createDiv("right tileset-main sprite-place-multiright","");D=loc.util.createDiv("middle tileset-vertical sprite-place-multi-middle","")}else{G=loc.util.createDiv("left tileset-main sprite-place-singleleft","");E=loc.util.createDiv("right tileset-main sprite-place-singleright","");D=loc.util.createDiv("middle tileset-vertical sprite-place-single-middle","")}var C=loc.util.createDiv(A,A+this.id);var H=function(I){loc.util.stopEventBubbling(I);loc.place.onclick("open","p",F.id)};var B=function(I){loc.util.stopEventBubbling(I)};G.onclick=E.onclick=D.onclick=H;G.ondblclick=E.ondblclick=D.ondblclick=B;C.appendChild(G);C.appendChild(E);C.appendChild(D);this.UI.left=G;this.UI.right=E;this.UI.middle=D;C.id="place"+this.id;loc.map.map.getPane(G_MAP_MARKER_PANE).appendChild(C);this.map=loc.map.map;this.div=C;if(this.content!==null){this.appendContent()}loc.util.stopMapEvents($(C))};Place.prototype.redraw=function(B){if(!B){return }GMarker.prototype.redraw.call(this,loc.map.map);var A=this;var C=loc.map.map.fromLatLngToDivPixel(this.latlng);if(this.isOpen){this.div.style.left=(C.x+this.labelOffset.width-31)+"px";this.div.style.top=(C.y+this.labelOffset.height-371)+"px"}else{this.div.style.left=(C.x+this.labelOffset.width-31)+"px";this.div.style.top=(C.y+this.labelOffset.height-75)+"px"}this.showOnTop()};Place.prototype.remove=function(){this.isOpen=false;GMarker.prototype.remove.call(this);$(this.div).remove()};Place.prototype.showNext=function(){for(var B=0;B<this.contents.length;B++){if(this.contents[B][0]==this.currentDisplayed){if(B==this.contents.length-1){this.currentDisplayed=this.contents[0][0];this.currentDisplayedIndex=0;break}else{var A=B+1;this.currentDisplayed=this.contents[A][0];this.currentDisplayedIndex=A;break}}}this.updateContent()};Place.prototype.showPrv=function(){for(var A=0;A<this.contents.length;A++){if(this.contents[A][0]==this.currentDisplayed){if(A==0){this.currentDisplayed=this.contents[this.contents.length-1][0];this.currentDisplayedIndex=this.contents.length-1;break}else{this.currentDisplayed=this.contents[A-1][0];this.currentDisplayedIndex=A-1;break}}}this.updateContent()};Place.prototype.showById=function(B){for(var A=0;A<this.contents.length;A++){if(this.contents[A][0]==B){this.currentDisplayed=B;this.currentDisplayedIndex=A;break}}this.updateContent(B)};Place.prototype.showPrv=function(){for(var A=0;A<this.contents.length;A++){if(this.contents[A][0]==this.currentDisplayed){if(A==0){this.currentDisplayed=this.contents[this.contents.length-1][0];this.currentDisplayedIndex=this.contents.length-1;break}else{this.currentDisplayed=this.contents[A-1][0];this.currentDisplayedIndex=A-1;break}}}this.updateContent()};Place.prototype.updateClosedContent=function(C){var A=C?C:this.currentDisplayed;for(var B=0;B<this.contents.length;B++){if(this.contents[B][0]==C){this.currentDisplayed=C;this.currentDisplayedIndex=B;break}}if(this.isMulti){this.content.remove();var E=this.getContentById(A);if(E!==null){var D=new Content(E,this);this.content=D;this.appendContent()}}};Place.prototype.updateContent=function(B){var A=B?B:this.currentDisplayed;if(this.isMulti){this.updateHeaderContent();this.content.remove();var D=this.getContentById(A);if(D!==null){var C=new Content(D,this);this.content=C;this.appendContent();this.content.open()}}};Place.prototype.getContentById=function(B){for(var A=0;A<this.contents.length;A++){if(this.contents[A][0]==B){return this.contents[A]}}return null};Place.prototype.hide=function(){this.div.style.display="none"};Place.prototype.show=function(){$(this.div).show()};Place.prototype.startMove=function(){this.hide();var A=new GIcon(G_DEFAULT_ICON);A.iconSize=new GSize(73,94);A.iconAnchor=new GPoint(18,75);A.imageMap=[0,0,0,73,73,94,94,0,0,0];A.image="http://www.locatik.com/static/1.1.15/image/place/pindol.png";this.draggableIcon=new GMarker(this.latlng,{draggable:true,icon:A,zIndexProcess:function(){return 9999}});GEvent.addListener(this.draggableIcon,"dragend",function(){loc.place.onclick("stopMove","newp")});loc.map.map.addOverlay(this.draggableIcon)};Place.prototype.stopMove=function(){this.setPosition();if(this.draggableIcon!==null){loc.map.map.removeOverlay(this.draggableIcon)}};Place.prototype.setPosition=function(){var A=this.draggableIcon.getLatLng();this.latlng=A;this.lat=A.lat();this.lng=A.lng();this.redraw(true);this.show()};Place.prototype.savePlace=function(A){var B=this;callback=function(G,F,E){if(G){B.hide();var D=loc.map.getCorners();loc.places.getPlaces(loc.user.PlacesMode,D,loc.map.map.getZoom(),"");loc.place.newPlace={}}else{B.hide();var C=loc.ui.modal;C.message(C.FAILURE,"Unable to add place")}};loc.srv.IssueCommand("AddPlace",A,null,callback)};function Content(C,B,A){this.CONTENT_LIST_HEIGHT=241;this.COMMENTS_LOAD_NUMBER=7;this.TITLE_LENGTH_SHORT=16;this.TITLE_LENGTH_LONG=50;this.parentObj=B;this.date=C[5];this.title=C[6];this.snippet=C[7];this.access=C[8];this.friendship=C[9];this.thumbnail={};this.thumbnail.link=C[10]["link"];this.thumbnail.maxWidth=C[10]["w"];this.thumbnail.maxHeight=C[10]["h"];this.authorId=C[11];this.authorName=C[12];this.actTime=C[13];this.firstBody=C[14][3];this.firstDate=C[14][6];this.firstAvatar=C[14][4];this.currentRequest=0;this.comments=[];this.commentsLoadNumber=B.commentsLoadNumber!=0?B.commentsLoadNumber:this.COMMENTS_LOAD_NUMBER;this.commentsCount=0;this.commentsLoader=null;this.isLoading=false;this.div="";this.hrLine=null;this.commentButton=null;this.isZoomIn=this.title=="- zoom in -"?true:false;if(this.isZoomIn){this.title="Many places here";this.firstBody="Click to zoom in";this.snippet="Click to zoom in"}if(A===undefined){A=false}if(!A){this.initialize()}this.parentObj.content=this}Content.prototype.initialize=function(){var F=this;if(this.parentObj.isOpen&&!this.parentObj.isMulti){this.initializeOpened();return }var E=loc.cfg.thumbnail.getLink(this.thumbnail.link,"singleClose");var A="pAnchor";var H=this.parentObj.id;if(this.isMulti){A="pAnchorOpen";H=this.parentObj.currentDisplayed}var G=loc.util.createDiv(A,A+H);var D=document.createElement("img");D.setAttribute("src",E.src);D.className="psTh";D.setAttribute("id","psTh-"+this.parentObj.id);var C=loc.util.createDiv("psCo","");if(this.isZoomIn){D.onclick=function(I){loc.util.stopEventBubbling(I);loc.place.onclick("zoomIn","p",H)};G.style.cursor="pointer";var B='<span class="psTi" id="psTi'+H+'" title="'+this.title+'">'+loc.util.getSnippet(this.title,this.TITLE_LENGTH_SHORT)+'</span><span class="psSn" id="psSn'+H+'" title="'+this.snippet+'">'+loc.util.getSnippet(this.snippet,18)+'</span><span class="psAu" id="psAu'+H+'"/>'}else{D.onclick=function(I){loc.util.stopEventBubbling(I);F.showPhoto()};var B='<span class="psTi" id="psTi'+H+'" title="'+$("<div/>").text(this.title).html()+'">'+$("<div/>").text(loc.util.getSnippet(this.title,this.TITLE_LENGTH_SHORT)).html()+'</span><span class="psSn" id="psSn'+H+'" title="'+$("<div/>").text(loc.util.skipTags(this.snippet)).html()+'">'+loc.util.getSnippet(this.snippet,18)+'</span> <span class="psAu" id="psAu'+H+'"> by: '+this.authorName+", "+this.date+"</span>"}C.innerHTML=B;this.div=G;$(this.div).append(D).append(C);this.div.onmouseover=function(){F.parentObj.setZindex()};this.div.onclick=function(I){loc.util.stopEventBubbling(I);if(F.isZoomIn&&!F.isMulti){loc.place.onclick("zoomIn","p",H)}else{loc.place.onclick("open","p",H)}};this.div.ondblclick=function(I){loc.util.stopEventBubbling(I)}};Content.prototype.remove=function(){if(this.parentObj.isMulti){this.close();$(this.div).remove();this.content=null}else{this.close();this.content=null}};Content.prototype.open=function(){this.openCSS();this.updateContent();this.getComments()};Content.prototype.close=function(){if(this.parentObj.isMulti){$(this.div).find(".psLo").remove();$(this.div).find(".commentGroup").remove();this.updateContent();this.closeCSS()}else{$(this.div).find(".commentGroup").remove();$(this.div).find(".psLo").remove();this.updateContent();this.closeCSS();this.commentButton=null}this.comments=[]};Content.prototype.openCSS=function(){$(this.div).removeClass("pAnchor").addClass("pAnchorOpen")};Content.prototype.closeCSS=function(){$(this.div).find(".pAnchor").empty();$(this.div).removeClass("pAnchorOpen").addClass("pAnchor")};Content.prototype.comment=function(){this.buildReplayView()};Content.prototype.buildCommentButton=function(){var C=this;var A=loc.util.createDiv("commentB1","commentB1"+this.parentObj.id);this.commentActionHolder=A;var B=loc.util.createDiv("commentB tileset-main sprite-icon-comment","commentB"+this.parentObj.id);B.onclick=function(D){loc.util.stopEventBubbling(D);C.comment()};A.appendChild(B);this.div.appendChild(A);this.commentButton=B};Content.prototype.getComments=function(){var A=this;var C=0;if(A.comments.length!==0){C=A.comments[A.comments.length-1][0]}callback=function(F,E,D){A.isLoading=false;if(F){if(A.parentObj.isOpen){if(A.comments.length==0){A.comments=D.place.posts;A.commentsCount=D.place.count;$(this.div).find(".commentGroup").remove();A.buildCommentsView()}else{$(A.commentsLoader).remove();A.comments=A.comments.concat(D.place.posts);A.appendComments(D.place.posts)}}$(A.div).find(".psLo").css("display","none");return }else{$(A.div).find(".psLo").css("display","none")}};if(A.parentObj.isMulti){if(A.parentObj.currentDisplayed>0){var B=loc.util.getWindowSize();loc.srv.IssueCommand("GetPlace",{id:A.parentObj.currentDisplayed,count:this.commentsLoadNumber,width:B.width,height:B.height,lastId:C},null,callback);this.isLoading=true;if(A.comments.length==0){$(A.div).find(".psLo").css("display","block")}}}else{if(A.parentObj.id>0){var B=loc.util.getWindowSize();loc.srv.IssueCommand("GetPlace",{id:A.parentObj.id,count:this.commentsLoadNumber,width:B.width,height:B.height,lastId:C},null,callback);this.isLoading=true;if(A.comments.length==0){$(A.div).find(".psLo").css("display","block")}return }}};Content.prototype.buildCommentsView=function(){var E=this;var F="";var A="";var B="";var C="";this.commentList=loc.util.createDiv("commentGroup","commentGroup"+this.parentObj.id);this.commentList.style.zIndex=-222;for(var D=0;D<this.comments.length;D++){if(this.comments[D][5].link!=""&&this.comments[D][5]!=undefined){F=loc.cfg.thumbnail.getLink(this.comments[D][5].link,"singleOpen")}A=loc.cfg.avatar.getAvatarLink(this.comments[D][4],"comment");this.addComment("append",this.comments[D][0],A,this.comments[D][2],this.comments[D][6],this.comments[D][3],F);A="";F=""}this.div.appendChild(this.commentList);B=$(this.div).find(".psSn").height();C=E.CONTENT_LIST_HEIGHT-B;if(!this.parentObj.isMulti){C=C+20}$(this.commentList).height(C+"px");this.commentList.onmousemove=function(G){loc.util.stopEventBubbling(G);return false};$(this.commentList).bind("DOMMouseScroll",function(){loc.scroller.loadNext($(E.commentList),E.parentObj)});$(this.commentList).bind("scroll",function(){loc.scroller.loadNext($(E.commentList),E.parentObj)});if(this.parentObj.commentsLoadNumber!=0){loc.scroller.setOnBottom($(E.commentList))}};Content.prototype.appendComments=function(C){var D="";var A="";for(var B=0;B<C.length;B++){if(C[B][5].link!=undefined&&C[B][5].link!=""){D=loc.cfg.thumbnail.getLink(C[B][5].link,"singleOpen")}A=loc.cfg.avatar.getAvatarLink(C[B][4],"comment");this.addComment("append",C[B][0],A,C[B][2],C[B][6],C[B][3],D);D="";A=""}};Content.prototype.showCommentLoader=function(){var B="";if(this.commentsLoader!==null){B=this.commentsLoader}else{B=document.createElement("div");B.className="commentItem";B.innerHTML='<div class="cBo" id="cBoLoader"><img src="http://www.locatik.com/static/1.1.15/image/load_c_yellow.gif" alt="Loading" /></div>';this.commentsLoader=B}var A=".commentItem:last";var C=$(this.commentList).find(A);if(C.length!==0){$(this.commentList).find(A).after($(this.commentsLoader))}};Content.prototype.removeReplayView=function(){var A=$(this.div).find(".psSn").height();var B=this.CONTENT_LIST_HEIGHT-A;if(!this.parentObj.isMulti){B=B+20}$(this.commentList).height(B+"px")};Content.prototype.buildReplayView=function(){var E=this;var H=document.createElement("div");$(H).attr("id","hr"+this.parentObj.id);$(H).attr("class","hr");$(this.hrLine).hide();var D=loc.util.createDiv("commentTAHolder","Comment"+this.parentObj.id);var G=document.createElement("textarea");G.setAttribute("id","t"+this.parentObj.id);G.name=("t"+this.parentObj.id);G.style.zIndex=3;G.rows="2";G.cols="39";G.tabindex="1";var A=loc.util.createDiv("submitCommentBtn tileset-main sprite-icon-send","SubmitCommentBtn"+this.parentObj.id);var F=loc.util.createDiv("cancelCommentBtn tileset-main sprite-icon-cancel","CancelCommentBtn"+this.parentObj.id);$(A).bind("click",function(I){loc.util.stopEventBubbling(I);loc.place.onclick("sendcomment","c",E.parentObj.id)});$(F).bind("click",function(I){loc.util.stopEventBubbling(I);loc.place.onclick("cancelcomment","c",E.parentObj.id)});D.appendChild(H);D.appendChild(G);D.appendChild(A);D.appendChild(F);this.commentTextarea=D;this.commentActionHolder.replaceChild(D,this.commentButton);var B=$(this.div).find(".psSn").height();var C=this.CONTENT_LIST_HEIGHT-B-$(this.div).find(".commentTAHolder").height()+20;if(jQuery.browser.msie){C=C-25}if(!this.parentObj.isMulti){C=C+20}this.commentList.style.height=C+"px";$("textArea").val("");$("textArea").select();$("textArea").focus()};Content.prototype.sendComment=function(){var C=this;var A=$(C.commentTextarea).find("textarea").val();if(A!==""){$(".submitCommentBtn").unbind();$(".cancelCommentBtn").unbind();$(C.commentActionHolder).unbind();var B=loc.util.createDiv("commentSending","");B.innerHTML="<img class='commentSendingImg' src='http://www.locatik.com/static/1.1.15/image/load_f.gif'/><span style='display:none'> Comment sent </span>";C.commentActionHolder.appendChild(B);var F=function(J,I,H){if(J){$(B).find("span").css("display","block");$(B).find("img").css("display","none");$(B).find("span").fadeOut(500,function(){C.commentActionHolder.replaceChild(C.commentButton,C.commentTextarea);C.removeReplayView();$(B).remove();C.comments="";C.getComments()})}else{$(B).remove();var G=loc.ui.modal;G.message(G.FAILURE,"Unable to add comment!");C.commentActionHolder.replaceChild(C.commentButton,C.commentTextarea);C.removeReplayView()}};var E=C.parentObj.id;if(this.parentObj.isMulti){E=C.parentObj.currentDisplayed}loc.srv.IssueCommand("AddPlace",{TopicId:E,Body:A,mode:0},null,F)}else{var D=$(C.commentTextarea).find("textarea");D.focus();D.css("border","1px solid red");D.keypress(function(){if(D.val()!==""){D.css("border","1px solid #7F9DB9")}})}};Content.prototype.updateContent=function(){var E=$(this.div);if(this.parentObj.isOpen){if(this.isZoomIn){$(E).find(".psTi").text(loc.util.getSnippet(this.title,this.TITLE_LENGTH_LONG))}else{if($(E).find(".psLo").length==0){var C=loc.cfg.host+"/static/1.1.1/image/load_f_yellow.gif";var D='<img src="'+C+'" class="psLo" style="display:none">';$(E).append(D);$(E).find(".psLo").append()}$(E).find(".psAu").text("by: "+this.authorName+", "+this.firstDate);$(E).find(".psTi").text(loc.util.getSnippet(this.title,this.TITLE_LENGTH_LONG));$(E).find(".psSn").html(this.firstBody);if(loc.user.isLogged){this.buildCommentButton()}}var B=loc.cfg.thumbnail.getLink(this.thumbnail.link,"singleOpen");var A=$(E).find("#psTh-"+this.parentObj.id);$(A).attr("src",B.src);this.hrLine=document.createElement("div");$(this.hrLine).attr("class","hr");$(this.hrLine).attr("id","hr"+this.parentObj.id);$(E).append($(this.hrLine))}else{if(this.isZoomIn){$(E).find(".psTi").text(loc.util.getSnippet(this.title,this.TITLE_LENGTH_SHORT))}else{$(E).find(".psAu").text("by: "+this.authorName+", "+this.date);$(E).find(".psTi").text(loc.util.getSnippet(this.title,this.TITLE_LENGTH_SHORT));$(E).find(".psSn").html(loc.util.getSnippet(this.snippet,18));$(E).find(".psLo").css("display","none");if(this.commentActionHolder){$(this.commentActionHolder).remove()}}var B=loc.cfg.thumbnail.getLink(this.thumbnail.link,"singleClose");var A=$(E).find("#psTh-"+this.parentObj.id);$(A).attr("src",B.src);$(E).find(".hr").remove();$(E).find(".commentGroup").remove()}};Content.prototype.addComment=function(A,B,F,I,D,J,K){var E="";if(K!=undefined&&K!=""){E='<img src="'+K.src+'" class="cTh" id="cTv'+B+"\"  onclick=\"loc.place.onclick('showCommentPhoto','p',"+this.parentObj.id+", {commentId:"+B+'})"/>'}var C='<div class="commentItem"><img src="'+F+'" class="cAv" id="cAv'+B+'"/><div class="cBo" id="cBo'+B+'">'+J+'</div><div class="cAu" id="cAu'+B+'"> by: '+I+", "+D+' </div> <div class="imgHolder">'+E+"</div></div>";if(A==="prepend"){var G=".commentItem:first";var H=$(this.commentList).find(G);if(H.length!==0){$(this.commentList).find(G).before(C)}else{this.commentList.innerHTML+=C}}else{this.commentList.innerHTML+=C}$(this.hrLine).show()};Content.prototype.cancelComment=function(){this.commentActionHolder.replaceChild(this.commentButton,this.commentTextarea);this.removeReplayView();$(this.hrLine).show()};Content.prototype.showPhoto=function(){if(this.parentObj.isOpen){if($(loc.cfg.thumbnail.unclickable).index(this.thumbnail.link)==-1){this.photoPopup(this.thumbnail.link,this.title)}}else{loc.place.onclick("toggle","p",this.parentObj.id)}};Content.prototype.showCommentPhoto=function(B){for(var A=0;A<this.comments.length;A++){if(this.comments[A][0]==B){this.comments[A][5].maxWidth=this.comments[A][5].w;this.comments[A][5].maxHeight=this.comments[A][5].h;this.photoPopup(this.comments[A][5].link,"");break}}};Content.prototype.photoPopup=function(G,H){var B=new Date();var F=document.documentElement.clientWidth;var E=document.documentElement.clientHeight-40;var D=G+"_"+F+"x"+E+"_"+B.getTime();var C='<div class="popupPhotoContainer"><img class="popupPhoto hidden"/></div><img class="popupLoader loader" src="'+loc.cfg.image.loader_photo+'"/><div class="popupTitle">Loading</div>';$.blockUI({message:C,css:{border:"10px solid white",padding:"0",top:"50%",left:"50%",width:"200px",height:"20px",margin:"-10px 0 0 -100px",cursor:"pointer"}});var A=$(".blockMsg");A.attr("title","Click to close this photo");A.click($.unblockUI);A.find(".popupPhoto").load(function(){var K=this;$(K).show();var J=A.find(".popupTitle");var I=K.height+J.height();A.animate({width:K.width+"px",marginLeft:(-K.width/2-10)+"px"},$.browser.msie?1200:500,"linear",function(){A.find(".loader").hide();J.text(H)});A.animate({height:I+"px",marginTop:(-I/2-10)+"px"},$.browser.msie?2200:1000)}).attr("src",D)};function newContent(A){this.parentObj=A;this.ui={newPlaceAnchor:null,newPlaceTitleInput:null,imageUploadHolder:null,newPlaceSnippet:null,descriptionTextarea:null,newPlaceTypeField:null,newPlaceNavHolder:null,newPlaceSaveBtn:null,newPlaceMoveBtn:null,newPlaceCancelBtn:null};this.photoNr=-1;this.initialize();this.parentObj.content=this}newContent.prototype.initialize=function(){var G=this;var A=document.createElement("div");A.className="newPlaceAnchor";A.style.position="absolute";this.ui.newPlaceAnchor=A;$(G.parentObj.div).append($(this.ui.newPlaceAnchor));var D=document.createElement("img");D.className="imagePlaceHolder";D.id="imagePlaceHolder";D.src="http://www.locatik.com/static/1.1.15/image/place/addPhoto.png";var F=document.createElement("input");F.setAttribute("id","newPlaceTitle");F.className="TitleInput";$(F).val("Place title");this.ui.newPlaceTitleInput=F;var E=document.createElement("textarea");E.setAttribute("id","newPlaceDescription");E.className="PlaceDescriptionTextarea";$(E).val("Enter a short place description");this.ui.descriptionTextarea=E;var I=document.createElement("fieldset");I.className="newPlaceRadioField";I.innerHTML='<legend class="newPlaceFieldLegend">Place visibility</legend>';this.ui.newPlaceTypeField=I;var J='<input type="radio" name="newPlaceType" id="newPlaceRadioPublic" class="newPlaceRadioType" value = "0" checked/> <label for="newPlaceRadioPublic">Public</label>';$(I).append(J);var L='<input type="radio" name="newPlaceType" id="newPlaceRadioPrivate" name="newPlaceRadioPrivate" class="newPlaceRadioType" value = "1" style="margin-left:10px"/> <label for="newPlaceRadioPrivate">Private</label>';$(I).append(L);var K=document.createElement("div");K.setAttribute("id","newPlaceNavHolder");K.className="newPlaceNav";this.ui.newPlaceNavHolder=K;var C=document.createElement("button");C.className="newPlaceSaveBtn tileset-main sprite-icon-save";C.setAttribute("id","newPlaceSaveBtn");this.ui.newPlaceSaveBtn=C;var B=document.createElement("button");B.className="newPlaceMoveBtn tileset-main sprite-icon-move";B.setAttribute("id","newPlaceMoveBtn");this.ui.newPlaceMoveBtn=B;var H=document.createElement("button");H.className="newPlaceCancelBtn tileset-main sprite-icon-cancel";H.setAttribute("id","newPlaceCancelBtn");this.ui.newPlaceCancelBtn=H;$(K).append(C);$(K).append(B);$(K).append(H);$(this.ui.newPlaceAnchor).append($(D));$(this.ui.newPlaceAnchor).append($(F));$(this.ui.newPlaceAnchor).append('<label class="inputFileLabel" for="UploadPlacePhoto">Select photo </label><input type="file" class="inputFile" name="UploadPlacePhoto" id="UploadPlacePhoto" onchange="loc.srv.ajaxFileUpload(\'UploadPlacePhoto\', \'place\');  $(\'#UploadPlacePhoto_loading\').css(\'visibility\',\'visible\'); return false;" /><img style="visibility:hidden" id="UploadPlacePhoto_loading" class="UploadPlacePhoto_loading" src="http://www.locatik.com/static/1.1.15/image/load_f.gif"/>');$(this.ui.newPlaceAnchor).append($(E));$(this.ui.newPlaceAnchor).append($(I));$(this.ui.newPlaceAnchor).append($(K));this.applyListeners();this.parentObj.setZindex()};newContent.prototype.applyListeners=function(){var A=this;this.ui.newPlaceTitleInput.onclick=function(){$(this).focus()};this.ui.newPlaceAnchor.onmouseover=function(){if(!loc.place.newPlace.hasOwnProperty()){A.parentObj.setZindex()}};this.ui.newPlaceTitleInput.onfocus=function(){if($(this).val()=="Place title"){$(this).val("")}};this.ui.newPlaceTitleInput.onblur=function(){if($(this).val()==""){$(this).val("Place title")}};this.ui.descriptionTextarea.onclick=function(){$(this).focus()};this.ui.descriptionTextarea.onfocus=function(){if($(this).val()=="Enter a short place description"){$(this).val("")}};this.ui.descriptionTextarea.onblur=function(){if($(this).val()==""){$(this).val("Enter a short place description")}};this.ui.newPlaceSaveBtn.onclick=function(){if($(A.ui.descriptionTextarea).val()!==""&&$(A.ui.descriptionTextarea).val()!=="Enter a short place description"){var B={Title:$(A.ui.newPlaceTitleInput).val(),Mode:$(A.ui.newPlaceTypeField).find("input:checked").val(),Longitude:A.parentObj.lng,Latitude:A.parentObj.lat,PhotoNo:A.photoNr,Body:$(A.ui.descriptionTextarea).val()};A.parentObj.savePlace(B)}else{$(A.ui.descriptionTextarea).focus()}};this.ui.newPlaceMoveBtn.onclick=function(){loc.place.onclick("startMove","newp")};this.ui.newPlaceCancelBtn.onclick=function(){loc.place.newPlace.remove();loc.place.newPlace={}}};newContent.prototype.initializeOpened=function(){};newContent.prototype.open=function(){};newContent.prototype.close=function(){};newContent.prototype.remove=function(){};newContent.prototype.openCSS=function(){};newContent.prototype.closeCSS=function(){};Content.prototype.startDrag=function(){this.close()};Content.prototype.stopDrag=function(){this.open()};var COUN=0;var DIFF=0;loc.userMarker={openMarkers:[],setMarkerData:function(G){var A=null;var B=null;var H=loc.userMarker.cacheMarkers(G);for(var F=0;F<H.markers.length;F++){if(H.markers[F].users.length==1){A=G.markers[F].users[0][1];if(loc.map.getMarkerById(A)==null){markert=new markerType.normal();B=loc.map.addMarker(H.markers[F].users[0],markert);if(B){B.show()}}}else{A=G.markers[F].info[1];if(loc.map.getMarkerById(A)==null){markert=new markerType.multi();for(var E=0,D=H.markers[F].users.length;E<D;E++){markert.markerList.push(H.markers[F].users[E])}B=loc.map.addMarker(H.markers[F].info,markert);if(B){B.show()}}else{}}}if(loc.userMarker.openMarkers){var I=null;for(var E=0;E<loc.userMarker.openMarkers.length;E++){for(var D=0;D<loc.map.markers.length;D++){A=loc.userMarker.openMarkers[E].id;msgWidowOpen=loc.userMarker.openMarkers[E].msg;B=loc.map.markers[D][1];if(B.isMulti){for(var C=0;C<B.markerList.length;C++){if(B.markerList[C][1]==A){B.openMarkerTab(C);if(msgWidowOpen){writeMessage(A)}loc.userMarker.openMarkers=[];return }}}else{if(B.id==A){B.openMarkerTab();if(msgWidowOpen){writeMessage(A)}loc.userMarker.openMarkers=[];return }}}}}},updateCache:function(D,E){var B=false;var A=loc.map.getMarkerById(D);if(A){for(var C=0;C<loc.srv.FriendData.friends.length;C++){if(loc.srv.FriendData.friends[C][1]===A.User.id){if(E.tikTime!==undefined){loc.srv.FriendData.friends[C][5]=E.tikTime}if(E.who!==undefined){loc.srv.FriendData.friends[C][6]=E.who}if(E.newest!==undefined){loc.srv.FriendData.friends[C][10][0]=E.newest}if(E.all!==undefined){loc.srv.FriendData.friends[C][10][1]=E.all}return }}if(loc.srv.FriendData.acc_to[0][1]==A.User.id){if(E.tikTime){loc.srv.FriendData.acc_to[0][5]=E.tikTime}if(E.who){loc.srv.FriendData.acc_to[0][6]=E.who}if(E.newest){loc.srv.FriendData.acc_to[0][10][0]=E.newest}if(E.all){loc.srv.FriendData.acc_to[0][10][1]=E.all}return }}},cacheMarkers:function(F){var A=null;var G=0;var B=false;var E=0;for(var D=loc.map.markers.length-1;D>=0;D--){B=false;for(var C=F.markers.length-1;C>=0;C--){G=F.markers[C].users.length==1?F.markers[C].users[0][1]:F.markers[C].info[1];if(loc.map.markers[D][0]==G){G=F.markers[C].users.length==1?F.markers[C].users[0][1]:F.markers[C].info[1];F.markers.splice(C,1);B=true;break}}if(!B){A=loc.map.markers[D][1];if(A.isOpen){loc.userMarker.openMarkers.push({id:A.User.id,msg:(A.Message&&A.Message.isOpen)?true:false})}A.remove();loc.map.markers.splice(D,1)}}return F},updateMarkerContent:function(C,B){var A=loc.map.getMarkerById(C);if(A){A.User.who=B;A.changeContentNavi()}},updateMarkersTime:function(F){for(var E=0,A=loc.map.markers.length;E<A;++E){A=loc.map.markers[E][1];if(A.isMulti){for(var D=0,G=F.markers.length;D<G;++D){if(A.id==F.markers[D].info[1]){A.markerList=[];for(var C=0,B=F.markers[D].users.length;C<B;C++){A.markerList.push(F.markers[D].users[C])}A.User.update();break}}}for(var C=0,B=F.friends.length;C<B;++C){A=loc.map.markers[E][1];if(A.User.id==F.friends[C][1]){A.User.tikTime=F.friends[C][5];A.User.Msg.newest=F.friends[C][10][0];if(A.isOpen){A.changeContentStatus();A.changeContentMessage()}break}}for(var C=0,B=F.markers.length;C<B;++C){if(loc.map.markers[E][0]==F.markers[C].info[1]){A=loc.map.markers[E][1];if(A.isOpen){for(var D=0,G=F.markers[C].users.length;D<G;++D){if(A.User.id==F.markers[C].users[D][1]){A.User.tikTime=F.markers[C].users[D][5];A.User.Msg.newest=F.markers[C].users[D][10][0];if(A.isOpen){A.changeContentStatus();A.changeContentMessage()}break}}}}}}}};var tableGroupNumber=4;var MaxVisibleClose=4;var MaxVisibleOpen=8;var LastClosedMarker=0;DivMultiMarker.prototype=new GMarker(new GLatLng(0,0));function DivMultiMarker(A,B){GMarker.apply(this,arguments);this.latlng=A;this.id=B.data[1];this.isOpen=B.isOpen||false;this.enableRange=B.enableRange||true;this.showRangeAlways=B.showRangeAlways||true;this.clickable=B.clickable||false;this.onTop=false;this.isMulti=true;var C=B.data[10]!=undefined?B.data[10]:[0,0];if(!C){C[0]=0;C[1]=0}this.latlng=A;this.Message=null;this.MarkerContent="";this.markerList=B.markerList||null;this.currentId=0;this.currentVisibleOpen=1;var D=this;this.User={update:function(){this.login=D.markerList[D.currentId][0];this.id=D.markerList[D.currentId][1];this.tikTime=D.markerList[D.currentId][5];this.who=D.markerList[D.currentId][6];this.avatar=D.markerList[D.currentId][7];this.latlng=new GLatLng(D.markerList[D.currentId][2],D.markerList[D.currentId][3]);this.Msg.update()}};this.User.Msg={update:function(){this.newest=D.markerList[D.currentId][10][0];this.all=D.markerList[D.currentId][10][1]}};this.UI={};this.UI.markercontentText=null;this.UI.markercontentAvatar=null;this.UI.contentTime=null;this.UI.navigationLinks=null;this.UI.div=null;this.UI.rawdiv=null;this.User.update()}DivMultiMarker.prototype.initialize=function(H){var B=this;this.map=H;GMarker.prototype.initialize.call(this,this.map);this.UI.div=$(loc.util.createDiv("marker multi"));this.UI.div.dblclick(loc.util.stopEventBubbling);this.UI.rawdiv=this.UI.div.get(0);this.UI.rawdiv.innerHTML='<div class="border top left   tileset-main     sprite-user-topleft"> </div><div class="border top center tileset-vertical sprite-user-top">     </div><div class="border top right  tileset-main     sprite-user-topright"></div><div class="border middle right tileset-main sprite-user-right"></div><div class="border middle left  tileset-main sprite-user-left"> </div><div class="border bottom left   tileset-main     sprite-user-bottomleft"></div><div class="border bottom center tileset-vertical sprite-user-bottom"><div class="kurzypazur         tileset-main     sprite-user-kurzypazur"></div></div><div class="border bottom right  tileset-main     sprite-user-bottomright"></div>';var G=$(loc.util.createDiv("markercontentMulti markercontent tileset-vertical sprite-user-middle"));G.mouseover(function(){B.setZindex()});var A=loc.util.createDiv("markercontentAvatar");this.UI.markercontentText=$(loc.util.createDiv("markercontentText"));this.UI.markercontentText.html(this.content);var C=loc.util.createDiv("markercontentNavi");var F=loc.util.createDiv("markercontentTable");this.UI.markercontentText.append(C);G.append(A);G.append(this.UI.markercontentText);G.append(F);var E=loc.util.createDiv("avatarNavi");this.UI.naviNext=document.createElement("a");this.UI.naviPrev=document.createElement("a");this.UI.naviNext.className="navigation next tileset-main sprite-user-down";this.UI.naviPrev.className="navigation prev tileset-main sprite-user-up";this.UI.naviNext.onclick=function(I){loc.util.stopEventBubbling(I);B.showNextAvatars();return false};this.UI.naviPrev.onclick=function(I){loc.util.stopEventBubbling(I);B.showPreviousAvatars();return false};E.appendChild(this.UI.naviPrev);E.appendChild(this.UI.naviNext);G.append(E);this.UI.div.append(G);if(this.clickable){this.UI.div.addClass("clickable");var D=this.UI.div.find(".border.middle.right").get(0);A.onclick=D.onclick=function(I){loc.util.stopEventBubbling(I);if(B.isOpen){B.closeMarkerTab()}else{B.openMarkerTab();B.showOnTop()}};A.ondblclick=D.ondblclick=loc.util.stopEventBubbling}this.map.getPane(G_MAP_MARKER_PANE).appendChild(this.UI.rawdiv);this.buildTableFromTo()};DivMultiMarker.prototype.redraw=function(A){if(!A){return }GMarker.prototype.redraw.call(this,loc.map.map);var B=this.map.fromLatLngToDivPixel(this.latlng);this.UI.rawdiv.style.left=B.x+"px";this.UI.rawdiv.style.top=B.y+"px";this.showOnTop()};DivMultiMarker.prototype.remove=function(){this.hideRange();$(this.UI.div).remove()};DivMultiMarker.prototype.changeMarkerTab=function(){if(this.isOpen){this.closeMarkerTab()}else{this.openMarkerTab()}};DivMultiMarker.prototype.openMarkerTab=function(A){if(A){this.currentId=A}loc.map.closeAllMarkerTab(this.id);this.changeContent();if(!this.isOpen){this.isOpen=true;this.toggleRange();this.UI.div.addClass("opened");this.UI.markercontentText.show();this.buildTableFromTo();this.showOnTop()}};DivMultiMarker.prototype.closeMarkerTab=function(){if(this.isOpen==true){this.isOpen=false;this.enableRange=false;this.toggleRange();this.UI.div.removeClass("opened");this.UI.markercontentText.hide();this.buildTableFromTo();if(this.Message!=null){this.Message.hide()}}};DivMultiMarker.prototype.setCurrentId=function(B){for(var A=0;A<this.markerList.length;A++){if(B==this.markerList[A][1]){this.currentId=A}}};DivMultiMarker.prototype.GetPoint=function(){return this.User.latlng};DivMultiMarker.prototype.showNext=function(){if(this.markerList!=null&&this.markerList.length>0){var A=this.markerList.length-1;if(this.currentId==-1||this.currentId==A){this.currentId=0}else{if(this.currentId<A){this.currentId++}}this.changeContent()}};DivMultiMarker.prototype.showPrevious=function(){if(this.markerList!=null&&this.markerList.length>0){var A=this.markerList.length-1;if(this.currentId==-1){this.currentId=0}else{if(this.currentId==0){this.currentId=A}else{this.currentId--}}this.changeContent()}};DivMultiMarker.prototype.setZindex=function(){this.zIndex=loc.map.getMaxZindex();this.UI.rawdiv.style.zIndex=this.zIndex};DivMultiMarker.prototype.toggleRange=function(){if(this.enableRange){loc.map.removeAllMarkerRanges()}};DivMultiMarker.prototype.showOnTop=function(){this.setZindex()};DivMultiMarker.prototype.changeContent=function(){this.User.update();this.changeContentAvatar();this.changeContentStatus();this.changeContentNavi();if(this.Message&&this.Message.isOpen){this.Message.hide()}};DivMultiMarker.prototype.changeContentStatus=function(C){if(C){this.User.tikTime=C}var A=this.UI.markercontentText.find(".contentLogin");if(A.length==0){var B=loc.util.formatString(loc.cfg.map.markerText,[this.User.login.toLowerCase(),this.User.tikTime,]);this.UI.markercontentText.append(B)}else{this.UI.markercontentText.find(".contentTime").html(this.User.tikTime);this.UI.markercontentText.find(".contentLogin").html(this.User.login)}};DivMultiMarker.prototype.changeContentNavi=function(){$("#naviLoading"+this.id).css("display","none");$(".navigationLinks").remove();var A=loc.ui.panel.buildNavi(this.User.who,this.User.id,this.User.Msg.newest);if(A){$(this.UI.markercontentText).append(A)}};DivMultiMarker.prototype.changeContentAvatar=function(){var C=loc.cfg.avatar.getAvatarLink(this.User.avatar,"marker");var A=this.UI.div.find(".markercontentAvatar");var B=A.find("img");if(B.length==0){A.append("<img src='"+C+"' class='markerAvatar'>")}else{B.attr("src",C)}};DivMultiMarker.prototype.changeContentMessage=function(){var C;var A=$("#userMsgButton"+this.User.id);var B=this.User.Msg.newest;if(B>0){C=loc.util.formatString(loc.lang.messageText,[B])}else{C=loc.lang.messageTextZero}A.html(C)};DivMultiMarker.prototype.buildTableFromTo=function(){var I=0;var J=4;var F=this;var L=MaxVisibleOpen;if(!this.isOpen){L=MaxVisibleClose}else{L=MaxVisibleOpen}I=(this.currentVisibleOpen-1)*L;J=this.markerList.length>(this.currentVisibleOpen*L)?this.currentVisibleOpen*L:this.markerList.length;var G=$(this.UI.naviNext);var K=$(this.UI.naviPrev);if((this.currentVisibleOpen*L)<this.markerList.length){G.css("visibility","visible");K.css("visibility",I==0?"hidden":"visible")}else{K.css("visibility",I==0?"hidden":"visible");G.css("visibility","hidden")}var B=null;var C=this.UI.div.find(".markercontentTable");C.empty();var F=this;for(var E=I;E<J;E++){var A=document.createElement("div");A.className="listAvatar";A.style.cursor="pointer";A.setAttribute("p",""+E);var H=document.createElement("a");H.setAttribute("i",""+E);H.title=""+this.markerList[E][0];H.onclick=function(N){loc.util.stopEventBubbling(N);var M=this.getAttribute("i");F.openMarkerTab(M);F.setZindex()};var D=document.createElement("img");D.src=loc.cfg.avatar.getAvatarLink(this.markerList[E][7],"multi");if(B!="undefined"||B!=null){if(this.markerList[E][1]==B){D.attr("class","categoryImageSelected")}}H.appendChild(D);A.appendChild(H);C.append(A)}return 0};DivMultiMarker.prototype.showAvatarTable=function(A){var B=this.UI.div.find(".listAvatar");if(B.length>A){for(i=0;i<B.length;i++){B[i].css("visibility",i<A?"visible":"hidden")}}};DivMultiMarker.prototype.showNextAvatars=function(){this.currentVisibleOpen++;this.buildTableFromTo()};DivMultiMarker.prototype.showPreviousAvatars=function(){if(this.currentVisibleOpen>1){this.currentVisibleOpen--;this.buildTableFromTo()}};DivMultiMarker.prototype.getPoint=function(){return this.point};DivMultiMarker.prototype.getLatlng=function(){return this.latlng};DivMultiMarker.prototype.drawRange=function(){if(this.drawRange&&this.User.accuracy>0||loc.cfg.map.drawZeroRange){if(this.User.accuracy==0){this.User.accuracy=loc.cfg.map.zeroRadius}this.range=new loc.map.Range(this.latlng,this.User.accuracy)}};DivMultiMarker.prototype.showRange=function(){if(this.enableRange){loc.map.removeAllMarkerRanges();if(!this.range){this.drawRange()}if(this.range){this.range.Show()}}};DivMultiMarker.prototype.hideRange=function(){if(this.range){this.range.Hide()}};DivMultiMarker.prototype.show=function(){loc.map.map.addOverlay(this)};jQuery.validator.addMethod("phone",function(B,A){return this.optional(A)||B.match(/^(\+|00)\d{1,}$/)},"");loc.validator={validators:new Array(),currentForm:"Login",getValidator:function(C){for(var B=0,A=this.validators.length;B<A;B++){if(this.validators[B].command==C){return this.validators[B]}}return null},showError:function(C,B){switch(C){case"Login":var A=this.getValidator(C);A.validator.showErrors({log_err:""+B});break;case"SetPosition":var A=this.getValidator(C);A.validator.showErrors({setPos_err:""+B});break;case"SetPhoneNo":var A=this.getValidator(C);A.validator.showErrors({log_err:""+B});break;case"Signup":var A=this.getValidator(C);A.validator.showErrors({sign_err:""+B});break;case"LostPassword":var A=this.getValidator(C);A.validator.showErrors({lostPassword_err:""+B});break;case"ChangePassword":var A=this.getValidator(C);A.validator.showErrors({changePassword_err:""+B});break;case"EnterSmsKey":var A=this.getValidator(C);A.validator.showErrors({enterSmsKey_err:""+B});break;case"ChangePhoneNo":var A=this.getValidator(C);A.validator.showErrors({changePhoneNo_err:""+B});break;case"SetNewPassword":var A=this.getValidator(C);A.validator.showErrors({setNewPass_err:""+B});case"SetTwitterData":var A=this.getValidator(C);A.validator.showErrors({setTwitterData_err:""+B});break}},validate:function(B){var A=this.getValidator(B);if(A==undefined){return true}return A.validator.form()},init:function(D){var A={errorClass:"invalid_error"};var C={errorClass:"invalid_error_inline"};var B=null;switch(D){case"Login":B=$("#log_form").validate(jQuery.extend({rules:{log_username:{required:true},log_password:{required:true}},messages:{log_username:{required:"Login is required"},log_password:{required:"Password is required"}},submitHandler:function(E){loc.srv.Command("Login",{username:$("#log_username").val(),password:$("#log_password").val(),remember:document.getElementById("log_remember").checked,redirect:$("#redirect").val()})}},A,C));break;case"Signup":B=$("#sign_form").validate(jQuery.extend({rules:{sign_username:{required:true,maxlength:32,minlength:5},sign_password:{required:true,maxlength:32,minlength:6},sign_confirm:{required:true,equalTo:"#sign_password"},sign_email:{required:true,maxlength:128,email:true},sign_phoneNo:{required:true,maxlength:16,phone:true},sign_terms:{required:true}},messages:{sign_username:{required:"Username is required",maxlength:"Username should be less than 32 characters",minlength:"Username should be more than 4 characters"},sign_password:{required:"Password is required",maxlength:"Password should be less than 33 characters",minlength:"Password should be more than 5 characters"},sign_confirm:{required:"Confirmation is required",equalTo:"Confirmation must match password above"},sign_email:{required:"Email is required",maxlength:"Email should have less be 127 characters",email:"Wrong email format"},sign_phoneNo:{maxlength:"Phone shoud be less than 17 characters",required:"Phone No. is required",phone:"Wrong format. Phone No. must start with + or 00"},sign_terms:{required:"You must agree to the Terms of Service"}},submitHandler:function(E){loc.srv.Command("Signup",{username:$("#sign_username").val(),password:$("#sign_password").val(),confirm:$("#sign_confirm").val(),email:$("#sign_email").val(),terms:document.getElementById("sign_terms").checked,phoneNo:$("#sign_phoneNo").val(),phoneModel:$("#sign_phoneModel").val()})}},A));break;case"LostPassword":B=$("#lostPassword_form").validate(jQuery.extend({rules:{lostpw_email:{required:true,maxlength:32,email:true}},messages:{lostpw_email:{required:"Email is required",maxlength:"Email should have less than 127 characters",email:"Wrong email format"}},submitHandler:function(E){loc.srv.Command("LostPassword",{email:$("#lostpw_email").val()})}},A));break;case"SetPosition":B=$("#setPos_form").validate(jQuery.extend({rules:{setPos_address:{required:true}},messages:{setPos_address:{required:"Address is required"}},submitHandler:function(E){loc.srv.Command("SetPosition",{Address:$("#setPos_address").val(),Mode:loc.user.PlacesMode})}},A));break;case"EnterSmsKey":B=$("#enterSmsKey_form").validate(jQuery.extend({rules:{enter_smsKey:{required:true,minlength:6,maxlength:6}},messages:{enter_smsKey:{maxlength:"Sms key shoud be less than 7 characters",minlength:"Sms key shoud be more than 5 characters",required:"Sms key is required"}},submitHandler:function(E){loc.srv.Command("EnterSmsKey",{SMSKey:$("#enter_smsKey").val()})}},A));break;case"ChangePhoneNo":B=$("#changePhoneNo_form").validate(jQuery.extend({rules:{change_phoneNo:{required:true,minlength:5,maxlength:16,phone:true}},messages:{change_phoneNo:{maxlength:"Phone shoud be less than 17 characters",minlength:"Phone shoud be more than 4 characters",required:"Phone No. is required",phone:"Wrong format. Phone No. must start with + or 00"}},submitHandler:function(E){loc.srv.Command("ChangePhoneNo",{phoneNo:$("#change_phoneNo").val()})}},A));break;case"ChangePassword":B=$("#changePassword_form").validate(jQuery.extend({rules:{pref_oldpass:{required:true},pref_newpass:{required:true,maxlength:32,minlength:6},pref_confirm:{required:true,equalTo:"#pref_newpass"}},messages:{pref_oldpass:{required:"Old password is required",maxlength:"Old password should be less than 33 characters",minlength:"Old password should be more than 5 characters"},pref_newpass:{required:"New password is required",maxlength:"New password should be less than 33 characters",minlength:"New password should be more than 5 characters"},pref_confirm:{required:"Confirm password is required",equalTo:"Confirmation must match password above"}},submitHandler:function(E){loc.srv.Command("ChangePassword",{old_pass:$("#pref_oldpass").val(),new_pass:$("#pref_newpass").val(),confirm:$("#pref_confirm").val()})}},A));break;case"SetNewPassword":B=$("#setNewPass_form").validate(jQuery.extend({rules:{setNewPass_email:{required:true,maxlength:128,email:true},setNewPass_newpass:{required:true,maxlength:32,minlength:6},setNewPass_confirm:{required:true,equalTo:"#setNewPass_newpass"}},messages:{setNewPass_email:{required:"Email is required",maxlength:"Email should have less be 127 characters",email:"Wrong email format"},setNewPass_newpass:{required:"New password is required",maxlength:"New password should be less than 33 characters",minlength:"New password should be more than 5 characters"},setNewPass_confirm:{required:"Confirm password is required",equalTo:"Confirmation must match password above"}}},A));break;case"SetTwitterData":B=$("#setTwitterData_form").validate(jQuery.extend({rules:{setLogin_twitter:{required:true,maxlength:30,minlength:2},setPass_twitter:{required:true,maxlength:15,minlength:2}},messages:{setLogin_twitter:{required:"Login is required",maxlength:"Login password should be less than 31 characters",minlength:"New password should be more than 5 characters"},setPass_twitter:{required:"Password is required",maxlength:"Password should be less than 16 characters",minlength:"Password should be more than 5 characters"}}},A));break}if(B){this.validators.push({validator:B,command:D})}}};var messages=[];function writeMessage(B){var A=loc.map.getMarkerById(B);if(A){if(A.Message){A.Message.remove()}A.Message=null;A.Message=new Message({id:B,markerId:A.id,userName:A.User.login,messageStatus:[A.User.Msg.newest,A.User.Msg.all]});A.Message.show();loc.console.debug(B,A.id,A)}}function Message(A){this.userName=A.userName||"";this.id=A.id;this.unread=A.unread;this.messages=A.messages||[];this.status=null;this.currentMessage=null;this.messageStatus=A.messageStatus||null;this.isOpen=false;this.currentVisible=0;this.currentVisibleId=0;this.markerId=A.markerId;if(this.messageStatus[0]>0){this.type="waiting"}else{this.type="new"}this.div="";this.initialize();this.fillHTML();this.getNewMesages()}Message.prototype.show=function(){if(!this.isOpen){messages.push(this);this.div.style.display="block";if(this.messages!=null&&this.messages.length!=0){if(this.type=="all"){this.updateContentTextHTML()}}this.isOpen=true;$(".messContentText").focus()}else{this.type=="all";this.updateContentTextHTML()}};Message.prototype.hide=function(){if(this.isOpen){this.isOpen=false;this.div.style.display="none"}};Message.prototype.getNewMesages=function(){var B=this;var A=function(F,E,D){if(F){B.messages=[];for(var C=D.messages.length-1;C>=0;C--){B.messages.push(D.messages[C])}if(B.messages.length>0){B.currentVisible=B.messages.length-1;if(B.type!="new"){B.type="all";B.fillHTML();if(B.currentVisibleId==0){B.showNext()}else{B.showChoosed(B.currentVisibleId)}B.updateMessageNumber()}}else{if(B.type!="new"){B.currentVisible=0;B.currentVisibleId=0;B.type="empty";B.fillHTML()}}}else{}};loc.srv.IssueCommand("UserMessages",{sender:this.id},null,A)};Message.prototype.setStatusOnList=function(){for(var A=0;A<this.messages.length;A++){if(this.messages[A][2]==0&&this.messages[A][1]==this.id){return }}$("#newMess"+this.id).remove()};Message.prototype.setAsRead=function(){var A=this;callback=function(E,D,C){if(E){for(var B=0;B<A.messages.length;B++){if(A.messages[B][0]==C.msg_deleted[0]){A.messages[B][2]=1}}if(C.msg_deleted[0]==A.messages[A.currentVisible][0]){$("#messContentText"+A.id).css("font-weight","normal")}A.messageStatus[0]=0;for(var B=0;B<A.messages.length;B++){if(A.messages[B][2]==0&&A.messages[B][1]==A.id){A.messageStatus[0]++}}A.updateMessageNumber();A.setStatusOnList()}else{}};loc.srv.IssueCommand("ReadMessages",{ids:A.messages[A.currentVisible][0]},null,callback)};Message.prototype.showNext=function(){if(this.messages!=null&&this.messages.length!=0){if(this.currentVisible<this.messages.length-1){this.currentVisible++;this.currentVisibleId=this.messages[this.currentVisible][0]}this.updateContentTextHTML();if(this.messages[this.currentVisible][2]==0&&this.messages[this.currentVisible][1]==this.id){this.setAsRead()}}};Message.prototype.showPrevious=function(){if(this.currentVisible>0){this.currentVisible--;this.currentVisibleId=this.messages[this.currentVisible][0];this.updateContentTextHTML();if(this.messages[this.currentVisible][2]==0&&this.messages[this.currentVisible][1]==this.id){this.setAsRead()}}};Message.prototype.showChoosed=function(A){if(this.currentVisible>0){for(var B=0;B<this.messages.length;B++){if(this.messages[B][0]==A){this.currentVisible=B;this.currentVisibleId=A}}this.updateContentTextHTML();if(this.messages[this.currentVisible][2]==0&&this.messages[this.currentVisible][1]==this.id){this.setAsRead()}}};Message.prototype.replay=function(){this.show();this.buildReplayHTML()};Message.prototype.dispalyMessHTML=function(){this.show();this.build()};Message.prototype.newMessHTML=function(){this.show();this.buildNew()};Message.prototype.fillHTML=function(){var A=$("#messcontent"+this.id);if(A.length>0){A.empty();switch(this.type){case"new":this.buildNewHTML();break;case"all":this.buildAllHTML();break;case"empty":this.buildEmptyHTML();break;case"waiting":this.buildWaitingHTML();break}}};Message.prototype.buildAllHTML=function(){var C=this;var B=$("#messcontent"+this.id);var A=document.createElement("span");A.setAttribute("id","fromTo"+this.id);A.className="msgFromTo";B.append(A);var A=document.createElement("span");A.setAttribute("id","msgDate"+this.id);A.className="msgDate";B.append(A);var A=document.createElement("div");A.className="msgClose tileset-main sprite-icon-close";A.onclick=function(){C.hide();$("#messCreateDiv"+this.id).remove();return false};B.append(A);var A=document.createElement("span");A.setAttribute("id","messContentText"+this.id);A.className="msgText";A.innerHTML=loc.lang.emptyInbox;B.append(A);var A=document.createElement("a");A.setAttribute("id","messButton"+this.id);A.title="newer";A.className="msgNaviRight";A.innerHTML="< Newer";A.onclick=function(D){C.showNext();loc.util.stopEventBubbling(D);return false};A.onmousedown=function(D){return false};B.append(A);var A=document.createElement("span");A.setAttribute("id","msgPosition"+this.id);A.className="msgPosition";B.append(A);var A=document.createElement("a");A.setAttribute("id","messButton"+this.id);A.title="older";A.className="msgNaviLeft";A.innerHTML="Older >";A.onclick=function(D){C.showPrevious();loc.util.stopEventBubbling(D);return false};A.onmousedown=function(D){return false};B.append(A);var A=document.createElement("a");A.setAttribute("id","messButton"+this.id);A.title="new";A.innerHTML="Write";A.className="msgNew";A.onclick=function(){C.type="new";C.fillHTML();return false};B.append(A)};Message.prototype.buildWaitingHTML=function(){var C=this;var B=$("#messcontent"+this.id);var A=document.createElement("div");A.className="msgClose tileset-main sprite-icon-close";A.onclick=function(){C.hide();return false};B.append(A);var A=document.createElement("span");A.setAttribute("id","messContentText"+this.id);A.innerHTML=loc.lang.waitingForMsgData;B.append(A);var A=document.createElement("a");A.setAttribute("id","messButton"+this.id);A.title="new";A.innerHTML="Write";A.className="msgNew";A.onclick=function(){C.type="new";C.fillHTML();return false};B.append(A)};Message.prototype.buildEmptyHTML=function(){var C=this;var B=$("#messcontent"+this.id);var A=document.createElement("div");A.className="msgClose tileset-main sprite-icon-close";A.onclick=function(){C.hide();return false};B.append(A);var A=document.createElement("span");A.setAttribute("id","messContentText"+this.id);A.className="msgText";A.innerHTML=loc.lang.emptyInbox;B.append(A);var A=document.createElement("a");A.setAttribute("id","messButton"+this.id);A.title="new";A.innerHTML="Write";A.className="msgNew";A.onclick=function(){C.type="new";C.fillHTML();return false};B.append(A)};Message.prototype.buildNewHTML=function(){var G=this;var E=$("#messcontent"+this.id);var A=document.createElement("div");A.className="msgClose tileset-main sprite-icon-close";A.onclick=function(){G.hide();return false};E.append(A);var A=document.createElement("div");A.className="msgSending";var B=document.createElement("img");B.src="http://www.locatik.com/static/1.1.15/image/load_f.gif";var D=document.createElement("span");D.className="msgSendingText";D.setAttribute("id","msgSendingText"+this.id);D.innerHTML="message sent";D.style.display="none";A.appendChild(D);A.appendChild(B);E.append(A);var E=$("#messcontent"+this.id);var A=document.createElement("span");A.innerHTML="New message";A.className="msgTitle";E.append(A);var F="charcount"+this.id;var A=document.createElement("span");A.setAttribute("id",F);A.className="charcount";A.innerHTML="";E.append(A);var C=document.createElement("textarea");C.setAttribute("id","messText"+this.id);C.name=("messContentText"+this.id);C.rows="2";C.cols="39";C.className="messContentText";C.innerHTML="";$(C).charCounter(loc.cfg.message.maxLength,{container:"#"+F,format:"%1 characters left"});E.append(C);var A=document.createElement("a");A.setAttribute("id","messButton"+this.id);A.className="msgSend";A.title="Send";A.innerHTML="Send";A.onclick=function(){var H=$("#messText"+G.id);var I=H.val();if(I==""){H.focus();$("#"+F).html(loc.lang.message.noContent)}else{loc.srv.UpdateMessage("PostMessage",{to:G.id,body:I,message:G});H.blur();$(".msgSending").fadeIn(500)}return false};E.append(A);var A=document.createElement("a");A.setAttribute("id","messButton"+this.id);A.className="msgCancel";A.title="Cancel";A.innerHTML="Inbox";A.onclick=function(){if(G.messageStatus[1]>0){if(G.messages.length>0){G.type="all";G.fillHTML();G.showNext()}else{G.type="waiting";G.fillHTML()}}else{G.type="empty";G.fillHTML()}$("#messText"+G.id).blur();return false};E.append(A)};Message.prototype.buildStatusHTML=function(){var A=document.createElement("div");A.innerHTML="Messages";return"Messages"};Message.prototype.updateContentTextHTML=function(){if(this.messages[this.currentVisible][1]!=this.id){$("#fromTo"+this.id).text("From: Me")}else{$("#fromTo"+this.id).text("From: "+this.userName)}$("#msgDate"+this.id).text(""+this.messages[this.currentVisible][4]);$("#messContentText"+this.id).text(this.messages[this.currentVisible][3]);if(this.messages[this.currentVisible][2]==0&&this.messages[this.currentVisible][1]==this.id){$("#messContentText"+this.id).css("font-weight","bold")}else{$("#messContentText"+this.id).css("font-weight","normal")}$("#msgPosition"+this.id).text((this.messages.length-this.currentVisible)+"/"+this.messages.length)};Message.prototype.getNrUnreadMsg=function(){var A=0;for(var B=0;B<this.messages.length;B++){if(this.messages[B][2]==0&&this.messages[B][1]==this.id){A++}}return A};Message.prototype.updateMessageNumber=function(){var B=this.getNrUnreadMsg();var A=loc.map.getMarkerById(this.id);if(A){A.User.Msg.newest=B;if(A.isMulti){for(var C=0;C<A.markerList.length;C++){if(A.markerList[C][1]==A.User.id){A.markerList[C][10][0]=B;break}}}}for(var C=0;C<loc.srv.FriendData.friends.length;C++){if(loc.srv.FriendData.friends[C][1]==A.User.id){loc.srv.FriendData.friends[C][10][0]=B;break}}A.changeContentMessage()};function buildLoadingHTML(A){var B=document.createElement("img");B.src="www.locatik.com/static/1.1.15/image/load_f.gif";B.style.display="none";B.name=A;return B}Message.prototype.initialize=function(){var D=this;var H=loc.util.createDiv("mess","messCreateDiv"+this.id);loc.util.stopMapEvents(H);var F=loc.util.createDiv("messcontent","messcontent"+this.id);var B=loc.util.createDiv("shadow-topMes","");B.innerHTML='<div class="left tileset-main sprite-mess-topleft"></div> <div class="center tileset-vertical sprite-mess-top"></div> <div class="right tileset-main sprite-mess-topright"></div> ';var G=loc.util.createDiv("shadow-middleMes","");G.innerHTML='<div class="left tileset-horizontal sprite-mess-left"></div><div class="right tileset-horizontal sprite-mess-right"> </div> ';var C=loc.util.createDiv("shadow-bottomMes","");C.innerHTML='<div class="left tileset-main sprite-mess-bottomleft"></div><div class="center tileset-vertical sprite-mess-bottom"><div class="kurzypazurMes tileset-main sprite-mess-kurzypazur"></div></div><div class="right tileset-main sprite-mess-bottomright"></div>';H.appendChild(F);H.appendChild(B);H.appendChild(G);H.appendChild(C);H.style.display="none";H.style.position="absolute";H.style.width="270px";H.style.height="100px";H.style.left="55px";H.style.top="-100px";H.style.zIndex="41";this.div=H;var A=loc.map.getMarkerById(this.markerId);loc.console.debug(A,this.markerId);if(A){if(A.isMulti){var E=$(A.UI.div)}else{var E=$(A.UI.div)}loc.console.debug("elemAv!!!!!",E);if(E.length>0){E.append(H)}}H.onmouseover=function(){D.showOnTop()}};Message.prototype.redraw=function(){if(this.isOpen){var A=document.getElementById("createDiv"+this.id);if(A!=undefined){A.appendChild(this.div)}}else{this.hide()}};Message.prototype.updateMessage=function(){this.getNewMesages()};Message.prototype.remove=function(){this.div.style.display="none";$(this.div).remove();this.isOpen=false};Message.prototype.setZindex=function(){var A=loc.map.getMaxZindex();this.zIndex=A;this.div.style.zIndex=A};Message.prototype.showOnTop=function(){var A=loc.map.getMarkerById(this.markerId);if(A){A.setZindex()}this.setZindex()};function checkIsInCache(B){for(var A=0;A<messages.length;A++){if(messages[A].id==B){return true}}return false}loc.twitter={init:function(){if(loc.user.TwitterLogin!=""){this.showLogout()}else{this.showLogin()}},showLogout:function(){$("#LogoutTwitterDataButton").css("display","block");$("#LoginTwitterDataButton").css("display","none");var A=loc.util.formatString(loc.lang.TwitterLogged,[loc.user.TwitterLogin]);$("#TwitterText").text(A);$("#LoginControls").css("display","none")},showLogin:function(){$("#LogoutTwitterDataButton").css("display","none");$("#LoginTwitterDataButton").css("display","block");var A=loc.lang.TwitterNotLogged;$("#TwitterText").text(A);$("#LoginControls").css("display","block")},logout:function(){$("#ResetTwitterData_loading").css("visibility","visible");var A=function(D,C,B){if(D){loc.user.TwitterLogin="";$("#ResetTwitterData_loading").css("visibility","hidden");loc.twitter.showLogin()}else{$("#ResetTwitterData_loading").css("visibility","hidden")}};loc.srv.IssueCommand("ResetTwitterData",{},null,A)},login:function(){$("#SetTwitterData_loading").css("visibility","visible");var A=function(D,C,B){if(D){loc.user.TwitterLogin=$("#setLogin_twitter").val();$("#SetTwitterData_loading").css("visibility","hidden");loc.twitter.showLogout()}else{loc.validator.showError("SetTwitterData",C);$("#SetTwitterData_loading").css("visibility","hidden")}};if(loc.validator.validate("SetTwitterData")){loc.srv.IssueCommand("SetTwitterData",{login:$("#setLogin_twitter").val(),password:$("#setPass_twitter").val()},null,A)}else{$("#SetTwitterData_loading").css("visibility","hidden")}}};
