/*
 * 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/06/23 22:58:52 $
 * $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);};});})();;// $Id: drupal.js,v 1.41.2.3 2008/06/25 09:06:57 goba Exp $

var Drupal = Drupal || { 'settings': {}, 'behaviors': {}, 'themes': {}, 'locale': {} };

/**
 * Set the variable that indicates if JavaScript behaviors should be applied
 */
Drupal.jsEnabled = document.getElementsByTagName && document.createElement && document.createTextNode && document.documentElement && document.getElementById;

/**
 * Attach all registered behaviors to a page element.
 *
 * Behaviors are event-triggered actions that attach to page elements, enhancing
 * default non-Javascript UIs. Behaviors are registered in the Drupal.behaviors
 * object as follows:
 * @code
 *    Drupal.behaviors.behaviorName = function () {
 *      ...
 *    };
 * @endcode
 *
 * Drupal.attachBehaviors is added below to the jQuery ready event and so
 * runs on initial page load. Developers implementing AHAH/AJAX in their
 * solutions should also call this function after new page content has been
 * loaded, feeding in an element to be processed, in order to attach all
 * behaviors to the new content.
 *
 * Behaviors should use a class in the form behaviorName-processed to ensure
 * the behavior is attached only once to a given element. (Doing so enables
 * the reprocessing of given elements, which may be needed on occasion despite
 * the ability to limit behavior attachment to a particular element.)
 *
 * @param context
 *   An element to attach behaviors to. If none is given, the document element
 *   is used.
 */
Drupal.attachBehaviors = function(context) {
  context = context || document;
  if (Drupal.jsEnabled) {
    // Execute all of them.
    jQuery.each(Drupal.behaviors, function() {
      this(context);
    });
  }
};

/**
 * Encode special characters in a plain-text string for display as HTML.
 */
Drupal.checkPlain = function(str) {
  str = String(str);
  var replace = { '&': '&amp;', '"': '&quot;', '<': '&lt;', '>': '&gt;' };
  for (var character in replace) {
    var regex = new RegExp(character, 'g');
    str = str.replace(regex, replace[character]);
  }
  return str;
};

/**
 * Translate strings to the page language or a given language.
 *
 * See the documentation of the server-side t() function for further details.
 *
 * @param str
 *   A string containing the English string to translate.
 * @param args
 *   An object of replacements pairs to make after translation. Incidences
 *   of any key in this array are replaced with the corresponding value.
 *   Based on the first character of the key, the value is escaped and/or themed:
 *    - !variable: inserted as is
 *    - @variable: escape plain text to HTML (Drupal.checkPlain)
 *    - %variable: escape text and theme as a placeholder for user-submitted
 *      content (checkPlain + Drupal.theme('placeholder'))
 * @return
 *   The translated string.
 */
Drupal.t = function(str, args) {
  // Fetch the localized version of the string.
  if (Drupal.locale.strings && Drupal.locale.strings[str]) {
    str = Drupal.locale.strings[str];
  }

  if (args) {
    // Transform arguments before inserting them
    for (var key in args) {
      switch (key.charAt(0)) {
        // Escaped only
        case '@':
          args[key] = Drupal.checkPlain(args[key]);
        break;
        // Pass-through
        case '!':
          break;
        // Escaped and placeholder
        case '%':
        default:
          args[key] = Drupal.theme('placeholder', args[key]);
          break;
      }
      str = str.replace(key, args[key]);
    }
  }
  return str;
};

/**
 * Format a string containing a count of items.
 *
 * This function ensures that the string is pluralized correctly. Since Drupal.t() is
 * called by this function, make sure not to pass already-localized strings to it.
 *
 * See the documentation of the server-side format_plural() function for further details.
 *
 * @param count
 *   The item count to display.
 * @param singular
 *   The string for the singular case. Please make sure it is clear this is
 *   singular, to ease translation (e.g. use "1 new comment" instead of "1 new").
 *   Do not use @count in the singular string.
 * @param plural
 *   The string for the plural case. Please make sure it is clear this is plural,
 *   to ease translation. Use @count in place of the item count, as in "@count
 *   new comments".
 * @param args
 *   An object of replacements pairs to make after translation. Incidences
 *   of any key in this array are replaced with the corresponding value.
 *   Based on the first character of the key, the value is escaped and/or themed:
 *    - !variable: inserted as is
 *    - @variable: escape plain text to HTML (Drupal.checkPlain)
 *    - %variable: escape text and theme as a placeholder for user-submitted
 *      content (checkPlain + Drupal.theme('placeholder'))
 *   Note that you do not need to include @count in this array.
 *   This replacement is done automatically for the plural case.
 * @return
 *   A translated string.
 */
Drupal.formatPlural = function(count, singular, plural, args) {
  var args = args || {};
  args['@count'] = count;
  // Determine the index of the plural form.
  var index = Drupal.locale.pluralFormula ? Drupal.locale.pluralFormula(args['@count']) : ((args['@count'] == 1) ? 0 : 1);

  if (index == 0) {
    return Drupal.t(singular, args);
  }
  else if (index == 1) {
    return Drupal.t(plural, args);
  }
  else {
    args['@count['+ index +']'] = args['@count'];
    delete args['@count'];
    return Drupal.t(plural.replace('@count', '@count['+ index +']'));
  }
};

/**
 * Generate the themed representation of a Drupal object.
 *
 * All requests for themed output must go through this function. It examines
 * the request and routes it to the appropriate theme function. If the current
 * theme does not provide an override function, the generic theme function is
 * called.
 *
 * For example, to retrieve the HTML that is output by theme_placeholder(text),
 * call Drupal.theme('placeholder', text).
 *
 * @param func
 *   The name of the theme function to call.
 * @param ...
 *   Additional arguments to pass along to the theme function.
 * @return
 *   Any data the theme function returns. This could be a plain HTML string,
 *   but also a complex object.
 */
Drupal.theme = function(func) {
  for (var i = 1, args = []; i < arguments.length; i++) {
    args.push(arguments[i]);
  }

  return (Drupal.theme[func] || Drupal.theme.prototype[func]).apply(this, args);
};

/**
 * Parse a JSON response.
 *
 * The result is either the JSON object, or an object with 'status' 0 and 'data' an error message.
 */
Drupal.parseJson = function (data) {
  if ((data.substring(0, 1) != '{') && (data.substring(0, 1) != '[')) {
    return { status: 0, data: data.length ? data : Drupal.t('Unspecified error') };
  }
  return eval('(' + data + ');');
};

/**
 * Freeze the current body height (as minimum height). Used to prevent
 * unnecessary upwards scrolling when doing DOM manipulations.
 */
Drupal.freezeHeight = function () {
  Drupal.unfreezeHeight();
  var div = document.createElement('div');
  $(div).css({
    position: 'absolute',
    top: '0px',
    left: '0px',
    width: '1px',
    height: $('body').css('height')
  }).attr('id', 'freeze-height');
  $('body').append(div);
};

/**
 * Unfreeze the body height
 */
Drupal.unfreezeHeight = function () {
  $('#freeze-height').remove();
};

/**
 * Wrapper to address the mod_rewrite url encoding bug
 * (equivalent of drupal_urlencode() in PHP).
 */
Drupal.encodeURIComponent = function (item, uri) {
  uri = uri || location.href;
  item = encodeURIComponent(item).replace(/%2F/g, '/');
  return (uri.indexOf('?q=') != -1) ? item : item.replace(/%26/g, '%2526').replace(/%23/g, '%2523').replace(/\/\//g, '/%252F');
};

/**
 * Get the text selection in a textarea.
 */
Drupal.getSelection = function (element) {
  if (typeof(element.selectionStart) != 'number' && document.selection) {
    // The current selection
    var range1 = document.selection.createRange();
    var range2 = range1.duplicate();
    // Select all text.
    range2.moveToElementText(element);
    // Now move 'dummy' end point to end point of original range.
    range2.setEndPoint('EndToEnd', range1);
    // Now we can calculate start and end points.
    var start = range2.text.length - range1.text.length;
    var end = start + range1.text.length;
    return { 'start': start, 'end': end };
  }
  return { 'start': element.selectionStart, 'end': element.selectionEnd };
};

/**
 * Build an error message from ahah response.
 */
Drupal.ahahError = function(xmlhttp, uri) {
  if (xmlhttp.status == 200) {
    if (jQuery.trim($(xmlhttp.responseText).text())) {
      var message = Drupal.t("An error occurred. \n@uri\n@text", {'@uri': uri, '@text': xmlhttp.responseText });
    }
    else {
      var message = Drupal.t("An error occurred. \n@uri\n(no information available).", {'@uri': uri, '@text': xmlhttp.responseText });
    }
  }
  else {
    var message = Drupal.t("An HTTP error @status occurred. \n@uri", {'@uri': uri, '@status': xmlhttp.status });
  }
  return message;
}

// Global Killswitch on the <html> element
if (Drupal.jsEnabled) {
  // Global Killswitch on the <html> element
  $(document.documentElement).addClass('js');
  // 'js enabled' cookie
  document.cookie = 'has_js=1; path=/';
  // Attach all behaviors.
  $(document).ready(function() {
    Drupal.attachBehaviors(this);
  });
}

/**
 * The default themes.
 */
Drupal.theme.prototype = {

  /**
   * Formats text for emphasized display in a placeholder inside a sentence.
   *
   * @param str
   *   The text to format (plain-text).
   * @return
   *   The formatted text (html).
   */
  placeholder: function(str) {
    return '<em>' + Drupal.checkPlain(str) + '</em>';
  }
};
;/**
 * Flash (http://jquery.lukelutman.com/plugins/flash)
 * A jQuery plugin for embedding Flash movies.
 * 
 * Version 1.0
 * November 9th, 2006
 *
 * Copyright (c) 2006 Luke Lutman (http://www.lukelutman.com)
 * Dual licensed under the MIT and GPL licenses.
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.opensource.org/licenses/gpl-license.php
 * 
 * Inspired by:
 * SWFObject (http://blog.deconcept.com/swfobject/)
 * UFO (http://www.bobbyvandersluis.com/ufo/)
 * sIFR (http://www.mikeindustries.com/sifr/)
 * 
 * IMPORTANT: 
 * The packed version of jQuery breaks ActiveX control
 * activation in Internet Explorer. Use JSMin to minifiy
 * jQuery (see: http://jquery.lukelutman.com/plugins/flash#activex).
 *
 **/ 
;(function(){
	
var $$;

/**
 * 
 * @desc Replace matching elements with a flash movie.
 * @author Luke Lutman
 * @version 1.0.1
 *
 * @name flash
 * @param Hash htmlOptions Options for the embed/object tag.
 * @param Hash pluginOptions Options for detecting/updating the Flash plugin (optional).
 * @param Function replace Custom block called for each matched element if flash is installed (optional).
 * @param Function update Custom block called for each matched if flash isn't installed (optional).
 * @type jQuery
 *
 * @cat plugins/flash
 * 
 * @example $('#hello').flash({ src: 'hello.swf' });
 * @desc Embed a Flash movie.
 *
 * @example $('#hello').flash({ src: 'hello.swf' }, { version: 8 });
 * @desc Embed a Flash 8 movie.
 *
 * @example $('#hello').flash({ src: 'hello.swf' }, { expressInstall: true });
 * @desc Embed a Flash movie using Express Install if flash isn't installed.
 *
 * @example $('#hello').flash({ src: 'hello.swf' }, { update: false });
 * @desc Embed a Flash movie, don't show an update message if Flash isn't installed.
 *
**/
$$ = jQuery.fn.flash = function(htmlOptions, pluginOptions, replace, update) {
	if (this.length > 0) {
		// Set the default block.
		var block = replace || $$.replace;
		
		// Merge the default and passed plugin options.
		pluginOptions = $$.copy($$.pluginOptions, pluginOptions);
		
		// Detect Flash.
		if(!$$.hasFlash(pluginOptions.version)) {
			// Use Express Install (if specified and Flash plugin 6,0,65 or higher is installed).
			if(pluginOptions.expressInstall && $$.hasFlash(6,0,65)) {
				// Add the necessary flashvars (merged later).
				var expressInstallOptions = {
					flashvars: {  	
						MMredirectURL: location,
						MMplayerType: 'PlugIn',
						MMdoctitle: jQuery('title').text() 
					}					
				};
			// Ask the user to update (if specified).
			} else if (pluginOptions.update) {
				// Change the block to insert the update message instead of the flash movie.
				block = update || $$.update;
			// Fail
			} else {
				// The required version of flash isn't installed.
				// Express Install is turned off, or flash 6,0,65 isn't installed.
				// Update is turned off.
				// Return without doing anything.
				return this;
			}
		}
		
		// Merge the default, express install and passed html options.
		htmlOptions = $$.copy($$.htmlOptions, expressInstallOptions, htmlOptions);
		
		// Invoke $block (with a copy of the merged html options) for each element.
		return this.each(function(){
			block.call(this, $$.copy(htmlOptions));
		});
	}
};
/**
 *
 * @name flash.copy
 * @desc Copy an arbitrary number of objects into a new object.
 * @type Object
 * 
 * @example $$.copy({ foo: 1 }, { bar: 2 });
 * @result { foo: 1, bar: 2 };
 *
**/
$$.copy = function() {
	var options = {}, flashvars = {};
	for(var i = 0; i < arguments.length; i++) {
		var arg = arguments[i];
		if(arg == undefined) {
			continue;
		}
		jQuery.extend(options, arg);
		// don't clobber one flash vars object with another
		// merge them instead
		if(arg.flashvars == undefined) {
			continue;
		}
		jQuery.extend(flashvars, arg.flashvars);
	}
	options.flashvars = flashvars;
	return options;
};
/*
 * @name flash.hasFlash
 * @desc Check if a specific version of the Flash plugin is installed
 * @type Boolean
 *
**/
$$.hasFlash = function() {
	// look for a flag in the query string to bypass flash detection
	if(/hasFlash\=true/.test(location)) { return true; }
	if(/hasFlash\=false/.test(location)) { return false; }
	var pv = $$.hasFlash.playerVersion().match(/\d+/g);
	var rv = String([arguments[0], arguments[1], arguments[2]]).match(/\d+/g) || String($$.pluginOptions.version).match(/\d+/g);
	for(var i = 0; i < 3; i++) {
		pv[i] = parseInt(pv[i] || 0);
		rv[i] = parseInt(rv[i] || 0);
		// player is less than required
		if(pv[i] < rv[i]) { return false; }
		// player is greater than required
		if(pv[i] > rv[i]) { return true; }
	}
	// major version, minor version and revision match exactly
	return true;
};
/**
 *
 * @name flash.hasFlash.playerVersion
 * @desc Get the version of the installed Flash plugin.
 * @type String
 *
**/
$$.hasFlash.playerVersion = function() {
	// ie
	try {
		try {
			// avoid fp6 minor version lookup issues
			// see: http://blog.deconcept.com/2006/01/11/getvariable-setvariable-crash-internet-explorer-flash-6/
			var axo = new ActiveXObject('ShockwaveFlash.ShockwaveFlash.6');
			try { axo.AllowScriptAccess = 'always';	} 
			catch(e) { return '6,0,0'; }				
		} catch(e) {}
		return new ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version').replace(/\D+/g, ',').match(/^,?(.+),?$/)[1];
	// other browsers
	} catch(e) {
		try {
			if(navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin){
				return (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]).description.replace(/\D+/g, ",").match(/^,?(.+),?$/)[1];
			}
		} catch(e) {}		
	}
	return '0,0,0';
};
/**
 *
 * @name flash.htmlOptions
 * @desc The default set of options for the object or embed tag.
 *
**/
$$.htmlOptions = {
	height: 240,
	flashvars: {},
	pluginspage: 'http://www.adobe.com/go/getflashplayer',
	src: '#',
	type: 'application/x-shockwave-flash',
	width: 320		
};
/**
 *
 * @name flash.pluginOptions
 * @desc The default set of options for checking/updating the flash Plugin.
 *
**/
$$.pluginOptions = {
	expressInstall: false,
	update: false,
	version: '6.0.65'
};
/**
 *
 * @name flash.replace
 * @desc The default method for replacing an element with a Flash movie.
 *
**/
$$.replace = function(htmlOptions) {
	this.innerHTML = '<div class="alt">'+this.innerHTML+'</div>';
	jQuery(this)
		.addClass('flash-replaced')
		.prepend($$.transform(htmlOptions));
};
/**
 *
 * @name flash.update
 * @desc The default method for replacing an element with an update message.
 *
**/
$$.update = function(htmlOptions) {
	var url = String(location).split('?');
	url.splice(1,0,'?hasFlash=true&');
	url = url.join('');
	var msg = '<p>This content requires the Flash Player. <a href="http://www.adobe.com/go/getflashplayer">Download Flash Player</a>. Already have Flash Player? <a href="'+url+'">Click here.</a></p>';
	this.innerHTML = '<span class="alt">'+this.innerHTML+'</span>';
	jQuery(this)
		.addClass('flash-update')
		.prepend(msg);
};
/**
 *
 * @desc Convert a hash of html options to a string of attributes, using Function.apply(). 
 * @example toAttributeString.apply(htmlOptions)
 * @result foo="bar" foo="bar"
 *
**/
function toAttributeString() {
	var s = '';
	for(var key in this) {
		if(typeof this[key] != 'function') {
			s += key+'="'+this[key]+'" ';
		}
	}
	return s;		
};
/**
 *
 * @desc Convert a hash of flashvars to a url-encoded string, using Function.apply(). 
 * @example toFlashvarsString.apply(flashvarsObject)
 * @result foo=bar&foo=bar
 *
**/
function toFlashvarsString() {
	var s = '';
	for(var key in this) {
		if(typeof this[key] != 'function') {
			s += key+'='+arb.text.percentEncode(this[key])+'&';
		}
	}
	return s.replace(/&$/, '');		
};
/**
 *
 * @name flash.transform
 * @desc Transform a set of html options into an embed tag.
 * @type String 
 *
 * @example $$.transform(htmlOptions)
 * @result <embed src="foo.swf" ... />
 *
 * Note: The embed tag is NOT standards-compliant, but it 
 * works in all current browsers. flash.transform can be
 * overwritten with a custom function to generate more 
 * standards-compliant markup.
 *
**/
$$.transform = function(htmlOptions) {
	if(htmlOptions.flashvars) {
		htmlOptions.flashvars.toString = toFlashvarsString;
	}
	if (!$.browser.msie) {
		htmlOptions.toString = toAttributeString;
		return '<embed ' + String(htmlOptions) + '/>';
	}
	else { // IE
		var output = "";
		var idString = "";
		if (typeof(htmlOptions.id) != "undefined") {
			idString = 'id="'+ htmlOptions.id + '"';
		}
		
		output = '<object '+ idString +' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+ htmlOptions.width +'" height="'+ htmlOptions.height +'">';
		output += '<param name="movie" value="'+ htmlOptions.src +'" />';
		
		delete(htmlOptions.id);
		delete(htmlOptions.width);
		delete(htmlOptions.height);
		delete(htmlOptions.src);
		delete(htmlOptions.type);
		delete(htmlOptions.pluginspage);

		for(var key in htmlOptions) {
		 output += '<param name="'+ key +'" value="'+ String(htmlOptions[key]) +'" />';
		}
		
		output += "</object>";

		return output;
	}
};

/**
 *
 * Flash Player 9 Fix (http://blog.deconcept.com/2006/07/28/swfobject-143-released/)
 *
**/
if (window.attachEvent) {
	window.attachEvent("onbeforeunload", function(){
		__flash_unloadHandler = function() {};
		__flash_savedUnloadHandler = function() {};
	});
}
	
})();



