/* total_time : 1.32 ms | total weight : 174.36 ko /*
/*
 * jQuery 1.2.4b - New Wave Javascript
 *
 * Copyright (c) 2008 John Resig (jquery.com)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * $Date: 2008-05-16 20:37:11 +0200 (ven, 16 mai 2008) $
 * $Rev: 5623 $
 */
(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.4b",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;}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.length?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(notxml&&!special&&name in elem){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);if(msie&&special&&notxml)return elem.getAttribute(name,2);return elem.getAttribute(name);}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($){$.dimensions={version:'@VERSION'};$.each(['Height','Width'],function(i,name){$.fn['inner'+name]=function(){if(!this[0])return;var torl=name=='Height'?'Top':'Left',borr=name=='Height'?'Bottom':'Right';return this.css('display')!='none'?this[0]['client'+name]:num(this,name.toLowerCase())+num(this,'padding'+torl)+num(this,'padding'+borr)};$.fn['outer'+name]=function(options){if(!this[0])return;var torl=name=='Height'?'Top':'Left',borr=name=='Height'?'Bottom':'Right';options=$.extend({margin:false},options||{});var val=this.css('display')!='none'?this[0]['offset'+name]:num(this,name.toLowerCase())+num(this,'border'+torl+'Width')+num(this,'border'+borr+'Width')+num(this,'padding'+torl)+num(this,'padding'+borr);return val+(options.margin?(num(this,'margin'+torl)+num(this,'margin'+borr)):0)}});$.each(['Left','Top'],function(i,name){$.fn['scroll'+name]=function(val){if(!this[0])return;return val!=undefined?this.each(function(){this==window||this==document?window.scrollTo(name=='Left'?val:$(window)['scrollLeft'](),name=='Top'?val:$(window)['scrollTop']()):this['scroll'+name]=val}):this[0]==window||this[0]==document?self[(name=='Left'?'pageXOffset':'pageYOffset')]||$.boxModel&&document.documentElement['scroll'+name]||document.body['scroll'+name]:this[0]['scroll'+name]}});$.fn.extend({position:function(){var left=0,top=0,elem=this[0],offset,parentOffset,offsetParent,results;if(elem){offsetParent=this.offsetParent();offset=this.offset();parentOffset=offsetParent.offset();offset.top-=num(elem,'marginTop');offset.left-=num(elem,'marginLeft');parentOffset.top+=num(offsetParent,'borderTopWidth');parentOffset.left+=num(offsetParent,'borderLeftWidth');results={top:offset.top-parentOffset.top,left:offset.left-parentOffset.left}}return results},offsetParent:function(){var offsetParent=this[0].offsetParent;while(offsetParent&&(!/^body|html$/i.test(offsetParent.tagName)&&$.css(offsetParent,'position')=='static'))offsetParent=offsetParent.offsetParent;return $(offsetParent)}});function num(el,prop){return parseInt($.curCSS(el.jquery?el[0]:el,prop,true))||0}})(jQuery);;
(function($){$.extend({metadata:{defaults:{type:'class',name:'metadata',cre:/({.*})/,single:'metadata'},setType:function(type,name){this.defaults.type=type;this.defaults.name=name},get:function(elem,opts){var settings=$.extend({},this.defaults,opts);if(!settings.single.length)settings.single='metadata';var data=$.data(elem,settings.single);if(data)return data;data="{}";if(settings.type=="class"){var m=settings.cre.exec(elem.className);if(m)data=m[1]}else if(settings.type=="elem"){if(!elem.getElementsByTagName)return undefined;var e=elem.getElementsByTagName(settings.name);if(e.length)data=$.trim(e[0].innerHTML)}else if(elem.getAttribute!=undefined){var attr=elem.getAttribute(settings.name);if(attr)data=attr}if(data.indexOf('{')<0)data="{"+data+"}";data=eval("("+data+")");$.data(elem,settings.single,data);return data}}});$.fn.metadata=function(opts){return $.metadata.get(this[0],opts)}})(jQuery);;
(function($){$.fn.bgIframe=$.fn.bgiframe=function(s){if($.browser.msie&&/6.0/.test(navigator.userAgent)){s=$.extend({top:'auto',left:'auto',width:'auto',height:'auto',opacity:true,src:'javascript:false;'},s||{});var prop=function(n){return n&&n.constructor==Number?n+'px':n;},html='<iframe class="bgiframe"frameborder="0"tabindex="-1"src="'+s.src+'"'+'style="display:block;position:absolute;z-index:-1;'+(s.opacity!==false?'filter:Alpha(Opacity=\'0\');':'')+'top:'+(s.top=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+\'px\')':prop(s.top))+';'+'left:'+(s.left=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+\'px\')':prop(s.left))+';'+'width:'+(s.width=='auto'?'expression(this.parentNode.offsetWidth+\'px\')':prop(s.width))+';'+'height:'+(s.height=='auto'?'expression(this.parentNode.offsetHeight+\'px\')':prop(s.height))+';'+'"/>';return this.each(function(){if($('> iframe.bgiframe',this).length==0)this.insertBefore(document.createElement(html),this.firstChild);});}return this;};})(jQuery);;
/* HACK : commenté jQuery.validator.attributeRules(element)
 * jQuery validation plug-in 1.3
 * $Id: jquery.validate.js 5565 2008-05-12 11:15:24Z joern.zaefferer $
 */
jQuery.extend(jQuery.fn,{validate:function(options){if(!this.length){options&&options.debug&&window.console&&console.warn("nothing selected, can't validate, returning nothing");return;}var validator=jQuery.data(this[0],'validator');if(validator){return validator;}validator=new jQuery.validator(options,this[0]);jQuery.data(this[0],'validator',validator);if(validator.settings.onsubmit){this.find(".cancel:submit").click(function(){validator.cancelSubmit=true;});this.submit(function(event){if(validator.settings.debug)event.preventDefault();function handle(){if(validator.settings.submitHandler){validator.settings.submitHandler.call(validator,validator.currentForm);return false;}return true;}if(validator.cancelSubmit){validator.cancelSubmit=false;return handle();}if(validator.form()){if(validator.pendingRequest){validator.formSubmitted=true;return false;}return handle();}else{validator.focusInvalid();return false;}});}return validator;},valid:function(){if(jQuery(this[0]).is('form')){return this.validate().form();}else{var valid=false;var validator=jQuery(this[0].form).validate();this.each(function(){valid|=validator.element(this);});return valid;}},removeAttrs:function(attributes){var result={},$element=this;$.each(attributes.split(/\s/),function(){result[this]=$element.attr(this);$element.removeAttr(this);});return result;},rules:function(command,argument){var element=this[0];if(command){var staticRules=jQuery.data(element.form,'validator').settings.rules;var existingRules=jQuery.validator.staticRules(element);switch(command){case"add":$.extend(existingRules,jQuery.validator.normalizeRule(argument));staticRules[element.name]=existingRules;break;case"remove":if(!argument){delete staticRules[element.name];return existingRules;}var filtered={};$.each(argument.split(/\s/),function(index,method){filtered[method]=existingRules[method];delete existingRules[method];});return filtered;}}var data=jQuery.validator.normalizeRules(jQuery.extend({},jQuery.validator.metadataRules(element),jQuery.validator.classRules(element),/*jQuery.validator.attributeRules(element),*/jQuery.validator.staticRules(element)),element);if(data.required){var param=data.required;delete data.required;data=$.extend({required:param},data);}return data;},push:function(t){return this.setArray(this.add(t).get());}});jQuery.extend(jQuery.expr[":"],{blank:function(a){return!jQuery.trim(a.value);},filled:function(a){return!!jQuery.trim(a.value);},unchecked:function(a){return!a.checked;}});jQuery.format=function(source,params){if(arguments.length==1)return function(){var args=jQuery.makeArray(arguments);args.unshift(source);return jQuery.format.apply(this,args);};if(arguments.length>2&&params.constructor!=Array){params=jQuery.makeArray(arguments).slice(1);}if(params.constructor!=Array){params=[params];}jQuery.each(params,function(i,n){source=source.replace(new RegExp("\\{"+i+"\\}","g"),n);});return source;};jQuery.validator=function(options,form){this.settings=jQuery.extend({},jQuery.validator.defaults,options);this.currentForm=form;this.init();};jQuery.extend(jQuery.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",errorElement:"label",focusInvalid:true,errorContainer:jQuery([]),errorLabelContainer:jQuery([]),onsubmit:true,ignore:[],onfocusin:function(element){this.lastActive=element;if(this.settings.focusCleanup&&!this.blockFocusCleanup){this.settings.unhighlight&&this.settings.unhighlight.call(this,element,this.settings.errorClass);this.errorsFor(element).hide();}},onfocusout:function(element){if(!this.checkable(element)&&(element.name in this.submitted||!this.optional(element))){this.element(element);}},onkeyup:function(element){if(element.name in this.submitted||element==this.lastElement){this.element(element);}},onclick:function(element){if(element.name in this.submitted)this.element(element);},highlight:function(element,errorClass){jQuery(element).addClass(errorClass);},unhighlight:function(element,errorClass){jQuery(element).removeClass(errorClass);}},setDefaults:function(settings){jQuery.extend(jQuery.validator.defaults,settings);},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",dateDE:"Bitte geben Sie ein gültiges Datum ein.",number:"Please enter a valid number.",numberDE:"Bitte geben Sie eine Nummer ein.",digits:"Please enter only digits",creditcard:"Please enter a valid credit card.",equalTo:"Please enter the same value again.",accept:"Please enter a value with a valid extension.",maxlength:jQuery.format("Please enter no more than {0} characters."),maxLength:jQuery.format("Please enter no more than {0} characters."),minlength:jQuery.format("Please enter at least {0} characters."),minLength:jQuery.format("Please enter at least {0} characters."),rangelength:jQuery.format("Please enter a value between {0} and {1} characters long."),rangeLength:jQuery.format("Please enter a value between {0} and {1} characters long."),rangeValue:jQuery.format("Please enter a value between {0} and {1}."),range:jQuery.format("Please enter a value between {0} and {1}."),maxValue:jQuery.format("Please enter a value less than or equal to {0}."),max:jQuery.format("Please enter a value less than or equal to {0}."),minValue:jQuery.format("Please enter a value greater than or equal to {0}."),min:jQuery.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:false,prototype:{init:function(){this.labelContainer=jQuery(this.settings.errorLabelContainer);this.errorContext=this.labelContainer.length&&this.labelContainer||jQuery(this.currentForm);this.containers=jQuery(this.settings.errorContainer).add(this.settings.errorLabelContainer);this.submitted={};this.valueCache={};this.pendingRequest=0;this.pending={};this.invalid={};this.reset();var groups=(this.groups={});jQuery.each(this.settings.groups,function(key,value){jQuery.each(value.split(/\s/),function(index,name){groups[name]=key;});});var rules=this.settings.rules;jQuery.each(rules,function(key,value){rules[key]=jQuery.validator.normalizeRule(value);});function delegate(event){var validator=jQuery.data(this[0].form,"validator");validator.settings["on"+event.type]&&validator.settings["on"+event.type].call(validator,this[0]);}jQuery(this.currentForm).delegate("focusin focusout keyup",":text, :password, :file, select, textarea",delegate).delegate("click",":radio, :checkbox",delegate);},form:function(){this.checkForm();jQuery.extend(this.submitted,this.errorMap);this.invalid=jQuery.extend({},this.errorMap);if(!this.valid())jQuery(this.currentForm).triggerHandler("invalid-form.validate",[this]);this.showErrors();return this.valid();},checkForm:function(){this.prepareForm();for(var i=0,elements=this.elements();elements[i];i++){this.check(elements[i]);}return this.valid();},element:function(element){element=this.clean(element);this.lastElement=element;this.prepareElement(element);var result=this.check(element);if(result){delete this.invalid[element.name];}else{this.invalid[element.name]=true;}if(!this.numberOfInvalids()){this.toHide.push(this.containers);}this.showErrors();return result;},showErrors:function(errors){if(errors){jQuery.extend(this.errorMap,errors);this.errorList=[];for(var name in errors){this.errorList.push({message:errors[name],element:this.findByName(name)[0]});}this.successList=jQuery.grep(this.successList,function(element){return!(element.name in errors);});}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors();},resetForm:function(){if(jQuery.fn.resetForm)jQuery(this.currentForm).resetForm();this.prepareForm();this.hideErrors();this.elements().removeClass(this.settings.errorClass);},numberOfInvalids:function(){return this.objectLength(this.invalid);},objectLength:function(obj){var count=0;for(var i in obj)count++;return count;},hideErrors:function(){this.addWrapper(this.toHide).hide();},valid:function(){return this.size()==0;},size:function(){return this.errorList.length;},focusInvalid:function(){if(this.settings.focusInvalid){try{jQuery(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus();}catch(e){}}},findLastActive:function(){var lastActive=this.lastActive;return lastActive&&jQuery.grep(this.errorList,function(n){return n.element.name==lastActive.name;}).length==1&&lastActive;},elements:function(){var validator=this,rulesCache={};return jQuery([]).add(this.currentForm.elements).filter("input, select, textarea").not(":submit, :reset, [disabled]").not(this.settings.ignore).filter(function(){!this.name&&validator.settings.debug&&window.console&&console.error("%o has no name assigned",this);if(this.name in rulesCache||!validator.objectLength($(this).rules()))return false;rulesCache[this.name]=true;return true;});},clean:function(selector){return jQuery(selector)[0];},errors:function(){return jQuery(this.settings.errorElement+"."+this.settings.errorClass,this.errorContext);},reset:function(){this.successList=[];this.errorList=[];this.errorMap={};this.toShow=jQuery([]);this.toHide=jQuery([]);this.formSubmitted=false;},prepareForm:function(){this.reset();this.toHide=this.errors().push(this.containers);},prepareElement:function(element){this.reset();this.toHide=this.errorsFor(element);},check:function(element){element=this.clean(element);if(this.checkable(element)){element=this.findByName(element.name)[0];}var rules=$(element).rules();var dependencyMismatch=false;for(method in rules){var rule={method:method,parameters:rules[method]};try{var result=jQuery.validator.methods[method].call(this,jQuery.trim(element.value),element,rule.parameters);if(result=="dependency-mismatch"){dependencyMismatch=true;continue;}dependencyMismatch=false;if(result=="pending"){this.toHide=this.toHide.not(this.errorsFor(element));return;}if(!result){this.formatAndAdd(element,rule);return false;}}catch(e){this.settings.debug&&window.console&&console.log("exception occured when checking element "+element.id
+", check the '"+rule.method+"' method");throw e;}}if(dependencyMismatch)return;if(this.objectLength(rules))this.successList.push(element);return true;},customMessage:function(name,method){var m=this.settings.messages[name];return m&&(m.constructor==String?m:m[method]);},findDefined:function(){for(var i=0;i<arguments.length;i++){if(arguments[i]!==undefined)return arguments[i];}return undefined;},defaultMessage:function(element,method){return this.findDefined(this.customMessage(element.name,method),element.title||undefined,jQuery.validator.messages[method],"<strong>Warning: No message defined for "+element.name+"</strong>");},formatAndAdd:function(element,rule){var message=this.defaultMessage(element,rule.method);if(typeof message=="function")message=message.call(this,rule.parameters,element);this.errorList.push({message:message,element:element});this.errorMap[element.name]=message;this.submitted[element.name]=message;},addWrapper:function(toToggle){if(this.settings.wrapper)toToggle.push(toToggle.parents(this.settings.wrapper));return toToggle;},defaultShowErrors:function(){for(var i=0;this.errorList[i];i++){var error=this.errorList[i];this.settings.highlight&&this.settings.highlight.call(this,error.element,this.settings.errorClass);this.showLabel(error.element,error.message);}if(this.errorList.length){this.toShow.push(this.containers);}if(this.settings.success){for(var i=0;this.successList[i];i++){this.showLabel(this.successList[i]);}}if(this.settings.unhighlight){for(var i=0,elements=this.validElements();elements[i];i++){this.settings.unhighlight.call(this,elements[i],this.settings.errorClass);}}this.toHide=this.toHide.not(this.toShow);this.hideErrors();this.addWrapper(this.toShow).show();},validElements:function(){return this.elements().not(this.invalidElements());},invalidElements:function(){return jQuery(this.errorList).map(function(){return this.element;});},showLabel:function(element,message){var label=this.errorsFor(element);if(label.length){label.removeClass().addClass(this.settings.errorClass);label.attr("generated")&&label.html(message);}else{label=jQuery("<"+this.settings.errorElement+"/>").attr({"for":this.idOrName(element),generated:true}).addClass(this.settings.errorClass).html(message||"");if(this.settings.wrapper){label=label.hide().show().wrap("<"+this.settings.wrapper+">").parent();}if(!this.labelContainer.append(label).length)this.settings.errorPlacement?this.settings.errorPlacement(label,jQuery(element)):label.insertAfter(element);}if(!message&&this.settings.success){label.text("");typeof this.settings.success=="string"?label.addClass(this.settings.success):this.settings.success(label);}this.toShow.push(label);},errorsFor:function(element){return this.errors().filter("[@for='"+this.idOrName(element)+"']");},idOrName:function(element){return this.groups[element.name]||(this.checkable(element)?element.name:element.id||element.name);},checkable:function(element){return/radio|checkbox/i.test(element.type);},findByName:function(name){var form=this.currentForm;return jQuery(document.getElementsByName(name)).map(function(index,element){return element.form==form&&element.name==name&&element||null;});},getLength:function(value,element){switch(element.nodeName.toLowerCase()){case'select':return jQuery("option:selected",element).length;case'input':if(this.checkable(element))return this.findByName(element.name).filter(':checked').length;}return value.length;},depend:function(param,element){return this.dependTypes[typeof param]?this.dependTypes[typeof param](param,element):true;},dependTypes:{"boolean":function(param,element){return param;},"string":function(param,element){return!!jQuery(param,element.form).length;},"function":function(param,element){return param(element);}},optional:function(element){return!jQuery.validator.methods.required.call(this,jQuery.trim(element.value),element)&&"dependency-mismatch";},startRequest:function(element){if(!this.pending[element.name]){this.pendingRequest++;this.pending[element.name]=true;}},stopRequest:function(element,valid){this.pendingRequest--;if(this.pendingRequest<0)this.pendingRequest=0;delete this.pending[element.name];if(valid&&this.pendingRequest==0&&this.formSubmitted&&this.form()){jQuery(this.currentForm).submit();}},previousValue:function(element){return jQuery.data(element,"previousValue")||jQuery.data(element,"previousValue",previous={old:null,valid:true,message:this.defaultMessage(element,"remote")});}},classRuleSettings:{required:{required:true},email:{email:true},url:{url:true},date:{date:true},dateISO:{dateISO:true},dateDE:{dateDE:true},number:{number:true},numberDE:{numberDE:true},digits:{digits:true},creditcard:{creditcard:true}},addClassRules:function(className,rules){className.constructor==String?this.classRuleSettings[className]=rules:jQuery.extend(this.classRuleSettings,className);},classRules:function(element){var rules={};var classes=jQuery(element).attr('class');classes&&jQuery.each(classes.split(' '),function(){if(this in jQuery.validator.classRuleSettings){jQuery.extend(rules,jQuery.validator.classRuleSettings[this]);}});return rules;},attributeRules:function(element){var rules={};var $element=jQuery(element);for(method in jQuery.validator.methods){var value=$element.attr(method);if(value!==undefined&&value!==''){rules[method]=value;}}if(rules.maxlength&&/-1|2147483647|524288/.test(rules.maxlength)){delete rules.maxlength;delete rules.maxLength;}return rules;},metadataRules:function(element){if(!jQuery.metadata)return{};var meta=jQuery.data(element.form,'validator').settings.meta;return meta?jQuery(element).metadata()[meta]:jQuery(element).metadata();},staticRules:function(element){var rules={};var validator=jQuery.data(element.form,'validator');if(validator.settings.rules){rules=jQuery.validator.normalizeRule(validator.settings.rules[element.name])||{};}return rules;},normalizeRules:function(rules,element){jQuery.each({minLength:'minlength',maxLength:'maxlength',rangeLength:'rangelength',minValue:'min',maxValue:'max',rangeValue:'range'},function(dep,curr){if(rules[dep]){rules[curr]=rules[dep];delete rules[dep];}});$.each(rules,function(prop,val){if(val===false){delete rules[prop];return;}if(val.param||val.depends){var keepRule=true;switch(typeof val.depends){case"string":keepRule=!!jQuery(val.depends,element.form).length;break;case"function":keepRule=val.depends.call(element,element);break;}if(keepRule){rules[prop]=val.param!==undefined?val.param:true;}else{delete rules[prop];}}});jQuery.each(rules,function(rule,parameter){rules[rule]=jQuery.isFunction(parameter)?parameter(element):parameter;});jQuery.each(['minlength','maxlength','min','max'],function(){if(rules[this]){rules[this]=Number(rules[this]);}});jQuery.each(['rangelength','range'],function(){if(rules[this]){rules[this]=[Number(rules[this][0]),Number(rules[this][1])];}});if(jQuery.validator.autoCreateRanges){if(rules.min&&rules.max){rules.range=[rules.min,rules.max];delete rules.min;delete rules.max;}if(rules.minlength&&rules.maxlength){rules.rangelength=[rules.minlength,rules.maxlength];delete rules.minlength;delete rules.maxlength;}}return rules;},normalizeRule:function(data){if(typeof data=="string"){var transformed={};jQuery.each(data.split(/\s/),function(){transformed[this]=true;});data=transformed;}return data;},addMethod:function(name,method,message){jQuery.validator.methods[name]=method;jQuery.validator.messages[name]=message;if(method.length<3){jQuery.validator.addClassRules(name,jQuery.validator.normalizeRule(name));}},methods:{required:function(value,element,param){if(!this.depend(param,element))return"dependency-mismatch";switch(element.nodeName.toLowerCase()){case'select':var options=jQuery("option:selected",element);return options.length>0&&(element.type=="select-multiple"||(jQuery.browser.msie&&!(options[0].attributes['value'].specified)?options[0].text:options[0].value).length>0);case'input':if(this.checkable(element))return this.getLength(value,element)>0;default:return value.length>0;}},remote:function(value,element,param){if(this.optional(element))return"dependency-mismatch";var previous=this.previousValue(element);if(!this.settings.messages[element.name])this.settings.messages[element.name]={};this.settings.messages[element.name].remote=typeof previous.message=="function"?previous.message(value):previous.message;if(previous.old!==value){previous.old=value;var validator=this;this.startRequest(element);var data={};data[element.name]=value;jQuery.ajax({url:param,mode:"abort",port:"validate"+element.name,dataType:"json",data:data,success:function(response){if(!response){var errors={};errors[element.name]=response||validator.defaultMessage(element,"remote");validator.showErrors(errors);}else{var submitted=validator.formSubmitted;validator.prepareElement(element);validator.formSubmitted=submitted;validator.successList.push(element);validator.showErrors();}previous.valid=response;validator.stopRequest(element,response);}});return"pending";}else if(this.pending[element.name]){return"pending";}return previous.valid;},minlength:function(value,element,param){return this.optional(element)||this.getLength(value,element)>=param;},minLength:function(value,element,param){return jQuery.validator.methods.minlength.apply(this,arguments);},maxlength:function(value,element,param){return this.optional(element)||this.getLength(value,element)<=param;},maxLength:function(value,element,param){return jQuery.validator.methods.maxlength.apply(this,arguments);},rangelength:function(value,element,param){var length=this.getLength(value,element);return this.optional(element)||(length>=param[0]&&length<=param[1]);},rangeLength:function(value,element,param){return jQuery.validator.methods.rangelength.apply(this,arguments);},min:function(value,element,param){return this.optional(element)||value>=param;},minValue:function(){return jQuery.validator.methods.min.apply(this,arguments);},max:function(value,element,param){return this.optional(element)||value<=param;},maxValue:function(){return jQuery.validator.methods.max.apply(this,arguments);},range:function(value,element,param){return this.optional(element)||(value>=param[0]&&value<=param[1]);},rangeValue:function(){return jQuery.validator.methods.range.apply(this,arguments);},email:function(value,element){return this.optional(element)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(element.value);},url:function(value,element){return this.optional(element)||/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(element.value);},date:function(value,element){return this.optional(element)||!/Invalid|NaN/.test(new Date(value));},dateISO:function(value,element){return this.optional(element)||/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(value);},dateDE:function(value,element){return this.optional(element)||/^\d\d?\.\d\d?\.\d\d\d?\d?$/.test(value);},number:function(value,element){return this.optional(element)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(value);},numberDE:function(value,element){return this.optional(element)||/^-?(?:\d+|\d{1,3}(?:\.\d{3})+)(?:,\d+)?$/.test(value);},digits:function(value,element){return this.optional(element)||/^\d+$/.test(value);},creditcard:function(value,element){if(this.optional(element))return"dependency-mismatch";if(/[^0-9-]+/.test(value))return false;var nCheck=0,nDigit=0,bEven=false;value=value.replace(/\D/g,"");for(n=value.length-1;n>=0;n--){var cDigit=value.charAt(n);var nDigit=parseInt(cDigit,10);if(bEven){if((nDigit*=2)>9)nDigit-=9;}nCheck+=nDigit;bEven=!bEven;}return(nCheck%10)==0;},accept:function(value,element,param){param=typeof param=="string"?param:"png|jpe?g|gif";return this.optional(element)||value.match(new RegExp(".("+param+")$","i"));},equalTo:function(value,element,param){return value==jQuery(param).val();}}});;(function($){var ajax=$.ajax;var pendingRequests={};$.ajax=function(settings){settings=jQuery.extend(settings,jQuery.extend({},jQuery.ajaxSettings,settings));var port=settings.port;if(settings.mode=="abort"){if(pendingRequests[port]){pendingRequests[port].abort();}return(pendingRequests[port]=ajax.apply(this,arguments));}return ajax.apply(this,arguments);};})(jQuery);;(function($){$.each({focus:'focusin',blur:'focusout'},function(original,fix){$.event.special[fix]={setup:function(){if($.browser.msie)return false;this.addEventListener(original,$.event.special[fix].handler,true);},teardown:function(){if($.browser.msie)return false;this.removeEventListener(original,$.event.special[fix].handler,true);},handler:function(e){arguments[0]=$.event.fix(e);arguments[0].type=fix;return $.event.handle.apply(this,arguments);}};});$.extend($.fn,{delegate:function(type,delegate,handler){return this.bind(type,function(event){var target=$(event.target);if(target.is(delegate)){return handler.apply(target,arguments);}});},triggerEvent:function(type,target){return this.triggerHandler(type,[jQuery.event.fix({type:type,target:target})]);}})})(jQuery);;
/** SWFObject v1.5 */if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return "";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;;
(function(C){C.ui={plugin:{add:function(F,G,I){var H=C.ui[F].prototype;for(var E in I){H.plugins[E]=H.plugins[E]||[];H.plugins[E].push([G,I[E]])}},call:function(E,G,F){var I=E.plugins[G];if(!I){return }for(var H=0;H<I.length;H++){if(E.options[I[H][0]]){I[H][1].apply(E.element,F)}}}},cssCache:{},css:function(E){if(C.ui.cssCache[E]){return C.ui.cssCache[E]}var F=C('<div class="ui-resizable-gen">').addClass(E).css({position:"absolute",top:"-5000px",left:"-5000px",display:"block"}).appendTo("body");C.ui.cssCache[E]=!!((!(/auto|default/).test(F.css("cursor"))||(/^[1-9]/).test(F.css("height"))||(/^[1-9]/).test(F.css("width"))||!(/none/).test(F.css("backgroundImage"))||!(/transparent|rgba\(0, 0, 0, 0\)/).test(F.css("backgroundColor"))));try{C("body").get(0).removeChild(F.get(0))}catch(G){}return C.ui.cssCache[E]},disableSelection:function(E){E.unselectable="on";E.onselectstart=function(){return false};if(E.style){E.style.MozUserSelect="none"}},enableSelection:function(E){E.unselectable="off";E.onselectstart=function(){return true};if(E.style){E.style.MozUserSelect=""}},hasScroll:function(H,F){var E=/top/.test(F||"top")?"scrollTop":"scrollLeft",G=false;if(H[E]>0){return true}H[E]=1;G=H[E]>0?true:false;H[E]=0;return G}};var B=C.fn.remove;C.fn.remove=function(){C("*",this).add(this).trigger("remove");return B.apply(this,arguments)};function A(F,G,H){var E=C[F][G].getter||[];E=(typeof E=="string"?E.split(/,?\s+/):E);return(C.inArray(H,E)!=-1)}var D={init:function(){},destroy:function(){},getData:function(F,E){return this.options[E]},setData:function(G,E,F){this.options[E]=F},enable:function(){this.setData(null,"disabled",false)},disable:function(){this.setData(null,"disabled",true)}};C.widget=function(F,E){var G=F.split(".")[0];F=F.split(".")[1];C.fn[F]=function(K,L){var I=(typeof K=="string"),J=arguments;if(I&&A(G,F,K)){var H=C.data(this[0],F);return(H?H[K](L):undefined)}return this.each(function(){var M=C.data(this,F);if(!M){C.data(this,F,new C[G][F](this,K))}else{if(I){M[K].apply(M,C.makeArray(J).slice(1))}}})};C[G][F]=function(J,I){var H=this;this.options=C.extend({},C[G][F].defaults,I);this.element=C(J).bind("setData."+F,function(M,K,L){return H.setData(M,K,L)}).bind("getData."+F,function(L,K){return H.getData(L,K)}).bind("remove",function(){return H.destroy()});this.init()};C[G][F].prototype=C.extend({},D,E)};C.widget("ui.mouse",{init:function(){var E=this;this.element.bind("mousedown.mouse",function(){return E.click.apply(E,arguments)}).bind("mouseup.mouse",function(){(E.timer&&clearInterval(E.timer))}).bind("click.mouse",function(){if(E.initialized){E.initialized=false;return false}});if(C.browser.msie){this.unselectable=this.element.attr("unselectable");this.element.attr("unselectable","on")}},destroy:function(){this.element.unbind(".mouse").removeData("mouse");(C.browser.msie&&this.element.attr("unselectable",this.unselectable))},trigger:function(){return this.click.apply(this,arguments)},click:function(G){if(G.which!=1||C.inArray(G.target.nodeName.toLowerCase(),this.options.dragPrevention||[])!=-1||(this.options.condition&&!this.options.condition.apply(this.options.executor||this,[G,this.element]))){return true}var F=this;this.initialized=false;var E=function(){F._MP={left:G.pageX,top:G.pageY};C(document).bind("mouseup.mouse",function(){return F.stop.apply(F,arguments)});C(document).bind("mousemove.mouse",function(){return F.drag.apply(F,arguments)});if(!F.initalized&&Math.abs(F._MP.left-G.pageX)>=F.options.distance||Math.abs(F._MP.top-G.pageY)>=F.options.distance){(F.options.start&&F.options.start.call(F.options.executor||F,G,F.element));(F.options.drag&&F.options.drag.call(F.options.executor||F,G,this.element));F.initialized=true}};if(this.options.delay){if(this.timer){clearInterval(this.timer)}this.timer=setTimeout(E,this.options.delay)}else{E()}return false},stop:function(E){if(!this.initialized){return C(document).unbind("mouseup.mouse").unbind("mousemove.mouse")}(this.options.stop&&this.options.stop.call(this.options.executor||this,E,this.element));C(document).unbind("mouseup.mouse").unbind("mousemove.mouse");return false},drag:function(E){var F=this.options;if(C.browser.msie&&!E.button){return this.stop.call(this,E)}if(!this.initialized&&(Math.abs(this._MP.left-E.pageX)>=F.distance||Math.abs(this._MP.top-E.pageY)>=F.distance)){(F.start&&F.start.call(F.executor||this,E,this.element));this.initialized=true}else{if(!this.initialized){return false}}(F.drag&&F.drag.call(this.options.executor||this,E,this.element));return false}})})(jQuery);;
(function(E){E.widget("ui.accordion",{init:function(){var G=this.options;if(G.navigation){var J=this.element.find("a").filter(G.navigationFilter);if(J.length){if(J.filter(G.header).length){G.active=J}else{G.active=J.parent().parent().prev();J.addClass("current")}}}G.headers=this.element.find(G.header);G.active=C(G.headers,G.active);if(!this.element.hasClass("ui-accordion")){this.element.addClass("ui-accordion");E("<span class='ui-accordion-left'/>").insertBefore(G.headers);E("<span class='ui-accordion-right'/>").appendTo(G.headers);G.headers.addClass("ui-accordion-header").attr("tabindex","0")}var I;if(G.fillSpace){I=this.element.parent().height();G.headers.each(function(){I-=E(this).outerHeight()});var H=0;G.headers.next().each(function(){H=Math.max(H,E(this).innerHeight()-E(this).height())}).height(I-H)}else{if(G.autoHeight){I=0;G.headers.next().each(function(){I=Math.max(I,E(this).outerHeight())}).height(I)}}G.headers.not(G.active||"").next().hide();G.active.parent().andSelf().addClass(G.selectedClass);if(G.event){this.element.bind((G.event)+".accordion",F)}},activate:function(G){F.call(this.element[0],{target:C(this.options.headers,G)[0]})},destroy:function(){this.options.headers.next().css("display","");if(this.options.fillSpace||this.options.autoHeight){this.options.headers.next().css("height","")}E.removeData(this.element[0],"accordion");this.element.removeClass("ui-accordion").unbind(".accordion")}});function B(H,G){return function(){return H.apply(G,arguments)}}function D(I){if(!E.data(this,"accordion")){return }var G=E.data(this,"accordion");var H=G.options;H.running=I?0:--H.running;if(H.running){return }if(H.clearStyle){H.toShow.add(H.toHide).css({height:"",overflow:""})}E(this).triggerHandler("accordionchange",[H.data],H.change)}function A(G,K,L,J,M){var I=E.data(this,"accordion").options;I.toShow=G;I.toHide=K;I.data=L;var H=B(D,this);I.running=K.size()===0?G.size():K.size();if(I.animated){if(!I.alwaysOpen&&J){E.ui.accordion.animations[I.animated]({toShow:jQuery([]),toHide:K,complete:H,down:M,autoHeight:I.autoHeight})}else{E.ui.accordion.animations[I.animated]({toShow:G,toHide:K,complete:H,down:M,autoHeight:I.autoHeight})}}else{if(!I.alwaysOpen&&J){G.toggle()}else{K.hide();G.show()}H(true)}}function F(L){var J=E.data(this,"accordion").options;if(J.disabled){return false}if(!L.target&&!J.alwaysOpen){J.active.parent().andSelf().toggleClass(J.selectedClass);var I=J.active.next(),M={instance:this,options:J,newHeader:jQuery([]),oldHeader:J.active,newContent:jQuery([]),oldContent:I},G=(J.active=E([]));A.call(this,G,I,M);return false}var K=E(L.target);if(K.parents(J.header).length){while(!K.is(J.header)){K=K.parent()}}var H=K[0]==J.active[0];if(J.running||(J.alwaysOpen&&H)){return false}if(!K.is(J.header)){return }J.active.parent().andSelf().toggleClass(J.selectedClass);if(!H){K.parent().andSelf().addClass(J.selectedClass)}var G=K.next(),I=J.active.next(),M={instance:this,options:J,newHeader:K,oldHeader:J.active,newContent:G,oldContent:I},N=J.headers.index(J.active[0])>J.headers.index(K[0]);J.active=H?E([]):K;A.call(this,G,I,M,H,N);return false}function C(H,G){return G!=undefined?typeof G=="number"?H.filter(":eq("+G+")"):H.not(H.not(G)):G===false?E([]):H.filter(":eq(0)")}E.extend(E.ui.accordion,{defaults:{selectedClass:"selected",alwaysOpen:true,animated:"slide",event:"click",header:"a",autoHeight:true,running:0,navigationFilter:function(){return this.href.toLowerCase()==location.href.toLowerCase()}},animations:{slide:function(G,I){G=E.extend({easing:"swing",duration:300},G,I);if(!G.toHide.size()){G.toShow.animate({height:"show"},G);return }var H=G.toHide.height(),J=G.toShow.height(),K=J/H;G.toShow.css({height:0,overflow:"hidden"}).show();G.toHide.filter(":hidden").each(G.complete).end().filter(":visible").animate({height:"hide"},{step:function(L){var M=(H-L)*K;if(E.browser.msie||E.browser.opera){M=Math.ceil(M)}G.toShow.height(M)},duration:G.duration,easing:G.easing,complete:function(){if(!G.autoHeight){G.toShow.css("height","auto")}G.complete()}})},bounceslide:function(G){this.slide(G,{easing:G.down?"bounceout":"swing",duration:G.down?1000:200})},easeslide:function(G){this.slide(G,{easing:"easeinout",duration:700})}}});E.fn.activate=function(G){return this.accordion("activate",G)}})(jQuery);;
/*
 * Version 2.18
 */
;eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(4($){7 m=\'2.18\';7 n=$.1P.1D&&/33 6.0/.2y(2r.2m);4 13(){3(1J.1E&&1J.1E.13)1J.1E.13(\'[E] \'+2Z.2V.2Q.2L(2F,\'\'))};$.G.E=4(l){x 8.Q(4(){l=l||{};3(l.1R==2h){3f(l){1M\'36\':3(8.B)1k(8.B);8.B=0;x;1M\'1G\':8.M=1;x;1M\'32\':8.M=0;x;2Y:l={R:l}}}3(8.B)1k(8.B);8.B=0;8.M=0;7 c=$(8);7 d=l.1A?$(l.1A,8):c.2N();7 e=d.2G();3(e.r<2){13(\'2B; 2x 2u 2s: \'+e.r);x}7 f=$.2q({},$.G.E.1X,l||{},$.1W?c.1W():$.2o?c.2l():{});3(f.1r)f.1q=f.1B||e.r;f.L=f.L?[f.L]:[];f.I=f.I?[f.I]:[];f.I.3d(4(){f.1N=0});3(f.X)f.I.14(4(){S(e,f,0,!f.O)});3(n&&f.1m&&!f.2e)1I(d);7 g=8.35;f.y=1b((g.1a(/w:(\\d+)/)||[])[1])||f.y;f.u=1b((g.1a(/h:(\\d+)/)||[])[1])||f.u;f.A=1b((g.1a(/t:(\\d+)/)||[])[1])||f.A;3(c.C(\'1d\')==\'2W\')c.C(\'1d\',\'2U\');3(f.y)c.y(f.y);3(f.u&&f.u!=\'1f\')c.u(f.u);3(f.V){f.U=[];2a(7 i=0;i<e.r;i++)f.U.14(i);f.U.2M(4(a,b){x 2J.V()-0.5});f.P=0;f.J=f.U[0]}N 3(f.J>=e.r)f.J=0;7 h=f.J||0;d.C({1d:\'2g\',2z:0,2w:0}).2v().Q(4(i){7 z=h?i>=h?e.r-(i-h):h-i:e.r-i;$(8).C(\'z-2t\',z)});$(e[h]).C(\'17\',1).20();3($.1P.1D)e[h].1Z.1Y(\'15\');3(f.H&&f.y)d.y(f.y);3(f.H&&f.u&&f.u!=\'1f\')d.u(f.u);3(f.1G)c.2p(4(){8.M=1},4(){8.M=0});7 j=$.G.E.1V[f.R];3($.1U(j))j(c,d,f);N 3(f.R!=\'1s\')13(\'2n 2k: \'+f.R);d.Q(4(){7 a=$(8);8.1T=(f.H&&f.u)?f.u:a.u();8.1S=(f.H&&f.y)?f.y:a.y()});f.W=f.W||{};f.12=f.12||{};f.11=f.11||{};d.1Q(\':1h(\'+h+\')\').C(f.W);3(f.2i)$(d[h]).C(f.2i);3(f.A){3(f.F.1R==2h)f.F={3i:3g,3c:3b}[f.F]||3a;3(!f.1p)f.F=f.F/2;39((f.A-f.F)<38)f.A+=f.F}3(f.1L)f.1O=f.1K=f.1L;3(!f.19)f.19=f.F;3(!f.1n)f.1n=f.F;f.2f=e.r;f.K=h;3(f.V){f.9=f.K;3(++f.P==e.r)f.P=0;f.9=f.U[f.P]}N f.9=f.J>=(e.r-1)?0:f.J+1;7 k=d[h];3(f.L.r)f.L[0].1l(k,[k,k,f,2d]);3(f.I.r>1)f.I[1].1l(k,[k,k,f,2d]);3(f.Z&&!f.D)f.D=f.Z;3(f.D)$(f.D).1H(\'Z\',4(){x 1F(e,f,f.O?-1:1)});3(f.1t)$(f.1t).1H(\'Z\',4(){x 1F(e,f,f.O?1:-1)});3(f.Y)2c(e,f);3(f.A||f.X)8.B=1u(4(){S(e,f,0,!f.O)},f.X?10:f.A+(f.2b||0));f.34=4(a){7 b=$(a),s=b[0];3(!f.1B)f.1q++;e.14(s);3(f.29)f.29.14(s);f.2f=e.r;b.C(\'1d\',\'2g\').C(f.W).28(c);3(n&&f.1m&&!f.2e)1I(b);3(f.H&&f.y)b.y(f.y);3(f.H&&f.u&&f.u!=\'1f\')d.u(f.u);s.1T=(f.H&&f.u)?f.u:b.u();s.1S=(f.H&&f.y)?f.y:b.y()}})};4 S(a,b,c,d){3(b.1N)x;7 p=a[0].1j,T=a[b.K],D=a[b.9];3(p.B===0&&!c)x;3(!c&&!p.M&&((b.1r&&(--b.1q<=0))||(b.1i&&!b.V&&b.9<b.K))){3(b.1C)b.1C(b);x}3(c||!p.M){3(b.L.r)$.Q(b.L,4(i,o){o.1l(D,[T,D,b,d])});7 e=4(){3($.1P.1D&&b.1m)8.1Z.1Y(\'15\');$.Q(b.I,4(i,o){o.1l(D,[T,D,b,d])})};3(b.9!=b.K){b.1N=1;3(b.1z)b.1z(T,D,b,e,d);N 3($.1U($.G.E[b.R]))$.G.E[b.R](T,D,b,e);N $.G.E.1s(T,D,b,e)}3(b.V){b.K=b.9;3(++b.P==a.r)b.P=0;b.9=b.U[b.P]}N{7 f=(b.9+1)==a.r;b.9=f?0:b.9+1;b.K=f?a.r-1:b.9-1}3(b.Y)$(b.Y).27(\'a\').2X(\'1y\').15(\'a:1h(\'+b.K+\')\').25(\'1y\')}3(b.A&&!b.X)p.B=1u(4(){S(a,b,0,!b.O)},b.A);N 3(b.X&&p.M)p.B=1u(4(){S(a,b,0,!b.O)},10)};4 1F(a,b,c){7 p=a[0].1j,A=p.B;3(A){1k(A);p.B=0}b.9=b.K+c;3(b.9<0){3(b.1i)x 1g;b.9=a.r-1}N 3(b.9>=a.r){3(b.1i)x 1g;b.9=0}3(b.1c&&1x b.1c==\'4\')b.1c(c>0,b.9,a[b.9]);S(a,b,1,c>=0);x 1g};4 2c(b,c){7 d=$(c.Y);$.Q(b,4(i,o){7 a=(1x c.1w==\'4\')?$(c.1w(i,o)):$(\'<a 2T="#">\'+(i+1)+\'</a>\');3(a.2S(\'2R\').r==0)a.28(d);a.1H(c.24,4(){c.9=i;7 p=b[0].1j,A=p.B;3(A){1k(A);p.B=0}3(1x c.1v==\'4\')c.1v(c.9,b[c.9]);S(b,c,1,!c.O);x 1g})});d.27(\'a\').15(\'a:1h(\'+c.J+\')\').25(\'1y\')};4 1I(b){4 1e(s){7 s=1b(s).2P(16);x s.r<2?\'0\'+s:s};4 26(e){2a(;e&&e.2O.30()!=\'31\';e=e.1j){7 v=$.C(e,\'23-22\');3(v.2K(\'2I\')>=0){7 a=v.1a(/\\d+/g);x\'#\'+1e(a[0])+1e(a[1])+1e(a[2])}3(v&&v!=\'2H\')x v}x\'#37\'};b.Q(4(){$(8).C(\'23-22\',26(8))})};$.G.E.1s=4(a,b,c,d){7 e=$(a),$n=$(b);$n.C(c.W);7 f=4(){$n.2j(c.12,c.19,c.1O,d)};e.2j(c.11,c.1n,c.1K,4(){3(c.1o)e.C(c.1o);3(!c.1p)f()});3(c.1p)f()};$.G.E.1V={21:4(a,b,c){b.1Q(\':1h(\'+c.J+\')\').C(\'17\',0);c.L.14(4(){$(8).20()});c.12={17:1};c.11={17:0};c.1o={2E:\'2D\'}}};$.G.E.2C=4(){x m};$.G.E.1X={R:\'21\',A:3e,X:0,F:2A,19:q,1n:q,D:q,1t:q,1c:q,Y:q,1v:q,24:\'Z\',1w:q,L:q,I:q,1C:q,1L:q,1O:q,1K:q,3h:q,12:q,11:q,W:q,1o:q,1z:q,u:\'1f\',J:0,1p:1,V:0,H:0,1G:0,1r:0,1B:0,2b:0,1A:q,1m:0,1i:0}})(3j);',62,206,'|||if|function|||var|this|nextSlide|||||||||||||||||null|length|||height|||return|width||timeout|cycleTimeout|css|next|cycle|speed|fn|fit|after|startingSlide|currSlide|before|cyclePause|else|rev|randomIndex|each|fx|go|curr|randomMap|random|cssBefore|continuous|pager|click||animOut|animIn|log|push|filter||opacity||speedIn|match|parseInt|prevNextClick|position|hex|auto|false|eq|nowrap|parentNode|clearTimeout|apply|cleartype|speedOut|cssAfter|sync|countdown|autostop|custom|prev|setTimeout|pagerClick|pagerAnchorBuilder|typeof|activeSlide|fxFn|slideExpr|autostopCount|end|msie|console|advance|pause|bind|clearTypeFix|window|easeOut|easing|case|busy|easeIn|browser|not|constructor|cycleW|cycleH|isFunction|transitions|metadata|defaults|removeAttribute|style|show|fade|color|background|pagerEvent|addClass|getBg|find|appendTo|els|for|delay|buildPager|true|cleartypeNoBg|slideCount|absolute|String|cssFirst|animate|transition|data|userAgent|unknown|meta|hover|extend|navigator|slides|index|few|hide|left|too|test|top|1000|terminating|ver|none|display|arguments|get|transparent|rgb|Math|indexOf|call|sort|children|nodeName|toString|join|body|parents|href|relative|prototype|static|removeClass|default|Array|toLowerCase|html|resume|MSIE|addSlide|className|stop|ffffff|250|while|400|200|fast|unshift|4000|switch|600|shuffle|slow|jQuery'.split('|'),0,{}));
;
/* Treeview pre-1.4.1 4684 2008-02-07 19:08:06Z */;(function($){$.extend($.fn,{swapClass:function(c1,c2){var c1Elements=this.filter('.'+c1);this.filter('.'+c2).removeClass(c2).addClass(c1);c1Elements.removeClass(c1).addClass(c2);return this;},replaceClass:function(c1,c2){return this.filter('.'+c1).removeClass(c1).addClass(c2).end();},hoverClass:function(className){className=className||"hover";return this.hover(function(){$(this).addClass(className);},function(){$(this).removeClass(className);});},heightToggle:function(animated,callback){animated?this.animate({height:"toggle"},animated,callback):this.each(function(){jQuery(this)[jQuery(this).is(":hidden")?"show":"hide"]();if(callback)callback.apply(this,arguments);});},heightHide:function(animated,callback){if(animated){this.animate({height:"hide"},animated,callback);}else{this.hide();if(callback)this.each(callback);}},prepareBranches:function(settings){if(!settings.prerendered){this.filter(":last-child:not(ul)").addClass(CLASSES.last);this.filter((settings.collapsed?"":"."+CLASSES.closed)+":not(."+CLASSES.open+")").find(">ul").hide();}return this.filter(":has(>ul)");},applyClasses:function(settings,toggler){this.filter(":has(>ul):not(:has(>a))").find(">span").click(function(event){if(this==event.target)toggler.apply($(this).next());}).add($("a",this)).hoverClass();if(!settings.prerendered){this.filter(":has(>ul:hidden)").addClass(CLASSES.expandable).replaceClass(CLASSES.last,CLASSES.lastExpandable);this.not(":has(>ul:hidden)").addClass(CLASSES.collapsable).replaceClass(CLASSES.last,CLASSES.lastCollapsable);this.prepend("<div class=\""+CLASSES.hitarea+"\"/>").find("div."+CLASSES.hitarea).each(function(){var classes="";$.each($(this).parent().attr("class").split(" "),function(){classes+=this+"-hitarea ";});$(this).addClass(classes);});}this.find("div."+CLASSES.hitarea).click(toggler);},treeview:function(settings){settings=$.extend({cookieId:"treeview"},settings);if(settings.add){return this.trigger("add",[settings.add]);}if(settings.toggle){var callback=settings.toggle;settings.toggle=function(){return callback.apply($(this).parent()[0],arguments);};}function treeController(tree,control){function handler(filter){return function(){toggler.apply($("div."+CLASSES.hitarea,tree).filter(function(){return filter?$(this).parent("."+filter).length:true;}));return false;};}$("a:eq(0)",control).click(handler(CLASSES.collapsable));$("a:eq(1)",control).click(handler(CLASSES.expandable));$("a:eq(2)",control).click(handler());}function toggler(){$(this).parent().find(">.hitarea").swapClass(CLASSES.collapsableHitarea,CLASSES.expandableHitarea).swapClass(CLASSES.lastCollapsableHitarea,CLASSES.lastExpandableHitarea).end().swapClass(CLASSES.collapsable,CLASSES.expandable).swapClass(CLASSES.lastCollapsable,CLASSES.lastExpandable).find(">ul").heightToggle(settings.animated,settings.toggle);if(settings.unique){$(this).parent().siblings().find(">.hitarea").replaceClass(CLASSES.collapsableHitarea,CLASSES.expandableHitarea).replaceClass(CLASSES.lastCollapsableHitarea,CLASSES.lastExpandableHitarea).end().replaceClass(CLASSES.collapsable,CLASSES.expandable).replaceClass(CLASSES.lastCollapsable,CLASSES.lastExpandable).find(">ul").heightHide(settings.animated,settings.toggle);}}function serialize(){function binary(arg){return arg?1:0;}var data=[];branches.each(function(i,e){data[i]=$(e).is(":has(>ul:visible)")?1:0;});$.cookie(settings.cookieId,data.join(""));}function deserialize(){var stored=$.cookie(settings.cookieId);if(stored){var data=stored.split("");branches.each(function(i,e){$(e).find(">ul")[parseInt(data[i])?"show":"hide"]();});}}this.addClass("treeview");var branches=this.find("li").prepareBranches(settings);switch(settings.persist){case"cookie":var toggleCallback=settings.toggle;settings.toggle=function(){serialize();if(toggleCallback){toggleCallback.apply(this,arguments);}};deserialize();break;case"location":var current=this.find("a").filter(function(){return this.href.toLowerCase()==location.href.toLowerCase();});if(current.length){current.addClass("selected").parents("ul, li").add(current.next()).show();}break;}branches.applyClasses(settings,toggler);if(settings.control){treeController(this,settings.control);$(settings.control).show();}return this.bind("add",function(event,branches){$(branches).prev().removeClass(CLASSES.last).removeClass(CLASSES.lastCollapsable).removeClass(CLASSES.lastExpandable).find(">.hitarea").removeClass(CLASSES.lastCollapsableHitarea).removeClass(CLASSES.lastExpandableHitarea);$(branches).find("li").andSelf().prepareBranches(settings).applyClasses(settings,toggler);});}});var CLASSES=$.fn.treeview.classes={open:"open",closed:"closed",expandable:"expandable",expandableHitarea:"expandable-hitarea",lastExpandableHitarea:"lastExpandable-hitarea",collapsable:"collapsable",collapsableHitarea:"collapsable-hitarea",lastCollapsableHitarea:"lastCollapsable-hitarea",lastCollapsable:"lastCollapsable",lastExpandable:"lastExpandable",last:"last",hitarea:"hitarea"};$.fn.Treeview=$.fn.treeview;})(jQuery);;
(function($){
	/**
	 *	The global namespace for jMaps
	 *	@type Object
	 *	@cat jMapOptions
	 *	@name $.jmap
	 */
	$.jmap = $.jmap || {};

	$.jmap.store = {};
	
	/**
	 *	The global object that contains the project details
	 *	@type Object
	 *	@cat jMapOptions
	 *	@name $.jmap.JDetails
	 */
	$.jmap.JDetails = {
		name: "jMaps Google Maps Plugin",
		description: "jMaps is a jQuery plugin that makes google maps easy",
		version: "3.0",
		releaseDate: "19/04/2008",
		author: "Tane Piper <digitalspaghetti@gmail.com>",
		blog: "http://digitalspaghetti.me.uk",
		repository: "http://hg.digitalspaghetti.me.uk/jmaps",
		googleGroup: "http://groups.google.com/group/jmaps",
		licenceType: "MIT",
		licenceURL: "http://www.opensource.org/licenses/mit-license.php"
	};
	
	/**
	 *	The global object for i18n error messages
	 *	@type Object
	 *	@cat jMapOptions
	 *	@name $.jmap.JErrors
	 */
	$.jmap.JErrors = {
		en : {
			functionDoesNotExist : "jMap Error 1: The function does not exist",
			addressNotFound: "This address cannot be found.  Please modify your search.",
			browserNotCompatible: "This browser is reported as being not compatible with Google Maps.",
			cannotLoad: "Cannot load the Google Maps API at this time.  Please check your connection."
		},
		fr : {
			addressNotFound: "Cette adresse ne peut pas être trouvée. Veuillez modifier votre recherche.",
			browserNotCompatible: "Ce navigateur est rapporté en tant qu'étant non compatible avec des cartes de Google.",
			cannotLoad: "Ne peut pas charger les cartes api de Google actuellement. Veuillez vérifier votre raccordement."
		},
		de : {
			addressNotFound: "Diese Adresse kann nicht gefunden werden. Ändern Sie bitte Ihre Suche.",
			browserNotCompatible: "Diese Datenbanksuchroutine wird als seiend nicht kompatibel mit Google Diagrammen berichtet.",
			cannotLoad: "Kann nicht die Google Diagramme API diesmal laden. Überprüfen Sie bitte Ihren Anschluß."
		},
		nl : {
			addressNotFound: "Dit adres kan worden gevonden niet. Gelieve te wijzigen uw onderzoek.",
			browserNotCompatible: "Dit browser wordt gemeld zoals zijnd niet compatibel met Kaarten Google.",
			cannotLoad: "Kan de Google Kaarten API op dit moment laden niet. Gelieve te controleren uw verbinding."
		},
		es : {
			addressNotFound: "Esta dirección no puede ser encontrada. Modifique por favor su búsqueda.",
			browserNotCompatible: "Este browser se divulga como siendo no compatible con los mapas de Google.",
			cannotLoad: "No puede cargar los mapas API de Google en este tiempo. Compruebe por favor su conexión."
		},
		sv : {
			addressNotFound: "Denna adress kunde ej hittas. Var god justera din sökning",
			browserNotCompatible: "Denna webbläsare är ej kompatibel med Google Maps",
			cannotLoad: "Kan inte ladda Google Maps API för tillfället. Var god kontrollera din anslutning."
		}
	};
	
	/**
	 *	The global object for .jmap("init") calls
	 *	@type Object
	 *	@cat jMapOptions
	 *	@name $.jmap.JDefaults
	 */	$.jmap.JDefaults = {
		// Initial type of map to display
		language: "en",
		// Options: "map", "sat", "hybrid"
		mapType: "map",
		// Initial map center
		mapCenter: [55.958858,-3.162302],
		// Initial map size
		mapDimensions: [400, 400],
		// Initial zoom level
		mapZoom: 12,
		// Initial map control size
		// Options: "large", "small", "none"
		mapControlSize: "small",
		// Initialise type of map control
		mapEnableType: false,
		// Initialise small map overview
		mapEnableOverview: false,
		// Enable map dragging when left button held down
		mapEnableDragging: true,
		// Enable map info windows
		mapEnableInfoWindows: true,
		// Enable double click zooming
		mapEnableDoubleClickZoom: false,
		// Enable zooming with scroll wheel
		mapEnableScrollZoom: false,
		// Enable smooth zoom
		mapEnableSmoothZoom: false,
		// Enable Google Bar
		mapEnableGoogleBar: false,
		// Enables scale bar
		mapEnableScaleControl: false,
		// Enable the jMap icon
		mapShowjMapIcon: true,
		//Debug Mode
		debugMode: false
	}
	
	/**
	 *	The global object for the google ads manager
	 *	@type Object
	 *	@cat jMapOptions
	 *	@name $.jmap.JAdsManagerDefaults
	 */
	$.jmap.JAdsManagerDefaults = {
		// Google Adsense publisher ID
		publisherId: ""
	};
	
	/**
	 *	The global object for adding KML or OpenRSS feeds to the map
	 *	@type Object
	 *	@cat jMapOptions
	 *	@name $.jmap.JFeedDefaults
	 */
	$.jmap.JFeedDefaults = {
		// URL of the feed to pass (required)
		feedUrl: "",
		// Position to center the map on (optional)
		mapCenter: []
	}
	
	/**
	 *	The global object that contains ground overlay details
	 *	@type Object
	 *	@cat jMapOptions
	 *	@name $.jmap.JGroundOverlayDefauts
	 */

	$.jmap.JGroundOverlayDefaults = {
		// South West Boundry
		overlaySouthWestBounds: [],
		// North East Boundry
		overlayNorthEastBounds: [],
		// Image
		overlayImage: ""
	}
	
	$.jmap.JIconDefaults = {
		iconImage: "",
		iconShadow: "",
		iconSize: null,
		iconShadowSize: null,
		iconAnchor: null,
		iconInfoWindowAnchor: null,
		iconPrintImage: "",
		iconMozPrintImage: "",
		iconPrintShadow: "",
		iconTransparent: ""
	};
	
	// Marker manager default options
	$.jmap.JMarkerManagerDefaults = {
		// Border Padding in pixels
		borderPadding: 100,
		// Max zoom level 
		maxZoom: 17,
		// Track markers
		trackMarkers: false
	};
	
	// Default options for a point to be created
	$.jmap.JMarkerDefaults = {
		// Point lat & lng
		pointLatLng: [],
		// Point HTML for infoWindow
		pointHTML: null,
		// Event to open infoWindow (click, dblclick, mouseover, etc)
		pointOpenHTMLEvent: "click",
		// Point is draggable?
		pointIsDraggable: false,
		// Point is removable?
		pointIsRemovable: false,
		// Event to remove on (click, dblclick, mouseover, etc)
		pointRemoveEvent: "dblclick",
		// These two are only required if adding to the marker manager
		pointMinZoom: 4,
		pointMaxZoom: 17,
		// Optional Icon to pass in (not yet implemented)
		pointIcon: null,
		// For maximizing infoWindows (not yet implemented)
		pointMaxContent: null,
		pointMaxTitle: null
	};
	
	// Defaults for a Polygon
	$.jmap.JPolygonDefaults = {
		// An array of GLatLng objects
		polygonPoints: [],
		// The outer stroke colour
	 	polygonStrokeColor: "#000000",
	 	// Stroke thickness
	 	polygonStrokeWeight: 5,
	 	// Stroke Opacity
	 	polygonStrokeOpacity: 1,
	 	// Fill colour
	 	polygonFillColor: "#ff0000",
	 	// Fill opacity
	 	polygonFillOpacity: 1,
	 	// Optional center map
	 	mapCenter: [],
	 	// Is polygon clickable?
	 	polygonClickable: true
	};
	
	// Default options for a Polyline
	$.jmap.JPolylineDefaults = {
		// An array of GLatLng objects
		polylinePoints: [],
		// Colour of the line
		polylineStrokeColor: "#ff0000",
		// Width of the line
		polylineStrokeWidth: 10,
		// Opacity of the line
		polylineStrokeOpacity: 1,
		// Optional center map
		mapCenter: [],
		// Is line Geodesic (i.e. bends to the curve of the earth)?
		polylineGeodesic: false,
		// Is line clickable?
		polylineClickable: true
	};
	
	$.jmap.JScreenOverlayDefaults = {
		
	}
	
	$.jmap.JSearchAddressDefaults = {
		// Address to search for
		address: null,
		// Optional Cache to store Geocode Data (not implemented yet)
		cache: {},
		// Country code for localisation (not implemented yet)
		countryCode: 'uk'
	};
	
	$.jmap.JSearchDirectionsDefault = {
		// From address
		fromAddress: "",
		// To address
		toAddress: "",
		// Optional panel to show text directions
		directionsPanel: ""
	};
	
	$.jmap.JTrafficDefaults = {
		// Can pass in "create" (default) or "destroy" which will remove the layer
		method: "create",
		// Center the map on this point (optional)
		mapCenter: []
	};
	
	$.jmap.JMoveToDefaults = {
		centerMethod: 'normal',
		mapType: null,
		mapCenter: [],
		mapZoom: null
	}
	
	$.jmap.JSavePositionDefaults = {
		recall: false
	}
	
	$.jmap.variables = {
		mapType: "Unknown",
		mapCenter: []
	}
	
	$.jmap.init = function(el, options, callback) {
	
		/* Set Up Options */
		// First we create out options object by checking passed options
		// and that no defaults have been overidden
		var options = $.extend({}, $.jmap.JDefaults, options);
		// Check for metadata plugin support
		var options = $.jmap.JOptions = $.meta ? $.extend({}, options, $(this).data()) : options;
		/* End Set Up Options */
		
		// Do checks or throw errors
		$.jmap._initChecks(el);
		
		// Initialise the GMap2 object
		el.jmap = $.jmap.GMap2 = new GMap2(el);
		
		// If the user shows the jMaps icon, show it right away
		if (options.mapShowjMapIcon) {
			$.jmap.addScreenOverlay(
				{
					imageUrl:'http://hg.digitalspaghetti.me.uk/jmaps/raw-file/3228fade0b3c/docs/images/jmaps-mapicon.png',
					screenXY:[70,10],
					overlayXY:[0,0],
					size:[42,25]
				}
			);
		}
		
		
		// Set map type based on passed option
		var mapType = $.jmap._initMapType(options.mapType);
		
		// Initialise the map with the passed settings
		el.jmap.setCenter(new GLatLng(options.mapCenter[0], options.mapCenter[1]), options.mapZoom, mapType);
			
		// Attach a controller to the map view
		// Will attach a large or small.  If any other value passed (i.e. "none") it is ignored
		switch(options.mapControlSize)
		{
			case "small":
				el.jmap.addControl(new GSmallMapControl());
			break;
			case "large":
				el.jmap.addControl(new GLargeMapControl());
			break;
		}
		// Type of map Control (Map,Sat,Hyb)
		if(options.mapEnableType)
			el.jmap.addControl(new GMapTypeControl()); // Off by default
		
		// Show the small overview map
		if(options.mapEnableOverview)
			el.jmap.addControl(new GOverviewMapControl());// Off by default
		
		// GMap2 Functions (in order of the docs for clarity)
		// Enable a mouse-dragable map
		if(!options.mapEnableDragging)
			el.jmap.disableDragging(); // On by default
			
		// Enable Info Windows
		if(!options.mapEnableInfoWindows)
			el.jmap.disableInfoWindow(); // On by default
		
		// Enable double click zoom on the map
		if(options.mapEnableDoubleClickZoom)
			el.jmap.enableDoubleClickZoom(); // On by default
		
		// Enable scrollwheel on the map
		if(options.mapEnableScrollZoom)
			el.jmap.enableScrollWheelZoom(); //Off by default
		
		// Enable smooth zooming
		if (options.mapEnableSmoothZoom)
			el.jmap.enableContinuousZoom(); // Off by default

		// Enable Google Bar
		if (options.mapEnableGoogleBar)
			el.jmap.enableGoogleBar();  //Off by default
			
		// Enables Scale bar
		if (options.mapEnableScaleControl)
			el.jmap.addControl(new GScaleControl());

		// output init to console
		if (options.debugMode) {
		    console.log(el.jmap);
		}
		
		// Initialise variables
		$.jmap.getMapType();
		
		if (typeof callback == 'function') return callback(el, options);
	}
	
	/**
	 *	.addFeed(options, callback?);
	 *	This function takes a KML or GeoRSS file and
	 *	adds it to the map
	 */
	$.jmap.addFeed = function(options, callback) {
	
		var options = $.extend({}, $.jmap.JFeedDefaults, options);
		
		// Load feed
		var feed = new GGeoXml(options.feedUrl);
		// Add as overlay
		$.jmap.GMap2.addOverlay(feed);
		
		// If the user has passed the optional mapCenter,
		// then center the map on that point
		if (options.mapCenter[0] && options.mapCenter[1])
			$.jmap.GMap2.setCenter(new GLatLng(options.mapCenter[0], options.mapCenter[1]));
		
		if (typeof callback == 'function') return callback(feed, options);
	}
	
	$.jmap.addGroundOverlay = function(options, callback) {
		var options = $.extend({}, $.jmap.JGroundOverlayDefaults, options);
		var boundries = new GLatLngBounds(new GLatLng(options.overlaySouthWestBounds[0], options.overlaySouthWestBounds[1]), new GLatLng(options.overlayNorthEastBounds[0], options.overlayNorthEastBounds[1]));
		
		$.jmap.GGroundOverlay = new GGroundOverlay(options.overlayImage, boundries);
		$.jmap.GMap2.addOverlay($.jmap.GGroundOverlay);
		
		if (typeof callback == 'function') return callback();
	}
	
	$.jmap.hideGroundOverlay = function(callback) {
		$.jmap.GGroundOverlay.hide();
		if (typeof callback == 'function') return callback();
	}
	
	$.jmap.showGroundOverlay = function(callback) {
		isHidden = $.jmap.GGroundOverlay.isHidden();
		if (isHidden)
			$.jmap.GGroundOverlay.show();
		if (typeof callback == 'function') return callback();
	}
	
	/**
	 *	Create a marker and add it as a point to the map
	 */
	$.jmap.addMarker = function(options, callback) {
		// Create options
		var options = $.extend({}, $.jmap.JMarkerDefaults, options);
		var markerOptions = {}
		
		if (typeof options.pointIcon == 'object')
			$.extend(markerOptions, {icon: options.pointIcon});
		
		if (options.pointIsDraggable)
			$.extend(markerOptions, {draggable: options.pointIsDraggable});
		
		// Create marker, optional parameter to make it draggable
		var marker = new GMarker(new GLatLng(options.pointLatLng[0],options.pointLatLng[1]), markerOptions);
		
		// If it has HTML to pass in, add an event listner for a click
		if(options.pointHTML)
			GEvent.addListener(marker, options.pointOpenHTMLEvent, function(){
				marker.openInfoWindowHtml(options.pointHTML, {maxContent: options.pointMaxContent, maxTitle: options.pointMaxTitle});
			});

		// If it is removable, add dblclick event
		if(options.pointIsRemovable)
			GEvent.addListener(marker, options.pointRemoveEvent, function(){
				$.jmap.GMap2.removeOverlay(marker);
			});

		// If the marker manager exists, add it
		if($.jmap.GMarkerManager) {
			$.jmap.GMarkerManager.addMarker(marker, options.pointMinZoom, options.pointMaxZoom);	
		} else {
			// Direct rendering to map
			$.jmap.GMap2.addOverlay(marker);
		}
		
		if (typeof callback == 'function') return callback();
	}
	
	/**
	 * Create a screen overlay
	 * @param {Object} options
	 * @param function callback
	 */
	$.jmap.addScreenOverlay = function(options, callback) {
		var options = $.extend({}, $.jmap.JScreenOverlayDefaults, options);
		var overlay = new GScreenOverlay(options.imageUrl, new GScreenPoint(options.screenXY[0],options.screenXY[1]), new GScreenPoint(options.overlayXY[0],options.overlayXY[1]), new GScreenSize(options.size[0],options.size[1]));
		$.jmap.GMap2.addOverlay(overlay);
		
		if (typeof callback == 'function') return callback(overlay, options);
	}
	
	/**
	 * Create a polygon and render to the map
	 */
	 $.jmap.addPolygon = function(options, callback) {
	 	
	 	var options = $.extend({}, $.jmap.JPolygonDefaults, options);
		polygonOptions = {};
	 	if (!options.polygonClickable)
			var polygonOptions = $.extend({}, polygonOptions, {
				clickable: false
			});
	 		
	 	if(options.mapCenter[0] && options.mapCenter[1])
	 		$.jmap.GMap2.setCenter(new GLatLng(options.mapCenter[0], options.mapCenter[1]));
		
		var polygon = new GPolygon(options.polygonPoints, options.polygonStrokeColor, options.polygonStrokeWeight, options.polygonStrokeOpacity, options.polygonFillColor, options.polygonFillOpacity, polygonOptions);

		$.jmap.GMap2.addOverlay(polygon);
		
		if (typeof callback == 'function') return callback();
	 }
	
	/**
	 *	Create a polyline and render on the map
	 */
	$.jmap.addPolyline = function (options, callback) {
		var options = $.extend({}, $.jmap.JPolylineDefaults, options);
		var polyLineOptions = {};
		if (options.polylineGeodesic)
			$.extend({}, polyLineOptions, {geodesic: true});
			
		if(!options.polylineClickable)
			$.extend({}, polyLineOptions, {clickable: false});

		if (options.mapCenter[0] && options.mapCenter[1])
			$.jmap.GMap2.setCenter(new GLatLng(options.mapCenter[0], options.mapCenter[1]));

		var polyline = new GPolyline(options.polylinePoints, options.polylineStrokeColor, options.polylineStrokeWidth, options.polylineStrokeOpacity, polyLineOptions);
		$.jmap.GMap2.addOverlay(polyline);
		
		if (typeof callback == 'function') return callback();
	}
		
	/**
	 *	.trafficInfo(options?, callback?);
	 *	This function renders a traffic info
	 *	overlay for supported cities
	 *	The GTrafficOverlay also has it's own show/hide methods
	 *	that do not destory the overlay.  Can be called:
	 *	$.jmap.GTrafficOverlay.show();
	 *	$.jmap.GTrafficOverlay.hide();
	 */
	$.jmap.addTrafficInfo = function(options, callback) {
		var options = $.extend({}, $.jmap.JTrafficDefaults, options);
		
		// Does the user wants to create or destory the overlay
		switch(options.method) {
			case "create":
				$.jmap.GTrafficOverlay = new GTrafficOverlay;
				// Add overlay
				$.jmap.GMap2.addOverlay($.jmap.GTrafficOverlay);
				// If the user has passed the optional mapCenter,
				// then center the map on that point
				if (options.mapCenter[0] && options.mapCenter[1]) {
					$.jmap.GMap2.setCenter(new GLatLng(options.mapCenter[0], options.mapCenter[1]));
				}
			break;
			case "destroy":
				// Distroy overlay
				$.jmap.GMap2.removeOverlay($.jmap.GTrafficOverlay);
			break;
		
		}
		if (typeof callback == 'function') return callback();
	}
	
	$.jmap.disableTraffic = function(callback) {
		$.jmap.GTrafficOverlay.hide();
		if (typeof callback == 'function') return callback();
	}
	
	$.jmap.enableTraffic = function(callback) {
		$.jmap.GTrafficOverlay.show();
		if (typeof callback == 'function') return callback();
	}
	
	/**
	 *	Create a AdSense ad manager
	 */
	$.jmap.createAdsManager = function(options, callback) {
		var options = $.extend({}, $.jmap.JAdsManagerDefaults, options);
	
		$.jmap.GAdsManager = new GAdsManager($.jmap.GMap2, options.publisherId);
		
		if (typeof callback == 'function') return callback();
	}
	
	$.jmap.hideAds = function(callback){
		$.jmap.GAdsManager.disable();
		if (typeof callback == 'function') return callback();
	}
	
	$.jmap.showAds = function(callback){
		$.jmap.GAdsManager.enable();
		if (typeof callback == 'function') return callback();
	}
	
	// Create Geocoder cache and attach to global object
	$.jmap.createGeoCache = function(callback) {
		$.jmap.GGeocodeCache = new GGeocodeCache();
		if (typeof callback == 'function') return callback();
	}
	
	// Create a geocoder object
	$.jmap.createGeoCoder = function(cache, callback) {
		if (cache) {
			// Create with cache
			$.jmap.GClientGeocoder = new GClientGeocoder(cache);
		} else {
			// No cache
			$.jmap.GClientGeocoder = new GClientGeocoder;
		}
		if (typeof callback == 'function') return callback();
	}
	
	/**
	 * Create an icon to return to addMarker
	 */
	$.jmap.createIcon = function(options) {
		var options = $.extend({}, $.jmap.JIconDefaults, options);
		var icon = new GIcon(G_DEFAULT_ICON);
		
		if(options.iconImage)
			icon.image = options.iconImage;
		if(options.iconShadow)
			icon.shadow = options.iconShadow;
		if(options.iconSize)
			icon.iconSize = options.iconSize;
		if(options.iconShadowSize)
			icon.shadowSize = options.iconShadowSize;
		if(options.iconAnchor)
			icon.iconAnchor = options.iconAnchor;
		if(options.iconInfoWindowAnchor)
			icon.infoWindowAnchor = options.iconInfoWindowAnchor;
	
		return icon;
	}
	
	/**
	 *	Creates the marker manager and attaches it to the $.jmap namespace
	 */
	$.jmap.createMarkerManager = function(options, callback) {
		// Merge the options with the defaults
		var options = $.extend({}, $.jmap.JMarkerManagerDefaults, options);
		// Create the marker manager and attach to the global object
		$.jmap.GMarkerManager = new GMarkerManager($.jmap.GMap2, options);
		// Return the callback
		if (typeof callback == 'function') return callback();
	}
		
	// This is an alias function that allows the user to simply search for an address
	// Can be returned as a result, or as a point on the map
	$.jmap.searchAddress = function(options, callback) {
	
		var options = $.extend({}, $.jmap.JSearchAddressDefaults, options);
		
		// Add options from pass to marker object
		var pass = $.extend({}, $.jmap.JMarkerManagerDefaults);
		
		// Check to see if the Geocoder already exists in the object
		// or create a temporary locally scoped one.
		if (typeof $.jmap.GClientGeocoder == 'undefined') {
			 var geocoder = new GClientGeocoder;
		} else {
			var geocoder = $.jmap.GClientGeocoder;
		}
		
		// Geocode the address
		geocoder.getLatLng(options.address, function(point){
				if (typeof callback == 'function') return callback(options, point);
		});
	}
	

	/**
	 *	.searchDirections(options, callback?);
	 *	This function allows you to pass a to and from address.  If To address
	 *	is previous from address, automatically creates a GRoute object
	 */	
	$.jmap.searchDirections = function(options, callback) {	
		var options = $.extend({}, $.jmap.JSearchDirectionsDefaults, options);
		var panel = $('#' + options.directionsPanel).get(0);
		$.jmap.GDirections = new GDirections($.jmap.GMap2, panel);
		$.jmap.GDirections.load(options.fromAddress + ' to ' + options.toAddress);
		if (typeof callback == 'function') return callback();
	}
	
	$.jmap.moveTo = function(options, callback) {
		
		var options = $.extend({}, $.jmap.JMoveToDefaults, options);
		if (options.mapType)
			var mapType = $.jmap._initMapType(options.mapType);
		var point = new GLatLng(options.mapCenter[0], options.mapCenter[1]);
		switch (options.centerMethod) {
			case 'normal':
				$.jmap.GMap2.setCenter(point, options.mapZoom, mapType);
				break;
			case 'pan':
				$.jmap.GMap2.panTo(point);
				break;
		}
		if (typeof callback == 'function') return callback();
	}
	
	$.jmap.savePosition = function(options, callback) {
		var options = $.extend({}, $.jmap.JMoveToDefaults, options);
		if (options.recall) {
			$.jmap.GMap2.returnToSavedPosition();
		} else {
			$.jmap.GMap2.savePosition();
		}
		if (typeof callback == 'function') return callback();
	}
	
	$.jmap.createKeyboardHandler = function(callback){
		$.jmap.keyboardHandler = new GKeyboardHandler($.jmap.GMap2);
		if (typeof callback == 'function') return callback();
	}
	
	
	// Function currently not returning correctly
	$.jmap.getMapType = function() {
		var mapTypes = $.jmap.GMap2.getMapTypes();
		var actMap = $.jmap.GMap2.getCurrentMapType();
		if (actMap.Hz) {
			$.jmap.variables.mapType = actMap.Hz;
		}
	}
	
	$.jmap.getCenter = function(){
		var center = $.jmap.GMap2.getCenter();
		$.jmap.variables.mapCenter = center
		if (typeof callback == 'function') return callback(center);
	}
	
	$.jmap.getBounds = function(){
		var bounds = $.jmap.GMap2.getBounds();
		$.jmap.variables.mapBounds = bounds;
		if (typeof callback == 'function') return callback(bounds);
	}

	/* Internal Functions */
	
	/**
	 *	Function: 	setMapType
	 *	Accepts: 	string maptype
	 *	Returns:	CONSTANT maptype
	 **/ 
	$.jmap._initMapType = function(option) {
		// Lets set our map type based on the options
		switch(option) {
			case "map":	// Normal Map
				var maptype = G_NORMAL_MAP;
			break;
			case "sat":	// Satallite Imagery
				var maptype = G_SATELLITE_MAP;
			break;
			case "hybrid":	//Hybrid Map
				var maptype = G_HYBRID_MAP;
			break;
		}
		return maptype;	
	}
	
	$.jmap._initChecks = function(el) {
		// Check if API can be loaded
		if (typeof GBrowserIsCompatible == 'undefined') {
			// Because map does not load, provide visual error
			$(el).text($.jmap.JErrors[$.jmap.JOptions.language].cannotLoad).css({
				color: "#f00"
			});
			// Throw exception
			throw Error($.jmap.JErrors[$.jmap.JOptions.language].cannotLoad);
		}
		// Check to see if browser is compatible, if not throw and exception
		if (!GBrowserIsCompatible()) {
			// Because map does not load, provide visual error
			$(el).text($.jmap.JErrors[$.jmap.JOptions.language].browserNotCompatible).css({color: "#f00"});
			// Throw exception
			throw Error($.jmap.JErrors[$.jmap.JOptions.language].browserNotCompatible);
		}
	}
	
	$.jmap.storePoints = function(options, callback) {
		$.jmap.store = $.extend({}, $.jmap.store, options);		
		if (typeof callback == 'function') return callback($.jmap.store);
	}
	
	$.fn.jmap = function(method, options, callback) {
		return this.each(function(){
			if (method == "init") {
				new $.jmap.init(this, options, callback);
			} else if (typeof method == 'object' || method == null) {
				new $.jmap.init(this, method, options);
			} else if (typeof options == 'function'){
				new $.jmap[method](options);
			} else {
				try {
					new $.jmap[method](options, callback);
				} catch(err) {
					throw Error($.jmap.JErrors[$.jmap.JOptions.language].functionDoesNotExist);
				}
			}
		});
	}
})(jQuery);;
// initialisation du scope Dms
$.dms = $.dms || {};
  
// configuration du Dms
$.dms.defaults =
{
  // urls http des requêtes Ajax
  admin:                "dmsAdmin",
  ajaxLogin:            "dmsAdminTools/ajaxLogin",
  resizeLayout:         "dms/dmsPage/resizeLayout",
  getPageStrippedTitle: "dms/dmsCore/getPageStrippedTitle",
  slotUpdateType:       "dms/dmsSlot/updateType",
  slotGetInner:         "dms/dmsSlot/inner",
  sortSlots:            "dms/dmsSlot/sort",
  sortZones:            "dms/dmsZone/sort",
  resizeZone:           "dms/dmsZone/resize",
  alignZone:            "dms/dmsZone/align",
  editZone:             "dms/dmsZone/edit",
  addZone:              "dms/dmsZone/create",
  getFormChamp:         "dms/dmsVarious/getFormChamp",
  changeLayout:         "dms/dmsPage/changeLayout",
  sortPages:            "dmsAdmin/sortPages",
  sortObjects:          "dmsAdminTools/sortObjects",
  dmsBlobUpdate:        "dmsBlob/update",
  modal:                false,
  accessible:           0,            // activer par défaut les contraintes d'accessibilité
  toolbox:                            // configuration de la boîte à outils
  {
    title:          "DMS ToolBox ( "+page_options.user_name+" )",    // titre du dialog
    cookie_name:    "dms_toolbox_",   // cookie de sauvegarde d'état
    default_x:      20,               // position x par défaut
    default_y:      20,               // position y par défaut
    width:          400,              // largeur du dialog
    height:         "auto",           // hauteur du dialog
    auto_hide:      true,             // cacher le contenu, et montrer au passage de la souris
    active:         "navigation",     // onglet visible par défaut
    open:           true,             // fenétre ouverte par défaut
    type_delay:     200,              // délai d'actualisation ajax
    i18n:
    {
      page_title:   "Il faut fournir un titre pour la page"
    }
  },
  image_dir:        "dmsPlugin/images/",
  images_to_preload:                  // images qui seront préchargées
  [
    "16/loader.gif",
    "66/loader.gif",
    "48/slot_validate.png",
    "48/slot_edit.png",
    "24/switch_active.png",
    "slot_loading.gif"
  ]
};

// configuration de jQuery
$.ajaxSetup({
  global:   false,
  timeout:  999999,
  method:   "POST"
});
      
// validation des formulaires
if ($.validator) {
	$.extend($.validator.messages, {
		required: '&nbsp;<img src="' + page_options.relative_url_root + "dmsPlugin/images/16/asterisk_orange.png" + '" />' +
		'&nbsp;<span style="color:#D57213; font-style:italic;">Requis</span>',
		email: "Merci d'entrer une adresse mail valide.",
		url: "Merci d'entrer une url valide.",
		number: "Merci d'entrer un nombre valide.",
		accept: "Le fichier n'a pas une extension valide.",
		equalTo: "Veuillez entrer une nouvelle fois la même valeur."
	});
	$.validator.setDefaults({
		debug: false
	});
}
      
//initialisation de thickbox
if ($.thickbox)
$.thickbox.defaults({
  i18n: { 
    close: { text: 'Fermer', title: 'Fermer cette fenêtre' },
    count: { text: 'Image #{image} / #{count}' },
    next: { text: 'Suivant', title: 'Voir l\'image suivante' },
    prev: { text: 'Précédent', title: 'Voir l\'image précédente' }
  }
});

// configuration des cluetips
if ($.fn.cluetip)
$.fn.cluetip.defaults = $.extend($.fn.cluetip.defaults,
{
  attribute:      'href',
  activation:     'click',
  fx: {             
    open:         'show', // can be 'show' or 'slideDown' or 'fadeIn'
    openSpeed:    0
  }, 
  cluetipClass:   'jtip',
  arrows:         true, 
  sticky:         true,
  mouseOutClose:  true,
  closePosition:  'title',
  closeText:      "X",
  dropShadow:     false,
  local:          true
});;
var Util = new function()
{
  
  var dialog_decoration_height = 60;
	
  this.init = function(opt)
  {
    Util.options = opt || {};
  };
  
  this.getHref = function(action_name)
  {
    eval("var action=Util.options."+action_name);
    return action ? Util.action2href(action) : null;
  };
  
  this.action2href=function(action)
  {
    return Util.options.script_name+action;
  };
  this.subs=function(str,nb)
  {
    return str.substring(0,str.length-nb);
  };
  this._fn=function(fn)
  {
    return $.isFunction(fn) ? fn : new Function();
  };
  this.img_src=function(img)
  {
    return Util.options.relative_url_root+Util.options.image_dir+img;
  };
  this.img=function(img, alt)
  {
    var alt = alt || "";
    return '<img src="'+Util.img_src(img)+'" alt="'+alt+'" />';
  };
  this.preload = function(images)
  {
    for(var i = 0; i<images.length; i++)
    {
      $("<img>").attr("src",Util.img_src(images[i]));
    }
  };
  this.in_array = function(needle, haystack)
  {
    for (var i in haystack)
    {
      if (haystack[i] == needle) {
        return true;
      }
    }
    return false;
  };
  
  this.track=function(delai)
  {
    setTimeout(Util.urchinTrack, delai||300);
  };
  this.urchinTrack=function(page){
    var err="";
    try{
			var pageTracker = _gat._getTracker(Util.options.urchin_tracker);
			pageTracker._initData();
			pageTracker._trackPageview();
    }
		catch(e){err+=e;}
    dbg('urchinTracker() '+err+" "+Util.options.urchin_tracker);
  };
};


jQuery.fn.extend({
  // construit un ui.dialog
  dms_dialog: function( opt, e ) {
    // si une ancienne version du dialog existe, on la supprime
    if (opt.class_name)
      $("."+opt.class_name.replace(/ /gi, ".")).remove();
    opt.width = opt.width || 400;
    opt.height = this.show().outerHeight() + Util.dialog_decoration_height ;
    $dialog = this.dialog(opt);
    $dialog.parent().parent().addClass(opt.class_name);
    // hack pour voir le dialog au dessus du flash
    setTimeout(function(){
      $("div.ui-dialog").css("overflow-y", "auto");
    }, 200);
    return $dialog;
  },
  // retourne une dimension ( ex: Util.num($(query, "marginLeft"); )
  widthOf: function( prop ) {
    return parseInt($.curCSS(el.jquery?el[0]:el,prop,true))||0;
  },
  // retourne la largeur totale des margin, border et padding
  // requiert le plugin dimensions
  decorationWidth: function() {
    return this.outerWidth({ margin: true }) - this.width();
  },
  rebind: function( type, data, fn ) {
    return this.unbind(type, fn).bind( type, data, fn );
  },
  loader: function( size, image, texte ) {
    var size = size || 16;
    var image = image || "loader.gif";
    var texte = texte || "";
    return this.html("<div class='dms dms_loader'>"+Util.img(size+"/"+image)+texte+"</div>");
  }
});

// faire fonctionner les double listes dans l'admin

function double_list_move(src, dest)
{
    var L = $(src).children();
    $(L).each(function(i){
        if(L[i].selected){
            $(dest).append('<option value="'+$(L[i]).val()+'">'+ $(L[i]).text()+'</option>');
            $(L[i]).remove();
        }
    });
 
}
 
function double_list_submit()
{
    var sel = $("form").find("select.sf_admin_multiple-selected");
    var C = $(sel).children();
    $(C).each(
        function(i){
            if(!C[i].selected)
                C[i].selected=true;
        }
    );
 
}

function dbg(o)
{
	try {
	  if("console" in window && 'firebug' in console)
	    console.debug(o);
  }
	catch(err)
	{
		//alert(o);
	}
};;
// logique de la zone

(function($)
{
  // constructeur de zone
  $.dms.zone = function(el) {

    // ATTRIBUTS
    
    var _=            this;
    var $zone=        $(el);
    var $view=        $zone.find("div.dms_zone_view");
    var $edit=        $zone.find("div.dms_zone_edit");
    var $form=        $edit.find("form.dms_zone_form");
    var $slots;
    var zone_id=      $zone.attr("id").substring("9");
    var cluetip_href= $zone.find('a.dms_zone_menu').attr("href");
    var timeSortSlots;
		var timeResize;
    
    // METHODS
    
    this.startPulsate = function()
    {
      $zone.addClass('dms_highlight');
    };
    this.stopPulsate = function()
    {
      $zone.removeClass('dms_highlight');
    };
		
    this.resize = function(new_width, new_type)
    {
      if (new_type == "%")
		  {
        $form.find(".dms_rel_width").text(new_width+new_type);
        $form.find(".dms_abs_width").val("");
      }
      else $form.find(".dms_rel_width").text("");
      $zone.css("width",new_width+new_type);
				
      if(timeResize) clearTimeout(timeResize);
      timeResize=setTimeout(function(){
	      $.post(
	        Util.getHref("resizeZone"),
	        {
	          zone_id:  zone_id,
	          width:    new_width,
	          type:     new_type
	        }
	      );
		  }, 200);
    };
    
    this.setAlign = function(new_align)
    {
      $zone.css("text-align", new_align);
      $.post(
        Util.getHref("alignZone"),
        {
          zone_id:  zone_id,
          align:    new_align
        }
      );
    };

    this.initSlots = function()
    {
      $slots = $zone.find("ul.dms_slots");
      // initialisation des slots de la zone
      $("li.dms_slot", $slots).slot($zone);
      if (Dms.can("edition_2")) 
			{
				if ($slots.hasClass("ui-sortable"))
				  $slots.sortable("refresh");
			  else
					$slots.sortable({
						stop: this.sortSlots,
						placeholder: ".dms_slot_place",
						handle: '.dms_slot_menu',
						prevention: "a"
					});
			}
    };
    
    this.sortSlots = function()
    {
      if(timeSortSlots) clearTimeout(timeSortSlots);
      timeSortSlots=setTimeout(function(){
        var unique_id = [];
        var len = 0;
        $slots.find("li.dms_slot").each(function() {
          old = false;
          id=parseInt($(this).attr("id").substring(9));
          for(var i=0;i<len;i++) { if(unique_id[i] == id) old = true; }
          if(!old) len=unique_id.push(id);
        });
        $.post(
          Util.getHref("sortSlots"),
          { id_slots: unique_id.join(';') }
        );
      },300);
    };
		
		this.createSlot = function(href, callback)
		{
      $slots.append($('<div id="dms_new_slot_loader">').loader(66));
      $.post(
        href,
        function (data) {
          $("#dms_new_slot_loader").remove();
          if (data!="ko")
					{
            $slots.append(data);
            _.initSlots();
            $the_slot = $.data($slots.find("li.dms_slot:last")[0], "dms_slot");
						Util._fn(callback)($the_slot);
          }
        }
      );
		};
    
		this.initEdit = function()
		{
			if (Dms.can("create_blob"))
			{
				$zone.find("a.dms_slot_add")
          .rebind("click",function()
					{
						_.createSlot($(this).attr("href"), function($the_slot) {
              $the_slot.blobDialog();
						});
            return false;
          })
        ;
        $zone.rebind("mouseover", function() {
	        if(!$zone.hasClass("hover"))
	          $zone.addClass("hover");
        });
        $zone.rebind("mouseout", function() {
	        if($zone.hasClass("hover"))
	          $zone.removeClass("hover");
        });
			}
	    if (Dms.can("edition_2"))
			{
	      // passage en mode edit
	      $view.find(".dms_zone_switch")
	        .rebind("click",
	          function() {
	            if($zone.hasClass("active")) {
	              $zone.removeClass("active");
	              $(this).removeClass("active");
	            }
	            else {
	              $zone.addClass("active");
	              $(this).addClass("active");
	            }
	          }
	        )
	      ;
	      // la même chose en dblclick sur la zone
	      $view.rebind("dblclick", function(e){
	        e.stopPropagation();
	        $view.find(".dms_zone_switch").trigger("click");
	        return false;
	      });
	      
	      //initialisation des cluetips ( menus contextuels ajax )
	      if (!Dms.cluetipExists(cluetip_href)) {
	        Dms.setCluetip(cluetip_href, true);
	        $zone.find('a.dms_zone_menu').unbind().cluetip({
	          onShow:         function($ct, $menu)
	          {
	            // clic sur Ajouter un slot : envoie une requete ajax puis affiche le slot
	            $menu.find("a.dms_slot_add")
	              .rebind("click",function() {
	                Dms.cluetipClose();
                  _.createSlot($(this).attr("href"),function($the_slot){
			              $the_slot.editionDialog();
			            });
									return false;
	              })
	            ;
	            
	            // clic sur Supprimer la zone : envoie une requete ajax puis détruit la zone
	            $menu.find("a.dms_zone_delete")
	              .rebind("click",function() {
	                Dms.cluetipClose();
	                $zone.slideUp("slow");
	                $.post(
	                  $(this).attr("href"),
	                  function (response) {
	                    if (response=="ok")
	                      $zone.remove();
	                  }
	                );
	                return false;
	              })
	            ;
	            
	            // passage en mode edit
	            $menu.find("a.dms_zone_edit")
	              .rebind("click",function(e) {
	                Dms.cluetipClose();
	                _.startPulsate();
	                
	                //$edit.show();
	                if (!$edit.is(".ui-dialog-content"))
	                  $edit.dms_dialog({
	                      title:      Util.img("24/zone_edit.png")+"Style de la zone",
	                      resizable:  false,
	                      width:      360,
	                      close:      function() {_.stopPulsate();},
	                      class_name: "dms dms_zone_edit_box zeb_"+zone_id
	                    })
	                    .find(".dms_zone_resize")
	                      .slider(
	                        {
	                          slide:      function(e, ui) {_.resize(parseInt(ui.value), "%");},
	                          minValue:   10,
	                          maxValue:   100,
	                          startValue: Util.subs($zone.css("width"),1)
	                        }
	                      )
	                    .end()
	                    .find(".dms_abs_width")
	                      .rebind("keyup",
	                        function() {
	                          _.resize($(this).val(), "px");
	                        }
	                      )
	                    .end()
	                    .find(".dms_zone_align")
	                      .rebind("change", function() {
	                        _.setAlign($(this).val());
	                      })
	                    .end()
	                    .find(".valider")
	                      .rebind("click", function() {
	                        $edit.dialog("close");
	                        return false;
	                      }
	                    )
	                  ;
	                else
	                  $edit.dialog("open");
	              }
	            );
	          }
	          // fin du onshow
	        });
	        // fin du cluetip
	      }
	      
	      // quand le formulaire est validé, on recharge la zone en ajax
	      $form
	        .rebind("submit",function(){
	          var values={
	            zone_id:    zone_id
	          };
	          $zone.load(
	            $(this).attr("action"),
	            values,
	            function(){
	              $zone.zone();
	            }
	          );
	          return false;
	        })
	      ;
	    };
		};
		
    // INITIALISATION    
    
    this.initSlots(); 
    
    // INITIALISATION DE L'EDITION
    
    this.initEdit();
    
  }; // fin de l'initialisation de l'édition

  $.fn.zone = function() {
    return this.each(function() {
      new $.dms.zone(this);
    });
  };
})(jQuery);;
// logique du slot

(function($)
{
  // constructeur de slot
  $.dms.slot = function(el, $zone) {
    
    // ATTRIBUTS
    
    var self=         this;
    var $slot=        $(el);
    var $view=        $slot.find("div.dms_slot_view");
    var $edit=        $slot.find("div.dms_slot_edit");
    var $form=        $edit.find("form.dms_slot_form");
    var slot_type=    $form.find("select.dms_slot_type").val();
    var slot_id=      $slot.attr("id").substring("9");
    var cluetip_href= $slot.find('a.dms_slot_menu').attr("href");
    
    var pulsate_timeout =  null;
    var pulsate_speed =    500;
		
		$.data(el, "dms_slot", this);
    
    // METHODES
    
    this.startPulsate = function()
    {
      $slot.addClass('dms_highlight');
			pulsate_timeout = setTimeout(function(){
				$slot.removeClass('dms_highlight');
			  pulsate_timeout = setTimeout(function(){
	        self.startPulsate();
	      }, pulsate_speed);
			}, pulsate_speed);
    };
    this.stopPulsate = function()
    {
			clearTimeout(pulsate_timeout);
      $slot.removeClass('dms_highlight');
    };
    
    this.prepareEditor = function($editor, type)
    {
      var $editor = $editor || $form;
      var type = type || slot_type;
      if(type == "form")
        self.prepareSlotForm($editor);
      self.prepareSlotLink($editor);
			if ($editor.find("ul.sort_me").length) 
			{
				$editor.find("ul.sort_me").sortable({
          placeholder:    "dms_sortable_place",
          items:          'li',
          axis:           "y",
					stop:           function(e, ui) {
						$editor.find("#dms_menu_order").val(
						  $editor.find("ul.sort_me").sortable("toArray", "page_id").join(';')
					  );
					}
			  });
			}
		  $editor.find("a[@class*='tog_']").each(function() {
        $(this).click(function(){ 
          $("."+$(this).attr('class').substring(4)).toggle(500);
        });
      });
    };
    
    this.prepareSlotLink = function($editor)
    {
      $page_selector = $editor.find("ul.dms_page_selector");
      if ($page_selector.length)
      {
        $(".seb_"+slot_id).css("overflow", "visible");
        $("a", $page_selector).rebind("click", function()
        {
          $page_selector.hide();
          var new_type = $(this).attr("href");
					if (new_type) 
					{
						$(".page_id", $editor).val(new_type);
						$(".page_id_info", $editor).html($(this).html());
						setTimeout(function()
						{
							$page_selector.show();
						}, 200);
					}
          return false;
        });
      }
    };
    
    this.prepareSlotForm = function($editor)
    {
      $editor.find(".dms_add_input").rebind("click",function(){
        $.get(
          Util.getHref("getFormChamp"),
          {id: parseInt($editor.find(".dms_inputs input[@name*=title]:last").attr("name").substring(6))+1},
          function (html) {
            $editor.find(".dms_add_input").before(html);
            self.prepareSlotForm($editor);
          }
        );
        return false;
      })
      .end().find(".dms_delete_input").rebind("click", function(){
        $(this).parent().remove();
        return false;
      }).css("cursor","pointer");
    };
    
    this.editionDialog = function(href)
    {
      var dialog_class = "seb_"+slot_id;
			
			var wnd = $(window), doc = $(document),
			  top = doc.scrollTop()+(wnd.height() / 2) - (500 / 2),
				left = doc.scrollLeft()+(wnd.width() / 2) - (400 / 2);
			
			$('<div class="dms_slot_edition>"').loader(66).dms_dialog({
        title:      Util.img("24/slot_edit.png")+"Contenu du slot",
        resizable:  false,
        height:     400,
        width:      400,
				position:   [ left, top ],
        close:      function() { self.stopPulsate(); },
        class_name: "dms dms_slot_edit_box "+dialog_class
      });
        
      var $dialog =         $("."+dialog_class);
			
      var href = href || $view.metadata().edition_href;
      
      self.startPulsate();
			
      $.get(href, function(html)
			{
        $dialog.find("div.dms_slot_edition").html(html);
				
				var $form =           $dialog.find("form.dms_slot_form");
	      var $slot_type_menu = $form.find("ul.dms_stm");
        
        // prépare le contenu de l'éditeur, qui doit être rechargé
        // lorsque le type de slot est changé
        self.prepareEditor($form);
				
	      if ($slot_type_menu.length)
	      {
          $slot_type_menu.mouseover(function(){
            $(".seb_"+slot_id).css("overflow", "visible");
          }).mouseout(function(){
            $(".seb_"+slot_id).css("overflow", "auto" );
          });
	        $("a", $slot_type_menu).rebind("click", function()
	        {
            var new_type = $(this).attr("href");
						if (new_type) 
						{
							var selected_name = $(this).text();
							$slot_type_menu.hide();
							$form.find(".typed_editor").loader(66).load(Util.getHref("slotUpdateType"), {
								slot_id: slot_id,
								slot_type: new_type
							}, function()
							{
								self.prepareEditor($(this), new_type);
								$slot_type_menu.show().find("a:first").text(selected_name);
								$(".dms_slot_type", $form).val(new_type);
							});
						}
	          return false;
	        });
		    }
		    
	      // quand le formulaire est validé, on recharge le slot en ajax
	      $form
	        .ajaxForm(
	          {
	            beforeSubmit: function(data) {
	              var slot_type = $(".dms_slot_type", $form).val();
	              var page_slot = $(".page_slot", $form).attr("checked");
	              
	              // affichage du dialog d'attente
	              $form.find("a.annuler").trigger("click");
	              $slot.loader(66);
	            },
	            success: function() {
	              Dms.setCluetip(cluetip_href, false);
	              $zone.zone();
                Dms.reloadAppInit();
	            },
	            target: $slot
	          }
	        )
	        .find("a.valider").rebind("click", function() {
	          $form.trigger("submit")
	        })
	        .end().find("a.annuler").rebind("click", function() {
	          $dialog.find(".ui-dialog-titlebar-close").trigger("click");
	        });
        }
		  );
    };
    
    this.styleDialog = function(href)
    {
      self.startPulsate();
      $.get(href, function(html) {
        $('<div class="dms_slot_style">').html(html).dms_dialog({
            title:      Util.img("24/slot_edit.png")+"Style du slot",
            resizable:  false,
            width:      300,
            close:      function() {self.stopPulsate();},
            class_name: "dms dms_slot_edit_box ssb_"+slot_id
          })
          .find("form.dms_slot_form_style")
            .ajaxForm({
              beforeSubmit: function() {
                $(".ssb_"+slot_id+" .ui-dialog-titlebar-close").trigger("click");
                $slot.loader(66);
                return true;
              },
              success: function() {
                Dms.setCluetip(cluetip_href, false);
                $zone.zone();
              },
              target: $slot
          })
          .end().find("a.valider").rebind("click", function() {
            $(".ssb_"+slot_id+" form.dms_slot_form_style").trigger("submit")
          })
          .end().find("a.annuler").rebind("click", function() {
            $(".ssb_"+slot_id+" .ui-dialog-titlebar-close").trigger("click");
          });
      });  
    };
		
		this.blobDialog = function(href)
    {
      var dialog_class = "beb_"+slot_id;
      
      var href = href || $slot.find("a.dms_blob_edit").attr("href");
			
			var
			  preview_loaded = true,
			  preview_timeout = null;
      
      var wnd = $(window), doc = $(document),
			  height =  510,
				width =   800,
        top =     doc.scrollTop()+(wnd.height() / 2) - (height / 2) - 20,
        left =    doc.scrollLeft()+(wnd.width() / 2) - (width / 2);
      
      $('<div>').loader(66).dms_dialog({
        title:      Util.img("24/slot_edit.png")+"Contenu et style du blob",
        resizable:  false,
        height:     height,
        width:      width,
        position:   [ left, top ],
        close:      function()
				{
          Dms.setCluetip("#dms_slot_ajax_menu_"+slot_id, false);
          if (preview_timeout)
           clearTimeout(preview_timeout);
					$slot.loader(66).load(
					  Util.getHref("slotGetInner"),
						{ slot_id: slot_id},
						function()
						{
		          $zone.zone();
		          Dms.reloadAppInit();
						}
				  );
				},
        class_name: "dms dms_blob_edit_box "+dialog_class
      });
        
      var $dialog =         $("."+dialog_class);
      
      $.get(href, function(html)
			{
	  	  $dialog.find("div.ui-dialog-content").addClass("dms_blob_edition").html(html);
				
        var
				  $form =           $dialog.find("form"),
					$nom =            $form.find("#nom"),
					$description =    $form.find("#description"),
          $template =       $form.find("#template"),
          $style =          $form.find("#style"),
          $image =          $form.find("#image"),
					$preview =        $dialog.find("div.dbe_preview");
          nom =             $nom.val(),
          description =     $description.val(),
          template =        $template.val(),
          style =           $style.val(),
          image =           $image.val();
      
        $description.markItUp(markdownSettings);
        
				Dms.mediaLauncher($preview);
			  
        var on_blob_event = function()
				{
          if (preview_loaded) 
          {
            preview_loaded = false;
            $preview.css("opacity", 0.4);
          }
					if (preview_timeout)
					 clearTimeout(preview_timeout);
					 
					preview_timeout = setTimeout(function()
          {
            blob_reload_preview();
          }, 500);
				};
					
        var blob_reload_preview = function()
        {
          if ($nom.val() != nom
           || $description.val() != description
           || $template.val() != template
           || $style.val() != style
           || $image.val() != image)
          {
            $form.submit();
            if ($image.val() != image)
            {
              var $blob_image = $preview.find("div.blob_image");
              var w = $blob_image.width() || 66, h = $blob_image.height() || 66;
              $blob_image.loader(66).width(w).height(h);
              setTimeout(function(){$image.val("");}, 500);
            }
            nom = $nom.val();
            description = $description.val();
            template = $template.val();
            style = $style.val();
            image = "";
          }
          else
          {
            $preview.css("opacity", 1);
            preview_loaded = true;
          }
          preview_timeout = setTimeout(function()
          {
            blob_reload_preview();
          }, 700);
        };
        
        $form.find("a.dbe_valider").rebind("click", function()
				{
          $dialog.find(".ui-dialog-titlebar-close").trigger("click");
				});
				
				$form.ajaxForm(
        {
          beforeSubmit: function() {
						if (preview_loaded) 
						{
							preview_loaded = false;
							$preview.css("opacity", 0.4);
						}
            return true;
          },
          target: $preview,
					success: function(data) {
            $preview.css("opacity", 1);
						preview_loaded = true;
            Dms.mediaLauncher($preview);
				  }
        });
          
        preview_timeout = setTimeout(function()
				{
					blob_reload_preview();
				}, 1000);
				
	    });
    };
    
		this.init = function()
		{
			Dms.mediaLauncher($slot);
		
			// auto-validation des formulaires générés par dmsSlotForm
			if ($("form.dms_form", $slot).length) 
				$("form.dms_form", $slot).validate();
			
			// thickbox
			if ($.thickbox)
			  $view.find('a.thickbox').thickbox();
			
      $view.find("a[@rel*='tog_']").each(function() {
        $(this).click(function(){ 
          $view.find("div."+$(this).attr('rel').substring(4)).toggle(500);
        }).css("cursor", "pointer");
      });
			
			// liens externes
			$('a[@href^="http:"]:not([@href^="'+Dms.options.base_url+'"])')
		    .addClass("external").attr({ target: "_blank" });

		};
		
		this.initEdition = function()
		{
			$view.find("div.dms_edit_me").each(function()
			{
	      var $this = $(this);
	      var data = $this.metadata();
				var type = data.type || "text";
        var $help = $this.find("div.help").clone();
				var $content = $this.html();
				var settings = {
					indicator:  Util.img("icon/indicator.gif"),
          type:       type,
          width:      "98%",
          placeholder: 'Cliquez pour éditer',
					loadurl:    data.loadurl ? Util.action2href(data.loadurl) : null,
          submit:     'Enregistrer',
          cancel:     'Annuler',
          onblur:     'ignore',
					open:       function()
				  {
            if ($help.length)
						{
              $this.prepend($help);
              $help.show();
            }
            if (type == "ajaxupload")
              $this.prepend($content);
							
					  $this.find("button").click(function(){$this.loader(66);});
          },
          close:      function()
					{
						if ($help.length)
              $help.remove();
					  $content = $this.html();
            Dms.mediaLauncher($slot);
          }
				};
        if (type == "textarea")
          settings = $.extend(settings, {
            height:     $this.height() > 200 ? $this.height() : 200
          });
        if (type == "ajaxupload")
          settings = $.extend(settings, {
            height:     $this.height() > 200 ? $this.height() : 200
          });
	      $this.editable(Util.action2href(data.href), settings);
				$this.hover(
				  function(){ $this.addClass("active"); },
					function(){ $this.removeClass("active"); }
			  ).attr("title", "Cliquez pour éditer");
	    });
			
			if (Dms.can("update_blob"))
			{
				$view.find("a.dms_blob_edit").rebind("click",function()
				{
		      self.blobDialog($(this).attr("href"));
		      return false;
		    });
			}
      
      if (Dms.can("delete_blob"))
      {
        $view.find("a.dms_slot_delete").rebind("click",function()
				{
          $slot.slideUp("slow");
          $.post($(this).attr("href"));
          return false;
        });
      }
			
      if (Dms.can("edition_3") && !Dms.can("edition_4"))
        $view.rebind("dblclick", function()
        {
          self.editionDialog($view.metadata().edition_href);
        });
	    
	    if (Dms.can("edition_3"))
	    {
	      // survol
	      $view.hover(
	        function() {$slot.addClass("hover");},
	        function() {$slot.removeClass("hover");}
	      );
	      
	      //initialisation des cluetips ( menus contextuels ajax )
	      if (!Dms.cluetipExists(cluetip_href))
				{
	        Dms.setCluetip(cluetip_href, true);
	        $slot.find('a.dms_slot_menu').unbind().cluetip({
						activation:       'click',
	          onShow: function($ct, $menu) {
	            // passage en mode edit
	            $("#cluetip").find("a.dms_slot_edit").rebind("click",function() {
	              Dms.cluetipClose();
	              self.editionDialog($(this).attr("href"));
                return false;
	            })
	            // passage en mode edit_style
	            .end().find("a.dms_slot_edit_style").rebind("click",function() {
	              Dms.cluetipClose();
	              self.styleDialog($(this).attr("href"));
	              return false;
	            })
	            //passage en édition d'objet pour les slots de type detail
	            .end().find("a.dms_slot_edit_object").rebind("click",function() {
	              Dms.cluetipClose();
	              self.objectDialog($(this).attr("href"));
	              return false;
	            })             
	            // clic sur supprimer : envoie la requete en ajax,
	            // puis efface le slot si reçoit la réponse "ok"
	            .end().find("a.dms_slot_delete").rebind("click",function() {
	              Dms.cluetipClose();
	              $slot.slideUp("slow");
	              $.post($(this).attr("href"), function (response) {
	                if (response=="ok")
									{
	                  Dms.setCluetip(cluetip_href, false);
	                  //$slot.remove();
	                  //$zone.zone();
	                }
	              });
	              return false;
	            });
	          }
	        });
	      }
	        
	    }
		};
		
    // INITIALISATION
    
		self.init();
		
    // INITIALISATION DE L'EDITION
		
		if (Dms.can("edition_1 extranet"))
		  self.initEdition();
                    
  };
  
  $.fn.slot = function($zone) {
    return this.each(function() {
      new $.dms.slot(this, $zone);
    });
  };

})(jQuery);;
// Controlleur primaire du DMS

var Dms = new function()
{
  var options;
  
  var timeSortZones;
  var thickbox_counter = 0;
  
  var resize_content_delay = 50;
  var resize_content_time;
  
  // slot qui ont un cluetip
  this.cluetips = new Array();

  this.init = function(options)
  {
    // extension des options par défaut
    Dms.options = $.extend($.dms.defaults, options);
        
    // configuration de la boîte à outils
    Util.init(Dms.options);
    
    // initialisation des zones
    Dms.initZones();
    
    // si on peut éditer
    if (Dms.can("edition_1"))
    {
      // initialisation de la toolbox
      $("#dms_toolbox").toolbox({
        auto_hide:    false,
        active:       ""
      });
    }
      
    // préchargement des images
    Util.preload(Dms.options.images_to_preload);
    
    // affichage du modal, si il y en a un à afficher
    if (options.modal)
      Dms.modal(options.modal);
      
    // urchin tracker
    if (options.urchin_tracker && !options.is_localhost)
      Util.track();

  };

  this.initZones = function()
  {
    if (Dms.can("edition_2"))
    {
      if ($("ul.dms_zones").hasClass("ui-sortable"))
        $("ul.dms_zones").sortable("refresh");
      else
        $("ul.dms_zones")
          .sortable({
            stop:          function() {Dms.sortZones($(this).parent().parent());},
            placeholder:   "dms_zone_place",
            handle:        '.dms_zone_menu',
            prevention:    "a"
          });
    }
    $("ul.dms_zones li.dms_zone").zone();
  };
  
  this.sortZones = function($layout_part)
  {
    if(timeSortZones) clearTimeout(timeSortZones);
    timeSortZones=setTimeout(function(){
      var unique_id = [];
      var len = 0;
      $($layout_part).find("li.dms_zone").each(function() {
        old = false;
        id=parseInt($(this).attr("id").substring(9));
        for(var i=0;i<len;i++) { if(unique_id[i] == id) old = true; }
        if(!old) len=unique_id.push(id);
      });
      $.post(
        Util.getHref("sortZones"),
        { 
          id_zones:     unique_id.join(';')
        }
      );
    },300);
  };
  
	this.reloadAppInit = function()
	{
		if (typeof(Ctrl) != "undefined")
		  Util._fn(Ctrl.init)();
	};
	
  this.setCluetip = function(href, flag)
  {
    this.cluetips[href] = flag;
  };
  this.cluetipExists = function(href)
  {
    for (var i in this.cluetips)
		{
      if (i == href)
        return this.cluetips[i];
    }
    return false;
  };
  
  this.modal = function(html)
  {
		if ($.thickbox)
		{
			$("#dms_modal_content").html(html);
			$("#dms_modal_a").thickbox({
				height: 100
			}).trigger("click");
		}
		else
		  alert(html);
  };
  
  this.cluetipClose = function()
  {
    $("#cluetip-close").trigger("click");
  };
  
  this.can = function(credentials)
  {
		var credentials_array = credentials.split(" ");
		
		for (var i in credentials_array)
    {
			if (Util.in_array(credentials_array[i], Dms.options.credentials))
        return true;
    }
    return false;
  };
	
	this.mediaLauncher = function($dom)
	{
    $flash = $("div.dms_flash", $dom);
    $video = $("div.dms_video", $dom);
    $gmap  = $("div.dms_gmap", $dom);
    if ($flash.length)
      Dms.launchFlash($flash);
    if ($video.length)
      Dms.launchVideo($video);
    if ($gmap.length)
      Dms.launchGmap($gmap);
	}
  
  this.launchFlash = function($elem)
  {
    var metas = $elem.metadata();
    if (metas.url)
    {
      setTimeout(function()
      {
        var new_id = "dms_flash_" + Math.floor(1000000 * Math.random());
        $elem.attr("id", new_id);
        
        var so = new SWFObject(Dms.options.relative_url_root + metas.url.substr(1), "fpl", metas.width || "320", metas.height || "260", "8", "#fff");
        
        if ($.isFunction(Ctrl.initFlashPlayer))
          so = Ctrl.initFlashPlayer(so);
        else
        {
					so.addParam("wmode", "opaque");
        }
				
        so.addVariable('width', metas.width || "320");
        so.addVariable('height', metas.height || "260");
        so.write(new_id);
      }, 100);
    }
  }
  
  this.launchGmap = function($elem)
  {
    var metas = $elem.metadata();
    $.jmap.searchAddress({address: metas.address}, function(options, point)
		{
			if (!point) {
		  	$elem.html(Dms.alertMsg("L'adresse "+metas.address+" n'a pas été trouvée !"));
				return;
		  }
      $elem.jmap('init', {
		    // Initial type of map to display
		    language: "fr",
		    // Options: "map", "sat", "hybrid"
		    mapType: metas.map_type,
		    // Initial map center
		    mapCenter: [55.958858,-3.162302],
		    // Initial zoom level
		    mapZoom: metas.zoom,
		    // Initial map control size
		    // Options: "large", "small", "none"
		    mapControlSize: "small",
		    // Initialise type of map control
		    mapEnableType: false,
		    // Initialise small map overview
		    mapEnableOverview: false,
		    // Enable map dragging when left button held down
		    mapEnableDragging: true,
		    // Enable map info windows
		    mapEnableInfoWindows: true,
		    // Enable double click zooming
		    mapEnableDoubleClickZoom: false,
		    // Enable zooming with scroll wheel
		    mapEnableScrollZoom: false,
		    // Enable smooth zoom
		    mapEnableSmoothZoom: false,
		    // Enable Google Bar
		    mapEnableGoogleBar: false,
		    // Enables scale bar
		    mapEnableScaleControl: false,
		    // Enable the jMap icon
		    mapShowjMapIcon: false,
		    //Debug Mode
		    debugMode: false
	    });
			$elem.jmap('moveTo', {mapCenter: [point.y, point.x]});
      $elem.jmap('addMarker', {pointLatLng:[point.y, point.x], pointHTML: metas.text || null});
	  });
  }
	
	this.launchVideo = function($elem)
	{
    var metas = $elem.metadata();
		if (metas.url)
		{
			setTimeout(function()
			{
				var new_id = "dms_video_" + Math.floor(1000000 * Math.random());
				$elem.attr("id", new_id);
				
				var so = new SWFObject(Dms.options.relative_url_root + "dmsPlugin/mediaplayer-3-16/mediaplayer.swf", "mpl", metas.width || "320", metas.height || "260", "8", "#fff");
				
				if ($.isFunction(Ctrl.initVideoPlayer))
				  so = Ctrl.initVideoPlayer(so);
			  else
				{
			    so.addParam('allowscriptaccess', 'always');
			    so.addParam('allowfullscreen', 'true');
			    so.addVariable('searchbar','false');
			    so.addVariable('shownavigation','false');
			    so.addVariable('showdigits','false');
			    so.addVariable('autostart','false');
			    so.addVariable('screencolor','0xFFFFFF');
				}
				
        so.addVariable('width', metas.width || "320");
        so.addVariable('height', metas.height || "260");
        so.addVariable('file', Dms.options.relative_url_root + metas.url);
				so.write(new_id);
			}, 100);
		}
	}
	
	this.alertMsg = function(text)
	{
		return Util.img("16/asterisk_orange.png")+text;
	}

};

$(function(){
  Dms.init(page_options);
});;
