/*
 * jQuery 1.2.6 - New Wave Javascript
 *
 * Copyright (c) 2008 John Resig (jquery.com)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * $Date: 2008-05-24 14:22:17 -0400 (Sat, 24 May 2008) $
 * $Rev: 5685 $
 */
(function(){var _jQuery=window.jQuery,_$=window.$;var jQuery=window.jQuery=window.$=function(selector,context){return new jQuery.fn.init(selector,context);};var quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/,isSimple=/^.[^:#\[\.]*$/,undefined;jQuery.fn=jQuery.prototype={init:function(selector,context){selector=selector||document;if(selector.nodeType){this[0]=selector;this.length=1;return this;}if(typeof selector=="string"){var match=quickExpr.exec(selector);if(match&&(match[1]||!context)){if(match[1])selector=jQuery.clean([match[1]],context);else{var elem=document.getElementById(match[3]);if(elem){if(elem.id!=match[3])return jQuery().find(selector);return jQuery(elem);}selector=[];}}else
return jQuery(context).find(selector);}else if(jQuery.isFunction(selector))return jQuery(document)[jQuery.fn.ready?"ready":"load"](selector);return this.setArray(jQuery.makeArray(selector));},jquery:"1.2.6",size:function(){return this.length;},length:0,get:function(num){return num==undefined?jQuery.makeArray(this):this[num];},pushStack:function(elems){var ret=jQuery(elems);ret.prevObject=this;return ret;},setArray:function(elems){this.length=0;Array.prototype.push.apply(this,elems);return this;},each:function(callback,args){return jQuery.each(this,callback,args);},index:function(elem){var ret=-1;return jQuery.inArray(elem&&elem.jquery?elem[0]:elem,this);},attr:function(name,value,type){var options=name;if(name.constructor==String)if(value===undefined)return this[0]&&jQuery[type||"attr"](this[0],name);else{options={};options[name]=value;}return this.each(function(i){for(name in options)jQuery.attr(type?this.style:this,name,jQuery.prop(this,options[name],type,i,name));});},css:function(key,value){if((key=='width'||key=='height')&&parseFloat(value)<0)value=undefined;return this.attr(key,value,"curCSS");},text:function(text){if(typeof text!="object"&&text!=null)return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(text));var ret="";jQuery.each(text||this,function(){jQuery.each(this.childNodes,function(){if(this.nodeType!=8)ret+=this.nodeType!=1?this.nodeValue:jQuery.fn.text([this]);});});return ret;},wrapAll:function(html){if(this[0])jQuery(html,this[0].ownerDocument).clone().insertBefore(this[0]).map(function(){var elem=this;while(elem.firstChild)elem=elem.firstChild;return elem;}).append(this);return this;},wrapInner:function(html){return this.each(function(){jQuery(this).contents().wrapAll(html);});},wrap:function(html){return this.each(function(){jQuery(this).wrapAll(html);});},append:function(){return this.domManip(arguments,true,false,function(elem){if(this.nodeType==1)this.appendChild(elem);});},prepend:function(){return this.domManip(arguments,true,true,function(elem){if(this.nodeType==1)this.insertBefore(elem,this.firstChild);});},before:function(){return this.domManip(arguments,false,false,function(elem){this.parentNode.insertBefore(elem,this);});},after:function(){return this.domManip(arguments,false,true,function(elem){this.parentNode.insertBefore(elem,this.nextSibling);});},end:function(){return this.prevObject||jQuery([]);},find:function(selector){var elems=jQuery.map(this,function(elem){return jQuery.find(selector,elem);});return this.pushStack(/[^+>] [^+>]/.test(selector)||selector.indexOf("..")>-1?jQuery.unique(elems):elems);},clone:function(events){var ret=this.map(function(){if(jQuery.browser.msie&&!jQuery.isXMLDoc(this)){var clone=this.cloneNode(true),container=document.createElement("div");container.appendChild(clone);return jQuery.clean([container.innerHTML])[0];}else
return this.cloneNode(true);});var clone=ret.find("*").andSelf().each(function(){if(this[expando]!=undefined)this[expando]=null;});if(events===true)this.find("*").andSelf().each(function(i){if(this.nodeType==3)return;var events=jQuery.data(this,"events");for(var type in events)for(var handler in events[type])jQuery.event.add(clone[i],type,events[type][handler],events[type][handler].data);});return ret;},filter:function(selector){return this.pushStack(jQuery.isFunction(selector)&&jQuery.grep(this,function(elem,i){return selector.call(elem,i);})||jQuery.multiFilter(selector,this));},not:function(selector){if(selector.constructor==String)if(isSimple.test(selector))return this.pushStack(jQuery.multiFilter(selector,this,true));else
selector=jQuery.multiFilter(selector,this);var isArrayLike=selector.length&&selector[selector.length-1]!==undefined&&!selector.nodeType;return this.filter(function(){return isArrayLike?jQuery.inArray(this,selector)<0:this!=selector;});},add:function(selector){return this.pushStack(jQuery.unique(jQuery.merge(this.get(),typeof selector=='string'?jQuery(selector):jQuery.makeArray(selector))));},is:function(selector){return!!selector&&jQuery.multiFilter(selector,this).length>0;},hasClass:function(selector){return this.is("."+selector);},val:function(value){if(value==undefined){if(this.length){var elem=this[0];if(jQuery.nodeName(elem,"select")){var index=elem.selectedIndex,values=[],options=elem.options,one=elem.type=="select-one";if(index<0)return null;for(var i=one?index:0,max=one?index+1:options.length;i<max;i++){var option=options[i];if(option.selected){value=jQuery.browser.msie&&!option.attributes.value.specified?option.text:option.value;if(one)return value;values.push(value);}}return values;}else
return(this[0].value||"").replace(/\r/g,"");}return undefined;}if(value.constructor==Number)value+='';return this.each(function(){if(this.nodeType!=1)return;if(value.constructor==Array&&/radio|checkbox/.test(this.type))this.checked=(jQuery.inArray(this.value,value)>=0||jQuery.inArray(this.name,value)>=0);else if(jQuery.nodeName(this,"select")){var values=jQuery.makeArray(value);jQuery("option",this).each(function(){this.selected=(jQuery.inArray(this.value,values)>=0||jQuery.inArray(this.text,values)>=0);});if(!values.length)this.selectedIndex=-1;}else
this.value=value;});},html:function(value){return value==undefined?(this[0]?this[0].innerHTML:null):this.empty().append(value);},replaceWith:function(value){return this.after(value).remove();},eq:function(i){return this.slice(i,i+1);},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments));},map:function(callback){return this.pushStack(jQuery.map(this,function(elem,i){return callback.call(elem,i,elem);}));},andSelf:function(){return this.add(this.prevObject);},data:function(key,value){var parts=key.split(".");parts[1]=parts[1]?"."+parts[1]:"";if(value===undefined){var data=this.triggerHandler("getData"+parts[1]+"!",[parts[0]]);if(data===undefined&&this.length)data=jQuery.data(this[0],key);return data===undefined&&parts[1]?this.data(parts[0]):data;}else
return this.trigger("setData"+parts[1]+"!",[parts[0],value]).each(function(){jQuery.data(this,key,value);});},removeData:function(key){return this.each(function(){jQuery.removeData(this,key);});},domManip:function(args,table,reverse,callback){var clone=this.length>1,elems;return this.each(function(){if(!elems){elems=jQuery.clean(args,this.ownerDocument);if(reverse)elems.reverse();}var obj=this;if(table&&jQuery.nodeName(this,"table")&&jQuery.nodeName(elems[0],"tr"))obj=this.getElementsByTagName("tbody")[0]||this.appendChild(this.ownerDocument.createElement("tbody"));var scripts=jQuery([]);jQuery.each(elems,function(){var elem=clone?jQuery(this).clone(true)[0]:this;if(jQuery.nodeName(elem,"script"))scripts=scripts.add(elem);else{if(elem.nodeType==1)scripts=scripts.add(jQuery("script",elem).remove());callback.call(obj,elem);}});scripts.each(evalScript);});}};jQuery.fn.init.prototype=jQuery.fn;function evalScript(i,elem){if(elem.src)jQuery.ajax({url:elem.src,async:false,dataType:"script"});else
jQuery.globalEval(elem.text||elem.textContent||elem.innerHTML||"");if(elem.parentNode)elem.parentNode.removeChild(elem);}function now(){return+new Date;}jQuery.extend=jQuery.fn.extend=function(){var target=arguments[0]||{},i=1,length=arguments.length,deep=false,options;if(target.constructor==Boolean){deep=target;target=arguments[1]||{};i=2;}if(typeof target!="object"&&typeof target!="function")target={};if(length==i){target=this;--i;}for(;i<length;i++)if((options=arguments[i])!=null)for(var name in options){var src=target[name],copy=options[name];if(target===copy)continue;if(deep&&copy&&typeof copy=="object"&&!copy.nodeType)target[name]=jQuery.extend(deep,src||(copy.length!=null?[]:{}),copy);else if(copy!==undefined)target[name]=copy;}return target;};var expando="jQuery"+now(),uuid=0,windowData={},exclude=/z-?index|font-?weight|opacity|zoom|line-?height/i,defaultView=document.defaultView||{};jQuery.extend({noConflict:function(deep){window.$=_$;if(deep)window.jQuery=_jQuery;return jQuery;},isFunction:function(fn){return!!fn&&typeof fn!="string"&&!fn.nodeName&&fn.constructor!=Array&&/^[\s[]?function/.test(fn+"");},isXMLDoc:function(elem){return elem.documentElement&&!elem.body||elem.tagName&&elem.ownerDocument&&!elem.ownerDocument.body;},globalEval:function(data){data=jQuery.trim(data);if(data){var head=document.getElementsByTagName("head")[0]||document.documentElement,script=document.createElement("script");script.type="text/javascript";if(jQuery.browser.msie)script.text=data;else
script.appendChild(document.createTextNode(data));head.insertBefore(script,head.firstChild);head.removeChild(script);}},nodeName:function(elem,name){return elem.nodeName&&elem.nodeName.toUpperCase()==name.toUpperCase();},cache:{},data:function(elem,name,data){elem=elem==window?windowData:elem;var id=elem[expando];if(!id)id=elem[expando]=++uuid;if(name&&!jQuery.cache[id])jQuery.cache[id]={};if(data!==undefined)jQuery.cache[id][name]=data;return name?jQuery.cache[id][name]:id;},removeData:function(elem,name){elem=elem==window?windowData:elem;var id=elem[expando];if(name){if(jQuery.cache[id]){delete jQuery.cache[id][name];name="";for(name in jQuery.cache[id])break;if(!name)jQuery.removeData(elem);}}else{try{delete elem[expando];}catch(e){if(elem.removeAttribute)elem.removeAttribute(expando);}delete jQuery.cache[id];}},each:function(object,callback,args){var name,i=0,length=object.length;if(args){if(length==undefined){for(name in object)if(callback.apply(object[name],args)===false)break;}else
for(;i<length;)if(callback.apply(object[i++],args)===false)break;}else{if(length==undefined){for(name in object)if(callback.call(object[name],name,object[name])===false)break;}else
for(var value=object[0];i<length&&callback.call(value,i,value)!==false;value=object[++i]){}}return object;},prop:function(elem,value,type,i,name){if(jQuery.isFunction(value))value=value.call(elem,i);return value&&value.constructor==Number&&type=="curCSS"&&!exclude.test(name)?value+"px":value;},className:{add:function(elem,classNames){jQuery.each((classNames||"").split(/\s+/),function(i,className){if(elem.nodeType==1&&!jQuery.className.has(elem.className,className))elem.className+=(elem.className?" ":"")+className;});},remove:function(elem,classNames){if(elem.nodeType==1)elem.className=classNames!=undefined?jQuery.grep(elem.className.split(/\s+/),function(className){return!jQuery.className.has(classNames,className);}).join(" "):"";},has:function(elem,className){return jQuery.inArray(className,(elem.className||elem).toString().split(/\s+/))>-1;}},swap:function(elem,options,callback){var old={};for(var name in options){old[name]=elem.style[name];elem.style[name]=options[name];}callback.call(elem);for(var name in options)elem.style[name]=old[name];},css:function(elem,name,force){if(name=="width"||name=="height"){var val,props={position:"absolute",visibility:"hidden",display:"block"},which=name=="width"?["Left","Right"]:["Top","Bottom"];function getWH(){val=name=="width"?elem.offsetWidth:elem.offsetHeight;var padding=0,border=0;jQuery.each(which,function(){padding+=parseFloat(jQuery.curCSS(elem,"padding"+this,true))||0;border+=parseFloat(jQuery.curCSS(elem,"border"+this+"Width",true))||0;});val-=Math.round(padding+border);}if(jQuery(elem).is(":visible"))getWH();else
jQuery.swap(elem,props,getWH);return Math.max(0,val);}return jQuery.curCSS(elem,name,force);},curCSS:function(elem,name,force){var ret,style=elem.style;function color(elem){if(!jQuery.browser.safari)return false;var ret=defaultView.getComputedStyle(elem,null);return!ret||ret.getPropertyValue("color")=="";}if(name=="opacity"&&jQuery.browser.msie){ret=jQuery.attr(style,"opacity");return ret==""?"1":ret;}if(jQuery.browser.opera&&name=="display"){var save=style.outline;style.outline="0 solid black";style.outline=save;}if(name.match(/float/i))name=styleFloat;if(!force&&style&&style[name])ret=style[name];else if(defaultView.getComputedStyle){if(name.match(/float/i))name="float";name=name.replace(/([A-Z])/g,"-$1").toLowerCase();var computedStyle=defaultView.getComputedStyle(elem,null);if(computedStyle&&!color(elem))ret=computedStyle.getPropertyValue(name);else{var swap=[],stack=[],a=elem,i=0;for(;a&&color(a);a=a.parentNode)stack.unshift(a);for(;i<stack.length;i++)if(color(stack[i])){swap[i]=stack[i].style.display;stack[i].style.display="block";}ret=name=="display"&&swap[stack.length-1]!=null?"none":(computedStyle&&computedStyle.getPropertyValue(name))||"";for(i=0;i<swap.length;i++)if(swap[i]!=null)stack[i].style.display=swap[i];}if(name=="opacity"&&ret=="")ret="1";}else if(elem.currentStyle){var camelCase=name.replace(/\-(\w)/g,function(all,letter){return letter.toUpperCase();});ret=elem.currentStyle[name]||elem.currentStyle[camelCase];if(!/^\d+(px)?$/i.test(ret)&&/^\d/.test(ret)){var left=style.left,rsLeft=elem.runtimeStyle.left;elem.runtimeStyle.left=elem.currentStyle.left;style.left=ret||0;ret=style.pixelLeft+"px";style.left=left;elem.runtimeStyle.left=rsLeft;}}return ret;},clean:function(elems,context){var ret=[];context=context||document;if(typeof context.createElement=='undefined')context=context.ownerDocument||context[0]&&context[0].ownerDocument||document;jQuery.each(elems,function(i,elem){if(!elem)return;if(elem.constructor==Number)elem+='';if(typeof elem=="string"){elem=elem.replace(/(<(\w+)[^>]*?)\/>/g,function(all,front,tag){return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?all:front+"></"+tag+">";});var tags=jQuery.trim(elem).toLowerCase(),div=context.createElement("div");var wrap=!tags.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!tags.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||tags.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!tags.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!tags.indexOf("<td")||!tags.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!tags.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||jQuery.browser.msie&&[1,"div<div>","</div>"]||[0,"",""];div.innerHTML=wrap[1]+elem+wrap[2];while(wrap[0]--)div=div.lastChild;if(jQuery.browser.msie){var tbody=!tags.indexOf("<table")&&tags.indexOf("<tbody")<0?div.firstChild&&div.firstChild.childNodes:wrap[1]=="<table>"&&tags.indexOf("<tbody")<0?div.childNodes:[];for(var j=tbody.length-1;j>=0;--j)if(jQuery.nodeName(tbody[j],"tbody")&&!tbody[j].childNodes.length)tbody[j].parentNode.removeChild(tbody[j]);if(/^\s/.test(elem))div.insertBefore(context.createTextNode(elem.match(/^\s*/)[0]),div.firstChild);}elem=jQuery.makeArray(div.childNodes);}if(elem.length===0&&(!jQuery.nodeName(elem,"form")&&!jQuery.nodeName(elem,"select")))return;if(elem[0]==undefined||jQuery.nodeName(elem,"form")||elem.options)ret.push(elem);else
ret=jQuery.merge(ret,elem);});return ret;},attr:function(elem,name,value){if(!elem||elem.nodeType==3||elem.nodeType==8)return undefined;var notxml=!jQuery.isXMLDoc(elem),set=value!==undefined,msie=jQuery.browser.msie;name=notxml&&jQuery.props[name]||name;if(elem.tagName){var special=/href|src|style/.test(name);if(name=="selected"&&jQuery.browser.safari)elem.parentNode.selectedIndex;if(name in elem&&notxml&&!special){if(set){if(name=="type"&&jQuery.nodeName(elem,"input")&&elem.parentNode)throw"type property can't be changed";elem[name]=value;}if(jQuery.nodeName(elem,"form")&&elem.getAttributeNode(name))return elem.getAttributeNode(name).nodeValue;return elem[name];}if(msie&&notxml&&name=="style")return jQuery.attr(elem.style,"cssText",value);if(set)elem.setAttribute(name,""+value);var attr=msie&&notxml&&special?elem.getAttribute(name,2):elem.getAttribute(name);return attr===null?undefined:attr;}if(msie&&name=="opacity"){if(set){elem.zoom=1;elem.filter=(elem.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(value)+''=="NaN"?"":"alpha(opacity="+value*100+")");}return elem.filter&&elem.filter.indexOf("opacity=")>=0?(parseFloat(elem.filter.match(/opacity=([^)]*)/)[1])/100)+'':"";}name=name.replace(/-([a-z])/ig,function(all,letter){return letter.toUpperCase();});if(set)elem[name]=value;return elem[name];},trim:function(text){return(text||"").replace(/^\s+|\s+$/g,"");},makeArray:function(array){var ret=[];if(array!=null){var i=array.length;if(i==null||array.split||array.setInterval||array.call)ret[0]=array;else
while(i)ret[--i]=array[i];}return ret;},inArray:function(elem,array){for(var i=0,length=array.length;i<length;i++)if(array[i]===elem)return i;return-1;},merge:function(first,second){var i=0,elem,pos=first.length;if(jQuery.browser.msie){while(elem=second[i++])if(elem.nodeType!=8)first[pos++]=elem;}else
while(elem=second[i++])first[pos++]=elem;return first;},unique:function(array){var ret=[],done={};try{for(var i=0,length=array.length;i<length;i++){var id=jQuery.data(array[i]);if(!done[id]){done[id]=true;ret.push(array[i]);}}}catch(e){ret=array;}return ret;},grep:function(elems,callback,inv){var ret=[];for(var i=0,length=elems.length;i<length;i++)if(!inv!=!callback(elems[i],i))ret.push(elems[i]);return ret;},map:function(elems,callback){var ret=[];for(var i=0,length=elems.length;i<length;i++){var value=callback(elems[i],i);if(value!=null)ret[ret.length]=value;}return ret.concat.apply([],ret);}});var userAgent=navigator.userAgent.toLowerCase();jQuery.browser={version:(userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[])[1],safari:/webkit/.test(userAgent),opera:/opera/.test(userAgent),msie:/msie/.test(userAgent)&&!/opera/.test(userAgent),mozilla:/mozilla/.test(userAgent)&&!/(compatible|webkit)/.test(userAgent)};var styleFloat=jQuery.browser.msie?"styleFloat":"cssFloat";jQuery.extend({boxModel:!jQuery.browser.msie||document.compatMode=="CSS1Compat",props:{"for":"htmlFor","class":"className","float":styleFloat,cssFloat:styleFloat,styleFloat:styleFloat,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing"}});jQuery.each({parent:function(elem){return elem.parentNode;},parents:function(elem){return jQuery.dir(elem,"parentNode");},next:function(elem){return jQuery.nth(elem,2,"nextSibling");},prev:function(elem){return jQuery.nth(elem,2,"previousSibling");},nextAll:function(elem){return jQuery.dir(elem,"nextSibling");},prevAll:function(elem){return jQuery.dir(elem,"previousSibling");},siblings:function(elem){return jQuery.sibling(elem.parentNode.firstChild,elem);},children:function(elem){return jQuery.sibling(elem.firstChild);},contents:function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.makeArray(elem.childNodes);}},function(name,fn){jQuery.fn[name]=function(selector){var ret=jQuery.map(this,fn);if(selector&&typeof selector=="string")ret=jQuery.multiFilter(selector,ret);return this.pushStack(jQuery.unique(ret));};});jQuery.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(name,original){jQuery.fn[name]=function(){var args=arguments;return this.each(function(){for(var i=0,length=args.length;i<length;i++)jQuery(args[i])[original](this);});};});jQuery.each({removeAttr:function(name){jQuery.attr(this,name,"");if(this.nodeType==1)this.removeAttribute(name);},addClass:function(classNames){jQuery.className.add(this,classNames);},removeClass:function(classNames){jQuery.className.remove(this,classNames);},toggleClass:function(classNames){jQuery.className[jQuery.className.has(this,classNames)?"remove":"add"](this,classNames);},remove:function(selector){if(!selector||jQuery.filter(selector,[this]).r.length){jQuery("*",this).add(this).each(function(){jQuery.event.remove(this);jQuery.removeData(this);});if(this.parentNode)this.parentNode.removeChild(this);}},empty:function(){jQuery(">*",this).remove();while(this.firstChild)this.removeChild(this.firstChild);}},function(name,fn){jQuery.fn[name]=function(){return this.each(fn,arguments);};});jQuery.each(["Height","Width"],function(i,name){var type=name.toLowerCase();jQuery.fn[type]=function(size){return this[0]==window?jQuery.browser.opera&&document.body["client"+name]||jQuery.browser.safari&&window["inner"+name]||document.compatMode=="CSS1Compat"&&document.documentElement["client"+name]||document.body["client"+name]:this[0]==document?Math.max(Math.max(document.body["scroll"+name],document.documentElement["scroll"+name]),Math.max(document.body["offset"+name],document.documentElement["offset"+name])):size==undefined?(this.length?jQuery.css(this[0],type):null):this.css(type,size.constructor==String?size:size+"px");};});function num(elem,prop){return elem[0]&&parseInt(jQuery.curCSS(elem[0],prop,true),10)||0;}var chars=jQuery.browser.safari&&parseInt(jQuery.browser.version)<417?"(?:[\\w*_-]|\\\\.)":"(?:[\\w\u0128-\uFFFF*_-]|\\\\.)",quickChild=new RegExp("^>\\s*("+chars+"+)"),quickID=new RegExp("^("+chars+"+)(#)("+chars+"+)"),quickClass=new RegExp("^([#.]?)("+chars+"*)");jQuery.extend({expr:{"":function(a,i,m){return m[2]=="*"||jQuery.nodeName(a,m[2]);},"#":function(a,i,m){return a.getAttribute("id")==m[2];},":":{lt:function(a,i,m){return i<m[3]-0;},gt:function(a,i,m){return i>m[3]-0;},nth:function(a,i,m){return m[3]-0==i;},eq:function(a,i,m){return m[3]-0==i;},first:function(a,i){return i==0;},last:function(a,i,m,r){return i==r.length-1;},even:function(a,i){return i%2==0;},odd:function(a,i){return i%2;},"first-child":function(a){return a.parentNode.getElementsByTagName("*")[0]==a;},"last-child":function(a){return jQuery.nth(a.parentNode.lastChild,1,"previousSibling")==a;},"only-child":function(a){return!jQuery.nth(a.parentNode.lastChild,2,"previousSibling");},parent:function(a){return a.firstChild;},empty:function(a){return!a.firstChild;},contains:function(a,i,m){return(a.textContent||a.innerText||jQuery(a).text()||"").indexOf(m[3])>=0;},visible:function(a){return"hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden";},hidden:function(a){return"hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden";},enabled:function(a){return!a.disabled;},disabled:function(a){return a.disabled;},checked:function(a){return a.checked;},selected:function(a){return a.selected||jQuery.attr(a,"selected");},text:function(a){return"text"==a.type;},radio:function(a){return"radio"==a.type;},checkbox:function(a){return"checkbox"==a.type;},file:function(a){return"file"==a.type;},password:function(a){return"password"==a.type;},submit:function(a){return"submit"==a.type;},image:function(a){return"image"==a.type;},reset:function(a){return"reset"==a.type;},button:function(a){return"button"==a.type||jQuery.nodeName(a,"button");},input:function(a){return/input|select|textarea|button/i.test(a.nodeName);},has:function(a,i,m){return jQuery.find(m[3],a).length;},header:function(a){return/h\d/i.test(a.nodeName);},animated:function(a){return jQuery.grep(jQuery.timers,function(fn){return a==fn.elem;}).length;}}},parse:[/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,new RegExp("^([:.#]*)("+chars+"+)")],multiFilter:function(expr,elems,not){var old,cur=[];while(expr&&expr!=old){old=expr;var f=jQuery.filter(expr,elems,not);expr=f.t.replace(/^\s*,\s*/,"");cur=not?elems=f.r:jQuery.merge(cur,f.r);}return cur;},find:function(t,context){if(typeof t!="string")return[t];if(context&&context.nodeType!=1&&context.nodeType!=9)return[];context=context||document;var ret=[context],done=[],last,nodeName;while(t&&last!=t){var r=[];last=t;t=jQuery.trim(t);var foundToken=false,re=quickChild,m=re.exec(t);if(m){nodeName=m[1].toUpperCase();for(var i=0;ret[i];i++)for(var c=ret[i].firstChild;c;c=c.nextSibling)if(c.nodeType==1&&(nodeName=="*"||c.nodeName.toUpperCase()==nodeName))r.push(c);ret=r;t=t.replace(re,"");if(t.indexOf(" ")==0)continue;foundToken=true;}else{re=/^([>+~])\s*(\w*)/i;if((m=re.exec(t))!=null){r=[];var merge={};nodeName=m[2].toUpperCase();m=m[1];for(var j=0,rl=ret.length;j<rl;j++){var n=m=="~"||m=="+"?ret[j].nextSibling:ret[j].firstChild;for(;n;n=n.nextSibling)if(n.nodeType==1){var id=jQuery.data(n);if(m=="~"&&merge[id])break;if(!nodeName||n.nodeName.toUpperCase()==nodeName){if(m=="~")merge[id]=true;r.push(n);}if(m=="+")break;}}ret=r;t=jQuery.trim(t.replace(re,""));foundToken=true;}}if(t&&!foundToken){if(!t.indexOf(",")){if(context==ret[0])ret.shift();done=jQuery.merge(done,ret);r=ret=[context];t=" "+t.substr(1,t.length);}else{var re2=quickID;var m=re2.exec(t);if(m){m=[0,m[2],m[3],m[1]];}else{re2=quickClass;m=re2.exec(t);}m[2]=m[2].replace(/\\/g,"");var elem=ret[ret.length-1];if(m[1]=="#"&&elem&&elem.getElementById&&!jQuery.isXMLDoc(elem)){var oid=elem.getElementById(m[2]);if((jQuery.browser.msie||jQuery.browser.opera)&&oid&&typeof oid.id=="string"&&oid.id!=m[2])oid=jQuery('[@id="'+m[2]+'"]',elem)[0];ret=r=oid&&(!m[3]||jQuery.nodeName(oid,m[3]))?[oid]:[];}else{for(var i=0;ret[i];i++){var tag=m[1]=="#"&&m[3]?m[3]:m[1]!=""||m[0]==""?"*":m[2];if(tag=="*"&&ret[i].nodeName.toLowerCase()=="object")tag="param";r=jQuery.merge(r,ret[i].getElementsByTagName(tag));}if(m[1]==".")r=jQuery.classFilter(r,m[2]);if(m[1]=="#"){var tmp=[];for(var i=0;r[i];i++)if(r[i].getAttribute("id")==m[2]){tmp=[r[i]];break;}r=tmp;}ret=r;}t=t.replace(re2,"");}}if(t){var val=jQuery.filter(t,r);ret=r=val.r;t=jQuery.trim(val.t);}}if(t)ret=[];if(ret&&context==ret[0])ret.shift();done=jQuery.merge(done,ret);return done;},classFilter:function(r,m,not){m=" "+m+" ";var tmp=[];for(var i=0;r[i];i++){var pass=(" "+r[i].className+" ").indexOf(m)>=0;if(!not&&pass||not&&!pass)tmp.push(r[i]);}return tmp;},filter:function(t,r,not){var last;while(t&&t!=last){last=t;var p=jQuery.parse,m;for(var i=0;p[i];i++){m=p[i].exec(t);if(m){t=t.substring(m[0].length);m[2]=m[2].replace(/\\/g,"");break;}}if(!m)break;if(m[1]==":"&&m[2]=="not")r=isSimple.test(m[3])?jQuery.filter(m[3],r,true).r:jQuery(r).not(m[3]);else if(m[1]==".")r=jQuery.classFilter(r,m[2],not);else if(m[1]=="["){var tmp=[],type=m[3];for(var i=0,rl=r.length;i<rl;i++){var a=r[i],z=a[jQuery.props[m[2]]||m[2]];if(z==null||/href|src|selected/.test(m[2]))z=jQuery.attr(a,m[2])||'';if((type==""&&!!z||type=="="&&z==m[5]||type=="!="&&z!=m[5]||type=="^="&&z&&!z.indexOf(m[5])||type=="$="&&z.substr(z.length-m[5].length)==m[5]||(type=="*="||type=="~=")&&z.indexOf(m[5])>=0)^not)tmp.push(a);}r=tmp;}else if(m[1]==":"&&m[2]=="nth-child"){var merge={},tmp=[],test=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(m[3]=="even"&&"2n"||m[3]=="odd"&&"2n+1"||!/\D/.test(m[3])&&"0n+"+m[3]||m[3]),first=(test[1]+(test[2]||1))-0,last=test[3]-0;for(var i=0,rl=r.length;i<rl;i++){var node=r[i],parentNode=node.parentNode,id=jQuery.data(parentNode);if(!merge[id]){var c=1;for(var n=parentNode.firstChild;n;n=n.nextSibling)if(n.nodeType==1)n.nodeIndex=c++;merge[id]=true;}var add=false;if(first==0){if(node.nodeIndex==last)add=true;}else if((node.nodeIndex-last)%first==0&&(node.nodeIndex-last)/first>=0)add=true;if(add^not)tmp.push(node);}r=tmp;}else{var fn=jQuery.expr[m[1]];if(typeof fn=="object")fn=fn[m[2]];if(typeof fn=="string")fn=eval("false||function(a,i){return "+fn+";}");r=jQuery.grep(r,function(elem,i){return fn(elem,i,m,r);},not);}}return{r:r,t:t};},dir:function(elem,dir){var matched=[],cur=elem[dir];while(cur&&cur!=document){if(cur.nodeType==1)matched.push(cur);cur=cur[dir];}return matched;},nth:function(cur,result,dir,elem){result=result||1;var num=0;for(;cur;cur=cur[dir])if(cur.nodeType==1&&++num==result)break;return cur;},sibling:function(n,elem){var r=[];for(;n;n=n.nextSibling){if(n.nodeType==1&&n!=elem)r.push(n);}return r;}});jQuery.event={add:function(elem,types,handler,data){if(elem.nodeType==3||elem.nodeType==8)return;if(jQuery.browser.msie&&elem.setInterval)elem=window;if(!handler.guid)handler.guid=this.guid++;if(data!=undefined){var fn=handler;handler=this.proxy(fn,function(){return fn.apply(this,arguments);});handler.data=data;}var events=jQuery.data(elem,"events")||jQuery.data(elem,"events",{}),handle=jQuery.data(elem,"handle")||jQuery.data(elem,"handle",function(){if(typeof jQuery!="undefined"&&!jQuery.event.triggered)return jQuery.event.handle.apply(arguments.callee.elem,arguments);});handle.elem=elem;jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];handler.type=parts[1];var handlers=events[type];if(!handlers){handlers=events[type]={};if(!jQuery.event.special[type]||jQuery.event.special[type].setup.call(elem)===false){if(elem.addEventListener)elem.addEventListener(type,handle,false);else if(elem.attachEvent)elem.attachEvent("on"+type,handle);}}handlers[handler.guid]=handler;jQuery.event.global[type]=true;});elem=null;},guid:1,global:{},remove:function(elem,types,handler){if(elem.nodeType==3||elem.nodeType==8)return;var events=jQuery.data(elem,"events"),ret,index;if(events){if(types==undefined||(typeof types=="string"&&types.charAt(0)=="."))for(var type in events)this.remove(elem,type+(types||""));else{if(types.type){handler=types.handler;types=types.type;}jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];if(events[type]){if(handler)delete events[type][handler.guid];else
for(handler in events[type])if(!parts[1]||events[type][handler].type==parts[1])delete events[type][handler];for(ret in events[type])break;if(!ret){if(!jQuery.event.special[type]||jQuery.event.special[type].teardown.call(elem)===false){if(elem.removeEventListener)elem.removeEventListener(type,jQuery.data(elem,"handle"),false);else if(elem.detachEvent)elem.detachEvent("on"+type,jQuery.data(elem,"handle"));}ret=null;delete events[type];}}});}for(ret in events)break;if(!ret){var handle=jQuery.data(elem,"handle");if(handle)handle.elem=null;jQuery.removeData(elem,"events");jQuery.removeData(elem,"handle");}}},trigger:function(type,data,elem,donative,extra){data=jQuery.makeArray(data);if(type.indexOf("!")>=0){type=type.slice(0,-1);var exclusive=true;}if(!elem){if(this.global[type])jQuery("*").add([window,document]).trigger(type,data);}else{if(elem.nodeType==3||elem.nodeType==8)return undefined;var val,ret,fn=jQuery.isFunction(elem[type]||null),event=!data[0]||!data[0].preventDefault;if(event){data.unshift({type:type,target:elem,preventDefault:function(){},stopPropagation:function(){},timeStamp:now()});data[0][expando]=true;}data[0].type=type;if(exclusive)data[0].exclusive=true;var handle=jQuery.data(elem,"handle");if(handle)val=handle.apply(elem,data);if((!fn||(jQuery.nodeName(elem,'a')&&type=="click"))&&elem["on"+type]&&elem["on"+type].apply(elem,data)===false)val=false;if(event)data.shift();if(extra&&jQuery.isFunction(extra)){ret=extra.apply(elem,val==null?data:data.concat(val));if(ret!==undefined)val=ret;}if(fn&&donative!==false&&val!==false&&!(jQuery.nodeName(elem,'a')&&type=="click")){this.triggered=true;try{elem[type]();}catch(e){}}this.triggered=false;}return val;},handle:function(event){var val,ret,namespace,all,handlers;event=arguments[0]=jQuery.event.fix(event||window.event);namespace=event.type.split(".");event.type=namespace[0];namespace=namespace[1];all=!namespace&&!event.exclusive;handlers=(jQuery.data(this,"events")||{})[event.type];for(var j in handlers){var handler=handlers[j];if(all||handler.type==namespace){event.handler=handler;event.data=handler.data;ret=handler.apply(this,arguments);if(val!==false)val=ret;if(ret===false){event.preventDefault();event.stopPropagation();}}}return val;},fix:function(event){if(event[expando]==true)return event;var originalEvent=event;event={originalEvent:originalEvent};var props="altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target timeStamp toElement type view wheelDelta which".split(" ");for(var i=props.length;i;i--)event[props[i]]=originalEvent[props[i]];event[expando]=true;event.preventDefault=function(){if(originalEvent.preventDefault)originalEvent.preventDefault();originalEvent.returnValue=false;};event.stopPropagation=function(){if(originalEvent.stopPropagation)originalEvent.stopPropagation();originalEvent.cancelBubble=true;};event.timeStamp=event.timeStamp||now();if(!event.target)event.target=event.srcElement||document;if(event.target.nodeType==3)event.target=event.target.parentNode;if(!event.relatedTarget&&event.fromElement)event.relatedTarget=event.fromElement==event.target?event.toElement:event.fromElement;if(event.pageX==null&&event.clientX!=null){var doc=document.documentElement,body=document.body;event.pageX=event.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc.clientLeft||0);event.pageY=event.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc.clientTop||0);}if(!event.which&&((event.charCode||event.charCode===0)?event.charCode:event.keyCode))event.which=event.charCode||event.keyCode;if(!event.metaKey&&event.ctrlKey)event.metaKey=event.ctrlKey;if(!event.which&&event.button)event.which=(event.button&1?1:(event.button&2?3:(event.button&4?2:0)));return event;},proxy:function(fn,proxy){proxy.guid=fn.guid=fn.guid||proxy.guid||this.guid++;return proxy;},special:{ready:{setup:function(){bindReady();return;},teardown:function(){return;}},mouseenter:{setup:function(){if(jQuery.browser.msie)return false;jQuery(this).bind("mouseover",jQuery.event.special.mouseenter.handler);return true;},teardown:function(){if(jQuery.browser.msie)return false;jQuery(this).unbind("mouseover",jQuery.event.special.mouseenter.handler);return true;},handler:function(event){if(withinElement(event,this))return true;event.type="mouseenter";return jQuery.event.handle.apply(this,arguments);}},mouseleave:{setup:function(){if(jQuery.browser.msie)return false;jQuery(this).bind("mouseout",jQuery.event.special.mouseleave.handler);return true;},teardown:function(){if(jQuery.browser.msie)return false;jQuery(this).unbind("mouseout",jQuery.event.special.mouseleave.handler);return true;},handler:function(event){if(withinElement(event,this))return true;event.type="mouseleave";return jQuery.event.handle.apply(this,arguments);}}}};jQuery.fn.extend({bind:function(type,data,fn){return type=="unload"?this.one(type,data,fn):this.each(function(){jQuery.event.add(this,type,fn||data,fn&&data);});},one:function(type,data,fn){var one=jQuery.event.proxy(fn||data,function(event){jQuery(this).unbind(event,one);return(fn||data).apply(this,arguments);});return this.each(function(){jQuery.event.add(this,type,one,fn&&data);});},unbind:function(type,fn){return this.each(function(){jQuery.event.remove(this,type,fn);});},trigger:function(type,data,fn){return this.each(function(){jQuery.event.trigger(type,data,this,true,fn);});},triggerHandler:function(type,data,fn){return this[0]&&jQuery.event.trigger(type,data,this[0],false,fn);},toggle:function(fn){var args=arguments,i=1;while(i<args.length)jQuery.event.proxy(fn,args[i++]);return this.click(jQuery.event.proxy(fn,function(event){this.lastToggle=(this.lastToggle||0)%i;event.preventDefault();return args[this.lastToggle++].apply(this,arguments)||false;}));},hover:function(fnOver,fnOut){return this.bind('mouseenter',fnOver).bind('mouseleave',fnOut);},ready:function(fn){bindReady();if(jQuery.isReady)fn.call(document,jQuery);else
jQuery.readyList.push(function(){return fn.call(this,jQuery);});return this;}});jQuery.extend({isReady:false,readyList:[],ready:function(){if(!jQuery.isReady){jQuery.isReady=true;if(jQuery.readyList){jQuery.each(jQuery.readyList,function(){this.call(document);});jQuery.readyList=null;}jQuery(document).triggerHandler("ready");}}});var readyBound=false;function bindReady(){if(readyBound)return;readyBound=true;if(document.addEventListener&&!jQuery.browser.opera)document.addEventListener("DOMContentLoaded",jQuery.ready,false);if(jQuery.browser.msie&&window==top)(function(){if(jQuery.isReady)return;try{document.documentElement.doScroll("left");}catch(error){setTimeout(arguments.callee,0);return;}jQuery.ready();})();if(jQuery.browser.opera)document.addEventListener("DOMContentLoaded",function(){if(jQuery.isReady)return;for(var i=0;i<document.styleSheets.length;i++)if(document.styleSheets[i].disabled){setTimeout(arguments.callee,0);return;}jQuery.ready();},false);if(jQuery.browser.safari){var numStyles;(function(){if(jQuery.isReady)return;if(document.readyState!="loaded"&&document.readyState!="complete"){setTimeout(arguments.callee,0);return;}if(numStyles===undefined)numStyles=jQuery("style, link[rel=stylesheet]").length;if(document.styleSheets.length!=numStyles){setTimeout(arguments.callee,0);return;}jQuery.ready();})();}jQuery.event.add(window,"load",jQuery.ready);}jQuery.each(("blur,focus,load,resize,scroll,unload,click,dblclick,"+"mousedown,mouseup,mousemove,mouseover,mouseout,change,select,"+"submit,keydown,keypress,keyup,error").split(","),function(i,name){jQuery.fn[name]=function(fn){return fn?this.bind(name,fn):this.trigger(name);};});var withinElement=function(event,elem){var parent=event.relatedTarget;while(parent&&parent!=elem)try{parent=parent.parentNode;}catch(error){parent=elem;}return parent==elem;};jQuery(window).bind("unload",function(){jQuery("*").add(document).unbind();});jQuery.fn.extend({_load:jQuery.fn.load,load:function(url,params,callback){if(typeof url!='string')return this._load(url);var off=url.indexOf(" ");if(off>=0){var selector=url.slice(off,url.length);url=url.slice(0,off);}callback=callback||function(){};var type="GET";if(params)if(jQuery.isFunction(params)){callback=params;params=null;}else{params=jQuery.param(params);type="POST";}var self=this;jQuery.ajax({url:url,type:type,dataType:"html",data:params,complete:function(res,status){if(status=="success"||status=="notmodified")self.html(selector?jQuery("<div/>").append(res.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(selector):res.responseText);self.each(callback,[res.responseText,status,res]);}});return this;},serialize:function(){return jQuery.param(this.serializeArray());},serializeArray:function(){return this.map(function(){return jQuery.nodeName(this,"form")?jQuery.makeArray(this.elements):this;}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type));}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:val.constructor==Array?jQuery.map(val,function(val,i){return{name:elem.name,value:val};}):{name:elem.name,value:val};}).get();}});jQuery.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(i,o){jQuery.fn[o]=function(f){return this.bind(o,f);};});var jsc=now();jQuery.extend({get:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data=null;}return jQuery.ajax({type:"GET",url:url,data:data,success:callback,dataType:type});},getScript:function(url,callback){return jQuery.get(url,null,callback,"script");},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json");},post:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data={};}return jQuery.ajax({type:"POST",url:url,data:data,success:callback,dataType:type});},ajaxSetup:function(settings){jQuery.extend(jQuery.ajaxSettings,settings);},ajaxSettings:{url:location.href,global:true,type:"GET",timeout:0,contentType:"application/x-www-form-urlencoded",processData:true,async:true,data:null,username:null,password:null,accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(s){s=jQuery.extend(true,s,jQuery.extend(true,{},jQuery.ajaxSettings,s));var jsonp,jsre=/=\?(&|$)/g,status,data,type=s.type.toUpperCase();if(s.data&&s.processData&&typeof s.data!="string")s.data=jQuery.param(s.data);if(s.dataType=="jsonp"){if(type=="GET"){if(!s.url.match(jsre))s.url+=(s.url.match(/\?/)?"&":"?")+(s.jsonp||"callback")+"=?";}else if(!s.data||!s.data.match(jsre))s.data=(s.data?s.data+"&":"")+(s.jsonp||"callback")+"=?";s.dataType="json";}if(s.dataType=="json"&&(s.data&&s.data.match(jsre)||s.url.match(jsre))){jsonp="jsonp"+jsc++;if(s.data)s.data=(s.data+"").replace(jsre,"="+jsonp+"$1");s.url=s.url.replace(jsre,"="+jsonp+"$1");s.dataType="script";window[jsonp]=function(tmp){data=tmp;success();complete();window[jsonp]=undefined;try{delete window[jsonp];}catch(e){}if(head)head.removeChild(script);};}if(s.dataType=="script"&&s.cache==null)s.cache=false;if(s.cache===false&&type=="GET"){var ts=now();var ret=s.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+ts+"$2");s.url=ret+((ret==s.url)?(s.url.match(/\?/)?"&":"?")+"_="+ts:"");}if(s.data&&type=="GET"){s.url+=(s.url.match(/\?/)?"&":"?")+s.data;s.data=null;}if(s.global&&!jQuery.active++)jQuery.event.trigger("ajaxStart");var remote=/^(?:\w+:)?\/\/([^\/?#]+)/;if(s.dataType=="script"&&type=="GET"&&remote.test(s.url)&&remote.exec(s.url)[1]!=location.host){var head=document.getElementsByTagName("head")[0];var script=document.createElement("script");script.src=s.url;if(s.scriptCharset)script.charset=s.scriptCharset;if(!jsonp){var done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){done=true;success();complete();head.removeChild(script);}};}head.appendChild(script);return undefined;}var requestDone=false;var xhr=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();if(s.username)xhr.open(type,s.url,s.async,s.username,s.password);else
xhr.open(type,s.url,s.async);try{if(s.data)xhr.setRequestHeader("Content-Type",s.contentType);if(s.ifModified)xhr.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url]||"Thu, 01 Jan 1970 00:00:00 GMT");xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");xhr.setRequestHeader("Accept",s.dataType&&s.accepts[s.dataType]?s.accepts[s.dataType]+", */*":s.accepts._default);}catch(e){}if(s.beforeSend&&s.beforeSend(xhr,s)===false){s.global&&jQuery.active--;xhr.abort();return false;}if(s.global)jQuery.event.trigger("ajaxSend",[xhr,s]);var onreadystatechange=function(isTimeout){if(!requestDone&&xhr&&(xhr.readyState==4||isTimeout=="timeout")){requestDone=true;if(ival){clearInterval(ival);ival=null;}status=isTimeout=="timeout"&&"timeout"||!jQuery.httpSuccess(xhr)&&"error"||s.ifModified&&jQuery.httpNotModified(xhr,s.url)&&"notmodified"||"success";if(status=="success"){try{data=jQuery.httpData(xhr,s.dataType,s.dataFilter);}catch(e){status="parsererror";}}if(status=="success"){var modRes;try{modRes=xhr.getResponseHeader("Last-Modified");}catch(e){}if(s.ifModified&&modRes)jQuery.lastModified[s.url]=modRes;if(!jsonp)success();}else
jQuery.handleError(s,xhr,status);complete();if(s.async)xhr=null;}};if(s.async){var ival=setInterval(onreadystatechange,13);if(s.timeout>0)setTimeout(function(){if(xhr){xhr.abort();if(!requestDone)onreadystatechange("timeout");}},s.timeout);}try{xhr.send(s.data);}catch(e){jQuery.handleError(s,xhr,null,e);}if(!s.async)onreadystatechange();function success(){if(s.success)s.success(data,status);if(s.global)jQuery.event.trigger("ajaxSuccess",[xhr,s]);}function complete(){if(s.complete)s.complete(xhr,status);if(s.global)jQuery.event.trigger("ajaxComplete",[xhr,s]);if(s.global&&!--jQuery.active)jQuery.event.trigger("ajaxStop");}return xhr;},handleError:function(s,xhr,status,e){if(s.error)s.error(xhr,status,e);if(s.global)jQuery.event.trigger("ajaxError",[xhr,s,e]);},active:0,httpSuccess:function(xhr){try{return!xhr.status&&location.protocol=="file:"||(xhr.status>=200&&xhr.status<300)||xhr.status==304||xhr.status==1223||jQuery.browser.safari&&xhr.status==undefined;}catch(e){}return false;},httpNotModified:function(xhr,url){try{var xhrRes=xhr.getResponseHeader("Last-Modified");return xhr.status==304||xhrRes==jQuery.lastModified[url]||jQuery.browser.safari&&xhr.status==undefined;}catch(e){}return false;},httpData:function(xhr,type,filter){var ct=xhr.getResponseHeader("content-type"),xml=type=="xml"||!type&&ct&&ct.indexOf("xml")>=0,data=xml?xhr.responseXML:xhr.responseText;if(xml&&data.documentElement.tagName=="parsererror")throw"parsererror";if(filter)data=filter(data,type);if(type=="script")jQuery.globalEval(data);if(type=="json")data=eval("("+data+")");return data;},param:function(a){var s=[];if(a.constructor==Array||a.jquery)jQuery.each(a,function(){s.push(encodeURIComponent(this.name)+"="+encodeURIComponent(this.value));});else
for(var j in a)if(a[j]&&a[j].constructor==Array)jQuery.each(a[j],function(){s.push(encodeURIComponent(j)+"="+encodeURIComponent(this));});else
s.push(encodeURIComponent(j)+"="+encodeURIComponent(jQuery.isFunction(a[j])?a[j]():a[j]));return s.join("&").replace(/%20/g,"+");}});jQuery.fn.extend({show:function(speed,callback){return speed?this.animate({height:"show",width:"show",opacity:"show"},speed,callback):this.filter(":hidden").each(function(){this.style.display=this.oldblock||"";if(jQuery.css(this,"display")=="none"){var elem=jQuery("<"+this.tagName+" />").appendTo("body");this.style.display=elem.css("display");if(this.style.display=="none")this.style.display="block";elem.remove();}}).end();},hide:function(speed,callback){return speed?this.animate({height:"hide",width:"hide",opacity:"hide"},speed,callback):this.filter(":visible").each(function(){this.oldblock=this.oldblock||jQuery.css(this,"display");this.style.display="none";}).end();},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){return jQuery.isFunction(fn)&&jQuery.isFunction(fn2)?this._toggle.apply(this,arguments):fn?this.animate({height:"toggle",width:"toggle",opacity:"toggle"},fn,fn2):this.each(function(){jQuery(this)[jQuery(this).is(":hidden")?"show":"hide"]();});},slideDown:function(speed,callback){return this.animate({height:"show"},speed,callback);},slideUp:function(speed,callback){return this.animate({height:"hide"},speed,callback);},slideToggle:function(speed,callback){return this.animate({height:"toggle"},speed,callback);},fadeIn:function(speed,callback){return this.animate({opacity:"show"},speed,callback);},fadeOut:function(speed,callback){return this.animate({opacity:"hide"},speed,callback);},fadeTo:function(speed,to,callback){return this.animate({opacity:to},speed,callback);},animate:function(prop,speed,easing,callback){var optall=jQuery.speed(speed,easing,callback);return this[optall.queue===false?"each":"queue"](function(){if(this.nodeType!=1)return false;var opt=jQuery.extend({},optall),p,hidden=jQuery(this).is(":hidden"),self=this;for(p in prop){if(prop[p]=="hide"&&hidden||prop[p]=="show"&&!hidden)return opt.complete.call(this);if(p=="height"||p=="width"){opt.display=jQuery.css(this,"display");opt.overflow=this.style.overflow;}}if(opt.overflow!=null)this.style.overflow="hidden";opt.curAnim=jQuery.extend({},prop);jQuery.each(prop,function(name,val){var e=new jQuery.fx(self,opt,name);if(/toggle|show|hide/.test(val))e[val=="toggle"?hidden?"show":"hide":val](prop);else{var parts=val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),start=e.cur(true)||0;if(parts){var end=parseFloat(parts[2]),unit=parts[3]||"px";if(unit!="px"){self.style[name]=(end||1)+unit;start=((end||1)/e.cur(true))*start;self.style[name]=start+unit;}if(parts[1])end=((parts[1]=="-="?-1:1)*end)+start;e.custom(start,end,unit);}else
e.custom(start,val,"");}});return true;});},queue:function(type,fn){if(jQuery.isFunction(type)||(type&&type.constructor==Array)){fn=type;type="fx";}if(!type||(typeof type=="string"&&!fn))return queue(this[0],type);return this.each(function(){if(fn.constructor==Array)queue(this,type,fn);else{queue(this,type).push(fn);if(queue(this,type).length==1)fn.call(this);}});},stop:function(clearQueue,gotoEnd){var timers=jQuery.timers;if(clearQueue)this.queue([]);this.each(function(){for(var i=timers.length-1;i>=0;i--)if(timers[i].elem==this){if(gotoEnd)timers[i](true);timers.splice(i,1);}});if(!gotoEnd)this.dequeue();return this;}});var queue=function(elem,type,array){if(elem){type=type||"fx";var q=jQuery.data(elem,type+"queue");if(!q||array)q=jQuery.data(elem,type+"queue",jQuery.makeArray(array));}return q;};jQuery.fn.dequeue=function(type){type=type||"fx";return this.each(function(){var q=queue(this,type);q.shift();if(q.length)q[0].call(this);});};jQuery.extend({speed:function(speed,easing,fn){var opt=speed&&speed.constructor==Object?speed:{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&easing.constructor!=Function&&easing};opt.duration=(opt.duration&&opt.duration.constructor==Number?opt.duration:jQuery.fx.speeds[opt.duration])||jQuery.fx.speeds.def;opt.old=opt.complete;opt.complete=function(){if(opt.queue!==false)jQuery(this).dequeue();if(jQuery.isFunction(opt.old))opt.old.call(this);};return opt;},easing:{linear:function(p,n,firstNum,diff){return firstNum+diff*p;},swing:function(p,n,firstNum,diff){return((-Math.cos(p*Math.PI)/2)+0.5)*diff+firstNum;}},timers:[],timerId:null,fx:function(elem,options,prop){this.options=options;this.elem=elem;this.prop=prop;if(!options.orig)options.orig={};}});jQuery.fx.prototype={update:function(){if(this.options.step)this.options.step.call(this.elem,this.now,this);(jQuery.fx.step[this.prop]||jQuery.fx.step._default)(this);if(this.prop=="height"||this.prop=="width")this.elem.style.display="block";},cur:function(force){if(this.elem[this.prop]!=null&&this.elem.style[this.prop]==null)return this.elem[this.prop];var r=parseFloat(jQuery.css(this.elem,this.prop,force));return r&&r>-10000?r:parseFloat(jQuery.curCSS(this.elem,this.prop))||0;},custom:function(from,to,unit){this.startTime=now();this.start=from;this.end=to;this.unit=unit||this.unit||"px";this.now=this.start;this.pos=this.state=0;this.update();var self=this;function t(gotoEnd){return self.step(gotoEnd);}t.elem=this.elem;jQuery.timers.push(t);if(jQuery.timerId==null){jQuery.timerId=setInterval(function(){var timers=jQuery.timers;for(var i=0;i<timers.length;i++)if(!timers[i]())timers.splice(i--,1);if(!timers.length){clearInterval(jQuery.timerId);jQuery.timerId=null;}},13);}},show:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.show=true;this.custom(0,this.cur());if(this.prop=="width"||this.prop=="height")this.elem.style[this.prop]="1px";jQuery(this.elem).show();},hide:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0);},step:function(gotoEnd){var t=now();if(gotoEnd||t>this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var done=true;for(var i in this.options.curAnim)if(this.options.curAnim[i]!==true)done=false;if(done){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(jQuery.css(this.elem,"display")=="none")this.elem.style.display="block";}if(this.options.hide)this.elem.style.display="none";if(this.options.hide||this.options.show)for(var p in this.options.curAnim)jQuery.attr(this.elem.style,p,this.options.orig[p]);}if(done)this.options.complete.call(this.elem);return false;}else{var n=t-this.startTime;this.state=n/this.options.duration;this.pos=jQuery.easing[this.options.easing||(jQuery.easing.swing?"swing":"linear")](this.state,n,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update();}return true;}};jQuery.extend(jQuery.fx,{speeds:{slow:600,fast:200,def:400},step:{scrollLeft:function(fx){fx.elem.scrollLeft=fx.now;},scrollTop:function(fx){fx.elem.scrollTop=fx.now;},opacity:function(fx){jQuery.attr(fx.elem.style,"opacity",fx.now);},_default:function(fx){fx.elem.style[fx.prop]=fx.now+fx.unit;}}});jQuery.fn.offset=function(){var left=0,top=0,elem=this[0],results;if(elem)with(jQuery.browser){var parent=elem.parentNode,offsetChild=elem,offsetParent=elem.offsetParent,doc=elem.ownerDocument,safari2=safari&&parseInt(version)<522&&!/adobeair/i.test(userAgent),css=jQuery.curCSS,fixed=css(elem,"position")=="fixed";if(elem.getBoundingClientRect){var box=elem.getBoundingClientRect();add(box.left+Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),box.top+Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));add(-doc.documentElement.clientLeft,-doc.documentElement.clientTop);}else{add(elem.offsetLeft,elem.offsetTop);while(offsetParent){add(offsetParent.offsetLeft,offsetParent.offsetTop);if(mozilla&&!/^t(able|d|h)$/i.test(offsetParent.tagName)||safari&&!safari2)border(offsetParent);if(!fixed&&css(offsetParent,"position")=="fixed")fixed=true;offsetChild=/^body$/i.test(offsetParent.tagName)?offsetChild:offsetParent;offsetParent=offsetParent.offsetParent;}while(parent&&parent.tagName&&!/^body|html$/i.test(parent.tagName)){if(!/^inline|table.*$/i.test(css(parent,"display")))add(-parent.scrollLeft,-parent.scrollTop);if(mozilla&&css(parent,"overflow")!="visible")border(parent);parent=parent.parentNode;}if((safari2&&(fixed||css(offsetChild,"position")=="absolute"))||(mozilla&&css(offsetChild,"position")!="absolute"))add(-doc.body.offsetLeft,-doc.body.offsetTop);if(fixed)add(Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));}results={top:top,left:left};}function border(elem){add(jQuery.curCSS(elem,"borderLeftWidth",true),jQuery.curCSS(elem,"borderTopWidth",true));}function add(l,t){left+=parseInt(l,10)||0;top+=parseInt(t,10)||0;}return results;};jQuery.fn.extend({position:function(){var left=0,top=0,results;if(this[0]){var offsetParent=this.offsetParent(),offset=this.offset(),parentOffset=/^body|html$/i.test(offsetParent[0].tagName)?{top:0,left:0}:offsetParent.offset();offset.top-=num(this,'marginTop');offset.left-=num(this,'marginLeft');parentOffset.top+=num(offsetParent,'borderTopWidth');parentOffset.left+=num(offsetParent,'borderLeftWidth');results={top:offset.top-parentOffset.top,left:offset.left-parentOffset.left};}return results;},offsetParent:function(){var offsetParent=this[0].offsetParent;while(offsetParent&&(!/^body|html$/i.test(offsetParent.tagName)&&jQuery.css(offsetParent,'position')=='static'))offsetParent=offsetParent.offsetParent;return jQuery(offsetParent);}});jQuery.each(['Left','Top'],function(i,name){var method='scroll'+name;jQuery.fn[method]=function(val){if(!this[0])return;return val!=undefined?this.each(function(){this==window||this==document?window.scrollTo(!i?val:jQuery(window).scrollLeft(),i?val:jQuery(window).scrollTop()):this[method]=val;}):this[0]==window||this[0]==document?self[i?'pageYOffset':'pageXOffset']||jQuery.boxModel&&document.documentElement[method]||document.body[method]:this[0][method];};});jQuery.each(["Height","Width"],function(i,name){var tl=i?"Left":"Top",br=i?"Right":"Bottom";jQuery.fn["inner"+name]=function(){return this[name.toLowerCase()]()+num(this,"padding"+tl)+num(this,"padding"+br);};jQuery.fn["outer"+name]=function(margin){return this["inner"+name]()+num(this,"border"+tl+"Width")+num(this,"border"+br+"Width")+(margin?num(this,"margin"+tl)+num(this,"margin"+br):0);};});})();

jQuery.fn.extend({
    everyTime: function(interval, label, fn, times, belay) {
        return this.each(function() {
            jQuery.timer.add(this, interval, label, fn, times, belay);
        });
    },
    oneTime: function(interval, label, fn) {
        return this.each(function() {
            jQuery.timer.add(this, interval, label, fn, 1);
        });
    },
    stopTime: function(label, fn) {
        return this.each(function() {
            jQuery.timer.remove(this, label, fn);
        });
    }
});

jQuery.extend({
    timer: {
        guid: 1,
        global: {},
        regex: /^([0-9]+)\s*(.*s)?$/,
        powers: {
            // Yeah this is major overkill...
            'ms': 1,
            'cs': 10,
            'ds': 100,
            's': 1000,
            'das': 10000,
            'hs': 100000,
            'ks': 1000000
        },
        timeParse: function(value) {
            if (value == undefined || value == null)
                return null;
            var result = this.regex.exec(jQuery.trim(value.toString()));
            if (result[2]) {
                var num = parseInt(result[1], 10);
                var mult = this.powers[result[2]] || 1;
                return num * mult;
            } else {
                return value;
            }
        },
        add: function(element, interval, label, fn, times, belay) {
            var counter = 0;

            if (jQuery.isFunction(label)) {
                if (!times)
                    times = fn;
                fn = label;
                label = interval;
            }

            interval = jQuery.timer.timeParse(interval);

            if (typeof interval != 'number' || isNaN(interval) || interval <= 0)
                return;

            if (times && times.constructor != Number) {
                belay = !!times;
                times = 0;
            }

            times = times || 0;
            belay = belay || false;

            if (!element.$timers)
                element.$timers = {};

            if (!element.$timers[label])
                element.$timers[label] = {};

            fn.$timerID = fn.$timerID || this.guid++;

            var handler = function() {
                if (belay && this.inProgress)
                    return;
                this.inProgress = true;
                if ((++counter > times && times !== 0) || fn.call(element, counter) === false)
                    jQuery.timer.remove(element, label, fn);
                this.inProgress = false;
            };

            handler.$timerID = fn.$timerID;

            if (!element.$timers[label][fn.$timerID])
                element.$timers[label][fn.$timerID] = window.setInterval(handler,interval);

            if ( !this.global[label] )
                this.global[label] = [];
            this.global[label].push( element );

        },
        remove: function(element, label, fn) {
            var timers = element.$timers, ret;

            if ( timers ) {

                if (!label) {
                    for ( label in timers )
                        this.remove(element, label, fn);
                } else if ( timers[label] ) {
                    if ( fn ) {
                        if ( fn.$timerID ) {
                            window.clearInterval(timers[label][fn.$timerID]);
                            delete timers[label][fn.$timerID];
                        }
                    } else {
                        for ( var fn in timers[label] ) {
                            window.clearInterval(timers[label][fn]);
                            delete timers[label][fn];
                        }
                    }

                    for ( ret in timers[label] ) break;
                    if ( !ret ) {
                        ret = null;
                        delete timers[label];
                    }
                }

                for ( ret in timers ) break;
                if ( !ret )
                    element.$timers = null;
            }
        }
    }
});

if (jQuery.browser.msie)
    jQuery(window).one("unload", function() {
        var global = jQuery.timer.global;
        for ( var label in global ) {
            var els = global[label], i = els.length;
            while ( --i )
                jQuery.timer.remove(els[i], label);
        }
    });

/**
 * find the previous HTMLElement with the given type of node
 *
 * @param   HTMLElement   o
 * @param   string        typeOfNode
 * @return  HTMLElement
 */
