
window.ie=!!(window.attachEvent&&!window.opera);window.ie6=window.ie&&navigator.userAgent.toLowerCase().indexOf("msie 6")>=0;window.iPhone=false;function noop(){}
function noOp(){}
function retFalse(){return false;}
function $$(el,forceID){if(el&&el!==document&&el.nodeType!==3&&typeof(el)!=="string"){Object.extend(el,Element);if(!!forceID&&(!isset(typeof(el.id))||el.id==='')){el.forceID();}
if(el.isNode('OPTION')||(el.isNode('INPUT')&&['RADIO','CHECKBOX'].in_array(el.type.toUpperCase()))){Object.extend(el,Input);}
else if(el.isNode('TABLE')||el.isNode('TBODY')){Object.extend(el,Table);}
else if(el.isNode('FORM')){Object.extend(el,Form);}
if(el.hasClassName('hide')){el.hide().removeClassName('hide');}}
return el;}
function $(id){var el=null;if(document.getElementById){el=document.getElementById(id);}
else if(document.all){el=document.all[id];}
else if(document.layers){el=document.layers[id];}
return el!==null?$$(el):null;}
function $debug(txt){var debug=$('debug');if(debug){if(debug.isNode('input')){debug.value+=txt+"\n";}
else if(debug.isNode('textarea')){debug.append(txt+"\n");}
else{debug.append(txt+"<br />");}}}
function $_GET(name){name=name.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var regexS="[\\?&]"+name+"=([^&#]*)",results=new RegExp(regexS).exec(window.location.search);if(results!==null){results=+results[1]+""===results[1]?+results[1]:results[1]==="true"?true:results[1]==="false"?false:results[1];}
return results;}
var Class=function(properties){var property,klass=function(){return(arguments[0]!==null&&this.initialize&&typeof(this.initialize)==='function')?this.initialize.apply(this,arguments):this;};if(typeof(properties)==='function'){klass.inherits(properties);}else{for(property in this){klass[property]=this[property];}
klass.prototype=properties;}
klass.constructor=Class;return klass;};Object.extend=function(d,s){if(typeof(s)==='function'&&s.prototype){return Object.extend(d,s.prototype);}
else if(d){for(var p in s){if(p.toString()!=='prototype'){if(d.prototype&&typeof(d.prototype)==='object'){d.prototype[p]=s[p];}
else if(!d.nodeType||d.nodeType!==3){d[p]=s[p];}}
else{for(var p2 in p){d.prototype[p2]=s[p][p2];}}}}
return d;};Function.prototype.bind=function(who){var func=this,args=[],i;for(i=1;i<arguments.length;++i){args.push(arguments[i]);}
return function(){return func.apply(who,args);};};Function.prototype.curry=function(){var slice=Array.prototype.slice,args=slice.apply(arguments),that=this;return function(){return that.apply(null,args.concat(slice.apply(arguments)));};};Function.prototype.inherits=function(Parent){var d={},p=(this.prototype=new Parent());this.prototype.uber=function uber(name){if(!(name in d)){d[name]=0;}
var f,r,t=d[name],v=Parent.prototype;if(t){while(t){v=v.constructor.prototype;t-=1;}
f=v[name];}else{f=p[name];if(f===this[name]){f=v[name];}}
d[name]+=1;r=f.apply(this,Array.prototype.slice.apply(arguments,[1]));d[name]-=1;return r;};return this;};var IEwatch=function(obj,prop,func){prop=String(prop);var _oldvalue=obj[prop],_interval,check=function(){if(isset(typeof(obj[prop]))&&obj[prop]!==null&&obj[prop]!==_oldvalue){obj[prop]=_oldvalue=func(prop,_oldvalue,obj[prop]);}};if(typeof(func)==="function"){_interval=window.setInterval(check,50);}
return{stopwatch:function(){window.clearInterval(_interval);}};};Object.xwatch=function(obj,prop,func){if(!Object.watch||!Object.unwatch){if(!isset(typeof(obj.watchpoint))){obj.watchpoint={};delete(obj.watchpoint.xwatch);delete(obj.watchpoint.xunwatch);}
obj.watchpoint[prop]=new IEwatch(obj,prop,func);}else{obj.watch(prop,func);}};Object.xunwatch=function(obj,prop){if(!Object.watch||!Object.unwatch){if(obj.watchpoint[prop]){obj.watchpoint[prop].stopwatch();delete(obj.watchpoint[prop]);}}else{obj.unwatch(prop);}};Number.prototype.intval=function(){return this<0?Math.ceil(this):Math.floor(this);};Number.prototype.addCommas=function(){var nStr=this+'',x=nStr.split('.'),x1=x[0],x2=x.length>1?'.'+x[1]:'',rgx=/(\d+)(\d{3})/;while(rgx.test(x1)){x1=x1.replace(rgx,'$1'+','+'$2');}
return x1+x2;};Number.prototype.number_format=function(decimals,dec_point,thousands_sep){decimals=Math.abs(decimals);var n=this,c=isNaN(decimals)?2:decimals,d=!isset(typeof(dec_point))?".":dec_point,t=!isset(typeof(thousands_sep))?",":thousands_sep,s=this<0?"-":"",i=parseInt((n=Math.abs(+n||0).toFixed(c)),10)+"",j=(j=i.length)>3?j%3:0;return s+(j?i.substr(0,j)+t:"")+i.substr(j).replace(/(\d{3})(?=\d)/g,"$1"+t)+(c?d+Math.abs(n-i).toFixed(c).slice(2):"");};Object.extend(String,{editFormat:function(){var txt=this;return txt.replace(/&#39;/g,"'").replace(/&quot;/g,'"').replace(/<br \/>/g,"\n");},trim:function(){var str=this,retval;if(str===""){retval="";}
else{retval=str.replace(/^((&[a-zA-Z]*;)|\s)*/g,"").replace(/(((&[a-zA-Z]*;)|\s)*)$/g,"");}
return retval;},trim2:function(){var str=this.replace(/^\s+/,''),i;for(i=str.length-1;i>=0;--i){if(/\S/.test(str.charAt(i))){str=str.substring(0,i+1);break;}}
return str;},toHyphenated:function(){var str=this,tmp;tmp=str.substr(1).substr(0,str.length-2);tmp=tmp.replace(/([A-Z])/g,'-$1');return(str.substr(0,1)+tmp+str.substr(-1)).toLowerCase();},wordWrap:function(m,b,c){var i,j,l,s,r;if(m<1){return this;}
else{for(i=-1,l=(r=this.split("\n")).length;++i<l;r[i]+=s){for(s=r[i],r[i]="";s.length>m;r[i]+=s.slice(0,j)+((s=s.slice(j)).length?b:"")){j=c==2||(j=s.slice(0,m+1).match(/\S*(\s)?$/))[1]?m:j.input.length-j[0].length||c==1&&m||j.input.length+(j=s.slice(m).match(/^\S*/)).input.length;}}}
return r.join("\n");},find:function(what){return this.indexOf(what)>=0?true:false;},reverse:function(){return this.split("").reverse().join("");},repeat:function(num){num=parseInt(num,10);return!num?'':Array.dim(num,this).join('');}});String.prototype.substring=String.prototype.slice;var List=new Class({initialize:function(list,del,htmlEl){list=(list)?list:"";del=(del)?del:",";this.del=del;this.htmlEl=htmlEl;this._update(list);},contains:function(el,del){var list=this.list,retval,len,elLen,i;del=(!!del)?del:this.del;if(list.indexOf(del+el+del)>0){retval=true;}
else if(list.indexOf(el+del)===0){retval=true;}
else{len=list.length;elLen=(del+el).length;i=list.indexOf(del+el);if(i>0&&i+elLen===len){retval=true;}
else{retval=list===el;}}
return retval;},length:function(){var retval;if(this.list===""){retval=0;}
else if(typeof(this.list)==='string'){retval=(this.list.split(this.del)).length;}
else{retval=this.list?1:0;}
return retval;},remove:function(el){var list=this.list,del=this.del,i=list.indexOf(del+el+del);if(list===el){list="";}
else if(i>0){var newList=list.substring(0,i);i+=(del+el).length;list=newList+list.substring(i);}else{i=list.indexOf(el+del);if(i===0){list=list.substring((el+del).length);}else{var len=list.length,elLen=(del+el).length;i=list.indexOf(del+el);while(i!==-1){if(i+elLen===len){list=list.substring(0,i);break;}else{i=list.indexOf(del+el);}}}}
this._update(list);return list;},add:function(el){var list=this.list;list=(list==="")?el:list+this.del+el;this._update(list);return list;},toArray:function(){if(this.length()===0){return[];}else{return this.list.split(this.del);}},value:function(){return this.list;},getAt:function(index){var tmp=this.toArray();return tmp[index];},_update:function(newList){this.list=newList;if(this.htmlEl){this.htmlEl.update(newList);}}});var Constants=function(){var _rel='/',_profilePic='viewProfilePic',_profile='profile',_profiles=_profile+'s/',_user='user/',_images='images/',_ajax='ajax/',hashComment="#commentboard",tree='tree',seq='sequencer',DL='download',_wall='board/',_css='css/',_maxRate=5,_flash='flash/',_message='mmmail',_tour='tour/',login='login',_prefs={XLI:1,XL:2,seq:3,tip:4,comments:5,search:6,mbits:7,royMeth:13,royAddy:14,royEmail:-14},custSrv='customerservice@mixmatchmusic.com',chazMM='charles@mixmatchmusic.com',_privs=['public','registered','friends','private'],_privStrs=['Everyone','Registered Users','Friends','Nobody'],_regUN=/^[a-zA-Z0-9\-_,\(\)\*:]*$/i,_regEmail=/^([a-zA-Z0-9_\.\-\+\'])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/,self={relRoot:function(){return _rel;},userLink:function(un){return _rel+_user+encodeURIComponent(un);},wallLink:function(){return _rel+_wall+Array.prototype.slice.call(arguments).join('/')+'/';},profileLink:function(id,un){return(!id&&!un)?_rel+_profile:_rel+(!id||id===null?_user+un:_profiles+'~'+id);},profilePic:function(id,type)
{return _rel+_profilePic+'?id='+id+(type===null?'':'&type='+type);},ajaxImages:function(){return _rel+_images+_ajax;},tourImages:function(){return _rel+_images+_tour;},images:function(full){return(full?window.location.protocol+'//www.mixmatchmusic.com/':'')+_rel+_images;},ajax:function(){return _rel+_ajax;},css:function(){return _rel+_css;},flash:function(){return _rel+_flash;},email:function(which){var ret;if(which==="cust"){ret=custSrv;}
else if(which==="chuck"){ret=chazMM;}
return ret;},commentAnchor:function(){return hashComment;},loginLink:function(){return _rel+login;},treeLink:function(id){return _rel+tree+'?id='+id;},seqLink:function(id){return _rel+seq+'?id='+id;},downLink:function(id){return _rel+DL+'?id='+id;},buyLink:function(id){return _rel+"buy/"+id;},prefsTip:function(){return _prefs.tip;},prefsSeq:function(){return _prefs.seq;},prefsRoyMeth:function(){return _prefs.royMeth;},prefsRoyEmail:function(){return _prefs.royEmail;},prefsRoyAddy:function(){return _prefs.royAddy;},prefsXL:function(){return _prefs.XL;},prefsXLIcon:function(){return _prefs.XLI;},maxRating:function(){return _maxRate;},privacies:function(str){return str?_privStrs:_privs;},message:function(id){return _rel+_message+'?mode=n&rid='+id;},regexpUN:function(){return _regUN;},regexpEmail:function(){return _regEmail;}};return self;}();var MMMID=function(){var _userPfx='2',_bitPfx='0',_bytePfx='1',_transPfx='3',_cmtPfx='5',_length=32,self={validID:function(id){return typeof(id)==="string"&&id.length===_length;},validUser:function(uid){return self.validID(uid)&&uid.substring(0,1)===_userPfx;},validBit:function(bid){return self.validID(bid)&&(bid.substring(0,1)===_bitPfx||bid.substring(0,1)===_bytePfx);},validTrans:function(tid){return self.validID(tid)&&tid.substring(0,1)===_transPfx;},validComment:function(cid){return self.validID(cid)&&cid.substring(0,1)===_cmtPfx;}};return self;}();var TextFormatter=function(){var self={addOwnership:function(str){str=String(str);return str+(str.substr(-1)==='s'?"'":"'s");},makeList:function(list,final,comma){if(Array.is_a(list)){final=final||'and';comma=comma||',';var ct=list.length,str='',i,last;for(i=0;i<ct;++i){last=i>=(ct-1);if(last){str+=final+' ';}
str+=list[i];if(!last){if(ct>2){str+=comma;}
if(ct>1){str+=' ';}}}
return str;}}};return self;}();Object.extend(Array,{indexOf:function(toFind){var retval=false,i;for(i=0;retval===false&&i<this.length;++i){if(this[i]===toFind){retval=i;}}
return retval===false?-1:retval;},in_array:function(obj){obj=String(obj).replace('(','\\(','g').replace(')','\\)','g');return new RegExp('(^|,)'+obj+'(,|$)','gi').test(this);},reduce:function(f,value){var i;for(i=0;i<this.length;++i){value=f(this[i],value);}}});Array.is_a=function(val){var doug=isset(typeof(val))&&!!val&&typeof(val)==="object"&&typeof(val.length)==="number"&&typeof(val.splice)==="function"&&!val.propertyIsEnumerable('length'),kangax=Object.prototype.toString.call(val)==="[object Array]";if(doug!==kangax){throw new Exception("Array.is_a: detection method results differ");}
return doug&&kangax;};Array.dim=function(dimension,initial){var a=[],i,isfunc=typeof(initial)==="function";for(i=0;i<dimension;++i){a[i]=isfunc?initial(i):initial;}
return a;};Array.matrix=function(m,n,initial){var i,mat=[],isfunc=typeof(initial)==="function";for(i=0;i<m;++i){mat[i]=Array.dim(n,isfunc?initial.curry(i):initial);}
return mat;};Array.identity=function(n){var i,func=function(max,row,col){return row===col?max:0;};return Array.matrix(n,n,func.curry(n));};var Element=new Class({initialize:noop,forceID:function(){var newid=this.nodeName.toLowerCase()+"_"+sha1(new Date().getTime());if(!$(newid)){this.id=newid;}
return this.id;},attrib:function(attr,value){if(!isset(typeof(value))){value=attr;}
this.attr=value;this.setAttribute(attr,value);return this;},unattrib:function(attr){delete(this.attr);this.removeAttribute(attr);return this;},getChild:function(nodeName){var children=this.childNodes,child=false;if(children&&children.length){for(var i=0;child===false&&i<children.length;++i)
{if($$(children[i]).isNode(nodeName)){child=children[i];}}}
return child;},appendChildren:function(nodes){for(var i=0;i<nodes.length;++i){this.appendChild(nodes[i]);}
return this;},insertAfter:function(node){this.parentNode.insertBefore(node,this.nextSibling);},create:function(nodeName,id,classname,innerHTML){if(this!==document){return this.appendChild(document.create.apply(document,arguments));}},createFirst:function(){return this.prependChild(document.create.apply(document,arguments));},prependChild:function(node){return this.childNodes&&this.childNodes.length>0?this.insertBefore(node,this.firstChild):this.appendChild(node);},createText:function(text){var retval;if(!isset(typeof(this.canHaveChildren))||this.canHaveChildren){retval=document.createTextNode(text);this.appendChild(retval);}else{this.text=retval=text;}
return retval;},getChildNodes:function(nonText){var nodes=[];for(var i=0;this.childNodes&&i<this.childNodes.length;++i){if(!nonText||this.childNodes[i].nodeType!==3){nodes.push($$(this.childNodes[i]));}}
return nodes;},childNodesNonText:function(index){var nodes=this.getChildNodes(true);return index&&index>0&&index<nodes.length?nodes[index]:nodes;},isNode:function(nodeName){return this.nodeName&&typeof(nodeName)==='string'&&this.nodeName.toUpperCase()===nodeName.toUpperCase();},remove:function(){if(this.parentNode){this.parentNode.removeChild(this);}},empty:function(){while(this.hasChildNodes()){this.removeChild(this.firstChild);}
if(isset(typeof(this.value))){this.value='';this.setAttribute("value",'');}
return this;},curStyle:function(){var retval=null;if(window.getComputedStyle){retval=window.getComputedStyle(this,null);}
else if(this.currentStyle){retval=this.currentStyle;}
return retval;},hasClassName:function(className){return!!(this.className&&this.className.length!==0&&(this.className===className||this.className.match(new RegExp("(^|\\s)"+className+"(\\s|$)"))));},addEvent:function(evType,fn,useCapture){var retval;try{if(this.addEventListener){this.addEventListener(evType,fn,useCapture);this.addedEventHandlers=this.addedEventHandlers||[];this.addedEventHandlers.push(fn);retval=true;}else if(this.attachEvent){retval=this.attachEvent("on"+evType,fn);}
else{retval=false;}
if(retval){try{VisualEvents.push({nNode:this,sSource:"MixMatchMusic",sType:evType,sFunction:fn});}catch(ex1){}}}catch(ex2){$debug("err: "+this.nodeName);}
return retval;},removeEvent:function(type,fn){if(this.removeEventListener){this.removeEventListener(type,fn,false);}
else if(this.detachEvent){this.detachEvent("on"+type,fn);}
try{VisualEvents.push({nNode:this,sSource:"MixMatchMusic",sType:type,sFunction:fn,bRemoved:true});}catch(e){}},setEvent:function(type,fn,useCapture){if(this.addedEventHandlers){for(var i=0;i<this.addedEventHandlers;i++){this.removeEvent(type,this.addedEventHandlers[i]);}
this.addedEventHandlers=[];}
if(type==='click'){this.setClick(fn);}
else if(type==='change'){this.onchange=fn;}
else{this['on'+type]=fn;}
try{VisualEvents.push({nNode:this,sSource:"MixMatchMusic",sType:type,sFunction:fn});}catch(e){}
return this;},addClick:function(fn,useCapture){return this.addEvent('click',fn,useCapture);},setClick:function(fn){this.onclick=fn;try{VisualEvents.push({nNode:this,sSource:"MixMatchMusic",sType:'click',sFunction:fn});}catch(e){}
return this;},addDblClick:function(fn,useCapture){return this.addEvent('dblclick',fn,useCapture);},setDblClick:function(fn){this.ondblclick=fn;return this;},setClassName:function(className){if(!isset(typeof(className))){className='';}
this.className=className;return this;},addClassName:function(className){if(Array.is_a(className)){className=className.join(' ');}
if(this.className&&this.className!==''){if(!this.hasClassName(className)){this.className=className+' '+this.className;}}else{this.setClassName(className);}
return this.hasClassName(className);},removeClassName:function(className){if(this.hasClassName(className)){this.className=this.className.replace(new RegExp("(^|\\s)"+className+"(\\s|$)")," ");if(this.className&&typeof(this.className)==="string"){this.className=this.className.trim();}}
return!this.hasClassName(className);},toggleClassName:function(className,add){return!!add?this.addClassName(className):this.removeClassName(className);},cloak:function(){if(this.style){this.style.visibility='hidden';}
return this;},reveal:function(display){display=display||"visible";if(this.style){this.style.visibility=display;}
return this;},visible:function(){var visible=(this.style&&this.getStyle("visibility")!=='hidden');return!this.isHidden()&&visible;},setCloaked:function(cloak,display){if(!cloak){this.reveal(display);}else{this.cloak();}
return this;},hide:function(){if(this.style){this.style.display='none';}
return this;},show:function(display,table){if(this.style){if(!isset(typeof(display))||display===null){display='block';}
if(!!table){try{if(this.nodeName.toUpperCase()==='TR'){this.style.display='table-row';}
else if(this.nodeName.toUpperCase()==='TABLE'){this.style.display='table';}
else if(this.nodeName.toUpperCase()==='TD'){this.style.display='table-column';}}catch(e){this.style.display=display;}}else{this.style.display=display;}
this.removeClassName('hide');}
return this;},isHidden:function(){return this.style&&this.getStyle("display")==='none';},setHidden:function(hide,display){if(!hide){this.show(display);}else{this.hide();}
return this;},toggle:function(display,table){if(this.isHidden()){this.show(display,table);}
else{this.hide();}
return this;},update:function(val){if(val!==0&&!val){val='';}
if(this.nodeName){if(this.isNode('input')||this.isNode('textarea')){this.setAttribute("value",val);this.value=val;}else if(this.isNode("table")){if(!val||val===''){this.empty();}
else{throw("The innerHTML property of a table can not be set in IE.");}}else if(isset(typeof(this.innerHTML))){try{this.innerHTML=val;}catch(e){if(this.isNode('p')){throw("IE sometimes can't set the innerHTML of a p tag.");}
else{throw("Exception setting InnerHTML: "+e.name+" / "+e.message);}}}}
return this;},scan:function(text){var retval=null;if(this.nodeName){if(this.isNode('input')||this.isNode('textarea')){retval=this.value;}
else if(this.isNode('select')){if(this.selectedIndex>=0){var sel=this.options[this.selectedIndex];retval=text?sel.text:sel.value;}else{retval=null;}}else if(isset(typeof(this.innerHTML))){retval=text?this.innerHTML.replace(/<br ?\/?>/ig,"\n").replace(/(<([^>]+)>)/ig,""):this.innerHTML;}}
return retval;},xerox:function(obj,text){if($$(obj)){this.update(obj.scan(text));}
return this;},append:function(val){if(val!==0&&!val){val='';}
this.update(this.scan()+val);return this;},clipCopy:function(oneline){var text=this.scan(true),onelinetext=text.split('\n').join('');if(this.createTextRange){if(oneline){this.update(onelinetext);}
var range=this.createTextRange();if(range&&BodyLoaded===1){range.execCommand('Copy');}
if(oneline){this.update(text);}}else{var flashcopier='flashcopier',flashEl=$(flashcopier);if(!flashEl){document.body.appendChild(document.create('div',flashcopier));flashEl=$(flashcopier);}
var divinfo='<embed src="'+Constants.flash()+'_clipboard.swf" FlashVars="clipboard='+encodeURIComponent(oneline?onelinetext:text)+'" width="0" height="0" type="application/x-shockwave-flash"></embed>';flashEl.empty().update(divinfo);statusBar.talk("Text copied to the clipboard.");window.setTimeout(flashEl.remove,500);}},getStyle:function(prop){if(this.style&&this.style[prop]&&this.style[prop]!==""){return this.style[prop];}else{var retval;if(this.currentStyle){retval=this.currentStyle[prop];}else if(window.getComputedStyle){var elstyle=window.getComputedStyle(this,"");retval=elstyle.getPropertyValue(prop.toHyphenated());}
return retval;}},popup:function(hideMethod){var closeFunc=noop;if(this.id){if(Element.beforePopup&&typeof(Element.beforePopup)==='function'){Element.beforePopup();}
WindowUtilities.disableScreen('dialog','overlay_modal',0,this.id);var me=this;hideMethod=(typeof(hideMethod)==='function')?hideMethod:noop;closeFunc=function(){me._unfreezeScreen();me.hide();WindowUtilities.enableScreen();hideMethod();if(Element.afterPopup&&typeof(Element.afterPopup)==='function'){Element.afterPopup();}};$('overlay_modal').addClick(closeFunc);this.style.zIndex=Windows.maxZIndex+10000;this.show();this._freezeScreen();this._centerMe();var currOpacity=0,targetOpacity=60,overlay=$('overlay_modal'),opacityInterval,doFade=function(){currOpacity+=10;overlay.style.filter="alpha(opacity="+currOpacity+")";overlay.style.MozOpacity=currOpacity/100;overlay.style.opacity=currOpacity/100;overlay.style.KhtmlOpacity=currOpacity/100;if(currOpacity>=targetOpacity){clearInterval(opacityInterval);}};opacityInterval=setInterval(doFade.bind(me),30);}
return closeFunc;},fadeIn:function(){this.currOpacity+=10;if(this.overlay.style.filters)
{this.overlay.style.filters.alpha.opacity=this.currOpacity;}
this.overlay.style.MozOpacity=this.currOpacity/100;this.overlay.style.opacity=this.currOpacity/100;if(this.currOpacity>=this.opacity){clearInterval(this.opacityIntveral);}},_centerMe:function(){this.remove();var me=this;window.addLoad(function(){document.body.appendChild(me);me.style.position='absolute';me._recenter();});},_freezeScreen:function(){var pageSize=WindowUtilities.getPageSize();this._prevSize=pageSize;document.onscroll=this._recenter.bind(this);window.onresize=this._recenter.bind(this);this.currentScroll=WindowUtilities.getWindowScroll();},_unfreezeScreen:function(){document.onscroll=null;window.onresize=null;},_recenter:function(){var windowScroll=WindowUtilities.getWindowScroll(),pageSize=WindowUtilities.getPageSize(),top=(pageSize.windowHeight-this.offsetHeight)/2+windowScroll.top,left=(pageSize.pageWidth-this.offsetWidth)/2+windowScroll.left;this.style.top=top+'px';this.style.left=left+'px';},getElementsByAttribute:function(attribute,value,tagName){if(!tagName){tagName="*";}
if(!!document.evaluate){var q=".//"+tagName+"[contains(@"+attribute+", '"+value+"')]";return document._getElementsByXPath(q,this);}else{var children=this.getElementsByTagName(tagName),elements=[],child,i,length;for(i=0,length=children.length;i<length;++i){if(this[attribute]===value){elements.push($$(children[i]));}}
return elements;}},setFaded:function(opacity){opacity=parseFloat(opacity);if(isNaN(opacity)||opacity>1){opacity=1;}
else if(opacity<0){opacity=0;}
if(this.style){this.style.opacity=opacity;this.style.MozOpacity=opacity;this.style.KhtmlOpacity=opacity;this.style.filter="alpha(opacity="+(100*opacity)+")";}
return this;},doFade:function(fadingIn,onComplete){var opac=fadingIn?0:1,mult=2,el=this,interval=window.setInterval(function(){if(!el.isHidden()&&(fadingIn?opac<1:opac>0)){if(fadingIn){opac+=mult*1e-2;}
else{opac-=mult*1e-2;}
mult*=1.5;el.setFaded(opac);}else{opac=fadingIn?1:0;el.setFaded(opac);window.clearInterval(interval);if(typeof(onComplete)==="function"){onComplete();}}},50);return this;}});var Input={check:function(){if(isset(typeof(this.checked))){this.checked=true;}
if(isset(typeof(this.selected))){this.selected=true;}
return this;},uncheck:function(){if(isset(typeof(this.checked))){this.checked=false;}
if(isset(typeof(this.selected))){this.selected=false;}
return this;},isChecked:function(){return!!this.checked||!!this.selected;}};var Table={getRowIndex:function(id){var r=this.rows,i,ind=false;if(r){for(i=0;ind===false&&i<r.length;++i){if(r[i].id===id){ind=i;}}}
return ind;},update:function(){this.empty();}};var Form={getElements:function(){var els=[];if(this.elements){for(var i=0;i<this.elements.length;++i){els.push($$(this.elements[i]));}}
return els;}};document.onscroll=function(){return false;};window.onscroll=function(){return false;};window.modifier=function(mask,e){if(!e){e=window.event;}
if(!!e){var targ=e.target?e.target:e.srcElement,which=e.which||e.keyCode||-1,yes,masks={'0001':'altKey','0010':'ctrlKey','0100':'shiftKey','0002':'altLeft','0020':'ctrlLeft','0200':'shiftLeft','1000':'metaKey'};if(isset(typeof(e[masks[mask]]))){yes=!!e[masks[mask]];}
else if(e.modifiers){mask=parseInt(mask,2);yes=(e.modifiers&mask)>0;}}
return!!e&&!!yes;};window.shiftKey=window.shifted=window.modifier.curry('0100');window.ctrlKey=window.modifier.curry('0010');window.altKey=window.modifier.curry('0001');window.metaKey=window.modifier.curry('1000');window.altKeyLeft=window.modifier.curry('0002');window.ctrlKeyLeft=window.modifier.curry('0020');window.shiftKeyLeft=window.modifier.curry('0200');window.enterKey=function(e){if(!e){e=window.event;}
return(e.which||e.keyCode||-1)===13;};window.getMouseCoords=function(e){if(!e){e=window.event;}
var posX=0,posY=0;if(!!e){if(e.pageX||e.pageY){posX=e.pageX;posY=e.pageY;}
else if(e.clientX||e.clientY){posX=e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;posY=e.clientY+document.body.scrollTop+document.documentElement.scrollTop;}}
return{x:parseInt(posX,10),y:parseInt(posY,10)};};Object.extend(Element,{getElementsByClassName:function(className,tagName){if(!tagName){tagName="*";}
if(!!document.evaluate){var q=".//"+tagName+"[contains(concat(' ', @class, ' '), ' "+className+" ')]";return document._getElementsByXPath(q,this);}else{var children=this.getElementsByTagName(tagName),elements=[],child,i,length;for(i=0,length=children.length;i<length;++i){if(Element.prototype.hasClassName.call(children[i],className))
{elements.push($$(children[i]));}}
return elements;}},getElementsByName:function(elName,tagName){return Element.prototype.getElementsByAttribute.call(this,'name',elName,tagName);},hasClass:Element.prototype.hasClassName,identify:function(id){this.id=id;return this;},classify:function(){if(arguments.length>0){for(var i=arguments.length;i>0;--i){this.addClassName(arguments[i-1]);}}
return this;},declassify:function(){if(arguments.length>0){for(var i=arguments.length;i>0;--i){this.removeClassName(arguments[i-1]);}}
return this;},textify:function(){this.createText.apply(this,arguments);return this;},stylify:function(prop,value){if(this.style){this.style[prop]=isset(typeof(value))?value:null;}
return this;},clearify:function(){this.create('div').classify('clear');return this;}});var Flash={tries:0,maxTries:2,playing:"",playClicked:false,curID:'',func:noop,playingFunc:noop,getFlashMovie:function(movieName){var isIE=navigator.appName.indexOf("Microsoft")!==-1;return(isIE)?window[movieName]:document[movieName];},update:function(name,id){if(this.curID!==id){this.curID=id;var movie=this.getFlashMovie(name);if(movie&&movie.switchSound){this.stop(name);movie.switchSound(id);if(this.playClicked){this.play(name);this.playClicked=false;}
this.tries=0;return true;}else if(this.tries++<this.maxTries){window.setTimeout(Flash.update.bind(Flash,name,id),500);}}},changePlayer:function(name){if(this.playing&&this.playing!==name){this.stop(this.playing);}
this.playing=name;return name;},play:function(name){var movie=this.getFlashMovie(name),retval=false;if(movie&&movie.playSound){this.playClicked=true;retval=movie.playSound();}
return retval;},stop:function(name){try{var movie=this.getFlashMovie(name),retval=false;if(movie&&movie.stopSound){this.playClicked=false;retval=movie.stopSound();}
var f=this.func;this.func=null;if(typeof(f)==="function"){f();}
return retval;}catch(e){return false;}},getCookies:function(){return document.cookie||'';},loadMbit:function(id){var movie=this.getFlashMovie("mmmSequencer"),retval=false;if(movie&&movie.loadMbit){retval=movie.loadMbit(id);}
return retval;},loadSession:function(id){var movie=this.getFlashMovie("mmmSequencer"),retval=false;if(movie&&movie.loadSession){retval=movie.loadSession(id);}else{window.alert("Sorry, this isn't supported yet");}
return retval;},isDirty:function(){var movie=this.getFlashMovie("mmmSequencer"),retval=null;if(movie&&movie.isDirty){retval=movie.isDirty();}
return retval;},setCallback:function(f){this.func=f;},setPlayingCallback:function(f){this.playingFunc=f;},soundPlaying:function(){var f=this.playingFunc;this.playingFunc=null;if(typeof(f)==="function"){f();}}};var startStack=function(){},lastStack=function(){},registerOnLoad=function(func,last){var orgOnLoad;if(ranOnload){if(typeof(func)==="function"){func();}}else if(!last){orgOnLoad=startStack;startStack=function(){orgOnLoad();if(typeof(func)==="function"){func();}
return;};}else{orgOnLoad=lastStack;lastStack=function(){orgOnLoad();if(typeof(func)==="function"){func();}
return;};}};document.getElementsByClassName=Element.prototype.getElementsByClassName;document.getElementsByName=Element.prototype.getElementsByName;if(document.body){document.body.getElementsByClassName=Element.prototype.getElementsByClassName;document.body.getElementsByName=Element.prototype.getElementsByName;}
window.addEvent=function(){return Element.prototype.addEvent.apply(window,arguments);};window.addLoad=function(){registerOnLoad(arguments[0],arguments[1]);};window.addUnload=window.addEvent.curry("unload");window.addBeforeUnload=window.addEvent.curry("beforeunload");document.create=function(nodeName,id,classname,innerHTML){var type,forID;if(nodeName.substring(0,5)==="input"&&nodeName!=="input"){type=nodeName.substring(6);nodeName="input";}
if(nodeName.substring(0,5)==="label"&&nodeName!=="label"){forID=nodeName.substring(6);nodeName="label";}
var el=document.createElement(nodeName);if(id&&id.length>0){el.id=id;}
$$(el);if(isset(typeof(classname))&&classname){el.addClassName(classname);}
if(type&&nodeName==="input"){el.setAttribute("type",type);}
if(forID&&nodeName==="label"){el.setAttribute("for",forID);}
if(isset(typeof(innerHTML))&&innerHTML!==false){el.update(innerHTML);}
return $$(el);};if(!!document.evaluate){document._getElementsByXPath=function(expression,parentElement){var results=[],i,query=document.evaluate(expression,$$(parentElement)||document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);for(i=0,length=query.snapshotLength;i<length;++i)
{results.push($$(query.snapshotItem(i)));}
return results;};}
Date.makeY2K=function(number){return(+number<1000)?+number+1900:+number;};Date.isValid=function(y,m,d){if(d!==""&&(m===0||m!=="")&&y!==""){var test=new Date(y,m,d);return((Date.makeY2K(test.getYear())===+y)&&(+m===test.getMonth())&&(+d===test.getDate()));}
return false;};function mmmAttachSubmitHoverEvents(input){input.addEvent('mouseover',function(){input.addClassName('submitHover');});input.addEvent('mouseout',function(){input.removeClassName('submitHover');});}
var mmmChangeBold=function(el){var opts=el.getElementsByAttribute("selected","selected","option"),i,sel=el.selectedIndex;for(i=0;i<opts.length;++i){opts[i].removeAttribute("selected");}
if(!window.ie&&sel>=0&&el.options&&el.options[sel]&&el.options[sel].setAttribute){el.options[sel].setAttribute("selected","selected");}};function mmmSetup(){try{doNifty("div#activeContent");doNifty("div#quickMenu,div#subQuickMenu,div#contentHolder","small");doNifty("div#adBarHolder,div#adBar","small");}catch(e){}
var inputs=document.getElementsByClassName("submit","input"),i,sels=document.getElementsByTagName('select');for(i=0;i<inputs.length;++i){mmmAttachSubmitHoverEvents(inputs[i]);}
function attachMCB(el){mmmChangeBold(el);el.addEvent("change",mmmChangeBold.curry(el));}
for(i=0;i<sels.length;++i){attachMCB($$(sels[i]));}}
window.addLoad(mmmSetup);if(window.ie6){window.addLoad(function(){document.body.style.behavior='url("/css/csshover.htc")';},true);}
var AjaxIndicator=function(){var ind,ca=Constants.ajaxImages(),img=document.create('img','ajaxImg'),err=document.create('img','ajaxErr'),imagePreload=new Image(),_ind=function(){if(!ind){ind=$("ajaxIndicator");}},_hide=function(){_ind();if(ind){ind.empty();}},_show=function(){_ind();if(ind){_hide();ind.appendChild(img);}},_error=function(){_ind();if(ind){_hide();ind.appendChild(err);}};imagePreload.src=img.src=ca+"clock.20081001.gif";err.src=ca+"error.20081001.gif";img.height=img.width=err.height=err.width=50;window.addLoad(_ind);return{show:_show,hide:_hide,error:_error};}();var Ajax=new Class({updateOptions:function(params){this.options=Object.extend(this.options,params);},initialize:function(url,params){this.options={method:'post',asynchronous:true,onRequest:null,onSuccess:noop,onFailure:noop,onComplete:noop,urlEncoded:true,encoding:'utf-8',parameters:"",debug:false,headers:{}};this.url=url;this.transport=window.XMLHttpRequest?new XMLHttpRequest():(ActiveXObject?new ActiveXObject('Microsoft.XMLHTTP'):false);this.updateOptions(params);if(this.options.debug){$debug('AJAX creating');}
this.options.method=this.options.method.toLowerCase();if(this.options.urlEncoded&&this.options.method==='post'){var encoding=!!this.options.encoding?'; charset='+this.options.encoding:'';this.options.headers['Content-type']='application/x-www-form-urlencoded'+encoding;}
if(this.options.debug){$debug('AJAX created');}},send:function(){if(this.options.debug){$debug('AJAX sending');}
AjaxIndicator.show();var url=this.url;if(this.options.parameters&&this.options.method==='get')
{url+=(this.url.indexOf('?')>-1?'&':'?')+this.options.parameters;}
this.transport.open(this.options.method.toUpperCase(),url,this.options.asynchronous);this.transport.onreadystatechange=this.onStateChange.bind(this);if((this.options.method==='post')&&this.transport.overrideMimeType)
{this.options.headers.Connection='close';}
for(var type in this.options.headers){if(this.options.headers.hasOwnProperty(type)){try{this.transport.setRequestHeader(type,this.options.headers[type]);}
catch(e){}}}
var post=this.options.method==='post'?this.options.parameters:null;this.transport.send(post);if(!this.options.asynchronous&&this.transport.overrideMimeType)
{this.onStateChange();}
if(this.options.debug){$debug('AJAX sent');}},onStateChange:function(){if(this.options.debug){$debug('AJAX state '+this.transport.readyState);}
if(this.transport.readyState!==4){return;}
if(this.options.debug){$debug('AJAX status '+this.transport.status);}
var status=0;try{status=this.transport.status;}catch(e){}
if(this.options.onComplete){AjaxIndicator.hide();this.options.onComplete(this.transport);}
if((status>=200)&&(status<300)){AjaxIndicator.hide();this.options.onSuccess(this.transport);}
else{if(this.transport.status>0){AjaxIndicator.error();this.options.onFailure(this.transport);}}
this.transport.onreadystatechange=noop;}});var Flow=function(){var _loggedIn,_log,_unS,_un,_idS,_id,_adm,_isAdmin,self={setup:function(){_log=$("loggedIn");_loggedIn=_log?+_log.scan(true)===1:false;_adm=$("isAdmin");_isAdmin=_adm?+_adm.scan(true)===1:false;_unS=_loggedIn?$('MM_username'):false;_idS=_loggedIn?$('mmmID'):false;_id=_idS?_idS.scan(true):null;_un=_unS?_unS.scan(true):false;},loggedIn:function(){return!!_loggedIn;},isAdmin:function(){return!!_isAdmin;},getMMMID:function(){return _id;},getUN:function(){return _un;}};return self;}();window.addLoad(Flow.setup);function getElementsByTagAndClass(root_element,tag,className){return root_element.getElementsByClassName(className,tag);}
function makeFakeLink(el,clickFunc,style){if($$(el)){if(!style){style="fakeLink";}
if(!el.hasClassName(style)){el.addClassName(style);}
el.addEvent('mouseover',function(){el.addClassName(style+"Hover");});el.addEvent('mouseout',function(){el.removeClassName(style+"Hover");});if(typeof(clickFunc)==="function"){el.setClick(clickFunc);}}}
function findPosX(obj){var curleft=0;if(obj.offsetParent){var yes=true;while(yes){curleft+=obj.offsetLeft;if(!obj.offsetParent){yes=false;}
else{obj=obj.offsetParent;}}}else if(obj.x){curleft+=obj.x;}
return curleft;}
function findPosY(obj){var curtop=0;if(obj.offsetParent){var yes=true;while(yes){curtop+=obj.offsetTop;if(!obj.offsetParent){yes=false;}
else{obj=obj.offsetParent;}}}else if(obj.y){curtop+=obj.y;}
return curtop;}
function getPos(obj){return{x:findPosX(obj),y:findPosY(obj)};}
var Cookie={createCookie:function(name,value,days,expires){var date;if(!isset(typeof days)&&!isset(typeof expires)){expires='';}else{if(!days){days=expires/(24*60*60*1000);}
if(days){date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));expires="; expires="+date.toGMTString();}}
document.cookie=name+"="+value+expires+"; path=/";},readCookie:function(name){var nameEQ=name+"=",i,ca=document.cookie.split(';'),data=null;for(i=0;i<ca.length;++i){var c=ca[i];while(c.charAt(0)===' '){c=c.substring(1);}
if(c.indexOf(nameEQ)===0){data=c.substring(nameEQ.length);break;}}
return data;},eraseCookie:function(name){Cookie.createCookie(name,0,-1);},get:function(name){return Cookie.readCookie(name);},set:function(name,value,expires){return Cookie.createCookie(name,value,false,expires);},unset:function(name){Cookie.eraseCookie(name);}};var CheckLogin=function(){var url=Constants.ajax()+"checklogin",s=Cookie.readCookie('MixMatchCookie'),func=null,loggedIn=true;function checkSucceeded(req){var obj=JSON.parse(req.responseText);if(obj&&obj.result){loggedIn=true;if(func&&typeof(func)==='function'){func(true);}}else{loggedIn=false;if(func&&typeof(func)==='function'){func(false);}
else{window.location.reload(true);}}}
function checkFailed(req){window.location.reload(true);}
var params={onSuccess:checkSucceeded,onFailure:checkFailed,method:'get',parameters:'s='+s};this.check=function(){var ajax=new Ajax(url,params);ajax.send();};this.isLoggedIn=function(){if(loggedIn){loggedIn=(Cookie.readCookie('in')!==null);}
return loggedIn;};this.checkLogout=function(){if(!CheckLogin.isLoggedIn()){window.location.reload(true);}};this.setCallback=function(f){func=f;};return this;}();function changeOpac(opacity,el){el.style.opacity=(opacity/100);el.style.MozOpacity=(opacity/100);el.style.KhtmlOpacity=(opacity/100);el.style.filter="alpha(opacity="+opacity+")";}
function objectContains(obj,x,y){var pos=getPos(obj),retval;if(obj.offsetWidth&&obj.offsetHeight){retval=((x>=pos.x)&&(x<=(pos.x+obj.offsetWidth))&&(y>=pos.y)&&(y<=(pos.y+obj.offsetHeight)));}else{retval=false;}
return retval;}
function cloneFunctionToString(_func){var functionString=_func.toString(),bodyString=functionString.substring(functionString.indexOf("{")+1,functionString.lastIndexOf("}")),functionArg=functionString.substring(functionString.indexOf("(")+1,functionString.indexOf(")")),argArray=functionArg.split(","),retString;retString=bodyString;retString=retString.replace(/\n/g," ");return retString;}
function cancelBubble(e){if(!e){e=window.event;}
if(e){e.cancelBubble=true;if(e.stopPropagation){e.stopPropagation();}}}
var statusBar=function(){var msg,sBlinks,box,main,_lSep,created=false,allLinks=[],hideLink,i,_setup=function(){main=$("statusBar");},mainCol,_create=function(){if(!created&&main){created=true;var txt='<table id="statusBarTbl" cellpadding="0" cellspacing="0"><tbody>';txt+='<tr><td id="sbTL"></td><td colspan="2"></td><td id="sbTR"></td></tr>';txt+='<tr><td></td><td valign="middle"><div id="sBcontentPad"><div id="sBcontent"></div></div></td><td id="sBlinks" valign="middle"></td><td></td></tr>';txt+='<tr><td id="sbBL"></td><td colspan="2"></td><td id="sbBR"></td></tr>';txt+='</tbody></table>';var tmp=main.create('div').update(txt);box=$('statusBarTbl').hide();msg=$('sBcontent');sBlinks=$('sBlinks');mainCol=$('sBcontentPad').parentNode;_lSep=document.create("span").update("&nbsp;|&nbsp;");window.setTimeout(doNifty.curry($('sBcontentPad'),"small"),30);}};this.hide=function(){if(main){_create();box.hide();sBlinks.empty();allLinks=[];msg.empty();AjaxIndicator.hide();sBlinks.style.height='auto';}
return this;};this.error=function(str){this.talk(str,"error");};this.talk=function(str,type){if(window.fluid&&window.fluid.showGrowlNotification&&window.fluid.isGrowlRunning&&window.fluid.isGrowlRunning()){window.fluid.showGrowlNotification({title:"MixMatchMusic "+(type==="error"?"Error":"Status")+" Message",description:str,priority:1,sticky:type==="error",identifier:"statusBar_"+sha1(str),onclick:statusBar.hide,icon:Constants.images(true)+(type==="error"?"tips_bang.gif":"tips_off.gif")});if(type==="error"){window.fluid.beep();}}else if(main){_create();if(type==="error"){str='<span class="error">'+str+'</span>';}
if(box.isHidden()){msg.update(str);}
else{msg.append("\n<br />"+str);}
statusBar.show();}};this.map=function(links){if(main){_create();allLinks=[];if(Array.is_a(links)){for(i=0;i<links.length;++i){allLinks.push($$(links[i]));}}
allLinks.push(document.create("a","sB_hideLink","blue hand").textify("Hide"));if(Array.is_a(allLinks)){sBlinks.hide().empty();for(i=0;i<allLinks.length;++i){sBlinks.appendChild(allLinks[i]);if(i+1<allLinks.length){sBlinks.appendChild(_lSep.cloneNode(true));}
allLinks[i].classify('blue').classify('hand').addClick(statusBar.hide);}
sBlinks.show('').create('span').update("");}else{sBlinks.hide();}}};this.show=function(){if(main){_create();box.show('');this.map();sBlinks.style.height=mainCol.clientHeight+'px';}
return this;};window.addLoad(_setup);return this;}();var seqLinks=function(){var _class="seqLink",_links=false,i,_cookieName="MixMatchSequencerLinkAction_Same",_urlP=Constants.ajax()+"prefsManager",_ajax=new Ajax(_urlP,{method:'get',asynchronous:true,onFailure:function(request){seqLinks.error(request);}}),_newTab=true,_prefSeq,_updateOne=function(node){if($$(node,true)){node.target=_newTab?"_blank":null;node.setAttribute("target",_newTab?"_blank":null);}},_update=function(){if(_links){i=_links.length;while(i--){_updateOne(_links[i]);}}},self={setup:function(){_prefSeq=$("pref_SeqAction");_newTab=Flow.loggedIn()?(_prefSeq?+_prefSeq.scan(true)===1:true):!Cookie.readCookie(_cookieName);_links=$("centerMe")?$("centerMe").getElementsByClassName(_class,"a"):false;_update();},setAction:function(newTab){_newTab=newTab;_update();if(Flow.loggedIn()){_ajax.updateOptions({parameters:'pref='+Constants.prefsSeq()+'&val='+(newTab?"new":"same"),onSuccess:function(request){seqLinks.handlePref(request,newTab);}});_ajax.send();Cookie.eraseCookie(_cookieName);_prefSeq.update(newTab?1:0);}else{if(newTab){Cookie.eraseCookie(_cookieName);}
else{Cookie.createCookie(_cookieName,1,30);}
self.handlePref(false,newTab);}},handlePref:function(request,newTab){var resp=request?JSON.parse(request.responseText):{y:1};if(resp.y){statusBar.talk('MixMaker links will now open in '+(newTab?'a new':'the same')+' tab/window.');}
else{statusBar.error('MixMaker link behavior preference not saved successfully.');}},attach:function(node){if(_links===false){_links=[];}
_links.push(node);_updateOne(node);}};window.addLoad(self.setup);return self;}();var xLinks=function(){var _class="xLink",_links=false,i,_prefIcon,_prefTab,_cookieName="MixMatchExternalLinkIcons_Off",_cookieNameTab="MixMatchExternalLinkAction_Same",_showIcon=true,_newTab=true,_urlP=Constants.ajax()+"prefsManager",_ajax=new Ajax(_urlP,{method:'get',asynchronous:true,onFailure:function(request){xLinks.error(request);}}),_icon,_iconSrc=Constants.images()+"xlink.20081001.gif",_updateOne=function(node){if($$(node,true)){_icon=$(node.id+"_img");var social=node.hasClassName("Social");if(!_icon&&!social){_icon=document.create("img",node.id+"_img",_class);_icon.src=_iconSrc;node.appendChild(_icon);}
if(_showIcon&&!social){_icon.show("inline");}
else if(!social){_icon.hide();}
node.target=_newTab?"_blank":null;node.classify(_class).setAttribute("target",_newTab?"_blank":null);}},_update=function(){if(_links){i=_links.length;while(i--){_updateOne(_links[i]);}}},self={setup:function(){_prefIcon=$("pref_xLinkIcons");_prefTab=$("pref_xLinkAction");_showIcon=Flow.loggedIn()?_prefIcon?+_prefIcon.scan(true)===1:true:!Cookie.readCookie(_cookieName);_newTab=Flow.loggedIn()?_prefTab?+_prefTab.scan(true)===1:true:!Cookie.readCookie(_cookieNameTab);_links=$("centerMe")?$("centerMe").getElementsByClassName(_class,"a"):false;_update();},show:function(){self.setIcons(true);},hide:function(){self.setIcons(false);},setIcons:function(show){_showIcon=show=!!show;_update();if(Flow.loggedIn()){_prefIcon.update(show?1:0);_ajax.updateOptions({parameters:'pref='+Constants.prefsXLIcon()+'&val='+(show?'show':'hide'),onSuccess:function(request){xLinks.handlePref(request,show,null);}});_ajax.send();}else{if(!show){Cookie.createCookie(_cookieName,1,1);}
self.handlePref(false,show,null);}
if(show&&!Flow.loggedIn()){Cookie.eraseCookie(_cookieName);}},setAction:function(newTab){_newTab=newTab=!!newTab;_update();if(Flow.loggedIn()){_ajax.updateOptions({parameters:'pref='+Constants.prefsXL()+'&val='+(newTab?"new":"same"),onSuccess:function(request){xLinks.handlePref(request,null,newTab);}});_ajax.send();Cookie.eraseCookie(_cookieNameTab);_prefTab.update(newTab?1:0);}else{if(newTab){Cookie.eraseCookie(_cookieNameTab);}
else{Cookie.createCookie(_cookieNameTab,1,30);}
self.handlePref(false,null,newTab);}},handlePref:function(request,show,newTab){var resp=request?JSON.parse(request.responseText):{y:1},msg=show===null?'External links will now open in '+(newTab?"a new":"the same")+' tab/window.':'External link indicator icons are now '+(show?'shown':'hidden')+'.';if(resp.y){statusBar.talk(msg);}
else{statusBar.error('External link '+(show===null?'behavior':'icon')+' preference not saved successfully.');}},attach:function(node){if(_links===false){_links=[];}
_links.push(node);_updateOne(node);}};window.addLoad(self.setup);return self;}();var Hash=function(){var _hash,_delim="#$",_startScroll=function(){var anchor=self.get('scroll');if(anchor&&anchor.length>0){self.scroll(anchor);}},_makeObject=function(){var i,tmp,arr=window.location.hash.replace(_delim,'').split('&');_hash={};for(i=0;i<arr.length;++i){if(arr[i].length>3){tmp=arr[i].split('=');_hash[tmp[0]]=isset(typeof(tmp[1]))?tmp[1]:true;}}},_save=function(){var hash=_delim,key;for(key in _hash){if(_hash.hasOwnProperty(key)){hash+=key+'='+_hash[key]+'&';}}
if(window.location.hash.length>1){window.location.hash=hash.length>2?hash.substring(0,-1):hash;}},self={get:function(name){if(typeof(name)==="number"){name=String(name);}
if(typeof(name)==="string"){name=name.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");}else{name='';}
if(name.length>0){var regexS="[\\"+_delim+"&]"+name+"([=]?)([^&]*)",results=new RegExp(regexS).exec(window.location.hash);if(results!==null){results=+results[2]+""===results[2]?+results[2]:results[2]==="true"?true:results[2]==="false"?false:results[1]===""?true:results[2];}}
return name.length>0?results:null;},set:function(name,value){if(typeof(name)==="number"){name=String(name);}
if(typeof(name)==="string"){if(window.location.hash===""||window.location.hash==="#"){window.location.hash=_delim+name+"="+value;_hash={};}else{_makeObject();_hash[name]=value;_save();}
_hash[name]=value;}},erase:function(name){if(typeof(name)==="number"){name=String(name);}
if(typeof(name)==="string"){_makeObject();delete(_hash[name]);_save();}},scroll:function(anchor){var hash=window.location.hash;window.location.hash='#'+anchor;window.location.hash=hash;self.set('scroll',anchor);},clear:function(){if(window.location.hash.length>0){window.location.hash="#";}
_hash={};}};window.addLoad(_startScroll);return self;}();var licFunc=function(){var lic=$('mmL_license'),licD=$('licPopup'),licCL=$('licCloseL'),licCR=$('licCloseR'),mac=BrowserDetect.OS.toLowerCase()==="mac"?1:0,toShow;if(lic&&licD&&licCL&&licCR){lic.setClick(licD.show);toShow=!!mac?licCL:licCR;toShow.addEvent('mouseover',toShow.addClassName.bind(toShow,'closeHover'));toShow.addEvent('mouseout',toShow.removeClassName.bind(toShow,'closeHover'));lic.addClick(function(){var cf=licD.popup();toShow.show().setClick(cf);});}};window.addLoad(licFunc);var ranOnload=false;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){if(!ranOnload){ranOnload=true;startStack();}},false);}else if(document.all&&!window.opera){document.write("<scr"+"ipt id='DOMReady' defer=true "+"src=//:><\/scr"+"ipt>");document.getElementById("DOMReady").onreadystatechange=function(){if(this.readyState==="complete"&&!ranOnload){ranOnload=true;startStack();}};}
window.addLoad(function(){try{if(window.ie){var s=$("searchBar"),l=$("loginBar"),a=$("adminBar"),m=$("mainNav");if(s){s.show();}
if(l){l.show();}
if(a){a.show();}
if(m){m.show();}}}catch(e){}});var orgOnLoad=window.onload;window.onload=function(){if(typeof(orgOnLoad)==='function'){orgOnLoad();}
if(!ranOnload){ranOnload=true;startStack();}};function htmlentities(str){var div=document.createElement('div'),text=document.createTextNode(str);div.appendChild(text);return div.innerHTML;}
function unhtmlentities(htmlstr){var tarea=document.createElement('textarea');tarea.innerHTML=htmlstr;return tarea.value;}
function utf8_encode(str_data){str_data=str_data.toString().replace(/\r\n/g,"\n");var utftext="",n,c;for(n=0;n<str_data.length;++n){c=str_data.charCodeAt(n);if(c<128){utftext+=String.fromCharCode(c);}
else if((c>127)&&(c<2048)){utftext+=String.fromCharCode((c>>6)|192);utftext+=String.fromCharCode((c&63)|128);}else{utftext+=String.fromCharCode((c>>12)|224);utftext+=String.fromCharCode(((c>>6)&63)|128);utftext+=String.fromCharCode((c&63)|128);}}
return utftext;}
function utf8_decode(utftext){var string="",i,c,c1,c2,c3;i=c=c1=c2=c3=0;while(i<utftext.length){c=utftext.charCodeAt(i);if(c<128){string+=String.fromCharCode(c);++i;}else if((c>191)&&(c<224)){c2=utftext.charCodeAt(i+1);string+=String.fromCharCode(((c&31)<<6)|(c2&63));i+=2;}else{c2=utftext.charCodeAt(i+1);c3=utftext.charCodeAt(i+2);string+=String.fromCharCode(((c&15)<<12)|((c2&63)<<6)|(c3&63));i+=3;}}
return string;}
function sha1(str){str=utf8_encode(str);var rotate_left=function(n,s){return(n<<s)|(n>>>(32-s));},lsb_hex=function(val){var lstr="",i,vh,vl;for(i=0;i<=6;i+=2){vh=(val>>>(i*4+4))&0x0f;vl=(val>>>(i*4))&0x0f;lstr+=vh.toString(16)+vl.toString(16);}
return lstr;},cvt_hex=function(val){var cstr="",i,v;for(i=7;i>=0;--i){v=(val>>>(i*4))&0x0f;cstr+=v.toString(16);}
return cstr;},blockstart,i,j,W=[],H0=0x67452301,H1=0xEFCDAB89,H2=0x98BADCFE,H3=0x10325476,H4=0xC3D2E1F0,A,B,C,D,E,temp,str_len=str.length,word_array=[];for(i=0;i<str_len-3;i+=4){j=str.charCodeAt(i)<<24|str.charCodeAt(i+1)<<16|str.charCodeAt(i+2)<<8|str.charCodeAt(i+3);word_array.push(j);}
switch(str_len%4){case 0:i=0x080000000;break;case 1:i=str.charCodeAt(str_len-1)<<24|0x0800000;break;case 2:i=str.charCodeAt(str_len-2)<<24|str.charCodeAt(str_len-1)<<16|0x08000;break;case 3:i=str.charCodeAt(str_len-3)<<24|str.charCodeAt(str_len-2)<<16|str.charCodeAt(str_len-1)<<8|0x80;}
word_array.push(i);while((word_array.length%16)!==14){word_array.push(0);}
word_array.push(str_len>>>29);word_array.push((str_len<<3)&0x0ffffffff);for(blockstart=0;blockstart<word_array.length;blockstart+=16){for(i=0;i<16;++i){W[i]=word_array[blockstart+i];}
for(i=16;i<=79;++i){W[i]=rotate_left(W[i-3]^W[i-8]^W[i-14]^W[i-16],1);}
A=H0;B=H1;C=H2;D=H3;E=H4;for(i=0;i<=19;++i){temp=(rotate_left(A,5)+((B&C)|(~B&D))+E+W[i]+0x5A827999)&0x0ffffffff;E=D;D=C;C=rotate_left(B,30);B=A;A=temp;}
for(i=20;i<=39;++i){temp=(rotate_left(A,5)+(B^C^D)+E+W[i]+0x6ED9EBA1)&0x0ffffffff;E=D;D=C;C=rotate_left(B,30);B=A;A=temp;}
for(i=40;i<=59;++i){temp=(rotate_left(A,5)+((B&C)|(B&D)|(C&D))+E+W[i]+0x8F1BBCDC)&0x0ffffffff;E=D;D=C;C=rotate_left(B,30);B=A;A=temp;}
for(i=60;i<=79;++i){temp=(rotate_left(A,5)+(B^C^D)+E+W[i]+0xCA62C1D6)&0x0ffffffff;E=D;D=C;C=rotate_left(B,30);B=A;A=temp;}
H0=(H0+A)&0x0ffffffff;H1=(H1+B)&0x0ffffffff;H2=(H2+C)&0x0ffffffff;H3=(H3+D)&0x0ffffffff;H4=(H4+E)&0x0ffffffff;}
temp=cvt_hex(H0)+cvt_hex(H1)+cvt_hex(H2)+cvt_hex(H3)+cvt_hex(H4);return temp.toLowerCase();}
function isHostMethod(object,property){var t=typeof object[property];return t==='function'||!!(t==='object'&&object[property])||t==='unknown';}
function isHostCollection(object,property){var t=typeof object[property];return!!(t==='object'&&object[property])||t==='function';}
function isHostObject(object,property){return!!(typeof(object[property])==='object'&&object[property]);}
function isset(ref){return ref.toString?ref.toString().toLowerCase()!=="undefined":false;}
function ConsoleLog(){var i,msg="Console.Log:";for(i=0;i<arguments.length;++i){msg+="\n<br />"+(i+1)+": "+arguments[i];}
if(arguments.length>0){statusBar.error(msg);}
return arguments;}
var noIE6=function(){var div=document.createElement('a'),img=document.createElement('img'),id='saynotoie6_div_20081014';div.setAttribute('id',id);div.className="nolink";div.setAttribute('href','http://www.savethedevelopers.org/');div.setAttribute('target','_blank');div.style.display='block';div.style.color='#1D1D1D';div.style.fontSize='11px';div.style.padding='0';div.style.position='absolute';div.style.top='0';div.style.right='40px';div.style.zIndex='999999';div.style.width='330px';div.style.height='63px';div.style.marginTop='-80px';div.style.filter='alpha(opacity=95)';img.style.border=0;img.src="/images/noIE6.20081014.gif";img.setAttribute('src',img.src);div.appendChild(img);document.body.appendChild(div);var myDiv=document.getElementById(id),stdorg_hide=function(){var value=parseInt(myDiv.style.marginTop,10);myDiv.style.marginTop=value-1+'px';if(value-1>-80){setTimeout(stdorg_hide,1.4*80/Math.abs(value)*3.70);}},stdorg_animate=function(){var value=parseInt(myDiv.style.marginTop,10);myDiv.style.marginTop=value+1+'px';if(value+1<-1){setTimeout(stdorg_animate,30*80/Math.abs(value)*0.27);}
else{setTimeout(stdorg_hide,5000);}};if(parseInt(Cookie.readCookie("MixMatch_ie6"),10)!==1){setTimeout(stdorg_animate,1000);Cookie.createCookie("MixMatch_ie6",1,false,'');}};if(window.ie6){window.addLoad(noIE6);}
if(window.fluid){var fluidBadgeCount=function(){var fr=$('friendreqs_nav'),mb=$('mbox_nav'),frN=fr?fr.getElementsByClassName("number","span"):[],mbN=mb?mb.getElementsByClassName("number","span"):[],events=0;if(frN.length===1){events+=parseInt(frN[0].scan(true),10);}
if(mbN.length===1){events+=parseInt(mbN[0].scan(true),10);}
try{window.fluid.dockBadge=events>0?events:null;}catch(e){}};window.addLoad(fluidBadgeCount);}
try{if(!isset(typeof(VisualEvents))){var VisualEvents=[];}}catch(e){}
var niftyOk=(document.getElementById&&document.createElement&&Array.prototype.push);var niftyCss=false;function createEl(x){return(document.createElement(x));}
function addCSS(){if(!niftyCss){niftyCss=true;var l=createEl("link");l.setAttribute("type","text/css");l.setAttribute("rel","stylesheet");l.setAttribute("href",Constants.css()+"niftyCorners.css");l.setAttribute("media","screen");document.getElementsByTagName("head")[0].appendChild(l);}}
var oldonload=window.onload;if(typeof(niftyLoad)!='function'){niftyLoad=function(){};}
if(typeof(oldonload)=='function'){window.onload=function(){oldonload();addCSS();niftyLoad();};}
else{window.onload=function(){addCSS();niftyLoad();};}
function fixIE(el){if(el.currentStyle!=null&&el.currentStyle.hasLayout!=null&&el.currentStyle.hasLayout==false){el.style.display="inline-block";}}
function createStrip(index,side,color,border,btype,isTop){var x=createEl("b");x.className=btype+index+" "+((isTop)?"niftyTop":"niftyBottom");x.style.backgroundColor=color;try{x.style.borderColor=border;}catch(e){}
if(side=="left"){x.style.borderRightWidth="0";x.style.marginRight="0";}
else if(side=="right"){x.style.borderLeftWidth="0";x.style.marginLeft="0";}
return(x);}
function getBk(x){var c=getStyleProp(x,"backgroundColor");if(c===null||c=="transparent"||c.find("rgba(0, 0, 0, 0)")){return("transparent");}
if(c.find("rgb")){c=rgb2hex(c);}
return(c);}
function mix(c1,c2){var i,step1,step2,x,y,r=new Array(3);if(c1.length==4){step1=1;}else{step1=2;}
if(c2.length==4){step2=1;}else{step2=2;}
for(i=0;i<3;i++){x=parseInt(c1.substr(1+step1*i,step1),16);if(step1==1){x=16*x+x;}
y=parseInt(c2.substr(1+step2*i,step2),16);if(step2==1){y=16*y+y;}
r[i]=Math.floor((x*50+y*50)/100);r[i]=r[i].toString(16);if(r[i].length==1){r[i]="0"+r[i];}}
return("#"+r[0]+r[1]+r[2]);}
function addTop(el,side,options){var d=createEl("b"),lim=4,border="",p,i,btype="r",bk,color;d.style.marginLeft="-"+getPadding(el,"Left")+"px";d.style.marginRight="-"+getPadding(el,"Right")+"px";if(options.find("alias")||(color=getBk(el))=="transparent"){color="transparent";bk="transparent";border=getParentBk(el);btype="t";}
else{bk=getParentBk(el);border=mix(color,bk);}
d.style.background=bk;d.className="niftycorners";p=getPadding(el,"Top");if(options.find("small")){d.style.marginBottom=(p-2)+"px";btype+="s";lim=2;}
else if(options.find("big")){d.style.marginBottom=(p-10)+"px";btype+="b";lim=8;}
else{d.style.marginBottom=(p-5)+"px";}
for(i=1;i<=lim;++i){d.appendChild(createStrip(i,side,color,border,btype,true));}
el.style.paddingTop="0";el.insertBefore(d,el.firstChild);}
function addBottom(el,side,options){var d=createEl("b"),lim=4,border="",p,i,btype="r",bk,color;d.style.marginLeft="-"+getPadding(el,"Left")+"px";d.style.marginRight="-"+getPadding(el,"Right")+"px";if(options.find("alias")||(color=getBk(el))=="transparent"){color="transparent";bk="transparent";border=getParentBk(el);btype="t";}
else{bk=getParentBk(el);border=mix(color,bk);}
d.style.background=bk;d.className="niftycorners";p=getPadding(el,"Bottom");if(options.find("small")){d.style.marginTop=(p-2)+"px";btype+="s";lim=2;}
else if(options.find("big")){d.style.marginTop=(p-10)+"px";btype+="b";lim=8;}
else{d.style.marginTop=(p-5)+"px";}
for(i=lim;i>0;i--){d.appendChild(createStrip(i,side,color,border,btype,false));}
el.style.paddingBottom=0;el.appendChild(d);}
function toRounded(selector,options){var i,top="",bottom="",v=[];if(options!==""){options=options.replace("left","tl bl");options=options.replace("right","tr br");options=options.replace("top","tr tl");options=options.replace("bottom","br bl");options=options.replace("transparent","alias");if(options.find("tl")){top="both";if(!options.find("tr")){top="left";}}
else if(options.find("tr")){top="right";}
if(options.find("bl")){bottom="both";if(!options.find("br")){bottom="left";}}
else if(options.find("br")){bottom="right";}}
if(top===""&&bottom===""&&!options.find("none")){top="both";bottom="both";}
v=getElementsBySelector(selector);for(i=0;i<v.length;i++){fixIE(v[i]);if(top!==""){addTop(v[i],top,options);}
if(bottom!==""){addBottom(v[i],bottom,options);}}}
function doNifty(selector,options){if(niftyOk===false){return;}
if(niftyCss===false){addCSS();}
var i,v=(typeof selector=='object')?[selector]:selector.split(","),h=0;if(options==null){options="";}
options=new String(options);if(options.find("fixed-height")){h=getElementsBySelector(v[0])[0].offsetHeight;}
for(i=0;i<v.length;i++){toRounded(v[i],options);}
if(options.find("height")){sameHeight(selector,h);}}
function sameHeight(selector,maxh){var i,v=(typeof selector=='object')?[selector]:selector.split(","),t,j,els=[],gap;for(i=0;i<v.length;i++){t=getElementsBySelector(v[i]);els=els.concat(t);}
for(i=0;i<els.length;i++){if(els[i].offsetHeight>maxh){maxh=els[i].offsetHeight;}
els[i].style.height="auto";}
for(i=0;i<els.length;i++){gap=maxh-els[i].offsetHeight;if(gap>0){t=createEl("b");t.className="niftyfill";t.style.height=gap+"px";var nc=els[i].lastChild;if(nc.className=="niftycorners"){els[i].insertBefore(t,nc);}else{els[i].appendChild(t);}}}}
function getElementsBySelector(selector){if(typeof selector=='object')return[selector];var v,i,j,selid="",selclass="",tag=selector,tag2="",v2,k,f,a,s=[],objlist=[],c;if(selector.find("#")){if(selector.find(" ")){s=selector.split(" ");var fs=s[0].split("#");if(fs.length==1){return(objlist);}
f=document.getElementById(fs[1]);if(f){v=f.getElementsByTagName(s[1]);for(i=0;i<v.length;i++){objlist.push(v[i]);}}
return(objlist);}
else{s=selector.split("#");tag=s[0];selid=s[1];if(selid!=""){f=document.getElementById(selid);if(f){objlist.push(f);}
return(objlist);}}}
if(selector.find(".")){s=selector.split(".");tag=s[0];selclass=s[1];if(selclass.find(" ")){s=selclass.split(" ");selclass=s[0];tag2=s[1];}}
v=document.getElementsByTagName(tag);if(selclass==""){for(i=0;i<v.length;i++){objlist.push(v[i]);}
return(objlist);}
for(i=0;i<v.length;i++){c=v[i].className.split(" ");for(j=0;j<c.length;j++){if(c[j]==selclass){if(tag2==""){objlist.push(v[i]);}else{v2=v[i].getElementsByTagName(tag2);for(k=0;k<v2.length;k++){objlist.push(v2[k]);}}}}}
return(objlist);}
function getParentBk(x){var el=x.parentNode,c;while(el.tagName.toUpperCase()!="HTML"&&(c=getBk(el))=="transparent"){el=el.parentNode;}
if(c=="transparent"){c="#FFFFFF";}
return(c);}
function rgb2hex(value){var hex="",v,h,i;var regexp=/([0-9]+)[, ]+([0-9]+)[, ]+([0-9]+)/;h=regexp.exec(value);for(i=1;i<4;i++){v=parseInt(h[i],0).toString(16);if(v.length==1){hex+="0"+v;}else{hex+=v;}}
return("#"+hex);}
function getPadding(x,side){var p=getStyleProp(x,"padding"+side);if(p===null||!p.find("px")){return(0);}
return(parseInt(p,0));}
function getStyleProp(x,prop){if(x.currentStyle){return(x.currentStyle[prop]);}
if(document.defaultView.getComputedStyle){return(document.defaultView.getComputedStyle(x,'')[prop]);}
return(null);}
var WindowUtilities={getWindowScroll:function(){var w=window;var T,L,W,H;L=window.pageXOffset||document.documentElement.scrollLeft;T=window.pageYOffset||document.documentElement.scrollTop;if(window.ie){W=Math.max(document.documentElement.offsetWidth,document.documentElement.scrollWidth);}else if(window.khtml){W=document.body.scrollWidth;}else{W=document.documentElement.scrollWidth;}
if(window.ie){H=Math.max(document.documentElement.offsetHeight,document.documentElement.scrollHeight);}else if(window.khtml){H=document.body.scrollHeight;}else{H=document.documentElement.scrollHeight;}
return{top:T,left:L,width:W,height:H};},getPageSize:function(){var xScroll,yScroll;if(window.innerHeight&&window.scrollMaxY){xScroll=document.body.scrollWidth;yScroll=window.innerHeight+window.scrollMaxY;}else if(document.body.scrollHeight>document.body.offsetHeight){xScroll=document.body.scrollWidth;yScroll=document.body.scrollHeight;}else{xScroll=document.body.offsetWidth;yScroll=document.body.offsetHeight;}
var windowWidth,windowHeight;if(self.innerHeight){windowWidth=self.innerWidth;windowHeight=self.innerHeight;}else if(document.documentElement&&document.documentElement.clientHeight){windowWidth=document.documentElement.clientWidth;windowHeight=document.documentElement.clientHeight;}else if(document.body){windowWidth=document.body.clientWidth;windowHeight=document.body.clientHeight;}
var pageHeight,pageWidth;if(yScroll<windowHeight){pageHeight=windowHeight;}else{pageHeight=yScroll;}
if(xScroll<windowWidth){pageWidth=windowWidth;}else{pageWidth=xScroll;}
return{pageWidth:pageWidth,pageHeight:pageHeight,windowWidth:windowWidth,windowHeight:windowHeight};},disableScreen:function(className,overlayId,overlayOpacity,contentId){var that=this;WindowUtilities.initLightbox(overlayId,className,function(){that._disableScreen(className,overlayId,overlayOpacity,contentId);});},_disableScreen:function(className,overlayId,overlayOpacity,contentId){var objBody=document.body;var objOverlay=$(overlayId);var windowScroll=WindowUtilities.getWindowScroll();if(contentId&&window.ie){WindowUtilities._hideSelect();WindowUtilities._showSelect(contentId);}
var top=$('top');if(top){var rate=top.getElementsByClassName("unit-rating","ul")[0];if(rate){rate.cloak();}}
objOverlay.style.height=(windowScroll.height+'px');objOverlay.style.width=(windowScroll.width+'px');objOverlay.style.display='none';if(overlayId=="overlay_modal"&&window.hasEffectLib&&Windows.overlayShowEffectOptions){objOverlay.overlayOpacity=overlayOpacity;var obj=new Effect.Appear(objOverlay,Object.extend({from:0,to:overlayOpacity},Windows.overlayShowEffectOptions));}
else{objOverlay.style.display="block";}},enableScreen:function(id){id=id||'overlay_modal';var objOverlay=$(id);if(objOverlay){if(id=="overlay_modal"&&window.hasEffectLib&&Windows.overlayHideEffectOptions){var obj=new Effect.Fade(objOverlay,Object.extend({from:objOverlay.overlayOpacity,to:0},Windows.overlayHideEffectOptions));}else{objOverlay.style.display='none';objOverlay.parentNode.removeChild(objOverlay);}
if(id!="__invisible__"){WindowUtilities._showSelect();}
var top=$('top');if(top){var rate=top.getElementsByClassName("unit-rating","ul")[0];if(rate){rate.reveal();}}}},_hideSelect:function(id){if(window.ie){var root=(id)?$(id):document;var els=root.getElementsByTagName('select');if(els&&els.length){for(var i=0;i<els.length;i++){var element=els[i];if(!WindowUtilities.isDefined(element.oldVisibility)){element.oldVisibility=element.style.visibility?element.style.visibility:"visible";element.style.visibility="hidden";}}}}},_showSelect:function(id){if(window.ie){var root=(id)?$(id):document;var els=root.getElementsByTagName('select');if(els&&els.length){for(var i=0;i<els.length;i++){var element=els[i];if(WindowUtilities.isDefined(element.oldVisibility)){try{element.style.visibility=element.oldVisibility;}catch(e){element.style.visibility="visible";}
element.oldVisibility=null;}else{if(element.style.visibility){element.style.visibility="visible";}}}}}},isDefined:function(object){return typeof(object)!="undefined"&&object!==null;},initLightbox:function(id,className,doneHandler){if($(id)){$(id).style.zIndex=Windows.maxZIndex+999;Windows.maxZIndex++;doneHandler();}
else{var objBody=document.body;var objOverlay=document.createElement("div");objOverlay.setAttribute('id',id);objOverlay.className="overlay_"+className;objOverlay.style.display='none';objOverlay.style.position='absolute';objOverlay.style.top='0';objOverlay.style.left='0';objOverlay.style.zIndex=Windows.maxZIndex+999;++Windows.maxZIndex;objOverlay.style.width='100%';objBody.insertBefore(objOverlay,objBody.firstChild);if(window.khtml&&id=="overlay_modal"){setTimeout(function(){doneHandler();},10);}
else{doneHandler();}}},setCookie:function(value,parameters){document.cookie=parameters[0]+"="+encodeURIComponent(value)+
((parameters[1])?"; expires="+parameters[1].toGMTString():"")+
((parameters[2])?"; path="+parameters[2]:"")+
((parameters[3])?"; domain="+parameters[3]:"")+
((parameters[4])?"; secure":"");},getCookie:function(name){var dc=document.cookie;var prefix=name+"=";var begin=dc.indexOf("; "+prefix);if(begin==-1){begin=dc.indexOf(prefix);if(begin!==0){return null;}}else{begin+=2;}
var end=document.cookie.indexOf(";",begin);if(end==-1){end=dc.length;}
return unescape(dc.substring(begin+prefix.length,end));},_computeSize:function(content,id,width,height,margin,className){var objBody=document.body;var tmpObj=document.createElement("div");tmpObj.setAttribute('id',id);tmpObj.className=className+"_content";if(height){tmpObj.style.height=height+"px";}else{tmpObj.style.width=width+"px";}
tmpObj.style.position='absolute';tmpObj.style.top='0';tmpObj.style.left='0';tmpObj.style.display='none';tmpObj.update(content);objBody.insertBefore(tmpObj,objBody.firstChild);var size;if(height){size=$(id).getDimensions().width+margin;}else{size=$(id).getDimensions().height+margin;}
objBody.removeChild(tmpObj);return size;}};var Windows={maxZIndex:0};

