/* 
 * The first part of this file is licensed under JQUERY license 
 *    jQuery 1.2.1 - New Wave Javascript 
 *    Copyright (c) 2007 John Resig (jquery.com) 
 *    Dual licensed under the MIT (MIT-LICENSE.txt) 
 *    and GPL (GPL-LICENSE.txt) licenses. 
 * The second part has Copyright (c) 2009 by inovia 
 *    This script is property of inovia webdevelopment services 
 *    you are not allowed to use this script, or ideas from it 
 *    without a written consent from inovia. 
 *    More information: www.inovia.nl 
*/ 
 
/* *************** FIRST PART ****************** */ 
(function(){var L=this,G,Y=L.jQuery,P=L.$,O=L.jQuery=L.$=function(e,f){return new O.fn.init(e,f)},d=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,F=/^.[^:#\[\.,]*$/;O.fn=O.prototype={init:function(e,h){e=e||document;if(e.nodeType){this[0]=e;this.length=1;this.context=e;return this}if(typeof e==="string"){var g=d.exec(e);if(g&&(g[1]||!h)){if(g[1]){e=O.clean([g[1]],h)}else{var i=document.getElementById(g[3]);if(i&&i.id!=g[3]){return O().find(e)}var f=O(i||[]);f.context=document;f.selector=e;return f}}else{return O(h).find(e)}}else{if(O.isFunction(e)){return O(document).ready(e)}}if(e.selector&&e.context){this.selector=e.selector;this.context=e.context}return this.setArray(O.isArray(e)?e:O.makeArray(e))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(e){return e===G?Array.prototype.slice.call(this):this[e]},pushStack:function(f,h,e){var g=O(f);g.prevObject=this;g.context=this.context;if(h==="find"){g.selector=this.selector+(this.selector?" ":"")+e}else{if(h){g.selector=this.selector+"."+h+"("+e+")"}}return g},setArray:function(e){this.length=0;Array.prototype.push.apply(this,e);return this},each:function(f,e){return O.each(this,f,e)},index:function(e){return O.inArray(e&&e.jquery?e[0]:e,this)},attr:function(f,h,g){var e=f;if(typeof f==="string"){if(h===G){return this[0]&&O[g||"attr"](this[0],f)}else{e={};e[f]=h}}return this.each(function(j){for(f in e){O.attr(g?this.style:this,f,O.prop(this,e[f],g,j,f))}})},css:function(e,f){if((e=="width"||e=="height")&&parseFloat(f)<0){f=G}return this.attr(e,f,"curCSS")},text:function(f){if(typeof f!=="object"&&f!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(f))}var e="";O.each(f||this,function(){O.each(this.childNodes,function(){if(this.nodeType!=8){e+=this.nodeType!=1?this.nodeValue:O.fn.text([this])}})});return e},wrapAll:function(e){if(this[0]){var f=O(e,this[0].ownerDocument).clone();if(this[0].parentNode){f.insertBefore(this[0])}f.map(function(){var g=this;while(g.firstChild){g=g.firstChild}return g}).append(this)}return this},wrapInner:function(e){return this.each(function(){O(this).contents().wrapAll(e)})},wrap:function(e){return this.each(function(){O(this).wrapAll(e)})},append:function(){return this.domManip(arguments,true,function(e){if(this.nodeType==1){this.appendChild(e)}})},prepend:function(){return this.domManip(arguments,true,function(e){if(this.nodeType==1){this.insertBefore(e,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(e){this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,false,function(e){this.parentNode.insertBefore(e,this.nextSibling)})},end:function(){return this.prevObject||O([])},push:[].push,sort:[].sort,splice:[].splice,find:function(e){if(this.length===1){var f=this.pushStack([],"find",e);f.length=0;O.find(e,this[0],f);return f}else{return this.pushStack(O.unique(O.map(this,function(g){return O.find(e,g)})),"find",e)}},clone:function(g){var e=this.map(function(){if(!O.support.noCloneEvent&&!O.isXMLDoc(this)){var i=this.outerHTML;if(!i){var j=this.ownerDocument.createElement("div");j.appendChild(this.cloneNode(true));i=j.innerHTML}return O.clean([i.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(g===true){var h=this.find("*").andSelf(),f=0;e.find("*").andSelf().each(function(){if(this.nodeName!==h[f].nodeName){return }var i=O.data(h[f],"events");for(var k in i){for(var j in i[k]){O.event.add(this,k,i[k][j],i[k][j].data)}}f++})}return e},filter:function(e){return this.pushStack(O.isFunction(e)&&O.grep(this,function(g,f){return e.call(g,f)})||O.multiFilter(e,O.grep(this,function(f){return f.nodeType===1})),"filter",e)},closest:function(e){var g=O.expr.match.POS.test(e)?O(e):null,f=0;return this.map(function(){var h=this;while(h&&h.ownerDocument){if(g?g.index(h)>-1:O(h).is(e)){O.data(h,"closest",f);return h}h=h.parentNode;f++}})},not:function(e){if(typeof e==="string"){if(F.test(e)){return this.pushStack(O.multiFilter(e,this,true),"not",e)}else{e=O.multiFilter(e,this)}}var f=e.length&&e[e.length-1]!==G&&!e.nodeType;return this.filter(function(){return f?O.inArray(this,e)<0:this!=e})},add:function(e){return this.pushStack(O.unique(O.merge(this.get(),typeof e==="string"?O(e):O.makeArray(e))))},is:function(e){return !!e&&O.multiFilter(e,this).length>0},hasClass:function(e){return !!e&&this.is("."+e)},val:function(l){if(l===G){var e=this[0];if(e){if(O.nodeName(e,"option")){return(e.attributes.value||{}).specified?e.value:e.text}if(O.nodeName(e,"select")){var j=e.selectedIndex,m=[],n=e.options,h=e.type=="select-one";if(j<0){return null}for(var f=h?j:0,k=h?j+1:n.length;f<k;f++){var g=n[f];if(g.selected){l=O(g).val();if(h){return l}m.push(l)}}return m}return(e.value||"").replace(/\r/g,"")}return G}if(typeof l==="number"){l+=""}return this.each(function(){if(this.nodeType!=1){return }if(O.isArray(l)&&/radio|checkbox/.test(this.type)){this.checked=(O.inArray(this.value,l)>=0||O.inArray(this.name,l)>=0)}else{if(O.nodeName(this,"select")){var i=O.makeArray(l);O("option",this).each(function(){this.selected=(O.inArray(this.value,i)>=0||O.inArray(this.text,i)>=0)});if(!i.length){this.selectedIndex=-1}}else{this.value=l}}})},html:function(e){return e===G?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(e)},replaceWith:function(e){return this.after(e).remove()},eq:function(e){return this.slice(e,+e+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(e){return this.pushStack(O.map(this,function(g,f){return e.call(g,f,g)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(k,o,n){if(this[0]){var j=(this[0].ownerDocument||this[0]).createDocumentFragment(),f=O.clean(k,(this[0].ownerDocument||this[0]),j),h=j.firstChild;if(h){for(var g=0,e=this.length;g<e;g++){n.call(m(this[g],h),this.length>1||g>0?j.cloneNode(true):j)}}if(f){O.each(f,Z)}}return this;function m(i,l){return o&&O.nodeName(i,"table")&&O.nodeName(l,"tr")?(i.getElementsByTagName("tbody")[0]||i.appendChild(i.ownerDocument.createElement("tbody"))):i}}};O.fn.init.prototype=O.fn;function Z(e,f){if(f.src){O.ajax({url:f.src,async:false,dataType:"script"})}else{O.globalEval(f.text||f.textContent||f.innerHTML||"")}if(f.parentNode){f.parentNode.removeChild(f)}}function E(){return +new Date}O.extend=O.fn.extend=function(){var k=arguments[0]||{},h=1,j=arguments.length,e=false,g;if(typeof k==="boolean"){e=k;k=arguments[1]||{};h=2}if(typeof k!=="object"&&!O.isFunction(k)){k={}}if(j==h){k=this;--h}for(;h<j;h++){if((g=arguments[h])!=null){for(var f in g){var l=k[f],m=g[f];if(k===m){continue}if(e&&m&&typeof m==="object"&&!m.nodeType){k[f]=O.extend(e,l||(m.length!=null?[]:{}),m)}else{if(m!==G){k[f]=m}}}}}return k};var B=/z-?index|font-?weight|opacity|zoom|line-?height/i,Q=document.defaultView||{},S=Object.prototype.toString;O.extend({noConflict:function(e){L.$=P;if(e){L.jQuery=Y}return O},isFunction:function(e){return S.call(e)==="[object Function]"},isArray:function(e){return S.call(e)==="[object Array]"},isXMLDoc:function(e){return e.nodeType===9&&e.documentElement.nodeName!=="HTML"||!!e.ownerDocument&&O.isXMLDoc(e.ownerDocument)},globalEval:function(g){if(g&&/\S/.test(g)){var f=document.getElementsByTagName("head")[0]||document.documentElement,e=document.createElement("script");e.type="text/javascript";if(O.support.scriptEval){e.appendChild(document.createTextNode(g))}else{e.text=g}f.insertBefore(e,f.firstChild);f.removeChild(e)}},nodeName:function(f,e){return f.nodeName&&f.nodeName.toUpperCase()==e.toUpperCase()},each:function(g,l,f){var e,h=0,j=g.length;if(f){if(j===G){for(e in g){if(l.apply(g[e],f)===false){break}}}else{for(;h<j;){if(l.apply(g[h++],f)===false){break}}}}else{if(j===G){for(e in g){if(l.call(g[e],e,g[e])===false){break}}}else{for(var k=g[0];h<j&&l.call(k,h,k)!==false;k=g[++h]){}}}return g},prop:function(h,j,g,f,e){if(O.isFunction(j)){j=j.call(h,f)}return typeof j==="number"&&g=="curCSS"&&!B.test(e)?j+"px":j},className:{add:function(e,f){O.each((f||"").split(/\s+/),function(g,h){if(e.nodeType==1&&!O.className.has(e.className,h)){e.className+=(e.className?" ":"")+h}})},remove:function(e,f){if(e.nodeType==1){e.className=f!==G?O.grep(e.className.split(/\s+/),function(g){return !O.className.has(f,g)}).join(" "):""}},has:function(f,e){return f&&O.inArray(e,(f.className||f).toString().split(/\s+/))>-1}},swap:function(h,g,i){var e={};for(var f in g){e[f]=h.style[f];h.style[f]=g[f]}i.call(h);for(var f in g){h.style[f]=e[f]}},css:function(h,f,j,e){if(f=="width"||f=="height"){var l,g={position:"absolute",visibility:"hidden",display:"block"},k=f=="width"?["Left","Right"]:["Top","Bottom"];function i(){l=f=="width"?h.offsetWidth:h.offsetHeight;if(e==="border"){return }O.each(k,function(){if(!e){l-=parseFloat(O.curCSS(h,"padding"+this,true))||0}if(e==="margin"){l+=parseFloat(O.curCSS(h,"margin"+this,true))||0}else{l-=parseFloat(O.curCSS(h,"border"+this+"Width",true))||0}})}if(h.offsetWidth!==0){i()}else{O.swap(h,g,i)}return Math.max(0,Math.round(l))}return O.curCSS(h,f,j)},curCSS:function(i,f,g){var l,e=i.style;if(f=="opacity"&&!O.support.opacity){l=O.attr(e,"opacity");return l==""?"1":l}if(f.match(/float/i)){f=W}if(!g&&e&&e[f]){l=e[f]}else{if(Q.getComputedStyle){if(f.match(/float/i)){f="float"}f=f.replace(/([A-Z])/g,"-$1").toLowerCase();var m=Q.getComputedStyle(i,null);if(m){l=m.getPropertyValue(f)}if(f=="opacity"&&l==""){l="1"}}else{if(i.currentStyle){var j=f.replace(/\-(\w)/g,function(n,o){return o.toUpperCase()});l=i.currentStyle[f]||i.currentStyle[j];if(!/^\d+(px)?$/i.test(l)&&/^\d/.test(l)){var h=e.left,k=i.runtimeStyle.left;i.runtimeStyle.left=i.currentStyle.left;e.left=l||0;l=e.pixelLeft+"px";e.left=h;i.runtimeStyle.left=k}}}}return l},clean:function(f,l,j){l=l||document;if(typeof l.createElement==="undefined"){l=l.ownerDocument||l[0]&&l[0].ownerDocument||document}if(!j&&f.length===1&&typeof f[0]==="string"){var h=/^<(\w+)\s*\/?>$/.exec(f[0]);if(h){return[l.createElement(h[1])]}}var g=[],e=[],m=l.createElement("div");O.each(f,function(q,t){if(typeof t==="number"){t+=""}if(!t){return }if(typeof t==="string"){t=t.replace(/(<(\w+)[^>]*?)\/>/g,function(u,v,i){return i.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?u:v+"></"+i+">"});var p=t.replace(/^\s+/,"").substring(0,10).toLowerCase();var r=!p.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!p.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||p.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!p.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!p.indexOf("<td")||!p.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!p.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!O.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];m.innerHTML=r[1]+t+r[2];while(r[0]--){m=m.lastChild}if(!O.support.tbody){var s=/<tbody/i.test(t),o=!p.indexOf("<table")&&!s?m.firstChild&&m.firstChild.childNodes:r[1]=="<table>"&&!s?m.childNodes:[];for(var n=o.length-1;n>=0;--n){if(O.nodeName(o[n],"tbody")&&!o[n].childNodes.length){o[n].parentNode.removeChild(o[n])}}}if(!O.support.leadingWhitespace&&/^\s/.test(t)){m.insertBefore(l.createTextNode(t.match(/^\s*/)[0]),m.firstChild)}t=O.makeArray(m.childNodes)}if(t.nodeType){g.push(t)}else{g=O.merge(g,t)}});if(j){for(var k=0;g[k];k++){if(O.nodeName(g[k],"script")&&(!g[k].type||g[k].type.toLowerCase()==="text/javascript")){e.push(g[k].parentNode?g[k].parentNode.removeChild(g[k]):g[k])}else{if(g[k].nodeType===1){g.splice.apply(g,[k+1,0].concat(O.makeArray(g[k].getElementsByTagName("script"))))}j.appendChild(g[k])}}return e}return g},attr:function(j,g,k){if(!j||j.nodeType==3||j.nodeType==8){return G}var h=!O.isXMLDoc(j),l=k!==G;g=h&&O.props[g]||g;if(j.tagName){var f=/href|src|style/.test(g);if(g=="selected"&&j.parentNode){j.parentNode.selectedIndex}if(g in j&&h&&!f){if(l){if(g=="type"&&O.nodeName(j,"input")&&j.parentNode){throw"type property can't be changed"}j[g]=k}if(O.nodeName(j,"form")&&j.getAttributeNode(g)){return j.getAttributeNode(g).nodeValue}if(g=="tabIndex"){var i=j.getAttributeNode("tabIndex");return i&&i.specified?i.value:j.nodeName.match(/(button|input|object|select|textarea)/i)?0:j.nodeName.match(/^(a|area)$/i)&&j.href?0:G}return j[g]}if(!O.support.style&&h&&g=="style"){return O.attr(j.style,"cssText",k)}if(l){j.setAttribute(g,""+k)}var e=!O.support.hrefNormalized&&h&&f?j.getAttribute(g,2):j.getAttribute(g);return e===null?G:e}if(!O.support.opacity&&g=="opacity"){if(l){j.zoom=1;j.filter=(j.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(k)+""=="NaN"?"":"alpha(opacity="+k*100+")")}return j.filter&&j.filter.indexOf("opacity=")>=0?(parseFloat(j.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}g=g.replace(/-([a-z])/ig,function(m,n){return n.toUpperCase()});if(l){j[g]=k}return j[g]},trim:function(e){return(e||"").replace(/^\s+|\s+$/g,"")},makeArray:function(g){var e=[];if(g!=null){var f=g.length;if(f==null||typeof g==="string"||O.isFunction(g)||g.setInterval){e[0]=g}else{while(f){e[--f]=g[f]}}}return e},inArray:function(g,h){for(var e=0,f=h.length;e<f;e++){if(h[e]===g){return e}}return -1},merge:function(h,e){var f=0,g,j=h.length;if(!O.support.getAll){while((g=e[f++])!=null){if(g.nodeType!=8){h[j++]=g}}}else{while((g=e[f++])!=null){h[j++]=g}}return h},unique:function(m){var g=[],f={};try{for(var h=0,j=m.length;h<j;h++){var l=O.data(m[h]);if(!f[l]){f[l]=true;g.push(m[h])}}}catch(k){g=m}return g},grep:function(f,k,e){var g=[];for(var h=0,j=f.length;h<j;h++){if(!e!=!k(f[h],h)){g.push(f[h])}}return g},map:function(e,k){var f=[];for(var g=0,h=e.length;g<h;g++){var j=k(e[g],g);if(j!=null){f[f.length]=j}}return f.concat.apply([],f)}});var c=navigator.userAgent.toLowerCase();O.browser={version:(c.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(c),opera:/opera/.test(c),msie:/msie/.test(c)&&!/opera/.test(c),mozilla:/mozilla/.test(c)&&!/(compatible|webkit)/.test(c)};O.each({parent:function(e){return e.parentNode},parents:function(e){return O.dir(e,"parentNode")},next:function(e){return O.nth(e,2,"nextSibling")},prev:function(e){return O.nth(e,2,"previousSibling")},nextAll:function(e){return O.dir(e,"nextSibling")},prevAll:function(e){return O.dir(e,"previousSibling")},siblings:function(e){return O.sibling(e.parentNode.firstChild,e)},children:function(e){return O.sibling(e.firstChild)},contents:function(e){return O.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:O.makeArray(e.childNodes)}},function(e,f){O.fn[e]=function(g){var h=O.map(this,f);if(g&&typeof g=="string"){h=O.multiFilter(g,h)}return this.pushStack(O.unique(h),e,g)}});O.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,f){O.fn[e]=function(g){var k=[],n=O(g);for(var m=0,h=n.length;m<h;m++){var j=(m>0?this.clone(true):this).get();O.fn[f].apply(O(n[m]),j);k=k.concat(j)}return this.pushStack(k,e,g)}});O.each({removeAttr:function(e){O.attr(this,e,"");if(this.nodeType==1){this.removeAttribute(e)}},addClass:function(e){O.className.add(this,e)},removeClass:function(e){O.className.remove(this,e)},toggleClass:function(f,e){if(typeof e!=="boolean"){e=!O.className.has(this,f)}O.className[e?"add":"remove"](this,f)},remove:function(e){if(!e||O.filter(e,[this]).length){O("*",this).add([this]).each(function(){O.event.remove(this);O.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){O(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(e,f){O.fn[e]=function(){return this.each(f,arguments)}});function J(e,f){return e[0]&&parseInt(O.curCSS(e[0],f,true),10)||0}var H="jQuery"+E(),V=0,a={};O.extend({cache:{},data:function(f,e,g){f=f==L?a:f;var h=f[H];if(!h){h=f[H]=++V}if(e&&!O.cache[h]){O.cache[h]={}}if(g!==G){O.cache[h][e]=g}return e?O.cache[h][e]:h},removeData:function(g,f){g=g==L?a:g;var i=g[H];if(f){if(O.cache[i]){delete O.cache[i][f];f="";for(f in O.cache[i]){break}if(!f){O.removeData(g)}}}else{try{delete g[H]}catch(h){if(g.removeAttribute){g.removeAttribute(H)}}delete O.cache[i]}},queue:function(f,e,h){if(f){e=(e||"fx")+"queue";var g=O.data(f,e);if(!g||O.isArray(h)){g=O.data(f,e,O.makeArray(h))}else{if(h){g.push(h)}}}return g},dequeue:function(h,g){var e=O.queue(h,g),f=e.shift();if(!g||g==="fx"){f=e[0]}if(f!==G){f.call(h)}}});O.fn.extend({data:function(e,g){var h=e.split(".");h[1]=h[1]?"."+h[1]:"";if(g===G){var f=this.triggerHandler("getData"+h[1]+"!",[h[0]]);if(f===G&&this.length){f=O.data(this[0],e)}return f===G&&h[1]?this.data(h[0]):f}else{return this.trigger("setData"+h[1]+"!",[h[0],g]).each(function(){O.data(this,e,g)})}},removeData:function(e){return this.each(function(){O.removeData(this,e)})},queue:function(e,f){if(typeof e!=="string"){f=e;e="fx"}if(f===G){return O.queue(this[0],e)}return this.each(function(){var g=O.queue(this,e,f);if(e=="fx"&&g.length==1){g[0].call(this)}})},dequeue:function(e){return this.each(function(){O.dequeue(this,e)})}});(function(){var s=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,m=0,i=Object.prototype.toString;var g=function(y,u,AB,AC){AB=AB||[];u=u||document;if(u.nodeType!==1&&u.nodeType!==9){return[]}if(!y||typeof y!=="string"){return AB}var z=[],w,AF,AI,e,AD,v,x=true;s.lastIndex=0;while((w=s.exec(y))!==null){z.push(w[1]);if(w[2]){v=RegExp.rightContext;break}}if(z.length>1&&n.exec(y)){if(z.length===2&&j.relative[z[0]]){AF=k(z[0]+z[1],u)}else{AF=j.relative[z[0]]?[u]:g(z.shift(),u);while(z.length){y=z.shift();if(j.relative[y]){y+=z.shift()}AF=k(y,AF)}}}else{var AE=AC?{expr:z.pop(),set:f(AC)}:g.find(z.pop(),z.length===1&&u.parentNode?u.parentNode:u,r(u));AF=g.filter(AE.expr,AE.set);if(z.length>0){AI=f(AF)}else{x=false}while(z.length){var AH=z.pop(),AG=AH;if(!j.relative[AH]){AH=""}else{AG=z.pop()}if(AG==null){AG=u}j.relative[AH](AI,AG,r(u))}}if(!AI){AI=AF}if(!AI){throw"Syntax error, unrecognized expression: "+(AH||y)}if(i.call(AI)==="[object Array]"){if(!x){AB.push.apply(AB,AI)}else{if(u.nodeType===1){for(var AA=0;AI[AA]!=null;AA++){if(AI[AA]&&(AI[AA]===true||AI[AA].nodeType===1&&l(u,AI[AA]))){AB.push(AF[AA])}}}else{for(var AA=0;AI[AA]!=null;AA++){if(AI[AA]&&AI[AA].nodeType===1){AB.push(AF[AA])}}}}}else{f(AI,AB)}if(v){g(v,u,AB,AC);if(h){hasDuplicate=false;AB.sort(h);if(hasDuplicate){for(var AA=1;AA<AB.length;AA++){if(AB[AA]===AB[AA-1]){AB.splice(AA--,1)}}}}}return AB};g.matches=function(e,u){return g(e,null,null,u)};g.find=function(AA,e,AB){var z,x;if(!AA){return[]}for(var w=0,v=j.order.length;w<v;w++){var y=j.order[w],x;if((x=j.match[y].exec(AA))){var u=RegExp.leftContext;if(u.substr(u.length-1)!=="\\"){x[1]=(x[1]||"").replace(/\\/g,"");z=j.find[y](x,e,AB);if(z!=null){AA=AA.replace(j.match[y],"");break}}}}if(!z){z=e.getElementsByTagName("*")}return{set:z,expr:AA}};g.filter=function(AD,AC,AG,w){var v=AD,AI=[],AA=AC,y,e,z=AC&&AC[0]&&r(AC[0]);while(AD&&AC.length){for(var AB in j.filter){if((y=j.match[AB].exec(AD))!=null){var u=j.filter[AB],AH,AF;e=false;if(AA==AI){AI=[]}if(j.preFilter[AB]){y=j.preFilter[AB](y,AA,AG,AI,w,z);if(!y){e=AH=true}else{if(y===true){continue}}}if(y){for(var x=0;(AF=AA[x])!=null;x++){if(AF){AH=u(AF,y,x,AA);var AE=w^!!AH;if(AG&&AH!=null){if(AE){e=true}else{AA[x]=false}}else{if(AE){AI.push(AF);e=true}}}}}if(AH!==G){if(!AG){AA=AI}AD=AD.replace(j.match[AB],"");if(!e){return[]}break}}}if(AD==v){if(e==null){throw"Syntax error, unrecognized expression: "+AD}else{break}}v=AD}return AA};var j=g.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(e){return e.getAttribute("href")}},relative:{"+":function(AA,e,z){var x=typeof e==="string",AB=x&&!/\W/.test(e),y=x&&!AB;if(AB&&!z){e=e.toUpperCase()}for(var w=0,v=AA.length,u;w<v;w++){if((u=AA[w])){while((u=u.previousSibling)&&u.nodeType!==1){}AA[w]=y||u&&u.nodeName===e?u||false:u===e}}if(y){g.filter(e,AA,true)}},">":function(z,u,AA){var x=typeof u==="string";if(x&&!/\W/.test(u)){u=AA?u:u.toUpperCase();for(var v=0,e=z.length;v<e;v++){var y=z[v];if(y){var w=y.parentNode;z[v]=w.nodeName===u?w:false}}}else{for(var v=0,e=z.length;v<e;v++){var y=z[v];if(y){z[v]=x?y.parentNode:y.parentNode===u}}if(x){g.filter(u,z,true)}}},"":function(w,u,y){var v=m++,e=t;if(!u.match(/\W/)){var x=u=y?u:u.toUpperCase();e=q}e("parentNode",u,v,w,x,y)},"~":function(w,u,y){var v=m++,e=t;if(typeof u==="string"&&!u.match(/\W/)){var x=u=y?u:u.toUpperCase();e=q}e("previousSibling",u,v,w,x,y)}},find:{ID:function(u,v,w){if(typeof v.getElementById!=="undefined"&&!w){var e=v.getElementById(u[1]);return e?[e]:[]}},NAME:function(v,y,z){if(typeof y.getElementsByName!=="undefined"){var u=[],x=y.getElementsByName(v[1]);for(var w=0,e=x.length;w<e;w++){if(x[w].getAttribute("name")===v[1]){u.push(x[w])}}return u.length===0?null:u}},TAG:function(e,u){return u.getElementsByTagName(e[1])}},preFilter:{CLASS:function(w,u,v,e,z,AA){w=" "+w[1].replace(/\\/g,"")+" ";if(AA){return w}for(var x=0,y;(y=u[x])!=null;x++){if(y){if(z^(y.className&&(" "+y.className+" ").indexOf(w)>=0)){if(!v){e.push(y)}}else{if(v){u[x]=false}}}}return false},ID:function(e){return e[1].replace(/\\/g,"")},TAG:function(u,e){for(var v=0;e[v]===false;v++){}return e[v]&&r(e[v])?u[1]:u[1].toUpperCase()},CHILD:function(e){if(e[1]=="nth"){var u=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(e[2]=="even"&&"2n"||e[2]=="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=(u[1]+(u[2]||1))-0;e[3]=u[3]-0}e[0]=m++;return e},ATTR:function(x,u,v,e,y,z){var w=x[1].replace(/\\/g,"");if(!z&&j.attrMap[w]){x[1]=j.attrMap[w]}if(x[2]==="~="){x[4]=" "+x[4]+" "}return x},PSEUDO:function(x,u,v,e,y){if(x[1]==="not"){if(x[3].match(s).length>1||/^\w/.test(x[3])){x[3]=g(x[3],null,null,u)}else{var w=g.filter(x[3],u,v,true^y);if(!v){e.push.apply(e,w)}return false}}else{if(j.match.POS.test(x[0])||j.match.CHILD.test(x[0])){return true}}return x},POS:function(e){e.unshift(true);return e}},filters:{enabled:function(e){return e.disabled===false&&e.type!=="hidden"},disabled:function(e){return e.disabled===true},checked:function(e){return e.checked===true},selected:function(e){e.parentNode.selectedIndex;return e.selected===true},parent:function(e){return !!e.firstChild},empty:function(e){return !e.firstChild},has:function(v,u,e){return !!g(e[3],v).length},header:function(e){return/h\d/i.test(e.nodeName)},text:function(e){return"text"===e.type},radio:function(e){return"radio"===e.type},checkbox:function(e){return"checkbox"===e.type},file:function(e){return"file"===e.type},password:function(e){return"password"===e.type},submit:function(e){return"submit"===e.type},image:function(e){return"image"===e.type},reset:function(e){return"reset"===e.type},button:function(e){return"button"===e.type||e.nodeName.toUpperCase()==="BUTTON"},input:function(e){return/input|select|textarea|button/i.test(e.nodeName)}},setFilters:{first:function(u,e){return e===0},last:function(v,u,e,w){return u===w.length-1},even:function(u,e){return e%2===0},odd:function(u,e){return e%2===1},lt:function(v,u,e){return u<e[3]-0},gt:function(v,u,e){return u>e[3]-0},nth:function(v,u,e){return e[3]-0==u},eq:function(v,u,e){return e[3]-0==u}},filter:{PSEUDO:function(z,v,w,AA){var u=v[1],x=j.filters[u];if(x){return x(z,w,v,AA)}else{if(u==="contains"){return(z.textContent||z.innerText||"").indexOf(v[3])>=0}else{if(u==="not"){var y=v[3];for(var w=0,e=y.length;w<e;w++){if(y[w]===z){return false}}return true}}}},CHILD:function(e,w){var z=w[1],u=e;switch(z){case"only":case"first":while(u=u.previousSibling){if(u.nodeType===1){return false}}if(z=="first"){return true}u=e;case"last":while(u=u.nextSibling){if(u.nodeType===1){return false}}return true;case"nth":var v=w[2],AC=w[3];if(v==1&&AC==0){return true}var y=w[0],AB=e.parentNode;if(AB&&(AB.sizcache!==y||!e.nodeIndex)){var x=0;for(u=AB.firstChild;u;u=u.nextSibling){if(u.nodeType===1){u.nodeIndex=++x}}AB.sizcache=y}var AA=e.nodeIndex-AC;if(v==0){return AA==0}else{return(AA%v==0&&AA/v>=0)}}},ID:function(u,e){return u.nodeType===1&&u.getAttribute("id")===e},TAG:function(u,e){return(e==="*"&&u.nodeType===1)||u.nodeName===e},CLASS:function(u,e){return(" "+(u.className||u.getAttribute("class"))+" ").indexOf(e)>-1},ATTR:function(y,w){var v=w[1],e=j.attrHandle[v]?j.attrHandle[v](y):y[v]!=null?y[v]:y.getAttribute(v),z=e+"",x=w[2],u=w[4];return e==null?x==="!=":x==="="?z===u:x==="*="?z.indexOf(u)>=0:x==="~="?(" "+z+" ").indexOf(u)>=0:!u?z&&e!==false:x==="!="?z!=u:x==="^="?z.indexOf(u)===0:x==="$="?z.substr(z.length-u.length)===u:x==="|="?z===u||z.substr(0,u.length+1)===u+"-":false},POS:function(x,u,v,y){var e=u[2],w=j.setFilters[e];if(w){return w(x,v,u,y)}}}};var n=j.match.POS;for(var p in j.match){j.match[p]=RegExp(j.match[p].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var f=function(u,e){u=Array.prototype.slice.call(u);if(e){e.push.apply(e,u);return e}return u};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(o){f=function(x,w){var u=w||[];if(i.call(x)==="[object Array]"){Array.prototype.push.apply(u,x)}else{if(typeof x.length==="number"){for(var v=0,e=x.length;v<e;v++){u.push(x[v])}}else{for(var v=0;x[v];v++){u.push(x[v])}}}return u}}var h;if(document.documentElement.compareDocumentPosition){h=function(u,e){var v=u.compareDocumentPosition(e)&4?-1:u===e?0:1;if(v===0){hasDuplicate=true}return v}}else{if("sourceIndex" in document.documentElement){h=function(u,e){var v=u.sourceIndex-e.sourceIndex;if(v===0){hasDuplicate=true}return v}}else{if(document.createRange){h=function(w,u){var v=w.ownerDocument.createRange(),e=u.ownerDocument.createRange();v.selectNode(w);v.collapse(true);e.selectNode(u);e.collapse(true);var x=v.compareBoundaryPoints(Range.START_TO_END,e);if(x===0){hasDuplicate=true}return x}}}}(function(){var u=document.createElement("form"),v="script"+(new Date).getTime();u.innerHTML="<input name='"+v+"'/>";var e=document.documentElement;e.insertBefore(u,e.firstChild);if(!!document.getElementById(v)){j.find.ID=function(x,y,z){if(typeof y.getElementById!=="undefined"&&!z){var w=y.getElementById(x[1]);return w?w.id===x[1]||typeof w.getAttributeNode!=="undefined"&&w.getAttributeNode("id").nodeValue===x[1]?[w]:G:[]}};j.filter.ID=function(y,w){var x=typeof y.getAttributeNode!=="undefined"&&y.getAttributeNode("id");return y.nodeType===1&&x&&x.nodeValue===w}}e.removeChild(u)})();(function(){var e=document.createElement("div");e.appendChild(document.createComment(""));if(e.getElementsByTagName("*").length>0){j.find.TAG=function(u,y){var x=y.getElementsByTagName(u[1]);if(u[1]==="*"){var w=[];for(var v=0;x[v];v++){if(x[v].nodeType===1){w.push(x[v])}}x=w}return x}}e.innerHTML="<a href='#'></a>";if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("href")!=="#"){j.attrHandle.href=function(u){return u.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var e=g,u=document.createElement("div");u.innerHTML="<p class='TEST'></p>";if(u.querySelectorAll&&u.querySelectorAll(".TEST").length===0){return }g=function(y,x,v,w){x=x||document;if(!w&&x.nodeType===9&&!r(x)){try{return f(x.querySelectorAll(y),v)}catch(z){}}return e(y,x,v,w)};g.find=e.find;g.filter=e.filter;g.selectors=e.selectors;g.matches=e.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var e=document.createElement("div");e.innerHTML="<div class='test e'></div><div class='test'></div>";if(e.getElementsByClassName("e").length===0){return }e.lastChild.className="e";if(e.getElementsByClassName("e").length===1){return }j.order.splice(1,0,"CLASS");j.find.CLASS=function(u,v,w){if(typeof v.getElementsByClassName!=="undefined"&&!w){return v.getElementsByClassName(u[1])}}})()}function q(u,z,y,AD,AA,AC){var AB=u=="previousSibling"&&!AC;for(var w=0,v=AD.length;w<v;w++){var e=AD[w];if(e){if(AB&&e.nodeType===1){e.sizcache=y;e.sizset=w}e=e[u];var x=false;while(e){if(e.sizcache===y){x=AD[e.sizset];break}if(e.nodeType===1&&!AC){e.sizcache=y;e.sizset=w}if(e.nodeName===z){x=e;break}e=e[u]}AD[w]=x}}}function t(u,z,y,AD,AA,AC){var AB=u=="previousSibling"&&!AC;for(var w=0,v=AD.length;w<v;w++){var e=AD[w];if(e){if(AB&&e.nodeType===1){e.sizcache=y;e.sizset=w}e=e[u];var x=false;while(e){if(e.sizcache===y){x=AD[e.sizset];break}if(e.nodeType===1){if(!AC){e.sizcache=y;e.sizset=w}if(typeof z!=="string"){if(e===z){x=true;break}}else{if(g.filter(z,[e]).length>0){x=e;break}}}e=e[u]}AD[w]=x}}}var l=document.compareDocumentPosition?function(u,e){return u.compareDocumentPosition(e)&16}:function(u,e){return u!==e&&(u.contains?u.contains(e):true)};var r=function(e){return e.nodeType===9&&e.documentElement.nodeName!=="HTML"||!!e.ownerDocument&&r(e.ownerDocument)};var k=function(e,AA){var w=[],x="",y,v=AA.nodeType?[AA]:AA;while((y=j.match.PSEUDO.exec(e))){x+=y[0];e=e.replace(j.match.PSEUDO,"")}e=j.relative[e]?e+"*":e;for(var z=0,u=v.length;z<u;z++){g(e,v[z],w)}return g.filter(x,w)};O.find=g;O.filter=g.filter;O.expr=g.selectors;O.expr[":"]=O.expr.filters;g.selectors.filters.hidden=function(e){return e.offsetWidth===0||e.offsetHeight===0};g.selectors.filters.visible=function(e){return e.offsetWidth>0||e.offsetHeight>0};g.selectors.filters.animated=function(e){return O.grep(O.timers,function(u){return e===u.elem}).length};O.multiFilter=function(v,e,u){if(u){v=":not("+v+")"}return g.matches(v,e)};O.dir=function(v,u){var e=[],w=v[u];while(w&&w!=document){if(w.nodeType==1){e.push(w)}w=w[u]}return e};O.nth=function(x,e,v,w){e=e||1;var u=0;for(;x;x=x[v]){if(x.nodeType==1&&++u==e){break}}return x};O.sibling=function(v,u){var e=[];for(;v;v=v.nextSibling){if(v.nodeType==1&&v!=u){e.push(v)}}return e};return ;L.Sizzle=g})();O.event={add:function(i,f,h,k){if(i.nodeType==3||i.nodeType==8){return }if(i.setInterval&&i!=L){i=L}if(!h.guid){h.guid=this.guid++}if(k!==G){var g=h;h=this.proxy(g);h.data=k}var e=O.data(i,"events")||O.data(i,"events",{}),j=O.data(i,"handle")||O.data(i,"handle",function(){return typeof O!=="undefined"&&!O.event.triggered?O.event.handle.apply(arguments.callee.elem,arguments):G});j.elem=i;O.each(f.split(/\s+/),function(m,n){var o=n.split(".");n=o.shift();h.type=o.slice().sort().join(".");var l=e[n];if(O.event.specialAll[n]){O.event.specialAll[n].setup.call(i,k,o)}if(!l){l=e[n]={};if(!O.event.special[n]||O.event.special[n].setup.call(i,k,o)===false){if(i.addEventListener){i.addEventListener(n,j,false)}else{if(i.attachEvent){i.attachEvent("on"+n,j)}}}}l[h.guid]=h;O.event.global[n]=true});i=null},guid:1,global:{},remove:function(k,h,j){if(k.nodeType==3||k.nodeType==8){return }var g=O.data(k,"events"),f,e;if(g){if(h===G||(typeof h==="string"&&h.charAt(0)==".")){for(var i in g){this.remove(k,i+(h||""))}}else{if(h.type){j=h.handler;h=h.type}O.each(h.split(/\s+/),function(m,o){var q=o.split(".");o=q.shift();var n=RegExp("(^|\\.)"+q.slice().sort().join(".*\\.")+"(\\.|$)");if(g[o]){if(j){delete g[o][j.guid]}else{for(var p in g[o]){if(n.test(g[o][p].type)){delete g[o][p]}}}if(O.event.specialAll[o]){O.event.specialAll[o].teardown.call(k,q)}for(f in g[o]){break}if(!f){if(!O.event.special[o]||O.event.special[o].teardown.call(k,q)===false){if(k.removeEventListener){k.removeEventListener(o,O.data(k,"handle"),false)}else{if(k.detachEvent){k.detachEvent("on"+o,O.data(k,"handle"))}}}f=null;delete g[o]}}})}for(f in g){break}if(!f){var l=O.data(k,"handle");if(l){l.elem=null}O.removeData(k,"events");O.removeData(k,"handle")}}},trigger:function(j,l,i,f){var h=j.type||j;if(!f){j=typeof j==="object"?j[H]?j:O.extend(O.Event(h),j):O.Event(h);if(h.indexOf("!")>=0){j.type=h=h.slice(0,-1);j.exclusive=true}if(!i){j.stopPropagation();if(this.global[h]){O.each(O.cache,function(){if(this.events&&this.events[h]){O.event.trigger(j,l,this.handle.elem)}})}}if(!i||i.nodeType==3||i.nodeType==8){return G}j.result=G;j.target=i;l=O.makeArray(l);l.unshift(j)}j.currentTarget=i;var k=O.data(i,"handle");if(k){k.apply(i,l)}if((!i[h]||(O.nodeName(i,"a")&&h=="click"))&&i["on"+h]&&i["on"+h].apply(i,l)===false){j.result=false}if(!f&&i[h]&&!j.isDefaultPrevented()&&!(O.nodeName(i,"a")&&h=="click")){this.triggered=true;try{i[h]()}catch(m){}}this.triggered=false;if(!j.isPropagationStopped()){var g=i.parentNode||i.ownerDocument;if(g){O.event.trigger(j,l,g,true)}}},handle:function(l){var k,e;l=arguments[0]=O.event.fix(l||L.event);l.currentTarget=this;var m=l.type.split(".");l.type=m.shift();k=!m.length&&!l.exclusive;var i=RegExp("(^|\\.)"+m.slice().sort().join(".*\\.")+"(\\.|$)");e=(O.data(this,"events")||{})[l.type];for(var g in e){var h=e[g];if(k||i.test(h.type)){l.handler=h;l.data=h.data;var f=h.apply(this,arguments);if(f!==G){l.result=f;if(f===false){l.preventDefault();l.stopPropagation()}}if(l.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(h){if(h[H]){return h}var f=h;h=O.Event(f);for(var g=this.props.length,k;g;){k=this.props[--g];h[k]=f[k]}if(!h.target){h.target=h.srcElement||document}if(h.target.nodeType==3){h.target=h.target.parentNode}if(!h.relatedTarget&&h.fromElement){h.relatedTarget=h.fromElement==h.target?h.toElement:h.fromElement}if(h.pageX==null&&h.clientX!=null){var j=document.documentElement,e=document.body;h.pageX=h.clientX+(j&&j.scrollLeft||e&&e.scrollLeft||0)-(j.clientLeft||0);h.pageY=h.clientY+(j&&j.scrollTop||e&&e.scrollTop||0)-(j.clientTop||0)}if(!h.which&&((h.charCode||h.charCode===0)?h.charCode:h.keyCode)){h.which=h.charCode||h.keyCode}if(!h.metaKey&&h.ctrlKey){h.metaKey=h.ctrlKey}if(!h.which&&h.button){h.which=(h.button&1?1:(h.button&2?3:(h.button&4?2:0)))}return h},proxy:function(f,e){e=e||function(){return f.apply(this,arguments)};e.guid=f.guid=f.guid||e.guid||this.guid++;return e},special:{ready:{setup:b,teardown:function(){}}},specialAll:{live:{setup:function(e,f){O.event.add(this,f[0],C)},teardown:function(g){if(g.length){var e=0,f=RegExp("(^|\\.)"+g[0]+"(\\.|$)");O.each((O.data(this,"events").live||{}),function(){if(f.test(this.type)){e++}});if(e<1){O.event.remove(this,g[0],C)}}}}}};O.Event=function(e){if(!this.preventDefault){return new O.Event(e)}if(e&&e.type){this.originalEvent=e;this.type=e.type}else{this.type=e}this.timeStamp=E();this[H]=true};function K(){return false}function U(){return true}O.Event.prototype={preventDefault:function(){this.isDefaultPrevented=U;var f=this.originalEvent;if(!f){return }if(f.preventDefault){f.preventDefault()}f.returnValue=false},stopPropagation:function(){this.isPropagationStopped=U;var f=this.originalEvent;if(!f){return }if(f.stopPropagation){f.stopPropagation()}f.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=U;this.stopPropagation()},isDefaultPrevented:K,isPropagationStopped:K,isImmediatePropagationStopped:K};var A=function(g){var f=g.relatedTarget;while(f&&f!=this){try{f=f.parentNode}catch(h){f=this}}if(f!=this){g.type=g.data;O.event.handle.apply(this,arguments)}};O.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(f,e){O.event.special[e]={setup:function(){O.event.add(this,f,A,e)},teardown:function(){O.event.remove(this,f,A)}}});O.fn.extend({bind:function(f,g,e){return f=="unload"?this.one(f,g,e):this.each(function(){O.event.add(this,f,e||g,e&&g)})},one:function(g,h,f){var e=O.event.proxy(f||h,function(i){O(this).unbind(i,e);return(f||h).apply(this,arguments)});return this.each(function(){O.event.add(this,g,e,f&&h)})},unbind:function(f,e){return this.each(function(){O.event.remove(this,f,e)})},trigger:function(e,f){return this.each(function(){O.event.trigger(e,f,this)})},triggerHandler:function(e,g){if(this[0]){var f=O.Event(e);f.preventDefault();f.stopPropagation();O.event.trigger(f,g,this[0]);return f.result}},toggle:function(g){var e=arguments,f=1;while(f<e.length){O.event.proxy(g,e[f++])}return this.click(O.event.proxy(g,function(h){this.lastToggle=(this.lastToggle||0)%f;h.preventDefault();return e[this.lastToggle++].apply(this,arguments)||false}))},hover:function(e,f){return this.mouseenter(e).mouseleave(f)},ready:function(e){b();if(O.isReady){e.call(document,O)}else{O.readyList.push(e)}return this},live:function(g,f){var e=O.event.proxy(f);e.guid+=this.selector+g;O(document).bind(I(g,this.selector),this.selector,e);return this},die:function(f,e){O(document).unbind(I(f,this.selector),e?{guid:e.guid+this.selector+f}:null);return this}});function C(h){var e=RegExp("(^|\\.)"+h.type+"(\\.|$)"),g=true,f=[];O.each(O.data(this,"events").live||[],function(j,k){if(e.test(k.type)){var l=O(h.target).closest(k.data)[0];if(l){f.push({elem:l,fn:k})}}});f.sort(function(j,i){return O.data(j.elem,"closest")-O.data(i.elem,"closest")});O.each(f,function(){if(this.fn.call(this.elem,h,this.fn.data)===false){return(g=false)}});return g}function I(f,e){return["live",f,e.replace(/\./g,"`").replace(/ /g,"|")].join(".")}O.extend({isReady:false,readyList:[],ready:function(){if(!O.isReady){O.isReady=true;if(O.readyList){O.each(O.readyList,function(){this.call(document,O)});O.readyList=null}O(document).triggerHandler("ready")}}});var X=false;function b(){if(X){return }X=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);O.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);O.ready()}});if(document.documentElement.doScroll&&L==L.top){(function(){if(O.isReady){return }try{document.documentElement.doScroll("left")}catch(e){setTimeout(arguments.callee,0);return }O.ready()})()}}}O.event.add(L,"load",O.ready)}O.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(f,e){O.fn[e]=function(g){return g?this.bind(e,g):this.trigger(e)}});O(L).bind("unload",function(){for(var e in O.cache){if(e!=1&&O.cache[e].handle){O.event.remove(O.cache[e].handle.elem)}}});(function(){O.support={};var g=document.documentElement,h=document.createElement("script"),l=document.createElement("div"),k="script"+(new Date).getTime();l.style.display="none";l.innerHTML='   <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var i=l.getElementsByTagName("*"),f=l.getElementsByTagName("a")[0];if(!i||!i.length||!f){return }O.support={leadingWhitespace:l.firstChild.nodeType==3,tbody:!l.getElementsByTagName("tbody").length,objectAll:!!l.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!l.getElementsByTagName("link").length,style:/red/.test(f.getAttribute("style")),hrefNormalized:f.getAttribute("href")==="/a",opacity:f.style.opacity==="0.5",cssFloat:!!f.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};h.type="text/javascript";try{h.appendChild(document.createTextNode("window."+k+"=1;"))}catch(j){}g.insertBefore(h,g.firstChild);if(L[k]){O.support.scriptEval=true;delete L[k]}g.removeChild(h);if(l.attachEvent&&l.fireEvent){l.attachEvent("onclick",function(){O.support.noCloneEvent=false;l.detachEvent("onclick",arguments.callee)});l.cloneNode(true).fireEvent("onclick")}O(function(){var e=document.createElement("div");e.style.width=e.style.paddingLeft="1px";document.body.appendChild(e);O.boxModel=O.support.boxModel=e.offsetWidth===2;document.body.removeChild(e).style.display="none"})})();var W=O.support.cssFloat?"cssFloat":"styleFloat";O.props={"for":"htmlFor","class":"className","float":W,cssFloat:W,styleFloat:W,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};O.fn.extend({_load:O.fn.load,load:function(g,j,k){if(typeof g!=="string"){return this._load(g)}var i=g.indexOf(" ");if(i>=0){var e=g.slice(i,g.length);g=g.slice(0,i)}var h="GET";if(j){if(O.isFunction(j)){k=j;j=null}else{if(typeof j==="object"){j=O.param(j);h="POST"}}}var f=this;O.ajax({url:g,type:h,dataType:"html",data:j,complete:function(m,l){if(l=="success"||l=="notmodified"){f.html(e?O("<div/>").append(m.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(e):m.responseText)}if(k){f.each(k,[m.responseText,l,m])}}});return this},serialize:function(){return O.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?O.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(e,f){var g=O(this).val();return g==null?null:O.isArray(g)?O.map(g,function(j,h){return{name:f.name,value:j}}):{name:f.name,value:g}}).get()}});O.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(e,f){O.fn[f]=function(g){return this.bind(f,g)}});var R=E();O.extend({get:function(e,g,h,f){if(O.isFunction(g)){h=g;g=null}return O.ajax({type:"GET",url:e,data:g,success:h,dataType:f})},getScript:function(e,f){return O.get(e,null,f,"script")},getJSON:function(e,f,g){return O.get(e,f,g,"json")},post:function(e,g,h,f){if(O.isFunction(g)){h=g;g={}}return O.ajax({type:"POST",url:e,data:g,success:h,dataType:f})},ajaxSetup:function(e){O.extend(O.ajaxSettings,e)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return L.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(n){n=O.extend(true,n,O.extend(true,{},O.ajaxSettings,n));var y,g=/=\?(&|$)/g,t,x,h=n.type.toUpperCase();if(n.data&&n.processData&&typeof n.data!=="string"){n.data=O.param(n.data)}if(n.dataType=="jsonp"){if(h=="GET"){if(!n.url.match(g)){n.url+=(n.url.match(/\?/)?"&":"?")+(n.jsonp||"callback")+"=?"}}else{if(!n.data||!n.data.match(g)){n.data=(n.data?n.data+"&":"")+(n.jsonp||"callback")+"=?"}}n.dataType="json"}if(n.dataType=="json"&&(n.data&&n.data.match(g)||n.url.match(g))){y="jsonp"+R++;if(n.data){n.data=(n.data+"").replace(g,"="+y+"$1")}n.url=n.url.replace(g,"="+y+"$1");n.dataType="script";L[y]=function(s){x=s;j();m();L[y]=G;try{delete L[y]}catch(z){}if(i){i.removeChild(v)}}}if(n.dataType=="script"&&n.cache==null){n.cache=false}if(n.cache===false&&h=="GET"){var f=E();var w=n.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+f+"$2");n.url=w+((w==n.url)?(n.url.match(/\?/)?"&":"?")+"_="+f:"")}if(n.data&&h=="GET"){n.url+=(n.url.match(/\?/)?"&":"?")+n.data;n.data=null}if(n.global&&!O.active++){O.event.trigger("ajaxStart")}var r=/^(\w+:)?\/\/([^\/?#]+)/.exec(n.url);if(n.dataType=="script"&&h=="GET"&&r&&(r[1]&&r[1]!=location.protocol||r[2]!=location.host)){var i=document.getElementsByTagName("head")[0];var v=document.createElement("script");v.src=n.url;if(n.scriptCharset){v.charset=n.scriptCharset}if(!y){var p=false;v.onload=v.onreadystatechange=function(){if(!p&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){p=true;j();m();v.onload=v.onreadystatechange=null;i.removeChild(v)}}}i.appendChild(v);return G}var l=false;var k=n.xhr();if(n.username){k.open(h,n.url,n.async,n.username,n.password)}else{k.open(h,n.url,n.async)}try{if(n.data){k.setRequestHeader("Content-Type",n.contentType)}if(n.ifModified){k.setRequestHeader("If-Modified-Since",O.lastModified[n.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}k.setRequestHeader("X-Requested-With","XMLHttpRequest");k.setRequestHeader("Accept",n.dataType&&n.accepts[n.dataType]?n.accepts[n.dataType]+", */*":n.accepts._default)}catch(u){}if(n.beforeSend&&n.beforeSend(k,n)===false){if(n.global&&!--O.active){O.event.trigger("ajaxStop")}k.abort();return false}if(n.global){O.event.trigger("ajaxSend",[k,n])}var o=function(s){if(k.readyState==0){if(q){clearInterval(q);q=null;if(n.global&&!--O.active){O.event.trigger("ajaxStop")}}}else{if(!l&&k&&(k.readyState==4||s=="timeout")){l=true;if(q){clearInterval(q);q=null}t=s=="timeout"?"timeout":!O.httpSuccess(k)?"error":n.ifModified&&O.httpNotModified(k,n.url)?"notmodified":"success";if(t=="success"){try{x=O.httpData(k,n.dataType,n)}catch(AA){t="parsererror"}}if(t=="success"){var z;try{z=k.getResponseHeader("Last-Modified")}catch(AA){}if(n.ifModified&&z){O.lastModified[n.url]=z}if(!y){j()}}else{O.handleError(n,k,t)}m();if(s){k.abort()}if(n.async){k=null}}}};if(n.async){var q=setInterval(o,13);if(n.timeout>0){setTimeout(function(){if(k&&!l){o("timeout")}},n.timeout)}}try{k.send(n.data)}catch(u){O.handleError(n,k,null,u)}if(!n.async){o()}function j(){if(n.success){n.success(x,t)}if(n.global){O.event.trigger("ajaxSuccess",[k,n])}}function m(){if(n.complete){n.complete(k,t)}if(n.global){O.event.trigger("ajaxComplete",[k,n])}if(n.global&&!--O.active){O.event.trigger("ajaxStop")}}return k},handleError:function(g,i,f,h){if(g.error){g.error(i,f,h)}if(g.global){O.event.trigger("ajaxError",[i,g,h])}},active:0,httpSuccess:function(g){try{return !g.status&&location.protocol=="file:"||(g.status>=200&&g.status<300)||g.status==304||g.status==1223}catch(f){}return false},httpNotModified:function(h,f){try{var i=h.getResponseHeader("Last-Modified");return h.status==304||i==O.lastModified[f]}catch(g){}return false},httpData:function(j,h,g){var f=j.getResponseHeader("content-type"),e=h=="xml"||!h&&f&&f.indexOf("xml")>=0,i=e?j.responseXML:j.responseText;if(e&&i.documentElement.tagName=="parsererror"){throw"parsererror"}if(g&&g.dataFilter){i=g.dataFilter(i,h)}if(typeof i==="string"){if(h=="script"){O.globalEval(i)}if(h=="json"){i=L["eval"]("("+i+")")}}return i},param:function(e){var g=[];function h(i,j){g[g.length]=encodeURIComponent(i)+"="+encodeURIComponent(j)}if(O.isArray(e)||e.jquery){O.each(e,function(){h(this.name,this.value)})}else{for(var f in e){if(O.isArray(e[f])){O.each(e[f],function(){h(f,this)})}else{h(f,O.isFunction(e[f])?e[f]():e[f])}}}return g.join("&").replace(/%20/g,"+")}});var M={},N,D=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function T(f,e){var g={};O.each(D.concat.apply([],D.slice(0,e)),function(){g[this]=f});return g}O.fn.extend({show:function(k,n){if(k){return this.animate(T("show",3),k,n)}else{for(var h=0,f=this.length;h<f;h++){var e=O.data(this[h],"olddisplay");this[h].style.display=e||"";if(O.css(this[h],"display")==="none"){var g=this[h].tagName,m;if(M[g]){m=M[g]}else{var j=O("<"+g+" />").appendTo("body");m=j.css("display");if(m==="none"){m="block"}j.remove();M[g]=m}O.data(this[h],"olddisplay",m)}}for(var h=0,f=this.length;h<f;h++){this[h].style.display=O.data(this[h],"olddisplay")||""}return this}},hide:function(h,j){if(h){return this.animate(T("hide",3),h,j)}else{for(var g=0,f=this.length;g<f;g++){var e=O.data(this[g],"olddisplay");if(!e&&e!=="none"){O.data(this[g],"olddisplay",O.css(this[g],"display"))}}for(var g=0,f=this.length;g<f;g++){this[g].style.display="none"}return this}},_toggle:O.fn.toggle,toggle:function(g,f){var e=typeof g==="boolean";return O.isFunction(g)&&O.isFunction(f)?this._toggle.apply(this,arguments):g==null||e?this.each(function(){var h=e?g:O(this).is(":hidden");O(this)[h?"show":"hide"]()}):this.animate(T("toggle",3),g,f)},fadeTo:function(e,g,f){return this.animate({opacity:g},e,f)},animate:function(i,f,h,g){var e=O.speed(f,h,g);return this[e.queue===false?"each":"queue"](function(){var k=O.extend({},e),m,l=this.nodeType==1&&O(this).is(":hidden"),j=this;for(m in i){if(i[m]=="hide"&&l||i[m]=="show"&&!l){return k.complete.call(this)}if((m=="height"||m=="width")&&this.style){k.display=O.css(this,"display");k.overflow=this.style.overflow}}if(k.overflow!=null){this.style.overflow="hidden"}k.curAnim=O.extend({},i);O.each(i,function(o,s){var r=new O.fx(j,k,o);if(/toggle|show|hide/.test(s)){r[s=="toggle"?l?"show":"hide":s](i)}else{var q=s.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),t=r.cur(true)||0;if(q){var n=parseFloat(q[2]),p=q[3]||"px";if(p!="px"){j.style[o]=(n||1)+p;t=((n||1)/r.cur(true))*t;j.style[o]=t+p}if(q[1]){n=((q[1]=="-="?-1:1)*n)+t}r.custom(t,n,p)}else{r.custom(t,s,"")}}});return true})},stop:function(f,e){var g=O.timers;if(f){this.queue([])}this.each(function(){for(var h=g.length-1;h>=0;h--){if(g[h].elem==this){if(e){g[h](true)}g.splice(h,1)}}});if(!e){this.dequeue()}return this}});O.each({slideDown:T("show",1),slideUp:T("hide",1),slideToggle:T("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(e,f){O.fn[e]=function(g,h){return this.animate(f,g,h)}});O.extend({speed:function(g,h,f){var e=typeof g==="object"?g:{complete:f||!f&&h||O.isFunction(g)&&g,duration:g,easing:f&&h||h&&!O.isFunction(h)&&h};e.duration=O.fx.off?0:typeof e.duration==="number"?e.duration:O.fx.speeds[e.duration]||O.fx.speeds._default;e.old=e.complete;e.complete=function(){if(e.queue!==false){O(this).dequeue()}if(O.isFunction(e.old)){e.old.call(this)}};return e},easing:{linear:function(g,h,e,f){return e+f*g},swing:function(g,h,e,f){return((-Math.cos(g*Math.PI)/2)+0.5)*f+e}},timers:[],fx:function(f,e,g){this.options=e;this.elem=f;this.prop=g;if(!e.orig){e.orig={}}}});O.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(O.fx.step[this.prop]||O.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(f){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var e=parseFloat(O.css(this.elem,this.prop,f));return e&&e>-10000?e:parseFloat(O.curCSS(this.elem,this.prop))||0},custom:function(i,h,g){this.startTime=E();this.start=i;this.end=h;this.unit=g||this.unit||"px";this.now=this.start;this.pos=this.state=0;var e=this;function f(j){return e.step(j)}f.elem=this.elem;if(f()&&O.timers.push(f)&&!N){N=setInterval(function(){var k=O.timers;for(var j=0;j<k.length;j++){if(!k[j]()){k.splice(j--,1)}}if(!k.length){clearInterval(N);N=G}},13)}},show:function(){this.options.orig[this.prop]=O.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());O(this.elem).show()},hide:function(){this.options.orig[this.prop]=O.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(h){var g=E();if(h||g>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var e=true;for(var f in this.options.curAnim){if(this.options.curAnim[f]!==true){e=false}}if(e){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(O.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){O(this.elem).hide()}if(this.options.hide||this.options.show){for(var j in this.options.curAnim){O.attr(this.elem.style,j,this.options.orig[j])}}this.options.complete.call(this.elem)}return false}else{var k=g-this.startTime;this.state=k/this.options.duration;this.pos=O.easing[this.options.easing||(O.easing.swing?"swing":"linear")](this.state,k,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};O.extend(O.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(e){O.attr(e.elem.style,"opacity",e.now)},_default:function(e){if(e.elem.style&&e.elem.style[e.prop]!=null){e.elem.style[e.prop]=e.now+e.unit}else{e.elem[e.prop]=e.now}}}});if(document.documentElement["getBoundingClientRect"]){O.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return O.offset.bodyOffset(this[0])}var g=this[0].getBoundingClientRect(),j=this[0].ownerDocument,f=j.body,e=j.documentElement,l=e.clientTop||f.clientTop||0,k=e.clientLeft||f.clientLeft||0,i=g.top+(self.pageYOffset||O.boxModel&&e.scrollTop||f.scrollTop)-l,h=g.left+(self.pageXOffset||O.boxModel&&e.scrollLeft||f.scrollLeft)-k;return{top:i,left:h}}}else{O.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return O.offset.bodyOffset(this[0])}O.offset.initialized||O.offset.initialize();var j=this[0],g=j.offsetParent,f=j,o=j.ownerDocument,m,h=o.documentElement,k=o.body,l=o.defaultView,e=l.getComputedStyle(j,null),n=j.offsetTop,i=j.offsetLeft;while((j=j.parentNode)&&j!==k&&j!==h){m=l.getComputedStyle(j,null);n-=j.scrollTop,i-=j.scrollLeft;if(j===g){n+=j.offsetTop,i+=j.offsetLeft;if(O.offset.doesNotAddBorder&&!(O.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(j.tagName))){n+=parseInt(m.borderTopWidth,10)||0,i+=parseInt(m.borderLeftWidth,10)||0}f=g,g=j.offsetParent}if(O.offset.subtractsBorderForOverflowNotVisible&&m.overflow!=="visible"){n+=parseInt(m.borderTopWidth,10)||0,i+=parseInt(m.borderLeftWidth,10)||0}e=m}if(e.position==="relative"||e.position==="static"){n+=k.offsetTop,i+=k.offsetLeft}if(e.position==="fixed"){n+=Math.max(h.scrollTop,k.scrollTop),i+=Math.max(h.scrollLeft,k.scrollLeft)}return{top:n,left:i}}}O.offset={initialize:function(){if(this.initialized){return }var l=document.body,f=document.createElement("div"),h,g,n,i,m,e,j=l.style.marginTop,k='<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>';m={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(e in m){f.style[e]=m[e]}f.innerHTML=k;l.insertBefore(f,l.firstChild);h=f.firstChild,g=h.firstChild,i=h.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(g.offsetTop!==5);this.doesAddBorderForTableAndCells=(i.offsetTop===5);h.style.overflow="hidden",h.style.position="relative";this.subtractsBorderForOverflowNotVisible=(g.offsetTop===-5);l.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(l.offsetTop===0);l.style.marginTop=j;l.removeChild(f);this.initialized=true},bodyOffset:function(e){O.offset.initialized||O.offset.initialize();var g=e.offsetTop,f=e.offsetLeft;if(O.offset.doesNotIncludeMarginInBodyOffset){g+=parseInt(O.curCSS(e,"marginTop",true),10)||0,f+=parseInt(O.curCSS(e,"marginLeft",true),10)||0}return{top:g,left:f}}};O.fn.extend({position:function(){var i=0,h=0,f;if(this[0]){var g=this.offsetParent(),j=this.offset(),e=/^body|html$/i.test(g[0].tagName)?{top:0,left:0}:g.offset();j.top-=J(this,"marginTop");j.left-=J(this,"marginLeft");e.top+=J(g,"borderTopWidth");e.left+=J(g,"borderLeftWidth");f={top:j.top-e.top,left:j.left-e.left}}return f},offsetParent:function(){var e=this[0].offsetParent||document.body;while(e&&(!/^body|html$/i.test(e.tagName)&&O.css(e,"position")=="static")){e=e.offsetParent}return O(e)}});O.each(["Left","Top"],function(f,e){var g="scroll"+e;O.fn[g]=function(h){if(!this[0]){return null}return h!==G?this.each(function(){this==L||this==document?L.scrollTo(!f?h:O(L).scrollLeft(),f?h:O(L).scrollTop()):this[g]=h}):this[0]==L||this[0]==document?self[f?"pageYOffset":"pageXOffset"]||O.boxModel&&document.documentElement[g]||document.body[g]:this[0][g]}});O.each(["Height","Width"],function(j,g){var e=j?"Left":"Top",h=j?"Right":"Bottom",f=g.toLowerCase();O.fn["inner"+g]=function(){return this[0]?O.css(this[0],f,false,"padding"):null};O.fn["outer"+g]=function(i){return this[0]?O.css(this[0],f,false,i?"margin":"border"):null};var k=g.toLowerCase();O.fn[k]=function(i){return this[0]==L?document.compatMode=="CSS1Compat"&&document.documentElement["client"+g]||document.body["client"+g]:this[0]==document?Math.max(document.documentElement["client"+g],document.body["scroll"+g],document.documentElement["scroll"+g],document.body["offset"+g],document.documentElement["offset"+g]):i===G?(this.length?O.css(this[0],k):null):this.css(k,typeof i==="string"?i:i+"px")}})})();(function(A){A.fn.extend({autocomplete:function(B,C){var D=typeof B=="string";C=A.extend({},A.Autocompleter.defaults,{url:D?B:null,data:D?null:B,delay:D?A.Autocompleter.defaults.delay:10,max:C&&!C.scroll?10:150},C);C.highlight=C.highlight||function(E){return E};C.formatMatch=C.formatMatch||C.formatItem;return this.each(function(){new A.Autocompleter(this,C)})},result:function(B){return this.bind("result",B)},search:function(B){return this.trigger("search",[B])},flushCache:function(){return this.trigger("flushCache")},setOptions:function(B){return this.trigger("setOptions",[B])},unautocomplete:function(){return this.trigger("unautocomplete")}});A.Autocompleter=function(L,G){var C={UP:38,DOWN:40,DEL:46,TAB:9,RETURN:13,ESC:27,COMMA:188,PAGEUP:33,PAGEDOWN:34,BACKSPACE:8};var B=A(L).attr("autocomplete","off").addClass(G.inputClass);var J;var P="";var M=A.Autocompleter.Cache(G);var E=0;var U;var X={mouseDownOnSelect:false};var R=A.Autocompleter.Select(G,L,D,X);var W;A.browser.opera&&A(L.form).bind("submit.autocomplete",function(){if(W){W=false;return false}});B.bind((A.browser.opera?"keypress":"keydown")+".autocomplete",function(Y){U=Y.keyCode;switch(Y.keyCode){case C.UP:Y.preventDefault();if(R.visible()){R.prev()}else{T(0,true)}break;case C.DOWN:Y.preventDefault();if(R.visible()){R.next()}else{T(0,true)}break;case C.PAGEUP:Y.preventDefault();if(R.visible()){R.pageUp()}else{T(0,true)}break;case C.PAGEDOWN:Y.preventDefault();if(R.visible()){R.pageDown()}else{T(0,true)}break;case G.multiple&&A.trim(G.multipleSeparator)==","&&C.COMMA:case C.TAB:case C.RETURN:if(D()){Y.preventDefault();W=true;return false}break;case C.ESC:R.hide();break;default:clearTimeout(J);J=setTimeout(T,G.delay);break}}).focus(function(){E++}).blur(function(){E=0;if(!X.mouseDownOnSelect){S()}}).click(function(){if(E++>1&&!R.visible()){T(0,true)}}).bind("search",function(){var Y=(arguments.length>1)?arguments[1]:null;function Z(d,c){var a;if(c&&c.length){for(var b=0;b<c.length;b++){if(c[b].result.toLowerCase()==d.toLowerCase()){a=c[b];break}}}if(typeof Y=="function"){Y(a)}else{B.trigger("result",a&&[a.data,a.value])}}A.each(H(B.val()),function(a,b){F(b,Z,Z)})}).bind("flushCache",function(){M.flush()}).bind("setOptions",function(){A.extend(G,arguments[1]);if("data" in arguments[1]){M.populate()}}).bind("unautocomplete",function(){R.unbind();B.unbind();A(L.form).unbind(".autocomplete")});function D(){var Z=R.selected();if(!Z){return false}var Y=Z.result;P=Y;if(G.multiple){var a=H(B.val());if(a.length>1){Y=a.slice(0,a.length-1).join(G.multipleSeparator)+G.multipleSeparator+Y}Y+=G.multipleSeparator}B.val(Y);V();B.trigger("result",[Z.data,Z.value]);return true}function T(a,Z){if(U==C.DEL){R.hide();return }var Y=B.val();if(!Z&&Y==P){return }P=Y;Y=I(Y);if(Y.length>=G.minChars){B.addClass(G.loadingClass);if(!G.matchCase){Y=Y.toLowerCase()}F(Y,K,V)}else{N();R.hide()}}function H(Z){if(!Z){return[""]}var a=Z.split(G.multipleSeparator);var Y=[];A.each(a,function(b,c){if(A.trim(c)){Y[b]=A.trim(c)}});return Y}function I(Y){if(!G.multiple){return Y}var Z=H(Y);return Z[Z.length-1]}function Q(Y,Z){if(G.autoFill&&(I(B.val()).toLowerCase()==Y.toLowerCase())&&U!=C.BACKSPACE){B.val(B.val()+Z.substring(I(P).length));A.Autocompleter.Selection(L,P.length,P.length+Z.length)}}function S(){clearTimeout(J);J=setTimeout(V,200)}function V(){var Y=R.visible();R.hide();clearTimeout(J);N();if(G.mustMatch){B.search(function(Z){if(!Z){if(G.multiple){var a=H(B.val()).slice(0,-1);B.val(a.join(G.multipleSeparator)+(a.length?G.multipleSeparator:""))}else{B.val("")}}})}if(Y){A.Autocompleter.Selection(L,L.value.length,L.value.length)}}function K(Z,Y){if(Y&&Y.length&&E){N();R.display(Y,Z);Q(Z,Y[0].value);R.show()}else{V()}}function F(Z,b,Y){if(!G.matchCase){Z=Z.toLowerCase()}var a=M.load(Z);if(a&&a.length){b(Z,a)}else{if((typeof G.url=="string")&&(G.url.length>0)){var c={timestamp:+new Date()};A.each(G.extraParams,function(d,e){c[d]=typeof e=="function"?e():e});A.ajax({mode:"abort",port:"autocomplete"+L.name,dataType:G.dataType,url:G.url,data:A.extend({q:I(Z),limit:G.max},c),success:function(e){var d=G.parse&&G.parse(e)||O(e);M.add(Z,d);b(Z,d)}})}else{R.emptyList();Y(Z)}}}function O(b){var Y=[];var a=b.split("\n");for(var Z=0;Z<a.length;Z++){var c=A.trim(a[Z]);if(c){c=c.split("|");Y[Y.length]={data:c,value:c[0],result:G.formatResult&&G.formatResult(c,c[0])||c[0]}}}return Y}function N(){B.removeClass(G.loadingClass)}};A.Autocompleter.defaults={inputClass:"ac_input",resultsClass:"ac_results",loadingClass:"ac_loading",minChars:1,delay:400,matchCase:false,matchSubset:true,matchContains:false,cacheLength:10,max:100,mustMatch:false,extraParams:{},selectFirst:true,formatItem:function(B){return B[0]},formatMatch:null,autoFill:false,width:0,multiple:false,multipleSeparator:", ",highlight:function(C,B){return C.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)("+B.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi,"\\$1")+")(?![^<>]*>)(?![^&;]+;)","gi"),"<strong>$1</strong>")},scroll:true,scrollHeight:180};A.Autocompleter.Cache=function(C){var F={};var D=0;function H(K,J){if(!C.matchCase){K=K.toLowerCase()}var I=K.indexOf(J);if(I==-1){return false}return I==0||C.matchContains}function G(J,I){if(D>C.cacheLength){B()}if(!F[J]){D++}F[J]=I}function E(){if(!C.data){return false}var J={},I=0;if(!C.url){C.cacheLength=1}J[""]=[];for(var L=0,K=C.data.length;L<K;L++){var O=C.data[L];O=(typeof O=="string")?[O]:O;var N=C.formatMatch(O,L+1,C.data.length);if(N===false){continue}var M=N.charAt(0).toLowerCase();if(!J[M]){J[M]=[]}var P={value:N,data:O,result:C.formatResult&&C.formatResult(O)||N};J[M].push(P);if(I++<C.max){J[""].push(P)}}A.each(J,function(Q,R){C.cacheLength++;G(Q,R)})}setTimeout(E,25);function B(){F={};D=0}return{flush:B,add:G,populate:E,load:function(L){if(!C.cacheLength||!D){return null}if(!C.url&&C.matchContains){var K=[];for(var I in F){if(I.length>0){var M=F[I];A.each(M,function(O,N){if(H(N.value,L)){K.push(N)}})}}return K}else{if(F[L]){return F[L]}else{if(C.matchSubset){for(var J=L.length-1;J>=C.minChars;J--){var M=F[L.substr(0,J)];if(M){var K=[];A.each(M,function(O,N){if(H(N.value,L)){K[K.length]=N}});return K}}}}}return null}}};A.Autocompleter.Select=function(E,J,L,P){var I={ACTIVE:"ac_over"};var K,F=-1,R,M="",S=true,C,O;function N(){if(!S){return }C=A("<div/>").hide().addClass(E.resultsClass).css("position","absolute").appendTo(document.body);O=A("<ul/>").appendTo(C).mouseover(function(T){if(Q(T).nodeName&&Q(T).nodeName.toUpperCase()=="LI"){F=A("li",O).removeClass(I.ACTIVE).index(Q(T));A(Q(T)).addClass(I.ACTIVE)}}).click(function(T){A(Q(T)).addClass(I.ACTIVE);L();J.focus();return false}).mousedown(function(){P.mouseDownOnSelect=true}).mouseup(function(){P.mouseDownOnSelect=false});if(E.width>0){C.css("width",E.width)}S=false}function Q(U){var T=U.target;while(T&&T.tagName!="LI"){T=T.parentNode}if(!T){return[]}return T}function H(T){K.slice(F,F+1).removeClass(I.ACTIVE);G(T);var V=K.slice(F,F+1).addClass(I.ACTIVE);if(E.scroll){var U=0;K.slice(0,F).each(function(){U+=this.offsetHeight});if((U+V[0].offsetHeight-O.scrollTop())>O[0].clientHeight){O.scrollTop(U+V[0].offsetHeight-O.innerHeight())}else{if(U<O.scrollTop()){O.scrollTop(U)}}}}function G(T){F+=T;if(F<0){F=K.size()-1}else{if(F>=K.size()){F=0}}}function B(T){return E.max&&E.max<T?E.max:T}function D(){O.empty();var U=B(R.length);for(var V=0;V<U;V++){if(!R[V]){continue}var W=E.formatItem(R[V].data,V+1,U,R[V].value,M);if(W===false){continue}var T=A("<li/>").html(E.highlight(W,M)).addClass(V%2==0?"ac_even":"ac_odd").appendTo(O)[0];A.data(T,"ac_data",R[V])}K=O.find("li");if(E.selectFirst){K.slice(0,1).addClass(I.ACTIVE);F=0}if(A.fn.bgiframe){O.bgiframe()}}return{display:function(U,T){N();R=U;M=T;D()},next:function(){H(1)},prev:function(){H(-1)},pageUp:function(){if(F!=0&&F-8<0){H(-F)}else{H(-8)}},pageDown:function(){if(F!=K.size()-1&&F+8>K.size()){H(K.size()-1-F)}else{H(8)}},hide:function(){C&&C.hide();K&&K.removeClass(I.ACTIVE);F=-1},visible:function(){return C&&C.is(":visible")},current:function(){return this.visible()&&(K.filter("."+I.ACTIVE)[0]||E.selectFirst&&K[0])},show:function(){var V=A(J).offset();C.css({width:typeof E.width=="string"||E.width>0?E.width:A(J).width(),top:V.top+J.offsetHeight,left:V.left}).show();if(E.scroll){O.scrollTop(0);O.css({maxHeight:E.scrollHeight,overflow:"auto"});if(A.browser.msie&&typeof document.body.style.maxHeight==="undefined"){var T=0;K.each(function(){T+=this.offsetHeight});var U=T>E.scrollHeight;O.css("height",U?E.scrollHeight:T);if(!U){K.width(O.width()-parseInt(K.css("padding-left"))-parseInt(K.css("padding-right")))}}}},selected:function(){var T=K&&K.filter("."+I.ACTIVE).removeClass(I.ACTIVE);return T&&T.length&&A.data(T[0],"ac_data")},emptyList:function(){O&&O.empty()},unbind:function(){C&&C.remove()}}};A.Autocompleter.Selection=function(D,E,C){if(D.createTextRange){var B=D.createTextRange();B.collapse(true);B.moveStart("character",E);B.moveEnd("character",C);B.select()}else{if(D.setSelectionRange){D.setSelectionRange(E,C)}else{if(D.selectionStart){D.selectionStart=E;D.selectionEnd=C}}}D.focus()}})(jQuery);(function(A){A.fn.bgIframe=A.fn.bgiframe=function(C){if(A.browser.msie&&/6.0/.test(navigator.userAgent)){C=A.extend({top:"auto",left:"auto",width:"auto",height:"auto",opacity:true,src:"javascript:false;"},C||{});var D=function(E){return E&&E.constructor==Number?E+"px":E},B='<iframe class="bgiframe"frameborder="0"tabindex="-1"src="'+C.src+'"style="display:block;position:absolute;z-index:-1;'+(C.opacity!==false?"filter:Alpha(Opacity='0');":"")+"top:"+(C.top=="auto"?"expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+'px')":D(C.top))+";left:"+(C.left=="auto"?"expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+'px')":D(C.left))+";width:"+(C.width=="auto"?"expression(this.parentNode.offsetWidth+'px')":D(C.width))+";height:"+(C.height=="auto"?"expression(this.parentNode.offsetHeight+'px')":D(C.height))+';"/>';return this.each(function(){if(A("> iframe.bgiframe",this).length==0){this.insertBefore(document.createElement(B),this.firstChild)}})}return this}})(jQuery);(function(B){B.dimensions={version:"1.2"};B.each(["Height","Width"],function(D,C){B.fn["inner"+C]=function(){if(!this[0]){return }var F=C=="Height"?"Top":"Left",E=C=="Height"?"Bottom":"Right";return this.is(":visible")?this[0]["client"+C]:A(this,C.toLowerCase())+A(this,"padding"+F)+A(this,"padding"+E)};B.fn["outer"+C]=function(F){if(!this[0]){return }var H=C=="Height"?"Top":"Left",E=C=="Height"?"Bottom":"Right";F=B.extend({margin:false},F||{});var G=this.is(":visible")?this[0]["offset"+C]:A(this,C.toLowerCase())+A(this,"border"+H+"Width")+A(this,"border"+E+"Width")+A(this,"padding"+H)+A(this,"padding"+E);return G+(F.margin?(A(this,"margin"+H)+A(this,"margin"+E)):0)}});B.each(["Left","Top"],function(D,C){B.fn["scroll"+C]=function(E){if(!this[0]){return }return E!=undefined?this.each(function(){this==window||this==document?window.scrollTo(C=="Left"?E:B(window)["scrollLeft"](),C=="Top"?E:B(window)["scrollTop"]()):this["scroll"+C]=E}):this[0]==window||this[0]==document?self[(C=="Left"?"pageXOffset":"pageYOffset")]||B.boxModel&&document.documentElement["scroll"+C]||document.body["scroll"+C]:this[0]["scroll"+C]}});B.fn.extend({position:function(){var H=0,G=0,F=this[0],I,C,E,D;if(F){E=this.offsetParent();I=this.offset();C=E.offset();I.top-=A(F,"marginTop");I.left-=A(F,"marginLeft");C.top+=A(E,"borderTopWidth");C.left+=A(E,"borderLeftWidth");D={top:I.top-C.top,left:I.left-C.left}}return D},offsetParent:function(){var C=this[0].offsetParent;while(C&&(!/^body|html$/i.test(C.tagName)&&B.css(C,"position")=="static")){C=C.offsetParent}return B(C)}});function A(C,D){return parseInt(B.curCSS(C.jquery?C[0]:C,D,true))||0}})(jQuery) 
/* *************** SECOND PART ****************** */ 
function CloudManager(){this.active=false;this.grabber=null;this.navigator=null;this.position=null;this.cloudDimensions=null;this.grabbed=false;this.grabbedMd=false;this.grabStart=null}CloudManager.prototype.createMd=function(B,A,D){var C=globals.mdTracker.get(B.id);if(!C){C=new Minidoc(B)}C.setContainer($(".cloud_container"));return C};CloudManager.prototype.activate=function(D,B,C,A){this.cloudDimensions=[D,B,C,A];if(!this.active){this.grabber=$("<div></div>").addClass("grabber grabable").prependTo($("body"));this.navigator=$("<div></div>").addClass("navigator").append(this.position=$("<div class='position'></div>")).append(this.navarea=$("<div class='area'></div>")).insertAfter($(".controller"));$("body").mousemove(CloudManager.prototype._GrabMove).mouseup(CloudManager.prototype._GrabUp).mouseleave(CloudManager.prototype._GrabUp);$(".grabable").each(CloudManager.prototype._MakeGrabable);$(".player .mousearea").each(CloudManager.prototype._MakeGrabable)}this._HandleCurrentSize();this._HandleResize();this.active=true};CloudManager.prototype.deactivate=function(){if(!this.active){return }$("body").unbind("mousemove",CloudManager.prototype._GrabMove).unbind("mouseup",CloudManager.prototype._GrabUp).unbind("mouseleave",CloudManager.prototype._GrabUp);$(".grabable").each(CloudManager.prototype._StopGrabable);$(".player .mousearea").each(CloudManager.prototype._StopGrabable);this.grabber.remove();this.grabber=null;this.navigator.remove();this.navigator=null;this.position=null;this.active=false};CloudManager.prototype._MakeGrabable=function(){$(this).mousedown(CloudManager.prototype._GrabDown).mouseup(CloudManager.prototype._GrabUp)};CloudManager.prototype._StopGrabable=function(){$(this).unbind("mousedown",CloudManager.prototype._GrabDown).unbind("mouseup",CloudManager.prototype._GrabUp)};CloudManager.prototype._HandleResize=function(){var A=$(window).width();var B=$(window).height();$(".msie_overflow_killer").css({"width":A,"height":B})};CloudManager.prototype._HandleCurrentSize=function(){CloudManager.prototype._HandleSizes(parseInt(globals.viewManager.cloudContainer.css("left")),parseInt(globals.viewManager.cloudContainer.css("top")))};CloudManager.prototype._HandleSizes=function(G,B){var E=$(window).width();var F=$(window).height();if(globals.cloudManager.grabber&&globals.cloudManager.navigator){var C=globals.cloudManager.cloudDimensions;C[0]=Math.max(C[0],E/2);C[1]=Math.max(C[1],F/2);globals.cloudManager.grabber.css({width:E+"px",height:F+"px",opacity:0});if(G<(E/2)-C[0]){G=(E/2)-C[0]}else{if(G>E/2){G=E/2}}if(B<(F/2)-C[1]){B=(F/2)-C[1]}else{if(B>F/2){B=F/2}}globals.viewManager.cloudContainer.css({top:B+"px",left:G+"px"});var A=[C[0]+E,C[1]+F];var H=100;var D=100/Math.max(A[0],A[1]);globals.cloudManager.navarea.css({width:(D*A[0])+"px",height:(D*A[1])+"px",left:(D*(G))+"px",top:(D*(B))+"px"});globals.cloudManager.position.css({width:(D*E)+"px",height:(D*F)+"px",left:(D*(2*G+Math.abs((E/2)-C[0])))+"px",top:(D*(2*B+Math.abs((F/2)-C[1])))+"px"});globals.cloudManager.navigator.css({left:(E-(D*A[0]))+(D*-1*(G))+"px",top:(F-(D*A[1]))+(D*-1*(B))+"px"})}};CloudManager.prototype._GrabDown=function(D){var A=null;var C=null;if($(this).hasClass("title")){globals.cloudManager.grabbedMd=true;var B=$(this).parent(".case.player");A=parseInt(B.css("top"));C=parseInt(B.css("left"));globals.viewManager.setOnTop(B)}$(this).addClass("grabbed");globals.cloudManager.grabbed=true;globals.cloudManager.grabStart={time:(new Date()).getTime(),cy:parseInt(globals.viewManager.cloudContainer.css("top")),cx:parseInt(globals.viewManager.cloudContainer.css("left")),py:A,px:C,y:D.pageY,x:D.pageX};CloudManager.prototype.Selectable(this,false);return false};CloudManager.prototype._GrabUp=function(A){$(".grabbed").each(function(){$(this).removeClass("grabbed");CloudManager.prototype.Selectable(this,true)});if(A.target.tagName!="A"&&globals.viewManager&&globals.cloudManager.grabStart!=null&&(new Date()).getTime()-globals.cloudManager.grabStart.time<125){if(!globals.viewManager.activateAllMds()){globals.viewManager.deactivateAllMds(false,false)}}globals.cloudManager.grabbed=false;globals.cloudManager.grabbedMd=false;globals.cloudManager.grabStart=null;return false};CloudManager.prototype._GrabMove=function(A){if(globals.cloudManager.grabbed){if(!globals.cloudManager.grabbedMd){globals.cloudManager._HandleSizes((globals.cloudManager.grabStart.cx+(A.pageX-globals.cloudManager.grabStart.x)),(globals.cloudManager.grabStart.cy+(A.pageY-globals.cloudManager.grabStart.y)))}else{$(".grabbed.title").parent(".case.player").css({left:(globals.cloudManager.grabStart.px+(A.pageX-globals.cloudManager.grabStart.x))+"px",top:(globals.cloudManager.grabStart.py+(A.pageY-globals.cloudManager.grabStart.y))+"px"})}}};CloudManager.prototype.Selectable=function(B,A){if(!B){return }B.unselectable=A?"off":"on";B.onselectstart=function(){return A};if(document.selection&&document.selection.empty){document.selection.empty()}if(B.style){B.style.MozUserSelect=A?"":"none"}};var MAIN=0;var SMALL_IFRAME=1;var LARGE_IFRAME=2;function Controller(){this.selected={md:null,playlist:null,platform:null,search:null};if(typeof startUser!="undefined"){this.user=startUser}else{this.user=null}$("#small_iframe").hide().load(this.LoadSmallIframe);$("#large_iframe").hide().load(this.LoadLargeIframe);$("#large_iframe_minimize").click(this.MinimizeLargeIframe);$("a[target=large_iframe]").click(this.HandleClickLargeIframe);$("a[target=small_iframe]").click(this.HandleClickSmallIframe);$("#large_iframe_hide").click(this.HideLargeIframe);$("#showonmap").click(this.ShowOnMapMagic);$("#scroll_bottom").click(this.ClickScrollBottom);$(".controller #admin_buttons a").click(this.HandleClickTarget);if(typeof loggedIn!="undefined"&&loggedIn&&!isLandingPage){this.SignalLogin()}this.disabled=false;this.preventLoadLargeIframe=false;this.preventLoadSmallIframe=false;this.form=$("#controller_form");Controller.prototype._InitForm()}Controller.prototype.ReloadForm=function(){var A=Controller.prototype._FramesMagic();A[MAIN].globals.controller.form.load(siteroot+"controller/form/html",A[MAIN].Controller.prototype._InitForm)};Controller.prototype.ReloadViewManager=function(){var A=Controller.prototype._FramesMagic();A[MAIN].globals.viewManager.reloadMapMds()};Controller.prototype._OrderAutocomplete=function(B,A){if(!B){A.sort(Controller.prototype._OrderAutocomplete);return 0}return B.value.toUpperCase()>A.value.toUpperCase()?1:-1};Controller.prototype._InitForm=function(){if($("#controller_form").length==0){return false}$("#select_playlist").change(Controller.prototype._SelectPlaylist);$("#select_platform").change(Controller.prototype._SelectPlatform);$(".buttons .wa_submit",this.form).each(replaceWaSubmitButton);$("#search_button").click(Controller.prototype._ClickSearchButton);$("#search_input").bind("keydown",Controller.prototype._KeyDownSearchInput).autocomplete(siteroot+"controller/autocomplete",{width:"280px",dataType:"json",highlight:function(B,A){return B},parse:function(C){var A=C.length;for(var B=0;B<A;B++){C[B]={data:C[B],value:C[B].name,result:C[B].name}}Controller.prototype._OrderAutocomplete(false,C);return C},formatItem:function(A){return"<div style='float:left'>"+A.name+"</div><div style='float:right;'><i>("+A.type+")</i></div>"}}).result(function(B,A){Controller.prototype._ClickSearchButton();return false})};Controller.prototype._KeyDownSearchInput=function(B){var A=B.keyCode?B.keyCode:B.charCode?B.charCode:B.which;if(A==13){Controller.prototype._ClickSearchButton();return false}return true};Controller.prototype.MinidocClick=function(){var B=Controller.prototype._FramesMagic();var A=parseInt($(this).attr("rel"));if(A){B[MAIN].Controller.prototype._SelectMinidoc(A)}return false};Controller.prototype.KeywordClick=function(){var A=Controller.prototype._FramesMagic();A[MAIN].$("#search_input").val($(this).text());A[MAIN].Controller.prototype._ClickSearchButton();return false};Controller.prototype.PlatformClick=function(){var A=Controller.prototype._FramesMagic();A[MAIN].$("#select_platform").val($(this).attr("rel"));A[MAIN].Controller.prototype._SelectPlatform();return false};Controller.prototype.PlaylistClick=function(){var A=Controller.prototype._FramesMagic();A[MAIN].$("#select_playlist").val($(this).attr("rel"));A[MAIN].Controller.prototype._SelectPlaylist();return false};Controller.prototype._ClickSearchButton=function(){var A=$("#search_input").val();if(A!=""){Controller.prototype._ResetPlatform();Controller.prototype._ResetPlaylist();globals.controller.selected.search=A;Controller.prototype.LoadSelection();Controller.prototype._ClosePlatform()}};Controller.prototype._SelectPlaylist=function(){if($("#select_playlist").val()!="null"){Controller.prototype._ResetPlatform();Controller.prototype._ResetSearch();globals.controller.selected.playlist=$("#select_playlist").val();Controller.prototype.HideLargeIframe();Controller.prototype.LoadSelection();Controller.prototype._ClosePlatform()}else{globals.controller.selected.playlist=null}Controller.prototype.ShowSelection()};Controller.prototype._GetPlatformUrl=function(A){return siteroot+"platform/facts/"+A+"/info"};Controller.prototype._OpenPlatform=function(B){var A=Controller.prototype._FramesMagic();Controller.prototype.ShowLargeIframe();A[LARGE_IFRAME].document.location=Controller.prototype._GetPlatformUrl(B)+"?"+(new Date()).getTime()};Controller.prototype._ClosePlatform=function(C){var A=Controller.prototype._FramesMagic();var B=new RegExp("platform/facts/[0-9]+/info","i");if(B.test(A[LARGE_IFRAME].document.location)){Controller.prototype.HideLargeIframe()}};Controller.prototype._SelectPlatform=function(){var A=Controller.prototype._FramesMagic();if($(this).val()!="null"){Controller.prototype._ResetSearch();Controller.prototype._ResetPlaylist();$("#maximize_buttons").hide();globals.controller.selected.platform=$("#select_platform").val();Controller.prototype._OpenPlatform(globals.controller.selected.platform);Controller.prototype.LoadSelection()}else{globals.controller.selected.platform=null}};Controller.prototype._SelectMinidoc=function(A){Controller.prototype._ResetPlaylist();Controller.prototype._ResetPlatform();Controller.prototype._ResetSearch();globals.controller.selected.md={id:A};globals.viewManager.setMainTitle("");Controller.prototype._LoadSelection()};Controller.prototype._ResetSearch=function(){$("#search_input").val("");globals.controller.selected.search=null};Controller.prototype._ResetPlaylist=function(){$("#select_playlist").val("null");globals.controller.selected.playlist=null};Controller.prototype._ResetPlatform=function(){$("#select_platform").val("null");globals.controller.selected.platform=null;$("#maximize_buttons").hide()};Controller.prototype.ClickScrollBottom=function(){$(document).scrollTop(99999)};Controller.prototype.LoadSelection=function(){var A=Controller.prototype._FramesMagic();A[MAIN].globals.viewManager.deactivateAllMds(true,true);$(".cloud_container .case.player").hide();A[MAIN].Controller.prototype._LoadSelection()};Controller.prototype._LoadSelection=function(){if(globals.viewManager){var A=globals.controller.selected;var B={md:A.md==null?null:A.md.id,playlist:A.playlist,platform:A.platform,search:A.search};$.ajax({dataType:"json",data:B,url:siteroot+"controller/selection",success:Controller.prototype.ProcessSelection})}};Controller.prototype.ProcessSelection=function(B){if(B.length==0){var A=Controller.prototype._FramesMagic();A[MAIN].globals.controller.selected.md=null}globals.viewManager.setCurrentMDs(B);globals.controller.ShowSelection()};Controller.prototype.select=function(A){this.selected.md=A;this._showSelection()};Controller.prototype.ShowSelection=function(){var A=Controller.prototype._FramesMagic();A[MAIN].globals.controller._showSelection()};Controller.prototype._showSelection=function(){var K=Controller.prototype._FramesMagic();if(K[MAIN].globals.viewManager){$(".controller .title .number").show().text("["+K[MAIN].globals.viewManager.mds.length+"]");var E=false;if(this.selected.md!=null){$(".controller .title .prefix").text("Mini doc");var L=globals.mdTracker.get(this.selected.md.id);if(!L){return false}this.selected.md=L;$(".controller .title .main").text(this.selected.md.data.title);$(".controller .title .number").hide()}else{if(this.selected.playlist!=null){$(".controller .title .prefix").text("Playlist");var F=$("#select_playlist option[value="+this.selected.playlist+"]");if(F.length==0){this.selected.playlist=null;this._showSelection();return }$("#select_playlist").val(this.selected.playlist);$(".controller .title .main").text(F.text());K[MAIN].globals.viewManager.setMainTitle(F.text());if(this.selected.playlist<=0){E=true}}else{if(this.selected.platform!=null){$(".controller .title .prefix").text("Platform");var F=$("#select_platform option[value="+this.selected.platform+"]");if(F.length==0){var D=Controller.prototype._GetPlatformUrl(this.selected.platform);if(K[MAIN].$("#large_iframe:visible").length==1&&(K[LARGE_IFRAME].document.location+"").indexOf(D)!=-1){Controller.prototype.HideLargeIframe()}K[MAIN].$("#maximize_buttons").hide();this.selected.platform=null;this._showSelection();return }$("#select_platform").val(this.selected.platform);$(".controller .title .main").text(F.text());K[MAIN].globals.viewManager.setMainTitle(F.text())}else{if(this.selected.search!=null){$(".controller .title .prefix").text("Keyword");$(".controller .title .main").text(this.selected.search);$("#search_input").val(this.selected.search);K[MAIN].globals.viewManager.setMainTitle(this.selected.search);E=true}else{K[MAIN].globals.viewManager.setMainTitle("");$(".controller .title .prefix").text("Urbaninform");$(".controller .title .main").text("");E=true}}}}var A=this.user!=null&&$("#select_platform option[value="+this.selected.platform+"][rel$="+this.user.id+"]").length==1;var C=this.user!=null&&$("#select_playlist option[value="+this.selected.playlist+"][rel$="+this.user.id+"]").length==1;var J=this.user!=null&&this.selected.md!=null&&this.selected.md.data.user.id==this.user.id;if(!E&&this.user!=null&&(this.user.rights=="E"||A||C||J)){var H="";var B="";var I=false;var G="small_iframe";if(this.selected.md!=null){I=this.selected.md.data.published;H=siteroot+"minidoc/account/manage/"+this.selected.md.id;B=siteroot+"minidoc/manage/"+this.selected.md.id+"/edit";G="large_iframe"}else{if(this.selected.playlist!=null){I=$("#select_playlist option[value="+this.selected.playlist+"][rel^=true]").length==1;H=siteroot+"playlist/manage/"+this.selected.playlist;B=H+"/edit"}else{if(this.selected.platform!=null){I=$("#select_platform option[value="+this.selected.platform+"][rel^=true]").length==1;H=siteroot+"platform/manage/"+this.selected.platform;B=H+"/edit"}}}$("#unpublish_button a").attr("href",H+"/unpublish").attr("target","small_iframe");$("#publish_button a").attr("href",H+"/publish").attr("target","small_iframe");$("#edit_button a").attr("href",B).attr("target",G);$("#delete_button a").attr("href",H+"/delete").attr("target","small_iframe");if(this.user.rights=="E"||A){if(I){$("#unpublish_button").show();$("#publish_button").hide()}else{$("#unpublish_button").hide();$("#publish_button").show()}}else{$("#unpublish_button").hide();$("#publish_button").hide()}$("#edit_button").show();$("#delete_button").show()}else{$("#unpublish_button").hide();$("#publish_button").hide();$("#edit_button").hide();$("#delete_button").hide()}}if(K[SMALL_IFRAME]&&K[SMALL_IFRAME].$){if(this.selected.md!=null){K[SMALL_IFRAME].$("#minidoc_name").removeClass("silver").text(this.selected.md.data.title);K[SMALL_IFRAME].$("#wa_form_account_playlist [name=minidoc_id], #wa_form_account_platform [name=minidoc_id]").val(this.selected.md.id)}else{K[SMALL_IFRAME].$("#minidoc_name").addClass("silver").text("Select a mini doc");K[SMALL_IFRAME].$("#wa_form_account_playlist [name=minidoc_id], #wa_form_account_platform [name=minidoc_id]").val("0")}}if(this.selected.platform!=null){var D=Controller.prototype._GetPlatformUrl(this.selected.platform);if(K[MAIN].$("#large_iframe:visible").length==1&&(K[LARGE_IFRAME].document.location+"").indexOf(D)!=-1){K[MAIN].$("#maximize_buttons").hide()}else{K[MAIN].$("#maximize_buttons").show();K[MAIN].$("#large_iframe_maximize a").attr("href",D+"?"+(new Date()).getTime())}}else{K[MAIN].$("#maximize_buttons").hide()}};Controller.prototype.deselect=function(A){if(this.selected.platform==null&&this.selected.playlist==null&&this.selected.search==null){return }if(!A||(this.selected.md&&this.selected.md.id==A.id)){this.selected.md=null}if(!A){this._showSelection()}};Controller.prototype._FramesMagic=function(){var B=null;try{B=window.parent}catch(A){B=window}return[B,B.frames["small_iframe"],B.frames["large_iframe"]]};Controller.prototype.SignalLogin=function(A){var B=Controller.prototype._FramesMagic();B[MAIN].Controller.prototype.ShowSmallIframe();B[MAIN].$("#small_iframe").attr("src",siteroot+"account/start");B[MAIN].$("#login").hide();B[MAIN].$("#logout").show();B[MAIN].$("#make_your_minidoc").hide();if(B[MAIN].globals.controller){if(A){B[MAIN].globals.controller.user=A}B[MAIN].globals.controller.ReloadForm()}};Controller.prototype.SignalLogout=function(){var A=Controller.prototype._FramesMagic();A[MAIN].globals.controller.user=null;A[MAIN].Controller.prototype.HideSmallIframe();A[MAIN].$("#login").show();A[MAIN].$("#logout").hide();A[MAIN].globals.controller.ReloadForm()};Controller.prototype.SignalNoLogin=function(){var A=Controller.prototype._FramesMagic();A[MAIN].Controller.prototype.SignalLogout();A[MAIN].alert("You are not logged in (anymore). Please login first")};Controller.prototype.Disable=function(A){var B=Controller.prototype._FramesMagic();if(B[MAIN].$("#large_iframe:visible").length==1){if(parseInt($.browser.version)<=6&&$.browser.msie){B[MAIN].$(".controller select").hide()}B[MAIN].$(".controller_black_opac_overlay").css({"height":(B[MAIN].$("#small_iframe").height()+210)+"px"}).show();B[MAIN].globals.controller.disabled=true;if(B[SMALL_IFRAME]&&B[SMALL_IFRAME].$){B[SMALL_IFRAME].$("#"+A).addClass("disabled")}}};Controller.prototype.Enable=function(A){var B=Controller.prototype._FramesMagic();if(parseInt($.browser.version)<=6&&$.browser.msie){B[MAIN].$(".controller select").show()}B[MAIN].$(".controller_black_opac_overlay").hide();B[MAIN].globals.controller.disabled=false;if(B[SMALL_IFRAME]&&B[SMALL_IFRAME].$){B[SMALL_IFRAME].$("#"+A).removeClass("disabled")}if(B[MAIN].globals.controller.selected.md!=null){if(!B[MAIN].globals.controller.selected.md.currentState.playing){B[MAIN].globals.controller.selected.md.reload()}}};Controller.prototype.ShowOnMapMagic=function(){var C=parseInt($(this).attr("rel"));var B=Controller.prototype._FramesMagic();if(B[LARGE_IFRAME]&&B[LARGE_IFRAME].$&&B[MAIN].globals.viewManager&&!B[MAIN].globals.controller.disabled){Controller.prototype.HideLargeIframe();B[MAIN].globals.viewManager.show_mapview();var A=function(){var D=B[MAIN].globals.mdTracker.get(C);if(D){if(D.marker_red==null){setTimeout(A,200)}else{B[MAIN].GoogleMap.prototype.ShowMd(D);B[MAIN].globals.viewManager.panToMiddle(D);A=null}}else{A=null}};A()}return false};Controller.prototype.HandleClickTarget=function(){var A=$(this).attr("target");if(A=="large_iframe"){return Controller.prototype.HandleClickLargeIframe()}else{if(A=="small_iframe"){return Controller.prototype.HandleClickSmallIframe()}}return false};Controller.prototype.HandleClickLargeIframe=function(){var A=Controller.prototype._FramesMagic();if(!A[MAIN].globals.controller.preventLoadLargeIframe||A[MAIN].confirm("Are you sure you want to continue? Changes to your mini doc could be lost.")){A[MAIN].Controller.prototype.ShowLargeIframe();return true}return false};Controller.prototype.ShowLargeIframe=function(){var A=Controller.prototype._FramesMagic();A[MAIN].$("#large_iframe").show();return true};Controller.prototype.HideLargeIframe=function(){var A=Controller.prototype._FramesMagic();if(A[LARGE_IFRAME]&&A[LARGE_IFRAME].$){if(A[MAIN].$("#large_iframe:visible").length==1){A[LARGE_IFRAME].$("body *").remove();A[LARGE_IFRAME].$("body").append($('&nbsp;<br/><span class="silver">Loading</span>'));if($.browser.msie&&A[LARGE_IFRAME].document.readyState!="complete"){setTimeout(Controller.prototype.HideLargeIframe,200);return false}A[MAIN].$("#large_iframe").hide()}}return false};Controller.prototype.MinimizeLargeIframe=function(){var A=Controller.prototype._FramesMagic();A[MAIN].$("#maximize_buttons").show();A[MAIN].add2cart(A[MAIN].$("#large_iframe"),A[MAIN].$("#maximize_buttons"));Controller.prototype.HideLargeIframe();setTimeout(Controller.prototype.ShowSelection,200);setTimeout(Controller.prototype.ShowSelection,1000)};Controller.prototype.LoadLargeIframe=function(){var A=Math.min($(window).height()-40,this.contentWindow.document.body.offsetHeight+30);$(this).css("height",A+"px");$(document).scrollTop(0);setTimeout(Controller.prototype.ShowSelection,200)};Controller.prototype.preventLoadLargeIframe=function(B){var A=Controller.prototype._FramesMagic();A[MAIN].globals.controller.preventLoadLargeIframe=B;return true};Controller.prototype.HandleClickSmallIframe=function(){var A=Controller.prototype._FramesMagic();if(!A[MAIN].globals.controller.preventLoadSmallIframe||A[MAIN].confirm("Are you sure you want to continue? Changes to your mini doc, playlist or platform could be lost.")){A[MAIN].Controller.prototype.ShowSmallIframe();return true}return false};Controller.prototype.ShowSmallIframe=function(){var A=Controller.prototype._FramesMagic();A[MAIN].$("#small_iframe").show();A[MAIN].$(".small_iframe_blue_opac_layer").show();return true};Controller.prototype.HideSmallIframe=function(){var A=Controller.prototype._FramesMagic();A[MAIN].$("#small_iframe").hide();A[MAIN].$(".small_iframe_blue_opac_layer").hide()};Controller.prototype.LoadSmallIframe=function(){$(document).scrollTop(0);Controller.prototype._SizeSmallIframe();setTimeout(Controller.prototype._SizeSmallIframe,250);globals.controller._showSelection()};Controller.prototype._SizeSmallIframe=function(){var C=Controller.prototype._FramesMagic();var B=C[MAIN].$("#small_iframe").get(0);var A=Math.min(($(window).height()-40)-210,B.contentWindow.document.body.offsetHeight+0);$(B).css("height",A+"px");$(".small_iframe_blue_opac_layer").css("height",A+"px")};Controller.prototype.preventLoadSmallIframe=function(B){var A=Controller.prototype._FramesMagic();A[MAIN].globals.controller.preventLoadSmallIframe=B;return true};function ELabel(A,E,F,C,D,B){this.point=A;this.html=E;this.classname=F||"";this.pixelOffset=C||new GSize(0,0);if(D){if(D<0){D=0}if(D>100){D=100}}this.percentOpacity=D;this.overlap=B||false;this.hidden=false}if(typeof GOverlay!="undefined"){ELabel.prototype=new GOverlay()}ELabel.prototype.initialize=function(A){var C=document.createElement("div");C.style.position="absolute";C.innerHTML='<div class="'+this.classname+'">'+this.html+"</div>";A.getPane(G_MAP_MARKER_PANE).appendChild(C);this.map_=A;this.div_=C;if(this.percentOpacity){if(typeof (C.style.filter)=="string"){C.style.filter="alpha(opacity:"+this.percentOpacity+")"}if(typeof (C.style.KHTMLOpacity)=="string"){C.style.KHTMLOpacity=this.percentOpacity/100}if(typeof (C.style.MozOpacity)=="string"){C.style.MozOpacity=this.percentOpacity/100}if(typeof (C.style.opacity)=="string"){C.style.opacity=this.percentOpacity/100}}if(this.overlap){var B=GOverlay.getZIndex(this.point.lat());this.div_.style.zIndex=B-1}if(this.hidden){this.hide()}};ELabel.prototype.remove=function(){this.div_.parentNode.removeChild(this.div_)};ELabel.prototype.copy=function(){return new ELabel(this.point,this.html,this.classname,this.pixelOffset,this.percentOpacity,this.overlap)};ELabel.prototype.redraw=function(B){var C=this.map_.fromLatLngToDivPixel(this.point);var A=parseInt(this.div_.clientHeight);this.div_.style.left=(C.x+this.pixelOffset.width)+"px";this.div_.style.top=(C.y+this.pixelOffset.height-A)+"px"};ELabel.prototype.show=function(){if(this.div_){this.div_.style.display="";this.redraw()}this.hidden=false};ELabel.prototype.hide=function(){if(this.div_){this.div_.style.display="none"}this.hidden=true};ELabel.prototype.isHidden=function(){return this.hidden};ELabel.prototype.supportsHide=function(){return true};ELabel.prototype.setContents=function(A){this.html=A;this.div_.innerHTML='<div class="'+this.classname+'">'+this.html+"</div>";this.redraw(true)};ELabel.prototype.setPoint=function(A){this.point=A;if(this.overlap){var B=GOverlay.getZIndex(this.point.lat());this.div_.style.zIndex=B}this.redraw(true)};ELabel.prototype.setOpacity=function(A){if(A){if(A<0){A=0}if(A>100){A=100}}this.percentOpacity=A;if(this.percentOpacity){if(typeof (this.div_.style.filter)=="string"){this.div_.style.filter="alpha(opacity:"+this.percentOpacity+")"}if(typeof (this.div_.style.KHTMLOpacity)=="string"){this.div_.style.KHTMLOpacity=this.percentOpacity/100}if(typeof (this.div_.style.MozOpacity)=="string"){this.div_.style.MozOpacity=this.percentOpacity/100}if(typeof (this.div_.style.opacity)=="string"){this.div_.style.opacity=this.percentOpacity/100}}};ELabel.prototype.getPoint=function(){return this.point};ELabel.prototype.U=function(){return this.point};ELabel.prototype.V=function(){return this.point};ELabel.prototype.W=function(){return this.point};ELabel.prototype.X=function(){return this.point};ELabel.prototype.Y=function(){return this.point};ELabel.prototype.Z=function(){return this.point};function FullscreenManager(){this.container=$(".fullscreen").hide();this.overlay=$(".fullscreen_overlay").css("opacity",0.8).click(function(){FullscreenManager.prototype.Exit();ViewManager.prototype.DisablePlayall()}).hide();this.enabled=false;this.md=null;this.interval=null}FullscreenManager.prototype.play=function(A){if(this.enabled){return false}this.md=A;$(window).scroll(FullscreenManager.prototype._HandleScrollResize);$(window).resize(FullscreenManager.prototype._HandleScrollResize);this.container.show();this.overlay.show();FullscreenManager.prototype._HandleScrollResize();this.enabled=true;A.enableFullscreen(this.container);if(this.interval!=null){clearInterval(this.interval)}this.interval=setInterval(FullscreenManager.prototype._HandleScrollResize,20)};FullscreenManager.prototype.handleNewImage=function(){if(this.interval!=null){clearInterval(this.interval);this.interval=null}if(!this.enabled){return false}this.interval=setInterval(FullscreenManager.prototype._HandleScrollResize,20);FullscreenManager.prototype._HandleScrollResize()};FullscreenManager.prototype.exit=function(A){if(!this.enabled){return false}$(window).unbind("scroll",FullscreenManager.prototype._HandleScrollResize);$(window).unbind("resize",FullscreenManager.prototype._HandleScrollResize);this.container.hide();this.overlay.hide();this.enabled=false;this.md.disableFullscreen();this.md=null;return true};FullscreenManager.prototype._HandleScrollResize=function(){if(!globals.fullscreenManager.enabled){return false}var D=$(window).width();var F=$(window).height();globals.fullscreenManager.overlay.css({width:D+"px",height:F+"px"});var C=$(".fullscreen .player .image img:last");if(C.length>0){var A=C.get(0).origw;var J=C.get(0).origh;if(!A||!J){C.css({width:"auto",height:"auto"});var A=C.width();var J=C.height();if(A!=0&&J!=0&&A!=280&&J!=210&&A>100&&J>100){C.get(0).origh=J;C.get(0).origw=A}}if(globals.fullscreenManager.interval!=null&&A!=0&&J!=0){clearInterval(globals.fullscreenManager.interval);globals.fullscreenManager.interval=null}}else{if(globals.fullscreenManager.interval!=null){clearInterval(globals.fullscreenManager.interval);globals.fullscreenManager.interval=null}var A=768;var J=576}var K=1;if(A>D){K=(D-40)/A}else{if(J>F){K=(F-40)/J}else{K=1}}J=J*K;A=A*K;var L=(F/2-J/2);var H=(D/2-A/2);globals.fullscreenManager.container.css({left:(H<0?0:H)+"px",top:(L<0?0:L)+"px"});globals.fullscreenManager.md.mouseArea.css({width:A+"px",height:J+"px"});C.css({width:A+"px",height:J+"px"});globals.fullscreenManager.md.container.css({width:A+"px",height:J+"px"});$(".controls .play_button, .controls .pause_button",globals.fullscreenManager.md.container).css({left:(A/2-85/2)+"px",top:(J/2-64/2)+"px"});globals.fullscreenManager.container.css({width:A+"px",height:J+"px"});var B=A-120;var G=B/250;var I=Math.ceil(15*G);try{$("textarea",globals.fullscreenManager.md.subsContainer).css({"font-size":12*G+"px","width":(B+5)+"px","line-height":I+"px","height":(2*I)+"px"});globals.fullscreenManager.md.subsContainer.css({left:(A-B)/2+"px",top:((J-(2*I))-20)+"px"})}catch(E){}};FullscreenManager.prototype.Exit=function(){globals.fullscreenManager.exit()};function GoogleMap(){if(typeof GBrowserIsCompatible!="function"){return }if(!GBrowserIsCompatible()){alert("Your browser is too old to support google maps.");return }this.map=$(".googlemaps");if(this.map.length>0){this.geocoder=new GClientGeocoder();this.gmap=new GMap2(this.map.get(0));this.bounds=new GLatLngBounds();var A=this.GetPointFromFields();if(A){this.gmap.setCenter(A,5,G_PHYSICAL_MAP);this.createPin(A)}else{this.gmap.setCenter(new GLatLng(73.428424,-135.351562),3,G_PHYSICAL_MAP)}var B=this.gmap.getDefaultUI();B.controls.menumaptypecontrol=false;this.gmap.setUI(B);$("#place_on_map").unbind("click").click(GoogleMap.prototype.ClickPlaceOnMap);this.manager=new MarkerManager(this.gmap);GEvent.addListener(this.gmap,"click",GoogleMap.prototype.MapClick);GEvent.addListener(this.gmap,"zoomend",GoogleMap.prototype.MapZoomEnd);this.red_icon=new GIcon();this.red_icon.image=siteroot+"images/map/pin_red.gif";this.red_icon.iconSize=new GSize(24,22);this.red_icon.iconAnchor=new GPoint(6,21);this.red_icon.infoWindowAnchor=new GPoint(12,11);this.silver_icon=new GIcon();this.silver_icon.image=siteroot+"images/map/pin_silver.gif";this.silver_icon.iconSize=new GSize(24,22);this.silver_icon.iconAnchor=new GPoint(6,21);this.silver_icon.infoWindowAnchor=new GPoint(12,11);this.nix_icon=new GIcon();this.nix_icon.image=siteroot+"images/nix.gif";this.nix_icon.iconSize=new GSize(1,14);this.nix_icon.iconAnchor=new GPoint(-18,20);this.nix_icon.infoWindowAnchor=new GPoint(1,1);this.nix_md_icon=new GIcon();this.nix_md_icon.image=siteroot+"images/nix.gif";this.nix_md_icon.iconSize=new GSize(280,225);this.nix_md_icon.iconAnchor=new GPoint(0,225+22);this.nix_md_icon.infoWindowAnchor=new GPoint(1,1)}this.map=$(".googlemaps")}GoogleMap.prototype.ClickPlaceOnMap=function(){globals.googleMap.addressChangeHandler();return false};GoogleMap.prototype.MapClick=function(A){if(!A){globals.viewManager.deactivateAllMds(true,false)}};GoogleMap.prototype._StopHideMds=function(B){var A=globals.googleMap.gmap.getPane(G_MAP_FLOAT_PANE);$("div[id^=container_md]:visible",A).each(function(){var D=GoogleMap.prototype._ParseContainerId($(this).attr("id"));var C=globals.mdTracker.get(D);if(B||!C.controlsContainer.is(":visible")){C.container.hide();C.pauseStop();globals.viewManager.activateAllMds(false)}})};GoogleMap.prototype.MapZoomEnd=function(){var A=globals.googleMap.gmap.getPane(G_MAP_FLOAT_PANE);$("div[id^=container_md]:visible",A).each(function(){var C=GoogleMap.prototype._ParseContainerId($(this).attr("id"));var B=globals.mdTracker.get(C);B.setContainerPosToMarker()})};GoogleMap.prototype._ParseContainerId=function(B){var A=new RegExp("^[a-z_]+([0-9]+)$","i");var B=A.exec(B);return parseInt(B[1])};GoogleMap.prototype.addressChangeHandler=function(C){var B=this.LocationLookupValue();if(this.lastLocationLookup!=B){this.lastLocationLookup=B;var A=this;A.clear();this.getLocation(B,function(E){var D=A._handleLocationResponse(E);if(D==null){alert("Location could not be found. Please change the country, state, city and/or street fields and try again.")}else{A.SetPointOnFields(D);A.createPin(D);A.setZoom(10);A.setPoint(D)}A=null})}B=null};GoogleMap.prototype._handleLocationResponse=function(A){if(!A||A.Status.code!=200){return null}return this._getCoordinates(A.Placemark[0].Point.coordinates)};GoogleMap.prototype._getCoordinates=function(A){return new GLatLng(A[1],A[0])};GoogleMap.prototype.LocationLookupValue=function(){return""+$("[name$='_country']").val()+", "+$("[name$='_state']").val()+", "+$("[name$='_city']").val()+", "+$("[name$='_district']").val()};GoogleMap.prototype.GetPointFromFields=function(){var B=parseFloat($("[name$='_lon']").val());var A=parseFloat($("[name$='_lat']").val());if(B&&A){return new GLatLng(A,B)}return false};GoogleMap.prototype.SetPointOnFields=function(A){$("[name$='_lon']").val(A.lng());$("[name$='_lat']").val(A.lat())};GoogleMap.prototype.createMdMarker=function(A,C,G){var H=globals.mdTracker.get(G.id);if(!H){H=new Minidoc(G)}if(!H.marker_red){var F=new GMarker(A,{"icon":this.red_icon,"draggable":false});var E=new GMarker(A,{"icon":this.silver_icon,"draggable":false});var D=this.createLabel(A,G.title);var B=this.createClickOverlayLabel(A,D,G);H.addMapMarkers(F,E,D,B);this.addHoverListeners(H);this.addMarkerMdPlayClickListener(H)}this.manager.addMarker(H.label,7);if(C=="red"){this.manager.addMarker(H.marker_red,0);this.bounds.extend(A)}else{this.manager.addMarker(H.marker_silver,0)}this.manager.addMarker(H.labelOverlay,7);return H};GoogleMap.prototype.zoomCenterToBounds=function(){this.gmap.setZoom(this.gmap.getBoundsZoomLevel(this.bounds));this.gmap.panTo(this.bounds.getCenter())};GoogleMap.prototype.createClickOverlayLabel=function(A,B,D){var E=$("<div></div>").addClass("elabel").css({"position":"absolute","top":"0px","left":"0px"}).html(D.title).appendTo($("body"));var C=E.width()+6;E.remove();E=null;this.nix_icon.iconSize=new GSize(C,14);return new GMarker(A,{"icon":new GIcon(this.nix_icon),"draggable":false})};GoogleMap.prototype.addHoverListeners=function(B){var A=B;GEvent.addListener(A.marker_red,"mouseover",function(){globals.googleMap.manager.removeMarker(A.label);globals.googleMap.manager.addMarker(A.label,0)});GEvent.addListener(A.marker_red,"mouseout",function(){globals.googleMap.manager.removeMarker(A.label);globals.googleMap.manager.addMarker(A.label,7)});GEvent.addListener(A.marker_silver,"mouseover",function(){globals.googleMap.manager.removeMarker(A.label);globals.googleMap.manager.addMarker(A.label,0)});GEvent.addListener(A.marker_silver,"mouseout",function(){globals.googleMap.manager.removeMarker(A.label);globals.googleMap.manager.addMarker(A.label,7)})};GoogleMap.prototype.addMarkerMdPlayClickListener=function(B){var A=B;clickListener=function(){if(!A.container||!A.container.is(":visible")){globals.viewManager.deactivateAllMds(true,true);GoogleMap.prototype.ShowMd(A)}else{globals.viewManager.deactivateAllMds(true,true)}};GEvent.addListener(A.labelOverlay,"click",clickListener);GEvent.addListener(A.marker_red,"click",clickListener);GEvent.addListener(A.marker_silver,"click",clickListener)};GoogleMap.prototype.ShowMd=function(A){var B=globals.googleMap.gmap.getPane(G_MAP_FLOAT_PANE);A.setContainer(B);A.setContainerPosToMarker();A.label.hide();A.labelOverlay.hide();A.activate(false);A.container.show();AddShadows();globals.controller.select(A)};GoogleMap.prototype.HideMd=function(A){if(A.label){A.label.show();A.labelOverlay.show()}if(A.container!=null){A.container.hide()}globals.controller.deselect(A)};GoogleMap.prototype.createPin=function(A){this.marker=new GMarker(A,{"icon":this.red_icon,"draggable":true});this.gmap.addOverlay(this.marker);if($("#place_on_map").length>0){GEvent.addListener(this.marker,"dragend",GoogleMap.prototype.DropPin);this.marker.enableDragging()}else{this.marker.disableDragging()}};GoogleMap.prototype.createLabel=function(A,B){return new ELabel(A,'<div class="elabel_wrap"><div class="text">'+B+"</div></div>","elabel",new GSize(18,-6),null,true)};GoogleMap.prototype.DropPin=function(){globals.googleMap.SetPointOnFields(globals.googleMap.marker.getPoint())};GoogleMap.prototype.addLine=function(A){this.gmap.addOverlay(A)};GoogleMap.prototype.setPoint=function(A){this.gmap.panTo(A)};GoogleMap.prototype.setZoom=function(A){this.gmap.setZoom(A)};GoogleMap.prototype.getLocation=function(A,B){this.geocoder.getLocations(A,B)};GoogleMap.prototype.checkResize=function(){var A=$(window).width();var B=$(window).height();$(".map_container").css({width:A+"px",height:B+"px"});this.gmap.checkResize()};GoogleMap.prototype.clear=function(){this.gmap.clearOverlays()};GoogleMap.prototype.clearMarkers=function(){this.manager.clearMarkers();this.bounds=new GLatLngBounds()};GoogleMap.prototype._HandleResize=function(){globals.googleMap.checkResize()};function ListManager(){this.active=false}ListManager.prototype.activate=function(){if(this.active){return }if($.browser.msie){$("html").click(ListManager.prototype._HideCurrentMdChecked)}else{$(".list_container").click(ListManager.prototype._HideCurrentMd)}ListManager.prototype._HandleResize();this.active=true};ListManager.prototype.deactivate=function(){if($.browser.msie){$("html").unbind("click",ListManager.prototype._HideCurrentMdChecked)}else{$(".list_container").unbind("click",ListManager.prototype._HideCurrentMd)}this.active=false};ListManager.prototype._HideCurrentMdChecked=function(A){if(A.pageX>60&&A.pageX<340&&A.pageY>20&&A.pageY<230){return true}ListManager.prototype._HideCurrentMd()};ListManager.prototype._HideCurrentMd=function(){globals.viewManager.deactivateAllMds(true,true)};ListManager.prototype.ShowMd=function(A){A.setContainer(globals.viewManager.listContainer);A.activate(false);A.container.show();A.setContainerPosToListContainer();globals.controller.select(A)};ListManager.prototype.HideMd=function(A){A.container.hide();globals.listManager.md=null;globals.controller.deselect(A)};ListManager.prototype.createListItem=function(B){if(B.listContainer){return B.listContainer.show()}var A=B;clickListener=function(){globals.viewManager.deactivateAllMds(true,true);ListManager.prototype.ShowMd(A);return false};return B.listContainer=$('<a href="#open" class="list_item"></a>').append($('<span class="title"></span>').text(B.data.title)).append($('<div class="purpose"></div>').text(B.data.purpose)).click(clickListener)};ListManager.prototype._HandleResize=function(){var A=$(".list_container");var B=$(window).width()-parseInt(A.css("padding-left"));var C=$(window).height()-parseInt(A.css("padding-top"));$(".list_container").css({width:B+"px",height:C+"px"});$("div[id^=container_md]:visible",globals.viewManager.listContainer).each(function(){var E=GoogleMap.prototype._ParseContainerId($(this).attr("id"));var D=globals.mdTracker.get(E);if(D){D.setContainerPosToListContainer()}})};function MarkerManager(D,E){var B=this;B.map_=D;B.mapZoom_=D.getZoom();B.projection_=D.getCurrentMapType().getProjection();E=E||{};B.tileSize_=MarkerManager.DEFAULT_TILE_SIZE_;var A=MarkerManager.DEFAULT_MAX_ZOOM_;if(E.maxZoom!=undefined){A=E.maxZoom}B.maxZoom_=A;B.trackMarkers_=E.trackMarkers;var C;if(typeof E.borderPadding=="number"){C=E.borderPadding}else{C=MarkerManager.DEFAULT_BORDER_PADDING_}B.swPadding_=new GSize(-C,C);B.nePadding_=new GSize(C,-C);B.borderPadding_=C;B.gridWidth_=[];B.grid_=[];B.grid_[A]=[];B.numMarkers_=[];B.numMarkers_[A]=0;GEvent.bind(D,"moveend",B,B.onMapMoveEnd_);B.removeOverlay_=function(F){D.removeOverlay(F);B.shownMarkers_--};B.addOverlay_=function(F){D.addOverlay(F);B.shownMarkers_++};B.resetManager_();B.shownMarkers_=0;B.shownBounds_=B.getMapGridBounds_()}MarkerManager.DEFAULT_TILE_SIZE_=1024;MarkerManager.DEFAULT_MAX_ZOOM_=17;MarkerManager.DEFAULT_BORDER_PADDING_=100;MarkerManager.MERCATOR_ZOOM_LEVEL_ZERO_RANGE=256;MarkerManager.prototype.resetManager_=function(){var C=this;var A=MarkerManager.MERCATOR_ZOOM_LEVEL_ZERO_RANGE;for(var B=0;B<=C.maxZoom_;++B){C.grid_[B]=[];C.numMarkers_[B]=0;C.gridWidth_[B]=Math.ceil(A/C.tileSize_);A<<=1}};MarkerManager.prototype.clearMarkers=function(){var A=this;A.processAll_(A.shownBounds_,A.removeOverlay_);A.resetManager_()};MarkerManager.prototype.getTilePoint_=function(D,B,C){var A=this.projection_.fromLatLngToPixel(D,B);return new GPoint(Math.floor((A.x+C.width)/this.tileSize_),Math.floor((A.y+C.height)/this.tileSize_))};MarkerManager.prototype.addMarkerBatch_=function(C,G,B){var F=C.getPoint();if(this.trackMarkers_){GEvent.bind(C,"changed",this,this.onMarkerMoved_)}var D=this.getTilePoint_(F,B,GSize.ZERO);for(var E=B;E>=G;E--){var A=this.getGridCellCreate_(D.x,D.y,E);A.push(C);D.x=D.x>>1;D.y=D.y>>1}};MarkerManager.prototype.isGridPointVisible_=function(B){var F=this;var D=F.shownBounds_.minY<=B.y&&B.y<=F.shownBounds_.maxY;var A=F.shownBounds_.minX;var C=A<=B.x&&B.x<=F.shownBounds_.maxX;if(!C&&A<0){var E=F.gridWidth_[F.shownBounds_.z];C=A+E<=B.x&&B.x<=E-1}return D&&C};MarkerManager.prototype.onMarkerMoved_=function(E,A,C){var G=this;var I=G.maxZoom_;var D=false;var B=G.getTilePoint_(A,I,GSize.ZERO);var F=G.getTilePoint_(C,I,GSize.ZERO);while(I>=0&&(B.x!=F.x||B.y!=F.y)){var H=G.getGridCellNoCreate_(B.x,B.y,I);if(H){if(G.removeFromArray(H,E)){G.getGridCellCreate_(F.x,F.y,I).push(E)}}if(I==G.mapZoom_){if(G.isGridPointVisible_(B)){if(!G.isGridPointVisible_(F)){G.removeOverlay_(E);D=true}}else{if(G.isGridPointVisible_(F)){G.addOverlay_(E);D=true}}}B.x=B.x>>1;B.y=B.y>>1;F.x=F.x>>1;F.y=F.y>>1;--I}if(D){G.notifyListeners_()}};MarkerManager.prototype.removeMarker=function(C){var F=this;var E=F.maxZoom_;var G=false;var B=C.getPoint();var D=F.getTilePoint_(B,E,GSize.ZERO);while(E>=0){var A=F.getGridCellNoCreate_(D.x,D.y,E);if(A){F.removeFromArray(A,C)}if(E==F.mapZoom_){if(F.isGridPointVisible_(D)){F.removeOverlay_(C);G=true}}D.x=D.x>>1;D.y=D.y>>1;--E}if(G){F.notifyListeners_()}};MarkerManager.prototype.addMarkers=function(D,E,C){var A=this.getOptMaxZoom_(C);for(var B=D.length-1;B>=0;B--){this.addMarkerBatch_(D[B],E,A)}this.numMarkers_[E]+=D.length};MarkerManager.prototype.getOptMaxZoom_=function(A){return A!=undefined?A:this.maxZoom_};MarkerManager.prototype.getMarkerCount=function(B){var A=0;for(var C=0;C<=B;C++){A+=this.numMarkers_[C]}return A};MarkerManager.prototype.addMarker=function(B,F,D){var E=this;var A=this.getOptMaxZoom_(D);E.addMarkerBatch_(B,F,A);var C=E.getTilePoint_(B.getPoint(),E.mapZoom_,GSize.ZERO);if(E.isGridPointVisible_(C)&&F<=E.shownBounds_.z&&E.shownBounds_.z<=A){E.addOverlay_(B);E.notifyListeners_()}this.numMarkers_[F]++};if(typeof GBounds!="undefined"){GBounds.prototype.containsPoint=function(A){var B=this;return(B.minX<=A.x&&B.maxX>=A.x&&B.minY<=A.y&&B.maxY>=A.y)}}MarkerManager.prototype.getGridCellCreate_=function(A,F,E){var C=this.grid_[E];if(A<0){A+=this.gridWidth_[E]}var B=C[A];if(!B){B=C[A]=[];return B[F]=[]}var D=B[F];if(!D){return B[F]=[]}return D};MarkerManager.prototype.getGridCellNoCreate_=function(A,E,D){var C=this.grid_[D];if(A<0){A+=this.gridWidth_[D]}var B=C[A];return B?B[E]:undefined};MarkerManager.prototype.getGridBounds_=function(A,I,H,F){I=Math.min(I,this.maxZoom_);var B=A.getSouthWest();var E=A.getNorthEast();var G=this.getTilePoint_(B,I,H);var D=this.getTilePoint_(E,I,F);var J=this.gridWidth_[I];if(E.lng()<B.lng()||D.x<G.x){G.x-=J}if(D.x-G.x+1>=J){G.x=0;D.x=J-1}var C=new GBounds([G,D]);C.z=I;return C};MarkerManager.prototype.getMapGridBounds_=function(){var A=this;return A.getGridBounds_(A.map_.getBounds(),A.mapZoom_,A.swPadding_,A.nePadding_)};MarkerManager.prototype.onMapMoveEnd_=function(){var A=this;A.objectSetTimeout_(this,this.updateMarkers_,0)};MarkerManager.prototype.objectSetTimeout_=function(B,C,A){return window.setTimeout(function(){C.call(B)},A)};MarkerManager.prototype.refresh=function(){var A=this;if(A.shownMarkers_>0){A.processAll_(A.shownBounds_,A.removeOverlay_)}A.processAll_(A.shownBounds_,A.addOverlay_);A.notifyListeners_()};MarkerManager.prototype.updateMarkers_=function(){var A=this;A.mapZoom_=this.map_.getZoom();var B=A.getMapGridBounds_();if(B.equals(A.shownBounds_)&&B.z==A.shownBounds_.z){return }if(B.z!=A.shownBounds_.z){A.processAll_(A.shownBounds_,A.removeOverlay_);A.processAll_(B,A.addOverlay_)}else{A.rectangleDiff_(A.shownBounds_,B,A.removeCellMarkers_);A.rectangleDiff_(B,A.shownBounds_,A.addCellMarkers_)}A.shownBounds_=B;A.notifyListeners_()};MarkerManager.prototype.notifyListeners_=function(){GEvent.trigger(this,"changed",this.shownBounds_,this.shownMarkers_)};MarkerManager.prototype.processAll_=function(B,D){for(var A=B.minX;A<=B.maxX;A++){for(var C=B.minY;C<=B.maxY;C++){this.processCellMarkers_(A,C,B.z,D)}}};MarkerManager.prototype.processCellMarkers_=function(B,F,D,E){var A=this.getGridCellNoCreate_(B,F,D);if(A){for(var C=A.length-1;C>=0;C--){E(A[C])}}};MarkerManager.prototype.removeCellMarkers_=function(A,C,B){this.processCellMarkers_(A,C,B,this.removeOverlay_)};MarkerManager.prototype.addCellMarkers_=function(A,C,B){this.processCellMarkers_(A,C,B,this.addOverlay_)};MarkerManager.prototype.rectangleDiff_=function(B,A,D){var C=this;C.rectangleDiffCoords(B,A,function(E,F){D.apply(C,[E,F,B.z])})};MarkerManager.prototype.rectangleDiffCoords=function(B,A,L){var F=B.minX;var M=B.minY;var H=B.maxX;var D=B.maxY;var E=A.minX;var K=A.minY;var G=A.maxX;var C=A.maxY;for(var J=F;J<=H;J++){for(var I=M;I<=D&&I<K;I++){L(J,I)}for(var I=Math.max(C+1,M);I<=D;I++){L(J,I)}}for(var I=Math.max(M,K);I<=Math.min(D,C);I++){for(var J=Math.min(H+1,E)-1;J>=F;J--){L(J,I)}for(var J=Math.max(F,G+1);J<=H;J++){L(J,I)}}};MarkerManager.prototype.removeFromArray=function(E,C,D){var A=0;for(var B=0;B<E.length;++B){if(E[B]===C||(D&&E[B]==C)){E.splice(B--,1);A++}}return A};function MdTracker(){this.mds={}}MdTracker.prototype.add=function(A){return this.mds[A.id]=A};MdTracker.prototype.get=function(A){if(typeof this.mds[A]!="undefined"){return this.mds[A]}return false};function Minidoc(B,A){this.settings={minPlayTime:5000};this.currentState={nr:0,start:null,restart:false,playing:false,autoPlay:false,subTimers:null,controlsTimer:null,loaded:false,loading:false,active:true,preventDeactivate:false,fullscreen:false};this.data=B;this.id=this.data.id;this.container=null;this.parentContainer=null;this.preview=A?true:false;this.marker_red=null;this.marker_silver=null;this.label=null;this.labelOverlay=null;this.listContainer=null;this.containerInfo=null;if(globals.mdTracker){globals.mdTracker.add(this)}}Minidoc.prototype.setContainer=function(A){this.parentContainer=A;if(this.container==null){this._initContainer()}this.container.appendTo(this.parentContainer)};Minidoc.prototype.enableFullscreen=function(B){if(this.currentState.fullscreen){return true}this.currentState.fullscreen=true;this._showControls();this.containerInfo={left:this.container.css("left"),top:this.container.css("top"),width:null,height:null};this.container.appendTo(B).css({top:"0px",left:"0px"});var A=this.data.items.length;var C=null;this._loadFullscreenImage(this.currentState.nr);this.imageContainer.empty().append(this.data.items[this.currentState.nr].imageObjFullscreen);globals.fullscreenManager.handleNewImage();$(".info_over",this.container).hide()};Minidoc.prototype.disableFullscreen=function(){if(!this.currentState.fullscreen){return false}this.currentState.fullscreen=false;this._showControls();this.container.css(this.containerInfo).appendTo(this.parentContainer);$(".controls .play_button, .controls .pause_button",this.container).css({left:null,top:null});this.subsContainer.css({left:null,top:null});$("textarea",this.subsContainer).css({"font-size":null,"width":null,"line-height":null,"height":null});this.mouseArea.css({width:null,height:null});this.imageContainer.empty().append($("<img>").attr("src",this.data.items[this.currentState.nr].image));$(".info_over",this.container).show();this.containerInfo=null};Minidoc.prototype.setContainerPosToMarker=function(){var A=this.marker_red.getLatLng();var B=globals.googleMap.gmap.fromLatLngToDivPixel(A);this.container.css({left:B.x+"px",top:(B.y-(225+23))+"px"})};Minidoc.prototype.setContainerPosToListContainer=function(){var A=this.listContainer.offset();this.container.css({left:A.left+"px",top:(A.top+($.browser.msie?0:1))+"px"})};Minidoc.prototype.addMapMarkers=function(D,C,B,A){this.marker_red=D;this.marker_silver=C;this.label=B;this.labelOverlay=A};Minidoc.prototype.deactivate=function(B,A){if(this.currentState.preventDeactivate){return false}if(!A&&this.controlsContainer!=null&&this.controlsContainer.is(":visible")){return false}if(B){this.pauseStop()}if(!this.currentState.playing){if(this.container==null){return true}this.mouseArea.css("opacity",0.6);this.currentState.active=false;this._hideControls();return true}this._hideControls();return false};Minidoc.prototype.activate=function(A){if(globals.viewManager&&A&&!this.currentState.fullscreen){globals.viewManager.setOnTop(this.container)}this.mouseArea.css("opacity",0);this.currentState.active=true};Minidoc.prototype.playResume=function(){if(globals.viewManager){this.currentState.preventDeactivate=true;globals.viewManager.deactivateAllMds(true,true);this.currentState.preventDeactivate=false;this.activate(true);this.container.show();if(!this.currentState.fullscreen){globals.viewManager.panToMiddle(this)}}this.currentState.autoPlay=true;this._gatrack("play");if(!this.currentState.loaded){if(!this.currentState.loading){this._loadData()}else{this._showLoad("Not loaded yet...")}return false}if(!this.currentState.playing){if(this.currentState.restart){this.currentState.restart=false;this.currentState.nr=0}this._playItem(this.currentState.nr);this._showControls();this._hideControls()}};Minidoc.prototype.pauseStop=function(){if(this.currentState.playing){this._doPauseStop(false)}this.currentState.autoPlay=false};Minidoc.prototype._doPauseStop=function(B){if(this.currentState.playing){this.data.items[this.currentState.nr].soundObj.stop()}if(this.currentState.subTimers!=null){var A=this.currentState.subTimers.length;for(var C=0;C<A;C++){clearTimeout(this.currentState.subTimers[C])}}this.currentState.subTimers=null;this.currentState.playing=false;this.currentState.autoPlay=false;this.currentState.start=null;this.subsContainer.hide();this._showControls();this.currentState.restart=B};Minidoc.prototype._showLoad=function(A){this.loadContainer.text(A?A:"Loading...").show()};Minidoc.prototype._showControls=function(){this.mouseArea.removeClass("nocursor");var A=this;this.controlsContainer.show();if(this.currentState.playing){this.stopControl.show();this.playControl.hide()}else{this.stopControl.hide();this.playControl.show()}if(this.currentState.fullscreen){this.fullscreendControl.show();this.fullscreenControl.hide()}else{this.fullscreendControl.hide();this.fullscreenControl.show()}if(globals.viewManager){if(globals.viewManager.canPlayNext(this.data.id)){this.nextControl.show()}else{this.nextControl.hide()}}this.prevControl.show();if(this.preview){this.fullscreendControl.hide();this.fullscreenControl.hide();this.nextControl.hide();this.prevControl.hide();this.infoControl.hide();this.infoOver.hide()}};Minidoc.prototype._hideControls=function(){this.controlsContainer.hide()};Minidoc.prototype._gatrack=function(A){try{pageTracker._trackEvent("Mini documentaries",A,this.data.title,this.id)}catch(B){}};Minidoc.prototype._initContainer=function(){var A=this;this.container=$("<div id='container_md"+this.id+"'></div>").addClass("case player shadow").append(this.titleContainer=$('<div class="title grabable"></div>').text(this.data.title)).append(this.controlsContainer=$('<div class="controls"></div>').append(this.stopControl=$('<a href="#pause" class="control pause_button"></a>').css("opacity",0.8).click(function(){A.pauseStop();return false}).hide()).append(this.playControl=$('<a href="#play" class="control play_button"></a>').css("opacity",0.8).click(function(){A.playResume();if(globals.controller){globals.controller.select(A)}return false}).hide()).append(this.fullscreenControl=$('<a href="#fullscreen" class="control fullscreen_button"></a>').css("opacity",0.8).click(function(){globals.fullscreenManager.play(A);return false})).append(this.fullscreendControl=$('<a href="#exit_fullscreen" class="control fullscreend_button"></a>').css("opacity",0.8).click(function(){globals.fullscreenManager.exit();ViewManager.prototype.DisablePlayall();return false}).hide()).append(this.nextControl=$('<a href="#next" class="control next_button"></a>').css("opacity",0.8).click(function(){if(globals.viewManager){globals.viewManager.playNext(A.data.id)}return false})).append(this.prevControl=$('<a href="#prev" class="control prev_button"></a>').css("opacity",0.8).click(function(){A._doPauseStop(true);A.playResume();if(globals.controller){globals.controller.select(A)}return false})).append(this.infoControl=$('<a href="'+siteroot+"minidoc/facts/"+A.id+'/info" class="control info_button" target="large_iframe"></a>').css("opacity",0.8).click(function(){globals.fullscreenManager.exit();return Controller.prototype.HandleClickLargeIframe()})).append(this.renderInfoOverElement()).hide()).append(this.mouseArea=$('<div class="mousearea"></div>').css("opacity",0).click(function(){A._showControls();if(globals.viewManager){globals.viewManager.deactivateAllMds(false,false)}if(globals.controller){globals.controller.select(A)}A.activate(true)})).append(this._renderSubtitles()).append(this.loadContainer=$('<div class="loadingmessage"></div>').hide()).append(this.imageContainer=$('<div class="image"><img src="'+this.data.items[0].image+'"></div>')).hover(function(){if(A.currentState.active){A._showControls()}},function(){A._hideControls()})};Minidoc.prototype.renderInfoOverElement=function(){var E=$('<div class="keywords"></div>');var B=this.data.keywords.length;for(var D=0;D<B;D++){$('<a href="#keyword_'+this.data.keywords[D].name+'" rel="'+this.data.keywords[D].id+'"></a>').html(this.data.keywords[D].name).click(Controller.prototype.KeywordClick).appendTo(E);$("<span>&nbsp; </span>").appendTo(E)}var C=$('<div class="purpose"></div>').text(this.data.purpose);var A=[];if(this.data.country!=""){A.push(this.data.country)}if(this.data.state!=""){A.push(this.data.state)}if(this.data.city!=""){A.push(this.data.city)}if(this.data.street!=""){A.push(this.data.street)}var F=$('<div class="location"></div>');B=A.length;for(var D=0;D<B;D++){$('<a href="#location_'+A[D]+'"></a>').html(A[D]).click(Controller.prototype.KeywordClick).appendTo(F);$("<span>&nbsp;</span>").appendTo(F)}return this.infoOver=$('<div class="info_over"></div>').css("opacity",0.8).append(C).append(F).append(E)};Minidoc.prototype.reload=function(){this.pauseStop();var A=this.data.items.length;for(var B=0;B<A;B++){soundManager.destroySound("md_"+this.id+"_item_"+B)}this.currentState.nr=0;this._loadData(function(D){var E=D.container;var C={left:D.container.css("left"),top:D.container.css("top")};D._initContainer();E.replaceWith(D.container);D.container.css(C)})};Minidoc.prototype._loadData=function(B){this.currentState.loading=true;var A=this;this._showLoad();$.ajax({dataType:"json",url:siteroot+"minidoc/view/json/"+this.id,success:function(C){A._processLoadedData(C,B)}})};Minidoc.prototype._processLoadedData=function(A,B){this.loadContainer.hide();this.currentState.loaded=true;this.currentState.loading=false;this.data=A;this._showControls();if(!this.currentState.playing&&this.currentState.autoPlay){this._playItem(this.currentState.nr);this._hideControls()}if(typeof B=="function"){B(this)}};Minidoc.prototype._playItem=function(C){if(typeof this.data.items[C]=="undefined"){this._doPauseStop(true);globals.viewManager.continuePlayall();soundManager._writeDebug("playItem "+C+" does not exists");return false}var B=this.data.items[C];if(this.currentState.playing){soundManager._writeDebug("playItem "+C+" already playing");return false}if(typeof B.soundObj=="undefined"||typeof B.imageObj=="undefined"||!B.soundObj.loaded){if(!B.soundObj){soundManager._writeDebug("playItem "+C+" not loaded: obj not there")}else{soundManager._writeDebug("playItem "+C+" not loaded: "+B.soundObj.readyState)}this._showLoad();this.currentState.playing=false;this.currentState.nr=C;this.currentState.start=null;this._startLoadItem(C);return false}this.currentState.playing=true;this.currentState.nr=C;this.currentState.start=new Date();var A=this;this.loadContainer.hide();if(this.currentState.fullscreen){this._loadFullscreenImage(C);this._loadFullscreenImage(C+1)}this.imageContainer.empty().append(this.currentState.fullscreen?B.imageObjFullscreen:B.imageObj);this.subsContainer.show();globals.fullscreenManager.handleNewImage();this._startSubtitles(C);soundManager._writeDebug(B.soundObj.sID+" call play function");B.soundObj.play()};Minidoc.prototype._loadFullscreenImage=function(B){if(typeof this.data.items[B]!="undefined"){var A=this.data.items[B];if(typeof A.imageObjFullscreen=="undefined"){var C=this.data.items[B].imageObjFullscreen=$(new Image());C.load(FullscreenManager.prototype._HandleScrollResize);C.attr("src",A.image_large)}}};Minidoc.prototype._startSubtitles=function(H){if(this.currentState.subTimers!=null){var A=this.currentState.subTimers.length;for(var E=0;E<A;E++){clearTimeout(this.currentState.subTimers[E])}}this.currentState.subTimers=new Array();var G=this.data.items[H];var C=$("textarea",this.subsContainer).val(G.subs+"\n");var F=parseInt(C.css("line-height"));var B=(C.get(0).scrollHeight/F)-1;var D=Math.floor(G.soundObj.duration/B);for(var E=0;E<B;E+=2){this._showSubtitle(H,E,D,C)}};Minidoc.prototype._showSubtitle=function(C,D,B,A){this.currentState.subTimers[this.currentState.subTimers.length]=setTimeout(function(){var E=parseInt(A.css("line-height"));A.scrollTop(E*D)},B*D)};Minidoc.prototype._renderSubtitles=function(){this.subsContainer=$('<div class="show subs"></div>').append(this._RenderSubtitle(0,0,"main")).append(this._RenderSubtitle(1,1,"shadow")).append(this._RenderSubtitle(1,-1,"shadow")).append(this._RenderSubtitle(-1,1,"shadow")).append(this._RenderSubtitle(-1,-1,"shadow"));return this.subsContainer.hide()};Minidoc.prototype._RenderSubtitle=function(B,C,A){return $("<textarea spellcheck='false'></textarea>").addClass("sub "+A).css({"top":B+"px","left":C+"px"})};Minidoc.prototype._finishItem=function(){if(this.currentState.start==null){return false}var B=new Date();var A=B-this.currentState.start;this.subsContainer.hide();if(A<this.settings.minPlayTime){var C=this;setTimeout(function(){C._finishItem()},A)}else{this.currentState.playing=false;this.currentState.start=null;if(this.currentState.autoPlay){this._playItem(this.currentState.nr+1)}}};Minidoc.prototype._loadItemFinished=function(A){this.data.items[A].loaded=true;soundManager._writeDebug("auto: "+this.currentState.autoPlay+" playing: "+this.currentState.playing);if(this.currentState.autoPlay&&!this.currentState.playing){this._playItem(A)}this._startLoadItem(A+1)};Minidoc.prototype._loadImage=function(B){var A=this.data.items[B];A.imageObj=jQuery("<img>").attr("src",A.image);this._loadItemFinished(B)};Minidoc.prototype._loadSound=function(C){var B=this.data.items[C];var A=this;B.soundObj=soundManager.createSound({id:"md_"+this.id+"_item_"+C,url:B.audio,autoLoad:false,autoPlay:false,stream:false,onload:function(){soundManager._writeDebug(this.sID+" finished loading");A._loadImage(C)},onfinish:function(){soundManager._writeDebug(this.sID+" finished playing");A._finishItem()}});B.soundObj.load()};Minidoc.prototype._startLoadItem=function(A){if(typeof this.data.items[A]!="undefined"){this._showLoad("Loading item "+(A+1)+"/"+this.data.items.length);if(typeof this.data.items[A].loaded=="undefined"){this.data.items[A].loaded=false;this._loadSound(A)}}else{this.loadContainer.hide()}};var CLOUD_VIEW=1;var MAP_VIEW=2;var LIST_VIEW=3;function ViewManager(){this.mds=[];this.mapMdsData=null;this.mapMds=[];this.cloudContainer=$(".cloud_container").show();this.listContainer=$(".list_container").hide();this.mapContainer=$(".map_container").hide();this.titleContainer=$(".main_title");this.currentView=CLOUD_VIEW;this.playall={active:false,md:0};this.storedSelectedMd=null}ViewManager.prototype.ClickCloudButton=function(){if($(this).hasClass("disabled")){return false}globals.viewManager.show_cloudview();return false};ViewManager.prototype.ClickMapButton=function(){if($(this).hasClass("disabled")){return false}globals.viewManager.show_mapview();return false};ViewManager.prototype.ClickListButton=function(){if($(this).hasClass("disabled")){return false}globals.viewManager.show_listview();return false};ViewManager.prototype.DisablePlayall=function(){globals.viewManager.playall.active=false;$("#playall_button").removeClass("disabled");return false};ViewManager.prototype.ClickPlayallButton=function(){if($("#playall_button").hasClass("disabled")){return ViewManager.prototype.DisablePlayall()}if(typeof globals.viewManager.mds[0]!="undefined"){$("#playall_button").addClass("disabled");globals.viewManager.playall.active=true;globals.viewManager.playall.md=0;globals.viewManager.showPlayResumeMd(globals.viewManager.mds[0]);globals.fullscreenManager.play(globals.viewManager.mds[0])}else{alert("No mini documentaries found to play.")}return false};ViewManager.prototype.continuePlayall=function(){if(this.playall.active){this.playall.md++;var A=this;setTimeout(function(){if(typeof A.mds[A.playall.md]!="undefined"){A.showPlayResumeMd(A.mds[A.playall.md])}else{ViewManager.prototype.DisablePlayall();FullscreenManager.prototype.Exit()}A=null},2500);return }};ViewManager.prototype.setCurrentMDs=function(B){this.mds=[];var A=B.length;var D=null;for(var C=0;C<A;C++){this.mds.push(D=globals.cloudManager.createMd(B[C]));D.data.published=B[C].published}AddShadows();if(this.currentView==CLOUD_VIEW){this.show_cloudview()}else{if(this.currentView==MAP_VIEW){this.currentView=null;this.show_mapview()}else{if(this.currentView==LIST_VIEW){this.show_listview()}}}};ViewManager.prototype.show_cloudview=function(){this.storeSelectedMd();this.currentView=CLOUD_VIEW;this.deactivateAllMds(true,true);globals.listManager.deactivate();globals.cloudManager.deactivate();this.listContainer.hide();this.mapContainer.hide();this.cloudContainer.show();$(".case.player",this.cloudContainer).hide();this.deactivateAllMds(true,true);$(".button_holder.disabled").removeClass("disabled");$("#cloud_button").addClass("disabled");globals.controller.deselect();this.OrderRandom();var O=this.mds.length;var F=80;var D=120;var P=0;var K=280+20;var J=225+60;var R=O<7?Math.ceil(O/2):(Math.ceil(Math.sqrt(O))+1);var H=-1;var E=0;var C=0;var N=0;for(var L=0;true;L++){if(typeof this.mds[N]=="undefined"){break}if((L%R)==0){H++}if(rnd()*100<=P){}else{var E=(L%R)*K;var C=(H*J);E+=(Math.floor((0.5-rnd())*F*2))+F+Math.ceil(K/2);C+=(Math.floor((0.5-rnd())*D*2))+D+Math.ceil(J/2);this.mds[N].setContainer(this.cloudContainer);this.mds[N].container.show().css({left:E+"px",top:C+"px"});this.mds[N].activate(false);N++}}var Q=((R*K)+(2*F)+K);var M=(((H+1)*J)+(2*D)+J);var I=$(window).width();var B=$(window).height();var A=Math.floor((I>Q)?(I-Q)/2:(Q-I)/-2);var G=Math.floor((B>M)?(B-M)/2:(M-B)/-2);this.cloudContainer.css({top:G+"px",left:A+"px"});globals.cloudManager.activate(Q,M,F,D);this.restoreSelectedMd()};ViewManager.prototype.show_mapview=function(){if(this.currentView==MAP_VIEW){return }this.storeSelectedMd();this.currentView=MAP_VIEW;this.deactivateAllMds(true,true);globals.cloudManager.deactivate();globals.listManager.deactivate();this.listContainer.hide();this.mapContainer.show();this.cloudContainer.hide();this.deactivateAllMds(true,true);$(".button_holder.disabled").removeClass("disabled");$("#map_button").addClass("disabled");globals.googleMap.checkResize();if(this.mapMdsData==null){$.ajax({url:siteroot+"minidoc/mapview/json",cache:false,dataType:"json",success:ViewManager.prototype.ReceiveMapviewData,type:"post"})}else{this.renderAllMarkers()}};ViewManager.prototype.ReceiveMapviewData=function(A){globals.viewManager.mapMdsData=A;globals.viewManager.renderAllMarkers()};ViewManager.prototype.renderAllMarkers=function(){this.mapMds=[];this.markers=[];var D=[];var B=null;globals.googleMap.clearMarkers();var A=this.mapMdsData.length;for(var C=0;C<A;C++){if(this.mapMdsData[C].lat&&this.mapMdsData[C].lng){B=new GLatLng(this.mapMdsData[C].lat,this.mapMdsData[C].lng);this.mapMds.push(globals.googleMap.createMdMarker(B,this._inCurrentMds(this.mapMdsData[C])?"red":"silver",this.mapMdsData[C]))}}globals.googleMap.manager.onMapMoveEnd_();globals.googleMap.zoomCenterToBounds();this.restoreSelectedMd()};ViewManager.prototype._inCurrentMds=function(C){var A=this.mds.length;for(var B=0;B<A;B++){if(this.mds[B].id==C.id){return true}}return false};ViewManager.prototype.reloadMapMds=function(){this.mapMdsData=null;if(this.currentView==MAP_VIEW){this.currentView=null;this.show_mapview()}};ViewManager.prototype.show_listview=function(){this.storeSelectedMd();this.currentView=LIST_VIEW;this.deactivateAllMds(true,true);globals.cloudManager.deactivate();globals.listManager.activate();this.listContainer.show();this.mapContainer.hide();this.cloudContainer.hide();$(".button_holder.disabled").removeClass("disabled");$("#list_button").addClass("disabled");$(".list_item",this.listContainer).hide();this.OrderAlph();var A=this.mds.length;for(var B=0;B<A;B++){globals.listManager.createListItem(this.mds[B]).appendTo(this.listContainer)}this.restoreSelectedMd()};ViewManager.prototype.OrderRandom=function(B,A){if(!B){this.mds.sort(ViewManager.prototype.OrderRandom);return 0}return(0.5-rnd())};ViewManager.prototype.OrderAlph=function(B,A){if(!B){this.mds.sort(ViewManager.prototype.OrderAlph);return 0}return B.data.title.toUpperCase()>A.data.title.toUpperCase()?1:-1};ViewManager.prototype.storeSelectedMd=function(){this.storedSelectedMd=null;if(globals.controller.selected&&globals.controller.selected.md&&globals.controller.selected.md.container){this.storedSelectedMd=globals.controller.selected.md}};ViewManager.prototype.restoreSelectedMd=function(){if(this.storedSelectedMd!=null){if(this.currentView==CLOUD_VIEW){if(this.storedSelectedMd.container.is(":visible")){this.deactivateAllMds(true,true);this.storedSelectedMd.activate(true);this.storedSelectedMd.container.show();this.panToMiddle(this.storedSelectedMd);globals.controller.select(this.storedSelectedMd)}}else{if(this.currentView==MAP_VIEW){this.deactivateAllMds(true,true);GoogleMap.prototype.ShowMd(this.storedSelectedMd);globals.viewManager.panToMiddle(this.storedSelectedMd)}else{if(this.currentView==LIST_VIEW){if(this.storedSelectedMd.listContainer&&this.storedSelectedMd.listContainer.is(":visible")){this.deactivateAllMds(true,true);ListManager.prototype.ShowMd(this.storedSelectedMd)}}}}this.storedSelectedMd=null}};ViewManager.prototype.deactivateAllMds=function(E,D){var B=this.currentView==MAP_VIEW?this.mapMds:this.mds;var A=B.length;for(var C=0;C<A;C++){if(B[C].deactivate(E,D)){if(this.currentView==CLOUD_VIEW){globals.controller.deselect(B[C])}else{if(this.currentView==MAP_VIEW){GoogleMap.prototype.HideMd(B[C])}else{if(this.currentView==LIST_VIEW){ListManager.prototype.HideMd(B[C])}}}}}Controller.prototype.ShowSelection();return true};ViewManager.prototype.activateAllMds=function(){var B=this.currentView==MAP_VIEW?this.mapMds:this.mds;var A=B.length;for(var C=0;C<A;C++){if(B[C].currentState.playing){return false}}for(var C=0;C<A;C++){B[C].activate(false)}if(this.currentView==CLOUD_VIEW){globals.controller.deselect()}return true};ViewManager.prototype.setOnTop=function(A){if(this.currentView==CLOUD_VIEW){A.appendTo(this.cloudContainer)}};ViewManager.prototype.panToMiddle=function(E){if(this.currentView==CLOUD_VIEW){var D=($(window).width()/2)-parseInt(E.container.css("left"));var C=($(window).height()/2)-parseInt(E.container.css("top"));this.cloudContainer.animate({top:C-110+"px",left:D-140+"px"},500,CloudManager.prototype._HandleCurrentSize)}else{if(this.currentView==MAP_VIEW){var A=E.marker_red.getLatLng();var B=globals.googleMap.gmap.fromLatLngToDivPixel(A);B.x+=140;B.y-=112;A=globals.googleMap.gmap.fromDivPixelToLatLng(B);globals.googleMap.gmap.panTo(A)}}};ViewManager.prototype.setMainTitle=function(A){if($("div",this.titleContainer).length==0){this.titleContainer.empty().append(this.renderTitleStroke(-2,-2,"stroke grabable")).append(this.renderTitleStroke(-2,2,"stroke grabable")).append(this.renderTitleStroke(2,-2,"stroke grabable")).append(this.renderTitleStroke(2,2,"stroke grabable")).append(this.renderTitleStroke(0,0,"main grabable"))}$("div",this.titleContainer).html("urbaninform<br/>"+A)};ViewManager.prototype.renderTitleStroke=function(A,C,B){return $("<div></div>").addClass(B).css({right:A+"px",top:C+"px"})};ViewManager.prototype.playNext=function(C){var A=this.mds.length;for(var B=0;B<A;B++){if(this.mds[B].data.id==C){if(typeof this.mds[B+1]!="undefined"){if(this.playall.active){this.playall.md=B+1}this.showPlayResumeMd(this.mds[B+1])}else{if(typeof this.mds[0]!="undefined"){if(this.playall.active){this.playall.md=0}this.showPlayResumeMd(this.mds[0])}}return }}};ViewManager.prototype.canPlayNext=function(C){var A=this.mds.length;for(var B=0;B<A;B++){if(this.mds[B].data.id==C){return true}}return false};ViewManager.prototype.showPlayResumeMd=function(A){if(this.currentView==MAP_VIEW){GoogleMap.prototype.ShowMd(A)}else{if(this.currentView==LIST_VIEW){ListManager.prototype.ShowMd(A)}}if(globals.fullscreenManager.exit()){globals.fullscreenManager.play(A)}A.playResume()};ViewManager.prototype.LocationClick=function(){return false};ViewManager.prototype.HandleTitleSize=function(){globals.viewManager.titleContainer.css("width",($(window).width()-350)+"px")};ViewManager.prototype.HandleResize=function(){ViewManager.prototype.HandleTitleSize();if(globals.viewManager.currentView==CLOUD_VIEW){CloudManager.prototype._HandleResize();CloudManager.prototype._HandleCurrentSize()}else{if(globals.viewManager.currentView==MAP_VIEW){GoogleMap.prototype._HandleResize()}else{if(globals.viewManager.currentView==LIST_VIEW){ListManager.prototype._HandleResize()}}}};if(typeof SoundManager!="undefined"){var soundManager=new SoundManager();soundManager.url=siteroot+"sm2.95a/";soundManager.debugMode=false;soundManager.consoleOnly=true;soundManager.useConsole=false;soundManager.waitForWindowLoad=true;soundManager.useHighPerformance=false;soundManager.loaded=false;soundManager.errored=false;soundManager.flashLoadTimeout=4000;soundManager.onload=function(A){$(".sm_loadingmessage").parent("div").hide();soundManager.loaded=true};soundManager.onerror=function(A){var B=$(".sm_loadingmessage").text("Loading failed.").parent("div").show();B.parent(".recorder_player").find(".action.play").hide();if($("#large_iframe").length>0){alert("Sorry, but your browser does not seem to support audio playback. Please install or update flash. "+A)}}}var globals={};$(function(){$(".sm_loadingmessage").text("Initializing...").parent("div").show();$(".buttons .wa_submit").each(replaceWaSubmitButton);$(".buttons a.nice_button").each(replaceAHrefButton);if(typeof ViewManager!="undefined"){$("#cloud_button").click(ViewManager.prototype.ClickCloudButton);$("#map_button").click(ViewManager.prototype.ClickMapButton);$("#list_button").click(ViewManager.prototype.ClickListButton);$("#playall_button").click(ViewManager.prototype.ClickPlayallButton)}$("#wa_form_create_md_submit_images_upload").hide();$("#wa_form_create_md_Item_new_0_image_original").change(function(){$("#wa_form_create_md_submit_images_upload").show().focus()});$("#wa_form_account_platform_submit_upload1").hide();$("[id$='_image1']").change(function(){$("#wa_form_account_platform_submit_upload1").show().focus()});$("#wa_form_account_platform_submit_upload2").hide();$("[id$='_image2']").change(function(){$("#wa_form_account_platform_submit_upload2").show().focus()});$(".caption textarea").each(function(){if($(this).val()==""){$(this).val("Type caption here").css({"color":"silver","font-style":"italic"}).focus(function(){if($(this).val()=="Type caption here"){$(this).css({"color":"black","font-style":"normal"}).val("")}})}});$("form").submit(function(){$("input, textarea").each(function(){if($(this).val()=="Type caption here"){$(this).val("")}});return true});bindAllOverlays();$(".magic_item_link").live("click",magicItemLinkClick);$("textarea:not(.sub)").scroll(sizeMagic).each(sizeMagic);showHideRealised();$("#realised input").change(showHideRealised).click(showHideRealised).each(showHideRealised);showHideSponsor();$("#opensponsor_trigger input").change(showHideSponsor).click(showHideSponsor).each(showHideSponsor);$(".show_example").click(function(){$(".md_preview").show();return false});if($(".show_example").length>0){$(".md_preview").hide()}$("a").each(checkExternalLink);$("a.keyword").click(Controller.prototype.KeywordClick);$("a.minidoc").click(Controller.prototype.MinidocClick);$("a.playlist").click(Controller.prototype.PlaylistClick);$("a.platform").click(Controller.prototype.PlatformClick);$(".controller_white_opac_layer").css("opacity",0.9);$(".news_white_opac_layer").css("opacity",0.9);$(".small_iframe_blue_opac_layer").css("opacity",0.9);$(".controller_black_opac_overlay").css("opacity",0.35);var A=$(window).width();var B=$(window).height()/2;$(".news, .news_white_opac_layer, .news_black_opac_layer").css({right:(Math.random()*($(window).width()-(340+280)))+"px",bottom:(Math.random()*B)+"px"});$(".news a").click(hideNews);AddShadows();$("#make_your_minidoc a").click(hideYourMinidoc);$("#make_your_minidoc .button_holder").click(hideYourMinidoc);$("#make_your_minidoc").css({left:((Math.random()*($(window).width()-(340+80)))+(340+80))+"px",top:(Math.random()*B)+"px"});if($.browser.msie){$("body.iframe").css({"overflow":"hidden"})}if($.browser.safari){$(".controller .links").css({"margin-top":"6px"})}if(typeof MdTracker!="undefined"){globals.mdTracker=new MdTracker()}if(typeof ViewManager!="undefined"){globals.viewManager=new ViewManager();$(window).resize(ViewManager.prototype.HandleResize);ViewManager.prototype.HandleTitleSize()}if(typeof CloudManager!="undefined"){globals.cloudManager=new CloudManager()}if(typeof GoogleMap!="undefined"){globals.googleMap=new GoogleMap()}if(typeof ListManager!="undefined"){globals.listManager=new ListManager()}if(typeof FullscreenManager!="undefined"){globals.fullscreenManager=new FullscreenManager()}if(typeof Controller!="undefined"){globals.controller=new Controller()}if(typeof GUnload=="function"){$(window).unload(GUnload)}if(typeof isLandingPage!="undefined"&&isLandingPage){initLandingPage()}});function initLandingPage(){hideYourMinidoc();hideNews();Controller.prototype._ClickSearchButton=leavePage;Controller.prototype._SelectPlatform=leavePage;Controller.prototype._SelectPlaylist=leavePage;$(".controller").hide().after($("<div class='controller'></div>").append("<div class='title'>Watch more minidocs<br/>on urbaninform.net</div>").append("<div class='buttons'><span class='orange float_left'><a href='"+siteroot+"' class='nice_button' id='gowatch'>go &amp; watch</a></span></div>"));$("#gowatch").each(replaceAHrefButton)}function leavePage(){top.location=siteroot}function hideYourMinidoc(){$("#make_your_minidoc").hide();return $(this).attr("href")!="#"}function hideNews(){$(".news, .news_white_opac_layer, .news_black_opac_layer").hide();return $(this).attr("href")!="#"}function showHideRealised(){if($("#realised input:checked").val()=="true"){$("#hide_realisation_date").show()}else{$("#hide_realisation_date").hide()}return true}function showHideSponsor(){if($("#opensponsor_trigger input:checked").length==1){$("#opensponsor").show()}else{$("#opensponsor").hide()}return true}function replaceWaSubmitButton(){var C='<input type="hidden" name="'+$(this).attr("name")+'" value="'+$(this).val()+'">';var E=$(this).attr("id");var H=null;var F=$(this).hasClass("disabled");var I=$(this).val().toLowerCase();if($(this).hasClass("delete")){I="x"}var G=$('<div class="buttons"></div>').appendTo("body");var B=$('<span id="'+E+'">'+I+"</span>").appendTo(G);var A=B.width();var D=new RegExp("^wa_form","g");if(D.test(E)){A+=8}G.remove();$(this).replaceWith(H=_createButton(A,I,{href:"#"}).click(function(){if((E!="wa_form_create_md_submit_stop"||confirm("The mini documentary recorder will be stopped. Your unfinished Mini doc is saved and stored in your account (click on your account name to see all your contributions). You can finish it later if you like.\n\nIf you don`t want to save your unfinished Mini doc, go to your account and click on the delete button (x).\n\nDo you want to stop the mini documentary recorder?"))&&(E!="wa_form_account_playlist_submit_cancel"||confirm("Are you sure you want to cancel? Your playlist will not be saved."))){$(this).parents("form").append($(C)).submit()}return true}));if(E){H.attr("id",E)}if(F){H.addClass("disabled")}H.removeClass("pressed");H=null}function replaceAHrefButton(){var B=$(this).attr("id");var A=$(this).hasClass("disabled");$(this).replaceWith(elm=_createButton($(this).width()+4,$(this).text().toLowerCase(),{href:$(this).attr("href"),target:$(this).attr("target")}));if(B){elm.attr("id",B)}if(A){elm.addClass("disabled")}}function _createButton(F,G,B){var D=null;var A=17;var C=G;switch(C){case"-":case"+":case"x":case"<":case">":F=A=13;G=" ";break;case"^":F=16;G=" "}var E=$("<div class='button_holder'></div>").append(D=$("<div class='button_relcont'></div>").append($("<a class='the_button'></a>").attr(B).text(G).css({"width":F+"px","height":(A-2)+"px","line-height":$.browser.safari?"17px":"16px"}))).css({"width":(F+2)+"px"});GenShadow(D,F,A,1,1);GenShadow(D,F,A,2,1);switch(C){case"-":E.addClass("min");break;case"+":E.addClass("plus");break;case"x":E.addClass("close");break;case"<":E.addClass("in");break;case">":E.addClass("out");break;case"^":E.addClass("down");break}return E.mousedown(buttonPress).mouseup(buttonRelease).mouseout(buttonRelease)}function buttonPress(){$(this).addClass("pressed");return true}function buttonRelease(){$(this).removeClass("pressed");return true}function AddShadows(){$(".shadow:visible").each(function(){$(this).removeClass("shadow");var B=$(this).width();var A=$(this).height();GenShadow($(this),B,A,1,0.6);GenShadow($(this),B,A,2,0.3);GenShadow($(this),B,A,3,0.1)})}function GenShadow(E,C,A,D,B){E.prepend($("<img src='"+siteroot+"images/nix.gif'/>").addClass("the_shadow shadow_l"+D).css({top:(D)+"px",left:(-1*D)+"px",width:"1px",height:(A-1)+"px","line-height":"1px","margin":"0px","padding":"0px",opacity:B})).prepend($("<img src='"+siteroot+"images/nix.gif'/>").addClass("the_shadow shadow_b"+D).css({top:(A+(D-1))+"px",left:(-1*D)+"px",width:(C)+"px",height:"1px",opacity:B}))}function magicItemLinkClick(){if($("#record_upload:visible").length>0){if(!confirm("You have recorded something without uploading. Do you want to continue and lose this recording?")){return false}}$("form").attr("action",$(this).attr("href")).submit();return false}function sizeMagic(A){if(this.scrollHeight&&this.scrollHeight>parseInt($(this).css("height"))){$(this).css("height",Math.min(300,this.scrollHeight)+"px")}}function checkExternalLink(){var C=document.location.toString();var D=new RegExp("^https?://([a-z.]*)","i");var A=C.match(D);var B=$(this).attr("href");if(D.test(B)&&B.indexOf(A[1])==-1){$(this).attr("target","_blank")}}$.fn.ajaxSubmit=function(A){this.submit(function(){var C={};$(this).find("input[@checked], input[@type='text'], input[@type='hidden'], input[@type='password'], input[@type='submit'], option[@selected], textarea").filter(":enabled").each(function(){C[this.name||this.id||this.parentNode.name||this.parentNode.id]=this.value});var B=$(this).parent("div");$.post(B.attr("title"),C,function(E,D){B.empty().html(E);B.children("form").ajaxSubmit()});return false});return this};function bindAllOverlays(){$(".overlay").live("click",showOverlay)}function showOverlay(C){$(".overlayed").remove();var D=$(this).offset();var B=$(this).attr("overlay");var A=$(this).hasClass("blue")?"#99cdff":"#ffffff";$("body").append($("<div></div>").addClass("overlayed").html(B).css({top:D.top+15,left:D.left-25,"background-color":A}).append($("<div></div>").addClass("close").click(function(){$(".overlayed").remove()})));B=D=null;return false}function add2cart(A,B){if(A.length!=1){return alert("source not found")}if(B.length!=1){return alert("target not found")}var C=$('<div id="'+A.attr("id")+'_shadow" style="display: none; background-color: #ddd; border: solid 1px darkgray; position: static; top: 0px; z-index: 100000;">&nbsp;</div>');$("body").prepend(C);C.width(A.css("width")).height(A.css("height")).css("top",A.offset().top).css("left",A.offset().left).css("opacity",0.5).show();C.css("position","absolute");C.animate({width:21,height:19,top:20,left:320},600,function(){$(this).remove()})}rnd.seed=1209453264447;function rnd(){rnd.seed=(rnd.seed*9301+49294)%233280;return rnd.seed/(233280)}function notnegative(A){return(A<0)?0:A}function playLinkedFragment(){var C=$(this);var B=C.parent(".recorder_player");var A=soundManager.getSoundById(C.attr("id"));if(A==null){A=soundManager.createSound({id:C.attr("id"),url:C.attr("href"),autoLoad:true,autoPlay:false,stream:false,onfinish:function(){_showPlay(B)},onstop:function(){_showPlay(B)},onload:function(){this.play()}})}else{if(A.paused){A.togglePause()}else{soundManager.stopAll();A.play()}}_showPause(B);return false}function pauseLinkedFragment(){var C=$(this);var B=C.parent(".recorder_player");var A=soundManager.getSoundById(C.attr("href"));A.pause();if(A.paused){_showPlay(B)}return false}function _showPause(A){$(".loadingmessage",A).text("Playing...").parent("div").show();$(".action.pause",A).show();$(".action.play",A).hide();$(".smaller_action",A).hide()}function _showPlay(A){$(".loadingmessage",A).parent("div").hide();$(".action.pause",A).hide();$(".action.play",A).show();$(".smaller_action",A).show()}function playItem(A){}$(function(){$(".recorder_player .below_container").hide();$(".recorder_player .smaller_action").show();$(".action.play").click(playLinkedFragment);$(".action.pause").click(pauseLinkedFragment).hide()});var LUPJS_STATE_UNINITIALIZED=0;var LUPJS_STATE_READY=1;var LUPJS_STATE_RECORDING=2;var LUPJS_STATE_STOPPING=3;var LUPJS_STATE_SENDABLE=4;var LUPJS_STATE_UPLOADING=5;var LUPJS_STATE_PLAYING=6;var LUPJS_STATE_PAUSED=7;var LUPJS_STATE_DONE=8;var LUPJS_STATE_LOADING=9;var LUPJS_State=LUPJS_STATE_UNINITIALIZED;function LUPJS_AppletReady(){LUPJS_SetState(LUPJS_STATE_READY)}function LUPJS_SetState(B){$("#recorder_states").text($("#recorder_states").text()+" - "+B);LUPJS_State=B;var I=$("#message");var D=$("#play");var F=$("#record_nomic");var H=$("#record");var G=$("#record_upload");var A=$("#stop");if(global_rp_timer){clearTimeout(global_rp_timer)}$("#script_load_failed").hide();I.text("").parent("div").hide();if(B==LUPJS_STATE_READY){$(".iframe_pixel_fixer").hide();setTimeout(function(){$(".iframe_pixel_fixer").show()},200);$("#inactive_recorder").parent(".recorder").removeClass("inactive");$("#inactive_recorder").remove();D.hide();F.hide();H.show();G.hide();A.hide()}else{if(B==LUPJS_STATE_SENDABLE||B==LUPJS_STATE_PAUSED){D.show();F.show();H.hide();G.show();A.hide()}else{if(B==LUPJS_STATE_RECORDING){D.hide();F.hide();H.hide();G.hide();A.show()}else{if(B==LUPJS_STATE_PLAYING){D.hide();F.hide();H.hide();G.hide();A.show()}else{if(B==LUPJS_STATE_DONE){I.text("Ready, please wait...").parent("div").show();var J=$("#recorder_item_id").val();var E=$("#wa_form_create_md");E.attr("action",E.attr("action")+"#item"+J);var C=$('<input type="submit" value="Record_submit_audio" name="_action_record_submit_audio" id="wa_form_create_md_submit_record_submit_audio" class="wa_submit"/>');E.append(C);C.click().remove()}else{if(B==LUPJS_STATE_UPLOADING){D.hide();F.hide();H.hide();G.hide();A.hide();I.text("Uploading, please wait...").parent("div").show()}else{D.hide();F.hide();H.hide();G.hide();A.hide();I.text("Loading...").parent("div").show()}}}}}}}function LUPJS_UploadCompleted(){LUPJS_SetState(LUPJS_STATE_DONE)}function LUPJS_RecordMessage(){if(!document.JavaSonicRecorder.isActive()){alert("Please wait for the java applet to load.")}else{var A=document.JavaSonicRecorder.isStopped();if(!A){alert("The applet is already recording or playing a fragment.");return }else{if(LUPJS_State==LUPJS_STATE_PAUSED){document.JavaSonicRecorder.stopAudio();LUPJS_SetState(LUPJS_STATE_SENDABLE)}}if(LUPJS_State!=LUPJS_STATE_SENDABLE||confirm("Start a new recording? The current recording will be lost!")){LUPJS_SetState(LUPJS_STATE_LOADING);document.JavaSonicRecorder.record()}}}function LUPJS_Stop(){if(!document.JavaSonicRecorder.isActive()){alert("Please wait for the java applet to load.")}else{if(LUPJS_State==LUPJS_STATE_RECORDING){LUPJS_SetState(LUPJS_STATE_STOPPING);setTimeout(function(){document.JavaSonicRecorder.stopAudio()},100)}else{if(LUPJS_State==LUPJS_STATE_PLAYING){LUPJS_SetState(LUPJS_STATE_STOPPING);setTimeout(function(){document.JavaSonicRecorder.pauseAudio()},100)}}}}function LUPJS_PlayMessage(){if(!document.JavaSonicRecorder.isActive()){alert("Please wait for the java applet to load.")}else{LUPJS_SetState(LUPJS_STATE_LOADING);document.JavaSonicRecorder.play()}}function LUPJS_UploadMessage(){if(!document.JavaSonicRecorder.isActive()){alert("Please wait for the java applet to load.")}else{var C=document.JavaSonicRecorder.isStopped();var B=document.JavaSonicRecorder.isPlayable();var A=C&&B;if(!A){alert("You must record a voice message before sending!");return }document.JavaSonicRecorder.setUploadCompletionScript("LUPJS_UploadCompleted();");LUPJS_SetState(LUPJS_STATE_UPLOADING);document.JavaSonicRecorder.addNameValuePair("item_id",$("#recorder_item_id").val());document.JavaSonicRecorder.addNameValuePair("code",$("#recorder_code").val());document.JavaSonicRecorder.addNameValuePair("audio_id",$("#recorder_audio_id").val());document.JavaSonicRecorder.sendRecordedMessage()}}function LUPJS_RanOutOfTime(A){alert("Sorry, the recording has stopped. This happens automatically after 20 seconds to keep all items short.")}function LUPJS_StateChanged(A,B){$("#recorder_states").text(A+" => "+B);if((A=="recording")&&(B=="stopped")){if(LUPJS_State!=LUPJS_STATE_STOPPING){LUPJS_RanOutOfTime()}LUPJS_SetState(LUPJS_STATE_SENDABLE)}else{if((A=="playing")&&(B=="stopped")){LUPJS_SetState(LUPJS_STATE_SENDABLE)}else{if((A=="playing")&&(B=="paused")){LUPJS_SetState(LUPJS_STATE_PAUSED)}else{if(B=="recording"){LUPJS_SetState(LUPJS_STATE_RECORDING)}else{if(B=="playing"){LUPJS_SetState(LUPJS_STATE_PLAYING)}}}}}}function _prepTime(B){var A=(Math.round(B*10)/10);if(A%1==0){return A+".0"}return A+""}function LUPJS_TimeChanged(C,A){if(LUPJS_State==LUPJS_STATE_PLAYING||LUPJS_State==LUPJS_STATE_RECORDING){var D=LUPJS_State==LUPJS_STATE_RECORDING?"Recording: ":"Playing: ";var B=$("#message");B.text(D+_prepTime(C)+"s / "+_prepTime(A)+"s").parent("div").show()}}var global_rp_timer=null;function handleButton(B){try{var A=$(B.currentTarget).attr("id");switch(A){case"play":LUPJS_PlayMessage();break;case"record":case"record_again":LUPJS_RecordMessage();break;case"stop":LUPJS_Stop();break;case"upload":LUPJS_UploadMessage();break}}catch(B){showRecorderError(B.message)}return false}function showRecorderError(A){if(A){alert(A)}$("#inactive_recorder").parent(".recorder").removeClass("inactive");$("#inactive_recorder").remove();$("#play").hide();$("#record_nomic").hide();$("#record").hide();$("#record_upload").hide();$("#stop").hide();$("#message").parent("div").hide();$("#script_load_failed").show()}$(function(){if($("#record_applet").length>0){global_rp_timer=setTimeout(function(){if(document.JavaSonicRecorder){showRecorderError("Applet loaded after 20 seconds, but did not signal document. Did you accept the security warning? Did you press next? Please try to refresh the page or wait somewhat longer.")}else{showRecorderError("Applet still not loaded after 20 seconds. Maybe your internet connection is very slow, please wait somewhat longer or refresh the page.")}},20000);$("#play").click(handleButton).hide();$("#record_nomic").hide();$("#stop").click(handleButton).hide();$("#record").click(handleButton).hide();$("#record_again").click(handleButton);$("#upload").click(handleButton);$("#record_upload").hide();$("#script_load_failed").hide()}})