function getPreviousNode ( o , typeOfNode ) {
    if ( arguments[2] == null ) {
        o = o.previousSibling ;
    }

    while ( o && o.nodeName.toLowerCase() != typeOfNode.toLowerCase () ) {
        c = o.childNodes ;

        for ( var i = ( c.length - 1 ) ; i >= 0 ; i-- ) {
            pSub = getPreviousNode ( c[i] , typeOfNode , false )  ;

            if ( pSub  ) {
                return pSub ;
            }
        }
        o = o.previousSibling;
    }

    if ( o ) {
        return o ;
    } else {
        return '' ;
    }
};

/**
 * find the next HTMLElement with the given type of node
 *
 * @param   HTMLElement   o
 * @param   string        typeOfNode
 * @return  HTMLElement
 */
function getNextNode ( o , typeOfNode ) {
    if ( arguments[2] == null ) {
        o = o.nextSibling ;
    }

    while ( o && o.nodeName.toLowerCase() != typeOfNode.toLowerCase () ) {
        c = o.childNodes ;

        for ( var i = 0 ; i < c.length ; i++ ) {
            pSub = getNextNode ( c[i] , typeOfNode , false )  ;

            if ( pSub  ) {
                return pSub ;
            }
        }
        o = o.nextSibling;
    }

    if ( o ) {
        return o ;
    } else {
        return '' ;
    }
};