/**
 * A class to parse color values
 * @author Stoyan Stefanov <sstoo@gmail.com>
 * @link   http://www.phpied.com/rgb-color-parser-in-javascript/
 * @license Use it if you like it
 */
function RGBColor(color_string)
{
    this.ok = false;

    // strip any leading #
    if (color_string.charAt(0) == '#') { // remove # if any
        color_string = color_string.substr(1,6);
    }

    color_string = color_string.replace(/ /g,'');
    color_string = color_string.toLowerCase();

    // before getting into regexps, try simple matches
    // and overwrite the input
    var simple_colors = {
        aliceblue: 'f0f8ff',
        antiquewhite: 'faebd7',
        aqua: '00ffff',
        aquamarine: '7fffd4',
        azure: 'f0ffff',
        beige: 'f5f5dc',
        bisque: 'ffe4c4',
        black: '000000',
        blanchedalmond: 'ffebcd',
        blue: '0000ff',
        blueviolet: '8a2be2',
        brown: 'a52a2a',
        burlywood: 'deb887',
        cadetblue: '5f9ea0',
        chartreuse: '7fff00',
        chocolate: 'd2691e',
        coral: 'ff7f50',
        cornflowerblue: '6495ed',
        cornsilk: 'fff8dc',
        crimson: 'dc143c',
        cyan: '00ffff',
        darkblue: '00008b',
        darkcyan: '008b8b',
        darkgoldenrod: 'b8860b',
        darkgray: 'a9a9a9',
        darkgreen: '006400',
        darkkhaki: 'bdb76b',
        darkmagenta: '8b008b',
        darkolivegreen: '556b2f',
        darkorange: 'ff8c00',
        darkorchid: '9932cc',
        darkred: '8b0000',
        darksalmon: 'e9967a',
        darkseagreen: '8fbc8f',
        darkslateblue: '483d8b',
        darkslategray: '2f4f4f',
        darkturquoise: '00ced1',
        darkviolet: '9400d3',
        deeppink: 'ff1493',
        deepskyblue: '00bfff',
        dimgray: '696969',
        dodgerblue: '1e90ff',
        feldspar: 'd19275',
        firebrick: 'b22222',
        floralwhite: 'fffaf0',
        forestgreen: '228b22',
        fuchsia: 'ff00ff',
        gainsboro: 'dcdcdc',
        ghostwhite: 'f8f8ff',
        gold: 'ffd700',
        goldenrod: 'daa520',
        gray: '808080',
        green: '008000',
        greenyellow: 'adff2f',
        honeydew: 'f0fff0',
        hotpink: 'ff69b4',
        indianred : 'cd5c5c',
        indigo : '4b0082',
        ivory: 'fffff0',
        khaki: 'f0e68c',
        lavender: 'e6e6fa',
        lavenderblush: 'fff0f5',
        lawngreen: '7cfc00',
        lemonchiffon: 'fffacd',
        lightblue: 'add8e6',
        lightcoral: 'f08080',
        lightcyan: 'e0ffff',
        lightgoldenrodyellow: 'fafad2',
        lightgrey: 'd3d3d3',
        lightgreen: '90ee90',
        lightpink: 'ffb6c1',
        lightsalmon: 'ffa07a',
        lightseagreen: '20b2aa',
        lightskyblue: '87cefa',
        lightslateblue: '8470ff',
        lightslategray: '778899',
        lightsteelblue: 'b0c4de',
        lightyellow: 'ffffe0',
        lime: '00ff00',
        limegreen: '32cd32',
        linen: 'faf0e6',
        magenta: 'ff00ff',
        maroon: '800000',
        mediumaquamarine: '66cdaa',
        mediumblue: '0000cd',
        mediumorchid: 'ba55d3',
        mediumpurple: '9370d8',
        mediumseagreen: '3cb371',
        mediumslateblue: '7b68ee',
        mediumspringgreen: '00fa9a',
        mediumturquoise: '48d1cc',
        mediumvioletred: 'c71585',
        midnightblue: '191970',
        mintcream: 'f5fffa',
        mistyrose: 'ffe4e1',
        moccasin: 'ffe4b5',
        navajowhite: 'ffdead',
        navy: '000080',
        oldlace: 'fdf5e6',
        olive: '808000',
        olivedrab: '6b8e23',
        orange: 'ffa500',
        orangered: 'ff4500',
        orchid: 'da70d6',
        palegoldenrod: 'eee8aa',
        palegreen: '98fb98',
        paleturquoise: 'afeeee',
        palevioletred: 'd87093',
        papayawhip: 'ffefd5',
        peachpuff: 'ffdab9',
        peru: 'cd853f',
        pink: 'ffc0cb',
        plum: 'dda0dd',
        powderblue: 'b0e0e6',
        purple: '800080',
        red: 'ff0000',
        rosybrown: 'bc8f8f',
        royalblue: '4169e1',
        saddlebrown: '8b4513',
        salmon: 'fa8072',
        sandybrown: 'f4a460',
        seagreen: '2e8b57',
        seashell: 'fff5ee',
        sienna: 'a0522d',
        silver: 'c0c0c0',
        skyblue: '87ceeb',
        slateblue: '6a5acd',
        slategray: '708090',
        snow: 'fffafa',
        springgreen: '00ff7f',
        steelblue: '4682b4',
        tan: 'd2b48c',
        teal: '008080',
        thistle: 'd8bfd8',
        tomato: 'ff6347',
        turquoise: '40e0d0',
        violet: 'ee82ee',
        violetred: 'd02090',
        wheat: 'f5deb3',
        white: 'ffffff',
        whitesmoke: 'f5f5f5',
        yellow: 'ffff00',
        yellowgreen: '9acd32'
    };
    for (var key in simple_colors) {
        if (color_string == key) {
            color_string = simple_colors[key];
        }
    }
    // emd of simple type-in colors

    // array of color definition objects
    var color_defs = [
        {
            re: /^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,
            example: ['rgb(123, 234, 45)', 'rgb(255,234,245)'],
            process: function (bits){
                return [
                    parseInt(bits[1]),
                    parseInt(bits[2]),
                    parseInt(bits[3])
                ];
            }
        },
        {
            re: /^(\w{2})(\w{2})(\w{2})$/,
            example: ['#00ff00', '336699'],
            process: function (bits){
                return [
                    parseInt(bits[1], 16),
                    parseInt(bits[2], 16),
                    parseInt(bits[3], 16)
                ];
            }
        },
        {
            re: /^(\w{1})(\w{1})(\w{1})$/,
            example: ['#fb0', 'f0f'],
            process: function (bits){
                return [
                    parseInt(bits[1] + bits[1], 16),
                    parseInt(bits[2] + bits[2], 16),
                    parseInt(bits[3] + bits[3], 16)
                ];
            }
        }
    ];

    // search through the definitions to find a match
    for (var i = 0; i < color_defs.length; i++) {
        var re = color_defs[i].re;
        var processor = color_defs[i].process;
        var bits = re.exec(color_string);
        if (bits) {
            channels = processor(bits);
            this.r = channels[0];
            this.g = channels[1];
            this.b = channels[2];
            this.ok = true;
        }

    }

    // validate/cleanup values
    this.r = (this.r < 0 || isNaN(this.r)) ? 0 : ((this.r > 255) ? 255 : this.r);
    this.g = (this.g < 0 || isNaN(this.g)) ? 0 : ((this.g > 255) ? 255 : this.g);
    this.b = (this.b < 0 || isNaN(this.b)) ? 0 : ((this.b > 255) ? 255 : this.b);

    // some getters
    this.toRGB = function () {
        return 'rgb(' + this.r + ', ' + this.g + ', ' + this.b + ')';
    };
    this.toHex = function () {
        var r = this.r.toString(16);
        var g = this.g.toString(16);
        var b = this.b.toString(16);
        if (r.length == 1) r = '0' + r;
        if (g.length == 1) g = '0' + g;
        if (b.length == 1) b = '0' + b;
        return '#' + r + g + b;
    };

    // help
    this.getHelpXML = function () {

        var examples = new Array();
        // add regexps
        for (var i = 0; i < color_defs.length; i++) {
            var example = color_defs[i].example;
            for (var j = 0; j < example.length; j++) {
                examples[examples.length] = example[j];
            }
        }
        // add type-in colors
        for (var sc in simple_colors) {
            examples[examples.length] = sc;
        }

        var xml = document.createElement('ul');
        xml.setAttribute('id', 'rgbcolor-examples');
        for (var i = 0; i < examples.length; i++) {
            try {
                var list_item = document.createElement('li');
                var list_color = new RGBColor(examples[i]);
                var example_div = document.createElement('div');
                example_div.style.cssText =
                        'margin: 3px; '
                        + 'border: 1px solid black; '
                        + 'background:' + list_color.toHex() + '; '
                        + 'color:' + list_color.toHex()
                ;
                example_div.appendChild(document.createTextNode('test'));
                var list_item_value = document.createTextNode(
                    ' ' + examples[i] + ' -> ' + list_color.toRGB() + ' -> ' + list_color.toHex()
                );
                list_item.appendChild(example_div);
                list_item.appendChild(list_item_value);
                xml.appendChild(list_item);

            } catch(e){}
        }
        return xml;

    };

}


