(function(){var moduleRegister={glow:true},regexEscape=/([$^\\\/()|?+*\[\]{}.-])/g,ua=navigator.userAgent.toLowerCase(),version="1.7.0",blockersActive=0,domReadyQueue=[],domReadyQueueLen=0,readyQueue=[],readyQueueLen=0,processingReadyQueue=false,glow={VERSION:version,UID:"glow"+Math.floor(Math.random()*(1<<30)),isDomReady:window.gloader&&gloader.isReady,isReady:window.gloader&&gloader.isReady,env:function(){var nanArray=[0,NaN],opera=(/opera[\s\/]([\w\.]+)/.exec(ua)||nanArray)[1],ie=opera?NaN:(/msie ([\w\.]+)/.exec(ua)||nanArray)[1],gecko=(/rv:([\w\.]+).*gecko\//.exec(ua)||nanArray)[1],webkit=(/applewebkit\/([\w\.]+)/.exec(ua)||nanArray)[1],khtml=(/khtml\/([\w\.]+)/.exec(ua)||nanArray)[1],toNum=parseFloat;return{gecko:toNum(gecko),ie:toNum(ie),opera:toNum(opera),webkit:toNum(webkit),khtml:toNum(khtml),version:ie||gecko||webkit||opera||khtml,standardsMode:document.compatMode!="BackCompat"&&(!ie||ie>=6)}}(),module:function(meta){var i=2,depends=meta.depends[0]||[],dependsLen=depends.length,name=meta.name,objRef=window.glow;if(meta.library[1]!=glow.VERSION){throw new Error("Cannot register "+name+": Version mismatch");}if(depends[2]){for(;i<dependsLen;i++){if(!moduleRegister[depends[i]]){throw new Error("Module "+depends[i]+" required before "+name);}}}meta.builder(glow);moduleRegister[name]=true;return glow},ready:function(f){if(this.isReady){f()}else{readyQueue[readyQueueLen++]=f}return this},_readyBlockers:{},_addReadyBlock:function(name){if(name in glow._readyBlockers){throw new Error("Blocker '"+name+"' already exists");}glow._readyBlockers[name]=true;glow.isReady=false;blockersActive++;return glow},_removeReadyBlock:function(name){if(glow._readyBlockers[name]){glow._readyBlockers[name]=false;blockersActive--;if(!blockersActive){glow.isReady=true;runReadyQueue()}}return glow},onDomReady:function(f){if(this.isDomReady){f()}else{domReadyQueue[domReadyQueueLen++]=f}},lang:{trim:function(sStr){return sStr.replace(/^\s*((?:[\S\s]*\S)?)\s*$/,'$1')},toArray:function(aArrayLike){if(aArrayLike.constructor==Array){return aArrayLike}var r=[],i=0,len=aArrayLike.length;for(;i<len;i++){r[i]=aArrayLike[i]}return r},apply:function(destination,source){for(var i in source){destination[i]=source[i]}return destination},map:function(arr,callback,context){if(Array.prototype.map){return Array.prototype.map.call(arr,callback,context||arr)}if(!callback.call){throw new TypeError();}var len=arr.length,res=[],thisp=context||arr,i=0;for(;i<len;i++){if(i in arr){res[i]=callback.call(thisp,arr[i],i,arr)}}return res},replace:(function(){var replaceBroken="g".replace(/g/,function(){return'l'})!='l',def=String.prototype.replace;return function(inputString,re,replaceWith){var pos,match,last,buf;if(!replaceBroken||typeof(replaceWith)!='function'){return def.call(inputString,re,replaceWith)}if(!(re instanceof RegExp)){pos=inputString.indexOf(re);return pos==-1?inputString:def.call(inputString,re,replaceWith.call(null,re,pos,inputString))}buf=[];last=re.lastIndex=0;while((match=re.exec(inputString))!=null){pos=match.index;buf[buf.length]=inputString.slice(last,pos);buf[buf.length]=replaceWith.apply(null,match);if(re.global){last=re.lastIndex}else{last=pos+match[0].length;break}}buf[buf.length]=inputString.slice(last);return buf.join("")}})(),interpolate:function(template,data,opts){var placeHolderRx,leftDelimiter,rightDelimiter,div;opts=opts||{};if(opts.escapeHtml){if(!glow.dom){throw new Error('glow.lang.interpolate - glow.dom is needed for escapeHtml');}div=glow.dom.create('<div></div>')}if(opts.delimiter==undefined){placeHolderRx=/\{[^{}]+\}/g}else{leftDelimiter=opts.delimiter.substr(0,1).replace(regexEscape,"\\$1");rightDelimiter=opts.delimiter.substr(1,1).replace(regexEscape,"\\$1")||leftDelimiter;placeHolderRx=new RegExp(leftDelimiter+"[^"+leftDelimiter+rightDelimiter+"]+"+rightDelimiter,"g")}return template.replace(placeHolderRx,function(placeholder){var key=placeholder.slice(1,-1),keyParts=key.split("."),val,i=0,len=keyParts.length;if(key in data){val=data[key]}else{val=data;for(;i<len;i++){if(keyParts[i]in val){val=val[keyParts[i]]}else{return placeholder}}}if(opts.escapeHtml){val=div.text(val).html()}return val})},hasOwnProperty:{}.hasOwnProperty?function(obj,prop){return obj.hasOwnProperty(prop)}:function(obj,prop){var propVal=obj[prop],objProto=obj.__proto__,protoVal=objProto?objProto[prop]:{};if(propVal!==protoVal){return true}var restoreProtoVal=glow.lang.hasOwnProperty(objProto,prop),tempObjProtoVal=objProto[prop]={},hasOwn=(obj[prop]!==tempObjProtoVal);delete objProto[prop];if(restoreProtoVal){objProto[name]=tempObjProtoVal}return hasOwn},extend:function(sub,base,additionalProperties){var f=function(){},p;f.prototype=base.prototype;p=new f();sub.prototype=p;p.constructor=sub;sub.base=base;if(additionalProperties){glow.lang.apply(sub.prototype,additionalProperties)}},clone:function(obj){var index,_index,tmp;obj=obj.valueOf();if(typeof obj!=='object'){return obj}else{if(obj[0]||obj.concat){tmp=[];index=obj.length;while(index--){tmp[index]=arguments.callee(obj[index])}}else{tmp={};for(index in obj){tmp[index]=arguments.callee(obj[index])}}return tmp}}}},env=glow.env,d=document;function runDomReadyQueue(){glow.isDomReady=true;for(var i=0;i<domReadyQueueLen;i++){domReadyQueue[i]()}}function runReadyQueue(){if(processingReadyQueue)return;processingReadyQueue=true;for(var i=0;i<readyQueueLen;){readyQueue[i]();i++;if(blockersActive){break}}readyQueue=readyQueue.slice(i);readyQueueLen=readyQueueLen-i;processingReadyQueue=false}(function(){if(glow.isDomReady){return}glow._addReadyBlock("glow_domReady");if(env.ie){if(typeof window.frameElement!='undefined'){d.attachEvent("onreadystatechange",function(){if(d.readyState=="complete"){d.detachEvent("onreadystatechange",arguments.callee);runDomReadyQueue();glow._removeReadyBlock("glow_domReady")}})}else{(function(){try{d.documentElement.doScroll('left')}catch(e){setTimeout(arguments.callee,0);return}runDomReadyQueue();glow._removeReadyBlock("glow_domReady")})()}}else if(glow.env.webkit<525.13&&typeof d.readyState!='undefined'){var f=function(){if(/loaded|complete/.test(d.readyState)){runDomReadyQueue();glow._removeReadyBlock("glow_domReady")}else{setTimeout(f,0)}};f()}else{var callback=function(){if(callback.fired){return}callback.fired=true;runDomReadyQueue();glow._removeReadyBlock("glow_domReady")};if(d.addEventListener){d.addEventListener("DOMContentLoaded",callback,false)}var oldOnload=window.onload;window.onload=function(){if(oldOnload){oldOnload()}callback()}}})();glow.isSupported=!(env.ie<6||(env.gecko<1.9&&!/^1\.8\.1/.test(env.version))||env.opera<9||env.webkit<412);if(!glow.isSupported){glow._addReadyBlock("glow_browserSupport")}if(window.gloader){gloader.library({name:"glow",version:"1.7.0",builder:function(){return glow}})}else if(window.glow){throw new Error("Glow global object already exists");}else{window.glow=glow}if(glow.ie){try{document.execCommand("BackgroundImageCache",false,true)}catch(e){}}})();/*@cc_on@*//*@if(@_jscript_version>5.5)@*/(window.gloader||glow).module({name:"glow.i18n",library:["glow","1.7.0"],depends:[["glow","1.7.0"]],builder:function(glow){var self;var subtagRegexes={l:/^[a-z]$/,lv:/^[a-z]{2,3}$/,s:/^[A-Z][a-z]{3}$/,r:/^[A-Z]{2}|[0-9]{3}$/,v:/^[a-z0-9]{4,}$/};var L=1,S=2,R=4,V=8,LSRV=L+S+R+V,LRV=L+R+V,LSV=L+S+V,LV=L+V,LSR=L+S+R,LR=L+R,LS=L+S;var masks={l:L,s:S,r:R,v:V},subtags=['l','s','r','v'],labels={l:0,s:1,r:2,v:3};var localePacks={};var moduleStructure={};var currentLocale=parseTag(document.documentElement.lang||'en')||parseTag('en');function getSubtagPattern(subtag){for(var pattern in subtagRegexes){if(subtagRegexes[pattern].test(subtag)){return pattern}}return""}function parseTag(tag){if(!tag.split){tag=""}var parts=tag.split("-"),len=parts.length,canon=[],matchedSubtags={l:"",s:"",r:"",v:""},start=0,i=start,mask=0,subtag,label;for(var j=0,jlen=subtags.length;j<jlen;j++){i=start;subtag=subtags[j];label=labels[subtag];while((getSubtagPattern(parts[i]).indexOf(subtag)==-1)&&(i<len)){i++}if(i<len){canon[label]=parts[i];mask+=masks[subtag];matchedSubtags[subtag]=parts[i];parts[i]="*";start=i}}var canonical=canon.join("-").replace(/-+/g,"-");if((canonical=="")||(canonical.substring(0,1)=="-")){return false}else{return{canonical:canonical,mask:mask,subtags:matchedSubtags}}}function getSubsetTag(parsed,test,mask){var subset;if((mask&~parsed.mask)==0){subset=parsed.subtags["l"];if(S&mask){subset=subset+"-"+parsed.subtags["s"]}if(R&mask){subset=subset+"-"+parsed.subtags["r"]}if(V&mask){subset=subset+"-"+parsed.subtags["v"]}if(test(subset)){return subset}}return false}function negotiate(parsed,testFn,successFn,failFn){var subset;switch(parsed.mask){case LRV:if((subset=getSubsetTag(parsed,testFn,LRV))){break}case LR:if((subset=getSubsetTag(parsed,testFn,LR))){break}case LSRV:if((subset=getSubsetTag(parsed,testFn,LSRV))){break}case LSR:if((subset=getSubsetTag(parsed,testFn,LSR))){break}case LSV:if((subset=getSubsetTag(parsed,testFn,LSV))){break}case LS:if((subset=getSubsetTag(parsed,testFn,LS))){break}case LV:if((subset=getSubsetTag(parsed,testFn,LV))){break}case L:if((subset=getSubsetTag(parsed,testFn,L))){break}default:if(testFn('en')){subset='en'}else{subset=null}}if(subset==null){failFn()}else{successFn(subset)}}function setLocale(newLocaleTag){var old=currentLocale,parsed=parseTag(newLocaleTag);if(parsed){currentLocale=parsed;currentLocale.next=old}return self}function revertLocale(){currentLocale=currentLocale.next||currentLocale;return self}function getLocale(){return currentLocale.canonical}function addLocaleModule(moduleName,localeTag,data){var tag=parseTag(localeTag),pack,module,structure;if(tag){pack=localePacks[tag.canonical]=localePacks[tag.canonical]||{};module=pack[moduleName]=pack[moduleName]||{};structure=moduleStructure[moduleName]=moduleStructure[moduleName]||{};for(var key in data){module[key]=data[key];structure[key]=1}}return self}function getLocaleModule(moduleName,opts){var module={},options=opts||{},structure=moduleStructure[moduleName]||{},localeTag=currentLocale,tag,label;function test(nTag){if(localePacks[nTag]&&localePacks[nTag][moduleName]&&localePacks[nTag][moduleName][label]){return true}else{return false}}function success(sTag){module[label]=localePacks[sTag][moduleName][label]}function fail(){module[label]="[Error! No "+moduleName+"."+label+" on "+localeTag.canonical+"]"}if(options.locale!=undefined){tag=parseTag(options.locale);if(tag){localeTag=tag}}for(label in structure){negotiate(localeTag,test,success,fail)}return module}function addLocalePack(localeTag,data){for(var moduleName in data){addLocaleModule(moduleName,localeTag,data[moduleName])}return self}function checkLocale(localeTag,opts){var options=opts||{},parsed=parseTag(localeTag);if(options.module){if(options.label){return checkLocaleByModuleAndLabel(parsed,options.module,options.label)}else{return checkLocaleByModule(parsed,options.module)}}else{return checkLocaleByEverything(parsed)}return null}function checkLocaleByModuleAndLabel(parsed,module,label){var result;function test(nTag){if(localePacks[nTag]&&localePacks[nTag][module]&&localePacks[nTag][module][label]){return true}else{return false}}function success(sTag){result=sTag}function fail(){result="**error** - no negotiated value exists"}negotiate(parsed,test,success,fail);return result}function checkLocaleByModule(parsed,module){var structure=moduleStructure[module]||{},results={},label;function test(nTag){if(localePacks[nTag]&&localePacks[nTag][module]&&localePacks[nTag][module][label]){return true}else{return false}}function success(sTag){results[label]=sTag}function fail(){results[label]="**error** - no negotiated value exists"}for(label in structure){negotiate(parsed,test,success,fail)}return results}function checkLocaleByEverything(parsed){var results={},module,label;function test(nTag){if(localePacks[nTag]&&localePacks[nTag][module]&&localePacks[nTag][module][label]){return true}else{return false}}function success(sTag){results[module][label]=sTag}function fail(){results[module][label]="**error** - no negotiated value exists"}for(module in moduleStructure){results[module]={};for(label in moduleStructure[module]){negotiate(parsed,test,success,fail)}}return results}glow.i18n=self={setLocale:setLocale,revertLocale:revertLocale,getLocale:getLocale,addLocaleModule:addLocaleModule,getLocaleModule:getLocaleModule,addLocalePack:addLocalePack,checkLocale:checkLocale};addLocalePack("en",{PROPERTIES:{LANGUAGE:"English",DIR:"ltr"}})}});(window.gloader||glow).module({name:"glow.dom",library:["glow","1.7.0"],depends:[],builder:function(glow){var env=glow.env,lang=glow.lang,cssRegex={tagName:/^(\w+|\*)/,combinator:/^\s*([>]?)\s*/,classNameOrId:(env.webkit<417)?new RegExp("^([\\.#])((?:(?![\\.#\\[:\\s\\\\]).|\\\\.)+)"):/^([\.#])((?:[^\.#\[:\\\s]+|\\.)+)/},regexEscape=/([$^\\\/()|?+*\[\]{}.-])/g,cssCache={},dom0PropertyMapping={checked:"checked","class":"className","disabled":"disabled","for":"htmlFor",maxlength:"maxLength"},dom0BooleanAttribute={checked:true,disabled:true},dom0AttributeMappings={maxlength:function(val){return val.toString()=="2147483647"?undefined:val}},ucheck=1,ucheckPropName="_unique"+glow.UID,dataPropName="_uniqueData"+glow.UID,dataIndex=1,dataCache=[],htmlColorNames={black:0,silver:0xc0c0c0,gray:0x808080,white:0xffffff,maroon:0x800000,red:0xff0000,purple:0x800080,fuchsia:0xff00ff,green:0x8000,lime:0xff00,olive:0x808000,yellow:0xffff00,navy:128,blue:255,teal:0x8080,aqua:0xffff,orange:0xffa500},usesYAxis=/height|top/,colorRegex=/^rgb\(([\d\.]+)(%?),\s*([\d\.]+)(%?),\s*([\d\.]+)(%?)/i,cssPropRegex=/^(?:(width|height)|(border-(top|bottom|left|right)-width))$/,hasUnits=/width|height|top$|bottom$|left$|right$|spacing$|indent$|font-size/,append,unique,placeholderElm,getByTagName,win=window,doc=document,docBody,docElm,nodePropertiesCloned,tmpDiv=doc.createElement("div"),tableArray=[1,'<table>','</table>'],emptyArray=[0,'',''],paddingElmArray=env.webkit<526?[0,'','</div>',true]:[1,'b<div>','</div>'],trArray=[3,'<table><tbody><tr>','</tr></tbody></table>'],elmWraps={caption:tableArray,thead:tableArray,th:trArray,colgroup:tableArray,tbody:tableArray,tr:[2,'<table><tbody>','</tbody></table>'],td:trArray,tfoot:tableArray,option:[1,'<select>','</select>'],legend:[1,'<fieldset>','</fieldset>'],link:paddingElmArray,script:paddingElmArray,style:paddingElmArray};if(env.ie){window.attachEvent("onunload",function(){tmpDiv=null})}glow.ready(function(){docBody=doc.body;docElm=doc.documentElement});(function(){var div=doc.createElement("div");div.a=1;nodePropertiesCloned=!!div.cloneNode(true).a})();function getFirstChildElm(parent){for(var child=parent.firstChild;child;child=child.nextSibling){if(child.nodeType==1){return child}}return null}function removeClassRegex(name){return new RegExp(["(^|\\s)",name.replace(regexEscape,"\\$1"),"($|\\s)"].join(""),"g")}function stringToNodes(str){var r=[],tagName=(/^\s*<([^\s>]+)/.exec(str)||[,'div'])[1],elmWrap=elmWraps[tagName]||emptyArray,nodeDepth,childElm,rLen=0;tmpDiv.innerHTML=(elmWrap[1]+str+elmWrap[2]);childElm=tmpDiv;nodeDepth=elmWrap[0];while(nodeDepth--){childElm=childElm.lastChild}while(childElm.firstChild){r[rLen++]=childElm.removeChild(childElm.firstChild)}childElm=null;return r}function nodelistToArray(nodelist){var r=[],i=0;for(;nodelist[i];i++){r[i]=nodelist[i]}return r}function setAttribute(value,attributeSetter){for(var that=this,i=0,length=that.length;i<length;i++){attributeSetter.call(that[i],value.call?value.call(that[i],i):value)}return that}if(document.all){append=function(a,b){var i=0,ai=a.length,length=b.length;if(typeof b.length=="number"){for(;i<length;i++){a[ai++]=b[i]}}else{for(;b[i];i++){a[ai++]=b[i]}}}}else{append=function(a,b){var i=0,ai=a.length;for(;b[i];i++){a[ai++]=b[i]}}}function isXml(node){return(node.ownerDocument&&!node.ownerDocument.body)||(node.documentElement&&!node.documentElement.body)}if(env.ie){unique=function(aNodes){if(aNodes.length==1){return aNodes}var r=[],ri=0,i=0;for(;aNodes[i];i++){if(aNodes[i].getAttribute(ucheckPropName)!=ucheck&&aNodes[i].nodeType==1){r[ri++]=aNodes[i]}aNodes[i].setAttribute(ucheckPropName,ucheck)}for(i=0;aNodes[i];i++){aNodes[i].removeAttribute(ucheckPropName)}ucheck++;return r}}else{unique=function(aNodes){if(aNodes.length==1){return aNodes}var r=[],ri=0,i=0;for(;aNodes[i];i++){if(aNodes[i][ucheckPropName]!=ucheck&&aNodes[i].nodeType==1){r[ri++]=aNodes[i]}aNodes[i][ucheckPropName]=ucheck}ucheck++;return r}}if(document.all){getByTagName=function(tag,context){var r=[],i=0;for(;context[i];i++){if(tag=="*"&&context[i].all&&!isXml(context[i])){append(r,context[i].all)}else{append(r,context[i].getElementsByTagName(tag))}}return r}}else{getByTagName=function(tag,context){var r=[],i=0,len=context.length;for(;i<len;i++){append(r,context[i].getElementsByTagName(tag))}return r}}function getChildElms(node){var r=[],childNodes=node.childNodes,i=0,ri=0;for(;childNodes[i];i++){if(childNodes[i].nodeType==1&&childNodes[i].nodeName!="!"){r[ri++]=childNodes[i]}}return r}var horizontalBorderPadding=['border-left-width','border-right-width','padding-left','padding-right'],verticalBorderPadding=['border-top-width','border-bottom-width','padding-top','padding-bottom'];function getElmDimension(elm,cssProp){var r,docElmOrBody=env.standardsMode?docElm:docBody,isWidth=(cssProp=="width"),cssPropCaps=isWidth?"Width":"Height",cssBorderPadding;if(elm.window){r=env.webkit<522.11?(isWidth?elm.innerWidth:elm.innerHeight):env.webkit?(isWidth?docBody.clientWidth:elm.innerHeight):env.opera<9.5?(isWidth?docBody.clientWidth:docBody.clientHeight):(isWidth?docElmOrBody.clientWidth:docElmOrBody.clientHeight)}else if(elm.getElementById){r=Math.max(docBody["scroll"+cssPropCaps],docElm["scroll"+cssPropCaps])}else{cssBorderPadding=isWidth?horizontalBorderPadding:verticalBorderPadding;r=elm['offset'+cssPropCaps]-parseInt(getCssValue(elm,cssBorderPadding))}return r}function getBodyElm(elm){if(env.ie<6){return elm.document.body}else{return elm.ownerDocument.body}}function setElmsSize(elms,val,type){if(typeof val=="number"||/\d$/.test(val)){val+="px"}for(var i=0,len=elms.length;i<len;i++){elms[i].style[type]=val}}function toStyleProp(prop){if(prop=="float"){return env.ie?"styleFloat":"cssFloat"}return lang.replace(prop,/-(\w)/g,function(match,p1){return p1.toUpperCase()})}function tempBlock(elm,func){var r,elmStyle=elm.style,oldDisp=elmStyle.display,oldVis=elmStyle.visibility,oldPos=elmStyle.position;elmStyle.visibility="hidden";elmStyle.position="absolute";elmStyle.display="block";if(!isVisible(elm)){elmStyle.position=oldPos;r=tempBlock(elm.parentNode,func);elmStyle.display=oldDisp;elmStyle.visibility=oldVis}else{r=func();elmStyle.display=oldDisp;elmStyle.position=oldPos;elmStyle.visibility=oldVis}return r}function isVisible(elm){return elm.offsetWidth||elm.offsetHeight}function getCssValue(elm,prop){var r,total=0,i=0,propLen=prop.length,compStyle=doc.defaultView&&(doc.defaultView.getComputedStyle(elm,null)||doc.defaultView.getComputedStyle),elmCurrentStyle=elm.currentStyle,oldDisplay,match,propTest=prop.push||cssPropRegex.exec(prop)||[];if(prop.push){for(;i<propLen;i++){total+=parseInt(getCssValue(elm,prop[i]),10)||0}return total+"px"}if(propTest[1]){if(!isVisible(elm)){return tempBlock(elm,function(){return getElmDimension(elm,propTest[1])+"px"})}return getElmDimension(elm,propTest[1])+"px"}else if(propTest[2]&&glow.env.ie&&getCssValue(elm,"border-"+propTest[3]+"-style")=="none"){return"0"}else if(compStyle){if(typeof compStyle=="function"){oldDisplay=elm.style.display;r=tempBlock(elm,function(){if(prop=="display"){elm.style.display=oldDisplay;if(!doc.defaultView.getComputedStyle(elm,null)){return"none"}elm.style.display="block"}return getCssValue(elm,prop)})}else{if(env.webkit>500&&env.webkit<526&&prop=='margin-right'&&compStyle.getPropertyValue('position')!='absolute'){prop='margin-left'}r=compStyle.getPropertyValue(prop)}}else if(elmCurrentStyle){if(prop=="opacity"){match=/alpha\(opacity=([^\)]+)\)/.exec(elmCurrentStyle.filter);return match?String(parseInt(match[1],10)/100):"1"}r=String(elmCurrentStyle[toStyleProp(prop)]);if(/^-?[\d\.]+(?!px)[%a-z]+$/i.test(r)&&prop!="font-size"){r=getPixelValue(elm,r,usesYAxis.test(prop))+"px"}}if(prop.indexOf("color")!=-1){r=normaliseCssColor(r).toString()}else if(r.indexOf("url")==0){r=r.replace(/\"/g,"")}return r}function getPixelValue(element,value,useYAxis){var axisPos=useYAxis?"top":"left",axisPosUpper=useYAxis?"Top":"Left",elmStyle=element.style,positionVal=elmStyle[axisPos],runtimePositionVal=element.runtimeStyle[axisPos],r;element.runtimeStyle[axisPos]=element.currentStyle[axisPos];elmStyle[axisPos]=value;r=elmStyle["pixel"+axisPosUpper];elmStyle[axisPos]=positionVal;element.runtimeStyle[axisPos]=runtimePositionVal;return r}function normaliseCssColor(val){if(/^(transparent|rgba\(0, ?0, ?0, ?0\))$/.test(val)){return'transparent'}var match,r,g,b,hex,mathRound=Math.round,parseIntFunc=parseInt,parseFloatFunc=parseFloat;if(match=colorRegex.exec(val)){r=match[2]?mathRound(((parseFloatFunc(match[1])/100)*255)):parseIntFunc(match[1]);g=match[4]?mathRound(((parseFloatFunc(match[3])/100)*255)):parseIntFunc(match[3]);b=match[6]?mathRound(((parseFloatFunc(match[5])/100)*255)):parseIntFunc(match[5])}else{if(typeof val=="number"){hex=val}else if(val.charAt(0)=="#"){if(val.length=="4"){val="#"+val.charAt(1)+val.charAt(1)+val.charAt(2)+val.charAt(2)+val.charAt(3)+val.charAt(3)}hex=parseIntFunc(val.slice(1),16)}else{hex=htmlColorNames[val]}r=(hex)>>16;g=(hex&0x00ff00)>>8;b=(hex&0x0000ff)}val=new String("rgb("+r+", "+g+", "+b+")");val.r=r;val.g=g;val.b=b;return val}function getTextNodeConcat(elm){var r="",nodes=elm.childNodes,i=0,len=nodes.length;for(;i<len;i++){if(nodes[i].nodeType==3){r+=nodes[i].nodeValue}else if(nodes[i].nodeType==1){r+=getTextNodeConcat(nodes[i])}}return r}function getNextOrPrev(nodelist,dir){var ret=[],ri=0,nextTmp,i=0,length=nodelist.length;for(;i<length;i++){nextTmp=nodelist[i];while(nextTmp=nextTmp[dir+"Sibling"]){if(nextTmp.nodeType==1&&nextTmp.nodeName!="!"){ret[ri++]=nextTmp;break}}}return r.get(ret)}function getPositionedParent(elm){var offsetParent=elm.offsetParent;while(offsetParent&&r.get(offsetParent).css("position")=="static"){offsetParent=offsetParent.offsetParent}if(!offsetParent&&r.get(docElm).css("position")!="static"){offsetParent=docElm}return offsetParent||null}function getScrollOffset(elm,isLeft){var r,scrollProp='scroll'+(isLeft?"Left":"Top");if(elm.window){r=elm.document.documentElement[scrollProp]||(isLeft?elm.pageXOffset:elm.pageYOffset)||0}else{r=elm[scrollProp]}return r}function setScrollOffset(elm,isLeft,newVal){if(elm.window){elm.scrollTo(isLeft?newVal:getScrollOffset(elm,true),!isLeft?newVal:getScrollOffset(elm,false))}else{elm['scroll'+(isLeft?"Left":"Top")]=newVal}}function scrollOffset(nodeList,isLeft,val){var i=nodeList.length;if(val!==undefined){while(i--){setScrollOffset(nodeList[i],isLeft,val)}return nodeList}else{return getScrollOffset(nodeList[0],isLeft)}}var r={};r.get=function(){var r=new glow.dom.NodeList(),i=0,args=arguments,argsLen=args.length;for(;i<argsLen;i++){if(typeof args[i]=="string"){r.push(new glow.dom.NodeList().push(doc).get(args[i]))}else{r.push(args[i])}}return r};r.create=function(sHtml,opts){var ret=[],i=0,rLen=0,toCheck;opts=glow.lang.apply({interpolate:null,escapeHtml:false},opts||{});if(opts.interpolate){sHtml=lang.interpolate(sHtml,opts.interpolate,{escapeHtml:opts.escapeHtml})}toCheck=stringToNodes(sHtml);for(;toCheck[i];i++){if(toCheck[i].nodeType==1&&toCheck[i].nodeName!="!"){ret[rLen++]=toCheck[i]}else if(toCheck[i].nodeType==3&&lang.trim(toCheck[i].nodeValue)!==""){throw new Error("glow.dom.create - Text must be wrapped in an element");}}return new r.NodeList().push(ret)};r.parseCssColor=function(cssColor){var normal=normaliseCssColor(cssColor);return{r:normal.r,g:normal.g,b:normal.b}};r.NodeList=function(){this.length=0};r.NodeList.prototype={item:function(nIndex){return this[nIndex]},push:function(){var args=arguments,argsLen=args.length,i=0,n,nNodeListLength,that=this,arrayPush=Array.prototype.push;for(;i<argsLen;i++){if(!args[i]){continue}else if(args[i].nodeType==1||args[i].nodeType==9||args[i].document){arrayPush.call(that,args[i])}else if(args[i][0]){for(n=0,nNodeListLength=args[i].length;n<nNodeListLength;n++){arrayPush.call(that,args[i][n])}}}return that},each:function(callback){for(var i=0,that=this,length=that.length;i<length;i++){callback.call(that[i],i,that)}return that},eq:function(nodelist){var that=this,i=0,length=that.length;if(!nodelist.push){nodelist=[nodelist]}if(nodelist.length!=that.length){return false}for(;i<length;i++){if(that[i]!=nodelist[i]){return false}}return true},isWithin:function(node){if(node.push){node=node[0]}if(!node||!this.length){return false}var that=this,i=0,length=that.length,toTest;if(node.contains&&env.webkit>=521){for(;i<length;i++){if(!(node.contains(that[i])&&that[i]!=node)){return false}}}else if(that[0].compareDocumentPosition){for(;i<length;i++){if(!(that[i].compareDocumentPosition(node)&8)){return false}}}else{for(;i<length;i++){toTest=that[i];while(toTest=toTest.parentNode){if(toTest==node){break}}if(!toTest){return false}}}return true},attr:function(name){var that=this,args=arguments,argsLen=args.length,i,value;if(that.length===0){return argsLen>1?that:undefined}if(typeof name=='object'){for(i in name){if(lang.hasOwnProperty(name,i)){that.attr(i,name[i])}}return that}if(env.ie&&dom0PropertyMapping[name]){if(argsLen>1){setAttribute.call(that,args[1],function(val){this[dom0PropertyMapping[name]]=val});return that}value=that[0][dom0PropertyMapping[name]];if(dom0BooleanAttribute[name]){return value?name:undefined}else if(dom0AttributeMappings[name]){return dom0AttributeMappings[name](value)}return value}if(argsLen>1){setAttribute.call(that,args[1],function(val){this.setAttribute(name,val)});return that}return isXml(that[0])?that[0].getAttribute(name):that[0].getAttribute(name,2)},removeAttr:function(name){var mapping=env.ie&&dom0PropertyMapping[name],that=this,i=0,length=that.length;for(;i<length;i++){if(mapping){that[i][mapping]=""}else{that[i].removeAttribute(name)}}return that},hasAttr:function(name){var firstNode=this[0],attributes=firstNode.attributes;if(isXml(firstNode)&&env.ie){var attributes=firstNode.attributes,i=0,len=attributes.length;for(;i<len;i++){if(attributes[i].nodeName==name){return attributes[i].specified}}return false}else if(this[0].getAttributeNode){var attr=this[0].getAttributeNode(name);return attr?attr.specified:false}return typeof attributes[attr]!="undefined"},prop:function(name,val){if(name.constructor===Object){var hash=name,key;for(key in hash){this.prop(key,hash[key])}return this}if(val!==undefined){var i=this.length;while(i--){this[i][name]=val}return this}if(!this[0]){return undefined}return this[0][name]},hasClass:function(name){for(var i=0,length=this.length;i<length;i++){if((" "+this[i].className+" ").indexOf(" "+name+" ")!=-1){return true}}return false},addClass:function(name){for(var i=0,length=this.length;i<length;i++){if((" "+this[i].className+" ").indexOf(" "+name+" ")==-1){this[i].className+=((this[i].className)?" ":"")+name}}return this},removeClass:function(name){var re=removeClassRegex(name),that=this,i=0,length=that.length;for(;i<length;i++){that[i].className=that[i].className.replace(re," ")}return that},toggleClass:function(name){var i=this.length,paddedClassName,paddedName=" "+name+" ";while(i--){paddedClassName=" "+this[i].className+" ";if(paddedClassName.indexOf(paddedName)!=-1){this[i].className=paddedClassName.replace(paddedName," ")}else{this[i].className+=" "+name}}return this},val:function(){function elementValue(el){var elType=el.type,elChecked=el.checked,elValue=el.value,vals=[],i=0;if(elType=="radio"){return elChecked?elValue:""}else if(elType=="checkbox"){return elChecked?elValue:""}else if(elType=="select-one"){return el.selectedIndex>-1?el.options[el.selectedIndex].value:""}else if(elType=="select-multiple"){for(var length=el.options.length;i<length;i++){if(el.options[i].selected){vals[vals.length]=el.options[i].value}}return vals}else{return elValue}}function formValues(form){var vals={},radios={},formElements=form.elements,i=0,length=formElements.length,name,formElement,j,radio,nodeName;for(;i<length;i++){formElement=formElements[i];nodeName=formElement.nodeName.toLowerCase();name=formElement.name;if(nodeName=="fieldset"||nodeName=="object"||!name){continue}if(formElement.type=="checkbox"&&!formElement.checked){if(!name in vals){vals[name]=undefined}}else if(formElement.type=="radio"){if(radios[name]){radios[name][radios[name].length]=formElement}else{radios[name]=[formElement]}}else{var value=elementValue(formElement);if(name in vals){if(vals[name].push){vals[name][vals[name].length]=value}else{vals[name]=[vals[name],value]}}else{vals[name]=value}}}for(i in radios){j=0;for(length=radios[i].length;j<length;j++){radio=radios[i][j];name=radio.name;if(radio.checked){vals[radio.name]=radio.value;break}}if(!name in vals){vals[name]=undefined}}return vals}function setFormValues(form,vals){var prop,currentField,fields={},storeType,i=0,n,len,foundOne,currentFieldType;for(prop in vals){currentField=form[prop];if(currentField&&currentField[0]&&!currentField.options){vals[prop]=vals[prop]&&vals[prop].push?vals[prop]:[vals[prop]];fields.radios=[];fields.checkboxesSelects=[];fields.multiSelects=[];fields.other=[];for(i=0;currentField[i];i++){currentFieldType=currentField[i].type;if(currentFieldType=="radio"){storeType="radios"}else if(currentFieldType=="select-one"||currentFieldType=="checkbox"){storeType="checkboxesSelects"}else if(currentFieldType=="select-multiple"){storeType="multiSelects"}else{storeType="other"}fields[storeType][fields[storeType].length]=currentField[i]}for(i=0;fields.multiSelects[i];i++){vals[prop]=setValue(fields.multiSelects[i],vals[prop])}for(i=0;fields.checkboxesSelects[i];i++){setValue(fields.checkboxesSelects[i],"");for(n=0,len=vals[prop].length;n<len;n++){if(setValue(fields.checkboxesSelects[i],vals[prop][n])){vals[prop].slice(n,1);break}}}for(i=0;fields.radios[i];i++){fields.radios[i].checked=false;foundOne=false;for(n=0,len=vals[prop].length;n<len;n++){if(setValue(fields.radios[i],vals[prop][n])){vals[prop].slice(n,1);foundOne=true;break}if(foundOne){break}}}for(i=0;fields.other[i]&&vals[prop][i]!==undefined;i++){setValue(fields.other[i],vals[prop][i])}}else if(currentField&&currentField.nodeName){setValue(currentField,vals[prop])}}}function setValue(el,val){var i=0,length,n=0,nlen,elOption,optionVal;if(el.type=="select-one"){for(length=el.options.length;i<length;i++){if(el.options[i].value==val){el.selectedIndex=i;return true}}return false}else if(el.type=="select-multiple"){var isArray=!!val.push;for(i=0,length=el.options.length;i<length;i++){elOption=el.options[i];optionVal=elOption.value;if(isArray){elOption.selected=false;for(nlen=val.length;n<nlen;n++){if(optionVal==val[n]){elOption.selected=true;val.splice(n,1);break}}}else{return elOption.selected=val==optionVal}}return false}else if(el.type=="radio"||el.type=="checkbox"){el.checked=val==el.value;return val==el.value}else{el.value=val;return true}}return function(){var args=arguments,val=args[0],that=this,i=0,length=that.length;if(args.length===0){return that[0].nodeName=='FORM'?formValues(that[0]):elementValue(that[0])}if(that[0].nodeName=='FORM'){if(!typeof val=='object'){throw'value for FORM must be object';}setFormValues(that[0],val)}else{for(;i<length;i++){setValue(that[i],val)}}return that}}(),slice:function(){return new r.NodeList().push(Array.prototype.slice.apply(this,arguments))},sort:function(func){var that=this,i=0,aNodes;if(!that.length){return that}if(!func){if(typeof that[0].sourceIndex=="number"){func=function(a,b){return a.sourceIndex-b.sourceIndex}}else if(that[0].compareDocumentPosition){func=function(a,b){return 3-(a.compareDocumentPosition(b)&6)}}else{aNodes=getByTagName("*",[doc]);for(;aNodes[i];i++){aNodes[i]._sourceIndex=i}func=function(a,b){return a._sourceIndex-b._sourceIndex}}}return r.get([].sort.call(that,func))},filter:function(callback){var ret=[],ri=0,i=0,length=this.length;for(;i<length;i++){if(callback.apply(this[i],[i])){ret[ri++]=this[i]}}return r.get(ret)},children:function(){var ret=[],ri=0,i=0,n=0,length=this.length,childTmp;for(;i<length;i++){ret=ret.concat(getChildElms(this[i]))}return r.get(ret)},parent:function(){var ret=[],ri=0,i=0,length=this.length;for(;i<length;i++){ret[ri++]=this[i].parentNode}return r.get(unique(ret))},ancestors:function(){var ret=[],ri=0,i=0,length=this.length,elm;while(i<length){elm=this[i].parentNode;while(elm&&elm.nodeType==1){ret[ri++]=elm;elm=elm.parentNode}i++}return r.get(unique(ret))},wrap:function(wrapper){var length=this.length,childElm,parent,wrappingNodes;if(typeof wrapper=='string'){wrappingNodes=r.create(wrapper)}else{wrappingNodes=r.get(wrapper)}for(i=0;i<length;i++){parent=wrappingNodes[0];while(parent){childElm=getFirstChildElm(parent);if(childElm){parent=childElm}else{break}}if(this[i].parentNode){wrappingNodes.insertBefore(this[i])}if(i!=length-1){wrappingNodes=wrappingNodes.clone()}parent.appendChild(this[i])}return this},unwrap:function(){var toRemove,nodesToRemove=this.parent(),length=nodesToRemove.length;for(i=0;i<length;i++){toRemove=nodesToRemove.slice(i,i+1);if(!toRemove[0].parentNode){toRemove.children().remove();toRemove.destroy()}else{toRemove.children().insertBefore(toRemove);toRemove.destroy()}}return this},next:function(){return getNextOrPrev(this,"next")},prev:function(){return getNextOrPrev(this,"previous")},is:function(selector){var nodes=glow.dom.get(selector),i=0,iLen=this.length,j,jLen;node:for(;i<iLen;i++){for(j=0,jLen=nodes.length;j<jLen;j++){if(this[i]==nodes[j]){continue node}}return false}return true},text:function(){var args=arguments,i=0,that=this,length=that.length;if(args.length>0){for(;i<length;i++){that[i].innerHTML="";that[i].appendChild(doc.createTextNode(args[0]))}return that}return that[0].innerText||that[0].textContent==undefined?getTextNodeConcat(that[0]):that[0].textContent},empty:function(){var i=0,len=this.length;for(;i<len;i++){while(this[i].firstChild){this[i].removeChild(this[i].firstChild)}}return this},remove:function(){for(var that=this,i=0,length=that.length,parentNode;i<length;i++){if(parentNode=that[i].parentNode){parentNode.removeChild(that[i])}}return that},destroy:function(){this.get("*").push(this).removeData();this.appendTo(tmpDiv);tmpDiv.innerHTML="";Array.prototype.splice.call(this,0,this.length);return this},clone:function(cloneListeners){var ret=[],i=this.length,allCloneElms,allBaseElms;eventIdProp='__eventId'+glow.UID;while(i--){ret[i]=this[i].cloneNode(true)}allCloneElms=r.get(ret).get("*").push(ret);if(nodePropertiesCloned&&!isXml(ret[0])){i=allCloneElms.length;while(i--){allCloneElms[i][eventIdProp]=null}}allBaseElms=this.get("*").push(this);i=allCloneElms.length;while(i--){allCloneElms[i].removeAttribute(dataPropName);glow.dom.get(allCloneElms[i]).data(glow.dom.get(allBaseElms[i]).data())}if(cloneListeners){if(!glow.events){throw"glow.events required to clone event listeners";}glow.events._copyListeners(this.get("*").push(this),allCloneElms||r.get(ret).get("*").push(ret))}return r.get(ret)},html:function(newHtml){var i=0,length=this.length;if(newHtml!==undefined){return this.empty().append(newHtml)}return this[0]?this[0].innerHTML:""},width:function(width){if(width==undefined){return getElmDimension(this[0],"width")}setElmsSize(this,width,"width");return this},height:function(height){if(height==undefined){return getElmDimension(this[0],"height")}setElmsSize(this,height,"height");return this},scrollLeft:function(val){return scrollOffset(this,true,val)},scrollTop:function(val){return scrollOffset(this,false,val)},show:function(){var i=0,len=this.length,currItem,itemStyle;for(;i<len;i++){currItem=r.get(this[i]);itemStyle=currItem[0].style;if(currItem.css("display")=="none"){itemStyle.display="";itemStyle.visibility="visible";if(currItem.css("display")=="none"){itemStyle.display="block"}}}return this},hide:function(){return this.css("display","none").css("visibility","hidden")},css:function(prop,val){var that=this,thisStyle,i=0,len=that.length,originalProp=prop;if(prop.constructor===Object){for(style in prop){this.css(style,prop[style])}return that}else if(val!=undefined){prop=toStyleProp(prop);for(;i<len;i++){thisStyle=that[i].style;if(typeof val=="number"&&hasUnits.test(originalProp)){val=val.toString()+"px"}if(prop=="opacity"&&env.ie){thisStyle.zoom="1";if(val===""){thisStyle.filter=""}else{thisStyle.filter="alpha(opacity="+Math.round(Number(val,10)*100)+")"}}else{thisStyle[prop]=val}}return that}else{if(!len){return}return getCssValue(that[0],prop)}},offset:function(){var elm=this[0],docScrollPos={x:getScrollOffset(window,true),y:getScrollOffset(window,false)};if(!glow.env.webkit&&elm.getBoundingClientRect){var rect=elm.getBoundingClientRect();return{top:rect.top+docScrollPos.y-docElm.clientTop,left:rect.left+docScrollPos.x-docElm.clientLeft}}else{var top=elm.offsetTop,left=elm.offsetLeft,originalElm=elm,nodeNameLower,involvesFixedElement=false,offsetParentBeforeBody=elm;while(elm=elm.offsetParent){left+=elm.offsetLeft;top+=elm.offsetTop;if(getCssValue(elm,"position")=="fixed"){involvesFixedElement=true}if(env.gecko||env.webkit>500){left+=parseInt(getCssValue(elm,"border-left-width"))||0;top+=parseInt(getCssValue(elm,"border-top-width"))||0}if(elm.nodeName.toLowerCase()!="body"){offsetParentBeforeBody=elm}}elm=originalElm;while((elm=elm.parentNode)&&(elm!=docBody)&&(elm!=docElm)){left-=elm.scrollLeft;top-=elm.scrollTop;if(env.gecko&&getCssValue(elm,"overflow")!="visible"){left+=parseInt(getCssValue(elm,"border-left-width"));top+=parseInt(getCssValue(elm,"border-top-width"))}}if(involvesFixedElement){left+=docScrollPos.x;top+=docScrollPos.y}if((env.webkit<500&&(involvesFixedElement||getCssValue(offsetParentBeforeBody,"position")=="absolute"))||(env.gecko&&getCssValue(offsetParentBeforeBody,"position")!="absolute")){left-=docBody.offsetLeft;top-=docBody.offsetTop}return{left:left,top:top}}},position:function(){var positionedParent=r.get(getPositionedParent(this[0])),hasPositionedParent=!!positionedParent[0],marginLeft=parseInt(this.css("margin-left"))||0,marginTop=parseInt(this.css("margin-top"))||0,positionedParentBorderLeft=(hasPositionedParent&&parseInt(positionedParent.css("border-left-width")))||0,positionedParentBorderTop=(hasPositionedParent&&parseInt(positionedParent.css("border-top-width")))||0,elOffset=this.offset(),positionedParentOffset=hasPositionedParent?positionedParent.offset():{top:0,left:0};return{left:elOffset.left-positionedParentOffset.left-marginLeft-positionedParentBorderLeft,top:elOffset.top-positionedParentOffset.top-marginTop-positionedParentBorderTop}},append:function(nodeSpec){var that=this,j=0,i=1,length=that.length,nodes;if(length==0){return that}nodes=typeof nodeSpec=="string"?nodelistToArray(stringToNodes(nodeSpec)):nodeSpec.nodeType?[nodeSpec]:nodelistToArray(nodeSpec);for(;nodes[j];j++){that[0].appendChild(nodes[j])}for(;i<length;i++){for(j=0;nodes[j];j++){that[i].appendChild(nodes[j].cloneNode(true))}}return that},prepend:function(nodeSpec){var that=this,j=0,i=1,length=that.length,nodes,first;if(length==0){return that}nodes=typeof nodeSpec=="string"?nodelistToArray(stringToNodes(nodeSpec)):nodeSpec.nodeType?[nodeSpec]:nodelistToArray(nodeSpec);first=that[0].firstChild;for(;nodes[j];j++){that[0].insertBefore(nodes[j],first)}for(;i<length;i++){first=that[i].firstChild;for(j=0;nodes[j];j++){that[i].insertBefore(nodes[j].cloneNode(true),first)}}return that},appendTo:function(nodes){if(!(nodes instanceof r.NodeList)){nodes=r.get(nodes)}nodes.append(this);return this},prependTo:function(nodes){if(!(nodes instanceof r.NodeList)){nodes=r.get(nodes)}nodes.prepend(this);return this},after:function(nodeSpec){var that=this,length=that.length,nodes,nodesLen,j,i=1,cloned;if(length==0){return that}nodes=typeof nodeSpec=="string"?r.create(nodeSpec):nodeSpec instanceof r.NodeList?nodeSpec:r.get(nodeSpec);nodesLen=nodes.length;for(j=nodesLen-1;j>=0;j--){that[0].parentNode.insertBefore(nodes[j],that[0].nextSibling)}for(;i<length;i++){cloned=nodes.clone();for(j=nodesLen-1;j>=0;j--){that[i].parentNode.insertBefore(cloned[j],that[i].nextSibling)}}return that},before:function(nodeSpec){var that=this,length=that.length,j=0,i=1,nodes,nodesLen,cloned;if(length==0){return that}nodes=typeof nodeSpec=="string"?r.create(nodeSpec):nodeSpec instanceof r.NodeList?nodeSpec:r.get(nodeSpec);nodesLen=nodes.length;for(;j<nodesLen;j++){that[0].parentNode.insertBefore(nodes[j],that[0])}for(;i<length;i++){cloned=nodes.clone();for(j=0;j<nodesLen;j++){that[i].parentNode.insertBefore(cloned[j],that[i])}}return that},insertAfter:function(nodes){if(!(nodes instanceof r.NodeList)){nodes=r.get(nodes)}nodes.after(this);return this},insertBefore:function(nodes){if(!(nodes instanceof r.NodeList)){nodes=r.get(nodes)}nodes.before(this);return this},replaceWith:function(nodeSpec){if(env.webkit<500){this.after(placeholderElm).remove();r.get("u.glow-placeholder").after(nodeSpec).remove()}else{this.after(nodeSpec).remove()}return this},data:function(key,val){if(typeof key==="object"){for(var prop in key){this.data(prop,key[prop])}return this}var index,elm;switch(arguments.length){case 0:if(this[0]===undefined){return undefined}index=this[0][dataPropName]||dataIndex++;return dataCache[index]||(dataCache[index]={});case 1:if(this[0]===undefined){return undefined}index=this[0][dataPropName];return index?dataCache[index][key]:undefined;case 2:for(var i=this.length;i--;){elm=this[i];if(!(index=elm[dataPropName])){index=dataIndex++;elm[dataPropName]=index;dataCache[index]={}}dataCache[index][key]=val}return this;default:throw new Error("glow.dom.NodeList#data expects 2 or less arguments, not "+arguments.length+".");}},removeData:function(key){var elm,i=this.length,index;while(i--){elm=this[i];index=elm[dataPropName];if(index!==undefined){switch(arguments.length){case 0:dataCache[index]=undefined;elm[dataPropName]=undefined;try{delete elm[dataPropName]}catch(e){elm.removeAttribute&&elm.removeAttribute(dataPropName)}break;case 1:dataCache[index][key]=undefined;delete dataCache[index][key];break;default:throw new Error("glow.dom.NodeList#removeData expects 1 or less arguments, not "+arguments.length+".");}}}return this},get:function(){function compileSelector(sSelector){if(cssCache[sSelector]){return cssCache[sSelector]}var r=[],ri=0,comb,tagTmp,idTmp,aRx,matchedCondition,sLastSelector,firstLoop=true,originalSelector=sSelector;while(sSelector&&sSelector!=sLastSelector){tagTmp="";idTmp="";sLastSelector=sSelector;if(aRx=cssRegex.combinator.exec(sSelector)){comb=aRx[1];sSelector=sSelector.slice(aRx[0].length)}if(aRx=cssRegex.tagName.exec(sSelector)){tagTmp=aRx[1];sSelector=sSelector.slice(aRx[0].length)}if(aRx=cssRegex.classNameOrId.exec(sSelector)){if(aRx[1]=="#"){idTmp=aRx[2];sSelector=sSelector.slice(aRx[0].length)}}if(!comb){if(idTmp&&firstLoop){r[ri++]=[getByIdQuick,[idTmp.replace(/\\/g,""),tagTmp||"*",null]]}else{r[ri++]=[getByTagName,[tagTmp||"*",null]];if(idTmp){r[ri++]=[hasId,[idTmp.replace(/\\/g,""),null]]}}}else if(comb==">"){r[ri++]=[getChildren,[null]];if(idTmp){r[ri++]=[hasId,[idTmp.replace(/\\/g,""),null]]}if(tagTmp&&tagTmp!="*"){r[ri++]=[isTag,[tagTmp,null]]}}matchedCondition=true;while(matchedCondition){if(sSelector.charAt(0)=="#"||sSelector.charAt(0)=="."){if(aRx=cssRegex.classNameOrId.exec(sSelector)){if(sSelector.charAt(0)=="#"){r[ri++]=[hasId,[aRx[2].replace(/\\/g,""),null]]}else{r[ri++]=[hasClassName,[aRx[2].replace(/\\/g,""),null]]}sSelector=sSelector.slice(aRx[0].length)}else{throw new Error("Invalid Selector "+originalSelector);}}else{matchedCondition=false}}firstLoop=false}if(sSelector!==""){throw new Error("Invalid Selector "+originalSelector);}return cssCache[sSelector]=r}function fetchElements(a,initialContext){var context=initialContext;for(var i=0,al=a.length;i<al;i++){a[i][1][a[i][1].length-1]=context;context=a[i][0].apply(this,a[i][1])}return context}function getByIdQuick(id,tagName,context){var r=[],ri=0,notQuick=[],notQuicki=0,tmpNode;for(var i=0,length=context.length;i<length;i++){if(context[i].getElementById){tmpNode=context[i].getElementById(id);if(tmpNode&&(tmpNode.tagName==tagName.toUpperCase()||tagName=="*"||tmpNode.tagName==tagName)){r[ri++]=tmpNode}}else{notQuick[notQuicki++]=context[i]}}if(notQuick[0]){notQuick=getByTagName(tagName,notQuick);notQuick=hasId(id,notQuick)}return r.concat(notQuick)}function getChildren(context){var r=[],i=0,len=context.length;for(;i<len;i++){append(r,getChildElms(context[i]))}return r}function hasId(id,context){for(var i=0,length=context.length;i<length;i++){if(context[i].id==id){return[context[i]]}}return[]}function isTag(tagName,context){var r=[],ri=0;for(var i=0,length=context.length;i<length;i++){if(context[i].tagName==tagName.toUpperCase()||context[i].tagName==tagName){r[ri++]=context[i]}}return r}function hasClassName(className,context){var r=[],ri=0;for(var i=0,length=context.length;i<length;i++){if((" "+context[i].className+" ").indexOf(" "+className+" ")!=-1){r[ri++]=context[i]}}return r}function getBySelector(sSelector,context){var aCompiledCSS;var r=[];var aSelectors=sSelector.split(",");for(var i=0,nSelLen=aSelectors.length;i<nSelLen;i++){aCompiledCSS=compileSelector(glow.lang.trim(aSelectors[i]));r=r.concat(fetchElements(aCompiledCSS,context))}return r}function getIfWithinContext(nodes,context){nodes=nodes.length?nodes:[nodes];var r=[];var nl;for(var i=0;nodes[i];i++){nl=glow.dom.get(nodes[i]);for(var n=0;context[n];n++){if(nl.isWithin(context[n])){r[r.length]=nl[0];break}}}return r}return function(sSelector){if(!this.length){return this}var r=[];for(var i=0,argLen=arguments.length;i<argLen;i++){if(typeof arguments[i]=="string"){r=r.concat(getBySelector(arguments[i],this))}else{r=r.concat(getIfWithinContext(arguments[i],this))}}return glow.dom.get(unique(r))}}()};placeholderElm=r.create('<u class="glow-placeholder"></u>');glow.dom=r}});(window.gloader||glow).module({name:"glow.events",library:["glow","1.7.0"],depends:[["glow","1.7.0",'glow.dom']],builder:function(glow){var $=glow.dom.get;var r={};var eventid=1;var objid=1;var listenersByObjId={};var listenersByEventId={};var domListeners={};var psuedoPrivateEventKey='__eventId'+glow.UID;var psuedoPreventDefaultKey=psuedoPrivateEventKey+'PreventDefault';var psuedoStopPropagationKey=psuedoPrivateEventKey+'StopPropagation';var topKeyListeners={};var keyListenerId=1;var keyListeners={};var keyTypes={};var CTRL=1;var ALT=2;var SHIFT=4;var specialPrintables={TAB:'\t',SPACE:' ',ENTER:'\n',BACKTICK:'`'};var keyNameAliases={'96':223};var keyNameToCode={CAPSLOCK:20,NUMLOCK:144,SCROLLLOCK:145,BREAK:19,BACKTICK:223,BACKSPACE:8,PRINTSCREEN:44,MENU:93,SPACE:32,SHIFT:16,CTRL:17,ALT:18,ESC:27,TAB:9,META:91,RIGHTMETA:92,ENTER:13,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,INS:45,HOME:36,PAGEUP:33,DEL:46,END:35,PAGEDOWN:34,LEFT:37,UP:38,RIGHT:39,DOWN:40};var codeToKeyName={};for(var i in keyNameToCode){codeToKeyName[''+keyNameToCode[i]]=i}var operaBrokenChars='0123456789=;\'\\\/#,.-';function removeKeyListener(ident){var keyType=keyTypes[ident];if(!keyType){return false}var listeners=keyListeners[keyType];if(!listeners){return false}for(var i=0,len=listeners.length;i<len;i++){if(listeners[i][0]==ident){listeners.splice(i,1);return true}}return false}function initTopKeyListener(type){topKeyListeners[type]=r.addListener(document,'key'+type,function(e){var mods=0;if(e.ctrlKey){mods+=CTRL}if(e.altKey){mods+=ALT}if(e.shiftKey){mods+=SHIFT}var keyType=e.chr?e.chr.toLowerCase():e.key?e.key.toLowerCase():e.keyCode;var eventType=mods+':'+keyType+':'+type;var listeners=keyListeners[eventType]?keyListeners[eventType].slice(0):[];if(e.shiftKey){var shiftEventType=(mods&~SHIFT)+':'+keyType+':'+type;if(keyListeners[shiftEventType]){for(var i=0,len=keyListeners[shiftEventType].length;i<len;i++){listeners[listeners.length]=keyListeners[shiftEventType][i]}}}if(!listeners){return}for(var i=0,len=listeners.length;i<len;i++){if(listeners[i][2].call(listeners[i][3]||this,e)===false){e.preventDefault()}}return!e.defaultPrevented()})}function clearEvents(){var ident;for(ident in listenersByEventId){r.removeListener(ident)}}var previousKeyDownKeyCode;var operaResizeListener,operaDocScrollListener;function addDomListener(attachTo,name,capturingMode){var wheelEventName;capturingMode=!!capturingMode;if(glow.env.opera){if(name.toLowerCase()=='resize'&&!operaResizeListener&&attachTo==window){operaResizeListener=r.addListener(window.document.body,'resize',function(e){r.fire(window,'resize',e)})}else if(name.toLowerCase()=='scroll'&&!operaDocScrollListener&&attachTo==window){operaDocScrollListener=r.addListener(window.document,'scroll',function(e){r.fire(window,'scroll',e)})}}var callback=function(e){if(!e){e=window.event}var event=new r.Event(),lowerCaseName=name.toLowerCase();event.nativeEvent=e;event.source=e.target||e.srcElement;event.relatedTarget=e.relatedTarget||(lowerCaseName=="mouseover"?e.fromElement:e.toElement);event.button=glow.env.ie?(e.button&1?0:e.button&2?2:1):e.button;if(e.pageX||e.pageY){event.pageX=e.pageX;event.pageY=e.pageY}else if(e.clientX||e.clientY){event.pageX=e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;event.pageY=e.clientY+document.body.scrollTop+document.documentElement.scrollTop}if(lowerCaseName=='mousewheel'){event.wheelDelta=e.wheelDelta?e.wheelDelta/120:e.detail?-e.detail/3:0;if(event.wheelDelta==0){return}}if(lowerCaseName.indexOf("key")!=-1){event.altKey=!!e.altKey;event.ctrlKey=!!e.ctrlKey;event.shiftKey=!!e.shiftKey;if(name=='keydown'){previousKeyDownKeyCode=e.keyCode}event.charCode=e.keyCode&&e.charCode!==0?undefined:e.charCode;if(lowerCaseName=='keypress'){if(typeof(event.charCode)=='undefined'){event.charCode=e.keyCode}if(glow.env.opera&&event.charCode&&event.charCode==previousKeyDownKeyCode&&operaBrokenChars.indexOf(String.fromCharCode(event.charCode))==-1){event.charCode=undefined;event.keyCode=previousKeyDownKeyCode}}if(event.charCode&&event.charCode<=49){event.charCode=undefined}if(event.charCode){event.chr=String.fromCharCode(event.charCode)}else if(e.keyCode){event.charCode=undefined;event.keyCode=keyNameAliases[e.keyCode.toString()]||e.keyCode;event.key=codeToKeyName[event.keyCode];if(specialPrintables[event.key]){event.chr=specialPrintables[event.key];event.charCode=event.chr.charCodeAt(0)}}if(event.chr){event.capsLock=event.chr.toUpperCase()!=event.chr?event.shiftKey:event.chr.toLowerCase()!=event.chr?!event.shiftKey:undefined}}r.fire(this,name,event);if(event.defaultPrevented()){return false}};if(attachTo.addEventListener&&(!glow.env.webkit||glow.env.webkit>418)){if((name=='focus'||name=='blur')&&(glow.env.opera)){attachTo.parentNode.addEventListener(name,function(){},true)}attachTo.addEventListener(name.toLowerCase()=='mousewheel'&&glow.env.gecko?'DOMMouseScroll':name,callback,capturingMode)}else{var onName='on'+name;var existing=attachTo[onName];if(existing){attachTo[onName]=function(){var existingReturn=existing.apply(this,arguments),callbackReturn=callback.apply(this,arguments);return(existingReturn!==false)&&(callbackReturn!==false)}}else{attachTo[onName]=callback}}attachTo=null}function addMouseEnterLeaveEvent(attachTo,isLeave){var elm=$(attachTo),listenFor=isLeave?"mouseout":"mouseover",toFire=isLeave?"mouseleave":"mouseenter";r.addListener(attachTo,listenFor,function(e){var relatedTarget=$(e.relatedTarget);if(!relatedTarget.eq(elm)&&!relatedTarget.isWithin(elm)){return!r.fire(elm[0],toFire,e).defaultPrevented()}})}r._copyListeners=function(from,to){var i=from.length,elementEvents,eventName,listenerIndex,listenersLen,listener;while(i--){if(from[i][psuedoPrivateEventKey]){elementEvents=listenersByObjId[from[i][psuedoPrivateEventKey]];for(eventName in elementEvents){listenerIndex=0;listenersLen=elementEvents[eventName].length;for(;listenerIndex<listenersLen;listenerIndex++){listener=elementEvents[eventName][listenerIndex];r.addListener(to[i],eventName,listener[2],listener[3])}}}}};r.addListener=function(attachTo,name,callback,context){var capturingMode=false;if(!attachTo){throw'no attachTo paramter passed to addListener';}if(typeof attachTo=='string'){if(!glow.dom){throw"glow.dom must be loaded to use a selector as the first argument to glow.events.addListener";}attachTo=$(attachTo)}if(glow.dom&&attachTo instanceof glow.dom.NodeList){var listenerIds=[],i=attachTo.length;while(i--){listenerIds[i]=r.addListener(attachTo[i],name,callback,context)}return listenerIds}var objIdent;if(!(objIdent=attachTo[psuedoPrivateEventKey])){objIdent=attachTo[psuedoPrivateEventKey]=objid++}var ident=eventid++;var listener=[objIdent,name,callback,context,ident];listenersByEventId[ident]=listener;var objListeners=listenersByObjId[objIdent];if(!objListeners){objListeners=listenersByObjId[objIdent]={}}var objEventListeners=objListeners[name];if(!objEventListeners){objEventListeners=objListeners[name]=[]}objEventListeners[objEventListeners.length]=listener;if((attachTo.addEventListener||attachTo.attachEvent)&&!domListeners[objIdent+':'+name]){switch(name){case"mouseenter":addMouseEnterLeaveEvent(attachTo,false);return ident;case"mouseleave":addMouseEnterLeaveEvent(attachTo,true);return ident;case"focus":if(glow.env.ie){addFocusInOutEvent(attachTo,true);return ident}else{capturingMode=true}break;case"blur":if(glow.env.ie){addFocusInOutEvent(attachTo,false);return ident}else{capturingMode=true}break}addDomListener(attachTo,name,capturingMode);domListeners[objIdent+':'+name]=true}return ident};function addFocusInOutEvent(attachTo,event){var listenFor=event?'focusin':'focusout',toFire=event?'focus':'blur';r.addListener(attachTo,listenFor,function(e){return!r.fire(attachTo,toFire,e).defaultPrevented()})};r.removeListener=function(ident){if(ident&&ident.toString().indexOf('k:')!=-1){return removeKeyListener(ident)}if(ident instanceof Array){var i=ident.length;while(i--){r.removeListener(ident[i])}return true}var listener=listenersByEventId[ident];if(!listener){return false}delete listenersByEventId[ident];var listeners=listenersByObjId[listener[0]][listener[1]];for(var i=0,len=listeners.length;i<len;i++){if(listeners[i]==listener){listeners.splice(i,1);break}}if(!listeners.length){delete listenersByObjId[listener[0]][listener[1]]}var listenersLeft=false;for(var i in listenersByObjId[listener[0]]){listenersLeft=true;break}if(!listenersLeft){delete listenersByObjId[listener[0]]}return true};r.removeAllListeners=function(obj){var i,objId,listenerIds=[],listenerIdsLen=0,eventName,events;if(typeof obj=="string"){obj=$(obj)}if(obj instanceof Array||obj instanceof glow.dom.NodeList){i=obj.length;while(i--){r.removeAllListeners(obj[i])}return r}objId=obj[psuedoPrivateEventKey];if(!objId){return r}events=listenersByObjId[objId];for(eventName in events){i=events[eventName].length;while(i--){listenerIds[listenerIdsLen++]=events[eventName][i][4]}}if(listenerIds.length){r.removeListener(listenerIds)}return r};r.fire=function(attachedTo,name,e){if(!attachedTo)throw'glow.events.fire: required parameter attachedTo not passed (name: '+name+')';if(!name)throw'glow.events.fire: required parameter name not passed';if(!e){e=new r.Event()}if(e.constructor===Object){e=new r.Event(e)}if(typeof attachedTo=='string'){if(!glow.dom){throw"glow.dom must be loaded to use a selector as the first argument to glow.events.addListener";}attachedTo=$(attachedTo)}e.type=name;e.attachedTo=attachedTo;if(!e.source){e.source=attachedTo}if(attachedTo instanceof glow.dom.NodeList){attachedTo.each(function(i){callListeners(attachedTo[i],e)})}else{callListeners(attachedTo,e)}return e};function callListeners(attachedTo,e){var objIdent,objListeners,objEventListeners=objListeners&&objListeners[e.type];(objIdent=attachedTo[psuedoPrivateEventKey])&&(objListeners=listenersByObjId[objIdent])&&(objEventListeners=objListeners[e.type]);if(!objEventListeners){return e}var listener;var listeners=objEventListeners.slice(0);for(var i=0,len=listeners.length;i<len;i++){listener=listeners[i];if(listener[2].call(listener[3]||attachedTo,e)===false){e.preventDefault()}}};var keyRegex=/^((?:(?:ctrl|alt|shift)\+)*)(?:(\w+|.)|[\n\r])$/i;r.addKeyListener=function(key,type,callback,context){type.replace(/^key/i,"");type=type.toLowerCase();if(!(type=='press'||type=='down'||type=='up')){throw'event type must be press, down or up';}if(!topKeyListeners[type]){initTopKeyListener(type)}var res=key.match(keyRegex),mods=0,charCode;if(!res){throw'key format not recognised';}if(res[1].toLowerCase().indexOf('ctrl')!=-1){mods+=CTRL}if(res[1].toLowerCase().indexOf('alt')!=-1){mods+=ALT}if(res[1].toLowerCase().indexOf('shift')!=-1){mods+=SHIFT}var eventKey=mods+':'+(res[2]?res[2].toLowerCase():'\n')+':'+type;var ident='k:'+keyListenerId++;keyTypes[ident]=eventKey;var listeners=keyListeners[eventKey];if(!listeners){listeners=keyListeners[eventKey]=[]}listeners[listeners.length]=[ident,type,callback,context];return ident};r.Event=function(obj){if(obj){glow.lang.apply(this,obj)}};r.Event.prototype.preventDefault=function(){if(this[psuedoPreventDefaultKey]){return}this[psuedoPreventDefaultKey]=true;if(this.nativeEvent&&this.nativeEvent.preventDefault){this.nativeEvent.preventDefault();this.nativeEvent.returnValue=false}};r.Event.prototype.defaultPrevented=function(){return!!this[psuedoPreventDefaultKey]};r.Event.prototype.stopPropagation=function(){if(this[psuedoStopPropagationKey]){return}this[psuedoStopPropagationKey]=true;var e=this.nativeEvent;if(e){e.cancelBubble=true;if(e.stopPropagation){e.stopPropagation()}}};r.Event.prototype.propagationStopped=function(){return!!this[psuedoStopPropagationKey]};if(glow.env.ie<8||glow.env.webkit<500){r.addListener(window,"unload",clearEvents)}glow.events=r;glow.events.listenersByObjId=listenersByObjId}});(window.gloader||glow).module({name:"glow.data",library:["glow","1.7.0"],depends:[["glow","1.7.0","glow.dom"]],builder:function(glow){var TYPES={UNDEFINED:"undefined",OBJECT:"object",NUMBER:"number",BOOLEAN:"boolean",STRING:"string",ARRAY:"array",FUNCTION:"function",NULL:"null"};var TEXT={AT:"@",EQ:"=",DOT:".",EMPTY:"",AND:"&",OPEN:"(",CLOSE:")"};var JSON={HASH:{START:"{",END:"}",SHOW_KEYS:true},ARRAY:{START:"[",END:"]",SHOW_KEYS:false},DATA_SEPARATOR:",",KEY_SEPARATOR:":",KEY_DELIMITER:"\"",STRING_DELIMITER:"\"",SAFE_PT1:/^[\],:{}\s]*$/,SAFE_PT2:/\\./g,SAFE_PT3:/\"[^\"\\\n\r]*\"|true|false|null|-?\d+(?:\.\d*)?(:?[eE][+\-]?\d+)?/g,SAFE_PT4:/(?:^|:|,)(?:\s*\[)+/g};var SLASHES={TEST:/[\b\n\r\t\\\f\"]/g,B:{PLAIN:"\b",ESC:"\\b"},N:{PLAIN:"\n",ESC:"\\n"},R:{PLAIN:"\r",ESC:"\\r"},T:{PLAIN:"\t",ESC:"\\t"},F:{PLAIN:"\f",ESC:"\\f"},SL:{PLAIN:"\\",ESC:"\\\\"},QU:{PLAIN:"\"",ESC:"\\\""}};function _replaceSlashes(s){switch(s){case SLASHES.B.PLAIN:return SLASHES.B.ESC;case SLASHES.N.PLAIN:return SLASHES.N.ESC;case SLASHES.R.PLAIN:return SLASHES.R.ESC;case SLASHES.T.PLAIN:return SLASHES.T.ESC;case SLASHES.F.PLAIN:return SLASHES.F.ESC;case SLASHES.SL.PLAIN:return SLASHES.SL.ESC;case SLASHES.QU.PLAIN:return SLASHES.QU.ESC;default:return s}};function _getType(object){if((typeof object)==TYPES.OBJECT){if(object==null){return TYPES.NULL}else{return(object instanceof Array)?TYPES.ARRAY:TYPES.OBJECT}}else{return(typeof object)}};glow.data={encodeUrl:function(object){var objectType=_getType(object);var paramsList=[];var listLength=0;if(objectType!=TYPES.OBJECT){throw new Error("glow.data.encodeUrl: cannot encode item");}else{for(var key in object){switch(_getType(object[key])){case TYPES.FUNCTION:case TYPES.OBJECT:throw new Error("glow.data.encodeUrl: cannot encode item");break;case TYPES.ARRAY:for(var i=0,l=object[key].length;i<l;i++){switch(_getType(object[key])[i]){case TYPES.FUNCTION:case TYPES.OBJECT:case TYPES.ARRAY:throw new Error("glow.data.encodeUrl: cannot encode item");break;default:paramsList[listLength++]=key+TEXT.EQ+encodeURIComponent(object[key][i])}}break;default:paramsList[listLength++]=key+TEXT.EQ+encodeURIComponent(object[key])}}return paramsList.join(TEXT.AND)}},decodeUrl:function(text){if(_getType(text)!=TYPES.STRING){throw new Error("glow.data.decodeUrl: cannot decode item");}else if(text===""){return{}}var result={};var keyValues=text.split(/[&;]/);var thisPair,key,value;for(var i=0,l=keyValues.length;i<l;i++){thisPair=keyValues[i].split(TEXT.EQ);if(thisPair.length!=2){throw new Error("glow.data.decodeUrl: cannot decode item");}else{key=glow.lang.trim(decodeURIComponent(thisPair[0]));value=glow.lang.trim(decodeURIComponent(thisPair[1]));switch(_getType(result[key])){case TYPES.ARRAY:result[key][result[key].length]=value;break;case TYPES.UNDEFINED:result[key]=value;break;default:result[key]=[result[key],value]}}}return result},encodeJson:function(object,options){function _encode(object,options){if(_getType(object)==TYPES.ARRAY){var type=JSON.ARRAY}else{var type=JSON.HASH}var serial=[type.START];var len=1;var dataType;var notFirst=false;for(var key in object){dataType=_getType(object[key]);if(dataType!=TYPES.UNDEFINED){if(notFirst){serial[len++]=JSON.DATA_SEPARATOR}notFirst=true;if(type.SHOW_KEYS){serial[len++]=JSON.KEY_DELIMITER;serial[len++]=key;serial[len++]=JSON.KEY_DELIMITER;serial[len++]=JSON.KEY_SEPARATOR}switch(dataType){case TYPES.FUNCTION:throw new Error("glow.data.encodeJson: cannot encode item");break;case TYPES.STRING:default:serial[len++]=JSON.STRING_DELIMITER;serial[len++]=glow.lang.replace(object[key],SLASHES.TEST,_replaceSlashes);serial[len++]=JSON.STRING_DELIMITER;break;case TYPES.NUMBER:case TYPES.BOOLEAN:serial[len++]=object[key];break;case TYPES.OBJECT:case TYPES.ARRAY:serial[len++]=_encode(object[key],options);break;case TYPES.NULL:serial[len++]=TYPES.NULL;break}}}serial[len++]=type.END;return serial.join(TEXT.EMPTY)}options=options||{};var type=_getType(object);if((type==TYPES.OBJECT)||(type==TYPES.ARRAY)){return _encode(object,options)}else{throw new Error("glow.data.encodeJson: cannot encode item");}},decodeJson:function(text,options){if(_getType(text)!=TYPES.STRING){throw new Error("glow.data.decodeJson: cannot decode item");}options=options||{};options.safeMode=options.safeMode||false;var canEval=true;if(options.safeMode){canEval=(JSON.SAFE_PT1.test(text.replace(JSON.SAFE_PT2,TEXT.AT).replace(JSON.SAFE_PT3,JSON.ARRAY.END).replace(JSON.SAFE_PT4,TEXT.EMPTY)))}if(canEval){try{return eval(TEXT.OPEN+text+TEXT.CLOSE)}catch(e){}}throw new Error("glow.data.decodeJson: cannot decode item");},escapeHTML:function(html){return glow.dom.create('<div></div>').text(html).html()}}}});(window.gloader||glow).module({name:"glow.net",library:["glow","1.7.0"],depends:[["glow","1.7.0","glow.data","glow.events"]],builder:function(glow){var STR={XML_ERR:"Cannot get response as XML, check the mime type of the data",POST_DEFAULT_CONTENT_TYPE:'application/x-www-form-urlencoded;'},endsPlusXml=/\+xml$/,scriptElements=[],callbackPrefix="c",globalObjectName="_"+glow.UID+"loadScriptCbs",$=glow.dom.get,events=glow.events,emptyFunc=function(){};function xmlHTTPRequest(){if(window.ActiveXObject){return(xmlHTTPRequest=function(){return new ActiveXObject("Microsoft.XMLHTTP")})()}else{return(xmlHTTPRequest=function(){return new XMLHttpRequest()})()}}function populateOptions(opts){return glow.lang.apply({onLoad:emptyFunc,onError:emptyFunc,onAbort:emptyFunc,headers:{},async:true,useCache:false,data:null,defer:false,forceXml:false},opts||{})};function noCacheUrl(url){return[url,(/\?/.test(url)?"&":"?"),"a",new Date().getTime(),parseInt(Math.random()*100000)].join("")}function makeXhrRequest(method,url,opts){var req=xmlHTTPRequest(),data=opts.data&&(typeof opts.data=="string"?opts.data:glow.data.encodeUrl(opts.data)),i,request=new Request(req,opts);if(!opts.useCache){url=noCacheUrl(url)}req.open(method,url,opts.async);for(i in opts.headers){req.setRequestHeader(i,opts.headers[i])}function send(){request.send=emptyFunc;if(opts.async){if(opts.timeout){request._timeout=setTimeout(function(){abortRequest(request);var response=new Response(req,true,request);events.fire(request,"error",response)},opts.timeout*1000)}req.onreadystatechange=function(){if(req.readyState==4){request._timeout&&clearTimeout(request._timeout);request.completed=true;var response=new Response(req,false,request);if(response.wasSuccessful){events.fire(request,"load",response)}else{events.fire(request,"error",response)}req.onreadystatechange=new Function()}};req.send(data);return request}else{req.send(data);request.completed=true;var response=new Response(req,false,request);if(response.wasSuccessful){events.fire(request,"load",response)}else{events.fire(request,"error",response)}return response}}request.send=send;return opts.defer?request:send()}var r={};r.get=function(url,o){o=populateOptions(o);return makeXhrRequest('GET',url,o)};r.post=function(url,data,o){o=populateOptions(o);o.data=data;if(!o.headers["Content-Type"]){o.headers["Content-Type"]=STR.POST_DEFAULT_CONTENT_TYPE}return makeXhrRequest('POST',url,o)};r.loadScript=function(url,opts){var newIndex=scriptElements.length,script,callbackName=callbackPrefix+newIndex,opts=populateOptions(opts),request=new Request(newIndex,opts),url=opts.useCache?url:noCacheUrl(url),globalObject=window[globalObjectName]||(window[globalObjectName]={});if(opts.onLoad!=emptyFunc){globalObject[callbackName]=function(){request._timeout&&clearTimeout(request._timeout);request.completed=true;opts.onLoad.apply(this,arguments);request.destroy();script=globalObject[callbackName]=undefined;delete globalObject[callbackName]};url=glow.lang.interpolate(url,{callback:globalObjectName+"."+callbackName})}script=scriptElements[newIndex]=document.createElement("script");if(opts.charset){script.charset=opts.charset}events.addListener(request,"abort",opts.onAbort);glow.ready(function(){if(opts.timeout){request._timeout=setTimeout(function(){abortRequest(request);opts.onError()},opts.timeout*1000)}if(glow.env.opera){setTimeout(function(){if(script){script.src=url}},0)}else{script.src=url}document.body.appendChild(script)});return request};function abortRequest(req){var nativeReq=req.nativeRequest,callbackIndex=req._callbackIndex;req._timeout&&clearTimeout(req._timeout);if(nativeReq){nativeReq.onreadystatechange=new Function();nativeReq.abort()}else if(callbackIndex){window[globalObjectName][callbackPrefix+callbackIndex]=emptyFunc;glow.dom.get(scriptElements[callbackIndex]).destroy()}};function Request(requestObj,opts){this._timeout=null;this._forceXml=opts.forceXml;if(opts.forceXml&&requestObj.overrideMimeType){requestObj.overrideMimeType('application/xml')}this.complete=false;if(typeof requestObj=="number"){this._callbackIndex=requestObj}else{this.nativeRequest=requestObj}var eventNames=["Load","Error","Abort"],i=0;for(;i<3;i++){events.addListener(this,eventNames[i].toLowerCase(),opts["on"+eventNames[i]])}}Request.prototype={send:function(){},abort:function(){if(!this.completed&&!events.fire(this,"abort").defaultPrevented()){abortRequest(this)}return this},destroy:function(){if(this._callbackIndex!==undefined){setTimeout(function(){$(scriptElements[this._callbackIndex]).destroy();scriptElements[this._callbackIndex]=undefined;delete scriptElements[this._callbackIndex]},0)}return this}};function Response(nativeResponse,timedOut,request){events.Event.call(this);this._request=request;this.nativeResponse=nativeResponse;this.status=timedOut?408:nativeResponse.status==1223?204:nativeResponse.status;this.timedOut=!!timedOut;this.wasSuccessful=(this.status>=200&&this.status<300)||this.status==304||(this.status==0&&nativeResponse.responseText)};function shouldParseAsXml(){var contentType=this.header("Content-Type");return endsPlusXml.test(contentType)||contentType===''}glow.lang.extend(Response,events.Event,{text:function(){return this.nativeResponse.responseText},xml:function(){var nativeResponse=this.nativeResponse;if((glow.env.ie&&shouldParseAsXml.call(this))||(this._request._forceXml&&!this._request.nativeRequest.overrideMimeType&&window.ActiveXObject)){var doc=new ActiveXObject("Microsoft.XMLDOM");doc.loadXML(nativeResponse.responseText);return doc}else{if(!nativeResponse.responseXML){throw new Error(STR.XML_ERR);}return nativeResponse.responseXML}},json:function(safe){return glow.data.decodeJson(this.text(),{safeMode:safe})},header:function(name){return this.nativeResponse.getResponseHeader(name)},statusText:function(){return this.timedOut?"Request Timeout":this.nativeResponse.statusText}});glow.net=r}});(window.gloader||glow).module({name:"glow.tweens",library:["glow","1.7.0"],depends:[],builder:function(glow){function _reverse(tween){return function(t){return 1-tween(1-t)}}glow.tweens={linear:function(){return function(t){return t}},easeIn:function(strength){strength=strength||2;return function(t){return Math.pow(1,strength-1)*Math.pow(t,strength)}},easeOut:function(strength){return _reverse(this.easeIn(strength))},easeBoth:function(strength){return this.combine(this.easeIn(strength),this.easeOut(strength))},overshootIn:function(amount){return _reverse(this.overshootOut(amount))},overshootOut:function(amount){amount=amount||1.70158;return function(t){if(t==0||t==1){return t}return((t-=1)*t*((amount+1)*t+amount)+1)}},overshootBoth:function(amount){return this.combine(this.overshootIn(amount),this.overshootOut(amount))},bounceIn:function(){return _reverse(this.bounceOut())},bounceOut:function(){return function(t){if(t<(1/2.75)){return 7.5625*t*t}else if(t<(2/2.75)){return(7.5625*(t-=(1.5/2.75))*t+.75)}else if(t<(2.5/2.75)){return(7.5625*(t-=(2.25/2.75))*t+.9375)}else{return(7.5625*(t-=(2.625/2.75))*t+.984375)}}},bounceBoth:function(){return this.combine(this.bounceIn(),this.bounceOut())},elasticIn:function(a,p){return _reverse(this.elasticOut(a,p))},elasticOut:function(a,p){return function(t){if(t==0||t==1){return t}if(!p){p=0.3}if(!a||a<1){a=1;var s=p/4}else{var s=p/(2*Math.PI)*Math.asin(1/a)}return a*Math.pow(2,-10*t)*Math.sin((t-s)*(2*Math.PI)/p)+1}},elasticBoth:function(a,p){p=p||0.45;return this.combine(this.elasticIn(a,p),this.elasticOut(a,p))},combine:function(tweenIn,tweenOut){return function(t){if(t<0.5){return tweenIn(t*2)/2}else{return tweenOut((t-0.5)*2)/2+0.5}}}}}});(window.gloader||glow).module({name:"glow.anim",library:["glow","1.7.0"],depends:[["glow","1.7.0","glow.tweens","glow.events","glow.dom"]],builder:function(glow){var $=glow.dom.get,manager,events=glow.events,dom=glow.dom,get=dom.get,hasUnits=/width|height|top$|bottom$|left$|right$|spacing$|indent$|font-size/,noNegatives=/width|height|padding|opacity/,usesYAxis=/height|top/,getUnit=/(\D+)$/,testElement=dom.create('<div style="position:absolute;visibility:hidden"></div>');function addEventsFromOpts(instance,opts,eventProps){for(var i=0,len=eventProps.length;i<len;i++){if(opts[eventProps[i]]){events.addListener(instance,eventProps[i].slice(2).toLowerCase(),opts[eventProps[i]])}}}(function(){var queue=[],queueLen=0,intervalTime=1,interval;manager={addToQueue:function(anim){queue[queueLen++]=anim;anim._playing=true;anim._timeAnchor=anim._timeAnchor||new Date().valueOf();if(!interval){this.startInterval()}},removeFromQueue:function(anim){for(var i=0;i<queueLen;i++){if(queue[i]==anim){queue.splice(i,1);anim._timeAnchor=null;anim._playing=false;if(--queueLen==0){this.stopInterval()}return}}},startInterval:function(){interval=window.setInterval(this.processQueue,intervalTime)},stopInterval:function(){window.clearInterval(interval);interval=null},processQueue:function(){var anim,i,now=new Date().valueOf();for(i=0;i<queueLen;i++){anim=queue[i];if(anim.position==anim.duration){manager.removeFromQueue(anim);i--;events.fire(anim,"complete");if(anim._opts.destroyOnComplete){anim.destroy()}continue}if(anim.useSeconds){anim.position=(now-anim._timeAnchor)/1000;if(anim.position>anim.duration){anim.position=anim.duration}}else{anim.position++}anim.value=anim.tween(anim.position/anim.duration);events.fire(anim,"frame")}}}})();function convertCssUnit(element,fromValue,toUnit,axis){var elmStyle=testElement[0].style,axisProp=(axis=="x")?"width":"height",startPixelValue,toUnitPixelValue;elmStyle.margin=elmStyle.padding=elmStyle.border="0";startPixelValue=testElement.css(axisProp,fromValue).insertAfter(element)[axisProp]();toUnitPixelValue=testElement.css(axisProp,10+toUnit)[axisProp]()/10;testElement.remove();return startPixelValue/toUnitPixelValue};function keepWithinRange(num,start,end){if(start!==undefined&&num<start){return start}if(end!==undefined&&num>end){return end}return num};function buildAnimFunction(element,spec){var cssProp,r=["a=(function(){"],rLen=1,fromUnit,unitDefault=[0,"px"],to,from,unit,a;for(cssProp in spec){r[rLen++]='element.css("'+cssProp+'", ';if(typeof spec[cssProp]!="object"){to=spec[cssProp]}else{to=spec[cssProp].to}if((from=spec[cssProp].from)===undefined){if(cssProp=="font-size"||cssProp=="background-position"){throw new Error("From value must be set for "+cssProp);}from=element.css(cssProp)}if(hasUnits.test(cssProp)){unit=(getUnit.exec(to)||unitDefault)[1];fromUnit=(getUnit.exec(from)||unitDefault)[1];from=parseFloat(from)||0;to=parseFloat(to)||0;if(from&&unit!=fromUnit){if(cssProp=="font-size"){throw new Error("Units must be the same for font-size");}from=convertCssUnit(element,from+fromUnit,unit,usesYAxis.test(cssProp)?"y":"x")}if(noNegatives.test(cssProp)){r[rLen++]='keepWithinRange(('+(to-from)+' * this.value) + '+from+', 0) + "'+unit+'"'}else{r[rLen++]='('+(to-from)+' * this.value) + '+from+' + "'+unit+'"'}}else if(!(isNaN(from)||isNaN(to))){from=Number(from);to=Number(to);r[rLen++]='('+(to-from)+' * this.value) + '+from}else if(cssProp.indexOf("color")!=-1){to=dom.parseCssColor(to);if(!glow.lang.hasOwnProperty(from,"r")){from=dom.parseCssColor(from)}r[rLen++]='"rgb(" + keepWithinRange(Math.round('+(to.r-from.r)+' * this.value + '+from.r+'), 0, 255) + "," + keepWithinRange(Math.round('+(to.g-from.g)+' * this.value + '+from.g+'), 0, 255) + "," + keepWithinRange(Math.round('+(to.b-from.b)+' * this.value + '+from.b+'), 0, 255) + ")"'}else if(cssProp=="background-position"){var vals={},fromTo=["from","to"],unit=(getUnit.exec(from)||unitDefault)[1];vals.fromOrig=from.toString().split(/\s/);vals.toOrig=to.toString().split(/\s/);if(vals.fromOrig[1]===undefined){vals.fromOrig[1]="50%"}if(vals.toOrig[1]===undefined){vals.toOrig[1]="50%"}for(var i=0;i<2;i++){vals[fromTo[i]+"X"]=parseFloat(vals[fromTo[i]+"Orig"][0]);vals[fromTo[i]+"Y"]=parseFloat(vals[fromTo[i]+"Orig"][1]);vals[fromTo[i]+"XUnit"]=(getUnit.exec(vals[fromTo[i]+"Orig"][0])||unitDefault)[1];vals[fromTo[i]+"YUnit"]=(getUnit.exec(vals[fromTo[i]+"Orig"][1])||unitDefault)[1]}if((vals.fromXUnit!==vals.toXUnit)||(vals.fromYUnit!==vals.toYUnit)){throw new Error("Mismatched axis units cannot be used for "+cssProp);}r[rLen++]='('+(vals.toX-vals.fromX)+' * this.value + '+vals.fromX+') + "'+vals.fromXUnit+' " + ('+(vals.toY-vals.fromY)+' * this.value + '+vals.fromY+') + "'+vals.fromYUnit+'"'}r[rLen++]=');'}r[rLen++]="})";return eval(r.join(""))}var r={};r.css=function(element,duration,spec,opts){element=get(element);var anim=new r.Animation(duration,opts);if(element[0]){events.addListener(anim,"frame",buildAnimFunction(element,spec))}return anim};slideElement=function slideElement(element,duration,action,opts){duration=duration||0.5;element=$(element);opts=glow.lang.apply({tween:glow.tweens.easeBoth(),onStart:function(){},onComplete:function(){}},opts);var i=0,thatlength=element.length,completeHeight,fromHeight,channels=[],timeline;for(;i<thatlength;i++){if(action=="up"||(action=="toggle"&&element.slice(i,i+1).height()>0)){element[i].style.overflow='hidden';if(glow.env.ie<8){element[i].style.zoom=1}completeHeight=0;fromHeight=element.slice(i,i+1).height()}else if(action=="down"||(action=="toggle"&&element.slice(i,i+1).height()==0)){fromHeight=element.slice(i,i+1).height();element[i].style.height="auto";completeHeight=element.slice(i,i+1).height();element[i].style.height=fromHeight+"px"}channels[i]=[glow.anim.css(element[i],duration,{'height':{from:fromHeight,to:completeHeight}},{tween:opts.tween})]}timeline=new glow.anim.Timeline(channels,{destroyOnComplete:true});events.addListener(timeline,"complete",function(){element.each(function(){if(this.style.height!="0px"){this.style.height="auto"}})});events.addListener(timeline,"start",opts.onStart);events.addListener(timeline,"complete",opts.onComplete);return timeline.start()};r.slideDown=function(element,duration,opts){return slideElement(element,duration,'down',opts)};r.slideUp=function(element,duration,opts){return slideElement(element,duration,'up',opts)};r.slideToggle=function(element,duration,opts){return slideElement(element,duration,'toggle',opts)};r.fadeOut=function(element,duration,opts){return r.fadeTo(element,0,duration,opts)};r.fadeIn=function(element,duration,opts){r.fadeTo(element,1,duration,opts)};r.fadeTo=function(element,opacity,duration,opts){duration=duration||0.5;element=$(element);opts=glow.lang.apply({tween:glow.tweens.easeBoth(),onStart:function(){},onComplete:function(){}},opts);var i=0,thatlength=element.length,channels=[],timeline;for(;i<thatlength;i++){channels[i]=[glow.anim.css(element[i],duration,{'opacity':opacity},{tween:opts.tween})]}timeline=new glow.anim.Timeline(channels,{destroyOnComplete:true});events.addListener(timeline,"start",opts.onStart);events.addListener(timeline,"complete",opts.onComplete);return timeline.start()};r.highlight=function(element,highlightColour,duration,opts){element=$(element);duration=duration||1;highlightColour=highlightColour||'#ffff99';opts=glow.lang.apply({tween:glow.tweens.easeBoth(),onStart:function(){},onComplete:function(){}},opts);var i=0,transArray=[],elmsLength=element.length,completeColour,channels=[],timeline;for(;i<elmsLength;i++){completeColour=opts.completeColour||element.slice(i,i+1).css("background-color");if(completeColour=="transparent"||completeColour==""){completeColour="#fff"}channels[i]=[r.css(element[i],duration,{"background-color":{from:highlightColour,to:completeColour}},{tween:opts.tween})]}timeline=new glow.anim.Timeline(channels,{destroyOnComplete:true});events.addListener(timeline,"start",opts.onStart);events.addListener(timeline,"complete",opts.onComplete);return timeline.start()};var animationEventConstructorNames=["onStart","onStop","onComplete","onResume","onFrame"];r.Animation=function(duration,opts){this._opts=opts=glow.lang.apply({useSeconds:true,tween:glow.tweens.linear(),destroyOnComplete:false,onStart:null,onStop:null,onComplete:null,onResume:null,onFrame:null},opts);this._playing=false;this._timeAnchor=null;this.duration=duration;this.useSeconds=opts.useSeconds;this.tween=opts.tween;this.position=0;this.value=0;addEventsFromOpts(this,opts,animationEventConstructorNames)};r.Animation.prototype={start:function(){if(this._playing){this.stop()}var e=events.fire(this,"start");if(e.defaultPrevented()){return this}this._timeAnchor=null;this.position=0;manager.addToQueue(this);return this},stop:function(){if(this._playing){var e=events.fire(this,"stop");if(e.defaultPrevented()){return this}manager.removeFromQueue(this)}return this},destroy:function(){this.stop();events.removeAllListeners(this);return this},resume:function(){if(!this._playing){var e=events.fire(this,"resume");if(e.defaultPrevented()){return this}this._timeAnchor=new Date().valueOf()-(this.position*1000);manager.addToQueue(this)}return this},isPlaying:function(){return this._playing},goTo:function(pos){this._timeAnchor=new Date().valueOf()-((this.position=pos)*1000);this.value=this.tween(this.duration&&this.position/this.duration);events.fire(this,"frame");return this}};var timelineEventConstructorNames=["onStart","onStop","onComplete","onResume"];r.Timeline=function(channels,opts){this._opts=opts=glow.lang.apply({loop:false,destroyOnComplete:false,onStart:null,onStop:null,onComplete:null,onResume:null},opts);this._channels=(channels[0]&&channels[0].push)?channels:[channels];this._channelPos=[];this._playing=false;this.loop=opts.loop;var i,j,iLen,jLen,channel,allChannels=this._channels,totalDuration=0,channelDuration;for(i=0,iLen=allChannels.length;i<iLen;i++){channel=allChannels[i];channelDuration=0;for(j=0,jLen=channel.length;j<jLen;j++){if(typeof channel[j]=="number"){channel[j]=new r.Animation(channel[j])}if(channel[j]instanceof r.Animation){if(!channel[j].useSeconds){throw new Error("Timelined animations must be timed in seconds");}channel[j]._timelineOffset=channelDuration*1000;channelDuration+=channel[j].duration;channel[j]._channelIndex=i}}this.duration=totalDuration=Math.max(channelDuration,totalDuration)}this._controlAnim=new r.Animation(totalDuration);events.addListener(this._controlAnim,"frame",this._processFrame,this);events.addListener(this._controlAnim,"complete",this._complete,this);addEventsFromOpts(this,opts,timelineEventConstructorNames)};r.Timeline.prototype={_advanceChannel:function(i){var currentAnim=this._channels[i][this._channelPos[i]],nextAnim=this._channels[i][++this._channelPos[i]];if(currentAnim&&currentAnim._playing){currentAnim._playing=false;events.fire(currentAnim,"complete");if(currentAnim._opts.destroyOnComplete){currentAnim.destroy()}}if((nextAnim)!==undefined){if(typeof nextAnim=="function"){nextAnim();this._advanceChannel(i)}else{nextAnim.position=0;nextAnim._channelIndex=i;events.fire(nextAnim,"start");nextAnim._playing=true}}},_complete:function(){if(this.loop){this.start();return}this._playing=false;events.fire(this,"complete");if(this._opts.destroyOnComplete){this.destroy()}},_processFrame:function(){var i,len,anim,controlAnim=this._controlAnim,msFromStart=(new Date().valueOf())-controlAnim._timeAnchor;for(i=0,len=this._channels.length;i<len;i++){if(!(anim=this._channels[i][this._channelPos[i]])){continue}anim.position=(msFromStart-anim._timelineOffset)/1000;if(anim.position>anim.duration){anim.position=anim.duration}anim.value=anim.tween(anim.position/anim.duration);events.fire(anim,"frame");if(anim.position==anim.duration){this._advanceChannel(i)}}},start:function(){var e=events.fire(this,"start");if(e.defaultPrevented()){return this}var i,iLen,j,jLen,anim;this._playing=true;for(i=0,iLen=this._channels.length;i<iLen;i++){this._channelPos[i]=-1;this._advanceChannel(i);for(j=this._channels[i].length;j;j--){anim=this._channels[i][j];if(anim instanceof r.Animation){anim.goTo(0)}}}this._controlAnim.start();return this},stop:function(){if(this._playing){var e=events.fire(this,"stop");if(e.defaultPrevented()){return this}this._playing=false;var anim;for(var i=0,len=this._channels.length;i<len;i++){anim=this._channels[i][this._channelPos[i]];if(anim instanceof r.Animation&&anim._playing){events.fire(anim,"stop");anim._playing=false}}this._controlAnim.stop()}return this},destroy:function(){var i,j;this.stop();events.removeAllListeners(this);this._controlAnim.destroy();i=this._channels.length;while(i--){j=this._channels[i].length;while(j--){if(this._channels[i][j].destroy){this._channels[i][j].destroy()}}}return this},resume:function(){if(!this._playing){var e=events.fire(this,"resume");if(e.defaultPrevented()){return this}this._playing=true;var anim;for(var i=0,len=this._channels.length;i<len;i++){anim=this._channels[i][this._channelPos[i]];if(anim instanceof r.Animation&&!anim._playing){events.fire(anim,"resume");anim._playing=true}}this._controlAnim.resume()}return this},isPlaying:function(){return this._playing},goTo:function(pos){var i,j,k,channelsLen=this._channels.length,channelLen,anim,runningDuration;if(typeof pos=="number"){if(pos>this.duration){if(this.loop){pos=pos%this.duration}else{pos=this.duration}}this._controlAnim.goTo(pos);for(i=0;i<channelsLen;i++){runningDuration=0;for(j=0,channelLen=this._channels[i].length;j<channelLen;j++){anim=this._channels[i][j];if(anim instanceof r.Animation){if((runningDuration+anim.duration)>pos){this._channelPos[i]=j;anim.goTo(pos-runningDuration);break}anim.goTo(anim.duration);runningDuration+=anim.duration}}for(k=channelLen;k>j;k--){anim.goTo(0)}}}else{for(i=0;i<channelsLen;i++){runningDuration=0;for(j=0,channelLen=this._channels[i].length;j<channelLen;j++){anim=this._channels[i][j];if(anim===pos){return this.goTo(runningDuration)}if(anim instanceof r.Animation){runningDuration+=anim.duration}}}throw"Animation not found in animation channels";}return this}};glow.anim=r}});(window.gloader||glow).module({name:"glow.forms",library:["glow","1.7.0"],depends:[["glow","1.7.0",'glow.dom','glow.events','glow.anim','glow.net','glow.i18n']],builder:function(glow){var $i18n=glow.i18n,$interpolate=glow.lang.interpolate;$i18n.addLocaleModule("GLOW_FORMS","en",{TEST_MESSAGE_REQUIRED:"Value is required",TEST_MESSAGE_IS_NUMBER:"Must be a number.",TEST_MESSAGE_MIN:"The value must be at least {arg}.",TEST_MESSAGE_MAX:"The value must be less than {arg}.",TEST_MESSAGE_RANGE:"The value must be {min} or greater, and less than {max}.",TEST_MESSAGE_MIN_COUNT:"Must be have at least {arg} values.",TEST_MESSAGE_MAX_COUNT:"Must be have at most {arg} values.",TEST_MESSAGE_COUNT:"Must have {arg} values.",TEST_MESSAGE_REGEX:"Must be in the correct format.",TEST_MESSAGE_MIN_LEN:"Must be at least {arg} characters.",TEST_MESSAGE_MAX_LEN:"Must be at most {arg} characters.",TEST_MESSAGE_IS_EMAIL:"Must be a valid email address.",TEST_MESSAGE_SAME_AS:"Must be the same as: {arg}",TEST_MESSAGE_AJAX:"server responded",TEST_MESSAGE_IS:"Must be {arg}",TEST_MESSAGE_IS_NOT:"Must not be {arg}"});glow.forms={};glow.forms.Form=function(formNode,opts){this.formNode=glow.dom.get(formNode);if(!this.formNode[0])throw"Could not find form. Possibly run before DOM ready.";this._fields=[];this._result=null;this.opts=opts||{};glow.events.addListener(this,"validate",this.opts.onValidate||feedback.defaultFeedback);this._idleTimer=null;this._localeModule=$i18n.getLocaleModule("GLOW_FORMS");var thisForm=this;glow.events.addListener(this.formNode,"submit",function(){thisForm.validate('submit');return false})};glow.forms.Form.prototype.validate=function(eventName,fieldName){this.eventName=eventName||'submit';this._result=new glow.forms.ValidateResult(this.eventName);this._result.form=this;this._fieldCur=0;this._testCur=-1;this._fieldName=fieldName;nextTest.call(this)};var nextTest=function(){this._testCur++;if(this._testCur>=this._fields[this._fieldCur]._tests.length){if(!nextField.call(this))return}var currentTest=this._fields[this._fieldCur]._tests[this._testCur];var fieldValue;if(currentTest.opts.field){fieldValue=this.formNode.val()[currentTest.opts.field]||"";currentTest.isConditional=true}else{fieldValue=this.formNode.val()[this._fields[this._fieldCur].name]||""}if(!fieldValue.join)fieldValue=[fieldValue];var callback=function(that){return function(){onTestResult.apply(that,arguments)}}(this);currentTest.opts.on=currentTest.opts.on||"submit";if(this._result.eventName&&(" "+currentTest.opts.on+" ").indexOf(" "+this._result.eventName+" ")!=-1){if(this._fieldName&&this._fieldName!=currentTest.name){nextTest.call(this);return}if(typeof glow.forms.tests[currentTest.type]!="function"){throw"Unimplemented test: no test exists of type '"+currentTest.type+"'.";}currentTest.opts._localeModule=this._localeModule;glow.forms.tests[currentTest.type](fieldValue,currentTest.opts,callback,this.formNode.val())}else{nextTest.call(this)}};var nextField=function(){this._fieldCur++;this._testCur=0;if(this._fieldCur>=this._fields.length){this._fieldCur=0;glow.events.fire(this,"validate",this._result);if(this.eventName=="submit"&&this._result&&!this._result.defaultPrevented()){try{this.formNode[0].submit()}catch(e){throw new Error("Glow can't submit the form because the submit function can't be called. Perhaps that form's submit was replaced by an input element named 'submit'?");}}return false}return true};var onTestResult=function(result,message){if(typeof result=="boolean")result=(result)?glow.forms.PASS:glow.forms.FAIL;if(this._fields[this._fieldCur]._tests[this._testCur].isConditional&&result===glow.forms.FAIL){result=glow.forms.SKIP}this._result.fields.push({name:this._fields[this._fieldCur].name,result:result,message:message});if(result!==glow.forms.PASS){if(result===glow.forms.FAIL)this._result.errorCount++;this._testCur=this._fields[this._fieldCur]._tests.length}nextTest.call(this)};glow.forms.Form.prototype.addTests=function(fieldName){var field={name:fieldName,_tests:[]};var changeCallback=function(that){return function(){that.validate.apply(that,["change",fieldName])}}(this);var clickCallback=function(that){return function(){that.validate.apply(that,["click",fieldName])}}(this);var idleCallback=function(that){return function(){that.validate.apply(that,["idle",fieldName])}}(this);for(var i=1;i<arguments.length;i++){var testType=arguments[i][0];var testOpts=(arguments[i].length>1)?arguments[i][1]:{};field._tests.push({name:fieldName,type:testType,opts:testOpts});if(!changeCallback.added&&(" "+testOpts.on+" ").indexOf(" change ")!=-1){var inputs=this.formNode.get("*").each(function(i){if(this.name==fieldName){glow.events.addListener(this,"change",changeCallback);changeCallback.added=true}})}if(!clickCallback.added&&(" "+testOpts.on+" ").indexOf(" click ")!=-1){var inputs=this.formNode.get("*").each(function(i){if(this.name==fieldName){glow.events.addListener(this,"click",clickCallback);clickCallback.added=true}})}if(!idleCallback.added&&(" "+testOpts.on+" ").indexOf(" idle ")!=-1){var idleDelay=(typeof testOpts.delay!="undefined")?parseInt(testOpts.delay):1000;var inputs=this.formNode.get("*").each(function(i){if(this.name==fieldName){glow.events.addListener(this,"keyup",function(t){return function(){window.clearTimeout(this.idleTimeoutID);if(this.value)this.idleTimeoutID=window.setTimeout(idleCallback,t)}}(idleDelay));glow.events.addListener(this,"blur",function(){window.clearTimeout(this.idleTimeoutID)});idleCallback.added=true}})}}this._fields.push(field);return this};glow.forms.ValidateResult=function(eventName){glow.events.Event.apply(this);this.eventName=eventName;this.errorCount=0;this.value=undefined;this.fields=[]};glow.lang.extend(glow.forms.ValidateResult,glow.events.Event);glow.forms.PASS=1;glow.forms.FAIL=0;glow.forms.SKIP=-1;glow.forms.tests={required:function(values,opts,callback){var message=opts.message||opts._localeModule.TEST_MESSAGE_REQUIRED;for(var i=0,len=values.length;i<len;i++){if(/^\s*$/.test(values[i])){callback(glow.forms.FAIL,message);return}}callback(glow.forms.PASS,message)},isNumber:function(values,opts,callback){var message=opts.message||opts._localeModule.TEST_MESSAGE_IS_NUMBER;for(var i=0,len=values.length;i<len;i++){if(values[i]==""||isNaN(values[i])){callback(glow.forms.FAIL,message);return}}callback(glow.forms.PASS,message)},min:function(values,opts,callback){var message=opts.message||$interpolate(opts._localeModule.TEST_MESSAGE_MIN,{arg:opts.arg});for(var i=0,len=values.length;i<len;i++){if(Number(values[i])<Number(opts.arg)){callback(glow.forms.FAIL,message);return}}callback(glow.forms.PASS,message)},max:function(values,opts,callback){var message=opts.message||$interpolate(opts._localeModule.TEST_MESSAGE_MAX,{arg:opts.arg});for(var i=0,len=values.length;i<len;i++){if(Number(values[i])>Number(opts.arg)){callback(glow.forms.FAIL,message);return}}callback(glow.forms.PASS,message)},range:function(values,opts,callback){var minmax=opts.arg.split("..");if(typeof minmax[0]=="undefined"||typeof minmax[1]=="undefined"){throw"Range test requires a parameter like 0..10."}var message=opts.message||$interpolate(opts._localeModule.TEST_MESSAGE_RANGE,{min:minmax[0],max:minmax[1]});minmax[0]*=1;minmax[1]*=1;if(minmax[0]>minmax[1]){var temp=minmax[0];minmax[0]=minmax[1];minmax[1]=temp}for(var i=0,len=values.length;i<len;i++){if(values[i]<minmax[0]||values[i]>minmax[1]){callback(glow.forms.FAIL,message);return}}callback(glow.forms.PASS,message)},minCount:function(values,opts,callback){var message=opts.message||$interpolate(opts._localeModule.TEST_MESSAGE_MIN_COUNT,{arg:opts.arg});var count=0;for(var i=0;i<values.length;i++){if(values[i]!="")count++}if(count<opts.arg){callback(glow.forms.FAIL,message);return}callback(glow.forms.PASS,message)},maxCount:function(values,opts,callback){var message=opts.message||$interpolate(opts._localeModule.TEST_MESSAGE_MAX_COUNT,{arg:opts.arg});var count=0;for(var i=0;i<values.length;i++){if(values[i]!="")count++}if(count>opts.arg){callback(glow.forms.FAIL,message);return}callback(glow.forms.PASS,message)},count:function(values,opts,callback){var message=opts.message||$interpolate(opts._localeModule.TEST_MESSAGE_COUNT,{arg:opts.arg});var count=0;for(var i=0;i<values.length;i++){if(values[i]!="")count++}if(count!=opts.arg){callback(glow.forms.FAIL,message);return}callback(glow.forms.PASS,message)},regex:function(values,opts,callback){var message=opts.message||opts._localeModule.TEST_MESSAGE_REGEX;var regex=(typeof opts.arg=="string")?new RegExp(opts.arg):opts.arg;for(var i=0,len=values.length;i<len;i++){if(!regex.test(values[i])){callback(glow.forms.FAIL,message);return}}callback(glow.forms.PASS,message)},minLen:function(values,opts,callback){var message=opts.message||$interpolate(opts._localeModule.TEST_MESSAGE_MIN_LEN,{arg:opts.arg});for(var i=0,len=values.length;i<len;i++){if(values[i].length<opts.arg){callback(glow.forms.FAIL,message);return}}callback(glow.forms.PASS,message)},maxLen:function(values,opts,callback){var message=opts.message||$interpolate(opts._localeModule.TEST_MESSAGE_MAX_LEN,{arg:opts.arg});for(var i=0,len=values.length;i<len;i++){if(values[i].length>opts.arg){callback(glow.forms.FAIL,message);return}}callback(glow.forms.PASS,message)},isEmail:function(values,opts,callback){var message=opts.message||opts._localeModule.TEST_MESSAGE_IS_EMAIL;for(var i=0,len=values.length;i<len;i++){if(!/^\s*[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,}\s*$/i.test(values[i])){callback(glow.forms.FAIL,message);return}}callback(glow.forms.PASS,message)},sameAs:function(values,opts,callback,formValues){var message=opts.message||$interpolate(opts._localeModule.TEST_MESSAGE_SAME_AS,{arg:opts.arg});var compareTo=formValues[opts.arg];for(var i=0,len=values.length;i<len;i++){if(values[i]!=compareTo){callback(glow.forms.FAIL,message);return}}callback(glow.forms.PASS,message)},ajax:function(values,opts,callback,formValues){var queryValues={},message=(opts.message||opts._localeModule.TEST_MESSAGE_AJAX);for(var p in formValues){if(typeof formValues[p]=="string"){queryValues[p]=escape(formValues[p])}else if(typeof formValues[p].push!="undefined"){queryValues[p]=glow.lang.map(formValues[p],function(i){return escape(i)}).join(",")}}var url=glow.lang.interpolate(opts.url,queryValues);var request=glow.net.get(url,{onLoad:function(response){var verdict=opts.arg(response);if(typeof verdict.push=="undefined")verdict=[verdict,message];callback(verdict[0],verdict[1])},onError:function(response){alert("Error getting file: "+url)}})},custom:function(values,opts,callback){opts.arg.apply(this,arguments)},"is":function(values,opts,callback){var message=opts.message||$interpolate(opts._localeModule.TEST_MESSAGE_IS,{arg:opts.arg});for(var i=0,len=values.length;i<len;i++){if(values[i]!=opts.arg){callback(glow.forms.FAIL,message);return}}callback(glow.forms.PASS,message)},"isNot":function(values,opts,callback){var message=opts.message||$interpolate(opts._localeModule.TEST_MESSAGE_IS_NOT,{arg:opts.arg});for(var i=0,len=values.length;i<len;i++){if(values[i]==opts.arg){callback(glow.forms.FAIL,message);return}}callback(glow.forms.PASS,message)}};var feedback=glow.forms.feedback={};feedback.defaultFeedback=(function(){var screenReaderBufferUpdater;function updateScreenReaderBuffer(){if(!screenReaderBufferUpdater){screenReaderBufferUpdater=glow.dom.create('<input type="hidden" value="0" name="1.7.0" id="1.7.0" />').appendTo(document.body)}screenReaderBufferUpdater[0].value++}function inlineErrors(response){var fields=response.fields,fieldElm,msgContainer,labelError,i,len;for(i=0,len=fields.length;i<len;i++){fieldElm=glow.dom.get(response.form.formNode[0].elements[fields[i].name]);msgContainer=glow.dom.get("."+fields[i].name.replace(/(\W)/g,"\\$1")+"-msgContainer");if(!msgContainer[0]&&fieldElm.length==1){msgContainer=response.form.formNode.get("label").filter(function(){return this.htmlFor==fieldElm[0].id})}labelError=msgContainer.get("span.glow-errorMsg");if(fields[i].result){labelError.remove();fieldElm.removeClass("glow-invalid")}else{if(msgContainer.length){if(!labelError[0]){msgContainer.append((labelError=glow.dom.create('<span class="glow-errorMsg"></span>')))}labelError.text(fields[i].message);fieldElm.addClass("glow-invalid")}}}}function summaryError(response){var fields=response.fields,fieldElm,errorSummary,errorList,promptContainer,prompt,i,len;response.form.formNode.get("div.glow-errorSummary").remove();errorSummary=glow.dom.create('<div class="glow-errorSummary" tabindex="-1"><ul></ul></div>');errorList=errorSummary.get("ul");for(i=0,len=fields.length;i<len;i++){fieldElm=glow.dom.get(response.form.formNode[0].elements[fields[i].name]);promptContainer=glow.dom.get("."+fields[i].name.replace(/(\W)/g,"\\$1")+"-prompt");if(!promptContainer[0]&&fieldElm.length==1){promptContainer=response.form.formNode.get("label").filter(function(){return this.htmlFor==fieldElm[0].id})}if(promptContainer[0]){promptContainer.get("span.glow-errorMsg").remove();prompt=glow.lang.trim(promptContainer.text());if(prompt.slice(-1)==":"){prompt=prompt.slice(0,-1)}}else{prompt=fields[i].name.replace(/^\w/,function(s){return s.toUpperCase()})}if(!fields[i].result){errorList.append(glow.dom.create("<li></li>").text(prompt+": "+fields[i].message))}}response.form.formNode.prepend(errorSummary.css("opacity","0"));glow.anim.css(errorSummary,"0.5",{opacity:{from:0,to:1}},{tween:glow.tweens.easeOut()}).start();try{errorSummary[0].focus()}catch(e){}updateScreenReaderBuffer()}return function(response){if(response.eventName=="submit"){if(!response.errorCount){response.form.formNode.get("div.glow-errorSummary").remove();return}summaryError(response)}setTimeout(function(){inlineErrors(response)},0);return false}}())}});(window.gloader||glow).module({name:"glow.embed",library:["glow","1.7.0"],depends:[["glow","1.7.0","glow.dom","glow.data","glow.i18n"]],builder:function(glow){var $i18n=glow.i18n;$i18n.addLocaleModule("GLOW_EMBED","en",{FLASH_MESSAGE:"This content requires Flash Player version {min} (installed version: {installed})",NO_PLAYER_MESSAGE:"No Flash Flayer installed, or version is pre 6.0.0"});function to_attributes(object){var attributes="";for(var $param in object){if($param.toLowerCase()=="flashvars"&&typeof object[$param]=="object"){attributes+=' FlashVars="'+glow.data.encodeUrl(object[$param])+'"'}else{attributes+=' '+$param+'="'+object[$param]+'"'}}return attributes}function toParams(object){var r="",key,value;for(key in object){if(key.toLowerCase()=="flashvars"&&typeof object[key]=="object"){value=glow.data.encodeUrl(object[key])}else{value=object[key]}r+='<param name="'+key+'" value="'+value+'" />\n'}return r}function _set_defaults(target,defaults){target=target||{};for(var param in defaults){if(typeof target[param]=="undefined"){target[param]=defaults[param]}else if(typeof defaults[param]=="object"){target[param]=_set_defaults(target[param],defaults[param])}}return target}function _platform(){var platform=(navigator.platform||navigator.userAgent);return platform.match(/win/i)?"win":platform.match(/mac/i)?"mac":"other"}function _askFlashPlayerForVersion(flash_player){var $regexFLASH_VERSION=/^WIN (\d+),(\d+),(\d+),\d+$/;var $version=flash_player.GetVariable("$version");if($match=$regexFLASH_VERSION.exec($version)){return{major:parseInt($match[1]),minor:parseInt($match[2]),release:parseInt($match[3]),actual:$version}}else{}}function _getFlashPlayerVersion(){var $match,flash_player,NO_FLASH={major:0,minor:0,release:0},result=NO_FLASH;if(glow.env.ie){try{flash_player=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");result=_askFlashPlayerForVersion(flash_player)}catch(e){try{flash_player=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");try{flash_player.AllowScriptAccess="always";result=_askFlashPlayerForVersion(flash_player)}catch(e){result={major:6,minor:0,release:29}}}catch(e){}}}else{var regexFLASH_VERSION=/^Shockwave Flash\s*(\d+)\.(\d+)\s*\w(\d+)$/;if((flash_player=navigator.plugins["Shockwave Flash"])&&($match=regexFLASH_VERSION.exec(flash_player.description))){result={major:parseInt($match[1]),minor:parseInt($match[2]),release:parseInt($match[3]),actual:flash_player.description}}}result.toString=function(){return this.major?[this.major,this.minor,this.release].join("."):$i18n.getLocaleModule("GLOW_EMBED").NO_PLAYER_MESSAGE};return result}var installed_flash_player=_getFlashPlayerVersion();function _meetsVersionRequirements(requiredVersion){if(typeof requiredVersion!="object"){var match=String(requiredVersion).match(/^(\d+)(?:\.(\d+)(?:\.(\d+))?)?$/);if(!match){throw new Error('glow.embed._meetsVersionRequirements: invalid format for version string, require "n.n.n" or "n.n" or simply "n" where n is a numeric value');}requiredVersion={major:parseInt(match[1],10),minor:parseInt(match[2]||0,10),release:parseInt(match[3]||0,10)}}var v=installed_flash_player,rv=requiredVersion;return(v.major>rv.major||(v.major==rv.major&&v.minor>rv.minor)||(v.major==rv.major&&v.minor==rv.minor&&v.release>=rv.release))}var _wrap_embedding_tag=glow.env.ie?_wrap_object_tag:_wrap_embed_tag;function _wrap_embed_tag(src,attributes,params){return'<embed type="application/x-shockwave-flash" src="'+src+'"'+to_attributes(attributes)+to_attributes(params)+'></embed>'}function _wrap_object_tag(src,attributes,params){return'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" '+to_attributes(attributes)+'><param name="movie" value="'+src+'" />'+toParams(params)+'</object>'}var r={},idIndex=0;function _getId(){return glow.UID+"FlashEmbed"+(idIndex++)}r.Flash=function(src,container,minVersion,opts){opts=_set_defaults(opts,{width:"100%",height:"100%",params:{allowscriptaccess:"always",allowfullscreen:"true",quality:"high"},attributes:{},message:glow.lang.interpolate($i18n.getLocaleModule("GLOW_EMBED").FLASH_MESSAGE,{min:minVersion,installed:installed_flash_player}),id:(opts&&opts.attributes&&opts.attributes.id)||_getId()});container=glow.dom.get(container);if(!container.length){throw new Error("glow.embed.Flash unable to locate container");}this.container=container;this.movie=null;this._displayErrorMessage=typeof opts.message=="function"?opts.message:function(){return opts.message};this.isSupported;if(this.isSupported=_meetsVersionRequirements(minVersion)){var attrs=opts.attributes,overwrites=["id","width","height"],i=overwrites.length;while(i--){if(opts[overwrites[i]]){attrs[overwrites[i]]=opts[overwrites[i]]}}if(opts.className){attrs["class"]=opts.className}this._embed_tag=_wrap_embedding_tag(src,attrs,opts.params)}};r.Flash.version=function(){return installed_flash_player};r.Flash.prototype.embed=function(){var containerElm=this.container[0];if(this.isSupported){containerElm.innerHTML=this._embed_tag;this.movie=containerElm.firstChild}else{var message=this._displayErrorMessage();if(message){containerElm.innerHTML=message}}return this};glow.embed=r}});(window.gloader||glow).module({name:"glow.dragdrop",library:["glow","1.7.0"],depends:[["glow","1.7.0","glow.tweens","glow.events","glow.dom","glow.anim"]],builder:function(glow){var events=glow.events,addListener=events.addListener,fire=events.fire,removeListener=events.removeListener,dom=glow.dom,$=dom.get,create=dom.create;var r={},_zIndex=11000,_ieStrict=(document.compatMode=="CSS1Compat"&&glow.env.ie>=5)?true:false,_ieTrans=(document.compatMode!="CSS1Compat"&&glow.env.ie>=5)?true:false,_ie=glow.env.ie>=5,sides=['top','right','bottom','left'];function memoize(clss,name){var orig=clss.prototype[name];var cachedName='cached_'+name;clss.prototype[name]=function(){if(cachedName in this)return this[cachedName];return this[cachedName]=orig.apply(this,arguments)}}function copyMargins(to,from){var i=sides.length,margin;while(i--){margin='margin-'+sides[i];to.css(margin,from.css(margin))}}function memoizeNamed(clss,methodName){var orig=clss.prototype[methodName];var cachedName='cached_'+methodName;clss.prototype[methodName]=function(name){if(!this[cachedName])this[cachedName]={};if(name in this[cachedName])return this[cachedName][name];return this[cachedName][name]=orig.apply(this,arguments)}}function reset(obj,names){for(var i=0,l=names.length;i<l;i++){delete obj['cached_'+names[i]]}}var Box=function(el){this.el=el};Box.prototype={val:function(style){var val=parseInt(this.el.css(style));return val||0},width:function(){return this.borderWidth()-this.val('border-left-width')-this.val('border-right-width')},height:function(){return this.borderHeight()-this.val('border-top-width')-this.val('border-bottom-width')},offsetParentPageTop:function(){var el=this.el[0],pos,top;while(el=el.offsetParent){if($(el).css('position')!='static'){break}}return el?$(el).offset().top:0},offsetTop:function(){return this.el.position().top},offsetLeft:function(){return this.el.position().left},borderWidth:function(){var width=this.el[0].offsetWidth;if(glow.env.khtml){width-=this.val('margin-left')+this.val('margin-right')+this.val('border-left-width')+this.val('border-right-width')}return width},borderHeight:function(){if(this._logicalBottom){return this._logicalBottom-this.offsetTop()}var height=this.el[0].offsetHeight;if(glow.env.khtml){height-=this.val('margin-top')+this.val('margin-bottom')+this.val('border-top-width')+this.val('border-bottom-width')}return height},outerWidth:function(){return this.borderWidth()+this.val('margin-left')+this.val('margin-right')},outerHeight:function(){return this.borderHeight()+this.val('margin-top')+this.val('margin-bottom')},innerLeftPos:function(){return this.offsetLeft()+this.val('margin-left')+this.val('border-left-width')+this.val('padding-left')},innerTopPos:function(){return this.offsetTop()+this.val('margin-top')+this.val('border-top-width')+this.val('padding-top')},surroundWidth:function(){return this.val('border-left-width')+this.val('padding-left')+this.val('padding-right')+this.val('border-right-width')},surroundHeight:function(){return this.val('border-top-width')+this.val('padding-top')+this.val('padding-bottom')+this.val('border-bottom-width')},verticalCenter:function(){return this.offsetTop()+(this.outerHeight()/2)},horizontalCenter:function(){return this.offsetTop()+(this.outerWidth()/2)}};for(var i in Box.prototype){if(i=='val')memoizeNamed(Box,i);else memoize(Box,i)}glow.lang.apply(Box.prototype,{resetPosition:function(){reset(this,['offsetTop','offsetLeft','borderTopPos','borderLeftPos','innerTopPos','innerLeftPos','verticalCenter','horizontalCenter'])},setLogicalBottom:function(bottom){this._logicalBottom=bottom},boundsFor:function(childBox){var top,left,pos=this.el.css('position');if(pos!='static'){top=left=0}else{top=this.innerTopPos();left=this.innerLeftPos()}return[top,left+this.width()-childBox.outerWidth(),top+this.height()-childBox.outerHeight(),left]},outerBounds:function(){var offset=this.el.offset(),left=offset.left,top=offset.top;return[top,left+this.borderWidth(),top+this.borderHeight(),left]},intersectSize:function(that,touches){var a=this.outerBounds(),b=that.outerBounds();if(touches){a[1]++;b[1]++;a[2]++;b[2]++}return(a[2]<b[0]?0:b[2]<a[0]?0:a[0]<b[0]?(a[2]<b[2]?a[2]-b[0]:b[2]-b[0]):b[2]<a[2]?b[2]-a[0]:a[2]-a[0])*(a[1]<b[3]?0:b[1]<a[3]?0:a[3]<b[3]?(a[1]<b[1]?a[1]-b[3]:b[1]-b[3]):b[1]<a[1]?b[1]-a[3]:a[1]-a[3])},sizePlaceholder:function(placeholder,pos,startLeft,startTop){var placeholderBox=new Box(placeholder),el=this.el,position=pos||el.css('position');placeholder.css('display','none');el.after(placeholder);placeholder.css('width',(el[0].offsetWidth-placeholderBox.surroundWidth())+'px').css('height',(el[0].offsetHeight-placeholderBox.surroundHeight())+'px');copyMargins(placeholder,el);placeholder.remove();placeholder.css('display','block');if(position!='static'){placeholder.css('left',startLeft+'px');placeholder.css('top',startTop+'px')}placeholder.css('position',position)},contains:function(box){var bounds=this.boundsFor(box),position=box.el.position(),top=position.top,left=position.left;return top>=bounds[0]&&left<=bounds[1]&&top<=bounds[2]&&left>=bounds[3]},containsPoint:function(offset){var elementOffset=this.el.offset();return offset.x>=elementOffset.left&&offset.y>=elementOffset.top&&offset.x<=elementOffset.left+this.borderWidth()&&offset.y<=elementOffset.top+this.borderHeight()},positionedAncestorBox:function(){var el=this.el.parent(),pos;while(el[0]){pos=el.css('position')||'static';if(pos=='relative'||pos=='absolute'||pos=='fixed')return new Box(el);el=el.parent()}return null}});function placeholderElement(el){var tag=el[0].tagName.toLowerCase()=='li'?'li':'div';var placeholder=create('<'+tag+'></'+tag+'>');if(tag=='li')placeholder.css('list-style-type','none');return placeholder}r.Draggable=function(el,opts){this.element=$(el);this._opts=opts=glow.lang.apply({dragPrevention:['input','textarea','button','select','option','a'],placeholder:'spacer',placeholderClass:'glow-dragdrop-placeholder',step:{x:1,y:1}},opts||{});if(typeof opts.step=="number"){opts.step={x:opts.step,y:opts.step}}else{opts.step.x=opts.step.x||1;opts.step.y=opts.step.y||1}this._preventDrag=[];for(var i=0,l=opts.dragPrevention.length;i<l;i++){this._preventDrag[i]=opts.dragPrevention[i].toLowerCase()}if(opts.container){this.container=$(opts.container)}this._handle=opts.handle&&this.element.get(opts.handle)||this.element;if(opts.dropTargets)this.dropTargets=$(opts.dropTargets);var listeners=this._listeners=[],i=0;if(opts.onDrag)listeners[i++]=addListener(this,'drag',this._opts.onDrag,this);if(opts.onEnter)listeners[i++]=addListener(this,'enter',this._opts.onEnter,this);if(opts.onLeave)listeners[i++]=addListener(this,'leave',this._opts.onLeave,this);if(opts.onDrop)listeners[i++]=addListener(this,'drop',this._opts.onDrop,this);this._dragListener=addListener(this._handle,'mousedown',this._startDragMouse,this);return};r.Draggable.prototype={_createPlaceholder:function(){var el=this.element,placeholder,box=this._box;if(this._opts.placeholder=='clone'){placeholder=el.clone()}else{placeholder=placeholderElement(el)}if(this._opts.placeholderClass){placeholder.addClass(this._opts.placeholderClass)}box.sizePlaceholder(placeholder,null,this._startLeft,this._startTop);el.after(placeholder);this._placeholder=placeholder},_removePlaceholder:function(){this._placeholder.remove()},_resetPosition:function(){var origPos=this._preDragPosition,el=this.element,box=this._box,startOffset=this._startOffset,pos=el.css('position'),newLeft,newTop;box.resetPosition();var position=box.el.position(),offset={x:position.left,y:position.top};if(this._placeholder||this._dropIndicator){el.remove()}if(origPos=='static'&&offset.y==startOffset.y&&offset.x==startOffset.x){el.css('position','static');el.css('left','');el.css('top','')}else{el.css('z-index',this._preDragZIndex);el.css('position',origPos=='static'?'relative':origPos);if(origPos=='static'){newLeft=offset.x-startOffset.x;newTop=offset.y-startOffset.y}else if(origPos=='relative'&&pos!='relative'){newLeft=this._startLeft+(offset.x-startOffset.x);newTop=this._startTop+(offset.y-startOffset.y)}if(pos!=origPos){el.css('left',newLeft?newLeft+'px':'');el.css('top',newTop?newTop+'px':'')}}if(this._dropIndicator){var parent=this._dropIndicator.parent()[0];if(parent)parent.replaceChild(el[0],this._dropIndicator[0]);delete this._dropIndicator;if(this._placeholder){this._placeholder.remove();delete this._placeholder}el.css('position',origPos);if(origPos=='relative'&&pos!='relative'){el.css('left',this._startLeft);el.css('top',this._startTop)}}else if(this._placeholder){var parent=this._placeholder.parent()[0];if(parent)parent.replaceChild(el[0],this._placeholder[0]);delete this._placeholder}},_startDragMouse:function(e){var preventDrag=this._preventDrag,source=e.source,tag=source.tagName.toLowerCase();for(var i=0,l=preventDrag.length;i<l;i++){if(preventDrag[i]==tag){return}}if(fire(this,'drag').defaultPrevented()){return}if(this._dragging==1)return this.endDrag();else if(this._dragging)return;this._dragging=1;var el=this.element,container=this.container,opts=this._opts,box=this._box=new Box(el),step=opts.step;this._preDragPosition=el.css('position');var position=box.el.position(),startOffset=this._startOffset={x:position.left,y:position.top};if(container){this._containerBox=new Box(container);this._bounds=this._containerBox.boundsFor(box);if(step.x!=1){this._bounds[3]-=(this._bounds[3]-startOffset.x)%step.x;this._bounds[1]-=(this._bounds[1]-startOffset.x)%step.x}if(step.y!=1){this._bounds[0]-=(this._bounds[0]-startOffset.y)%step.y;this._bounds[2]-=(this._bounds[2]-startOffset.y)%step.y}}else{delete this._bounds}this._mouseStart={x:e.pageX,y:e.pageY};this._preDragStyle=el.attr('style');this._preDragZIndex=el.css('z-index');el.css('z-index',_zIndex++);this._startLeft=el[0].style.left?parseInt(el[0].style.left):0;this._startTop=el[0].style.top?parseInt(el[0].style.top):0;if(opts.placeholder&&opts.placeholder!='none'){this._createPlaceholder()}el.css('position','absolute');el.css('left',startOffset.x+'px');el.css('top',startOffset.y+'px');if(_ieStrict){this._scrollY=document.documentElement.scrollTop;this._innerHeight=document.documentElement.clientHeight}else if(_ieTrans){this._scrollY=document.body.scrollTop;this._innerHeight=document.body.clientHeight}else{this._scrollY=window.scrollY;this._innerHeight=window.innerHeight}var cancelFunc=function(){return false},doc=document.documentElement;if(this.dropTargets){var event=new events.Event();event.draggable=this;for(var i=0,l=this.dropTargets.length;i<l;i++){fire(this.dropTargets[i],'active',event)}this._mousePos={x:e.pageX,y:e.pageY};this._testForDropTargets()}this._dragListeners=[addListener(doc,'selectstart',cancelFunc),addListener(doc,'dragstart',cancelFunc),addListener(doc,'mousedown',cancelFunc),addListener(doc,'mousemove',this._dragMouse,this),addListener(doc,'mouseup',this._releaseElement,this)];return false},_dragMouse:function(e){var element=this.element,axis=this._opts.axis,newX=axis=='y'?this._startOffset.x:(this._startOffset.x+e.pageX-this._mouseStart.x),newY=axis=='x'?this._startOffset.y:(this._startOffset.y+e.pageY-this._mouseStart.y),bounds=this._bounds,step=this._opts.step;if(step.x!=1){newX=Math.round((newX-this._startOffset.x)/step.x)*step.x+this._startOffset.x}if(step.y!=1){newY=Math.round((newY-this._startOffset.y)/step.y)*step.y+this._startOffset.y}if(bounds){if(axis!='y'){newX=newX<bounds[3]?bounds[3]:newX>bounds[1]?bounds[1]:newX}if(axis!='x'){newY=newY<bounds[0]?bounds[0]:newY>bounds[2]?bounds[2]:newY}}element[0].style.left=newX+'px';element[0].style.top=newY+'px';if(this.dropTargets){this._mousePos={x:e.pageX,y:e.pageY}}if(_ie&&e.nativeEvent.button==0){this._releaseElement(e);return false};return false},_testForDropTargets:function(fromTimeout){if(!this._lock)this._lock=0;if(fromTimeout)this._lock--;else if(this.lock)return;if(this._dragging!=1)return;var previousTarget=this.activeTarget,activeTarget,targets=this.dropTargets,target,targetBox,box=this._box,mousePos=this._mousePos;box.resetPosition();var maxIntersectSize=0;for(var i=0,l=targets.length;i<l;i++){target=targets[i];targetBox=target._box;if(target._opts.tolerance=='contained'){if(targetBox.contains(box)){activeTarget=target;break}}else if(target._opts.tolerance=='cursor'){if(targetBox.containsPoint(mousePos)){activeTarget=target;break}}else{var intersectSize=targetBox.intersectSize(box,true);if(intersectSize>maxIntersectSize){maxIntersectSize=intersectSize;activeTarget=target}}}this.activeTarget=activeTarget;if(activeTarget!==previousTarget){if(activeTarget){var draggableEnterEvent=new events.Event();draggableEnterEvent.draggable=this;fire(activeTarget,'enter',draggableEnterEvent);var enterTargetEvent=new events.Event();enterTargetEvent.dropTarget=activeTarget;fire(this,'enter',enterTargetEvent)}if(previousTarget){var draggableLeaveEvent=new events.Event();draggableLeaveEvent.draggable=this;fire(previousTarget,'leave',draggableLeaveEvent);var leaveTargetEvent=new events.Event();leaveTargetEvent.dropTarget=previousTarget;fire(this,'leave',leaveTargetEvent)}}if(activeTarget&&activeTarget._opts.dropIndicator!='none'){var childBox,childBoxes=activeTarget._childBoxes,children=activeTarget._children;box.resetPosition();var totalHeight=activeTarget._box.innerTopPos();var draggablePosition=mousePos.y-box.offsetParentPageTop();var placed=0;for(var i=0,l=childBoxes.length;i<l;i++){if(children[i]==this.element[0])continue;childBox=childBoxes[i];totalHeight+=childBox.outerHeight();if(draggablePosition<=totalHeight){if(activeTarget._dropIndicatorAt!=i){$(childBox.el).before(activeTarget._dropIndicator);activeTarget._dropIndicatorAt=i}placed=1;break}}if(!placed){if(childBox){$(childBox.el).after(activeTarget._dropIndicator);activeTarget._dropIndicatorAt=i+1}else{activeTarget.element.append(activeTarget._dropIndicator);activeTarget._dropIndicatorAt=0}}}this._lock++;var this_=this;setTimeout(function(){this_._testForDropTargets(1)},100)},_releaseElement:function(){if(this._dragging!=1)return;this._dragging=2;var i,l;var dropTargets=this.dropTargets,activeTarget=this.activeTarget;if(dropTargets){for(i=0,l=dropTargets.length;i<l;i++){var event=new events.Event();event.draggable=this;event.droppedOnThis=activeTarget&&activeTarget==dropTargets[i];fire(dropTargets[i],'inactive',event)}}if(activeTarget){var event=new events.Event();event.draggable=this;fire(activeTarget,'drop',event)}var dragListeners=this._dragListeners;for(i=0,l=dragListeners.length;i<l;i++){events.removeListener(dragListeners[i])}var dropEvent=fire(this,"drop");if(!dropEvent.defaultPrevented()&&this.dropTargets){this.returnHome()}else{this.endDrag()}},endDrag:function(){if(this._dragging!=2)return;this._dragging=0;if(this._reset){this._reset();delete this._reset}if(this.placeholder){this.placeholder.remove()}this._resetPosition();delete this.activeTarget;fire(this,"afterDrop")},returnHome:function(tween){var mytween=(tween)?tween:glow.tweens.linear(),leftDestination,topDestination,el=this.element,position=this._box.el.position(),distance=Math.pow(Math.pow(this._startOffset.x-position.left,2)+Math.pow(this._startOffset.y-position.top,2),0.5),duration=0.3+(distance/1000);var channels=[[glow.anim.css(el,duration,{left:this._startOffset.x,top:this._startOffset.y},{tween:mytween})]];if(this._dropIndicator){channels.push([glow.anim.css(this._dropIndicator,duration-0.1,{opacity:{to:0}})])}var timeline=new glow.anim.Timeline(channels);addListener(timeline,'complete',function(){this.endDrag()},this);timeline.start();return}};var dropTargetId=0;r.DropTarget=function(el,opts){el=this.element=$(el);if(!el.length)throw'no element passed into DropTarget constuctor';if(el.length>1)throw'more than one element passed into DropTarget constructor';this._id=++dropTargetId;this._opts=opts=glow.lang.apply({dropIndicator:'none',dropIndicatorClass:'glow-dragdrop-dropindicator',tolerance:'intersect'},opts||{});if(opts.onActive)addListener(this,'active',opts.onActive);if(opts.onInactive)addListener(this,'inactive',opts.onInactive);if(opts.onEnter)addListener(this,'enter',opts.onEnter);if(opts.onLeave)addListener(this,'leave',opts.onLeave);if(opts.onDrop)addListener(this,'drop',opts.onDrop);addListener(this,'active',this._onActive);addListener(this,'inactive',this._onInactive);return this};r.DropTarget.prototype={setLogicalBottom:function(bottom){this._logicalBottom=bottom},_onActive:function(e){var draggable=e.draggable;this._box=new Box(this.element);if(this._logicalBottom)this._box.setLogicalBottom(this._logicalBottom);if(this._opts.dropIndicator=='none')return;this._onEnterListener=addListener(this,'enter',this._onEnter);this._onLeaveListener=addListener(this,'leave',this._onLeave);this._dropIndicator=placeholderElement(draggable.element);if(this._opts.dropIndicatorClass){this._dropIndicator.addClass(this._opts.dropIndicatorClass)}draggable._box.sizePlaceholder(this._dropIndicator,'relative',0,0);var children=this._children=$(this.element.children()).filter(function(){var el=$(this);return(!e.draggable._placeholder||!el.eq(e.draggable._placeholder))&&(!this._dropIndicator||!el.eq(this._dropIndicator))});var childBoxes=this._childBoxes=[];children.each(function(i){childBoxes[i]=new Box($(children[i]))})},_onInactive:function(e){removeListener(this._onEnterListener);removeListener(this._onLeaveListener);delete this._box;if(this._opts.dropIndicator=='none')return;if(!e.droppedOnThis&&this._dropIndicator){this._dropIndicator.remove();delete this._dropIndicator}delete this._childBoxes;delete this._children},_onEnter:function(){this._dropIndicatorAt=-1},_onLeave:function(){this._dropIndicator.remove()},moveToPosition:function(draggable){var dropIndicator=this._dropIndicator,box=new Box(dropIndicator);var marginLeft=parseInt(dropIndicator.css('margin-left'))||0,marginTop=parseInt(dropIndicator.css('margin-top'))||0,position=box.el.position();draggable._startOffset={x:position.left,y:position.top};draggable._dropIndicator=dropIndicator;delete this._dropIndicator}};glow.dragdrop=r}});/*@end@*/