/**
 * opens a new popup window
 *
 * @param   string      newWindowURL
 * @param   string      width
 * @param   string      height
 * @param   string      scroll
 * @param   string      id
 * @return  void
 */
function openWindow( newWindowURL , width , height , scroll , id ) {
    var posLeft   = ( screen.width /2 ) - width / 2;
    var posTop    = ( screen.height /2 ) - height / 2;

    var styleStr  = 'toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars='+scroll+',resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+posLeft+',top='+posTop+',screenX='+posLeft+',screenY='+posTop ;
    var msgWindow = window.open( newWindowURL , id , styleStr );

    msgWindow.focus () ;
};

/**
 * @param   HTMLElement   obj
 * @return  void
 */
function selectImage ( obj ) {
    openDialogWindow ( 'imageSelector' , 'ibase.php?module=explorer&index[explorer][filter]=jpg;jpeg;gif;bmp;png' , 600 , 551 ,
        function () {
            var returnedArguments = parseArgumentsToArray ( dialogWindow.returnedValue ) ;
            $( 'img' , obj.parentNode ).attr ( 'src' , './temp/explorer/files/' + returnedArguments[ 'mImage' ] ) ;
            $( 'img' , obj.parentNode ).attr ( 'width' , returnedArguments[ 'mThumbX' ] ) ;
            $( 'img' , obj.parentNode ).attr ( 'height' , returnedArguments[ 'mThumbY' ] ) ;
            $( '.toBeSubmitted' , obj.parentNode ).attr ( 'value' , returnedArguments[ 'mImage' ] ) ;
        }
    );
};