// jquery flash (by Eric)

jQuery.fn.flashText = function(htmlOptions) {
	this.flash(
		htmlOptions, 
		{ version: 8 },
		function(htmlOptions) {
			// add a class indicating we have flash
			$('html').addClass('flash-text-has-flash');
			
			// check if this element has previously been done
			if (!$(this).is('.flash-text-replaced')) {

				// set wMode to transparent to not show white background and to place the movie in the page z order
				htmlOptions.wMode = 'transparent';

				// dump the text into an 'alt' div for printing, sizing etc.
				this.innerHTML = "<span class='alt'>"+this.innerHTML+"</span>";
				
				var $alt = $(this.firstChild);

				// remove a's which are named anchors from the alternate text and put back into 
				// parent container
				var $anchor = $('a', $alt).not('[href]');
				$anchor.after($anchor.html());
				$anchor.html("");
				$(this).prepend($anchor);
				
				// pass the text into the flash movie
				htmlOptions.flashvars.txt = $alt[0].innerHTML.replace(/%/, "%25").trim();
						
				// pass the text size through to the flash movie
				htmlOptions.height = $alt.height();
				htmlOptions.width = $alt.width();
				
				// initialise the flashvars parameter if needed
				if (typeof(htmlOptions.flashvars) == 'undefined') {
					htmlOptions.flashvars = {};
				}
				if (typeof(htmlOptions.flashvars.css) == 'undefined') {
					htmlOptions.flashvars.css = "";				
				}
				
				// write out CSS styles
				var allowedElements = [$alt, $('a', $alt[0])];
				var allowedStyles = ['font-style', 'text-align', 'text-decoration'];
				
				for (var i = 0; i < allowedElements.length; i++) {
					var $item = allowedElements[i];
					if ($item.length > 0) {
						// special case color style
						var css = "{ color: " + (new RGBColor($item.css('color'))).toHex() + "; ";

						// special case font-weight style
						// IE reports font weight as number, 400 == normal
						// flash doesn't recognise the number version of font-weight
						// so we need to normalise it
						var fontWeight = $item.css("font-weight");
						if (typeof(fontWeight) == "number") {
							fontWeight = fontWeight > 400 ? "bold" : "normal";
						} 
						css += "font-weight: " + fontWeight + "; ";
						
						// write out other allowed styles
						for (var j = 0; j < allowedStyles.length; j++) {
							css += allowedStyles[j] + ": " + $item.css(allowedStyles[j]) + "; ";
						}
						
						// close style block
						css += "} ";
						
						if ($item !== $alt) {
							// we have an 'a' tag, write out hover style
							css += "a:hover { text-decoration: " + (($item.css('text-decoration') == 'none') ? 'underline' : 'none') + "} ";
							// write css selector on front of rules
							css = "a " + css;
						}
						else {
							// write css selector on front of rules
							css = "* " + css;
						}
						
						htmlOptions.flashvars.css += css;
					}
				}

				// do the replacement
				if (!jQuery.fn.flashText.debug) {
					// if we're not debugging, insert the movie
						$(this).addClass('flash-text-replaced');
						$(this).append($.fn.flash.transform(htmlOptions));	
				}
				else {
					// otherwise only insert the movie when clicked (for debugging)
					$(this).bind('click', flashReplace);
				}
			}
			
			function flashReplace(element) {
					element = (element == null) ? element : this;
					$(element).addClass('flash-text-replaced');
					$(element).prepend($.fn.flash.transform(htmlOptions));	
					$(element).unbind('click', flashReplace);
			}
		}
	);
};

jQuery.fn.resizeFlashText = function() {
	return this.each(function() {
		var $alt = $("span.alt", this);
		var $movie = $("object,embed", this);
		$movie.css('position', 'absolute');
		$alt.css({position: 'static', visibility: 'hidden'});
		$movie.height($alt.height());
		$movie.width($alt.width());
		$movie.css('position', 'static');
		$alt.css({position: 'absolute', visibility: 'visible'});
	});
};

//////////////////////////////////////////////
//	DO NOT COMPRESS THIS FUNCTION!!! (eric)
//////////////////////////////////////////////

jQuery.fn.flash.replace = function(htmlOptions) {
	if (typeof(htmlOptions.width) == 'undefined') {
		htmlOptions.width = $(this).width();
	}
	if (typeof(htmlOptions.height) == 'undefined') {
		htmlOptions.height = $(this).height();
	}
	htmlOptions.wMode = 'transparent';
	// must use innerHTML for External Interface to work in IE
	var id = typeof(htmlOptions.id) == "undefined" ? "" : htmlOptions.id;
	
	this.innerHTML = $.fn.flash.transform(htmlOptions) + '<div class="alt">'+this.innerHTML+'</div>';
	
	// major work around for IE brokenness with External Interface and flash contained within a form
	// IE blows chunks here (but then, so does the Flash javascript in assuming the 
	// movie is available in the global namespace)
	if ($.browser.msie && id != "" && $(this).parents("form").length > 0) {
		window[id] = document.forms[0][id];
	}
	
	$(this).addClass('flash-replaced');
};

jQuery.fn.flashText.debug = false;
;/*****************************************************************************************
 *
 *	Areeba Javascript Library
 *	Author: Eric Orton
 *
 ****************************************************************************************/
// $$Revision: 1 $

/**
 * This provides us with a namespace.  Everything in this file is under arb.XXX
 *  so as not to interfere with the operation of any other included scripts.
 */
var arb = { };


arb.prefs = {
	promptText: true,
	focusHighlighting: true,
	popupHelp: false,
	tableStriping: true
};

arb.init = function(options) {
	options = $.extend(arb.prefs, options);
	arb.element.addClass(document.body.parentNode, "js");
	if (options.promptText) { arb.form.initPromptText(); }	
	if (options.focusHighlighting) { arb.form.initFocusHighlighting(); }
	if (options.popupHelp) { arb.form.initPopupHelp(); }
	if (options.tableStriping) { arb.functions.stripeTables(); }
};

/**
 * Javascript language extensions for inheritance etc.
 */
arb.lang = {
	/**
	 * Implements inheritance from a given base class.  Adds a 'superClass' member
	 * to the subclass which points to the base class's 'prototype' member.  This allows
	 * calling methods in the base class via "SubClassName.superClass.method.call(this, arg1, arg2);".
	 * @param {Object} subClass
	 * @param {Object} baseClass
	 * @return {Object}
	 */
	inherit: function(subClass, baseClass) {
		// create an instance of the base class with an empty constructor (the constructor
		// might have side effects.
		function inheritance() {}
		inheritance.prototype = baseClass.prototype;
	
		// attach the instance of the base class to our sub class's 'prototype' member,
		// this is the js lookup chain for members not implemented in an instance of an 
		// object
		subClass.prototype = new inheritance();
		subClass.prototype.constructor = subClass;
		subClass.superClass = baseClass.prototype;
		subClass.superClass.constructor = baseClass;
	},
	
	/**
	 * Add the methods and properties from the augmenter to the augmentee.
	 * 
	 * @param {Object} augmenter
	 * @param {Object} augmentee
	 */
	augment: function(augmentee, augmenter){
		for (p in augmenter.prototype) {
			if (!augmentee.prototype[p]) {
				augmentee.prototype[p] = augmenter.prototype[p];
			}
		}
	}
};

arb.event = {
	/**
	 * 	Add the given event handler, preserving existing event handler functions.   The event handler
	 *	is passed the event object as it's only argument, and within the event handler "this" refers to the element 
	 *	being acted on.
	 *
	 *	@param	{DOM Node} elem, the element to add the event handler to
	 *	@param	{String} eventName, the name of the event, eg/ "load", "mouseover"
	 *	@param	{function} func, the function to call when the event is fired.
	 *	@author	Eric Orton &lt;eric.orton@areeba.com.au&gt;
	 */
	addHandler: function (elem, eventName, func) {
		// make a function which lets 'this' be used in our handlers and fixes e to point to an event
		var handlerFunc = function(e) {
			e = e ? e : window.event;
			elem.__f = func;
			var s = elem.__f(e);
			elem.__f = null;
			return s;
		};
		
		var currentHandler = elem['on' + eventName];
		if (typeof(currentHandler) == 'function') { // not first handler
			elem['on' + eventName] = function(e) {
				var x = currentHandler(e);
				var y = handlerFunc(e);
				return x && y;
			};
		} else { // first handler
			elem['on' + eventName] = handlerFunc;
		}
	 }
};


arb.event.standardHandler = {

	/**
	 * 	Adds a classname on mouseover and removes it on mouseout.
	 *
	 *	@param	{DOM Node} elem, the element to add the event handlers to
	 *	@param	{String} optional hoverClass, the class to apply when hovering, defaults to "arb-hover"
	 *	@author	Eric Orton &lt;eric.orton@areeba.com.au&gt;
	 */
	hover: function(element, hoverClass) {
		hoverClass = (hoverClass != null) ? hoverClass : 'arb-hover'; 
		arb.event.addHandler(element, 'mouseover', function() { arb.element.addClass(this, 'arb-hover'); } );
		arb.event.addHandler(element, 'mouseout', function() { arb.element.removeClass(this, 'arb-hover'); } );
	},

	/**
	 * 	add event handlers for mouseover and mouseout which are only called when the event applies to the given 
	 *	DOM node, and not when the target is a contained node.
	 *
	 *	@param	{DOM Node} element, the element to add the event handlers to
	 *	@param	{Function} f, the mouseover event handler
	 *	@param	{Function} g, the mouseout event handler
	 *	@author	Eric Orton &lt;eric.orton@areeba.com.au&gt;
	 */
	hoverFns: function(element, f, g) {
		// A private function for handling mouse 'hovering'
		function handleHover(e) {
			// Check if mouse(over|out) are still within the same parent element
			var p = (e.type == "mouseover" ? e.fromElement : e.toElement) || e.relatedTarget;
	
			// Traverse up the tree
			while ( p && p != element ) p = p.parentNode;
			
			// If we actually just moused on to a sub-element, ignore it
			if ( p == element ) return false;
			
			// Execute the right function
			element.__g = (e.type == "mouseover" ? f : g);
			var s = element.__g(e);
			element.__g = null;
			return s;
		}
		
		// Bind the function to the two event listeners
		arb.event.addHandler(element, 'mouseover', handleHover);
		arb.event.addHandler(element, 'mouseout', handleHover);
	}
};


arb.element = {
	/**
	 * 	Add a class to a DOM node.
	 *
	 *	@param	{DOM Node} theNode, the element to add the class to
	 *	@param	{String} theClass, the class name to add
	 *	@author	Eric Orton &lt;eric.orton@areeba.com.au&gt;
	 */
	addClass: function(theNode, theClass) {
		if (theNode.className == '') {
			theNode.className = theClass;
		} else {
			theNode.className += ' ' + theClass;
		}
	},
	
	/**
	 * 	Removes the specified class from the given element
	 *
	 *	@param	{DOM Node} theNode, the element to remove the class from
	 *	@param	{String} theClass, the class name to remove
	 *	@author	Eric Orton &lt;eric.orton@areeba.com.au&gt;
	 */
	removeClass: function(theNode, theClass) {
		var oldClass = theNode.className;
		var regExp = new RegExp('\\s?\\b'+theClass+'\\b');
		if (oldClass.match(regExp) != null) {
			theNode.className = oldClass.replace(regExp,'');
		}
	},
	
	/**
	 * 	Checks whether the DOM node has a specified class
	 *
	 *	@param	{DOM Node} elem, the element to check
	 *	@param	{String} theClass, the class name to check for
	 *	@type	Boolean, true if it has the class
	 *	@author	Eric Orton &lt;eric.orton@areeba.com.au&gt;
	 */
	hasClass: function(elem, theClass) {
		var regExp = new RegExp('\\b'+theClass+'\\b');
		return (elem.className.match(regExp) != null);
	},
	
	/**
	 * 	Read the value of the style for the given element.
	 *
	 *	@param	{DOM Node} oNode, the element to query
	 *	@param	{String} sProperty, the css property to retrieve the value for
	 *	@type	(String), the property value, or null if it can't be retrieved
	 *	@author	Eric Orton &lt;eric.orton@areeba.com.au&gt;
	 */
	getCSSProperty: function(oNode, sProperty) {
		if(document.defaultView) {
			return document.defaultView.getComputedStyle(oNode, null).getPropertyValue(sProperty);
		} else if(oNode.currentStyle) {
			for(var reExp = /-([a-z])/; reExp.test(sProperty); sProperty = sProperty.replace(reExp, RegExp.$1.toUpperCase())) {
				;
			}
			return oNode.currentStyle[sProperty];
		}
		else {
			return null;
		}
	},
	
	/**
	 * 	Move a DOM nodes children to be children of another node
	 *
	 *	@param	{DOM Node} fromElem, the DOM node to move the children from
	 *	@param	{DOM Node} fromElem, the DOM node to move the children to
	 *	@author	Eric Orton &lt;eric.orton@areeba.com.au&gt;
	 */
	moveChildren: function(fromElem, toElem) {
		var nextChild;
		for(var child = fromElem.childNodes[0]; child != null; child = nextChild) {
			var nextChild = child.nextSibling;
			fromElem.removeChild(child);
			toElem.appendChild(child);
		}
	}
};

arb.element.position = {
	/**
	 * 	Return the absolute distance of the left of the element to the left of the document
	 *
	 *	@param	{DOM Node} el, the DOM node to get the position of
	 *	@type	(Number), the distance in pixels
	 *	@author	Eric Orton &lt;eric.orton@areeba.com.au&gt;
	 */
	left: function(el){
		var l=el.offsetLeft;
		while((el=el.parentNode) && el!=document)
			l+=el.offsetLeft;
		return l;
	},
	
	/**
	 * 	Return the absolute distance of the top of the element to the top of the document
	 *
	 *	@param	{DOM Node} el, the DOM node to get the position of
	 *	@type	(Number), the distance in pixels
	 *	@author	Eric Orton &lt;eric.orton@areeba.com.au&gt;
	 */
	top: function(el){
		var t=el.offsetTop;
		while((el=el.parentNode) && el!=document)
			t+=el.offsetTop || 0;
		return t;
	}		
};