var Window=new Class();Window.keepMultiModalWindow=false;Window.hasEffectLib=String.prototype.parseColor!==null;Window.resizeEffectDuration=0.4;Window.prototype={initialize:function(){var id;var optionIndex=0;if(arguments.length>0){if(typeof arguments[0]=="string"){id=arguments[0];optionIndex=1;}
else{id=arguments[0]?arguments[0].id:null;}}
if(!id){id="window_"+new Date().getTime();}
if($(id)){window.alert("Window "+id+" is already registered in the DOM! Make sure you use setDestroyOnClose() or destroyOnClose: true in the constructor");}
this.options=Object.extend({className:"dialog",minWidth:100,minHeight:20,resizable:true,closable:true,minimizable:true,maximizable:true,draggable:true,userData:null,showEffect:(Window.hasEffectLib?Effect.Appear:Element.show),hideEffect:(Window.hasEffectLib?Effect.Fade:Element.hide),showEffectOptions:{},hideEffectOptions:{},effectOptions:null,parent:document.body,title:"&nbsp;",url:null,onload:function(){},width:200,height:300,opacity:1,recenterAuto:true,wiredDrag:false,closeCallback:null,destroyOnClose:false,gridX:1,gridY:1},arguments[optionIndex]||{});if(typeof this.options.top=="undefined"&&typeof this.options.bottom=="undefined"){this.options.top=this._round(Math.random()*500,this.options.gridY);}
if(typeof this.options.left=="undefined"&&typeof this.options.right=="undefined"){this.options.left=this._round(Math.random()*500,this.options.gridX);}
if(this.options.effectOptions){Object.extend(this.options.hideEffectOptions,this.options.effectOptions);Object.extend(this.options.showEffectOptions,this.options.effectOptions);if(this.options.showEffect==Element.Appear){this.options.showEffectOptions.to=this.options.opacity;}}
if(Window.hasEffectLib){if(this.options.showEffect==Effect.Appear){this.options.showEffectOptions.to=this.options.opacity;}
if(this.options.hideEffect==Effect.Fade){this.options.hideEffectOptions.from=this.options.opacity;}}
if(this.options.hideEffect==Element.hide){this.options.hideEffect=function(){Element.hide(this.element);if(this.options.destroyOnClose){this.destroy();}}.bind(this);}
if(this.options.parent!=document.body){this.options.parent=$(this.options.parent);}
this.element=this._createWindow(id);this.eventMouseDown=this._initDrag.bindAsEventListener(this);this.eventMouseUp=this._endDrag.bindAsEventListener(this);this.eventMouseMove=this._updateDrag.bindAsEventListener(this);this.eventOnLoad=this._getWindowBorderSize.bindAsEventListener(this);this.eventMouseDownContent=this.toFront.bindAsEventListener(this);this.eventResize=this._recenter.bindAsEventListener(this);this.topbar=$(this.element.id+"_top");this.bottombar=$(this.element.id+"_bottom");this.content=$(this.element.id+"_content");Event.observe(this.topbar,"mousedown",this.eventMouseDown);Event.observe(this.bottombar,"mousedown",this.eventMouseDown);Event.observe(this.content,"mousedown",this.eventMouseDownContent);Event.observe(window,"load",this.eventOnLoad);Event.observe(window,"resize",this.eventResize);Event.observe(window,"scroll",this.eventResize);if(this.options.draggable){var that=this;[this.topbar,this.topbar.up().previous(),this.topbar.up().next()].each(function(element){element.observe("mousedown",that.eventMouseDown);element.addClassName("top_draggable");});[this.bottombar.up(),this.bottombar.up().previous(),this.bottombar.up().next()].each(function(element){element.observe("mousedown",that.eventMouseDown);element.addClassName("bottom_draggable");});}
if(this.options.resizable){this.sizer=$(this.element.id+"_sizer");Event.observe(this.sizer,"mousedown",this.eventMouseDown);}
this.useLeft=null;this.useTop=null;if(typeof this.options.left!="undefined"){this.element.setStyle({left:parseFloat(this.options.left)+'px'});this.useLeft=true;}
else{this.element.setStyle({right:parseFloat(this.options.right)+'px'});this.useLeft=false;}
if(typeof this.options.top!="undefined"){this.element.setStyle({top:parseFloat(this.options.top)+'px'});this.useTop=true;}
else{this.element.setStyle({bottom:parseFloat(this.options.bottom)+'px'});this.useTop=false;}
this.storedLocation=null;this.setOpacity(this.options.opacity);if(this.options.zIndex){this.setZIndex(this.options.zIndex);}
if(this.options.destroyOnClose){this.setDestroyOnClose(true);}
this._getWindowBorderSize();this.width=this.options.width;this.height=this.options.height;this.visible=false;this.constraint=false;this.constraintPad={top:0,left:0,bottom:0,right:0};if(this.width&&this.height){this.setSize(this.options.width,this.options.height);}
this.setTitle(this.options.title);Windows.register(this);},destroy:function(){this._notify("onDestroy");Event.stopObserving(this.topbar,"mousedown",this.eventMouseDown);Event.stopObserving(this.bottombar,"mousedown",this.eventMouseDown);Event.stopObserving(this.content,"mousedown",this.eventMouseDownContent);Event.stopObserving(window,"load",this.eventOnLoad);Event.stopObserving(window,"resize",this.eventResize);Event.stopObserving(window,"scroll",this.eventResize);Event.stopObserving(this.content,"load",this.options.onload);if(this._oldParent){var content=this.getContent();var originalContent=null;for(var i=0;i<content.childNodes.length;i++){originalContent=content.childNodes[i];if(originalContent.nodeType==1){break;}
originalContent=null;}
if(originalContent){this._oldParent.appendChild(originalContent);}
this._oldParent=null;}
if(this.sizer){Event.stopObserving(this.sizer,"mousedown",this.eventMouseDown);}
if(this.options.url){this.content.src=null;}
if(this.iefix){Element.remove(this.iefix);}
Element.remove(this.element);Windows.unregister(this);},setCloseCallback:function(callback){this.options.closeCallback=callback;},getContent:function(){return this.content;},setContent:function(id,autoresize,autoposition){var element=$(id);if(element==null){throw"Unable to find element '"+id+"' in DOM";}
this._oldParent=element.parentNode;var d=null;var p=null;if(autoresize){d=Element.getDimensions(element);}
if(autoposition){p=Position.cumulativeOffset(element);}
var content=this.getContent();this.setHTMLContent("");content=this.getContent();content.appendChild(element);element.show();if(autoresize){this.setSize(d.width,d.height);}
if(autoposition){this.setLocation(p[1]-this.heightN,p[0]-this.widthW);}},setHTMLContent:function(html){if(this.options.url){this.content.src=null;this.options.url=null;var content="<div id=\""+this.getId()+"_content\" class=\""+this.options.className+"_content\"> </div>";$(this.getId()+"_table_content").update(content);this.content=$(this.element.id+"_content");}
this.getContent().update(html);},setAjaxContent:function(url,options,showCentered,showModal){this.showFunction=showCentered?"showCenter":"show";this.showModal=showModal||false;options=options||{};this.setHTMLContent("");this.onComplete=options.onComplete;if(!this._onCompleteHandler)
{this._onCompleteHandler=this._setAjaxContent.bind(this);}
options.onComplete=this._onCompleteHandler;var a=new Ajax.Request(url,options);options.onComplete=this.onComplete;},_setAjaxContent:function(originalRequest){Element.update(this.getContent(),originalRequest.responseText);if(this.onComplete)
{this.onComplete(originalRequest);}
this.onComplete=null;this[this.showFunction](this.showModal);},setURL:function(url){if(this.options.url)
{this.content.src=null;}
this.options.url=url;var content="<iframe frameborder='0' name='"+this.getId()+"_content'  id='"+this.getId()+"_content' src='"+url+"' width='"+this.width+"' height='"+this.height+"'> </iframe>";$(this.getId()+"_table_content").update(content);this.content=$(this.element.id+"_content");},getURL:function(){return this.options.url?this.options.url:null;},refresh:function(){if(this.options.url)
{$(this.element.getAttribute('id')+'_content').src=this.options.url;}},setCookie:function(name,expires,path,domain,secure){name=name||this.element.id;this.cookie=[name,expires,path,domain,secure];var value=WindowUtilities.getCookie(name);if(value){var values=value.split(',');var x=values[0].split(':');var y=values[1].split(':');var w=parseFloat(values[2]),h=parseFloat(values[3]);var mini=values[4];var maxi=values[5];this.setSize(w,h);if(mini=="true")
{this.doMinimize=true;}
else if(maxi=="true")
{this.doMaximize=true;}
this.useLeft=x[0]=="l";this.useTop=y[0]=="t";this.element.setStyle(this.useLeft?{left:x[1]}:{right:x[1]});this.element.setStyle(this.useTop?{top:y[1]}:{bottom:y[1]});}},getId:function(){return this.element.id;},setDestroyOnClose:function(){this.options.destroyOnClose=true;},setConstraint:function(bool,padding){this.constraint=bool;this.constraintPad=Object.extend(this.constraintPad,padding||{});if(this.useTop&&this.useLeft)
{this.setLocation(parseFloat(this.element.style.top),parseFloat(this.element.style.left));}},_initDrag:function(event){if(Event.element(event)==this.sizer&&this.isMinimized())
{return;}
if(Event.element(event)!=this.sizer&&this.isMaximized())
{return;}
if(window.ie&&this.heightN==0)
{this._getWindowBorderSize();}
this.pointer=[this._round(Event.pointerX(event),this.options.gridX),this._round(Event.pointerY(event),this.options.gridY)];if(this.options.wiredDrag)
{this.currentDrag=this._createWiredElement();}
else
{this.currentDrag=this.element;}
if(Event.element(event)==this.sizer){this.doResize=true;this.widthOrg=this.width;this.heightOrg=this.height;this.bottomOrg=parseFloat(this.element.getStyle('bottom'));this.rightOrg=parseFloat(this.element.getStyle('right'));this._notify("onStartResize");}
else{this.doResize=false;var closeButton=$(this.getId()+'_close');if(closeButton&&Position.within(closeButton,this.pointer[0],this.pointer[1])){this.currentDrag=null;return;}
this.toFront();if(!this.options.draggable)
{return;}
this._notify("onStartMove");}
Event.observe(document,"mouseup",this.eventMouseUp,false);Event.observe(document,"mousemove",this.eventMouseMove,false);WindowUtilities.disableScreen('__invisible__','__invisible__',this.overlayOpacity);document.body.ondrag=function(){return false;};document.body.onselectstart=function(){return false;};this.currentDrag.show();Event.stop(event);},_round:function(val,round){return round==1?val:val=Math.floor(val/round)*round;},_updateDrag:function(event){var pointer=[this._round(Event.pointerX(event),this.options.gridX),this._round(Event.pointerY(event),this.options.gridY)];var dx=pointer[0]-this.pointer[0];var dy=pointer[1]-this.pointer[1];if(this.doResize){var w=this.widthOrg+dx;var h=this.heightOrg+dy;dx=this.width-this.widthOrg;dy=this.height-this.heightOrg;if(this.useLeft)
{w=this._updateWidthConstraint(w);}
else
{this.currentDrag.setStyle({right:(this.rightOrg-dx)+'px'});}
if(this.useTop)
{h=this._updateHeightConstraint(h);}
else
{this.currentDrag.setStyle({bottom:(this.bottomOrg-dy)+'px'});}
this.setSize(w,h);this._notify("onResize");}
else{this.pointer=pointer;if(this.useLeft){var left=parseFloat(this.currentDrag.getStyle('left'))+dx;var newLeft=this._updateLeftConstraint(left);this.pointer[0]+=newLeft-left;this.currentDrag.setStyle({left:newLeft+'px'});}
else
{this.currentDrag.setStyle({right:parseFloat(this.currentDrag.getStyle('right'))-dx+'px'});}
if(this.useTop){var top=parseFloat(this.currentDrag.getStyle('top'))+dy;var newTop=this._updateTopConstraint(top);this.pointer[1]+=newTop-top;this.currentDrag.setStyle({top:newTop+'px'});}
else
{this.currentDrag.setStyle({bottom:parseFloat(this.currentDrag.getStyle('bottom'))-dy+'px'});}
this._notify("onMove");}
if(this.iefix)
{this._fixIEOverlapping();}
this._removeStoreLocation();Event.stop(event);},_endDrag:function(event){WindowUtilities.enableScreen('__invisible__');if(this.doResize)
{this._notify("onEndResize");}
else
{this._notify("onEndMove");}
Event.stopObserving(document,"mouseup",this.eventMouseUp,false);Event.stopObserving(document,"mousemove",this.eventMouseMove,false);Event.stop(event);this._hideWiredElement();this._saveCookie();document.body.ondrag=null;document.body.onselectstart=null;},_updateLeftConstraint:function(left){if(this.constraint&&this.useLeft&&this.useTop){var width=this.options.parent==document.body?WindowUtilities.getPageSize().windowWidth:this.options.parent.getDimensions().width;if(left<this.constraintPad.left)
{left=this.constraintPad.left;}
if(left+this.width+this.widthE+this.widthW>width-this.constraintPad.right)
{left=width-this.constraintPad.right-this.width-this.widthE-this.widthW;}}
return left;},_updateTopConstraint:function(top){if(this.constraint&&this.useLeft&&this.useTop){var height=this.options.parent==document.body?WindowUtilities.getPageSize().windowHeight:this.options.parent.getDimensions().height;var h=this.height+this.heightN+this.heightS;if(top<this.constraintPad.top)
{top=this.constraintPad.top;}
if(top+h>height-this.constraintPad.bottom)
{top=height-this.constraintPad.bottom-h;}}
return top;},_updateWidthConstraint:function(w){if(this.constraint&&this.useLeft&&this.useTop){var width=this.options.parent==document.body?WindowUtilities.getPageSize().windowWidth:this.options.parent.getDimensions().width;var left=parseFloat(this.element.getStyle("left"));if(left+w+this.widthE+this.widthW>width-this.constraintPad.right)
{w=width-this.constraintPad.right-left-this.widthE-this.widthW;}}
return w;},_updateHeightConstraint:function(h){if(this.constraint&&this.useLeft&&this.useTop){var height=this.options.parent==document.body?WindowUtilities.getPageSize().windowHeight:this.options.parent.getDimensions().height;var top=parseFloat(this.element.getStyle("top"));if(top+h+this.heightN+this.heightS>height-this.constraintPad.bottom)
{h=height-this.constraintPad.bottom-top-this.heightN-this.heightS;}}
return h;},_createWindow:function(id){var className=this.options.className;var win=document.createElement("div");win.setAttribute('id',id);win.className="dialog";var content;if(this.options.url)
{content="<iframe frameborder=\"0\" name=\""+id+"_content\"  id=\""+id+"_content\" src=\""+this.options.url+"\"> </iframe>";}
else
{content="<div id=\""+id+"_content\" class=\""+className+"_content\"> </div>";}
var closeDiv=this.options.closable?"<div class='"+className+"_close' id='"+id+"_close' onclick='Windows.close(\""+id+"\", event)'> </div>":"";var minDiv=this.options.minimizable?"<div class='"+className+"_minimize' id='"+id+"_minimize' onclick='Windows.minimize(\""+id+"\", event)'> </div>":"";var maxDiv=this.options.maximizable?"<div class='"+className+"_maximize' id='"+id+"_maximize' onclick='Windows.maximize(\""+id+"\", event)'> </div>":"";var seAttributes=this.options.resizable?"class='"+className+"_sizer' id='"+id+"_sizer'":"class='"+className+"_se'";var blank="../themes/default/blank.gif";win.update(closeDiv+minDiv+maxDiv+"\n<table id='"+id+"_row1' class=\"top table_window\">\n        <tr>\n          <td class='"+className+"_nw'></td>\n          <td class='"+className+"_n'><div id='"+id+"_top' class='"+className+"_title title_window'>"+this.options.title+"</div></td>\n          <td class='"+className+"_ne'></td>\n        </tr>\n      </table>\n      <table id='"+id+"_row2' class=\"mid table_window\">\n        <tr>\n          <td class='"+className+"_w'></td>\n            <td id='"+id+"_table_content' class='"+className+"_content' valign='top'>"+content+"</td>\n          <td class='"+className+"_e'></td>\n        </tr>\n      </table>\n        <table id='"+id+"_row3' class=\"bot table_window\">\n        <tr>\n          <td class='"+className+"_sw'></td>\n            <td class='"+className+"_s'><div id='"+id+"_bottom' class='status_bar'><span style='float:left; width:1px; height:1px'></span></div></td>\n            <td "+seAttributes+"></td>\n        </tr>\n      </table>");Element.hide(win);this.options.parent.insertBefore(win,this.options.parent.firstChild);Event.observe($(id+"_content"),"load",this.options.onload);return win;},changeClassName:function(newClassName){var className=this.options.className;var id=this.getId();var win=this;$A(["_close","_minimize","_maximize","_sizer","_content"]).each(function(value){win._toggleClassName($(id+value),className+value,newClassName+value);});$$("#"+id+" td").each(function(td){td.className=td.className.sub(className,newClassName);});this.options.className=newClassName;},_toggleClassName:function(element,oldClassName,newClassName){if(element){element.removeClassName(oldClassName);element.addClassName(newClassName);}},setLocation:function(top,left){top=this._updateTopConstraint(top);left=this._updateLeftConstraint(left);var e=this.currentDrag||this.element;e.setStyle({top:top+'px'});e.setStyle({left:left+'px'});this.useLeft=true;this.useTop=true;},getLocation:function(){var location={};if(this.useTop)
{location=Object.extend(location,{top:this.element.getStyle("top")});}
else
{location=Object.extend(location,{bottom:this.element.getStyle("bottom")});}
if(this.useLeft)
{location=Object.extend(location,{left:this.element.getStyle("left")});}
else
{location=Object.extend(location,{right:this.element.getStyle("right")});}
return location;},getSize:function(){return{width:this.width,height:this.height};},setSize:function(width,height,useEffect){width=parseFloat(width);height=parseFloat(height);if(!this.minimized&&width<this.options.minWidth)
{width=this.options.minWidth;}
if(!this.minimized&&height<this.options.minHeight)
{height=this.options.minHeight;}
if(this.options.maxHeight&&height>this.options.maxHeight)
{height=this.options.maxHeight;}
if(this.options.maxWidth&&width>this.options.maxWidth)
{width=this.options.maxWidth;}
if(this.useTop&&this.useLeft&&Window.hasEffectLib&&Effect.ResizeWindow&&useEffect){var ef=new Effect.ResizeWindow(this,null,null,width,height,{duration:Window.resizeEffectDuration});}else{this.width=width;this.height=height;var e=this.currentDrag?this.currentDrag:this.element;e.setStyle({width:width+this.widthW+this.widthE+"px"});e.setStyle({height:height+this.heightN+this.heightS+"px"});if(!this.currentDrag||this.currentDrag==this.element){var content=$(this.element.id+'_content');content.setStyle({height:height+'px'});content.setStyle({width:width+'px'});}}},updateHeight:function(){this.setSize(this.width,this.content.scrollHeight,true);},updateWidth:function(){this.setSize(this.content.scrollWidth,this.height,true);},toFront:function(){if(this.element.style.zIndex<Windows.maxZIndex)
{this.setZIndex(Windows.maxZIndex+1);}
this._notify("onFocus");if(this.iefix)
{this._fixIEOverlapping();}},show:function(modal){if(modal){if(typeof this.overlayOpacity=="undefined"){var that=this;setTimeout(function(){that.show(modal);},10);return;}
Windows.addModalWindow(this);this.modal=true;this.setZIndex(Windows.maxZIndex+1);Windows.unsetOverflow(this);}
else{if(!this.element.style.zIndex)
{this.setZIndex(Windows.maxZIndex+++1);}}
if(this.oldStyle)
{this.getContent().setStyle({overflow:this.oldStyle});}
if(!this.width||!this.height){var size=WindowUtilities._computeSize(this.content.scan(),this.content.id,this.width,this.height,0,this.options.className);if(this.height)
{this.width=size+5;}
else
{this.height=size+5;}}
this.setSize(this.width,this.height);if(this.centered)
{this._center(this.centerTop,this.centerLeft);}
this._notify("onBeforeShow");if(this.options.showEffect!=Element.show&&this.options.showEffectOptions)
{this.options.showEffect(this.element,this.options.showEffectOptions);}
else
{this.options.showEffect(this.element);}
this._checkIEOverlapping();this.visible=true;WindowUtilities.focusedWindow=this;this._notify("onShow");},showCenter:function(modal,top,left){this.centered=true;this.centerTop=top;this.centerLeft=left;this.show(modal);},isVisible:function(){return this.visible;},_center:function(top,left){var windowScroll=WindowUtilities.getWindowScroll();var pageSize=WindowUtilities.getPageSize();if(typeof top=="undefined")
{top=(pageSize.windowHeight-(this.height+this.heightN+this.heightS))/2;}
top+=windowScroll.top;if(typeof left=="undefined")
{left=(pageSize.windowWidth-(this.width+this.widthW+this.widthE))/2;}
left+=windowScroll.left;this.setLocation(top,left);this.toFront();},_recenter:function(event){if(this.centered){var pageSize=WindowUtilities.getPageSize();if(this.pageSize&&this.pageSize.windowWidth==pageSize.windowWidth&&this.pageSize.windowHeight==pageSize.windowHeight)
{return;}
this.pageSize=pageSize;var om=$('overlay_modal');if(om)
{om.setStyle({height:(pageSize.pageHeight+'px')});}
if(this.options.recenterAuto)
{this._center(this.centerTop,this.centerLeft);}}},hide:function(){this.visible=false;if(this.modal){Windows.removeModalWindow(this);Windows.resetOverflow();}
this.oldStyle=this.getContent().getStyle('overflow')||"auto";this.getContent().setStyle({overflow:"hidden"});this.options.hideEffect(this.element,this.options.hideEffectOptions);if(this.iefix)
{this.iefix.hide();}
if(!this.doNotNotifyHide)
{this._notify("onHide");}},close:function(){if(this.visible){if(this.options.closeCallback&&!this.options.closeCallback(this))
{return;}
if(this.options.destroyOnClose){var destroyFunc=this.destroy.bind(this);if(this.options.hideEffectOptions.afterFinish){var func=this.options.hideEffectOptions.afterFinish;this.options.hideEffectOptions.afterFinish=function(){func();destroyFunc();};}
else
{this.options.hideEffectOptions.afterFinish=function(){destroyFunc();};}}
Windows.updateFocusedWindow();this.doNotNotifyHide=true;this.hide();this.doNotNotifyHide=false;this._notify("onClose");}},minimize:function(){if(this.resizing)
{return;}
var r2=$(this.getId()+"_row2"),dh;if(!this.minimized){this.minimized=true;dh=r2.getDimensions().height;this.r2Height=dh;var h=this.element.getHeight()-dh;if(this.useLeft&&this.useTop&&Window.hasEffectLib&&Effect.ResizeWindow){var eft1=new Effect.ResizeWindow(this,null,null,null,this.height-dh,{duration:Window.resizeEffectDuration});}else{this.height-=dh;this.element.setStyle({height:h+"px"});r2.hide();}
if(!this.useTop){var bottom=parseFloat(this.element.getStyle('bottom'));this.element.setStyle({bottom:(bottom+dh)+'px'});}}
else{this.minimized=false;dh=this.r2Height;this.r2Height=null;if(this.useLeft&&this.useTop&&Window.hasEffectLib&&Effect.ResizeWindow){var eft2=new Effect.ResizeWindow(this,null,null,null,this.height+dh,{duration:Window.resizeEffectDuration});}
else{var h2=this.element.getHeight()+dh;this.height+=dh;this.element.setStyle({height:h2+"px"});r2.show();}
if(!this.useTop){var bottom2=parseFloat(this.element.getStyle('bottom'));this.element.setStyle({bottom:(bottom2-dh)+'px'});}
this.toFront();}
this._notify("onMinimize");this._saveCookie();},maximize:function(){if(this.isMinimized()||this.resizing)
{return;}
if(window.ie&&this.heightN==0)
{this._getWindowBorderSize();}
if(this.storedLocation!=null){this._restoreLocation();if(this.iefix)
{this.iefix.hide();}}
else{this._storeLocation();Windows.unsetOverflow(this);var windowScroll=WindowUtilities.getWindowScroll();var pageSize=WindowUtilities.getPageSize();var left=windowScroll.left;var top=windowScroll.top;if(this.options.parent!=document.body){windowScroll={top:0,left:0,bottom:0,right:0};var dim=this.options.parent.getDimensions();pageSize.windowWidth=dim.width;pageSize.windowHeight=dim.height;top=0;left=0;}
if(this.constraint){pageSize.windowWidth-=Math.max(0,this.constraintPad.left)+Math.max(0,this.constraintPad.right);pageSize.windowHeight-=Math.max(0,this.constraintPad.top)+Math.max(0,this.constraintPad.bottom);left+=Math.max(0,this.constraintPad.left);top+=Math.max(0,this.constraintPad.top);}
var width=pageSize.windowWidth-this.widthW-this.widthE;var height=pageSize.windowHeight-this.heightN-this.heightS;if(this.useLeft&&this.useTop&&Window.hasEffectLib&&Effect.ResizeWindow){var eft3=new Effect.ResizeWindow(this,top,left,width,height,{duration:Window.resizeEffectDuration});}
else{this.setSize(width,height);this.element.setStyle(this.useLeft?{left:left}:{right:left});this.element.setStyle(this.useTop?{top:top}:{bottom:top});}
this.toFront();if(this.iefix)
{this._fixIEOverlapping();}}
this._notify("onMaximize");this._saveCookie();},isMinimized:function(){return this.minimized;},isMaximized:function(){return(this.storedLocation!=null);},setOpacity:function(opacity){if(Element.setOpacity)
{Element.setOpacity(this.element,opacity);}},setZIndex:function(zindex){this.element.setStyle({zIndex:zindex});Windows.updateZindex(zindex,this);},setTitle:function(newTitle){if(!newTitle||newTitle=="")
{newTitle="&nbsp;";}
Element.update(this.element.id+'_top',newTitle);},setStatusBar:function(element){var statusBar=$(this.getId()+"_bottom");if(typeof(element)=="object"){if(this.bottombar.firstChild)
{this.bottombar.replaceChild(element,this.bottombar.firstChild);}
else
{this.bottombar.appendChild(element);}}
else
{this.bottombar.update(element);}},_checkIEOverlapping:function(){if(!this.iefix&&(navigator.appVersion.indexOf('MSIE')>0)&&(navigator.userAgent.indexOf('Opera')<0)&&(this.element.getStyle('position')=='absolute')){var ins=new Insertion.After(this.element.id,'<iframe id="'+this.element.id+'_iefix" '+'style="display:none;position:absolute;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);" '+'src="javascript:false;" frameborder="0" scrolling="no"></iframe>');this.iefix=$(this.element.id+'_iefix');}
if(this.iefix)
{setTimeout(this._fixIEOverlapping.bind(this),50);}},_fixIEOverlapping:function(){Position.clone(this.element,this.iefix);this.iefix.style.zIndex=this.element.style.zIndex-1;this.iefix.show();},_getWindowBorderSize:function(event){var div=this._createHiddenDiv(this.options.className+"_n");this.heightN=Element.getDimensions(div).height;div.parentNode.removeChild(div);var div2=this._createHiddenDiv(this.options.className+"_s");this.heightS=Element.getDimensions(div2).height;div2.parentNode.removeChild(div2);var div3=this._createHiddenDiv(this.options.className+"_e");this.widthE=Element.getDimensions(div3).width;div3.parentNode.removeChild(div3);var div4=this._createHiddenDiv(this.options.className+"_w");this.widthW=Element.getDimensions(div4).width;div4.parentNode.removeChild(div4);var div5=document.createElement("div");div5.className="overlay_"+this.options.className;document.body.appendChild(div5);var that=this;setTimeout(function(){that.overlayOpacity=($(div).getStyle("opacity"));div.parentNode.removeChild(div);},10);if(window.ie){this.heightS=$(this.getId()+"_row3").getDimensions().height;this.heightN=$(this.getId()+"_row1").getDimensions().height;}
if(window.khtml&&!window.webkit)
{this.setSize(this.width,this.height);}
if(this.doMaximize)
{this.maximize();}
if(this.doMinimize)
{this.minimize();}},_createHiddenDiv:function(className){var objBody=document.body;var win=document.createElement("div");win.setAttribute('id',this.element.id+"_tmp");win.className=className;win.style.display='none';win.update();objBody.insertBefore(win,objBody.firstChild);return win;},_storeLocation:function(){if(this.storedLocation==null){this.storedLocation={useTop:this.useTop,useLeft:this.useLeft,top:this.element.getStyle('top'),bottom:this.element.getStyle('bottom'),left:this.element.getStyle('left'),right:this.element.getStyle('right'),width:this.width,height:this.height};}},_restoreLocation:function(){if(this.storedLocation!=null){this.useLeft=this.storedLocation.useLeft;this.useTop=this.storedLocation.useTop;if(this.useLeft&&this.useTop&&Window.hasEffectLib&&Effect.ResizeWindow)
{var eft4=new Effect.ResizeWindow(this,this.storedLocation.top,this.storedLocation.left,this.storedLocation.width,this.storedLocation.height,{duration:Window.resizeEffectDuration});}
else{this.element.setStyle(this.useLeft?{left:this.storedLocation.left}:{right:this.storedLocation.right});this.element.setStyle(this.useTop?{top:this.storedLocation.top}:{bottom:this.storedLocation.bottom});this.setSize(this.storedLocation.width,this.storedLocation.height);}
Windows.resetOverflow();this._removeStoreLocation();}},_removeStoreLocation:function(){this.storedLocation=null;},_saveCookie:function(){if(this.cookie){var value="";if(this.useLeft)
{value+="l:"+(this.storedLocation?this.storedLocation.left:this.element.getStyle('left'));}
else
{value+="r:"+(this.storedLocation?this.storedLocation.right:this.element.getStyle('right'));}
if(this.useTop)
{value+=",t:"+(this.storedLocation?this.storedLocation.top:this.element.getStyle('top'));}
else
{value+=",b:"+(this.storedLocation?this.storedLocation.bottom:this.element.getStyle('bottom'));}
value+=","+(this.storedLocation?this.storedLocation.width:this.width);value+=","+(this.storedLocation?this.storedLocation.height:this.height);value+=","+this.isMinimized();value+=","+this.isMaximized();WindowUtilities.setCookie(value,this.cookie);}},_createWiredElement:function(){if(!this.wiredElement){if(window.ie)
{this._getWindowBorderSize();}
var div=document.createElement("div");div.className="wired_frame "+this.options.className+"_wired_frame";div.style.position='absolute';this.options.parent.insertBefore(div,this.options.parent.firstChild);this.wiredElement=$(div);}
if(this.useLeft)
{this.wiredElement.setStyle({left:this.element.getStyle('left')});}
else
{this.wiredElement.setStyle({right:this.element.getStyle('right')});}
if(this.useTop)
{this.wiredElement.setStyle({top:this.element.getStyle('top')});}
else
{this.wiredElement.setStyle({bottom:this.element.getStyle('bottom')});}
var dim=this.element.getDimensions();this.wiredElement.setStyle({width:dim.width+"px",height:dim.height+"px"});this.wiredElement.setStyle({zIndex:Windows.maxZIndex+30});return this.wiredElement;},_hideWiredElement:function(){if(!this.wiredElement||!this.currentDrag)
{return;}
if(this.currentDrag==this.element)
{this.currentDrag=null;}
else{if(this.useLeft)
{this.element.setStyle({left:this.currentDrag.getStyle('left')});}
else
{this.element.setStyle({right:this.currentDrag.getStyle('right')});}
if(this.useTop)
{this.element.setStyle({top:this.currentDrag.getStyle('top')});}
else
{this.element.setStyle({bottom:this.currentDrag.getStyle('bottom')});}
this.currentDrag.hide();this.currentDrag=null;if(this.doResize)
{this.setSize(this.width,this.height);}}},_notify:function(eventName){if(this.options[eventName])
{this.options[eventName](this);}
else
{Windows.notify(eventName,this);}}};var Windows={windows:[],modalWindows:[],observers:[],focusedWindow:null,maxZIndex:0,overlayShowEffectOptions:{duration:0.5},overlayHideEffectOptions:{duration:0.5},addObserver:function(observer){this.removeObserver(observer);this.observers.push(observer);},removeObserver:function(observer){this.observers=this.observers.reject(function(o){return o==observer;});},notify:function(eventName,win){this.observers.each(function(o){if(o[eventName]){o[eventName](eventName,win);}});},getWindow:function(id){return this.windows.detect(function(d){return d.getId()==id;});},getFocusedWindow:function(){return this.focusedWindow;},updateFocusedWindow:function(){this.focusedWindow=this.windows.length>=2?this.windows[this.windows.length-2]:null;},register:function(win){this.windows.push(win);},addModalWindow:function(win){if(this.modalWindows.length==0)
{WindowUtilities.disableScreen(win.options.className,'overlay_modal',win.overlayOpacity,win.getId());}
else{if(Window.keepMultiModalWindow){$('overlay_modal').style.zIndex=Windows.maxZIndex+1;Windows.maxZIndex+=1;WindowUtilities._hideSelect(this.modalWindows.last().getId());}
else
{this.modalWindows.last().element.hide();}
WindowUtilities._showSelect(win.getId());}
this.modalWindows.push(win);},removeModalWindow:function(win){this.modalWindows.pop();if(this.modalWindows.length==0)
{WindowUtilities.enableScreen();}
else{if(Window.keepMultiModalWindow){this.modalWindows.last().toFront();WindowUtilities._showSelect(this.modalWindows.last().getId());}
else
{this.modalWindows.last().element.show();}}},register:function(win){this.windows.push(win);},unregister:function(win){this.windows=this.windows.reject(function(d){return d==win;});},closeAll:function(){this.windows.each(function(w){Windows.close(w.getId());});},closeAllModalWindows:function(){WindowUtilities.enableScreen();this.modalWindows.each(function(win){if(win){win.close();}});},minimize:function(id,event){var win=this.getWindow(id);if(win&&win.visible)
{win.minimize();}
Event.stop(event);},maximize:function(id,event){var win=this.getWindow(id);if(win&&win.visible)
{win.maximize();}
Event.stop(event);},close:function(id,event){var win=this.getWindow(id);if(win)
{win.close();}
if(event)
{Event.stop(event);}},unsetOverflow:function(except){this.windows.each(function(d){d.oldOverflow=d.getContent().getStyle("overflow")||"auto";d.getContent().setStyle({overflow:"hidden"});});if(except&&except.oldOverflow)
{except.getContent().setStyle({overflow:except.oldOverflow});}},resetOverflow:function(){this.windows.each(function(d){if(d.oldOverflow){d.getContent().setStyle({overflow:d.oldOverflow});}});},updateZindex:function(zindex,win){if(zindex>this.maxZIndex)
{this.maxZIndex=zindex;}
this.focusedWindow=win;}};var Dialog={dialogId:null,onCompleteFunc:null,callFunc:null,parameters:null,confirm:function(content,parameters){if(content&&typeof content!="string"){Dialog._runAjaxRequest(content,parameters,Dialog.confirm);return;}
content=content||"";parameters=parameters||{};var okLabel=parameters.okLabel?parameters.okLabel:"Ok";var cancelLabel=parameters.cancelLabel?parameters.cancelLabel:"Cancel";parameters=Object.extend(parameters,parameters.windowParameters||{});parameters.windowParameters=parameters.windowParameters||{};parameters.className=parameters.className||"alert";var okButtonClass="class ='"+(parameters.buttonClass?parameters.buttonClass+" ":"")+" ok_button'";var cancelButtonClass="class ='"+(parameters.buttonClass?parameters.buttonClass+" ":"")+" cancel_button'";var content="\n      <div class='"+parameters.className+"_message'>"+content+"</div>\n        <div class='"+parameters.className+"_buttons'>\n          <input type='button' value='"+okLabel+"' onclick='Dialog.okCallback()' "+okButtonClass+"/>\n          <input type='button' value='"+cancelLabel+"' onclick='Dialog.cancelCallback()' "+cancelButtonClass+"/>\n        </div>\n    ";return this._openDialog(content,parameters);},alert:function(content,parameters){if(content&&typeof content!="string"){Dialog._runAjaxRequest(content,parameters,Dialog.alert);return;}
content=content||"";parameters=parameters||{};var okLabel=parameters.okLabel?parameters.okLabel:"Ok";parameters=Object.extend(parameters,parameters.windowParameters||{});parameters.windowParameters=parameters.windowParameters||{};parameters.className=parameters.className||"alert";var okButtonClass="class ='"+(parameters.buttonClass?parameters.buttonClass+" ":"")+" ok_button'";var content="\n      <div class='"+parameters.className+"_message'>"+content+"</div>\n        <div class='"+parameters.className+"_buttons'>\n          <input type='button' value='"+okLabel+"' onclick='Dialog.okCallback()' "+okButtonClass+"/>\n        </div>";return this._openDialog(content,parameters);},info:function(content,parameters){if(content&&typeof content!="string"){Dialog._runAjaxRequest(content,parameters,Dialog.info);return;}
content=content||"";parameters=parameters||{};parameters=Object.extend(parameters,parameters.windowParameters||{});parameters.windowParameters=parameters.windowParameters||{};parameters.className=parameters.className||"alert";var content="<div id='modal_dialog_message' class='"+parameters.className+"_message'>"+content+"</div>";if(parameters.showProgress)
{content+="<div id='modal_dialog_progress' class='"+parameters.className+"_progress'>  </div>";}
parameters.ok=null;parameters.cancel=null;return this._openDialog(content,parameters);},setInfoMessage:function(message){$('modal_dialog_message').update(message);},closeInfo:function(){Windows.close(this.dialogId);},_openDialog:function(content,parameters){var className=parameters.className;if(!parameters.height&&!parameters.width){parameters.width=WindowUtilities.getPageSize().pageWidth/2;}
if(parameters.id)
{this.dialogId=parameters.id;}
else{var t=new Date();this.dialogId='modal_dialog_'+t.getTime();parameters.id=this.dialogId;}
if(!parameters.height||!parameters.width){var size=WindowUtilities._computeSize(content,this.dialogId,parameters.width,parameters.height,5,className);if(parameters.height)
{parameters.width=size+5;}
else
{parameters.height=size+5;}}
parameters.resizable=parameters.resizable||false;parameters.effectOptions=parameters.effectOptions;parameters.minimizable=false;parameters.maximizable=false;parameters.draggable=false;parameters.closable=false;var win=new Window(parameters);win.getContent().update(content);win.showCenter(true,parameters.top,parameters.left);win.setDestroyOnClose();win.cancelCallback=parameters.onCancel||parameters.cancel;win.okCallback=parameters.onOk||parameters.ok;return win;},_getAjaxContent:function(originalRequest){Dialog.callFunc(originalRequest.responseText,Dialog.parameters);},_runAjaxRequest:function(message,parameters,callFunc){if(message.options==null)
{message.options={};}
Dialog.onCompleteFunc=message.options.onComplete;Dialog.parameters=parameters;Dialog.callFunc=callFunc;message.options.onComplete=Dialog._getAjaxContent;var aj=new Ajax.Request(message.url,message.options);},okCallback:function(){var win=Windows.focusedWindow;if(!win.okCallback||win.okCallback(win)){$$("#"+win.getId()+" input").each(function(element){element.onclick=null;});win.close();}},cancelCallback:function(){var win=Windows.focusedWindow;$$("#"+win.getId()+" input").each(function(element){element.onclick=null;});win.close();if(win.cancelCallback)
{win.cancelCallback(win);}}};if(window.ActiveXObject){window.ie=window[window.XMLHttpRequest?'ie7':'ie6']=true;}
else if(document.childNodes&&!document.all&&!navigator.taintEnabled){window.khtml=true;}
else if(document.getBoxObjectFor!=null){window.gecko=true;}
do{var array=navigator.userAgent.match(new RegExp(/AppleWebKit\/([\d\.\+]*)/));window.webkit=array&&array.length==2?parseFloat(array[1])>=420:false;}while(false);var BrowserDetect=function(){var obj={},versionSearchString,dataBrowser=[{string:navigator.userAgent,subString:"OmniWeb",versionSearch:"OmniWeb/",identity:"OmniWeb"},{string:navigator.vendor,subString:"Apple",identity:"Safari"},{prop:window.opera,identity:"Opera"},{string:navigator.vendor,subString:"iCab",identity:"iCab"},{string:navigator.vendor,subString:"KDE",identity:"Konqueror"},{string:navigator.userAgent,subString:"Flock",identity:"Flock"},{string:navigator.userAgent,subString:"Firefox",identity:"Firefox"},{string:navigator.vendor,subString:"Camino",identity:"Camino"},{string:navigator.userAgent,subString:"Netscape",identity:"Netscape"},{string:navigator.userAgent,subString:"MSIE",identity:"Explorer",versionSearch:"MSIE"},{string:navigator.userAgent,subString:"Gecko",identity:"Mozilla",versionSearch:"rv"},{string:navigator.userAgent,subString:"Mozilla",identity:"Netscape",versionSearch:"Mozilla"}],dataOS=[{string:navigator.platform,subString:"iphone",identity:"iPhone"},{string:navigator.platform,subString:"Win",identity:"Windows"},{string:navigator.platform,subString:"Mac",identity:"Mac"},{string:navigator.platform,subString:"Linux",identity:"Linux"}],searchString=function(data){var ret=null,i,dataString,dataProp;for(i=0;i<data.length&&ret===null;++i){dataString=data[i].string;dataProp=data[i].prop;versionSearchString=data[i].versionSearch||data[i].identity;if(dataString){if(dataString.indexOf(data[i].subString)!==-1){ret=data[i].identity;}}
else if(dataProp){ret=data[i].identity;}
dataString=dataProp=null;}
return ret;},searchVersion=function(dataString){var index=dataString.indexOf(versionSearchString);return index!==-1&&parseFloat(dataString.substring(index+versionSearchString.length+1));},init=function(){obj.browser=searchString(dataBrowser)||"unknown";obj.version=searchVersion(navigator.userAgent)||searchVersion(navigator.appVersion)||"?";obj.OS=searchString(dataOS)||"unknown";};init();return obj;}();