/**
 * @param   HTMLElement   obj
 * @return  void
 */
function clearImage ( obj ) {
    $( 'img' , obj.parentNode ).attr ( 'src' , 'skins/dark/en/images/nopicture.png' ) ;
    $( 'img' , obj.parentNode ).attr ( 'width' , 80 ) ;
    $( 'img' , obj.parentNode ).attr ( 'height' , 80 ) ;
    $( '.toBeSubmitted' , obj.parentNode ).attr ( 'value' , '' ) ;
};

/**
 * @param   HTMLElement   obj
 * @return  void
 */
function selectFile ( obj ) {
    openDialogWindow ( 'fileSelector' , 'ibase.php?module=explorer&index[explorer][filter]=NULL' , 600 , 551 ,
        function () {
            var returnedArguments = parseArgumentsToArray ( dialogWindow.returnedValue ) ;
            if (dialogWindow.returnedValue.split('=').length > 1) {
                $( 'span' , obj.parentNode ).html ( '<img src="core/shared/PEAR/HTMLTreeMenu/erisxIcons/' + returnedArguments[ 'mExt' ] + '.gif">&nbsp;' + returnedArguments[ 'mName' ] + ' (' + returnedArguments[ 'mSize' ] + ')' ) ;
                $( '.toBeSubmitted' , obj.parentNode ).attr ( 'value' , returnedArguments[ 'mImage' ] ) ;
            }
        }
    ) ;
};

/**
 * @param   HTMLElement   obj
 * @return  void
 */
function clearFile ( obj ) {
    $( 'span' , obj.parentNode ).html ( ex_text[ 'no_file_selected' ] ) ;
    $( '.toBeSubmitted' , obj.parentNode ).attr ( 'value' , '' ) ;
}

/**
 * @param   HTMLElement   obj
 * @return  void
 */
function selectSelection ( obj , options ) {
    openDialogWindow ( 'selectionDialog' , 'ibase.php?module=selection&' + options + '&index[selection][initValues][selection]=' + $( '.toBeSubmitted' , obj.parentNode ).attr ( 'value' ) , 600 , 451 ,
        function () {
            var returnedArguments = parseArgumentsToArray ( dialogWindow.returnedValue ) ;

            $( 'span' , obj.parentNode ).html ( returnedArguments[ 'values' ] ) ;
            $( '.toBeSubmitted' , obj.parentNode ).attr ( 'value' , returnedArguments[ 'keys' ] ) ;
        }
    ) ;
}

/**
 * @param   HTMLElement   obj
 * @return  void
 */
function clearSelection ( obj ) {
    $( 'span' , obj.parentNode ).html ( ex_text[ 'no_entries_selected' ] ) ;
    $( '.toBeSubmitted' , obj.parentNode ).attr ( 'value' , '' ) ;
}

/**
 * @param   String        pAction
 * @param   String        pUrl
 * @return  void
 */
function doAction ( pAction , pUrl ) {
    var useElems = '&action=' + pAction ;

    $( 'input.checkbox' ).each ( function () {
        if ( this.name == 'checkbox[]' && this.checked == true ) {
            useElems += '&id[]=' + this.value ;
        }
    } ) ;

    document.location.href = pUrl + useElems ;
}

/**
 * @param   String        lnk
 * @return  void
 */
function fetchHistory ( lnk ) {
    $( '#history' ).load ( 'core/shared/XMLHttp/fetchHistory.php?action=int' + lnk , {} , function ( a ) { alert ( a ) ; } ) ;
}

/**
 * @return  void
 */
function hideHistory () {
    $( '#history' ).hide () ;
}

function editLanguage ( lng ) {
    $( '.multilang' ).hide () ;
    $( '.' + lng ).show () ;
}


$( document ).ready ( function () {
    var pCounter = 1 ;
    var pStatus  = new Array () ;

    $( "a" ).focus ( function () {
        this.blur () ;
    } ) ;

    $( "input" ).each ( function () {
        $( this ).addClass ( $( this ).attr( 'type' ) ) ;
    } ) ;

    if ( $('#selectLang').val() ) {
        editLanguage ( $('#selectLang').val() ) ;
    }


    //Content strecken bzw verkleinern
    $( window ).bind( 'resize' , resizeWindow ) ;
    resizeWindow() ;

    //screenshots ergänzen ersetzen
    $('img.monitor').each(function (i) {
        $(this).wrap( '<div class="monitor"></div>' ) ;
        $(this).parent().attr( 'style' , $(this).attr( 'style' ) ) ;
        $(this).attr( 'style' , '' ) ;
        if ( $(this).height() > $(this).width() ) {
            $(this).css('height' , '134px' ) ;
        } else {
            $(this).css('width' , '181px' ) ;
        }
    });

    $( '.stripOnWebsite' ).remove() ;
} ) ;


function resizeWindow ( ) {
    var winWidth   = $( window ).width( ) ;

    if ( winWidth > 1216 ) {
//         $( '#container' ).css( 'width' , '1216px' ) ;
        $( '#container' ).removeClass( 'contentSmall' ) ;
        $( '#container' ).addClass( 'contentLarge' ) ;
    } else {
//         $( '#container' ).css( 'width' , '960px' ) ;
        $( '#container' ).removeClass( 'contentLarge' ) ;
        $( '#container' ).addClass( 'contentSmall' ) ;
    }
}

rolloverImageRegexp = /(_f[0-9])?((\.jpg)|(\.png)|(\.gif))/ ;
collectedTriggers   = [] ;

function collectTriggers ( objects ) {
    collectedTriggers.push ( objects ) ;
}

function initTriggers () {
    for ( var i = 0 ; i < collectedTriggers.length ; i++ ) {
        eval ( collectedTriggers [ i ] ) ;
    }
}

function initRollovers ( elements ) {
    for ( var i = 0 ; i < elements.length ; i++ ) {
        $( "#" + elements[ i ].toLowerCase() ).addClass( 'active' ).find( "> a" ).addClass( 'active' ).find( "> img" ).addClass( 'active' ) ;
    }
}

function prepareRollovers () {
    $( "img.active" ).each( function () {
         this.src = this.src.replace ( rolloverImageRegexp , '_f2$2' ) ;
    } ) ;

    $( "img.rollover:not(.active)" ).hover (
        function () { hoverImageStart ( this ) } ,
        function () { hoverImageEnd ( this ) }
    ) ;

    $( ".navigation li a" ).hover (
        function () { hoverImageStart ( $( this ).find ( "> img" ).get(0) ) } ,
        function () { hoverImageEnd ( $( this ).find ( "> img" ).get(0) ) }
    ) ;
}

function hoverImageStart ( img ) {
    if ( img )
        img.src = img.src.replace ( rolloverImageRegexp , '_f2$2' ) ;
}

function hoverImageEnd ( img ) {
    if ( img && $( img ).hasClass ( 'active' ) == false )
        img.src = img.src.replace ( rolloverImageRegexp , '$2' ) ;
}

$( document ).ready ( function () {
    $( ".navigation" ).find( "> li" ).each( function () {
        if ( this.id == '' ) {
            this.id = $( this ).find( '> a' ).text().toLowerCase() ;
        }
    } ) ;

    initTriggers () ;
    prepareRollovers () ;
} ) ;

/**
 * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 */
if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return "";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;