arb.form = {
	/**
	 * 	Add event handlers to any &lt;input&gt; on the page with a 'promptValue' attribute to 
	 *  display the 'promptValue' as the 'Value' when the 'Value' is empty, and to clear the 'Value'
	 *  when the input is focus'ed.  While the &lt;input&gt; is displaying the 'promptValue', it has 
	 *  a class of 'displayingPromptValue' applied to it.
	 *
	 *	@author	Eric Orton &lt;eric.orton@areeba.com.au&gt;
	 */
	initPromptText: function() {
		/* 
		 * local function definitions 
		 */
		function _cleanupPromptTextOnSubmit(e) {
			var inputs = this.getElementsByTagName('input');
			for(var j=0; j < inputs.length; j++) {
				_clearPromptText(inputs[j]);
			}			
		}	
		function _clearPromptText(elem) {
			if($(elem).hasClass('replaced-password')) {
				var $text = $(elem);
				elem = $text.prev()[0];
				_clearPromptText(elem);
				$(elem).show();
				elem.focus();
				$text.remove();
				return;
			}
			if(elem.value == elem.getAttribute("title")) {
				elem.value = "";
				arb.element.removeClass(elem, 'displayingPromptValue');
			}
		}
		function _addPromptText(elem) {
			/* only add the prompt text if this item isn't disabled */
			if((elem.getAttribute('disabled') == null || elem.getAttribute('disabled') == false) 
				&& (!elem.value || elem.value == "" || elem.value == elem.getAttribute("title"))) {
				elem.value = elem.getAttribute("title");
				arb.element.addClass(elem, 'displayingPromptValue');
				if (elem.type == 'password') {
					$(elem).hide();
					var $text = $("<input type='text' />");
					$text.val(elem.value);
					$text.attr('class', $(elem).attr('class'));
					$text.addClass('replaced-password');
					$(elem).after($text);
					$text.bind('focus', _clearPromptTextHandler);
				}
			}
		}

		function _clearPromptTextHandler(e) { _clearPromptText(this); }
		function _replacePromptText(e) { _addPromptText(this); } 			

		/* 
		 * Start of function code 
		 */
		if(!document.getElementsByTagName) return false;
		var forms = document.getElementsByTagName('form');
		
		for(var i = (forms.length - 1); i > -1; i--) { 
			var inputs = forms[i].getElementsByTagName('input');
			arb.event.addHandler(forms[i], 'submit', _cleanupPromptTextOnSubmit);
			for(var j=0; j < inputs.length; j++) {
				var theInput = inputs[j];
				if(theInput.getAttribute("title")) {
					var selectedNode;
					// IE only, check if we're already focused
					if (typeof document.selection != "undefined" && document.selection != null && typeof window.opera == "undefined") {
						/* find the currently focused page element */
						selectedNode = document.selection.createRange().parentElement();
					}
					/* only insert prompt text at start if not focused in input */
					if(selectedNode != theInput) {
						_addPromptText(theInput);
					}
					/* add the focus and blur handlers to add/remove prompt text */
					arb.event.addHandler(theInput, 'focus', _clearPromptTextHandler);
					arb.event.addHandler(theInput, 'blur', _replacePromptText);
				}
			}
		}		
	},
				
	/**
	 * 	Add event handlers to any &lt;input&gt; on the page with an associated &lt;label&gt; which will
	 *	add a class of 'arbHasFocus' to both items when the input is focused.
	 *
	 *	@author	Eric Orton &lt;eric.orton@areeba.com.au&gt;
	 */
	initFocusHighlighting: function() {
		/* 
		 * local function definitions 
		 */
		function _focus(e) {
			if(arb.element.hasClass(this, 'arbHasFocus')) return true;
			arb.element.addClass(this, 'arbHasFocus');
			for(var i = 0; i < this._labels.length; i++) {
				arb.element.addClass(this._labels[i], 'arbHasFocus');
			}
			if($(this).parents(".form-item").length > 0) {
				$(this).parents(".form-item").addClass('focussed-form-item');	
			}
		}
		
		function _blur(e) {
			arb.element.removeClass(this, 'arbHasFocus');
			for(var i = 0; i < this._labels.length; i++) {
				arb.element.removeClass(this._labels[i], 'arbHasFocus');			
			}
			if ($(this).parents(".form-item").length > 0) {
			    $(this).parents(".form-item").removeClass('focussed-form-item');	
			}
		}

		/* 
		 * Start of function code 
		 */
		
		var labels = document.getElementsByTagName('label');
		
		for(var i = (labels.length -1); i > -1; i--) {
			var inputID = labels[i].getAttribute('for') ? labels[i].getAttribute('for') : labels[i].getAttribute('htmlFor');
			if(inputID) {
				var input = document.getElementById(inputID);
				if(!input._labels) input._labels = new Array();
				input._labels.push(labels[i]);
				$(input).bind( 'focus', _focus);
				$(input).bind( 'blur', _blur);
			}
		}
	}
};

arb.debug = {
	/**
	 * 	Print passed messages to an onscreen box.
	 *
	 *	@param	{String | Object}, the message to print, or an object to dump
	 *	@author	Eric Orton &lt;eric.orton@areeba.com.au&gt;
	 */
	debugCounter: 0,
	
	log: function(strMessage) {
		var debugBox = document.getElementById('debugBox');
		var msgP = document.createElement('DIV');

		if (typeof(strMessage) == 'object') {
			var object = strMessage;
			strMessage = object + '';
			for (var key in object) {
				strMessage += "<br />" + key + ' => ' + object[key];
			}
		}
		
		msgP.innerHTML = arb.debug.debugCounter + ': ' + strMessage;
		arb.debug.debugCounter++;
		
		if(!debugBox) {
			debugBox = document.createElement('DIV');
			debugBox.style.position = 'absolute';
			debugBox.style.zIndex = '3000';
			debugBox.style.width = '280px';
			debugBox.style.height = '280px';
			debugBox.style.top = '0';
			debugBox.style.right = '0';
			debugBox.style.backgroundColor = "#dddddd";
			debugBox.style.overflow = 'auto';
			debugBox.onclick = function(){this.style.display = 'none';};
			debugBox.id = 'debugBox';
			document.body.appendChild(debugBox);
		}
		debugBox.style.display = 'block';
		debugBox.insertBefore(msgP, debugBox.firstChild);
	}
};

