(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);};});})();;;(function($){$.fn.extend({autocomplete:function(urlOrData,options){var isUrl=typeof urlOrData=="string";options=$.extend({},$.Autocompleter.defaults,{url:isUrl?urlOrData:null,data:isUrl?null:urlOrData,delay:isUrl?$.Autocompleter.defaults.delay:10,max:options&&!options.scroll?10:150},options);options.highlight=options.highlight||function(value){return value;};options.formatMatch=options.formatMatch||options.formatItem;return this.each(function(){new $.Autocompleter(this,options);});},result:function(handler){return this.bind("result",handler);},search:function(handler){return this.trigger("search",[handler]);},flushCache:function(){return this.trigger("flushCache");},setOptions:function(options){return this.trigger("setOptions",[options]);},unautocomplete:function(){return this.trigger("unautocomplete");}});$.Autocompleter=function(input,options){var KEY={UP:38,DOWN:40,DEL:46,TAB:9,RETURN:13,ESC:27,COMMA:188,PAGEUP:33,PAGEDOWN:34,BACKSPACE:8};var $input=$(input).attr("autocomplete","off").addClass(options.inputClass);var timeout;var previousValue="";var cache=$.Autocompleter.Cache(options);var hasFocus=0;var lastKeyPressCode;var config={mouseDownOnSelect:false};var select=$.Autocompleter.Select(options,input,selectCurrent,config);var blockSubmit;$.browser.opera&&$(input.form).bind("submit.autocomplete",function(){if(blockSubmit){blockSubmit=false;return false;}});$input.bind(($.browser.opera?"keypress":"keydown")+".autocomplete",function(event){hasFocus=1;lastKeyPressCode=event.keyCode;switch(event.keyCode){case KEY.UP:event.preventDefault();if(select.visible()){select.prev();}else{onChange(0,true);}
break;case KEY.DOWN:event.preventDefault();if(select.visible()){select.next();}else{onChange(0,true);}
break;case KEY.PAGEUP:event.preventDefault();if(select.visible()){select.pageUp();}else{onChange(0,true);}
break;case KEY.PAGEDOWN:event.preventDefault();if(select.visible()){select.pageDown();}else{onChange(0,true);}
break;case options.multiple&&$.trim(options.multipleSeparator)==","&&KEY.COMMA:case KEY.TAB:case KEY.RETURN:if(selectCurrent()){event.preventDefault();blockSubmit=true;return false;}
break;case KEY.ESC:select.hide();break;default:clearTimeout(timeout);timeout=setTimeout(onChange,options.delay);break;}}).focus(function(){hasFocus++;}).blur(function(){hasFocus=0;if(!config.mouseDownOnSelect){hideResults();}}).click(function(){if(hasFocus++>1&&!select.visible()){onChange(0,true);}}).bind("search",function(){var fn=(arguments.length>1)?arguments[1]:null;function findValueCallback(q,data){var result;if(data&&data.length){for(var i=0;i<data.length;i++){if(data[i].result.toLowerCase()==q.toLowerCase()){result=data[i];break;}}}
if(typeof fn=="function")fn(result);else $input.trigger("result",result&&[result.data,result.value]);}
$.each(trimWords($input.val()),function(i,value){request(value,findValueCallback,findValueCallback);});}).bind("flushCache",function(){cache.flush();}).bind("setOptions",function(){$.extend(options,arguments[1]);if("data"in arguments[1])
cache.populate();}).bind("unautocomplete",function(){select.unbind();$input.unbind();$(input.form).unbind(".autocomplete");});function selectCurrent(){var selected=select.selected();if(!selected)
return false;var v=selected.result;previousValue=v;if(options.multiple){var words=trimWords($input.val());if(words.length>1){var seperator=options.multipleSeparator.length;var cursorAt=$(input).selection().start;var wordAt,progress=0;$.each(words,function(i,word){progress+=word.length;if(cursorAt<=progress){wordAt=i;return false;}
progress+=seperator;});words[wordAt]=v;v=words.join(options.multipleSeparator);}
v+=options.multipleSeparator;}
$input.val(v);hideResultsNow();$input.trigger("result",[selected.data,selected.value]);return true;}
function onChange(crap,skipPrevCheck){if(lastKeyPressCode==KEY.DEL){select.hide();return;}
var currentValue=$input.val();if(!skipPrevCheck&&currentValue==previousValue)
return;previousValue=currentValue;currentValue=lastWord(currentValue);if(currentValue.length>=options.minChars){$input.addClass(options.loadingClass);if(!options.matchCase)
currentValue=currentValue.toLowerCase();request(currentValue,receiveData,hideResultsNow);}else{stopLoading();select.hide();}};function trimWords(value){if(!value)
return[""];if(!options.multiple)
return[$.trim(value)];return $.map(value.split(options.multipleSeparator),function(word){return $.trim(value).length?$.trim(word):null;});}
function lastWord(value){if(!options.multiple)
return value;var words=trimWords(value);if(words.length==1)
return words[0];var cursorAt=$(input).selection().start;if(cursorAt==value.length){words=trimWords(value)}else{words=trimWords(value.replace(value.substring(cursorAt),""));}
return words[words.length-1];}
function autoFill(q,sValue){if(options.autoFill&&(lastWord($input.val()).toLowerCase()==q.toLowerCase())&&lastKeyPressCode!=KEY.BACKSPACE){$input.val($input.val()+sValue.substring(lastWord(previousValue).length));$(input).selection(previousValue.length,previousValue.length+sValue.length);}};function hideResults(){clearTimeout(timeout);timeout=setTimeout(hideResultsNow,200);};function hideResultsNow(){var wasVisible=select.visible();select.hide();clearTimeout(timeout);stopLoading();if(options.mustMatch){$input.search(function(result){if(!result){if(options.multiple){var words=trimWords($input.val()).slice(0,-1);$input.val(words.join(options.multipleSeparator)+(words.length?options.multipleSeparator:""));}
else{$input.val("");$input.trigger("result",null);}}});}};function receiveData(q,data){if(data&&data.length&&hasFocus){stopLoading();select.display(data,q);autoFill(q,data[0].value);select.show();}else{hideResultsNow();}};function request(term,success,failure){if(!options.matchCase)
term=term.toLowerCase();var data=cache.load(term);if(data&&data.length){success(term,data);}else if((typeof options.url=="string")&&(options.url.length>0)){var extraParams={timestamp:+new Date()};$.each(options.extraParams,function(key,param){extraParams[key]=typeof param=="function"?param():param;});$.ajax({mode:"abort",port:"autocomplete"+input.name,dataType:options.dataType,url:options.url,data:$.extend({q:lastWord(term),limit:options.max},extraParams),success:function(data){var parsed=options.parse&&options.parse(data)||parse(data);cache.add(term,parsed);success(term,parsed);}});}else{select.emptyList();failure(term);}};function parse(data){var parsed=[];var rows=data.split("\n");for(var i=0;i<rows.length;i++){var row=$.trim(rows[i]);if(row){row=row.split("|");parsed[parsed.length]={data:row,value:row[0],result:options.formatResult&&options.formatResult(row,row[0])||row[0]};}}
return parsed;};function stopLoading(){$input.removeClass(options.loadingClass);};};$.Autocompleter.defaults={inputClass:"ac_input",resultsClass:"ac_results",loadingClass:"ac_loading",minChars:1,delay:400,matchCase:false,matchSubset:true,matchContains:false,cacheLength:10,max:100,mustMatch:false,extraParams:{},selectFirst:true,formatItem:function(row){return row[0];},formatMatch:null,autoFill:false,width:0,multiple:false,multipleSeparator:", ",highlight:function(value,term){return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)("+term.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi,"\\$1")+")(?![^<>]*>)(?![^&;]+;)","gi"),"<strong>$1</strong>");},scroll:true,scrollHeight:180};$.Autocompleter.Cache=function(options){var data={};var length=0;function matchSubset(s,sub){if(!options.matchCase)
s=s.toLowerCase();var i=s.indexOf(sub);if(options.matchContains=="word"){i=s.toLowerCase().search("\\b"+sub.toLowerCase());}
if(i==-1)return false;return i==0||options.matchContains;};function add(q,value){if(length>options.cacheLength){flush();}
if(!data[q]){length++;}
data[q]=value;}
function populate(){if(!options.data)return false;var stMatchSets={},nullData=0;if(!options.url)options.cacheLength=1;stMatchSets[""]=[];for(var i=0,ol=options.data.length;i<ol;i++){var rawValue=options.data[i];rawValue=(typeof rawValue=="string")?[rawValue]:rawValue;var value=options.formatMatch(rawValue,i+1,options.data.length);if(value===false)
continue;var firstChar=value.charAt(0).toLowerCase();if(!stMatchSets[firstChar])
stMatchSets[firstChar]=[];var row={value:value,data:rawValue,result:options.formatResult&&options.formatResult(rawValue)||value};stMatchSets[firstChar].push(row);if(nullData++<options.max){stMatchSets[""].push(row);}};$.each(stMatchSets,function(i,value){options.cacheLength++;add(i,value);});}
setTimeout(populate,25);function flush(){data={};length=0;}
return{flush:flush,add:add,populate:populate,load:function(q){if(!options.cacheLength||!length)
return null;if(!options.url&&options.matchContains){var csub=[];for(var k in data){if(k.length>0){var c=data[k];$.each(c,function(i,x){if(matchSubset(x.value,q)){csub.push(x);}});}}
return csub;}else
if(data[q]){return data[q];}else
if(options.matchSubset){for(var i=q.length-1;i>=options.minChars;i--){var c=data[q.substr(0,i)];if(c){var csub=[];$.each(c,function(i,x){if(matchSubset(x.value,q)){csub[csub.length]=x;}});return csub;}}}
return null;}};};$.Autocompleter.Select=function(options,input,select,config){var CLASSES={ACTIVE:"ac_over"};var listItems,active=-1,data,term="",needsInit=true,element,list;function init(){if(!needsInit)
return;element=$("<div/>").hide().addClass(options.resultsClass).css("position","absolute").appendTo(document.body);list=$("<ul/>").appendTo(element).mouseover(function(event){if(target(event).nodeName&&target(event).nodeName.toUpperCase()=='LI'){active=$("li",list).removeClass(CLASSES.ACTIVE).index(target(event));$(target(event)).addClass(CLASSES.ACTIVE);}}).click(function(event){$(target(event)).addClass(CLASSES.ACTIVE);select();input.focus();return false;}).mousedown(function(){config.mouseDownOnSelect=true;}).mouseup(function(){config.mouseDownOnSelect=false;});if(options.width>0)
element.css("width",options.width);needsInit=false;}
function target(event){var element=event.target;while(element&&element.tagName!="LI")
element=element.parentNode;if(!element)
return[];return element;}
function moveSelect(step){listItems.slice(active,active+1).removeClass(CLASSES.ACTIVE);movePosition(step);var activeItem=listItems.slice(active,active+1).addClass(CLASSES.ACTIVE);if(options.scroll){var offset=0;listItems.slice(0,active).each(function(){offset+=this.offsetHeight;});if((offset+activeItem[0].offsetHeight-list.scrollTop())>list[0].clientHeight){list.scrollTop(offset+activeItem[0].offsetHeight-list.innerHeight());}else if(offset<list.scrollTop()){list.scrollTop(offset);}}};function movePosition(step){active+=step;if(active<0){active=listItems.size()-1;}else if(active>=listItems.size()){active=0;}}
function limitNumberOfItems(available){return options.max&&options.max<available?options.max:available;}
function fillList(){list.empty();var max=limitNumberOfItems(data.length);for(var i=0;i<max;i++){if(!data[i])
continue;var formatted=options.formatItem(data[i].data,i+1,max,data[i].value,term);if(formatted===false)
continue;var li=$("<li/>").html(options.highlight(formatted,term)).addClass(i%2==0?"ac_even":"ac_odd").appendTo(list)[0];$.data(li,"ac_data",data[i]);}
listItems=list.find("li");if(options.selectFirst){listItems.slice(0,1).addClass(CLASSES.ACTIVE);active=0;}
if($.fn.bgiframe)
list.bgiframe();}
return{display:function(d,q){init();data=d;term=q;fillList();},next:function(){moveSelect(1);},prev:function(){moveSelect(-1);},pageUp:function(){if(active!=0&&active-8<0){moveSelect(-active);}else{moveSelect(-8);}},pageDown:function(){if(active!=listItems.size()-1&&active+8>listItems.size()){moveSelect(listItems.size()-1-active);}else{moveSelect(8);}},hide:function(){element&&element.hide();listItems&&listItems.removeClass(CLASSES.ACTIVE);active=-1;},visible:function(){return element&&element.is(":visible");},current:function(){return this.visible()&&(listItems.filter("."+CLASSES.ACTIVE)[0]||options.selectFirst&&listItems[0]);},show:function(){var offset=$(input).offset();element.css({width:typeof options.width=="string"||options.width>0?options.width:$(input).width(),top:offset.top+input.offsetHeight,left:offset.left}).show();if(options.scroll){list.scrollTop(0);list.css({maxHeight:options.scrollHeight,overflow:'auto'});if($.browser.msie&&typeof document.body.style.maxHeight==="undefined"){var listHeight=0;listItems.each(function(){listHeight+=this.offsetHeight;});var scrollbarsVisible=listHeight>options.scrollHeight;list.css('height',scrollbarsVisible?options.scrollHeight:listHeight);if(!scrollbarsVisible){listItems.width(list.width()-parseInt(listItems.css("padding-left"))-parseInt(listItems.css("padding-right")));}}}},selected:function(){var selected=listItems&&listItems.filter("."+CLASSES.ACTIVE).removeClass(CLASSES.ACTIVE);return selected&&selected.length&&$.data(selected[0],"ac_data");},emptyList:function(){list&&list.empty();},unbind:function(){element&&element.remove();}};};$.fn.selection=function(start,end){if(start!==undefined){return this.each(function(){if(this.createTextRange){var selRange=this.createTextRange();if(end===undefined||start==end){selRange.move("character",start);selRange.select();}else{selRange.collapse(true);selRange.moveStart("character",start);selRange.moveEnd("character",end);selRange.select();}}else if(this.setSelectionRange){this.setSelectionRange(start,end);}else if(this.selectionStart){this.selectionStart=start;this.selectionEnd=end;}});}
var field=this[0];if(field.createTextRange){var range=document.selection.createRange(),orig=field.value,teststring="<->",textLength=range.text.length;range.text=teststring;var caretAt=field.value.indexOf(teststring);field.value=orig;this.selection(caretAt,caretAt+textLength);return{start:caretAt,end:caretAt+textLength}}else if(field.selectionStart!==undefined){return{start:field.selectionStart,end:field.selectionEnd}}};})(jQuery);;(function($){function PopUpCal(){this.debug=false;this._nextId=0;this._inst=[];this._curInst=null;this._disabledInputs=[];this._popUpShowing=false;this._inDialog=false;this.regional=[];this.regional['']={clearText:'Clear',closeText:'Close',prevText:'&lt;Prev',nextText:'Next&gt;',currentText:'Today',dayNames:['Su','Mo','Tu','We','Th','Fr','Sa'],monthNames:['January','February','March','April','May','June','July','August','September','October','November','December'],dateFormat:'DMY/',firstDay:0};this._defaults={autoPopUp:'focus',defaultDate:null,appendText:'',buttonText:'...',buttonImage:'',buttonImageOnly:false,closeAtTop:true,hideIfNoPrevNext:false,changeMonth:true,changeYear:true,yearRange:'-10:+10',changeFirstDay:true,showOtherMonths:false,minDate:null,maxDate:null,speed:'medium',customDate:null,fieldSettings:null,onSelect:null,numberOfMonths:1,stepMonths:1,rangeSelect:false,rangeSeparator:' - '};$.extend(this._defaults,this.regional['']);this._calendarDiv=$('<div id="calendar_div"></div>');$(document.body).append(this._calendarDiv).mousedown(this._checkExternalClick);}
$.extend(PopUpCal.prototype,{markerClassName:'hasCalendar',log:function(){if(this.debug){console.log.apply('',arguments);}},_register:function(inst){var id=this._nextId++;this._inst[id]=inst;return id;},_getInst:function(id){return this._inst[id]||id;},setDefaults:function(settings){extendRemove(this._defaults,settings||{});},_doKeyDown:function(e){var inst=popUpCal._getInst(this._calId);if(popUpCal._popUpShowing){switch(e.keyCode){case 9:popUpCal.hideCalendar(inst,'');break;case 13:popUpCal._selectDay(inst,inst._selectedMonth,inst._selectedYear,$('td.calendar_daysCellOver',inst._calendarDiv)[0]);break;case 27:popUpCal.hideCalendar(inst,inst._get('speed'));break;case 33:popUpCal._adjustDate(inst,(e.ctrlKey?-1:-inst._get('stepMonths')),(e.ctrlKey?'Y':'M'));break;case 34:popUpCal._adjustDate(inst,(e.ctrlKey?+1:+inst._get('stepMonths')),(e.ctrlKey?'Y':'M'));break;case 35:if(e.ctrlKey)popUpCal._clearDate(inst);break;case 36:if(e.ctrlKey)popUpCal._gotoToday(inst);break;case 37:if(e.ctrlKey)popUpCal._adjustDate(inst,-1,'D');break;case 38:if(e.ctrlKey)popUpCal._adjustDate(inst,-7,'D');break;case 39:if(e.ctrlKey)popUpCal._adjustDate(inst,+1,'D');break;case 40:if(e.ctrlKey)popUpCal._adjustDate(inst,+7,'D');break;}}
else if(e.keyCode==36&&e.ctrlKey){popUpCal.showFor(this);}},_doKeyPress:function(e){var inst=popUpCal._getInst(this._calId);var chr=String.fromCharCode(e.charCode==undefined?e.keyCode:e.charCode);return(chr<' '||chr==inst._get('dateFormat').charAt(3)||(chr>='0'&&chr<='9'));},_connectCalendar:function(target,inst){var input=$(target);if(this._hasClass(input,this.markerClassName)){return;}
var appendText=inst._get('appendText');if(appendText){input.after('<span class="calendar_append">'+appendText+'</span>');}
var autoPopUp=inst._get('autoPopUp');if(autoPopUp=='focus'||autoPopUp=='both'){input.focus(this.showFor);}
if(autoPopUp=='button'||autoPopUp=='both'){var buttonText=inst._get('buttonText');var buttonImage=inst._get('buttonImage');var buttonImageOnly=inst._get('buttonImageOnly');var trigger=$(buttonImageOnly?'<img class="calendar_trigger" src="'+
buttonImage+'" alt="'+buttonText+'" title="'+buttonText+'"/>':'<button type="button" class="calendar_trigger">'+(buttonImage!=''?'<img src="'+buttonImage+'" alt="'+buttonText+'" title="'+buttonText+'"/>':buttonText)+'</button>');input.wrap('<span class="calendar_wrap"></span>').after(trigger);trigger.click(this.showFor);}
input.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress);input[0]._calId=inst._id;},_inlineCalendar:function(target,inst){var input=$(target);if(this._hasClass(input,this.markerClassName)){return;}
input.addClass(this.markerClassName).append(inst._calendarDiv);input[0]._calId=inst._id;this._updateCalendar(inst);inst._calendarDiv.resize(function(){popUpCal._inlineShow(inst);});},_inlineShow:function(inst){var numMonths=inst._get('numberOfMonths');numMonths=(numMonths==null?1:(typeof numMonths=='number'?numMonths:numMonths[1]));inst._calendarDiv.width(numMonths*$('.calendar',inst._calendarDiv[0]).width());},_hasClass:function(element,className){var classes=element.attr('class');return(classes&&classes.indexOf(className)>-1);},dialogCalendar:function(dateText,onSelect,settings,pos){var inst=this._dialogInst;if(!inst){inst=this._dialogInst=new PopUpCalInstance({},false);this._dialogInput=$('<input type="text" size="1" style="position: absolute; top: -100px;"/>');this._dialogInput.keydown(this._doKeyDown);$('body').append(this._dialogInput);this._dialogInput[0]._calId=inst._id;}
extendRemove(inst._settings,settings||{});this._dialogInput.val(dateText);this._pos=pos||[($(window).width()/2)-100,($(window).height()/2)-150];if(document.documentElement&&(document.documentElement.scrollTop)){browserTopY=document.documentElement.scrollTop;}
else{browserTopY=document.body.scrollTop;}
this._pos[1]=this._pos[1]+browserTopY;this._dialogInput.css('left',this._pos[0]+'px').css('top',this._pos[1]+'px');inst._settings.onSelect=onSelect;this._inDialog=true;this._calendarDiv.addClass('calendar_dialog');this.showFor(this._dialogInput[0]);if($.blockUI){$.blockUI(this._calendarDiv);}},enableFor:function(inputs){inputs=(inputs.jquery?inputs:$(inputs));inputs.each(function(){this.disabled=false;$('../button.calendar_trigger',this).each(function(){this.disabled=false;});$('../img.calendar_trigger',this).css({opacity:'1.0',cursor:''});var $this=this;popUpCal._disabledInputs=$.map(popUpCal._disabledInputs,function(value){return(value==$this?null:value);});});},disableFor:function(inputs){inputs=(inputs.jquery?inputs:$(inputs));inputs.each(function(){this.disabled=true;$('../button.calendar_trigger',this).each(function(){this.disabled=true;});$('../img.calendar_trigger',this).css({opacity:'0.5',cursor:'default'});var $this=this;popUpCal._disabledInputs=$.map(popUpCal._disabledInputs,function(value){return(value==$this?null:value);});popUpCal._disabledInputs[popUpCal._disabledInputs.length]=this;});},reconfigureFor:function(control,settings){control=(typeof control=='string'?$(control)[0]:control);var inst=this._getInst(control._calId);if(inst){extendRemove(inst._settings,settings||{});this._updateCalendar(inst);}},setDateFor:function(control,date){control=(typeof control=='string'?$(control)[0]:control);var inst=this._getInst($(control)[0]._calId);if(inst){inst._setDate(date);this._updateCalendar(inst);}},getDateFor:function(control){control=(typeof control=='string'?$(control)[0]:control);var inst=this._getInst(control._calId);return(inst?inst._getDate():null);},showFor:function(target){target=(typeof target=='string'?$(target)[0]:target);var input=(target.nodeName&&target.nodeName.toLowerCase()=='input'?target:this);if(input.nodeName.toLowerCase()!='input'){input=$('input',input.parentNode)[0];}
if(popUpCal._lastInput==input){return;}
for(var i=0;i<popUpCal._disabledInputs.length;i++){if(popUpCal._disabledInputs[i]==input){return;}}
var inst=popUpCal._getInst(input._calId);var fieldSettings=inst._get('fieldSettings');extendRemove(inst._settings,(fieldSettings?fieldSettings(input):{}));popUpCal.hideCalendar(inst,'');popUpCal._lastInput=input;inst._setDateFromField(input);if(popUpCal._inDialog){input.value='';}
if(!popUpCal._pos){popUpCal._pos=popUpCal._findPos(input);popUpCal._pos[1]+=input.offsetHeight;}
inst._calendarDiv.css('position',(popUpCal._inDialog&&$.blockUI?'static':'absolute')).css('left',popUpCal._pos[0]+'px').css('top',popUpCal._pos[1]+'px');popUpCal._pos=null;popUpCal._showCalendar(inst);},_showCalendar:function(id){var inst=this._getInst(id);inst._rangeStart=null;this._updateCalendar(inst);if(!inst._inline){var speed=inst._get('speed');var postProcess=function(){popUpCal._popUpShowing=true;popUpCal._afterShow(inst);};inst._calendarDiv.show(speed,postProcess);if(speed==''){postProcess();}
if(inst._input[0].type!='hidden'){inst._input[0].focus();}
this._curInst=inst;}},_updateCalendar:function(inst){inst._calendarDiv.empty().append(inst._generateCalendar());if(inst._get('numberOfMonths')!=1){inst._calendarDiv.addClass('calendar_multi');}
else{inst._calendarDiv.removeClass('calendar_multi');}
if(inst._input&&inst._input[0].type!='hidden'){inst._input[0].focus();}},_afterShow:function(inst){var numMonths=inst._get('numberOfMonths');numMonths=(numMonths==null?1:(typeof numMonths=='number'?numMonths:numMonths[1]));inst._calendarDiv.width(numMonths*$('.calendar',inst._calendarDiv[0]).width());if($.browser.msie){$('#calendar_cover').css({width:inst._calendarDiv.width()+4,height:inst._calendarDiv.height()+4});}
var pos=popUpCal._findPos(inst._input[0]);browserWidth=$(window).width();if(document.documentElement&&(document.documentElement.scrollLeft)){browserX=document.documentElement.scrollLeft;}
else{browserX=document.body.scrollLeft;}
if((inst._calendarDiv.offset().left+inst._calendarDiv.width())>(browserWidth+browserX)){inst._calendarDiv.css('left',(pos[0]+$(inst._input[0]).width()-inst._calendarDiv.width())+'px');}
browserHeight=$(window).height();if(document.documentElement&&(document.documentElement.scrollTop)){browserTopY=document.documentElement.scrollTop;}
else{browserTopY=document.body.scrollTop;}
if((inst._calendarDiv.offset().top+inst._calendarDiv.height())>(browserTopY+browserHeight)){inst._calendarDiv.css('top',(pos[1]-inst._calendarDiv.height())+'px');}},hideCalendar:function(id,speed){var inst=this._getInst(id);var rangeSelect=inst._get('rangeSelect');if(rangeSelect&&this._stayOpen){this._appendDate=true;this._selectDate(id,inst._formatDate());}
this._stayOpen=false;if(this._popUpShowing){speed=(speed!=null?speed:inst._get('speed'));inst._calendarDiv.hide(speed,function(){popUpCal._tidyDialog(inst);});if(speed==''){this._tidyDialog(inst);}
this._popUpShowing=false;this._lastInput=null;inst._settings.prompt=null;if(this._inDialog){this._dialogInput.css('position','absolute').css('left','0px').css('top','-100px');if($.blockUI){$.unblockUI();$('body').append(this._calendarDiv);}}
this._inDialog=false;}
this._curInst=null;},_tidyDialog:function(inst){inst._calendarDiv.removeClass('calendar_dialog');$('.calendar_prompt',inst._calendarDiv).remove();},_checkExternalClick:function(event){if(!popUpCal._curInst){return;}
var target=$(event.target);if((target.parents("#calendar_div").length==0)&&(target.attr('class')!='calendar_trigger')&&popUpCal._popUpShowing&&!(popUpCal._inDialog&&$.blockUI))
{popUpCal.hideCalendar(popUpCal._curInst,'');}},_adjustDate:function(id,offset,period){var inst=this._getInst(id);inst._adjustDate(offset,period);this._updateCalendar(inst);},_gotoToday:function(id){var date=new Date();var inst=this._getInst(id);inst._selectedDay=date.getDate();inst._selectedMonth=date.getMonth();inst._selectedYear=date.getFullYear();this._adjustDate(inst);},_selectMonthYear:function(id,select,period){var inst=this._getInst(id);inst._selectingMonthYear=false;inst[period=='M'?'_selectedMonth':'_selectedYear']=select.options[select.selectedIndex].value-0;this._adjustDate(inst);},_clickMonthYear:function(id){var inst=this._getInst(id);if(inst._input&&inst._selectingMonthYear&&!$.browser.msie){inst._input[0].focus();}
inst._selectingMonthYear=!inst._selectingMonthYear;},_changeFirstDay:function(id,a){var inst=this._getInst(id);var dayNames=inst._get('dayNames');var value=a.firstChild.nodeValue;for(var i=0;i<7;i++){if(dayNames[i]==value){inst._settings.firstDay=i;break;}}
this._updateCalendar(inst);},_selectDay:function(id,month,year,td){var inst=this._getInst(id);var rangeSelect=inst._get('rangeSelect');if(rangeSelect){if(!this._stayOpen){this._stayOpen=true;$('.calendar td').removeClass('calendar_currentDay');$(td).addClass('calendar_currentDay');}
else{this._appendDate=true;this._stayOpen=false;}}
inst._selectedDay=$("a",td).html();inst._selectedMonth=month;inst._selectedYear=year;this._selectDate(id);if(this._stayOpen){inst._endDay=inst._endMonth=inst._endYear=null;inst._rangeStart=new Date(inst._selectedYear,inst._selectedMonth,inst._selectedDay);this._updateCalendar(inst);}
else if(rangeSelect){if(inst._inline){inst._endDay=inst._currentDay;inst._endMonth=inst._currentMonth;inst._endYear=inst._currentYear;inst._selectedDay=inst._currentDay=inst._rangeStart.getDate();inst._selectedMonth=inst._currentMonth=inst._rangeStart.getMonth();inst._selectedYear=inst._currentYear=inst._rangeStart.getFullYear();inst._rangeStart=null;this._updateCalendar(inst);}
else{inst._rangeStart=null;}}},_clearDate:function(id){this._selectDate(id,'');},_selectDate:function(id,dateStr){var inst=this._getInst(id);dateStr=(dateStr!=null?dateStr:inst._formatDate());if(this._appendDate){dateStr=inst._formatDate(inst._rangeStart)+inst._get('rangeSeparator')+dateStr;this._appendDate=false;}
if(inst._input){inst._input.val(dateStr);}
var onSelect=inst._get('onSelect');if(onSelect){onSelect(dateStr,inst);}
else{inst._input.trigger('change');}
if(inst._inline){this._updateCalendar(inst);}
else{if(!this._stayOpen){this.hideCalendar(inst,inst._get('speed'));}}},noWeekends:function(date){var day=date.getDay();return[(day>0&&day<6),''];},_findPos:function(obj){while(obj&&(obj.type=='hidden'||obj.nodeType!=1)){obj=obj.nextSibling;}
var curleft=curtop=0;if(obj&&obj.offsetParent){curleft=obj.offsetLeft;curtop=obj.offsetTop;while(obj=obj.offsetParent){var origcurleft=curleft;curleft+=obj.offsetLeft;if(curleft<0){curleft=origcurleft;}
curtop+=obj.offsetTop;}}
return[curleft,curtop];}});function PopUpCalInstance(settings,inline){this._id=popUpCal._register(this);this._selectedDay=0;this._selectedMonth=0;this._selectedYear=0;this._input=null;this._inline=inline;this._calendarDiv=(!inline?popUpCal._calendarDiv:$('<div id="calendar_div_'+this._id+'" class="calendar_inline"></div>'));this._settings=extendRemove({},settings||{});if(inline){this._setDate(this._getDefaultDate());}}
$.extend(PopUpCalInstance.prototype,{_get:function(name){return(this._settings[name]!=null?this._settings[name]:popUpCal._defaults[name]);},_setDateFromField:function(input){this._input=$(input);var dateFormat=this._get('dateFormat');var currentDate=this._input.val().split(dateFormat.charAt(3));this._endDay=this._endMonth=this._endYear=null;if(currentDate.length==3){this._currentDay=parseInt(currentDate[dateFormat.indexOf('D')],10);this._currentMonth=parseInt(currentDate[dateFormat.indexOf('M')],10)-1;this._currentYear=parseInt(currentDate[dateFormat.indexOf('Y')],10);}
else if(currentDate.length==5){currentDateArray=this._input.val().split(this._get('rangeSeparator'));currentDate=currentDateArray[0].split(dateFormat.charAt(3));this._currentDay=parseInt(currentDate[dateFormat.indexOf('D')],10);this._currentMonth=parseInt(currentDate[dateFormat.indexOf('M')],10)-1;this._currentYear=parseInt(currentDate[dateFormat.indexOf('Y')],10);currentDate=currentDateArray[1].split(dateFormat.charAt(3));this._endDay=parseInt(currentDate[dateFormat.indexOf('D')],10);this._endMonth=parseInt(currentDate[dateFormat.indexOf('M')],10)-1;this._endYear=parseInt(currentDate[dateFormat.indexOf('Y')],10);}
else{var date=this._getDefaultDate();this._currentDay=date.getDate();this._currentMonth=date.getMonth();this._currentYear=date.getFullYear();}
this._selectedDay=this._currentDay;this._selectedMonth=this._currentMonth;this._selectedYear=this._currentYear;this._adjustDate();},_getDefaultDate:function(){var offsetDate=function(offset){var date=new Date();date.setDate(date.getDate()+offset);return date;};var defaultDate=this._get('defaultDate');return(defaultDate==null?new Date():(typeof defaultDate=='number'?offsetDate(defaultDate):defaultDate));},_setDate:function(date){this._selectedDay=this._currentDay=date.getDate();this._selectedMonth=this._currentMonth=date.getMonth();this._selectedYear=this._currentYear=date.getFullYear();this._adjustDate();},_getDate:function(){return new Date(this._currentYear,this._currentMonth,this._currentDay);},_generateCalendar:function(){var today=new Date();today=new Date(today.getFullYear(),today.getMonth(),today.getDate());var controls='<div class="calendar_control">'+'<div class="calendar_clear"><a onclick="popUpCal._clearDate('+this._id+');">'+
this._get('clearText')+'</a></div>'+'<div class="calendar_close"><a onclick="popUpCal.hideCalendar('+this._id+');">'+
this._get('closeText')+'</a></div></div>';var prompt=this._get('prompt');var closeAtTop=this._get('closeAtTop');var hideIfNoPrevNext=this._get('hideIfNoPrevNext');var numMonths=this._get('numberOfMonths');var stepMonths=this._get('stepMonths');var isMultiMonth=(numMonths!=1);numMonths=(numMonths==null?[1,1]:(typeof numMonths=='number'?[1,numMonths]:numMonths));var html=(prompt?'<div class="calendar_prompt">'+prompt+'</div>':'')+
(closeAtTop&&!this._inline?controls:'')+'<div class="calendar_links"><div class="calendar_prev">'+
(this._canAdjustMonth(-1)?'<a onclick="popUpCal._adjustDate('+this._id+', -'+stepMonths+', \'M\');">'+this._get('prevText')+'</a>':(hideIfNoPrevNext?'':'<label>'+this._get('prevText')+'</label>'))+'</div>'+
(this._isInRange(today)?'<div class="calendar_current"><a '+'onclick="popUpCal._gotoToday('+this._id+');">'+this._get('currentText')+'</a></div>':'')+'<div class="calendar_next">'+
(this._canAdjustMonth(+1)?'<a onclick="popUpCal._adjustDate('+this._id+', +'+stepMonths+', \'M\');">'+this._get('nextText')+'</a>':(hideIfNoPrevNext?'':'<label>'+this._get('nextText')+'</label>'))+'</div></div>';var minDate=this._getMinDate();var maxDate=this._get('maxDate');var drawMonth=this._selectedMonth;var drawYear=this._selectedYear;for(var row=0;row<numMonths[0];row++){for(var col=0;col<numMonths[1];col++){html+='<div class="calendar_oneMonth'+(col==0?' calendar_newRow':'')+'">'+
this._generateMonthYearHeader(drawMonth,drawYear,minDate,maxDate,row>0||col>0)+'<table class="calendar" cellpadding="0" cellspacing="0"><thead>'+'<tr class="calendar_titleRow">';var firstDay=this._get('firstDay');var changeFirstDay=this._get('changeFirstDay');var dayNames=this._get('dayNames');for(var dow=0;dow<7;dow++){html+='<td>'+(!changeFirstDay?'':'<a onclick="popUpCal._changeFirstDay('+this._id+', this);">')+
dayNames[(dow+firstDay)%7]+(changeFirstDay?'</a>':'')+'</td>';}
html+='</tr></thead><tbody>';var daysInMonth=this._getDaysInMonth(drawYear,drawMonth);this._selectedDay=Math.min(this._selectedDay,daysInMonth);var leadDays=(this._getFirstDayOfMonth(drawYear,drawMonth)-firstDay+7)%7;var currentDate=new Date(this._currentYear,this._currentMonth,this._currentDay);var endDate=this._endDay?new Date(this._endYear,this._endMonth,this._endDay):currentDate;var selectedDate=new Date(drawYear,drawMonth,this._selectedDay);var printDate=new Date(drawYear,drawMonth,1-leadDays);var numRows=(isMultiMonth?6:Math.ceil((leadDays+daysInMonth)/7));var customDate=this._get('customDate');var showOtherMonths=this._get('showOtherMonths');var count=0;for(var dRow=0;dRow<numRows;dRow++){html+='<tr class="calendar_daysRow">';for(var dow=0;dow<7;dow++){var customSettings=(customDate?customDate(printDate):[true,'']);var otherMonth=(printDate.getMonth()!=drawMonth);var unselectable=otherMonth||!customSettings[0]||(minDate&&printDate<minDate)||(maxDate&&printDate>maxDate);html+='<td class="calendar_daysCell'+
((dow+firstDay+6)%7>=5?' calendar_weekEndCell':'')+
(otherMonth?' calendar_otherMonth':'')+
(printDate.getTime()==selectedDate.getTime()&&drawMonth==this._selectedMonth?' calendar_daysCellOver':'')+
(unselectable?' calendar_unselectable':'')+
(otherMonth&&!showOtherMonths?'':' '+customSettings[1]+
(printDate.getTime()>=currentDate.getTime()&&printDate.getTime()<=endDate.getTime()?' calendar_currentDay':(printDate.getTime()==today.getTime()?' calendar_today':'')))+'"'+
(unselectable?'':' onmouseover="$(this).addClass(\'calendar_daysCellOver\');"'+' onmouseout="$(this).removeClass(\'calendar_daysCellOver\');"'+' onclick="popUpCal._selectDay('+this._id+','+drawMonth+','+drawYear+', this);"')+'>'+
(otherMonth?(showOtherMonths?printDate.getDate():'&nbsp;'):(unselectable?printDate.getDate():'<a>'+printDate.getDate()+'</a>'))+'</td>';printDate.setDate(printDate.getDate()+1);}
html+='</tr>';}
drawMonth++;if(drawMonth>11){drawMonth=0;drawYear++;}
html+='</tbody></table></div>';}}
html+=(!closeAtTop&&!this._inline?controls:'')+'<div style="clear: both;"></div>'+(!$.browser.msie?'':'<!--[if lte IE 6.5]><iframe src="javascript:false;" class="calendar_cover"></iframe><![endif]-->');return html;},_generateMonthYearHeader:function(drawMonth,drawYear,minDate,maxDate,secondary){var html='<div class="calendar_header">';var monthNames=this._get('monthNames');if(secondary||!this._get('changeMonth')){html+=monthNames[drawMonth]+'&nbsp;';}
else{var inMinYear=(minDate&&minDate.getFullYear()==drawYear);var inMaxYear=(maxDate&&maxDate.getFullYear()==drawYear);html+='<select class="calendar_newMonth" '+'onchange="popUpCal._selectMonthYear('+this._id+', this, \'M\');" '+'onclick="popUpCal._clickMonthYear('+this._id+');">';for(var month=0;month<12;month++){if((!inMinYear||month>=minDate.getMonth())&&(!inMaxYear||month<=maxDate.getMonth())){html+='<option value="'+month+'"'+
(month==drawMonth?' selected="selected"':'')+'>'+monthNames[month]+'</option>';}}
html+='</select>';}
if(secondary||!this._get('changeYear')){html+=drawYear;}
else{var years=this._get('yearRange').split(':');var year=0;var endYear=0;if(years.length!=2){year=drawYear-10;endYear=drawYear+10;}
else if(years[0].charAt(0)=='+'||years[0].charAt(0)=='-'){year=drawYear+parseInt(years[0],10);endYear=drawYear+parseInt(years[1],10);}
else{year=parseInt(years[0],10);endYear=parseInt(years[1],10);}
year=(minDate?Math.max(year,minDate.getFullYear()):year);endYear=(maxDate?Math.min(endYear,maxDate.getFullYear()):endYear);html+='<select class="calendar_newYear" '+'onchange="popUpCal._selectMonthYear('+this._id+', this, \'Y\');" '+'onclick="popUpCal._clickMonthYear('+this._id+');">';for(;year<=endYear;year++){html+='<option value="'+year+'"'+
(year==drawYear?' selected="selected"':'')+'>'+year+'</option>';}
html+='</select>';}
html+='</div>';return html;},_adjustDate:function(offset,period){var date=new Date(this._selectedYear+(period=='Y'?offset:0),this._selectedMonth+(period=='M'?offset:0),this._selectedDay+(period=='D'?offset:0));var minDate=this._getMinDate();var maxDate=this._get('maxDate');date=(minDate&&date<minDate?minDate:date);date=(maxDate&&date>maxDate?maxDate:date);this._selectedDay=date.getDate();this._selectedMonth=date.getMonth();this._selectedYear=date.getFullYear();},_getMinDate:function(){var minDate=this._get('minDate');return(!this._rangeStart?minDate:(!minDate||this._rangeStart>minDate?this._rangeStart:minDate));},_getDaysInMonth:function(year,month){return 32-new Date(year,month,32).getDate();},_getFirstDayOfMonth:function(year,month){return new Date(year,month,1).getDay();},_canAdjustMonth:function(offset){var date=new Date(this._selectedYear,this._selectedMonth+offset,1);if(offset<0){date.setDate(this._getDaysInMonth(date.getFullYear(),date.getMonth()));}
return this._isInRange(date);},_isInRange:function(date){var minDate=this._get('minDate');var maxDate=this._get('maxDate');return((!minDate||date>=minDate)&&(!maxDate||date<=maxDate));},_formatDate:function(day,month,year){if(!day){day=this._currentDay=this._selectedDay;month=this._currentMonth=this._selectedMonth;year=this._currentYear=this._selectedYear;}
else if(typeof day=='object'){year=day.getFullYear();month=day.getMonth();day=day.getDate();}
month++;var dateFormat=this._get('dateFormat');var dateString='';for(var i=0;i<3;i++){dateString+=dateFormat.charAt(3)+
(dateFormat.charAt(i)=='D'?(day<10?'0':'')+day:(dateFormat.charAt(i)=='M'?(month<10?'0':'')+month:(dateFormat.charAt(i)=='Y'?year:'?')));}
return dateString.substring(dateFormat.charAt(3)?1:0);}});function extendRemove(target,props){$.extend(target,props);for(var name in props){if(props[name]==null){target[name]=null;}}
return target;}
$.fn.calendar=function(settings){return this.each(function(){var inlineSettings=null;for(attrName in popUpCal._defaults){var attrValue=this.getAttribute('cal:'+attrName);if(attrValue){inlineSettings=inlineSettings||{};try{inlineSettings[attrName]=eval(attrValue);}
catch(err){inlineSettings[attrName]=attrValue;}}}
var nodeName=this.nodeName.toLowerCase();if(nodeName=='input'){var instSettings=(inlineSettings?$.extend($.extend({},settings||{}),inlineSettings||{}):settings);var inst=(inst&&!inlineSettings?inst:new PopUpCalInstance(instSettings,false));popUpCal._connectCalendar(this,inst);}
else if(nodeName=='div'||nodeName=='span'){var instSettings=$.extend($.extend({},settings||{}),inlineSettings||{});var inst=new PopUpCalInstance(instSettings,true);popUpCal._inlineCalendar(this,inst);}});};$(document).ready(function(){popUpCal=new PopUpCal();});})(jQuery);;
/*
 * jQuery corner plugin: simple corner rounding
 * Examples and documentation at: http://jquery.malsup.com/corner/
 * version 2.03 (05-DEC-2009)
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 */
;(function($){var ua=navigator.userAgent;var moz=$.browser.mozilla&&/gecko/i.test(ua);var webkit=$.browser.safari&&/Safari\/[5-9]/.test(ua);var expr=$.browser.msie&&(function(){var div=document.createElement('div');try{div.style.setExpression('width','0+0');div.style.removeExpression('width');}
catch(e){return false;}
return true;})();function sz(el,p){return parseInt($.css(el,p))||0;};function hex2(s){var s=parseInt(s).toString(16);return(s.length<2)?'0'+s:s;};function gpc(node){for(;node&&node.nodeName.toLowerCase()!='html';node=node.parentNode){var v=$.css(node,'backgroundColor');if(v=='rgba(0, 0, 0, 0)')
continue;if(v.indexOf('rgb')>=0){var rgb=v.match(/\d+/g);return'#'+hex2(rgb[0])+hex2(rgb[1])+hex2(rgb[2]);}
if(v&&v!='transparent')
return v;}
return'#ffffff';};function getWidth(fx,i,width){switch(fx){case'round':return Math.round(width*(1-Math.cos(Math.asin(i/width))));case'cool':return Math.round(width*(1+Math.cos(Math.asin(i/width))));case'sharp':return Math.round(width*(1-Math.cos(Math.acos(i/width))));case'bite':return Math.round(width*(Math.cos(Math.asin((width-i-1)/width))));case'slide':return Math.round(width*(Math.atan2(i,width/i)));case'jut':return Math.round(width*(Math.atan2(width,(width-i-1))));case'curl':return Math.round(width*(Math.atan(i)));case'tear':return Math.round(width*(Math.cos(i)));case'wicked':return Math.round(width*(Math.tan(i)));case'long':return Math.round(width*(Math.sqrt(i)));case'sculpt':return Math.round(width*(Math.log((width-i-1),width)));case'dog':return(i&1)?(i+1):width;case'dog2':return(i&2)?(i+1):width;case'dog3':return(i&3)?(i+1):width;case'fray':return(i%2)*width;case'notch':return width;case'bevel':return i+1;}};$.fn.corner=function(options){if(this.length==0){if(!$.isReady&&this.selector){var s=this.selector,c=this.context;$(function(){$(s,c).corner(options);});}
return this;}
return this.each(function(index){var $this=$(this);var o=[options||'',$this.attr($.fn.corner.defaults.metaAttr)||''].join(' ').toLowerCase();var keep=/keep/.test(o);var cc=((o.match(/cc:(#[0-9a-f]+)/)||[])[1]);var sc=((o.match(/sc:(#[0-9a-f]+)/)||[])[1]);var width=parseInt((o.match(/(\d+)px/)||[])[1])||10;var re=/round|bevel|notch|bite|cool|sharp|slide|jut|curl|tear|fray|wicked|sculpt|long|dog3|dog2|dog/;var fx=((o.match(re)||['round'])[0]);var edges={T:0,B:1};var opts={TL:/top|tl|left/.test(o),TR:/top|tr|right/.test(o),BL:/bottom|bl|left/.test(o),BR:/bottom|br|right/.test(o)};if(!opts.TL&&!opts.TR&&!opts.BL&&!opts.BR)
opts={TL:1,TR:1,BL:1,BR:1};if($.fn.corner.defaults.useNative&&fx=='round'&&(moz||webkit)&&!cc&&!sc){if(opts.TL)
$this.css(moz?'-moz-border-radius-topleft':'-webkit-border-top-left-radius',width+'px');if(opts.TR)
$this.css(moz?'-moz-border-radius-topright':'-webkit-border-top-right-radius',width+'px');if(opts.BL)
$this.css(moz?'-moz-border-radius-bottomleft':'-webkit-border-bottom-left-radius',width+'px');if(opts.BR)
$this.css(moz?'-moz-border-radius-bottomright':'-webkit-border-bottom-right-radius',width+'px');return;}
var strip=document.createElement('div');strip.style.overflow='hidden';strip.style.height='1px';strip.style.backgroundColor=sc||'transparent';strip.style.borderStyle='solid';var pad={T:parseInt($.css(this,'paddingTop'))||0,R:parseInt($.css(this,'paddingRight'))||0,B:parseInt($.css(this,'paddingBottom'))||0,L:parseInt($.css(this,'paddingLeft'))||0};if(typeof this.style.zoom!=undefined)this.style.zoom=1;if(!keep)this.style.border='none';strip.style.borderColor=cc||gpc(this.parentNode);var cssHeight=$.curCSS(this,'height');for(var j in edges){var bot=edges[j];if((bot&&(opts.BL||opts.BR))||(!bot&&(opts.TL||opts.TR))){strip.style.borderStyle='none '+(opts[j+'R']?'solid':'none')+' none '+(opts[j+'L']?'solid':'none');var d=document.createElement('div');$(d).addClass('jquery-corner');var ds=d.style;bot?this.appendChild(d):this.insertBefore(d,this.firstChild);if(bot&&cssHeight!='auto'){if($.css(this,'position')=='static')
this.style.position='relative';ds.position='absolute';ds.bottom=ds.left=ds.padding=ds.margin='0';if(expr)
ds.setExpression('width','this.parentNode.offsetWidth');else
ds.width='100%';}
else if(!bot&&$.browser.msie){if($.css(this,'position')=='static')
this.style.position='relative';ds.position='absolute';ds.top=ds.left=ds.right=ds.padding=ds.margin='0';if(expr){var bw=sz(this,'borderLeftWidth')+sz(this,'borderRightWidth');ds.setExpression('width','this.parentNode.offsetWidth - '+bw+'+ "px"');}
else
ds.width='100%';}
else{ds.position='relative';ds.margin=!bot?'-'+pad.T+'px -'+pad.R+'px '+(pad.T-width)+'px -'+pad.L+'px':(pad.B-width)+'px -'+pad.R+'px -'+pad.B+'px -'+pad.L+'px';}
for(var i=0;i<width;i++){var w=Math.max(0,getWidth(fx,i,width));var e=strip.cloneNode(false);e.style.borderWidth='0 '+(opts[j+'R']?w:0)+'px 0 '+(opts[j+'L']?w:0)+'px';bot?d.appendChild(e):d.insertBefore(e,d.firstChild);}}}});};$.fn.uncorner=function(){if(moz||webkit)
this.css(moz?'-moz-border-radius':'-webkit-border-radius',0);$('div.jquery-corner',this).remove();return this;};$.fn.corner.defaults={useNative:true,metaAttr:'data-corner'};})(jQuery);;jQuery.create=function(){if(arguments.length==0)return[];var args=arguments[0]||{},elem=null,elements=null;var siblings=null;if(args==null)args="";if(args.constructor==String){if(arguments.length>1){var attributes=arguments[1];if(attributes.constructor==String){elem=document.createTextNode(args);elements=[];elements.push(elem);siblings=jQuery.create.apply(null,Array.prototype.slice.call(arguments,1));elements=elements.concat(siblings);return elements;}else{var buggy="No";if(args.toUpperCase()=="INPUT"||args.toUpperCase()=="SELECT"){try{if(arguments[1]){var attr=arguments[1];var attributes="<"+args+" ";for(key in attr){attributes+=key+"=\""+attr[key]+"\" ";}
attributes+=">";}
var elem=document.createElement(attributes);var buggy="Yep";}
catch(element){}}
if(buggy=="No"){elem=document.createElement(args);var attributes=arguments[1];for(var attr in attributes)
jQuery(elem).attr(attr,attributes[attr]);}
if(arguments[2]){var children=arguments[2];children=jQuery.create.apply(null,children);jQuery(elem).append(children);}
if(arguments.length>3){siblings=jQuery.create.apply(null,Array.prototype.slice.call(arguments,3));return[elem].concat(siblings);}
return elem;}}else return document.createTextNode(args);}else{elements=[];elements.push(args);siblings=jQuery.create.apply(null,(Array.prototype.slice.call(arguments,1)));elements=elements.concat(siblings);return elements;}};;(function($){$.fn.lightBox=function(settings){settings=jQuery.extend({overlayBgColor:'#000',overlayOpacity:0.8,imageLoading:'images/lightbox-ico-loading.gif',imageBtnPrev:'images/lightbox-btn-prev.gif',imageBtnNext:'images/lightbox-btn-next.gif',imageBtnClose:'images/lightbox-btn-close.gif',imageBlank:'images/lightbox-blank.gif',containerBorderSize:10,containerResizeSpeed:400,txtImage:'Image',txtOf:'of',keyToClose:'c',keyToPrev:'p',keyToNext:'n',imageArray:[],activeImage:0},settings);var jQueryMatchedObj=this;function _initialize(){_start(this,jQueryMatchedObj);return false;}
function _start(objClicked,jQueryMatchedObj){$('embed, object, select').css({'visibility':'hidden'});_set_interface();settings.imageArray.length=0;settings.activeImage=0;if(jQueryMatchedObj.length==1){settings.imageArray.push(new Array(objClicked.getAttribute('href'),objClicked.getAttribute('title')));}else{for(var i=0;i<jQueryMatchedObj.length;i++){settings.imageArray.push(new Array(jQueryMatchedObj[i].getAttribute('href'),jQueryMatchedObj[i].getAttribute('title')));}}
while(settings.imageArray[settings.activeImage][0]!=objClicked.getAttribute('href')){settings.activeImage++;}
_set_image_to_view();}
function _set_interface(){$('body').append('<div id="jquery-overlay"></div><div id="jquery-lightbox"><div id="lightbox-container-image-box"><div id="lightbox-container-image"><img id="lightbox-image"><div style="" id="lightbox-nav"><a href="#" id="lightbox-nav-btnPrev"></a><a href="#" id="lightbox-nav-btnNext"></a></div><div id="lightbox-loading"><a href="#" id="lightbox-loading-link"><img src="'+settings.imageLoading+'"></a></div></div></div><div id="lightbox-container-image-data-box"><div id="lightbox-container-image-data"><div id="lightbox-image-details"><span id="lightbox-image-details-caption"></span><span id="lightbox-image-details-currentNumber"></span></div><div id="lightbox-secNav"><a href="#" id="lightbox-secNav-btnClose"><img src="'+settings.imageBtnClose+'"></a></div></div></div></div>');var arrPageSizes=___getPageSize();$('#jquery-overlay').css({backgroundColor:settings.overlayBgColor,opacity:settings.overlayOpacity,width:arrPageSizes[0],height:arrPageSizes[1]}).fadeIn();var arrPageScroll=___getPageScroll();$('#jquery-lightbox').css({top:arrPageScroll[1]+(arrPageSizes[3]/10),left:arrPageScroll[0]}).show();$('#jquery-overlay,#jquery-lightbox').click(function(){_finish();});$('#lightbox-loading-link,#lightbox-secNav-btnClose').click(function(){_finish();return false;});$(window).resize(function(){var arrPageSizes=___getPageSize();$('#jquery-overlay').css({width:arrPageSizes[0],height:arrPageSizes[1]});var arrPageScroll=___getPageScroll();$('#jquery-lightbox').css({top:arrPageScroll[1]+(arrPageSizes[3]/10),left:arrPageScroll[0]});});}
function _set_image_to_view(){$('#lightbox-loading').show();$('#lightbox-image,#lightbox-nav,#lightbox-nav-btnPrev,#lightbox-nav-btnNext,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide();var objImagePreloader=new Image();objImagePreloader.onload=function(){$('#lightbox-image').attr('src',settings.imageArray[settings.activeImage][0]);_resize_container_image_box(objImagePreloader.width,objImagePreloader.height);objImagePreloader.onload=function(){};};objImagePreloader.src=settings.imageArray[settings.activeImage][0];};function _resize_container_image_box(intImageWidth,intImageHeight){var intCurrentWidth=$('#lightbox-container-image-box').width();var intCurrentHeight=$('#lightbox-container-image-box').height();var intWidth=(intImageWidth+(settings.containerBorderSize*2));var intHeight=(intImageHeight+(settings.containerBorderSize*2));var intDiffW=intCurrentWidth-intWidth;var intDiffH=intCurrentHeight-intHeight;$('#lightbox-container-image-box').animate({width:intWidth,height:intHeight},settings.containerResizeSpeed,function(){_show_image();});if((intDiffW==0)&&(intDiffH==0)){if($.browser.msie){___pause(250);}else{___pause(100);}}
$('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({height:intImageHeight+(settings.containerBorderSize*2)});$('#lightbox-container-image-data-box').css({width:intImageWidth});};function _show_image(){$('#lightbox-loading').hide();$('#lightbox-image').fadeIn(function(){_show_image_data();_set_navigation();});_preload_neighbor_images();};function _show_image_data(){$('#lightbox-container-image-data-box').slideDown('fast');$('#lightbox-image-details-caption').hide();if(settings.imageArray[settings.activeImage][1]){$('#lightbox-image-details-caption').html(settings.imageArray[settings.activeImage][1]).show();}
if(settings.imageArray.length>1){$('#lightbox-image-details-currentNumber').html(settings.txtImage+' '+(settings.activeImage+1)+' '+settings.txtOf+' '+settings.imageArray.length).show();}}
function _set_navigation(){$('#lightbox-nav').show();$('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({'background':'transparent url('+settings.imageBlank+') no-repeat'});if(settings.activeImage!=0){$('#lightbox-nav-btnPrev').unbind().hover(function(){$(this).css({'background':'url('+settings.imageBtnPrev+') left 15% no-repeat'});},function(){$(this).css({'background':'transparent url('+settings.imageBlank+') no-repeat'});}).show().bind('click',function(){settings.activeImage=settings.activeImage-1;_set_image_to_view();return false;});}
if(settings.activeImage!=(settings.imageArray.length-1)){$('#lightbox-nav-btnNext').unbind().hover(function(){$(this).css({'background':'url('+settings.imageBtnNext+') right 15% no-repeat'});},function(){$(this).css({'background':'transparent url('+settings.imageBlank+') no-repeat'});}).show().bind('click',function(){settings.activeImage=settings.activeImage+1;_set_image_to_view();return false;});}
_enable_keyboard_navigation();}
function _enable_keyboard_navigation(){$(document).keydown(function(objEvent){_keyboard_action(objEvent);});}
function _disable_keyboard_navigation(){$(document).unbind();}
function _keyboard_action(objEvent){if(objEvent==null){keycode=event.keyCode;escapeKey=27;}else{keycode=objEvent.keyCode;escapeKey=objEvent.DOM_VK_ESCAPE;}
key=String.fromCharCode(keycode).toLowerCase();if((key==settings.keyToClose)||(key=='x')||(keycode==escapeKey)){_finish();}
if((key==settings.keyToPrev)||(keycode==37)){if(settings.activeImage!=0){settings.activeImage=settings.activeImage-1;_set_image_to_view();_disable_keyboard_navigation();}}
if((key==settings.keyToNext)||(keycode==39)){if(settings.activeImage!=(settings.imageArray.length-1)){settings.activeImage=settings.activeImage+1;_set_image_to_view();_disable_keyboard_navigation();}}}
function _preload_neighbor_images(){if((settings.imageArray.length-1)>settings.activeImage){objNext=new Image();objNext.src=settings.imageArray[settings.activeImage+1][0];}
if(settings.activeImage>0){objPrev=new Image();objPrev.src=settings.imageArray[settings.activeImage-1][0];}}
function _finish(){$('#jquery-lightbox').remove();$('#jquery-overlay').fadeOut(function(){$('#jquery-overlay').remove();});$('embed, object, select').css({'visibility':'visible'});}
function ___getPageSize(){var xScroll,yScroll;if(window.innerHeight&&window.scrollMaxY){xScroll=window.innerWidth+window.scrollMaxX;yScroll=window.innerHeight+window.scrollMaxY;}else if(document.body.scrollHeight>document.body.offsetHeight){xScroll=document.body.scrollWidth;yScroll=document.body.scrollHeight;}else{xScroll=document.body.offsetWidth;yScroll=document.body.offsetHeight;}
var windowWidth,windowHeight;if(self.innerHeight){if(document.documentElement.clientWidth){windowWidth=document.documentElement.clientWidth;}else{windowWidth=self.innerWidth;}
windowHeight=self.innerHeight;}else if(document.documentElement&&document.documentElement.clientHeight){windowWidth=document.documentElement.clientWidth;windowHeight=document.documentElement.clientHeight;}else if(document.body){windowWidth=document.body.clientWidth;windowHeight=document.body.clientHeight;}
if(yScroll<windowHeight){pageHeight=windowHeight;}else{pageHeight=yScroll;}
if(xScroll<windowWidth){pageWidth=xScroll;}else{pageWidth=windowWidth;}
arrayPageSize=new Array(pageWidth,pageHeight,windowWidth,windowHeight);return arrayPageSize;};function ___getPageScroll(){var xScroll,yScroll;if(self.pageYOffset){yScroll=self.pageYOffset;xScroll=self.pageXOffset;}else if(document.documentElement&&document.documentElement.scrollTop){yScroll=document.documentElement.scrollTop;xScroll=document.documentElement.scrollLeft;}else if(document.body){yScroll=document.body.scrollTop;xScroll=document.body.scrollLeft;}
arrayPageScroll=new Array(xScroll,yScroll);return arrayPageScroll;};function ___pause(ms){var date=new Date();curDate=null;do{var curDate=new Date();}
while(curDate-date<ms);};return this.unbind('click').click(_initialize);};})(jQuery);;;(function(h){h.fn.addOption=function(){var j=function(a,f,c,g){var d=document.createElement("option");d.value=f,d.text=c;var b=a.options;var e=b.length;if(!a.cache){a.cache={};for(var i=0;i<e;i++){a.cache[b[i].value]=i}}if(typeof a.cache[f]=="undefined")a.cache[f]=e;a.options[a.cache[f]]=d;if(g){d.selected=true}};var k=arguments;if(k.length==0)return this;var l=true;var m=false;var n,o,p;if(typeof(k[0])=="object"){m=true;n=k[0]}if(k.length>=2){if(typeof(k[1])=="boolean")l=k[1];else if(typeof(k[2])=="boolean")l=k[2];if(!m){o=k[0];p=k[1]}}this.each(function(){if(this.nodeName.toLowerCase()!="select")return;if(m){for(var a in n){j(this,a,n[a],l)}}else{j(this,o,p,l)}});return this};h.fn.ajaxAddOption=function(c,g,d,b,e){if(typeof(c)!="string")return this;if(typeof(g)!="object")g={};if(typeof(d)!="boolean")d=true;this.each(function(){var f=this;h.getJSON(c,g,function(a){h(f).addOption(a,d);if(typeof b=="function"){if(typeof e=="object"){b.apply(f,e)}else{b.call(f)}}})});return this};h.fn.removeOption=function(){var d=arguments;if(d.length==0)return this;var b=typeof(d[0]);var e,i;if(b=="string"||b=="object"||b=="function"){e=d[0];if(e.constructor==Array){var j=e.length;for(var k=0;k<j;k++){this.removeOption(e[k],d[1])}return this}}else if(b=="number")i=d[0];else return this;this.each(function(){if(this.nodeName.toLowerCase()!="select")return;if(this.cache)this.cache=null;var a=false;var f=this.options;if(!!e){var c=f.length;for(var g=c-1;g>=0;g--){if(e.constructor==RegExp){if(f[g].value.match(e)){a=true}}else if(f[g].value==e){a=true}if(a&&d[1]===true)a=f[g].selected;if(a){f[g]=null}a=false}}else{if(d[1]===true){a=f[i].selected}else{a=true}if(a){this.remove(i)}}});return this};h.fn.sortOptions=function(e){var i=h(this).selectedValues();var j=typeof(e)=="undefined"?true:!!e;this.each(function(){if(this.nodeName.toLowerCase()!="select")return;var c=this.options;var g=c.length;var d=[];for(var b=0;b<g;b++){d[b]={v:c[b].value,t:c[b].text}}d.sort(function(a,f){o1t=a.t.toLowerCase(),o2t=f.t.toLowerCase();if(o1t==o2t)return 0;if(j){return o1t<o2t?-1:1}else{return o1t>o2t?-1:1}});for(var b=0;b<g;b++){c[b].text=d[b].t;c[b].value=d[b].v}}).selectOptions(i,true);return this};h.fn.selectOptions=function(g,d){var b=g;var e=typeof(g);if(e=="object"&&b.constructor==Array){var i=this;h.each(b,function(){i.selectOptions(this,d)})};var j=d||false;if(e!="string"&&e!="function"&&e!="object")return this;this.each(function(){if(this.nodeName.toLowerCase()!="select")return this;var a=this.options;var f=a.length;for(var c=0;c<f;c++){if(b.constructor==RegExp){if(a[c].value.match(b)){a[c].selected=true}else if(j){a[c].selected=false}}else{if(a[c].value==b){a[c].selected=true}else if(j){a[c].selected=false}}}});return this};h.fn.copyOptions=function(g,d){var b=d||"selected";if(h(g).size()==0)return this;this.each(function(){if(this.nodeName.toLowerCase()!="select")return this;var a=this.options;var f=a.length;for(var c=0;c<f;c++){if(b=="all"||(b=="selected"&&a[c].selected)){h(g).addOption(a[c].value,a[c].text)}}});return this};h.fn.containsOption=function(g,d){var b=false;var e=g;var i=typeof(e);var j=typeof(d);if(i!="string"&&i!="function"&&i!="object")return j=="function"?this:b;this.each(function(){if(this.nodeName.toLowerCase()!="select")return this;if(b&&j!="function")return false;var a=this.options;var f=a.length;for(var c=0;c<f;c++){if(e.constructor==RegExp){if(a[c].value.match(e)){b=true;if(j=="function")d.call(a[c],c)}}else{if(a[c].value==e){b=true;if(j=="function")d.call(a[c],c)}}}});return j=="function"?this:b};h.fn.selectedValues=function(){var a=[];this.selectedOptions().each(function(){a[a.length]=this.value});return a};h.fn.selectedTexts=function(){var a=[];this.selectedOptions().each(function(){a[a.length]=this.text});return a};h.fn.selectedOptions=function(){return this.find("option:selected")}})(jQuery);;var RegionTree={};RegionTree.regions=[{"id":"315","parentId":"0","name":"Aalborg","country":"2"},{"id":"22","parentId":"0","name":"Blekinge","country":"1"},{"id":"317","parentId":"0","name":"Bornholm","country":"2"},{"id":"6","parentId":"0","name":"Dalarna","country":"1"},{"id":"318","parentId":"0","name":"Fyn","country":"2"},{"id":"328","parentId":"0","name":"F\u00e6r\u00f8erne","country":"2"},{"id":"19","parentId":"0","name":"Gotland","country":"1"},{"id":"329","parentId":"0","name":"Gr\u00f8nland","country":"2"},{"id":"5","parentId":"0","name":"G\u00e4vleborg","country":"1"},{"id":"15","parentId":"0","name":"G\u00f6teborg","country":"1"},{"id":"20","parentId":"0","name":"Halland","country":"1"},{"id":"319","parentId":"0","name":"Jylland","country":"2"},{"id":"320","parentId":"0","name":"Jylland - Midt og Vest","country":"2"},{"id":"321","parentId":"0","name":"Jylland - Nord","country":"2"},{"id":"322","parentId":"0","name":"Jylland - Syd og S\u00f8nder","country":"2"},{"id":"323","parentId":"0","name":"Jylland - \u00d8st","country":"2"},{"id":"3","parentId":"0","name":"J\u00e4mtland","country":"1"},{"id":"17","parentId":"0","name":"J\u00f6nk\u00f6ping","country":"1"},{"id":"18","parentId":"0","name":"Kalmar","country":"1"},{"id":"21","parentId":"0","name":"Kronoberg","country":"1"},{"id":"314","parentId":"0","name":"K\u00f8benhavn","country":"2"},{"id":"1","parentId":"0","name":"Norrbotten","country":"1"},{"id":"316","parentId":"0","name":"Odense","country":"2"},{"id":"326","parentId":"0","name":"Sj. - Syd &Lolland\/Falster","country":"2"},{"id":"324","parentId":"0","name":"Sj\u00e6lland","country":"2"},{"id":"325","parentId":"0","name":"Sj\u00e6lland - Nord","country":"2"},{"id":"327","parentId":"0","name":"Sj\u00e6lland - Vest","country":"2"},{"id":"13","parentId":"0","name":"Skaraborg","country":"1"},{"id":"23","parentId":"0","name":"Sk\u00e5ne","country":"1"},{"id":"11","parentId":"0","name":"Stockholm","country":"1"},{"id":"12","parentId":"0","name":"S\u00f6dermanland","country":"1"},{"id":"10","parentId":"0","name":"Uppsala","country":"1"},{"id":"7","parentId":"0","name":"V\u00e4rmland","country":"1"},{"id":"2","parentId":"0","name":"V\u00e4sterbotten","country":"1"},{"id":"4","parentId":"0","name":"V\u00e4sternorrland","country":"1"},{"id":"9","parentId":"0","name":"V\u00e4stmanland","country":"1"},{"id":"313","parentId":"0","name":"\u00c5rhus","country":"2"},{"id":"16","parentId":"0","name":"\u00c4lvsborg","country":"1"},{"id":"8","parentId":"0","name":"\u00d6rebro","country":"1"},{"id":"14","parentId":"0","name":"\u00d6sterg\u00f6tland","country":"1"},{"id":"119","parentId":"1","name":"Arjeplog","country":"1"},{"id":"120","parentId":"1","name":"Arvidsjaur","country":"1"},{"id":"121","parentId":"1","name":"Boden","country":"1"},{"id":"122","parentId":"1","name":"G\u00e4llivare","country":"1"},{"id":"123","parentId":"1","name":"Haparanda","country":"1"},{"id":"124","parentId":"1","name":"Jokkmokk","country":"1"},{"id":"125","parentId":"1","name":"Kalix","country":"1"},{"id":"126","parentId":"1","name":"Kiruna","country":"1"},{"id":"127","parentId":"1","name":"Lule\u00e5","country":"1"},{"id":"128","parentId":"1","name":"Pajala","country":"1"},{"id":"129","parentId":"1","name":"Pite\u00e5","country":"1"},{"id":"130","parentId":"1","name":"\u00c4lvsbyn","country":"1"},{"id":"131","parentId":"1","name":"\u00d6verkalix","country":"1"},{"id":"132","parentId":"1","name":"\u00d6vertorne\u00e5","country":"1"},{"id":"199","parentId":"10","name":"Enk\u00f6ping","country":"1"},{"id":"200","parentId":"10","name":"Heby","country":"1"},{"id":"201","parentId":"10","name":"H\u00e5bo","country":"1"},{"id":"202","parentId":"10","name":"Knivsta","country":"1"},{"id":"203","parentId":"10","name":"Tierp","country":"1"},{"id":"204","parentId":"10","name":"Uppsala stad","country":"1"},{"id":"205","parentId":"10","name":"\u00c4lvkarleby","country":"1"},{"id":"206","parentId":"10","name":"\u00d6sthammar","country":"1"},{"id":"164","parentId":"11","name":"Botkyrka","country":"1"},{"id":"165","parentId":"11","name":"Danderyd","country":"1"},{"id":"166","parentId":"11","name":"Eker\u00f6","country":"1"},{"id":"167","parentId":"11","name":"Haninge","country":"1"},{"id":"168","parentId":"11","name":"Huddinge","country":"1"},{"id":"169","parentId":"11","name":"J\u00e4rf\u00e4lla","country":"1"},{"id":"170","parentId":"11","name":"Liding\u00f6","country":"1"},{"id":"171","parentId":"11","name":"Nacka","country":"1"},{"id":"172","parentId":"11","name":"Norrt\u00e4lje","country":"1"},{"id":"173","parentId":"11","name":"Nykvarn","country":"1"},{"id":"174","parentId":"11","name":"Nyn\u00e4shamn","country":"1"},{"id":"175","parentId":"11","name":"Salem","country":"1"},{"id":"176","parentId":"11","name":"Sigtuna","country":"1"},{"id":"177","parentId":"11","name":"Sollentuna","country":"1"},{"id":"178","parentId":"11","name":"Solna","country":"1"},{"id":"179","parentId":"11","name":"Stockholms stad","country":"1"},{"id":"180","parentId":"11","name":"Sundbyberg","country":"1"},{"id":"181","parentId":"11","name":"S\u00f6dert\u00e4lje","country":"1"},{"id":"182","parentId":"11","name":"Tyres\u00f6","country":"1"},{"id":"183","parentId":"11","name":"T\u00e4by","country":"1"},{"id":"184","parentId":"11","name":"Upplands V\u00e4sby","country":"1"},{"id":"185","parentId":"11","name":"Upplands-Bro","country":"1"},{"id":"186","parentId":"11","name":"Vallentuna","country":"1"},{"id":"187","parentId":"11","name":"Vaxholm","country":"1"},{"id":"188","parentId":"11","name":"V\u00e4rmd\u00f6","country":"1"},{"id":"189","parentId":"11","name":"\u00d6ster\u00e5ker","country":"1"},{"id":"190","parentId":"12","name":"Eskilstuna","country":"1"},{"id":"191","parentId":"12","name":"Flen","country":"1"},{"id":"192","parentId":"12","name":"Gnesta","country":"1"},{"id":"193","parentId":"12","name":"Katrineholm","country":"1"},{"id":"194","parentId":"12","name":"Nyk\u00f6ping","country":"1"},{"id":"195","parentId":"12","name":"Oxel\u00f6sund","country":"1"},{"id":"196","parentId":"12","name":"Str\u00e4ngn\u00e4s","country":"1"},{"id":"197","parentId":"12","name":"Trosa","country":"1"},{"id":"198","parentId":"12","name":"Ving\u00e5ker","country":"1"},{"id":"133","parentId":"13","name":"Essunga","country":"1"},{"id":"134","parentId":"13","name":"Falk\u00f6ping","country":"1"},{"id":"135","parentId":"13","name":"Gr\u00e4storp","country":"1"},{"id":"136","parentId":"13","name":"Gullsp\u00e5ng","country":"1"},{"id":"137","parentId":"13","name":"G\u00f6tene","country":"1"},{"id":"138","parentId":"13","name":"Hjo","country":"1"},{"id":"139","parentId":"13","name":"Karlsborg","country":"1"},{"id":"140","parentId":"13","name":"Lidk\u00f6ping","country":"1"},{"id":"141","parentId":"13","name":"Mariestad","country":"1"},{"id":"142","parentId":"13","name":"Skara","country":"1"},{"id":"143","parentId":"13","name":"Sk\u00f6vde","country":"1"},{"id":"144","parentId":"13","name":"Tibro","country":"1"},{"id":"145","parentId":"13","name":"Tidaholm","country":"1"},{"id":"146","parentId":"13","name":"T\u00f6reboda","country":"1"},{"id":"147","parentId":"13","name":"Vara","country":"1"},{"id":"280","parentId":"14","name":"Boxholm","country":"1"},{"id":"281","parentId":"14","name":"Finsp\u00e5ng","country":"1"},{"id":"282","parentId":"14","name":"Kinda","country":"1"},{"id":"283","parentId":"14","name":"Link\u00f6ping","country":"1"},{"id":"284","parentId":"14","name":"Mj\u00f6lby","country":"1"},{"id":"285","parentId":"14","name":"Motala","country":"1"},{"id":"286","parentId":"14","name":"Norrk\u00f6ping","country":"1"},{"id":"287","parentId":"14","name":"S\u00f6derk\u00f6ping","country":"1"},{"id":"288","parentId":"14","name":"Vadstena","country":"1"},{"id":"289","parentId":"14","name":"Valdemarsvik","country":"1"},{"id":"290","parentId":"14","name":"Ydre","country":"1"},{"id":"291","parentId":"14","name":"\u00c5tvidaberg","country":"1"},{"id":"292","parentId":"14","name":"\u00d6desh\u00f6g","country":"1"},{"id":"57","parentId":"15","name":"G\u00f6teborgs stad","country":"1"},{"id":"58","parentId":"15","name":"H\u00e4rryda","country":"1"},{"id":"59","parentId":"15","name":"Kung\u00e4lv","country":"1"},{"id":"60","parentId":"15","name":"Lysekil","country":"1"},{"id":"61","parentId":"15","name":"Munkedal","country":"1"},{"id":"62","parentId":"15","name":"M\u00f6lndal","country":"1"},{"id":"63","parentId":"15","name":"Orust","country":"1"},{"id":"64","parentId":"15","name":"Partille","country":"1"},{"id":"65","parentId":"15","name":"Soten\u00e4s","country":"1"},{"id":"66","parentId":"15","name":"Stenungsund","country":"1"},{"id":"67","parentId":"15","name":"Str\u00f6mstad","country":"1"},{"id":"68","parentId":"15","name":"Tanum","country":"1"},{"id":"69","parentId":"15","name":"Tj\u00f6rn","country":"1"},{"id":"70","parentId":"15","name":"Uddevalla","country":"1"},{"id":"71","parentId":"15","name":"\u00d6cker\u00f6","country":"1"},{"id":"251","parentId":"16","name":"Ale","country":"1"},{"id":"252","parentId":"16","name":"Alings\u00e5s","country":"1"},{"id":"253","parentId":"16","name":"Bengtsfors","country":"1"},{"id":"254","parentId":"16","name":"Bollebygd","country":"1"},{"id":"255","parentId":"16","name":"Bor\u00e5s","country":"1"},{"id":"256","parentId":"16","name":"Dals-Ed","country":"1"},{"id":"257","parentId":"16","name":"F\u00e4rgelanda","country":"1"},{"id":"258","parentId":"16","name":"Herrljunga","country":"1"},{"id":"259","parentId":"16","name":"Lerum","country":"1"},{"id":"260","parentId":"16","name":"Lilla Edet","country":"1"},{"id":"261","parentId":"16","name":"Mark","country":"1"},{"id":"262","parentId":"16","name":"Svenljunga","country":"1"},{"id":"263","parentId":"16","name":"Tranemo","country":"1"},{"id":"264","parentId":"16","name":"Trollh\u00e4ttan","country":"1"},{"id":"265","parentId":"16","name":"Ulricehamn","country":"1"},{"id":"266","parentId":"16","name":"V\u00e4nersborg","country":"1"},{"id":"267","parentId":"16","name":"\u00c5m\u00e5l","country":"1"},{"id":"86","parentId":"17","name":"Aneby","country":"1"},{"id":"87","parentId":"17","name":"Eksj\u00f6","country":"1"},{"id":"88","parentId":"17","name":"Gislaved","country":"1"},{"id":"89","parentId":"17","name":"Gnosj\u00f6","country":"1"},{"id":"90","parentId":"17","name":"Habo","country":"1"},{"id":"91","parentId":"17","name":"J\u00f6nk\u00f6pings stad","country":"1"},{"id":"92","parentId":"17","name":"Mullsj\u00f6","country":"1"},{"id":"93","parentId":"17","name":"N\u00e4ssj\u00f6","country":"1"},{"id":"94","parentId":"17","name":"S\u00e4vsj\u00f6","country":"1"},{"id":"95","parentId":"17","name":"Tran\u00e5s","country":"1"},{"id":"96","parentId":"17","name":"Vaggeryd","country":"1"},{"id":"97","parentId":"17","name":"Vetlanda","country":"1"},{"id":"98","parentId":"17","name":"V\u00e4rnamo","country":"1"},{"id":"581","parentId":"179","name":"Bandhagen","country":"1"},{"id":"293","parentId":"179","name":"Bromma","country":"1"},{"id":"294","parentId":"179","name":"Enskede","country":"1"},{"id":"297","parentId":"179","name":"Farsta","country":"1"},{"id":"298","parentId":"179","name":"H\u00e4gersten","country":"1"},{"id":"300","parentId":"179","name":"H\u00e4sselby","country":"1"},{"id":"580","parentId":"179","name":"Johanneshov","country":"1"},{"id":"305","parentId":"179","name":"Kista","country":"1"},{"id":"302","parentId":"179","name":"Kungsholmen","country":"1"},{"id":"299","parentId":"179","name":"Liljeholmen","country":"1"},{"id":"578","parentId":"179","name":"Lilla Essingen","country":"1"},{"id":"303","parentId":"179","name":"Norrmalm","country":"1"},{"id":"304","parentId":"179","name":"Rinkeby","country":"1"},{"id":"306","parentId":"179","name":"Skarpn\u00e4ck","country":"1"},{"id":"307","parentId":"179","name":"Sk\u00e4rholmen","country":"1"},{"id":"308","parentId":"179","name":"Sp\u00e5nga","country":"1"},{"id":"579","parentId":"179","name":"Stora Essingen","country":"1"},{"id":"310","parentId":"179","name":"S\u00f6dermalm","country":"1"},{"id":"309","parentId":"179","name":"Tensta","country":"1"},{"id":"296","parentId":"179","name":"Vant\u00f6r","country":"1"},{"id":"301","parentId":"179","name":"V\u00e4llingby","country":"1"},{"id":"295","parentId":"179","name":"\u00c5rsta","country":"1"},{"id":"311","parentId":"179","name":"\u00c4lvsj\u00f6","country":"1"},{"id":"312","parentId":"179","name":"\u00d6stermalm","country":"1"},{"id":"99","parentId":"18","name":"Borgholm","country":"1"},{"id":"100","parentId":"18","name":"Emmaboda","country":"1"},{"id":"101","parentId":"18","name":"Hultsfred","country":"1"},{"id":"102","parentId":"18","name":"H\u00f6gsby","country":"1"},{"id":"103","parentId":"18","name":"Kalmars stad","country":"1"},{"id":"104","parentId":"18","name":"M\u00f6nster\u00e5s","country":"1"},{"id":"105","parentId":"18","name":"M\u00f6rbyl\u00e5nga","country":"1"},{"id":"106","parentId":"18","name":"Nybro","country":"1"},{"id":"107","parentId":"18","name":"Oskarshamn","country":"1"},{"id":"108","parentId":"18","name":"Tors\u00e5s","country":"1"},{"id":"109","parentId":"18","name":"Vimmerby","country":"1"},{"id":"110","parentId":"18","name":"V\u00e4stervik","country":"1"},{"id":"222","parentId":"2","name":"Bjurholm","country":"1"},{"id":"223","parentId":"2","name":"Lycksele","country":"1"},{"id":"224","parentId":"2","name":"Nordmaling","country":"1"},{"id":"225","parentId":"2","name":"Norsj\u00f6","country":"1"},{"id":"226","parentId":"2","name":"Robertsfors","country":"1"},{"id":"227","parentId":"2","name":"Skellefte\u00e5","country":"1"},{"id":"228","parentId":"2","name":"Storuman","country":"1"},{"id":"229","parentId":"2","name":"Ume\u00e5","country":"1"},{"id":"230","parentId":"2","name":"Vilhelmina","country":"1"},{"id":"231","parentId":"2","name":"Vindeln","country":"1"},{"id":"232","parentId":"2","name":"V\u00e4nn\u00e4s","country":"1"},{"id":"233","parentId":"2","name":"\u00c5sele","country":"1"},{"id":"72","parentId":"20","name":"Falkenberg","country":"1"},{"id":"73","parentId":"20","name":"Halmstad","country":"1"},{"id":"74","parentId":"20","name":"Hylte","country":"1"},{"id":"75","parentId":"20","name":"Kungsbacka","country":"1"},{"id":"76","parentId":"20","name":"Laholm","country":"1"},{"id":"77","parentId":"20","name":"Varberg","country":"1"},{"id":"111","parentId":"21","name":"Alvesta","country":"1"},{"id":"112","parentId":"21","name":"Lessebo","country":"1"},{"id":"113","parentId":"21","name":"Ljungby","country":"1"},{"id":"114","parentId":"21","name":"Markaryd","country":"1"},{"id":"115","parentId":"21","name":"Tingsryd","country":"1"},{"id":"116","parentId":"21","name":"Uppvidinge","country":"1"},{"id":"117","parentId":"21","name":"V\u00e4xj\u00f6","country":"1"},{"id":"118","parentId":"21","name":"\u00c4lmhult","country":"1"},{"id":"24","parentId":"22","name":"Karkshamn","country":"1"},{"id":"25","parentId":"22","name":"Karlskrona","country":"1"},{"id":"26","parentId":"22","name":"Olofstr\u00f6m","country":"1"},{"id":"27","parentId":"22","name":"Ronneby","country":"1"},{"id":"28","parentId":"22","name":"S\u00f6lvesborg","country":"1"},{"id":"148","parentId":"23","name":"B\u00e5stad","country":"1"},{"id":"149","parentId":"23","name":"Esl\u00f6v","country":"1"},{"id":"150","parentId":"23","name":"Helsingborg","country":"1"},{"id":"151","parentId":"23","name":"H\u00e4ssleholm","country":"1"},{"id":"152","parentId":"23","name":"H\u00f6rby","country":"1"},{"id":"153","parentId":"23","name":"H\u00f6\u00f6r","country":"1"},{"id":"154","parentId":"23","name":"Klippan","country":"1"},{"id":"155","parentId":"23","name":"Kristianstad","country":"1"},{"id":"156","parentId":"23","name":"Landskrona","country":"1"},{"id":"157","parentId":"23","name":"Lund","country":"1"},{"id":"158","parentId":"23","name":"Malm\u00f6","country":"1"},{"id":"159","parentId":"23","name":"Osby","country":"1"},{"id":"160","parentId":"23","name":"Simrishamn","country":"1"},{"id":"161","parentId":"23","name":"Trelleborg","country":"1"},{"id":"162","parentId":"23","name":"Ystad","country":"1"},{"id":"163","parentId":"23","name":"\u00c4ngelholm","country":"1"},{"id":"78","parentId":"3","name":"Berg","country":"1"},{"id":"79","parentId":"3","name":"Br\u00e4cke","country":"1"},{"id":"80","parentId":"3","name":"H\u00e4rjedalen","country":"1"},{"id":"81","parentId":"3","name":"Krokom","country":"1"},{"id":"82","parentId":"3","name":"Ragunda","country":"1"},{"id":"83","parentId":"3","name":"Str\u00f6msund","country":"1"},{"id":"84","parentId":"3","name":"\u00c5re","country":"1"},{"id":"85","parentId":"3","name":"\u00d6stersund","country":"1"},{"id":"234","parentId":"4","name":"H\u00e4rn\u00f6sand","country":"1"},{"id":"235","parentId":"4","name":"Kramfors","country":"1"},{"id":"236","parentId":"4","name":"Sollefte\u00e5","country":"1"},{"id":"237","parentId":"4","name":"Sundsvall","country":"1"},{"id":"238","parentId":"4","name":"Timr\u00e5","country":"1"},{"id":"239","parentId":"4","name":"\u00c5nge","country":"1"},{"id":"240","parentId":"4","name":"\u00d6rnsk\u00f6ldsvik","country":"1"},{"id":"47","parentId":"5","name":"Bolln\u00e4s","country":"1"},{"id":"48","parentId":"5","name":"G\u00e4vle","country":"1"},{"id":"49","parentId":"5","name":"Hofors","country":"1"},{"id":"50","parentId":"5","name":"Hudiksvall","country":"1"},{"id":"51","parentId":"5","name":"Ljusdal","country":"1"},{"id":"52","parentId":"5","name":"Nordanstig","country":"1"},{"id":"53","parentId":"5","name":"Ockelbo","country":"1"},{"id":"54","parentId":"5","name":"Ovan\u00e5ker","country":"1"},{"id":"55","parentId":"5","name":"Sandviken","country":"1"},{"id":"56","parentId":"5","name":"S\u00f6derhamn","country":"1"},{"id":"475","parentId":"57","name":"Agnesberg","country":"1"},{"id":"476","parentId":"57","name":"Angered","country":"1"},{"id":"477","parentId":"57","name":"Annedal","country":"1"},{"id":"478","parentId":"57","name":"Arendal","country":"1"},{"id":"479","parentId":"57","name":"Askim","country":"1"},{"id":"480","parentId":"57","name":"Backa","country":"1"},{"id":"481","parentId":"57","name":"Bagareg\u00e5rden","country":"1"},{"id":"482","parentId":"57","name":"Bergsj\u00f6n","country":"1"},{"id":"483","parentId":"57","name":"Bergum","country":"1"},{"id":"484","parentId":"57","name":"Billdal","country":"1"},{"id":"485","parentId":"57","name":"Biskopsg\u00e5rden","country":"1"},{"id":"582","parentId":"57","name":"Bjursl\u00e4tt","country":"1"},{"id":"486","parentId":"57","name":"Bj\u00f6rkek\u00e4rr","country":"1"},{"id":"487","parentId":"57","name":"Bj\u00f6rlanda","country":"1"},{"id":"489","parentId":"57","name":"Bratthammar","country":"1"},{"id":"490","parentId":"57","name":"Brunnsbo","country":"1"},{"id":"488","parentId":"57","name":"Br\u00e4mareg\u00e5rden","country":"1"},{"id":"491","parentId":"57","name":"Eriksbo","country":"1"},{"id":"492","parentId":"57","name":"Fiskeb\u00e4ck","country":"1"},{"id":"493","parentId":"57","name":"Flat\u00e5s","country":"1"},{"id":"494","parentId":"57","name":"Fr\u00f6lunda","country":"1"},{"id":"495","parentId":"57","name":"Fr\u00f6lunda Torg","country":"1"},{"id":"497","parentId":"57","name":"Gamlestaden","country":"1"},{"id":"498","parentId":"57","name":"Gerrebacka","country":"1"},{"id":"499","parentId":"57","name":"Greveg\u00e5rden","country":"1"},{"id":"500","parentId":"57","name":"Grimmered","country":"1"},{"id":"501","parentId":"57","name":"Guldheden","country":"1"},{"id":"502","parentId":"57","name":"Guldringen","country":"1"},{"id":"503","parentId":"57","name":"Gunnared","country":"1"},{"id":"504","parentId":"57","name":"Gunnilse","country":"1"},{"id":"496","parentId":"57","name":"G\u00e5rdstensbergen","country":"1"},{"id":"509","parentId":"57","name":"Haga","country":"1"},{"id":"510","parentId":"57","name":"Hagen","country":"1"},{"id":"511","parentId":"57","name":"Hammarkullen","country":"1"},{"id":"512","parentId":"57","name":"Heden","country":"1"},{"id":"514","parentId":"57","name":"Hjuvik","country":"1"},{"id":"513","parentId":"57","name":"Hj\u00e4llbo","country":"1"},{"id":"515","parentId":"57","name":"Hov\u00e5s","country":"1"},{"id":"505","parentId":"57","name":"H\u00e4rlanda","country":"1"},{"id":"506","parentId":"57","name":"H\u00f6gsbo","country":"1"},{"id":"507","parentId":"57","name":"H\u00f6gsboh\u00f6jd","country":"1"},{"id":"508","parentId":"57","name":"H\u00f6gsbotorp","country":"1"},{"id":"516","parentId":"57","name":"Inom Vallgraven","country":"1"},{"id":"519","parentId":"57","name":"Johanneberg","country":"1"},{"id":"517","parentId":"57","name":"J\u00e4rnbrott","country":"1"},{"id":"518","parentId":"57","name":"J\u00e4ttesten","country":"1"},{"id":"524","parentId":"57","name":"Kalleb\u00e4ck","country":"1"},{"id":"525","parentId":"57","name":"Kanneb\u00e4ck","country":"1"},{"id":"526","parentId":"57","name":"Kaver\u00f6s","country":"1"},{"id":"527","parentId":"57","name":"Kortedala","country":"1"},{"id":"528","parentId":"57","name":"Kroksl\u00e4tt","country":"1"},{"id":"529","parentId":"57","name":"Kungsladug\u00e5rd","country":"1"},{"id":"530","parentId":"57","name":"Kvilleb\u00e4cken","country":"1"},{"id":"523","parentId":"57","name":"K\u00e5lltorp","country":"1"},{"id":"520","parentId":"57","name":"K\u00e4rra","country":"1"},{"id":"521","parentId":"57","name":"K\u00e4rralund","country":"1"},{"id":"522","parentId":"57","name":"K\u00e4rrdalen","country":"1"},{"id":"535","parentId":"57","name":"Landala","country":"1"},{"id":"577","parentId":"57","name":"Lindholmen","country":"1"},{"id":"536","parentId":"57","name":"Linnarhult","country":"1"},{"id":"537","parentId":"57","name":"Linnestaden","country":"1"},{"id":"538","parentId":"57","name":"Lorensberg","country":"1"},{"id":"539","parentId":"57","name":"Lundby","country":"1"},{"id":"540","parentId":"57","name":"Lunden","country":"1"},{"id":"533","parentId":"57","name":"L\u00e5ngedrag","country":"1"},{"id":"531","parentId":"57","name":"L\u00e4nsmansg\u00e5rden","country":"1"},{"id":"532","parentId":"57","name":"L\u00e4rjedalen","country":"1"},{"id":"534","parentId":"57","name":"L\u00f6vg\u00e4rdet","country":"1"},{"id":"541","parentId":"57","name":"Majorna","country":"1"},{"id":"543","parentId":"57","name":"Masthugget","country":"1"},{"id":"545","parentId":"57","name":"Nolered","country":"1"},{"id":"544","parentId":"57","name":"N\u00e4set","country":"1"},{"id":"546","parentId":"57","name":"Olivedal","country":"1"},{"id":"547","parentId":"57","name":"Olskroken","country":"1"},{"id":"549","parentId":"57","name":"Rannebergen","country":"1"},{"id":"550","parentId":"57","name":"Redbergslid","country":"1"},{"id":"551","parentId":"57","name":"Ruddalen","country":"1"},{"id":"548","parentId":"57","name":"R\u00f6dbo","country":"1"},{"id":"553","parentId":"57","name":"Sanna","country":"1"},{"id":"554","parentId":"57","name":"Sanneg\u00e5rden","country":"1"},{"id":"557","parentId":"57","name":"Skatteg\u00e5rden","country":"1"},{"id":"558","parentId":"57","name":"Skogome","country":"1"},{"id":"556","parentId":"57","name":"Sk\u00e5r","country":"1"},{"id":"555","parentId":"57","name":"Sk\u00e4lltorp","country":"1"},{"id":"559","parentId":"57","name":"Sl\u00e4ttadamm","country":"1"},{"id":"560","parentId":"57","name":"Stampen","country":"1"},{"id":"561","parentId":"57","name":"Stigberget","country":"1"},{"id":"562","parentId":"57","name":"Styrs\u00f6","country":"1"},{"id":"563","parentId":"57","name":"Svartedalen","country":"1"},{"id":"552","parentId":"57","name":"S\u00e4ve","country":"1"},{"id":"564","parentId":"57","name":"Tofta","country":"1"},{"id":"565","parentId":"57","name":"Torpa","country":"1"},{"id":"566","parentId":"57","name":"Torslanda","country":"1"},{"id":"567","parentId":"57","name":"Tuve","country":"1"},{"id":"568","parentId":"57","name":"Tynnered","country":"1"},{"id":"569","parentId":"57","name":"Utby","country":"1"},{"id":"570","parentId":"57","name":"Vasastaden","country":"1"},{"id":"573","parentId":"57","name":"\u00c4ngg\u00e5rden","country":"1"},{"id":"572","parentId":"57","name":"\u00c4ng\u00e5s","country":"1"},{"id":"574","parentId":"57","name":"\u00d6nnered","country":"1"},{"id":"575","parentId":"57","name":"\u00d6rgryte","country":"1"},{"id":"576","parentId":"57","name":"\u00d6ver\u00e5s","country":"1"},{"id":"29","parentId":"6","name":"Avesta","country":"1"},{"id":"30","parentId":"6","name":"Borl\u00e4nge","country":"1"},{"id":"31","parentId":"6","name":"Falun","country":"1"},{"id":"32","parentId":"6","name":"Gagnef","country":"1"},{"id":"33","parentId":"6","name":"Hedemora","country":"1"},{"id":"34","parentId":"6","name":"Leksand","country":"1"},{"id":"35","parentId":"6","name":"Ludvika","country":"1"},{"id":"36","parentId":"6","name":"Malung-S\u00e4len","country":"1"},{"id":"37","parentId":"6","name":"Mora","country":"1"},{"id":"38","parentId":"6","name":"Orsa","country":"1"},{"id":"39","parentId":"6","name":"R\u00e4ttvik","country":"1"},{"id":"40","parentId":"6","name":"Smedjebacken","country":"1"},{"id":"41","parentId":"6","name":"S\u00e4ter","country":"1"},{"id":"42","parentId":"6","name":"Vansbro","country":"1"},{"id":"43","parentId":"6","name":"\u00c4lvdalen","country":"1"},{"id":"207","parentId":"7","name":"Arvika","country":"1"},{"id":"208","parentId":"7","name":"Eda","country":"1"},{"id":"209","parentId":"7","name":"Filipstad","country":"1"},{"id":"210","parentId":"7","name":"Forshaga","country":"1"},{"id":"211","parentId":"7","name":"Grums","country":"1"},{"id":"212","parentId":"7","name":"Hagfors","country":"1"},{"id":"213","parentId":"7","name":"Hammar\u00f6","country":"1"},{"id":"214","parentId":"7","name":"Karlstad","country":"1"},{"id":"215","parentId":"7","name":"Kil","country":"1"},{"id":"216","parentId":"7","name":"Kristinehamn","country":"1"},{"id":"217","parentId":"7","name":"Munkfors","country":"1"},{"id":"218","parentId":"7","name":"Sunne","country":"1"},{"id":"219","parentId":"7","name":"S\u00e4ffle","country":"1"},{"id":"220","parentId":"7","name":"Torsby","country":"1"},{"id":"221","parentId":"7","name":"\u00c5rj\u00e4ng","country":"1"},{"id":"268","parentId":"8","name":"Askersund","country":"1"},{"id":"269","parentId":"8","name":"Degerfors","country":"1"},{"id":"270","parentId":"8","name":"Hallsberg","country":"1"},{"id":"271","parentId":"8","name":"H\u00e4llefors","country":"1"},{"id":"272","parentId":"8","name":"Karlskoga","country":"1"},{"id":"273","parentId":"8","name":"Kumla","country":"1"},{"id":"274","parentId":"8","name":"Lax\u00e5","country":"1"},{"id":"275","parentId":"8","name":"Lekeberg","country":"1"},{"id":"276","parentId":"8","name":"Lindesberg","country":"1"},{"id":"277","parentId":"8","name":"Ljusnarsberg","country":"1"},{"id":"278","parentId":"8","name":"Nora","country":"1"},{"id":"279","parentId":"8","name":"\u00d6rebro stad","country":"1"},{"id":"241","parentId":"9","name":"Arboga","country":"1"},{"id":"242","parentId":"9","name":"Fagersta","country":"1"},{"id":"243","parentId":"9","name":"Hallstahammar","country":"1"},{"id":"244","parentId":"9","name":"Kungs\u00f6r","country":"1"},{"id":"245","parentId":"9","name":"K\u00f6ping","country":"1"},{"id":"246","parentId":"9","name":"Norberg","country":"1"},{"id":"247","parentId":"9","name":"Sala","country":"1"},{"id":"248","parentId":"9","name":"Skinnskatteberg","country":"1"},{"id":"249","parentId":"9","name":"Surahammar","country":"1"},{"id":"250","parentId":"9","name":"V\u00e4ster\u00e5s","country":"1"}];RegionTree.countries=[{"country_name":"Sverige","country_iso":"SE","country_currency":"SEK","country_iso4217":"752"},{"country_name":"Danmark","country_iso":"DK","country_currency":"DKK","country_iso4217":"208"},{"country_name":"Norge","country_iso":"NO","country_currency":"NOK","country_iso4217":"578"}];RegionTree.depth=-1;RegionTree.lastId=0;RegionTree.countryId=1;RegionTree.regionName=function(region_id){for(i=0;i<this.regions.length;i++){if(this.regions[i].id==region_id)
return this.regions[i].name;}}
RegionTree.regionParent=function(region_id){for(i=0;i<this.regions.length;i++){if(this.regions[i].id==region_id)
return this.regions[i].parentId|0;}
return false;}
RegionTree.regionChildren=function(region_id){var children=[];for(i=0;i<this.regions.length;i++){if(this.regions[i].parentId==region_id)
children.push(this.regions[i]);}
return children;}
RegionTree.path=function(region_id){if(region_id==undefined)region_id=RegionTree.lastId;var path=this.regionName(region_id);while((p_id=this.regionParent(region_id))!=0){path=this.regionName(p_id)+' &raquo; '+path;region_id=p_id;}
return path;}
RegionTree.pathIds=function(region_id){if(region_id==undefined)region_id=RegionTree.lastId;var ids=[region_id|0];while((p_id=this.regionParent(region_id))!=0){ids.push(p_id);region_id=p_id;}
return ids;}
RegionTree.build=function(region_id){while(RegionTree.depth>-1)
RegionTree.remove();var ids=this.pathIds(region_id);var previd=0;var id=ids.pop();this.create(previd,id);previd=id;while(id=ids.pop()){this.create(previd,id);previd=id;}
this.create(previd);}
RegionTree.create=function(parent_id,selected_id,country,mode){if(selected_id==undefined)selected_id=0;if(country!=undefined)this.countryId=country;if(mode==undefined)mode='normal';this.depth++;name='region_'+this.depth;var sel=$.create('select',{'id':name,'name':'ad[region]['+this.depth+']','class':'regionselect'});$(sel).hide();if(mode=='normal')
$('#regionlist').append($(sel));if(mode=='search')
$('#regionsearch').append($(sel));if(mode=='normal'){$(sel).change(function(){if($(this).val()!=''){RegionTree.lastId=$(this).val();var mydepth=$(this).attr('id').split('_')[1]|0;while(mydepth<RegionTree.depth)
RegionTree.remove();RegionTree.create($(this).val());if(mydepth==RegionTree.depth)
$('#regionlist_ok').click();}else{$('#regionlist_ok').hide();}});}
var toplabel='&raquo; Välj område &laquo;';opt=$.create('option',{'value':''});if(mode=='search')
toplabel='&raquo; Hela landet &laquo;';$(opt).html(toplabel);$(sel).append($(opt));var selected_found=false;var idx=0;for(i=0;i<this.regions.length;i++){if(this.regions[i].parentId==parent_id&&this.regions[i].country==this.countryId){args={'value':this.regions[i].id};if(selected_id==this.regions[i].id)
selected_found=true;opt=$.create('option',args);$(opt).html(this.regions[i].name);$(sel).append($(opt));idx++;}}
if(!selected_found&&selected_id>0){optg=$.create('optgroup',{'label':'Nuvarande'});opt=$.create('option',{'value':selected_id});$(opt).html(RegionTree.regionName(selected_id));$(optg).append($(opt));$(sel).append($(optg));idx++;}
$(sel).val(selected_id);$(sel).val();if($(sel).children().length>1){$(sel).attr('style','');if(mode=='normal')
$('#regionlist_ok').hide();}else{this.remove();if(mode=='normal')
$('#regionlist_ok').show();}}
RegionTree.remove=function(){if(this.depth>-1){$('#region_'+this.depth).remove();this.depth--;}}
RegionTree.currentId=function(){return $('.regionselect:last').val();}
RegionTree.currentName=function(){return $('.regionselect:last option:selected').html();}
RegionTree.init=function(){$('#regionlist_ok').click(function(e){$('#regionlist_title').html(RegionTree.currentName());$('#regionlist_id').val(RegionTree.lastId);$('#regionlist_name').show();$('#regionlist').hide();$('#regionlist_help').hide();$('#regionlist_ok').hide();});$('#regionlist_retry').click(function(e){$('#regionlist_name').hide();$('#regionlist').show();$('#regionlist_help').show();$('#regionlist_ok').show();e.preventDefault();});};if(typeof BoPunkten=="undefined"){BoPunkten={Classes:{}};}
BoPunkten.l10n={translate:function(string){return BoPunkten.l10n.Phrases[string]?BoPunkten.l10n.Phrases[string]:string;},add:function(string,localized){BoPunkten.l10n.Phrases[string]=localized;},Phrases:{}};String.prototype.t=function(){return BoPunkten.l10n.translate(this);};BoPunkten.Classes.Toggler=function(el,options){if(!el){return false;}
this.el=$(el);this.options=options||{};this.className=this.options.prefix?this.options.prefix+"closed closed":"closed";this.closed=this.el.hasClass(this.className);}
BoPunkten.Classes.Toggler.prototype={toggle:function(){if(this.closed){this.open();}else{this.close();}},open:function(){this.el.removeClass(this.className);this.closed=false;},close:function(){this.el.addClass(this.className);this.closed=true;}}
$(document).ready(function(){if($("table.overview tbody tr").find("a[class!='delete']").length>=1){$("table#search-result tbody tr").click(function(){window.location=$(this).find("td[class!='photo']").children("a")[0].href;}).addClass("hover");}
$("table.overview tbody tr.saved-search-title").click(function(){if($(this).next(".saved-search-details").is(":hidden")){$("table.overview tbody tr.saved-search-details").hide();$(this).next(".saved-search-details").show();}else{$(this).next(".saved-search-details").hide();}}).addClass("hover");$("table.overview tbody tr:not(tr.saved-search-details):even").addClass("even");$("tr.saved-search-details").hide();$("table.component tr:even").addClass("even");$("table.component tr:odd").addClass("odd");$(".send-sms").change(function(){if($(this).is(':checked')){$(this).parents("tr").prev().find(".mobile-indicator").attr('src','/i/mobile.png');}else{$(this).parents("tr").prev().find(".mobile-indicator").attr('src','/i/mobile_off.png');}
$.get('/ajax/search/sms/'+$(this).attr('search_id')+'/'+($(this).is(':checked')?1:0));});$(".send-email").change(function(){if($(this).is(':checked')){$(this).parents("tr").prev().find(".email-indicator").attr('src','/i/email.png');}else{$(this).parents("tr").prev().find(".email-indicator").attr('src','/i/email_off.png');}
$.get('/ajax/search/email/'+$(this).attr('search_id')+'/'+($(this).is(':checked')?1:0));});$(".send-sms").change();$(".send-email").change();$("#specify-date").hide();$("#indate_later").click(function(){$("#specify-date").show();});$(".noticehide").click(function(){$(this).fadeOut();});});$(document).ready(function(){$(function(){if($.browser.msie){$("input:radio").click(function(){this.blur();this.focus();});$("input:checkbox").click(function(){this.blur();this.focus();});}});$(".areatag").corner("3px");RegionTree.init();Search.houses=searchHouses;Search.contracts=searchContracts;Search.maxrent=searchMaxrent;Search.minrooms=searchMinrooms;Search.init(searchMode);$(".overview .photo a, .ad-photos a").lightBox({imageLoading:'/i/lightbox-ico-loading.gif',imageBtnClose:'/i/lightbox-btn-close.gif',imageBtnPrev:'/i/lightbox-btn-prev.gif',imageBtnNext:'/i/lightbox-btn-next.gif',imageBlank:'/i/lightbox-blank.gif',txtImage:'Bild',txtOf:'av'});$("#ad_available_from").calendar({dateFormat:'YMD-',defaultDate:+0,firstDay:1,dayNames:['S','M','T','O','T','F','L'],monthNames:['Jan','Feb','Mar','Apr','Maj','Jun','Jul','Aug','Sep','Okt','Nov','Dec'],currentText:'I dag',clearText:'Radera',prevText:'Tidigare',nextText:'Senare',yearRange:'-0:+5',showOtherMonths:false});$("#ad_available_until").calendar({dateFormat:'YMD-',defaultDate:+0,firstDay:1,dayNames:['S','M','T','O','T','F','L'],monthNames:['Jan','Feb','Mar','Apr','Maj','Jun','Jul','Aug','Sep','Okt','Nov','Dec'],currentText:'I dag',clearText:'Radera',prevText:'Tidigare',nextText:'Senare',yearRange:'-0:+5',showOtherMonths:false});$("#ad_area").autocomplete("/ajax/check_region.php",{delay:10,minChars:2,matchSubset:1,matchContains:1,cacheLength:10,autoFill:false});$(".price").click(function(){if($("input[name=membership]:checked").val()==4)
$(".paymentrow").hide();else
$(".paymentrow").show();if($("input[name=payment]:checked").val()==1)
$(".ssnrow").show();else
$(".ssnrow").hide();});$(".price").click(updateTotal);$(".smsprice").click(updateTotal);updateTotal();if($("input[name=membership]:checked").val()==4)
$(".paymentrow").hide();$("#email").change(function(){$("#email_load").attr('src','/i/ajax-loader.gif');jQuery.get('/ajax/check_email.php?email='+$(this).val(),function(data){$("#email_load").attr('src','/i/'+data+'.gif');if(data=='dupe')
$("#email_dupe").show();else
$("#email_dupe").hide();});});$("#email_dupe_login").click(function(e){$(this).attr('href',$(this).attr('href')+$("#email").val());});$("#discount_apply").click(function(){$.get('/ajax/get_discount.php',{code:$("#discount").val()},function(data){if(data.indexOf('%')==-1){$("#discount_value").attr('price',parseInt(data));$("#discount_value").attr('percent',0);}else{$("#discount_value").attr('price',0);$("#discount_value").attr('percent',(parseInt(data))/100);}
updateTotal();});});if($("#discount").val()!='')
$("#discount_apply").click();$("#clientid_update").click(function(){$(".memberaddress").html(clientData.firstname+' '+clientData.lastname+'<br />'+clientData.address+'<br />'+clientData.zipcode+' '+clientData.city);$("#ssn").next().html(clientData.pno);$.get('/ajax/update_address.php',clientData);$("#clientid_newaddress").hide();});$("#clientID").change(function(){if($(this).val()[2]>1)
companyProfile(true);$("#clientid_newaddress").hide();$("#clientid_load").attr('src','/i/ajax-loader.gif');jQuery.get('/ajax/check_address.php?clientId='+$(this).val(),function(data){var formObj=document.forms['clientForm'];if(data.length){$("#clientid_load").attr('src','/i/success.gif');eval(data);if(formObj==undefined){if(/Adress saknas/.test($(".memberaddress").html())){$("#clientid_update").click();}else{$("#clientid_newaddress").show();}}else{formObj.firstname.value=clientData.firstname;formObj.lastname.value=clientData.lastname;formObj.address.value=clientData.address;formObj.zipcode.value=clientData.zipcode;formObj.city.value=clientData.city;}}else{$("#clientid_load").attr('src','/i/fail.gif');}});});$(".remove-saved-search").click(function(e){if(confirm('Är du säker på att du vill ta bort den sparade sökningen?')){$(this).parents('tr').prev().fadeOut();$(this).parents('tr').fadeOut();$.get('/ajax/search/remove/'+$(this).attr('search_id'));e.preventDefault();}});$("#terms").hide();$(".terms-toggler").click(function(e){$("#terms").toggle();e.preventDefault();});$("img.radio").click(function(){$(".ad_house_room[value="+$(this).attr('matchvalue')+"]").attr('checked','checked');$(".ad_house_room").change();});$("#ad_country_code").change(function(){if($(this).val()==1)
$('#regionlist_help').show();else
$('#regionlist_help').hide();region=0;$(".regionselect").remove();RegionTree.create(0,0,$(this).val());$(".currency").html(Currency[$(this).val()])});if($("#ad_country_code").length){RegionTree.create(0,0,$("#ad_country_code").val());}
if($("#search_country_code").length){RegionTree.create(0,regionId,$("#search_country_code").val(),'search');}
$("#search_country_code").change(function(){region=0;$(".regionselect").remove();RegionTree.create(0,0,$(this).val(),'search');$(".currency").html(Currency[$(this).val()])});$(".login-link").click(function(e){$("#login-compact").show();e.preventDefault();});$(".currency").html(Currency[$("#ad_country_code").val()])
$('#user_terms_of_service').change(function(){$('#accept_terms').toggleClass('notaccepted');});if($("#user_terms_of_service").not(':checked').length)
$('#accept_terms').addClass('notaccepted');$("#ad_postal_code").change(function(){if($("#ad_country_code").val()!=1)
return;$("#zipcode_load").attr('src','/i/ajax-loader.gif');jQuery.get('/ajax/get_postal_region.php',{zipcode:$(this).val()},function(data){if(data.length){var postal_region_id=false;eval(data);if(postal_region_id){$('#regionlist_retry').click();RegionTree.build(postal_region_id);if(RegionTree.currentId()!='')
$('#regionlist_ok').click();}
$("#zipcode_load").attr('src','/i/trans.gif');}});});if($("#ad_postal_code").length&&$("#ad_postal_code").val().length>=5&&!regionId)
$("#ad_postal_code").change();else if($("#ad_postal_code").length&&regionId){$('#regionlist_retry').click();RegionTree.build(regionId);$('#regionlist_ok').click();}
$("#ad_contract_type").change(function(){showSellPrice($(this).val());});showSellPrice($("#ad_contract_type").val());$(".ad_house_room").change(function(e){if($(this).is(":checked")){if($(this).val()=='room_5'){$("#contractcheckbox-container").hide();$("#furniture-container").addClass('room');$("#ad_house_room_select").removeClass('invisible');$("#ad_contract_type")[0].selectedIndex=0;$("#ad_contract_type").change();}else{$("#ad_house_room_select").addClass('invisible');$("#furniture-container").removeClass('room');if($("#ad_contract_type")[0].selectedIndex=='0')
$("#contractcheckbox-container").show();}}});$(".ad_house_room").change();$("#ad_contract_firsthand").change(function(){if($(this).attr('checked')==true){showMask();$("#contract-disclaimer").show();}else{hideMask();$("#contract-disclaimer").hide();}});$("#contract-disclaimer").hide();$("#contract-yes").click(function(){$("#ad_contract_firsthand").attr('checked','checked');$("#contract-disclaimer").hide();hideMask();});$("#contract-no").click(function(){$("#ad_contract_firsthand").removeAttr('checked');$("#contract-disclaimer").hide();hideMask();});$("#companylink").toggle(function(){companyProfile(true);},function(){companyProfile(false);});companyProfile(false);$("#rentlevel").change(function(){if($(this).val()==-1)
$("#rentlevel_label").html("&nbsp;");else
$("#rentlevel_label").html("Upp till "+$(this).val()+" i hyra.");});$("#rentlevel").change();if($('#saved_search_region').length)
savedSearchRegion();$('#smstimeall').click(function(){if($(this).is(':checked')){$("#smstimestamps").fadeOut();$.get('/ajax/search/savetime',{'start':'00:00:00','end':'23:59:59'},function(data){savedSearchStatus(data);});}else{$("#smstimestamps").fadeIn();$.get('/ajax/search/savetime',{'start':$('#smstime1').val(),'end':$('#smstime2').val()},function(data){savedSearchStatus(data);});}});$('.smstime').change(function(){jQuery.get('/ajax/search/savetime',{'start':$('#smstime1').val(),'end':$('#smstime2').val()},function(data){savedSearchStatus(data);});});mask=new Image();mask.src='/i/mask.png';$("table.logs tr.message").hide();$("table.logs tr.header td").click(function(){if($(this).parent().hasClass('label'))
$(this).parent().next().next().toggle();else
$(this).parent().next().toggle();});$(".logfilter").click(function(){$('tr.level'+$(this).val()).toggle();});});function savedSearchStatus(code){if(code=='OK'){css="smsok";msg="&Auml;ndringarna sparade";}else{css="smserror";msg="Kunde inte spara";}
$(".savestatus").fadeOut(1,function(){$(".savestatus").html(msg);$(".savestatus").removeClass('smserror smsok').addClass(css).fadeIn(1000);});}
function savedSearchRegion(countryId,regionId,parentId){if(countryId==undefined){jQuery.get('/ajax/get_saved_search_region.php',function(data){eval('var countrylist = '+data+';');$("#saved_search_region").html('');for(var country_id in countrylist){var a=$.create('a',{'href':'#'});c=countrylist[country_id].split('|');$(a).html('<img src="/i/flags/'+c[1]+'.png"> '+c[0]);eval('$(a).click(function(e) {  savedSearchRegion('+country_id+'); e.preventDefault();  });');$("#saved_search_region").append(a)
$("#saved_search_region").append($.create('br',{}));}});}else{regionId=regionId|0;jQuery.get('/ajax/get_saved_search_region.php?country_id='+countryId+'&region_id='+regionId,function(data){eval('var regionlist = '+data+';');$("#saved_search_region").html('');back=$.create('a',{'href':'#'+(parentId|0)});$(back).html('Tillbaka');$(back).click(function(e){if(parentId==undefined)
savedSearchRegion();else
savedSearchRegion(countryId,parentId);e.preventDefault();});var ul=$.create('ul',{});$("#saved_search_region").append($.create('« '),back,$.create('br',{}));for(var region_id in regionlist){r=regionlist[region_id].split('|');if(r[1]==1){var a=$.create('a',{'href':'#'});$(a).html(r[0]);eval('$(a).click(function(e) {  savedSearchRegion('+countryId+', '+region_id+', '+regionId+'); e.preventDefault(); });');}else{var a=$.create(r[0]);}
var label=$.create('label',{});$(label).append($.create('input',{'type':'checkbox','name':'region[]','value':region_id}),$.create(' '),a,$.create('br',{}));var li=$.create('li',{});$(li).append(label);$(ul).append(li);}
$("#saved_search_region").append(ul);});}}
function showMask(){var maskHeight=$(document).height();var maskWidth=$(window).width();$('#mask').css({'width':maskWidth,'height':maskHeight});$('#mask').fadeIn(500);}
function hideMask(){$('#mask').hide();}
function showSellPrice(show){if(show==2){$("#price-container").hide();if($(".ad_house_room[checked]").val()!='room_5')
$("#contract-container").show();$("#available-container").show();$("#furniture-container").show();}
if(show==3){$("#price-container").show();$("#contract-container").hide();$("#available-container").hide();$("#furniture-container").hide();if($(".ad_house_room[value='room_5']").is(':checked')){$("#ad_apartment_option").attr('checked','checked');$("#ad_house_room_select").addClass('invisible');}}}
function companyProfile(enable){if(enable){$(".companyrow").show();$("#iscompany").val(1);$("#ssn").html('Org.nummer');$("#companylink").html('Privatperson?');}else{$(".companyrow").hide();$("#iscompany").val(0);$("#ssn").html('Personnummer');$("#companylink").html('Företagskund?');}}
function updateTotal(){total=0;discount=0;$(".price[checked]").each(function(idx,item){total+=parseInt(item.getAttribute('price'));});$(".price[type=hidden]").each(function(idx,item){total+=parseInt(item.getAttribute('price'));});$(".discount[type=hidden]").each(function(idx,item){discount+=parseInt(item.getAttribute('price'));discount+=total*parseFloat(item.getAttribute('percent'));});if(discount>total)
discount=total;$(".smsprice[checked]").each(function(idx,item){total+=parseInt(item.getAttribute('price'));});if(discount==0)
$("#totalSum").html(total+' kr');else
$("#totalSum").html(total+' kr - <span class="discounted">'+Math.round(discount)+' kr</span> = '+(total-Math.round(discount))+' kr');}
function in_array(v,a){if(a==undefined)
return false;return((String(','+a.toString()+',').search(','+v+',')>-1)?true:false)}
var Search={};Search.mode=0;Search.houses=[];Search.contracts=[];Search.maxrent=0;Search.init=function(search_mode){if(search_mode!=undefined)
this.mode=search_mode;$('input.modeselector').change(function(){if($('input.modeselector:checked').val()=='simple')
$('#advanced-search').hide('slow');else
$('#advanced-search').show('slow');});$('#advanced-search input[type=checkbox].house').each(function(){if(in_array($(this).val(),Search.houses))
$(this).attr('checked','checked');else
$(this).removeAttr('checked');});$('#advanced-search input[type=checkbox].contract').each(function(){if(in_array($(this).val(),Search.contracts))
$(this).attr('checked','checked');else
$(this).removeAttr('checked');});if(this.houses.length==0&&this.contracts.length==0)
$('#advanced-search input[type=checkbox]').attr('checked','checked');$('#advanced-search input.maxrent').val(Search.maxrent);rooms=Search.minrooms.toString();if(rooms=='9')rooms=rooms+'+';$('#advanced-search select.minrooms').val(rooms);if(this.mode==1){$('input.modeselector[value=advanced]').click();$('#advanced-search').show();}};$(document).ready(JT_init);function JT_init(){$("a.jTip").hover(function(){JT_show(this.href,this.id,this.name)},function(){$('#JT').remove()}).click(function(){return false});}
function JT_show(url,linkId,title){if(title==false)title="&nbsp;";var de=document.documentElement;var w=self.innerWidth||(de&&de.clientWidth)||document.body.clientWidth;var hasArea=w-getAbsoluteLeft(linkId);var clickElementy=getAbsoluteTop(linkId)-3;var queryString=url.replace(/^[^\?]+\??/,'');var params=parseQuery(queryString);if(params['width']===undefined){params['width']=250};if(params['link']!==undefined){$('#'+linkId).bind('click',function(){window.location=params['link']});$('#'+linkId).css('cursor','pointer');}
if(hasArea>((params['width']*1)+75)){$("body").append("<div id='JT' style='width:"+params['width']*1+"px'><div id='JT_arrow_left'></div><div id='JT_close_left'>"+title+"</div><div id='JT_copy'><div class='JT_loader'><div></div></div>");var arrowOffset=getElementWidth(linkId)+11;var clickElementx=getAbsoluteLeft(linkId)+arrowOffset;}else{$("body").append("<div id='JT' style='width:"+params['width']*1+"px'><div id='JT_arrow_right' style='left:"+((params['width']*1)+1)+"px'></div><div id='JT_close_right'>"+title+"</div><div id='JT_copy'><div class='JT_loader'><div></div></div>");var clickElementx=getAbsoluteLeft(linkId)-((params['width']*1)+15);}
$('#JT').css({left:clickElementx+"px",top:clickElementy+"px"});$('#JT').show();$('#JT_copy').load(url);}
function getElementWidth(objectId){x=document.getElementById(objectId);return x.offsetWidth;}
function getAbsoluteLeft(objectId){o=document.getElementById(objectId)
oLeft=o.offsetLeft
while(o.offsetParent!=null){oParent=o.offsetParent
oLeft+=oParent.offsetLeft
o=oParent}
return oLeft}
function getAbsoluteTop(objectId){o=document.getElementById(objectId)
oTop=o.offsetTop
while(o.offsetParent!=null){oParent=o.offsetParent
oTop+=oParent.offsetTop
o=oParent}
return oTop}
function parseQuery(query){var Params=new Object();if(!query)return Params;var Pairs=query.split(/[;&]/);for(var i=0;i<Pairs.length;i++){var KeyVal=Pairs[i].split('=');if(!KeyVal||KeyVal.length!=2)continue;var key=unescape(KeyVal[0]);var val=unescape(KeyVal[1]);val=val.replace(/\+/g,' ');Params[key]=val;}
return Params;}
function blockEvents(evt){if(evt.target){evt.preventDefault();}else{evt.returnValue=false;}}