/******************************************************************************
Name:    Highslide JS
Version: 4.1.0 (March 12 2009)
Config:  default
Author:  Torstein Hønsi
Support: http://highslide.com/support

Licence:
Highslide JS is licensed under a Creative Commons Attribution-NonCommercial 2.5
License (http://creativecommons.org/licenses/by-nc/2.5/).

You are free:
    * to copy, distribute, display, and perform the work
    * to make derivative works

Under the following conditions:
    * Attribution. You must attribute the work in the manner  specified by  the
      author or licensor.
    * Noncommercial. You may not use this work for commercial purposes.

* For  any  reuse  or  distribution, you  must make clear to others the license
  terms of this work.
* Any  of  these  conditions  can  be  waived  if  you  get permission from the
  copyright holder.

Your fair use and other rights are in no way affected by the above.
******************************************************************************/
var hs = {
// Language strings
lang : {
    cssDirection: 'ltr',
    loadingText : 'Loading...',
    loadingTitle : 'Click to cancel',
    focusTitle : 'Click to bring to front',
    fullExpandTitle : 'Expand to actual size (f)',
    creditsText : 'Powered by <i>Highslide JS</i>',
    creditsTitle : 'Go to the Highslide JS homepage',
    restoreTitle : 'Click to close image, click and drag to move. Use arrow keys for next and previous.'
},
// See http://highslide.com/ref for examples of settings
graphicsDir : 'highslide/graphics/',
expandCursor : 'zoomin.cur', // null disables
restoreCursor : 'zoomout.cur', // null disables
expandDuration : 250, // milliseconds
restoreDuration : 250,
marginLeft : 15,
marginRight : 15,
marginTop : 15,
marginBottom : 15,
zIndexCounter : 1001, // adjust to other absolutely positioned elements
loadingOpacity : 0.75,
allowMultipleInstances: true,
numberOfImagesToPreload : 5,
outlineWhileAnimating : 2, // 0 = never, 1 = always, 2 = HTML only
outlineStartOffset : 3, // ends at 10
padToMinWidth : false, // pad the popup width to make room for wide caption
fullExpandPosition : 'bottom right',
fullExpandOpacity : 1,
showCredits : true, // you can set this to false if you want
creditsHref : 'http://highslide.com/',
enableKeyListener : true,
openerTagNames : ['a'], // Add more to allow slideshow indexing

dragByHeading: true,
minWidth: 200,
minHeight: 200,
allowSizeReduction: true, // allow the image to reduce to fit client size. If false, this overrides minWidth and minHeight
outlineType : 'drop-shadow', // set null to disable outlines
wrapperClassName : 'highslide-wrapper', // for enhanced css-control
// END OF YOUR SETTINGS


// declare internal properties
preloadTheseImages : [],
continuePreloading: true,
expanders : [],
overrides : [
    'allowSizeReduction',
    'useBox',
    'outlineType',
    'outlineWhileAnimating',
    'captionId',
    'captionText',
    'captionEval',
    'captionOverlay',
    'headingId',
    'headingText',
    'headingEval',
    'headingOverlay',
    'dragByHeading',

    'width',
    'height',

    'wrapperClassName',
    'minWidth',
    'minHeight',
    'maxWidth',
    'maxHeight',
    'slideshowGroup',
    'easing',
    'easingClose',
    'fadeInOut',
    'src'
],
overlays : [],
idCounter : 0,
oPos : {
    x: ['leftpanel', 'left', 'center', 'right', 'rightpanel'],
    y: ['above', 'top', 'middle', 'bottom', 'below']
},
mouse: {},
headingOverlay: {},
captionOverlay: {},
timers : [],

pendingOutlines : {},
clones : {},
uaVersion: parseFloat((navigator.userAgent.toLowerCase().match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [0,'0'])[1]),
ie : (document.all && !window.opera),
safari : /Safari/.test(navigator.userAgent),
geckoMac : /Macintosh.+rv:1\.[0-8].+Gecko/.test(navigator.userAgent),

$ : function (id) {
    if (id) return document.getElementById(id);
},

push : function (arr, val) {
    arr[arr.length] = val;
},

createElement : function (tag, attribs, styles, parent, nopad) {
    var el = document.createElement(tag);
    if (attribs) hs.extend(el, attribs);
    if (nopad) hs.setStyles(el, {padding: 0, border: 'none', margin: 0});
    if (styles) hs.setStyles(el, styles);
    if (parent) parent.appendChild(el);
    return el;
},

extend : function (el, attribs) {
    for (var x in attribs) el[x] = attribs[x];
    return el;
},

setStyles : function (el, styles) {
    for (var x in styles) {
        if (hs.ie && x == 'opacity') {
            if (styles[x] > 0.99) el.style.removeAttribute('filter');
            else el.style.filter = 'alpha(opacity='+ (styles[x] * 100) +')';
        }
        else el.style[x] = styles[x];
    }
},
animate: function(el, prop, dur, easing, callback) {
    var rate = 25,
        from = {},
        to = {},
        units = {},
        timers = hs.timers,
        timer = [],
        step;
    if (typeof dur == 'object' && dur != null) {
        easing = dur.easing;
        callback = dur.callback;
        step = dur.step;
        dur = dur.duration;
    }

    if (typeof dur != 'number') dur = 250;
    dur = Math.floor(dur / rate) * rate + rate;
    easing = Math[easing] || Math.easeInQuad;
    for (var x in prop) {
        from[x] = parseFloat(hs.css(el, x)) || 0;
        to[x] = parseFloat(prop[x]);
        units[x] = x != 'opacity' ? 'px' : '';
    }
    for (var time = rate; time <= dur; time += rate) {
        (function(){
            var inter = {}, steps = [];

            for (var x in prop) {
                inter[x] = easing(time, from[x], to[x] - from[x], dur);
                if (isNaN(inter[x])) inter[x] = to[x];
                if (units[x]) inter[x] = Math.round(inter[x]);
                if (step) (function() {
                    var val = inter[x],
                        pX = x;
                    hs.push(steps, function() {
                        step(val, { prop: pX } )
                    });
                })();
                inter[x] += units[x];

            }
            timer.push(function() {
                hs.setStyles(el, inter);
                if (steps) for (var i = 0; i < steps.length; i++) steps[i]();
            });
        })();
    }
    for (var i = 0; i < timers.length; i++) {
        if (timers[i].el == el) {
            timers.splice(i--, 1);
        }
    }
    timer.el = el;
    timer.callback = callback;
    timer.shift()();
    if (timer.length) timers.push(timer);
    else if (callback) callback();
    if (hs.timerId == null) {
        hs.timerId = setInterval( function() {
            for ( var i = 0; i < timers.length; i++ ) {
                timers[i].shift()();
                if (!timers[i].length) {
                    if (timers[i].callback) timers[i].callback();
                    timers.splice(i--, 1);
                }
            }

            if ( !timers.length ) {
                clearInterval( hs.timerId );
                hs.timerId = null;
            }
        }, rate);
    }
},
css: function(el, prop) {
    if (document.defaultView) {
        return document.defaultView.getComputedStyle(el, null).getPropertyValue(prop);

    } else {
        if (prop == 'opacity') prop = 'filter';
        var val = el.currentStyle[prop.replace(/\-(\w)/g, function (a, b){ return b.toUpperCase(); })];
        if (prop == 'filter')
            val = val.replace(/alpha\(opacity=([0-9]+)\)/,
                function (a, b) { return b / 100 });
        return val === '' ? 1 : val;
    }
},

getPageSize : function () {
    var d = document, w = window, iebody = d.compatMode && d.compatMode != 'BackCompat'
        ? d.documentElement : d.body;

    var width = hs.ie ? iebody.clientWidth :
            (d.documentElement.clientWidth || self.innerWidth),
        height = hs.ie ? iebody.clientHeight : self.innerHeight;

    return {
        width: width,
        height: height,
        scrollLeft: hs.ie ? iebody.scrollLeft : pageXOffset,
        scrollTop: hs.ie ? iebody.scrollTop : pageYOffset
    }
},

getPosition : function(el)  {
    var p = { x: el.offsetLeft, y: el.offsetTop };
    while (el.offsetParent) {
        el = el.offsetParent;
        p.x += el.offsetLeft;
        p.y += el.offsetTop;
        if (el != document.body && el != document.documentElement) {
            p.x -= el.scrollLeft;
            p.y -= el.scrollTop;
        }
    }
    return p;
},

expand : function(a, params, custom, type) {
    if (!a) a = hs.createElement('a', null, { display: 'none' }, hs.container);
    if (typeof a.getParams == 'function') return params;
    try {
        new hs.Expander(a, params, custom);
        return false;
    } catch (e) { return true; }
},


focusTopmost : function() {
    var topZ = 0,
        topmostKey = -1,
        expanders = hs.expanders,
        exp,
        zIndex;
    for (var i = 0; i < expanders.length; i++) {
        exp = expanders[i];
        if (exp) {
            zIndex = exp.wrapper.style.zIndex;
            if (zIndex && zIndex > topZ) {
                topZ = zIndex;
                topmostKey = i;
            }
        }
    }
    if (topmostKey == -1) hs.focusKey = -1;
    else expanders[topmostKey].focus();
},

getParam : function (a, param) {
    a.getParams = a.onclick;
    var p = a.getParams ? a.getParams() : null;
    a.getParams = null;

    return (p && typeof p[param] != 'undefined') ? p[param] :
        (typeof hs[param] != 'undefined' ? hs[param] : null);
},

getSrc : function (a) {
    var src = hs.getParam(a, 'src');
    if (src) return src;
    return a.href;
},

getNode : function (id) {
    var node = hs.$(id), clone = hs.clones[id], a = {};
    if (!node && !clone) return null;
    if (!clone) {
        clone = node.cloneNode(true);
        clone.id = '';
        hs.clones[id] = clone;
        return node;
    } else {
        return clone.cloneNode(true);
    }
},

discardElement : function(d) {
    hs.garbageBin.appendChild(d);
    hs.garbageBin.innerHTML = '';
},
transit : function (adj, exp) {
    var last = exp = exp || hs.getExpander();
    if (hs.upcoming) return false;
    else hs.last = last;
    try {
        hs.upcoming = adj;
        adj.onclick();
    } catch (e){
        hs.last = hs.upcoming = null;
    }
    try {
        exp.close();
    } catch (e) {}
    return false;
},

previousOrNext : function (el, op) {
    var exp = hs.getExpander(el);
    if (exp) {
        adj = exp.getAdjacentAnchor(op);
        return hs.transit(adj, exp);
    } else return false;
},

previous : function (el) {
    return hs.previousOrNext(el, -1);
},

next : function (el) {
    return hs.previousOrNext(el, 1);
},

keyHandler : function(e) {
    if (!e) e = window.event;
    if (!e.target) e.target = e.srcElement; // ie
    if (typeof e.target.form != 'undefined') return true; // form element has focus
    var exp = hs.getExpander();

    var op = null;
    switch (e.keyCode) {
        case 70: // f
            if (exp) exp.doFullExpand();
            return true;
        case 32: // Space
        case 34: // Page Down
        case 39: // Arrow right
        case 40: // Arrow down
            op = 1;
            break;
        case 8:  // Backspace
        case 33: // Page Up
        case 37: // Arrow left
        case 38: // Arrow up
            op = -1;
            break;
        case 27: // Escape
        case 13: // Enter
            op = 0;
    }
    if (op !== null) {hs.removeEventListener(document, window.opera ? 'keypress' : 'keydown', hs.keyHandler);
        if (!hs.enableKeyListener) return true;

        if (e.preventDefault) e.preventDefault();
        else e.returnValue = false;
        if (exp) {
            if (op == 0) {
                exp.close();
            } else {
                hs.previousOrNext(exp.key, op);
            }
            return false;
        }
    }
    return true;
},


registerOverlay : function (overlay) {
    hs.push(hs.overlays, overlay);
},


getWrapperKey : function (element, expOnly) {
    var el, re = /^highslide-wrapper-([0-9]+)$/;
    // 1. look in open expanders
    el = element;
    while (el.parentNode)   {
        if (el.id && re.test(el.id)) return el.id.replace(re, "$1");
        el = el.parentNode;
    }
    // 2. look in thumbnail
    if (!expOnly) {
        el = element;
        while (el.parentNode)   {
            if (el.tagName && hs.isHsAnchor(el)) {
                for (var key = 0; key < hs.expanders.length; key++) {
                    var exp = hs.expanders[key];
                    if (exp && exp.a == el) return key;
                }
            }
            el = el.parentNode;
        }
    }
    return null;
},

getExpander : function (el, expOnly) {
    if (typeof el == 'undefined') return hs.expanders[hs.focusKey] || null;
    if (typeof el == 'number') return hs.expanders[el] || null;
    if (typeof el == 'string') el = hs.$(el);
    return hs.expanders[hs.getWrapperKey(el, expOnly)] || null;
},

isHsAnchor : function (a) {
    return (a.onclick && a.onclick.toString().replace(/\s/g, ' ').match(/hs.(htmlE|e)xpand/));
},

reOrder : function () {
    for (var i = 0; i < hs.expanders.length; i++)
        if (hs.expanders[i] && hs.expanders[i].isExpanded) hs.focusTopmost();
},

mouseClickHandler : function(e)
{
    if (!e) e = window.event;
    if (e.button > 1) return true;
    if (!e.target) e.target = e.srcElement;

    var el = e.target;
    while (el.parentNode
        && !(/highslide-(image|move|html|resize)/.test(el.className)))
    {
        el = el.parentNode;
    }
    var exp = hs.getExpander(el);
    if (exp && (exp.isClosing || !exp.isExpanded)) return true;

    if (exp && e.type == 'mousedown') {
        if (e.target.form) return true;
        var match = el.className.match(/highslide-(image|move|resize)/);
        if (match) {
            hs.dragArgs = { exp: exp , type: match[1], left: exp.x.pos, width: exp.x.size, top: exp.y.pos,
                height: exp.y.size, clickX: e.clientX, clickY: e.clientY };


            hs.addEventListener(document, 'mousemove', hs.dragHandler);
            if (e.preventDefault) e.preventDefault(); // FF

            if (/highslide-(image|html)-blur/.test(exp.content.className)) {
                exp.focus();
                hs.hasFocused = true;
            }
            return false;
        }
    } else if (e.type == 'mouseup') {

        hs.removeEventListener(document, 'mousemove', hs.dragHandler);

        if (hs.dragArgs) {
            if (hs.styleRestoreCursor && hs.dragArgs.type == 'image')
                hs.dragArgs.exp.content.style.cursor = hs.styleRestoreCursor;
            var hasDragged = hs.dragArgs.hasDragged;

            if (!hasDragged &&!hs.hasFocused && !/(move|resize)/.test(hs.dragArgs.type)) {
                exp.close();
            }
            else if (hasDragged || (!hasDragged && hs.hasHtmlExpanders)) {
                hs.dragArgs.exp.doShowHide('hidden');
            }

            hs.hasFocused = false;
            hs.dragArgs = null;

        } else if (/highslide-image-blur/.test(el.className)) {
            el.style.cursor = hs.styleRestoreCursor;
        }
    }
    return false;
},

dragHandler : function(e)
{
    if (!hs.dragArgs) return true;
    if (!e) e = window.event;
    var a = hs.dragArgs, exp = a.exp;

    a.dX = e.clientX - a.clickX;
    a.dY = e.clientY - a.clickY;

    var distance = Math.sqrt(Math.pow(a.dX, 2) + Math.pow(a.dY, 2));
    if (!a.hasDragged) a.hasDragged = (a.type != 'image' && distance > 0)
        || (distance > (hs.dragSensitivity || 5));

    if (a.hasDragged && e.clientX > 5 && e.clientY > 5) {

        if (a.type == 'resize') exp.resize(a);
        else {
            exp.moveTo(a.left + a.dX, a.top + a.dY);
            if (a.type == 'image') exp.content.style.cursor = 'move';
        }
    }
    return false;
},

wrapperMouseHandler : function (e) {
    try {
        if (!e) e = window.event;
        var over = /mouseover/i.test(e.type);
        if (!e.target) e.target = e.srcElement; // ie
        if (hs.ie) e.relatedTarget =
            over ? e.fromElement : e.toElement; // ie
        var exp = hs.getExpander(e.target);
        if (!exp.isExpanded) return;
        if (!exp || !e.relatedTarget || hs.getExpander(e.relatedTarget, true) == exp
            || hs.dragArgs) return;
        for (var i = 0; i < exp.overlays.length; i++) (function() {
            var o = hs.$('hsId'+ exp.overlays[i]);
            if (o && o.hideOnMouseOut) {
                if (over) hs.setStyles(o, { visibility: 'visible' });
                hs.animate(o, { opacity: over ? o.opacity : 0 }, o.dur, null,
                    over ? null : function() { hs.setStyles(o, { visibility: 'hidden' })});
            }
        })();
    } catch (e) {}
},
addEventListener : function (el, event, func) {
    try {
        el.addEventListener(event, func, false);
    } catch (e) {
        try {
            el.detachEvent('on'+ event, func);
            el.attachEvent('on'+ event, func);
        } catch (e) {
            el['on'+ event] = func;
        }
    }
},

removeEventListener : function (el, event, func) {
    try {
        el.removeEventListener(event, func, false);
    } catch (e) {
        try {
            el.detachEvent('on'+ event, func);
        } catch (e) {
            el['on'+ event] = null;
        }
    }
},

preloadFullImage : function (i) {
    if (hs.continuePreloading && hs.preloadTheseImages[i] && hs.preloadTheseImages[i] != 'undefined') {
        var img = document.createElement('img');
        img.onload = function() {
            img = null;
            hs.preloadFullImage(i + 1);
        };
        img.src = hs.preloadTheseImages[i];
    }
},
preloadImages : function (number) {
    if (number && typeof number != 'object') hs.numberOfImagesToPreload = number;

    var arr = hs.getAnchors();
    for (var i = 0; i < arr.images.length && i < hs.numberOfImagesToPreload; i++) {
        hs.push(hs.preloadTheseImages, hs.getSrc(arr.images[i]));
    }

    // preload outlines
    if (hs.outlineType) new hs.Outline(hs.outlineType, function () { hs.preloadFullImage(0)} );
    else

    hs.preloadFullImage(0);

    // preload cursor
    if (hs.restoreCursor) var cur = hs.createElement('img', { src: hs.graphicsDir + hs.restoreCursor });
},


init : function () {
    if (!hs.container) {

        hs.page = hs.getPageSize();
        hs.ieLt7 = hs.ie && hs.uaVersion < 7;
        for (var x in hs.langDefaults) {
            if (typeof hs[x] != 'undefined') hs.lang[x] = hs[x];
            else if (typeof hs.lang[x] == 'undefined' && typeof hs.langDefaults[x] != 'undefined')
                hs.lang[x] = hs.langDefaults[x];
        }

        hs.container = hs.createElement('div', {
                className: 'highslide-container'
            }, {
                position: 'absolute',
                left: 0,
                top: 0,
                width: '100%',
                zIndex: hs.zIndexCounter,
                direction: 'ltr'
            },
            document.body,
            true
        );
        hs.loading = hs.createElement('a', {
                className: 'highslide-loading',
                title: hs.lang.loadingTitle,
                innerHTML: hs.lang.loadingText,
                href: 'javascript:;'
            }, {
                position: 'absolute',
                top: '-9999px',
                opacity: hs.loadingOpacity,
                zIndex: 1
            }, hs.container
        );
        hs.garbageBin = hs.createElement('div', null, { display: 'none' }, hs.container);

        // http://www.robertpenner.com/easing/
        Math.linearTween = function (t, b, c, d) {
            return c*t/d + b;
        };
        Math.easeInQuad = function (t, b, c, d) {
            return c*(t/=d)*t + b;
        };

        hs.hideSelects = hs.ieLt7;
        hs.hideIframes = ((window.opera && hs.uaVersion < 9) || navigator.vendor == 'KDE'
            || (hs.ie && hs.uaVersion < 5.5));
    }
},
domReady : function() {
    hs.isDomReady = true;
    if (hs.onDomReady) hs.onDomReady();
},

updateAnchors : function() {
    var el, els, all = [], images = [],groups = {}, re;

    for (var i = 0; i < hs.openerTagNames.length; i++) {
        els = document.getElementsByTagName(hs.openerTagNames[i]);
        for (var j = 0; j < els.length; j++) {
            el = els[j];
            re = hs.isHsAnchor(el);
            if (re) {
                hs.push(all, el);
                if (re[0] == 'hs.expand') hs.push(images, el);
                var g = hs.getParam(el, 'slideshowGroup') || 'none';
                if (!groups[g]) groups[g] = [];
                hs.push(groups[g], el);
            }
        }
    }
    hs.anchors = { all: all, groups: groups, images: images };
    return hs.anchors;

},

getAnchors : function() {
    return hs.anchors || hs.updateAnchors();
},


close : function(el) {
    var exp = hs.getExpander(el);
    if (exp) exp.close();
    return false;
}
}; // end hs object


hs.Outline =  function (outlineType, onLoad) {
    this.onLoad = onLoad;
    this.outlineType = outlineType;
    var v = hs.uaVersion, tr;

    this.hasAlphaImageLoader = hs.ie && v >= 5.5 && v < 7;
    if (!outlineType) {
        if (onLoad) onLoad();
        return;
    }

    hs.init();
    this.table = hs.createElement(
        'table', {
            cellSpacing: 0
        }, {
            visibility: 'hidden',
            position: 'absolute',
            borderCollapse: 'collapse',
            width: 0
        },
        hs.container,
        true
    );
    var tbody = hs.createElement('tbody', null, null, this.table, 1);

    this.td = [];
    for (var i = 0; i <= 8; i++) {
        if (i % 3 == 0) tr = hs.createElement('tr', null, { height: 'auto' }, tbody, true);
        this.td[i] = hs.createElement('td', null, null, tr, true);
        var style = i != 4 ? { lineHeight: 0, fontSize: 0} : { position : 'relative' };
        hs.setStyles(this.td[i], style);
    }
    this.td[4].className = outlineType +' highslide-outline';

    this.preloadGraphic();
};

hs.Outline.prototype = {
preloadGraphic : function () {
    var src = hs.graphicsDir + (hs.outlinesDir || "outlines/")+ this.outlineType +".png";

    var appendTo = hs.safari ? hs.container : null;
    this.graphic = hs.createElement('img', null, { position: 'absolute',
        top: '-9999px' }, appendTo, true); // for onload trigger

    var pThis = this;
    this.graphic.onload = function() { pThis.onGraphicLoad(); };

    this.graphic.src = src;
},

onGraphicLoad : function () {
    var o = this.offset = this.graphic.width / 4,
        pos = [[0,0],[0,-4],[-2,0],[0,-8],0,[-2,-8],[0,-2],[0,-6],[-2,-2]],
        dim = { height: (2*o) +'px', width: (2*o) +'px' };
    for (var i = 0; i <= 8; i++) {
        if (pos[i]) {
            if (this.hasAlphaImageLoader) {
                var w = (i == 1 || i == 7) ? '100%' : this.graphic.width +'px';
                var div = hs.createElement('div', null, { width: '100%', height: '100%', position: 'relative', overflow: 'hidden'}, this.td[i], true);
                hs.createElement ('div', null, {
                        filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale, src='"+ this.graphic.src + "')",
                        position: 'absolute',
                        width: w,
                        height: this.graphic.height +'px',
                        left: (pos[i][0]*o)+'px',
                        top: (pos[i][1]*o)+'px'
                    },
                div,
                true);
            } else {
                hs.setStyles(this.td[i], { background: 'url('+ this.graphic.src +') '+ (pos[i][0]*o)+'px '+(pos[i][1]*o)+'px'});
            }

            if (window.opera && (i == 3 || i ==5))
                hs.createElement('div', null, dim, this.td[i], true);

            hs.setStyles (this.td[i], dim);
        }
    }
    this.graphic = null;
    if (hs.pendingOutlines[this.outlineType]) hs.pendingOutlines[this.outlineType].destroy();
    hs.pendingOutlines[this.outlineType] = this;
    if (this.onLoad) this.onLoad();
},

setPosition : function (parse, offset, vis, dur, easing) {
    var exp = this.exp,
        stl = exp.wrapper.style,
        offset = offset || 0,
        pos = parse ? {
            x: parseInt(stl.left),
            y: parseInt(stl.top),
            w: parseInt(stl.width),
            h: parseInt(stl.height)
        } : {
            x: exp.x.pos + offset,
            y: exp.y.pos + offset,
            w: exp.x.get('wsize') - 2 * offset,
            h: exp.y.get('wsize') - 2 * offset
        };
    if (vis) this.table.style.visibility = (pos.h >= 4 * this.offset)
        ? 'visible' : 'hidden';
    hs.setStyles(this.table, {
        left: (pos.x - this.offset) +'px',
        top: (pos.y - this.offset) +'px',
        width: (pos.w + 2 * this.offset) +'px'
    });

    pos.w -= 2 * this.offset;
    pos.h -= 2 * this.offset;
    hs.setStyles (this.td[4], {
        width: pos.w >= 0 ? pos.w +'px' : 0,
        height: pos.h >= 0 ? pos.h +'px' : 0
    });
    if (this.hasAlphaImageLoader) this.td[3].style.height
        = this.td[5].style.height = this.td[4].style.height;

},

destroy : function(hide) {
    if (hide) this.table.style.visibility = 'hidden';
    else hs.discardElement(this.table);
}
};

hs.Dimension = function(exp, dim) {
    this.exp = exp;
    this.dim = dim;
    this.ucwh = dim == 'x' ? 'Width' : 'Height';
    this.wh = this.ucwh.toLowerCase();
    this.uclt = dim == 'x' ? 'Left' : 'Top';
    this.lt = this.uclt.toLowerCase();
    this.ucrb = dim == 'x' ? 'Right' : 'Bottom';
    this.rb = this.ucrb.toLowerCase();
    this.p1 = this.p2 = 0;
};
hs.Dimension.prototype = {
get : function(key) {
    switch (key) {
        case 'loadingPos':
            return this.tpos + this.tb + (this.t - hs.loading['offset'+ this.ucwh]) / 2;
        case 'wsize':
            return this.size + 2 * this.cb + this.p1 + this.p2;
        case 'fitsize':
            return this.clientSize - this.marginMin - this.marginMax;
        case 'opos':
            return this.pos - (this.exp.outline ? this.exp.outline.offset : 0);
        case 'osize':
            return this.get('wsize') + (this.exp.outline ? 2*this.exp.outline.offset : 0);
        case 'imgPad':
            return this.imgSize ? Math.round((this.size - this.imgSize) / 2) : 0;

    }
},
calcBorders: function() {
    // correct for borders
    this.cb = (this.exp.content['offset'+ this.ucwh] - this.t) / 2;
    this.marginMax = hs['margin'+ this.ucrb] + 2 * this.cb;
},
calcThumb: function() {
    this.t = this.exp.el[this.wh] ? parseInt(this.exp.el[this.wh]) :
        this.exp.el['offset'+ this.ucwh];
    this.tpos = this.exp.tpos[this.dim];
    this.tb = (this.exp.el['offset'+ this.ucwh] - this.t) / 2;
    if (this.tpos == 0) {
        this.tpos = (hs.page[this.wh] / 2) + hs.page['scroll'+ this.uclt];
    };
},
calcExpanded: function() {
    var exp = this.exp;
    this.justify = 'auto';


    // size and position
    this.pos = this.tpos - this.cb + this.tb;
    this.size = Math.min(this.full, exp['max'+ this.ucwh] || this.full);
    this.minSize = exp.allowSizeReduction ?
        Math.min(exp['min'+ this.ucwh], this.full) :this.full;
    if (exp.isImage && exp.useBox)  {
        this.size = exp[this.wh];
        this.imgSize = this.full;
    }
    if (this.dim == 'x' && hs.padToMinWidth) this.minSize = exp.minWidth;
    this.marginMin = hs['margin'+ this.uclt];
    this.scroll = hs.page['scroll'+ this.uclt];
    this.clientSize = hs.page[this.wh];
},
setSize: function(i) {
    var exp = this.exp;
    if (exp.isImage && (exp.useBox || hs.padToMinWidth)) {
        this.imgSize = i;
        this.size = Math.max(this.size, this.imgSize);
        exp.content.style[this.lt] = this.get('imgPad')+'px';
    } else
    this.size = i;

    exp.content.style[this.wh] = i +'px';
    exp.wrapper.style[this.wh] = this.get('wsize') +'px';
    if (exp.outline) exp.outline.setPosition();
    if (this.dim == 'x' && exp.overlayBox) exp.sizeOverlayBox(true);
},
setPos: function(i) {
    this.pos = i;
    this.exp.wrapper.style[this.lt] = i +'px';

    if (this.exp.outline) this.exp.outline.setPosition();

}
};