arb.url = {
	/**
	 * 	Test if the two URL's refer to the same resource.
	 *
	 *	@param	{String} left, the first URL
	 *	@param	{String} right, the second URL
	 *	@author	Eric Orton &lt;eric.orton@areeba.com.au&gt;
	 */
	equal: function(left, right) {
		// normalise our url's
		left = arb.url.normalise(left);
		right = arb.url.normalise(right);

		// compare them, simple when they're normalised
		return left == right;
	},
	
	/**
	 * 	Return a normalised URL.  The URL includes no query
	 *	string or page anchor and has the default.aspx or index.htm(l) stripped off.
	 *
	 *	@param	{String} url, the URL to normalise
	 *	@type	(String), the normalised URL
	 *	@author	Eric Orton &lt;eric.orton@areeba.com.au&gt;
	 */
	normalise: function(url) {
		// Lowercase our URL.  Very, very few web servers out there are case sensitive
		url = url.toLowerCase();
		
		// Chop off any query string
		url = url.replace(/^(.*)\?.*$/, "$1");

		// Chop off any page anchor
		url = url.replace(/^(.*)#.*$/, "$1");

		// Chop off any "default.aspx etc."
		url = url.replace(/^(.*)\/(default|index)\.(aspx|htm(l?))$/i, "$1");

		// Chop off any "/"
		url = url.replace(/^(.*)\/$/i, "$1");

		return url;
	},
	
	/**
	 * 	Return the parent page of the given page in the form of a normalised URL.
	 *
	 *	@param	{String} url, the URL to normalise
	 *	@type	(String), the normalised URL of the parent page
	 *	@author	Eric Orton &lt;eric.orton@areeba.com.au&gt;
	 */
	parentPage: function(url) {
			// normalise the url (no default.aspx etc.)
			url = arb.url.normalise(url);
			
			// If the path ends in .aspx or .html or .htm, chop the filename to
			// try matching our parent
			if (url.match(/^.*\/.*?\.(aspx|htm(l?))$/i)) 
			{
				return url.replace(/^(.*)\/.*?$/i, "$1");
			}
			// Else, if it's a directory reference, chop off a path component and return that
			else if (url.match(/^http(s)?:\/\/.+\/.*$/)) 
			{
				return url.replace(/^(http(s)?:\/\/.+)\/.*?$/i, "$1");
			}
			
			// else, we're outta luck
			return "";
	},
	
	/**
	 * 	Get the value of a given query string parameter
	 *
	 *	@param	{String} variable, the name of the parameter to retrieve
	 *	@type	(String), parameter value
	 *	@author	Eric Orton &lt;eric.orton@areeba.com.au&gt;
	 */
	getParam: function(variable) {
		var query = window.location.search.substring(1);
		var vars = query.split("&");
		for (var i = 0; i < vars.length; i++) {
			var pair = vars[i].split("=");
			if (pair[0] == variable) {
				return pair[1];
			}
		} 
		return null;
	}
};

arb.text = {
	
	/**
	 * 	This function is to percent encoding a string for URIs
	 *
	 *	@alias 	arb.text.percentEncode
	 *	@param	{String} string to encode
	 */
	percentEncode: function( textString ) {
		
		var haut = 0;
		var n = 0;
		CPstring = '';
		for (var i = 0; i < textString.length; i++) {
			var b = textString.charCodeAt(i); 
			if (b < 0 || b > 0xFFFF) {
				CPstring += 'Error ' + arb.text.dec2hex(b) + '!';
			}
			if (haut != 0) {
				if (0xDC00 <= b && b <= 0xDFFF) {
					CPstring += arb.text.dec2hex(0x10000 + ((haut - 0xD800) << 10) + (b - 0xDC00)) + ' ';
					haut = 0;
					continue;
				} else {
					CPstring += '!erreur ' + arb.text.dec2hex(haut) + '!';
					haut = 0;
				}
			}
			if (0xD800 <= b && b <= 0xDBFF) {
				haut = b;
			} else {
				CPstring += arb.text.dec2hex(b) + ' ';
			}
		}
		textString = CPstring.substring(0, CPstring.length-1);
		
		// textstring: sequence of Unicode code points, derived from convertChar2CP()
		var outputString = "";
		// remove initial spaces
		textString = textString.replace(/^\s+/, '');
		if (textString.length == 0) { return ""; }
		// make all multiple spaces a single space
		textString = textString.replace(/\s+/g, ' ');
		var listArray = textString.split(' ');
		// process each codepoint
		for ( var i = 0; i < listArray.length; i++ ) {
			var n = parseInt(listArray[i], 16);
			if (n == 0x20) { outputString += '%20'; }
			else if (n >= 0x41 && n <= 0x5A) { outputString += String.fromCharCode(n); } // alpha
			else if (n >= 0x61 && n <= 0x7A) { outputString += String.fromCharCode(n); } // alpha
			else if (n >= 0x30 && n <= 0x39) { outputString += String.fromCharCode(n); } // digits
			else if (n == 0x2D || n == 0x2E || n == 0x5F || n == 0x7E) { outputString += String.fromCharCode(n); } // - . _ ~
			else if (n <= 0x7F) { outputString += '%'+arb.text.dec2hex2(n); }
			else if (n <= 0x7FF) { outputString += '%'+arb.text.dec2hex2(0xC0 | ((n>>6) & 0x1F)) + '%' + arb.text.dec2hex2(0x80 | (n & 0x3F)); } 
			else if (n <= 0xFFFF) { outputString += '%'+arb.text.dec2hex2(0xE0 | ((n>>12) & 0x0F)) + '%' + arb.text.dec2hex2(0x80 | ((n>>6) & 0x3F)) + '%' + arb.text.dec2hex2(0x80 | (n & 0x3F)); } 
			else if (n <= 0x10FFFF) {outputString += '%'+arb.text.dec2hex2(0xF0 | ((n>>18) & 0x07)) + '%' + arb.text.dec2hex2(0x80 | ((n>>12) & 0x3F)) + '%' + arb.text.dec2hex2(0x80 | ((n>>6) & 0x3F)) + '%' + arb.text.dec2hex2(0x80 | (n & 0x3F)); } 
			else { outputString += '!Error ' + arb.text.dec2hex(n) +'!'; }
		}
		return( outputString );
	},
	
	/**
	 * 	This function is to change a character to a two character hexidecimal
	 *
	 *	@alias 	arb.text.dec2hex2
	 *	@param	{String} string to encode
	 */
	dec2hex2: function( textString ) {
		var hexequiv = new Array ("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F");
		return hexequiv[(textString >> 4) & 0xF] + hexequiv[textString & 0xF];
	},
	
	/**
	 * 	This function is to change a character to a one character hexidecimal
	 *
	 *	@alias 	arb.text.dec2hex
	 *	@param	{String} string to encode
	 */
	dec2hex: function ( textString ) {
		return (textString+0).toString(16).toUpperCase();
	}
	
};

arb.functions = {
	/**
	 * 	Traverses a ul/li/a menu structure under an element with the passed id
	 *	and determines which item is the current page.
	 *	Marks the current page's item with a class of 'active', and all it's 
	 *	parents with a class of 'expanded'.
	 *
	 *	@param	{String} id, id of the element containing the navigation menu
	 *	@author	Eric Orton &lt;eric.orton@areeba.com.au&gt;
	 */
	expandMenu: function(id) {
		if(!document.getElementById) { 
			return; 
		}
		
		var menu = document.getElementById(id);
		if(!menu) { 
			return;
		}
		
		var menuItems = menu.getElementsByTagName("a");
		var activeMenuItem;
		var searchLocation = document.location.href;
		
		// set the class of "menus-expanded" on a new child of the top level menu
		// containing all the previous children.
		var innerDiv = document.createElement('div');
		arb.element.addClass(innerDiv, 'menus-expanded');	
		arb.element.moveChildren(menu, innerDiv);
		menu.appendChild(innerDiv);
		
		// find the currently active menu item.  If the page exists in more than one place
		// in the navigation heirarchy, this will only find one.  Which one depends on the
		// order of links returned by getElementsByTagName("a")
		do {
			for (var i=0; i<menuItems.length; i++){
				if (menuItems[i].href && arb.url.equal(menuItems[i].href, searchLocation)) {
					activeMenuItem = menuItems[i];
					break;
				}
			}
		
			// If we've exited the above loop without a match, adjust our searchLocation and try again.
			if (!activeMenuItem) {
				searchLocation = arb.url.parentPage(searchLocation);
			}
		} while (!activeMenuItem && searchLocation);
		
		// deal with the active menu item
		// put a class of 'active' on the active menu item, and 'expanded' on it's parent items
		if(activeMenuItem) {
			var parent = activeMenuItem.parentNode;  // our enclosing 'li'
			arb.element.addClass(parent, 'active');
			while(parent != menu) {
				if(parent.nodeName == "LI" || parent.nodeName == "UL") {
					arb.element.addClass(parent, 'expanded');
					if (parent.id != "") {
						arb.element.addClass(parent, parent.id + "-expanded");
					}
				}
				parent = parent.parentNode;
			}
		}
	},
	
	/**
	 * 	Applies "drop down" functionality to a nested &lt;ul&gt;/&lt;li&gt;/&lt;a&gt; menu list.
	 *
	 *	@param	{String} id, id of the element containing the navigation menu
	 *	@author	Eric Orton &lt;eric.orton@areeba.com.au&gt;
	 */
	dropdownMenus: function(id) {
		function _showMenu(e) {
			arb.element.addClass(this, "arb-hover");
			if (typeof(jQuery) != "undefined") {
				$("ul", this).slideDown('fast');		
			}
		}
		function _hideMenu(e) { 
			arb.element.removeClass(this, "arb-hover");
		}
		var elements = document.getElementById(id).getElementsByTagName("LI");
		for (var i=0; i<elements.length; i++) {
			arb.event.standardHandler.hoverFns(elements[i], _showMenu, _hideMenu);
			arb.event.addHandler(elements[i], "focus", _showMenu);
			arb.event.addHandler(elements[i], "blur", _hideMenu);
		}
	},
	
	/**
	 * 	Scans for every table in the page and adds a class of "arb-even" to the &lt;tr&gt; element of each even table row to allow 
	 *	styling of alternate rows.  Also add a class of "arb-hover" to the &lt;tr&gt; element currently being hovered over to allow
	 *	higlighting.
	 *
	 *	@alias 	arb.functions.stripeTables
	 *	@author	Eric Orton &lt;eric.orton@areeba.com.au&gt;
	 */
	 stripeTables: function() {
		if (typeof(jQuery) != "undefined") {
			$(document).ready(function(){
			$("#content tr").hover(function() {$(this).addClass("arb-hover");}, function() {$(this).removeClass("arb-hover");});
			$("#content tr:even").addClass("arb-even");
			});		
		}
	},
		
	/**
	 * 	Replaces selected button inputs with links that call the given callback when clicked.
	 *
	 *	@param	{String} selector, a jquery selector that returns the button inputs to be replaced.
	 *	@param	{Function} callback - optional, the function that will be executed when the link is clicked.
	 *			The function is called as "callback(link, button)" where link is the jquery link
	 *			object, and button is the jquery button object.
	 *			If no callback is specified a default callback which submits the original button
	 *			will be used.
	 *	@author	Eric Orton &lt;eric.orton@areeba.com.au&gt;
	 */
	linkButtons: function(selector, callback) {
		callback = (callback == null) ? defaultCallback : callback;
		
		$(selector).each(function() {
			var button = $(this);
			var text = button.val();
			var link = $('<a href="#" class="link-button"><span>' + text + '</span></a>');
			link.addClass(button.attr("class"));
			button.before(link).hide();
			if (!button.is(":disabled")) {
				link.click(function() { callback(link, button); return false; });
			}
			else {
				link.click(function() { return false; }).attr("href", "");
			}		
		});	
		
		function defaultCallback(link, button) {
			button.click(); 
		}
	},
	
	enhanceTextareas: function () {
		$('textarea:not([wysiwyg-textarea=true])').each(function() {
			$(this)
				.wrap("<div class=\"enhanced-textarea\"></div>")
				.parent()
				.append($("<div class=\"textarea-footer\"></div>"));
			
			arb.functions.expandableTextarea($(this).parent());
			arb.functions.maxlengthTextarea($(this).parent());
		});
	},
	
	expandableTextarea: function (textareaWrapper) {
		var staticOffset = null;
		var textarea = $("textarea", textareaWrapper);
		
		$(".textarea-footer", textareaWrapper)
			.addClass("grippie")
			.mousedown(startDrag);
		
		var grippie = $(".textarea-footer", textareaWrapper)[0];
		
		$(grippie).css("margin-right", grippie.offsetWidth - textarea[0].offsetWidth + "px");

		function startDrag(e) {
			staticOffset = textarea.height() - arb.functions.mousePosition(e).y;
			textarea.css("opacity", 0.25);
			$(document).bind("mousemove", performDrag).bind("mouseup", endDrag);
			return false;
		}

		function performDrag(e) {
			textarea.height(Math.max(32, staticOffset + arb.functions.mousePosition(e).y) + "px");
			return false;
		}

		function endDrag(e) {
			$(document).unbind("mousemove", performDrag).unbind("mouseup", endDrag);
			textarea.css("opacity", 1);
		}
	},

	/**
	 * Returns an object with the x & y coordinates of the mouse relating to the given Event
	 * @param	{Event} e
	 * @return	{Object}	
	 */
	mousePosition: function (e) {
		return {x:e.clientX + document.documentElement.scrollLeft, y:e.clientY + document.documentElement.scrollTop};
	},
	
	maxlengthTextarea: function (textareaWrapper) {
		$("textarea[maxlength]", textareaWrapper)
			// set the max chars
			.each(function(){
				var maxLength  = $(this).attr('maxlength');
				var currentLength = $(this).val().length;
				var html_counter = $("<div class=\"textarea-length-counter\"><span>" + currentLength + "</span>/" + maxLength +" characters</div>");
				$(".textarea-footer", textareaWrapper).append(html_counter);
				this.relatedElement = $('span', html_counter);
			})
			// check the max chars
			.keyup(function(){
				var maxLength     = $(this).attr('maxlength');
				var currentLength = $(this).val().length;
				if(currentLength >= maxLength) {
					this.value = this.value.substring(0, maxLength - 1);
				}
				this.relatedElement.html(currentLength);
			});
	},
	
	/**
	 * 	Inserts font size up/down and print controls into page
	 *
	 *	@param	{String} selector, a jquery selector that identifies the element 
	 *	the controls should be appended to.
	 *	@author	Eric Orton &lt;eric.orton@areeba.com.au&gt;
	 */
	fontSizing: function(insertSelector, options) {
		
		var options = $.extend({
			printText: 'Print page',
			maxFontSize: 140, // %
			minFontSize: 70, // %
			fontIncrement: 16.66, // %
			controlsFontSize: 11, // %
			insertHTML: '<li id="font-size-down-control" title="Decrease font size"><span>A-</span></li><li id="font-size-up-control" title="Increase font size"><span>A+</span></li><li class="print-link" title="'+options.printText+'"><a href="#">'+options.printText+'</a></li>'
		}, options);

		function incrementFontSize(sizeDelta) {
			var newSize = parseFloat(arb.cookie.get("font-size")) + sizeDelta;
			if (newSize > options.minFontSize && newSize < options.maxFontSize) {
				setBodyFontSize(newSize);
				arb.cookie.set("font-size", newSize, {path: "/"});
			}
		}
		
		function setBodyFontSize(size) {
			$("#content").css("font-size", size + "%");
			$("#content #page-controls").css("font-size", options.controlsFontSize+"px"); // Do not change the page controls
			if (((size*1) - options.fontIncrement) < options.minFontSize) {
				$("#font-size-down-control").css("opacity", 0.5);
				$("#font-size-up-control").css("opacity", 1);
			}
			else if (((size*1) + options.fontIncrement) > options.maxFontSize) {
				$("#font-size-down-control").css("opacity", 1);
				$("#font-size-up-control").css("opacity", 0.5);
			}
			else {
				$("#font-size-down-control").css("opacity", 1);
				$("#font-size-up-control").css("opacity", 1);
			}
		}
		
		var fontSize = arb.cookie.get("font-size");
		
		if (!fontSize) {
			arb.cookie.set("font-size", "100", {path: "/"}); // set the default if there' no value
			fontSize = arb.cookie.get("font-size");  // read it back to make sure cookies are supported
		}
	
		// check we can support this functionality
		if (window.print && fontSize) {
			$(insertSelector).prepend(options.insertHTML);
			
			setBodyFontSize(fontSize);
			
			// attach print handler
			$(".print-link a").click(function() {
				window.print();
			});
			
			// attach font down handler
			$("#font-size-down-control").click(function() {
				incrementFontSize(-options.fontIncrement);
			});
	
			// attach font up handler
			$("#font-size-up-control").click(function() {
				incrementFontSize(options.fontIncrement);
			});
			
			// attach hover handler so we can style cursor with a hand on mouseover
			$("#page-controls li").hover(
				function() { $(this).addClass("arb-hover"); },
				function() { $(this).removeClass("arb-hover"); }
			);
		}
	}
};

arb.cookie = {
	/**
	 * 	Set a cookie
	 *
	 *	@param 	String name The name of the cookie.
	 *	@param 	String value The value of the cookie.
	 *	@param 	Hash options A set of key/value pairs for optional cookie parameters.
	 *	@option	Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object.
	 *                             If a negative value is specified (e.g. a date in the past), the cookie will be deleted.
	 *                             If set to null or omitted, the cookie will be a session cookie and will not be retained
	 *                             when the the browser exits.
	 *	@option	String path The value of the path atribute of the cookie (default: path of page that created the cookie).
	 *	@option	String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie).
	 * 	@option	Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will
	 *                        require a secure protocol (like HTTPS).
	 *	@author	Eric Orton &lt;eric.orton@areeba.com.au&gt;
	 */
	set: function(name, value, options) {
        options = options || {};
        var expires = '';
		
		options.expires = options.expires || 356;
		
		var date = new Date();
		date.setTime(date.getTime()+(options.expires*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
		
		var path = options.path ? '; path=' + options.path : '';
        var domain = options.domain ? '; domain=' + options.domain : '';
        var secure = options.secure ? '; secure' : '';
        document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
    },
	
	/**
	 * 	Get the value of a cookie
	 *
	 *	@param 	String name The name of the cookie.
 	 *	@return	The value of the cookie.
 	 *	@type 	String
	 *	@author	Eric Orton &lt;eric.orton@areeba.com.au&gt;
	 */
	get: function(name) {
        var cookieValue = null;
        if (document.cookie && document.cookie != '') {
            var cookies = document.cookie.split(';');
            for (var i = 0; i < cookies.length; i++) {
                var cookie = cookies[i].trim();
                // Does this cookie string begin with the name we want?
                if (cookie.substring(0, name.length + 1) == (name + '=')) {
                    cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
                    break;
                }
            }
        }
        return cookieValue;
    },
	
	/**
	 * 	Delete a cookie
	 *
	 *	@param 	String name The name of the cookie.
	 *	@author	Eric Orton &lt;eric.orton@areeba.com.au&gt;
	 */
	remove: function(name) {
		arb.cookie.set(name, "", {expires: -1});
	}
};	
	
$(document).ready(arb.init);



// ---------------------------------------------------------------------
//                      array.push (if unsupported)
// ---------------------------------------------------------------------
if(Array.prototype.push == null) {
  Array.prototype.push = function(item) {
    this[this.length] = item;
    return this.length;
  };
};


// ---------------------------------------------------------------------
//                      string.trim (our own language addition)
// ---------------------------------------------------------------------
if (String.prototype.trim == null) {
	String.prototype.trim = function() { 
		return this.replace(/^\s+|\s+$/, ''); 
	};
}


// ---------------------------------------------------------------------
// kill dotnets sucky validation rendering and replaces with our own
// ---------------------------------------------------------------------
$(function() {
	if (typeof(ValidatorUpdateDisplay) == 'function') {
		ValidatorUpdateDisplay = function(val) {
			if (typeof(val.display) == "string") {
				if (val.display == "Dynamic") {
					if (val.isvalid && $(val).is(':visible')) {
						$(val).animate({height: 'hide', opacity: 'hide'},'slow', function() {
							if (!$(val).siblings('.error-message').is(':visible')) {
								$(val).parent('.error-messages').parent('.form-item').removeClass('error-form-item');
							}
						});
					}
					else if (!val.isvalid && !$(val).is(':visible')) {
						$(val).animate({height: 'show', opacity: 'show'},'slow').parent('.error-messages').parent('.form-item').addClass('error-form-item');
					}
				}
			}
		}
	}
});

/************************************************************************************
 * @desc intercept .net asynchronous postback responses and insert the content
 *		via jQuery methods so that live-query behaviours can take effect
 ************************************************************************************/
(function() {
	$(document).ready(function() {
		// hook up .net page request event handlers
		if (typeof(Sys) != 'undefined') {
		//	Sys.WebForms.PageRequestManager.getInstance().add_pageLoading(onPageLoading);
		//	Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(onPageLoaded);
		Sys.WebForms.PageRequestManager.getInstance().add_endRequest(onEndRequest);
		}
		
		if (!$.browser.msie) {
			$('button').each(function() {
				if (typeof(this.addEventListener) == 'function') {
					this.addEventListener('click', function(e) {
						if (e.target != this) {
							// stop current event
							e.preventDefault();						
							var me = this;
							window.setTimeout(function() {
								var evt = document.createEvent("MouseEvents");
								evt.initMouseEvent("click", true, true, window,
									0, 0, 0, 0, 0, false, false, false, false, 0, null);
								var canceled = !me.dispatchEvent(evt);
							}, 0);
						}
					}, true);
				}
			});
		}
	});
	
	function onPageLoading(sender, args) {

	}
	function onPageLoaded(sender, args) {

	}
	
	function onEndRequest(sender, args) {
	    arb.functions.enhanceTextareas();
	}
})();
;/*
 *	jquery.flash.js
 */
;(function(){var g;g=jQuery.fn.flash=function(a,b,c,d){if(this.length>0){var e=c||g.replace;b=g.copy(g.pluginOptions,b);if(!g.hasFlash(b.version)){if(b.expressInstall&&g.hasFlash(6,0,65)){var f={flashvars:{MMredirectURL:location,MMplayerType:'PlugIn',MMdoctitle:jQuery('title').text()}}}else if(b.update){e=d||g.update}else{return this}}a=g.copy(g.htmlOptions,f,a);return this.each(function(){e.call(this,g.copy(a))})}};g.copy=function(){var a={},flashvars={};for(var i=0;i<arguments.length;i++){var b=arguments[i];if(b==undefined){continue}jQuery.extend(a,b);if(b.flashvars==undefined){continue}jQuery.extend(flashvars,b.flashvars)}a.flashvars=flashvars;return a};g.hasFlash=function(){if(/hasFlash\=true/.test(location)){return true}if(/hasFlash\=false/.test(location)){return false}var a=g.hasFlash.playerVersion().match(/\d+/g);var b=String([arguments[0],arguments[1],arguments[2]]).match(/\d+/g)||String(g.pluginOptions.version).match(/\d+/g);for(var i=0;i<3;i++){a[i]=parseInt(a[i]||0);b[i]=parseInt(b[i]||0);if(a[i]<b[i]){return false}if(a[i]>b[i]){return true}}return true};g.hasFlash.playerVersion=function(){try{try{var a=new ActiveXObject('ShockwaveFlash.ShockwaveFlash.6');try{a.AllowScriptAccess='always'}catch(e){return'6,0,0'}}catch(e){}return new ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version').replace(/\D+/g,',').match(/^,?(.+),?$/)[1]}catch(e){try{if(navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin){return(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]).description.replace(/\D+/g,",").match(/^,?(.+),?$/)[1]}}catch(e){}}return'0,0,0'};g.htmlOptions={height:240,flashvars:{},pluginspage:'http://www.adobe.com/go/getflashplayer',src:'#',type:'application/x-shockwave-flash',width:320};g.pluginOptions={expressInstall:false,update:false,version:'6.0.65'};g.replace=function(a){this.innerHTML='<div class="alt">'+this.innerHTML+'</div>';jQuery(this).addClass('flash-replaced').prepend(g.transform(a))};g.update=function(a){var b=String(location).split('?');b.splice(1,0,'?hasFlash=true&');b=b.join('');var c='<p>This content requires the Flash Player. <a href="http://www.adobe.com/go/getflashplayer">Download Flash Player</a>. Already have Flash Player? <a href="'+b+'">Click here.</a></p>';this.innerHTML='<span class="alt">'+this.innerHTML+'</span>';jQuery(this).addClass('flash-update').prepend(c)};function toAttributeString(){var s='';for(var a in this){if(typeof this[a]!='function'){s+=a+'="'+this[a]+'" '}}return s};function toFlashvarsString(){var s='';for(var a in this){if(typeof this[a]!='function'){s+=a+'='+arb.text.percentEncode(this[a])+'&'}}return s.replace(/&$/,'')};g.transform=function(a){if(a.flashvars){a.flashvars.toString=toFlashvarsString}if(!$.browser.msie){a.toString=toAttributeString;return'<embed '+String(a)+'/>'}else{var b="";var c="";if(typeof(a.id)!="undefined"){c='id="'+a.id+'"'}b='<object '+c+' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+a.width+'" height="'+a.height+'">';b+='<param name="movie" value="'+a.src+'" />';delete(a.id);delete(a.width);delete(a.height);delete(a.src);delete(a.type);delete(a.pluginspage);for(var d in a){b+='<param name="'+d+'" value="'+String(a[d])+'" />'}b+="</object>";return b}};if(window.attachEvent){window.attachEvent("onbeforeunload",function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){}})}})();function RGBColor(l){this.ok=false;if(l.charAt(0)=='#'){l=l.substr(1,6)}l=l.replace(/ /g,'');l=l.toLowerCase();var m={aliceblue:'f0f8ff',antiquewhite:'faebd7',aqua:'00ffff',aquamarine:'7fffd4',azure:'f0ffff',beige:'f5f5dc',bisque:'ffe4c4',black:'000000',blanchedalmond:'ffebcd',blue:'0000ff',blueviolet:'8a2be2',brown:'a52a2a',burlywood:'deb887',cadetblue:'5f9ea0',chartreuse:'7fff00',chocolate:'d2691e',coral:'ff7f50',cornflowerblue:'6495ed',cornsilk:'fff8dc',crimson:'dc143c',cyan:'00ffff',darkblue:'00008b',darkcyan:'008b8b',darkgoldenrod:'b8860b',darkgray:'a9a9a9',darkgreen:'006400',darkkhaki:'bdb76b',darkmagenta:'8b008b',darkolivegreen:'556b2f',darkorange:'ff8c00',darkorchid:'9932cc',darkred:'8b0000',darksalmon:'e9967a',darkseagreen:'8fbc8f',darkslateblue:'483d8b',darkslategray:'2f4f4f',darkturquoise:'00ced1',darkviolet:'9400d3',deeppink:'ff1493',deepskyblue:'00bfff',dimgray:'696969',dodgerblue:'1e90ff',feldspar:'d19275',firebrick:'b22222',floralwhite:'fffaf0',forestgreen:'228b22',fuchsia:'ff00ff',gainsboro:'dcdcdc',ghostwhite:'f8f8ff',gold:'ffd700',goldenrod:'daa520',gray:'808080',green:'008000',greenyellow:'adff2f',honeydew:'f0fff0',hotpink:'ff69b4',indianred:'cd5c5c',indigo:'4b0082',ivory:'fffff0',khaki:'f0e68c',lavender:'e6e6fa',lavenderblush:'fff0f5',lawngreen:'7cfc00',lemonchiffon:'fffacd',lightblue:'add8e6',lightcoral:'f08080',lightcyan:'e0ffff',lightgoldenrodyellow:'fafad2',lightgrey:'d3d3d3',lightgreen:'90ee90',lightpink:'ffb6c1',lightsalmon:'ffa07a',lightseagreen:'20b2aa',lightskyblue:'87cefa',lightslateblue:'8470ff',lightslategray:'778899',lightsteelblue:'b0c4de',lightyellow:'ffffe0',lime:'00ff00',limegreen:'32cd32',linen:'faf0e6',magenta:'ff00ff',maroon:'800000',mediumaquamarine:'66cdaa',mediumblue:'0000cd',mediumorchid:'ba55d3',mediumpurple:'9370d8',mediumseagreen:'3cb371',mediumslateblue:'7b68ee',mediumspringgreen:'00fa9a',mediumturquoise:'48d1cc',mediumvioletred:'c71585',midnightblue:'191970',mintcream:'f5fffa',mistyrose:'ffe4e1',moccasin:'ffe4b5',navajowhite:'ffdead',navy:'000080',oldlace:'fdf5e6',olive:'808000',olivedrab:'6b8e23',orange:'ffa500',orangered:'ff4500',orchid:'da70d6',palegoldenrod:'eee8aa',palegreen:'98fb98',paleturquoise:'afeeee',palevioletred:'d87093',papayawhip:'ffefd5',peachpuff:'ffdab9',peru:'cd853f',pink:'ffc0cb',plum:'dda0dd',powderblue:'b0e0e6',purple:'800080',red:'ff0000',rosybrown:'bc8f8f',royalblue:'4169e1',saddlebrown:'8b4513',salmon:'fa8072',sandybrown:'f4a460',seagreen:'2e8b57',seashell:'fff5ee',sienna:'a0522d',silver:'c0c0c0',skyblue:'87ceeb',slateblue:'6a5acd',slategray:'708090',snow:'fffafa',springgreen:'00ff7f',steelblue:'4682b4',tan:'d2b48c',teal:'008080',thistle:'d8bfd8',tomato:'ff6347',turquoise:'40e0d0',violet:'ee82ee',violetred:'d02090',wheat:'f5deb3',white:'ffffff',whitesmoke:'f5f5f5',yellow:'ffff00',yellowgreen:'9acd32'};for(var n in m){if(l==n){l=m[n]}}var o=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:['rgb(123, 234, 45)','rgb(255,234,245)'],process:function(a){return[parseInt(a[1]),parseInt(a[2]),parseInt(a[3])]}},{re:/^(\w{2})(\w{2})(\w{2})$/,example:['#00ff00','336699'],process:function(a){return[parseInt(a[1],16),parseInt(a[2],16),parseInt(a[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,example:['#fb0','f0f'],process:function(a){return[parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16),parseInt(a[3]+a[3],16)]}}];for(var i=0;i<o.length;i++){var p=o[i].re;var q=o[i].process;var s=p.exec(l);if(s){channels=q(s);this.r=channels[0];this.g=channels[1];this.b=channels[2];this.ok=true}}this.r=(this.r<0||isNaN(this.r))?0:((this.r>255)?255:this.r);this.g=(this.g<0||isNaN(this.g))?0:((this.g>255)?255:this.g);this.b=(this.b<0||isNaN(this.b))?0:((this.b>255)?255:this.b);this.toRGB=function(){return'rgb('+this.r+', '+this.g+', '+this.b+')'};this.toHex=function(){var r=this.r.toString(16);var g=this.g.toString(16);var b=this.b.toString(16);if(r.length==1)r='0'+r;if(g.length==1)g='0'+g;if(b.length==1)b='0'+b;return'#'+r+g+b};this.getHelpXML=function(){var a=new Array();for(var i=0;i<o.length;i++){var b=o[i].example;for(var j=0;j<b.length;j++){a[a.length]=b[j]}}for(var c in m){a[a.length]=c}var d=document.createElement('ul');d.setAttribute('id','rgbcolor-examples');for(var i=0;i<a.length;i++){try{var f=document.createElement('li');var g=new RGBColor(a[i]);var h=document.createElement('div');h.style.cssText='margin: 3px; '+'border: 1px solid black; '+'background:'+g.toHex()+'; '+'color:'+g.toHex();h.appendChild(document.createTextNode('test'));var k=document.createTextNode(' '+a[i]+' -> '+g.toRGB()+' -> '+g.toHex());f.appendChild(h);f.appendChild(k);d.appendChild(f)}catch(e){}}return d}}jQuery.fn.flashText=function(l){this.flash(l,{version:8},function(b){$('html').addClass('flash-text-has-flash');if(!$(this).is('.flash-text-replaced')){b.wMode='transparent';this.innerHTML="<span class='alt'>"+this.innerHTML+"</span>";var c=$(this.firstChild);var d=$('a',c).not('[href]');d.after(d.html());d.html("");$(this).prepend(d);b.flashvars.txt=c[0].innerHTML.replace(/%/,"%25").trim();b.height=c.height();b.width=c.width();if(typeof(b.flashvars)=='undefined'){b.flashvars={}}if(typeof(b.flashvars.css)=='undefined'){b.flashvars.css=""}var e=[c,$('a',c[0])];var f=['font-style','text-align','text-decoration'];for(var i=0;i<e.length;i++){var g=e[i];if(g.length>0){var h="{ color: "+(new RGBColor(g.css('color'))).toHex()+"; ";var k=g.css("font-weight");if(typeof(k)=="number"){k=k>400?"bold":"normal"}h+="font-weight: "+k+"; ";for(var j=0;j<f.length;j++){h+=f[j]+": "+g.css(f[j])+"; "}h+="} ";if(g!==c){h+="a:hover { text-decoration: "+((g.css('text-decoration')=='none')?'underline':'none')+"} ";h="a "+h}else{h="* "+h}b.flashvars.css+=h}}if(!jQuery.fn.flashText.debug){$(this).addClass('flash-text-replaced');$(this).append($.fn.flash.transform(b))}else{$(this).bind('click',flashReplace)}}function flashReplace(a){a=(a==null)?a:this;$(a).addClass('flash-text-replaced');$(a).prepend($.fn.flash.transform(b));$(a).unbind('click',flashReplace)}})};jQuery.fn.resizeFlashText=function(){return this.each(function(){var a=$("span.alt",this);var b=$("object,embed",this);b.css('position','absolute');a.css({position:'static',visibility:'hidden'});b.height(a.height());b.width(a.width());b.css('position','static');a.css({position:'absolute',visibility:'visible'})})};jQuery.fn.flash.replace=function(a){if(typeof(a.width)=='undefined'){a.width=$(this).width()}if(typeof(a.height)=='undefined'){a.height=$(this).height()}a.wMode='transparent';var b=typeof(a.id)=="undefined"?"":a.id;this.innerHTML=$.fn.flash.transform(a)+'<div class="alt">'+this.innerHTML+'</div>';if($.browser.msie&&b!=""&&$(this).parents("form").length>0){window[b]=document.forms[0][b]}$(this).addClass('flash-replaced')};jQuery.fn.flashText.debug=false;


/*
 *  jquery.defuscate.js 
 */
;(function($){jQuery.fn.defuscate=function(b){b=jQuery.extend({link:true},b);var c=/\b([A-Z0-9._%-]+)\([^)]+\)((?:[A-Z0-9-]+\.)+[A-Z]{2,6})\b/gi;return this.each(function(){if($(this).is('a[@href]')){$(this).attr('href',$(this).attr('href').replace(c,'$1@$2'));var a=true}$(this).html($(this).html().replace(c,(b.link&&!a?'<a href="mailto:$1@$2">$1@$2</a>':'$1@$2')))})}})(jQuery); 


/*
 * jquery.blockUI.js
 */
(function($){$.blockUI=function(a,b,c){$.blockUI.impl.install(window,a,b,c)};$.blockUI.version=1.33;$.unblockUI=function(a){$.blockUI.impl.remove(window,a)};$.fn.block=function(a,b,c){return this.each(function(){if(!this.$pos_checked){if($.css(this,"position")=='static')this.style.position='relative';if($.browser.msie)this.style.zoom=1;this.$pos_checked=1}$.blockUI.impl.install(this,a,b,c)})};$.fn.unblock=function(a){return this.each(function(){$.blockUI.impl.remove(this,a)})};$.fn.displayBox=function(a,b,c){var d=this[0];if(!d)return;var e=$(d);a=a||{};var w=e.width()||e.attr('width')||a.width||$.blockUI.defaults.displayBoxCSS.width;var h=e.height()||e.attr('height')||a.height||$.blockUI.defaults.displayBoxCSS.height;if(w[w.length-1]=='%'){var f=document.documentElement.clientWidth||document.body.clientWidth;w=parseInt(w)||100;w=(w*f)/100}if(h[h.length-1]=='%'){var g=document.documentElement.clientHeight||document.body.clientHeight;h=parseInt(h)||100;h=(h*g)/100}var i='-'+parseInt(w)/2+'px';var j='-'+parseInt(h)/2+'px';var k=navigator.userAgent.toLowerCase();var l={displayMode:b||1,noalpha:c&&/mac/.test(k)&&/firefox/.test(k)};$.blockUI.impl.install(window,d,{width:w,height:h,marginTop:j,marginLeft:i},l)};$.blockUI.defaults={pageMessage:'<h1>Please wait...</h1>',elementMessage:'',overlayCSS:{backgroundColor:'#fff',opacity:'0.5'},pageMessageCSS:{width:'250px',margin:'-50px 0 0 -125px',top:'50%',left:'50%',textAlign:'center',color:'#000',backgroundColor:'#fff',border:'3px solid #aaa'},elementMessageCSS:{width:'250px',padding:'10px',textAlign:'center',backgroundColor:'#fff'},displayBoxCSS:{width:'400px',height:'400px',top:'50%',left:'50%'},ie6Stretch:1,allowTabToLeave:0,closeMessage:'Click to close',fadeOut:1,fadeTime:400};$.blockUI.impl={box:null,boxCallback:null,pageBlock:null,pageBlockEls:[],op8:window.opera&&window.opera.version()<9,ie6:$.browser.msie&&/MSIE 6.0/.test(navigator.userAgent),install:function(a,b,c,d){d=d||{};this.boxCallback=typeof d.displayMode=='function'?d.displayMode:null;this.box=d.displayMode?b:null;var e=(a==window);var g=this.op8||$.browser.mozilla&&/Linux/.test(navigator.platform);if(typeof d.alphaOverride!='undefined')g=d.alphaOverride==0?1:0;if(e&&this.pageBlock)this.remove(window,{fadeOut:0});if(b&&typeof b=='object'&&!b.jquery&&!b.nodeType){c=b;b=null}b=b?(b.nodeType?$(b):b):e?$.blockUI.defaults.pageMessage:$.blockUI.defaults.elementMessage;if(d.displayMode)var h=jQuery.extend({},$.blockUI.defaults.displayBoxCSS);else var h=jQuery.extend({},e?$.blockUI.defaults.pageMessageCSS:$.blockUI.defaults.elementMessageCSS);c=jQuery.extend(h,c||{});var f=($.browser.msie)?$('<iframe class="blockUI" style="z-index:1000;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="javascript:false;"></iframe>'):$('<div class="blockUI" style="display:none"></div>');var w=$('<div class="blockUI" style="z-index:1001;cursor:wait;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>');var m=e?$('<div class="blockUI blockMsg" style="z-index:1002;cursor:wait;padding:0;position:fixed"></div>'):$('<div class="blockUI" style="display:none;z-index:1002;cursor:wait;position:absolute"></div>');w.css('position',e?'fixed':'absolute');if(b)m.css(c);if(!g)w.css($.blockUI.defaults.overlayCSS);if(this.op8)w.css({width:''+a.clientWidth,height:''+a.clientHeight});if($.browser.msie)f.css('opacity','0.0');$([f[0],w[0],m[0]]).appendTo(e?'body':a);var j=$.browser.msie&&(!$.boxModel||$('object,embed',e?null:a).length>0);if(this.ie6||j){if(e&&$.blockUI.defaults.ie6Stretch&&$.boxModel)$('html,body').css('height','100%');if((this.ie6||!$.boxModel)&&!e){var t=this.sz(a,'borderTopWidth'),l=this.sz(a,'borderLeftWidth');var k=t?'(0 - '+t+')':0;var n=l?'(0 - '+l+')':0}$.each([f,w,m],function(i,o){var s=o[0].style;s.position='absolute';if(i<2){e?s.setExpression('height','document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + "px"'):s.setExpression('height','this.parentNode.offsetHeight + "px"');e?s.setExpression('width','jQuery.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"'):s.setExpression('width','this.parentNode.offsetWidth + "px"');if(n)s.setExpression('left',n);if(k)s.setExpression('top',k)}else{if(e)s.setExpression('top','(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"');s.marginTop=0}})}if(d.displayMode){w.css('cursor','default').attr('title',$.blockUI.defaults.closeMessage);m.css('cursor','default');$([f[0],w[0],m[0]]).removeClass('blockUI').addClass('displayBox');$().click($.blockUI.impl.boxHandler).bind('keypress',$.blockUI.impl.boxHandler)}else this.bind(1,a);m.append(b).show();if(b.jquery)b.show();if(d.displayMode)return;if(e){this.pageBlock=m[0];this.pageBlockEls=$(':input:enabled:visible',this.pageBlock);setTimeout(this.focus,20)}else this.center(m[0])},remove:function(a,b){var o=$.extend({},$.blockUI.defaults,b);this.bind(0,a);var c=a==window;var d=c?$('body').children().filter('.blockUI'):$('.blockUI',a);if(c)this.pageBlock=this.pageBlockEls=null;if(o.fadeOut){d.fadeOut(o.fadeTime,function(){if(this.parentNode)this.parentNode.removeChild(this)})}else d.remove()},boxRemove:function(a){$().unbind('click',$.blockUI.impl.boxHandler).unbind('keypress',$.blockUI.impl.boxHandler);if(this.boxCallback)this.boxCallback(this.box);$('body .displayBox').hide().remove()},handler:function(e){if(e.keyCode&&e.keyCode==9){if($.blockUI.impl.pageBlock&&!$.blockUI.defaults.allowTabToLeave){var a=$.blockUI.impl.pageBlockEls;var b=!e.shiftKey&&e.target==a[a.length-1];var c=e.shiftKey&&e.target==a[0];if(b||c){setTimeout(function(){$.blockUI.impl.focus(c)},10);return false}}}if($(e.target).parents('div.blockMsg').length>0)return true;return $(e.target).parents().children().filter('div.blockUI').length==0},boxHandler:function(e){if((e.keyCode&&e.keyCode==27)||(e.type=='click'&&$(e.target).parents('div.blockMsg').length==0))$.blockUI.impl.boxRemove();return true},bind:function(b,a){var c=a==window;if(!b&&(c&&!this.pageBlock||!c&&!a.$blocked))return;if(!c)a.$blocked=b;var d=$(a).find('a,:input');$.each(['mousedown','mouseup','keydown','keypress','click'],function(i,o){d[b?'bind':'unbind'](o,$.blockUI.impl.handler)})},focus:function(a){if(!$.blockUI.impl.pageBlockEls)return;var e=$.blockUI.impl.pageBlockEls[a===true?$.blockUI.impl.pageBlockEls.length-1:0];if(e)e.focus()},center:function(a){var p=a.parentNode,s=a.style;var l=((p.offsetWidth-a.offsetWidth)/2)-this.sz(p,'borderLeftWidth');var t=((p.offsetHeight-a.offsetHeight)/2)-this.sz(p,'borderTopWidth');s.left=l>0?(l+'px'):'0';s.top=t>0?(t+'px'):'0'},sz:function(a,p){return parseInt($.css(a,p))||0}}})(jQuery);


/*
 *	arb.js
 */
var arb={};arb.prefs={promptText:true,focusHighlighting:true,popupHelp:false,tableStriping:true};arb.init=function(a){a=$.extend(arb.prefs,a);arb.element.addClass(document.body.parentNode,"js");if(a.promptText){arb.form.initPromptText()}if(a.focusHighlighting){arb.form.initFocusHighlighting()}if(a.popupHelp){arb.form.initPopupHelp()}if(a.tableStriping){arb.functions.stripeTables()}};arb.lang={inherit:function(a,b){function c(){}c.prototype=b.prototype;a.prototype=new c();a.prototype.constructor=a;a.superClass=b.prototype;a.superClass.constructor=b},augment:function(a,b){for(p in b.prototype){if(!a.prototype[p]){a.prototype[p]=b.prototype[p]}}}};arb.event={addHandler:function(d,e,f){var g=function(a){a=a?a:window.event;d.__f=f;var b=d.__f(a);d.__f=null;return b};var h=d['on'+e];if(typeof(h)=='function'){d['on'+e]=function(a){var b=h(a);var c=g(a);return b&&c}}else{d['on'+e]=g}}};arb.event.standardHandler={hover:function(a,b){b=(b!=null)?b:'arb-hover';arb.event.addHandler(a,'mouseover',function(){arb.element.addClass(this,'arb-hover')});arb.event.addHandler(a,'mouseout',function(){arb.element.removeClass(this,'arb-hover')})},hoverFns:function(d,e,f){function g(a){var b=(a.type=="mouseover"?a.fromElement:a.toElement)||a.relatedTarget;while(b&&b!=d)b=b.parentNode;if(b==d)return false;d.__g=(a.type=="mouseover"?e:f);var c=d.__g(a);d.__g=null;return c}arb.event.addHandler(d,'mouseover',g);arb.event.addHandler(d,'mouseout',g)}};arb.element={addClass:function(a,b){if(a.className==''){a.className=b}else{a.className+=' '+b}},removeClass:function(a,b){var c=a.className;var d=new RegExp('\\s?\\b'+b+'\\b');if(c.match(d)!=null){a.className=c.replace(d,'')}},hasClass:function(a,b){var c=new RegExp('\\b'+b+'\\b');return(a.className.match(c)!=null)},getCSSProperty:function(a,b){if(document.defaultView){return document.defaultView.getComputedStyle(a,null).getPropertyValue(b)}else if(a.currentStyle){for(var c=/-([a-z])/;c.test(b);b=b.replace(c,RegExp.$1.toUpperCase())){}return a.currentStyle[b]}else{return null}},moveChildren:function(a,b){var c;for(var d=a.childNodes[0];d!=null;d=c){var c=d.nextSibling;a.removeChild(d);b.appendChild(d)}}};arb.element.position={left:function(a){var b=a.offsetLeft;while((a=a.parentNode)&&a!=document)b+=a.offsetLeft;return b},top:function(a){var b=a.offsetTop;while((a=a.parentNode)&&a!=document)b+=a.offsetTop||0;return b}};arb.form={initPromptText:function(){function d(a){var b=this.getElementsByTagName('input');for(var c=0;c<b.length;c++){e(b[c])}}function e(a){if($(a).hasClass('replaced-password')){var b=$(a);a=b.prev()[0];e(a);$(a).show();a.focus();b.remove();return}if(a.value==a.getAttribute("title")){a.value="";arb.element.removeClass(a,'displayingPromptValue')}}function f(a){if((a.getAttribute('disabled')==null||a.getAttribute('disabled')==false)&&(!a.value||a.value==""||a.value==a.getAttribute("title"))){a.value=a.getAttribute("title");arb.element.addClass(a,'displayingPromptValue');if(a.type=='password'){$(a).hide();var b=$("<input type='text' />");b.val(a.value);b.attr('class',$(a).attr('class'));b.addClass('replaced-password');$(a).after(b);b.bind('focus',g)}}}function g(a){e(this)}function h(a){f(this)}if(!document.getElementsByTagName)return false;var k=document.getElementsByTagName('form');for(var j=(k.length-1);j>-1;j--){var m=k[j].getElementsByTagName('input');arb.event.addHandler(k[j],'submit',d);for(var l=0;l<m.length;l++){var i=m[l];if(i.getAttribute("title")){var n;if(typeof document.selection!="undefined"&&document.selection!=null&&typeof window.opera=="undefined"){n=document.selection.createRange().parentElement()}if(n!=i){f(i)}arb.event.addHandler(i,'focus',g);arb.event.addHandler(i,'blur',h)}}}},initFocusHighlighting:function(){function c(a){if(arb.element.hasClass(this,'arbHasFocus'))return true;arb.element.addClass(this,'arbHasFocus');for(var b=0;b<this._labels.length;b++){arb.element.addClass(this._labels[b],'arbHasFocus')}if($(this).parent().is('.form-item')){$(this).parent().addClass('focussed-form-item')}}function d(a){arb.element.removeClass(this,'arbHasFocus');for(var b=0;b<this._labels.length;b++){arb.element.removeClass(this._labels[b],'arbHasFocus')}if($(this).parent().is('.form-item')){$(this).parent().removeClass('focussed-form-item')}}var e=document.getElementsByTagName('label');for(var f=(e.length-1);f>-1;f--){var g=e[f].getAttribute('for')?e[f].getAttribute('for'):e[f].getAttribute('htmlFor');if(g){var h=document.getElementById(g);if(!h._labels)h._labels=new Array();h._labels.push(e[f]);$(h).bind('focus',c);$(h).bind('blur',d)}}}};arb.debug={debugCounter:0,log:function(a){var b=document.getElementById('debugBox');var c=document.createElement('DIV');if(typeof(a)=='object'){var d=a;a=d+'';for(var e in d){a+="<br />"+e+' => '+d[e]}}c.innerHTML=arb.debug.debugCounter+': '+a;arb.debug.debugCounter++;if(!b){b=document.createElement('DIV');b.style.position='absolute';b.style.zIndex='3000';b.style.width='280px';b.style.height='280px';b.style.top='0';b.style.right='0';b.style.backgroundColor="#dddddd";b.style.overflow='auto';b.onclick=function(){this.style.display='none'};b.id='debugBox';document.body.appendChild(b)}b.style.display='block';b.insertBefore(c,b.firstChild)}};arb.url={equal:function(a,b){a=arb.url.normalise(a);b=arb.url.normalise(b);return a==b},normalise:function(a){a=a.toLowerCase();a=a.replace(/^(.*)\?.*$/,"$1");a=a.replace(/^(.*)#.*$/,"$1");a=a.replace(/^(.*)\/(default|index)\.(aspx|htm(l?))$/i,"$1");a=a.replace(/^(.*)\/$/i,"$1");return a},parentPage:function(a){a=arb.url.normalise(a);if(a.match(/^.*\/.*?\.(aspx|htm(l?))$/i)){return a.replace(/^(.*)\/.*?$/i,"$1")}else if(a.match(/^http(s)?:\/\/.+\/.*$/)){return a.replace(/^(http(s)?:\/\/.+)\/.*?$/i,"$1")}return""},getParam:function(a){var b=window.location.search.substring(1);var c=b.split("&");for(var d=0;d<c.length;d++){var e=c[d].split("=");if(e[0]==a){return e[1]}}return null}};arb.text={percentEncode:function(a){var b=0;var c=0;CPstring='';for(var d=0;d<a.length;d++){var e=a.charCodeAt(d);if(e<0||e>0xFFFF){CPstring+='Error '+arb.text.dec2hex(e)+'!'}if(b!=0){if(0xDC00<=e&&e<=0xDFFF){CPstring+=arb.text.dec2hex(0x10000+((b-0xD800)<<10)+(e-0xDC00))+' ';b=0;continue}else{CPstring+='!erreur '+arb.text.dec2hex(b)+'!';b=0}}if(0xD800<=e&&e<=0xDBFF){b=e}else{CPstring+=arb.text.dec2hex(e)+' '}}a=CPstring.substring(0,CPstring.length-1);var f="";a=a.replace(/^\s+/,'');if(a.length==0){return""}a=a.replace(/\s+/g,' ');var g=a.split(' ');for(var d=0;d<g.length;d++){var c=parseInt(g[d],16);if(c==0x20){f+='%20'}else if(c>=0x41&&c<=0x5A){f+=String.fromCharCode(c)}else if(c>=0x61&&c<=0x7A){f+=String.fromCharCode(c)}else if(c>=0x30&&c<=0x39){f+=String.fromCharCode(c)}else if(c==0x2D||c==0x2E||c==0x5F||c==0x7E){f+=String.fromCharCode(c)}else if(c<=0x7F){f+='%'+arb.text.dec2hex2(c)}else if(c<=0x7FF){f+='%'+arb.text.dec2hex2(0xC0|((c>>6)&0x1F))+'%'+arb.text.dec2hex2(0x80|(c&0x3F))}else if(c<=0xFFFF){f+='%'+arb.text.dec2hex2(0xE0|((c>>12)&0x0F))+'%'+arb.text.dec2hex2(0x80|((c>>6)&0x3F))+'%'+arb.text.dec2hex2(0x80|(c&0x3F))}else if(c<=0x10FFFF){f+='%'+arb.text.dec2hex2(0xF0|((c>>18)&0x07))+'%'+arb.text.dec2hex2(0x80|((c>>12)&0x3F))+'%'+arb.text.dec2hex2(0x80|((c>>6)&0x3F))+'%'+arb.text.dec2hex2(0x80|(c&0x3F))}else{f+='!Error '+arb.text.dec2hex(c)+'!'}}return(f)},dec2hex2:function(a){var b=new Array("0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F");return b[(a>>4)&0xF]+b[a&0xF]},dec2hex:function(a){return(a+0).toString(16).toUpperCase()}};arb.functions={expandMenu:function(a){if(!document.getElementById){return}var b=document.getElementById(a);if(!b){return}var c=b.getElementsByTagName("a");var d;var e=document.location.href;var f=document.createElement('div');arb.element.addClass(f,'menus-expanded');arb.element.moveChildren(b,f);b.appendChild(f);do{for(var g=0;g<c.length;g++){if(c[g].href&&arb.url.equal(c[g].href,e)){d=c[g];break}}if(!d){e=arb.url.parentPage(e)}}while(!d&&e);if(d){var h=d.parentNode;arb.element.addClass(h,'active');while(h!=b){if(h.nodeName=="LI"||h.nodeName=="UL"){arb.element.addClass(h,'expanded');if(h.id!=""){arb.element.addClass(h,h.id+"-expanded")}}h=h.parentNode}}},dropdownMenus:function(b){function c(a){arb.element.addClass(this,"arb-hover");if(typeof(jQuery)!="undefined"){$("ul",this).slideDown('fast')}}function d(a){arb.element.removeClass(this,"arb-hover")}var e=document.getElementById(b).getElementsByTagName("LI");for(var f=0;f<e.length;f++){arb.event.standardHandler.hoverFns(e[f],c,d);arb.event.addHandler(e[f],"focus",c);arb.event.addHandler(e[f],"blur",d)}},stripeTables:function(){if(typeof(jQuery)!="undefined"){$(document).ready(function(){$("#content tr").hover(function(){$(this).addClass("arb-hover")},function(){$(this).removeClass("arb-hover")});$("#content tr:even").addClass("arb-even")})}},linkButtons:function(d,e){e=(e==null)?f:e;$(d).each(function(){var a=$(this);var b=a.val();var c=$('<a href="#" class="link-button"><span>'+b+'</span></a>');c.addClass(a.attr("class"));a.before(c).hide();if(!a.is(":disabled")){c.click(function(){e(c,a);return false})}else{c.click(function(){return false}).attr("href","")}});function f(a,b){b.click()}},enhanceTextareas:function(){$('textarea:not([wysiwyg-textarea=true])').each(function(){$(this).wrap("<div class=\"enhanced-textarea\"></div>").parent().append($("<div class=\"textarea-footer\"></div>"));arb.functions.expandableTextarea($(this).parent());arb.functions.maxlengthTextarea($(this).parent())})},expandableTextarea:function(b){var c=null;var d=$("textarea",b);$(".textarea-footer",b).addClass("grippie").mousedown(f);var e=$(".textarea-footer",b)[0];$(e).css("margin-right",e.offsetWidth-d[0].offsetWidth+"px");function f(a){c=d.height()-arb.functions.mousePosition(a).y;d.css("opacity",0.25);$(document).bind("mousemove",g).bind("mouseup",h);return false}function g(a){d.height(Math.max(32,c+arb.functions.mousePosition(a).y)+"px");return false}function h(a){$(document).unbind("mousemove",g).unbind("mouseup",h);d.css("opacity",1)}},mousePosition:function(a){return{x:a.clientX+document.documentElement.scrollLeft,y:a.clientY+document.documentElement.scrollTop}},maxlengthTextarea:function(d){$("textarea[maxlength]",d).each(function(){var a=$(this).attr('maxlength');var b=$(this).val().length;var c=$("<div class=\"textarea-length-counter\"><span>"+b+"</span>/"+a+" characters</div>");$(".textarea-footer",d).append(c);this.relatedElement=$('span',c)}).keyup(function(){var a=$(this).attr('maxlength');var b=$(this).val().length;if(b>=a){this.value=this.value.substring(0,a-1)}this.relatedElement.html(b)})},fontSizing:function(c,d){var d=$.extend({printText:'Print page',maxFontSize:140,minFontSize:70,fontIncrement:16.66,controlsFontSize:11,insertHTML:'<li id="font-size-down-control" title="Decrease font size"><span>A-</span></li><li id="font-size-up-control" title="Increase font size"><span>A+</span></li><li class="print-link" title="'+d.printText+'"><a href="#">'+d.printText+'</a></li>'},d);function e(a){var b=parseFloat(arb.cookie.get("font-size"))+a;if(b>d.minFontSize&&b<d.maxFontSize){f(b);arb.cookie.set("font-size",b,{path:"/"})}}function f(a){$("#content").css("font-size",a+"%");$("#content #page-controls").css("font-size",d.controlsFontSize+"px");if(((a*1)-d.fontIncrement)<d.minFontSize){$("#font-size-down-control").css("opacity",0.5);$("#font-size-up-control").css("opacity",1)}else if(((a*1)+d.fontIncrement)>d.maxFontSize){$("#font-size-down-control").css("opacity",1);$("#font-size-up-control").css("opacity",0.5)}else{$("#font-size-down-control").css("opacity",1);$("#font-size-up-control").css("opacity",1)}}var g=arb.cookie.get("font-size");if(!g){arb.cookie.set("font-size","100",{path:"/"});g=arb.cookie.get("font-size")}if(window.print&&g){$(c).prepend(d.insertHTML);f(g);$(".print-link a").click(function(){window.print()});$("#font-size-down-control").click(function(){e(-d.fontIncrement)});$("#font-size-up-control").click(function(){e(d.fontIncrement)});$("#page-controls li").hover(function(){$(this).addClass("arb-hover")},function(){$(this).removeClass("arb-hover")})}}};arb.cookie={set:function(a,b,c){c=c||{};var d='';c.expires=c.expires||356;var e=new Date();e.setTime(e.getTime()+(c.expires*24*60*60*1000));var d="; expires="+e.toGMTString();var f=c.path?'; path='+c.path:'';var g=c.domain?'; domain='+c.domain:'';var h=c.secure?'; secure':'';document.cookie=[a,'=',encodeURIComponent(b),d,f,g,h].join('')},get:function(a){var b=null;if(document.cookie&&document.cookie!=''){var c=document.cookie.split(';');for(var d=0;d<c.length;d++){var e=c[d].trim();if(e.substring(0,a.length+1)==(a+'=')){b=decodeURIComponent(e.substring(a.length+1));break}}}return b},remove:function(a){arb.cookie.set(a,"",{expires:-1})}};$(document).ready(arb.init);if(Array.prototype.push==null){Array.prototype.push=function(a){this[this.length]=a;return this.length}};if(String.prototype.trim==null){String.prototype.trim=function(){return this.replace(/^\s+|\s+$/,'')}}$(function(){if(typeof(ValidatorUpdateDisplay)=='function'){ValidatorUpdateDisplay=function(a){if(typeof(a.display)=="string"){if(a.display=="Dynamic"){if(a.isvalid&&$(a).is(':visible')){$(a).animate({height:'hide',opacity:'hide'},'slow',function(){if(!$(a).siblings('.error-message').is(':visible')){$(a).parent('.error-messages').parent('.form-item').removeClass('error-form-item')}})}else if(!a.isvalid&&!$(a).is(':visible')){$(a).animate({height:'show',opacity:'show'},'slow').parent('.error-messages').parent('.form-item').addClass('error-form-item')}}}}}});(function(){$(document).ready(function(){if(typeof(Sys)!='undefined'){Sys.WebForms.PageRequestManager.getInstance().add_endRequest(g)}if(!$.browser.msie){$('button').each(function(){if(typeof(this.addEventListener)=='function'){this.addEventListener('click',function(c){if(c.target!=this){c.preventDefault();var d=this;window.setTimeout(function(){var a=document.createEvent("MouseEvents");a.initMouseEvent("click",true,true,window,0,0,0,0,0,false,false,false,false,0,null);var b=!d.dispatchEvent(a)},0)}},true)}})}});function e(a,b){}function f(a,b){}function g(a,b){arb.functions.enhanceTextareas()}})();


/*
 *	site.js
 */

/*****************************************************************************************
 *
 *	Site specific javascript
 *
 ****************************************************************************************/

(function($) { // start our namespace 

	/*
	 * Function for all the sIFR on the site
	 */
	function sIFR(){
		$('body.home-page #page-title h1').flashText({
			src: BASE_THEME_DIR + '/Common/flash/swfs/SegoeScript_Regular.swf' //Segoe Script
		});
		$('body:not(.home-page) h1').flashText({
			src: BASE_THEME_DIR + '/Common/flash/swfs/Helvetica45Light_Regular.swf' //Helvetica 45 Light
		});
	}
	
	function pageControls(){
		arb.functions.fontSizing('#page-controls-box ul', {
			insertHTML: '<li id="font-size-up-control" class="image-replaced" title="Increase font size">A+<span></span></li><li id="font-size-down-control" class="image-replaced" title="Decrease font size">A-<span></span></li><li class="print-link"><a href="#" title="Print page">Print</a></li>'
		
		});
	}
	
  /*
   * Contact page Google maps
   */
  function googleMaps(){
    $('a.show-map').click(function() {
      
      var $googleMapURL = $(this).attr('href');
      
      $.extend($.blockUI.defaults.overlayCSS, { backgroundColor: '#46869F', opacity: '0.7' });
      $.extend($.blockUI.defaults.pageMessageCSS = { border: '4px solid #FFF', width: '700px', height: '500px', marginLeft: '-350px', marginTop: '-250px', top:'50%', left:'50%' });
      
      // This is can be used for the Google Maps API
      $.blockUI('<div id="map" style="width: 700px; height: 500px;"></div><a href="'+$googleMapURL+'" style="color:#FFF; font-weight: bold; padding-top: 20px; display: block; background: transparent; outline: none;" target="_blank">View Larger Map</a>');
     googleMapAPI();
      
      //$.blockUI('<iframe width="700" height="500" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="'+$googleMapURL+'"></iframe><a href="'+$googleMapURL+'" style="color:#FFF; font-weight: bold; padding-top: 20px; margin-left: 300px; display: block; background: transparent; outline: none;" target="_blank">View Larger Map</a>');
      
      
      $('div.blockUI').css({ cursor: 'pointer' });
      
      $('div.blockUI:not(.blockMsg)').attr('title','Click to close').click(function() {
        $.unblockUI();
      });
      
      return false;
    });
  }
  
  /*
   * Only use for the API Version
   */
  function googleMapAPI() {      
    if (GBrowserIsCompatible()) {    
      
      // Add map
      var map = new GMap2(document.getElementById('map'));    
      map.setCenter(new GLatLng(-37.816463,144.958742), 16);  
      
      // Add office
      var point = new GLatLng(-37.816463,144.958742);
      map.addOverlay( new GMarker(point) );

      // Offices
      var offices = [
        {
          latitude: '-37.817683',
          longitude: '144.959729'
        }
      ];
      
      //  Custom icon
      var customIcon = new GIcon(G_DEFAULT_ICON);
      customIcon.image = BASE_THEME_DIR + 'Common/images/icons/ico_parking.png';
      customIcon.iconSize = new GSize(20, 20);
      customIcon.shadowSize = new GSize(0, 0); // Remove the shadow

      // Set up our GMarkerOptions object
      markerOptions = { icon:customIcon };
      
      // Add parking icons
      for (var i=0, len=offices.length; i<len; i++) {
        point = new GLatLng(offices[i].latitude,offices[i].longitude);
        map.addOverlay(new GMarker(point, markerOptions));
      }
      
      // Add info window
      var content = document.createElement('div');
      content.innerHTML = "<strong>Aitken Partners</strong><br />Level 1, 114 William St,<br /> Melbourne Victoria 3000,<br /> Australia";
      map.openInfoWindowHtml(map.getCenter(),content);       
      
      // Map controls
      map.addControl(new GMapTypeControl);
      map.addControl(new GLargeMapControl());
    }   
  }

	$(document).ready(function() {		
		/* enhanced primary nav dropdowns */
		$("#primary-navigation > ul > li").hover(
			function() {
				$(this).addClass('arb-hover').find('> ul').hide().animate({opacity: 'show', height: 'show'}, 100); 
			},
			function() {
				$(this).removeClass('arb-hover'); 
			}
		 );	
		sIFR();
		pageControls();
		$("a.email").defuscate();
		googleMaps();
	});

})(jQuery);  // end namespace
;