/*!
 * jQuery JavaScript Library v1.4.2
 * http://jquery.com/
 *
 * Copyright 2010, John Resig
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * Includes Sizzle.js
 * http://sizzlejs.com/
 * Copyright 2010, The Dojo Foundation
 * Released under the MIT, BSD, and GPL Licenses.
 *
 * Date: Sat Feb 13 22:33:48 2010 -0500
 */
(function(A,w){function ma(){if(!c.isReady){try{s.documentElement.doScroll("left")}catch(a){setTimeout(ma,1);return}c.ready()}}function Qa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function X(a,b,d,f,e,j){var i=a.length;if(typeof b==="object"){for(var o in b)X(a,o,b[o],f,e,d);return a}if(d!==w){f=!j&&f&&c.isFunction(d);for(o=0;o<i;o++)e(a[o],b,f?d.call(a[o],o,e(a[o],b)):d,j);return a}return i?
e(a[0],b):w}function J(){return(new Date).getTime()}function Y(){return false}function Z(){return true}function na(a,b,d){d[0].type=a;return c.event.handle.apply(b,d)}function oa(a){var b,d=[],f=[],e=arguments,j,i,o,k,n,r;i=c.data(this,"events");if(!(a.liveFired===this||!i||!i.live||a.button&&a.type==="click")){a.liveFired=this;var u=i.live.slice(0);for(k=0;k<u.length;k++){i=u[k];i.origType.replace(O,"")===a.type?f.push(i.selector):u.splice(k--,1)}j=c(a.target).closest(f,a.currentTarget);n=0;for(r=
j.length;n<r;n++)for(k=0;k<u.length;k++){i=u[k];if(j[n].selector===i.selector){o=j[n].elem;f=null;if(i.preType==="mouseenter"||i.preType==="mouseleave")f=c(a.relatedTarget).closest(i.selector)[0];if(!f||f!==o)d.push({elem:o,handleObj:i})}}n=0;for(r=d.length;n<r;n++){j=d[n];a.currentTarget=j.elem;a.data=j.handleObj.data;a.handleObj=j.handleObj;if(j.handleObj.origHandler.apply(j.elem,e)===false){b=false;break}}return b}}function pa(a,b){return"live."+(a&&a!=="*"?a+".":"")+b.replace(/\./g,"`").replace(/ /g,
"&")}function qa(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function ra(a,b){var d=0;b.each(function(){if(this.nodeName===(a[d]&&a[d].nodeName)){var f=c.data(a[d++]),e=c.data(this,f);if(f=f&&f.events){delete e.handle;e.events={};for(var j in f)for(var i in f[j])c.event.add(this,j,f[j][i],f[j][i].data)}}})}function sa(a,b,d){var f,e,j;b=b&&b[0]?b[0].ownerDocument||b[0]:s;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&b===s&&!ta.test(a[0])&&(c.support.checkClone||!ua.test(a[0]))){e=
true;if(j=c.fragments[a[0]])if(j!==1)f=j}if(!f){f=b.createDocumentFragment();c.clean(a,b,f,d)}if(e)c.fragments[a[0]]=j?f:1;return{fragment:f,cacheable:e}}function K(a,b){var d={};c.each(va.concat.apply([],va.slice(0,b)),function(){d[this]=a});return d}function wa(a){return"scrollTo"in a&&a.document?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var c=function(a,b){return new c.fn.init(a,b)},Ra=A.jQuery,Sa=A.$,s=A.document,T,Ta=/^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,Ua=/^.[^:#\[\.,]*$/,Va=/\S/,
Wa=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,Xa=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,P=navigator.userAgent,xa=false,Q=[],L,$=Object.prototype.toString,aa=Object.prototype.hasOwnProperty,ba=Array.prototype.push,R=Array.prototype.slice,ya=Array.prototype.indexOf;c.fn=c.prototype={init:function(a,b){var d,f;if(!a)return this;if(a.nodeType){this.context=this[0]=a;this.length=1;return this}if(a==="body"&&!b){this.context=s;this[0]=s.body;this.selector="body";this.length=1;return this}if(typeof a==="string")if((d=Ta.exec(a))&&
(d[1]||!b))if(d[1]){f=b?b.ownerDocument||b:s;if(a=Xa.exec(a))if(c.isPlainObject(b)){a=[s.createElement(a[1])];c.fn.attr.call(a,b,true)}else a=[f.createElement(a[1])];else{a=sa([d[1]],[f]);a=(a.cacheable?a.fragment.cloneNode(true):a.fragment).childNodes}return c.merge(this,a)}else{if(b=s.getElementById(d[2])){if(b.id!==d[2])return T.find(a);this.length=1;this[0]=b}this.context=s;this.selector=a;return this}else if(!b&&/^\w+$/.test(a)){this.selector=a;this.context=s;a=s.getElementsByTagName(a);return c.merge(this,
a)}else return!b||b.jquery?(b||T).find(a):c(b).find(a);else if(c.isFunction(a))return T.ready(a);if(a.selector!==w){this.selector=a.selector;this.context=a.context}return c.makeArray(a,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return R.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this.slice(a)[0]:this[a]},pushStack:function(a,b,d){var f=c();c.isArray(a)?ba.apply(f,a):c.merge(f,a);f.prevObject=this;f.context=this.context;if(b===
"find")f.selector=this.selector+(this.selector?" ":"")+d;else if(b)f.selector=this.selector+"."+b+"("+d+")";return f},each:function(a,b){return c.each(this,a,b)},ready:function(a){c.bindReady();if(c.isReady)a.call(s,c);else Q&&Q.push(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(R.apply(this,arguments),"slice",R.call(arguments).join(","))},map:function(a){return this.pushStack(c.map(this,
function(b,d){return a.call(b,d,b)}))},end:function(){return this.prevObject||c(null)},push:ba,sort:[].sort,splice:[].splice};c.fn.init.prototype=c.fn;c.extend=c.fn.extend=function(){var a=arguments[0]||{},b=1,d=arguments.length,f=false,e,j,i,o;if(typeof a==="boolean"){f=a;a=arguments[1]||{};b=2}if(typeof a!=="object"&&!c.isFunction(a))a={};if(d===b){a=this;--b}for(;b<d;b++)if((e=arguments[b])!=null)for(j in e){i=a[j];o=e[j];if(a!==o)if(f&&o&&(c.isPlainObject(o)||c.isArray(o))){i=i&&(c.isPlainObject(i)||
c.isArray(i))?i:c.isArray(o)?[]:{};a[j]=c.extend(f,i,o)}else if(o!==w)a[j]=o}return a};c.extend({noConflict:function(a){A.$=Sa;if(a)A.jQuery=Ra;return c},isReady:false,ready:function(){if(!c.isReady){if(!s.body)return setTimeout(c.ready,13);c.isReady=true;if(Q){for(var a,b=0;a=Q[b++];)a.call(s,c);Q=null}c.fn.triggerHandler&&c(s).triggerHandler("ready")}},bindReady:function(){if(!xa){xa=true;if(s.readyState==="complete")return c.ready();if(s.addEventListener){s.addEventListener("DOMContentLoaded",
L,false);A.addEventListener("load",c.ready,false)}else if(s.attachEvent){s.attachEvent("onreadystatechange",L);A.attachEvent("onload",c.ready);var a=false;try{a=A.frameElement==null}catch(b){}s.documentElement.doScroll&&a&&ma()}}},isFunction:function(a){return $.call(a)==="[object Function]"},isArray:function(a){return $.call(a)==="[object Array]"},isPlainObject:function(a){if(!a||$.call(a)!=="[object Object]"||a.nodeType||a.setInterval)return false;if(a.constructor&&!aa.call(a,"constructor")&&!aa.call(a.constructor.prototype,
"isPrototypeOf"))return false;var b;for(b in a);return b===w||aa.call(a,b)},isEmptyObject:function(a){for(var b in a)return false;return true},error:function(a){throw a;},parseJSON:function(a){if(typeof a!=="string"||!a)return null;a=c.trim(a);if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return A.JSON&&A.JSON.parse?A.JSON.parse(a):(new Function("return "+
a))();else c.error("Invalid JSON: "+a)},noop:function(){},globalEval:function(a){if(a&&Va.test(a)){var b=s.getElementsByTagName("head")[0]||s.documentElement,d=s.createElement("script");d.type="text/javascript";if(c.support.scriptEval)d.appendChild(s.createTextNode(a));else d.text=a;b.insertBefore(d,b.firstChild);b.removeChild(d)}},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,b,d){var f,e=0,j=a.length,i=j===w||c.isFunction(a);if(d)if(i)for(f in a){if(b.apply(a[f],
d)===false)break}else for(;e<j;){if(b.apply(a[e++],d)===false)break}else if(i)for(f in a){if(b.call(a[f],f,a[f])===false)break}else for(d=a[0];e<j&&b.call(d,e,d)!==false;d=a[++e]);return a},trim:function(a){return(a||"").replace(Wa,"")},makeArray:function(a,b){b=b||[];if(a!=null)a.length==null||typeof a==="string"||c.isFunction(a)||typeof a!=="function"&&a.setInterval?ba.call(b,a):c.merge(b,a);return b},inArray:function(a,b){if(b.indexOf)return b.indexOf(a);for(var d=0,f=b.length;d<f;d++)if(b[d]===
a)return d;return-1},merge:function(a,b){var d=a.length,f=0;if(typeof b.length==="number")for(var e=b.length;f<e;f++)a[d++]=b[f];else for(;b[f]!==w;)a[d++]=b[f++];a.length=d;return a},grep:function(a,b,d){for(var f=[],e=0,j=a.length;e<j;e++)!d!==!b(a[e],e)&&f.push(a[e]);return f},map:function(a,b,d){for(var f=[],e,j=0,i=a.length;j<i;j++){e=b(a[j],j,d);if(e!=null)f[f.length]=e}return f.concat.apply([],f)},guid:1,proxy:function(a,b,d){if(arguments.length===2)if(typeof b==="string"){d=a;a=d[b];b=w}else if(b&&
!c.isFunction(b)){d=b;b=w}if(!b&&a)b=function(){return a.apply(d||this,arguments)};if(a)b.guid=a.guid=a.guid||b.guid||c.guid++;return b},uaMatch:function(a){a=a.toLowerCase();a=/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version)?[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||!/compatible/.test(a)&&/(mozilla)(?:.*? rv:([\w.]+))?/.exec(a)||[];return{browser:a[1]||"",version:a[2]||"0"}},browser:{}});P=c.uaMatch(P);if(P.browser){c.browser[P.browser]=true;c.browser.version=P.version}if(c.browser.webkit)c.browser.safari=
true;if(ya)c.inArray=function(a,b){return ya.call(b,a)};T=c(s);if(s.addEventListener)L=function(){s.removeEventListener("DOMContentLoaded",L,false);c.ready()};else if(s.attachEvent)L=function(){if(s.readyState==="complete"){s.detachEvent("onreadystatechange",L);c.ready()}};(function(){c.support={};var a=s.documentElement,b=s.createElement("script"),d=s.createElement("div"),f="script"+J();d.style.display="none";d.innerHTML="   <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
var e=d.getElementsByTagName("*"),j=d.getElementsByTagName("a")[0];if(!(!e||!e.length||!j)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(j.getAttribute("style")),hrefNormalized:j.getAttribute("href")==="/a",opacity:/^0.55$/.test(j.style.opacity),cssFloat:!!j.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:s.createElement("select").appendChild(s.createElement("option")).selected,
parentNode:d.removeChild(d.appendChild(s.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};b.type="text/javascript";try{b.appendChild(s.createTextNode("window."+f+"=1;"))}catch(i){}a.insertBefore(b,a.firstChild);if(A[f]){c.support.scriptEval=true;delete A[f]}try{delete b.test}catch(o){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function k(){c.support.noCloneEvent=
false;d.detachEvent("onclick",k)});d.cloneNode(true).fireEvent("onclick")}d=s.createElement("div");d.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";a=s.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var k=s.createElement("div");k.style.width=k.style.paddingLeft="1px";s.body.appendChild(k);c.boxModel=c.support.boxModel=k.offsetWidth===2;s.body.removeChild(k).style.display="none"});a=function(k){var n=
s.createElement("div");k="on"+k;var r=k in n;if(!r){n.setAttribute(k,"return;");r=typeof n[k]==="function"}return r};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=e=j=null}})();c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var G="jQuery"+J(),Ya=0,za={};c.extend({cache:{},expando:G,noData:{embed:true,object:true,
applet:true},data:function(a,b,d){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var f=a[G],e=c.cache;if(!f&&typeof b==="string"&&d===w)return null;f||(f=++Ya);if(typeof b==="object"){a[G]=f;e[f]=c.extend(true,{},b)}else if(!e[f]){a[G]=f;e[f]={}}a=e[f];if(d!==w)a[b]=d;return typeof b==="string"?a[b]:a}},removeData:function(a,b){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var d=a[G],f=c.cache,e=f[d];if(b){if(e){delete e[b];c.isEmptyObject(e)&&c.removeData(a)}}else{if(c.support.deleteExpando)delete a[c.expando];
else a.removeAttribute&&a.removeAttribute(c.expando);delete f[d]}}}});c.fn.extend({data:function(a,b){if(typeof a==="undefined"&&this.length)return c.data(this[0]);else if(typeof a==="object")return this.each(function(){c.data(this,a)});var d=a.split(".");d[1]=d[1]?"."+d[1]:"";if(b===w){var f=this.triggerHandler("getData"+d[1]+"!",[d[0]]);if(f===w&&this.length)f=c.data(this[0],a);return f===w&&d[1]?this.data(d[0]):f}else return this.trigger("setData"+d[1]+"!",[d[0],b]).each(function(){c.data(this,
a,b)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var f=c.data(a,b);if(!d)return f||[];if(!f||c.isArray(d))f=c.data(a,b,c.makeArray(d));else f.push(d);return f}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),f=d.shift();if(f==="inprogress")f=d.shift();if(f){b==="fx"&&d.unshift("inprogress");f.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b===
w)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this,a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var Aa=/[\n\t]/g,ca=/\s+/,Za=/\r/g,$a=/href|src|style/,ab=/(button|input)/i,bb=/(button|input|object|select|textarea)/i,
cb=/^(a|area)$/i,Ba=/radio|checkbox/;c.fn.extend({attr:function(a,b){return X(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(n){var r=c(this);r.addClass(a.call(this,n,r.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ca),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1)if(e.className){for(var j=" "+e.className+" ",
i=e.className,o=0,k=b.length;o<k;o++)if(j.indexOf(" "+b[o]+" ")<0)i+=" "+b[o];e.className=c.trim(i)}else e.className=a}return this},removeClass:function(a){if(c.isFunction(a))return this.each(function(k){var n=c(this);n.removeClass(a.call(this,k,n.attr("class")))});if(a&&typeof a==="string"||a===w)for(var b=(a||"").split(ca),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1&&e.className)if(a){for(var j=(" "+e.className+" ").replace(Aa," "),i=0,o=b.length;i<o;i++)j=j.replace(" "+b[i]+" ",
" ");e.className=c.trim(j)}else e.className=""}return this},toggleClass:function(a,b){var d=typeof a,f=typeof b==="boolean";if(c.isFunction(a))return this.each(function(e){var j=c(this);j.toggleClass(a.call(this,e,j.attr("class"),b),b)});return this.each(function(){if(d==="string")for(var e,j=0,i=c(this),o=b,k=a.split(ca);e=k[j++];){o=f?o:!i.hasClass(e);i[o?"addClass":"removeClass"](e)}else if(d==="undefined"||d==="boolean"){this.className&&c.data(this,"__className__",this.className);this.className=
this.className||a===false?"":c.data(this,"__className__")||""}})},hasClass:function(a){a=" "+a+" ";for(var b=0,d=this.length;b<d;b++)if((" "+this[b].className+" ").replace(Aa," ").indexOf(a)>-1)return true;return false},val:function(a){if(a===w){var b=this[0];if(b){if(c.nodeName(b,"option"))return(b.attributes.value||{}).specified?b.value:b.text;if(c.nodeName(b,"select")){var d=b.selectedIndex,f=[],e=b.options;b=b.type==="select-one";if(d<0)return null;var j=b?d:0;for(d=b?d+1:e.length;j<d;j++){var i=
e[j];if(i.selected){a=c(i).val();if(b)return a;f.push(a)}}return f}if(Ba.test(b.type)&&!c.support.checkOn)return b.getAttribute("value")===null?"on":b.value;return(b.value||"").replace(Za,"")}return w}var o=c.isFunction(a);return this.each(function(k){var n=c(this),r=a;if(this.nodeType===1){if(o)r=a.call(this,k,n.val());if(typeof r==="number")r+="";if(c.isArray(r)&&Ba.test(this.type))this.checked=c.inArray(n.val(),r)>=0;else if(c.nodeName(this,"select")){var u=c.makeArray(r);c("option",this).each(function(){this.selected=
c.inArray(c(this).val(),u)>=0});if(!u.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(a,b,d,f){if(!a||a.nodeType===3||a.nodeType===8)return w;if(f&&b in c.attrFn)return c(a)[b](d);f=a.nodeType!==1||!c.isXMLDoc(a);var e=d!==w;b=f&&c.props[b]||b;if(a.nodeType===1){var j=$a.test(b);if(b in a&&f&&!j){if(e){b==="type"&&ab.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed");
a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&b.specified?b.value:bb.test(a.nodeName)||cb.test(a.nodeName)&&a.href?0:w;return a[b]}if(!c.support.style&&f&&b==="style"){if(e)a.style.cssText=""+d;return a.style.cssText}e&&a.setAttribute(b,""+d);a=!c.support.hrefNormalized&&f&&j?a.getAttribute(b,2):a.getAttribute(b);return a===null?w:a}return c.style(a,b,d)}});var O=/\.(.*)$/,db=function(a){return a.replace(/[^\w\s\.\|`]/g,
function(b){return"\\"+b})};c.event={add:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){if(a.setInterval&&a!==A&&!a.frameElement)a=A;var e,j;if(d.handler){e=d;d=e.handler}if(!d.guid)d.guid=c.guid++;if(j=c.data(a)){var i=j.events=j.events||{},o=j.handle;if(!o)j.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem,arguments):w};o.elem=a;b=b.split(" ");for(var k,n=0,r;k=b[n++];){j=e?c.extend({},e):{handler:d,data:f};if(k.indexOf(".")>-1){r=k.split(".");
k=r.shift();j.namespace=r.slice(0).sort().join(".")}else{r=[];j.namespace=""}j.type=k;j.guid=d.guid;var u=i[k],z=c.event.special[k]||{};if(!u){u=i[k]=[];if(!z.setup||z.setup.call(a,f,r,o)===false)if(a.addEventListener)a.addEventListener(k,o,false);else a.attachEvent&&a.attachEvent("on"+k,o)}if(z.add){z.add.call(a,j);if(!j.handler.guid)j.handler.guid=d.guid}u.push(j);c.event.global[k]=true}a=null}}},global:{},remove:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){var e,j=0,i,o,k,n,r,u,z=c.data(a),
C=z&&z.events;if(z&&C){if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(e in C)c.event.remove(a,e+b)}else{for(b=b.split(" ");e=b[j++];){n=e;i=e.indexOf(".")<0;o=[];if(!i){o=e.split(".");e=o.shift();k=new RegExp("(^|\\.)"+c.map(o.slice(0).sort(),db).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(r=C[e])if(d){n=c.event.special[e]||{};for(B=f||0;B<r.length;B++){u=r[B];if(d.guid===u.guid){if(i||k.test(u.namespace)){f==null&&r.splice(B--,1);n.remove&&n.remove.call(a,u)}if(f!=
null)break}}if(r.length===0||f!=null&&r.length===1){if(!n.teardown||n.teardown.call(a,o)===false)Ca(a,e,z.handle);delete C[e]}}else for(var B=0;B<r.length;B++){u=r[B];if(i||k.test(u.namespace)){c.event.remove(a,n,u.handler,B);r.splice(B--,1)}}}if(c.isEmptyObject(C)){if(b=z.handle)b.elem=null;delete z.events;delete z.handle;c.isEmptyObject(z)&&c.removeData(a)}}}}},trigger:function(a,b,d,f){var e=a.type||a;if(!f){a=typeof a==="object"?a[G]?a:c.extend(c.Event(e),a):c.Event(e);if(e.indexOf("!")>=0){a.type=
e=e.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[e]&&c.each(c.cache,function(){this.events&&this.events[e]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===8)return w;a.result=w;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(f=c.data(d,"handle"))&&f.apply(d,b);f=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+e]&&d["on"+e].apply(d,b)===false)a.result=false}catch(j){}if(!a.isPropagationStopped()&&
f)c.event.trigger(a,b,f,true);else if(!a.isDefaultPrevented()){f=a.target;var i,o=c.nodeName(f,"a")&&e==="click",k=c.event.special[e]||{};if((!k._default||k._default.call(d,a)===false)&&!o&&!(f&&f.nodeName&&c.noData[f.nodeName.toLowerCase()])){try{if(f[e]){if(i=f["on"+e])f["on"+e]=null;c.event.triggered=true;f[e]()}}catch(n){}if(i)f["on"+e]=i;c.event.triggered=false}}},handle:function(a){var b,d,f,e;a=arguments[0]=c.event.fix(a||A.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive;
if(!b){d=a.type.split(".");a.type=d.shift();f=new RegExp("(^|\\.)"+d.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}e=c.data(this,"events");d=e[a.type];if(e&&d){d=d.slice(0);e=0;for(var j=d.length;e<j;e++){var i=d[e];if(b||f.test(i.namespace)){a.handler=i.handler;a.data=i.data;a.handleObj=i;i=i.handler.apply(this,arguments);if(i!==w){a.result=i;if(i===false){a.preventDefault();a.stopPropagation()}}if(a.isImmediatePropagationStopped())break}}}return a.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
fix:function(a){if(a[G])return a;var b=a;a=c.Event(b);for(var d=this.props.length,f;d;){f=this.props[--d];a[f]=b[f]}if(!a.target)a.target=a.srcElement||s;if(a.target.nodeType===3)a.target=a.target.parentNode;if(!a.relatedTarget&&a.fromElement)a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement;if(a.pageX==null&&a.clientX!=null){b=s.documentElement;d=s.body;a.pageX=a.clientX+(b&&b.scrollLeft||d&&d.scrollLeft||0)-(b&&b.clientLeft||d&&d.clientLeft||0);a.pageY=a.clientY+(b&&b.scrollTop||
d&&d.scrollTop||0)-(b&&b.clientTop||d&&d.clientTop||0)}if(!a.which&&(a.charCode||a.charCode===0?a.charCode:a.keyCode))a.which=a.charCode||a.keyCode;if(!a.metaKey&&a.ctrlKey)a.metaKey=a.ctrlKey;if(!a.which&&a.button!==w)a.which=a.button&1?1:a.button&2?3:a.button&4?2:0;return a},guid:1E8,proxy:c.proxy,special:{ready:{setup:c.bindReady,teardown:c.noop},live:{add:function(a){c.event.add(this,a.origType,c.extend({},a,{handler:oa}))},remove:function(a){var b=true,d=a.origType.replace(O,"");c.each(c.data(this,
"events").live||[],function(){if(d===this.origType.replace(O,""))return b=false});b&&c.event.remove(this,a.origType,oa)}},beforeunload:{setup:function(a,b,d){if(this.setInterval)this.onbeforeunload=d;return false},teardown:function(a,b){if(this.onbeforeunload===b)this.onbeforeunload=null}}}};var Ca=s.removeEventListener?function(a,b,d){a.removeEventListener(b,d,false)}:function(a,b,d){a.detachEvent("on"+b,d)};c.Event=function(a){if(!this.preventDefault)return new c.Event(a);if(a&&a.type){this.originalEvent=
a;this.type=a.type}else this.type=a;this.timeStamp=J();this[G]=true};c.Event.prototype={preventDefault:function(){this.isDefaultPrevented=Z;var a=this.originalEvent;if(a){a.preventDefault&&a.preventDefault();a.returnValue=false}},stopPropagation:function(){this.isPropagationStopped=Z;var a=this.originalEvent;if(a){a.stopPropagation&&a.stopPropagation();a.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=Z;this.stopPropagation()},isDefaultPrevented:Y,isPropagationStopped:Y,
isImmediatePropagationStopped:Y};var Da=function(a){var b=a.relatedTarget;try{for(;b&&b!==this;)b=b.parentNode;if(b!==this){a.type=a.data;c.event.handle.apply(this,arguments)}}catch(d){}},Ea=function(a){a.type=a.data;c.event.handle.apply(this,arguments)};c.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){c.event.special[a]={setup:function(d){c.event.add(this,b,d&&d.selector?Ea:Da,a)},teardown:function(d){c.event.remove(this,b,d&&d.selector?Ea:Da)}}});if(!c.support.submitBubbles)c.event.special.submit=
{setup:function(){if(this.nodeName.toLowerCase()!=="form"){c.event.add(this,"click.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="submit"||d==="image")&&c(b).closest("form").length)return na("submit",this,arguments)});c.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="text"||d==="password")&&c(b).closest("form").length&&a.keyCode===13)return na("submit",this,arguments)})}else return false},teardown:function(){c.event.remove(this,".specialSubmit")}};
if(!c.support.changeBubbles){var da=/textarea|input|select/i,ea,Fa=function(a){var b=a.type,d=a.value;if(b==="radio"||b==="checkbox")d=a.checked;else if(b==="select-multiple")d=a.selectedIndex>-1?c.map(a.options,function(f){return f.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},fa=function(a,b){var d=a.target,f,e;if(!(!da.test(d.nodeName)||d.readOnly)){f=c.data(d,"_change_data");e=Fa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data",
e);if(!(f===w||e===f))if(f!=null||e){a.type="change";return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:fa,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return fa.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return fa.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a,
"_change_data",Fa(a))}},setup:function(){if(this.type==="file")return false;for(var a in ea)c.event.add(this,a+".specialChange",ea[a]);return da.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return da.test(this.nodeName)}};ea=c.event.special.change.filters}s.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(f){f=c.event.fix(f);f.type=b;return c.event.handle.call(this,f)}c.event.special[b]={setup:function(){this.addEventListener(a,
d,true)},teardown:function(){this.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,f,e){if(typeof d==="object"){for(var j in d)this[b](j,f,d[j],e);return this}if(c.isFunction(f)){e=f;f=w}var i=b==="one"?c.proxy(e,function(k){c(this).unbind(k,i);return e.apply(this,arguments)}):e;if(d==="unload"&&b!=="one")this.one(d,f,e);else{j=0;for(var o=this.length;j<o;j++)c.event.add(this[j],d,i,f)}return this}});c.fn.extend({unbind:function(a,b){if(typeof a==="object"&&
!a.preventDefault)for(var d in a)this.unbind(d,a[d]);else{d=0;for(var f=this.length;d<f;d++)c.event.remove(this[d],a,b)}return this},delegate:function(a,b,d,f){return this.live(b,d,f,a)},undelegate:function(a,b,d){return arguments.length===0?this.unbind("live"):this.die(b,null,d,a)},trigger:function(a,b){return this.each(function(){c.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){a=c.Event(a);a.preventDefault();a.stopPropagation();c.event.trigger(a,b,this[0]);return a.result}},
toggle:function(a){for(var b=arguments,d=1;d<b.length;)c.proxy(a,b[d++]);return this.click(c.proxy(a,function(f){var e=(c.data(this,"lastToggle"+a.guid)||0)%d;c.data(this,"lastToggle"+a.guid,e+1);f.preventDefault();return b[e].apply(this,arguments)||false}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var Ga={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};c.each(["live","die"],function(a,b){c.fn[b]=function(d,f,e,j){var i,o=0,k,n,r=j||this.selector,
u=j?this:c(this.context);if(c.isFunction(f)){e=f;f=w}for(d=(d||"").split(" ");(i=d[o++])!=null;){j=O.exec(i);k="";if(j){k=j[0];i=i.replace(O,"")}if(i==="hover")d.push("mouseenter"+k,"mouseleave"+k);else{n=i;if(i==="focus"||i==="blur"){d.push(Ga[i]+k);i+=k}else i=(Ga[i]||i)+k;b==="live"?u.each(function(){c.event.add(this,pa(i,r),{data:f,selector:r,handler:e,origType:i,origHandler:e,preType:n})}):u.unbind(pa(i,r),e)}}return this}});c.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),
function(a,b){c.fn[b]=function(d){return d?this.bind(b,d):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});A.attachEvent&&!A.addEventListener&&A.attachEvent("onunload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}});(function(){function a(g){for(var h="",l,m=0;g[m];m++){l=g[m];if(l.nodeType===3||l.nodeType===4)h+=l.nodeValue;else if(l.nodeType!==8)h+=a(l.childNodes)}return h}function b(g,h,l,m,q,p){q=0;for(var v=m.length;q<v;q++){var t=m[q];
if(t){t=t[g];for(var y=false;t;){if(t.sizcache===l){y=m[t.sizset];break}if(t.nodeType===1&&!p){t.sizcache=l;t.sizset=q}if(t.nodeName.toLowerCase()===h){y=t;break}t=t[g]}m[q]=y}}}function d(g,h,l,m,q,p){q=0;for(var v=m.length;q<v;q++){var t=m[q];if(t){t=t[g];for(var y=false;t;){if(t.sizcache===l){y=m[t.sizset];break}if(t.nodeType===1){if(!p){t.sizcache=l;t.sizset=q}if(typeof h!=="string"){if(t===h){y=true;break}}else if(k.filter(h,[t]).length>0){y=t;break}}t=t[g]}m[q]=y}}}var f=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
e=0,j=Object.prototype.toString,i=false,o=true;[0,0].sort(function(){o=false;return 0});var k=function(g,h,l,m){l=l||[];var q=h=h||s;if(h.nodeType!==1&&h.nodeType!==9)return[];if(!g||typeof g!=="string")return l;for(var p=[],v,t,y,S,H=true,M=x(h),I=g;(f.exec(""),v=f.exec(I))!==null;){I=v[3];p.push(v[1]);if(v[2]){S=v[3];break}}if(p.length>1&&r.exec(g))if(p.length===2&&n.relative[p[0]])t=ga(p[0]+p[1],h);else for(t=n.relative[p[0]]?[h]:k(p.shift(),h);p.length;){g=p.shift();if(n.relative[g])g+=p.shift();
t=ga(g,t)}else{if(!m&&p.length>1&&h.nodeType===9&&!M&&n.match.ID.test(p[0])&&!n.match.ID.test(p[p.length-1])){v=k.find(p.shift(),h,M);h=v.expr?k.filter(v.expr,v.set)[0]:v.set[0]}if(h){v=m?{expr:p.pop(),set:z(m)}:k.find(p.pop(),p.length===1&&(p[0]==="~"||p[0]==="+")&&h.parentNode?h.parentNode:h,M);t=v.expr?k.filter(v.expr,v.set):v.set;if(p.length>0)y=z(t);else H=false;for(;p.length;){var D=p.pop();v=D;if(n.relative[D])v=p.pop();else D="";if(v==null)v=h;n.relative[D](y,v,M)}}else y=[]}y||(y=t);y||k.error(D||
g);if(j.call(y)==="[object Array]")if(H)if(h&&h.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&E(h,y[g])))l.push(t[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&l.push(t[g]);else l.push.apply(l,y);else z(y,l);if(S){k(S,q,l,m);k.uniqueSort(l)}return l};k.uniqueSort=function(g){if(B){i=o;g.sort(B);if(i)for(var h=1;h<g.length;h++)g[h]===g[h-1]&&g.splice(h--,1)}return g};k.matches=function(g,h){return k(g,null,null,h)};k.find=function(g,h,l){var m,q;if(!g)return[];
for(var p=0,v=n.order.length;p<v;p++){var t=n.order[p];if(q=n.leftMatch[t].exec(g)){var y=q[1];q.splice(1,1);if(y.substr(y.length-1)!=="\\"){q[1]=(q[1]||"").replace(/\\/g,"");m=n.find[t](q,h,l);if(m!=null){g=g.replace(n.match[t],"");break}}}}m||(m=h.getElementsByTagName("*"));return{set:m,expr:g}};k.filter=function(g,h,l,m){for(var q=g,p=[],v=h,t,y,S=h&&h[0]&&x(h[0]);g&&h.length;){for(var H in n.filter)if((t=n.leftMatch[H].exec(g))!=null&&t[2]){var M=n.filter[H],I,D;D=t[1];y=false;t.splice(1,1);if(D.substr(D.length-
1)!=="\\"){if(v===p)p=[];if(n.preFilter[H])if(t=n.preFilter[H](t,v,l,p,m,S)){if(t===true)continue}else y=I=true;if(t)for(var U=0;(D=v[U])!=null;U++)if(D){I=M(D,t,U,v);var Ha=m^!!I;if(l&&I!=null)if(Ha)y=true;else v[U]=false;else if(Ha){p.push(D);y=true}}if(I!==w){l||(v=p);g=g.replace(n.match[H],"");if(!y)return[];break}}}if(g===q)if(y==null)k.error(g);else break;q=g}return v};k.error=function(g){throw"Syntax error, unrecognized expression: "+g;};var n=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,
CLASS:/\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(g){return g.getAttribute("href")}},
relative:{"+":function(g,h){var l=typeof h==="string",m=l&&!/\W/.test(h);l=l&&!m;if(m)h=h.toLowerCase();m=0;for(var q=g.length,p;m<q;m++)if(p=g[m]){for(;(p=p.previousSibling)&&p.nodeType!==1;);g[m]=l||p&&p.nodeName.toLowerCase()===h?p||false:p===h}l&&k.filter(h,g,true)},">":function(g,h){var l=typeof h==="string";if(l&&!/\W/.test(h)){h=h.toLowerCase();for(var m=0,q=g.length;m<q;m++){var p=g[m];if(p){l=p.parentNode;g[m]=l.nodeName.toLowerCase()===h?l:false}}}else{m=0;for(q=g.length;m<q;m++)if(p=g[m])g[m]=
l?p.parentNode:p.parentNode===h;l&&k.filter(h,g,true)}},"":function(g,h,l){var m=e++,q=d;if(typeof h==="string"&&!/\W/.test(h)){var p=h=h.toLowerCase();q=b}q("parentNode",h,m,g,p,l)},"~":function(g,h,l){var m=e++,q=d;if(typeof h==="string"&&!/\W/.test(h)){var p=h=h.toLowerCase();q=b}q("previousSibling",h,m,g,p,l)}},find:{ID:function(g,h,l){if(typeof h.getElementById!=="undefined"&&!l)return(g=h.getElementById(g[1]))?[g]:[]},NAME:function(g,h){if(typeof h.getElementsByName!=="undefined"){var l=[];
h=h.getElementsByName(g[1]);for(var m=0,q=h.length;m<q;m++)h[m].getAttribute("name")===g[1]&&l.push(h[m]);return l.length===0?null:l}},TAG:function(g,h){return h.getElementsByTagName(g[1])}},preFilter:{CLASS:function(g,h,l,m,q,p){g=" "+g[1].replace(/\\/g,"")+" ";if(p)return g;p=0;for(var v;(v=h[p])!=null;p++)if(v)if(q^(v.className&&(" "+v.className+" ").replace(/[\t\n]/g," ").indexOf(g)>=0))l||m.push(v);else if(l)h[p]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()},
CHILD:function(g){if(g[1]==="nth"){var h=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=h[1]+(h[2]||1)-0;g[3]=h[3]-0}g[0]=e++;return g},ATTR:function(g,h,l,m,q,p){h=g[1].replace(/\\/g,"");if(!p&&n.attrMap[h])g[1]=n.attrMap[h];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,h,l,m,q){if(g[1]==="not")if((f.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,h);else{g=k.filter(g[3],h,l,true^q);l||m.push.apply(m,
g);return false}else if(n.match.POS.test(g[0])||n.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,h,l){return!!k(l[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)},
text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}},
setFilters:{first:function(g,h){return h===0},last:function(g,h,l,m){return h===m.length-1},even:function(g,h){return h%2===0},odd:function(g,h){return h%2===1},lt:function(g,h,l){return h<l[3]-0},gt:function(g,h,l){return h>l[3]-0},nth:function(g,h,l){return l[3]-0===h},eq:function(g,h,l){return l[3]-0===h}},filter:{PSEUDO:function(g,h,l,m){var q=h[1],p=n.filters[q];if(p)return p(g,l,h,m);else if(q==="contains")return(g.textContent||g.innerText||a([g])||"").indexOf(h[3])>=0;else if(q==="not"){h=
h[3];l=0;for(m=h.length;l<m;l++)if(h[l]===g)return false;return true}else k.error("Syntax error, unrecognized expression: "+q)},CHILD:function(g,h){var l=h[1],m=g;switch(l){case "only":case "first":for(;m=m.previousSibling;)if(m.nodeType===1)return false;if(l==="first")return true;m=g;case "last":for(;m=m.nextSibling;)if(m.nodeType===1)return false;return true;case "nth":l=h[2];var q=h[3];if(l===1&&q===0)return true;h=h[0];var p=g.parentNode;if(p&&(p.sizcache!==h||!g.nodeIndex)){var v=0;for(m=p.firstChild;m;m=
m.nextSibling)if(m.nodeType===1)m.nodeIndex=++v;p.sizcache=h}g=g.nodeIndex-q;return l===0?g===0:g%l===0&&g/l>=0}},ID:function(g,h){return g.nodeType===1&&g.getAttribute("id")===h},TAG:function(g,h){return h==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===h},CLASS:function(g,h){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(h)>-1},ATTR:function(g,h){var l=h[1];g=n.attrHandle[l]?n.attrHandle[l](g):g[l]!=null?g[l]:g.getAttribute(l);l=g+"";var m=h[2];h=h[4];return g==null?m==="!=":m===
"="?l===h:m==="*="?l.indexOf(h)>=0:m==="~="?(" "+l+" ").indexOf(h)>=0:!h?l&&g!==false:m==="!="?l!==h:m==="^="?l.indexOf(h)===0:m==="$="?l.substr(l.length-h.length)===h:m==="|="?l===h||l.substr(0,h.length+1)===h+"-":false},POS:function(g,h,l,m){var q=n.setFilters[h[2]];if(q)return q(g,l,h,m)}}},r=n.match.POS;for(var u in n.match){n.match[u]=new RegExp(n.match[u].source+/(?![^\[]*\])(?![^\(]*\))/.source);n.leftMatch[u]=new RegExp(/(^(?:.|\r|\n)*?)/.source+n.match[u].source.replace(/\\(\d+)/g,function(g,
h){return"\\"+(h-0+1)}))}var z=function(g,h){g=Array.prototype.slice.call(g,0);if(h){h.push.apply(h,g);return h}return g};try{Array.prototype.slice.call(s.documentElement.childNodes,0)}catch(C){z=function(g,h){h=h||[];if(j.call(g)==="[object Array]")Array.prototype.push.apply(h,g);else if(typeof g.length==="number")for(var l=0,m=g.length;l<m;l++)h.push(g[l]);else for(l=0;g[l];l++)h.push(g[l]);return h}}var B;if(s.documentElement.compareDocumentPosition)B=function(g,h){if(!g.compareDocumentPosition||
!h.compareDocumentPosition){if(g==h)i=true;return g.compareDocumentPosition?-1:1}g=g.compareDocumentPosition(h)&4?-1:g===h?0:1;if(g===0)i=true;return g};else if("sourceIndex"in s.documentElement)B=function(g,h){if(!g.sourceIndex||!h.sourceIndex){if(g==h)i=true;return g.sourceIndex?-1:1}g=g.sourceIndex-h.sourceIndex;if(g===0)i=true;return g};else if(s.createRange)B=function(g,h){if(!g.ownerDocument||!h.ownerDocument){if(g==h)i=true;return g.ownerDocument?-1:1}var l=g.ownerDocument.createRange(),m=
h.ownerDocument.createRange();l.setStart(g,0);l.setEnd(g,0);m.setStart(h,0);m.setEnd(h,0);g=l.compareBoundaryPoints(Range.START_TO_END,m);if(g===0)i=true;return g};(function(){var g=s.createElement("div"),h="script"+(new Date).getTime();g.innerHTML="<a name='"+h+"'/>";var l=s.documentElement;l.insertBefore(g,l.firstChild);if(s.getElementById(h)){n.find.ID=function(m,q,p){if(typeof q.getElementById!=="undefined"&&!p)return(q=q.getElementById(m[1]))?q.id===m[1]||typeof q.getAttributeNode!=="undefined"&&
q.getAttributeNode("id").nodeValue===m[1]?[q]:w:[]};n.filter.ID=function(m,q){var p=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&p&&p.nodeValue===q}}l.removeChild(g);l=g=null})();(function(){var g=s.createElement("div");g.appendChild(s.createComment(""));if(g.getElementsByTagName("*").length>0)n.find.TAG=function(h,l){l=l.getElementsByTagName(h[1]);if(h[1]==="*"){h=[];for(var m=0;l[m];m++)l[m].nodeType===1&&h.push(l[m]);l=h}return l};g.innerHTML="<a href='#'></a>";
if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")n.attrHandle.href=function(h){return h.getAttribute("href",2)};g=null})();s.querySelectorAll&&function(){var g=k,h=s.createElement("div");h.innerHTML="<p class='TEST'></p>";if(!(h.querySelectorAll&&h.querySelectorAll(".TEST").length===0)){k=function(m,q,p,v){q=q||s;if(!v&&q.nodeType===9&&!x(q))try{return z(q.querySelectorAll(m),p)}catch(t){}return g(m,q,p,v)};for(var l in g)k[l]=g[l];h=null}}();
(function(){var g=s.createElement("div");g.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){n.order.splice(1,0,"CLASS");n.find.CLASS=function(h,l,m){if(typeof l.getElementsByClassName!=="undefined"&&!m)return l.getElementsByClassName(h[1])};g=null}}})();var E=s.compareDocumentPosition?function(g,h){return!!(g.compareDocumentPosition(h)&16)}:
function(g,h){return g!==h&&(g.contains?g.contains(h):true)},x=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false},ga=function(g,h){var l=[],m="",q;for(h=h.nodeType?[h]:h;q=n.match.PSEUDO.exec(g);){m+=q[0];g=g.replace(n.match.PSEUDO,"")}g=n.relative[g]?g+"*":g;q=0;for(var p=h.length;q<p;q++)k(g,h[q],l);return k.filter(m,l)};c.find=k;c.expr=k.selectors;c.expr[":"]=c.expr.filters;c.unique=k.uniqueSort;c.text=a;c.isXMLDoc=x;c.contains=E})();var eb=/Until$/,fb=/^(?:parents|prevUntil|prevAll)/,
gb=/,/;R=Array.prototype.slice;var Ia=function(a,b,d){if(c.isFunction(b))return c.grep(a,function(e,j){return!!b.call(e,j,e)===d});else if(b.nodeType)return c.grep(a,function(e){return e===b===d});else if(typeof b==="string"){var f=c.grep(a,function(e){return e.nodeType===1});if(Ua.test(b))return c.filter(b,f,!d);else b=c.filter(b,f)}return c.grep(a,function(e){return c.inArray(e,b)>=0===d})};c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,f=0,e=this.length;f<e;f++){d=b.length;
c.find(a,this[f],b);if(f>0)for(var j=d;j<b.length;j++)for(var i=0;i<d;i++)if(b[i]===b[j]){b.splice(j--,1);break}}return b},has:function(a){var b=c(a);return this.filter(function(){for(var d=0,f=b.length;d<f;d++)if(c.contains(this,b[d]))return true})},not:function(a){return this.pushStack(Ia(this,a,false),"not",a)},filter:function(a){return this.pushStack(Ia(this,a,true),"filter",a)},is:function(a){return!!a&&c.filter(a,this).length>0},closest:function(a,b){if(c.isArray(a)){var d=[],f=this[0],e,j=
{},i;if(f&&a.length){e=0;for(var o=a.length;e<o;e++){i=a[e];j[i]||(j[i]=c.expr.match.POS.test(i)?c(i,b||this.context):i)}for(;f&&f.ownerDocument&&f!==b;){for(i in j){e=j[i];if(e.jquery?e.index(f)>-1:c(f).is(e)){d.push({selector:i,elem:f});delete j[i]}}f=f.parentNode}}return d}var k=c.expr.match.POS.test(a)?c(a,b||this.context):null;return this.map(function(n,r){for(;r&&r.ownerDocument&&r!==b;){if(k?k.index(r)>-1:c(r).is(a))return r;r=r.parentNode}return null})},index:function(a){if(!a||typeof a===
"string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){a=typeof a==="string"?c(a,b||this.context):c.makeArray(a);b=c.merge(this.get(),a);return this.pushStack(qa(a[0])||qa(b[0])?b:c.unique(b))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode",
d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")?
a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(d,f){var e=c.map(this,b,d);eb.test(a)||(f=d);if(f&&typeof f==="string")e=c.filter(f,e);e=this.length>1?c.unique(e):e;if((this.length>1||gb.test(f))&&fb.test(a))e=e.reverse();return this.pushStack(e,a,R.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return c.find.matches(a,b)},dir:function(a,b,d){var f=[];for(a=a[b];a&&a.nodeType!==9&&(d===w||a.nodeType!==1||!c(a).is(d));){a.nodeType===
1&&f.push(a);a=a[b]}return f},nth:function(a,b,d){b=b||1;for(var f=0;a;a=a[d])if(a.nodeType===1&&++f===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var Ja=/ jQuery\d+="(?:\d+|null)"/g,V=/^\s+/,Ka=/(<([\w:]+)[^>]*?)\/>/g,hb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,La=/<([\w:]+)/,ib=/<tbody/i,jb=/<|&#?\w+;/,ta=/<script|<object|<embed|<option|<style/i,ua=/checked\s*(?:[^=]|=\s*.checked.)/i,Ma=function(a,b,d){return hb.test(d)?
a:b+"></"+d+">"},F={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};F.optgroup=F.option;F.tbody=F.tfoot=F.colgroup=F.caption=F.thead;F.th=F.td;if(!c.support.htmlSerialize)F._default=[1,"div<div>","</div>"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d=
c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==w)return this.empty().append((this[0]&&this[0].ownerDocument||s).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this},
wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})},
prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,
this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,f;(f=this[d])!=null;d++)if(!a||c.filter(a,[f]).length){if(!b&&f.nodeType===1){c.cleanData(f.getElementsByTagName("*"));c.cleanData([f])}f.parentNode&&f.parentNode.removeChild(f)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild);
return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,f=this.ownerDocument;if(!d){d=f.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(Ja,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(V,"")],f)[0]}else return this.cloneNode(true)});if(a===true){ra(this,b);ra(this.find("*"),b.find("*"))}return b},html:function(a){if(a===w)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Ja,
""):null;else if(typeof a==="string"&&!ta.test(a)&&(c.support.leadingWhitespace||!V.test(a))&&!F[(La.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Ka,Ma);try{for(var b=0,d=this.length;b<d;b++)if(this[b].nodeType===1){c.cleanData(this[b].getElementsByTagName("*"));this[b].innerHTML=a}}catch(f){this.empty().append(a)}}else c.isFunction(a)?this.each(function(e){var j=c(this),i=j.html();j.empty().append(function(){return a.call(this,e,i)})}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&
this[0].parentNode){if(c.isFunction(a))return this.each(function(b){var d=c(this),f=d.html();d.replaceWith(a.call(this,b,f))});if(typeof a!=="string")a=c(a).detach();return this.each(function(){var b=this.nextSibling,d=this.parentNode;c(this).remove();b?c(b).before(a):c(d).append(a)})}else return this.pushStack(c(c.isFunction(a)?a():a),"replaceWith",a)},detach:function(a){return this.remove(a,true)},domManip:function(a,b,d){function f(u){return c.nodeName(u,"table")?u.getElementsByTagName("tbody")[0]||
u.appendChild(u.ownerDocument.createElement("tbody")):u}var e,j,i=a[0],o=[],k;if(!c.support.checkClone&&arguments.length===3&&typeof i==="string"&&ua.test(i))return this.each(function(){c(this).domManip(a,b,d,true)});if(c.isFunction(i))return this.each(function(u){var z=c(this);a[0]=i.call(this,u,b?z.html():w);z.domManip(a,b,d)});if(this[0]){e=i&&i.parentNode;e=c.support.parentNode&&e&&e.nodeType===11&&e.childNodes.length===this.length?{fragment:e}:sa(a,this,o);k=e.fragment;if(j=k.childNodes.length===
1?(k=k.firstChild):k.firstChild){b=b&&c.nodeName(j,"tr");for(var n=0,r=this.length;n<r;n++)d.call(b?f(this[n],j):this[n],n>0||e.cacheable||this.length>1?k.cloneNode(true):k)}o.length&&c.each(o,Qa)}return this}});c.fragments={};c.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var f=[];d=c(d);var e=this.length===1&&this[0].parentNode;if(e&&e.nodeType===11&&e.childNodes.length===1&&d.length===1){d[b](this[0]);
return this}else{e=0;for(var j=d.length;e<j;e++){var i=(e>0?this.clone(true):this).get();c.fn[b].apply(c(d[e]),i);f=f.concat(i)}return this.pushStack(f,a,d.selector)}}});c.extend({clean:function(a,b,d,f){b=b||s;if(typeof b.createElement==="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||s;for(var e=[],j=0,i;(i=a[j])!=null;j++){if(typeof i==="number")i+="";if(i){if(typeof i==="string"&&!jb.test(i))i=b.createTextNode(i);else if(typeof i==="string"){i=i.replace(Ka,Ma);var o=(La.exec(i)||["",
""])[1].toLowerCase(),k=F[o]||F._default,n=k[0],r=b.createElement("div");for(r.innerHTML=k[1]+i+k[2];n--;)r=r.lastChild;if(!c.support.tbody){n=ib.test(i);o=o==="table"&&!n?r.firstChild&&r.firstChild.childNodes:k[1]==="<table>"&&!n?r.childNodes:[];for(k=o.length-1;k>=0;--k)c.nodeName(o[k],"tbody")&&!o[k].childNodes.length&&o[k].parentNode.removeChild(o[k])}!c.support.leadingWhitespace&&V.test(i)&&r.insertBefore(b.createTextNode(V.exec(i)[0]),r.firstChild);i=r.childNodes}if(i.nodeType)e.push(i);else e=
c.merge(e,i)}}if(d)for(j=0;e[j];j++)if(f&&c.nodeName(e[j],"script")&&(!e[j].type||e[j].type.toLowerCase()==="text/javascript"))f.push(e[j].parentNode?e[j].parentNode.removeChild(e[j]):e[j]);else{e[j].nodeType===1&&e.splice.apply(e,[j+1,0].concat(c.makeArray(e[j].getElementsByTagName("script"))));d.appendChild(e[j])}return e},cleanData:function(a){for(var b,d,f=c.cache,e=c.event.special,j=c.support.deleteExpando,i=0,o;(o=a[i])!=null;i++)if(d=o[c.expando]){b=f[d];if(b.events)for(var k in b.events)e[k]?
c.event.remove(o,k):Ca(o,k,b.handle);if(j)delete o[c.expando];else o.removeAttribute&&o.removeAttribute(c.expando);delete f[d]}}});var kb=/z-?index|font-?weight|opacity|zoom|line-?height/i,Na=/alpha\([^)]*\)/,Oa=/opacity=([^)]*)/,ha=/float/i,ia=/-([a-z])/ig,lb=/([A-Z])/g,mb=/^-?\d+(?:px)?$/i,nb=/^-?\d/,ob={position:"absolute",visibility:"hidden",display:"block"},pb=["Left","Right"],qb=["Top","Bottom"],rb=s.defaultView&&s.defaultView.getComputedStyle,Pa=c.support.cssFloat?"cssFloat":"styleFloat",ja=
function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){return X(this,a,b,true,function(d,f,e){if(e===w)return c.curCSS(d,f);if(typeof e==="number"&&!kb.test(f))e+="px";c.style(d,f,e)})};c.extend({style:function(a,b,d){if(!a||a.nodeType===3||a.nodeType===8)return w;if((b==="width"||b==="height")&&parseFloat(d)<0)d=w;var f=a.style||a,e=d!==w;if(!c.support.opacity&&b==="opacity"){if(e){f.zoom=1;b=parseInt(d,10)+""==="NaN"?"":"alpha(opacity="+d*100+")";a=f.filter||c.curCSS(a,"filter")||"";f.filter=
Na.test(a)?a.replace(Na,b):b}return f.filter&&f.filter.indexOf("opacity=")>=0?parseFloat(Oa.exec(f.filter)[1])/100+"":""}if(ha.test(b))b=Pa;b=b.replace(ia,ja);if(e)f[b]=d;return f[b]},css:function(a,b,d,f){if(b==="width"||b==="height"){var e,j=b==="width"?pb:qb;function i(){e=b==="width"?a.offsetWidth:a.offsetHeight;f!=="border"&&c.each(j,function(){f||(e-=parseFloat(c.curCSS(a,"padding"+this,true))||0);if(f==="margin")e+=parseFloat(c.curCSS(a,"margin"+this,true))||0;else e-=parseFloat(c.curCSS(a,
"border"+this+"Width",true))||0})}a.offsetWidth!==0?i():c.swap(a,ob,i);return Math.max(0,Math.round(e))}return c.curCSS(a,b,d)},curCSS:function(a,b,d){var f,e=a.style;if(!c.support.opacity&&b==="opacity"&&a.currentStyle){f=Oa.test(a.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return f===""?"1":f}if(ha.test(b))b=Pa;if(!d&&e&&e[b])f=e[b];else if(rb){if(ha.test(b))b="float";b=b.replace(lb,"-$1").toLowerCase();e=a.ownerDocument.defaultView;if(!e)return null;if(a=e.getComputedStyle(a,null))f=
a.getPropertyValue(b);if(b==="opacity"&&f==="")f="1"}else if(a.currentStyle){d=b.replace(ia,ja);f=a.currentStyle[b]||a.currentStyle[d];if(!mb.test(f)&&nb.test(f)){b=e.left;var j=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;e.left=d==="fontSize"?"1em":f||0;f=e.pixelLeft+"px";e.left=b;a.runtimeStyle.left=j}}return f},swap:function(a,b,d){var f={};for(var e in b){f[e]=a.style[e];a.style[e]=b[e]}d.call(a);for(e in b)a.style[e]=f[e]}});if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b=
a.offsetWidth,d=a.offsetHeight,f=a.nodeName.toLowerCase()==="tr";return b===0&&d===0&&!f?true:b>0&&d>0&&!f?false:c.curCSS(a,"display")==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var sb=J(),tb=/<script(.|\s)*?\/script>/gi,ub=/select|textarea/i,vb=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,N=/=\?(&|$)/,ka=/\?/,wb=/(\?|&)_=.*?(&|$)/,xb=/^(\w+:)?\/\/([^\/?#]+)/,yb=/%20/g,zb=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!==
"string")return zb.call(this,a);else if(!this.length)return this;var f=a.indexOf(" ");if(f>=0){var e=a.slice(f,a.length);a=a.slice(0,f)}f="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b==="object"){b=c.param(b,c.ajaxSettings.traditional);f="POST"}var j=this;c.ajax({url:a,type:f,dataType:"html",data:b,complete:function(i,o){if(o==="success"||o==="notmodified")j.html(e?c("<div />").append(i.responseText.replace(tb,"")).find(e):i.responseText);d&&j.each(d,[i.responseText,o,i])}});return this},
serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ub.test(this.nodeName)||vb.test(this.type))}).map(function(a,b){a=c(this).val();return a==null?null:c.isArray(a)?c.map(a,function(d){return{name:b.name,value:d}}):{name:b.name,value:a}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),
function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:f})},getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:f})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href,
global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:A.XMLHttpRequest&&(A.location.protocol!=="file:"||!A.ActiveXObject)?function(){return new A.XMLHttpRequest}:function(){try{return new A.ActiveXObject("Microsoft.XMLHTTP")}catch(a){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(a){function b(){e.success&&
e.success.call(k,o,i,x);e.global&&f("ajaxSuccess",[x,e])}function d(){e.complete&&e.complete.call(k,x,i);e.global&&f("ajaxComplete",[x,e]);e.global&&!--c.active&&c.event.trigger("ajaxStop")}function f(q,p){(e.context?c(e.context):c.event).trigger(q,p)}var e=c.extend(true,{},c.ajaxSettings,a),j,i,o,k=a&&a.context||e,n=e.type.toUpperCase();if(e.data&&e.processData&&typeof e.data!=="string")e.data=c.param(e.data,e.traditional);if(e.dataType==="jsonp"){if(n==="GET")N.test(e.url)||(e.url+=(ka.test(e.url)?
"&":"?")+(e.jsonp||"callback")+"=?");else if(!e.data||!N.test(e.data))e.data=(e.data?e.data+"&":"")+(e.jsonp||"callback")+"=?";e.dataType="json"}if(e.dataType==="json"&&(e.data&&N.test(e.data)||N.test(e.url))){j=e.jsonpCallback||"jsonp"+sb++;if(e.data)e.data=(e.data+"").replace(N,"="+j+"$1");e.url=e.url.replace(N,"="+j+"$1");e.dataType="script";A[j]=A[j]||function(q){o=q;b();d();A[j]=w;try{delete A[j]}catch(p){}z&&z.removeChild(C)}}if(e.dataType==="script"&&e.cache===null)e.cache=false;if(e.cache===
false&&n==="GET"){var r=J(),u=e.url.replace(wb,"$1_="+r+"$2");e.url=u+(u===e.url?(ka.test(e.url)?"&":"?")+"_="+r:"")}if(e.data&&n==="GET")e.url+=(ka.test(e.url)?"&":"?")+e.data;e.global&&!c.active++&&c.event.trigger("ajaxStart");r=(r=xb.exec(e.url))&&(r[1]&&r[1]!==location.protocol||r[2]!==location.host);if(e.dataType==="script"&&n==="GET"&&r){var z=s.getElementsByTagName("head")[0]||s.documentElement,C=s.createElement("script");C.src=e.url;if(e.scriptCharset)C.charset=e.scriptCharset;if(!j){var B=
false;C.onload=C.onreadystatechange=function(){if(!B&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){B=true;b();d();C.onload=C.onreadystatechange=null;z&&C.parentNode&&z.removeChild(C)}}}z.insertBefore(C,z.firstChild);return w}var E=false,x=e.xhr();if(x){e.username?x.open(n,e.url,e.async,e.username,e.password):x.open(n,e.url,e.async);try{if(e.data||a&&a.contentType)x.setRequestHeader("Content-Type",e.contentType);if(e.ifModified){c.lastModified[e.url]&&x.setRequestHeader("If-Modified-Since",
c.lastModified[e.url]);c.etag[e.url]&&x.setRequestHeader("If-None-Match",c.etag[e.url])}r||x.setRequestHeader("X-Requested-With","XMLHttpRequest");x.setRequestHeader("Accept",e.dataType&&e.accepts[e.dataType]?e.accepts[e.dataType]+", */*":e.accepts._default)}catch(ga){}if(e.beforeSend&&e.beforeSend.call(k,x,e)===false){e.global&&!--c.active&&c.event.trigger("ajaxStop");x.abort();return false}e.global&&f("ajaxSend",[x,e]);var g=x.onreadystatechange=function(q){if(!x||x.readyState===0||q==="abort"){E||
d();E=true;if(x)x.onreadystatechange=c.noop}else if(!E&&x&&(x.readyState===4||q==="timeout")){E=true;x.onreadystatechange=c.noop;i=q==="timeout"?"timeout":!c.httpSuccess(x)?"error":e.ifModified&&c.httpNotModified(x,e.url)?"notmodified":"success";var p;if(i==="success")try{o=c.httpData(x,e.dataType,e)}catch(v){i="parsererror";p=v}if(i==="success"||i==="notmodified")j||b();else c.handleError(e,x,i,p);d();q==="timeout"&&x.abort();if(e.async)x=null}};try{var h=x.abort;x.abort=function(){x&&h.call(x);
g("abort")}}catch(l){}e.async&&e.timeout>0&&setTimeout(function(){x&&!E&&g("timeout")},e.timeout);try{x.send(n==="POST"||n==="PUT"||n==="DELETE"?e.data:null)}catch(m){c.handleError(e,x,null,m);d()}e.async||g();return x}},handleError:function(a,b,d,f){if(a.error)a.error.call(a.context||a,b,d,f);if(a.global)(a.context?c(a.context):c.event).trigger("ajaxError",[b,a,f])},active:0,httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status===
1223||a.status===0}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),f=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(f)c.etag[b]=f;return a.status===304||a.status===0},httpData:function(a,b,d){var f=a.getResponseHeader("content-type")||"",e=b==="xml"||!b&&f.indexOf("xml")>=0;a=e?a.responseXML:a.responseText;e&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b===
"json"||!b&&f.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&f.indexOf("javascript")>=0)c.globalEval(a);return a},param:function(a,b){function d(i,o){if(c.isArray(o))c.each(o,function(k,n){b||/\[\]$/.test(i)?f(i,n):d(i+"["+(typeof n==="object"||c.isArray(n)?k:"")+"]",n)});else!b&&o!=null&&typeof o==="object"?c.each(o,function(k,n){d(i+"["+k+"]",n)}):f(i,o)}function f(i,o){o=c.isFunction(o)?o():o;e[e.length]=encodeURIComponent(i)+"="+encodeURIComponent(o)}var e=[];if(b===w)b=c.ajaxSettings.traditional;
if(c.isArray(a)||a.jquery)c.each(a,function(){f(this.name,this.value)});else for(var j in a)d(j,a[j]);return e.join("&").replace(yb,"+")}});var la={},Ab=/toggle|show|hide/,Bb=/^([+-]=)?([\d+-.]+)(.*)$/,W,va=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b){if(a||a===0)return this.animate(K("show",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay");
this[a].style.display=d||"";if(c.css(this[a],"display")==="none"){d=this[a].nodeName;var f;if(la[d])f=la[d];else{var e=c("<"+d+" />").appendTo("body");f=e.css("display");if(f==="none")f="block";e.remove();la[d]=f}c.data(this[a],"olddisplay",f)}}a=0;for(b=this.length;a<b;a++)this[a].style.display=c.data(this[a],"olddisplay")||"";return this}},hide:function(a,b){if(a||a===0)return this.animate(K("hide",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay");!d&&d!=="none"&&c.data(this[a],
"olddisplay",c.css(this[a],"display"))}a=0;for(b=this.length;a<b;a++)this[a].style.display="none";return this}},_toggle:c.fn.toggle,toggle:function(a,b){var d=typeof a==="boolean";if(c.isFunction(a)&&c.isFunction(b))this._toggle.apply(this,arguments);else a==null||d?this.each(function(){var f=d?a:c(this).is(":hidden");c(this)[f?"show":"hide"]()}):this.animate(K("toggle",3),a,b);return this},fadeTo:function(a,b,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,d)},
animate:function(a,b,d,f){var e=c.speed(b,d,f);if(c.isEmptyObject(a))return this.each(e.complete);return this[e.queue===false?"each":"queue"](function(){var j=c.extend({},e),i,o=this.nodeType===1&&c(this).is(":hidden"),k=this;for(i in a){var n=i.replace(ia,ja);if(i!==n){a[n]=a[i];delete a[i];i=n}if(a[i]==="hide"&&o||a[i]==="show"&&!o)return j.complete.call(this);if((i==="height"||i==="width")&&this.style){j.display=c.css(this,"display");j.overflow=this.style.overflow}if(c.isArray(a[i])){(j.specialEasing=
j.specialEasing||{})[i]=a[i][1];a[i]=a[i][0]}}if(j.overflow!=null)this.style.overflow="hidden";j.curAnim=c.extend({},a);c.each(a,function(r,u){var z=new c.fx(k,j,r);if(Ab.test(u))z[u==="toggle"?o?"show":"hide":u](a);else{var C=Bb.exec(u),B=z.cur(true)||0;if(C){u=parseFloat(C[2]);var E=C[3]||"px";if(E!=="px"){k.style[r]=(u||1)+E;B=(u||1)/z.cur(true)*B;k.style[r]=B+E}if(C[1])u=(C[1]==="-="?-1:1)*u+B;z.custom(B,u,E)}else z.custom(B,u,"")}});return true})},stop:function(a,b){var d=c.timers;a&&this.queue([]);
this.each(function(){for(var f=d.length-1;f>=0;f--)if(d[f].elem===this){b&&d[f](true);d.splice(f,1)}});b||this.dequeue();return this}});c.each({slideDown:K("show",1),slideUp:K("hide",1),slideToggle:K("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(a,b){c.fn[a]=function(d,f){return this.animate(b,d,f)}});c.extend({speed:function(a,b,d){var f=a&&typeof a==="object"?a:{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};f.duration=c.fx.off?0:typeof f.duration===
"number"?f.duration:c.fx.speeds[f.duration]||c.fx.speeds._default;f.old=f.complete;f.complete=function(){f.queue!==false&&c(this).dequeue();c.isFunction(f.old)&&f.old.call(this)};return f},easing:{linear:function(a,b,d,f){return d+f*a},swing:function(a,b,d,f){return(-Math.cos(a*Math.PI)/2+0.5)*f+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]||
c.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style)this.elem.style.display="block"},cur:function(a){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];return(a=parseFloat(c.css(this.elem,this.prop,a)))&&a>-10000?a:parseFloat(c.curCSS(this.elem,this.prop))||0},custom:function(a,b,d){function f(j){return e.step(j)}this.startTime=J();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start;
this.pos=this.state=0;var e=this;f.elem=this.elem;if(f()&&c.timers.push(f)&&!W)W=setInterval(c.fx.tick,13)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(a){var b=J(),d=true;if(a||b>=this.options.duration+this.startTime){this.now=
this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var f in this.options.curAnim)if(this.options.curAnim[f]!==true)d=false;if(d){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;a=c.data(this.elem,"olddisplay");this.elem.style.display=a?a:this.options.display;if(c.css(this.elem,"display")==="none")this.elem.style.display="block"}this.options.hide&&c(this.elem).hide();if(this.options.hide||this.options.show)for(var e in this.options.curAnim)c.style(this.elem,
e,this.options.orig[e]);this.options.complete.call(this.elem)}return false}else{e=b-this.startTime;this.state=e/this.options.duration;a=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||a](this.state,e,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a=c.timers,b=0;b<a.length;b++)a[b]()||a.splice(b--,1);a.length||
c.fx.stop()},stop:function(){clearInterval(W);W=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){c.style(a.elem,"opacity",a.now)},_default:function(a){if(a.elem.style&&a.elem.style[a.prop]!=null)a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit;else a.elem[a.prop]=a.now}}});if(c.expr&&c.expr.filters)c.expr.filters.animated=function(a){return c.grep(c.timers,function(b){return a===b.elem}).length};c.fn.offset="getBoundingClientRect"in s.documentElement?
function(a){var b=this[0];if(a)return this.each(function(e){c.offset.setOffset(this,a,e)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);var d=b.getBoundingClientRect(),f=b.ownerDocument;b=f.body;f=f.documentElement;return{top:d.top+(self.pageYOffset||c.support.boxModel&&f.scrollTop||b.scrollTop)-(f.clientTop||b.clientTop||0),left:d.left+(self.pageXOffset||c.support.boxModel&&f.scrollLeft||b.scrollLeft)-(f.clientLeft||b.clientLeft||0)}}:function(a){var b=
this[0];if(a)return this.each(function(r){c.offset.setOffset(this,a,r)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);c.offset.initialize();var d=b.offsetParent,f=b,e=b.ownerDocument,j,i=e.documentElement,o=e.body;f=(e=e.defaultView)?e.getComputedStyle(b,null):b.currentStyle;for(var k=b.offsetTop,n=b.offsetLeft;(b=b.parentNode)&&b!==o&&b!==i;){if(c.offset.supportsFixedPosition&&f.position==="fixed")break;j=e?e.getComputedStyle(b,null):b.currentStyle;
k-=b.scrollTop;n-=b.scrollLeft;if(b===d){k+=b.offsetTop;n+=b.offsetLeft;if(c.offset.doesNotAddBorder&&!(c.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(b.nodeName))){k+=parseFloat(j.borderTopWidth)||0;n+=parseFloat(j.borderLeftWidth)||0}f=d;d=b.offsetParent}if(c.offset.subtractsBorderForOverflowNotVisible&&j.overflow!=="visible"){k+=parseFloat(j.borderTopWidth)||0;n+=parseFloat(j.borderLeftWidth)||0}f=j}if(f.position==="relative"||f.position==="static"){k+=o.offsetTop;n+=o.offsetLeft}if(c.offset.supportsFixedPosition&&
f.position==="fixed"){k+=Math.max(i.scrollTop,o.scrollTop);n+=Math.max(i.scrollLeft,o.scrollLeft)}return{top:k,left:n}};c.offset={initialize:function(){var a=s.body,b=s.createElement("div"),d,f,e,j=parseFloat(c.curCSS(a,"marginTop",true))||0;c.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"});b.innerHTML="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";
a.insertBefore(b,a.firstChild);d=b.firstChild;f=d.firstChild;e=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=f.offsetTop!==5;this.doesAddBorderForTableAndCells=e.offsetTop===5;f.style.position="fixed";f.style.top="20px";this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15;f.style.position=f.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==j;a.removeChild(b);
c.offset.initialize=c.noop},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.curCSS(a,"marginTop",true))||0;d+=parseFloat(c.curCSS(a,"marginLeft",true))||0}return{top:b,left:d}},setOffset:function(a,b,d){if(/static/.test(c.curCSS(a,"position")))a.style.position="relative";var f=c(a),e=f.offset(),j=parseInt(c.curCSS(a,"top",true),10)||0,i=parseInt(c.curCSS(a,"left",true),10)||0;if(c.isFunction(b))b=b.call(a,
d,e);d={top:b.top-e.top+j,left:b.left-e.left+i};"using"in b?b.using.call(a,d):f.css(d)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),f=/^body|html$/i.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.curCSS(a,"marginTop",true))||0;d.left-=parseFloat(c.curCSS(a,"marginLeft",true))||0;f.top+=parseFloat(c.curCSS(b[0],"borderTopWidth",true))||0;f.left+=parseFloat(c.curCSS(b[0],"borderLeftWidth",true))||0;return{top:d.top-
f.top,left:d.left-f.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||s.body;a&&!/^body|html$/i.test(a.nodeName)&&c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(f){var e=this[0],j;if(!e)return null;if(f!==w)return this.each(function(){if(j=wa(this))j.scrollTo(!a?f:c(j).scrollLeft(),a?f:c(j).scrollTop());else this[d]=f});else return(j=wa(e))?"pageXOffset"in j?j[a?"pageYOffset":
"pageXOffset"]:c.support.boxModel&&j.document.documentElement[d]||j.document.body[d]:e[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();c.fn["inner"+b]=function(){return this[0]?c.css(this[0],d,false,"padding"):null};c.fn["outer"+b]=function(f){return this[0]?c.css(this[0],d,false,f?"margin":"border"):null};c.fn[d]=function(f){var e=this[0];if(!e)return f==null?null:this;if(c.isFunction(f))return this.each(function(j){var i=c(this);i[d](f.call(this,j,i[d]()))});return"scrollTo"in
e&&e.document?e.document.compatMode==="CSS1Compat"&&e.document.documentElement["client"+b]||e.document.body["client"+b]:e.nodeType===9?Math.max(e.documentElement["client"+b],e.body["scroll"+b],e.documentElement["scroll"+b],e.body["offset"+b],e.documentElement["offset"+b]):f===w?c.css(e,d):this.css(d,typeof f==="string"?f:f+"px")}});A.jQuery=A.$=c})(window);/*!
 * jQuery UI 1.8.10
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI
 */
(function(c,j){function k(a){return!c(a).parents().andSelf().filter(function(){return c.curCSS(this,"visibility")==="hidden"||c.expr.filters.hidden(this)}).length}c.ui=c.ui||{};if(!c.ui.version){c.extend(c.ui,{version:"1.8.10",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,
NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});c.fn.extend({_focus:c.fn.focus,focus:function(a,b){return typeof a==="number"?this.each(function(){var d=this;setTimeout(function(){c(d).focus();b&&b.call(d)},a)}):this._focus.apply(this,arguments)},scrollParent:function(){var a;a=c.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(c.curCSS(this,
"position",1))&&/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!a.length?c(document):a},zIndex:function(a){if(a!==j)return this.css("zIndex",a);if(this.length){a=c(this[0]);for(var b;a.length&&a[0]!==document;){b=a.css("position");
if(b==="absolute"||b==="relative"||b==="fixed"){b=parseInt(a.css("zIndex"),10);if(!isNaN(b)&&b!==0)return b}a=a.parent()}}return 0},disableSelection:function(){return this.bind((c.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});c.each(["Width","Height"],function(a,b){function d(f,g,l,m){c.each(e,function(){g-=parseFloat(c.curCSS(f,"padding"+this,true))||0;if(l)g-=parseFloat(c.curCSS(f,
"border"+this+"Width",true))||0;if(m)g-=parseFloat(c.curCSS(f,"margin"+this,true))||0});return g}var e=b==="Width"?["Left","Right"]:["Top","Bottom"],h=b.toLowerCase(),i={innerWidth:c.fn.innerWidth,innerHeight:c.fn.innerHeight,outerWidth:c.fn.outerWidth,outerHeight:c.fn.outerHeight};c.fn["inner"+b]=function(f){if(f===j)return i["inner"+b].call(this);return this.each(function(){c(this).css(h,d(this,f)+"px")})};c.fn["outer"+b]=function(f,g){if(typeof f!=="number")return i["outer"+b].call(this,f);return this.each(function(){c(this).css(h,
d(this,f,true,g)+"px")})}});c.extend(c.expr[":"],{data:function(a,b,d){return!!c.data(a,d[3])},focusable:function(a){var b=a.nodeName.toLowerCase(),d=c.attr(a,"tabindex");if("area"===b){b=a.parentNode;d=b.name;if(!a.href||!d||b.nodeName.toLowerCase()!=="map")return false;a=c("img[usemap=#"+d+"]")[0];return!!a&&k(a)}return(/input|select|textarea|button|object/.test(b)?!a.disabled:"a"==b?a.href||!isNaN(d):!isNaN(d))&&k(a)},tabbable:function(a){var b=c.attr(a,"tabindex");return(isNaN(b)||b>=0)&&c(a).is(":focusable")}});
c(function(){var a=document.body,b=a.appendChild(b=document.createElement("div"));c.extend(b.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});c.support.minHeight=b.offsetHeight===100;c.support.selectstart="onselectstart"in b;a.removeChild(b).style.display="none"});c.extend(c.ui,{plugin:{add:function(a,b,d){a=c.ui[a].prototype;for(var e in d){a.plugins[e]=a.plugins[e]||[];a.plugins[e].push([b,d[e]])}},call:function(a,b,d){if((b=a.plugins[b])&&a.element[0].parentNode)for(var e=0;e<b.length;e++)a.options[b[e][0]]&&
b[e][1].apply(a.element,d)}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b)},hasScroll:function(a,b){if(c(a).css("overflow")==="hidden")return false;b=b&&b==="left"?"scrollLeft":"scrollTop";var d=false;if(a[b]>0)return true;a[b]=1;d=a[b]>0;a[b]=0;return d},isOverAxis:function(a,b,d){return a>b&&a<b+d},isOver:function(a,b,d,e,h,i){return c.ui.isOverAxis(a,d,h)&&c.ui.isOverAxis(b,e,i)}})}})(jQuery);
;/*!
 * jQuery UI Widget 1.8.10
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Widget
 */
(function(b,j){if(b.cleanData){var k=b.cleanData;b.cleanData=function(a){for(var c=0,d;(d=a[c])!=null;c++)b(d).triggerHandler("remove");k(a)}}else{var l=b.fn.remove;b.fn.remove=function(a,c){return this.each(function(){if(!c)if(!a||b.filter(a,[this]).length)b("*",this).add([this]).each(function(){b(this).triggerHandler("remove")});return l.call(b(this),a,c)})}}b.widget=function(a,c,d){var e=a.split(".")[0],f;a=a.split(".")[1];f=e+"-"+a;if(!d){d=c;c=b.Widget}b.expr[":"][f]=function(h){return!!b.data(h,
a)};b[e]=b[e]||{};b[e][a]=function(h,g){arguments.length&&this._createWidget(h,g)};c=new c;c.options=b.extend(true,{},c.options);b[e][a].prototype=b.extend(true,c,{namespace:e,widgetName:a,widgetEventPrefix:b[e][a].prototype.widgetEventPrefix||a,widgetBaseClass:f},d);b.widget.bridge(a,b[e][a])};b.widget.bridge=function(a,c){b.fn[a]=function(d){var e=typeof d==="string",f=Array.prototype.slice.call(arguments,1),h=this;d=!e&&f.length?b.extend.apply(null,[true,d].concat(f)):d;if(e&&d.charAt(0)==="_")return h;
e?this.each(function(){var g=b.data(this,a),i=g&&b.isFunction(g[d])?g[d].apply(g,f):g;if(i!==g&&i!==j){h=i;return false}}):this.each(function(){var g=b.data(this,a);g?g.option(d||{})._init():b.data(this,a,new c(d,this))});return h}};b.Widget=function(a,c){arguments.length&&this._createWidget(a,c)};b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(a,c){b.data(c,this.widgetName,this);this.element=b(c);this.options=b.extend(true,{},this.options,
this._getCreateOptions(),a);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){return b.metadata&&b.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},
widget:function(){return this.element},option:function(a,c){var d=a;if(arguments.length===0)return b.extend({},this.options);if(typeof a==="string"){if(c===j)return this.options[a];d={};d[a]=c}this._setOptions(d);return this},_setOptions:function(a){var c=this;b.each(a,function(d,e){c._setOption(d,e)});return this},_setOption:function(a,c){this.options[a]=c;if(a==="disabled")this.widget()[c?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",c);return this},
enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(a,c,d){var e=this.options[a];c=b.Event(c);c.type=(a===this.widgetEventPrefix?a:this.widgetEventPrefix+a).toLowerCase();d=d||{};if(c.originalEvent){a=b.event.props.length;for(var f;a;){f=b.event.props[--a];c[f]=c.originalEvent[f]}}this.element.trigger(c,d);return!(b.isFunction(e)&&e.call(this.element[0],c,d)===false||c.isDefaultPrevented())}}})(jQuery);
;/*!
 * jQuery UI Mouse 1.8.10
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Mouse
 *
 * Depends:
 *	jquery.ui.widget.js
 */
(function(c){c.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var a=this;this.element.bind("mousedown."+this.widgetName,function(b){return a._mouseDown(b)}).bind("click."+this.widgetName,function(b){if(true===c.data(b.target,a.widgetName+".preventClickEvent")){c.removeData(b.target,a.widgetName+".preventClickEvent");b.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName)},_mouseDown:function(a){a.originalEvent=
a.originalEvent||{};if(!a.originalEvent.mouseHandled){this._mouseStarted&&this._mouseUp(a);this._mouseDownEvent=a;var b=this,e=a.which==1,f=typeof this.options.cancel=="string"?c(a.target).parents().add(a.target).filter(this.options.cancel).length:false;if(!e||f||!this._mouseCapture(a))return true;this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet)this._mouseDelayTimer=setTimeout(function(){b.mouseDelayMet=true},this.options.delay);if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a)){this._mouseStarted=
this._mouseStart(a)!==false;if(!this._mouseStarted){a.preventDefault();return true}}this._mouseMoveDelegate=function(d){return b._mouseMove(d)};this._mouseUpDelegate=function(d){return b._mouseUp(d)};c(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);a.preventDefault();return a.originalEvent.mouseHandled=true}},_mouseMove:function(a){if(c.browser.msie&&!(document.documentMode>=9)&&!a.button)return this._mouseUp(a);if(this._mouseStarted){this._mouseDrag(a);
return a.preventDefault()}if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a))(this._mouseStarted=this._mouseStart(this._mouseDownEvent,a)!==false)?this._mouseDrag(a):this._mouseUp(a);return!this._mouseStarted},_mouseUp:function(a){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;a.target==this._mouseDownEvent.target&&c.data(a.target,this.widgetName+".preventClickEvent",
true);this._mouseStop(a)}return false},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery);
;/*
 * jQuery UI Draggable 1.8.10
 *
 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Draggables
 *
 * Depends:
 *	jquery.ui.core.js
 *	jquery.ui.mouse.js
 *	jquery.ui.widget.js
 */
(function(d){d.widget("ui.draggable",d.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false},_create:function(){if(this.options.helper==
"original"&&!/^(?:r|a|f)/.test(this.element.css("position")))this.element[0].style.position="relative";this.options.addClasses&&this.element.addClass("ui-draggable");this.options.disabled&&this.element.addClass("ui-draggable-disabled");this._mouseInit()},destroy:function(){if(this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy();return this}},_mouseCapture:function(a){var b=
this.options;if(this.helper||b.disabled||d(a.target).is(".ui-resizable-handle"))return false;this.handle=this._getHandle(a);if(!this.handle)return false;return true},_mouseStart:function(a){var b=this.options;this.helper=this._createHelper(a);this._cacheHelperProportions();if(d.ui.ddmanager)d.ui.ddmanager.current=this;this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.positionAbs=this.element.offset();this.offset={top:this.offset.top-
this.margins.top,left:this.offset.left-this.margins.left};d.extend(this.offset,{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this.position=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);b.containment&&this._setContainment();if(this._trigger("start",a)===false){this._clear();return false}this._cacheHelperProportions();
d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.helper.addClass("ui-draggable-dragging");this._mouseDrag(a,true);return true},_mouseDrag:function(a,b){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute");if(!b){b=this._uiHash();if(this._trigger("drag",a,b)===false){this._mouseUp({});return false}this.position=b.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||
this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);return false},_mouseStop:function(a){var b=false;if(d.ui.ddmanager&&!this.options.dropBehaviour)b=d.ui.ddmanager.drop(this,a);if(this.dropped){b=this.dropped;this.dropped=false}if((!this.element[0]||!this.element[0].parentNode)&&this.options.helper=="original")return false;if(this.options.revert=="invalid"&&!b||this.options.revert=="valid"&&b||this.options.revert===true||d.isFunction(this.options.revert)&&
this.options.revert.call(this.element,b)){var c=this;d(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){c._trigger("stop",a)!==false&&c._clear()})}else this._trigger("stop",a)!==false&&this._clear();return false},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(a){var b=!this.options.handle||!d(this.options.handle,this.element).length?true:false;d(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==
a.target)b=true});return b},_createHelper:function(a){var b=this.options;a=d.isFunction(b.helper)?d(b.helper.apply(this.element[0],[a])):b.helper=="clone"?this.element.clone():this.element;a.parents("body").length||a.appendTo(b.appendTo=="parent"?this.element[0].parentNode:b.appendTo);a[0]!=this.element[0]&&!/(fixed|absolute)/.test(a.css("position"))&&a.css("position","absolute");return a},_adjustOffsetFromHelper:function(a){if(typeof a=="string")a=a.split(" ");if(d.isArray(a))a={left:+a[0],top:+a[1]||
0};if("left"in a)this.offset.click.left=a.left+this.margins.left;if("right"in a)this.offset.click.left=this.helperProportions.width-a.right+this.margins.left;if("top"in a)this.offset.click.top=a.top+this.margins.top;if("bottom"in a)this.offset.click.top=this.helperProportions.height-a.bottom+this.margins.top},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var a=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],
this.offsetParent[0])){a.left+=this.scrollParent.scrollLeft();a.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&d.browser.msie)a={top:0,left:0};return{top:a.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:a.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.element.position();return{top:a.top-
(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var a=this.options;if(a.containment==
"parent")a.containment=this.helper[0].parentNode;if(a.containment=="document"||a.containment=="window")this.containment=[(a.containment=="document"?0:d(window).scrollLeft())-this.offset.relative.left-this.offset.parent.left,(a.containment=="document"?0:d(window).scrollTop())-this.offset.relative.top-this.offset.parent.top,(a.containment=="document"?0:d(window).scrollLeft())+d(a.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a.containment=="document"?
0:d(window).scrollTop())+(d(a.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(a.containment)&&a.containment.constructor!=Array){var b=d(a.containment)[0];if(b){a=d(a.containment).offset();var c=d(b).css("overflow")!="hidden";this.containment=[a.left+(parseInt(d(b).css("borderLeftWidth"),10)||0)+(parseInt(d(b).css("paddingLeft"),10)||0)-this.margins.left,a.top+(parseInt(d(b).css("borderTopWidth"),
10)||0)+(parseInt(d(b).css("paddingTop"),10)||0)-this.margins.top,a.left+(c?Math.max(b.scrollWidth,b.offsetWidth):b.offsetWidth)-(parseInt(d(b).css("borderLeftWidth"),10)||0)-(parseInt(d(b).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,a.top+(c?Math.max(b.scrollHeight,b.offsetHeight):b.offsetHeight)-(parseInt(d(b).css("borderTopWidth"),10)||0)-(parseInt(d(b).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}}else if(a.containment.constructor==
Array)this.containment=a.containment},_convertPositionTo:function(a,b){if(!b)b=this.position;a=a=="absolute"?1:-1;var c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName);return{top:b.top+this.offset.relative.top*a+this.offset.parent.top*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():
f?0:c.scrollTop())*a),left:b.left+this.offset.relative.left*a+this.offset.parent.left*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():f?0:c.scrollLeft())*a)}},_generatePosition:function(a){var b=this.options,c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName),e=a.pageX,g=a.pageY;
if(this.originalPosition){if(this.containment){if(a.pageX-this.offset.click.left<this.containment[0])e=this.containment[0]+this.offset.click.left;if(a.pageY-this.offset.click.top<this.containment[1])g=this.containment[1]+this.offset.click.top;if(a.pageX-this.offset.click.left>this.containment[2])e=this.containment[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>this.containment[3])g=this.containment[3]+this.offset.click.top}if(b.grid){g=this.originalPageY+Math.round((g-this.originalPageY)/
b.grid[1])*b.grid[1];g=this.containment?!(g-this.offset.click.top<this.containment[1]||g-this.offset.click.top>this.containment[3])?g:!(g-this.offset.click.top<this.containment[1])?g-b.grid[1]:g+b.grid[1]:g;e=this.originalPageX+Math.round((e-this.originalPageX)/b.grid[0])*b.grid[0];e=this.containment?!(e-this.offset.click.left<this.containment[0]||e-this.offset.click.left>this.containment[2])?e:!(e-this.offset.click.left<this.containment[0])?e-b.grid[0]:e+b.grid[0]:e}}return{top:g-this.offset.click.top-
this.offset.relative.top-this.offset.parent.top+(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():f?0:c.scrollTop()),left:e-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():f?0:c.scrollLeft())}},_clear:function(){this.helper.removeClass("ui-draggable-dragging");this.helper[0]!=
this.element[0]&&!this.cancelHelperRemoval&&this.helper.remove();this.helper=null;this.cancelHelperRemoval=false},_trigger:function(a,b,c){c=c||this._uiHash();d.ui.plugin.call(this,a,[b,c]);if(a=="drag")this.positionAbs=this._convertPositionTo("absolute");return d.Widget.prototype._trigger.call(this,a,b,c)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}});d.extend(d.ui.draggable,{version:"1.8.10"});
d.ui.plugin.add("draggable","connectToSortable",{start:function(a,b){var c=d(this).data("draggable"),f=c.options,e=d.extend({},b,{item:c.element});c.sortables=[];d(f.connectToSortable).each(function(){var g=d.data(this,"sortable");if(g&&!g.options.disabled){c.sortables.push({instance:g,shouldRevert:g.options.revert});g._refreshItems();g._trigger("activate",a,e)}})},stop:function(a,b){var c=d(this).data("draggable"),f=d.extend({},b,{item:c.element});d.each(c.sortables,function(){if(this.instance.isOver){this.instance.isOver=
0;c.cancelHelperRemoval=true;this.instance.cancelHelperRemoval=false;if(this.shouldRevert)this.instance.options.revert=true;this.instance._mouseStop(a);this.instance.options.helper=this.instance.options._helper;c.options.helper=="original"&&this.instance.currentItem.css({top:"auto",left:"auto"})}else{this.instance.cancelHelperRemoval=false;this.instance._trigger("deactivate",a,f)}})},drag:function(a,b){var c=d(this).data("draggable"),f=this;d.each(c.sortables,function(){this.instance.positionAbs=
c.positionAbs;this.instance.helperProportions=c.helperProportions;this.instance.offset.click=c.offset.click;if(this.instance._intersectsWith(this.instance.containerCache)){if(!this.instance.isOver){this.instance.isOver=1;this.instance.currentItem=d(f).clone().appendTo(this.instance.element).data("sortable-item",true);this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return b.helper[0]};a.target=this.instance.currentItem[0];this.instance._mouseCapture(a,
true);this.instance._mouseStart(a,true,true);this.instance.offset.click.top=c.offset.click.top;this.instance.offset.click.left=c.offset.click.left;this.instance.offset.parent.left-=c.offset.parent.left-this.instance.offset.parent.left;this.instance.offset.parent.top-=c.offset.parent.top-this.instance.offset.parent.top;c._trigger("toSortable",a);c.dropped=this.instance.element;c.currentItem=c.element;this.instance.fromOutside=c}this.instance.currentItem&&this.instance._mouseDrag(a)}else if(this.instance.isOver){this.instance.isOver=
0;this.instance.cancelHelperRemoval=true;this.instance.options.revert=false;this.instance._trigger("out",a,this.instance._uiHash(this.instance));this.instance._mouseStop(a,true);this.instance.options.helper=this.instance.options._helper;this.instance.currentItem.remove();this.instance.placeholder&&this.instance.placeholder.remove();c._trigger("fromSortable",a);c.dropped=false}})}});d.ui.plugin.add("draggable","cursor",{start:function(){var a=d("body"),b=d(this).data("draggable").options;if(a.css("cursor"))b._cursor=
a.css("cursor");a.css("cursor",b.cursor)},stop:function(){var a=d(this).data("draggable").options;a._cursor&&d("body").css("cursor",a._cursor)}});d.ui.plugin.add("draggable","iframeFix",{start:function(){var a=d(this).data("draggable").options;d(a.iframeFix===true?"iframe":a.iframeFix).each(function(){d('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1E3}).css(d(this).offset()).appendTo("body")})},
stop:function(){d("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});d.ui.plugin.add("draggable","opacity",{start:function(a,b){a=d(b.helper);b=d(this).data("draggable").options;if(a.css("opacity"))b._opacity=a.css("opacity");a.css("opacity",b.opacity)},stop:function(a,b){a=d(this).data("draggable").options;a._opacity&&d(b.helper).css("opacity",a._opacity)}});d.ui.plugin.add("draggable","scroll",{start:function(){var a=d(this).data("draggable");if(a.scrollParent[0]!=
document&&a.scrollParent[0].tagName!="HTML")a.overflowOffset=a.scrollParent.offset()},drag:function(a){var b=d(this).data("draggable"),c=b.options,f=false;if(b.scrollParent[0]!=document&&b.scrollParent[0].tagName!="HTML"){if(!c.axis||c.axis!="x")if(b.overflowOffset.top+b.scrollParent[0].offsetHeight-a.pageY<c.scrollSensitivity)b.scrollParent[0].scrollTop=f=b.scrollParent[0].scrollTop+c.scrollSpeed;else if(a.pageY-b.overflowOffset.top<c.scrollSensitivity)b.scrollParent[0].scrollTop=f=b.scrollParent[0].scrollTop-
c.scrollSpeed;if(!c.axis||c.axis!="y")if(b.overflowOffset.left+b.scrollParent[0].offsetWidth-a.pageX<c.scrollSensitivity)b.scrollParent[0].scrollLeft=f=b.scrollParent[0].scrollLeft+c.scrollSpeed;else if(a.pageX-b.overflowOffset.left<c.scrollSensitivity)b.scrollParent[0].scrollLeft=f=b.scrollParent[0].scrollLeft-c.scrollSpeed}else{if(!c.axis||c.axis!="x")if(a.pageY-d(document).scrollTop()<c.scrollSensitivity)f=d(document).scrollTop(d(document).scrollTop()-c.scrollSpeed);else if(d(window).height()-
(a.pageY-d(document).scrollTop())<c.scrollSensitivity)f=d(document).scrollTop(d(document).scrollTop()+c.scrollSpeed);if(!c.axis||c.axis!="y")if(a.pageX-d(document).scrollLeft()<c.scrollSensitivity)f=d(document).scrollLeft(d(document).scrollLeft()-c.scrollSpeed);else if(d(window).width()-(a.pageX-d(document).scrollLeft())<c.scrollSensitivity)f=d(document).scrollLeft(d(document).scrollLeft()+c.scrollSpeed)}f!==false&&d.ui.ddmanager&&!c.dropBehaviour&&d.ui.ddmanager.prepareOffsets(b,a)}});d.ui.plugin.add("draggable",
"snap",{start:function(){var a=d(this).data("draggable"),b=a.options;a.snapElements=[];d(b.snap.constructor!=String?b.snap.items||":data(draggable)":b.snap).each(function(){var c=d(this),f=c.offset();this!=a.element[0]&&a.snapElements.push({item:this,width:c.outerWidth(),height:c.outerHeight(),top:f.top,left:f.left})})},drag:function(a,b){for(var c=d(this).data("draggable"),f=c.options,e=f.snapTolerance,g=b.offset.left,n=g+c.helperProportions.width,m=b.offset.top,o=m+c.helperProportions.height,h=
c.snapElements.length-1;h>=0;h--){var i=c.snapElements[h].left,k=i+c.snapElements[h].width,j=c.snapElements[h].top,l=j+c.snapElements[h].height;if(i-e<g&&g<k+e&&j-e<m&&m<l+e||i-e<g&&g<k+e&&j-e<o&&o<l+e||i-e<n&&n<k+e&&j-e<m&&m<l+e||i-e<n&&n<k+e&&j-e<o&&o<l+e){if(f.snapMode!="inner"){var p=Math.abs(j-o)<=e,q=Math.abs(l-m)<=e,r=Math.abs(i-n)<=e,s=Math.abs(k-g)<=e;if(p)b.position.top=c._convertPositionTo("relative",{top:j-c.helperProportions.height,left:0}).top-c.margins.top;if(q)b.position.top=c._convertPositionTo("relative",
{top:l,left:0}).top-c.margins.top;if(r)b.position.left=c._convertPositionTo("relative",{top:0,left:i-c.helperProportions.width}).left-c.margins.left;if(s)b.position.left=c._convertPositionTo("relative",{top:0,left:k}).left-c.margins.left}var t=p||q||r||s;if(f.snapMode!="outer"){p=Math.abs(j-m)<=e;q=Math.abs(l-o)<=e;r=Math.abs(i-g)<=e;s=Math.abs(k-n)<=e;if(p)b.position.top=c._convertPositionTo("relative",{top:j,left:0}).top-c.margins.top;if(q)b.position.top=c._convertPositionTo("relative",{top:l-c.helperProportions.height,
left:0}).top-c.margins.top;if(r)b.position.left=c._convertPositionTo("relative",{top:0,left:i}).left-c.margins.left;if(s)b.position.left=c._convertPositionTo("relative",{top:0,left:k-c.helperProportions.width}).left-c.margins.left}if(!c.snapElements[h].snapping&&(p||q||r||s||t))c.options.snap.snap&&c.options.snap.snap.call(c.element,a,d.extend(c._uiHash(),{snapItem:c.snapElements[h].item}));c.snapElements[h].snapping=p||q||r||s||t}else{c.snapElements[h].snapping&&c.options.snap.release&&c.options.snap.release.call(c.element,
a,d.extend(c._uiHash(),{snapItem:c.snapElements[h].item}));c.snapElements[h].snapping=false}}}});d.ui.plugin.add("draggable","stack",{start:function(){var a=d(this).data("draggable").options;a=d.makeArray(d(a.stack)).sort(function(c,f){return(parseInt(d(c).css("zIndex"),10)||0)-(parseInt(d(f).css("zIndex"),10)||0)});if(a.length){var b=parseInt(a[0].style.zIndex)||0;d(a).each(function(c){this.style.zIndex=b+c});this[0].style.zIndex=b+a.length}}});d.ui.plugin.add("draggable","zIndex",{start:function(a,
b){a=d(b.helper);b=d(this).data("draggable").options;if(a.css("zIndex"))b._zIndex=a.css("zIndex");a.css("zIndex",b.zIndex)},stop:function(a,b){a=d(this).data("draggable").options;a._zIndex&&d(b.helper).css("zIndex",a._zIndex)}})})(jQuery);
;if(typeof google !== 'undefined' && typeof google.maps !== 'undefined'){
    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}('8 t(a){2.3=a;2.6=X.1v("1V");2.6.4.L="R: 1g; 15: 1A;";2.p=X.1v("1V");2.p.4.L=2.6.4.L;2.p.23("2L","1Q w;");2.p.23("2w","1Q w;");2.v=X.1v("2o");2.v.4.L="R: 1g; z-2l: 2g; I: 16;";2.v.4.1b="-2a";2.v.4.1w="-2Y";2.v.2V="22://5.1X.1T/1R/1P/1M/2x.2v"}t.s=W 7.5.2n();t.s.2m=8(){r g=2;r l=w;r c=w;r o;r f;r i,12;r n;r d;r m=20;r h="29(22://5.1X.1T/1R/1P/1M/28.27)";r j=8(e){9(e.24){e.24()}e.2R=G;9(e.1Z){e.1Z()}};r k=8(){g.3.1W(2J)};2.1n().1S.S(2.6);2.1n().2D.S(2.p);2.1n().1S.S(2.v);2.1p=[7.5.q.M(2.p,"1N",8(e){9(g.3.N()||g.3.U()){2.4.19="1Y";7.5.q.B(g.3,"1N",e)}}),7.5.q.M(2.p,"1U",8(e){9((g.3.N()||g.3.U())&&!c){2.4.19=g.3.2r();7.5.q.B(g.3,"1U",e)}}),7.5.q.M(2.p,"1J",8(e){i=0;12=0;c=w;9(g.3.N()){l=G;2.4.19=h}9(g.3.N()||g.3.U()){7.5.q.B(g.3,"1J",e)}j(e)}),7.5.q.M(X,"1G",8(a){r b;9(l){l=w;g.p.4.19="1Y";7.5.q.B(g.3,"1G",a)}9(c){a.E=o;n=G;9(d){b=g.Q().1i(g.3.11());b.y+=m;g.3.J(g.Q().1E(b));2k{g.3.1W(7.5.2j.2i);2h(k,2f)}2e(e){}g.v.4.I="16"}g.3.T(f);c=w;7.5.q.B(g.3,"1D",a)}}),7.5.q.u(g.3.2d(),"2c",8(a){r b;9(l){a.E=W 7.5.2b(a.E.1d()-i,a.E.1c()-12);9(c){o=a.E;b=g.Q().1i(a.E);9(d){g.v.4.Y=b.x+"A";g.v.4.P=b.y+"A";g.v.4.I="";b.y-=m}g.3.J(g.Q().1E(b));9(d){g.p.4.P=(b.y+m)+"A"}7.5.q.B(g.3,"1C",a)}V{i=a.E.1d()-g.3.11().1d();12=a.E.1c()-g.3.11().1c();f=g.3.1a();g.3.T(1B);d=g.3.D("14");c=G;7.5.q.B(g.3,"1z",a)}}}),7.5.q.M(2.p,"1y",8(e){9(g.3.N()||g.3.U()){9(n){n=w}V{7.5.q.B(g.3,"1y",e);j(e)}}}),7.5.q.M(2.p,"1x",8(e){9(g.3.N()||g.3.U()){7.5.q.B(g.3,"1x",e);j(e)}}),7.5.q.u(2.3,"1z",8(a){9(!c){d=2.D("14")}}),7.5.q.u(2.3,"1C",8(a){9(!c){9(d){g.J(m);g.6.4.K=1B+(2.D("18")?-1:+1)}}}),7.5.q.u(2.3,"1D",8(a){9(!c){9(d){g.J(0)}}}),7.5.q.u(2.3,"2X",8(){g.J()}),7.5.q.u(2.3,"2W",8(){g.T()}),7.5.q.u(2.3,"2U",8(){g.17()}),7.5.q.u(2.3,"2T",8(){g.17()}),7.5.q.u(2.3,"2S",8(){g.1t()}),7.5.q.u(2.3,"2Q",8(){g.1f()}),7.5.q.u(2.3,"2P",8(){g.1e()}),7.5.q.u(2.3,"2O",8(){g.Z()}),7.5.q.u(2.3,"2M",8(){g.Z()})]};t.s.2K=8(){r i;2.6.1r.1h(2.6);2.p.1r.1h(2.p);2.v.1r.1h(2.v);26(i=0;i<2.1p.2I;i++){7.5.q.2G(2.1p[i])}};t.s.2F=8(){2.1f();2.1t();2.Z()};t.s.1f=8(){r a=2.3.D("1j");9(F a.2E==="H"){2.6.13=a;2.p.13=2.6.13}V{2.6.13="";2.6.S(a);a=a.2C(G);2.p.S(a)}};t.s.1t=8(){2.p.2B=2.3.2A()||""};t.s.Z=8(){r i,C;2.6.1o=2.3.D("1m");2.p.1o=2.6.1o;2.6.4.L="";2.p.4.L="";C=2.3.D("C");26(i 2z C){9(C.2y(i)){2.6.4[i]=C[i];2.p.4[i]=C[i]}}2.1L()};t.s.1L=8(){2.6.4.R="1g";2.6.4.15="1A";9(F 2.6.4.O!=="H"&&2.6.4.O!==""){2.6.4.1K="1O(O="+(2.6.4.O*2u)+")"}2.p.4.R=2.6.4.R;2.p.4.15=2.6.4.15;2.p.4.O=0.2H;2.p.4.1K="1O(O=1)";2.1e();2.J();2.17()};t.s.1e=8(){r a=2.3.D("1q");2.6.4.1b=-a.x+"A";2.6.4.1w=-a.y+"A";2.p.4.1b=-a.x+"A";2.p.4.1w=-a.y+"A"};t.s.J=8(a){r b=2.Q().1i(2.3.11());9(F a==="H"){a=0}2.6.4.Y=b.x+"A";2.6.4.P=(b.y-a)+"A";2.p.4.Y=2.6.4.Y;2.p.4.P=2.6.4.P;2.T()};t.s.T=8(){r a=(2.3.D("18")?-1:+1);9(F 2.3.1a()==="H"){2.6.4.K=2t(2.6.4.P,10)+a;2.p.4.K=2.6.4.K}V{2.6.4.K=2.3.1a()+a;2.p.4.K=2.6.4.K}};t.s.17=8(){9(2.3.D("1l")){2.6.4.I=2.3.2s()?"2N":"16"}V{2.6.4.I="16"}2.p.4.I=2.6.4.I};8 1k(a){a=a||{};a.1j=a.1j||"";a.1q=a.1q||W 7.5.2q(0,0);a.1m=a.1m||"2p";a.C=a.C||{};a.18=a.18||w;9(F a.1l==="H"){a.1l=G}9(F a.14==="H"){a.14=G}9(F a.21==="H"){a.21=G}9(F a.1I==="H"){a.1I=w}2.1H=W t(2);7.5.1s.25(2,1F)}1k.s=W 7.5.1s();1k.s.1u=8(a){7.5.1s.s.1u.25(2,1F);2.1H.1u(a)};',62,185,'||this|marker_|style|maps|labelDiv_|google|function|if||||||||||||||||eventDiv_|event|var|prototype|MarkerLabel_|addListener|crossDiv_|false||||px|trigger|labelStyle|get|latLng|typeof|true|undefined|display|setPosition|zIndex|cssText|addDomListener|getDraggable|opacity|top|getProjection|position|appendChild|setZIndex|getClickable|else|new|document|left|setStyles||getPosition|cLngOffset|innerHTML|raiseOnDrag|overflow|none|setVisible|labelInBackground|cursor|getZIndex|marginLeft|lng|lat|setAnchor|setContent|absolute|removeChild|fromLatLngToDivPixel|labelContent|MarkerWithLabel|labelVisible|labelClass|getPanes|className|listeners_|labelAnchor|parentNode|Marker|setTitle|setMap|createElement|marginTop|dblclick|click|dragstart|hidden|1000000|drag|dragend|fromDivPixelToLatLng|arguments|mouseup|label|draggable|mousedown|filter|setMandatoryStyles|mapfiles|mouseover|alpha|en_us|return|intl|overlayImage|com|mouseout|div|setAnimation|gstatic|pointer|stopPropagation||clickable|http|setAttribute|preventDefault|apply|for|cur|closedhand_8_8|url|8px|LatLng|mousemove|getMap|catch|1406|1000002|setTimeout|BOUNCE|Animation|try|index|onAdd|OverlayView|img|markerLabels|Point|getCursor|getVisible|parseInt|100|png|ondragstart|drag_cross_67_16|hasOwnProperty|in|getTitle|title|cloneNode|overlayMouseTarget|nodeType|draw|removeListener|01|length|null|onRemove|onselectstart|labelstyle_changed|block|labelclass_changed|labelanchor_changed|labelcontent_changed|cancelBubble|title_changed|labelvisible_changed|visible_changed|src|zindex_changed|position_changed|9px'.split('|'),0,{}));
}/**
 * Copyright (C) 2005 Brightcove, Inc.  All Rights Reserved.  No
 * use, copying or distribution of this work may be made except in
 * accordance with a valid license agreement from Brightcove, Inc.
 * This notice must be included on all copies, modifications and
 * derivatives of this work.
 *
 * Brightcove, Inc MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT
 * THE SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED,
 * INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
 * NON-INFRINGEMENT. BRIGHTCOVE SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED
 * BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS
 * SOFTWARE OR ITS DERIVATIVES.
 *
 * "Brightcove" is a trademark of Brightcove, Inc.
 **/

/*********************************************** CONFIGURATION ************************************************/

/**
 * This is the API Token assigned to each Brightcove customer that allows for the use of Brightcove's Media Read API.
 * Fill in your read API token (there are two versions, but you want the one that includes URL responses) here.
 */
var BCReadAPIToken = "T_iEpPZO_PY-lyzh4KgSgrQVEudYtlaLpBssYnTb3b03Geg9zQsUBw..";

/**
 * This value indicates whether or not your account is set-up for UDS. HTML5 requires that the files be delivered
 * over HTTP.  This is accomplished by having an account that is configured for HTTP (PD) delivery or that is set-up
 * for UDS. 
 */
var isUDS = true;

/* This variable is a dictionary that contains information about the location of each
 * Brightcove video object within the DOM of the page. Specifically, it is an associative array
 * where, for each stored mapping, the keys is the playerID of a given video, and the value is
 * the next sibling of that video object in the DOM. Keeping track of this sibling will allow
 * us to re-insert the mobile compatible <video> tag into the correct place (before this sibling)
 * in the DOM of the original page.
 */
var pagePlacementInfo = new Object();

/**********************************************************************************************************************/
/*********************************************** DOM MODIFICATION CODE ************************************************/
/**********************************************************************************************************************/

/* This is the main entry function. It goes through the list of all video objects that need to be removed,
 * and one by one, initiates a request that causes that object to be removed and replaced by the
 * appropriate <video> tag (if the JS detects that the browser is on a smartphone).
 */
function runMobileCompatibilityScript(bcExperienceID, videoTagID){
    //detect if this is a smartphone or not
    var thisIsSmartPhone = DetectSmartphone();

    if (!thisIsSmartPhone) {
        return;
    }

	
    makeMobileCompatible(bcExperienceID, videoTagID);
}

/* This method works on a specific object, represented by id "strObjID". The method retrieves the
 * element with the given ID from the DOM, and then extracts the player ID from the video
 * object. Then, it removes the video object from the page's DOM and stores its location in the page
 * in a global dictionary variable (this will be useful when we want to add the corresponding
 * video tag back in the page in the appropriate place).
 *
 * Finally, the method submits an API Read request to the Brightcove server through the initiateMobileVideoRetrieval()
 * method in order to retrieve the sepcific Video URL corresponding to the given object.
 */
function makeMobileCompatible(strObjID, videoTagID){
    //our video object (which we need to remove)
    var vidObj = document.getElementById(strObjID);
	
    //extract the playerID of this video object before deleting it
    var vidPlayerID = getParamValueForVidObject(vidObj, 'playerID');
    var programmedVideo = getParamValueForVidObject(vidObj, '@videoPlayer');

    //if the video player ID could not be extracted from the Source Code, for some reason,
    //then refer to the dictionary provided by the user
    if (vidPlayerID === null || typeof vidPlayerID === 'undefined'){
        vidPlayerID = BCVidObjects[strObjID];
    }

    //store the parent of the node we wish to remove
    var parentObj = vidObj.parentNode;
	
    //this is the object before which our vidObj element occurs in the parent element's DOM.
    //likewise, when we insert our <video> tag, we will insert it BEFORE this element,
    //in order to maintain the look of the page (this is the best that we can do...)
    var nextAdjacentNode = vidObj.nextSibling;
	
    //if there are no nodes after this node that was removed, then store 'null' to indicate that this was the last
    //child.
    if (nextAdjacentNode === null){
        pagePlacementInfo[""+strObjID] = null;
    }
    //otherwise store the next sibling
    else {
        pagePlacementInfo[""+strObjID] = nextAdjacentNode;
    }
	
    //now, dynamically remove the video object from the DOM
    parentObj.removeChild(vidObj);

    //this procedure will make the appropriate API calls to get the first video corresponding to the player ID
    //of the object we just removed.
	
    initiateMobileVideoRetrieval(vidPlayerID, programmedVideo, BCReadAPIToken, videoTagID, strObjID);
}


/** 
 * This function takes an object representing a Brigthcove video embed and a particular 'parameter' that was
 * passed to the Brightcove video object and returns the parameter.
 */
function getParamValueForVidObject(vidObj, paramName) {
    //these are the children nodes of the given object in the DOM
    var childrenNodes = vidObj.childNodes;
    var tagName;
	
    //loop through all children of the video object, searching for <param> tags.
    //each time we find a <param> tag, we check whether its name is 'flashVars'.
    //if so, we store the param's value and break from the loop, otherwise we
    //continue
    for (var i = 0; i < childrenNodes.length; i++){
        if (childrenNodes[i].nodeType != 1) {
            continue;
        }

        tagName = childrenNodes[i].tagName.toLowerCase();
        if (tagName == "param"){
            if (childrenNodes[i].getAttribute("name") == paramName){
                return childrenNodes[i].getAttribute("value");
            }
        }
    }

    return null;
}

/**
 * Takes a string 'str' that consists of multiple arguments separated by ampersands (&),
 * and breaks it down so that it can extract and return the paramName from the string.
 */
function parseParamFromString(str, paramName) {
    var params = str.split("&"); //array of strings
    for (var i = 0; i < params.length; i++){
        if (params[i].indexOf(paramName) != -1){
            return params[i].substr(params[i].indexOf("=")+1);
        }
    }
	
    // if we could not find the param then return null
    return null;
}



/**********************************************************************************************************************/
/****************************************** MEDIA API CALLS & VIDEO TAG INSERTION *************************************/
/**********************************************************************************************************************/

/* This method calls the Brightcove Media API to get all playlists included within a particular
 * playerID.
 */
function initiateMobileVideoRetrieval(playerID, programmedVideoID, readAPIToken, videoTagID, strObjID) {
    var APICall;
    var scriptNode;
    var scriptText;
    var callbackMethodName;

    if (programmedVideoID) {
        if (programmedVideoID.indexOf('ref:') != -1) {
            APICall = "http://api.brightcove.com/services/library?command=find_video_by_reference_id&reference_id="+programmedVideoID.substring(4)+"&token="+readAPIToken;
        }
        else {
            APICall = "http://api.brightcove.com/services/library?command=find_video_by_id&video_id="+programmedVideoID+"&token="+readAPIToken;
        }

        //when we make the API call, we specify a response handler (known as a callback method) that will deal with the response from
        //the Brightcove server. However, we create a customized 'callback' method for each playerID, so that when we are 'inside' the
        //callback method (after receiving the server's reponse), we will know which playerID the response corresponds to. This variable
        //stores the name (which includes the playerID) of that callback method.
        callbackMethodName = "handleJSONResponseForID"+new Date().getTime();
        scriptNode = document.createElement("script");
        scriptNode.setAttribute("language", "javascript");
        scriptText =
        "function "+callbackMethodName+"(JSONResponse){\n" +
        "\thandleVideoResponse(JSONResponse, '"+playerID+"', '"+videoTagID+"', '"+strObjID+"');\n"+
        "}\n";
    }
    else {
        APICall = "http://api.brightcove.com/services/library?command=find_playlists_for_player_id&player_id="+playerID+"&token="+readAPIToken;
        callbackMethodName = "handleJSONResponseForID"+ new Date().getTime();
        scriptNode = document.createElement("script");
        scriptNode.setAttribute("language", "javascript");
        scriptText =
        "function "+callbackMethodName+"(JSONResponse){\n" +
        "\thandlePlaylistResponse(JSONResponse, '"+playerID+"', '"+videoTagID+"', '"+strObjID+"');\n"+
        "}\n";
    }

    if (isUDS) {
        APICall += "&media_delivery=http";
    }

    //NOTE: we add to the end of the body, so that we do not disrupt any of the order of the children
    //at the top of the body's DOM tree
    var scriptTextNode = document.createTextNode(scriptText);
    scriptNode.appendChild(scriptTextNode);
    document.body.appendChild(scriptNode);
	
    //make the API call, specifying the unique callback method for this request
    addScriptTag("getMobileRendition",  APICall, callbackMethodName);
}

/* Methods needed to make API Calls to the Brightcove server*/
function addScriptTag(id, url, callback) {
    var scriptTag = document.createElement("script");
    var noCacheIE = '&noCacheIE=' + (new Date()).getTime();
   
    // Add script object attributes
    scriptTag.setAttribute("type", "text/javascript");
    scriptTag.setAttribute("charset", "utf-8");
    scriptTag.setAttribute("src", url + "&callback=" + callback + noCacheIE);
    scriptTag.setAttribute("id", id);
	
    var head = document.getElementsByTagName("head").item(0);
    head.appendChild(scriptTag);
}

/**
 * This is the general response-handler for the JSON response from the Brightcove server for playlist based players.
 * The arguments to the method include the response object, as well as the playerID of the 
 * object which this response pertains to.
 *
 */
function handlePlaylistResponse(JSONResponse, playerID, videoTagID, strObjID) {
    //obtain first playlist in Brightcove Player given corresponding to this playerID
    var firstPlaylist = JSONResponse.items[0];
	
    //obtain the first video from our first playlist
    var firstVideo = firstPlaylist.videos[0];

    embedHTML5PlayerForVideo(firstVideo, playerID, videoTagID, strObjID);
}

/**
 * This is the general response-handler for the JSON response from the Brightcove server for playlist based players.
 * The arguments to the method include the response object, as well as the playerID of the 
 * object which this response pertains to.
 *
 */
function handleVideoResponse(JSONResponse, playerID, videoTagID, strObjID) {
    embedHTML5PlayerForVideo(JSONResponse, playerID, videoTagID, strObjID);
}

/** 
 * For a given video object (from the BC APIs) we will embed an HTML 5 'video' tag.
 * Requires searching through the renditions associated with the video object
 * for a rendition that is a 'best' match and passing the URL to the video
 * tag.
 *
 * In this handler, we explore the JSON object in search of the first video in the
 * first playlist that is returned by the Brightcove server. Then, once we identify
 * this first video, we examine the various renditions of the video and search
 * for the rendition that is most appropriate for a mobile (H.264 encoding 
 * and 256 kbps). 
 */
function embedHTML5PlayerForVideo(video, playerID, videoTagID, strObjID) {
    //obtain the array of various renditions that exist for this video.
    //NOTE: a rendition, from our perspective, has a certain encoding rate,
    //      and a certain encoding format. We wish to find the best rendition for
    //      a smartphone.
    var renditions = video.renditions;
	
    //In the for-loop that follows, we traverse all renditions of this first video, searching
    //for the H.264 (mobile-compatible) rendition whose encoding rate is closest to 256kbps
    var bestRenditionIndex = -1;
    var bestEncodingRateSoFar = -1;
	
    for (var i = 0; i < renditions.length; i = i+1){
        //if this rendition is not H264, skip it and move on to the next
        if (renditions[i].videoCodec != "H264"){
            continue;
        }
		
        //if best rendition index variable is uninitialized, then initialize it to
        //this rendition (which is H.264) - we need this because it's possible that
        //there are no H264 renditions at all, and starting our bestRenditionIndex at
        //an invalid value will help us figure out whether we came across any H264 renditions
        //as we were looping.
        if (bestRenditionIndex == -1){
            bestRenditionIndex = i;
            bestEncodingRateSoFar = renditions[i].encodingRate;
        }
		
        //otherwise check to see if this rendition has a better encoding rate than the best one before this
        else if (betterEncodingForMobile(renditions[i].encodingRate, bestEncodingRateSoFar) == renditions[i].encodingRate){
            //if so, then record this rendition as the best one so far
            bestRenditionIndex = i;
            bestEncodingRateSoFar = renditions[i].encodingRate;
        }
    }
	
    //after the for-loop has terminated, if best rendition index still == -1,
    //then that means we don't have ANY H264 renditions. so let the user know,
    //and don't add anything to the page
    if (bestRenditionIndex == -1){
        bestRendition = video.videoFullLength;
    }
    else {
        bestRendition = renditions[bestRenditionIndex];
    }


    var bestRenditionURL = bestRendition.url;
	
    var vidName = video.name;
    var vidHeight = bestRendition.frameHeight;
    var vidWidth = bestRendition.frameWidth;
    var vidStillURL = video.videoStillURL;
		
    //construct the <video> tag as a DOM element
    var videoScriptTag = formVideoTagFromInfo(videoTagID, vidName, bestRenditionURL, vidWidth, vidHeight, vidStillURL);
	
    //retrieve the component before which this video tag needs to be inserted
    var nextSiblingOfVideo = pagePlacementInfo[strObjID];
    var videoTagParent = nextSiblingOfVideo.parentNode; //the sibling and this video share the same parent node!
		
    //if 'nextSibling' value is null, then we want to add our video as the last child of the parent,
    //so we use the append() method; if 'nextSibling' is defined, then we use insertBefore() to add our video tag
    //into the appropriate location in our page.
    if (nextSiblingOfVideo === null){
        videoTagParent.appendChild(videoScriptTag);
    }
    else{
        videoTagParent.insertBefore(videoScriptTag, nextSiblingOfVideo);
    }
}

/* This function takes two encoding rates and returns the one that
 * is more apprporiate for mobile phones.
 */
function betterEncodingForMobile(encoding1, encoding2){
    IDEAL_ENCODING_RATE = 256000; //bits per second; equivalent to 256 kbps
	
    diff1 = Math.abs(encoding1 - IDEAL_ENCODING_RATE);
    diff2 = Math.abs(encoding2 - IDEAL_ENCODING_RATE);
	
    return ((diff1 <= diff2) ? encoding1 : encoding2);
}

/**
 * This method takes properties of a video, its dimensions, and its poster (still image),
 * inserts them into an HTML 5.0 <video> tag. This <video> object is then returned.
 */
function formVideoTagFromInfo(videoTagID, videoID, videoURL, vidWidth, vidHeight, vidImageURL){
    var videoTag = document.createElement("video");
    if (videoTagID) {
        videoTag.setAttribute("id", videoTagID);
    }
    else {
        videoTag.setAttribute("id", videoID);
    }

    videoTag.setAttribute("poster", vidImageURL);
    videoTag.setAttribute("width",""+vidWidth);
    videoTag.setAttribute("height", ""+vidHeight);
    videoTag.setAttribute("controls", "true");
    videoTag.setAttribute("src", videoURL);
	
    return videoTag;
}


/**********************************************************************************************************************/
/****************************************** MOBILE BROWSER DETECTION CODE *********************************************/
/**********************************************************************************************************************/

// JavaScript Document

// Anthony Hand, ahand@hand-interactive.com
// Web: www.hand-interactive.com
// 
// License info: http://creativecommons.org/licenses/by/3.0/us/

//Initialize some initial string variables we'll look for later.
var deviceIphone = "iphone";
var deviceIPad = "ipad";
var deviceIpod = "ipod";
var devicePlaystation = "playstation";
var deviceWap = "wap";

var deviceWinMob = "windows ce";
var enginePie = "wm5 pie";
var deviceIeMob = "iemobile";

var deviceS60 = "series60";
var deviceSymbian = "symbian";
var deviceS70 = "series70";
var deviceS80 = "series80";
var deviceS90 = "series90";

var deviceBB = "blackberry";

var deviceAndroid = "android";

var deviceMidp = "midp";
var deviceWml = "wml";
var deviceBrew = "brew";

var devicePalm = "palm";
var engineXiino = "xiino";
var engineBlazer = "blazer"; //Old Palm

var devicePda = "pda";
var deviceNintendoDs = "nitro";

var engineWebKit = "webkit";
var engineNetfront = "netfront";


var manuSonyEricsson = "sonyericsson";
var manuericsson = "ericsson";
var manuSamsung1 = "sec-sgh";

var svcDocomo = "docomo";
var svcKddi = "kddi";
var svcVodafone = "vodafone";

//Due to the flexibility of the S60 OSSO Browser, 
//   you may wish to let new S60 devices get the regular pages instead.
var s60GetsMobile = true;


//Due to the flexibility of the iPhone/iPod Touch Browser, 
//   you may wish to let new S60 devices get the regular pages instead.
var iphoneIpodGetsMobile = true;


//Initialize our user agent string.
var uagent = navigator.userAgent.toLowerCase();

//**************************
// Detects if the current device is an iPhone.
function DetectIphone()
{
    if (uagent.search(deviceIphone) > -1)
    {
        //The iPod touch says it's an iPhone! So let's disambiguate.
        if (uagent.search(deviceIpod) > -1)
            return false;
        else
            return true;
    }
    else
        return false;
}

//**************************
// Detects if the current device is an iPhone.
function DetectIPad()
{
    if (uagent.search(deviceIPad) > -1) {
        return true;
    }
    else {
        return false;
    }
}

//**************************
// Detects if the current device is an iPod Touch.
function DetectIpod()
{
    if (uagent.search(deviceIpod) > -1)
        return true;
    else
        return false;
}

//**************************
// Detects if the current device is an iPhone or iPod Touch.
function DetectIphoneOrIpodOrIPad()
{
    //We repeat the searches here because some iPods
    //  may report themselves as an iPhone, which is ok.
    if (uagent.search(deviceIphone) > -1 ||
        uagent.search(deviceIpod) > -1 ||
        uagent.search(deviceIPad) > -1)

        return true;
    else
        return false;
}

//**************************
// Detects if the current device is an Android OS-based device.
function DetectAndroid()
{
    if (uagent.search(deviceAndroid) > -1)
        return true;
    else
        return false;
}


//**************************
// Detects if the current device is an Android OS-based device and
//   the browser is based on WebKit.
function DetectAndroidWebKit()
{
    if (DetectAndroid())
    {
        if (DetectWebkit())
            return true;
        else
            return false;
    }
    else
        return false;
}

//**************************
// Detects if the current browser is based on WebKit.
function DetectWebkit()
{
    if (uagent.search(engineWebKit) > -1)
        return true;
    else
        return false;
}

//**************************
// Detects if the current browser is the Nokia S60 Open Source Browser.
function DetectS60OssBrowser()
{
    if (DetectWebkit())
    {
        if ((uagent.search(deviceS60) > -1 ||
            uagent.search(deviceSymbian) > -1))
            return true;
        else
            return false;
    }
    else
        return false;
}

//**************************
// Detects if the current device is any Symbian OS-based device,
//   including older S60, Series 70, Series 80, Series 90, and UIQ, 
//   or other browsers running on these devices.
function DetectSymbianOS()
{
    if (uagent.search(deviceSymbian) > -1 ||
        uagent.search(deviceS60) > -1 ||
        uagent.search(deviceS70) > -1 ||
        uagent.search(deviceS80) > -1 ||
        uagent.search(deviceS90) > -1)
        return true;
    else
        return false;
}


//**************************
// Detects if the current browser is a BlackBerry of some sort.
function DetectBlackBerry()
{
    if (uagent.search(deviceBB) > -1)
        return true;
    else
        return false;
}

//**************************
// Detects if the current browser is a Windows Mobile device.
function DetectWindowsMobile()
{
    //Most devices use 'Windows CE', but some report 'iemobile'
    //  and some older ones report as 'PIE' for Pocket IE.
    if (uagent.search(deviceWinMob) > -1 ||
        uagent.search(deviceIeMob) > -1 ||
        uagent.search(enginePie) > -1)
        return true;
    else
        return false;
}

//**************************
// Detects if the current browser is on a PalmOS device.
function DetectPalmOS()
{
    //Most devices nowadays report as 'Palm',
    //  but some older ones reported as Blazer or Xiino.
    if (uagent.search(devicePalm) > -1 ||
        uagent.search(engineBlazer) > -1 ||
        uagent.search(engineXiino) > -1)
        return true;
    else
        return false;
}

//**************************
// Sets whether S60 devices running the 
//   Open Source Browser (based on WebKit)
//   should be detected as 'mobile' or not.
//   Set TRUE to be detected as mobile.
//   Set FALSE and it will not be detected as mobile.
function SetS60GetsMobile(setMobile)
{
    s60GetsMobile = setMobile;
}

//**************************
// Sets whether iPhone/iPod Touch devices running the 
//   Open Source Browser (based on WebKit)
//   should be detected as 'mobile' or not.
//   Set TRUE to be detected as mobile.
//   Set FALSE and it will not be detected as mobile.
/*
function SetS60GetsMobile(setMobile)
{
   iphoneIpodGetsMobile = setMobile;
}
*/


//**************************
// Check to see whether the device is a 'smartphone'.
//   You might wish to send smartphones to a more capable web page
//   than a dumbed down WAP page. 
function DetectSmartphone()
{
    //First, look for iPhone and iPod Touch.
    if (DetectIphoneOrIpodOrIPad())
        return true;

    //Now, look for S60 Open Source Browser on S60 release 3 devices.
    if (DetectS60OssBrowser())
        return true;

    //Check for other Symbian devices - older S60, UIQ, other.
    if (DetectSymbianOS())
        return true;

    //Check for Windows Mobile devices.
    if (DetectWindowsMobile())
        return true;

    //Next, look for a BlackBerry
    if (DetectBlackBerry())
        return true;

    //PalmOS.
    if (DetectPalmOS())
        return true;

    //Otherwise, return false.
    return false;
}


//**************************
// Detects if the current device is a mobile device.
//  This method catches most of the popular modern devices.
function DetectMobileQuick()
{
    //Attempt to detect most mobile devices,
    //   especially mass market feature phones.
    // NOTE: Doesn't usually work reliably...
    if (uagent.search(deviceWap) > -1   ||
        uagent.search(deviceMidp) > -1 ||
        uagent.search(deviceWml) > -1  ||
        uagent.search(deviceBrew) > -1  )
        {
        return true;
    }

    //Detect for most smartphones.
    if (DetectSmartphone())
        return true;

    //Check for a NetFront browser
    if (uagent.search(engineNetfront) > -1)
        return true;

    //Check for a Playstation
    if (uagent.search(devicePlaystation) > -1)
        return true;

    //Check for a generic PDA
    if (uagent.search(devicePda) > -1)
        return true;

    return false;
}


//**************************
// Detects in a more comprehensive way if the current device is a mobile device.
function DetectMobileLonger()
{
    //Run the quick check first.
    if (DetectMobileQuick())
        return true;

    //Check for NTT Docomo
    if (uagent.search(svcDocomo) > -1)
        return true;

    //Check for KDDI
    if (uagent.search(svcKddi) > -1)
        return true;

    //Check for Nintendo DS
    if (uagent.search(deviceNintendoDs) > -1)
        return true;

    //Check for Vodafone 3G
    if (uagent.search(svcVodafone) > -1)
        return true;

    //Finally, detect for certain very old devices with stupid useragent strings.
    if (uagent.search(manuSamsung1) > -1 ||
        uagent.search(manuSonyEricsson) > -1 ||
        uagent.search(manuericsson) > -1)
        {
        return true;
    }

    return false;
}
/*
 * jQuery MD5 Plugin 1.2.1
 * https://github.com/blueimp/jQuery-MD5
 *
 * Copyright 2010, Sebastian Tschan
 * https://blueimp.net
 *
 * Licensed under the MIT license:
 * http://creativecommons.org/licenses/MIT/
 * 
 * Based on
 * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
 * Digest Algorithm, as defined in RFC 1321.
 * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009
 * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
 * Distributed under the BSD License
 * See http://pajhome.org.uk/crypt/md5 for more info.
 */

/*jslint bitwise: true */
/*global unescape, jQuery */

(function ($) {
    'use strict';

    /*
    * Add integers, wrapping at 2^32. This uses 16-bit operations internally
    * to work around bugs in some JS interpreters.
    */
    function safe_add(x, y) {
        var lsw = (x & 0xFFFF) + (y & 0xFFFF),
            msw = (x >> 16) + (y >> 16) + (lsw >> 16);
        return (msw << 16) | (lsw & 0xFFFF);
    }

    /*
    * Bitwise rotate a 32-bit number to the left.
    */
    function bit_rol(num, cnt) {
        return (num << cnt) | (num >>> (32 - cnt));
    }

    /*
    * These functions implement the four basic operations the algorithm uses.
    */
    function md5_cmn(q, a, b, x, s, t) {
        return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b);
    }
    function md5_ff(a, b, c, d, x, s, t) {
        return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);
    }
    function md5_gg(a, b, c, d, x, s, t) {
        return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);
    }
    function md5_hh(a, b, c, d, x, s, t) {
        return md5_cmn(b ^ c ^ d, a, b, x, s, t);
    }
    function md5_ii(a, b, c, d, x, s, t) {
        return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);
    }

    /*
    * Calculate the MD5 of an array of little-endian words, and a bit length.
    */
    function binl_md5(x, len) {
        /* append padding */
        x[len >> 5] |= 0x80 << ((len) % 32);
        x[(((len + 64) >>> 9) << 4) + 14] = len;

        var i, olda, oldb, oldc, oldd,
            a =  1732584193,
            b = -271733879,
            c = -1732584194,
            d =  271733878;

        for (i = 0; i < x.length; i += 16) {
            olda = a;
            oldb = b;
            oldc = c;
            oldd = d;

            a = md5_ff(a, b, c, d, x[i],       7, -680876936);
            d = md5_ff(d, a, b, c, x[i +  1], 12, -389564586);
            c = md5_ff(c, d, a, b, x[i +  2], 17,  606105819);
            b = md5_ff(b, c, d, a, x[i +  3], 22, -1044525330);
            a = md5_ff(a, b, c, d, x[i +  4],  7, -176418897);
            d = md5_ff(d, a, b, c, x[i +  5], 12,  1200080426);
            c = md5_ff(c, d, a, b, x[i +  6], 17, -1473231341);
            b = md5_ff(b, c, d, a, x[i +  7], 22, -45705983);
            a = md5_ff(a, b, c, d, x[i +  8],  7,  1770035416);
            d = md5_ff(d, a, b, c, x[i +  9], 12, -1958414417);
            c = md5_ff(c, d, a, b, x[i + 10], 17, -42063);
            b = md5_ff(b, c, d, a, x[i + 11], 22, -1990404162);
            a = md5_ff(a, b, c, d, x[i + 12],  7,  1804603682);
            d = md5_ff(d, a, b, c, x[i + 13], 12, -40341101);
            c = md5_ff(c, d, a, b, x[i + 14], 17, -1502002290);
            b = md5_ff(b, c, d, a, x[i + 15], 22,  1236535329);

            a = md5_gg(a, b, c, d, x[i +  1],  5, -165796510);
            d = md5_gg(d, a, b, c, x[i +  6],  9, -1069501632);
            c = md5_gg(c, d, a, b, x[i + 11], 14,  643717713);
            b = md5_gg(b, c, d, a, x[i],      20, -373897302);
            a = md5_gg(a, b, c, d, x[i +  5],  5, -701558691);
            d = md5_gg(d, a, b, c, x[i + 10],  9,  38016083);
            c = md5_gg(c, d, a, b, x[i + 15], 14, -660478335);
            b = md5_gg(b, c, d, a, x[i +  4], 20, -405537848);
            a = md5_gg(a, b, c, d, x[i +  9],  5,  568446438);
            d = md5_gg(d, a, b, c, x[i + 14],  9, -1019803690);
            c = md5_gg(c, d, a, b, x[i +  3], 14, -187363961);
            b = md5_gg(b, c, d, a, x[i +  8], 20,  1163531501);
            a = md5_gg(a, b, c, d, x[i + 13],  5, -1444681467);
            d = md5_gg(d, a, b, c, x[i +  2],  9, -51403784);
            c = md5_gg(c, d, a, b, x[i +  7], 14,  1735328473);
            b = md5_gg(b, c, d, a, x[i + 12], 20, -1926607734);

            a = md5_hh(a, b, c, d, x[i +  5],  4, -378558);
            d = md5_hh(d, a, b, c, x[i +  8], 11, -2022574463);
            c = md5_hh(c, d, a, b, x[i + 11], 16,  1839030562);
            b = md5_hh(b, c, d, a, x[i + 14], 23, -35309556);
            a = md5_hh(a, b, c, d, x[i +  1],  4, -1530992060);
            d = md5_hh(d, a, b, c, x[i +  4], 11,  1272893353);
            c = md5_hh(c, d, a, b, x[i +  7], 16, -155497632);
            b = md5_hh(b, c, d, a, x[i + 10], 23, -1094730640);
            a = md5_hh(a, b, c, d, x[i + 13],  4,  681279174);
            d = md5_hh(d, a, b, c, x[i],      11, -358537222);
            c = md5_hh(c, d, a, b, x[i +  3], 16, -722521979);
            b = md5_hh(b, c, d, a, x[i +  6], 23,  76029189);
            a = md5_hh(a, b, c, d, x[i +  9],  4, -640364487);
            d = md5_hh(d, a, b, c, x[i + 12], 11, -421815835);
            c = md5_hh(c, d, a, b, x[i + 15], 16,  530742520);
            b = md5_hh(b, c, d, a, x[i +  2], 23, -995338651);

            a = md5_ii(a, b, c, d, x[i],       6, -198630844);
            d = md5_ii(d, a, b, c, x[i +  7], 10,  1126891415);
            c = md5_ii(c, d, a, b, x[i + 14], 15, -1416354905);
            b = md5_ii(b, c, d, a, x[i +  5], 21, -57434055);
            a = md5_ii(a, b, c, d, x[i + 12],  6,  1700485571);
            d = md5_ii(d, a, b, c, x[i +  3], 10, -1894986606);
            c = md5_ii(c, d, a, b, x[i + 10], 15, -1051523);
            b = md5_ii(b, c, d, a, x[i +  1], 21, -2054922799);
            a = md5_ii(a, b, c, d, x[i +  8],  6,  1873313359);
            d = md5_ii(d, a, b, c, x[i + 15], 10, -30611744);
            c = md5_ii(c, d, a, b, x[i +  6], 15, -1560198380);
            b = md5_ii(b, c, d, a, x[i + 13], 21,  1309151649);
            a = md5_ii(a, b, c, d, x[i +  4],  6, -145523070);
            d = md5_ii(d, a, b, c, x[i + 11], 10, -1120210379);
            c = md5_ii(c, d, a, b, x[i +  2], 15,  718787259);
            b = md5_ii(b, c, d, a, x[i +  9], 21, -343485551);

            a = safe_add(a, olda);
            b = safe_add(b, oldb);
            c = safe_add(c, oldc);
            d = safe_add(d, oldd);
        }
        return [a, b, c, d];
    }

    /*
    * Convert an array of little-endian words to a string
    */
    function binl2rstr(input) {
        var i,
            output = '';
        for (i = 0; i < input.length * 32; i += 8) {
            output += String.fromCharCode((input[i >> 5] >>> (i % 32)) & 0xFF);
        }
        return output;
    }

    /*
    * Convert a raw string to an array of little-endian words
    * Characters >255 have their high-byte silently ignored.
    */
    function rstr2binl(input) {
        var i,
            output = [];
        output[(input.length >> 2) - 1] = undefined;
        for (i = 0; i < output.length; i += 1) {
            output[i] = 0;
        }
        for (i = 0; i < input.length * 8; i += 8) {
            output[i >> 5] |= (input.charCodeAt(i / 8) & 0xFF) << (i % 32);
        }
        return output;
    }

    /*
    * Calculate the MD5 of a raw string
    */
    function rstr_md5(s) {
        return binl2rstr(binl_md5(rstr2binl(s), s.length * 8));
    }

    /*
    * Calculate the HMAC-MD5, of a key and some data (raw strings)
    */
    function rstr_hmac_md5(key, data) {
        var i,
            bkey = rstr2binl(key),
            ipad = [],
            opad = [],
            hash;
        ipad[15] = opad[15] = undefined;                        
        if (bkey.length > 16) {
            bkey = binl_md5(bkey, key.length * 8);
        }
        for (i = 0; i < 16; i += 1) {
            ipad[i] = bkey[i] ^ 0x36363636;
            opad[i] = bkey[i] ^ 0x5C5C5C5C;
        }
        hash = binl_md5(ipad.concat(rstr2binl(data)), 512 + data.length * 8);
        return binl2rstr(binl_md5(opad.concat(hash), 512 + 128));
    }

    /*
    * Convert a raw string to a hex string
    */
    function rstr2hex(input) {
        var hex_tab = '0123456789abcdef',
            output = '',
            x,
            i;
        for (i = 0; i < input.length; i += 1) {
            x = input.charCodeAt(i);
            output += hex_tab.charAt((x >>> 4) & 0x0F) +
                hex_tab.charAt(x & 0x0F);
        }
        return output;
    }

    /*
    * Encode a string as utf-8
    */
    function str2rstr_utf8(input) {
        return unescape(encodeURIComponent(input));
    }

    /*
    * Take string arguments and return either raw or hex encoded strings
    */
    function raw_md5(s) {
        return rstr_md5(str2rstr_utf8(s));
    }
    function hex_md5(s) {
        return rstr2hex(raw_md5(s));
    }
    function raw_hmac_md5(k, d) {
        return rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d));
    }
    function hex_hmac_md5(k, d) {
        return rstr2hex(raw_hmac_md5(k, d));
    }
    
    $.md5 = function (string, key, raw) {
        if (!key) {
            if (!raw) {
                return hex_md5(string);
            } else {
                return raw_md5(string);
            }
        }
        if (!raw) {
            return hex_hmac_md5(key, string);
        } else {
            return raw_hmac_md5(key, string);
        }
    };
    
}(typeof jQuery === 'function' ? jQuery : this));/*
 * jQuery Cycle Plugin (with Transition Definitions)
 * Examples and documentation at: http://malsup.com/jquery/cycle/
 * Copyright (c) 2007-2008 M. Alsup
 * Version: 2.30 (02-NOV-2008)
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 */
;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($){8 q=\'2.30\';8 r=$.25.26&&/37 6.0/.1u(38.39);4 1n(){7(27.28&&27.28.1n)27.28.1n(\'[B] \'+3a.3b.3c.3d(2x,\'\'))};$.E.B=4(n){8 o=2x[1];O x.1s(4(){7(n===3e||n===P)n={};7(n.29==2y){3f(n){2a\'3g\':7(x.S)1v(x.S);x.S=0;$(x).1F(\'B.1M\',\'\');O;2a\'2b\':x.1g=1;O;2a\'2z\':x.1g=0;7(o===2c){n=$(x).1F(\'B.1M\');7(!n){1n(\'2A 1o 2B, 2C 1o 2z\');O}7(x.S){1v(x.S);x.S=0}1j(n.1N,n,1,1)}O;3h:n={1p:n}}}Q 7(n.29==3i){8 d=n;n=$(x).1F(\'B.1M\');7(!n){1n(\'2A 1o 2B, 2C 1o 1O 2D\');O}7(d<0||d>=n.1N.L){1n(\'3j 2D 1G: \'+d);O}n.N=d;7(x.S){1v(x.S);x.S=0}1j(n.1N,n,1,d>=n.1b);O}7(x.S)1v(x.S);x.S=0;x.1g=0;8 e=$(x);8 f=n.2d?$(n.2d,x):e.3k();8 g=f.3l();7(g.L<2){1n(\'3m; 3n 3o 3p: \'+g.L);O}8 h=$.3q({},$.E.B.2E,n||{},$.2F?e.2F():$.3r?e.1F():{});7(h.2e)h.2f=h.2g||g.L;e.1F(\'B.1M\',h);h.1w=x;h.1N=g;h.H=h.H?[h.H]:[];h.1k=h.1k?[h.1k]:[];h.1k.1P(4(){h.2h=0});7(h.1x)h.1k.J(4(){1j(g,h,0,!h.1y)});7(r&&h.1Q&&!h.2G)2i(f);8 j=x.3s;h.D=T((j.1H(/w:(\\d+)/)||[])[1])||h.D;h.C=T((j.1H(/h:(\\d+)/)||[])[1])||h.C;h.W=T((j.1H(/t:(\\d+)/)||[])[1])||h.W;7(e.u(\'1R\')==\'3t\')e.u(\'1R\',\'3u\');7(h.D)e.D(h.D);7(h.C&&h.C!=\'1S\')e.C(h.C);7(h.18)h.18=T(h.18);7(h.1l){h.1q=[];1I(8 i=0;i<g.L;i++)h.1q.J(i);h.1q.3v(4(a,b){O 3w.1l()-0.5});h.Z=0;h.18=h.1q[0]}Q 7(h.18>=g.L)h.18=0;8 k=h.18||0;f.u({1R:\'2H\',y:0,9:0}).U().1s(4(i){8 z=k?i>=k?g.L-(i-k):k-i:g.L-i;$(x).u(\'z-1G\',z)});$(g[k]).u(\'1h\',1).V();7($.25.26)g[k].2I.2J(\'2j\');7(h.1m&&h.D)f.D(h.D);7(h.1m&&h.C&&h.C!=\'1S\')f.C(h.C);7(h.2b)e.2K(4(){x.1g=1},4(){x.1g=0});8 l=$.E.B.M[h.1p];7($.2L(l))l(e,f,h);Q 7(h.1p!=\'2k\')1n(\'3x 3y: \'+h.1p);f.1s(4(){8 a=$(x);x.11=(h.1m&&h.C)?h.C:a.C();x.12=(h.1m&&h.D)?h.D:a.D()});h.A=h.A||{};h.I=h.I||{};h.G=h.G||{};f.1o(\':2l(\'+k+\')\').u(h.A);7(h.1f)$(f[k]).u(h.1f);7(h.W){h.W=T(h.W);7(h.19.29==2y)h.19=$.1p.3z[h.19]||T(h.19);7(!h.1T)h.19=h.19/2;3A((h.W-h.19)<3B)h.W+=h.19}7(h.2m)h.1U=h.1V=h.2m;7(!h.1z)h.1z=h.19;7(!h.1J)h.1J=h.19;h.2M=g.L;h.1b=k;7(h.1l){h.N=h.1b;7(++h.Z==g.L)h.Z=0;h.N=h.1q[h.Z]}Q h.N=h.18>=(g.L-1)?0:h.18+1;8 m=f[k];7(h.H.L)h.H[0].1W(m,[m,m,h,2c]);7(h.1k.L>1)h.1k[1].1W(m,[m,m,h,2c]);7(h.1K&&!h.1a)h.1a=h.1K;7(h.1a)$(h.1a).2n(\'1K\',4(){O 1O(g,h,h.1y?-1:1)});7(h.2o)$(h.2o).2n(\'1K\',4(){O 1O(g,h,h.1y?1:-1)});7(h.1r)2N(g,h);h.3C=4(a,b){8 c=$(a),s=c[0];7(!h.2g)h.2f++;g[b?\'1P\':\'J\'](s);7(h.1c)h.1c[b?\'1P\':\'J\'](s);h.2M=g.L;c.u(\'1R\',\'2H\');c[b?\'3D\':\'2O\'](e);7(b){h.1b++;h.N++}7(r&&h.1Q&&!h.2G)2i(c);7(h.1m&&h.D)c.D(h.D);7(h.1m&&h.C&&h.C!=\'1S\')f.C(h.C);s.11=(h.1m&&h.C)?h.C:c.C();s.12=(h.1m&&h.D)?h.D:c.D();c.u(h.A);7(h.1r)$.E.B.2p(g.L-1,s,$(h.1r),g,h);7(1X h.X==\'4\')h.X(c)};7(h.W||h.1x)x.S=1Y(4(){1j(g,h,0,!h.1y)},h.1x?10:h.W+(h.2P||0))})};4 1j(a,b,c,d){7(b.2h)O;8 p=b.1w,1A=a[b.1b],1a=a[b.N];7(p.S===0&&!c)O;7(!c&&!p.1g&&((b.2e&&(--b.2f<=0))||(b.1Z&&!b.1l&&b.N<b.1b))){7(b.2q)b.2q(b);O}7(c||!p.1g){7(b.H.L)$.1s(b.H,4(i,o){o.1W(1a,[1A,1a,b,d])});8 e=4(){7($.25.26&&b.1Q)x.2I.2J(\'2j\');$.1s(b.1k,4(i,o){o.1W(1a,[1A,1a,b,d])})};7(b.N!=b.1b){b.2h=1;7(b.20)b.20(1A,1a,b,e,d);Q 7($.2L($.E.B[b.1p]))$.E.B[b.1p](1A,1a,b,e);Q $.E.B.2k(1A,1a,b,e,c&&b.2Q)}7(b.1l){b.1b=b.N;7(++b.Z==a.L)b.Z=0;b.N=b.1q[b.Z]}Q{8 f=(b.N+1)==a.L;b.N=f?0:b.N+1;b.1b=f?a.L-1:b.N-1}7(b.1r)$.E.B.2r(b.1r,b.1b)}7(b.W&&!b.1x)p.S=1Y(4(){1j(a,b,0,!b.1y)},b.W);Q 7(b.1x&&p.1g)p.S=1Y(4(){1j(a,b,0,!b.1y)},10)};$.E.B.2r=4(a,b){$(a).3E(\'a\').3F(\'2R\').2j(\'a:2l(\'+b+\')\').3G(\'2R\')};4 1O(a,b,c){8 p=b.1w,W=p.S;7(W){1v(W);p.S=0}7(b.1l&&c<0){b.Z--;7(--b.Z==-2)b.Z=a.L-2;Q 7(b.Z==-1)b.Z=a.L-1;b.N=b.1q[b.Z]}Q 7(b.1l){7(++b.Z==a.L)b.Z=0;b.N=b.1q[b.Z]}Q{b.N=b.1b+c;7(b.N<0){7(b.1Z)O 21;b.N=a.L-1}Q 7(b.N>=a.L){7(b.1Z)O 21;b.N=0}}7(b.22&&1X b.22==\'4\')b.22(c>0,b.N,a[b.N]);1j(a,b,1,c>=0);O 21};4 2N(a,b){8 c=$(b.1r);$.1s(a,4(i,o){$.E.B.2p(i,o,c,a,b)});$.E.B.2r(b.1r,b.18)};$.E.B.2p=4(i,a,b,c,d){8 e=(1X d.2s==\'4\')?$(d.2s(i,a)):$(\'<a 3H="#">\'+(i+1)+\'</a>\');7(e.3I(\'3J\').L==0)e.2O(b);e.2n(d.2S,4(){d.N=i;8 p=d.1w,W=p.S;7(W){1v(W);p.S=0}7(1X d.2t==\'4\')d.2t(d.N,c[d.N]);1j(c,d,1,d.1b<i);O 21});7(d.2T)e.2K(4(){d.1w.1g=1},4(){d.1w.1g=0})};4 2i(b){4 23(s){8 s=T(s).3K(16);O s.L<2?\'0\'+s:s};4 2U(e){1I(;e&&e.3L.3M()!=\'3N\';e=e.3O){8 v=$.u(e,\'2V-2W\');7(v.3P(\'3Q\')>=0){8 a=v.1H(/\\d+/g);O\'#\'+23(a[0])+23(a[1])+23(a[2])}7(v&&v!=\'3R\')O v}O\'#3S\'};b.1s(4(){$(x).u(\'2V-2W\',2U(x))})};$.E.B.2k=4(a,b,c,d,e){8 f=$(a),$n=$(b);$n.u(c.A);8 g=e?1:c.1z;8 h=e?1:c.1J;8 i=e?P:c.1U;8 j=e?P:c.1V;8 k=4(){$n.24(c.I,g,i,d)};f.24(c.G,h,j,4(){7(c.K)f.u(c.K);7(!c.1T)k()});7(c.1T)k()};$.E.B.M={2X:4(b,c,d){c.1o(\':2l(\'+d.18+\')\').u(\'1h\',0);d.H.J(4(){$(x).V()});d.I={1h:1};d.G={1h:0};d.A={1h:0};d.K={R:\'Y\'};d.X=4(a){a.U()}}};$.E.B.3T=4(){O q};$.E.B.2E={1p:\'2X\',W:3U,1x:0,19:3V,1z:P,1J:P,1a:P,2o:P,22:P,1r:P,2t:P,2S:\'1K\',2s:P,H:P,1k:P,2q:P,2m:P,1U:P,1V:P,1L:P,I:P,G:P,A:P,K:P,20:P,C:\'1S\',18:0,1T:1,1l:0,1m:0,2b:0,2T:0,2e:0,2g:0,2P:0,2d:P,1Q:0,1Z:0,2Q:0}})(2Y);(4($){$.E.B.M.3W=4(d,e,f){d.u(\'17\',\'1d\');f.H.J(4(a,b,c){$(x).V();c.A.y=b.1B;c.G.y=0-a.1B});f.1f={y:0};f.I={y:0};f.K={R:\'Y\'}};$.E.B.M.3X=4(d,e,f){d.u(\'17\',\'1d\');f.H.J(4(a,b,c){$(x).V();c.A.y=0-b.1B;c.G.y=a.1B});f.1f={y:0};f.I={y:0};f.K={R:\'Y\'}};$.E.B.M.3Y=4(d,e,f){d.u(\'17\',\'1d\');f.H.J(4(a,b,c){$(x).V();c.A.9=b.1C;c.G.9=0-a.1C});f.1f={9:0};f.I={9:0}};$.E.B.M.3Z=4(d,e,f){d.u(\'17\',\'1d\');f.H.J(4(a,b,c){$(x).V();c.A.9=0-b.1C;c.G.9=a.1C});f.1f={9:0};f.I={9:0}};$.E.B.M.40=4(f,g,h){f.u(\'17\',\'1d\').D();h.H.J(4(a,b,c,d){$(x).V();8 e=a.1C,2u=b.1C;c.A=d?{9:2u}:{9:-2u};c.I.9=0;c.G.9=d?-e:e;g.1o(a).u(c.A)});h.1f={9:0};h.K={R:\'Y\'}};$.E.B.M.41=4(f,g,h){f.u(\'17\',\'1d\');h.H.J(4(a,b,c,d){$(x).V();8 e=a.1B,2v=b.1B;c.A=d?{y:-2v}:{y:2v};c.I.y=0;c.G.y=d?e:-e;g.1o(a).u(c.A)});h.1f={y:0};h.K={R:\'Y\'}};$.E.B.M.42=4(d,e,f){f.H.J(4(a,b,c){$(a).u(\'F\',1)});f.X=4(a){a.U()};f.A={F:2};f.I={D:\'V\'};f.G={D:\'U\'}};$.E.B.M.43=4(d,e,f){f.H.J(4(a,b,c){$(a).u(\'F\',1)});f.X=4(a){a.U()};f.A={F:2};f.I={C:\'V\'};f.G={C:\'U\'}};$.E.B.M.1L=4(g,h,j){8 w=g.u(\'17\',\'2Z\').D();h.u({9:0,y:0});j.H.J(4(){$(x).V()});j.19=j.19/2;j.1l=0;j.1L=j.1L||{9:-w,y:15};j.1c=[];1I(8 i=0;i<h.L;i++)j.1c.J(h[i]);1I(8 i=0;i<j.18;i++)j.1c.J(j.1c.31());j.20=4(a,b,c,d,e){8 f=e?$(a):$(b);f.24(c.1L,c.1z,c.1U,4(){e?c.1c.J(c.1c.31()):c.1c.1P(c.1c.44());7(e)1I(8 i=0,2w=c.1c.L;i<2w;i++)$(c.1c[i]).u(\'z-1G\',2w-i);Q{8 z=$(a).u(\'z-1G\');f.u(\'z-1G\',T(z)+1)}f.24({9:0,y:0},c.1J,c.1V,4(){$(e?x:a).U();7(d)d()})})};j.X=4(a){a.U()}};$.E.B.M.45=4(d,e,f){f.H.J(4(a,b,c){$(x).V();c.A.y=b.11;c.I.C=b.11});f.X=4(a){a.U()};f.1f={y:0};f.A={C:0};f.I={y:0};f.G={C:0};f.K={R:\'Y\'}};$.E.B.M.46=4(d,e,f){f.H.J(4(a,b,c){$(x).V();c.I.C=b.11;c.G.y=a.11});f.X=4(a){a.U()};f.1f={y:0};f.A={y:0,C:0};f.G={C:0};f.K={R:\'Y\'}};$.E.B.M.47=4(d,e,f){f.H.J(4(a,b,c){$(x).V();c.A.9=b.12;c.I.D=b.12});f.X=4(a){a.U()};f.A={D:0};f.I={9:0};f.G={D:0};f.K={R:\'Y\'}};$.E.B.M.48=4(d,e,f){f.H.J(4(a,b,c){$(x).V();c.I.D=b.12;c.G.9=a.12});f.X=4(a){a.U()};f.A={9:0,D:0};f.I={9:0};f.G={D:0};f.K={R:\'Y\'}};$.E.B.M.32=4(d,e,f){f.1f={y:0,9:0};f.K={R:\'Y\'};f.H.J(4(a,b,c){$(x).V();c.A={D:0,C:0,y:b.11/2,9:b.12/2};c.K={R:\'Y\'};c.I={y:0,9:0,D:b.12,C:b.11};c.G={D:0,C:0,y:a.11/2,9:a.12/2};$(a).u(\'F\',2);$(b).u(\'F\',1)});f.X=4(a){a.U()}};$.E.B.M.49=4(d,e,f){f.H.J(4(a,b,c){c.A={D:0,C:0,1h:1,9:b.12/2,y:b.11/2,F:1};c.I={y:0,9:0,D:b.12,C:b.11}});f.G={1h:0};f.K={F:0}};$.E.B.M.4a=4(d,e,f){8 w=d.u(\'17\',\'1d\').D();e.V();f.H.J(4(a,b,c){$(a).u(\'F\',1)});f.A={9:w,F:2};f.K={F:1};f.I={9:0};f.G={9:w}};$.E.B.M.4b=4(d,e,f){8 h=d.u(\'17\',\'1d\').C();e.V();f.H.J(4(a,b,c){$(a).u(\'F\',1)});f.A={y:h,F:2};f.K={F:1};f.I={y:0};f.G={y:h}};$.E.B.M.4c=4(d,e,f){8 h=d.u(\'17\',\'1d\').C();8 w=d.D();e.V();f.H.J(4(a,b,c){$(a).u(\'F\',1)});f.A={y:h,9:w,F:2};f.K={F:1};f.I={y:0,9:0};f.G={y:h,9:w}};$.E.B.M.4d=4(d,e,f){f.H.J(4(a,b,c){c.A={9:x.12/2,D:0,F:2};c.I={9:0,D:x.12};c.G={9:0};$(a).u(\'F\',1)});f.X=4(a){a.U().u(\'F\',1)}};$.E.B.M.4e=4(d,e,f){f.H.J(4(a,b,c){c.A={y:x.11/2,C:0,F:2};c.I={y:0,C:x.11};c.G={y:0};$(a).u(\'F\',1)});f.X=4(a){a.U().u(\'F\',1)}};$.E.B.M.4f=4(d,e,f){f.H.J(4(a,b,c){c.A={9:b.12/2,D:0,F:1,R:\'1D\'};c.I={9:0,D:x.12};c.G={9:a.12/2,D:0};$(a).u(\'F\',2)});f.X=4(a){a.U()};f.K={F:1,R:\'Y\'}};$.E.B.M.4g=4(d,e,f){f.H.J(4(a,b,c){c.A={y:b.11/2,C:0,F:1,R:\'1D\'};c.I={y:0,C:x.11};c.G={y:a.11/2,C:0};$(a).u(\'F\',2)});f.X=4(a){a.U()};f.K={F:1,R:\'Y\'}};$.E.B.M.4h=4(e,f,g){8 d=g.33||\'9\';8 w=e.u(\'17\',\'1d\').D();8 h=e.C();g.H.J(4(a,b,c){c.A=c.A||{};c.A.F=2;c.A.R=\'1D\';7(d==\'34\')c.A.9=-w;Q 7(d==\'35\')c.A.y=h;Q 7(d==\'36\')c.A.y=-h;Q c.A.9=w;$(a).u(\'F\',1)});7(!g.I)g.I={9:0,y:0};7(!g.G)g.G={9:0,y:0};g.K=g.K||{};g.K.F=2;g.K.R=\'Y\'};$.E.B.M.4i=4(e,f,g){8 d=g.33||\'9\';8 w=e.u(\'17\',\'1d\').D();8 h=e.C();g.H.J(4(a,b,c){c.A.R=\'1D\';7(d==\'34\')c.G.9=w;Q 7(d==\'35\')c.G.y=-h;Q 7(d==\'36\')c.G.y=h;Q c.G.9=-w;$(a).u(\'F\',2);$(b).u(\'F\',1)});g.X=4(a){a.U()};7(!g.I)g.I={9:0,y:0};g.A=g.A||{};g.A.y=0;g.A.9=0;g.K=g.K||{};g.K.F=1;g.K.R=\'Y\'};$.E.B.M.4j=4(d,e,f){8 w=d.u(\'17\',\'2Z\').D();8 h=d.C();f.H.J(4(a,b,c){$(a).u(\'F\',2);c.A.R=\'1D\';7(!c.G.9&&!c.G.y)c.G={9:w*2,y:-h/2,1h:0};Q c.G.1h=0});f.X=4(a){a.U()};f.A={9:0,y:0,F:1,1h:1};f.I={9:0};f.K={F:2,R:\'Y\'}};$.E.B.M.4k=4(o,p,q){8 w=o.u(\'17\',\'1d\').D();8 h=o.C();q.A=q.A||{};8 s;7(q.1i){7(/4l/.1u(q.1i))s=\'1t(1e 1e \'+h+\'14 1e)\';Q 7(/4m/.1u(q.1i))s=\'1t(1e \'+w+\'14 \'+h+\'14 \'+w+\'14)\';Q 7(/4n/.1u(q.1i))s=\'1t(1e \'+w+\'14 1e 1e)\';Q 7(/4o/.1u(q.1i))s=\'1t(\'+h+\'14 \'+w+\'14 \'+h+\'14 1e)\';Q 7(/32/.1u(q.1i)){8 t=T(h/2);8 l=T(w/2);s=\'1t(\'+t+\'14 \'+l+\'14 \'+t+\'14 \'+l+\'14)\'}}q.A.1i=q.A.1i||s||\'1t(1e 1e 1e 1e)\';8 d=q.A.1i.1H(/(\\d+)/g);8 t=T(d[0]),r=T(d[1]),b=T(d[2]),l=T(d[3]);q.H.J(4(g,i,j){7(g==i)O;8 k=$(g).u(\'F\',2);8 m=$(i).u({F:3,R:\'1D\'});8 n=1,1E=T((j.1z/13))-1;4 f(){8 a=t?t-T(n*(t/1E)):0;8 c=l?l-T(n*(l/1E)):0;8 d=b<h?b+T(n*((h-b)/1E||1)):h;8 e=r<w?r+T(n*((w-r)/1E||1)):w;m.u({1i:\'1t(\'+a+\'14 \'+e+\'14 \'+d+\'14 \'+c+\'14)\'});(n++<=1E)?1Y(f,13):k.u(\'R\',\'Y\')}f()});q.K={};q.I={9:0};q.G={9:0}}})(2Y);',62,273,'||||function|||if|var|left|||||||||||||||||||||css|||this|top||cssBefore|cycle|height|width|fn|zIndex|animOut|before|animIn|push|cssAfter|length|transitions|nextSlide|return|null|else|display|cycleTimeout|parseInt|hide|show|timeout|onAddSlide|none|randomIndex||cycleH|cycleW||px|||overflow|startingSlide|speed|next|currSlide|els|hidden|0px|cssFirst|cyclePause|opacity|clip|go|after|random|fit|log|not|fx|randomMap|pager|each|rect|test|clearTimeout|container|continuous|rev|speedIn|curr|offsetHeight|offsetWidth|block|count|data|index|match|for|speedOut|click|shuffle|opts|elements|advance|unshift|cleartype|position|auto|sync|easeIn|easeOut|apply|typeof|setTimeout|nowrap|fxFn|false|prevNextClick|hex|animate|browser|msie|window|console|constructor|case|pause|true|slideExpr|autostop|countdown|autostopCount|busy|clearTypeFix|filter|custom|eq|easing|bind|prev|createPagerAnchor|end|updateActivePagerLink|pagerAnchorBuilder|pagerClick|nextW|nextH|len|arguments|String|resume|options|found|can|slide|defaults|metadata|cleartypeNoBg|absolute|style|removeAttribute|hover|isFunction|slideCount|buildPager|appendTo|delay|fastOnEvent|activeSlide|pagerEvent|pauseOnPagerHover|getBg|background|color|fade|jQuery|visible||shift|zoom|direction|right|up|down|MSIE|navigator|userAgent|Array|prototype|join|call|undefined|switch|stop|default|Number|invalid|children|get|terminating|too|few|slides|extend|meta|className|static|relative|sort|Math|unknown|transition|speeds|while|250|addSlide|prependTo|find|removeClass|addClass|href|parents|body|toString|nodeName|toLowerCase|html|parentNode|indexOf|rgb|transparent|ffffff|ver|4000|1000|scrollUp|scrollDown|scrollLeft|scrollRight|scrollHorz|scrollVert|slideX|slideY|pop|turnUp|turnDown|turnLeft|turnRight|fadeZoom|blindX|blindY|blindZ|growX|growY|curtainX|curtainY|cover|uncover|toss|wipe|l2r|r2l|t2b|b2t'.split('|'),0,{}));
/**
 * jQuery Ajax Rater Plugin
 *
 * This rater is based on the code Ritesh Agrawal did. Unfortunatly his CSS and the hover technique breaks in some browsers.
 * So i thought, why not use the best CSS star-rater known to man kind and throw it in the mix.
 * I have used the CSS and technique from Komodo Media since it is stable and tested on many, many browsers.
 *
 * This rater compared, has no cancel button. But i think we can live with that :)
 * To avoid conflicts i have changed the function name.
 *
 * Licensed under The MIT License
 *
 * @version     1.0
 * @since       03.01.2007
 * @author      Kjell Bublitz <m3nt0r.de@gmail.com
 * @link        http://www.m3nt0r.de/devel/raterDemo/ Demonstration and Documentation
 * @link        http://php.scripts.psu.edu/rja171/widgets/rating.php Based on Ritesh Agrawal Star Rating System
 * @link        http://komodomedia.com/blog/index.php/2007/01/20/css-star-rating-redux/ The Komodo Media CSS Rater Blogpost
 * @license     http://www.opensource.org/licenses/mit-license.php MIT
 * @package     jQuery Plugins
 * @subpackage  Rater
 */

/**
 * Usage: jQuery('#rating').rater('your_servlet', {style:'basic', maxvalue:5, curvalue:0});
 *
 * @param url The address you want to post the result to.
 * @param options The style and value attributes
 * @param offline Wehter to send request or not
 *
 * Valid options:
 * ---------------------------------------
 *       style:       'basic', 'inline' OR 'small'
 *       maxvalue:    the maximum value / number of stars
 *       curvalue:    the initial value / selected stars
 */
jQuery.fn.rater = function(url, options, offline)
{
    if(url == null && offline !== true) return;

    var settings = {
        url       : url, // post changes to
        maxvalue  : 5,   // max number of stars
        curvalue  : 0,    // number of selected stars
        alreadyRated: false
    };

    if(offline === true){
        jQuery(function(){
            jQuery('input[name="' + url + '"]').val(settings.curvalue);
        });
    }

    if(options) { jQuery.extend(settings, options); }
    jQuery.extend(settings, {cancel: (settings.maxvalue > 1) ? true : false});

    var container = jQuery(this);
    jQuery.extend(container, { averageRating: settings.curvalue, url: settings.url });

    var raterwidth, ratingparent;

    if(!settings.style || settings.style == null || settings.style == 'basic') {
        raterwidth = settings.maxvalue * 25;
        ratingparent = '<ul class="star-rating" style="width:'+raterwidth+'px">';
    }
    if(settings.style == 'small') {
        raterwidth = settings.maxvalue * 16;
        ratingparent = '<ul class="star-rating small-star" style="width:'+raterwidth+'px">';
    }
    if(settings.style == 'inline') {
        raterwidth = settings.maxvalue * 16;
        ratingparent = '<span class="inline-rating"><ul class="star-rating small-star" style="width:'+raterwidth+'px">';
    }
    container.append(ratingparent);

    // create rater
    var starWidth, starIndex, listitems = '';
    var curvalueWidth = Math.floor(100 / settings.maxvalue * settings.curvalue);
    for(var i = 0; i <= settings.maxvalue ; i++) {
        if (i == 0) {
            listitems+='<li class="current-rating" style="width:'+curvalueWidth+'%;">'+settings.curvalue+'/'+settings.maxvalue+'</li>';
        } else {
            starWidth = Math.floor(100 / settings.maxvalue * i);
            starIndex = (settings.maxvalue - i) + 2;
            listitems+='<li class="star"><a href="#'+i+'" title="'+i+'/'+settings.maxvalue +'" style="width:'+starWidth+'%;z-index:'+starIndex+'">'+i+'</a></li>';
        }
    }
    container.find('.star-rating').append(listitems); // i am using find here, because the span wrapped in the small style would break children()

    if(settings.maxvalue > 1) // add a container for the ajax result
    {
        container.append('<span class="star-rating-result"></span>');
    }
    var stars = jQuery(container).find('.star-rating').children('.star');
    if(!settings.alreadyRated){
        stars.click(function()
        {

            if(settings.maxvalue == 1) // on / off
            {
                settings.curvalue = (settings.curvalue == 0) ? 1 : 0;
                jQuery(container).find('.star-rating').children('.current-rating').css({width:(settings.curvalue*100)+'%'});
                if(offline === true){
                    jQuery('input[name="' + url + '"]').val(settings.curvalue);
                    jQuery('.current-rating', container).css({width:(raterValue*20)+'%'});
                    return true;
                }else{
                    jQuery.post(container.url, { "rating": settings.curvalue });
                }
                return false;
            }
            else
            {
                settings.curvalue = stars.index(this) + 1;
                var raterValue = jQuery(this).children('a')[0].href.split('#')[1];
                if(offline === true){
                    jQuery('input[name="' + url + '"]').val(raterValue);
                    jQuery('.current-rating', container).css({width:(raterValue*20)+'%'});
                    if(settings.onchange !== undefined){
                        settings.onchange(raterValue);
                    }
                    return false;
                }else{
                    jQuery.post(container.url, { "rating": raterValue }, function(response){
                        jQuery('.star').remove();
                        jQuery('.current-rating').css({width:(response*20)+'%'});
                        //jQuery('.current-rating').css('width',(100/settings.maxvalue)*response+'%');
                        container.children('.star-rating-result').html('');
                        window.location.reload();
                    });
                }
                return false;
            }
            return true;
        });
    }else{
        jQuery('.star').remove();
        jQuery('.current-rating').css({width:(settings.curvalue*20)+'%'});
        container.children('.star-rating-result').html('');
    }

    return this; // strict warning: anonymous function does not always return a value. fix?
};/**
 * jQuery lightBox plugin
 * This jQuery plugin was inspired and based on Lightbox 2 by Lokesh Dhakar (http://www.huddletogether.com/projects/lightbox2/)
 * and adapted to me for use like a plugin from jQuery.
 * @name jquery-lightbox-0.5.js
 * @author Leandro Vieira Pinho - http://leandrovieira.com
 * @version 0.5
 * @date April 11, 2008
 * @category jQuery plugin
 * @copyright (c) 2008 Leandro Vieira Pinho (leandrovieira.com)
 * @license CCAttribution-ShareAlike 2.5 Brazil - http://creativecommons.org/licenses/by-sa/2.5/br/deed.en_US
 * @example Visit http://leandrovieira.com/projects/jquery/lightbox/ for more informations about this jQuery plugin
 */
(function($){$.fn.lightBox=function(settings){settings=jQuery.extend({overlayBgColor:'#000',overlayOpacity:0.8,fixedNavigation:false,imageLoading:'images/lightbox-ico-loading.gif',imageBtnPrev:'images/lightbox-btn-prev.gif',imageBtnNext:'images/lightbox-btn-next.gif',imageBtnClose:'images/lightbox-btn-close.gif',imageBlank:'images/lightbox-blank.gif',containerBorderSize:10,containerResizeSpeed:400,txtImage:'Image',txtOf:'of',keyToClose:'c',keyToPrev:'p',keyToNext:'n',imageArray:[],activeImage:0},settings);var jQueryMatchedObj=this;function _initialize(){_start(this,jQueryMatchedObj);return false;}
function _start(objClicked,jQueryMatchedObj){$('embed, object, select').css({'visibility':'hidden'});_set_interface();settings.imageArray.length=0;settings.activeImage=0;if(jQueryMatchedObj.length==1){settings.imageArray.push(new Array(objClicked.getAttribute('href'),objClicked.getAttribute('title')));}else{for(var i=0;i<jQueryMatchedObj.length;i++){settings.imageArray.push(new Array(jQueryMatchedObj[i].getAttribute('href'),jQueryMatchedObj[i].getAttribute('title')));}}
while(settings.imageArray[settings.activeImage][0]!=objClicked.getAttribute('href')){settings.activeImage++;}
_set_image_to_view();}
function _set_interface(){$('body').append('<div id="jquery-overlay"></div><div id="jquery-lightbox"><div id="lightbox-container-image-box"><div id="lightbox-container-image"><img id="lightbox-image"><div style="" id="lightbox-nav"><a href="#" id="lightbox-nav-btnPrev"></a><a href="#" id="lightbox-nav-btnNext"></a></div><div id="lightbox-loading"><a href="#" id="lightbox-loading-link"><img src="'+settings.imageLoading+'"></a></div></div></div><div id="lightbox-container-image-data-box"><div id="lightbox-container-image-data"><div id="lightbox-image-details"><span id="lightbox-image-details-caption"></span><span id="lightbox-image-details-currentNumber"></span></div><div id="lightbox-secNav"><a href="#" id="lightbox-secNav-btnClose"><img src="'+settings.imageBtnClose+'"></a></div></div></div></div>');var arrPageSizes=___getPageSize();$('#jquery-overlay').css({backgroundColor:settings.overlayBgColor,opacity:settings.overlayOpacity,width:arrPageSizes[0],height:arrPageSizes[1]}).fadeIn();var arrPageScroll=___getPageScroll();$('#jquery-lightbox').css({top:arrPageScroll[1]+(arrPageSizes[3]/10),left:arrPageScroll[0]}).show();$('#jquery-overlay,#jquery-lightbox').click(function(){_finish();});$('#lightbox-loading-link,#lightbox-secNav-btnClose').click(function(){_finish();return false;});$(window).resize(function(){var arrPageSizes=___getPageSize();$('#jquery-overlay').css({width:arrPageSizes[0],height:arrPageSizes[1]});var arrPageScroll=___getPageScroll();$('#jquery-lightbox').css({top:arrPageScroll[1]+(arrPageSizes[3]/10),left:arrPageScroll[0]});});}
function _set_image_to_view(){$('#lightbox-loading').show();if(settings.fixedNavigation){$('#lightbox-image,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide();}else{$('#lightbox-image,#lightbox-nav,#lightbox-nav-btnPrev,#lightbox-nav-btnNext,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide();}
var objImagePreloader=new Image();objImagePreloader.onload=function(){$('#lightbox-image').attr('src',settings.imageArray[settings.activeImage][0]);_resize_container_image_box(objImagePreloader.width,objImagePreloader.height);objImagePreloader.onload=function(){};};objImagePreloader.src=settings.imageArray[settings.activeImage][0];};function _resize_container_image_box(intImageWidth,intImageHeight){var intCurrentWidth=$('#lightbox-container-image-box').width();var intCurrentHeight=$('#lightbox-container-image-box').height();var intWidth=(intImageWidth+(settings.containerBorderSize*2));var intHeight=(intImageHeight+(settings.containerBorderSize*2));var intDiffW=intCurrentWidth-intWidth;var intDiffH=intCurrentHeight-intHeight;$('#lightbox-container-image-box').animate({width:intWidth,height:intHeight},settings.containerResizeSpeed,function(){_show_image();});if((intDiffW==0)&&(intDiffH==0)){if($.browser.msie){___pause(250);}else{___pause(100);}}
$('#lightbox-container-image-data-box').css({width:intImageWidth});$('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({height:intImageHeight+(settings.containerBorderSize*2)});};function _show_image(){$('#lightbox-loading').hide();$('#lightbox-image').fadeIn(function(){_show_image_data();_set_navigation();});_preload_neighbor_images();};function _show_image_data(){$('#lightbox-container-image-data-box').slideDown('fast');$('#lightbox-image-details-caption').hide();if(settings.imageArray[settings.activeImage][1]){$('#lightbox-image-details-caption').html(settings.imageArray[settings.activeImage][1]).show();}
if(settings.imageArray.length>1){$('#lightbox-image-details-currentNumber').html(settings.txtImage+' '+(settings.activeImage+1)+' '+settings.txtOf+' '+settings.imageArray.length).show();}}
function _set_navigation(){$('#lightbox-nav').show();$('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({'background':'transparent url('+settings.imageBlank+') no-repeat'});if(settings.activeImage!=0){if(settings.fixedNavigation){$('#lightbox-nav-btnPrev').css({'background':'url('+settings.imageBtnPrev+') left 15% no-repeat'}).unbind().bind('click',function(){settings.activeImage=settings.activeImage-1;_set_image_to_view();return false;});}else{$('#lightbox-nav-btnPrev').unbind().hover(function(){$(this).css({'background':'url('+settings.imageBtnPrev+') left 15% no-repeat'});},function(){$(this).css({'background':'transparent url('+settings.imageBlank+') no-repeat'});}).show().bind('click',function(){settings.activeImage=settings.activeImage-1;_set_image_to_view();return false;});}}
if(settings.activeImage!=(settings.imageArray.length-1)){if(settings.fixedNavigation){$('#lightbox-nav-btnNext').css({'background':'url('+settings.imageBtnNext+') right 15% no-repeat'}).unbind().bind('click',function(){settings.activeImage=settings.activeImage+1;_set_image_to_view();return false;});}else{$('#lightbox-nav-btnNext').unbind().hover(function(){$(this).css({'background':'url('+settings.imageBtnNext+') right 15% no-repeat'});},function(){$(this).css({'background':'transparent url('+settings.imageBlank+') no-repeat'});}).show().bind('click',function(){settings.activeImage=settings.activeImage+1;_set_image_to_view();return false;});}}
_enable_keyboard_navigation();}
function _enable_keyboard_navigation(){$(document).keydown(function(objEvent){_keyboard_action(objEvent);});}
function _disable_keyboard_navigation(){$(document).unbind();}
function _keyboard_action(objEvent){if(objEvent==null){keycode=event.keyCode;escapeKey=27;}else{keycode=objEvent.keyCode;escapeKey=objEvent.DOM_VK_ESCAPE;}
key=String.fromCharCode(keycode).toLowerCase();if((key==settings.keyToClose)||(key=='x')||(keycode==escapeKey)){_finish();}
if((key==settings.keyToPrev)||(keycode==37)){if(settings.activeImage!=0){settings.activeImage=settings.activeImage-1;_set_image_to_view();_disable_keyboard_navigation();}}
if((key==settings.keyToNext)||(keycode==39)){if(settings.activeImage!=(settings.imageArray.length-1)){settings.activeImage=settings.activeImage+1;_set_image_to_view();_disable_keyboard_navigation();}}}
function _preload_neighbor_images(){if((settings.imageArray.length-1)>settings.activeImage){objNext=new Image();objNext.src=settings.imageArray[settings.activeImage+1][0];}
if(settings.activeImage>0){objPrev=new Image();objPrev.src=settings.imageArray[settings.activeImage-1][0];}}
function _finish(){$('#jquery-lightbox').remove();$('#jquery-overlay').fadeOut(function(){$('#jquery-overlay').remove();});$('embed, object, select').css({'visibility':'visible'});}
function ___getPageSize(){var xScroll,yScroll;if(window.innerHeight&&window.scrollMaxY){xScroll=window.innerWidth+window.scrollMaxX;yScroll=window.innerHeight+window.scrollMaxY;}else if(document.body.scrollHeight>document.body.offsetHeight){xScroll=document.body.scrollWidth;yScroll=document.body.scrollHeight;}else{xScroll=document.body.offsetWidth;yScroll=document.body.offsetHeight;}
var windowWidth,windowHeight;if(self.innerHeight){if(document.documentElement.clientWidth){windowWidth=document.documentElement.clientWidth;}else{windowWidth=self.innerWidth;}
windowHeight=self.innerHeight;}else if(document.documentElement&&document.documentElement.clientHeight){windowWidth=document.documentElement.clientWidth;windowHeight=document.documentElement.clientHeight;}else if(document.body){windowWidth=document.body.clientWidth;windowHeight=document.body.clientHeight;}
if(yScroll<windowHeight){pageHeight=windowHeight;}else{pageHeight=yScroll;}
if(xScroll<windowWidth){pageWidth=xScroll;}else{pageWidth=windowWidth;}
arrayPageSize=new Array(pageWidth,pageHeight,windowWidth,windowHeight);return arrayPageSize;};function ___getPageScroll(){var xScroll,yScroll;if(self.pageYOffset){yScroll=self.pageYOffset;xScroll=self.pageXOffset;}else if(document.documentElement&&document.documentElement.scrollTop){yScroll=document.documentElement.scrollTop;xScroll=document.documentElement.scrollLeft;}else if(document.body){yScroll=document.body.scrollTop;xScroll=document.body.scrollLeft;}
arrayPageScroll=new Array(xScroll,yScroll);return arrayPageScroll;};function ___pause(ms){var date=new Date();curDate=null;do{var curDate=new Date();}
while(curDate-date<ms);};return this.unbind('click').click(_initialize);};})(jQuery);
var ape={debug:false,version:'0.1'};ape.Debug={debug:jQuery.noop,info:jQuery.noop,warn:jQuery.noop,error:jQuery.noop,log:jQuery.noop,time:jQuery.noop,timeEnd:jQuery.noop,profile:jQuery.noop,profileEnd:jQuery.noop,trace:jQuery.noop,group:jQuery.noop,groupEnd:jQuery.noop,dir:jQuery.noop,dirxml:jQuery.noop,assert:jQuery.noop,clear:jQuery.noop,count:jQuery.noop};if(typeof console==='undefined'){var console=ape.Debug;}
ape.Listeners={listeners:{},init:function(selector){if(typeof selector==='undefined'){selector=document;}
if(!selector instanceof jQuery){selector=jQuery(selector);}
for(var i=1;i<=9;i++){if(!ape.Listeners.listeners[i]){continue;}
for(var j in ape.Listeners.listeners[i]){var listener=ape.Listeners.listeners[i][j];if(ape.debug)console.log('Processing listener:',listener.name);var elements=selector.find('.'+listener.name);if(elements.length>0){try{listener.callback(jQuery(elements));}catch(e){if(console&&console.debug&&window.location.hostname.slice(-3,window.location.hostname.length)=='dev'){console.debug('Error in listener '+listener.name);console.debug(e);}}}
if(ape.debug)console.log('Executed listener:',listener.name,elements);}}
PHPFOX.load();},addListener:function(name,callback,priority){if(!jQuery.isFunction(callback)){return false;}
priority=(typeof priority==='undefined'||priority>9)?9:priority;if(!ape.Listeners.listeners[priority]){ape.Listeners.listeners[priority]=[];}
ape.Listeners.listeners[priority].push({priority:priority,name:name,callback:callback});if(ape.debug)console.debug('Added listener:',name,callback,priority);return true;}};jQuery(document).ready(ape.Listeners.init);ape.Ajax={initExchange:function(ref){ref.each(function(){jQuery(this).unbind('click.ajax_exchange').bind('click.ajax_exchange',ape.Ajax.exchangeCallback);});},exchangeCallback:function(){var widget=jQuery(this).parents('.cma_widget'),url=jQuery(this).attr('rel'),target=jQuery(this).attr('rev');ape.Widget.enableOverlayLoader(widget);jQuery.get(url,{},function(response){jQuery('#'+target).html(response);ape.Listeners.init(jQuery('#'+target));ape.Widget.disableOverlayLoader(widget);},'html');}};ape.Form={getValuesOf:function(form,values){if(typeof values==undefined||values==undefined){values={};}
values=this.getInputValuesOf(form,values);values=this.getTextareaValuesOf(form,values);values=this.getDropdownValuesOf(form,values);values=this.getRadioValuesOf(form,values);values=this.getCheckboxValuesOf(form,values);return values;},getInputValuesOf:function(form,values){if(typeof values!=='object'){values={};}
jQuery('input[type="text"]',form).each(function(index,item){item=jQuery(item);values[item.attr('name')]=item.val();});jQuery('input[type="password"]',form).each(function(index,item){item=jQuery(item);values[item.attr('name')]=item.val();});jQuery('input[type="hidden"]',form).each(function(index,item){item=jQuery(item);values[item.attr('name')]=item.val();});return values;},getTextareaValuesOf:function(form,values){if(typeof values!=='object'){values={};}
jQuery('textarea',form).each(function(index,item){item=jQuery(item);values[item.attr('name')]=item.val();});return values;},getDropdownValuesOf:function(form,values){if(typeof values!=='object'){values={};}
jQuery('select',form).each(function(index,item){item=jQuery(item);values[item.attr('name')]=item.val();});return values;},getRadioValuesOf:function(form,values){if(typeof values!=='object'){values={};}
jQuery('input[type="radio"]',form).each(function(index,item){item=jQuery(item);if(item.is(':checked')){values[item.attr('name')]=item.val();}
if(values[item.attr('name')]==undefined){values[item.attr('name')]=0;}});return values;},getCheckboxValuesOf:function(form,values){if(typeof values!=='object'){values={};}
jQuery('input[type="checkbox"]',form).each(function(index,item){item=jQuery(item);values[item.attr('name')]=item.is(':checked')?1:0;});return values;},submitFormListener:function(e){var code=(e.keyCode?e.keyCode:e.which);if(code==13){jQuery(this).parentsUntil('form.is_submitable, form.is_submittable').submit();}},submitButtonFormListener:function(e){var form=jQuery(this).parentsUntil('form.is_submitable, form.is_submittable');var submit=jQuery('input[type="submit"]',form);if(submit.length>0){jQuery('input[type="submit"]',form).click();}else{form.submit();}
return false;},dateFormListener:function(e){var dateContainer=jQuery(this).parent();var day=jQuery('.is_day',dateContainer).val();var month=jQuery('.is_month',dateContainer).val();var year=jQuery('.is_year',dateContainer).val();if(day&&month&&year){jQuery('.is_date',dateContainer).val(day+'.'+month+'.'+year);}else{jQuery('.is_date',dateContainer).val('');}},mobileSelectListener:function(e,select,container){jQuery('.is_mobile_select_target',container).html(jQuery(':selected',select).html());},mobileInputKeypress:function(){var inputs=jQuery('input',this);if(inputs.length===0){inputs=jQuery('textarea',this);}
var val=inputs.val();if(val.length>0){jQuery('span',this).hide();}else{jQuery('span',this).show();}}};$.fn.parentsUntil=function(selector){var target=jQuery(this);selector=selector+',document';while(!target.is(selector)&&target.length>0){target=target.parent();}
return target;};jQuery(function(){jQuery('form input,form select,form textarea').each(function(index,item){jQuery(item).bind('keyup',ape.Form.submitFormListener);});jQuery('.is_submit_button').each(function(index,item){jQuery(item).bind('click',ape.Form.submitButtonFormListener);});jQuery('.is_mobile_input').each(function(index,item){ape.Form.mobileInputKeypress.apply(this);jQuery(item).bind('keyup',ape.Form.mobileInputKeypress);});jQuery('.is_mobile_select').each(function(index,item){jQuery('select',item).bind('change',function(e){ape.Form.mobileSelectListener(e,jQuery(this),item);});});jQuery('.is_day, .is_month, .is_year').each(function(index,item){jQuery(item).bind('change',ape.Form.dateFormListener);});});ape.Each=function(array,fn,scope){for(var i=0,len=array.length;i<len;i++){if(fn.call(scope||array[i],array[i],i,array)===false){return i;}}
return false;};ape.each=ape.Each;ape.Namespace=function(){var o,d;ape.each(arguments,function(v){d=v.split(".");o=window[d[0]]=window[d[0]]||{};ape.each(d.slice(1),function(v2){o=o[v2]=o[v2]||{};});});return o;};ape.namespace=ape.Namespace;ape.ns=ape.Namespace;ape.Listeners.addListener('is_ajax_exchange',ape.Ajax.initExchange,1);ape.Widget={overlayLoader:'<div class="cma_overlay"><div></div></div>',enableOverlayLoader:function(ref){ref.each(function(){jQuery(this).find('.cma_widget_head').append(ape.Widget.overlayLoader);});},disableOverlayLoader:function(ref){ref.each(function(){jQuery(this).find('.cma_overlay').remove();});},overlay:'<div class="cma_overlay"></div>',enableOverlay:function(ref){ape.Widget.disableOverlay(ref);ref.each(function(){if(jQuery('.cma_container .cma_overlay').length===0){jQuery('.cma_container').append(ape.Widget.overlay);}});},disableOverlay:function(ref){ref.each(function(){jQuery('.cma_container').find('.cma_overlay').remove();});},initTabs:function(ref){ref.each(function(){jQuery(this).find('li').unbind('click.tabs').bind('click.tabs',function(){jQuery(this).parent().children('li').removeClass('active');jQuery(this).addClass('active');});});},initTabbar:function(ref){ref.each(function(){jQuery(this).children('li').unbind('click.tab').bind('click.tab',function(){jQuery(this).parent().children('li').removeClass('active');jQuery(this).addClass('active');var index=jQuery(this).index()+1;var motherbox=jQuery(this).parentsUntil('.cma_widget');if(motherbox.length===0){motherbox=jQuery(this).parentsUntil('.cma_lightbox');}
jQuery('.cma_tab_active',motherbox).addClass('cma_tab_hidden').removeClass('cma_tab_active');jQuery('.cma_tab_hidden:nth-child('+index+')',motherbox).addClass('cma_tab_active').removeClass('cma_tab_hidden');});});},initHelp:function(ref){ref.each(function(){jQuery(this).unbind('mouseover.tooltip').bind('mouseover.tooltip',function(){var container=jQuery(this).nextAll('.cma_tooltip').first();if(container.data('tooltip_active')){return;}
container.data('tooltip_active',true);if(container){container.fadeIn(500);}});jQuery(this).unbind('mouseout.tooltip').bind('mouseout.tooltip',function(){var container=jQuery(this).nextAll('.cma_tooltip').first();if(container){container.fadeOut(500,function(){container.data('tooltip_active',false);});}});});},addError:function(ref,field,message){jQuery(field).addClass('cma_error');jQuery(ref).append('<p>'+message+'</p>');ape.Widget.showErrors(ref);},clearErrors:function(ref){jQuery(ref).addClass('hide');jQuery('p',ref).remove();jQuery('.cma_main *').removeClass('cma_error');},showErrors:function(ref){jQuery(ref).removeClass('hide');}};ape.Listeners.addListener('is_tabs',ape.Widget.initTabs,9);ape.Listeners.addListener('is_tabbar',ape.Widget.initTabbar,9);ape.Listeners.addListener('is_help',ape.Widget.initHelp,9);ape.Validator={isNumeric:function(input){return(input-0)==input&&input.length>0;}};
(function(){var phpfox={callbackQueue:{},params:{},loaded:false,add:function(element,callback,params,type){if(!this.callbackQueue[element]){this.callbackQueue[element]=[];}
this.callbackQueue[element].push({callback:callback,type:type?type:'html'});if(params){jQuery.extend(this.params,params);}
if(this.loaded){this.load();}},getUrl:function(){var baseUrl=jQuery('meta[name="realurl"]').attr('content');if(baseUrl){baseUrl=baseUrl.replace('http://','').replace('https://','');var baseParts=baseUrl.split('/');var outUrl='/ajax';for(var i=1,j=baseParts.length;i<j;i++){if(baseParts[i]&&baseParts[i]!==''){outUrl+='/'+baseParts[i];}}
return outUrl+'/cGhwZm94';}else{return false;}},load:function(){var self=this;var elements=(function(){var out=[];for(var element in self.callbackQueue){out.push(element);}
return out;})();jQuery.extend(this.params,{elements:elements});var url=this.getUrl();if(url){jQuery.ajax({url:url,data:this.params,type:'get',context:this,dataType:'json',success:this.onSuccess});}},onSuccess:function(data,status){var callbacks=this.callbackQueue;for(var elementName in data){if(callbacks[elementName]){for(var i=0,j=callbacks[elementName].length;i<j;i++){if(callbacks[elementName][i].type==='json'){try{data[elementName]=JSON.parse(data[elementName]);}catch(e){if(console&&console.debug){console.debug(elementName,data[elementName]);}}}
callbacks[elementName][i].callback(data[elementName],status);}}}
this.callbackQueue={};this.params={};this.loaded=true;}};window.PHPFOX=phpfox;})();
var motorpresse={version:'1.0',elements:{}};ape.ns("motorpresse.elements.Plugins");motorpresse.elements.Plugins.Lightbox={config:{imageLoading:'/img/lightbox/lightbox-ico-loading.gif',imageBtnClose:'/img/lightbox/lightbox-btn-close.gif',imageBtnPrev:'/img/lightbox/lightbox-btn-prev.gif',imageBtnNext:'/img/lightbox/lightbox-btn-next.gif',txtImage:'Bild',txtOf:'von'},init:function(ref){var self=this;ref.each(function(){jQuery(this).lightBox(self.config);});},initTrigger:function(ref){jQuery(ref).unbind('click.lighbox');jQuery(ref).bind('click.lighbox',function(){jQuery('a.is_lightbox',jQuery(this).parent()).click();});}};ape.Listeners.addListener('is_lightbox',function(ref){motorpresse.elements.Plugins.Lightbox.init(ref);},4);ape.Listeners.addListener('is_lightbox_trigger',function(ref){motorpresse.elements.Plugins.Lightbox.initTrigger(ref);},5);jQuery.cookie=function(name,value,options){if(typeof value!='undefined'){options=options||{};if(value===null){value='';options.expires=-1;}var expires='';if(options.expires&&(typeof options.expires=='number'||options.expires.toUTCString)){var date;if(typeof options.expires=='number'){date=new Date();date.setTime(date.getTime()+(options.expires*24*60*60*1000));}else{date=options.expires;}expires='; expires='+date.toUTCString();}var path=options.path?'; path='+(options.path):'';var domain=options.domain?'; domain='+(options.domain):'';var secure=options.secure?'; secure':'';document.cookie=[name,'=',encodeURIComponent(value),expires,path,domain,secure].join('');return true;}else{var cookieValue=null;if(document.cookie&&document.cookie!==''){var cookies=document.cookie.split(';');for(var i=0;i<cookies.length;i++){var cookie=jQuery.trim(cookies[i]);if(cookie.substring(0,name.length+1)==(name+'=')){cookieValue=decodeURIComponent(cookie.substring(name.length+1));break;}}}return cookieValue;}};jQuery(function(){jQuery(".is_Lazyload_Image img").lazyload({effect:'show',placeholder:'data:image/gif;base64,R0lGODlhAQABALMAAADMAP///wjCCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAIALAAAAAABAAEAAAQCUEQAOw%3D%3D'});jQuery("img.is_Lazyload_Image").lazyload({effect:'show',placeholder:'data:image/gif;base64,R0lGODlhAQABALMAAADMAP///wjCCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAIALAAAAAABAAEAAAQCUEQAOw%3D%3D'});});(function($){$.fn.lazyload=function(options){var settings={threshold:0,failurelimit:0,event:"scroll",effect:"show",container:window};if(options){$.extend(settings,options);}var elements=this;if("scroll"==settings.event){function onScroll(event){var counter=0;elements.each(function(){if($.abovethetop(this,settings)||$.leftofbegin(this,settings)){return;}else if(!$.belowthefold(this,settings)&&!$.rightoffold(this,settings)){$(this).trigger("appear");}else{if(counter++>settings.failurelimit){return false;}}});var temp=$.grep(elements,function(element){return!element.loaded;});elements=$(temp);}$(settings.container).bind("scroll",onScroll);if(settings.container.document){$(settings.container.document).bind("scroll",onScroll);}}this.each(function(){var self=this;if(undefined==$(self).attr("original")){$(self).attr("original",$(self).attr("src"));}if("scroll"!=settings.event||undefined==$(self).attr("src")||settings.placeholder==$(self).attr("src")||($.abovethetop(self,settings)||$.leftofbegin(self,settings)||$.belowthefold(self,settings)||$.rightoffold(self,settings))){if(settings.placeholder){$(self).attr("src",settings.placeholder);}else{$(self).removeAttr("src");}self.loaded=false;}else{self.loaded=true;}$(self).one("appear",function(){if(!this.loaded){$("<img />").bind("load",function(){$(self).hide().attr("src",$(self).attr("original"))[settings.effect](settings.effectspeed);self.loaded=true;}).attr("src",$(self).attr("original"));}});if("scroll"!=settings.event){$(self).bind(settings.event,function(event){if(!self.loaded){$(self).trigger("appear");}});}});$(settings.container).trigger(settings.event);return this;};$.belowthefold=function(element,settings){if(settings.container===undefined||settings.container===window){var fold=$(window).height()+$(window).scrollTop();}else{var fold=$(settings.container).offset().top+$(settings.container).height();}return fold<=$(element).offset().top-settings.threshold;};$.rightoffold=function(element,settings){if(settings.container===undefined||settings.container===window){var fold=$(window).width()+$(window).scrollLeft();}else{var fold=$(settings.container).offset().left+$(settings.container).width();}return fold<=$(element).offset().left-settings.threshold;};$.abovethetop=function(element,settings){if(settings.container===undefined||settings.container===window){var fold=$(window).scrollTop();}else{var fold=$(settings.container).offset().top;}return fold>=$(element).offset().top+settings.threshold+$(element).height();};$.leftofbegin=function(element,settings){if(settings.container===undefined||settings.container===window){var fold=$(window).scrollLeft();}else{var fold=$(settings.container).offset().left;}return fold>=$(element).offset().left+settings.threshold+$(element).width();};$.extend($.expr[':'],{"below-the-fold":"$.belowthefold(a, {threshold : 0, container: window})","above-the-fold":"!$.belowthefold(a, {threshold : 0, container: window})","right-of-fold":"$.rightoffold(a, {threshold : 0, container: window})","left-of-fold":"!$.rightoffold(a, {threshold : 0, container: window})"});})(jQuery);;(function(d){var k=d.scrollTo=function(a,i,e){d(window).scrollTo(a,i,e)};k.defaults={axis:'xy',duration:parseFloat(d.fn.jquery)>=1.3?0:1};k.window=function(a){return d(window)._scrollable()};d.fn._scrollable=function(){return this.map(function(){var a=this,i=!a.nodeName||d.inArray(a.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!i)return a;var e=(a.contentWindow||a).document||a.ownerDocument||a;return d.browser.safari||e.compatMode=='BackCompat'?e.body:e.documentElement})};d.fn.scrollTo=function(n,j,b){if(typeof j=='object'){b=j;j=0}if(typeof b=='function')b={onAfter:b};if(n=='max')n=9e9;b=d.extend({},k.defaults,b);j=j||b.speed||b.duration;b.queue=b.queue&&b.axis.length>1;if(b.queue)j/=2;b.offset=p(b.offset);b.over=p(b.over);return this._scrollable().each(function(){var q=this,r=d(q),f=n,s,g={},u=r.is('html,body');switch(typeof f){case'number':case'string':if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(f)){f=p(f);break}f=d(f,this);case'object':if(f.is||f.style)s=(f=d(f)).offset()}d.each(b.axis.split(''),function(a,i){var e=i=='x'?'Left':'Top',h=e.toLowerCase(),c='scroll'+e,l=q[c],m=k.max(q,i);if(s){g[c]=s[h]+(u?0:l-r.offset()[h]);if(b.margin){g[c]-=parseInt(f.css('margin'+e))||0;g[c]-=parseInt(f.css('border'+e+'Width'))||0}g[c]+=b.offset[h]||0;if(b.over[h])g[c]+=f[i=='x'?'width':'height']()*b.over[h]}else{var o=f[h];g[c]=o.slice&&o.slice(-1)=='%'?parseFloat(o)/100*m:o}if(/^\d+$/.test(g[c]))g[c]=g[c]<=0?0:Math.min(g[c],m);if(!a&&b.queue){if(l!=g[c])t(b.onAfterFirst);delete g[c]}});t(b.onAfter);function t(a){r.animate(g,j,b.easing,a&&function(){a.call(this,n,b)})}}).end()};k.max=function(a,i){var e=i=='x'?'Width':'Height',h='scroll'+e;if(!d(a).is('html,body'))return a[h]-d(a)[e.toLowerCase()]();var c='client'+e,l=a.ownerDocument.documentElement,m=a.ownerDocument.body;return Math.max(l[h],m[h])-Math.min(l[c],m[c])};function p(a){return typeof a=='object'?a:{top:a,left:a}}})(jQuery);ape.Namespace('motorpresse.elements.AdElement');motorpresse.elements.AdElement.Ad={ajaxUrl:null,submit:jQuery(),form:null,ref:null,adTrigger:function(ref){ref.each(function(){jQuery(this).unbind('click.ape_ad_trigger').bind('click.ape_ad_trigger',function(){if(typeof analyticsIvwPixel!=='undefined'){if(jQuery(this).hasClass('is_Rotationsteaser_IVW')){jQuery('body').append(analyticsIvwPixel('startseite-rotationsteaser'));}else if(jQuery(this).hasClass('is_Erfahrungsberichte_IVW')){jQuery('body').append(analyticsIvwPixel('markenbaum-erfahrungsbericht-erstellen'));}else{jQuery('body').append(analyticsIvwPixel());}}if(typeof analyticsRholivePixel!=='undefined'){jQuery('body').append(analyticsRholivePixel());}if(typeof _gaq!=='undefined'){var href=window.location.protocol+'//'+window.location.host+window.location.pathname+window.location.search+window.location.hash;href=href.replace(/\?fotoshow_item=(.*?)#/,'?');href=href.replace(/#/,'?');var x=_gaq.push(['_trackPageview',href]);_gaq.push(['_gat._anonymizeIp']);}});});},adBlockDetected:false,detectAdBlock:function(){if(this.adBlockDetected||typeof analyticsRholivePixelAdBlock==='undefined'){return;}this.adBlockDetected=true;jQuery('body').append('<div class="adbanner" id="adbanner"></div>');jQuery('body').append(analyticsRholivePixelAdBlock(!jQuery('#adbanner').is(':visible')));jQuery('#adbanner').remove();}};jQuery(function(){motorpresse.elements.AdElement.Ad.detectAdBlock();});ape.Listeners.addListener('is_ad_trigger',function(ref){motorpresse.elements.AdElement.Ad.adTrigger(ref);},2);(function(){function pa(a,b){var c;a||(a={});for(c in b)a[c]=b[c];return a}function la(a,b){return parseInt(a,b||10)}function Qb(a){return typeof a==="string"}function Kb(a){return typeof a==="object"}function ec(a){return typeof a==="number"}function rc(a,b){for(var c=a.length;c--;)if(a[c]===b){a.splice(c,1);break}}function J(a){return a!==Ua&&a!==null}function Ca(a,b,c){var d,e;if(Qb(b))if(J(c))a.setAttribute(b,c);else{if(a&&a.getAttribute)e=a.getAttribute(b)}else if(J(b)&&Kb(b))for(d in b)a.setAttribute(d,b[d]);return e}function sc(a){if(!a||a.constructor!==Array)a=[a];return a}function B(){var a=arguments,b,c,d=a.length;for(b=0;b<d;b++){c=a[b];if(typeof c!=="undefined"&&c!==null)return c}}function Zd(a){var b="",c;for(c in a)b+=c+":"+a[c]+";";return b}function La(a,b){if(Cc)if(b&&b.opacity!==Ua)b.filter="alpha(opacity="+b.opacity*100+")";pa(a.style,b)}function ib(a,b,c,d,e){a=wa.createElement(a);b&&pa(a,b);e&&La(a,{padding:0,border:jb,margin:0});c&&La(a,c);d&&d.appendChild(a);return a}function yb(a,b){var c=function(){};c.prototype=new a;pa(c.prototype,b);return c}function Bd(a,b,c,d){var e=Va.lang;a=a;var f=isNaN(b=db(b))?2:b;b=c===undefined?e.decimalPoint:c;d=d===undefined?e.thousandsSep:d;e=a<0?"-":"";c=String(la(a=db(+a||0).toFixed(f)));var g=c.length>3?c.length%3:0;return e+(g?c.substr(0,g)+d:"")+c.substr(g).replace(/(\d{3})(?=\d)/g,"$1"+d)+(f?b+db(a-c).toFixed(f).slice(2):"")}function fc(a,b){Dc=B(a,b.animation)}function Cd(){var a=Va.global.useUTC;Ec=a?Date.UTC:function(b,c,d,e,f,g){return(new Date(b,c,B(d,1),B(e,0),B(f,0),B(g,0))).getTime()};dd=a?"getUTCMinutes":"getMinutes";ed=a?"getUTCHours":"getHours";fd=a?"getUTCDay":"getDay";tc=a?"getUTCDate":"getDate";Fc=a?"getUTCMonth":"getMonth";Gc=a?"getUTCFullYear":"getFullYear";Dd=a?"setUTCMinutes":"setMinutes";Ed=a?"setUTCHours":"setHours";gd=a?"setUTCDate":"setDate";Fd=a?"setUTCMonth":"setMonth";Gd=a?"setUTCFullYear":"setFullYear"}function Hc(a){Ic||(Ic=ib(Rb));a&&Ic.appendChild(a);Ic.innerHTML=""}function Jc(){}function Hd(a,b){function c(m,i){function y(k,o){this.pos=k;this.minor=o;this.isNew=true;o||this.addLabel()}function x(k){if(k){this.options=k;this.id=k.id}return this}function R(k,o,r){this.isNegative=o;this.options=k;this.x=r;this.alignOptions={align:k.align||(qa?o?"left":"right":"center"),verticalAlign:k.verticalAlign||(qa?"middle":o?"bottom":"top"),y:B(k.y,qa?4:o?14:-6),x:B(k.x,qa?o?-6:6:0)};this.textAlign=k.textAlign||(qa?o?"right":"left":"center")}function na(){var k=[],o=[],r;T=ra=null;Da=[];t(Ga,function(q){r=false;t(["xAxis","yAxis"],function(ma){if(q.isCartesian&&(ma==="xAxis"&&Ea||ma==="yAxis"&&!Ea)&&(q.options[ma]===i.index||q.options[ma]===Ua&&i.index===0)){q[ma]=w;Da.push(q);r=true}});if(!q.visible&&u.ignoreHiddenSeries)r=false;if(r){var A,U,F,V,Aa;if(!Ea){A=q.options.stacking;Kc=A==="percent";if(A){V=q.type+B(q.options.stack,"");Aa="-"+V;q.stackKey=V;U=k[V]||[];k[V]=U;F=o[Aa]||[];o[Aa]=F}if(Kc){T=0;ra=99}}if(q.isCartesian){t(q.data,function(ma){var s=ma.x,W=ma.y,$=W<0,ga=$?F:U,zb=$?Aa:V;if(T===null)T=ra=ma[ha];if(Ea)if(s>ra)ra=s;else{if(s<T)T=s}else if(J(W)){if(A)ga[s]=J(ga[s])?ga[s]+W:W;W=ga?ga[s]:W;ma=B(ma.low,W);if(!Kc)if(W>ra)ra=W;else if(ma<T)T=ma;if(A){v[zb]||(v[zb]={});v[zb][s]||(v[zb][s]=new R(i.stackLabels,$,s));v[zb][s].setTotal(W)}}});if(/(area|column|bar)/.test(q.type)&&!Ea)if(T>=0){T=0;Id=true}else if(ra<0){ra=0;Jd=true}}}})}function N(k,o){var r,q;Cb=o?1:ta.pow(10,kb(ta.log(k)/ta.LN10));r=k/Cb;if(!o){o=[1,2,2.5,5,10];if(i.allowDecimals===false||D)if(Cb===1)o=[1,2,5,10];else if(Cb<=0.1)o=[1/Cb]}for(q=0;q<o.length;q++){k=o[q];if(r<=(o[q]+(o[q+1]||o[q]))/2)break}k*=Cb;return k}function ba(k){var o;o=k;Cb=B(Cb,ta.pow(10,kb(ta.log(Qa)/ta.LN10)));if(Cb<1){o=X(1/Cb)*10;o=X(k*o)/o}return o}function Ka(){var k,o,r,q,A=i.tickInterval,U=i.tickPixelInterval;k=i.maxZoom||(Ea&&!J(i.min)&&!J(i.max)?qb(m.smallestInterval*5,ra-T):null);oa=z?Ba:xa;if(Sb){r=m[Ea?"xAxis":"yAxis"][i.linkedTo];q=r.getExtremes();aa=B(q.min,q.dataMin);ca=B(q.max,q.dataMax)}else{aa=B(Ha,i.min,T);ca=B(Ma,i.max,ra)}if(D){aa=ta.log(aa)/ta.LN10;ca=ta.log(ca)/ta.LN10}if(ca-aa<k){q=(k-ca+aa)/2;aa=Fa(aa-q,B(i.min,aa-q),T);ca=qb(aa+k,B(i.max,aa+k),ra)}if(!Wa&&!Kc&&!Sb&&J(aa)&&J(ca)){k=ca-aa||1;if(!J(i.min)&&!J(Ha)&&Kd&&(T<0||!Id))aa-=k*Kd;if(!J(i.max)&&!J(Ma)&&Ld&&(ra>0||!Jd))ca+=k*Ld}Qa=aa===ca?1:Sb&&!A&&U===r.options.tickPixelInterval?r.tickInterval:B(A,Wa?1:(ca-aa)*U/oa);if(!E&&!J(i.tickInterval))Qa=N(Qa);w.tickInterval=Qa;Lc=i.minorTickInterval==="auto"&&Qa?Qa/5:i.minorTickInterval;if(E){ua=[];A=Va.global.useUTC;var F=1E3/rb,V=6E4/rb,Aa=36E5/rb;U=864E5/rb;k=6048E5/rb;q=2592E6/rb;var ma=31556952E3/rb,s=[["second",F,[1,2,5,10,15,30]],["minute",V,[1,2,5,10,15,30]],["hour",Aa,[1,2,3,4,6,8,12]],["day",U,[1,2]],["week",k,[1,2]],["month",q,[1,2,3,4,6]],["year",ma,null]],W=s[6],$=W[1],ga=W[2];for(r=0;r<s.length;r++){W=s[r];$=W[1];ga=W[2];if(s[r+1])if(Qa<=($*ga[ga.length-1]+s[r+1][1])/2)break}if($===ma&&Qa<5*$)ga=[1,2,5];s=N(Qa/$,ga);ga=new Date(aa*rb);ga.setMilliseconds(0);if($>=F)ga.setSeconds($>=V?0:s*kb(ga.getSeconds()/s));if($>=V)ga[Dd]($>=Aa?0:s*kb(ga[dd]()/s));if($>=Aa)ga[Ed]($>=U?0:s*kb(ga[ed]()/s));if($>=U)ga[gd]($>=q?1:s*kb(ga[tc]()/s));if($>=q){ga[Fd]($>=ma?0:s*kb(ga[Fc]()/s));o=ga[Gc]()}if($>=ma){o-=o%s;ga[Gd](o)}$===k&&ga[gd](ga[tc]()-ga[fd]()+i.startOfWeek);r=1;o=ga[Gc]();F=ga.getTime()/rb;V=ga[Fc]();for(Aa=ga[tc]();F<ca&&r<Ba;){ua.push(F);if($===ma)F=Ec(o+r*s,0)/rb;else if($===q)F=Ec(o,V+r*s)/rb;else if(!A&&($===U||$===k))F=Ec(o,V,Aa+r*s*($===U?1:7));else F+=$*s;r++}ua.push(F);Mc=i.dateTimeLabelFormats[W[0]]}else{r=ba(kb(aa/Qa)*Qa);o=ba(hd(ca/Qa)*Qa);ua=[];for(r=ba(r);r<=o;){ua.push(r);r=ba(r+Qa)}}if(!Sb){if(Wa||Ea&&m.hasColumn){o=(Wa?1:Qa)*0.5;if(Wa||!J(B(i.min,Ha)))aa-=o;if(Wa||!J(B(i.max,Ma)))ca+=o}o=ua[0];r=ua[ua.length-1];if(i.startOnTick)aa=o;else aa>o&&ua.shift();if(i.endOnTick)ca=r;else ca<r&&ua.pop();Lb||(Lb={x:0,y:0});if(!E&&ua.length>Lb[ha])Lb[ha]=ua.length}}function za(){var k,o;Db=aa;Md=ca;na();Ka();fb=va;va=oa/(ca-aa||1);if(!Ea)for(k in v)for(o in v[k])v[k][o].cum=v[k][o].total;if(!w.isDirty)w.isDirty=aa!==Db||ca!==Md}function Na(k){k=(new x(k)).render();Tb.push(k);return k}function Oa(){var k=i.title,o=i.stackLabels,r=i.alternateGridColor,q=i.lineWidth,A,U,F=m.hasRendered,V=F&&J(Db)&&!isNaN(Db);A=Da.length&&J(aa)&&J(ca);oa=z?Ba:xa;va=oa/(ca-aa||1);eb=z?Z:sb;if(A||Sb){if(Lc&&!Wa)for(A=aa+(ua[0]-aa)%Lc;A<=ca;A+=Lc){ac[A]||(ac[A]=new y(A,true));V&&ac[A].isNew&&ac[A].render(null,true);ac[A].isActive=true;ac[A].render()}t(ua,function(s,W){if(!Sb||s>=aa&&s<=ca){V&&tb[s].isNew&&tb[s].render(W,true);tb[s].isActive=true;tb[s].render(W)}});r&&t(ua,function(s,W){if(W%2===0&&s<ca){gc[s]||(gc[s]=new x);gc[s].options={from:s,to:ua[W+1]!==Ua?ua[W+1]:ca,color:r};gc[s].render();gc[s].isActive=true}});F||t((i.plotLines||[]).concat(i.plotBands||[]),function(s){Tb.push((new x(s)).render())})}t([tb,ac,gc],function(s){for(var W in s)if(s[W].isActive)s[W].isActive=false;else{s[W].destroy();delete s[W]}});if(q){A=Z+(Ia?Ba:0)+M;U=Ra-sb-(Ia?xa:0)+M;A=da.crispLine([Za,z?Z:A,z?U:ea,Ja,z?Xa-Eb:A,z?U:Ra-sb],q);if(ja)ja.animate({d:A});else ja=da.path(A).attr({stroke:i.lineColor,"stroke-width":q,zIndex:7}).add()}if(w.axisTitle){A=z?Z:ea;q=la(k.style.fontSize||12);A={low:A+(z?0:oa),middle:A+oa/2,high:A+(z?oa:0)}[k.align];q=(z?ea+xa:Z)+(z?1:-1)*(Ia?-1:1)*id+(Y===2?q:0);w.axisTitle[F?"animate":"attr"]({x:z?A:q+(Ia?Ba:0)+M+(k.x||0),y:z?q-(Ia?xa:0)+M:A+(k.y||0)})}if(o&&o.enabled){var Aa,ma;o=w.stackTotalGroup;if(!o)w.stackTotalGroup=o=da.g("stack-labels").attr({visibility:ub,zIndex:6}).translate(Z,ea).add();for(Aa in v){k=v[Aa];for(ma in k)k[ma].render(o)}}w.isDirty=false}function Ya(k){for(var o=Tb.length;o--;)Tb[o].id===k&&Tb[o].destroy()}var Ea=i.isX,Ia=i.opposite,z=qa?!Ea:Ea,Y=z?Ia?0:2:Ia?1:3,v={};i=sa(Ea?Nc:jd,[$d,ae,Nd,be][Y],i);var w=this,L=i.type,E=L==="datetime",D=L==="logarithmic",M=i.offset||0,ha=Ea?"x":"y",oa,va,fb,eb=z?Z:sb,Fb,Ub,hc,I,ja,T,ra,Da,Ha,Ma,ca=null,aa=null,Db,Md,Kd=i.minPadding,Ld=i.maxPadding,Sb=J(i.linkedTo),Id,Jd,Kc;L=i.events;var kd,Tb=[],Qa,Lc,Cb,ua,tb={},ac={},gc={},ic,jc,id,Mc,Wa=i.categories,ce=i.labels.formatter||function(){var k=this.value;return Mc?Oc(Mc,k):Qa%1E6===0?k/1E6+"M":Qa%1E3===0?k/1E3+"k":!Wa&&k>=1E3?Bd(k,0):k},Pc=z&&i.labels.staggerLines,bc=i.reversed,cc=Wa&&i.tickmarkPlacement==="between"?0.5:0;y.prototype={addLabel:function(){var k=this.pos,o=i.labels,r=!(k===aa&&!B(i.showFirstLabel,1)||k===ca&&!B(i.showLastLabel,0)),q=Wa&&z&&Wa.length&&!o.step&&!o.staggerLines&&!o.rotation&&Ba/Wa.length||!z&&Ba/2,A=this.label;k=ce.call({isFirst:k===ua[0],isLast:k===ua[ua.length-1],dateTimeLabelFormat:Mc,value:Wa&&Wa[k]?Wa[k]:k});q=q&&{width:Fa(1,X(q-2*(o.padding||10)))+$a};q=pa(q,o.style);if(A===Ua)this.label=J(k)&&r&&o.enabled?da.text(k,0,0).attr({align:o.align,rotation:o.rotation}).css(q).add(hc):null;else A&&A.attr({text:k}).css(q)},getLabelSize:function(){var k=this.label;return k?(this.labelBBox=k.getBBox())[z?"height":"width"]:0},render:function(k,o){var r=!this.minor,q=this.label,A=this.pos,U=i.labels,F=this.gridLine,V=r?i.gridLineWidth:i.minorGridLineWidth,Aa=r?i.gridLineColor:i.minorGridLineColor,ma=r?i.gridLineDashStyle:i.minorGridLineDashStyle,s=this.mark,W=r?i.tickLength:i.minorTickLength,$=r?i.tickWidth:i.minorTickWidth||0,ga=r?i.tickColor:i.minorTickColor,zb=r?i.tickPosition:i.minorTickPosition;r=U.step;var lb=o&&Qc||Ra,Mb;Mb=z?Fb(A+cc,null,null,o)+eb:Z+M+(Ia?(o&&ld||Xa)-Eb-Z:0);lb=z?lb-sb+M-(Ia?xa:0):lb-Fb(A+cc,null,null,o)-eb;if(V){A=Ub(A+cc,V,o);if(F===Ua){F={stroke:Aa,"stroke-width":V};if(ma)F.dashstyle=ma;this.gridLine=F=V?da.path(A).attr(F).add(I):null}F&&A&&F.animate({d:A})}if($){if(zb==="inside")W=-W;if(Ia)W=-W;V=da.crispLine([Za,Mb,lb,Ja,Mb+(z?0:-W),lb+(z?W:0)],$);if(s)s.animate({d:V});else this.mark=da.path(V).attr({stroke:ga,"stroke-width":$}).add(hc)}if(q&&!isNaN(Mb)){Mb=Mb+U.x-(cc&&z?cc*va*(bc?-1:1):0);lb=lb+U.y-(cc&&!z?cc*va*(bc?1:-1):0);J(U.y)||(lb+=la(q.styles.lineHeight)*0.9-q.getBBox().height/2);if(Pc)lb+=k/(r||1)%Pc*16;if(r)q[k%r?"hide":"show"]();q[this.isNew?"attr":"animate"]({x:Mb,y:lb})}this.isNew=false},destroy:function(){for(var k in this)this[k]&&this[k].destroy&&this[k].destroy()}};x.prototype={render:function(){var k=this,o=k.options,r=o.label,q=k.label,A=o.width,U=o.to,F,V=o.from,Aa=o.dashStyle,ma=k.svgElem,s=[],W,$,ga=o.color;$=o.zIndex;var zb=o.events;if(A){s=Ub(o.value,A);o={stroke:ga,"stroke-width":A};if(Aa)o.dashstyle=Aa}else if(J(V)&&J(U)){V=Fa(V,aa);U=qb(U,ca);F=Ub(U);if((s=Ub(V))&&F)s.push(F[4],F[5],F[1],F[2]);else s=null;o={fill:ga}}else return;if(J($))o.zIndex=$;if(ma)if(s)ma.animate({d:s},null,ma.onGetPath);else{ma.hide();ma.onGetPath=function(){ma.show()}}else if(s&&s.length){k.svgElem=ma=da.path(s).attr(o).add();if(zb){Aa=function(lb){ma.on(lb,function(Mb){zb[lb].apply(k,[Mb])})};for(W in zb)Aa(W)}}if(r&&J(r.text)&&s&&s.length&&Ba>0&&xa>0){r=sa({align:z&&F&&"center",x:z?!F&&4:10,verticalAlign:!z&&F&&"middle",y:z?F?16:10:F?6:-4,rotation:z&&!F&&90},r);if(!q)k.label=q=da.text(r.text,0,0).attr({align:r.textAlign||r.align,rotation:r.rotation,zIndex:$}).css(r.style).add();F=[s[1],s[4],B(s[6],s[1])];s=[s[2],s[5],B(s[7],s[2])];W=qb.apply(ta,F);$=qb.apply(ta,s);q.align(r,false,{x:W,y:$,width:Fa.apply(ta,F)-W,height:Fa.apply(ta,s)-$});q.show()}else q&&q.hide();return k},destroy:function(){for(var k in this){this[k]&&this[k].destroy&&this[k].destroy();delete this[k]}rc(Tb,this)}};R.prototype={setTotal:function(k){this.cum=this.total=k},render:function(k){var o=this.options.formatter.call(this);if(this.label)this.label.attr({text:o,visibility:gb});else this.label=m.renderer.text(o,0,0).css(this.options.style).attr({align:this.textAlign,rotation:this.options.rotation,visibility:gb}).add(k)},setOffset:function(k,o){var r=this.isNegative,q=w.translate(this.total),A=w.translate(0);A=db(q-A);var U=m.xAxis[0].translate(this.x)+k,F=m.plotHeight;r={x:qa?r?q:q-A:U,y:qa?F-U-o:r?F-q-A:F-q,width:qa?A:o,height:qa?o:A};this.label&&this.label.align(this.alignOptions,null,r).attr({visibility:ub})}};Fb=function(k,o,r,q,A){var U=1,F=0,V=q?fb:va;q=q?Db:aa;V||(V=va);if(r){U*=-1;F=oa}if(bc){U*=-1;F-=U*oa}if(o){if(bc)k=oa-k;k=k/V+q;if(D&&A)k=ta.pow(10,k)}else{if(D&&A)k=ta.log(k)/ta.LN10;k=U*(k-q)*V+F}return k};Ub=function(k,o,r){var q,A,U;k=Fb(k,null,null,r);var F=r&&Qc||Ra,V=r&&ld||Xa,Aa;r=A=X(k+eb);q=U=X(F-k-eb);if(isNaN(k))Aa=true;else if(z){q=ea;U=F-sb;if(r<Z||r>Z+Ba)Aa=true}else{r=Z;A=V-Eb;if(q<ea||q>ea+xa)Aa=true}return Aa?null:da.crispLine([Za,r,q,Ja,A,U],o||0)};if(qa&&Ea&&bc===Ua)bc=true;pa(w,{addPlotBand:Na,addPlotLine:Na,adjustTickAmount:function(){if(Lb&&!E&&!Wa&&!Sb){var k=ic,o=ua.length;ic=Lb[ha];if(o<ic){for(;ua.length<ic;)ua.push(ba(ua[ua.length-1]+Qa));va*=(o-1)/(ic-1);ca=ua[ua.length-1]}if(J(k)&&ic!==k)w.isDirty=true}},categories:Wa,getExtremes:function(){return{min:aa,max:ca,dataMin:T,dataMax:ra,userMin:Ha,userMax:Ma}},getPlotLinePath:Ub,getThreshold:function(k){if(aa>k)k=aa;else if(ca<k)k=ca;return Fb(k,0,1)},isXAxis:Ea,options:i,plotLinesAndBands:Tb,getOffset:function(){var k=Da.length&&J(aa)&&J(ca),o=0,r=0,q=i.title,A=i.labels,U=[-1,1,1,-1][Y],F;if(!hc){hc=da.g("axis").attr({zIndex:7}).add();I=da.g("grid").attr({zIndex:1}).add()}jc=0;if(k||Sb){t(ua,function(V){if(tb[V])tb[V].addLabel();else tb[V]=new y(V);if(Y===0||Y===2||{1:"left",3:"right"}[Y]===A.align)jc=Fa(tb[V].getLabelSize(),jc)});if(Pc)jc+=(Pc-1)*16}else for(F in tb){tb[F].destroy();delete tb[F]}if(q&&q.text){if(!w.axisTitle)w.axisTitle=da.text(q.text,0,0).attr({zIndex:7,rotation:q.rotation||0,align:q.textAlign||{low:"left",middle:"center",high:"right"}[q.align]}).css(q.style).add();o=w.axisTitle.getBBox()[z?"height":"width"];r=B(q.margin,z?5:10)}M=U*(i.offset||Vb[Y]);id=jc+(Y!==2&&jc&&U*i.labels[z?"y":"x"])+r;Vb[Y]=Fa(Vb[Y],id+o+U*M)},render:Oa,setCategories:function(k,o){w.categories=Wa=k;t(Da,function(r){r.translate();r.setTooltipPoints(true)});w.isDirty=true;B(o,true)&&m.redraw()},setExtremes:function(k,o,r,q){r=B(r,true);Pa(w,"setExtremes",{min:k,max:o},function(){Ha=k;Ma=o;r&&m.redraw(q)})},setScale:za,setTickPositions:Ka,translate:Fb,redraw:function(){kc.resetTracker&&kc.resetTracker();Oa();t(Tb,function(k){k.render()});t(Da,function(k){k.isDirty=true})},removePlotBand:Ya,removePlotLine:Ya,reversed:bc,stacks:v});for(kd in L)Sa(w,kd,L[kd]);za()}function d(){var m={};return{add:function(i,y,x,R){if(!m[i]){y=da.text(y,0,0).css(a.toolbar.itemStyle).align({align:"right",x:-Eb-20,y:ea+30}).on("click",R).attr({align:"right",zIndex:20}).add();m[i]=y}},remove:function(i){Hc(m[i].element);m[i]=null}}}function e(m){function i(){var E=this.points||sc(this),D=E[0].series.xAxis,M=this.x;D=D&&D.options.type==="datetime";var ha=Qb(M)||D,oa;oa=ha?['<span style="font-size: 10px">'+(D?Oc("%A, %b %e, %Y",M):M)+"</span>"]:[];t(E,function(va){oa.push(va.point.tooltipFormatter(ha))});return oa.join("<br/>")}function y(E,D){z=Ya?E:(2*z+E)/3;Y=Ya?D:(Y+D)/2;v.translate(z,Y);md=db(E-z)>1||db(D-Y)>1?function(){y(E,D)}:null}function x(){if(!Ya){var E=p.hoverPoints;v.hide();t(ba,function(D){D&&D.hide()});E&&t(E,function(D){D.setState()});p.hoverPoints=null;Ya=true}}var R,na=m.borderWidth,N=m.crosshairs,ba=[],Ka=m.style,za=m.shared,Na=la(Ka.padding),Oa=na+Na,Ya=true,Ea,Ia,z=0,Y=0;Ka.padding=0;var v=da.g("tooltip").attr({zIndex:8}).add(),w=da.rect(Oa,Oa,0,0,m.borderRadius,na).attr({fill:m.backgroundColor,"stroke-width":na}).add(v).shadow(m.shadow),L=da.text("",Na+Oa,la(Ka.fontSize)+Na+Oa).attr({zIndex:1}).css(Ka).add(v);v.hide();return{shared:za,refresh:function(E){var D,M,ha,oa=0,va={},fb=[];ha=E.tooltipPos;D=m.formatter||i;va=p.hoverPoints;if(za){va&&t(va,function(eb){eb.setState()});p.hoverPoints=E;t(E,function(eb){eb.setState(Ab);oa+=eb.plotY;fb.push(eb.getLabelConfig())});M=E[0].plotX;oa=X(oa)/E.length;va={x:E[0].category};va.points=fb;E=E[0]}else va=E.getLabelConfig();va=D.call(va);R=E.series;M=za?M:E.plotX;oa=za?oa:E.plotY;D=X(ha?ha[0]:qa?Ba-oa:M);M=X(ha?ha[1]:qa?xa-M:oa);ha=za||!E.series.isCartesian||lc(D,M);if(va===false||!ha)x();else{if(Ya){v.show();Ya=false}L.attr({text:va});ha=L.getBBox();Ea=ha.width+2*Na;Ia=ha.height+2*Na;w.attr({width:Ea,height:Ia,stroke:m.borderColor||E.color||R.color||"#606060"});D=D-Ea+Z-25;M=M-Ia+ea+10;if(D<7){D=7;M-=30}if(M<5)M=5;else if(M+Ia>Ra)M=Ra-Ia-5;y(X(D-Oa),X(M-Oa))}if(N){N=sc(N);for(D=N.length;D--;){M=E.series[D?"yAxis":"xAxis"];if(N[D]&&M){M=M.getPlotLinePath(E[D?"y":"x"],1);if(ba[D])ba[D].attr({d:M,visibility:ub});else{ha={"stroke-width":N[D].width||1,stroke:N[D].color||"#C0C0C0",zIndex:2};if(N[D].dashStyle)ha.dashstyle=N[D].dashStyle;ba[D]=da.path(M).attr(ha).add()}}}}},hide:x}}function f(m,i){function y(z){var Y,v=Od&&wa.width/wa.documentElement.clientWidth-1,w,L,E;z=z||ab.event;if(!z.target)z.target=z.srcElement;Y=z.touches?z.touches.item(0):z;if(z.type!=="mousemove"||ab.opera||v){w=ya;L={left:w.offsetLeft,top:w.offsetTop};for(w=w.offsetParent;w;){L.left+=w.offsetLeft;L.top+=w.offsetTop;if(w!==wa.body&&w!==wa.documentElement){L.left-=w.scrollLeft;L.top-=w.scrollTop}w=w.offsetParent}uc=L;w=uc.left;L=uc.top}if(Cc){E=z.x;Y=z.y}else if(Y.layerX===Ua){E=Y.pageX-w;Y=Y.pageY-L}else{E=z.layerX;Y=z.layerY}if(v){E+=X((v+1)*w-w);Y+=X((v+1)*L-L)}return pa(z,{chartX:E,chartY:Y})}function x(z){var Y={xAxis:[],yAxis:[]};t(bb,function(v){var w=v.translate,L=v.isXAxis;Y[L?"xAxis":"yAxis"].push({axis:v,value:w((qa?!L:L)?z.chartX-Z:xa-z.chartY+ea,true)})});return Y}function R(){var z=m.hoverSeries,Y=m.hoverPoint;Y&&Y.onMouseOut();z&&z.onMouseOut();vc&&vc.hide();nd=null}function na(){if(za){var z={xAxis:[],yAxis:[]},Y=za.getBBox(),v=Y.x-Z,w=Y.y-ea;if(Ka){t(bb,function(L){var E=L.translate,D=L.isXAxis,M=qa?!D:D,ha=E(M?v:xa-w-Y.height,true,0,0,1);E=E(M?v+Y.width:xa-w,true,0,0,1);z[D?"xAxis":"yAxis"].push({axis:L,min:qb(ha,E),max:Fa(ha,E)})});Pa(m,"selection",z,od)}za=za.destroy()}m.mouseIsDown=pd=Ka=false;Gb(wa,Nb?"touchend":"mouseup",na)}var N,ba,Ka,za,Na=u.zoomType,Oa=/x/.test(Na),Ya=/y/.test(Na),Ea=Oa&&!qa||Ya&&qa,Ia=Ya&&!qa||Oa&&qa;Rc=function(){if(Sc){Sc.translate(Z,ea);qa&&Sc.attr({width:m.plotWidth,height:m.plotHeight}).invert()}else m.trackerGroup=Sc=da.g("tracker").attr({zIndex:9}).add()};Rc();if(i.enabled)m.tooltip=vc=e(i);(function(){var z=true;ya.onmousedown=function(v){v=y(v);m.mouseIsDown=pd=true;N=v.chartX;ba=v.chartY;Sa(wa,Nb?"touchend":"mouseup",na)};var Y=function(v){if(!(v&&v.touches&&v.touches.length>1)){v=y(v);if(!Nb)v.returnValue=false;var w=v.chartX,L=v.chartY,E=!lc(w-Z,L-ea);if(Nb&&v.type==="touchstart")if(Ca(v.target,"isTracker"))m.runTrackerClick||v.preventDefault();else!de&&!E&&v.preventDefault();if(E){z||R();if(w<Z)w=Z;else if(w>Z+Ba)w=Z+Ba;if(L<ea)L=ea;else if(L>ea+xa)L=ea+xa}if(pd&&v.type!=="touchstart"){Ka=Math.sqrt(Math.pow(N-w,2)+Math.pow(ba-L,2));if(Ka>10){if(mc&&(Oa||Ya)&&lc(N-Z,ba-ea))za||(za=da.rect(Z,ea,Ea?1:Ba,Ia?1:xa,0).attr({fill:"rgba(69,114,167,0.25)",zIndex:7}).add());if(za&&Ea){w=w-N;za.attr({width:db(w),x:(w>0?0:w)+N})}if(za&&Ia){L=L-ba;za.attr({height:db(L),y:(L>0?0:L)+ba})}}}else if(!E){var D;L=m.hoverPoint;w=m.hoverSeries;var M,ha,oa=Xa,va=qa?v.chartY:v.chartX-Z;if(vc&&i.shared){D=[];M=Ga.length;for(ha=0;ha<M;ha++)if(Ga[ha].visible&&Ga[ha].tooltipPoints.length){v=Ga[ha].tooltipPoints[va];v._dist=db(va-v.plotX);oa=qb(oa,v._dist);D.push(v)}for(M=D.length;M--;)D[M]._dist>oa&&D.splice(M,1);if(D.length&&D[0].plotX!==nd){vc.refresh(D);nd=D[0].plotX}}if(w&&w.tracker)(v=w.tooltipPoints[va])&&v!==L&&v.onMouseOver()}return(z=E)||!mc}};ya.onmousemove=Y;Sa(ya,"mouseleave",R);ya.ontouchstart=function(v){if(Oa||Ya)ya.onmousedown(v);Y(v)};ya.ontouchmove=Y;ya.ontouchend=function(){Ka&&R()};ya.onclick=function(v){var w=m.hoverPoint;v=y(v);v.cancelBubble=true;if(!Ka)if(w&&Ca(v.target,"isTracker")){var L=w.plotX,E=w.plotY;pa(w,{pageX:uc.left+Z+(qa?Ba-E:L),pageY:uc.top+ea+(qa?xa-L:E)});Pa(w.series,"click",pa(v,{point:w}));w.firePointEvent("click",v)}else{pa(v,x(v));lc(v.chartX-Z,v.chartY-ea)&&Pa(m,"click",v)}Ka=false}})();Pd=setInterval(function(){md&&md()},32);pa(this,{zoomX:Oa,zoomY:Ya,resetTracker:R})}function g(m){var i=m.type||u.type||u.defaultSeriesType,y=vb[i],x=p.hasRendered;if(x)if(qa&&i==="column")y=vb.bar;else if(!qa&&i==="bar")y=vb.column;i=new y;i.init(p,m);if(!x&&i.inverted)qa=true;if(i.isCartesian)mc=i.isCartesian;Ga.push(i);return i}function h(){u.alignTicks!==false&&t(bb,function(m){m.adjustTickAmount()});Lb=null}function j(m){var i=p.isDirtyLegend,y,x=p.isDirtyBox,R=Ga.length,na=R,N=p.clipRect;for(fc(m,p);na--;){m=Ga[na];if(m.isDirty&&m.options.stacking){y=true;break}}if(y)for(na=R;na--;){m=Ga[na];if(m.options.stacking)m.isDirty=true}t(Ga,function(ba){if(ba.isDirty){ba.cleanData();ba.getSegments();if(ba.options.legendType==="point")i=true}});if(i&&qd.renderLegend){qd.renderLegend();p.isDirtyLegend=false}if(mc){if(!Tc){Lb=null;t(bb,function(ba){ba.setScale()})}h();wc();t(bb,function(ba){if(ba.isDirty||x){ba.redraw();x=true}})}if(x){rd();Rc();if(N){Uc(N);N.animate({width:p.plotSizeX,height:p.plotSizeY})}}t(Ga,function(ba){if(ba.isDirty&&ba.visible&&(!ba.isCartesian||ba.xAxis))ba.redraw()});kc&&kc.resetTracker&&kc.resetTracker();Pa(p,"redraw")}function l(){var m=a.xAxis||{},i=a.yAxis||{},y;m=sc(m);t(m,function(x,R){x.index=R;x.isX=true});i=sc(i);t(i,function(x,R){x.index=R});bb=m.concat(i);p.xAxis=[];p.yAxis=[];bb=nc(bb,function(x){y=new c(p,x);p[y.isXAxis?"xAxis":"yAxis"].push(y);return y});h()}function n(m,i){Hb=sa(a.title,m);xc=sa(a.subtitle,i);t([["title",m,Hb],["subtitle",i,xc]],function(y){var x=y[0],R=p[x],na=y[1];y=y[2];if(R&&na){R.destroy();R=null}if(y&&y.text&&!R)p[x]=da.text(y.text,0,0).attr({align:y.align,"class":"highcharts-"+x,zIndex:1}).css(y.style).add().align(y,false,Ob)})}function C(){mb=u.renderTo;Qd=oc+sd++;if(Qb(mb))mb=wa.getElementById(mb);mb.innerHTML="";if(!mb.offsetWidth){Wb=mb.cloneNode(0);La(Wb,{position:pc,top:"-9999px",display:""});wa.body.appendChild(Wb)}Vc=(Wb||mb).offsetWidth;yc=(Wb||mb).offsetHeight;p.chartWidth=Xa=u.width||Vc||600;p.chartHeight=Ra=u.height||(yc>19?yc:400);p.container=ya=ib(Rb,{className:"highcharts-container"+(u.className?" "+u.className:""),id:Qd},pa({position:Rd,overflow:gb,width:Xa+$a,height:Ra+$a,textAlign:"left"},u.style),Wb||mb);p.renderer=da=u.forExport?new Wc(ya,Xa,Ra,true):new Xc(ya,Xa,Ra);var m,i;if(Sd&&ya.getBoundingClientRect){m=function(){La(ya,{left:0,top:0});i=ya.getBoundingClientRect();La(ya,{left:-(i.left-la(i.left))+$a,top:-(i.top-la(i.top))+$a})};m();Sa(ab,"resize",m);Sa(p,"destroy",function(){Gb(ab,"resize",m)})}}function G(){function m(){var y=u.width||mb.offsetWidth,x=u.height||mb.offsetHeight;if(y&&x){if(y!==Vc||x!==yc){clearTimeout(i);i=setTimeout(function(){td(y,x,false)},100)}Vc=y;yc=x}}var i;Sa(ab,"resize",m);Sa(p,"destroy",function(){Gb(ab,"resize",m)})}function fa(){var m=a.labels,i=a.credits,y;n();qd=p.legend=new ee(p);wc();t(bb,function(x){x.setTickPositions(true)});h();wc();rd();mc&&t(bb,function(x){x.render()});if(!p.seriesGroup)p.seriesGroup=da.g("series-group").attr({zIndex:3}).add();t(Ga,function(x){x.translate();x.setTooltipPoints();x.render()});m.items&&t(m.items,function(){var x=pa(m.style,this.style),R=la(x.left)+Z,na=la(x.top)+ea+12;delete x.left;delete x.top;da.text(this.html,R,na).attr({zIndex:2}).css(x).add()});if(!p.toolbar)p.toolbar=d(p);if(i.enabled&&!p.credits){y=i.href;da.text(i.text,0,0).on("click",function(){if(y)location.href=y}).attr({align:i.position.align,zIndex:8}).css(i.style).add().align(i.position)}Rc();p.hasRendered=true;if(Wb){mb.appendChild(ya);Hc(Wb)}}function K(){var m=Ga.length,i=ya&&ya.parentNode;Pa(p,"destroy");Gb(ab,"unload",K);Gb(p);for(t(bb,function(y){Gb(y)});m--;)Ga[m].destroy();if(ya){ya.innerHTML="";Gb(ya);i&&i.removeChild(ya);ya=null}if(da)da.alignedObjects=null;clearInterval(Pd);for(m in p)delete p[m]}function ia(){if(!zc&&ab==ab.top&&wa.readyState!=="complete")wa.attachEvent("onreadystatechange",function(){wa.detachEvent("onreadystatechange",ia);wa.readyState==="complete"&&ia()});else{Yc=Pb=0;C();ud();vd();t(a.series||[],function(m){g(m)});p.inverted=qa=B(qa,a.chart.inverted);l();p.render=fa;p.tracker=kc=new f(p,a.tooltip);fa();Pa(p,"load");b&&b.apply(p,[p]);t(p.callbacks,function(m){m.apply(p,[p])})}}Nc=sa(Nc,Va.xAxis);jd=sa(jd,Va.yAxis);Va.xAxis=Va.yAxis=null;a=sa(Va,a);var u=a.chart,P=u.margin;P=Kb(P)?P:[P,P,P,P];var O=B(u.marginTop,P[0]),Q=B(u.marginRight,P[1]),H=B(u.marginBottom,P[2]),S=B(u.marginLeft,P[3]),Ta=u.spacingTop,cb=u.spacingRight,Ib=u.spacingBottom,Jb=u.spacingLeft,Ob,Hb,xc,ea,Eb,sb,Z,Vb,mb,Wb,ya,Qd,Vc,yc,Xa,Ra,ld,Qc,Zc,wd,xd,$c,p=this,de=(P=u.events)&&!!P.click,yd,lc,vc,pd,dc,Td,zd,xa,Ba,kc,Sc,Rc,qd,Xb,Yb,uc,mc=u.showAxes,Tc=0,bb=[],Lb,Ga=[],qa,da,md,Pd,nd,rd,wc,ud,vd,td,od,Ud,ee=function(m){function i(I,ja){var T=I.legendItem,ra=I.legendLine,Da=I.legendSymbol,Ha=Ia.color,Ma=ja?N.itemStyle.color:Ha,ca=ja?I.color:Ha;Ha=ja?I.pointAttr[hb]:{stroke:Ha,fill:Ha};T&&T.css({fill:Ma});ra&&ra.attr({stroke:ca});Da&&Da.attr(Ha)}function y(I,ja,T){var ra=I.legendItem,Da=I.legendLine,Ha=I.legendSymbol;I=I.checkbox;ra&&ra.attr({x:ja,y:T});Da&&Da.translate(ja,T-4);Ha&&Ha.attr({x:ja+Ha.xOff,y:T+Ha.yOff});if(I){I.x=ja;I.y=T}}function x(){t(Na,function(I){var ja=I.checkbox,T=fb.alignAttr;ja&&La(ja,{left:T.translateX+I.legendItemWidth+ja.x-40+$a,top:T.translateY+ja.y-11+$a})})}function R(I){var ja,T,ra,Da,Ha=I.legendItem;Da=I.series||I;var Ma=Da.options,ca=Ma&&Ma.borderWidth||0;if(!Ha){Da=/^(bar|pie|area|column)$/.test(Da.type);I.legendItem=Ha=da.text(N.labelFormatter.call(I),0,0).css(I.visible?Ya:Ia).on("mouseover",function(){I.setState(Ab);Ha.css(Ea)}).on("mouseout",function(){Ha.css(I.visible?Ya:Ia);I.setState()}).on("click",function(){var Db=function(){I.setVisible()};I.firePointEvent?I.firePointEvent("legendItemClick",null,Db):Pa(I,"legendItemClick",null,Db)}).attr({zIndex:2}).add(fb);if(!Da&&Ma&&Ma.lineWidth){var aa={"stroke-width":Ma.lineWidth,zIndex:2};if(Ma.dashStyle)aa.dashstyle=Ma.dashStyle;I.legendLine=da.path([Za,-Ka-za,0,Ja,-za,0]).attr(aa).add(fb)}if(Da)ja=da.rect(T=-Ka-za,ra=-11,Ka,12,2).attr({zIndex:3}).add(fb);else if(Ma&&Ma.marker&&Ma.marker.enabled)ja=da.symbol(I.symbol,T=-Ka/2-za,ra=-4,Ma.marker.radius).attr({zIndex:3}).add(fb);if(ja){ja.xOff=T+ca%2/2;ja.yOff=ra+ca%2/2}I.legendSymbol=ja;i(I,I.visible);if(Ma&&Ma.showCheckbox){I.checkbox=ib("input",{type:"checkbox",checked:I.selected,defaultChecked:I.selected},N.itemCheckboxStyle,ya);Sa(I.checkbox,"click",function(Db){Pa(I,"checkboxClick",{checked:Db.target.checked},function(){I.select()})})}}ja=Ha.getBBox();T=I.legendItemWidth=N.itemWidth||Ka+za+ja.width+Y;M=ja.height;if(ba&&L-w+T>(Fb||Xa-2*z-w)){L=w;E+=M}D=E;y(I,L,E);if(ba)L+=T;else E+=M;eb=Fb||Fa(ba?L-w:T,eb)}function na(){L=w;E=v;D=eb=0;fb||(fb=da.g("legend").attr({zIndex:7}).add());Na=[];t(Ub,function(ra){var Da=ra.options;if(Da.showInLegend)Na=Na.concat(Da.legendType==="point"?ra.data:ra)});Na.sort(function(ra,Da){return(ra.options.legendIndex||0)-(Da.options.legendIndex||0)});hc&&Na.reverse();t(Na,R);Xb=Fb||eb;Yb=D-v+M;if(oa||va){Xb+=2*z;Yb+=2*z;if(ha)Xb>0&&Yb>0&&ha.animate(ha.crisp(null,null,null,Xb,Yb));else ha=da.rect(0,0,Xb,Yb,N.borderRadius,oa||0).attr({stroke:N.borderColor,"stroke-width":oa||0,fill:va||jb}).add(fb).shadow(N.shadow);ha[Na.length?"show":"hide"]()}for(var I=["left","right","top","bottom"],ja,T=4;T--;){ja=I[T];if(Oa[ja]&&Oa[ja]!=="auto"){N[T<2?"align":"verticalAlign"]=ja;N[T<2?"x":"y"]=la(Oa[ja])*(T%2?-1:1)}}fb.align(pa(N,{width:Xb,height:Yb}),true,Ob);Tc||x()}var N=m.options.legend;if(N.enabled){var ba=N.layout==="horizontal",Ka=N.symbolWidth,za=N.symbolPadding,Na,Oa=N.style,Ya=N.itemStyle,Ea=N.itemHoverStyle,Ia=N.itemHiddenStyle,z=la(Oa.padding),Y=20,v=18,w=4+z+Ka+za,L,E,D,M=0,ha,oa=N.borderWidth,va=N.backgroundColor,fb,eb,Fb=N.width,Ub=m.series,hc=N.reversed;na();Sa(m,"endResize",x);return{colorizeItem:i,destroyItem:function(I){var ja=I.checkbox;t(["legendItem","legendLine","legendSymbol"],function(T){I[T]&&I[T].destroy()});ja&&Hc(I.checkbox)},renderLegend:na}}};lc=function(m,i){return m>=0&&m<=Ba&&i>=0&&i<=xa};Ud=function(){Pa(p,"selection",{resetSelection:true},od);p.toolbar.remove("zoom")};od=function(m){var i=Va.lang,y=p.pointCount<100;p.toolbar.add("zoom",i.resetZoom,i.resetZoomTitle,Ud);!m||m.resetSelection?t(bb,function(x){x.setExtremes(null,null,false,y)}):t(m.xAxis.concat(m.yAxis),function(x){var R=x.axis;if(p.tracker[R.isXAxis?"zoomX":"zoomY"])R.setExtremes(x.min,x.max,false,y)});j()};wc=function(){var m=a.legend,i=B(m.margin,10),y=m.x,x=m.y,R=m.align,na=m.verticalAlign,N;ud();if((p.title||p.subtitle)&&!J(O))if(N=Fa(p.title&&!Hb.floating&&!Hb.verticalAlign&&Hb.y||0,p.subtitle&&!xc.floating&&!xc.verticalAlign&&xc.y||0))ea=Fa(ea,N+B(Hb.margin,15)+Ta);if(m.enabled&&!m.floating)if(R==="right")J(Q)||(Eb=Fa(Eb,Xb-y+i+cb));else if(R==="left")J(S)||(Z=Fa(Z,Xb+y+i+Jb));else if(na==="top")J(O)||(ea=Fa(ea,Yb+x+i+Ta));else if(na==="bottom")J(H)||(sb=Fa(sb,Yb-x+i+Ib));mc&&t(bb,function(ba){ba.getOffset()});J(S)||(Z+=Vb[3]);J(O)||(ea+=Vb[0]);J(H)||(sb+=Vb[2]);J(Q)||(Eb+=Vb[1]);vd()};td=function(m,i,y){var x=p.title,R=p.subtitle;Tc+=1;fc(y,p);Qc=Ra;ld=Xa;p.chartWidth=Xa=X(m);p.chartHeight=Ra=X(i);La(ya,{width:Xa+$a,height:Ra+$a});da.setSize(Xa,Ra,y);Ba=Xa-Z-Eb;xa=Ra-ea-sb;Lb=null;t(bb,function(na){na.isDirty=true;na.setScale()});t(Ga,function(na){na.isDirty=true});p.isDirtyLegend=true;p.isDirtyBox=true;wc();x&&x.align(null,null,Ob);R&&R.align(null,null,Ob);j(y);Qc=null;Pa(p,"resize");setTimeout(function(){Pa(p,"endResize",null,function(){Tc-=1})},Dc&&Dc.duration||500)};vd=function(){p.plotLeft=Z=X(Z);p.plotTop=ea=X(ea);p.plotWidth=Ba=X(Xa-Z-Eb);p.plotHeight=xa=X(Ra-ea-sb);p.plotSizeX=qa?xa:Ba;p.plotSizeY=qa?Ba:xa;Ob={x:Jb,y:Ta,width:Xa-Jb-cb,height:Ra-Ta-Ib}};ud=function(){ea=B(O,Ta);Eb=B(Q,cb);sb=B(H,Ib);Z=B(S,Jb);Vb=[0,0,0,0]};rd=function(){var m=u.borderWidth||0,i=u.backgroundColor,y=u.plotBackgroundColor,x=u.plotBackgroundImage,R,na={x:Z,y:ea,width:Ba,height:xa};R=m+(u.shadow?8:0);if(m||i)if(Zc)Zc.animate(Zc.crisp(null,null,null,Xa-R,Ra-R));else Zc=da.rect(R/2,R/2,Xa-R,Ra-R,u.borderRadius,m).attr({stroke:u.borderColor,"stroke-width":m,fill:i||jb}).add().shadow(u.shadow);if(y)if(wd)wd.animate(na);else wd=da.rect(Z,ea,Ba,xa,0).attr({fill:y}).add().shadow(u.plotShadow);if(x)if(xd)xd.animate(na);else xd=da.image(x,Z,ea,Ba,xa).add();if(u.plotBorderWidth)if($c)$c.animate($c.crisp(null,Z,ea,Ba,xa));else $c=da.rect(Z,ea,Ba,xa,0,u.plotBorderWidth).attr({stroke:u.plotBorderColor,"stroke-width":u.plotBorderWidth,zIndex:4}).add();p.isDirtyBox=false};Sa(ab,"unload",K);u.reflow!==false&&Sa(p,"load",G);if(P)for(yd in P)Sa(p,yd,P[yd]);p.options=a;p.series=Ga;p.addSeries=function(m,i,y){var x;if(m){fc(y,p);i=B(i,true);Pa(p,"addSeries",{options:m},function(){x=g(m);x.isDirty=true;p.isDirtyLegend=true;i&&p.redraw()})}return x};p.animation=B(u.animation,true);p.destroy=K;p.get=function(m){var i,y,x;for(i=0;i<bb.length;i++)if(bb[i].options.id===m)return bb[i];for(i=0;i<Ga.length;i++)if(Ga[i].options.id===m)return Ga[i];for(i=0;i<Ga.length;i++){x=Ga[i].data;for(y=0;y<x.length;y++)if(x[y].id===m)return x[y]}return null};p.getSelectedPoints=function(){var m=[];t(Ga,function(i){m=m.concat(Ad(i.data,function(y){return y.selected}))});return m};p.getSelectedSeries=function(){return Ad(Ga,function(m){return m.selected})};p.hideLoading=function(){ad(dc,{opacity:0},{duration:a.loading.hideDuration,complete:function(){La(dc,{display:jb})}});zd=false};p.isInsidePlot=lc;p.redraw=j;p.setSize=td;p.setTitle=n;p.showLoading=function(m){var i=a.loading;if(!dc){dc=ib(Rb,{className:"highcharts-loading"},pa(i.style,{left:Z+$a,top:ea+$a,width:Ba+$a,height:xa+$a,zIndex:10,display:jb}),ya);Td=ib("span",null,i.labelStyle,dc)}Td.innerHTML=m||a.lang.loading;if(!zd){La(dc,{opacity:0,display:""});ad(dc,{opacity:i.style.opacity},{duration:i.showDuration});zd=true}};p.pointCount=0;ia()}var wa=document,ab=window,ta=Math,X=ta.round,kb=ta.floor,hd=ta.ceil,Fa=ta.max,qb=ta.min,db=ta.abs,nb=ta.cos,Bb=ta.sin,Zb=ta.PI,Vd=Zb*2/360,qc=navigator.userAgent,Cc=/msie/i.test(qc)&&!ab.opera,Ac=wa.documentMode===8,Od=/AppleWebKit/.test(qc),Sd=/Firefox/.test(qc),zc=!!wa.createElementNS&&!!wa.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect,Xc,Nb=wa.documentElement.ontouchstart!==undefined,Pb,Yc,Wd={},sd=0,rb=1,Ic,Va,Oc,Dc,bd,Ua,Rb="div",pc="absolute",Rd="relative",gb="hidden",oc="highcharts-",ub="visible",$a="px",jb="none",Za="M",Ja="L",Xd="rgba(192,192,192,"+(zc?1.0E-6:0.0020)+")",hb="",Ab="hover",Ec,dd,ed,fd,tc,Fc,Gc,Dd,Ed,gd,Fd,Gd,ka=ab.HighchartsAdapter,wb=ka||{},t=wb.each,Ad=wb.grep,nc=wb.map,sa=wb.merge,Yd=wb.hyphenate,Sa=wb.addEvent,Gb=wb.removeEvent,Pa=wb.fireEvent,ad=wb.animate,Uc=wb.stop,vb={};Oc=function(a,b,c){function d(G){return G.toString().replace(/^([0-9])$/,"0$1")}if(!J(b)||isNaN(b))return"Invalid date";a=B(a,"%Y-%m-%d %H:%M:%S");b=new Date(b*rb);var e,f=b[ed](),g=b[fd](),h=b[tc](),j=b[Fc](),l=b[Gc](),n=Va.lang,C=n.weekdays;n=n.months;b={a:C[g].substr(0,3),A:C[g],d:d(h),e:h,b:n[j].substr(0,3),B:n[j],m:d(j+1),y:l.toString().substr(2,2),Y:l,H:d(f),I:d(f%12||12),l:f%12||12,M:d(b[dd]()),p:f<12?"AM":"PM",P:f<12?"am":"pm",S:d(b.getSeconds())};for(e in b)a=a.replace("%"+e,b[e]);return c?a.substr(0,1).toUpperCase()+a.substr(1):a};ka&&ka.init&&ka.init();if(!ka&&ab.jQuery){var ob=jQuery;t=function(a,b){for(var c=0,d=a.length;c<d;c++)if(b.call(a[c],a[c],c,a)===false)return c};Ad=ob.grep;nc=function(a,b){for(var c=[],d=0,e=a.length;d<e;d++)c[d]=b.call(a[d],a[d],d,a);return c};sa=function(){var a=arguments;return ob.extend(true,null,a[0],a[1],a[2],a[3])};Yd=function(a){return a.replace(/([A-Z])/g,function(b,c){return"-"+c.toLowerCase()})};Sa=function(a,b,c){ob(a).bind(b,c)};Gb=function(a,b,c){var d=wa.removeEventListener?"removeEventListener":"detachEvent";if(wa[d]&&!a[d])a[d]=function(){};ob(a).unbind(b,c)};Pa=function(a,b,c,d){var e=ob.Event(b),f="detached"+b;pa(e,c);if(a[b]){a[f]=a[b];a[b]=null}ob(a).trigger(e);if(a[f]){a[b]=a[f];a[f]=null}d&&!e.isDefaultPrevented()&&d(e)};ad=function(a,b,c){var d=ob(a);if(b.d){a.toD=b.d;b.d=1}d.stop();d.animate(b,c)};Uc=function(a){ob(a).stop()};ob.extend(ob.easing,{easeOutQuad:function(a,b,c,d,e){return-d*(b/=e)*(b-2)+c}});var fe=jQuery.fx.step._default,ge=jQuery.fx.prototype.cur;ob.fx.step._default=function(a){var b=a.elem;b.attr?b.attr(a.prop,a.now):fe.apply(this,arguments)};ob.fx.step.d=function(a){var b=a.elem;if(!a.started){var c=bd.init(b,b.d,b.toD);a.start=c[0];a.end=c[1];a.started=true}b.attr("d",bd.step(a.start,a.end,a.pos,b.toD))};ob.fx.prototype.cur=function(){var a=this.elem;return a.attr?a.attr(this.prop):ge.apply(this,arguments)}}bd={init:function(a,b,c){b=b||"";var d=a.shift,e=b.indexOf("C")>-1,f=e?7:3,g;b=b.split(" ");c=[].concat(c);var h,j,l=function(n){for(g=n.length;g--;)n[g]===Za&&n.splice(g+1,0,n[g+1],n[g+2],n[g+1],n[g+2])};if(e){l(b);l(c)}if(a.isArea){h=b.splice(b.length-6,6);j=c.splice(c.length-6,6)}if(d){c=[].concat(c).splice(0,f).concat(c);a.shift=false}if(b.length)for(a=c.length;b.length<a;){d=[].concat(b).splice(b.length-f,f);if(e){d[f-6]=d[f-2];d[f-5]=d[f-1]}b=b.concat(d)}if(h){b=b.concat(h);c=c.concat(j)}return[b,c]},step:function(a,b,c,d){var e=[],f=a.length;if(c===1)e=d;else if(f===b.length&&c<1)for(;f--;){d=parseFloat(a[f]);e[f]=isNaN(d)?a[f]:c*parseFloat(b[f]-d)+d}else e=b;return e}};ka={enabled:true,align:"center",x:0,y:15,style:{color:"#666",fontSize:"11px",lineHeight:"14px"}};Va={colors:["#4572A7","#AA4643","#89A54E","#80699B","#3D96AE","#DB843D","#92A8CD","#A47D7C","#B5CA92"],symbols:["circle","diamond","square","triangle","triangle-down"],lang:{loading:"Loading...",months:["January","February","March","April","May","June","July","August","September","October","November","December"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],decimalPoint:".",resetZoom:"Reset zoom",resetZoomTitle:"Reset zoom level 1:1",thousandsSep:","},global:{useUTC:true},chart:{borderColor:"#4572A7",borderRadius:5,defaultSeriesType:"line",ignoreHiddenSeries:true,spacingTop:10,spacingRight:10,spacingBottom:15,spacingLeft:10,style:{fontFamily:'"Lucida Grande", "Lucida Sans Unicode", Verdana, Arial, Helvetica, sans-serif',fontSize:"12px"},backgroundColor:"#FFFFFF",plotBorderColor:"#C0C0C0"},title:{text:"Chart title",align:"center",y:15,style:{color:"#3E576F",fontSize:"16px"}},subtitle:{text:"",align:"center",y:30,style:{color:"#6D869F"}},plotOptions:{line:{allowPointSelect:false,showCheckbox:false,animation:{duration:1E3},events:{},lineWidth:2,shadow:true,marker:{enabled:true,lineWidth:0,radius:4,lineColor:"#FFFFFF",states:{hover:{},select:{fillColor:"#FFFFFF",lineColor:"#000000",lineWidth:2}}},point:{events:{}},dataLabels:sa(ka,{enabled:false,y:-6,formatter:function(){return this.y}}),showInLegend:true,states:{hover:{marker:{}},select:{marker:{}}},stickyTracking:true}},labels:{style:{position:pc,color:"#3E576F"}},legend:{enabled:true,align:"center",layout:"horizontal",labelFormatter:function(){return this.name},borderWidth:1,borderColor:"#909090",borderRadius:5,shadow:false,style:{padding:"5px"},itemStyle:{cursor:"pointer",color:"#3E576F"},itemHoverStyle:{cursor:"pointer",color:"#000000"},itemHiddenStyle:{color:"#C0C0C0"},itemCheckboxStyle:{position:pc,width:"13px",height:"13px"},symbolWidth:16,symbolPadding:5,verticalAlign:"bottom",x:0,y:0},loading:{hideDuration:100,labelStyle:{fontWeight:"bold",position:Rd,top:"1em"},showDuration:100,style:{position:pc,backgroundColor:"white",opacity:0.5,textAlign:"center"}},tooltip:{enabled:true,backgroundColor:"rgba(255, 255, 255, .85)",borderWidth:2,borderRadius:5,shadow:true,snap:Nb?25:10,style:{color:"#333333",fontSize:"12px",padding:"5px",whiteSpace:"nowrap"}},toolbar:{itemStyle:{color:"#4572A7",cursor:"pointer"}},credits:{enabled:true,text:"Highcharts.com",href:"http://www.highcharts.com",position:{align:"right",x:-10,verticalAlign:"bottom",y:-5},style:{cursor:"pointer",color:"#909090",fontSize:"10px"}}};var Nc={dateTimeLabelFormats:{second:"%H:%M:%S",minute:"%H:%M",hour:"%H:%M",day:"%e. %b",week:"%e. %b",month:"%b '%y",year:"%Y"},endOnTick:false,gridLineColor:"#C0C0C0",labels:ka,lineColor:"#C0D0E0",lineWidth:1,max:null,min:null,minPadding:0.01,maxPadding:0.01,minorGridLineColor:"#E0E0E0",minorGridLineWidth:1,minorTickColor:"#A0A0A0",minorTickLength:2,minorTickPosition:"outside",startOfWeek:1,startOnTick:false,tickColor:"#C0D0E0",tickLength:5,tickmarkPlacement:"between",tickPixelInterval:100,tickPosition:"outside",tickWidth:1,title:{align:"middle",style:{color:"#6D869F",fontWeight:"bold"}},type:"linear"},jd=sa(Nc,{endOnTick:true,gridLineWidth:1,tickPixelInterval:72,showLastLabel:true,labels:{align:"right",x:-8,y:3},lineWidth:0,maxPadding:0.05,minPadding:0.05,startOnTick:true,tickWidth:0,title:{rotation:270,text:"Y-values"},stackLabels:{enabled:false,formatter:function(){return this.total},style:ka.style}}),be={labels:{align:"right",x:-8,y:null},title:{rotation:270}},ae={labels:{align:"left",x:8,y:null},title:{rotation:90}},Nd={labels:{align:"center",x:0,y:14},title:{rotation:0}},$d=sa(Nd,{labels:{y:-5}}),xb=Va.plotOptions;ka=xb.line;xb.spline=sa(ka);xb.scatter=sa(ka,{lineWidth:0,states:{hover:{lineWidth:0}}});xb.area=sa(ka,{});xb.areaspline=sa(xb.area);xb.column=sa(ka,{borderColor:"#FFFFFF",borderWidth:1,borderRadius:0,groupPadding:0.2,marker:null,pointPadding:0.1,minPointLength:0,states:{hover:{brightness:0.1,shadow:false},select:{color:"#C0C0C0",borderColor:"#000000",shadow:false}},dataLabels:{y:null,verticalAlign:null}});xb.bar=sa(xb.column,{dataLabels:{align:"left",x:5,y:0}});xb.pie=sa(ka,{borderColor:"#FFFFFF",borderWidth:1,center:["50%","50%"],colorByPoint:true,dataLabels:{distance:30,enabled:true,formatter:function(){return this.point.name},y:5},legendType:"point",marker:null,size:"75%",showInLegend:false,slicedOffset:10,states:{hover:{brightness:0.1,shadow:false}}});Cd();var $b=function(a){var b=[],c;(function(d){if(c=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]?(?:\.[0-9]+)?)\s*\)/.exec(d))b=[la(c[1]),la(c[2]),la(c[3]),parseFloat(c[4],10)];else if(c=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(d))b=[la(c[1],16),la(c[2],16),la(c[3],16),1]})(a);return{get:function(d){return b&&!isNaN(b[0])?d==="rgb"?"rgb("+b[0]+","+b[1]+","+b[2]+")":d==="a"?b[3]:"rgba("+b.join(",")+")":a},brighten:function(d){if(ec(d)&&d!==0){var e;for(e=0;e<3;e++){b[e]+=la(d*255);if(b[e]<0)b[e]=0;if(b[e]>255)b[e]=255}}return this},setOpacity:function(d){b[3]=d;return this}}};Jc.prototype={init:function(a,b){this.element=wa.createElementNS("http://www.w3.org/2000/svg",b);this.renderer=a},animate:function(a,b,c){if(b=B(b,Dc,true)){b=sa(b);if(c)b.complete=c;ad(this,a,b)}else{this.attr(a);c&&c()}},attr:function(a,b){var c,d,e,f,g=this.element,h=g.nodeName,j=this.renderer,l,n=this.shadows,C,G=this;if(Qb(a)&&J(b)){c=a;a={};a[c]=b}if(Qb(a)){c=a;if(h==="circle")c={x:"cx",y:"cy"}[c]||c;else if(c==="strokeWidth")c="stroke-width";G=Ca(g,c)||this[c]||0;if(c!=="d"&&c!=="visibility")G=parseFloat(G)}else for(c in a){l=false;d=a[c];if(c==="d"){if(d&&d.join)d=d.join(" ");if(/(NaN| {2}|^$)/.test(d))d="M 0 0";this.d=d}else if(c==="x"&&h==="text"){for(e=0;e<g.childNodes.length;e++){f=g.childNodes[e];Ca(f,"x")===Ca(g,"x")&&Ca(f,"x",d)}if(this.rotation)Ca(g,"transform","rotate("+this.rotation+" "+d+" "+la(a.y||Ca(g,"y"))+")")}else if(c==="fill")d=j.color(d,g,c);else if(h==="circle"&&(c==="x"||c==="y"))c={x:"cx",y:"cy"}[c]||c;else if(c==="translateX"||c==="translateY"||c==="rotation"||c==="verticalAlign"){this[c]=d;this.updateTransform();l=true}else if(c==="stroke")d=j.color(d,g,c);else if(c==="dashstyle"){c="stroke-dasharray";d=d&&d.toLowerCase();if(d==="solid")d=jb;else if(d){d=d.replace("shortdashdotdot","3,1,1,1,1,1,").replace("shortdashdot","3,1,1,1").replace("shortdot","1,1,").replace("shortdash","3,1,").replace("longdash","8,3,").replace(/dot/g,"1,3,").replace("dash","4,3,").replace(/,$/,"").split(",");for(e=d.length;e--;)d[e]=la(d[e])*a["stroke-width"];d=d.join(",")}}else if(c==="isTracker")this[c]=d;else if(c==="width")d=la(d);else if(c==="align"){c="text-anchor";d={left:"start",center:"middle",right:"end"}[d]}if(c==="strokeWidth")c="stroke-width";if(Od&&c==="stroke-width"&&d===0)d=1.0E-6;if(this.symbolName&&/^(x|y|r|start|end|innerR)/.test(c)){if(!C){this.symbolAttr(a);C=true}l=true}if(n&&/^(width|height|visibility|x|y|d)$/.test(c))for(e=n.length;e--;)Ca(n[e],c,d);if((c==="width"||c==="height")&&h==="rect"&&d<0)d=0;if(c==="text"){this.textStr=d;this.added&&j.buildText(this)}else l||Ca(g,c,d)}return G},symbolAttr:function(a){var b=this;t(["x","y","r","start","end","width","height","innerR"],function(c){b[c]=B(a[c],b[c])});b.attr({d:b.renderer.symbols[b.symbolName](X(b.x*2)/2,X(b.y*2)/2,b.r,{start:b.start,end:b.end,width:b.width,height:b.height,innerR:b.innerR})})},clip:function(a){return this.attr("clip-path","url("+this.renderer.url+"#"+a.id+")")},crisp:function(a,b,c,d,e){var f,g={},h={},j;a=a||this.strokeWidth||0;j=a%2/2;h.x=kb(b||this.x||0)+j;h.y=kb(c||this.y||0)+j;h.width=kb((d||this.width||0)-2*j);h.height=kb((e||this.height||0)-2*j);h.strokeWidth=a;for(f in h)if(this[f]!==h[f])this[f]=g[f]=h[f];return g},css:function(a){var b=this.element;b=a&&a.width&&b.nodeName==="text";var c=a,d;if(a&&a.color)a.fill=a.color;this.styles=a=pa(this.styles,a);if(J(a)){a={};for(d in c)a[Yd(d)]=c[d]}if(Cc&&!zc){b&&delete a.width;La(this.element,a)}else this.attr({style:Zd(a)});b&&this.added&&this.renderer.buildText(this);return this},on:function(a,b){var c=b;if(Nb&&a==="click"){a="touchstart";c=function(d){d.preventDefault();b()}}this.element["on"+a]=c;return this},translate:function(a,b){return this.attr({translateX:a,translateY:b})},invert:function(){this.inverted=true;this.updateTransform();return this},updateTransform:function(){var a=this.translateX||0,b=this.translateY||0,c=this.inverted,d=this.rotation,e=[];if(c){a+=this.attr("width");b+=this.attr("height")}if(a||b)e.push("translate("+a+","+b+")");if(c)e.push("rotate(90) scale(-1,1)");else d&&e.push("rotate("+d+" "+this.x+" "+this.y+")");e.length&&Ca(this.element,"transform",e.join(" "))},toFront:function(){var a=this.element;a.parentNode.appendChild(a);return this},align:function(a,b,c){if(a){this.alignOptions=a;this.alignByTranslate=b;c||this.renderer.alignedObjects.push(this)}else{a=this.alignOptions;b=this.alignByTranslate}c=B(c,this.renderer);var d=a.align,e=a.verticalAlign,f=(c.x||0)+(a.x||0),g=(c.y||0)+(a.y||0),h={};if(/^(right|center)$/.test(d))f+=(c.width-(a.width||0))/{right:1,center:2}[d];h[b?"translateX":"x"]=X(f);if(/^(bottom|middle)$/.test(e))g+=(c.height-(a.height||0))/({bottom:1,middle:2}[e]||1);h[b?"translateY":"y"]=X(g);this[this.placed?"animate":"attr"](h);this.placed=true;this.alignAttr=h;return this},getBBox:function(){var a,b,c,d=this.rotation,e=d*Vd;try{a=pa({},this.element.getBBox())}catch(f){a={width:0,height:0}}b=a.width;c=a.height;if(d){a.width=db(c*Bb(e))+db(b*nb(e));a.height=db(c*nb(e))+db(b*Bb(e))}return a},show:function(){return this.attr({visibility:ub})},hide:function(){return this.attr({visibility:gb})},add:function(a){var b=this.renderer,c=a||b,d=c.element||b.box,e=d.childNodes,f=this.element,g=Ca(f,"zIndex");this.parentInverted=a&&a.inverted;this.textStr!==undefined&&b.buildText(this);if(g){c.handleZ=true;g=la(g)}if(c.handleZ)for(c=0;c<e.length;c++){a=e[c];b=Ca(a,"zIndex");if(a!==f&&(la(b)>g||!J(g)&&J(b))){d.insertBefore(f,a);return this}}d.appendChild(f);this.added=true;return this},destroy:function(){var a=this.element||{},b=this.shadows,c=a.parentNode,d;a.onclick=a.onmouseout=a.onmouseover=a.onmousemove=null;Uc(this);c&&c.removeChild(a);b&&t(b,function(e){(c=e.parentNode)&&c.removeChild(e)});rc(this.renderer.alignedObjects,this);for(d in this)delete this[d];return null},empty:function(){for(var a=this.element,b=a.childNodes,c=b.length;c--;)a.removeChild(b[c])},shadow:function(a,b){var c=[],d,e,f=this.element,g=this.parentInverted?"(-1,-1)":"(1,1)";if(a){for(d=1;d<=3;d++){e=f.cloneNode(0);Ca(e,{isShadow:"true",stroke:"rgb(0, 0, 0)","stroke-opacity":0.05*d,"stroke-width":7-2*d,transform:"translate"+g,fill:jb});b?b.element.appendChild(e):f.parentNode.insertBefore(e,f);c.push(e)}this.shadows=c}return this}};var Wc=function(){this.init.apply(this,arguments)};Wc.prototype={Element:Jc,init:function(a,b,c,d){var e=location,f;f=this.createElement("svg").attr({xmlns:"http://www.w3.org/2000/svg",version:"1.1"});a.appendChild(f.element);this.box=f.element;this.boxWrapper=f;this.alignedObjects=[];this.url=Cc?"":e.href.replace(/#.*?$/,"");this.defs=this.createElement("defs").add();this.forExport=d;this.setSize(b,c,false)},createElement:function(a){var b=new this.Element;b.init(this,a);return b},buildText:function(a){for(var b=a.element,c=B(a.textStr,"").toString().replace(/<(b|strong)>/g,'<span style="font-weight:bold">').replace(/<(i|em)>/g,'<span style="font-style:italic">').replace(/<a/g,"<span").replace(/<\/(b|strong|i|em|a)>/g,"</span>").split(/<br.*?>/g),d=b.childNodes,e=/style="([^"]+)"/,f=/href="([^"]+)"/,g=Ca(b,"x"),h=a.styles,j=Sd&&h&&h["-hc-direction"]==="rtl"&&!this.forExport&&la(qc.split("Firefox/")[1])<4,l,n=h&&la(h.width),C=h&&h["line-height"],G,fa=d.length;fa--;)b.removeChild(d[fa]);n&&!a.added&&this.box.appendChild(b);t(c,function(K,ia){var u,P=0,O;K=K.replace(/<span/g,"|||<span").replace(/<\/span>/g,"</span>|||");u=K.split("|||");t(u,function(Q){if(Q!==""||u.length===1){var H={},S=wa.createElementNS("http://www.w3.org/2000/svg","tspan");e.test(Q)&&Ca(S,"style",Q.match(e)[1].replace(/(;| |^)color([ :])/,"$1fill$2"));if(f.test(Q)){Ca(S,"onclick",'location.href="'+Q.match(f)[1]+'"');La(S,{cursor:"pointer"})}Q=(Q.replace(/<(.|\n)*?>/g,"")||" ").replace(/&lt;/g,"<").replace(/&gt;/g,">");if(j){l=[];for(fa=Q.length;fa--;)l.push(Q.charAt(fa));Q=l.join("")}S.appendChild(wa.createTextNode(Q));if(P)H.dx=3;else H.x=g;if(!P){if(ia){!zc&&a.renderer.forExport&&La(S,{display:"block"});O=ab.getComputedStyle&&ab.getComputedStyle(G,null).getPropertyValue("line-height");if(!O||isNaN(O))O=C||G.offsetHeight||18;Ca(S,"dy",O)}G=S}Ca(S,H);b.appendChild(S);P++;if(n){Q=Q.replace(/-/g,"- ").split(" ");for(var Ta,cb=[];Q.length||cb.length;){Ta=b.getBBox().width;H=Ta>n;if(!H||Q.length===1){Q=cb;cb=[];if(Q.length){S=wa.createElementNS("http://www.w3.org/2000/svg","tspan");Ca(S,{dy:C||16,x:g});b.appendChild(S);if(Ta>n)n=Ta}}else{S.removeChild(S.firstChild);cb.unshift(Q.pop())}Q.length&&S.appendChild(wa.createTextNode(Q.join(" ").replace(/- /g,"-")))}}}})})},crispLine:function(a,b){if(a[1]===a[4])a[1]=a[4]=X(a[1])+b%2/2;if(a[2]===a[5])a[2]=a[5]=X(a[2])+b%2/2;return a},path:function(a){return this.createElement("path").attr({d:a,fill:jb})},circle:function(a,b,c){a=Kb(a)?a:{x:a,y:b,r:c};return this.createElement("circle").attr(a)},arc:function(a,b,c,d,e,f){if(Kb(a)){b=a.y;c=a.r;d=a.innerR;e=a.start;f=a.end;a=a.x}return this.symbol("arc",a||0,b||0,c||0,{innerR:d||0,start:e||0,end:f||0})},rect:function(a,b,c,d,e,f){if(Kb(a)){b=a.y;c=a.width;d=a.height;e=a.r;f=a.strokeWidth;a=a.x}e=this.createElement("rect").attr({rx:e,ry:e,fill:jb});return e.attr(e.crisp(f,a,b,Fa(c,0),Fa(d,0)))},setSize:function(a,b,c){var d=this.alignedObjects,e=d.length;this.width=a;this.height=b;for(this.boxWrapper[B(c,true)?"animate":"attr"]({width:a,height:b});e--;)d[e].align()},g:function(a){return this.createElement("g").attr(J(a)&&{"class":oc+a})},image:function(a,b,c,d,e){var f={preserveAspectRatio:jb};arguments.length>1&&pa(f,{x:b,y:c,width:d,height:e});f=this.createElement("image").attr(f);f.element.setAttributeNS?f.element.setAttributeNS("http://www.w3.org/1999/xlink","href",a):f.element.setAttribute("hc-svg-href",a);return f},symbol:function(a,b,c,d,e){var f,g=this.symbols[a];g=g&&g(X(b),X(c),d,e);var h=/^url\((.*?)\)$/,j;if(g){f=this.path(g);pa(f,{symbolName:a,x:b,y:c,r:d});e&&pa(f,e)}else if(h.test(a)){var l=function(n,C){n.attr({width:C[0],height:C[1]}).translate(-X(C[0]/2),-X(C[1]/2))};j=a.match(h)[1];a=Wd[j];f=this.image(j).attr({x:b,y:c});if(a)l(f,a);else{f.attr({width:0,height:0});ib("img",{onload:function(){l(f,Wd[j]=[this.width,this.height])},src:j})}}else f=this.circle(b,c,d);return f},symbols:{square:function(a,b,c){c=0.707*c;return[Za,a-c,b-c,Ja,a+c,b-c,a+c,b+c,a-c,b+c,"Z"]},triangle:function(a,b,c){return[Za,a,b-1.33*c,Ja,a+c,b+0.67*c,a-c,b+0.67*c,"Z"]},"triangle-down":function(a,b,c){return[Za,a,b+1.33*c,Ja,a-c,b-0.67*c,a+c,b-0.67*c,"Z"]},diamond:function(a,b,c){return[Za,a,b-c,Ja,a+c,b,a,b+c,a-c,b,"Z"]},arc:function(a,b,c,d){var e=d.start,f=d.end-1.0E-6,g=d.innerR,h=nb(e),j=Bb(e),l=nb(f);f=Bb(f);d=d.end-e<Zb?0:1;return[Za,a+c*h,b+c*j,"A",c,c,0,d,1,a+c*l,b+c*f,Ja,a+g*l,b+g*f,"A",g,g,0,d,0,a+g*h,b+g*j,"Z"]}},clipRect:function(a,b,c,d){var e=oc+sd++,f=this.createElement("clipPath").attr({id:e}).add(this.defs);a=this.rect(a,b,c,d,0).add(f);a.id=e;return a},color:function(a,b,c){var d,e=/^rgba/;if(a&&a.linearGradient){var f=this;b=a.linearGradient;c=oc+sd++;var g,h,j;g=f.createElement("linearGradient").attr({id:c,gradientUnits:"userSpaceOnUse",x1:b[0],y1:b[1],x2:b[2],y2:b[3]}).add(f.defs);t(a.stops,function(l){if(e.test(l[1])){d=$b(l[1]);h=d.get("rgb");j=d.get("a")}else{h=l[1];j=1}f.createElement("stop").attr({offset:l[0],"stop-color":h,"stop-opacity":j}).add(g)});return"url("+this.url+"#"+c+")"}else if(e.test(a)){d=$b(a);Ca(b,c+"-opacity",d.get("a"));return d.get("rgb")}else return a},text:function(a,b,c){var d=Va.chart.style;b=X(B(b,0));c=X(B(c,0));a=this.createElement("text").attr({x:b,y:c,text:a}).css({"font-family":d.fontFamily,"font-size":d.fontSize});a.x=b;a.y=c;return a}};Xc=Wc;if(!zc){wb=yb(Jc,{init:function(a,b){var c=["<",b,' filled="f" stroked="f"'],d=["position: ",pc,";"];if(b==="shape"||b===Rb)d.push("left:0;top:0;width:10px;height:10px;");if(Ac)d.push("visibility: ",b===Rb?gb:ub);c.push(' style="',d.join(""),'"/>');if(b){c=b===Rb||b==="span"||b==="img"?c.join(""):a.prepVML(c);this.element=ib(c)}this.renderer=a},add:function(a){var b=this.renderer,c=this.element,d=b.box;d=a?a.element||a:d;a&&a.inverted&&b.invertChild(c,d);Ac&&d.gVis===gb&&La(c,{visibility:gb});d.appendChild(c);this.added=true;this.alignOnAdd&&this.updateTransform();return this},attr:function(a,b){var c,d,e,f=this.element||{},g=f.style,h=f.nodeName,j=this.renderer,l=this.symbolName,n,C,G=this.shadows,fa=this;if(Qb(a)&&J(b)){c=a;a={};a[c]=b}if(Qb(a)){c=a;fa=c==="strokeWidth"||c==="stroke-width"?this.strokeweight:this[c]}else for(c in a){d=a[c];n=false;if(l&&/^(x|y|r|start|end|width|height|innerR)/.test(c)){if(!C){this.symbolAttr(a);C=true}n=true}else if(c==="d"){d=d||[];this.d=d.join(" ");e=d.length;for(n=[];e--;)n[e]=ec(d[e])?X(d[e]*10)-5:d[e]==="Z"?"x":d[e];d=n.join(" ")||"x";f.path=d;if(G)for(e=G.length;e--;)G[e].path=d;n=true}else if(c==="zIndex"||c==="visibility"){if(Ac&&c==="visibility"&&h==="DIV"){f.gVis=d;n=f.childNodes;for(e=n.length;e--;)La(n[e],{visibility:d});if(d===ub)d=null}if(d)g[c]=d;n=true}else if(/^(width|height)$/.test(c)){if(this.updateClipping){this[c]=d;this.updateClipping()}else g[c]=d;n=true}else if(/^(x|y)$/.test(c)){this[c]=d;if(f.tagName==="SPAN")this.updateTransform();else g[{x:"left",y:"top"}[c]]=d}else if(c==="class")f.className=d;else if(c==="stroke"){d=j.color(d,f,c);c="strokecolor"}else if(c==="stroke-width"||c==="strokeWidth"){f.stroked=d?true:false;c="strokeweight";this[c]=d;if(ec(d))d+=$a}else if(c==="dashstyle"){(f.getElementsByTagName("stroke")[0]||ib(j.prepVML(["<stroke/>"]),null,null,f))[c]=d||"solid";this.dashstyle=d;n=true}else if(c==="fill")if(h==="SPAN")g.color=d;else{f.filled=d!==jb?true:false;d=j.color(d,f,c);c="fillcolor"}else if(c==="translateX"||c==="translateY"||c==="rotation"||c==="align"){if(c==="align")c="textAlign";this[c]=d;this.updateTransform();n=true}else if(c==="text"){this.bBox=null;f.innerHTML=d;n=true}if(G&&c==="visibility")for(e=G.length;e--;)G[e].style[c]=d;if(!n)if(Ac)f[c]=d;else Ca(f,c,d)}return fa},clip:function(a){var b=this,c=a.members;c.push(b);b.destroyClip=function(){rc(c,b)};return b.css(a.getCSS(b.inverted))},css:function(a){var b=this.element;if(b=a&&b.tagName==="SPAN"&&a.width){delete a.width;this.textWidth=b;this.updateTransform()}this.styles=pa(this.styles,a);La(this.element,a);return this},destroy:function(){this.destroyClip&&this.destroyClip();Jc.prototype.destroy.apply(this)},empty:function(){for(var a=this.element.childNodes,b=a.length,c;b--;){c=a[b];c.parentNode.removeChild(c)}},getBBox:function(){var a=this.element,b=this.bBox;if(!b){if(a.nodeName==="text")a.style.position=pc;b=this.bBox={x:a.offsetLeft,y:a.offsetTop,width:a.offsetWidth,height:a.offsetHeight}}return b},on:function(a,b){this.element["on"+a]=function(){var c=ab.event;c.target=c.srcElement;b(c)};return this},updateTransform:function(){if(this.added){var a=this,b=a.element,c=a.translateX||0,d=a.translateY||0,e=a.x||0,f=a.y||0,g=a.textAlign||"left",h={left:0,center:0.5,right:1}[g],j=g&&g!=="left";if(c||d)a.css({marginLeft:c,marginTop:d});a.inverted&&t(b.childNodes,function(P){a.renderer.invertChild(P,b)});if(b.tagName==="SPAN"){var l,n;c=a.rotation;var C;l=0;d=1;var G=0,fa;C=la(a.textWidth);var K=a.xCorr||0,ia=a.yCorr||0,u=[c,g,b.innerHTML,a.textWidth].join(",");if(u!==a.cTT){if(J(c)){l=c*Vd;d=nb(l);G=Bb(l);La(b,{filter:c?["progid:DXImageTransform.Microsoft.Matrix(M11=",d,", M12=",-G,", M21=",G,", M22=",d,", sizingMethod='auto expand')"].join(""):jb})}l=b.offsetWidth;n=b.offsetHeight;if(l>C){La(b,{width:C+$a,display:"block",whiteSpace:"normal"});l=C}C=X((la(b.style.fontSize)||12)*1.2);K=d<0&&-l;ia=G<0&&-n;fa=d*G<0;K+=G*C*(fa?1-h:h);ia-=d*C*(c?fa?h:1-h:1);if(j){K-=l*h*(d<0?-1:1);if(c)ia-=n*h*(G<0?-1:1);La(b,{textAlign:g})}a.xCorr=K;a.yCorr=ia}La(b,{left:e+K,top:f+ia});a.cTT=u}}else this.alignOnAdd=true},shadow:function(a,b){var c=[],d,e=this.element,f=this.renderer,g,h=e.style,j,l=e.path;if(l&&typeof l.value!=="string")l="x";if(a){for(d=1;d<=3;d++){j=['<shape isShadow="true" strokeweight="',7-2*d,'" filled="false" path="',l,'" coordsize="100,100" style="',e.style.cssText,'" />'];g=ib(f.prepVML(j),null,{left:la(h.left)+1,top:la(h.top)+1});j=['<stroke color="black" opacity="',0.05*d,'"/>'];ib(f.prepVML(j),null,null,g);b?b.element.appendChild(g):e.parentNode.insertBefore(g,e);c.push(g)}this.shadows=c}return this}});ka=function(){this.init.apply(this,arguments)};ka.prototype=sa(Wc.prototype,{Element:wb,isIE8:qc.indexOf("MSIE 8.0")>-1,init:function(a,b,c){var d;this.alignedObjects=[];d=this.createElement(Rb);a.appendChild(d.element);this.box=d.element;this.boxWrapper=d;this.setSize(b,c,false);if(!wa.namespaces.hcv){wa.namespaces.add("hcv","urn:schemas-microsoft-com:vml");wa.createStyleSheet().cssText="hcv\\:fill, hcv\\:path, hcv\\:shape, hcv\\:stroke{ behavior:url(#default#VML); display: inline-block; } "}},clipRect:function(a,b,c,d){var e=this.createElement();return pa(e,{members:[],left:a,top:b,width:c,height:d,getCSS:function(f){var g=this.top,h=this.left,j=h+this.width,l=g+this.height;g={clip:"rect("+X(f?h:g)+"px,"+X(f?l:j)+"px,"+X(f?j:l)+"px,"+X(f?g:h)+"px)"};!f&&Ac&&pa(g,{width:j+$a,height:l+$a});return g},updateClipping:function(){t(e.members,function(f){f.css(e.getCSS(f.inverted))})}})},color:function(a,b,c){var d,e=/^rgba/;if(a&&a.linearGradient){var f,g,h=a.linearGradient,j,l,n,C;t(a.stops,function(G,fa){if(e.test(G[1])){d=$b(G[1]);f=d.get("rgb");g=d.get("a")}else{f=G[1];g=1}if(fa){n=f;C=g}else{j=f;l=g}});a=90-ta.atan((h[3]-h[1])/(h[2]-h[0]))*180/Zb;c=["<",c,' colors="0% ',j,",100% ",n,'" angle="',a,'" opacity="',C,'" o:opacity2="',l,'" type="gradient" focus="100%" />'];ib(this.prepVML(c),null,null,b)}else if(e.test(a)&&b.tagName!=="IMG"){d=$b(a);c=["<",c,' opacity="',d.get("a"),'"/>'];ib(this.prepVML(c),null,null,b);return d.get("rgb")}else return a},prepVML:function(a){var b=this.isIE8;a=a.join("");if(b){a=a.replace("/>",' xmlns="urn:schemas-microsoft-com:vml" />');a=a.indexOf('style="')===-1?a.replace("/>",' style="display:inline-block;behavior:url(#default#VML);" />'):a.replace('style="','style="display:inline-block;behavior:url(#default#VML);')}else a=a.replace("<","<hcv:");return a},text:function(a,b,c){var d=Va.chart.style;return this.createElement("span").attr({text:a,x:X(b),y:X(c)}).css({whiteSpace:"nowrap",fontFamily:d.fontFamily,fontSize:d.fontSize})},path:function(a){return this.createElement("shape").attr({coordsize:"100 100",d:a})},circle:function(a,b,c){return this.symbol("circle").attr({x:a,y:b,r:c})},g:function(a){var b;if(a)b={className:oc+a,"class":oc+a};return this.createElement(Rb).attr(b)},image:function(a,b,c,d,e){var f=this.createElement("img").attr({src:a});arguments.length>1&&f.css({left:b,top:c,width:d,height:e});return f},rect:function(a,b,c,d,e,f){if(Kb(a)){b=a.y;c=a.width;d=a.height;e=a.r;f=a.strokeWidth;a=a.x}var g=this.symbol("rect");g.r=e;return g.attr(g.crisp(f,a,b,Fa(c,0),Fa(d,0)))},invertChild:function(a,b){var c=b.style;La(a,{flip:"x",left:la(c.width)-10,top:la(c.height)-10,rotation:-90})},symbols:{arc:function(a,b,c,d){var e=d.start,f=d.end,g=nb(e),h=Bb(e),j=nb(f),l=Bb(f);d=d.innerR;var n=0.07/c,C=d&&0.1/d||0;if(f-e===0)return["x"];else if(2*Zb-f+e<n)j=-n;else if(f-e<C)j=nb(e+C);return["wa",a-c,b-c,a+c,b+c,a+c*g,b+c*h,a+c*j,b+c*l,"at",a-d,b-d,a+d,b+d,a+d*j,b+d*l,a+d*g,b+d*h,"x","e"]},circle:function(a,b,c){return["wa",a-c,b-c,a+c,b+c,a+c,b,a+c,b,"e"]},rect:function(a,b,c,d){if(!J(d))return[];var e=d.width;d=d.height;var f=a+e,g=b+d;c=qb(c,e,d);return[Za,a+c,b,Ja,f-c,b,"wa",f-2*c,b,f,b+2*c,f-c,b,f,b+c,Ja,f,g-c,"wa",f-2*c,g-2*c,f,g,f,g-c,f-c,g,Ja,a+c,g,"wa",a,g-2*c,a+2*c,g,a+c,g,a,g-c,Ja,a,b+c,"wa",a,b,a+2*c,b+2*c,a,b+c,a+c,b,"x","e"]}}});Xc=ka}Hd.prototype.callbacks=[];var Bc=function(){};Bc.prototype={init:function(a,b){var c;this.series=a;this.applyOptions(b);this.pointAttr={};if(a.options.colorByPoint){c=a.chart.options.colors;if(!this.options)this.options={};this.color=this.options.color=this.color||c[Pb++];if(Pb>=c.length)Pb=0}a.chart.pointCount++;return this},applyOptions:function(a){var b=this.series;this.config=a;if(ec(a)||a===null)this.y=a;else if(Kb(a)&&!ec(a.length)){pa(this,a);this.options=a}else if(Qb(a[0])){this.name=a[0];this.y=a[1]}else if(ec(a[0])){this.x=a[0];this.y=a[1]}if(this.x===Ua)this.x=b.autoIncrement()},destroy:function(){var a=this,b=a.series,c;b.chart.pointCount--;a===b.chart.hoverPoint&&a.onMouseOut();b.chart.hoverPoints=null;Gb(a);t(["graphic","tracker","group","dataLabel","connector"],function(d){a[d]&&a[d].destroy()});a.legendItem&&a.series.chart.legend.destroyItem(a);for(c in a)a[c]=null},getLabelConfig:function(){return{x:this.category,y:this.y,series:this.series,point:this,percentage:this.percentage,total:this.total||this.stackTotal}},select:function(a,b){var c=this,d=c.series.chart;c.selected=a=B(a,!c.selected);c.firePointEvent(a?"select":"unselect");c.setState(a&&"select");b||t(d.getSelectedPoints(),function(e){if(e.selected&&e!==c){e.selected=false;e.setState(hb);e.firePointEvent("unselect")}})},onMouseOver:function(){var a=this.series.chart,b=a.tooltip,c=a.hoverPoint;c&&c!==this&&c.onMouseOut();this.firePointEvent("mouseOver");b&&!b.shared&&b.refresh(this);this.setState(Ab);a.hoverPoint=this},onMouseOut:function(){this.firePointEvent("mouseOut");this.setState();this.series.chart.hoverPoint=null},tooltipFormatter:function(a){var b=this.series;return['<span style="color:'+b.color+'">',this.name||b.name,"</span>: ",!a?"<b>x = "+(this.name||this.x)+",</b> ":"","<b>",!a?"y = ":"",this.y,"</b>"].join("")},update:function(a,b,c){var d=this,e=d.series,f=d.graphic,g=e.chart;b=B(b,true);d.firePointEvent("update",{options:a},function(){d.applyOptions(a);if(Kb(a)){e.getAttribs();f&&f.attr(d.pointAttr[e.state])}e.isDirty=true;b&&g.redraw(c)})},remove:function(a,b){var c=this,d=c.series,e=d.chart,f=d.data;fc(b,e);a=B(a,true);c.firePointEvent("remove",null,function(){rc(f,c);c.destroy();d.isDirty=true;a&&e.redraw()})},firePointEvent:function(a,b,c){var d=this,e=this.series.options;if(e.point.events[a]||d.options&&d.options.events&&d.options.events[a])this.importEvents();if(a==="click"&&e.allowPointSelect)c=function(f){d.select(null,f.ctrlKey||f.metaKey||f.shiftKey)};Pa(this,a,b,c)},importEvents:function(){if(!this.hasImportedEvents){var a=sa(this.series.options.point,this.options).events,b;this.events=a;for(b in a)Sa(this,b,a[b]);this.hasImportedEvents=true}},setState:function(a){var b=this.series,c=b.options.states,d=xb[b.type].marker&&b.options.marker,e=d&&!d.enabled,f=(d=d&&d.states[a])&&d.enabled===false,g=b.stateMarkerGraphic,h=b.chart,j=this.pointAttr;a=a||hb;if(!(a===this.state||this.selected&&a!=="select"||c[a]&&c[a].enabled===false||a&&(f||e&&!d.enabled))){if(this.graphic)this.graphic.attr(j[a]);else{if(a){if(!g)b.stateMarkerGraphic=g=h.renderer.circle(0,0,j[a].r).attr(j[a]).add(b.group);g.translate(this.plotX,this.plotY)}if(g)g[a?"show":"hide"]()}this.state=a}}};var pb=function(){};pb.prototype={isCartesian:true,type:"line",pointClass:Bc,pointAttrToOptions:{stroke:"lineColor","stroke-width":"lineWidth",fill:"fillColor",r:"radius"},init:function(a,b){var c,d;d=a.series.length;this.chart=a;b=this.setOptions(b);pa(this,{index:d,options:b,name:b.name||"Series "+(d+1),state:hb,pointAttr:{},visible:b.visible!==false,selected:b.selected===true});d=b.events;for(c in d)Sa(this,c,d[c]);if(d&&d.click||b.point&&b.point.events&&b.point.events.click||b.allowPointSelect)a.runTrackerClick=true;this.getColor();this.getSymbol();this.setData(b.data,false)},autoIncrement:function(){var a=this.options,b=this.xIncrement;b=B(b,a.pointStart,0);this.pointInterval=B(this.pointInterval,a.pointInterval,1);this.xIncrement=b+this.pointInterval;return b},cleanData:function(){var a=this.chart,b=this.data,c,d,e=a.smallestInterval,f,g;b.sort(function(h,j){return h.x-j.x});if(this.options.connectNulls)for(g=b.length-1;g>=0;g--)b[g].y===null&&b[g-1]&&b[g+1]&&b.splice(g,1);for(g=b.length-1;g>=0;g--)if(b[g-1]){f=b[g].x-b[g-1].x;if(f>0&&(d===Ua||f<d)){d=f;c=g}}if(e===Ua||d<e)a.smallestInterval=d;this.closestPoints=c},getSegments:function(){var a=-1,b=[],c=this.data;t(c,function(d,e){if(d.y===null){e>a+1&&b.push(c.slice(a+1,e));a=e}else e===c.length-1&&b.push(c.slice(a+1,e+1))});this.segments=b},setOptions:function(a){var b=this.chart.options.plotOptions;return sa(b[this.type],b.series,a)},getColor:function(){var a=this.chart.options.colors;this.color=this.options.color||a[Pb++]||"#0000ff";if(Pb>=a.length)Pb=0},getSymbol:function(){var a=this.chart.options.symbols;this.symbol=this.options.marker.symbol||a[Yc++];if(Yc>=a.length)Yc=0},addPoint:function(a,b,c,d){var e=this.data,f=this.graph,g=this.area,h=this.chart;a=(new this.pointClass).init(this,a);fc(d,h);if(f&&c)f.shift=c;if(g){g.shift=c;g.isArea=true}b=B(b,true);e.push(a);c&&e[0].remove(false);this.getAttribs();this.isDirty=true;b&&h.redraw()},setData:function(a,b){var c=this,d=c.data,e=c.initialColor,f=c.chart,g=d&&d.length||0;c.xIncrement=null;if(J(e))Pb=e;for(a=nc(sc(a||[]),function(h){return(new c.pointClass).init(c,h)});g--;)d[g].destroy();c.data=a;c.cleanData();c.getSegments();c.getAttribs();c.isDirty=true;f.isDirtyBox=true;B(b,true)&&f.redraw(false)},remove:function(a,b){var c=this,d=c.chart;a=B(a,true);if(!c.isRemoving){c.isRemoving=true;Pa(c,"remove",null,function(){c.destroy();d.isDirtyLegend=d.isDirtyBox=true;a&&d.redraw(b)})}c.isRemoving=false},translate:function(){for(var a=this.chart,b=this.options.stacking,c=this.xAxis.categories,d=this.yAxis,e=this.data,f=e.length;f--;){var g=e[f],h=g.x,j=g.y,l=g.low,n=d.stacks[(j<0?"-":"")+this.stackKey];g.plotX=this.xAxis.translate(h);if(b&&this.visible&&n&&n[h]){l=n[h];h=l.total;l.cum=l=l.cum-j;j=l+j;if(b==="percent"){l=h?l*100/h:0;j=h?j*100/h:0}g.percentage=h?g.y*100/h:0;g.stackTotal=h}if(J(l))g.yBottom=d.translate(l,0,1,0,1);if(j!==null)g.plotY=d.translate(j,0,1,0,1);g.clientX=a.inverted?a.plotHeight-g.plotX:g.plotX;g.category=c&&c[g.x]!==Ua?c[g.x]:g.x}},setTooltipPoints:function(a){var b=this.chart,c=b.inverted,d=[],e=X((c?b.plotTop:b.plotLeft)+b.plotSizeX),f,g,h=[];if(a)this.tooltipPoints=null;t(this.segments,function(j){d=d.concat(j)});if(this.xAxis&&this.xAxis.reversed)d=d.reverse();t(d,function(j,l){f=d[l-1]?d[l-1]._high+1:0;for(g=j._high=d[l+1]?kb((j.plotX+(d[l+1]?d[l+1].plotX:e))/2):e;f<=g;)h[c?e-f++:f++]=j});this.tooltipPoints=h},onMouseOver:function(){var a=this.chart,b=a.hoverSeries;if(!(!Nb&&a.mouseIsDown)){b&&b!==this&&b.onMouseOut();this.options.events.mouseOver&&Pa(this,"mouseOver");this.tracker&&this.tracker.toFront();this.setState(Ab);a.hoverSeries=this}},onMouseOut:function(){var a=this.options,b=this.chart,c=b.tooltip,d=b.hoverPoint;d&&d.onMouseOut();this&&a.events.mouseOut&&Pa(this,"mouseOut");c&&!a.stickyTracking&&c.hide();this.setState();b.hoverSeries=null},animate:function(a){var b=this.chart,c=this.clipRect,d=this.options.animation;if(d&&!Kb(d))d={};if(a){if(!c.isAnimating){c.attr("width",0);c.isAnimating=true}}else{c.animate({width:b.plotSizeX},d);this.animate=null}},drawPoints:function(){var a,b=this.data,c=this.chart,d,e,f,g,h,j;if(this.options.marker.enabled)for(f=b.length;f--;){g=b[f];d=g.plotX;e=g.plotY;j=g.graphic;if(e!==Ua&&!isNaN(e)){a=g.pointAttr[g.selected?"select":hb];h=a.r;if(j)j.animate({x:d,y:e,r:h});else g.graphic=c.renderer.symbol(B(g.marker&&g.marker.symbol,this.symbol),d,e,h).attr(a).add(this.group)}}},convertAttribs:function(a,b,c,d){var e=this.pointAttrToOptions,f,g,h={};a=a||{};b=b||{};c=c||{};d=d||{};for(f in e){g=e[f];h[f]=B(a[g],b[f],c[f],d[f])}return h},getAttribs:function(){var a=this,b=xb[a.type].marker?a.options.marker:a.options,c=b.states,d=c[Ab],e,f=a.color,g={stroke:f,fill:f},h=a.data,j=[],l,n=a.pointAttrToOptions,C;if(a.options.marker){d.radius=d.radius||b.radius+2;d.lineWidth=d.lineWidth||b.lineWidth+1}else d.color=d.color||$b(d.color||f).brighten(d.brightness).get();j[hb]=a.convertAttribs(b,g);t([Ab,"select"],function(G){j[G]=a.convertAttribs(c[G],j[hb])});a.pointAttr=j;for(f=h.length;f--;){g=h[f];if((b=g.options&&g.options.marker||g.options)&&b.enabled===false)b.radius=0;e=false;if(g.options)for(C in n)if(J(b[n[C]]))e=true;if(e){l=[];c=b.states||{};e=c[Ab]=c[Ab]||{};if(!a.options.marker)e.color=$b(e.color||g.options.color).brighten(e.brightness||d.brightness).get();l[hb]=a.convertAttribs(b,j[hb]);l[Ab]=a.convertAttribs(c[Ab],j[Ab],l[hb]);l.select=a.convertAttribs(c.select,j.select,l[hb])}else l=j;g.pointAttr=l}},destroy:function(){var a=this,b=a.chart,c=/\/5[0-9\.]+ (Safari|Mobile)\//.test(qc),d,e;Gb(a);a.legendItem&&a.chart.legend.destroyItem(a);t(a.data,function(f){f.destroy()});t(["area","graph","dataLabelsGroup","group","tracker"],function(f){if(a[f]){d=c&&f==="group"?"hide":"destroy";a[f][d]()}});if(b.hoverSeries===a)b.hoverSeries=null;rc(b.series,a);for(e in a)delete a[e]},drawDataLabels:function(){if(this.options.dataLabels.enabled){var a=this,b,c,d=a.data,e=a.options.dataLabels,f,g=a.dataLabelsGroup,h=a.chart,j=h.inverted,l=a.type,n;n=a.options.stacking;var C=l==="column"||l==="bar",G=e.verticalAlign===null,fa=e.y===null;if(C)if(n){if(G)e=sa(e,{verticalAlign:"middle"});if(fa)e=sa(e,{y:{top:14,middle:4,bottom:-6}[e.verticalAlign]})}else{if(G)e=sa(e,{verticalAlign:"top"});if(fa)e=sa(e,{y:-6})}if(!g)g=a.dataLabelsGroup=h.renderer.g("data-labels").attr({visibility:a.visible?ub:gb,zIndex:6}).translate(h.plotLeft,h.plotTop).add();n=e.color;if(n==="auto")n=null;e.style.color=B(n,a.color);t(d,function(K){var ia=K.barX,u=ia&&ia+K.barW/2||K.plotX||-999,P=B(K.plotY,-999),O=K.dataLabel,Q=e.align;f=e.formatter.call(K.getLabelConfig());b=(j?h.plotWidth-P:u)+e.x;c=(j?h.plotHeight-u:P)+e.y;if(l==="column")b+={left:-1,right:1}[Q]*K.barW/2||0;if(O){if(j&&!e.y)c=c+la(O.styles.lineHeight)*0.9-O.getBBox().height/2;O.attr({text:f}).animate({x:b,y:c})}else if(J(f)){O=K.dataLabel=h.renderer.text(f,b,c).attr({align:Q,rotation:e.rotation,zIndex:1}).css(e.style).add(g);j&&!e.y&&O.attr({y:c+la(O.styles.lineHeight)*0.9-O.getBBox().height/2})}if(C&&a.options.stacking){u=K.barY;P=K.barW;K=K.barH;O.align(e,null,{x:j?h.plotWidth-u-K:ia,y:j?h.plotHeight-ia-P:u,width:j?K:P,height:j?P:K})}})}},drawGraph:function(){var a=this,b=a.options,c=a.graph,d=[],e,f=a.area,g=a.group,h=b.lineColor||a.color,j=b.lineWidth,l=b.dashStyle,n,C=a.chart.renderer,G=a.yAxis.getThreshold(b.threshold||0),fa=/^area/.test(a.type),K=[],ia=[];t(a.segments,function(u){n=[];t(u,function(H,S){if(a.getPointSpline)n.push.apply(n,a.getPointSpline(u,H,S));else{n.push(S?Ja:Za);S&&b.step&&n.push(H.plotX,u[S-1].plotY);n.push(H.plotX,H.plotY)}});if(u.length>1)d=d.concat(n);else K.push(u[0]);if(fa){var P=[],O,Q=n.length;for(O=0;O<Q;O++)P.push(n[O]);Q===3&&P.push(Ja,n[1],n[2]);if(b.stacking&&a.type!=="areaspline")for(O=u.length-1;O>=0;O--)P.push(u[O].plotX,u[O].yBottom);else P.push(Ja,u[u.length-1].plotX,G,Ja,u[0].plotX,G);ia=ia.concat(P)}});a.graphPath=d;a.singlePoints=K;if(fa){e=B(b.fillColor,$b(a.color).setOpacity(b.fillOpacity||0.75).get());if(f)f.animate({d:ia});else a.area=a.chart.renderer.path(ia).attr({fill:e}).add(g)}if(c)c.animate({d:d});else if(j){c={stroke:h,"stroke-width":j};if(l)c.dashstyle=l;a.graph=C.path(d).attr(c).add(g).shadow(b.shadow)}},render:function(){var a=this,b=a.chart,c,d,e=a.options,f=e.animation,g=f&&a.animate;f=g?f&&f.duration||500:0;var h=a.clipRect;d=b.renderer;if(!h){h=a.clipRect=!b.hasRendered&&b.clipRect?b.clipRect:d.clipRect(0,0,b.plotSizeX,b.plotSizeY);if(!b.clipRect)b.clipRect=h}if(!a.group){c=a.group=d.g("series");if(b.inverted){d=function(){c.attr({width:b.plotWidth,height:b.plotHeight}).invert()};d();Sa(b,"resize",d)}c.clip(a.clipRect).attr({visibility:a.visible?ub:gb,zIndex:e.zIndex}).translate(b.plotLeft,b.plotTop).add(b.seriesGroup)}a.drawDataLabels();g&&a.animate(true);a.drawGraph&&a.drawGraph();a.drawPoints();a.options.enableMouseTracking!==false&&a.drawTracker();g&&a.animate();setTimeout(function(){h.isAnimating=false;if((c=a.group)&&h!==b.clipRect&&h.renderer){c.clip(a.clipRect=b.clipRect);h.destroy()}},f);a.isDirty=false},redraw:function(){var a=this.chart,b=this.group;if(b){a.inverted&&b.attr({width:a.plotWidth,height:a.plotHeight});b.animate({translateX:a.plotLeft,translateY:a.plotTop})}this.translate();this.setTooltipPoints(true);this.render()},setState:function(a){var b=this.options,c=this.graph,d=b.states;b=b.lineWidth;a=a||hb;if(this.state!==a){this.state=a;if(!(d[a]&&d[a].enabled===false)){if(a)b=d[a].lineWidth||b+1;if(c&&!c.dashstyle)c.attr({"stroke-width":b},a?0:500)}}},setVisible:function(a,b){var c=this.chart,d=this.legendItem,e=this.group,f=this.tracker,g=this.dataLabelsGroup,h,j=this.data,l=c.options.chart.ignoreHiddenSeries;h=this.visible;h=(this.visible=a=a===Ua?!h:a)?"show":"hide";e&&e[h]();if(f)f[h]();else for(e=j.length;e--;){f=j[e];f.tracker&&f.tracker[h]()}g&&g[h]();d&&c.legend.colorizeItem(this,a);this.isDirty=true;this.options.stacking&&t(c.series,function(n){if(n.options.stacking&&n.visible)n.isDirty=true});if(l)c.isDirtyBox=true;b!==false&&c.redraw();Pa(this,h)},show:function(){this.setVisible(true)},hide:function(){this.setVisible(false)},select:function(a){this.selected=a=a===Ua?!this.selected:a;if(this.checkbox)this.checkbox.checked=a;Pa(this,a?"select":"unselect")},drawTracker:function(){var a=this,b=a.options,c=[].concat(a.graphPath),d=c.length,e=a.chart,f=e.options.tooltip.snap,g=a.tracker,h=b.cursor;h=h&&{cursor:h};var j=a.singlePoints,l;if(d)for(l=d+1;l--;){c[l]===Za&&c.splice(l+1,0,c[l+1]-f,c[l+2],Ja);if(l&&c[l]===Za||l===d)c.splice(l,0,Ja,c[l-2]+f,c[l-1])}for(l=0;l<j.length;l++){d=j[l];c.push(Za,d.plotX-f,d.plotY,Ja,d.plotX+f,d.plotY)}if(g)g.attr({d:c});else a.tracker=e.renderer.path(c).attr({isTracker:true,stroke:Xd,fill:jb,"stroke-width":b.lineWidth+2*f,visibility:a.visible?ub:gb,zIndex:1}).on(Nb?"touchstart":"mouseover",function(){e.hoverSeries!==a&&a.onMouseOver()}).on("mouseout",function(){b.stickyTracking||a.onMouseOut()}).css(h).add(e.trackerGroup)}};ka=yb(pb);vb.line=ka;ka=yb(pb,{type:"area"});vb.area=ka;ka=yb(pb,{type:"spline",getPointSpline:function(a,b,c){var d=b.plotX,e=b.plotY,f=a[c-1],g=a[c+1],h,j,l,n;if(c&&c<a.length-1){a=f.plotY;l=g.plotX;g=g.plotY;var C;h=(1.5*d+f.plotX)/2.5;j=(1.5*e+a)/2.5;l=(1.5*d+l)/2.5;n=(1.5*e+g)/2.5;C=(n-j)*(l-d)/(l-h)+e-n;j+=C;n+=C;if(j>a&&j>e){j=Fa(a,e);n=2*e-j}else if(j<a&&j<e){j=qb(a,e);n=2*e-j}if(n>g&&n>e){n=Fa(g,e);j=2*e-n}else if(n<g&&n<e){n=qb(g,e);j=2*e-n}b.rightContX=l;b.rightContY=n}if(c){b=["C",f.rightContX||f.plotX,f.rightContY||f.plotY,h||d,j||e,d,e];f.rightContX=f.rightContY=null}else b=[Za,d,e];return b}});vb.spline=ka;ka=yb(ka,{type:"areaspline"});vb.areaspline=ka;var cd=yb(pb,{type:"column",pointAttrToOptions:{stroke:"borderColor","stroke-width":"borderWidth",fill:"color",r:"borderRadius"},init:function(){pb.prototype.init.apply(this,arguments);var a=this,b=a.chart;b.hasColumn=true;b.hasRendered&&t(b.series,function(c){if(c.type===a.type)c.isDirty=true})},translate:function(){var a=this,b=a.chart,c=a.options,d=c.stacking,e=c.borderWidth,f=0,g=a.xAxis.reversed,h=a.xAxis.categories,j={},l,n;pb.prototype.translate.apply(a);t(b.series,function(H){if(H.type===a.type&&H.visible){if(H.options.stacking){l=H.stackKey;if(j[l]===Ua)j[l]=f++;n=j[l]}else n=f++;H.columnIndex=n}});var C=a.data,G=a.closestPoints;h=db(C[1]?C[G].plotX-C[G-1].plotX:b.plotSizeX/(h&&h.length||1));G=h*c.groupPadding;var fa=(h-2*G)/f,K=c.pointWidth,ia=J(K)?(fa-K)/2:fa*c.pointPadding,u=Fa(B(K,fa-2*ia),1),P=ia+(G+((g?f-a.columnIndex:a.columnIndex)||0)*fa-h/2)*(g?-1:1),O=a.yAxis.getThreshold(c.threshold||0),Q=B(c.minPointLength,5);t(C,function(H){var S=H.plotY,Ta=H.yBottom||O,cb=H.plotX+P,Ib=hd(qb(S,Ta)),Jb=hd(Fa(S,Ta)-Ib),Ob=a.yAxis.stacks[(H.y<0?"-":"")+a.stackKey],Hb;d&&a.visible&&Ob&&Ob[H.x]&&Ob[H.x].setOffset(P,u);if(db(Jb)<Q){if(Q){Jb=Q;Ib=db(Ib-O)>Q?Ta-Q:O-(S<=O?Q:0)}Hb=Ib-3}pa(H,{barX:cb,barY:Ib,barW:u,barH:Jb});H.shapeType="rect";S=pa(b.renderer.Element.prototype.crisp.apply({},[e,cb,Ib,u,Jb]),{r:c.borderRadius});if(e%2){S.y-=1;S.height+=1}H.shapeArgs=S;H.trackerArgs=J(Hb)&&sa(H.shapeArgs,{height:Fa(6,Jb+3),y:Hb})})},getSymbol:function(){},drawGraph:function(){},drawPoints:function(){var a=this,b=a.options,c=a.chart.renderer,d,e;t(a.data,function(f){var g=f.plotY;if(g!==Ua&&!isNaN(g)&&f.y!==null){d=f.graphic;e=f.shapeArgs;if(d){Uc(d);d.animate(e)}else f.graphic=c[f.shapeType](e).attr(f.pointAttr[f.selected?"select":hb]).add(a.group).shadow(b.shadow)}})},drawTracker:function(){var a=this,b=a.chart,c=b.renderer,d,e,f=+new Date,g=a.options.cursor,h=g&&{cursor:g},j;t(a.data,function(l){e=l.tracker;d=l.trackerArgs||l.shapeArgs;delete d.strokeWidth;if(l.y!==null)if(e)e.attr(d);else l.tracker=c[l.shapeType](d).attr({isTracker:f,fill:Xd,visibility:a.visible?ub:gb,zIndex:1}).on(Nb?"touchstart":"mouseover",function(n){j=n.relatedTarget||n.fromElement;b.hoverSeries!==a&&Ca(j,"isTracker")!==f&&a.onMouseOver();l.onMouseOver()}).on("mouseout",function(n){if(!a.options.stickyTracking){j=n.relatedTarget||n.toElement;Ca(j,"isTracker")!==f&&a.onMouseOut()}}).css(h).add(l.group||b.trackerGroup)})},animate:function(a){var b=this,c=b.data;if(!a){t(c,function(d){var e=d.graphic;d=d.shapeArgs;if(e){e.attr({height:0,y:b.yAxis.translate(0,0,1)});e.animate({height:d.height,y:d.y},b.options.animation)}});b.animate=null}},remove:function(){var a=this,b=a.chart;b.hasRendered&&t(b.series,function(c){if(c.type===a.type)c.isDirty=true});pb.prototype.remove.apply(a,arguments)}});vb.column=cd;ka=yb(cd,{type:"bar",init:function(a){a.inverted=this.inverted=true;cd.prototype.init.apply(this,arguments)}});vb.bar=ka;ka=yb(pb,{type:"scatter",translate:function(){var a=this;pb.prototype.translate.apply(a);t(a.data,function(b){b.shapeType="circle";b.shapeArgs={x:b.plotX,y:b.plotY,r:a.chart.options.tooltip.snap}})},drawTracker:function(){var a=this,b=a.options.cursor,c=b&&{cursor:b},d;t(a.data,function(e){(d=e.graphic)&&d.attr({isTracker:true}).on("mouseover",function(){a.onMouseOver();e.onMouseOver()}).on("mouseout",function(){a.options.stickyTracking||a.onMouseOut()}).css(c)})},cleanData:function(){}});vb.scatter=ka;ka=yb(Bc,{init:function(){Bc.prototype.init.apply(this,arguments);var a=this,b;pa(a,{visible:a.visible!==false,name:B(a.name,"Slice")});b=function(){a.slice()};Sa(a,"select",b);Sa(a,"unselect",b);return a},setVisible:function(a){var b=this.series.chart,c=this.tracker,d=this.dataLabel,e=this.connector,f;f=(this.visible=a=a===Ua?!this.visible:a)?"show":"hide";this.group[f]();c&&c[f]();d&&d[f]();e&&e[f]();this.legendItem&&b.legend.colorizeItem(this,a)},slice:function(a,b,c){var d=this.series.chart,e=this.slicedTranslation;fc(c,d);B(b,true);a=this.sliced=J(a)?a:!this.sliced;a={translateX:a?e[0]:d.plotLeft,translateY:a?e[1]:d.plotTop};this.group.animate(a);this.shadowGroup&&this.shadowGroup.animate(a)}});ka=yb(pb,{type:"pie",isCartesian:false,pointClass:ka,pointAttrToOptions:{stroke:"borderColor","stroke-width":"borderWidth",fill:"color"},getColor:function(){this.initialColor=Pb},animate:function(){var a=this;t(a.data,function(b){var c=b.graphic;b=b.shapeArgs;var d=-Zb/2;if(c){c.attr({r:0,start:d,end:d});c.animate({r:b.r,start:b.start,end:b.end},a.options.animation)}});a.animate=null},translate:function(){var a=0,b=-0.25,c=this.options,d=c.slicedOffset,e=d+c.borderWidth,f=c.center.concat([c.size,c.innerSize||0]),g=this.chart,h=g.plotWidth,j=g.plotHeight,l,n,C,G=this.data,fa=2*Zb,K,ia=qb(h,j),u,P,O,Q=c.dataLabels.distance;f=nc(f,function(H,S){return(u=/%$/.test(H))?[h,j,ia,ia][S]*la(H)/100:H});this.getX=function(H,S){C=ta.asin((H-f[1])/(f[2]/2+Q));return f[0]+(S?-1:1)*nb(C)*(f[2]/2+Q)};this.center=f;t(G,function(H){a+=H.y});t(G,function(H){K=a?H.y/a:0;l=X(b*fa*1E3)/1E3;b+=K;n=X(b*fa*1E3)/1E3;H.shapeType="arc";H.shapeArgs={x:f[0],y:f[1],r:f[2]/2,innerR:f[3]/2,start:l,end:n};C=(n+l)/2;H.slicedTranslation=nc([nb(C)*d+g.plotLeft,Bb(C)*d+g.plotTop],X);P=nb(C)*f[2]/2;O=Bb(C)*f[2]/2;H.tooltipPos=[f[0]+P*0.7,f[1]+O*0.7];H.labelPos=[f[0]+P+nb(C)*Q,f[1]+O+Bb(C)*Q,f[0]+P+nb(C)*e,f[1]+O+Bb(C)*e,f[0]+P,f[1]+O,Q<0?"center":C<fa/4?"left":"right",C];H.percentage=K*100;H.total=a});this.setTooltipPoints()},render:function(){this.drawPoints();this.options.enableMouseTracking!==false&&this.drawTracker();this.drawDataLabels();this.options.animation&&this.animate&&this.animate();this.isDirty=false},drawPoints:function(){var a=this.chart,b=a.renderer,c,d,e,f=this.options.shadow,g,h;t(this.data,function(j){d=j.graphic;h=j.shapeArgs;e=j.group;g=j.shadowGroup;if(f&&!g)g=j.shadowGroup=b.g("shadow").attr({zIndex:4}).add();if(!e)e=j.group=b.g("point").attr({zIndex:5}).add();c=j.sliced?j.slicedTranslation:[a.plotLeft,a.plotTop];e.translate(c[0],c[1]);g&&g.translate(c[0],c[1]);if(d)d.animate(h);else j.graphic=b.arc(h).attr(pa(j.pointAttr[hb],{"stroke-linejoin":"round"})).add(j.group).shadow(f,g);j.visible===false&&j.setVisible(false)})},drawDataLabels:function(){var a=this.data,b,c=this.chart,d=this.options.dataLabels,e=B(d.connectorPadding,10),f=B(d.connectorWidth,1),g,h,j=d.distance>0,l,n,C=this.center[1],G=[[],[],[],[]],fa,K,ia,u,P,O,Q,H=4,S;pb.prototype.drawDataLabels.apply(this);t(a,function(Ta){var cb=Ta.labelPos[7];G[cb<0?0:cb<Zb/2?1:cb<Zb?2:3].push(Ta)});G[1].reverse();G[3].reverse();for(Q=function(Ta,cb){return Ta.y>cb.y};H--;){a=0;b=[].concat(G[H]);b.sort(Q);for(S=b.length;S--;)b[S].rank=S;for(u=0;u<2;u++){n=(O=H%3)?9999:-9999;P=O?-1:1;for(S=0;S<G[H].length;S++){b=G[H][S];if(g=b.dataLabel){h=b.labelPos;ia=ub;fa=h[0];K=h[1];l||(l=g&&g.getBBox().height);if(j)if(u&&b.rank<a)ia=gb;else if(!O&&K<n+l||O&&K>n-l){K=n+P*l;fa=this.getX(K,H>1);if(!O&&K+l>C||O&&K-l<C)if(u)ia=gb;else a++}if(b.visible===false)ia=gb;if(ia===ub)n=K;if(u){g.attr({visibility:ia,align:h[6]})[g.moved?"animate":"attr"]({x:fa+d.x+({left:e,right:-e}[h[6]]||0),y:K+d.y});g.moved=true;if(j&&f){g=b.connector;h=[Za,fa+(h[6]==="left"?5:-5),K,Ja,fa,K,Ja,h[2],h[3],Ja,h[4],h[5]];if(g){g.animate({d:h});g.attr("visibility",ia)}else b.connector=g=this.chart.renderer.path(h).attr({"stroke-width":f,stroke:d.connectorColor||"#606060",visibility:ia,zIndex:3}).translate(c.plotLeft,c.plotTop).add()}}}}}}},drawTracker:cd.prototype.drawTracker,getSymbol:function(){}});vb.pie=ka;ab.Highcharts={Chart:Hd,dateFormat:Oc,pathAnim:bd,getOptions:function(){return Va},numberFormat:Bd,Point:Bc,Color:$b,Renderer:Xc,seriesTypes:vb,setOptions:function(a){Va=sa(Va,a);Cd();return Va},Series:pb,addEvent:Sa,createElement:ib,discardElement:Hc,css:La,each:t,extend:pa,map:nc,merge:sa,pick:B,extendClass:yb,version:"2.1.5"}})();ape.ns("motorpresse.elements");motorpresse.elements.PhpfoxLogin={ajaxUrl:"/forum/phpfox_login.php?do=login",params:{'vb_login_username':null,'vb_login_md5password':null,'cookieuser':'1','do':'login','from':'phpfox'},form:jQuery(),init:function(ref){this.form=ref;var self=this;jQuery(this.form).unbind('submit.phpfoxlogin');jQuery(this.form).bind('submit.phpfoxlogin',function(){return self.onSubmit();});},onSubmit:function(){var self=this;this.params.vb_login_username=jQuery('input.is_phpfox_username',this.form).val();this.params.vb_login_md5password=jQuery.md5(jQuery('input.is_phpfox_password',this.form).val());jQuery.ajax({url:this.ajaxUrl,data:this.params,type:'post',dataType:'json',complete:function(data,status){jQuery(self.form).unbind('submit.phpfoxlogin');self.form.submit();}});return false;}};ape.Listeners.addListener('is_phpfox_login',function(ref){motorpresse.elements.PhpfoxLogin.init(ref);},2);ape.ns("motorpresse.elements");motorpresse.elements.CarRatingElement={ref:null,ajaxUrl:null,params:{},init:function(ref){this.ref=ref;var self=this;if(this.ajaxUrl===null||this.ajaxUrl===''){return false;}jQuery.ajax({url:this.ajaxUrl,type:'post',dataType:'html',data:this.params,success:function(data,status){if(data!==''){self.ref.html(jQuery(data));motorpresse.elements.AdElement.Ad.adTrigger(jQuery('.is_ad_trigger'));jQuery('.button_like',self.ref).bind('click',function(){self.vote.apply(self,['1']);});jQuery('.button_dislike',self.ref).bind('click',function(){self.vote.apply(self,['0']);});}}});return true;},vote:function(like){var self=this;var params=this.params;params.like=like;jQuery.ajax({url:this.ajaxUrl,type:'post',data:params,dataType:'html',success:function(data,status){if(data!==''){self.ref.html(jQuery(data));motorpresse.elements.AdElement.Ad.adTrigger(jQuery('.is_ad_trigger'));}}});}};ape.Listeners.addListener('is_carrating',function(ref){motorpresse.elements.CarRatingElement.init(ref);},1);ape.ns("motorpresse.elements");motorpresse.elements.LoginElement={ref:null,init:function(ref){this.ref=ref;var self=this;if(this.ajaxUrl===null||this.ajaxUrl===''){return false;}PHPFOX.add('structure_login',function(data,status){if(data!==''){self.ref.replaceWith(jQuery(data));}});return true;}};ape.Listeners.addListener('is_login',function(ref){motorpresse.elements.LoginElement.init(ref);},1);ape.ns("motorpresse.elements");motorpresse.elements.OffroadChallengeForm={seite:1,initSubmit:function(ref){ref.each(function(){$(this).unbind('click.submit').bind('click.submit',function(){$('#form_offroadchallenge_maincol').submit();});});}};ape.Listeners.addListener('is_offroadchallenge_submit',motorpresse.elements.OffroadChallengeForm.initSubmit,1);ape.ns("motorpresse.elements");motorpresse.elements.TVProgramm={initWochenSelector:function(ref){ref.each(function(){$(this).unbind('change').bind('change',function(){window.location.href='http://'+window.location.hostname+window.location.pathname+'?woche='+$(this).val();});});},initDaySelector:function(ref){ref.each(function(){$(this).unbind('click.dayselector').bind('click.dayselector',function(){$('.is_tvprogramm_days').removeClass('aktiv');$('.tvprogramm_boxes, .tvprogramm_titles').addClass('hide');var id=$(this).attr('id').split('_').pop();$('#tvprogramm_'+id+'_content, #tvprogramm_'+id+'_title').removeClass('hide');$('#tvprogramm_'+id).addClass('aktiv');return false;});});},initAbschnittSelector:function(ref){ref.each(function(){$(this).unbind('click.abschnittselector').bind('click.abschnittselector',function(){$('.is_tvprogramm_abschnitt',$(this).parent()).addClass('geschlossen').removeClass('geoeffnet');$('.abschnitt_content',$(this).parent()).addClass('hide');var id=$(this).attr('id').split('_').pop();$('#guide_'+id+'_content').removeClass('hide');$('#guide_'+id).addClass('geoeffnet').removeClass('geschlossen');return false;});});}};ape.Listeners.addListener('is_tvprogramm_weeks',motorpresse.elements.TVProgramm.initWochenSelector,1);ape.Listeners.addListener('is_tvprogramm_days',motorpresse.elements.TVProgramm.initDaySelector,1);ape.Listeners.addListener('is_tvprogramm_abschnitt',motorpresse.elements.TVProgramm.initAbschnittSelector,1);ape.ns("motorpresse.elements");motorpresse.elements.Bigvoting={get_html_translation_table:function(table,quote_style){var entities={},hash_map={},decimal=0,symbol='';var constMappingTable={},constMappingQuoteStyle={};var useTable={},useQuoteStyle={};constMappingTable[0]='HTML_SPECIALCHARS';constMappingTable[1]='HTML_ENTITIES';constMappingQuoteStyle[0]='ENT_NOQUOTES';constMappingQuoteStyle[2]='ENT_COMPAT';constMappingQuoteStyle[3]='ENT_QUOTES';useTable=!isNaN(table)?constMappingTable[table]:table?table.toUpperCase():'HTML_SPECIALCHARS';useQuoteStyle=!isNaN(quote_style)?constMappingQuoteStyle[quote_style]:quote_style?quote_style.toUpperCase():'ENT_COMPAT';if(useTable!=='HTML_SPECIALCHARS'&&useTable!=='HTML_ENTITIES'){throw new Error("Table: "+useTable+' not supported');}entities['38']='&amp;';if(useTable==='HTML_ENTITIES'){entities['160']='&nbsp;';entities['161']='&iexcl;';entities['162']='&cent;';entities['163']='&pound;';entities['164']='&curren;';entities['165']='&yen;';entities['166']='&brvbar;';entities['167']='&sect;';entities['168']='&uml;';entities['169']='&copy;';entities['170']='&ordf;';entities['171']='&laquo;';entities['172']='&not;';entities['173']='&shy;';entities['174']='&reg;';entities['175']='&macr;';entities['176']='&deg;';entities['177']='&plusmn;';entities['178']='&sup2;';entities['179']='&sup3;';entities['180']='&acute;';entities['181']='&micro;';entities['182']='&para;';entities['183']='&middot;';entities['184']='&cedil;';entities['185']='&sup1;';entities['186']='&ordm;';entities['187']='&raquo;';entities['188']='&frac14;';entities['189']='&frac12;';entities['190']='&frac34;';entities['191']='&iquest;';entities['192']='&Agrave;';entities['193']='&Aacute;';entities['194']='&Acirc;';entities['195']='&Atilde;';entities['196']='&Auml;';entities['197']='&Aring;';entities['198']='&AElig;';entities['199']='&Ccedil;';entities['200']='&Egrave;';entities['201']='&Eacute;';entities['202']='&Ecirc;';entities['203']='&Euml;';entities['204']='&Igrave;';entities['205']='&Iacute;';entities['206']='&Icirc;';entities['207']='&Iuml;';entities['208']='&ETH;';entities['209']='&Ntilde;';entities['210']='&Ograve;';entities['211']='&Oacute;';entities['212']='&Ocirc;';entities['213']='&Otilde;';entities['214']='&Ouml;';entities['215']='&times;';entities['216']='&Oslash;';entities['217']='&Ugrave;';entities['218']='&Uacute;';entities['219']='&Ucirc;';entities['220']='&Uuml;';entities['221']='&Yacute;';entities['222']='&THORN;';entities['223']='&szlig;';entities['224']='&agrave;';entities['225']='&aacute;';entities['226']='&acirc;';entities['227']='&atilde;';entities['228']='&auml;';entities['229']='&aring;';entities['230']='&aelig;';entities['231']='&ccedil;';entities['232']='&egrave;';entities['233']='&eacute;';entities['234']='&ecirc;';entities['235']='&euml;';entities['236']='&igrave;';entities['237']='&iacute;';entities['238']='&icirc;';entities['239']='&iuml;';entities['240']='&eth;';entities['241']='&ntilde;';entities['242']='&ograve;';entities['243']='&oacute;';entities['244']='&ocirc;';entities['245']='&otilde;';entities['246']='&ouml;';entities['247']='&divide;';entities['248']='&oslash;';entities['249']='&ugrave;';entities['250']='&uacute;';entities['251']='&ucirc;';entities['252']='&uuml;';entities['253']='&yacute;';entities['254']='&thorn;';entities['255']='&yuml;';}if(useQuoteStyle!=='ENT_NOQUOTES'){entities['34']='&quot;';}if(useQuoteStyle==='ENT_QUOTES'){entities['39']='&#39;';}entities['60']='&lt;';entities['62']='&gt;';for(decimal in entities){symbol=String.fromCharCode(decimal);hash_map[symbol]=entities[decimal];}return hash_map;},htmlentities:function(string,quote_style,charset,double_encode){var hash_map=motorpresse.elements.Bigvoting.get_html_translation_table('HTML_ENTITIES',quote_style),symbol='';string=string===null?'':string+'';if(!hash_map){return false;}if(quote_style&&quote_style==='ENT_QUOTES'){hash_map["'"]='&#039;';}if(!double_encode||double_encode===null){for(symbol in hash_map){string=string.split(symbol).join(hash_map[symbol]);}}else{string=string.replace(/([\s\S]*?)(&(?:#\d+|#x[\da-f]+|[a-zA-Z][\da-z]*);|$)/g,function(ignore,text,entity){for(symbol in hash_map){text=text.split(symbol).join(hash_map[symbol]);}return text+entity;});}return string;},showForm:function(ref){ref.each(function(){jQuery(this).unbind('click.openForm').bind('click.openForm',function(){var url=jQuery(this).attr('href');if(url!==''){jQuery.ajax({type:"GET",url:url,data:{freitextname:"ballotpaper",freitexteingabe:motorpresse.elements.Bigvoting.htmlentities(jQuery('input[name="ballotpaper"]').val(),"ENT_QUOTES")},dataType:"text",success:function(result){jQuery('.voting').html(result);jQuery('.voting .is_submit').bind('click.submit',motorpresse.elements.Bigvoting.submitForm);jQuery('html, body').animate({scrollTop:0},'slow');motorpresse.elements.Bigvoting.aktivateEnterSubmitting();}});}return false;});});},submitForm:function(){var url=jQuery(this).parentsUntil('form').attr('action');var values=ape.Form.getValuesOf(jQuery(this).parentsUntil('form'));jQuery.ajax({type:"POST",url:url,data:values,dataType:"text",success:function(result){jQuery('.voting').html(result);jQuery('.voting .is_submit').bind('click.submit',motorpresse.elements.Bigvoting.submitForm);jQuery('html, body').animate({scrollTop:0},'slow');motorpresse.elements.Bigvoting.aktivateEnterSubmitting();jQuery.ajax({type:"POST",url:location.protocol+'//'+location.host+location.pathname+'?do=insertBullotpaper',data:{result:values},dataType:"json",success:function(result){if(result.success){jQuery('.stimmzettel dl span').each(function(){jQuery(this).html('<i>&mdash;</i>');});}}});}});return true;},aktivateEnterSubmitting:function(){jQuery('.voting input').bind("keyup",function(e){var code=(e.keyCode?e.keyCode:e.which);if(code==13){jQuery('.voting .is_submit').click();}});}};ape.Listeners.addListener('is_game_finished_link_voting',motorpresse.elements.Bigvoting.showForm,1);var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;if(typeof t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof O.ActiveXObject!=D){try{var ad=new ActiveXObject(W);if(ad){ab=ad.GetVariable("$version");if(ab){X=true;ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac}}(),k=function(){if(!M.w3){return}if((typeof j.readyState!=D&&j.readyState=="complete")||(typeof j.readyState==D&&(j.getElementsByTagName("body")[0]||j.body))){f()}if(!J){if(typeof j.addEventListener!=D){j.addEventListener("DOMContentLoaded",f,false)}if(M.ie&&M.win){j.attachEvent(x,function(){if(j.readyState=="complete"){j.detachEvent(x,arguments.callee);f()}});if(O==top){(function(){if(J){return}try{j.documentElement.doScroll("left")}catch(X){setTimeout(arguments.callee,0);return}f()})()}}if(M.wk){(function(){if(J){return}if(!/loaded|complete/.test(j.readyState)){setTimeout(arguments.callee,0);return}f()})()}s(f)}}();function f(){if(J){return}try{var Z=j.getElementsByTagName("body")[0].appendChild(C("span"));Z.parentNode.removeChild(Z)}catch(aa){return}J=true;var X=U.length;for(var Y=0;Y<X;Y++){U[Y]()}}function K(X){if(J){X()}else{U[U.length]=X}}function s(Y){if(typeof O.addEventListener!=D){O.addEventListener("load",Y,false)}else{if(typeof j.addEventListener!=D){j.addEventListener("load",Y,false)}else{if(typeof O.attachEvent!=D){i(O,"onload",Y)}else{if(typeof O.onload=="function"){var X=O.onload;O.onload=function(){X();Y()}}else{O.onload=Y}}}}}function h(){if(T){V()}else{H()}}function V(){var X=j.getElementsByTagName("body")[0];var aa=C(r);aa.setAttribute("type",q);var Z=X.appendChild(aa);if(Z){var Y=0;(function(){if(typeof Z.GetVariable!=D){var ab=Z.GetVariable("$version");if(ab){ab=ab.split(" ")[1].split(",");M.pv=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}else{if(Y<10){Y++;setTimeout(arguments.callee,10);return}}X.removeChild(aa);Z=null;H()})()}else{H()}}function H(){var ag=o.length;if(ag>0){for(var af=0;af<ag;af++){var Y=o[af].id;var ab=o[af].callbackFn;var aa={success:false,id:Y};if(M.pv[0]>0){var ae=c(Y);if(ae){if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){w(Y,true);if(ab){aa.success=true;aa.ref=z(Y);ab(aa)}}else{if(o[af].expressInstall&&A()){var ai={};ai.data=o[af].expressInstall;ai.width=ae.getAttribute("width")||"0";ai.height=ae.getAttribute("height")||"0";if(ae.getAttribute("class")){ai.styleclass=ae.getAttribute("class")}if(ae.getAttribute("align")){ai.align=ae.getAttribute("align")}var ah={};var X=ae.getElementsByTagName("param");var ac=X.length;for(var ad=0;ad<ac;ad++){if(X[ad].getAttribute("name").toLowerCase()!="movie"){ah[X[ad].getAttribute("name")]=X[ad].getAttribute("value")}}P(ai,ah,Y,ab)}else{p(ae);if(ab){ab(aa)}}}}}else{w(Y,true);if(ab){var Z=z(Y);if(Z&&typeof Z.SetVariable!=D){aa.success=true;aa.ref=Z}ab(aa)}}}}}function z(aa){var X=null;var Y=c(aa);if(Y&&Y.nodeName=="OBJECT"){if(typeof Y.SetVariable!=D){X=Y}else{var Z=Y.getElementsByTagName(r)[0];if(Z){X=Z}}}return X}function A(){return!a&&F("6.0.65")&&(M.win||M.mac)&&!(M.wk&&M.wk<312)}function P(aa,ab,X,Z){a=true;E=Z||null;B={success:false,id:X};var ae=c(X);if(ae){if(ae.nodeName=="OBJECT"){l=g(ae);Q=null}else{l=ae;Q=X}aa.id=R;if(typeof aa.width==D||(!/%$/.test(aa.width)&&parseInt(aa.width,10)<310)){aa.width="310"}if(typeof aa.height==D||(!/%$/.test(aa.height)&&parseInt(aa.height,10)<137)){aa.height="137"}j.title=j.title.slice(0,47)+" - Flash Player Installation";var ad=M.ie&&M.win?"ActiveX":"PlugIn",ac="MMredirectURL="+O.location.toString().replace(/&/g,"%26")+"&MMplayerType="+ad+"&MMdoctitle="+j.title;if(typeof ab.flashvars!=D){ab.flashvars+="&"+ac}else{ab.flashvars=ac}if(M.ie&&M.win&&ae.readyState!=4){var Y=C("div");X+="SWFObjectNew";Y.setAttribute("id",X);ae.parentNode.insertBefore(Y,ae);ae.style.display="none";(function(){if(ae.readyState==4){ae.parentNode.removeChild(ae)}else{setTimeout(arguments.callee,10)}})()}u(aa,ab,X)}}function p(Y){if(M.ie&&M.win&&Y.readyState!=4){var X=C("div");Y.parentNode.insertBefore(X,Y);X.parentNode.replaceChild(g(Y),X);Y.style.display="none";(function(){if(Y.readyState==4){Y.parentNode.removeChild(Y)}else{setTimeout(arguments.callee,10)}})()}else{Y.parentNode.replaceChild(g(Y),Y)}}function g(ab){var aa=C("div");if(M.win&&M.ie){aa.innerHTML=ab.innerHTML}else{var Y=ab.getElementsByTagName(r)[0];if(Y){var ad=Y.childNodes;if(ad){var X=ad.length;for(var Z=0;Z<X;Z++){if(!(ad[Z].nodeType==1&&ad[Z].nodeName=="PARAM")&&!(ad[Z].nodeType==8)){aa.appendChild(ad[Z].cloneNode(true))}}}}}return aa}function u(ai,ag,Y){var X,aa=c(Y);if(M.wk&&M.wk<312){return X}if(aa){if(typeof ai.id==D){ai.id=Y}if(M.ie&&M.win){var ah="";for(var ae in ai){if(ai[ae]!=Object.prototype[ae]){if(ae.toLowerCase()=="data"){ag.movie=ai[ae]}else{if(ae.toLowerCase()=="styleclass"){ah+=' class="'+ai[ae]+'"'}else{if(ae.toLowerCase()!="classid"){ah+=" "+ae+'="'+ai[ae]+'"'}}}}}var af="";for(var ad in ag){if(ag[ad]!=Object.prototype[ad]){af+='<param name="'+ad+'" value="'+ag[ad]+'" />'}}aa.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+ah+">"+af+"</object>";N[N.length]=ai.id;X=c(ai.id)}else{var Z=C(r);Z.setAttribute("type",q);for(var ac in ai){if(ai[ac]!=Object.prototype[ac]){if(ac.toLowerCase()=="styleclass"){Z.setAttribute("class",ai[ac])}else{if(ac.toLowerCase()!="classid"){Z.setAttribute(ac,ai[ac])}}}}for(var ab in ag){if(ag[ab]!=Object.prototype[ab]&&ab.toLowerCase()!="movie"){e(Z,ab,ag[ab])}}aa.parentNode.replaceChild(Z,aa);X=Z}}return X}function e(Z,X,Y){var aa=C("param");aa.setAttribute("name",X);aa.setAttribute("value",Y);Z.appendChild(aa)}function y(Y){var X=c(Y);if(X&&X.nodeName=="OBJECT"){if(M.ie&&M.win){X.style.display="none";(function(){if(X.readyState==4){b(Y)}else{setTimeout(arguments.callee,10)}})()}else{X.parentNode.removeChild(X)}}}function b(Z){var Y=c(Z);if(Y){for(var X in Y){if(typeof Y[X]=="function"){Y[X]=null}}Y.parentNode.removeChild(Y)}}function c(Z){var X=null;try{X=j.getElementById(Z)}catch(Y){}return X}function C(X){return j.createElement(X)}function i(Z,X,Y){Z.attachEvent(X,Y);I[I.length]=[Z,X,Y]}function F(Z){var Y=M.pv,X=Z.split(".");X[0]=parseInt(X[0],10);X[1]=parseInt(X[1],10)||0;X[2]=parseInt(X[2],10)||0;return(Y[0]>X[0]||(Y[0]==X[0]&&Y[1]>X[1])||(Y[0]==X[0]&&Y[1]==X[1]&&Y[2]>=X[2]))?true:false}function v(ac,Y,ad,ab){if(M.ie&&M.mac){return}var aa=j.getElementsByTagName("head")[0];if(!aa){return}var X=(ad&&typeof ad=="string")?ad:"screen";if(ab){n=null;G=null}if(!n||G!=X){var Z=C("style");Z.setAttribute("type","text/css");Z.setAttribute("media",X);n=aa.appendChild(Z);if(M.ie&&M.win&&typeof j.styleSheets!=D&&j.styleSheets.length>0){n=j.styleSheets[j.styleSheets.length-1]}G=X}if(M.ie&&M.win){if(n&&typeof n.addRule==r){n.addRule(ac,Y)}}else{if(n&&typeof j.createTextNode!=D){n.appendChild(j.createTextNode(ac+" {"+Y+"}"))}}}function w(Z,X){if(!m){return}var Y=X?"visible":"hidden";if(J&&c(Z)){c(Z).style.visibility=Y}else{v("#"+Z,"visibility:"+Y)}}function L(Y){var Z=/[\\\"<>\.;]/;var X=Z.exec(Y)!=null;return X&&typeof encodeURIComponent!=D?encodeURIComponent(Y):Y}var d=function(){if(M.ie&&M.win){window.attachEvent("onunload",function(){var ac=I.length;for(var ab=0;ab<ac;ab++){I[ab][0].detachEvent(I[ab][1],I[ab][2])}var Z=N.length;for(var aa=0;aa<Z;aa++){y(N[aa])}for(var Y in M){M[Y]=null}M=null;for(var X in swfobject){swfobject[X]=null}swfobject=null})}}();return{registerObject:function(ab,X,aa,Z){if(M.w3&&ab&&X){var Y={};Y.id=ab;Y.swfVersion=X;Y.expressInstall=aa;Y.callbackFn=Z;o[o.length]=Y;w(ab,false)}else{if(Z){Z({success:false,id:ab})}}},getObjectById:function(X){if(M.w3){return z(X)}},embedSWF:function(ab,ah,ae,ag,Y,aa,Z,ad,af,ac){var X={success:false,id:ah};if(M.w3&&!(M.wk&&M.wk<312)&&ab&&ah&&ae&&ag&&Y){w(ah,false);K(function(){ae+="";ag+="";var aj={};if(af&&typeof af===r){for(var al in af){aj[al]=af[al]}}aj.data=ab;aj.width=ae;aj.height=ag;var am={};if(ad&&typeof ad===r){for(var ak in ad){am[ak]=ad[ak]}}if(Z&&typeof Z===r){for(var ai in Z){if(typeof am.flashvars!=D){am.flashvars+="&"+ai+"="+Z[ai]}else{am.flashvars=ai+"="+Z[ai]}}}if(F(Y)){var an=u(aj,am,ah);if(aj.id==ah){w(ah,true)}X.success=true;X.ref=an}else{if(aa&&A()){aj.data=aa;P(aj,am,ah,ac);return}else{w(ah,true)}}if(ac){ac(X)}})}else{if(ac){ac(X)}}},switchOffAutoHideShow:function(){m=false},ua:M,getFlashPlayerVersion:function(){return{major:M.pv[0],minor:M.pv[1],release:M.pv[2]}},hasFlashPlayerVersion:F,createSWF:function(Z,Y,X){if(M.w3){return u(Z,Y,X)}else{return undefined}},showExpressInstall:function(Z,aa,X,Y){if(M.w3&&A()){P(Z,aa,X,Y)}},removeSWF:function(X){if(M.w3){y(X)}},createCSS:function(aa,Z,Y,X){if(M.w3){v(aa,Z,Y,X)}},addDomLoadEvent:K,addLoadEvent:s,getQueryParamValue:function(aa){var Z=j.location.search||j.location.hash;if(Z){if(/\?/.test(Z)){Z=Z.split("?")[1]}if(aa==null){return L(Z)}var Y=Z.split("&");for(var X=0;X<Y.length;X++){if(Y[X].substring(0,Y[X].indexOf("="))==aa){return L(Y[X].substring((Y[X].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(a){var X=c(R);if(X&&l){X.parentNode.replaceChild(l,X);if(Q){w(Q,true);if(M.ie&&M.win){l.style.display="block"}}if(E){E(B)}}a=false}}}}();function FlippingBook(){this.pages=[];this.zoomPages=[];this.printPages=[];this.contents=[];this.stageWidth=840;this.stageHeight=546;this.settings={bookWidth:840,bookHeight:546,pagesSet:this.pages,zoomPagesSet:this.zoomPages,printPagesSet:this.printPages,scaleContent:true,preserveProportions:false,centerContent:true,hardcover:false,hardcoverThickness:3,hardcoverEdgeColor:0xFFFFFF,highlightHardcover:true,frameWidth:0,frameColor:0xFFFFFF,frameAlpha:100,firstPageNumber:1,autoFlipSize:50,navigationFlipOffset:30,flipOnClick:true,handOverCorner:true,handOverPage:true,alwaysOpened:false,staticShadowsType:"Asymmetric",staticShadowsDepth:1,staticShadowsLightColor:0xFFFFFF,staticShadowsDarkColor:0x000000,dynamicShadowsDepth:1,dynamicShadowsLightColor:0xFFFFFF,dynamicShadowsDarkColor:0x000000,moveSpeed:2,closeSpeed:3,gotoSpeed:3,rigidPageSpeed:5,flipSound:"",hardcoverSound:"",preloaderType:"Progress Bar",pageBackgroundColor:0xFFFFFF,loadOnDemand:true,allowPagesUnload:true,showUnderlyingPages:false,playOnDemand:true,freezeOnFlip:false,darkPages:false,smoothPages:false,rigidPages:false,flipCornerStyle:"manually",flipCornerPosition:"bottom-right",flipCornerAmount:50,flipCornerAngle:0,flipCornerRelease:true,flipCornerVibrate:true,flipCornerPlaySound:false,zoomEnabled:true,zoomPath:"img/flipBook/pages/large/",zoomImageWidth:757,zoomImageHeight:956,zoomOnClick:false,zoomUIColor:0xFFFFFF,zoomHint:"Double click for zooming.",zoomHintEnabled:false,centerBook:true,useCustomCursors:true,dropShadowEnabled:true,dropShadowHideWhenFlipping:true,backgroundColor:0xFFFFFF,backgroundImage:"img/flipBook/bookBackground.png",backgroundImagePlacement:"left center",printEnabled:true,printTitle:"Print Pages",downloadURL:"",downloadTitle:"Download PDF",downloadSize:"Size: 4.7 Mb",downloadComplete:"Complete",extXML:""};this.containerId="fbContainer";this.forwardButtonId="fbForwardButton";this.backButtonId="fbBackButton";this.zoomButtonId="fbZoomButton";this.printButtonId="fbPrintButton";this.downloadButtonId="fbDownloadButton";this.currentPagesId="fbCurrentPages";this.totalPagesId="fbTotalPages";this.contentsMenuId="fbContentsMenu";}FlippingBook.prototype.create=function(){this.settings.pagesSet=this.pages;this.settings.zoomPagesSet=this.zoomPages;this.settings.printPagesSet=this.printPages;if(location.hash.substr(1)!==""){this.settings.firstPageNumber=location.hash.substr(1);}this.addLoadEvent(this.onWindowLoad);swfobject.embedSWF("/flash/FlippingBook.swf",this.containerId,this.stageWidth,this.stageHeight,"8.0.0","/flash/expressInstall.swf",this.settings,{allowScriptAccess:"always",bgcolor:"#"+this.settings.backgroundColor.toString(16)});};FlippingBook.prototype.getFlippingBookReference=function(){return this.getObjectReference(this.containerId);};FlippingBook.prototype.getObjectReference=function(id){return document.getElementById(id);};FlippingBook.prototype.flipForward=function(){flippingBook.getFlippingBookReference().flipForward();};FlippingBook.prototype.flipBack=function(){flippingBook.getFlippingBookReference().flipBack();};FlippingBook.prototype.zoomButtonClick=function(){if(flippingBook.getFlippingBookReference().isZoomedIn()){flippingBook.zoomOut();}else{flippingBook.zoomIn();}};FlippingBook.prototype.zoomIn=function(){this.getFlippingBookReference().zoomIn();};FlippingBook.prototype.zoomOut=function(){this.getFlippingBookReference().zoomOut();};FlippingBook.prototype.print=function(){flippingBook.getFlippingBookReference().print();};FlippingBook.prototype.downloadFile=function(){if(flippingBook.settings.downloadURL)flippingBook.getFlippingBookReference().downloadFile();};FlippingBook.prototype.onWindowLoad=function(){var forwardButton=flippingBook.getObjectReference(flippingBook.forwardButtonId);if(forwardButton){forwardButton.style.cursor="pointer";forwardButton.onclick=flippingBook.flipForward;}var backButton=flippingBook.getObjectReference(flippingBook.backButtonId);if(backButton){backButton.style.cursor="pointer";backButton.onclick=flippingBook.flipBack;}var zoomButton=flippingBook.getObjectReference(flippingBook.zoomButtonId);if(zoomButton){zoomButton.style.cursor="pointer";zoomButton.onclick=flippingBook.zoomButtonClick;}var printButton=flippingBook.getObjectReference(flippingBook.printButtonId);if(printButton){printButton.style.cursor="pointer";printButton.onclick=flippingBook.print;}var downloadButton=flippingBook.getObjectReference(flippingBook.downloadButtonId);if(downloadButton){downloadButton.style.cursor="pointer";downloadButton.onclick=flippingBook.downloadFile;}flippingBook.buildContentsMenu();};FlippingBook.prototype.onPutPage=function(leftPageNumber,rightPageNumber){this.updatePagination(leftPageNumber,rightPageNumber);this.updateContentsMenu(leftPageNumber,rightPageNumber);};FlippingBook.prototype.updatePagination=function(leftPageNumber,rightPageNumber){var leftPageExists=(leftPageNumber!=undefined);var rightPageExists=(rightPageNumber!=undefined);var pageNumberString=leftPageNumber+"-"+rightPageNumber;if(!leftPageExists)pageNumberString=rightPageNumber;if(!rightPageExists)pageNumberString=leftPageNumber;this.getObjectReference(this.currentPagesId).innerHTML=pageNumberString;this.getObjectReference(this.totalPagesId).innerHTML=" / "+this.getFlippingBookReference().totalPages();statistikclick();};FlippingBook.prototype.buildContentsMenu=function(){var contentsSelect=this.getObjectReference(this.contentsMenuId);if(contentsSelect){for(var i=0;i<this.contents.length;i++)contentsSelect.options[i]=new Option(this.contents[i][0],this.contents[i][1]);contentsSelect.onchange=this.onContentsChange;}};FlippingBook.prototype.onContentsChange=function(){var contentsSelect=flippingBook.getObjectReference(flippingBook.contentsMenuId);var pageNumber=contentsSelect.options[contentsSelect.selectedIndex].value;if(pageNumber)flippingBook.getFlippingBookReference().flipGotoPage(pageNumber);};FlippingBook.prototype.updateContentsMenu=function(leftPageNumber,rightPageNumber){var contentsSelect=flippingBook.getObjectReference(flippingBook.contentsMenuId);if(contentsSelect){for(var i=0;i<this.contents.length-1;i++){var minPage=contentsSelect.options[i].value;var maxPage=contentsSelect.options[i+1].value;var leftOK=false;var rightOK=false;if(leftPageNumber)leftOK=(Number(leftPageNumber)>=minPage&&Number(leftPageNumber)<=maxPage);elseleftOK=true;if(rightPageNumber)rightOK=(Number(rightPageNumber)>=minPage&&Number(rightPageNumber)<=maxPage);elserightOK=true;if(leftOK&&rightOK)break;}contentsSelect.selectedIndex=i;}};FlippingBook.prototype.getWindowHeight=function(){var windowHeight=0;if(typeof(window.innerHeight)=='number'){windowHeight=window.innerHeight;alert(windowHeight);}else{if(document.documentElement&&document.documentElement.clientHeight){windowHeight=document.documentElement.clientHeight;alert(windowHeight);}else{if(document.body&&document.body.clientHeight){windowHeight=document.body.clientHeight;alert(windowHeight);}}}return windowHeight;};FlippingBook.prototype.addLoadEvent=function(fn){if(typeof window.addEventListener!="undefined"){window.addEventListener("load",fn,false);}else if(typeof document.addEventListener!="undefined"){document.addEventListener("load",fn,false);}else if(typeof window.attachEvent!="undefined"){window.attachEvent("onload",fn);}else if(typeof window.onload=="function"){var fnOld=window.onload;window.onload=function(){fnOld();fn();};}else{window.onload=fn;}};function sizeContent(){var windowHeight=getWindowHeight();var footerHeight=document.getElementById("fbFooter").offsetHeight;var contentHeight=675;document.getElementById("fbContainer").style.height=contentHeight+"px";var altDiv=document.getElementById("altmsg");if(altDiv){var altH=altDiv.offsetHeight;var altW=altDiv.offsetWidth;altDiv.style.top=(contentHeight/2-altH/2)+"px";altDiv.style.left=(getWindowWidth()/2-altW/2)+"px";}}function addEvent(obj,type,fn){if(obj.addEventListener)obj.addEventListener(type,fn,false);else if(obj.attachEvent){obj["e"+type+fn]=fn;obj.attachEvent("on"+type,function(){obj["e"+type+fn]();});}}function getWindowHeight(){var windowHeight=0;if(typeof(window.innerHeight)=='number'){windowHeight=window.innerHeight;}else{if(document.documentElement&&document.documentElement.clientHeight){windowHeight=document.documentElement.clientHeight;}else{if(document.body&&document.body.clientHeight){windowHeight=document.body.clientHeight;}}}return windowHeight;}function getWindowWidth(){var ww=0;if(self.innerWidth)ww=self.innerWidth;else if(document.documentElement&&document.documentElement.clientWidth)ww=document.documentElement.clientWidth;else if(document.body)ww=document.body.clientWidth;return ww;}flippingBook=null;ape.ns("motorpresse.elements");motorpresse.elements.FlipBook={flipBookConfig:{stageWidth:900,stageHeight:770,pages:[],contents:[],settings:{zoomImageWidth:757,zoomImageHeight:1136,bookWidth:900,bookHeight:675,pageBackgroundColor:0xFFFFFF,backgroundColor:0xFFFFFF,zoomUIColor:0xFFFFFF,useCustomCursors:false,dropShadowEnabled:false,zoomHintEnabled:false,zoomPath:"/img/flipBook/pages/honda_auto/large/",downloadURL:"http://www.page-flip.com/new-demos/03-kitchen-gorenje-2008/kitchen_gorenje_2008.pdf",flipSound:"/img/flipBook/sounds/02.mp3",flipCornerStyle:"first page only"}},init:function(){flippingBook=new FlippingBook();this.applySettings(flippingBook);flippingBook.create();addEvent(window,"load",sizeContent);addEvent(window,"resize",sizeContent);},applySettings:function(obj,settings){settings=settings||this.flipBookConfig;for(var key in settings){if(obj[key]===undefined){obj[key]=settings[key];}else if(typeof settings[key]==='object'){this.applySettings(obj[key],settings[key]);}else{obj[key]=settings[key];}}return obj;}};ape.Listeners.addListener('is_flipbook',function(ref){motorpresse.elements.FlipBook.init(ref);},1);(function(a){var k="function",i="password",c="maxLength",e="type",b=true,d=false,s="watermark",t,m=s,h="watermarkClass",p="watermarkFocus",j="watermarkSubmit",l="watermarkMaxLength",g="watermarkPassword",f="watermarkText",r=":data("+m+")",n=":text,:password,:search,textarea",o=["Page_ClientValidate"],q=d;a.extend(a.expr[":"],{search:function(a){return"search"===a.type;},data:function(f,h,g){var e,c=/^((?:[^=!^$*]|[!^$*](?!=))+)(?:([!^$*]?=)(.*))?$/.exec(g[3]);if(c){e=a(f).data(c[1]);if(e!==t){if(c[2]){e=""+e;switch(c[2]){case"=":return e==c[3];case"!=":return e!=c[3];case"^=":return e.slice(0,c[3].length)==c[3];case"$=":return e.slice(-c[3].length)==c[3];case"*=":return e.indexOf(c[3])!==-1;default:return b;}}return b;}}return d;}});a.watermark={version:"3.0.5",options:{className:s,useNative:b},hide:function(b){a(b).filter(r).each(function(){a.watermark._hide(a(this));});},_hide:function(a,i){if(a.val()==a.data(f)){a.val("");if(a.data(g)){if(a.attr(e)==="text"){var d=a.data(g),b=a.parent();b[0].removeChild(a[0]);b[0].appendChild(d[0]);a=d;}}if(a.data(l)){a.attr(c,a.data(l));a.removeData(l);}if(i){a.attr("autocomplete","off");window.setTimeout(function(){a.select();},0);}}a.removeClass(a.data(h));},show:function(b){a(b).filter(r).each(function(){a.watermark._show(a(this));});},_show:function(d){var r=d.val(),j=d.data(f),m=d.attr(e);if((r.length===0||r==j)&&!d.data(p)){q=b;if(d.data(g)){if(m===i){var o=d.data(g),n=d.parent();n[0].removeChild(d[0]);n[0].appendChild(o[0]);d=o;d.attr(c,j.length);}}if(m==="text"||m==="search"){var k=d.attr(c);if(k>0&&j.length>k){d.data(l,k);d.attr(c,j.length);}}d.addClass(d.data(h));d.val(j);}else a.watermark._hide(d);},hideAll:function(){if(q){a.watermark.hide(n);q=d;}},showAll:function(){a.watermark.show(n);}};a.fn.watermark=function(q,l){var o="string",s=typeof q===o,r;if(typeof l==="object"){r=typeof l.className===o;l=a.extend({},a.watermark.options,l);}else if(typeof l===o){r=b;l=a.extend({},a.watermark.options,{className:l});}else l=a.watermark.options;if(typeof l.useNative!==k)l.useNative=l.useNative?function(){return b;}:function(){return d;};return this.each(function(){var u="dragleave",t="dragenter",w=this,d=a(w);if(!d.is(n))return;if(d.data(m)){if(s||r){a.watermark._hide(d);s&&d.data(f,q);r&&d.data(h,l.className);}}else{if(l.useNative.call(w,d)){if((""+d.css("-webkit-appearance")).replace("undefined","")!==""&&d.attr("tagName")!=="TEXTAREA"){s&&d.attr("placeholder",q);return;}}d.data(f,s?q:"");d.data(h,l.className);d.data(m,1);if(d.attr(e)===i){var x=d.wrap("<span>").parent(),k=a(x.html().replace(/type=["']?password["']?/i,'type="text"'));k.data(f,d.data(f));k.data(h,d.data(h));k.data(m,1);k.attr(c,q.length);k.focus(function(){a.watermark._hide(k,b);}).bind(t,function(){a.watermark._hide(k);}).bind("dragend",function(){window.setTimeout(function(){k.blur();},1);});d.blur(function(){a.watermark._show(d);}).bind(u,function(){a.watermark._show(d);});k.data(g,d);d.data(g,k);}else d.focus(function(){d.data(p,1);a.watermark._hide(d,b);}).blur(function(){d.data(p,0);a.watermark._show(d);}).bind(t,function(){a.watermark._hide(d);}).bind(u,function(){a.watermark._show(d);}).bind("dragend",function(){window.setTimeout(function(){a.watermark._show(d);},1);}).bind("drop",function(b){var a=b.originalEvent.dataTransfer.getData("Text");d.val().replace(a,"")===d.data(f)&&d.val(a);d.focus();});if(w.form){var o=w.form,v=a(o);if(!v.data(j)){v.submit(a.watermark.hideAll);if(o.submit){v.data(j,o.submit);o.submit=function(c,b){return function(){var d=b.data(j);a.watermark.hideAll();if(d.apply)d.apply(c,Array.prototype.slice.call(arguments));else d();};}(o,v);}else{v.data(j,1);o.submit=function(b){return function(){a.watermark.hideAll();delete b.submit;b.submit();};}(o);}}}}a.watermark._show(d);}).end();};o.length&&a(function(){for(var b,c,d=o.length-1;d>=0;d--){b=o[d];c=window[b];if(typeof c===k)window[b]=function(b){return function(){a.watermark.hideAll();return b.apply(null,Array.prototype.slice.call(arguments));};}(c);}});})(jQuery);ape.Namespace('motorpresse.elements.Form');motorpresse.elements.Form.Watermark={public_key:null,field:jQuery(),theme:'custom',lang:'de',init:function(ref){ref.each(function(){var field=jQuery(this),value=field.attr('alt');if(value){field.watermark(value);}});}};ape.Listeners.addListener('is_watermark',function(ref){motorpresse.elements.Form.Watermark.init(ref);},2);ape.Namespace('motorpresse.elements.Form');motorpresse.elements.Form.Captcha={public_key:null,field:jQuery(),theme:'custom',lang:'de',init:function(ref){this.field=jQuery('#is_captcha_image',ref);this.public_key=jQuery('input[name="recaptcha_public_key"]').val();var recaptcha_options={theme:this.theme,lang:this.lang};Recaptcha.create(this.public_key,'recaptcha_image',recaptcha_options);jQuery('.is_reload_captcha',ref).bind('click',function(){Recaptcha.reload();});}};ape.Listeners.addListener('is_captcha',function(ref){motorpresse.elements.Form.Captcha.init(ref);},2);ape.ns("motorpresse.elements");motorpresse.elements.CampingChequeElement={submit:null,trigger:null,charges:null,sum:null,idGuides:"#europaguide",idCheques:"#cheques",idSum:'#gesamtsumme',idSumDisplay:'#gesamtsummeanzeige',idCharges:'#bearbeitungskosten',pricePerGuide:6,pricePerCheque:15,init:function(ref){var self=this;this.sum=jQuery(this.idSumDisplay,ref);this.charges=parseInt(jQuery(this.idCharges,ref).text(),10);if(isNaN(this.charges)){this.charges=0;}this.trigger=jQuery('.is_trigger',ref);this.trigger.unbind('keyup.ape_campingcheque');this.trigger.bind('keyup.ape_campingcheque',function(){var valueGuides=parseInt(jQuery(self.idGuides,self.ref).val(),10);if(isNaN(valueGuides)){valueGuides=0;if(self.idGuides!='#'+jQuery(this).attr('id')){jQuery(self.idGuides,ref).val(0);}}var valueCheques=parseInt(jQuery(self.idCheques,self.ref).val(),10);if(isNaN(valueCheques)){valueCheques=0;if(self.idCheques!='#'+jQuery(this).attr('id')){jQuery(self.idCheques,ref).val(0);}}var sumGuides=valueGuides*self.pricePerGuide;var sumCheques=valueCheques*self.pricePerCheque;var sum=0;if(sumGuides===0&&sumCheques===0){sum=0;}else if(sumCheques===0){sum=sumGuides;}else{sum=self.charges+sumGuides+sumCheques;}jQuery(self.sum).html(sum);});this.submit=jQuery('.is_submit',ref);this.submit.unbind('click.ape_campingcheque_submit');this.submit.bind('click.ape_campingcheque_submit',function(){jQuery(self.idSum).val(jQuery(self.idSumDisplay).html());jQuery('form',self.ref).submit();return false;});}};ape.Listeners.addListener('is_campingcheque',function(ref){motorpresse.elements.CampingChequeElement.init(ref);},2);ape.ns("motorpresse.elements");motorpresse.elements.GenericComparisonResultTable={ref:null,data:null,init:function(ref){var self=this;},loadSection:function(key,position){var section,sectionKey,valueKey;for(sectionKey in this.data){section=this.data[sectionKey];for(valueKey in section.values){var value=section.values[valueKey];this.setSectionField(key,sectionKey,valueKey,value.testValue[position],value.value[position]);}}},setSectionField:function(key,sectionIndex,fieldIndex,testValue,value){fieldIndex--;var rows=jQuery('#is_comparison_section_'+sectionIndex+' > table > tbody > tr');var testValueTarget,valueTarget;if(rows.length>0){var currentRow=jQuery(rows[fieldIndex]);if(currentRow.length>0){if(key==1){testValueTarget=jQuery('td.col_4',currentRow);valueTarget=jQuery('td.col_5 > em',currentRow);}else{testValueTarget=jQuery('td.col_2',currentRow);valueTarget=jQuery('td.col_3 > em',currentRow);}if(testValueTarget.length>0){testValueTarget.html(testValue);}if(valueTarget.length>0){valueTarget.html(value);}}}},refreshDropdowns:function(key,position){var dropdown=jQuery('#select_menu'+(key==1?2:1));var selected=dropdown.val();var template=jQuery('.is_comparison_result_table_dropdown_template option');dropdown.find('option').remove();template.each(function(){if(jQuery(this).val()!=position){jQuery(this).clone().appendTo(dropdown);}});dropdown.val(selected);}};motorpresse.elements.GenericComparisonResultTableDropdown={ref:null,init:function(ref){var self=this;jQuery(ref).val(0);jQuery(ref).unbind('change.comparisontable');jQuery(ref).bind('change.comparisontable',function(){self.onChange(jQuery(this));});},onChange:function(dropdown){var key=dropdown.attr('id');key=key.replace('select_menu','');var position=dropdown.val();motorpresse.elements.GenericComparisonResultTable.loadSection(key,position);motorpresse.elements.GenericComparisonResultTable.refreshDropdowns(key,position);}};ape.Listeners.addListener('is_comparison_result_table',function(ref){motorpresse.elements.GenericComparisonResultTable.init(ref);},2);ape.Listeners.addListener('is_comparison_result_table_dropdown',function(ref){motorpresse.elements.GenericComparisonResultTableDropdown.init(ref);},2);ape.ns("motorpresse.elements");motorpresse.elements.BrandTreeSeriesOverviewElement={initialData:jQuery(),init:function(ref){var self=this;if(ref.length>0){this.initialData=this.getContainer(ref[0]).find('div.eintrag');}for(var i=0;i<ref.length;i++){var current=jQuery(ref[i]);if(current.is('.is_series_filter_default')){current.attr('checked','checked');}current.bind('change',function(){self.onClick(jQuery(this));});}},onClick:function(el){var self=this;var ajaxUrl=el.val();if(el.is('.is_series_filter_default')){self.getContainer(el).find('div.eintrag:visible').remove();this.initialData.show();return;}else{this.initialData.hide();}jQuery.ajax({url:ajaxUrl,type:'post',dataType:'html',success:function(data,status){var container=self.getContainer(el);container.find('div.eintrag:visible').remove();container.append(data);}});},getContainer:function(input){return jQuery(input).parent().parent().parent();}};ape.Listeners.addListener('is_series_filter',function(ref){motorpresse.elements.BrandTreeSeriesOverviewElement.init(ref);},2);ape.ns("motorpresse.elements");motorpresse.elements.AppointmentSearchElement={ref:null,defaultValues:{},init:function(ref){var self=this;this.ref=ref;jQuery("form.is_submittable",ref).bind('submit',function(){for(var id in self.defaultValues){if(jQuery("#"+id,ref).val()==self.defaultValues[id]){jQuery("#"+id,ref).val('');}}});jQuery('input[name="dateRange"]').change(this.toggleDateToField);this.toggleDateToField();},toggleDateToField:function(){if(jQuery('#terminsuche_von',this.ref).is(':checked')){jQuery('#dateTo',this.ref).removeAttr('disabled');}else{jQuery('#dateTo',this.ref).attr('disabled','disabled');}},initButton:function(ref){var self=this;jQuery('.is_shortcut_button',ref).bind('click',function(){jQuery('input[name="category"]',ref).val(jQuery('span span.hide',this).html());jQuery('.is_submittable',ref).submit();});},addDefaultValue:function(id,description){var inputElement=jQuery('#'+id,this.ref);if(!inputElement.val()){inputElement.val(description);}inputElement.focusin(function(){if(jQuery(this).val()==description){jQuery(this).val('');}}).focusout(function(){if(jQuery(this).val()===""){jQuery(this).val(description);}});this.defaultValues[id]=description;}};ape.Listeners.addListener('is_appointment_searchform',function(ref){motorpresse.elements.AppointmentSearchElement.init(ref);},2);ape.Listeners.addListener('is_appointment_fastsearchform',function(ref){motorpresse.elements.AppointmentSearchElement.initButton(ref);},2);ape.ns("motorpresse.elements");motorpresse.elements.routenplanerFalk={startRoute:'false',that:this,error:null,map:null,processor:null,router:null,init:function(ref){motorpresse.elements.routenplanerFalk.setBindings();document.map=new FalkMap("falkMap");FalkMapConfiguration.mapCoordinateFormat=FalkMapConfiguration.MAP_COORDINATE_FORMAT_WGS_84;document.map.subscribe(FalkMap.MSG_MAP_CLICKED,this.map_clicked);YAHOO.namespace("Custom.Route");YAHOO.Custom.Route.RouteHTMLRenderer=function(){YAHOO.Custom.Route.RouteHTMLRenderer.superclass.constructor.call(this);this.__name="ExampleRouteHTMLRenderer";};YAHOO.lang.extend(YAHOO.Custom.Route.RouteHTMLRenderer,RouteHTMLRenderer);YAHOO.Custom.Route.RouteHTMLRenderer.prototype._renderOverview=function(){var route_option_routetype=$('input[name="route_option_routetype"]:checked').val();var template=YAHOO.Custom.Route.RouteHTMLRenderer.HTML_TEMPLATE_OVERVIEW;template=template.replace("%VALUE_DURATION%",this.formatDuration(this._route.duration));template=template.replace("%VALUE_DISTANCE%",this._route.distance);template=template.replace("%VALUE_DEPARTURE%",this._route.departureDate.getDateString());template=template.replace("%VALUE_DEPARTURE_TIME%",this._route.departureTime.getFormatedTime());template=template.replace("%VALUE_ARRIVAL%",this._route.arrivalDate.getDateString());template=template.replace("%VALUE_ARRIVAL_TIME%",this._route.arrivalTime.getFormatedTime());template=template.replace("%VALUE_TRAVEL_COSTS%",this.calcTravelCosts(this._route.distance));switch(route_option_routetype){case'schnell':template=template.replace("%VALUE_ROUTE_OPT%",'schnellste');break;case'kurz':template=template.replace("%VALUE_ROUTE_OPT%",'kürzeste');break;default:break;}BEGONE.parse(template,YDom.get("routeOverview"),false);$('.button_change_routetype').unbind('click.changeroutetyoe').bind('click.changeroutetyoe',function(){$('.is_changeRouteButton').click();});};YAHOO.Custom.Route.RouteHTMLRenderer.HTML_TEMPLATE_OVERVIEW=""+"<dt><strong>Strecke:</strong></dt><dd class='trenner'><strong>%VALUE_DISTANCE%</strong></dd> "+"<dt class='trenner'><strong>Fahrzeit:</strong></dt><dd class='trenner' ><strong>%VALUE_DURATION%</strong></dd> "+"<dt>Abfahrt:</dt><dd>%VALUE_DEPARTURE% %VALUE_DEPARTURE_TIME%</dd>"+"<dt class='trenner'>Ankunft:</dt><dd class='trenner'>%VALUE_ARRIVAL% %VALUE_ARRIVAL_TIME%</dd>"+"<dt class='trenner'>Reisekosten:</dt><dd class='trenner'>%VALUE_TRAVEL_COSTS%</dd>"+"<dt>Routenart:</dt>"+"<dd><strong>%VALUE_ROUTE_OPT% <a href='javascript:;' class='button_change_routetype'>Routenart ändern</a></strong></dd>";YAHOO.Custom.Route.RouteHTMLRenderer.prototype.calcTravelCosts=function(distance){var self=motorpresse.elements.routenplanerFalk;var entfernung=parseFloat(self.str_replace(',','.',self.str_replace(' km','',distance)));var verbrauch=parseFloat(self.str_replace(',','.',$('#route_option_verbrauch').val()));var benzinpreis=parseFloat(self.str_replace(',','.',$('#route_option_benzinpreis').val()));var ausgabe_benzin=self.str_replace('.',',',self.extround((entfernung*(verbrauch/100))*benzinpreis,2));var travelCosts='-';if(ausgabe_benzin!=='NaN'){travelCosts=ausgabe_benzin+' € (Verbrauch: '+self.str_replace('.',',',self.extround(entfernung*(verbrauch/100),2))+' Liter )';}return travelCosts;};YAHOO.Custom.Route.RouteHTMLRenderer.prototype.formatDuration=function(duration){if(is_null(duration)){return duration;}try{var d=duration.split(":");d[0]=parseInt(d[0],10);d[1]=parseInt(d[1],10);if(!is_number(d[0])||!is_number(d[1])){return duration;}duration=((d[0]===0)?"":d[0]+" Std. ")+d[1]+" Min.";return duration;}catch(e){}return duration;};FPTime.prototype.getFormatedTime=function(){return this.getHourString()+":"+this.getMinuteString()+" Uhr";};ROUTE_HTML_STYLE.push({classname:'stationcol1',styles:[{key:'fontSize',value:'11px'}]},{classname:'stationcol2',styles:[{key:'fontSize',value:'11px'}]},{classname:'overviewcol1',styles:[{key:'fontSize',value:'11px'}]},{classname:'overviewcol2',styles:[{key:'fontSize',value:'11px'}]},{classname:'overviewcol3',styles:[{key:'fontSize',value:'11px'}]},{classname:'overviewcol4',styles:[{key:'fontSize',value:'11px'}]},{classname:'col1',styles:[{key:'fontSize',value:'11px'}]},{classname:'col2',styles:[{key:'fontSize',value:'11px'}]},{classname:'col3',styles:[{key:'fontSize',value:'11px'}]},{classname:'col4',styles:[{key:'fontSize',value:'11px'}]});if(this.startRoute==='true'){this.requestRoute(document.map);}else{this.resetMap();}},str_replace:function(search,replace,subject){subject=subject+"";return subject.split(search).join(replace);},extround:function(zahl,n_stelle){zahl=(Math.round(zahl*n_stelle)/n_stelle);return zahl;},map_clicked:function(){motorpresse.elements.routenplanerFalk.map_zoom_in();},map_zoom_in:function(){document.map.zoomIn();},map_zoom_out:function(){document.map.zoomOut();},map_move_left:function(){document.map.moveMap(100,0);},map_move_right:function(){document.map.moveMap(-100,0);},map_move_top:function(){document.map.moveMap(0,100);},map_move_bottom:function(){document.map.moveMap(0,-100);},map_print:function(){window.print();},map_flag_start:function(){alert('hier zum start springen');},map_flag_end:function(){alert('hier zum ziel springen');},map_weiterleiten:function(){prompt('Kopieren Sie sich diesen Link, um diese Route zu einem späteren Zeitpunkt wieder laden zu können.',window.location.href);},map_switch_map:function(){document.map.changeMapLayer('MSMAP');$(this).parent().children('li').removeClass('aktiv');$(this).addClass('aktiv');},map_switch_hyb:function(){document.map.changeMapLayer('MSHYBRID');$(this).parent().children('li').removeClass('aktiv');$(this).addClass('aktiv');},map_switch_sat:function(){document.map.changeMapLayer('MSAIR');$(this).parent().children('li').removeClass('aktiv');$(this).addClass('aktiv');},setMapOverlayColors:function(){$('.yui-overlay .bd .body').css({background:'#F0EFEC'});$('.yui-overlay .ft').remove();$('.yui-overlay .hd .header .header_tr').remove();},setBindings:function(){var contentbereich=$('.navigation_routenplaner');$('.zoom_plus',contentbereich).unbind('click').bind('click',motorpresse.elements.routenplanerFalk.map_zoom_in);$('.zoom_minus',contentbereich).unbind('click').bind('click',motorpresse.elements.routenplanerFalk.map_zoom_out);$('.pfeil_links',contentbereich).unbind('click').bind('click',motorpresse.elements.routenplanerFalk.map_move_left);$('.pfeil_rechts',contentbereich).unbind('click').bind('click',motorpresse.elements.routenplanerFalk.map_move_right);$('.pfeil_hoch',contentbereich).unbind('click').bind('click',motorpresse.elements.routenplanerFalk.map_move_top);$('.pfeil_runter',contentbereich).unbind('click').bind('click',motorpresse.elements.routenplanerFalk.map_move_bottom);$('.print_link').unbind('click').bind('click',motorpresse.elements.routenplanerFalk.map_print);$('.flagge_start',contentbereich).unbind('click').bind('click',motorpresse.elements.routenplanerFalk.map_flag_start);$('.flagge_ziel',contentbereich).unbind('click').bind('click',motorpresse.elements.routenplanerFalk.map_flag_end);$('.weiterleiten',contentbereich).unbind('click').bind('click',motorpresse.elements.routenplanerFalk.map_weiterleiten);$('.mapswitch_map',contentbereich).unbind('click').bind('click',motorpresse.elements.routenplanerFalk.map_switch_map);$('.mapswitch_hyb',contentbereich).unbind('click').bind('click',motorpresse.elements.routenplanerFalk.map_switch_hyb);$('.mapswitch_sat',contentbereich).unbind('click').bind('click',motorpresse.elements.routenplanerFalk.map_switch_sat);$('.is_myRouteButton').unbind('click').bind('click',motorpresse.elements.routenplanerFalk.showMyRoute);$('.is_changeRouteButton').unbind('click').bind('click',motorpresse.elements.routenplanerFalk.showRouteForm);$('.button_change_routetype').unbind('click.changeroutetyoe').bind('click.changeroutetyoe',function(){$('.is_changeRouteButton').click();});$('#newRouteSubmit').unbind('click.submit').bind('click.submit',motorpresse.elements.routenplanerFalk.checkRouteParameters);$('#routeDescription').unbind('click.colors').bind('click.colors',motorpresse.elements.routenplanerFalk.setMapOverlayColors);$('#falkMap').unbind('mousemove').bind('mousemove',motorpresse.elements.routenplanerFalk.setMapOverlayColors);motorpresse.elements.routenplanerFalk.setMapOverlayColors();$('.switchAdresses').unbind('click.switchAdresses').bind('click.switchAdresses',motorpresse.elements.routenplanerFalk.switchAdresses);$('#route_option_datechanger').unbind('click.show_routenplaner_kalender').bind('click.show_routenplaner_kalender',motorpresse.elements.routenplanerFalk.showDatePicker);},showMyRoute:function(){$(this).parent().parent().children('.button_aktiv').removeClass('button_aktiv').addClass('button');$(this).parent().removeClass('button').addClass('button_aktiv');$('.is_routeform').addClass('hide');$('.is_myroute').removeClass('hide');},showRouteForm:function(){$(this).parent().parent().children('.button_aktiv').removeClass('button_aktiv').addClass('button');$(this).parent().removeClass('button').addClass('button_aktiv');$('.is_routeform').removeClass('hide');$('.is_myroute').addClass('hide');},showDatePicker:function(){$('#routenplaner_kalender').show();$('#routenplaner_kalender a.close').unbind('click.hide_routenplaner_kalender').bind('click.hide_routenplaner_kalender',function(){$('#routenplaner_kalender').hide();});$('.blaettern_weiter').bind('click',function(){var number=parseInt($(this).attr('id').split('_').pop(),10);var kalenderocunt=0;$('.kalender_routenplaner div').each(function(){kalenderocunt++;});if(number<kalenderocunt-1){$('.kalender_routenplaner div').hide();$('.kalender_routenplaner #kalender_'+(number+1)).show();}});$('.blaettern_zuruck').bind('click',function(){var number=parseInt($(this).attr('id').split('_').pop(),10);if(number>0){$('.kalender_routenplaner div').hide();$('.kalender_routenplaner #kalender_'+(number-1)).show();}});$('.kalender_routenplaner div table tbody tr td a').unbind('click').bind('click.setday',function(){var day=$(this).html();var month=$(this).parent().parent().parent().parent().parent().attr('month');var year=$(this).parent().parent().parent().parent().parent().attr('year');if(day.length<2){day='0'+day;}if(month.length<2){month='0'+month;}$('#route_option_date').html(day+'.'+month+'.'+year);$('#route_option_date_input').val(day+'.'+month+'.'+year);});},checkRouteParameters:function(){var startcity=$('#route_start_stadt').val();var startzip=$('#route_start_plz').val();var destcity=$('#route_ziel_stadt').val();var destzip=$('#route_ziel_plz').val();if((startcity!==''||startzip!=='')&&(destcity!==''||destzip!=='')){$('#is_RoutePlanerForm').submit();}else{alert('Bitte geben Sie für die Start- und Zieladresse jeweils mindestens die Stadt oder PLZ ein.');}},requestRoute:function(map){processor=new FalkRouteFlowProcessor(map,"routeDescription",new YAHOO.Custom.Route.RouteHTMLRenderer());router=processor.getFalkRouter();var startcountry=$('#route_start_land').val();var startcity=$('#route_start_stadt').val();var startzip=$('#route_start_plz').val();var startstreet=$('#route_start_street').val();var startAddress=new FalkAddress(startcountry,startcity,startzip,startstreet);var destcountry=$('#route_ziel_land').val();var destcity=$('#route_ziel_stadt').val();var destzip=$('#route_ziel_plz').val();var deststreet=$('#route_ziel_street').val();var destAddress=new FalkAddress(destcountry,destcity,destzip,deststreet);var rp=new RouteProfile();var route_option_routetype=$('input[name="route_option_routetype"]:checked').val();switch(route_option_routetype){case'schnell':rp.setOptimizationType(RouteProfile.OPT_FASTEST);break;case'kurz':rp.setOptimizationType(RouteProfile.OPT_SHORTEST);break;default:break;}router.setRouteProfile(rp);var fd=new FPDate();fd.parseDate($('#route_option_date').html());router.setRoutingDate(fd);router.setRoutingTime(new FPTime($('#route_option_uhrzeit_hour').val(),$('#route_option_uhrzeit_min').val()));var route_option_planung=$('input[name="route_option_planung"]:checked').val();switch(route_option_planung){case'abfahrt':router.setArrivalTimeSet(false);break;case'ankunft':router.setArrivalTimeSet(true);break;default:break;}processor.subscribe(FalkRouteFlowProcessor.MSG_ROUTING_ERROR,motorpresse.elements.routenplanerFalk.showError);processor.subscribe(FalkRouteFlowProcessor.MSG_GEOCODING_ERROR,motorpresse.elements.routenplanerFalk.showError);motorpresse.elements.routenplanerFalk.clearError();processor.setRouteColor(FalkRouter.ROUTE_COLOR_BLUE);processor.disableFeature(FalkRouter.FEATURE_DRAW_ROUTE);processor.calcRoute([startAddress,destAddress]);},resetMap:function(){var geocode=new FalkPoint(9.223379437790086,48.72223860481109);document.map.centerMapToGeocode(geocode,5);},showError:function(result){var o=YDom.get("error");if(!is_null(o)&&!is_null(result)&&!is_null(result.error)){if(result.error.userText==='Die Adresse konnte nicht geocodiert werden'){$('.is_changeRouteButton').click();if(result.geocodeRequest.countryCode==$('#route_start_land').val()&&result.geocodeRequest.city==$('#route_start_stadt').val()&&result.geocodeRequest.zip==$('#route_start_plz').val()&&result.geocodeRequest.street==$('#route_start_street').val()){$('#warnung_start').show();}if(result.geocodeRequest.countryCode==$('#route_ziel_land').val()&&result.geocodeRequest.city==$('#route_ziel_stadt').val()&&result.geocodeRequest.zip==$('#route_ziel_plz').val()&&result.geocodeRequest.street==$('#route_ziel_street').val()){$('#warnung_ziel').show();}motorpresse.elements.routenplanerFalk.resetMap();}else{o.innerHTML=result.error.userText;}}},clearError:function(){var o=YDom.get("error");if(!is_null(o)){o.innerHTML="";}},showError_geocode:function(result){if(result&&result.error){error=result.error.userText;if(error==='Die Adresse konnte nicht geocodiert werden'){$('.is_changeRouteButton').click();if(result.geocodeRequest.countryCode==$('#route_start_land').val()&&result.geocodeRequest.city==$('#route_start_stadt').val()&&result.geocodeRequest.zip==$('#route_start_plz').val()&&result.geocodeRequest.street==$('#route_start_street').val()){$('#warnung_start').show();}if(result.geocodeRequest.countryCode==$('#route_ziel_land').val()&&result.geocodeRequest.city==$('#route_ziel_stadt').val()&&result.geocodeRequest.zip==$('#route_ziel_plz').val()&&result.geocodeRequest.street==$('#route_ziel_street').val()){$('#warnung_ziel').show();}motorpresse.elements.routenplanerFalk.resetMap();}}},switchAdresses:function(){var startcountry=$('#route_start_land').val();var startcity=$('#route_start_stadt').val();var startzip=$('#route_start_plz').val();var startstreet=$('#route_start_street').val();$('#route_start_land').val($('#route_ziel_land').val());$('#route_start_stadt').val($('#route_ziel_stadt').val());$('#route_start_plz').val($('#route_ziel_plz').val());$('#route_start_street').val($('#route_ziel_street').val());$('#route_ziel_land').val(startcountry);$('#route_ziel_stadt').val(startcity);$('#route_ziel_plz').val(startzip);$('#route_ziel_street').val(startstreet);}};ape.Listeners.addListener('is_RoutePlaner',function(ref){motorpresse.elements.routenplanerFalk.init(ref);},1);ape.ns("motorpresse.elements");motorpresse.elements.VehicleCallback={_config:{},init:function(ref){ref.each(function(){var self=motorpresse.elements.VehicleCallback;});}};ape.ns("motorpresse.elements");motorpresse.elements.ArticleGenericHead={ajaxUrl:null,ref:null,init:function(ref){this.ref=ref;var self=this;if(this.ajaxUrl===null){return false;}PHPFOX.add('article_genericHead',function(data,status){if(data.count>0){jQuery('.is_comment_count',self.ref).attr('href','#kommentare');}else{jQuery('.is_comment_count',self.ref).attr('href','#kommentar_schreiben');}jQuery('.is_comment_count',self.ref).html(data.count+' Kommentare');},null,'json');if(typeof gapi!=="undefined"){gapi.plusone.go();}return true;}};ape.Listeners.addListener('is_generic_head',function(ref){motorpresse.elements.ArticleGenericHead.init(ref);},1);ape.ns("motorpresse.elements");motorpresse.elements.CommentElement={ref:null,pagination_page:1,init:function(ref){var self=this;this.ref=jQuery(ref);PHPFOX.add('article_comment',function(data,status){self.ref.replaceWith(jQuery(data));motorpresse.elements.CommentElement.Rate.init(jQuery('.is_rate'));motorpresse.elements.CommentElement.Spam.init(jQuery('.is_spam'));motorpresse.elements.CommentElement.Pager.init(jQuery('.is_comment_list'));motorpresse.elements.AdElement.Ad.adTrigger(jQuery('.is_ad_trigger'));},{pagination_page:this.pagination_page});}};ape.Listeners.addListener('is_comment_list',function(ref){motorpresse.elements.CommentElement.init(ref);},2);ape.ns("motorpresse.elements");motorpresse.elements.ArticleAudio={_config:{},_container:'',init:function(ref){this._container=ref.attr('id');var self=motorpresse.elements.ArticleAudio;var playerID=self._config.playerID;var publisherID=self._config.publisherID;var param_site=self._config.param_site;var param_affiliate=self._config.param_affiliate;var param_prod=self._config.param_prod;var artikelurl=self._config.artikelurl;var audioID=self._config.audioID;var audioTag=self.generateaudioTag(playerID,publisherID,param_site,param_affiliate,param_prod,artikelurl,audioID,'');jQuery('#'+self._container).html(audioTag);brightcove.createExperiences();},generateaudioTag:function(playerID,publisherID,param_site,param_affiliate,param_prod,artikelurl,audioID,extratag){var additionalAdTargetingParams='';if(!window.frn046adxtra){window.frn046adxtra="";}var frn046enrich=(typeof window.pt027bw=='undefined')?"&band=256"+window.frn046adxtra:"&band="+window.pt027bw+window.frn046adxtra;frn046enrich=(typeof window.frn046tie=='undefined')?"&tie=free"+frn046enrich:"&tie="+window.frn046tie+frn046enrich;if(additionalAdTargetingParams===''){additionalAdTargetingParams=escape('site='+param_site+'&affiliate='+param_affiliate+'&prod='+param_prod+'&tbl=channel'+frn046enrich);}else{additionalAdTargetingParams=escape(additionalAdTargetingParams+frn046enrich);}var width=560;var height=45;if(this._config.mobile){width=jQuery('#'+this._container).css('width').replace('px','');}var random=Math.round(Math.random()*100);var audioTag='<object id="myExperience" class="BrightcoveExperience"> ';audioTag+='<param name="bgcolor" value="#FFFFFF" /> ';audioTag+='<param name="width" value="'+width+'"/> ';audioTag+='<param name="height" value="'+height+'"/> ';audioTag+='<param name="playerID" value="'+playerID+'"/> ';audioTag+='<param name="playerKey" value="AQ~~,AAAAD5ndabE~,9xTjtgFh42cVZDmLLUNv0zvjfgrBIhAO" /> ';audioTag+='<param name="isVid" value="true"/> ';audioTag+='<param name="isUI" value="true"/> ';audioTag+='<param name="dynamicStreaming" value="true" /> ';audioTag+='<param name="@videoPlayer"value="'+audioID+'"/> ';audioTag+='</object> ';return audioTag;}};ape.Listeners.addListener('is_articleaudiocontainer',function(ref){motorpresse.elements.ArticleAudio.init(ref);});ape.ns("motorpresse.elements");motorpresse.elements.TestArchiveElement={brandDropdown:jQuery(),seriesDropdown:jQuery(),modelDropdown:jQuery(),ratingSelect:jQuery(),seriesAjaxUrl:'/ajax/static.html/cars_listSeries/',modelAjaxUrl:'/ajax/static.html/cars_listModels/',init:function(ref){this.brandDropdown=jQuery('select[name="brand"]',ref);this.seriesDropdown=jQuery('select[name="series"]',ref);this.modelDropdown=jQuery('select[name="model"]',ref);this.ratingSelect=jQuery('.is_rating_select',ref);this.initBrandDropdown();this.initSeriesDropdown();this.initRatingSelect();jQuery('input, select',ref).bind('change',function(){jQuery('form',ref).submit();});jQuery('ul li a',ref).bind('click',function(){jQuery('form',ref).submit();});},initBrandDropdown:function(){var self=this;this.brandDropdown.unbind('change.testarchive');this.brandDropdown.bind('change.testarchive',function(){var currentValue=self.brandDropdown.val();if(currentValue==="0"){self.emptyDropDown(self.seriesDropdown);self.emptyDropDown(self.modelDropdown);return;}self.seriesDropdown.attr('disabled','disabled');self.emptyDropDown(self.modelDropdown);jQuery.ajax({url:self.seriesAjaxUrl,data:{Marke_ID:currentValue},dataType:'json',global:false,success:function(data){if(data){self.populateDropDown(self.seriesDropdown,data,'Baureihe_ID','Name');}}});});},initSeriesDropdown:function(){var self=this;this.seriesDropdown.unbind('change.testarchive');this.seriesDropdown.bind('change.testarchive',function(){var currentValue=self.seriesDropdown.val();if(currentValue==="0"){self.emptyDropDown(self.modelDropdown);return;}self.modelDropdown.attr('disabled','disabled');jQuery.ajax({url:self.modelAjaxUrl,data:{Baureihe_ID:currentValue},dataType:'json',global:false,success:function(data){if(data){self.populateDropDown(self.modelDropdown,data,'Modell_ID','Modell_Name');}}});});},initRatingSelect:function(){var self=this;jQuery('ul li a',this.ratingSelect).click(function(){if(jQuery(this).hasClass('aktiv')){jQuery(this).removeClass('aktiv');jQuery('input',self.ratingSelect).val(0);}else{jQuery('ul li a',this.ratingSelect).removeClass('aktiv');jQuery(this).addClass('aktiv');jQuery('input',self.ratingSelect).val(jQuery(this).attr('rel'));}});},populateDropDown:function(dropdown,values,valueKey,displayKey){this.emptyDropDown(dropdown);if(values===null){return false;}for(var i=0;i<values.length;i++){var current=values[i];dropdown.append('<option value="'+current[valueKey]+'">'+current[displayKey]+'</option>');}dropdown.removeAttr('disabled');return true;},emptyDropDown:function(dropdown){jQuery('option[value!="0"]',dropdown).remove();}};ape.Listeners.addListener('is_testarchiveform',function(ref){motorpresse.elements.TestArchiveElement.init(ref);});ape.ns("motorpresse.elements");motorpresse.elements.InsuranceCompare={initSubmit:function(ref){ref.each(function(){$(this).unbind('click.submit').bind('click.submit',function(){var okz=document.getElementById("vv_kennzeichen");var regex=/^[a-z]{1,3}$/i;if(!regex.test(okz.value)){alert(unescape('Bitte geben Sie ein g%FCltiges Ortskennzeichen ein.'));document.getElementById("vv_kennzeichen").focus();return false;}$('#insuranceCompareForm').submit();return false;});});}};ape.Listeners.addListener('is_insurance_compare_submit',motorpresse.elements.InsuranceCompare.initSubmit,1);ape.ns("motorpresse.elements");motorpresse.elements.ListsRubricElement={initForm:function(ref){ref.find('select').bind('change',function(){jQuery(this).closest('form').submit();});}};ape.Listeners.addListener('is_rubric_list_archive_form',function(ref){motorpresse.elements.ListsRubricElement.initForm(ref);},1);ape.ns("motorpresse.elements");motorpresse.elements.ListsBrandTreeElement={initForm:function(form){var self=this;jQuery('select[name="series"]').attr('disabled','');jQuery('select[name="type"]').attr('disabled','');jQuery('.is_brandtree_teaser_form_submit',form).unbind('click.brandtree');jQuery('.is_brandtree_teaser_form_submit',form).bind('click.brandtree',function(){self.doSubmit(jQuery(this).closest('form'));});},initFormSelects:function(ref){var self=this;ref.find('select').bind('change',function(){self.doSubmit(jQuery(this).closest('form'));});},doSubmit:function(inForm){var seriesselect=jQuery('select[name="series"]',inForm);var typeselect=jQuery('select[name="type"]',inForm);var selectedSeries=null;var selectedType=null;if(seriesselect.length>0&&typeselect.length>0){try{selectedSeries=JSON.parse(seriesselect.val().replace(/\!#\!/g,'"'));selectedType=typeselect.val();if(selectedSeries[selectedType]){inForm.attr('action',selectedSeries[selectedType]);}seriesselect.attr('disabled','disabled');typeselect.attr('disabled','disabled');}catch(e){inForm.attr('action',seriesselect.val());seriesselect.attr('disabled','disabled');}}else if(seriesselect.length>0){inForm.attr('action',seriesselect.val());seriesselect.attr('disabled','disabled');}inForm.submit();}};ape.Listeners.addListener('is_brandtree_teaser_form',function(ref){motorpresse.elements.ListsBrandTreeElement.initForm(ref);},1);ape.Listeners.addListener('is_brandtree_list_form',function(ref){motorpresse.elements.ListsBrandTreeElement.initFormSelects(ref);},1);ape.ns("motorpresse.elements");motorpresse.elements.vBulletinLogin={ajaxUrl:"/community/?do=apeapi",params:{username:null,password:null,func:'login'},form:jQuery(),phpFoxLoginDone:false,init:function(ref){this.form=ref;var self=this;jQuery('input[type=submit]',this.form).unbind('click.vbulletinlogin');jQuery('input[type=submit]',this.form).bind('click.vbulletinlogin',function(){return self.onSubmit();});},onSubmit:function(){if(this.phpFoxLoginDone){return true;}var self=this;this.params.username=jQuery('input#vb_login_username',this.form).val();this.params.password=jQuery('input#vb_login_password',this.form).val();jQuery('input',this.form).attr('disabled','disabled');jQuery.ajax({url:this.ajaxUrl,data:this.params,type:'post',dataType:'json',success:function(data,status){jQuery('input',self.form).removeAttr('disabled');self.phpFoxLoginDone=true;self.form.submit();}});return false;}};ape.Listeners.addListener('is_vbulletin_login',function(ref){motorpresse.elements.vBulletinLogin.init(ref);},2);ape.ns("motorpresse.elements");motorpresse.elements.ModelsElement={init:function(ref){ref.find('.filter input').bind('change.changeSorting',{container:ref},this.changeSorting);ref.find('.is_models_overview_default').attr('checked','checked');this.bindInnerEvents(ref.find('.innen'));},bindInnerEvents:function(ref){ref.find('.abschnitt').bind('click.openGroup',{container:ref},this.openGroup);},openGroup:function(event){if(jQuery(this).hasClass('geoeffnet')){return false;}event.data.container.find('.geoeffnet').removeClass('geoeffnet').addClass('geschlossen').next().hide();jQuery(this).removeClass('geschlossen').addClass('geoeffnet').next().show();$(window).scrollTop(jQuery(this).offset().top);return false;},changeSorting:function(event){var ajaxUrl=jQuery(this).val();jQuery.ajax({url:ajaxUrl,type:'post',dataType:'html',success:function(data,status){var newContent=jQuery(data).find('.innen');motorpresse.elements.ModelsElement.bindInnerEvents(newContent);event.data.container.find('.innen').replaceWith(newContent);}});}};ape.Listeners.addListener('is_models_overview_box',function(ref){motorpresse.elements.ModelsElement.init(ref);},2);ape.ns("motorpresse.elements");motorpresse.elements.BrandTreeFastSelect={_config:{},brandsLoaded:false,selectedBrand:null,init:function(ref){ref.each(function(){$('#dropdown_marke').unbind('click.dropdown_marke').bind('click.dropdown_marke',function(){if($('#auswahl_marke').css('display')=='none'){$(this).addClass('mehr');$('#dropdown_baureihe').removeClass('mehr');$('#auswahl_marke').show();$('#auswahl_baureihe').hide();var self=motorpresse.elements.BrandTreeFastSelect;self.showOverlay();if(!self.brandsLoaded){$(this).removeClass('is_ad_trigger').unbind('click.ape_ad_trigger');self.loadBrands();self.brandsLoaded=true;}}else{$(this).removeClass('mehr');$('#auswahl_marke').hide();motorpresse.elements.BrandTreeFastSelect.hideOverlay();}});$('#dropdown_baureihe').unbind('click.dropdown_baureihe').bind('click.dropdown_baureihe',function(){if($(this).attr('class')=='dropdown aktiv'||$(this).attr('class')=='dropdown aktiv mehr'){if($('#auswahl_baureihe').css('display')=='none'){$(this).addClass('mehr');$('#dropdown_marke').removeClass('mehr');$('#auswahl_baureihe').show();$('#auswahl_marke').hide();motorpresse.elements.BrandTreeFastSelect.showOverlay();}else{$(this).removeClass('mehr');$('#auswahl_baureihe').hide();motorpresse.elements.BrandTreeFastSelect.hideOverlay();}}});});},showOverlay:function(){if($('#is_fastSelectOverlay').length>0){return;}else{$('#main').append('<div id="is_fastSelectOverlay" style="z-index:3;width:100%;height:100%;position:fixed;left:0px;top:0px;background:none;"></div>');$('#is_fastSelectOverlay').unbind('click.closeFastSelect').bind('click.closeFastSelect',function(){$('#auswahl_marke').hide();$('#dropdown_marke').removeClass('mehr');$('#auswahl_baureihe').hide();$('#dropdown_baureihe').removeClass('mehr');$(this).remove();});}},hideOverlay:function(){$('#is_fastSelectOverlay').unbind('click.closeFastSelect').remove();},loadBrands:function(){var self=motorpresse.elements.BrandTreeFastSelect;$.ajax({url:self._config.ajaxURL_Brands,type:'GET',dataType:'json',success:function(json){var colums=Math.ceil(json.length/self._config.maxRows);var maxRows=self._config.maxRows;if(Math.ceil(json.length/self._config.maxRows)>self._config.maxCols){maxRows=Math.ceil(json.length/self._config.maxCols);colums=self._config.maxCols;}var insertMarkenString='';var count=0;for(var i=0;i<json.length;i++){insertMarkenString+='<li>';insertMarkenString+='<a href="'+json[i].URL+'" id="Fastselect_Marke_ID__'+json[i].Marke_ID+'">'+json[i].Bild+'<span>'+json[i].Marke_Name+'</span></a>';insertMarkenString+='</li>';count++;if(count>=maxRows&&json.length>(i+1)){insertMarkenString+='</ul><ul>';count=0;}}$('.is_brandtreefastselect div div.auswahl_marke').addClass('size_'+colums);$('.is_brandtreefastselect div div.auswahl_marke div.innen').html('<ul>'+insertMarkenString+'</ul>');$('#auswahl_marke a').click(function(){$('#auswahl_marke a').removeClass('ausgewaehlt');$(this).addClass('ausgewaehlt');$('#auswahl_marke').hide();$('#dropdown_marke').removeClass('mehr');$('#dropdown_baureihe').addClass('aktiv');var self=motorpresse.elements.BrandTreeFastSelect;self.selectedBrand=$(this).attr('id').split('__').pop();self.loadSeries();$('#dropdown_baureihe').click();return false;});}});},loadSeries:function(){var self=motorpresse.elements.BrandTreeFastSelect;for(var s=1;s<=6;s++){$('.is_brandtreefastselect div div.auswahl_baureihe').removeClass('size_'+s);}$('.is_brandtreefastselect div div.auswahl_baureihe div.innen').html('<ul><li><span class="loading">Loading...</span></li></ul>');$.ajax({url:self._config.ajaxURL_Series,data:{Marke_ID:self.selectedBrand},type:'GET',dataType:'json',success:function(json){var insertBaureihenString='';var count=0;var Marke_URL=$('#Fastselect_Marke_ID__'+self.selectedBrand).attr('href');json.unshift({'URL':Marke_URL,'Titel':'Alle Baureihen'});for(var i=0;i<json.length;i++){insertBaureihenString+='<li>';insertBaureihenString+='<a href="'+json[i].URL+'">'+json[i].Titel+'</a>';insertBaureihenString+='</li>';count++;if(count>=self._config.maxRows&&json.length>(i+1)){insertBaureihenString+='</ul><ul>';count=0;}}var colums=Math.ceil(json.length/self._config.maxRows);$('.is_brandtreefastselect div div.auswahl_baureihe').addClass('size_'+colums);$('.is_brandtreefastselect div div.auswahl_baureihe div.innen').html('<ul>'+insertBaureihenString+'</ul>');}});},brandSelect:jQuery(),seriesSelect:jQuery(),mobileSubmit:jQuery(),brandSelected:false,seriesSelected:false,initMobile:function(ref){var self=this;this.brandSelect=jQuery('#brand',ref);this.seriesSelect=jQuery('#series',ref);jQuery.ajax({url:this._config.ajaxURL_Brands,type:'GET',dataType:'json',context:this,success:function(json){this.brandSelect.html("");this.brandSelect.append('<option value="0">Bitte wählen...</option>');for(var i=0,j=json.length;i<j;i++){var obj=json[i];this.brandSelect.append('<option value="'+obj.URL+'" brand="'+obj.Marke_ID+'">'+obj.Marke_Name+'</option>');}this.brandSelected=false;}});function getSeries(){jQuery.ajax({url:self._config.ajaxURL_Series,data:{Marke_ID:jQuery('[value="'+self.brandSelect.val()+'"]').attr('brand')},type:'GET',dataType:'json',context:self,success:function(json){this.seriesSelect.html("");this.seriesSelect.append('<option value="0">Bitte wählen...</option>');for(var i=0,j=json.length;i<j;i++){var obj=json[i];this.seriesSelect.append('<option value="'+obj.URL+'">'+obj.Titel+'</option>');}this.seriesSelected=false;}});}this.brandSelect.unbind('change.mobile').bind('change.mobile',function(){if(jQuery(this).val()=='0'){jQuery('.is_submit',ref).addClass('subtile');jQuery('.is_submit span',ref).html('Automarke wählen');jQuery('.is_series',ref).hide();self.brandSelected=false;return;}self.brandSelected=true;jQuery('.is_series',ref).show();getSeries();jQuery('.is_submit',ref).removeClass('subtile');jQuery('.is_submit span',ref).html('Automarke öffnen');});this.seriesSelect.unbind('change.mobile').bind('change.mobile',function(){if(jQuery(this).val()=='0'){jQuery('.is_submit span',ref).html('Automarke öffnen');self.seriesSelected=false;return;}self.seriesSelected=true;jQuery('.is_submit span',ref).html('Baureihe öffnen');});jQuery('.is_submit',ref).unbind('click.mobile').bind('click.mobile',function(){if(self.seriesSelected){window.location=self.seriesSelect.val();}else if(self.brandSelected){window.location=self.brandSelect.val();}});}};ape.Listeners.addListener('is_brandtreefastselect',motorpresse.elements.BrandTreeFastSelect.init,1);ape.Listeners.addListener('is_brandtreefastselect_mobile',function(ref){motorpresse.elements.BrandTreeFastSelect.initMobile(ref);},1);ape.Namespace('motorpresse.elements.SearchDetailedElement');motorpresse.elements.SearchDetailedElement={ref:null,google:{channel:'',pubId:''},init:function(ref){var self=this;this.ref=ref;this.updatehitsButton();jQuery('.filter_links input:checkbox:not(#hits)',ref).bind('change',function(){if(!jQuery(this).next().hasClass('button_inaktiv')){return;}jQuery(this).next().toggleClass('selected');self.updatehitsButton();});jQuery('.filter_links #hits',ref).change(function(){if(!jQuery(this).next().hasClass('button_inaktiv')){return;}jQuery(this).next().toggleClass('selected');jQuery('.filter_links input:checkbox:checked:not(#hits)',ref).each(function(){jQuery(this).trigger('click');jQuery(this).next().removeClass('selected');});});jQuery('.filter_rechts input:checkbox',ref).change(function(){jQuery(this).next().toggleClass('selected');});jQuery('label',ref).click(function(){var id=jQuery(this).attr('for');var checkbox=jQuery('#'+id,ref);if(checkbox.is(':checked')){checkbox.attr('checked',false);}else{checkbox.attr('checked',true);}checkbox.trigger('change');jQuery('form',ref).submit();return false;});},updatehitsButton:function(){if(jQuery('.filter_links input:checked:not(#hits)',this.ref).length>0){jQuery('#hits').next().removeClass('selected');}else{jQuery('#hits').next().addClass('selected');}},initGoogle:function(ref){var pageOptions={'pubId':this.google.pubId,'query':jQuery('#as_q').val(),'channel':this.google.channel,'hl':'de'};if(pageOptions.query==='Suche'){return;}var adblock={'container':'is_google_search','number':'3','width':'560px','fontSizeTitle':'13px','fontSizeDescription':'10px','fontSizeDomainLink':'10px','colorTitleLink':'#C20C06','colorText':'#333333','colorDomainLink':'#C20C06','colorBackground':'#FCFCFC','colorBorder':'#FCFCFC'};new google.ads.search.Ads(pageOptions,adblock);}};ape.Listeners.addListener('is_searchform',function(ref){motorpresse.elements.SearchDetailedElement.init(ref);},2);ape.ns("motorpresse.elements");motorpresse.elements.MagazineArchiveElement={initSelector:function(ref){jQuery(ref).unbind('change.mag_archive').bind('change.mag_archive',function(event){var query='?jahr='+jQuery(this+':selected').val();window.location.href=query;});}};ape.Listeners.addListener('is_magazinearchive_selector',function(ref){motorpresse.elements.MagazineArchiveElement.initSelector(ref);},2);ape.ns("motorpresse.elements");motorpresse.elements.Co2Calculator={_config:{},init:function(ref){ref.each(function(){var self=motorpresse.elements.Co2Calculator;$('.is_co2rechner_submit_fahrzeug').bind('click.fahrzeug',function(){$('#co2_rechner_form_fahrzeug').submit();});$('.is_co2rechner_submit_ausstoss').bind('click.ausstoss',function(){$('#co2_rechner_form_ausstoss').submit();});$('.is_brands_select').each(function(i,object){self.loadBrands();});});},initBrands:function(ref){ref.each(function(){jQuery(this).unbind('change.co2_brands').bind('change.co2_brands',motorpresse.elements.Co2Calculator.loadSeries);});},initSeries:function(ref){ref.each(function(){jQuery(this).unbind('change.co2_series').bind('change.co2_series',motorpresse.elements.Co2Calculator.loadModels);});},initSubmit_fahrzeug:function(ref){ref.each(function(){jQuery(this).bind('click.submit',function(){$('#co2_rechner_form_fahrzeug').submit();});});},initSubmit_ausstoss:function(ref){ref.each(function(){jQuery(this).bind('click.submit',function(){$('#co2_rechner_form_ausstoss').submit();});});},loadBrands:function(){var self=motorpresse.elements.Co2Calculator;$.ajax({url:self._config.ajaxURL_Brands,type:'GET',dataType:'json',success:function(json){$('.is_brands_select').html('<option value="0">Bitte wählen</option>');var selected='';var preselect=false;for(var i=0;i<json.length;i++){if(json[i].Marke_ID==self._config.selected_Brand){selected='selected="selected"';preselect=true;}$('.is_brands_select').append('<option '+selected+' value="'+json[i].Marke_ID+'">'+json[i].Marke_Name+'</option>');selected='';}if(preselect){motorpresse.elements.Co2Calculator.loadSeries();}$('.is_brands_select').attr('disabled',false);}});},loadSeries:function(){var self=motorpresse.elements.Co2Calculator;if(parseInt($('#co2_marke').val(),10)===0){$('.is_series_select').html('<option value="0"> &mdash; </option>').attr('disabled',true);return;}$.ajax({url:self._config.ajaxURL_Series,data:{Marke_ID:$('#co2_marke').val()},type:'GET',dataType:'json',success:function(json){$('.is_series_select').html('<option value="0">Bitte wählen</option>');var selected='';var preselect=false;for(var i=0;i<json.length;i++){if(json[i].Baureihe_ID==self._config.selected_Serie){selected='selected="selected"';preselect=true;}$('.is_series_select').append('<option '+selected+' value="'+json[i].Baureihe_ID+'">'+json[i].Titel+'</option>');selected='';}if(preselect){motorpresse.elements.Co2Calculator.loadModels();}$('.is_series_select').attr('disabled',false);}});},loadModels:function(){var self=motorpresse.elements.Co2Calculator;if(parseInt($('#co2_baureihe').val(),10)===0){$('.is_models_select').html('<option value="0"> &mdash; </option>').attr('disabled',true);return;}$.ajax({url:self._config.ajaxURL_Models,data:{Baureihe_ID:$('#co2_baureihe').val()},type:'GET',dataType:'json',success:function(json){$('.is_models_select').html('<option value="0">Bitte wählen</option>');var selected='';for(var i=0;i<json.length;i++){if(json[i].Modell_ID==self._config.selected_Model){selected='selected="selected"';}$('.is_models_select').append('<option '+selected+' value="'+json[i].Modell_ID+'">'+json[i].Titel+'</option>');selected='';}$('.is_models_select').attr('disabled',false);}});}};ape.Listeners.addListener('is_co2rechner_form',motorpresse.elements.Co2Calculator.init,1);ape.Listeners.addListener('is_brands_select',motorpresse.elements.Co2Calculator.initBrands,1);ape.Listeners.addListener('is_series_select',motorpresse.elements.Co2Calculator.initSeries,1);ape.Listeners.addListener('is_co2rechner_submit_fahrzeug',motorpresse.elements.Co2Calculator.initSubmit_fahrzeug,1);ape.Listeners.addListener('is_co2rechner_submit_ausstoss',motorpresse.elements.Co2Calculator.initSubmit_ausstoss,1);ape.ns("motorpresse.elements");motorpresse.elements.WissenstestElement={ajaxUrl:null,ajaxUrlForm:null,ajaxUrlHelp:null,ajaxUrlQuestions:null,success:false,lightbox:false,finished:false,questions:jQuery(),answers:[],activeQuestion:0,ref:jQuery(),resolution:jQuery(),startScreen:jQuery(),questionsScreen:jQuery(),errorScreen:jQuery(),init:function(ref){this.ref=jQuery(ref);this.questions=jQuery('.is_autokenner_question',ref);this.startScreen=jQuery('.is_autokenner_start_screen',ref);this.questionsScreen=jQuery('.is_autokenner_question_screen',ref);this.errorScreen=jQuery('.is_autokenner_fehler',ref);this.successScreen=jQuery('.is_autokenner_success',ref);this.resolution=jQuery('.is_autokenner_resolution',ref);this.loadQuestions();},loadQuestions:function(){var self=this;jQuery.ajax({url:this.ajaxUrlQuestions,method:'post',dataType:'html',success:function(data){jQuery('.is_question_insert_target',self.questionsScreen).before(data);motorpresse.elements.WissenstestElement.initPrevQuestion(jQuery('.is_autokenner_question_prev'));motorpresse.elements.WissenstestElement.initNextQuestion(jQuery('.is_autokenner_question_next'));motorpresse.elements.WissenstestElement.initFinish(jQuery('.is_autokenner_question_finish'));motorpresse.elements.WissenstestElement.initQuestionAnswer(jQuery('.is_autokenner_question_answer'));motorpresse.elements.WissenstestElement.initQuestionHelp(jQuery('.is_autokenner_help'));motorpresse.elements.AdElement.Ad.adTrigger(jQuery('.is_ad_trigger'));self.questions=jQuery('.is_autokenner_question',self.ref);self.initHash();}});},initHash:function(){var hash=window.location.hash;if(hash){hash=hash.replace('#','');this.answers=hash.split(',');for(var i=0;i<this.answers.length;i++){if(this.answers[i]!==''){var answer=jQuery('#autokenner_question_'+i+'_answer_'+this.answers[i]);if(answer.length>0){this.processAnswer(answer);}}}this.startScreen.hide();jQuery('.is_autokenner_text').hide();this.questionsScreen.show();}},next:function(){this.gotoQuestion(this.activeQuestion+1);},prev:function(){this.gotoQuestion(this.activeQuestion-1);},gotoQuestion:function(index){if(this.questions[index]){jQuery(this.questions[this.activeQuestion]).hide();this.activeQuestion=parseInt(index,0);jQuery(this.questions[this.activeQuestion]).show();}jQuery('.is_question_insert_target').show();this.errorScreen.hide();},processAnswer:function(answer){var otherAnswers=answer.parent().find('div.checked');otherAnswers.removeClass('checked');answer.addClass('checked');var letter=jQuery('label > b',answer).html();var questionIndex=parseInt(jQuery('input',answer).attr('name').replace('frage',''),0);var resolutionObj=jQuery('a[id="autokenner_question_'+questionIndex+'"]',this.resolution);resolutionObj.parent().removeClass('fehler');resolutionObj.html(letter);this.updateHash(questionIndex,letter);if(this.finished){var self=this;this.checkAnswers(this.answers,function(){self.inProgressCheck(answer);});}},inProgressCheck:function(answer){var errors=jQuery('.fehler',this.resolution);if(errors.length===0){this.onSuccess({success:true});}},updateHash:function(index,letter){this.answers[index]=letter;window.location='#'+this.answers.join(',');},initPrevQuestion:function(ref){var self=this;ref.unbind('click.autokenner');ref.bind('click.autokenner',function(){self.prev();});},initNextQuestion:function(ref){var self=this;ref.unbind('click.autokenner');ref.bind('click.autokenner',function(){self.next();});},initStartButton:function(ref){var self=this;ref.unbind('click.autokenner');ref.bind('click.autokenner',function(){self.startScreen.hide();self.questionsScreen.show();jQuery('.is_autokenner_text').hide();});},initQuestionJumpButton:function(ref){var self=this;ref.unbind('click.autokenner');ref.bind('click.autokenner',function(){var index=parseInt(jQuery(this).attr('id').replace('autokenner_question_',''),0);self.gotoQuestion(index);});},initQuestionJumpFirstButton:function(ref){var self=this;ref.unbind('click.autokenner');ref.bind('click.autokenner',function(){self.gotoQuestion(0);});},initQuestionAnswer:function(ref){var self=this;ref.unbind('click.autokenner');ref.bind('click.autokenner',function(){self.processAnswer(jQuery(this));});},initFinish:function(ref){var self=this;ref.unbind('click.autokenner');ref.bind('click.autokenner',function(){self.checkAnswers(self.answers);});},initFinishFormButton:function(ref){var self=this;ref.unbind('click.autokenner');ref.bind('click.autokenner',function(){self.loadSuccessForm();});},initQuestionHelp:function(ref){var self=this;ref.unbind('click.autokenner');ref.bind('click.autokenner',function(){self.loadHelp(parseInt(jQuery(this).attr('id').replace('autokenner_help_',''),0));});},loadHelp:function(index){if(!this.lightbox){var self=this;jQuery.ajax({url:this.ajaxUrlHelp,method:'post',data:{questionIndex:index},dataType:'html',success:function(data){self.lightbox=jQuery(data);jQuery('body').append(self.lightbox);self.center(self.lightbox);motorpresse.elements.AdElement.Ad.adTrigger(jQuery('.is_ad_trigger'));jQuery('.is_close',self.lightbox).bind('click',function(){self.lightbox.remove();self.lightbox=false;});}});}},checkAnswers:function(answers,customCallback){var self=this;jQuery.ajax({url:this.ajaxUrl,method:'post',data:{answers:answers},dataType:'json',success:function(data){if(data.success){self.onSuccess(data,customCallback);}else{self.onError(data,customCallback);}motorpresse.elements.AdElement.Ad.adTrigger(jQuery('.is_ad_trigger'));}});},onError:function(data,customCallback){this.finished=true;var errors=data.errors;for(var index in errors){if(errors[index]===true){jQuery('#autokenner_question_'+index).parent().addClass('fehler');}}if(customCallback){customCallback();return;}jQuery(this.questions[this.activeQuestion]).hide();jQuery('.is_question_insert_target').hide();this.errorScreen.show();},onSuccess:function(data,customCallback){this.finished=true;if(!data.success){this.onError(data);}if(customCallback){customCallback();return;}this.errorScreen.hide();jQuery('.is_question_insert_target').hide();jQuery(this.questions[this.activeQuestion]).hide();jQuery('.is_autokenner_question_jump').unbind('click.autokenner');this.successScreen.show();this.success=true;},loadSuccessForm:function(){if(this.success){var self=this;jQuery.ajax({url:this.ajaxUrlForm,method:'post',data:{freitextname:'Loesungssatz',freitexteingabe:this.answers.join('')},dataType:'html',success:function(data){self.successScreen.hide();self.questionsScreen.hide();self.startScreen.html(data);self.startScreen.show();motorpresse.elements.AdElement.Ad.adTrigger(jQuery('.is_ad_trigger'));motorpresse.elements.Form.Captcha.init(jQuery('.is_captcha'));jQuery('.is_submit').bind('click.submit',function(e){self.submitForm(jQuery(this));});}});}},submitForm:function(button){if(jQuery('input[name=recaptcha_response_field]').val()===''){alert('Die eingegebene Sicherheitsabfrage ist nicht korrekt!');return false;}var url=jQuery(button).parent().parent().parent().attr('action');var values=ape.Form.getValuesOf($(button).parent().parent().parent());var self=this;jQuery.ajax({type:"POST",url:url,data:values,dataType:"text",success:function(data){self.startScreen.html(data);motorpresse.elements.AdElement.Ad.adTrigger(jQuery('.is_ad_trigger'));motorpresse.elements.Form.Captcha.init(jQuery('.is_captcha'));jQuery('.is_submit').bind('click.submit',function(e){self.submitForm(jQuery(this));});}});return true;},center:function(item){item.css('position','fixed');item.css('top',(jQuery(window).height()-item.height())/2+'px');item.css('left',(jQuery(window).width()-item.width())/2+'px');}};ape.Listeners.addListener('is_autokenner',function(ref){motorpresse.elements.WissenstestElement.init(ref);},2);ape.Listeners.addListener('is_autokenner_start_button',function(ref){motorpresse.elements.WissenstestElement.initStartButton(ref);},2);ape.Listeners.addListener('is_autokenner_question_prev',function(ref){motorpresse.elements.WissenstestElement.initPrevQuestion(ref);},2);ape.Listeners.addListener('is_autokenner_question_next',function(ref){motorpresse.elements.WissenstestElement.initNextQuestion(ref);},2);ape.Listeners.addListener('is_autokenner_question_finish',function(ref){motorpresse.elements.WissenstestElement.initFinish(ref);},2);ape.Listeners.addListener('is_autokenner_finish',function(ref){motorpresse.elements.WissenstestElement.initFinishFormButton(ref);},2);ape.Listeners.addListener('is_autokenner_question_jump',function(ref){motorpresse.elements.WissenstestElement.initQuestionJumpButton(ref);},2);ape.Listeners.addListener('is_autokenner_question_jumpFirst',function(ref){motorpresse.elements.WissenstestElement.initQuestionJumpFirstButton(ref);},2);ape.Listeners.addListener('is_autokenner_question_answer',function(ref){motorpresse.elements.WissenstestElement.initQuestionAnswer(ref);},2);ape.Listeners.addListener('is_autokenner_help',function(ref){motorpresse.elements.WissenstestElement.initQuestionHelp(ref);},2);ape.ns("motorpresse.elements");motorpresse.elements.VideoTeaser={_config:{},activeVideoID:null,selectors:{thumbs:'div.thumbnails div.eintrag',thumbs_play:'span.play',vorschau_bild:'div.player > a > img',vorschau_a:'div.player > a',player:'div.player',dachzeile:'em',ueberschrift:'strong',thumbs_click:'a',bigView:'.grossansicht',bigView_container:'.grossansicht .container',bigView_close:'.grossansicht .close'},container:jQuery(),vorschau:jQuery(),thumbs:jQuery(),init:function(ref){ref.each(function(){var self=motorpresse.elements.VideoTeaser;self.activeVideoID=self._config.activeVideoID;self.container=jQuery('#'+self._config.box_id);self.thumbs=jQuery(self.selectors.thumbs,self.container);self.vorschau=jQuery(self.selectors.vorschau,self.container);self.initListeners();});},initListeners:function(){var self=motorpresse.elements.VideoTeaser;jQuery(self.selectors.thumbs_click,self.thumbs).unbind('click.videoTeaser').bind('click.videoTeaser',function(){self.onThumbClick(jQuery(this).find(self.selectors.thumbs_play));});jQuery(self.selectors.vorschau_a,self.container).unbind('click.videoTeaser').bind('click.videoTeaser',function(){self.onPlayClick(jQuery(this));});jQuery(self.selectors.bigView_close,self.container).unbind('click.videoTeaser').bind('click.videoTeaser',function(){self.onCloseClick(jQuery(this).find(self.selectors.thumbs_play));});},onThumbClick:function(playButton){var self=motorpresse.elements.VideoTeaser;var currentID=playButton.attr('id');currentID=currentID.replace(self._config.box_id+'_','');if(typeof self._config.data[currentID]!=='undefined'){self.setActiveItem(self._config.data[currentID]);}},onCloseClick:function(){this.container.find(this.selectors.bigView).hide();this.container.removeClass("aktuelle_videos_abstand");},onPlayClick:function(){if(typeof this._config.data[this.activeVideoID]!=='undefined'){var activeItem=this._config.data[this.activeVideoID];}else{return;}var additionalAdTargetingParams=activeItem.additionalAdTargetingParams;if(!window.frn046adxtra){window.frn046adxtra="";}var frn046enrich=(typeof window.pt027bw=='undefined')?"&band=256"+window.frn046adxtra:"&band="+window.pt027bw+window.frn046adxtra;frn046enrich=(typeof window.frn046tie=='undefined')?"&tie=free"+frn046enrich:"&tie="+window.frn046tie+frn046enrich;if(additionalAdTargetingParams===''){additionalAdTargetingParams='site='+this._config.param_site+'&affiliate='+this._config.param_affiliate+'&prod='+this._config.param_prod+'&tbl=channel'+frn046enrich;}else{additionalAdTargetingParams=additionalAdTargetingParams+frn046enrich;}this.container.find(this.selectors.bigView).show();this.container.addClass("aktuelle_videos_abstand");var videoTag='<object id="myExperienceSidecol" class="BrightcoveExperience"> ';videoTag+='<param name="bgcolor" value="#FFFFFF"/> ';videoTag+='<param name="width" value="498"/> ';videoTag+='<param name="height" value="420"/> ';videoTag+='<param name="playerID" value="'+this._config.playerID+'"/> ';videoTag+='<param name="playerKey" value="'+this._config.playerKey+'"/> ';videoTag+='<param name="publisherID" value="'+this._config.publisherID+'"/> ';videoTag+='<param name="isVid" value="true"/> ';videoTag+='<param name="isUI" value="true"/> ';videoTag+='<param name="wmode" value="opaque" /> ';videoTag+='<param name="dynamicStreaming" value="true" />';videoTag+='<param name="optimizedContentLoad" value="true"/> ';videoTag+='<param name="@videoPlayer" value="'+this.activeVideoID+'"/> ';videoTag+='<param name="additionalAdTargetingParams" value="'+additionalAdTargetingParams+'" /> ';videoTag+='<param name="flashVars" value="@videoPlayer='+this.activeVideoID+'&playerID='+this._config.playerID+'&domain=embed&" />';videoTag+='<param name="linkBaseURL" value="'+window.location.href+'?bcpid='+this._config.playerID+'&bctid='+this.activeVideoID+'" />';videoTag+='<embed src="http://c.brightcove.com/services/viewer/federated_f9/'+this._config.playerID+'?isVid=1&publisherID='+this._config.publisherID+'"';videoTag+='bgcolor="#FFFFFF" ';videoTag+='flashVars="@videoPlayer='+this.activeVideoID+'&playerID='+this._config.playerID+'&playerKey='+this._config.playerKey+'&domain=embed&" ';videoTag+='base="http://admin.brightcove.com"   ';videoTag+='name="myExperienceSidecol" ';videoTag+='type="application/x-shockwave-flash" ';videoTag+='width="498" ';videoTag+='height="420" ';videoTag+='seamlesstabbing="false" ';videoTag+='allowFullScreen="true" ';videoTag+='swLiveConnect="true" ';videoTag+='allowScriptAccess="always" ';videoTag+='linkBaseURL="'+window.location.href+'?bcpid='+this._config.playerID+'&bctid='+this.activeVideoID+'" ';videoTag+='additionalAdTargetingParams="'+additionalAdTargetingParams+'" ';videoTag+='pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">';videoTag+='</embed>  ';videoTag+='</object>  ';this.container.find(this.selectors.bigView_container).html(videoTag);runMobileCompatibilityScript('myExperienceSidecol','myExperienceSidecol_html5');brightcove.createExperiences();},setActiveItem:function(data){var self=motorpresse.elements.VideoTeaser;if(data.Video_ID==self.activeVideoID){return;}self.activeVideoID=data.Video_ID;var newPlayerHtml=jQuery('<a href="javascript:;">'+data.Vorschau_Bild.replace(/\[QUOTES\]/g,'"')+'<span class="play">play</span></a>');self.container.find(self.selectors.player).empty();self.container.find(self.selectors.player).html(newPlayerHtml);self.container.find(self.selectors.dachzeile).html(data.Dachzeile.replace(/\[QUOTES\]/g,'"'));self.container.find(self.selectors.ueberschrift).html(data.Ueberschrift.replace(/\[QUOTES\]/g,'"'));self.initListeners();}};ape.Listeners.addListener('is_VideoTeaser',motorpresse.elements.VideoTeaser.init,1);ape.ns("motorpresse.elements");motorpresse.elements.ArticleVideo={_config:{},_container:'',init:function(ref){this._container=ref.attr('id');var self=motorpresse.elements.ArticleVideo;var playerID=self._config.playerID;var publisherID=self._config.publisherID;var param_site=self._config.param_site;var param_affiliate=self._config.param_affiliate;var param_prod=self._config.param_prod;var artikelurl=self._config.artikelurl;var videoID=self._config.videoID;var videoTag=self.generateVideoTag(playerID,publisherID,param_site,param_affiliate,param_prod,artikelurl,videoID,'');jQuery('#'+self._container).html(videoTag);brightcove.createExperiences();},generateVideoTag:function(playerID,publisherID,param_site,param_affiliate,param_prod,artikelurl,videoID,extratag){var additionalAdTargetingParams='';if(!window.frn046adxtra){window.frn046adxtra="";}var frn046enrich=(typeof window.pt027bw=='undefined')?"&band=256"+window.frn046adxtra:"&band="+window.pt027bw+window.frn046adxtra;frn046enrich=(typeof window.frn046tie=='undefined')?"&tie=free"+frn046enrich:"&tie="+window.frn046tie+frn046enrich;if(additionalAdTargetingParams===''){additionalAdTargetingParams=escape('site='+param_site+'&affiliate='+param_affiliate+'&prod='+param_prod+'&tbl=channel'+frn046enrich);}else{additionalAdTargetingParams=escape(additionalAdTargetingParams+frn046enrich);}var width=560;var height=420;if(this._config.mobile){width=jQuery('#'+this._container).css('width').replace('px','');}var random=Math.round(Math.random()*100);var videoTag='<object id="myExperience_'+random+'" class="BrightcoveExperience"> ';videoTag+='<param name="bgcolor" value="#FFFFFF"/> ';videoTag+='<param name="width" value="'+width+'"/> ';videoTag+='<param name="height" value="'+height+'"/> ';videoTag+='<param name="playerID" value="'+playerID+'"/> ';videoTag+='<param name="publisherID" value="'+publisherID+'"/> ';videoTag+='<param name="isVid" value="true"/> ';videoTag+='<param name="isUI" value="true"/> ';videoTag+='<param name="dynamicStreaming" value="true" />';videoTag+='<param name="videoSmoothing" value="true" />';videoTag+='<param name="wmode" value="opaque" /> ';videoTag+='<param name="optimizedContentLoad" value="true"/> ';videoTag+='<param name="@videoPlayer" value="'+videoID+'"/> ';videoTag+='<param name="additionalAdTargetingParams" value="'+additionalAdTargetingParams+'" /> ';videoTag+='<param name="flashVars" value="@videoPlayer='+videoID+'&playerID='+playerID+'&domain=embed&videoSmoothing=true&additionalAdTargetingParams='+additionalAdTargetingParams+'" />';videoTag+='<param name="linkBaseURL" value="'+artikelurl+'?bcpid='+playerID+'&bctid='+videoID+'" />';videoTag+='<embed src="http://c.brightcove.com/services/viewer/federated_f9/'+playerID+'?isVid=1&publisherID='+publisherID+'"';videoTag+='bgcolor="#FFFFFF" ';videoTag+='type="application/x-shockwave-flash" ';videoTag+='flashVars="@videoPlayer='+videoID+'&playerID='+playerID+'&domain=embed&videoSmoothing=true" ';videoTag+='base="http://admin.brightcove.com"   ';videoTag+='name="myExperience_'+random+'" ';videoTag+='width="'+width+'" ';videoTag+='height="'+height+'" ';videoTag+='videoSmoothing="true" ';videoTag+='seamlesstabbing="false" ';videoTag+='allowFullScreen="true" ';videoTag+='swLiveConnect="true" ';videoTag+='allowScriptAccess="always" ';videoTag+='linkBaseURL="'+artikelurl+'?bcpid='+playerID+'&bctid='+videoID+'" ';videoTag+='additionalAdTargetingParams="'+additionalAdTargetingParams+'" ';videoTag+='pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">';videoTag+='</embed> ';videoTag+='</object> ';return videoTag;}};ape.Listeners.addListener('is_articlevideocontainer',function(ref){motorpresse.elements.ArticleVideo.init(ref);});ape.Namespace('motorpresse.elements.CommentElement');motorpresse.elements.CommentElement.Spam={ajaxUrl:null,ref:null,init:function(ref){this.ref=ref;var self=this;jQuery(ref).each(function(index,item){item=jQuery(item);item.unbind('click.ape_comment_spam');item.bind('click.ape_comment_spam',function(){self.doSpam(jQuery(this));});});},doSpam:function(item){var self=this;var ajaxUrl=item.attr('rel');jQuery.ajax({url:ajaxUrl,type:'get',dataType:'html',context:jQuery(item),success:function(data,status){if(jQuery('#comment_report_lightbox').length<1){jQuery('#main').append(data);self.center(jQuery('#comment_report_lightbox'));jQuery('#comment_report_lightbox a.is_close').unbind('click.ape_comment_spam');jQuery('#comment_report_lightbox a.is_close').bind('click.ape_comment_spam',function(){jQuery('#comment_report_lightbox').fadeOut('fast',function(){jQuery(this).replaceWith('');});});jQuery('#comment_report_lightbox .is_submit').unbind('click.ape_comment_spam');jQuery('#comment_report_lightbox .is_submit').bind('click.ape_comment_spam',function(){self.doSubmit(jQuery(this));});}}});},doSubmit:function(item){var ajaxUrl=item.attr('rel');var values=ape.Form.getValuesOf(jQuery('#comment_report_lightbox form'));jQuery.ajax({url:ajaxUrl,data:values,type:'post',dataType:'json',context:this,success:function(data,status){if(data.success===true){jQuery('#comment_report_lightbox .formular').html("<p>Vielen Dank für Ihren Hinweis.<br />Das Fenster schließt sich nach 5 Sekunden automatisch.</p>");window.setTimeout(function(){jQuery('#comment_report_lightbox').fadeOut('fast',function(){jQuery(this).replaceWith('');});},5000);}}});},center:function(item){item.css('position','fixed');item.css('top',(jQuery(window).height()-item.height())/2+'px');item.css('left',(jQuery(window).width()-item.width())/2+'px');}};ape.Listeners.addListener('is_spam',function(ref){motorpresse.elements.CommentElement.Spam.init(ref);},2);ape.Namespace('motorpresse.elements.CommentElement');motorpresse.elements.CommentElement.Form={ajaxUrl:null,submit:jQuery(),form:null,isMobile:false,ref:null,init:function(ref,initial){var self=this;this.form=jQuery('form',ref);this.isMobile=jQuery(ref).is('.is_mobile');this.ref=ref;this.submit=jQuery('.is_submit',ref);this.success=jQuery('.is_success',ref).html();jQuery('.is_mobile_input',ref).each(function(index,item){jQuery(item).bind('keyup',ape.Form.mobileInputKeypress);});if(this.success==1){window.location="#kommentare";}this.submit.unbind('click.ape_comment_form');this.submit.bind('click.ape_comment_form',function(){self.onSubmit();return false;});if(this.isMobile){jQuery('#kommentar',ref).unbind('click.comment').bind('click.comment',function(){jQuery('.is_open_close',ref).removeClass('close');});jQuery('.is_close',ref).unbind('click.comment').bind('click.comment',function(){jQuery('.is_mobile_input input',ref).each(function(index,item){jQuery(item).val('');ape.Form.mobileInputKeypress.apply(jQuery(item).parent());});jQuery('.is_mobile_input textarea',ref).each(function(index,item){jQuery(item).val('');ape.Form.mobileInputKeypress.apply(jQuery(item).parent());});jQuery('.is_open_close',ref).addClass('close');});}if(initial===undefined){PHPFOX.add('article_comment_form',function(data,status){self.ref.replaceWith(jQuery(data));self.init(jQuery('.is_comment_form'),true);motorpresse.elements.AdElement.Ad.adTrigger(jQuery('.is_ad_trigger'));},{pagination_page:this.pagination_page});}},onSubmit:function(){var self=this;var values=ape.Form.getValuesOf(this.form);jQuery.ajax({url:this.ajaxUrl,data:values,type:'post',dataType:'html',success:function(data,status){self.ref.replaceWith(jQuery(data));self.init(jQuery('.is_comment_form'),true);motorpresse.elements.AdElement.Ad.adTrigger(jQuery('.is_ad_trigger'));motorpresse.elements.CommentElement.init(jQuery('.is_comment_list'));}});}};ape.Listeners.addListener('is_comment_form',function(ref){motorpresse.elements.CommentElement.Form.init(ref);},2);ape.Namespace('motorpresse.elements.CommentElement');motorpresse.elements.CommentElement.Pager={ajaxUrl:null,ref:null,pagination_page:1,inProgress:false,init:function(ref){this.ref=ref;var self=this;jQuery(ref).each(function(index,item){var items=jQuery('.pagination a',item);for(var i=0;i<items.length;i++){var link=jQuery(items[i]);link.unbind('click.ape_comment_pager');link.bind('click.ape_comment_pager',function(){return self.onClick(jQuery(this));});}});},onClick:function(item){if(item.parent().is('.button_weiter')){this.pagination_page=parseInt(this.pagination_page,10)+1;}else if(item.parent().is('.button_zurueck')){this.pagination_page=parseInt(this.pagination_page,10)-1;}else{this.pagination_page=item.html();}this.gotoPage(this.pagination_page);return false;},gotoPage:function(page){var self=this;if(this.inProgress){return false;}this.inProgress=true;jQuery.ajax({url:this.ajaxUrl,data:{pagination_page:this.pagination_page},type:'post',dataType:'html',success:function(data,status){self.ref.replaceWith(jQuery(data));motorpresse.elements.CommentElement.Rate.init(jQuery('.is_rate'));motorpresse.elements.CommentElement.Spam.init(jQuery('.is_spam'));motorpresse.elements.CommentElement.Pager.init(jQuery('.is_comment_list'));motorpresse.elements.AdElement.Ad.adTrigger(jQuery('.is_ad_trigger'));window.location="#kommentare";self.inProgress=false;}});return true;}};ape.Listeners.addListener('is_comment_list',function(ref){motorpresse.elements.CommentElement.Pager.init(ref);},2);ape.Namespace('motorpresse.elements.CommentElement');motorpresse.elements.CommentElement.Rate={ajaxUrl:null,ref:null,inProgress:false,init:function(ref){var self=this;jQuery(ref).each(function(index,item){item=jQuery(item);item.unbind('click.ape_comment_rate');item.bind('click.ape_comment_rate',function(){jQuery(this).unbind('click.ape_ad_trigger');jQuery(this).unbind('click.ape_comment_rate');self.doRate(jQuery(this));});});},doRate:function(item){var commentid=item.parent().attr('id').replace('is_comment_id_','');if(this.inProgress||this.hasRated(commentid)){return false;}var ajaxUrl=item.attr('rel');var self=this;var content=jQuery(item).html();content=content.replace(/\(/,'');content=content.replace(/\)/,'');jQuery(item).html('('+(parseInt(content,10)+1)+')');jQuery.ajax({url:ajaxUrl,type:'post',dataType:'json',context:jQuery(item),success:function(data,status){self.inProgress=false;var currentCookie=jQuery.cookie("phpfox_comments_rated");if(currentCookie===null){currentCookie='';}currentCookie=currentCookie.split(',');currentCookie.push(commentid);jQuery.cookie("phpfox_comments_rated",currentCookie.join(','),{expires:72,path:'/',domain:window.location.host});}});return true;},hasRated:function(id){var currentCookie=jQuery.cookie("phpfox_comments_rated");if(currentCookie===null){currentCookie='';}currentCookie=currentCookie.split(',');if(jQuery.inArray(id,currentCookie)===-1){return false;}return true;}};ape.Listeners.addListener('is_rate',function(ref){motorpresse.elements.CommentElement.Rate.init(ref);},2);ape.ns("motorpresse.elements");motorpresse.elements.PitchSearch={fields:null,form:null,init:function(ref){motorpresse.elements.PitchSearch.fields={name:jQuery('#sts_name'),zipcode:jQuery('#sts_plz'),city:jQuery('#sts_ort'),district:jQuery('#sts_bundesland'),country:jQuery('#sts_land'),region:jQuery('#sts_region'),type:jQuery('#sts_typ'),benefits:jQuery('#sts_leistungen input'),charge:jQuery('#sts_gebuehr')};var form=jQuery('#apePitchSearch');form.find('input[type="text"]').unbind('keypress.pitch_search_submit').bind('keypress.pitch_search_submit',function(e){if(e.which!='13'){return;}form.trigger('submit.pitch_search');e.preventDefault();});form.find('.button_weiter_form_galerie').unbind('click.pitch_search_submit').bind('click.pitch_search_submit',function(e){form.trigger('submit.pitch_search');e.preventDefault();});form.unbind('submit.pitch_search').bind('submit.pitch_search',function(e){motorpresse.elements.PitchSearch.search();e.preventDefault();});form.find('.is_search_trigger').unbind('change.pitch_search').bind('change.pitch_search',function(e){if(jQuery(this).attr('name')==='d'||jQuery(this).attr('name')==='region'){motorpresse.elements.PitchSearch.fields['country'].val('D');}else if(jQuery(this).attr('name')==='c'){if(jQuery(this).val()!='D'){motorpresse.elements.PitchSearch.fields['district'].val('');motorpresse.elements.PitchSearch.fields['region'].val('');}if(jQuery(this).val()=='D'||!jQuery(this).val()){motorpresse.elements.PitchSearch.fields['district'].removeAttr('disabled');motorpresse.elements.PitchSearch.fields['region'].removeAttr('disabled');}else{motorpresse.elements.PitchSearch.fields['district'].attr('disabled','disabled');motorpresse.elements.PitchSearch.fields['region'].attr('disabled','disabled');}}form.trigger('submit.pitch_search');e.preventDefault();});motorpresse.elements.PitchSearch.form=form;},clearCriterias:function(){for(var fieldName in motorpresse.elements.PitchSearch.fields){var field=motorpresse.elements.PitchSearch.fields[fieldName];if((field.is('input')&&field.attr('type')==='text')||field.is('select')){field.val('');}else if(field.is('input')&&field.attr('type')==='checkbox'){field.attr('checked',false);}}},getCriterias:function(){if(!motorpresse.elements.PitchSearch.form){return null;}return motorpresse.elements.PitchSearch.form.serializeArray();},setCriterias:function(criterias){for(var fieldName in criterias){var fieldValue=criterias[fieldName];if(typeof fieldValue==='undefined'||fieldValue===null){continue;}var field=motorpresse.elements.PitchSearch.fields[fieldName];if(typeof field==='undefined'){continue;}field.val(fieldValue);}},search:function(){var criterias=motorpresse.elements.PitchSearch.getCriterias();if(typeof motorpresse.elements.PitchMap!=='undefined'){motorpresse.elements.PitchMap.update(criterias,true);}if(typeof motorpresse.elements.PitchList!=='undefined'){motorpresse.elements.PitchList.update(criterias);}}};ape.Listeners.addListener('is_apePitchSearch',motorpresse.elements.PitchSearch.init);ape.ns("motorpresse.elements");motorpresse.elements.PitchMap={_config:{},ajaxResultUrl:null,ajaxDetailUrl:null,countries:{},districts:{},cities:{},map:null,markers:{},infoWindow:null,init:function(ref){var conf=motorpresse.elements.PitchMap._config;var mapContainer=jQuery('#mpsPitchMap');motorpresse.elements.PitchMap.ajaxResultUrl=conf.pitch_Map_Result;motorpresse.elements.PitchMap.ajaxDetailUrl=conf.pitch_Map_Details;motorpresse.elements.PitchMap.countries={center:conf.countriesCenter,zoom:conf.countriesZoom};motorpresse.elements.PitchMap.districts={center:conf.districtsCenter,zoom:conf.districtsZoom};motorpresse.elements.PitchMap.cities={center:conf.citiesCenter,zoom:conf.citiesZoom};mapContainer.empty();motorpresse.elements.PitchMap.map=new google.maps.Map(document.getElementById(mapContainer.attr('id')),{center:new google.maps.LatLng(51.165,10.455278),mapTypeId:google.maps.MapTypeId.TERRAIN,zoom:5});google.maps.event.addListenerOnce(motorpresse.elements.PitchMap.map,'tilesloaded',motorpresse.elements.PitchMap.showAll);},showAll:function(){if(!jQuery('#mpsPitchMap_Indicator').hasClass('hide')){return;}motorpresse.elements.PitchMap.clearMarkers();jQuery('#mpsPitchMap_Indicator').removeClass('hide');var bounds=motorpresse.elements.PitchMap.map.getBounds();var zoom=motorpresse.elements.PitchMap.map.getZoom();jQuery.post(motorpresse.elements.PitchMap.ajaxResultUrl,{zoom:zoom},function(response){if(!response){return;}motorpresse.elements.PitchMap.updateMarkers(response.clusters,false);jQuery('#mpsPitchMap_Indicator').addClass('hide');});},update:function(criterias){if(!jQuery('#mpsPitchMap_Indicator').hasClass('hide')){return undefined;}google.maps.event.clearListeners(motorpresse.elements.PitchMap.map,'idle');motorpresse.elements.PitchMap.clearMarkers();if((typeof criterias==='undefined'||criterias===null)&&typeof motorpresse.elements.PitchSearch!=='undefined'){criterias=motorpresse.elements.PitchSearch.getCriterias();}jQuery('#mpsPitchMap_Indicator').removeClass('hide');var bounds=motorpresse.elements.PitchMap.map.getBounds();var zoom=motorpresse.elements.PitchMap.map.getZoom();var params={zoom:zoom,criterias:criterias};jQuery.post(motorpresse.elements.PitchMap.ajaxResultUrl,params,function(response){if(!response){return;}if(response.clusters.length<1){jQuery('#mpsPitchMap_Indicator').addClass('hide');motorpresse.elements.PitchMap.clearMarkers();motorpresse.elements.PitchMap.map.setCenter(new google.maps.LatLng(51.165,10.455278));motorpresse.elements.PitchMap.map.setZoom(4);return;}motorpresse.elements.PitchMap.updateMarkers(response.clusters);jQuery('#mpsPitchMap_Indicator').addClass('hide');return;});return undefined;},updateMarkers:function(markers,fitBounds){var clustererStyles=[{url:'/img/icon/pitch_cluster.png',height:50,width:49,anchor:[6,13],textColor:'white',textSize:11},{url:'/img/icon/pitch_cluster.png',height:50,width:49,anchor:[6,13],textSize:11,textColor:'white'},{url:'/img/icon/pitch_cluster.png',height:50,width:49,anchor:[6,13],textColor:'white',textSize:11}];var clusterer=new MarkerClusterer(motorpresse.elements.PitchMap.map,{},{styles:clustererStyles,batchSizeIE:200});var bounds=new google.maps.LatLngBounds();for(var i=0;i<markers.length;i++){var marker,markerId,position;markerId=markers[i].ID;position=new google.maps.LatLng(markers[i].Lat,markers[i].Lng);marker=new google.maps.Marker({mpsId:markers[i].ID,clickable:true,icon:new google.maps.MarkerImage('/img/icon/pitch.png',new google.maps.Size(47,40)),position:position,visible:true});clusterer.addMarker(marker);google.maps.event.addListener(marker,'click',function(){if(typeof motorpresse.elements.PitchMap.markers[this.mpsId]==='undefined'){return;}jQuery('#mpsPitchMap_Indicator').removeClass('hide');var targetMarker=motorpresse.elements.PitchMap.markers[this.mpsId];jQuery.post(motorpresse.elements.PitchMap.ajaxDetailUrl,{id:this.mpsId},function(response){if(motorpresse.elements.PitchMap.infoWindow){motorpresse.elements.PitchMap.infoWindow.close();}var infoWindow=new google.maps.InfoWindow({content:response});infoWindow.open(motorpresse.elements.PitchMap.map,targetMarker);motorpresse.elements.PitchMap.infoWindow=infoWindow;jQuery('#mpsPitchMap_Indicator').addClass('hide');});});if(marker){motorpresse.elements.PitchMap.markers[markerId]=marker;bounds.extend(marker.position);}}if(typeof fitBounds==='undefined'||fitBounds===true){motorpresse.elements.PitchMap.map.fitBounds(bounds);}},clearMarkers:function(){for(var id in motorpresse.elements.PitchMap.markers){var marker=motorpresse.elements.PitchMap.markers[id];marker.setMap(null);google.maps.event.clearInstanceListeners(marker);delete motorpresse.elements.PitchMap.markers[id];}},panToCountry:function(value,callback){var center,zoom;if(typeof motorpresse.elements.PitchMap.countries.center[value]!=='undefined'){center=motorpresse.elements.PitchMap.countries.center[value].split(',');}if(typeof motorpresse.elements.PitchMap.countries.zoom[value]!=='undefined'){zoom=motorpresse.elements.PitchMap.countries.zoom[value];}else{zoom=8;}var map=motorpresse.elements.PitchMap.map;if(map.getZoom()===zoom&&map.getCenter().equals(new google.maps.LatLng(center[0],center[1]))){callback();}else{map.setZoom(zoom);google.maps.event.addListenerOnce(motorpresse.elements.PitchMap.map,'idle',callback);map.panTo(new google.maps.LatLng(center[0],center[1]));}window.location.href='#mpsPitchMap_Head';},panToDistrict:function(value,callback){var center,zoom;if(typeof motorpresse.elements.PitchMap.districts.center[value]!=='undefined'){center=motorpresse.elements.PitchMap.districts.center[value].split(',');}if(typeof motorpresse.elements.PitchMap.districts.zoom[value]!=='undefined'){zoom=motorpresse.elements.PitchMap.districts.zoom[value];}else{zoom=8;}var map=motorpresse.elements.PitchMap.map;if(map.getZoom()===zoom&&map.getCenter().equals(new google.maps.LatLng(center[0],center[1]))){callback();}else{map.setZoom(zoom);google.maps.event.addListenerOnce(motorpresse.elements.PitchMap.map,'idle',callback);map.panTo(new google.maps.LatLng(center[0],center[1]));}window.location.href='#mpsPitchMap_Head';},panToCity:function(t,callback){if(typeof t==='undefined'){t='';}var center,zoom;if(typeof motorpresse.elements.PitchMap.cities.center[t]!=='undefined'){center=motorpresse.elements.PitchMap.cities.center[t].split(',');}if(typeof motorpresse.elements.PitchMap.cities.zoom[t]!=='undefined'){zoom=motorpresse.elements.PitchMap.cities.zoom[t];}else{zoom=8;}var map=motorpresse.elements.PitchMap.map;if(map.getZoom()===zoom&&map.getCenter().equals(new google.maps.LatLng(center[0],center[1]))){callback();}else{map.setZoom(zoom);google.maps.event.addListenerOnce(motorpresse.elements.PitchMap.map,'idle',callback);map.panTo(new google.maps.LatLng(center[0],center[1]));}window.location.href='#mpsPitchMap_Head';return true;},panToDistrictCity:function(d,t,callback){if(typeof t==='undefined'){t='';}var center,zoom;if(typeof motorpresse.elements.PitchMap.cities.center[t]!=='undefined'){center=motorpresse.elements.PitchMap.cities.center[t].split(',');}else{return motorpresse.elements.PitchMap.panToDistrict(d,callback);}if(typeof motorpresse.elements.PitchMap.cities.zoom[t]!=='undefined'){zoom=motorpresse.elements.PitchMap.cities.zoom[t];}else{zoom=8;}var map=motorpresse.elements.PitchMap.map;if(map.getZoom()===zoom&&map.getCenter().equals(new google.maps.LatLng(center[0],center[1]))){callback();}else{map.setZoom(zoom);google.maps.event.addListenerOnce(motorpresse.elements.PitchMap.map,'idle',callback);map.panTo(new google.maps.LatLng(center[0],center[1]));}window.location.href='#mpsPitchMap_Head';return true;}};ape.Listeners.addListener('is_mpsPitchMap',function(ref){motorpresse.elements.PitchMap.init(ref);});ape.ns("motorpresse.elements");motorpresse.elements.PitchList={ajaxUrl:null,init:function(ref){jQuery(ref).each(function(){motorpresse.elements.PitchList.initList(this);});},initList:function(ref){var container=jQuery(ref),pagination=container.find('div.pagination');motorpresse.elements.PitchList.ajaxUrl=container.children('span:eq(0)').text();pagination.find('a').each(function(){jQuery(this).unbind('click.pitch_list_pagination').bind('click.pitch_list_pagination',function(e){window.location.href='#'+container.find('div.kopfzeile').first().attr('id');var target=jQuery(this).attr('rel');jQuery('#apePitchList').fadeOut(function(){if(typeof motorpresse.elements.PitchSearch!=='undefined'){var criterias=motorpresse.elements.PitchSearch.getCriterias();}else{criterias={};}jQuery.post(target,{criterias:criterias},function(result){container.html(jQuery(result).html());motorpresse.elements.PitchList.init(container.parent().find('.is_pitch_list'));jQuery('#apePitchList').fadeIn();});});e.preventDefault();});});},setCriterias:function(c,d,t){if(typeof motorpresse.elements.PitchSearch!=='undefined'){motorpresse.elements.PitchSearch.clearCriterias();motorpresse.elements.PitchSearch.setCriterias({country:c,district:d,city:t});if(c=='D'){motorpresse.elements.PitchSearch.fields['district'].removeAttr('disabled');motorpresse.elements.PitchSearch.fields['region'].removeAttr('disabled');}else{motorpresse.elements.PitchSearch.fields['district'].val('');motorpresse.elements.PitchSearch.fields['region'].val('');motorpresse.elements.PitchSearch.fields['district'].attr('disabled','disabled');motorpresse.elements.PitchSearch.fields['region'].attr('disabled','disabled');}motorpresse.elements.PitchSearch.search();}return false;},update:function(criterias){jQuery('#apePitchList').fadeOut(function(){jQuery.post(motorpresse.elements.PitchList.ajaxUrl,{criterias:criterias},function(response){jQuery('#apePitchList').replaceWith(response);motorpresse.elements.PitchList.initList(jQuery('#apePitchList'));jQuery('#apePitchList').fadeIn();});});}};ape.Listeners.addListener('is_pitch_list',motorpresse.elements.PitchList.init,1);function ClusterIcon(cluster,styles){cluster.getMarkerClusterer().extend(ClusterIcon,google.maps.OverlayView);this.cluster_=cluster;this.styles_=styles;this.center_=null;this.div_=null;this.sums_=null;this.visible_=false;this.setMap(cluster.getMap());}ClusterIcon.prototype.onAdd=function(){var cClusterIcon=this;this.div_=document.createElement("div");if(this.visible_){this.show();}this.getPanes().overlayMouseTarget.appendChild(this.div_);google.maps.event.addDomListener(this.div_,"click",function(e){var mc=cClusterIcon.cluster_.getMarkerClusterer();google.maps.event.trigger(mc,"click",cClusterIcon.cluster_);google.maps.event.trigger(mc,"clusterclick",cClusterIcon.cluster_);var mz=mc.getMaxZoom();if(mc.getZoomOnClick()){mc.getMap().fitBounds(cClusterIcon.cluster_.getBounds());if(mz&&(mc.getMap().getZoom()>mz)){mc.getMap().setZoom(mz+1);}e.cancelBubble=true;if(e.stopPropagation){e.stopPropagation();}}});google.maps.event.addDomListener(this.div_,"mouseover",function(){var mc=cClusterIcon.cluster_.getMarkerClusterer();google.maps.event.trigger(mc,"mouseover",cClusterIcon.cluster_);});google.maps.event.addDomListener(this.div_,"mouseout",function(){var mc=cClusterIcon.cluster_.getMarkerClusterer();google.maps.event.trigger(mc,"mouseout",cClusterIcon.cluster_);});};ClusterIcon.prototype.onRemove=function(){if(this.div_&&this.div_.parentNode){this.hide();google.maps.event.clearInstanceListeners(this.div_);this.div_.parentNode.removeChild(this.div_);this.div_=null;}};ClusterIcon.prototype.draw=function(){if(this.visible_){var pos=this.getPosFromLatLng_(this.center_);this.div_.style.top=pos.y+"px";this.div_.style.left=pos.x+"px";}};ClusterIcon.prototype.hide=function(){if(this.div_){this.div_.style.display="none";}this.visible_=false;};ClusterIcon.prototype.show=function(){if(this.div_){var pos=this.getPosFromLatLng_(this.center_);this.div_.style.cssText=this.createCss(pos);if(this.cluster_.printable_){this.div_.innerHTML="<img src='"+this.url_+"'><div style='position: absolute; top: 0px; left: 0px; width: "+this.width_+"px;'>"+this.sums_.text+"</div>";}else{this.div_.innerHTML=this.sums_.text;}this.div_.title=this.cluster_.getMarkerClusterer().getTitle();this.div_.style.display="";}this.visible_=true;};ClusterIcon.prototype.useStyle=function(sums){this.sums_=sums;var index=Math.max(0,sums.index-1);index=Math.min(this.styles_.length-1,index);var style=this.styles_[index];this.url_=style.url;this.height_=style.height;this.width_=style.width;this.anchor_=style.anchor;this.anchorIcon_=style.anchorIcon||[parseInt(this.height_/2,10),parseInt(this.width_/2,10)];this.textColor_=style.textColor||"black";this.textSize_=style.textSize||11;this.textDecoration_=style.textDecoration||"none";this.fontWeight_=style.fontWeight||"bold";this.fontStyle_=style.fontStyle||"normal";this.fontFamily_=style.fontFamily||"Arial,sans-serif";this.backgroundPosition_=style.backgroundPosition||"0 0";};ClusterIcon.prototype.setCenter=function(center){this.center_=center;};ClusterIcon.prototype.createCss=function(pos){var style=[];if(!this.cluster_.printable_){style.push('background-image:url('+this.url_+');');style.push('background-size:'+this.width_+'px '+this.height_+'px;');style.push('background-position:'+this.backgroundPosition_+';');}if(typeof this.anchor_==='object'){if(typeof this.anchor_[0]==='number'&&this.anchor_[0]>0&&this.anchor_[0]<this.height_){style.push('height:'+(this.height_-this.anchor_[0])+'px; padding-top:'+this.anchor_[0]+'px;');}else{style.push('height:'+this.height_+'px; line-height:'+this.height_+'px;');}if(typeof this.anchor_[1]==='number'&&this.anchor_[1]>0&&this.anchor_[1]<this.width_){style.push('width:'+(this.width_-this.anchor_[1])+'px; padding-left:'+this.anchor_[1]+'px;');}else{style.push('width:'+this.width_+'px; text-align:center;');}}else{style.push('height:'+this.height_+'px; line-height:'+this.height_+'px; width:'+this.width_+'px; text-align:center;');}style.push('cursor:pointer; top:'+pos.y+'px; left:'+pos.x+'px; color:'+this.textColor_+'; position:absolute; font-size:'+this.textSize_+'px; font-family:'+this.fontFamily_+'; font-weight:'+this.fontWeight_+'; font-style:'+this.fontStyle_+'; text-decoration:'+this.textDecoration_+';');return style.join("");};ClusterIcon.prototype.getPosFromLatLng_=function(latlng){var pos=this.getProjection().fromLatLngToDivPixel(latlng);pos.x-=this.anchorIcon_[1];pos.y-=this.anchorIcon_[0];return pos;};function Cluster(mc){this.markerClusterer_=mc;this.map_=mc.getMap();this.gridSize_=mc.getGridSize();this.minClusterSize_=mc.getMinimumClusterSize();this.averageCenter_=mc.getAverageCenter();this.printable_=mc.getPrintable();this.markers_=[];this.center_=null;this.bounds_=null;this.clusterIcon_=new ClusterIcon(this,mc.getStyles());}Cluster.prototype.getSize=function(){return this.markers_.length;};Cluster.prototype.getMarkers=function(){return this.markers_;};Cluster.prototype.getCenter=function(){return this.center_;};Cluster.prototype.getMap=function(){return this.map_;};Cluster.prototype.getMarkerClusterer=function(){return this.markerClusterer_;};Cluster.prototype.getBounds=function(){var i;var bounds=new google.maps.LatLngBounds(this.center_,this.center_);var markers=this.getMarkers();for(i=0;i<markers.length;i++){bounds.extend(markers[i].getPosition());}return bounds;};Cluster.prototype.remove=function(){this.clusterIcon_.setMap(null);this.markers_=[];delete this.markers_;};Cluster.prototype.addMarker=function(marker){var i;var mCount;var mz;if(this.isMarkerAlreadyAdded_(marker)){return false;}if(!this.center_){this.center_=marker.getPosition();this.calculateBounds_();}else{if(this.averageCenter_){var l=this.markers_.length+1;var lat=(this.center_.lat()*(l-1)+marker.getPosition().lat())/l;var lng=(this.center_.lng()*(l-1)+marker.getPosition().lng())/l;this.center_=new google.maps.LatLng(lat,lng);this.calculateBounds_();}}marker.isAdded=true;this.markers_.push(marker);mCount=this.markers_.length;mz=this.markerClusterer_.getMaxZoom();if(mz!==null&&this.map_.getZoom()>mz){if(marker.getMap()!==this.map_){marker.setMap(this.map_);}}else if(mCount<this.minClusterSize_){if(marker.getMap()!==this.map_){marker.setMap(this.map_);}}else if(mCount===this.minClusterSize_){for(i=0;i<mCount;i++){this.markers_[i].setMap(null);}}else{marker.setMap(null);}this.updateIcon_();return true;};Cluster.prototype.isMarkerInClusterBounds=function(marker){return this.bounds_.contains(marker.getPosition());};Cluster.prototype.calculateBounds_=function(){var bounds=new google.maps.LatLngBounds(this.center_,this.center_);this.bounds_=this.markerClusterer_.getExtendedBounds(bounds);};Cluster.prototype.updateIcon_=function(){var mCount=this.markers_.length;var mz=this.markerClusterer_.getMaxZoom();if(mz!==null&&this.map_.getZoom()>mz){this.clusterIcon_.hide();return;}if(mCount<this.minClusterSize_){this.clusterIcon_.hide();return;}var numStyles=this.markerClusterer_.getStyles().length;var sums=this.markerClusterer_.getCalculator()(this.markers_,numStyles);this.clusterIcon_.setCenter(this.center_);this.clusterIcon_.useStyle(sums);this.clusterIcon_.show();};Cluster.prototype.isMarkerAlreadyAdded_=function(marker){var i;if(this.markers_.indexOf){return this.markers_.indexOf(marker)!==-1;}else{for(i=0;i<this.markers_.length;i++){if(marker===this.markers_[i]){return true;}}}return false;};function MarkerClusterer(map,opt_markers,opt_options){this.extend(MarkerClusterer,google.maps.OverlayView);opt_markers=opt_markers||[];opt_options=opt_options||{};this.markers_=[];this.clusters_=[];this.listeners_=[];this.activeMap_=null;this.ready_=false;this.gridSize_=opt_options.gridSize||60;this.minClusterSize_=opt_options.minimumClusterSize||2;this.maxZoom_=opt_options.maxZoom||null;this.styles_=opt_options.styles||[];this.title_=opt_options.title||"";this.zoomOnClick_=true;if(opt_options.zoomOnClick!==undefined){this.zoomOnClick_=opt_options.zoomOnClick;}this.averageCenter_=false;if(opt_options.averageCenter!==undefined){this.averageCenter_=opt_options.averageCenter;}this.ignoreHidden_=false;if(opt_options.ignoreHidden!==undefined){this.ignoreHidden_=opt_options.ignoreHidden;}this.printable_=false;if(opt_options.printable!==undefined){this.printable_=opt_options.printable;}this.imagePath_=opt_options.imagePath||MarkerClusterer.IMAGE_PATH;this.imageExtension_=opt_options.imageExtension||MarkerClusterer.IMAGE_EXTENSION;this.imageSizes_=opt_options.imageSizes||MarkerClusterer.IMAGE_SIZES;this.calculator_=opt_options.calculator||MarkerClusterer.CALCULATOR;this.batchSizeIE_=opt_options.batchSizeIE||MarkerClusterer.BATCH_SIZE_IE;if(navigator.userAgent.toLowerCase().indexOf("msie")!==-1){this.batchSize_=this.batchSizeIE_;}else{this.batchSize_=MarkerClusterer.BATCH_SIZE;}this.setupStyles_();this.addMarkers(opt_markers,true);this.setMap(map);}MarkerClusterer.prototype.onAdd=function(){var cMarkerClusterer=this;this.activeMap_=this.getMap();this.ready_=true;this.repaint();this.listeners_=[google.maps.event.addListener(this.getMap(),"zoom_changed",function(){cMarkerClusterer.resetViewport_(false);}),google.maps.event.addListener(this.getMap(),"idle",function(){cMarkerClusterer.redraw_();})];};MarkerClusterer.prototype.onRemove=function(){var i;for(i=0;i<this.markers_.length;i++){this.markers_[i].setMap(this.activeMap_);}for(i=0;i<this.clusters_.length;i++){this.clusters_[i].remove();}this.clusters_=[];for(i=0;i<this.listeners_.length;i++){google.maps.event.removeListener(this.listeners_[i]);}this.listeners_=[];this.activeMap_=null;this.ready_=false;};MarkerClusterer.prototype.draw=function(){};MarkerClusterer.prototype.setupStyles_=function(){var i,size;if(this.styles_.length>0){return;}for(i=0;i<this.imageSizes_.length;i++){size=this.imageSizes_[i];this.styles_.push({url:this.imagePath_+(i+1)+"."+this.imageExtension_,height:size,width:size});}};MarkerClusterer.prototype.fitMapToMarkers=function(){var i;var markers=this.getMarkers();var bounds=new google.maps.LatLngBounds();for(i=0;i<markers.length;i++){bounds.extend(markers[i].getPosition());}this.getMap().fitBounds(bounds);};MarkerClusterer.prototype.getGridSize=function(){return this.gridSize_;};MarkerClusterer.prototype.setGridSize=function(gridSize){this.gridSize_=gridSize;};MarkerClusterer.prototype.getMinimumClusterSize=function(){return this.minClusterSize_;};MarkerClusterer.prototype.setMinimumClusterSize=function(minimumClusterSize){this.minClusterSize_=minimumClusterSize;};MarkerClusterer.prototype.getMaxZoom=function(){return this.maxZoom_;};MarkerClusterer.prototype.setMaxZoom=function(maxZoom){this.maxZoom_=maxZoom;};MarkerClusterer.prototype.getStyles=function(){return this.styles_;};MarkerClusterer.prototype.setStyles=function(styles){this.styles_=styles;};MarkerClusterer.prototype.getTitle=function(){return this.title_;};MarkerClusterer.prototype.setTitle=function(title){this.title_=title;};MarkerClusterer.prototype.getZoomOnClick=function(){return this.zoomOnClick_;};MarkerClusterer.prototype.setZoomOnClick=function(zoomOnClick){this.zoomOnClick_=zoomOnClick;};MarkerClusterer.prototype.getAverageCenter=function(){return this.averageCenter_;};MarkerClusterer.prototype.setAverageCenter=function(averageCenter){this.averageCenter_=averageCenter;};MarkerClusterer.prototype.getIgnoreHidden=function(){return this.ignoreHidden_;};MarkerClusterer.prototype.setIgnoreHidden=function(ignoreHidden){this.ignoreHidden_=ignoreHidden;};MarkerClusterer.prototype.getImageExtension=function(){return this.imageExtension_;};MarkerClusterer.prototype.setImageExtension=function(imageExtension){this.imageExtension_=imageExtension;};MarkerClusterer.prototype.getImagePath=function(){return this.imagePath_;};MarkerClusterer.prototype.setImagePath=function(imagePath){this.imagePath_=imagePath;};MarkerClusterer.prototype.getImageSizes=function(){return this.imageSizes_;};MarkerClusterer.prototype.setImageSizes=function(imageSizes){this.imageSizes_=imageSizes;};MarkerClusterer.prototype.getCalculator=function(){return this.calculator_;};MarkerClusterer.prototype.setCalculator=function(calculator){this.calculator_=calculator;};MarkerClusterer.prototype.getPrintable=function(){return this.printable_;};MarkerClusterer.prototype.setPrintable=function(printable){this.printable_=printable;};MarkerClusterer.prototype.getBatchSizeIE=function(){return this.batchSizeIE_;};MarkerClusterer.prototype.setBatchSizeIE=function(batchSizeIE){this.batchSizeIE_=batchSizeIE;};MarkerClusterer.prototype.getMarkers=function(){return this.markers_;};MarkerClusterer.prototype.getTotalMarkers=function(){return this.markers_.length;};MarkerClusterer.prototype.getTotalClusters=function(){return this.clusters_.length;};MarkerClusterer.prototype.addMarker=function(marker,opt_nodraw){this.pushMarkerTo_(marker);if(!opt_nodraw){this.redraw_();}};MarkerClusterer.prototype.addMarkers=function(markers,opt_nodraw){var i;for(i=0;i<markers.length;i++){this.pushMarkerTo_(markers[i]);}if(!opt_nodraw){this.redraw_();}};MarkerClusterer.prototype.pushMarkerTo_=function(marker){if(marker.getDraggable()){var cMarkerClusterer=this;google.maps.event.addListener(marker,"dragend",function(){if(cMarkerClusterer.ready_){this.isAdded=false;cMarkerClusterer.repaint();}});}marker.isAdded=false;this.markers_.push(marker);};MarkerClusterer.prototype.removeMarker=function(marker,opt_nodraw){var removed=this.removeMarker_(marker);if(!opt_nodraw&&removed){this.repaint();}return removed;};MarkerClusterer.prototype.removeMarkers=function(markers,opt_nodraw){var i,r;var removed=false;for(i=0;i<markers.length;i++){r=this.removeMarker_(markers[i]);removed=removed||r;}if(!opt_nodraw&&removed){this.repaint();}return removed;};MarkerClusterer.prototype.removeMarker_=function(marker){var i;var index=-1;if(this.markers_.indexOf){index=this.markers_.indexOf(marker);}else{for(i=0;i<this.markers_.length;i++){if(marker===this.markers_[i]){index=i;break;}}}if(index===-1){return false;}marker.setMap(null);this.markers_.splice(index,1);return true;};MarkerClusterer.prototype.clearMarkers=function(){this.resetViewport_(true);this.markers_=[];};MarkerClusterer.prototype.repaint=function(){var oldClusters=this.clusters_.slice();this.clusters_=[];this.resetViewport_(false);this.redraw_();setTimeout(function(){var i;for(i=0;i<oldClusters.length;i++){oldClusters[i].remove();}},0);};MarkerClusterer.prototype.getExtendedBounds=function(bounds){var projection=this.getProjection();var tr=new google.maps.LatLng(bounds.getNorthEast().lat(),bounds.getNorthEast().lng());var bl=new google.maps.LatLng(bounds.getSouthWest().lat(),bounds.getSouthWest().lng());var trPix=projection.fromLatLngToDivPixel(tr);trPix.x+=this.gridSize_;trPix.y-=this.gridSize_;var blPix=projection.fromLatLngToDivPixel(bl);blPix.x-=this.gridSize_;blPix.y+=this.gridSize_;var ne=projection.fromDivPixelToLatLng(trPix);var sw=projection.fromDivPixelToLatLng(blPix);bounds.extend(ne);bounds.extend(sw);return bounds;};MarkerClusterer.prototype.redraw_=function(){this.createClusters_(0);};MarkerClusterer.prototype.resetViewport_=function(opt_hide){var i,marker;for(i=0;i<this.clusters_.length;i++){this.clusters_[i].remove();}this.clusters_=[];for(i=0;i<this.markers_.length;i++){marker=this.markers_[i];marker.isAdded=false;if(opt_hide){marker.setMap(null);}}};MarkerClusterer.prototype.distanceBetweenPoints_=function(p1,p2){var R=6371;var dLat=(p2.lat()-p1.lat())*Math.PI/180;var dLon=(p2.lng()-p1.lng())*Math.PI/180;var a=Math.sin(dLat/2)*Math.sin(dLat/2)+Math.cos(p1.lat()*Math.PI/180)*Math.cos(p2.lat()*Math.PI/180)*Math.sin(dLon/2)*Math.sin(dLon/2);var c=2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a));var d=R*c;return d;};MarkerClusterer.prototype.isMarkerInBounds_=function(marker,bounds){return bounds.contains(marker.getPosition());};MarkerClusterer.prototype.addToClosestCluster_=function(marker){var i,d,cluster,center;var distance=40000;var clusterToAddTo=null;for(i=0;i<this.clusters_.length;i++){cluster=this.clusters_[i];center=cluster.getCenter();if(center){d=this.distanceBetweenPoints_(center,marker.getPosition());if(d<distance){distance=d;clusterToAddTo=cluster;}}}if(clusterToAddTo&&clusterToAddTo.isMarkerInClusterBounds(marker)){clusterToAddTo.addMarker(marker);}else{cluster=new Cluster(this);cluster.addMarker(marker);this.clusters_.push(cluster);}};MarkerClusterer.prototype.createClusters_=function(iFirst){var i,marker;var cMarkerClusterer=this;if(!this.ready_){return;}if(iFirst===0){google.maps.event.trigger(this,"clusteringbegin",this);if(typeof this.timerRefStatic!=="undefined"){clearTimeout(this.timerRefStatic);delete this.timerRefStatic;}}var mapBounds=new google.maps.LatLngBounds(this.getMap().getBounds().getSouthWest(),this.getMap().getBounds().getNorthEast());var bounds=this.getExtendedBounds(mapBounds);var iLast=Math.min(iFirst+this.batchSize_,this.markers_.length);for(i=iFirst;i<iLast;i++){marker=this.markers_[i];if(!marker.isAdded&&this.isMarkerInBounds_(marker,bounds)){if(!this.ignoreHidden_||(this.ignoreHidden_&&marker.getVisible())){this.addToClosestCluster_(marker);}}}if(iLast<this.markers_.length){this.timerRefStatic=setTimeout(function(){cMarkerClusterer.createClusters_(iLast);},0);}else{delete this.timerRefStatic;google.maps.event.trigger(this,"clusteringend",this);}};MarkerClusterer.prototype.extend=function(obj1,obj2){return(function(object){var property;for(property in object.prototype){this.prototype[property]=object.prototype[property];}return this;}).apply(obj1,[obj2]);};MarkerClusterer.CALCULATOR=function(markers,numStyles){var index=0;var count=markers.length.toString();var dv=count;while(dv!==0){dv=parseInt(dv/10,10);index++;}index=Math.min(index,numStyles);return{text:count,index:index};};MarkerClusterer.BATCH_SIZE=2000;MarkerClusterer.BATCH_SIZE_IE=500;MarkerClusterer.IMAGE_PATH="http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclustererplus/images/m";MarkerClusterer.IMAGE_EXTENSION="png";MarkerClusterer.IMAGE_SIZES=[53,56,66,78,90];ape.ns("motorpresse.elements");motorpresse.elements.RatingElement={ajaxUrl:null,brandID:null,ref:null,lightbox:null,init:function(ref){if(ref.count<1){return;}var self=this;this.ref=jQuery(ref);this.ajaxUrl=ref.attr('rev');this.brandID=ref.attr('href');if(!this.brandID){return;}this.brandID=this.brandID.replace('#','');jQuery.ajax({url:this.ajaxUrl,data:{breandID:this.brandID},type:'post',dataType:'html',success:function(data,status){jQuery('.main_col').append(data);self.lightbox=jQuery('div.lightbox_baureihen',jQuery('.main_col'));self.initLightbox();}});},initLightbox:function(){var self=this;var closeButton=jQuery('a.close',this.lightbox);this.ref.unbind('click.rating_series_lightbox');this.ref.bind('click.rating_series_lightbox',function(){self.lightbox.show();});closeButton.unbind('click.rating_series_lightbox');closeButton.bind('click.rating_series_lightbox',function(){self.lightbox.hide();});}};ape.Listeners.addListener('is_report_button',function(ref){motorpresse.elements.RatingElement.init(ref);},2);ape.ns("motorpresse.elements");motorpresse.elements.FotoshowElement={config:{aktuell:0,reload:0,images:[],count:0},fotoshowContainer:jQuery(),fotoshowImageContainer:jQuery(),fotoshowCounter:jQuery(),clickCounter:0,activeIndex:0,autorField:jQuery(),textField:jQuery(),init:function(ref){this.activeIndex=parseInt(this.config.aktuell,10);this.config.reload=parseInt(this.config.reload,10);this.config.count=parseInt(this.config.count,10);this.fotoshowContainer=ref;this.fotoshowImageContainer=jQuery('.is_Fotoshow_Image_Container',this.fotoshowContainer);this.fotoshowCounter=jQuery('.is_Fotoshow_Counter',this.fotoshowContainer);this.autorField=jQuery('.autor',this.fotoshowContainer);this.textField=jQuery('.text',this.fotoshowContainer);this.initImages();this.initButtons();this.initHashValue();},initButtons:function(){var self=this;jQuery('.is_Fotoshow_Next',this.fotoshowContainer).unbind('click.fotoshow');jQuery('.is_Fotoshow_Next',this.fotoshowContainer).bind('click.fotoshow',function(button){var data=jQuery(this).data('imageData');if(data&&data.link){if(data.rholive&&data.rholive.host&&data.rholive.url){if(typeof analyticsRholivePixel!=='undefined'){jQuery('body').append(analyticsRholivePixel(data.rholive.host,data.rholive.url));}window.setTimeout(function(){window.location=data.link;},100);}else{window.location=data.link;}}else{self.next();}return false;});jQuery('.is_Fotoshow_Last',this.fotoshowContainer).unbind('click.fotoshow');jQuery('.is_Fotoshow_Last',this.fotoshowContainer).bind('click.fotoshow',function(button){self.previous();return false;});},initImages:function(){var currentVisibleImage=jQuery(jQuery('.is_Fotoshow_Image')[0]);var imageTemplate=currentVisibleImage.clone(true);imageTemplate.addClass('hide');var append=false;var toPrepend=[];var i=0;for(i=0;i<this.config.images.length;i++){var currentImage=imageTemplate.clone(true);var currentData=this.config.images[i];jQuery('img',currentImage).replaceWith(currentData.image);if(currentData.active){append=true;currentVisibleImage.data('imageData',currentData);continue;}currentImage.hide();currentImage.data('imageData',currentData);if(append){this.fotoshowImageContainer.append(currentImage);}else{toPrepend.push(currentImage);}}toPrepend=toPrepend.reverse();for(i=0;i<toPrepend.length;i++){this.fotoshowImageContainer.prepend(toPrepend[i]);}motorpresse.elements.AdElement.Ad.adTrigger(jQuery('.is_ad_trigger'));},handleClick:function(){if(this.activeIndex>this.config.count-1){this.activeIndex=0;}else if(this.activeIndex<0){this.activeIndex=this.config.count-1;}this.clickCounter++;if(this.clickCounter>=this.config.reload){this.gotoIndex(this.activeIndex);return false;}this.updateCounter();this.updatePlista();this.updateHash();return true;},gotoIndex:function(index){if(index>this.config.count){index=this.config.count-1;}else if(index<0){index=0;}this.stopAll();var newUrl=window.location.protocol+'//'+window.location.host+window.location.pathname+'?fotoshow_item='+index;window.location=newUrl;return true;},updateHash:function(){window.location=this.getHashForUrl();},initHashValue:function(){var hash=window.location.hash.replace('#','');if(hash!==''){var params=hash.split('&');for(var i=0;i<params.length;i++){var parts=params[i].split('=');var name=parts.shift();var value=parseInt(parts.pop(),10);if(name==='fotoshow_item'){if(value!=this.activeIndex){if((this.activeIndex-this.config.reload)>value||(this.activeIndex+this.config.reload)<value){this.gotoIndex(value);return;}var difference=0;var j=0;if(value>this.activeIndex){difference=value-this.activeIndex;for(j=0;j<difference;j++){this.next();}}else{difference=this.activeIndex-value;if(difference>0){for(j=0;j<difference;j++){this.previous();}}}}}}}},updatePlista:function(){if(typeof PLISTA!=='undefined'){PLISTA.pictureads.hideAll();setTimeout(function(){PLISTA.pictureads.reInit();},300);}},loadData:function(currentData){if(currentData){if(currentData.autor!==''){this.autorField.html("&copy; "+currentData.autor);}this.textField.html(currentData.text);}},next:function(){this.activeIndex++;var testNext=jQuery('.is_Fotoshow_Image:not(.hide)').next();if(testNext.length===0&&this.activeIndex>this.config.count-1){this.activeIndex=0;}if(this.handleClick()){var next=jQuery('.is_Fotoshow_Image:not(.hide)').addClass('hide').next();if(next.length===0){next=jQuery('.is_Fotoshow_Image.hide:first');}next.removeClass('hide');next.css('display','');this.loadData(next.data('imageData'));}},previous:function(){this.activeIndex--;var testPrev=jQuery('.is_Fotoshow_Image:not(.hide)').prev();if(testPrev.length===0&&this.activeIndex<0){this.activeIndex=this.config.count-1;}if(this.handleClick()){var prev=jQuery('.is_Fotoshow_Image:not(.hide)').addClass('hide').prev();if(prev.length===0){this.activeIndex=this.config.count-1;prev=jQuery('.is_Fotoshow_Image.hide:last');}prev.removeClass('hide');prev.css('display','');this.loadData(prev.data('imageData'));}},updateCounter:function(){jQuery('.is_Fotoshow_Next a',this.fotoshowContainer).attr('href',this.getNextUrl());jQuery('.is_Fotoshow_Last a',this.fotoshowContainer).attr('href',this.getPrevUrl());this.fotoshowCounter.html("Bild "+(this.activeIndex+1)+" von "+this.config.count);},getHashForUrl:function(){return'#fotoshow_item='+this.activeIndex;},getNextUrl:function(){var next=this.activeIndex+1;if(next>this.config.images.count){next=0;}return window.location.protocol+'//'+window.location.host+window.location.pathname+'?fotoshow_item='+next;},getPrevUrl:function(){var prev=this.activeIndex-1;if(prev<0){prev=this.config.images.length;}return window.location.protocol+'//'+window.location.host+window.location.pathname+'?fotoshow_item='+prev;},stopAll:function(){jQuery('.is_Fotoshow_Next',this.fotoshowContainer).unbind('click.fotoshow');jQuery('.is_Fotoshow_Last',this.fotoshowContainer).unbind('click.fotoshow');}};ape.Listeners.addListener('is_Fotoshow',function(ref){motorpresse.elements.FotoshowElement.init(ref);},1);ape.ns("motorpresse.elements");motorpresse.elements.RotationTeaser={active:0,interval:3500,restartpause:8000,init:function(ref){ref.each(function(){$('ul li',this).unbind('click.RotationTeaserItem').bind('click.RotationTeaserItem',function(){motorpresse.elements.RotationTeaser.clickHeadline(this);return false;});if($('.is_RotationTeaser ul').children('li').length>1){document.RotationTeaserInterval=window.setInterval(function(){motorpresse.elements.RotationTeaser.switchActiveItem(motorpresse.elements.RotationTeaser.active+1);},motorpresse.elements.RotationTeaser.interval);}});},switchActiveItem:function(newID){var self=motorpresse.elements.RotationTeaser;self.active=newID;if(self.active>$('.is_RotationTeaser ul').children('li').length-1){self.active=0;}$('.is_RotationTeaser ul').children('li').each(function(i,object){if(i!=self.active){$(object).removeClass('aktiv');}else{$(object).addClass('aktiv');}});$('.is_RotationTeaser div.links').children('div.container').each(function(i,object){if(i!=self.active){$(object).hide();}else{$(object).show();}});},clickHeadline:function(headline){window.clearInterval(document.RotationTeaserInterval);var i=parseInt($(headline).attr('id').split('_').pop(),10);motorpresse.elements.RotationTeaser.switchActiveItem(i);window.clearTimeout(document.RotationTeaserRestartTimeout);document.RotationTeaserRestartTimeout=window.setTimeout(function(){motorpresse.elements.RotationTeaser.init(jQuery('.is_RotationTeaser'));},motorpresse.elements.RotationTeaser.restartpause);}};ape.Listeners.addListener('is_RotationTeaser',motorpresse.elements.RotationTeaser.init,1);ape.ns('motorpresse.misc');motorpresse.misc.Logo={init:function(ref){$('img',ref).hover(function(){$('span',ref).show();},function(){$('span',ref).hide();});}};ape.Listeners.addListener('is_Logo',motorpresse.misc.Logo.init,1);ape.Namespace('motorpresse.elements.PollElement');motorpresse.elements.PollElement.Poll={ajaxUrl:null,submit:jQuery(),form:null,ref:null,reloadAjaxUrl:'',init:function(ref,isAjaxLoaded){var self=this;if(isAjaxLoaded===undefined){jQuery.ajax({url:motorpresse.elements.PollElement.Poll.reloadAjaxUrl,type:'get',dataType:'html',success:function(data,status){jQuery(ref).replaceWith(jQuery(data));self.init(jQuery('.is_poll'),true);self.animateResultBar(jQuery('.is_animatableBar'));self.animateResultPercentage(jQuery('.is_animatablePercentage'));}});return;}ref.each(function(){self.form=jQuery('form',this);self.ref=this;self.ajaxUrl=jQuery(self.form).attr('action');self.submit=jQuery('.is_submit',ref);self.form.unbind('submit.ape_poll_form');self.form.bind('submit.ape_poll_form',function(){self.onSubmit(ref);return false;});$(".auswahl div a, .auswahl div label",this).bind("click",function(){$(this).parent("div").parent(".auswahl").children("div").each(function(){$(this).removeClass("checked");});$(this).parent("div").addClass("checked");$(this).parent("div").children("input").attr({checked:"checked"});});});},onSubmit:function(ref){var self=this;var values=ape.Form.getValuesOf(this.form);jQuery.ajax({url:this.ajaxUrl,data:values,type:'post',dataType:'html',success:function(data,status){jQuery(ref).replaceWith(jQuery(data));self.init(jQuery('.is_poll'),true);self.animateResultBar(jQuery('.is_animatableBar'));self.animateResultPercentage(jQuery('.is_animatablePercentage'));}});},animateResultBar:function(ref){ref.each(function(){var width=jQuery(this).css('width');jQuery(this).css('width','1%').animate({width:width},{duration:1000,complete:function(){jQuery(this).css('width',width);}});});},animateResultPercentage:function(ref){ref.each(function(){var container=jQuery(this);var value=container.text().replace('%','');jQuery({count:0}).animate({count:value},{duration:1000,step:function(){container.text(Math.round(this.count)+'%');},complete:function(){container.text(Math.round(value)+'%');}});});}};ape.Listeners.addListener('is_poll',function(ref){motorpresse.elements.PollElement.Poll.init(ref);},2);ape.Listeners.addListener('is_animatableBar',function(ref){motorpresse.elements.PollElement.Poll.animateResultBar(ref);},2);ape.Listeners.addListener('is_animatablePercentage',function(ref){motorpresse.elements.PollElement.Poll.animateResultPercentage(ref);},2);ape.ns("motorpresse.elements");motorpresse.elements.AdventCalendar={init:function(ref){jQuery('.is_front',ref).bind('click',function(){jQuery('.is_front').each(function(){if($(this).data('open')===true){var back=$(this).parent().children('.is_back');back.animate({width:"toggle"},600,function(){$(this).parent().children('.is_front').data('open',false);$(this).parent().children('.is_front').animate({width:"toggle"},600);});}});if($(this).parent().children('.is_back').length>0){$(this).animate({width:"toggle"},600,function(){$(this).data('open',true);var back=$(this).parent().children('.is_back');back.animate({width:"toggle"},600);});}});}};ape.Listeners.addListener('is_adventskalender',function(ref){motorpresse.elements.AdventCalendar.init(ref);});ape.Namespace('motorpresse.elements.HeaderElement');motorpresse.elements.HeaderElement={initialSearchValue:"",init:function(ref){this.initialSearchValue=jQuery(ref).val();var self=this;jQuery(ref).focusin(function(){if(jQuery(this).val()==self.initialSearchValue){jQuery(this).val('');}}).focusout(function(){if(jQuery(this).val()===""){jQuery(this).val(self.initialSearchValue);}});jQuery(ref).parent().parent().bind('submit',function(){if(jQuery(ref).val()==self.initialSearchValue){jQuery(ref).val('');}});},button:jQuery(),navigation:jQuery(),navigationLinks:jQuery(),addonsContainer:jQuery(),newsletterAddon:jQuery(),brandTreeAddon:jQuery(),searchAddon:jQuery(),initNavigation:function(ref){var self=this;this.navigation=ref;this.navigationLinks=jQuery('.is_mobile_navigation > a');this.addonsContainer=jQuery('.is_tools',this.navigation);this.newsletterAddon=jQuery('.is_newsletter_tool',this.addonsContainer);this.newsletterAddon.hide();this.searchAddon=jQuery('.is_search_tool',this.addonsContainer);this.searchAddon.hide();this.brandTreeAddon=jQuery('.is_brandtree_tool',this.addonsContainer);this.brandTreeAddon.hide();this.addonsContainer.show();jQuery('.is_cancel_button',this.addonsContainer).show().unbind('click.mobile').bind('click.mobile',function(){self.navigationLinks.show();self.brandTreeAddon.hide();self.newsletterAddon.hide();self.searchAddon.hide();});this.navigationLinks.unbind('click.mobile').bind('click.mobile',function(){var href=jQuery(this).attr('href');if(href=="#newsletter"){self.navigationLinks.hide();jQuery('.is_submit_button',self.newsletterAddon).hide();jQuery('.is_double',self.newsletterAddon).show().find('a').show();self.newsletterAddon.fadeToggle();}else if(href=="#fahrzeugdatenbank"){self.navigationLinks.hide();self.brandTreeAddon.fadeToggle();}else if(href=="#suche"){self.navigationLinks.hide();self.searchAddon.fadeToggle();}});},initButton:function(ref){var self=this;this.button=ref;this.button.unbind('click.mobile').bind('click.mobile',function(){if(self.brandTreeAddon.is(':visible')||self.searchAddon.is(':visible')||self.newsletterAddon.is(':visible')){self.navigationLinks.show();self.brandTreeAddon.hide();self.searchAddon.hide();self.newsletterAddon.hide();}else{self.navigation.fadeToggle();}});}};ape.Listeners.addListener('is_searchfield',function(ref){motorpresse.elements.HeaderElement.init(ref);},2);ape.Listeners.addListener('is_mobile_navigation',function(ref){motorpresse.elements.HeaderElement.initNavigation(ref);},1);ape.Listeners.addListener('is_mobile_navigation_button',function(ref){motorpresse.elements.HeaderElement.initButton(ref);},2);ape.Namespace('motorpresse.elements.ReportElement');motorpresse.elements.ReportElement.Spam={ajaxUrl:null,ref:null,init:function(ref){var self=this;this.ajaxUrl=jQuery('#is_report_url_spam').html();jQuery(ref).each(function(index,item){item=jQuery(item);item.unbind('click.ape_comment_spam');item.bind('click.ape_comment_spam',function(){self.doSpam(jQuery(this));});});},doSpam:function(item){var reportID=jQuery('#is_report_id').html();var self=this;jQuery.ajax({url:this.ajaxUrl,data:{reportID:reportID},type:'get',dataType:'html',context:jQuery(item),success:function(data,status){if(jQuery('#report_report_lightbox').length<1){jQuery('#main').append(data);self.center(jQuery('#report_report_lightbox'));jQuery('#report_report_lightbox a.is_close').unbind('click.ape_comment_spam');jQuery('#report_report_lightbox a.is_close').bind('click.ape_comment_spam',function(){jQuery('#report_report_lightbox').fadeOut('fast',function(){jQuery(this).replaceWith('');});});jQuery('#report_report_lightbox .is_submit').unbind('click.ape_comment_spam');jQuery('#report_report_lightbox .is_submit').bind('click.ape_comment_spam',function(){self.doSubmit();});}}});},doSubmit:function(){var values=ape.Form.getValuesOf(jQuery('#report_report_lightbox form'));jQuery.ajax({url:this.ajaxUrl,data:values,type:'post',dataType:'json',context:this,success:function(data,status){if(data.success===true){jQuery('#report_report_lightbox .formular').html("<p>Vielen Dank für Ihren Hinweis.<br />Das Fenster schließt sich nach 5 Sekunden automatisch.</p>");window.setTimeout(function(){jQuery('#report_report_lightbox').fadeOut('fast',function(){jQuery(this).replaceWith('');});},5000);}}});},center:function(item){item.css('position','absolute');item.css('top',(jQuery(window).height()-item.height())/2+jQuery(window).scrollTop()+'px');item.css('left',(jQuery(window).width()-item.width())/2+jQuery(window).scrollLeft()+'px');}};ape.Listeners.addListener('is_report_report',function(ref){motorpresse.elements.ReportElement.Spam.init(ref);},2);ape.Namespace('motorpresse.elements.ReportElement');motorpresse.elements.ReportElement.Rate={ajaxUrl:null,ref:null,init:function(ref){var self=this;this.ajaxUrl=jQuery('#is_report_url_rate').html();jQuery(ref).each(function(index,item){item=jQuery(item);item.unbind('click.ape_report_rate');item.bind('click.ape_report_rate',function(){self.doRate(jQuery(this));});});},doRate:function(item){var reportID=jQuery('#is_report_id',item.parent()).html();var direction=jQuery(item).is('.is_report_helpful_yes');jQuery.ajax({url:this.ajaxUrl,data:{reportID:reportID,direction:direction?'JA':'NEIN'},type:'post',dataType:'json',context:jQuery(item),success:function(data,status){if(typeof data.success!=='undefined'&&data.success===true){jQuery('.is_rate_report_text',jQuery(this).parent()).html('Vielen Dank für Ihre Bewertung.');}else{jQuery('.is_rate_report_text',jQuery(this).parent()).html('Sie haben diesen Erfahrungsbericht bereits bewertet.');}jQuery('.is_rate_report',jQuery(this).parent()).replaceWith('');}});}};ape.Listeners.addListener('is_rate_report',function(ref){motorpresse.elements.ReportElement.Rate.init(ref);},2);ape.Namespace('motorpresse.elements.ComparisonElement');motorpresse.elements.ComparisonElement.Comparison={ajaxUrl:null,submit:jQuery(),data:null,ref:null,init:function(ref){var self=this;this.data=jQuery('.is_comparison_data',ref);this.ref=ref;this.ajaxUrl=ref.find('span.is_comparison_url').text();this.submit=jQuery('.is_comparison_selector',ref);this.submit.unbind('change.ape_comparison');this.submit.bind('change.ape_comparison',function(){self.onSubmit();return false;});},onSubmit:function(){var self=this;var values=ape.Form.getValuesOf(this.ref);jQuery.ajax({url:this.ajaxUrl,data:values,type:'post',dataType:'html',success:function(data,status){self.ref.replaceWith(jQuery(data));self.init(jQuery('.is_comparison'));}});}};ape.Listeners.addListener('is_comparison',function(ref){motorpresse.elements.ComparisonElement.Comparison.init(ref);},2);ape.ns("motorpresse.elements");motorpresse.elements.ReportSearchElement={ref:null,ratings:jQuery(),form:jQuery(),ajaxUrl:'/ajax/static.html/cars_listSeries/',brandDropdown:jQuery(),seriesDropdown:jQuery(),init:function(ref){this.ratings=jQuery('.is_report_search_criterias_rating',ref);this.form=ref.parentsUntil('form');var self=this;this.ratings.unbind('click.reportSearchCriterias');this.ratings.bind('click.reportSearchCriterias',function(){self.ratings.removeClass('aktiv');jQuery('input[name="rating"]',self.form).val(jQuery(this).attr('rel'));jQuery(this).addClass('aktiv');});},initForm:function(ref){this.ref=ref;this.brandDropdown=jQuery('select[name="marke"]',ref);this.seriesDropdown=jQuery('select[name="modell"]',ref);this.initBrandDropdown();},initBrandDropdown:function(){var self=this;this.brandDropdown.unbind('change.reportsearch');this.brandDropdown.bind('change.reportsearch',function(){self.seriesDropdown.attr('disabled','disabled');var currentValue=self.brandDropdown.val();jQuery.ajax({url:self.ajaxUrl,data:{Marke_ID:currentValue},dataType:'json',global:false,success:function(data){if(data){self.populateDropDown(self.seriesDropdown,data,'Baureihe_ID','Titel');}}});});},initWriteButton:function(ref){var self=this;ref.unbind('click.writeReport');ref.bind('click.writeReport',function(){jQuery.ajax({url:"/ajax/static.html/brandTree_reportWriteUrl",data:{marke:self.brandDropdown.val(),baureihe:self.seriesDropdown.val()},dataType:'json',global:false,success:function(data){if(data===undefined){return false;}if(data.success){window.location=data.data;}else{self.showError('Sie müssen eine Marke und ein Modell ausgewählt haben um einen Fahrertest schreiben zu können.');}return true;}});});},showError:function(msg){jQuery('ul.error li',this.ref).remove();jQuery('ul.error',this.ref).removeClass('hide').append("<li>"+msg+"</li>");},populateDropDown:function(dropdown,values,valueKEY,displayKEY){this.emptyDropDown(dropdown);if(values===null){return false;}for(var i=0;i<values.length;i++){var current=values[i];dropdown.append('<option value="'+current[valueKEY]+'">'+current[displayKEY]+'</option>');}dropdown.removeAttr('disabled');return true;},emptyDropDown:function(dropdown){jQuery('option[value!="0"]',dropdown).remove();}};ape.Listeners.addListener('is_report_search_criterias',function(ref){motorpresse.elements.ReportSearchElement.init(ref);},2);ape.Listeners.addListener('is_report_search_form',function(ref){motorpresse.elements.ReportSearchElement.initForm(ref);},2);ape.Listeners.addListener('is_write_report_button',function(ref){motorpresse.elements.ReportSearchElement.initWriteButton(ref);},2);ape.ns("motorpresse.elements");motorpresse.elements.Charts={ref:null,data:null,init:function(ref){this.ref=ref;if(!this.data){return;}this.initChart();},initChart:function(){if(this.data.data[0]){this.data.data[0].type='line';}this.chart=new Highcharts.Chart({title:{text:this.data.title},subtitle:{text:this.data.subtitle,floating:true,align:'left',verticalAlign:'top',x:100,y:50},credits:{enabled:false},legend:{floating:true,align:'left',verticalAlign:'top',x:100,y:5},colors:['#FF0000','#6eb61f','#0768a4'],tooltip:{formatter:function(){var s='<b>'+this.x+'</b>';jQuery.each(this.points,function(i,point){s+='<br />'+point.series.name+': '+point.y.toFixed(2)+'€';});return s;},shared:true},chart:{marginTop:80,renderTo:'is_chart',defaultSeriesType:'column'},xAxis:{categories:this.data.categories,labels:{rotation:-90,y:40}},yAxis:{title:{text:''},labels:{style:{fontSize:"8px",fontWeight:'bold'}}},plotOptions:{column:{stacking:'normal',borderRadius:0,pointWidth:30,zIndex:5,dataLabels:{x:-2,enabled:true,color:'#FFF',style:{fontSize:"9px",fontWeight:'bold'},formatter:function(){return this.y.toFixed(2);}}},line:{dataLabels:{enabled:true,color:'#FF0000',y:-10,formatter:function(){return this.y.toFixed(2);},style:{fontWeight:'bold'}},zIndex:10,lineWidth:0}},series:this.data.data});}};ape.Listeners.addListener('is_chart',function(ref){motorpresse.elements.Charts.init(ref);});ape.ns("motorpresse.elements");motorpresse.elements.SecondHandCarElement={brandDropdown:jQuery(),seriesDropdown:jQuery(),ajaxUrl:'/ajax/static.html/cars_listSeries/',ref:null,automarkt:false,typeSelected:jQuery(),typeAll:jQuery(),typeSelectionTrigger:['kleinwagen','limousine','kombi','van','gelaendewagen','cabrio','sportwagen','andere'],init:function(ref){this.ref=ref;this.brandDropdown=jQuery('select[name="marke"]',ref);this.seriesDropdown=jQuery('select[name="modell"]',ref);this.automarkt=this.ref.hasClass('is_automarkt');if(this.automarkt){this.brandDropdown.attr('name','carsearchmake');this.seriesDropdown.attr('name','carsearchmod');}this.initBrandDropdown();this.initCarTypeSelection();},initCarTypeSelection:function(){var self=this;this.typeAll=jQuery('input[name="fahrzeugtyp"][value="1"]');this.typeSelected=jQuery('input[name="fahrzeugtyp"][value="2"]');this.typeAll.unbind('click.secondhandcar').bind('click.secondhandcar',function(){self.typeAll.parent().find('label').addClass("aktiv");self.typeSelected.parent().find('label').removeClass("aktiv");for(var i=0;i<self.typeSelectionTrigger.length;i++){var current=jQuery('input[name="'+self.typeSelectionTrigger[i]+'"]');current.attr('checked',false);}});this.typeSelected.unbind('click.secondhandcar').bind('click.secondhandcar',function(){self.typeSelected.parent().find('label').addClass("aktiv");self.typeAll.parent().find('label').removeClass("aktiv");});for(var i=0;i<this.typeSelectionTrigger.length;i++){var current=jQuery('input[name="'+this.typeSelectionTrigger[i]+'"]');if(current.length>0){current.unbind('click.secondhandcar');current.bind('click.secondhandcar',function(){self.onTypeClick(jQuery(this));});}}},onTypeClick:function(checkbox){if(checkbox.is(':checked')){this.selectSelectedTypes();}this.checkForSelectedTypes();},checkForSelectedTypes:function(){var checkedCount=0;for(var i=0;i<this.typeSelectionTrigger.length;i++){var current=jQuery('input[name="'+this.typeSelectionTrigger[i]+'"]');if(current.length>0){if(current.is(':checked')){checkedCount++;}}}if(checkedCount===0){this.selectAllTypes();}},selectAllTypes:function(){this.typeAll.attr('checked',true);this.typeAll.parent().find('label').addClass("aktiv");this.typeSelected.attr('checked',false);this.typeSelected.parent().find('label').removeClass("aktiv");},selectSelectedTypes:function(){this.typeSelected.attr('checked',true);this.typeSelected.parent().find('label').addClass("aktiv");this.typeAll.attr('checked',false);this.typeAll.parent().find('label').removeClass("aktiv");},initBrandDropdown:function(){var self=this;this.brandDropdown.unbind('change.secondhandcar');this.brandDropdown.bind('change.secondhandcar',function(){self.seriesDropdown.attr('disabled','disabled');var currentValue=self.brandDropdown.val();jQuery.ajax({url:self.ajaxUrl,data:{automarkt:self.automarkt,Marke_ID:currentValue},dataType:'json',global:false,success:function(data){if(data){if(self.automarkt){self.populateDropDown(self.seriesDropdown,data,'Name','Titel');}else{self.populateDropDown(self.seriesDropdown,data,'Baureihe_ID','Titel');}}}});});},populateDropDown:function(dropdown,values,valueKEY,displayKEY){this.emptyDropDown(dropdown);if(values===null){return false;}for(var i=0;i<values.length;i++){var current=values[i];dropdown.append('<option value="'+current[valueKEY]+'">'+current[displayKEY]+'</option>');}dropdown.removeAttr('disabled');return true;},emptyDropDown:function(dropdown){if(this.automarkt){jQuery('option[value!=""]',dropdown).remove();}else{jQuery('option[value!="0"]',dropdown).remove();}}};ape.Listeners.addListener('is_second_hand_car_search_form',function(ref){motorpresse.elements.SecondHandCarElement.init(ref);});ape.ns("motorpresse.elements");motorpresse.elements.RotationTeaserLightbox={config:{},init:function(ref){jQuery.fancybox.init();var self=this;var id=jQuery('.video_id',ref).html();this.config=motorpresse.brightcove_videos[id];if(!this.config){return false;}var playerID=this.config.playerID;var publisherID=this.config.publisherID;var param_site=this.config.param_site;var param_affiliate=this.config.param_affiliate;var param_prod=this.config.param_prod;var artikelurl=this.config.artikelurl;var videoID=this.config.videoID;var videoTag=this.generateVideoTag(playerID,publisherID,param_site,param_affiliate,param_prod,artikelurl,videoID,'');jQuery('a',ref).click(function(){jQuery.fancybox({type:'html',content:videoTag,centerOnScroll:true,width:560,height:420,autoDimensions:false,scrolling:'no',onComplete:function(){brightcove.createExperiences();},title:jQuery('h2 a',ref).text()});return false;});},generateVideoTag:function(playerID,publisherID,param_site,param_affiliate,param_prod,artikelurl,videoID,extratag){var additionalAdTargetingParams='';if(!window.frn046adxtra){window.frn046adxtra="";}var frn046enrich=(typeof window.pt027bw=='undefined')?"&band=256"+window.frn046adxtra:"&band="+window.pt027bw+window.frn046adxtra;frn046enrich=(typeof window.frn046tie=='undefined')?"&tie=free"+frn046enrich:"&tie="+window.frn046tie+frn046enrich;if(additionalAdTargetingParams===''){additionalAdTargetingParams=escape('site='+param_site+'&affiliate='+param_affiliate+'&prod='+param_prod+'&tbl=channel'+frn046enrich);}else{additionalAdTargetingParams=escape(additionalAdTargetingParams+frn046enrich);}var random=Math.round(Math.random()*100);var videoTag='<object id="myExperience_'+random+'" class="BrightcoveExperience"> ';videoTag+='<param name="bgcolor" value="#FFFFFF"/> ';videoTag+='<param name="width" value="560"/> ';videoTag+='<param name="height" value="420"/> ';videoTag+='<param name="playerID" value="'+playerID+'"/> ';videoTag+='<param name="publisherID" value="'+publisherID+'"/> ';videoTag+='<param name="isVid" value="true"/> ';videoTag+='<param name="isUI" value="true"/> ';videoTag+='<param name="dynamicStreaming" value="true" />';videoTag+='<param name="wmode" value="opaque" /> ';videoTag+='<param name="optimizedContentLoad" value="true"/> ';videoTag+='<param name="@videoPlayer" value="'+videoID+'"/> ';videoTag+='<param name="additionalAdTargetingParams" value="'+additionalAdTargetingParams+'" /> ';videoTag+='<param name="flashVars" value="@videoPlayer='+videoID+'&playerID='+playerID+'&domain=embed&additionalAdTargetingParams='+additionalAdTargetingParams+'" />';videoTag+='<param name="linkBaseURL" value="'+artikelurl+'?bcpid='+playerID+'&bctid='+videoID+'" />';videoTag+='<embed src="http://c.brightcove.com/services/viewer/federated_f9/'+playerID+'?isVid=1&publisherID='+publisherID+'"';videoTag+='bgcolor="#FFFFFF" ';videoTag+='flashVars="@videoPlayer='+videoID+'&playerID='+playerID+'&domain=embed" ';videoTag+='base="http://admin.brightcove.com"   ';videoTag+='name="myExperience_'+random+'" ';videoTag+='width="560" ';videoTag+='height="420" ';videoTag+='type="application/x-shockwave-flash" ';videoTag+='seamlesstabbing="false" ';videoTag+='allowFullScreen="true" ';videoTag+='swLiveConnect="true" ';videoTag+='allowScriptAccess="always" ';videoTag+='linkBaseURL="'+artikelurl+'?bcpid='+playerID+'&bctid='+videoID+'" ';videoTag+='additionalAdTargetingParams="'+additionalAdTargetingParams+'" ';videoTag+='pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">';videoTag+='</embed> ';videoTag+='</object> ';return videoTag;}};ape.Listeners.addListener('is_videolightbox',function(ref){motorpresse.elements.RotationTeaserLightbox.init(ref);},2);function Ape_Element_Slider(itemWidth,holder,factor,sliderWidth,itemSelector,speed,autoDelay){this.holder=holder;this.itemWidth=itemWidth;this.animationSpeed=speed;this.factor=factor;this.sliderWidth=sliderWidth;this.itemSelector=itemSelector;this.autoDelay=autoDelay;this.init();}Ape_Element_Slider.prototype={itemWidth:0,animationSpeed:400,autoDelay:null,holder:jQuery(),content:jQuery(),contentSlider:jQuery(),statusBar:jQuery(),statusBarItems:jQuery(),nextButton:jQuery(),prevButton:jQuery(),items:jQuery(),autoInterval:null,currentIndex:0,sliderWidth:0,factor:1,itemSelector:'*',autoDir:true,init:function(){var self=this;this.contentSlider=jQuery('.is_content_slider',this.holder);this.content=jQuery('.is_content',this.holder);this.items=jQuery(this.itemSelector,this.content);this.statusBar=jQuery('.is_status_bar',this.holder);this.nextButton=jQuery('.is_prev',this.holder);this.prevButton=jQuery('.is_next',this.holder);if(this.autoDelay){this.holder.bind('mouseover.slider',function(){self.stopInterval();});this.holder.bind('mouseout.slider',function(){self.startInterval();});}window.onorientationchange=function(){self.slideTo(self.currentIndex);};this.initContent();this.initStatusBar();this.initButtons();this.startInterval();},startInterval:function(){var self=this;this.stopInterval();this.autoInterval=setInterval(function(){if(self.autoDir){self.next();}else{self.prev();}var currentIndex=self.currentIndex;if(currentIndex==self.items.length-1){self.autoDir=false;}else if(currentIndex===0){self.autoDir=true;}},this.autoDelay);},stopInterval:function(){if(this.autoInterval!==null){clearInterval(this.autoInterval);this.autoInterval=null;}},initStatusBar:function(){var self=this;this.statusBarItems=jQuery('.is_statusbar_item',this.statusBar);this.statusBarItems.bind('click.slider',function(){var index=self.statusBarItems.index(jQuery(this));self.slideTo(index);});},updateSlider:function(){this.statusBarItems.removeClass('aktiv');if(this.statusBarItems[this.currentIndex]){jQuery(this.statusBarItems[this.currentIndex]).addClass('aktiv');}},initContent:function(){for(var i=0,j=this.items.length;i<j;i++){var current=jQuery(this.items[i]);current.css('width',(100/this.items.length).toFixed(6)+'%');}this.content.css('width',(100*this.items.length)+'%');},initButtons:function(){var self=this;this.nextButton.bind('click.logoslider',function(){self.next();});this.prevButton.bind('click.logoslider',function(){self.prev();});},next:function(){this.currentIndex++;this.slideTo(this.currentIndex);},prev:function(){this.currentIndex--;this.slideTo(this.currentIndex);},slideTo:function(index){if(index>this.items.length-1){index=0;}else if(index<0){index=this.items.length-1;}this.currentIndex=index;var currentWidth=parseInt(this.content.css('width').replace('px',''));var position=index*(currentWidth/this.items.length);this.contentSlider.scrollTo({left:position+'px',top:0},this.animationSpeed);this.updateSlider();}};ape.ns("motorpresse.elements");motorpresse.elements.GameMemory={imagewidth:128,openFirst:'none',openSecond:'none',of:'none',os:'none',openpairs:0,icons:0,working:0,ivwPixelStack:new Array(),animationSpeed_front:250,animationSpeed_back:250,waitingTimeToClose:500,tryouts:0,params:'',init:function(ref){ref.each(function(){var self=motorpresse.elements.GameMemory;self.icons=jQuery(this).children('div').length;jQuery(this).children('div').children('div.front').width(0).css({left:(self.imagewidth/2)+'px'});jQuery(this).children('div').children('div.back').unbind('click.umdrehen').bind('click.umdrehen',motorpresse.elements.GameMemory.memorySwitch);});},memorySwitch:function(event){var self=motorpresse.elements.GameMemory;var showFrontID=jQuery(this).parent().attr('id').split('_').pop();if(self.working===0){self.working=1;self.tryouts=self.tryouts+1;if(self.openFirst!=='none'){self.openSecond=showFrontID;}else{self.openFirst=showFrontID;}jQuery('#game_side_back_'+showFrontID).animate({width:"0px",left:(self.imagewidth/2)+'px'},self.animationSpeed_front,'',function(){jQuery('#game_side_back_'+showFrontID).hide();jQuery('#game_side_front_'+showFrontID).show().css('display','block').animate({width:self.imagewidth+"px",left:'0px'},self.animationSpeed_front,'',function(){if(self.openFirst!=='none'&&self.openSecond!=='none'){if(jQuery('#game_side_id_'+self.openFirst).val()===jQuery('#game_side_id_'+self.openSecond).val()){self.openpairs++;self.of='none';self.os='none';self.openFirst='none';self.openSecond='none';if(self.openpairs===(self.icons/2)){var href=jQuery('.game_finised_link').attr('href');jQuery('.game_finised_link').attr('href',href+'?step=form&game_parameter=tryouts:'+self.tryouts);jQuery('#game_finished_text').removeClass('hide');jQuery('#game_finished_button').removeClass('hide');}else{self.working=0;}}else{self.of=self.openFirst;self.os=self.openSecond;window.setTimeout(self.showBack,1000);self.openFirst='none';self.openSecond='none';self.working=1;}}else{self.working=0;}});});}},showBack:function(){var self=motorpresse.elements.GameMemory;jQuery('#game_side_front_'+self.of).animate({width:"0px",left:(self.imagewidth/2)+'px'},self.animationSpeed_back,'',function(){jQuery('#game_side_front_'+self.of).hide();jQuery('#game_side_back_'+self.of).show().animate({width:self.imagewidth+"px",left:'0px'},self.animationSpeed_back,'',function(){self.of='none';});});jQuery('#game_side_front_'+self.os).animate({width:"0px",left:(self.imagewidth/2)+'px'},self.animationSpeed_back,'',function(){jQuery('#game_side_front_'+self.os).hide();jQuery('#game_side_back_'+self.os).show().animate({width:self.imagewidth+"px",left:'0px'},self.animationSpeed_back,'',function(){self.os='none';self.working=0;});});},showForm:function(ref){ref.each(function(){jQuery(this).unbind('click.openForm').bind('click.openForm',function(){var url=$(this).attr('href');if(url!==''){$('#game_finished_text').remove();$('#game_finished_button span').each(function(){if(!$(this).hasClass('is_game_memory_nochmal')){$(this).remove();}});$('.is_game_memory').parent().children('p').remove();$('.is_game_memory').removeClass('bilderraetsel').html('Lade das Anmeldeformular...');jQuery.ajax({type:"GET",url:url,dataType:"text",success:function(result){$('.is_game_memory').html(result);$('.is_game_memory .is_submit').unbind('click.submit').bind('click.submit',motorpresse.elements.GameMemory.submitForm);$('html, body').animate({scrollTop:0},'slow');}});}return false;});});},submitForm:function(){if($('input[name=recaptcha_response_field]').val()===''){alert('Die eingegebene Sicherheitsabfrage ist nicht korrekt!');return false;}var url=$(this).parent().parent().parent().attr('action');var values=ape.Form.getValuesOf($(this).parent().parent().parent());jQuery.ajax({type:"POST",url:url,data:values,dataType:"text",success:function(result){$('.is_game_memory').html(result);$('.is_game_memory .is_submit').unbind('click.submit').bind('click.submit',motorpresse.elements.GameMemory.submitForm);$('html, body').animate({scrollTop:0},'slow');}});return true;}};ape.Listeners.addListener('is_game_memory',motorpresse.elements.GameMemory.init,1);ape.Listeners.addListener('game_finised_link',motorpresse.elements.GameMemory.showForm,1);ape.Namespace('motorpresse.elements.ContactElement');motorpresse.elements.ContactElement.Contact={ajaxUrl:null,form:null,ref:null,init:function(ref){var self=this;this.form=jQuery('form',ref);this.ref=ref;this.ajaxUrl=jQuery(this.form).attr('action');this.form.unbind('submit.ape_contact_form');this.form.bind('submit.ape_contact_form',function(){self.onSubmit();return false;});jQuery('input[name=empfaenger]').change(function(){if(jQuery(this).val()=='2'){jQuery('label[for=plz]').html('PLZ/Ort: *');}else{jQuery('label[for=plz]').html('PLZ/Ort:');}});},onSubmit:function(){var self=this;var values=ape.Form.getValuesOf(this.form);jQuery.ajax({url:this.ajaxUrl,data:values,type:'post',dataType:'html',success:function(data,status){self.ref.replaceWith(jQuery(data));self.init(jQuery('.is_contact_form'));jQuery('.is_submit_button').unbind('click').bind('click',ape.Form.submitButtonFormListener);scroll(0,0);}});}};ape.Listeners.addListener('is_contact_form',function(ref){motorpresse.elements.ContactElement.Contact.init(ref);},2);ape.ns('motorpresse.misc');motorpresse.misc.Logo={init:function(ref){$('img',ref).hover(function(){$('span',ref).show();},function(){$('span',ref).hide();});}};ape.Listeners.addListener('is_Logo',motorpresse.misc.Logo.init,1);