hs.Expander = function(a, params, custom, contentType) {
    if (document.readyState && hs.ie && !hs.isDomReady) {
        hs.onDomReady = function() {
            new hs.Expander(a, params, custom, contentType);
        };
        return;
    }
    this.a = a;
    this.custom = custom;
    this.contentType = contentType || 'image';
    this.isImage = !this.isHtml;

    hs.continuePreloading = false;
    this.overlays = [];
    hs.init();
    var key = this.key = hs.expanders.length;

    // override inline parameters
    for (var i = 0; i < hs.overrides.length; i++) {
        var name = hs.overrides[i];
        this[name] = params && typeof params[name] != 'undefined' ?
            params[name] : hs[name];
    }
    
    if (!this.src) this.src = a.href;

    // get thumb
    var el = (params && params.thumbnailId) ? hs.$(params.thumbnailId) : a;
    el = this.thumb = el.getElementsByTagName('img')[0] || el;
    this.thumbsUserSetId = el.id || a.id;

    // check if already open
    for (var i = 0; i < hs.expanders.length; i++) {
        if (hs.expanders[i] && hs.expanders[i].a == a) {
            hs.expanders[i].focus();
            return false;
        }
    }

    // cancel other
    for (var i = 0; i < hs.expanders.length; i++) {
        if (hs.expanders[i] && hs.expanders[i].thumb != el && !hs.expanders[i].onLoadStarted) {
            hs.expanders[i].cancelLoading();
        }
    }
    hs.expanders[this.key] = this;
    if (!hs.allowMultipleInstances && !hs.upcoming) {
        if (hs.expanders[key-1]) hs.expanders[key-1].close();
        if (typeof hs.focusKey != 'undefined' && hs.expanders[hs.focusKey])
            hs.expanders[hs.focusKey].close();
    }

    // initiate metrics
    this.el = el;
    this.tpos = hs.getPosition(el);
    hs.page = hs.getPageSize();
    var x = this.x = new hs.Dimension(this, 'x');
    x.calcThumb();
    var y = this.y = new hs.Dimension(this, 'y');
    y.calcThumb();
    this.wrapper = hs.createElement(
        'div', {
            id: 'highslide-wrapper-'+ this.key,
            className: this.wrapperClassName
        }, {
            visibility: 'hidden',
            position: 'absolute',
            zIndex: hs.zIndexCounter++
        }, null, true );

    this.wrapper.onmouseover = this.wrapper.onmouseout = hs.wrapperMouseHandler;
    if (this.contentType == 'image' && this.outlineWhileAnimating == 2)
        this.outlineWhileAnimating = 0;

    // get the outline
    if (!this.outlineType) {
        this[this.contentType +'Create']();

    } else if (hs.pendingOutlines[this.outlineType]) {
        this.connectOutline();
        this[this.contentType +'Create']();

    } else {
        this.showLoading();
        var exp = this;
        new hs.Outline(this.outlineType,
            function () {
                exp.connectOutline();
                exp[exp.contentType +'Create']();
            }
        );
    }
    return true;
};

hs.Expander.prototype = {
error : function(e) {
    // alert ('Line '+ e.lineNumber +': '+ e.message);
    window.location.href = this.src;
},

connectOutline : function() {
    var outline = this.outline = hs.pendingOutlines[this.outlineType];
    outline.exp = this;
    outline.table.style.zIndex = this.wrapper.style.zIndex;
    hs.pendingOutlines[this.outlineType] = null;
},

showLoading : function() {
    if (this.onLoadStarted || this.loading) return;

    this.loading = hs.loading;
    var exp = this;
    this.loading.onclick = function() {
        exp.cancelLoading();
    };
    var exp = this,
        l = this.x.get('loadingPos') +'px',
        t = this.y.get('loadingPos') +'px';
    setTimeout(function () {
        if (exp.loading) hs.setStyles(exp.loading, { left: l, top: t, zIndex: hs.zIndexCounter++ })}
    , 100);
},

imageCreate : function() {
    var exp = this;

    var img = document.createElement('img');
    this.content = img;
    img.onload = function () {
        if (hs.expanders[exp.key]) exp.contentLoaded();
    };
    if (hs.blockRightClick) img.oncontextmenu = function() { return false; };
    img.className = 'highslide-image';
    hs.setStyles(img, {
        visibility: 'hidden',
        display: 'block',
        position: 'absolute',
        maxWidth: '9999px',
        zIndex: 3
    });
    img.title = hs.lang.restoreTitle;
    if (hs.safari) hs.container.appendChild(img);
    if (hs.ie && hs.flushImgSize) img.src = null;
    img.src = this.src;

    this.showLoading();
},

contentLoaded : function() {
    try {
        if (!this.content) return;
        this.content.onload = null;
        if (this.onLoadStarted) return;
        else this.onLoadStarted = true;

        var x = this.x, y = this.y;

        if (this.loading) {
            hs.setStyles(this.loading, { top: '-9999px' });
            this.loading = null;
        }
            x.full = this.content.width;
            y.full = this.content.height;

            hs.setStyles(this.content, {
                width: x.t +'px',
                height: y.t +'px'
            });
            this.wrapper.appendChild(this.content);
            hs.container.appendChild(this.wrapper);

        x.calcBorders();
        y.calcBorders();

        hs.setStyles (this.wrapper, {
            left: (x.tpos + x.tb - x.cb) +'px',
            top: (y.tpos + x.tb - y.cb) +'px'
        });
        this.getOverlays();

        var ratio = x.full / y.full;

        x.calcExpanded();
        this.justify(x);

        y.calcExpanded();
        this.justify(y);
        if (this.overlayBox) this.sizeOverlayBox(0, 1);

        if (this.allowSizeReduction) {
                this.correctRatio(ratio);
            if (this.isImage && this.x.full > (this.x.imgSize || this.x.size)) {
                this.createFullExpand();
                if (this.overlays.length == 1) this.sizeOverlayBox();
            }
        }
        this.show();

    } catch (e) {
        this.error(e);
    }
},

justify : function (p, moveOnly) {
    var tgtArr, tgt = p.target, dim = p == this.x ? 'x' : 'y';

        var hasMovedMin = false;

        var allowReduce = p.exp.allowSizeReduction;
            p.pos = Math.round(p.pos - ((p.get('wsize') - p.t) / 2));
        if (p.pos < p.scroll + p.marginMin) {
            p.pos = p.scroll + p.marginMin;
            hasMovedMin = true;
        }
        if (!moveOnly && p.size < p.minSize) {
            p.size = p.minSize;
            allowReduce = false;
        }
        if (p.pos + p.get('wsize') > p.scroll + p.clientSize - p.marginMax) {
            if (!moveOnly && hasMovedMin && allowReduce) {
                p.size = p.get('fitsize'); // can't expand more
            } else if (p.get('wsize') < p.get('fitsize')) {
                p.pos = p.scroll + p.clientSize - p.marginMax - p.get('wsize');
            } else { // image larger than viewport
                p.pos = p.scroll + p.marginMin;
                if (!moveOnly && allowReduce) p.size = p.get('fitsize');
            }
        }

        if (!moveOnly && p.size < p.minSize) {
            p.size = p.minSize;
            allowReduce = false;
        }



    if (p.pos < p.marginMin) {
        var tmpMin = p.pos;
        p.pos = p.marginMin;

        if (allowReduce && !moveOnly) p.size = p.size - (p.pos - tmpMin);

    }
},

correctRatio : function(ratio) {
    var x = this.x,
        y = this.y,
        changed = false,
        xSize = Math.min(x.full, x.size),
        ySize = Math.min(y.full, y.size),
        useBox = (this.useBox || hs.padToMinWidth);

    if (xSize / ySize > ratio) { // width greater
        xSize = ySize * ratio;
        if (xSize < x.minSize) { // below minWidth
            xSize = x.minSize;
            ySize = xSize / ratio;
        }
        changed = true;

    } else if (xSize / ySize < ratio) { // height greater
        ySize = xSize / ratio;
        changed = true;
    }

    if (hs.padToMinWidth && x.full < x.minSize) {
        x.imgSize = x.full;
        y.size = y.imgSize = y.full;
    } else if (this.useBox) {
        x.imgSize = xSize;
        y.imgSize = ySize;
    } else {
        x.size = xSize;
        y.size = ySize;
    }
    this.fitOverlayBox(useBox ? null : ratio);
    if (useBox && y.size < y.imgSize) {
        y.imgSize = y.size;
        x.imgSize = y.size * ratio;
    }
    if (changed || useBox) {
        x.pos = x.tpos - x.cb + x.tb;
        x.minSize = x.size;
        this.justify(x, true);

        y.pos = y.tpos - y.cb + y.tb;
        y.minSize = y.size;
        this.justify(y, true);
        if (this.overlayBox) this.sizeOverlayBox();
    }
},
fitOverlayBox : function(ratio) {
    var x = this.x, y = this.y;
    if (this.overlayBox) {
        while (y.size > this.minHeight && x.size > this.minWidth
                &&  y.get('wsize') > y.get('fitsize')) {
            y.size -= 10;
            if (ratio) x.size = y.size * ratio;
            this.sizeOverlayBox(0, 1);
        }
    }
},

show : function () {
    var x = this.x, y = this.y;
    this.doShowHide('hidden');

    // Apply size change
    this.changeSize(
        1, {
            wrapper: {
                width : x.get('wsize'),
                height : y.get('wsize'),
                left: x.pos,
                top: y.pos
            },
            content: {
                left: x.p1 + x.get('imgPad'),
                top: y.p1 + y.get('imgPad'),
                width:x.imgSize ||x.size,
                height:y.imgSize ||y.size
            }
        },
        hs.expandDuration
    );
},

changeSize : function(up, to, dur) {

    if (this.outline && !this.outlineWhileAnimating) {
        if (up) this.outline.setPosition();
        else this.outline.destroy();
    }


    if (!up) this.destroyOverlays();

    var exp = this,
        x = exp.x,
        y = exp.y,
        easing = this.easing;
    if (!up) easing = this.easingClose || easing;
    var after = up ?
        function() {

            if (exp.outline) exp.outline.table.style.visibility = "visible";
            setTimeout(function() {
                exp.afterExpand();
            }, 50);
        } :
        function() {
            exp.afterClose();
        };
    if (up) hs.setStyles( this.wrapper, {
        width: x.t +'px',
        height: y.t +'px'
    });
    if (this.fadeInOut) {
        hs.setStyles(this.wrapper, { opacity: up ? 0 : 1 });
        hs.extend(to.wrapper, { opacity: up });
    }
    if (this.outline && this.outlineWhileAnimating) {
        var wrapStep =  function(val, args) {
            if (args.prop == 'height') exp.outline.setPosition(1, 0, 1);
        }
    }
    hs.animate( this.wrapper, to.wrapper, {
        duration: dur,
        easing: easing,
        step: wrapStep
    });
    hs.animate( this.content, to.content, dur, easing, after);
    if (up) {
        this.wrapper.style.visibility = 'visible';
        this.content.style.visibility = 'visible';
        this.a.className += ' highslide-active-anchor';
    }
},




afterExpand : function() {
    this.isExpanded = true;
    this.focus();
    if (hs.upcoming && hs.upcoming == this.a) hs.upcoming = null;
    this.prepareNextOutline();
    var p = hs.page, mX = hs.mouse.x + p.scrollLeft, mY = hs.mouse.y + p.scrollTop;
    this.mouseIsOver = this.x.pos < mX && mX < this.x.pos + this.x.get('wsize')
        && this.y.pos < mY && mY < this.y.pos + this.y.get('wsize');
    if (this.overlayBox) this.showOverlays();

},


prepareNextOutline : function() {
    var key = this.key;
    var outlineType = this.outlineType;
    new hs.Outline(outlineType,
        function () { try { hs.expanders[key].preloadNext(); } catch (e) {} });
},


preloadNext : function() {
    var next = this.getAdjacentAnchor(1);
    if (next && next.onclick.toString().match(/hs\.expand/))
        var img = hs.createElement('img', { src: hs.getSrc(next) });
},


getAdjacentAnchor : function(op) {
    var current = this.getAnchorIndex(), as = hs.anchors.groups[this.slideshowGroup || 'none'];

    /*< ? if ($cfg->slideshow) : ?>s*/
    if (!as[current + op] && this.slideshow && this.slideshow.repeat) {
        if (op == 1) return as[0];
        else if (op == -1) return as[as.length-1];
    }
    /*< ? endif ?>s*/
    return as[current + op] || null;
},

getAnchorIndex : function() {
    var arr = hs.getAnchors().groups[this.slideshowGroup || 'none'];
    for (var i = 0; i < arr.length; i++) {
        if (arr[i] == this.a) return i;
    }
    return null;
},


cancelLoading : function() {
    hs.expanders[this.key] = null;
    if (this.loading) hs.loading.style.left = '-9999px';
},

writeCredits : function () {
    this.credits = hs.createElement('a', {
        href: hs.creditsHref,
        className: 'highslide-credits',
        innerHTML: hs.lang.creditsText,
        title: hs.lang.creditsTitle
    });
    this.createOverlay({
        overlayId: this.credits,
        position: 'top left'
    });
},

getInline : function(types, addOverlay) {
    for (var i = 0; i < types.length; i++) {
        var type = types[i], s = null;
        if (!this[type +'Id'] && this.thumbsUserSetId)
            this[type +'Id'] = type +'-for-'+ this.thumbsUserSetId;
        if (this[type +'Id']) this[type] = hs.getNode(this[type +'Id']);
        if (!this[type] && !this[type +'Text'] && this[type +'Eval']) try {
            s = eval(this[type +'Eval']);
        } catch (e) {}
        if (!this[type] && this[type +'Text']) {
            s = this[type +'Text'];
        }
        if (!this[type] && !s) {
            var next = this.a.nextSibling;
            while (next && !hs.isHsAnchor(next)) {
                if ((new RegExp('highslide-'+ type)).test(next.className || null)) {
                    this[type] = next.cloneNode(1);
                    break;
                }
                next = next.nextSibling;
            }
        }

        if (!this[type] && s) this[type] = hs.createElement('div',
                { className: 'highslide-'+ type, innerHTML: s } );

        if (addOverlay && this[type]) {
            var o = { position: (type == 'heading') ? 'above' : 'below' };
            for (var x in this[type+'Overlay']) o[x] = this[type+'Overlay'][x];
            o.overlayId = this[type];
            this.createOverlay(o);
        }
    }
},


// on end move and resize
doShowHide : function(visibility) {
    if (hs.hideSelects) this.showHideElements('SELECT', visibility);
    if (hs.hideIframes) this.showHideElements('IFRAME', visibility);
    if (hs.geckoMac) this.showHideElements('*', visibility);
},
showHideElements : function (tagName, visibility) {
    var els = document.getElementsByTagName(tagName);
    var prop = tagName == '*' ? 'overflow' : 'visibility';
    for (var i = 0; i < els.length; i++) {
        if (prop == 'visibility' || (document.defaultView.getComputedStyle(
                els[i], "").getPropertyValue('overflow') == 'auto'
                || els[i].getAttribute('hidden-by') != null)) {
            var hiddenBy = els[i].getAttribute('hidden-by');
            if (visibility == 'visible' && hiddenBy) {
                hiddenBy = hiddenBy.replace('['+ this.key +']', '');
                els[i].setAttribute('hidden-by', hiddenBy);
                if (!hiddenBy) els[i].style[prop] = els[i].origProp;
            } else if (visibility == 'hidden') { // hide if behind
                var elPos = hs.getPosition(els[i]);
                elPos.w = els[i].offsetWidth;
                elPos.h = els[i].offsetHeight;


                    var clearsX = (elPos.x + elPos.w < this.x.get('opos')
                        || elPos.x > this.x.get('opos') + this.x.get('osize'));
                    var clearsY = (elPos.y + elPos.h < this.y.get('opos')
                        || elPos.y > this.y.get('opos') + this.y.get('osize'));
                var wrapperKey = hs.getWrapperKey(els[i]);
                if (!clearsX && !clearsY && wrapperKey != this.key) { // element falls behind image
                    if (!hiddenBy) {
                        els[i].setAttribute('hidden-by', '['+ this.key +']');
                        els[i].origProp = els[i].style[prop];
                        els[i].style[prop] = 'hidden';

                    } else if (hiddenBy.indexOf('['+ this.key +']') == -1) {
                        els[i].setAttribute('hidden-by', hiddenBy + '['+ this.key +']');
                    }
                } else if ((hiddenBy == '['+ this.key +']' || hs.focusKey == wrapperKey)
                        && wrapperKey != this.key) { // on move
                    els[i].setAttribute('hidden-by', '');
                    els[i].style[prop] = els[i].origProp || '';
                } else if (hiddenBy && hiddenBy.indexOf('['+ this.key +']') > -1) {
                    els[i].setAttribute('hidden-by', hiddenBy.replace('['+ this.key +']', ''));
                }

            }
        }
    }
},

focus : function() {
    this.wrapper.style.zIndex = hs.zIndexCounter++;
    // blur others
    for (var i = 0; i < hs.expanders.length; i++) {
        if (hs.expanders[i] && i == hs.focusKey) {
            var blurExp = hs.expanders[i];
            blurExp.content.className += ' highslide-'+ blurExp.contentType +'-blur';
                blurExp.content.style.cursor = hs.ie ? 'hand' : 'pointer';
                blurExp.content.title = hs.lang.focusTitle;
        }
    }

    // focus this
    if (this.outline) this.outline.table.style.zIndex
        = this.wrapper.style.zIndex;
    this.content.className = 'highslide-'+ this.contentType;
        this.content.title = hs.lang.restoreTitle;

        if (hs.restoreCursor) {
            hs.styleRestoreCursor = window.opera ? 'pointer' : 'url('+ hs.graphicsDir + hs.restoreCursor +'), pointer';
            if (hs.ie && hs.uaVersion < 6) hs.styleRestoreCursor = 'hand';
            this.content.style.cursor = hs.styleRestoreCursor;
        }

    hs.focusKey = this.key;
    hs.addEventListener(document, window.opera ? 'keypress' : 'keydown', hs.keyHandler);
},
moveTo: function(x, y) {
    this.x.setPos(x);
    this.y.setPos(y);
},
resize : function (e) {
    var w, h, r = e.width / e.height;
    w = Math.max(e.width + e.dX, Math.min(this.minWidth, this.x.full));
    if (this.isImage && Math.abs(w - this.x.full) < 12) w = this.x.full;
    h = w / r;
    if (h < Math.min(this.minHeight, this.y.full)) {
        h = Math.min(this.minHeight, this.y.full);
        if (this.isImage) w = h * r;
    }
    this.resizeTo(w, h);
},
resizeTo: function(w, h) {
    this.y.setSize(h);
    this.x.setSize(w);
},

close : function() {
    if (this.isClosing || !this.isExpanded) return;
    this.isClosing = true;

    hs.removeEventListener(document, window.opera ? 'keypress' : 'keydown', hs.keyHandler);

    try {
        this.content.style.cursor = 'default';
        this.changeSize(
            0, {
                wrapper: {
                    width : this.x.t,
                    height : this.y.t,
                    left: this.x.tpos - this.x.cb + this.x.tb,
                    top: this.y.tpos - this.y.cb + this.y.tb
                },
                content: {
                    left: 0,
                    top: 0,
                    width: this.x.t,
                    height: this.y.t
                }
            }, hs.restoreDuration
        );
    } catch (e) { this.afterClose(); }
},

createOverlay : function (o) {
    var el = o.overlayId;
    if (typeof el == 'string') el = hs.getNode(el);
    if (o.html) el = hs.createElement('div', { innerHTML: o.html });
    if (!el || typeof el == 'string') return;
    el.style.display = 'block';
    this.genOverlayBox();
    var width = o.width && /^[0-9]+(px|%)$/.test(o.width) ? o.width : 'auto';
    if (/^(left|right)panel$/.test(o.position) && !/^[0-9]+px$/.test(o.width)) width = '200px';
    var overlay = hs.createElement(
        'div', {
            id: 'hsId'+ hs.idCounter++,
            hsId: o.hsId
        }, {
            position: 'absolute',
            visibility: 'hidden',
            width: width,
            direction: hs.lang.cssDirection || '',
            opacity: 0
        },this.overlayBox,
        true
    );

    overlay.appendChild(el);
    hs.extend(overlay, {
        opacity: 1,
        offsetX: 0,
        offsetY: 0,
        dur: (o.fade === 0 || o.fade === false || (o.fade == 2 && hs.ie)) ? 0 : 250
    });
    hs.extend(overlay, o);

    if (this.gotOverlays) {
        this.positionOverlay(overlay);
        if (!overlay.hideOnMouseOut || this.mouseIsOver)
            hs.animate(overlay, { opacity: overlay.opacity }, overlay.dur);
    }
    hs.push(this.overlays, hs.idCounter - 1);
},
positionOverlay : function(overlay) {
    var p = overlay.position || 'middle center',
        offX = overlay.offsetX,
        offY = overlay.offsetY;
    if (overlay.parentNode != this.overlayBox) this.overlayBox.appendChild(overlay);
    if (/left$/.test(p)) overlay.style.left = offX +'px';

    if (/center$/.test(p))  hs.setStyles (overlay, {
        left: '50%',
        marginLeft: (offX - Math.round(overlay.offsetWidth / 2)) +'px'
    });

    if (/right$/.test(p)) overlay.style.right = - offX +'px';

    if (/^leftpanel$/.test(p)) {
        hs.setStyles(overlay, {
            right: '100%',
            marginRight: this.x.cb +'px',
            top: - this.y.cb +'px',
            bottom: - this.y.cb +'px',
            overflow: 'auto'
        });
        this.x.p1 = overlay.offsetWidth;

    } else if (/^rightpanel$/.test(p)) {
        hs.setStyles(overlay, {
            left: '100%',
            marginLeft: this.x.cb +'px',
            top: - this.y.cb +'px',
            bottom: - this.y.cb +'px',
            overflow: 'auto'
        });
        this.x.p2 = overlay.offsetWidth;
    }

    if (/^top/.test(p)) overlay.style.top = offY +'px';
    if (/^middle/.test(p))  hs.setStyles (overlay, {
        top: '50%',
        marginTop: (offY - Math.round(overlay.offsetHeight / 2)) +'px'
    });
    if (/^bottom/.test(p)) overlay.style.bottom = - offY +'px';
    if (/^above$/.test(p)) {
        hs.setStyles(overlay, {
            left: (- this.x.p1 - this.x.cb) +'px',
            right: (- this.x.p2 - this.x.cb) +'px',
            bottom: '100%',
            marginBottom: this.y.cb +'px',
            width: 'auto'
        });
        this.y.p1 = overlay.offsetHeight;

    } else if (/^below$/.test(p)) {
        hs.setStyles(overlay, {
            position: 'relative',
            left: (- this.x.p1 - this.x.cb) +'px',
            right: (- this.x.p2 - this.x.cb) +'px',
            top: '100%',
            marginTop: this.y.cb +'px',
            width: 'auto'
        });
        this.y.p2 = overlay.offsetHeight;
        overlay.style.position = 'absolute';
    }
},

getOverlays : function() {
    this.getInline(['heading', 'caption'], true);
    if (this.heading && this.dragByHeading) this.heading.className += ' highslide-move';
    if (hs.showCredits) this.writeCredits();
    for (var i = 0; i < hs.overlays.length; i++) {
        var o = hs.overlays[i], tId = o.thumbnailId, sg = o.slideshowGroup;
        if ((!tId && !sg) || (tId && tId == this.thumbsUserSetId)
                || (sg && sg === this.slideshowGroup)) {
            this.createOverlay(o);
        }
    }
    var os = [];
    for (var i = 0; i < this.overlays.length; i++) {
        var o = hs.$('hsId'+ this.overlays[i]);
        if (/panel$/.test(o.position)) this.positionOverlay(o);
        else hs.push(os, o);
    }
    for (var i = 0; i < os.length; i++) this.positionOverlay(os[i]);
    this.gotOverlays = true;
},
genOverlayBox : function() {
    if (!this.overlayBox) this.overlayBox = hs.createElement (
        'div', {
            className: this.wrapperClassName
        }, {
            position : 'absolute',
            width: (this.x.size || this.x.full) +'px',
            height: (this.y.size || this.y.full) +'px',
            visibility : 'hidden',
            overflow : 'hidden',
            zIndex : hs.ie ? 4 : null
        },
        hs.container,
        true
    );
},
sizeOverlayBox : function(doWrapper, doPanels) {
    var overlayBox = this.overlayBox,
        x = this.x,
        y = this.y;
    hs.setStyles( overlayBox, {
        width: x.size +'px',
        height: y.size +'px'
    });
    if (doWrapper || doPanels) {
        for (var i = 0; i < this.overlays.length; i++) {
            var o = hs.$('hsId'+ this.overlays[i]);
            var ie6 = (hs.ieLt7 || document.compatMode == 'BackCompat');
            if (o && /^(above|below)$/.test(o.position)) {
                if (ie6) {
                    o.style.width = (overlayBox.offsetWidth + 2 * x.cb
                        + x.p1 + x.p2) +'px';
                }
                y[o.position == 'above' ? 'p1' : 'p2'] = o.offsetHeight;
            }
            if (o && ie6 && /^(left|right)panel$/.test(o.position)) {
                o.style.height = (overlayBox.offsetHeight + 2* y.cb) +'px';
            }
        }
    }
    if (doWrapper) {
        hs.setStyles(this.content, {
            top: y.p1 +'px'
        });
        hs.setStyles(overlayBox, {
            top: (y.p1 + y.cb) +'px'
        });
    }
},

showOverlays : function() {
    var b = this.overlayBox;
    b.className = '';
    hs.setStyles(b, {
        top: (this.y.p1 + this.y.cb) +'px',
        left: (this.x.p1 + this.x.cb) +'px',
        overflow : 'visible'
    });
    if (hs.safari) b.style.visibility = 'visible';
    this.wrapper.appendChild (b);
    for (var i = 0; i < this.overlays.length; i++) {
        var o = hs.$('hsId'+ this.overlays[i]);
        o.style.zIndex = 4;
        if (!o.hideOnMouseOut || this.mouseIsOver) {
            o.style.visibility = 'visible';
            hs.animate(o, { opacity: o.opacity }, o.dur);
        }
    }
},

destroyOverlays : function() {
    if (!this.overlays.length) return;
    hs.discardElement(this.overlayBox);
},



createFullExpand : function () {
    this.fullExpandLabel = hs.createElement(
        'a', {
            href: 'javascript:hs.expanders['+ this.key +'].doFullExpand();',
            title: hs.lang.fullExpandTitle,
            className: 'highslide-full-expand'
        }
    );

    this.createOverlay({
        overlayId: this.fullExpandLabel,
        position: hs.fullExpandPosition,
        hideOnMouseOut: true,
        opacity: hs.fullExpandOpacity
    });
},

doFullExpand : function () {
    try {
        if (this.fullExpandLabel) hs.discardElement(this.fullExpandLabel);

        this.focus();
        var xSize = this.x.size;
        this.resizeTo(this.x.full, this.y.full);

        var xpos = this.x.pos - (this.x.size - xSize) / 2;
        if (xpos < hs.marginLeft) xpos = hs.marginLeft;

        this.moveTo(xpos, this.y.pos);
        this.doShowHide('hidden');

    } catch (e) {
        this.error(e);
    }
},


afterClose : function () {
    this.a.className = this.a.className.replace('highslide-active-anchor', '');

    this.doShowHide('visible');
        if (this.outline && this.outlineWhileAnimating) this.outline.destroy();

        hs.discardElement(this.wrapper);

    hs.expanders[this.key] = null;
    hs.reOrder();
}

};
if (document.readyState && hs.ie) {
    (function () {
        try {
            document.documentElement.doScroll('left');
        } catch (e) {
            setTimeout(arguments.callee, 50);
            return;
        }
        hs.domReady();
    })();
}
hs.langDefaults = hs.lang;
// history
var HsExpander = hs.Expander;

// set handlers
hs.addEventListener(window, 'load', function() {
    if (hs.expandCursor) {
        var sel = '.highslide img',
            dec = 'cursor: url('+ hs.graphicsDir + hs.expandCursor +'), pointer !important;';

        var style = hs.createElement('style', { type: 'text/css' }, null,
            document.getElementsByTagName('HEAD')[0]);

        if (!hs.ie) {
            style.appendChild(document.createTextNode(sel + " {" + dec + "}"));
        } else {
            var last = document.styleSheets[document.styleSheets.length - 1];
            if (typeof(last.addRule) == "object") last.addRule(sel, dec);
        }
    }
});
hs.addEventListener(window, 'resize', function() {
    hs.page = hs.getPageSize();
});
hs.addEventListener(document, 'mousemove', function(e) {
    hs.mouse = { x: e.clientX, y: e.clientY };
});
hs.addEventListener(document, 'mousedown', hs.mouseClickHandler);
hs.addEventListener(document, 'mouseup', hs.mouseClickHandler);
hs.addEventListener(window, 'load', hs.preloadImages);

/*
Name:       ImageFlow
Version:    1.1 (March 13 2008)
Author:     Finn Rudolph
Support:    http://finnrudolph.de/ImageFlow

Licence:    ImageFlow is licensed under a Creative Commons
            Attribution-Noncommercial 3.0 Unported License
            (http://creativecommons.org/licenses/by-nc/3.0/).

            You are free:
                + to Share - to copy, distribute and transmit the work
                + to Remix - to adapt the work

            Under the following conditions:
                + Attribution. You must attribute the work in the manner specified by the author or licensor
                  (but not in any way that suggests that they endorse you or your use of the work).
                + Noncommercial. You may not use this work for commercial purposes.

            + For any reuse or distribution, you must make clear to others the license terms of this work.
            + Any of the above conditions can be waived if you get permission from the copyright holder.
            + Nothing in this license impairs or restricts the author's moral rights.

Credits:    This script is based on Michael L. Perrys Cover flow in Javascript [1].
            The reflections are generated server-sided by a slightly hacked version
            of Richard Daveys easyreflections [2] written in PHP. The mouse wheel
            support is an implementation of Adomas Paltanavicius JavaScript mouse
            wheel code [3]. It also uses the domReadyEvent from Tanny O'Haley [4].

            [1] http://www.adventuresinsoftware.com/blog/?p=104#comment-1981
            [2] http://reflection.corephp.co.uk/v2.php
            [3] http://adomas.org/javascript-mouse-wheel/
            [4] http://tanny.ica.com/ICA/TKO/tkoblog.nsf/dx/domcontentloaded-for-browsers-part-v
*/

/* Packed ImageFlow constructor and DOMContentLoaded event handler */
eval(function(p,a,c,k,e,r){e=function(c){return(c<62?'':e(parseInt(c/62)))+((c=c%62)>35?String.fromCharCode(c+29):c.toString(36))};if('0'.replace(0,e)==0){while(c--)r[e(c)]=k[c];k=[function(e){return r[e]||e}];e=function(){return'([79q-vx-zA-Z]|[1-3]\\w)'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('r ImageFlow(){7.25={1A:1.964,26:t,27:\'1o\',y:\'imageflow\',1p:1.0,1B:4,28:0.67,29:1.0,2a:r(){s.location=7.2b},1d:v,1e:[10,8,6,4,2],1C:118,1D:S,2c:t,1E:t,2d:\'\',1f:0.5,2e:v,2f:0.6,1q:t,2g:\'e-resize\',T:14,2h:1,2i:v,12:150};q a=7;7.13=r(b){q c=new Array(\'1A\',\'26\',\'27\',\'29\',\'y\',\'1p\',\'1B\',\'28\',\'2a\',\'1d\',\'1e\',\'1C\',\'1D\',\'2c\',\'1E\',\'2d\',\'1f\',\'2e\',\'2f\',\'1q\',\'2g\',\'T\',\'2h\',\'2i\',\'12\');q d=c.1g;U(q e=0;e<d;e++){q f=c[e];7[f]=(b!==1F&&b[f]!==1F)?b[f]:a.25[f]}q h=s.G(a.y);9(h){h.u.1G=\'2j\';7.D=h;9(7.2A()){7.B=s.G(a.y+\'_2\');7.1H=s.G(a.y+\'_3\');7.1r=s.G(a.y+\'_1\');7.1I=s.G(a.y+\'_4\');7.1J=[];7.15=0;7.L=0;7.1s=0;7.1K=0;7.1L=t;7.1M=t;7.I=v;9(7.1q===v){7.1r.u.1t=\'1N\'}q i=7.D.2E;q g=J.M(i/a.1A);s.G(a.y+\'_0\').u.paddingTop=((g*0.5)-22)+\'F\';h.u.16=g+\'F\';7.1P()}}};7.2A=r(){q b=s.17(\'1h\');b.z(\'V\',a.y+\'_2\');b.z(\'1i\',\'2l\');b.z(\'1j\',\'2l\');q c=H;q d=7.D.C.1g;U(q e=0;e<d;e++){c=7.D.C[e];9(c&&c.1Q==1&&c.1R==\'1S\'){9(a.1E===t){q f=\'2\';9(a.2e===t){f=\'3\'}q h=c.18(\'2m\',2);h=\'reflect\'+f+\'.php?img=\'+h+a.2d;c.z(\'2m\',h)}q i=c.cloneNode(t);b.N(i)}}q g=s.17(\'p\');q j=s.2F(\' \');g.z(\'V\',a.y+\'_0\');g.N(j);q k=s.17(\'1h\');k.z(\'V\',a.y+\'_5\');k.z(\'1i\',\'2n\');k.z(\'1j\',\'2n\');q m=s.17(\'1h\');m.z(\'V\',a.y+\'_6\');m.z(\'1i\',\'2I\');m.z(\'1j\',\'2I\');k.N(m);q n=s.17(\'1h\');n.z(\'V\',a.y+\'_3\');n.z(\'1i\',\'2J\');n.z(\'1j\',\'2J\');q l=s.17(\'1h\');l.z(\'V\',a.y+\'_1\');l.z(\'1i\',\'2K\');l.z(\'1j\',\'2K\');q o=s.17(\'1h\');o.z(\'V\',a.y+\'_4\');o.z(\'1i\',\'1q\');o.z(\'1j\',\'1q\');l.N(o);q p=v;9(a.D.N(b)&&a.D.N(g)&&a.D.N(k)&&a.D.N(n)&&a.D.N(l)){U(e=0;e<d;e++){c=7.D.C[e];9(c&&c.1Q==1&&c.1R==\'1S\'){7.D.removeChild(c)}}p=t}O p};7.1P=r(){q b=a.2L();9(b<S||a.1M===t&&a.2c===t){9(a.1M===t&&b==S){a.1M=v;A.W(a.1P,S)}E{A.W(a.1P,40)}}E{s.G(a.y+\'_0\').u.1t=\'1N\';s.G(a.y+\'_5\').u.1t=\'1N\';A.W(a.2M,1000);a.2N();a.x.13();a.1T.13();a.1U(t);s.G(a.y+\'_1\').u.1G=\'2j\';q c=a.2h-1;9(c<0){c=0}9(c>a.P){c=a.P-1}a.1k(c);9(a.2i===t){a.1V(5000)}}};7.2L=r(){q b=a.B.C.1g;q c=0,d=0;q e=H;U(q f=0;f<b;f++){e=a.B.C[f];9(e&&e.1Q==1&&e.1R==\'1S\'){9(e.2o===t){d++}c++}}q h=J.M((d/c)*S);q i=s.G(a.y+\'_6\');i.u.19=h+\'%\';q g=s.G(a.y+\'_0\');q j=s.2F(\'2n 2l \'+d+\'/\'+c);g.replaceChild(j,g.firstChild);O h};7.1U=r(){7.X=a.B.2E;7.1u=J.M(a.X/a.1A);7.2p=a.1B*a.12;7.1l=a.X*0.5;7.T=a.T*0.5;7.1a=(a.X-(J.M(a.T)*2))*a.2f;7.2q=J.M(a.1u*a.28);a.D.u.16=a.1u+\'F\';a.B.u.16=a.2q+\'F\';a.1H.u.19=a.X+\'F\';a.1H.u.2O=J.M(a.X*0.02)+\'F\';a.1r.u.19=a.1a+\'F\';a.1r.u.2O=J.M(a.X*0.02)+\'F\';a.1r.u.2Q=J.M(a.T+((a.X-a.1a)/2))+\'F\';a.1I.u.2R=a.2g;a.1I.onmousedown=r(){a.x.2S(7);O v};q b=(a.1E===t)?a.1f+1:1;q c=a.B.C.1g;q d=0;q e=H;U(q f=0;f<c;f++){e=a.B.C[f];9(e!==H&&e.1Q==1&&e.1R==\'1S\'){7.1J[d]=f;e.2b=e.18(\'longdesc\');e.xPosition=(-d*a.12);e.i=d;9(a.1L){9(e.18(\'19\')!==H&&e.18(\'16\')!==H){e.w=e.18(\'19\');e.h=e.18(\'16\')*b}E{e.w=e.19;e.h=e.16}}9((e.w)>(e.h/(a.1f+1))){e.Q=a.1C;e.1W=a.1C}E{e.Q=a.1D;e.1W=a.1D}e.u.2R=a.27;d++}}7.P=a.1J.1g;9(a.1L){a.1L=v}a.1k(a.L);a.1V(a.15)};7.1V=r(b){7.15=b;7.Y=a.P;U(q c=0;c<a.P;c++){q d=a.B.C[a.1J[c]];q e=c*-a.12;9((e+a.2p)<a.1K||(e-a.2p)>a.1K){d.u.1G=\'hidden\';d.u.1t=\'1N\'}E{q f=(J.sqrt(10000+b*b)+S)*a.29;q h=b/f*a.1l+a.1l;d.u.1t=\'block\';q i=(d.h/d.w*d.Q)/f*a.1l;q g=0;1v(i>a.1u){1m v:g=d.Q/f*a.1l;K;1o:i=a.1u;g=d.w*i/d.h;K}q j=(a.2q-i)+((i/(a.1f+1))*a.1f);d.u.2T=h-(d.Q/2)/f*a.1l+\'F\';9(g&&i){d.u.16=i+\'F\';d.u.19=g+\'F\';d.u.top=j+\'F\'}d.u.1G=\'2j\';1v(b<0){1m t:7.Y++;K;1o:7.Y=a.Y-1;K}1v(d.i==a.L){1m v:d.2U=r(){a.1k(7.i)};K;1o:7.Y=a.Y+1;9(d.2b!==\'\'){d.2U=a.2a}K}d.u.Y=a.Y}b+=a.12}};7.1k=r(b){q c=-b*a.12;7.1s=c;7.1K=c;7.L=b;q d=a.B.C[b].18(\'alt\');9(d===\'\'||a.26===v){d=\'&nbsp;\'}a.1H.innerHTML=d;9(a.x.I===v){7.Z=(b*a.1a)/(a.P-1)-a.x.2r;a.1I.u.2Q=(a.Z-a.T)+\'F\'}9(a.1d===t||a.1p!==a.25.1p){a.1X(a.B.C[b],a.1e[0]);a.B.C[b].Q=a.B.C[b].Q*a.1p;q e=0;q f=0;q h=0;q i=a.1e.1g;U(q g=1;g<(a.1B+1);g++){9((g+1)>i){e=a.1e[i-1]}E{e=a.1e[g]}f=b+g;h=b-g;9(f<a.P){a.1X(a.B.C[f],e);a.B.C[f].Q=a.B.C[f].1W}9(h>=0){a.1X(a.B.C[h],e);a.B.C[h].Q=a.B.C[h].1W}}}9(a.I===v){A.W(a.2s,50);a.I=t}};7.2s=r(){1v(a.1s<a.15-1||a.1s>a.15+1){1m t:a.1V(a.15+(a.1s-a.15)/3);A.W(a.2s,50);a.I=t;K;1o:a.I=v;K}};7.1X=r(b,c){9(a.1d===t){b.u.1d=c/10;b.u.filter=\'alpha(1d=\'+c*10+\')\'}};7.2N=r(){9(A.11){a.D.11(\'DOMMouseScroll\',a.2t,v)}a.D.onmousewheel=a.2t};7.2t=r(b){q c=0;9(!b){b=A.1Y}9(b.2W){c=b.2W/120}E 9(b.2X){c=-b.2X/3}9(c){a.1Z(c)}9(b.2Y){b.2Y()}b.returnValue=v};7.1Z=r(b){q c=v;q d=0;9(b>0){9(a.L>=1){d=a.L-1;c=t}}E{9(a.L<(a.P-1)){d=a.L+1;c=t}}9(c===t){a.1k(d)}};7.x={1w:H,2u:0,20:0,2r:0,I:v,13:r(){a.1n(a.D,\'mousemove\',a.x.2Z);a.1n(a.D,\'30\',a.x.2v);a.1n(s,\'30\',a.x.2v);a.D.onselectstart=r(){q b=t;9(a.x.I===t){b=v}O b}},2S:r(b){a.x.1w=b;a.x.2u=a.x.20-b.offsetLeft+a.Z},2v:r(){a.x.1w=H;a.x.I=v},2Z:r(b){q c=0;9(!b){b=A.1Y}9(b.31){c=b.31}E 9(b.32){c=b.32+s.2w.33+s.documentElement.33}a.x.20=c;9(a.x.1w!==H){q d=(a.x.20-a.x.2u)+a.T;9(d<(-a.Z)){d=-a.Z}9(d>(a.1a-a.Z)){d=a.1a-a.Z}q e=(d+a.Z)/(a.1a/(a.P-1));q f=J.M(e);a.x.2r=d;a.x.1w.u.2T=d+\'F\';9(a.L!==f){a.1k(f)}a.x.I=t}}};7.1T={13:r(){s.onkeydown=r(b){a.1T.34(b)}},34:r(b){q c=a.1T.35(b);1v(c){1m 39:a.1Z(-1);K;1m 37:a.1Z(1);K}},35:r(b){b=b||A.1Y;O b.keyCode}};7.1n=r(b,c,d){9(b.11){b.11(c,d,v)}E 9(b.36){b["e"+c+d]=d;b[c+d]=r(){b["e"+c+d](A.1Y)};b.36("on"+c,b[c+d])}};7.2M=r(){q b=A.21;9(1x A.21!=\'r\'){A.21=r(){a.1U()}}E{A.21=r(){9(b){b()}a.1U()}}}}q R={2x:"R",1y:{},1b:1,1z:v,2y:H,38:r(b){9(!b.$$1b){b.$$1b=7.1b++;9(7.1z){b()}7.1y[b.$$1b]=b}},remove:r(b){9(b.$$1b){delete 7.1y[b.$$1b]}},1c:r(){9(7.1z){O}7.1z=t;U(q b in 7.1y){7.1y[b]()}},23:r(){9(7.1z){O}9(/KHTML|WebKit/i.3a(navigator.userAgent)){9(/loaded|2o/.3a(s.3b)){7.1c()}E{W(7.2x+".23()",S)}}E 9(s.G("2z")){O t}9(1x 7.2y==="r"){9(1x s.3c!==\'1F\'&&(s.3c(\'2w\')[0]!==H||s.2w!==H)){9(7.2y()){7.1c()}E{W(7.2x+".23()",250)}}}O t},13:r(){9(s.11){s.11("DOMContentLoaded",r(){R.1c()},v)}W("R.23()",S);r b(){R.1c()}9(1x 1n!=="1F"){1n(A,"3d",b)}E 9(s.11){s.11("3d",b,v)}E 9(1x A.24==="r"){q c=A.24;A.24=r(){R.1c();c()}}E{A.24=b}/*@cc_on @9(@_win32||@_win64)s.write("<3e V=2z defer 2m=\\"//:\\"><\\/3e>");q d=s.G("2z");d.onreadystatechange=r(){9(7.3b=="2o"){R.1c()}};@end @*/}};q domReady=r(b){R.38(b)};R.13();',[],201,'|||||||this||if|||||||||||||||||var|function|document|true|style|false||MouseDrag|ImageFlowID|setAttribute|window|imagesDiv|childNodes|ImageFlowDiv|else|px|getElementById|null|busy|Math|break|imageID|round|appendChild|return|max|pc|domReadyEvent|100|sliderWidth|for|id|setTimeout|iWidth|zIndex|newSliderX||addEventListener|xStep|init||current|height|createElement|getAttribute|width|scrollbarWidth|domReadyID|run|opacity|opacityArray|reflectionP|length|div|class|className|glideTo|size|case|addEvent|default|imageFocusM|slider|scrollbarDiv|target|display|maxHeight|switch|object|typeof|events|bDone|aspectRatio|imageFocusMax|percentLandscape|percentOther|reflections|undefined|visibility|captionDiv|sliderDiv|indexArray|memTarget|firstRefresh|firstCheck|none||loadingProgress|nodeType|nodeName|IMG|Key|refresh|moveTo|pcMem|setOpacity|event|handleMouseWheel|mouseX|onresize||schedule|onload|defaults|captions|imageCursor|imagesHeight|imagesM|onClick|url|preloadImages|reflectionGET|reflectionPNG|scrollbarP|sliderCursor|startID|startAnimation|visible||images|src|loading|complete|maxFocus|imagesDivHeight|newX|animate|eventMouseWheel|objectX|stop|body|name|DOMContentLoadedCustom|__ie_onload|createStructure||||offsetWidth|createTextNode|||loading_bar|caption|scrollbar|loadingStatus|addResizeEvent|initMouseWheel|marginTop||marginLeft|cursor|start|left|onclick||wheelDelta|detail|preventDefault|drag|mouseup|pageX|clientX|scrollLeft|handle|get|attachEvent||add||test|readyState|getElementsByTagName|load|script'.split('|'),0,{}))

/* Create ImageFlow instances when the DOM structure has been loaded */

/*
 * Thickbox 3.1 - One Box To Rule Them All.
 * By Cody Lindley (http://www.codylindley.com)
 * Copyright (c) 2007 cody lindley
 * Licensed under the MIT License: http://www.opensource.org/licenses/mit-license.php
*/


/* Interface */
/* Text datei: Ordner dark/{sprache}/accessories/javascript/text.js
/* */


var tb_pathToImage = "./skins/website/en/accessories/javascript/thickbox/loadingAnimation.gif";

/*!!!!!!!!!!!!!!!!! edit below this line at your own risk !!!!!!!!!!!!!!!!!!!!!!!*/

//on page load call tb_init
$(document).ready(function(){   
	tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
	imgLoader = new Image();// preload image
	imgLoader.src = tb_pathToImage;
});

//add thickbox to href & area elements that have a class of .thickbox
function tb_init(domChunk){
	$(domChunk).click(function(){
	var t = this.title || this.name || null;
	var a = this.href || this.alt;
	var g = this.rel || false;
	tb_show(t,a,g);
	this.blur();
	return false;
	});
}

function tb_show(caption, url, imageGroup) {//function called when the user clicks on a thickbox link

	try {
		if (typeof document.body.style.maxHeight === "undefined") {//if IE 6
			$("body","html").css({height: "100%", width: "100%"});
			$("html").css("overflow","hidden");
			if (document.getElementById("TB_HideSelect") === null) {//iframe to hide select elements in ie6
				$("body").append("<iframe id='TB_HideSelect'></iframe><div id='TB_overlay'></div><div id='TB_window'></div>");
				$("#TB_overlay").click(tb_remove);
			}
		}else{//all others
			if(document.getElementById("TB_overlay") === null){
				$("body").append("<div id='TB_overlay'></div><div id='TB_window'></div>");
				$("#TB_overlay").click(tb_remove);
			}
		}
		
		if(tb_detectMacXFF()){
			$("#TB_overlay").addClass("TB_overlayMacFFBGHack");//use png overlay so hide flash
		}else{
			$("#TB_overlay").addClass("TB_overlayBG");//use background and opacity
		}
		
		if(caption===null){caption="";}
		$("body").append("<div id='TB_load'><img src='"+imgLoader.src+"' /></div>");//add loader to the page
		$('#TB_load').show();//show loader
		
		var baseURL;
	   if(url.indexOf("?")!==-1){ //ff there is a query string involved
			baseURL = url.substr(0, url.indexOf("?"));
	   }else{ 
	   		baseURL = url;
	   }
	   
	   var urlString = /\.jpg$|\.jpeg$|\.png$|\.gif$|\.bmp$/;
	   var urlType = baseURL.toLowerCase().match(urlString);

		if(urlType == '.jpg' || urlType == '.jpeg' || urlType == '.png' || urlType == '.gif' || urlType == '.bmp'){//code to show images
				
			TB_PrevCaption = "";
			TB_PrevURL = "";
			TB_PrevHTML = "";
			TB_NextCaption = "";
			TB_NextURL = "";
			TB_NextHTML = "";
			TB_imageCount = "";
			TB_FoundURL = false;
			if(imageGroup){
				TB_TempArray = $("a[@rel="+imageGroup+"]").get();
				for (TB_Counter = 0; ((TB_Counter < TB_TempArray.length) && (TB_NextHTML === "")); TB_Counter++) {
					var urlTypeTemp = TB_TempArray[TB_Counter].href.toLowerCase().match(urlString);
						if (!(TB_TempArray[TB_Counter].href == url)) {						
							if (TB_FoundURL) {
								TB_NextCaption = TB_TempArray[TB_Counter].title;
								TB_NextURL = TB_TempArray[TB_Counter].href;
								TB_NextHTML = "| <span id='TB_next'>&nbsp;&nbsp;<a href='#'>" + ex_text['thickbox_next'] + "</a></span>";
							} else {
								TB_PrevCaption = TB_TempArray[TB_Counter].title;
								TB_PrevURL = TB_TempArray[TB_Counter].href;
								TB_PrevHTML = "<span id='TB_prev'>&nbsp;&nbsp;<a href='#'>" + ex_text['thickbox_previous'] + "</a></span> |";
							}
						} else {
							TB_FoundURL = true;
							TB_imageCount = ex_text['thickbox_image'] + (TB_Counter + 1) + ex_text['thickbox_from'] + (TB_TempArray.length);											
						}
				}
			}

			imgPreloader = new Image();
			imgPreloader.onload = function(){		
			imgPreloader.onload = null;
				
			// Resizing large images - orginal by Christian Montoya edited by me.
			var pagesize = tb_getPageSize();
			var x = pagesize[0] - 150;
			var y = pagesize[1] - 150;
			var imageWidth = imgPreloader.width;
			var imageHeight = imgPreloader.height;
			if (imageWidth > x) {
				imageHeight = imageHeight * (x / imageWidth); 
				imageWidth = x; 
				if (imageHeight > y) { 
					imageWidth = imageWidth * (y / imageHeight); 
					imageHeight = y; 
				}
			} else if (imageHeight > y) { 
				imageWidth = imageWidth * (y / imageHeight); 
				imageHeight = y; 
				if (imageWidth > x) { 
					imageHeight = imageHeight * (x / imageWidth); 
					imageWidth = x;
				}
			}
			// End Resizing
			
			TB_WIDTH = imageWidth + 30;
			TB_HEIGHT = imageHeight + 60;
			$("#TB_window").append("<a href='' id='TB_ImageOff' title='Close'><img id='TB_Image' src='"+url+"' width='"+imageWidth+"' height='"+imageHeight+"' alt='"+caption+"'/></a>" + "<div id='TB_caption'>"+caption+"<div id='TB_secondLine'>" + TB_imageCount + TB_PrevHTML + TB_NextHTML + "</div></div><div id='TB_closeWindow'><a href='#' id='TB_closeWindowButton' title='Close'>" + ex_text['thickbox_close'] + "</a></div>"); 		
			
			$("#TB_closeWindowButton").click(tb_remove);
			
			if (!(TB_PrevHTML === "")) {
				function goPrev(){
					if($(document).unbind("click",goPrev)){$(document).unbind("click",goPrev);}
					$("#TB_window").remove();
					$("body").append("<div id='TB_window'></div>");
					tb_show(TB_PrevCaption, TB_PrevURL, imageGroup);
					return false;	
				}
				$("#TB_prev").click(goPrev);
			}
			
			if (!(TB_NextHTML === "")) {		
				function goNext(){
					$("#TB_window").remove();
					$("body").append("<div id='TB_window'></div>");
					tb_show(TB_NextCaption, TB_NextURL, imageGroup);				
					return false;	
				}
				$("#TB_next").click(goNext);
				
			}

			document.onkeydown = function(e){ 	
				if (e == null) { // ie
					keycode = event.keyCode;
				} else { // mozilla
					keycode = e.which;
				}
				if(keycode == 27){ // close
					tb_remove();
				} else if(keycode == 190){ // display previous image
					if(!(TB_NextHTML == "")){
						document.onkeydown = "";
						goNext();
					}
				} else if(keycode == 188){ // display next image
					if(!(TB_PrevHTML == "")){
						document.onkeydown = "";
						goPrev();
					}
				}	
			};
			
			tb_position();
			$("#TB_load").remove();
			$("#TB_ImageOff").click(tb_remove);
			$("#TB_window").css({display:"block"}); //for safari using css instead of show
			};
			
			imgPreloader.src = url;
		}else{//code to show html
			
			var queryString = url.replace(/^[^\?]+\??/,'');
			var params = tb_parseQuery( queryString );

			TB_WIDTH = (params['width']*1) + 30 || 630; //defaults to 630 if no paramaters were added to URL
			TB_HEIGHT = (params['height']*1) + 40 || 440; //defaults to 440 if no paramaters were added to URL
			ajaxContentW = TB_WIDTH - 30;
			ajaxContentH = TB_HEIGHT - 45;
			
			if(url.indexOf('TB_iframe') != -1){// either iframe or ajax window		
					urlNoQuery = url.split('TB_');
					$("#TB_iframeContent").remove();
					if(params['modal'] != "true"){//iframe no modal
						$("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+caption+"</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton' title='Close'>" + ex_text['thickbox_close'] + "</a>y</div></div><iframe frameborder='0' hspace='0' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(Math.random()*1000)+"' onload='tb_showIframe()' style='width:"+(ajaxContentW + 29)+"px;height:"+(ajaxContentH + 17)+"px;' > </iframe>");
					}else{//iframe modal
					$("#TB_overlay").unbind();
						$("#TB_window").append("<iframe frameborder='0' hspace='0' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(Math.random()*1000)+"' onload='tb_showIframe()' style='width:"+(ajaxContentW + 29)+"px;height:"+(ajaxContentH + 17)+"px;'> </iframe>");
					}
			}else{// not an iframe, ajax
					if($("#TB_window").css("display") != "block"){
						if(params['modal'] != "true"){//ajax no modal
						$("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+caption+"</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton'>" + ex_text['thickbox_close'] + "</a></div></div><div id='TB_ajaxContent' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px'></div>");
						}else{//ajax modal
						$("#TB_overlay").unbind();
						$("#TB_window").append("<div id='TB_ajaxContent' class='TB_modal' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px;'></div>");	
						}
					}else{//this means the window is already up, we are just loading new content via ajax
						$("#TB_ajaxContent")[0].style.width = ajaxContentW +"px";
						$("#TB_ajaxContent")[0].style.height = ajaxContentH +"px";
						$("#TB_ajaxContent")[0].scrollTop = 0;
						$("#TB_ajaxWindowTitle").html(caption);
					}
			}
					
			$("#TB_closeWindowButton").click(tb_remove);
			
				if(url.indexOf('TB_inline') != -1){	
					$("#TB_ajaxContent").append($('#' + params['inlineId']).children());
					$("#TB_window").unload(function () {
						$('#' + params['inlineId']).append( $("#TB_ajaxContent").children() ); // move elements back when you're finished
					});
					tb_position();
					$("#TB_load").remove();
					$("#TB_window").css({display:"block"}); 
				}else if(url.indexOf('TB_iframe') != -1){
					tb_position();
					if($.browser.safari){//safari needs help because it will not fire iframe onload
						$("#TB_load").remove();
						$("#TB_window").css({display:"block"});
					}
				}else{
					$("#TB_ajaxContent").load(url += "&random=" + (new Date().getTime()),function(){//to do a post change this load method
						tb_position();
						$("#TB_load").remove();
						tb_init("#TB_ajaxContent a.thickbox");
						$("#TB_window").css({display:"block"});
					});
				}
			
		}

		if(!params['modal']){
			document.onkeyup = function(e){ 	
				if (e == null) { // ie
					keycode = event.keyCode;
				} else { // mozilla
					keycode = e.which;
				}
				if(keycode == 27){ // close
					tb_remove();
				}	
			};
		}
		
	} catch(e) {
		//nothing here
	}
}

//helper functions below
function tb_showIframe(){
	$("#TB_load").remove();
	$("#TB_window").css({display:"block"});
}

function tb_remove() {
 	$("#TB_imageOff").unbind("click");
	$("#TB_closeWindowButton").unbind("click");
	$("#TB_window").fadeOut("fast",function(){$('#TB_window,#TB_overlay,#TB_HideSelect').trigger("unload").unbind().remove();});
	$("#TB_load").remove();
	if (typeof document.body.style.maxHeight == "undefined") {//if IE 6
		$("body","html").css({height: "auto", width: "auto"});
		$("html").css("overflow","");
	}
	document.onkeydown = "";
	document.onkeyup = "";
	return false;
}

function tb_position() {
$("#TB_window").css({marginLeft: '-' + parseInt((TB_WIDTH / 2),10) + 'px', width: TB_WIDTH + 'px'});
	if ( !(jQuery.browser.msie && jQuery.browser.version < 7)) { // take away IE6
		$("#TB_window").css({marginTop: '-' + parseInt((TB_HEIGHT / 2),10) + 'px'});
	}
}

function tb_parseQuery ( query ) {
   var Params = {};
   if ( ! query ) {return Params;}// return empty object
   var Pairs = query.split(/[;&]/);
   for ( var i = 0; i < Pairs.length; i++ ) {
      var KeyVal = Pairs[i].split('=');
      if ( ! KeyVal || KeyVal.length != 2 ) {continue;}
      var key = unescape( KeyVal[0] );
      var val = unescape( KeyVal[1] );
      val = val.replace(/\+/g, ' ');
      Params[key] = val;
   }
   return Params;
}

function tb_getPageSize(){
	var de = document.documentElement;
	var w = window.innerWidth || self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth;
	var h = window.innerHeight || self.innerHeight || (de&&de.clientHeight) || document.body.clientHeight;
	arrayPageSize = [w,h];
	return arrayPageSize;
}

function tb_detectMacXFF() {
  var userAgent = navigator.userAgent.toLowerCase();
  if (userAgent.indexOf('mac') != -1 && userAgent.indexOf('firefox')!=-1) {
    return true;
  }
}




