function pageload(hash){if(hash){jQuery("#load").load(hash+".gsp");}else{jQuery("#load").empty();}}var Ajax;if(Ajax&&(Ajax!=null)){Ajax.Responders.register({onCreate:function(){if($("spinner")&&Ajax.activeRequestCount>0){Effect.Appear("spinner",{duration:0.5,queue:"end"});}},onComplete:function(){if($("spinner")&&Ajax.activeRequestCount==0){Effect.Fade("spinner",{duration:0.5,queue:"end"});}}});}var datePickerDivID="datepicker";var iFrameDivID="datepickeriframe";var dayArrayShort=new Array("Su","Mo","Tu","We","Th","Fr","Sa");var dayArrayMed=new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat");var dayArrayLong=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");var monthArrayShort=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");var monthArrayMed=new Array("Jan","Feb","Mar","Apr","May","June","July","Aug","Sept","Oct","Nov","Dec");var monthArrayLong=new Array("January","February","March","April","May","June","July","August","September","October","November","December");var defaultDateSeparator="-";var defaultDateFormat="ymd";var dateSeparator=defaultDateSeparator;var dateFormat=defaultDateFormat;function displayDatePicker(dateFieldName,displayBelowThisObject,dtFormat,dtSep){var targetDateField=document.getElementsByName(dateFieldName).item(0);if(!displayBelowThisObject){displayBelowThisObject=targetDateField;}if(dtSep){dateSeparator=dtSep;}else{dateSeparator=defaultDateSeparator;}if(dtFormat){dateFormat=dtFormat;}else{dateFormat=defaultDateFormat;}var x=displayBelowThisObject.offsetLeft;var y=displayBelowThisObject.offsetTop+displayBelowThisObject.offsetHeight;var parent=displayBelowThisObject;while(parent.offsetParent){parent=parent.offsetParent;x+=parent.offsetLeft;y+=parent.offsetTop;}drawDatePicker(targetDateField,x,y);}function drawDatePicker(targetDateField,x,y){var dt=getFieldDate(targetDateField.value);if(!document.getElementById(datePickerDivID)){var newNode=document.createElement("div");newNode.setAttribute("id",datePickerDivID);newNode.setAttribute("class","dpDiv");newNode.setAttribute("style","visibility: hidden;");document.body.appendChild(newNode);}var pickerDiv=document.getElementById(datePickerDivID);pickerDiv.style.position="absolute";pickerDiv.style.left=x+"px";pickerDiv.style.top=y+"px";pickerDiv.style.visibility=(pickerDiv.style.visibility=="visible"?"hidden":"visible");pickerDiv.style.display=(pickerDiv.style.display=="block"?"none":"block");pickerDiv.style.zIndex=10000;refreshDatePicker(targetDateField.name,dt.getFullYear(),dt.getMonth(),dt.getDate());}function refreshDatePicker(dateFieldName,year,month,day){var thisDay=new Date();if((month>=0)&&(year>0)){thisDay=new Date(year,month,1);}else{day=thisDay.getDate();thisDay.setDate(1);}var crlf="\r\n";var TABLE="<table cols=7 class='dpTable'>"+crlf;var xTABLE="</table>"+crlf;var TR="<tr class='dpTR'>";var TR_title="<tr class='dpTitleTR'>";var TR_days="<tr class='dpDayTR'>";var TR_todaybutton="<tr class='dpTodayButtonTR'>";var xTR="</tr>"+crlf;var TD="<td class='dpTD' onMouseOut='this.className=\"dpTD\";' onMouseOver=' this.className=\"dpTDHover\";' ";var TD_title="<td colspan=5 class='dpTitleTD'>";var TD_buttons="<td class='dpButtonTD'>";var TD_todaybutton="<td colspan=7 class='dpTodayButtonTD'>";var TD_days="<td class='dpDayTD'>";var TD_selected="<td class='dpDayHighlightTD' onMouseOut='this.className=\"dpDayHighlightTD\";' onMouseOver='this.className=\"dpTDHover\";' ";var xTD="</td>"+crlf;var DIV_title="<div class='dpTitleText'>";var DIV_selected="<div class='dpDayHighlight'>";var xDIV="</div>";var html=TABLE;html+=TR_title;html+=TD_buttons+getButtonCode(dateFieldName,thisDay,-1,"&lt;")+xTD;html+=TD_title+DIV_title+monthArrayLong[thisDay.getMonth()]+" "+thisDay.getFullYear()+xDIV+xTD;html+=TD_buttons+getButtonCode(dateFieldName,thisDay,1,"&gt;")+xTD;html+=xTR;html+=TR_days;for(i=0;i<dayArrayShort.length;i++){html+=TD_days+dayArrayShort[i]+xTD;}html+=xTR;html+=TR;for(i=0;i<thisDay.getDay();i++){html+=TD+"&nbsp;"+xTD;}do{dayNum=thisDay.getDate();TD_onclick=" onclick=\"updateDateField('"+dateFieldName+"', '"+getDateString(thisDay)+"');\">";if(dayNum==day){html+=TD_selected+TD_onclick+DIV_selected+dayNum+xDIV+xTD;}else{html+=TD+TD_onclick+dayNum+xTD;}if(thisDay.getDay()==6){html+=xTR+TR;}thisDay.setDate(thisDay.getDate()+1);}while(thisDay.getDate()>1);if(thisDay.getDay()>0){for(i=6;i>thisDay.getDay();i--){html+=TD+"&nbsp;"+xTD;}}html+=xTR;var today=new Date();var todayString="Today is "+dayArrayMed[today.getDay()]+", "+monthArrayMed[today.getMonth()]+" "+today.getDate();html+=TR_todaybutton+TD_todaybutton;html+="<button class='dpTodayButton' onClick='refreshDatePicker(\""+dateFieldName+"\");'>this month</button> ";html+="<button class='dpTodayButton' onClick='updateDateField(\""+dateFieldName+"\");'>close</button>";html+=xTD+xTR;html+=xTABLE;document.getElementById(datePickerDivID).innerHTML=html;adjustiFrame();}function getButtonCode(dateFieldName,dateVal,adjust,label){var newMonth=(dateVal.getMonth()+adjust)%12;var newYear=dateVal.getFullYear()+parseInt((dateVal.getMonth()+adjust)/12);if(newMonth<0){newMonth+=12;newYear+=-1;}return"<button class='dpButton' onClick='refreshDatePicker(\""+dateFieldName+'", '+newYear+", "+newMonth+");'>"+label+"</button>";}function getDateString(dateVal){var dayString="00"+dateVal.getDate();var monthString="00"+(dateVal.getMonth()+1);dayString=dayString.substring(dayString.length-2);monthString=monthString.substring(monthString.length-2);switch(dateFormat){case"dmy":return dayString+dateSeparator+monthString+dateSeparator+dateVal.getFullYear();case"ymd":return dateVal.getFullYear()+dateSeparator+monthString+dateSeparator+dayString;case"mdy":default:return monthString+dateSeparator+dayString+dateSeparator+dateVal.getFullYear();}}function getFieldDate(dateString){var dateVal;var dArray;var d,m,y;try{dArray=splitDateString(dateString);if(dArray){switch(dateFormat){case"dmy":d=parseInt(dArray[0],10);m=parseInt(dArray[1],10)-1;y=parseInt(dArray[2],10);break;case"ymd":d=parseInt(dArray[2],10);m=parseInt(dArray[1],10)-1;y=parseInt(dArray[0],10);break;case"mdy":default:d=parseInt(dArray[1],10);m=parseInt(dArray[0],10)-1;y=parseInt(dArray[2],10);break;}dateVal=new Date(y,m,d);}else{if(dateString){dateVal=new Date(dateString);}else{dateVal=new Date();}}}catch(e){dateVal=new Date();}return dateVal;}function splitDateString(dateString){var dArray;if(dateString.indexOf("/")>=0){dArray=dateString.split("/");}else{if(dateString.indexOf(".")>=0){dArray=dateString.split(".");}else{if(dateString.indexOf("-")>=0){dArray=dateString.split("-");}else{if(dateString.indexOf("\\")>=0){dArray=dateString.split("\\");}else{dArray=false;}}}}return dArray;}function updateDateField(dateFieldName,dateString){var targetDateField=document.getElementsByName(dateFieldName).item(0);if(dateString){targetDateField.value=dateString;}var pickerDiv=document.getElementById(datePickerDivID);pickerDiv.style.visibility="hidden";pickerDiv.style.display="none";adjustiFrame();targetDateField.focus();if((dateString)&&(typeof(datePickerClosed)=="function")){datePickerClosed(targetDateField);}}function adjustiFrame(pickerDiv,iFrameDiv){var is_opera=(navigator.userAgent.toLowerCase().indexOf("opera")!=-1);if(is_opera){return;}try{if(!document.getElementById(iFrameDivID)){var newNode=document.createElement("iFrame");newNode.setAttribute("id",iFrameDivID);newNode.setAttribute("src","javascript:false;");newNode.setAttribute("scrolling","no");newNode.setAttribute("frameborder","0");document.body.appendChild(newNode);}if(!pickerDiv){pickerDiv=document.getElementById(datePickerDivID);}if(!iFrameDiv){iFrameDiv=document.getElementById(iFrameDivID);}try{iFrameDiv.style.position="absolute";iFrameDiv.style.width=pickerDiv.offsetWidth;iFrameDiv.style.height=pickerDiv.offsetHeight;iFrameDiv.style.top=pickerDiv.style.top;iFrameDiv.style.left=pickerDiv.style.left;iFrameDiv.style.zIndex=pickerDiv.style.zIndex-1;iFrameDiv.style.visibility=pickerDiv.style.visibility;iFrameDiv.style.display=pickerDiv.style.display;}catch(e){}}catch(ee){}}var sendInvite=function(userId,name,jabberId,inviteId){if(userId&&name&&jabberId&&inviteId){var inviteObj=new Object();inviteObj.userId=userId;inviteObj.name=name;inviteObj.jabberId=jabberId;var inviteHash=new Object();inviteHash.inviteId=inviteObj;document.getElementById("tbx_call").inviteUser(inviteHash);}else{alert("missing info to invite a user");}};(function(){var _jQuery=window.jQuery,_$=window.$;var jQuery=window.jQuery=window.$=function(selector,context){return new jQuery.fn.init(selector,context);};var quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/,isSimple=/^.[^:#\[\.]*$/,undefined;jQuery.fn=jQuery.prototype={init:function(selector,context){selector=selector||document;if(selector.nodeType){this[0]=selector;this.length=1;return this;}if(typeof selector=="string"){var match=quickExpr.exec(selector);if(match&&(match[1]||!context)){if(match[1]){selector=jQuery.clean([match[1]],context);}else{var elem=document.getElementById(match[3]);if(elem){if(elem.id!=match[3]){return jQuery().find(selector);}return jQuery(elem);}selector=[];}}else{return jQuery(context).find(selector);}}else{if(jQuery.isFunction(selector)){return jQuery(document)[jQuery.fn.ready?"ready":"load"](selector);}}return this.setArray(jQuery.makeArray(selector));},jquery:"1.2.6",size:function(){return this.length;},length:0,get:function(num){return num==undefined?jQuery.makeArray(this):this[num];},pushStack:function(elems){var ret=jQuery(elems);ret.prevObject=this;return ret;},setArray:function(elems){this.length=0;Array.prototype.push.apply(this,elems);return this;},each:function(callback,args){return jQuery.each(this,callback,args);},index:function(elem){var ret=-1;return jQuery.inArray(elem&&elem.jquery?elem[0]:elem,this);},attr:function(name,value,type){var options=name;if(name.constructor==String){if(value===undefined){return this[0]&&jQuery[type||"attr"](this[0],name);}else{options={};options[name]=value;}}return this.each(function(i){for(name in options){jQuery.attr(type?this.style:this,name,jQuery.prop(this,options[name],type,i,name));}});},css:function(key,value){if((key=="width"||key=="height")&&parseFloat(value)<0){value=undefined;}return this.attr(key,value,"curCSS");},text:function(text){if(typeof text!="object"&&text!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(text));}var ret="";jQuery.each(text||this,function(){jQuery.each(this.childNodes,function(){if(this.nodeType!=8){ret+=this.nodeType!=1?this.nodeValue:jQuery.fn.text([this]);}});});return ret;},wrapAll:function(html){if(this[0]){jQuery(html,this[0].ownerDocument).clone().insertBefore(this[0]).map(function(){var elem=this;while(elem.firstChild){elem=elem.firstChild;}return elem;}).append(this);}return this;},wrapInner:function(html){return this.each(function(){jQuery(this).contents().wrapAll(html);});},wrap:function(html){return this.each(function(){jQuery(this).wrapAll(html);});},append:function(){return this.domManip(arguments,true,false,function(elem){if(this.nodeType==1){this.appendChild(elem);}});},prepend:function(){return this.domManip(arguments,true,true,function(elem){if(this.nodeType==1){this.insertBefore(elem,this.firstChild);}});},before:function(){return this.domManip(arguments,false,false,function(elem){this.parentNode.insertBefore(elem,this);});},after:function(){return this.domManip(arguments,false,true,function(elem){this.parentNode.insertBefore(elem,this.nextSibling);});},end:function(){return this.prevObject||jQuery([]);},find:function(selector){var elems=jQuery.map(this,function(elem){return jQuery.find(selector,elem);});return this.pushStack(/[^+>] [^+>]/.test(selector)||selector.indexOf("..")>-1?jQuery.unique(elems):elems);},clone:function(events){var ret=this.map(function(){if(jQuery.browser.msie&&!jQuery.isXMLDoc(this)){var clone=this.cloneNode(true),container=document.createElement("div");container.appendChild(clone);return jQuery.clean([container.innerHTML])[0];}else{return this.cloneNode(true);}});var clone=ret.find("*").andSelf().each(function(){if(this[expando]!=undefined){this[expando]=null;}});if(events===true){this.find("*").andSelf().each(function(i){if(this.nodeType==3){return;}var events=jQuery.data(this,"events");for(var type in events){for(var handler in events[type]){jQuery.event.add(clone[i],type,events[type][handler],events[type][handler].data);}}});}return ret;},filter:function(selector){return this.pushStack(jQuery.isFunction(selector)&&jQuery.grep(this,function(elem,i){return selector.call(elem,i);})||jQuery.multiFilter(selector,this));},not:function(selector){if(selector.constructor==String){if(isSimple.test(selector)){return this.pushStack(jQuery.multiFilter(selector,this,true));}else{selector=jQuery.multiFilter(selector,this);}}var isArrayLike=selector.length&&selector[selector.length-1]!==undefined&&!selector.nodeType;return this.filter(function(){return isArrayLike?jQuery.inArray(this,selector)<0:this!=selector;});},add:function(selector){return this.pushStack(jQuery.unique(jQuery.merge(this.get(),typeof selector=="string"?jQuery(selector):jQuery.makeArray(selector))));},is:function(selector){return !!selector&&jQuery.multiFilter(selector,this).length>0;},hasClass:function(selector){return this.is("."+selector);},val:function(value){if(value==undefined){if(this.length){var elem=this[0];if(jQuery.nodeName(elem,"select")){var index=elem.selectedIndex,values=[],options=elem.options,one=elem.type=="select-one";if(index<0){return null;}for(var i=one?index:0,max=one?index+1:options.length;i<max;i++){var option=options[i];if(option.selected){value=jQuery.browser.msie&&!option.attributes.value.specified?option.text:option.value;if(one){return value;}values.push(value);}}return values;}else{return(this[0].value||"").replace(/\r/g,"");}}return undefined;}if(value.constructor==Number){value+="";}return this.each(function(){if(this.nodeType!=1){return;}if(value.constructor==Array&&/radio|checkbox/.test(this.type)){this.checked=(jQuery.inArray(this.value,value)>=0||jQuery.inArray(this.name,value)>=0);}else{if(jQuery.nodeName(this,"select")){var values=jQuery.makeArray(value);jQuery("option",this).each(function(){this.selected=(jQuery.inArray(this.value,values)>=0||jQuery.inArray(this.text,values)>=0);});if(!values.length){this.selectedIndex=-1;}}else{this.value=value;}}});},html:function(value){return value==undefined?(this[0]?this[0].innerHTML:null):this.empty().append(value);},replaceWith:function(value){return this.after(value).remove();},eq:function(i){return this.slice(i,i+1);},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments));},map:function(callback){return this.pushStack(jQuery.map(this,function(elem,i){return callback.call(elem,i,elem);}));},andSelf:function(){return this.add(this.prevObject);},data:function(key,value){var parts=key.split(".");parts[1]=parts[1]?"."+parts[1]:"";if(value===undefined){var data=this.triggerHandler("getData"+parts[1]+"!",[parts[0]]);if(data===undefined&&this.length){data=jQuery.data(this[0],key);}return data===undefined&&parts[1]?this.data(parts[0]):data;}else{return this.trigger("setData"+parts[1]+"!",[parts[0],value]).each(function(){jQuery.data(this,key,value);});}},removeData:function(key){return this.each(function(){jQuery.removeData(this,key);});},domManip:function(args,table,reverse,callback){var clone=this.length>1,elems;return this.each(function(){if(!elems){elems=jQuery.clean(args,this.ownerDocument);if(reverse){elems.reverse();}}var obj=this;if(table&&jQuery.nodeName(this,"table")&&jQuery.nodeName(elems[0],"tr")){obj=this.getElementsByTagName("tbody")[0]||this.appendChild(this.ownerDocument.createElement("tbody"));}var scripts=jQuery([]);jQuery.each(elems,function(){var elem=clone?jQuery(this).clone(true)[0]:this;if(jQuery.nodeName(elem,"script")){scripts=scripts.add(elem);}else{if(elem.nodeType==1){scripts=scripts.add(jQuery("script",elem).remove());}callback.call(obj,elem);}});scripts.each(evalScript);});}};jQuery.fn.init.prototype=jQuery.fn;function evalScript(i,elem){if(elem.src){jQuery.ajax({url:elem.src,async:false,dataType:"script"});}else{jQuery.globalEval(elem.text||elem.textContent||elem.innerHTML||"");}if(elem.parentNode){elem.parentNode.removeChild(elem);}}function now(){return +new Date;}jQuery.extend=jQuery.fn.extend=function(){var target=arguments[0]||{},i=1,length=arguments.length,deep=false,options;if(target.constructor==Boolean){deep=target;target=arguments[1]||{};i=2;}if(typeof target!="object"&&typeof target!="function"){target={};}if(length==i){target=this;--i;}for(;i<length;i++){if((options=arguments[i])!=null){for(var name in options){var src=target[name],copy=options[name];if(target===copy){continue;}if(deep&&copy&&typeof copy=="object"&&!copy.nodeType){target[name]=jQuery.extend(deep,src||(copy.length!=null?[]:{}),copy);}else{if(copy!==undefined){target[name]=copy;}}}}}return target;};var expando="jQuery"+now(),uuid=0,windowData={},exclude=/z-?index|font-?weight|opacity|zoom|line-?height/i,defaultView=document.defaultView||{};jQuery.extend({noConflict:function(deep){window.$=_$;if(deep){window.jQuery=_jQuery;}return jQuery;},isFunction:function(fn){return !!fn&&typeof fn!="string"&&!fn.nodeName&&fn.constructor!=Array&&/^[\s[]?function/.test(fn+"");},isXMLDoc:function(elem){return elem.documentElement&&!elem.body||elem.tagName&&elem.ownerDocument&&!elem.ownerDocument.body;},globalEval:function(data){data=jQuery.trim(data);if(data){var head=document.getElementsByTagName("head")[0]||document.documentElement,script=document.createElement("script");script.type="text/javascript";if(jQuery.browser.msie){script.text=data;}else{script.appendChild(document.createTextNode(data));}head.insertBefore(script,head.firstChild);head.removeChild(script);}},nodeName:function(elem,name){return elem.nodeName&&elem.nodeName.toUpperCase()==name.toUpperCase();},cache:{},data:function(elem,name,data){elem=elem==window?windowData:elem;var id=elem[expando];if(!id){id=elem[expando]=++uuid;}if(name&&!jQuery.cache[id]){jQuery.cache[id]={};}if(data!==undefined){jQuery.cache[id][name]=data;}return name?jQuery.cache[id][name]:id;},removeData:function(elem,name){elem=elem==window?windowData:elem;var id=elem[expando];if(name){if(jQuery.cache[id]){delete jQuery.cache[id][name];name="";for(name in jQuery.cache[id]){break;}if(!name){jQuery.removeData(elem);}}}else{try{delete elem[expando];}catch(e){if(elem.removeAttribute){elem.removeAttribute(expando);}}delete jQuery.cache[id];}},each:function(object,callback,args){var name,i=0,length=object.length;if(args){if(length==undefined){for(name in object){if(callback.apply(object[name],args)===false){break;}}}else{for(;i<length;){if(callback.apply(object[i++],args)===false){break;}}}}else{if(length==undefined){for(name in object){if(callback.call(object[name],name,object[name])===false){break;}}}else{for(var value=object[0];i<length&&callback.call(value,i,value)!==false;value=object[++i]){}}}return object;},prop:function(elem,value,type,i,name){if(jQuery.isFunction(value)){value=value.call(elem,i);}return value&&value.constructor==Number&&type=="curCSS"&&!exclude.test(name)?value+"px":value;},className:{add:function(elem,classNames){jQuery.each((classNames||"").split(/\s+/),function(i,className){if(elem.nodeType==1&&!jQuery.className.has(elem.className,className)){elem.className+=(elem.className?" ":"")+className;}});},remove:function(elem,classNames){if(elem.nodeType==1){elem.className=classNames!=undefined?jQuery.grep(elem.className.split(/\s+/),function(className){return !jQuery.className.has(classNames,className);}).join(" "):"";}},has:function(elem,className){return jQuery.inArray(className,(elem.className||elem).toString().split(/\s+/))>-1;}},swap:function(elem,options,callback){var old={};for(var name in options){old[name]=elem.style[name];elem.style[name]=options[name];}callback.call(elem);for(var name in options){elem.style[name]=old[name];}},css:function(elem,name,force){if(name=="width"||name=="height"){var val,props={position:"absolute",visibility:"hidden",display:"block"},which=name=="width"?["Left","Right"]:["Top","Bottom"];function getWH(){val=name=="width"?elem.offsetWidth:elem.offsetHeight;var padding=0,border=0;jQuery.each(which,function(){padding+=parseFloat(jQuery.curCSS(elem,"padding"+this,true))||0;border+=parseFloat(jQuery.curCSS(elem,"border"+this+"Width",true))||0;});val-=Math.round(padding+border);}if(jQuery(elem).is(":visible")){getWH();}else{jQuery.swap(elem,props,getWH);}return Math.max(0,val);}return jQuery.curCSS(elem,name,force);},curCSS:function(elem,name,force){var ret,style=elem.style;function color(elem){if(!jQuery.browser.safari){return false;}var ret=defaultView.getComputedStyle(elem,null);return !ret||ret.getPropertyValue("color")=="";}if(name=="opacity"&&jQuery.browser.msie){ret=jQuery.attr(style,"opacity");return ret==""?"1":ret;}if(jQuery.browser.opera&&name=="display"){var save=style.outline;style.outline="0 solid black";style.outline=save;}if(name.match(/float/i)){name=styleFloat;}if(!force&&style&&style[name]){ret=style[name];}else{if(defaultView.getComputedStyle){if(name.match(/float/i)){name="float";}name=name.replace(/([A-Z])/g,"-$1").toLowerCase();var computedStyle=defaultView.getComputedStyle(elem,null);if(computedStyle&&!color(elem)){ret=computedStyle.getPropertyValue(name);}else{var swap=[],stack=[],a=elem,i=0;for(;a&&color(a);a=a.parentNode){stack.unshift(a);}for(;i<stack.length;i++){if(color(stack[i])){swap[i]=stack[i].style.display;stack[i].style.display="block";}}ret=name=="display"&&swap[stack.length-1]!=null?"none":(computedStyle&&computedStyle.getPropertyValue(name))||"";for(i=0;i<swap.length;i++){if(swap[i]!=null){stack[i].style.display=swap[i];}}}if(name=="opacity"&&ret==""){ret="1";}}else{if(elem.currentStyle){var camelCase=name.replace(/\-(\w)/g,function(all,letter){return letter.toUpperCase();});ret=elem.currentStyle[name]||elem.currentStyle[camelCase];if(!/^\d+(px)?$/i.test(ret)&&/^\d/.test(ret)){var left=style.left,rsLeft=elem.runtimeStyle.left;elem.runtimeStyle.left=elem.currentStyle.left;style.left=ret||0;ret=style.pixelLeft+"px";style.left=left;elem.runtimeStyle.left=rsLeft;}}}}return ret;},clean:function(elems,context){var ret=[];context=context||document;if(typeof context.createElement=="undefined"){context=context.ownerDocument||context[0]&&context[0].ownerDocument||document;}jQuery.each(elems,function(i,elem){if(!elem){return;}if(elem.constructor==Number){elem+="";}if(typeof elem=="string"){elem=elem.replace(/(<(\w+)[^>]*?)\/>/g,function(all,front,tag){return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?all:front+"></"+tag+">";});var tags=jQuery.trim(elem).toLowerCase(),div=context.createElement("div");var wrap=!tags.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!tags.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||tags.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!tags.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!tags.indexOf("<td")||!tags.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!tags.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||jQuery.browser.msie&&[1,"div<div>","</div>"]||[0,"",""];div.innerHTML=wrap[1]+elem+wrap[2];while(wrap[0]--){div=div.lastChild;}if(jQuery.browser.msie){var tbody=!tags.indexOf("<table")&&tags.indexOf("<tbody")<0?div.firstChild&&div.firstChild.childNodes:wrap[1]=="<table>"&&tags.indexOf("<tbody")<0?div.childNodes:[];for(var j=tbody.length-1;j>=0;--j){if(jQuery.nodeName(tbody[j],"tbody")&&!tbody[j].childNodes.length){tbody[j].parentNode.removeChild(tbody[j]);}}if(/^\s/.test(elem)){div.insertBefore(context.createTextNode(elem.match(/^\s*/)[0]),div.firstChild);}}elem=jQuery.makeArray(div.childNodes);}if(elem.length===0&&(!jQuery.nodeName(elem,"form")&&!jQuery.nodeName(elem,"select"))){return;}if(elem[0]==undefined||jQuery.nodeName(elem,"form")||elem.options){ret.push(elem);}else{ret=jQuery.merge(ret,elem);}});return ret;},attr:function(elem,name,value){if(!elem||elem.nodeType==3||elem.nodeType==8){return undefined;}var notxml=!jQuery.isXMLDoc(elem),set=value!==undefined,msie=jQuery.browser.msie;name=notxml&&jQuery.props[name]||name;if(elem.tagName){var special=/href|src|style/.test(name);if(name=="selected"&&jQuery.browser.safari){elem.parentNode.selectedIndex;}if(name in elem&&notxml&&!special){if(set){if(name=="type"&&jQuery.nodeName(elem,"input")&&elem.parentNode){throw"type property can't be changed";}elem[name]=value;}if(jQuery.nodeName(elem,"form")&&elem.getAttributeNode(name)){return elem.getAttributeNode(name).nodeValue;}return elem[name];}if(msie&&notxml&&name=="style"){return jQuery.attr(elem.style,"cssText",value);}if(set){elem.setAttribute(name,""+value);}var attr=msie&&notxml&&special?elem.getAttribute(name,2):elem.getAttribute(name);return attr===null?undefined:attr;}if(msie&&name=="opacity"){if(set){elem.zoom=1;elem.filter=(elem.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(value)+""=="NaN"?"":"alpha(opacity="+value*100+")");}return elem.filter&&elem.filter.indexOf("opacity=")>=0?(parseFloat(elem.filter.match(/opacity=([^)]*)/)[1])/100)+"":"";}name=name.replace(/-([a-z])/ig,function(all,letter){return letter.toUpperCase();});if(set){elem[name]=value;}return elem[name];},trim:function(text){return(text||"").replace(/^\s+|\s+$/g,"");},makeArray:function(array){var ret=[];if(array!=null){var i=array.length;if(i==null||array.split||array.setInterval||array.call){ret[0]=array;}else{while(i){ret[--i]=array[i];}}}return ret;},inArray:function(elem,array){for(var i=0,length=array.length;i<length;i++){if(array[i]===elem){return i;}}return -1;},merge:function(first,second){var i=0,elem,pos=first.length;if(jQuery.browser.msie){while(elem=second[i++]){if(elem.nodeType!=8){first[pos++]=elem;}}}else{while(elem=second[i++]){first[pos++]=elem;}}return first;},unique:function(array){var ret=[],done={};try{for(var i=0,length=array.length;i<length;i++){var id=jQuery.data(array[i]);if(!done[id]){done[id]=true;ret.push(array[i]);}}}catch(e){ret=array;}return ret;},grep:function(elems,callback,inv){var ret=[];for(var i=0,length=elems.length;i<length;i++){if(!inv!=!callback(elems[i],i)){ret.push(elems[i]);}}return ret;},map:function(elems,callback){var ret=[];for(var i=0,length=elems.length;i<length;i++){var value=callback(elems[i],i);if(value!=null){ret[ret.length]=value;}}return ret.concat.apply([],ret);}});var userAgent=navigator.userAgent.toLowerCase();jQuery.browser={version:(userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[])[1],safari:/webkit/.test(userAgent),opera:/opera/.test(userAgent),msie:/msie/.test(userAgent)&&!/opera/.test(userAgent),mozilla:/mozilla/.test(userAgent)&&!/(compatible|webkit)/.test(userAgent)};var styleFloat=jQuery.browser.msie?"styleFloat":"cssFloat";jQuery.extend({boxModel:!jQuery.browser.msie||document.compatMode=="CSS1Compat",props:{"for":"htmlFor","class":"className","float":styleFloat,cssFloat:styleFloat,styleFloat:styleFloat,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing"}});jQuery.each({parent:function(elem){return elem.parentNode;},parents:function(elem){return jQuery.dir(elem,"parentNode");},next:function(elem){return jQuery.nth(elem,2,"nextSibling");},prev:function(elem){return jQuery.nth(elem,2,"previousSibling");},nextAll:function(elem){return jQuery.dir(elem,"nextSibling");},prevAll:function(elem){return jQuery.dir(elem,"previousSibling");},siblings:function(elem){return jQuery.sibling(elem.parentNode.firstChild,elem);},children:function(elem){return jQuery.sibling(elem.firstChild);},contents:function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.makeArray(elem.childNodes);}},function(name,fn){jQuery.fn[name]=function(selector){var ret=jQuery.map(this,fn);if(selector&&typeof selector=="string"){ret=jQuery.multiFilter(selector,ret);}return this.pushStack(jQuery.unique(ret));};});jQuery.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(name,original){jQuery.fn[name]=function(){var args=arguments;return this.each(function(){for(var i=0,length=args.length;i<length;i++){jQuery(args[i])[original](this);}});};});jQuery.each({removeAttr:function(name){jQuery.attr(this,name,"");if(this.nodeType==1){this.removeAttribute(name);}},addClass:function(classNames){jQuery.className.add(this,classNames);},removeClass:function(classNames){jQuery.className.remove(this,classNames);},toggleClass:function(classNames){jQuery.className[jQuery.className.has(this,classNames)?"remove":"add"](this,classNames);},remove:function(selector){if(!selector||jQuery.filter(selector,[this]).r.length){jQuery("*",this).add(this).each(function(){jQuery.event.remove(this);jQuery.removeData(this);});if(this.parentNode){this.parentNode.removeChild(this);}}},empty:function(){jQuery(">*",this).remove();while(this.firstChild){this.removeChild(this.firstChild);}}},function(name,fn){jQuery.fn[name]=function(){return this.each(fn,arguments);};});jQuery.each(["Height","Width"],function(i,name){var type=name.toLowerCase();jQuery.fn[type]=function(size){return this[0]==window?jQuery.browser.opera&&document.body["client"+name]||jQuery.browser.safari&&window["inner"+name]||document.compatMode=="CSS1Compat"&&document.documentElement["client"+name]||document.body["client"+name]:this[0]==document?Math.max(Math.max(document.body["scroll"+name],document.documentElement["scroll"+name]),Math.max(document.body["offset"+name],document.documentElement["offset"+name])):size==undefined?(this.length?jQuery.css(this[0],type):null):this.css(type,size.constructor==String?size:size+"px");};});function num(elem,prop){return elem[0]&&parseInt(jQuery.curCSS(elem[0],prop,true),10)||0;}var chars=jQuery.browser.safari&&parseInt(jQuery.browser.version)<417?"(?:[\\w*_-]|\\\\.)":"(?:[\\w\u0128-\uFFFF*_-]|\\\\.)",quickChild=new RegExp("^>\\s*("+chars+"+)"),quickID=new RegExp("^("+chars+"+)(#)("+chars+"+)"),quickClass=new RegExp("^([#.]?)("+chars+"*)");jQuery.extend({expr:{"":function(a,i,m){return m[2]=="*"||jQuery.nodeName(a,m[2]);},"#":function(a,i,m){return a.getAttribute("id")==m[2];},":":{lt:function(a,i,m){return i<m[3]-0;},gt:function(a,i,m){return i>m[3]-0;},nth:function(a,i,m){return m[3]-0==i;},eq:function(a,i,m){return m[3]-0==i;},first:function(a,i){return i==0;},last:function(a,i,m,r){return i==r.length-1;},even:function(a,i){return i%2==0;},odd:function(a,i){return i%2;},"first-child":function(a){return a.parentNode.getElementsByTagName("*")[0]==a;},"last-child":function(a){return jQuery.nth(a.parentNode.lastChild,1,"previousSibling")==a;},"only-child":function(a){return !jQuery.nth(a.parentNode.lastChild,2,"previousSibling");},parent:function(a){return a.firstChild;},empty:function(a){return !a.firstChild;},contains:function(a,i,m){return(a.textContent||a.innerText||jQuery(a).text()||"").indexOf(m[3])>=0;},visible:function(a){return"hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden";},hidden:function(a){return"hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden";},enabled:function(a){return !a.disabled;},disabled:function(a){return a.disabled;},checked:function(a){return a.checked;},selected:function(a){return a.selected||jQuery.attr(a,"selected");},text:function(a){return"text"==a.type;},radio:function(a){return"radio"==a.type;},checkbox:function(a){return"checkbox"==a.type;},file:function(a){return"file"==a.type;},password:function(a){return"password"==a.type;},submit:function(a){return"submit"==a.type;},image:function(a){return"image"==a.type;},reset:function(a){return"reset"==a.type;},button:function(a){return"button"==a.type||jQuery.nodeName(a,"button");},input:function(a){return/input|select|textarea|button/i.test(a.nodeName);},has:function(a,i,m){return jQuery.find(m[3],a).length;},header:function(a){return/h\d/i.test(a.nodeName);},animated:function(a){return jQuery.grep(jQuery.timers,function(fn){return a==fn.elem;}).length;}}},parse:[/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,new RegExp("^([:.#]*)("+chars+"+)")],multiFilter:function(expr,elems,not){var old,cur=[];while(expr&&expr!=old){old=expr;var f=jQuery.filter(expr,elems,not);expr=f.t.replace(/^\s*,\s*/,"");cur=not?elems=f.r:jQuery.merge(cur,f.r);}return cur;},find:function(t,context){if(typeof t!="string"){return[t];}if(context&&context.nodeType!=1&&context.nodeType!=9){return[];}context=context||document;var ret=[context],done=[],last,nodeName;while(t&&last!=t){var r=[];last=t;t=jQuery.trim(t);var foundToken=false,re=quickChild,m=re.exec(t);if(m){nodeName=m[1].toUpperCase();for(var i=0;ret[i];i++){for(var c=ret[i].firstChild;c;c=c.nextSibling){if(c.nodeType==1&&(nodeName=="*"||c.nodeName.toUpperCase()==nodeName)){r.push(c);}}}ret=r;t=t.replace(re,"");if(t.indexOf(" ")==0){continue;}foundToken=true;}else{re=/^([>+~])\s*(\w*)/i;if((m=re.exec(t))!=null){r=[];var merge={};nodeName=m[2].toUpperCase();m=m[1];for(var j=0,rl=ret.length;j<rl;j++){var n=m=="~"||m=="+"?ret[j].nextSibling:ret[j].firstChild;for(;n;n=n.nextSibling){if(n.nodeType==1){var id=jQuery.data(n);if(m=="~"&&merge[id]){break;}if(!nodeName||n.nodeName.toUpperCase()==nodeName){if(m=="~"){merge[id]=true;}r.push(n);}if(m=="+"){break;}}}}ret=r;t=jQuery.trim(t.replace(re,""));foundToken=true;}}if(t&&!foundToken){if(!t.indexOf(",")){if(context==ret[0]){ret.shift();}done=jQuery.merge(done,ret);r=ret=[context];t=" "+t.substr(1,t.length);}else{var re2=quickID;var m=re2.exec(t);if(m){m=[0,m[2],m[3],m[1]];}else{re2=quickClass;m=re2.exec(t);}m[2]=m[2].replace(/\\/g,"");var elem=ret[ret.length-1];if(m[1]=="#"&&elem&&elem.getElementById&&!jQuery.isXMLDoc(elem)){var oid=elem.getElementById(m[2]);if((jQuery.browser.msie||jQuery.browser.opera)&&oid&&typeof oid.id=="string"&&oid.id!=m[2]){oid=jQuery('[@id="'+m[2]+'"]',elem)[0];}ret=r=oid&&(!m[3]||jQuery.nodeName(oid,m[3]))?[oid]:[];}else{for(var i=0;ret[i];i++){var tag=m[1]=="#"&&m[3]?m[3]:m[1]!=""||m[0]==""?"*":m[2];if(tag=="*"&&ret[i].nodeName.toLowerCase()=="object"){tag="param";}r=jQuery.merge(r,ret[i].getElementsByTagName(tag));}if(m[1]=="."){r=jQuery.classFilter(r,m[2]);}if(m[1]=="#"){var tmp=[];for(var i=0;r[i];i++){if(r[i].getAttribute("id")==m[2]){tmp=[r[i]];break;}}r=tmp;}ret=r;}t=t.replace(re2,"");}}if(t){var val=jQuery.filter(t,r);ret=r=val.r;t=jQuery.trim(val.t);}}if(t){ret=[];}if(ret&&context==ret[0]){ret.shift();}done=jQuery.merge(done,ret);return done;},classFilter:function(r,m,not){m=" "+m+" ";var tmp=[];for(var i=0;r[i];i++){var pass=(" "+r[i].className+" ").indexOf(m)>=0;if(!not&&pass||not&&!pass){tmp.push(r[i]);}}return tmp;},filter:function(t,r,not){var last;while(t&&t!=last){last=t;var p=jQuery.parse,m;for(var i=0;p[i];i++){m=p[i].exec(t);if(m){t=t.substring(m[0].length);m[2]=m[2].replace(/\\/g,"");break;}}if(!m){break;}if(m[1]==":"&&m[2]=="not"){r=isSimple.test(m[3])?jQuery.filter(m[3],r,true).r:jQuery(r).not(m[3]);}else{if(m[1]=="."){r=jQuery.classFilter(r,m[2],not);}else{if(m[1]=="["){var tmp=[],type=m[3];for(var i=0,rl=r.length;i<rl;i++){var a=r[i],z=a[jQuery.props[m[2]]||m[2]];if(z==null||/href|src|selected/.test(m[2])){z=jQuery.attr(a,m[2])||"";}if((type==""&&!!z||type=="="&&z==m[5]||type=="!="&&z!=m[5]||type=="^="&&z&&!z.indexOf(m[5])||type=="$="&&z.substr(z.length-m[5].length)==m[5]||(type=="*="||type=="~=")&&z.indexOf(m[5])>=0)^not){tmp.push(a);}}r=tmp;}else{if(m[1]==":"&&m[2]=="nth-child"){var merge={},tmp=[],test=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(m[3]=="even"&&"2n"||m[3]=="odd"&&"2n+1"||!/\D/.test(m[3])&&"0n+"+m[3]||m[3]),first=(test[1]+(test[2]||1))-0,last=test[3]-0;for(var i=0,rl=r.length;i<rl;i++){var node=r[i],parentNode=node.parentNode,id=jQuery.data(parentNode);if(!merge[id]){var c=1;for(var n=parentNode.firstChild;n;n=n.nextSibling){if(n.nodeType==1){n.nodeIndex=c++;}}merge[id]=true;}var add=false;if(first==0){if(node.nodeIndex==last){add=true;}}else{if((node.nodeIndex-last)%first==0&&(node.nodeIndex-last)/first>=0){add=true;}}if(add^not){tmp.push(node);}}r=tmp;}else{var fn=jQuery.expr[m[1]];if(typeof fn=="object"){fn=fn[m[2]];}if(typeof fn=="string"){fn=eval("false||function(a,i){return "+fn+";}");}r=jQuery.grep(r,function(elem,i){return fn(elem,i,m,r);},not);}}}}}return{r:r,t:t};},dir:function(elem,dir){var matched=[],cur=elem[dir];while(cur&&cur!=document){if(cur.nodeType==1){matched.push(cur);}cur=cur[dir];}return matched;},nth:function(cur,result,dir,elem){result=result||1;var num=0;for(;cur;cur=cur[dir]){if(cur.nodeType==1&&++num==result){break;}}return cur;},sibling:function(n,elem){var r=[];for(;n;n=n.nextSibling){if(n.nodeType==1&&n!=elem){r.push(n);}}return r;}});jQuery.event={add:function(elem,types,handler,data){if(elem.nodeType==3||elem.nodeType==8){return;}if(jQuery.browser.msie&&elem.setInterval){elem=window;}if(!handler.guid){handler.guid=this.guid++;}if(data!=undefined){var fn=handler;handler=this.proxy(fn,function(){return fn.apply(this,arguments);});handler.data=data;}var events=jQuery.data(elem,"events")||jQuery.data(elem,"events",{}),handle=jQuery.data(elem,"handle")||jQuery.data(elem,"handle",function(){if(typeof jQuery!="undefined"&&!jQuery.event.triggered){return jQuery.event.handle.apply(arguments.callee.elem,arguments);}});handle.elem=elem;jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];handler.type=parts[1];var handlers=events[type];if(!handlers){handlers=events[type]={};if(!jQuery.event.special[type]||jQuery.event.special[type].setup.call(elem)===false){if(elem.addEventListener){elem.addEventListener(type,handle,false);}else{if(elem.attachEvent){elem.attachEvent("on"+type,handle);}}}}handlers[handler.guid]=handler;jQuery.event.global[type]=true;});elem=null;},guid:1,global:{},remove:function(elem,types,handler){if(elem.nodeType==3||elem.nodeType==8){return;}var events=jQuery.data(elem,"events"),ret,index;if(events){if(types==undefined||(typeof types=="string"&&types.charAt(0)==".")){for(var type in events){this.remove(elem,type+(types||""));}}else{if(types.type){handler=types.handler;types=types.type;}jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];if(events[type]){if(handler){delete events[type][handler.guid];}else{for(handler in events[type]){if(!parts[1]||events[type][handler].type==parts[1]){delete events[type][handler];}}}for(ret in events[type]){break;}if(!ret){if(!jQuery.event.special[type]||jQuery.event.special[type].teardown.call(elem)===false){if(elem.removeEventListener){elem.removeEventListener(type,jQuery.data(elem,"handle"),false);}else{if(elem.detachEvent){elem.detachEvent("on"+type,jQuery.data(elem,"handle"));}}}ret=null;delete events[type];}}});}for(ret in events){break;}if(!ret){var handle=jQuery.data(elem,"handle");if(handle){handle.elem=null;}jQuery.removeData(elem,"events");jQuery.removeData(elem,"handle");}}},trigger:function(type,data,elem,donative,extra){data=jQuery.makeArray(data);if(type.indexOf("!")>=0){type=type.slice(0,-1);var exclusive=true;}if(!elem){if(this.global[type]){jQuery("*").add([window,document]).trigger(type,data);}}else{if(elem.nodeType==3||elem.nodeType==8){return undefined;}var val,ret,fn=jQuery.isFunction(elem[type]||null),event=!data[0]||!data[0].preventDefault;if(event){data.unshift({type:type,target:elem,preventDefault:function(){},stopPropagation:function(){},timeStamp:now()});data[0][expando]=true;}data[0].type=type;if(exclusive){data[0].exclusive=true;}var handle=jQuery.data(elem,"handle");if(handle){val=handle.apply(elem,data);}if((!fn||(jQuery.nodeName(elem,"a")&&type=="click"))&&elem["on"+type]&&elem["on"+type].apply(elem,data)===false){val=false;}if(event){data.shift();}if(extra&&jQuery.isFunction(extra)){ret=extra.apply(elem,val==null?data:data.concat(val));if(ret!==undefined){val=ret;}}if(fn&&donative!==false&&val!==false&&!(jQuery.nodeName(elem,"a")&&type=="click")){this.triggered=true;try{elem[type]();}catch(e){}}this.triggered=false;}return val;},handle:function(event){var val,ret,namespace,all,handlers;event=arguments[0]=jQuery.event.fix(event||window.event);namespace=event.type.split(".");event.type=namespace[0];namespace=namespace[1];all=!namespace&&!event.exclusive;handlers=(jQuery.data(this,"events")||{})[event.type];for(var j in handlers){var handler=handlers[j];if(all||handler.type==namespace){event.handler=handler;event.data=handler.data;ret=handler.apply(this,arguments);if(val!==false){val=ret;}if(ret===false){event.preventDefault();event.stopPropagation();}}}return val;},fix:function(event){if(event[expando]==true){return event;}var originalEvent=event;event={originalEvent:originalEvent};var props="altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target timeStamp toElement type view wheelDelta which".split(" ");for(var i=props.length;i;i--){event[props[i]]=originalEvent[props[i]];}event[expando]=true;event.preventDefault=function(){if(originalEvent.preventDefault){originalEvent.preventDefault();}originalEvent.returnValue=false;};event.stopPropagation=function(){if(originalEvent.stopPropagation){originalEvent.stopPropagation();}originalEvent.cancelBubble=true;};event.timeStamp=event.timeStamp||now();if(!event.target){event.target=event.srcElement||document;}if(event.target.nodeType==3){event.target=event.target.parentNode;}if(!event.relatedTarget&&event.fromElement){event.relatedTarget=event.fromElement==event.target?event.toElement:event.fromElement;}if(event.pageX==null&&event.clientX!=null){var doc=document.documentElement,body=document.body;event.pageX=event.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc.clientLeft||0);event.pageY=event.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc.clientTop||0);}if(!event.which&&((event.charCode||event.charCode===0)?event.charCode:event.keyCode)){event.which=event.charCode||event.keyCode;}if(!event.metaKey&&event.ctrlKey){event.metaKey=event.ctrlKey;}if(!event.which&&event.button){event.which=(event.button&1?1:(event.button&2?3:(event.button&4?2:0)));}return event;},proxy:function(fn,proxy){proxy.guid=fn.guid=fn.guid||proxy.guid||this.guid++;return proxy;},special:{ready:{setup:function(){bindReady();return;},teardown:function(){return;}},mouseenter:{setup:function(){if(jQuery.browser.msie){return false;}jQuery(this).bind("mouseover",jQuery.event.special.mouseenter.handler);return true;},teardown:function(){if(jQuery.browser.msie){return false;}jQuery(this).unbind("mouseover",jQuery.event.special.mouseenter.handler);return true;},handler:function(event){if(withinElement(event,this)){return true;}event.type="mouseenter";return jQuery.event.handle.apply(this,arguments);}},mouseleave:{setup:function(){if(jQuery.browser.msie){return false;}jQuery(this).bind("mouseout",jQuery.event.special.mouseleave.handler);return true;},teardown:function(){if(jQuery.browser.msie){return false;}jQuery(this).unbind("mouseout",jQuery.event.special.mouseleave.handler);return true;},handler:function(event){if(withinElement(event,this)){return true;}event.type="mouseleave";return jQuery.event.handle.apply(this,arguments);}}}};jQuery.fn.extend({bind:function(type,data,fn){return type=="unload"?this.one(type,data,fn):this.each(function(){jQuery.event.add(this,type,fn||data,fn&&data);});},one:function(type,data,fn){var one=jQuery.event.proxy(fn||data,function(event){jQuery(this).unbind(event,one);return(fn||data).apply(this,arguments);});return this.each(function(){jQuery.event.add(this,type,one,fn&&data);});},unbind:function(type,fn){return this.each(function(){jQuery.event.remove(this,type,fn);});},trigger:function(type,data,fn){return this.each(function(){jQuery.event.trigger(type,data,this,true,fn);});},triggerHandler:function(type,data,fn){return this[0]&&jQuery.event.trigger(type,data,this[0],false,fn);},toggle:function(fn){var args=arguments,i=1;while(i<args.length){jQuery.event.proxy(fn,args[i++]);}return this.click(jQuery.event.proxy(fn,function(event){this.lastToggle=(this.lastToggle||0)%i;event.preventDefault();return args[this.lastToggle++].apply(this,arguments)||false;}));},hover:function(fnOver,fnOut){return this.bind("mouseenter",fnOver).bind("mouseleave",fnOut);},ready:function(fn){bindReady();if(jQuery.isReady){fn.call(document,jQuery);}else{jQuery.readyList.push(function(){return fn.call(this,jQuery);});}return this;}});jQuery.extend({isReady:false,readyList:[],ready:function(){if(!jQuery.isReady){jQuery.isReady=true;if(jQuery.readyList){jQuery.each(jQuery.readyList,function(){this.call(document);});jQuery.readyList=null;}jQuery(document).triggerHandler("ready");}}});var readyBound=false;function bindReady(){if(readyBound){return;}readyBound=true;if(document.addEventListener&&!jQuery.browser.opera){document.addEventListener("DOMContentLoaded",jQuery.ready,false);}if(jQuery.browser.msie&&window==top){(function(){if(jQuery.isReady){return;}try{document.documentElement.doScroll("left");}catch(error){setTimeout(arguments.callee,0);return;}jQuery.ready();})();}if(jQuery.browser.opera){document.addEventListener("DOMContentLoaded",function(){if(jQuery.isReady){return;}for(var i=0;i<document.styleSheets.length;i++){if(document.styleSheets[i].disabled){setTimeout(arguments.callee,0);return;}}jQuery.ready();},false);}if(jQuery.browser.safari){var numStyles;(function(){if(jQuery.isReady){return;}if(document.readyState!="loaded"&&document.readyState!="complete"){setTimeout(arguments.callee,0);return;}if(numStyles===undefined){numStyles=jQuery("style, link[rel=stylesheet]").length;}if(document.styleSheets.length!=numStyles){setTimeout(arguments.callee,0);return;}jQuery.ready();})();}jQuery.event.add(window,"load",jQuery.ready);}jQuery.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,change,select,submit,keydown,keypress,keyup,error").split(","),function(i,name){jQuery.fn[name]=function(fn){return fn?this.bind(name,fn):this.trigger(name);};});var withinElement=function(event,elem){var parent=event.relatedTarget;while(parent&&parent!=elem){try{parent=parent.parentNode;}catch(error){parent=elem;}}return parent==elem;};jQuery(window).bind("unload",function(){jQuery("*").add(document).unbind();});jQuery.fn.extend({_load:jQuery.fn.load,load:function(url,params,callback){if(typeof url!="string"){return this._load(url);}var off=url.indexOf(" ");if(off>=0){var selector=url.slice(off,url.length);url=url.slice(0,off);}callback=callback||function(){};var type="GET";if(params){if(jQuery.isFunction(params)){callback=params;params=null;}else{params=jQuery.param(params);type="POST";}}var self=this;jQuery.ajax({url:url,type:type,dataType:"html",data:params,complete:function(res,status){if(status=="success"||status=="notmodified"){self.html(selector?jQuery("<div/>").append(res.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(selector):res.responseText);}self.each(callback,[res.responseText,status,res]);}});return this;},serialize:function(){return jQuery.param(this.serializeArray());},serializeArray:function(){return this.map(function(){return jQuery.nodeName(this,"form")?jQuery.makeArray(this.elements):this;}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type));}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:val.constructor==Array?jQuery.map(val,function(val,i){return{name:elem.name,value:val};}):{name:elem.name,value:val};}).get();}});jQuery.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(i,o){jQuery.fn[o]=function(f){return this.bind(o,f);};});var jsc=now();jQuery.extend({get:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data=null;}return jQuery.ajax({type:"GET",url:url,data:data,success:callback,dataType:type});},getScript:function(url,callback){return jQuery.get(url,null,callback,"script");},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json");},post:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data={};}return jQuery.ajax({type:"POST",url:url,data:data,success:callback,dataType:type});},ajaxSetup:function(settings){jQuery.extend(jQuery.ajaxSettings,settings);},ajaxSettings:{url:location.href,global:true,type:"GET",timeout:0,contentType:"application/x-www-form-urlencoded",processData:true,async:true,data:null,username:null,password:null,accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(s){s=jQuery.extend(true,s,jQuery.extend(true,{},jQuery.ajaxSettings,s));var jsonp,jsre=/=\?(&|$)/g,status,data,type=s.type.toUpperCase();if(s.data&&s.processData&&typeof s.data!="string"){s.data=jQuery.param(s.data);}if(s.dataType=="jsonp"){if(type=="GET"){if(!s.url.match(jsre)){s.url+=(s.url.match(/\?/)?"&":"?")+(s.jsonp||"callback")+"=?";}}else{if(!s.data||!s.data.match(jsre)){s.data=(s.data?s.data+"&":"")+(s.jsonp||"callback")+"=?";}}s.dataType="json";}if(s.dataType=="json"&&(s.data&&s.data.match(jsre)||s.url.match(jsre))){jsonp="jsonp"+jsc++;if(s.data){s.data=(s.data+"").replace(jsre,"="+jsonp+"$1");}s.url=s.url.replace(jsre,"="+jsonp+"$1");s.dataType="script";window[jsonp]=function(tmp){data=tmp;success();complete();window[jsonp]=undefined;try{delete window[jsonp];}catch(e){}if(head){head.removeChild(script);}};}if(s.dataType=="script"&&s.cache==null){s.cache=false;}if(s.cache===false&&type=="GET"){var ts=now();var ret=s.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+ts+"$2");s.url=ret+((ret==s.url)?(s.url.match(/\?/)?"&":"?")+"_="+ts:"");}if(s.data&&type=="GET"){s.url+=(s.url.match(/\?/)?"&":"?")+s.data;s.data=null;}if(s.global&&!jQuery.active++){jQuery.event.trigger("ajaxStart");}var remote=/^(?:\w+:)?\/\/([^\/?#]+)/;if(s.dataType=="script"&&type=="GET"&&remote.test(s.url)&&remote.exec(s.url)[1]!=location.host){var head=document.getElementsByTagName("head")[0];var script=document.createElement("script");script.src=s.url;if(s.scriptCharset){script.charset=s.scriptCharset;}if(!jsonp){var done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){done=true;success();complete();head.removeChild(script);}};}head.appendChild(script);return undefined;}var requestDone=false;var xhr=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();if(s.username){xhr.open(type,s.url,s.async,s.username,s.password);}else{xhr.open(type,s.url,s.async);}try{if(s.data){xhr.setRequestHeader("Content-Type",s.contentType);}if(s.ifModified){xhr.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url]||"Thu, 01 Jan 1970 00:00:00 GMT");}xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");xhr.setRequestHeader("Accept",s.dataType&&s.accepts[s.dataType]?s.accepts[s.dataType]+", */*":s.accepts._default);}catch(e){}if(s.beforeSend&&s.beforeSend(xhr,s)===false){s.global&&jQuery.active--;xhr.abort();return false;}if(s.global){jQuery.event.trigger("ajaxSend",[xhr,s]);}var onreadystatechange=function(isTimeout){if(!requestDone&&xhr&&(xhr.readyState==4||isTimeout=="timeout")){requestDone=true;if(ival){clearInterval(ival);ival=null;}status=isTimeout=="timeout"&&"timeout"||!jQuery.httpSuccess(xhr)&&"error"||s.ifModified&&jQuery.httpNotModified(xhr,s.url)&&"notmodified"||"success";if(status=="success"){try{data=jQuery.httpData(xhr,s.dataType,s.dataFilter);}catch(e){status="parsererror";}}if(status=="success"){var modRes;try{modRes=xhr.getResponseHeader("Last-Modified");}catch(e){}if(s.ifModified&&modRes){jQuery.lastModified[s.url]=modRes;}if(!jsonp){success();}}else{jQuery.handleError(s,xhr,status);}complete();if(s.async){xhr=null;}}};if(s.async){var ival=setInterval(onreadystatechange,13);if(s.timeout>0){setTimeout(function(){if(xhr){xhr.abort();if(!requestDone){onreadystatechange("timeout");}}},s.timeout);}}try{xhr.send(s.data);}catch(e){jQuery.handleError(s,xhr,null,e);}if(!s.async){onreadystatechange();}function success(){if(s.success){s.success(data,status);}if(s.global){jQuery.event.trigger("ajaxSuccess",[xhr,s]);}}function complete(){if(s.complete){s.complete(xhr,status);}if(s.global){jQuery.event.trigger("ajaxComplete",[xhr,s]);}if(s.global&&!--jQuery.active){jQuery.event.trigger("ajaxStop");}}return xhr;},handleError:function(s,xhr,status,e){if(s.error){s.error(xhr,status,e);}if(s.global){jQuery.event.trigger("ajaxError",[xhr,s,e]);}},active:0,httpSuccess:function(xhr){try{return !xhr.status&&location.protocol=="file:"||(xhr.status>=200&&xhr.status<300)||xhr.status==304||xhr.status==1223||jQuery.browser.safari&&xhr.status==undefined;}catch(e){}return false;},httpNotModified:function(xhr,url){try{var xhrRes=xhr.getResponseHeader("Last-Modified");return xhr.status==304||xhrRes==jQuery.lastModified[url]||jQuery.browser.safari&&xhr.status==undefined;}catch(e){}return false;},httpData:function(xhr,type,filter){var ct=xhr.getResponseHeader("content-type"),xml=type=="xml"||!type&&ct&&ct.indexOf("xml")>=0,data=xml?xhr.responseXML:xhr.responseText;if(xml&&data.documentElement.tagName=="parsererror"){throw"parsererror";}if(filter){data=filter(data,type);}if(type=="script"){jQuery.globalEval(data);}if(type=="json"){data=eval("("+data+")");}return data;},param:function(a){var s=[];if(a.constructor==Array||a.jquery){jQuery.each(a,function(){s.push(encodeURIComponent(this.name)+"="+encodeURIComponent(this.value));});}else{for(var j in a){if(a[j]&&a[j].constructor==Array){jQuery.each(a[j],function(){s.push(encodeURIComponent(j)+"="+encodeURIComponent(this));});}else{s.push(encodeURIComponent(j)+"="+encodeURIComponent(jQuery.isFunction(a[j])?a[j]():a[j]));}}}return s.join("&").replace(/%20/g,"+");}});jQuery.fn.extend({show:function(speed,callback){return speed?this.animate({height:"show",width:"show",opacity:"show"},speed,callback):this.filter(":hidden").each(function(){this.style.display=this.oldblock||"";if(jQuery.css(this,"display")=="none"){var elem=jQuery("<"+this.tagName+" />").appendTo("body");this.style.display=elem.css("display");if(this.style.display=="none"){this.style.display="block";}elem.remove();}}).end();},hide:function(speed,callback){return speed?this.animate({height:"hide",width:"hide",opacity:"hide"},speed,callback):this.filter(":visible").each(function(){this.oldblock=this.oldblock||jQuery.css(this,"display");this.style.display="none";}).end();},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){return jQuery.isFunction(fn)&&jQuery.isFunction(fn2)?this._toggle.apply(this,arguments):fn?this.animate({height:"toggle",width:"toggle",opacity:"toggle"},fn,fn2):this.each(function(){jQuery(this)[jQuery(this).is(":hidden")?"show":"hide"]();});},slideDown:function(speed,callback){return this.animate({height:"show"},speed,callback);},slideUp:function(speed,callback){return this.animate({height:"hide"},speed,callback);},slideToggle:function(speed,callback){return this.animate({height:"toggle"},speed,callback);},fadeIn:function(speed,callback){return this.animate({opacity:"show"},speed,callback);},fadeOut:function(speed,callback){return this.animate({opacity:"hide"},speed,callback);},fadeTo:function(speed,to,callback){return this.animate({opacity:to},speed,callback);},animate:function(prop,speed,easing,callback){var optall=jQuery.speed(speed,easing,callback);return this[optall.queue===false?"each":"queue"](function(){if(this.nodeType!=1){return false;}var opt=jQuery.extend({},optall),p,hidden=jQuery(this).is(":hidden"),self=this;for(p in prop){if(prop[p]=="hide"&&hidden||prop[p]=="show"&&!hidden){return opt.complete.call(this);}if(p=="height"||p=="width"){opt.display=jQuery.css(this,"display");opt.overflow=this.style.overflow;}}if(opt.overflow!=null){this.style.overflow="hidden";}opt.curAnim=jQuery.extend({},prop);jQuery.each(prop,function(name,val){var e=new jQuery.fx(self,opt,name);if(/toggle|show|hide/.test(val)){e[val=="toggle"?hidden?"show":"hide":val](prop);}else{var parts=val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),start=e.cur(true)||0;if(parts){var end=parseFloat(parts[2]),unit=parts[3]||"px";if(unit!="px"){self.style[name]=(end||1)+unit;start=((end||1)/e.cur(true))*start;self.style[name]=start+unit;}if(parts[1]){end=((parts[1]=="-="?-1:1)*end)+start;}e.custom(start,end,unit);}else{e.custom(start,val,"");}}});return true;});},queue:function(type,fn){if(jQuery.isFunction(type)||(type&&type.constructor==Array)){fn=type;type="fx";}if(!type||(typeof type=="string"&&!fn)){return queue(this[0],type);}return this.each(function(){if(fn.constructor==Array){queue(this,type,fn);}else{queue(this,type).push(fn);if(queue(this,type).length==1){fn.call(this);}}});},stop:function(clearQueue,gotoEnd){var timers=jQuery.timers;if(clearQueue){this.queue([]);}this.each(function(){for(var i=timers.length-1;i>=0;i--){if(timers[i].elem==this){if(gotoEnd){timers[i](true);}timers.splice(i,1);}}});if(!gotoEnd){this.dequeue();}return this;}});var queue=function(elem,type,array){if(elem){type=type||"fx";var q=jQuery.data(elem,type+"queue");if(!q||array){q=jQuery.data(elem,type+"queue",jQuery.makeArray(array));}}return q;};jQuery.fn.dequeue=function(type){type=type||"fx";return this.each(function(){var q=queue(this,type);q.shift();if(q.length){q[0].call(this);}});};jQuery.extend({speed:function(speed,easing,fn){var opt=speed&&speed.constructor==Object?speed:{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&easing.constructor!=Function&&easing};opt.duration=(opt.duration&&opt.duration.constructor==Number?opt.duration:jQuery.fx.speeds[opt.duration])||jQuery.fx.speeds.def;opt.old=opt.complete;opt.complete=function(){if(opt.queue!==false){jQuery(this).dequeue();}if(jQuery.isFunction(opt.old)){opt.old.call(this);}};return opt;},easing:{linear:function(p,n,firstNum,diff){return firstNum+diff*p;},swing:function(p,n,firstNum,diff){return((-Math.cos(p*Math.PI)/2)+0.5)*diff+firstNum;}},timers:[],timerId:null,fx:function(elem,options,prop){this.options=options;this.elem=elem;this.prop=prop;if(!options.orig){options.orig={};}}});jQuery.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this);}(jQuery.fx.step[this.prop]||jQuery.fx.step._default)(this);if(this.prop=="height"||this.prop=="width"){this.elem.style.display="block";}},cur:function(force){if(this.elem[this.prop]!=null&&this.elem.style[this.prop]==null){return this.elem[this.prop];}var r=parseFloat(jQuery.css(this.elem,this.prop,force));return r&&r>-10000?r:parseFloat(jQuery.curCSS(this.elem,this.prop))||0;},custom:function(from,to,unit){this.startTime=now();this.start=from;this.end=to;this.unit=unit||this.unit||"px";this.now=this.start;this.pos=this.state=0;this.update();var self=this;function t(gotoEnd){return self.step(gotoEnd);}t.elem=this.elem;jQuery.timers.push(t);if(jQuery.timerId==null){jQuery.timerId=setInterval(function(){var timers=jQuery.timers;for(var i=0;i<timers.length;i++){if(!timers[i]()){timers.splice(i--,1);}}if(!timers.length){clearInterval(jQuery.timerId);jQuery.timerId=null;}},13);}},show:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.show=true;this.custom(0,this.cur());if(this.prop=="width"||this.prop=="height"){this.elem.style[this.prop]="1px";}jQuery(this.elem).show();},hide:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0);},step:function(gotoEnd){var t=now();if(gotoEnd||t>this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var done=true;for(var i in this.options.curAnim){if(this.options.curAnim[i]!==true){done=false;}}if(done){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(jQuery.css(this.elem,"display")=="none"){this.elem.style.display="block";}}if(this.options.hide){this.elem.style.display="none";}if(this.options.hide||this.options.show){for(var p in this.options.curAnim){jQuery.attr(this.elem.style,p,this.options.orig[p]);}}}if(done){this.options.complete.call(this.elem);}return false;}else{var n=t-this.startTime;this.state=n/this.options.duration;this.pos=jQuery.easing[this.options.easing||(jQuery.easing.swing?"swing":"linear")](this.state,n,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update();}return true;}};jQuery.extend(jQuery.fx,{speeds:{slow:600,fast:200,def:400},step:{scrollLeft:function(fx){fx.elem.scrollLeft=fx.now;},scrollTop:function(fx){fx.elem.scrollTop=fx.now;},opacity:function(fx){jQuery.attr(fx.elem.style,"opacity",fx.now);},_default:function(fx){fx.elem.style[fx.prop]=fx.now+fx.unit;}}});jQuery.fn.offset=function(){var left=0,top=0,elem=this[0],results;if(elem){with(jQuery.browser){var parent=elem.parentNode,offsetChild=elem,offsetParent=elem.offsetParent,doc=elem.ownerDocument,safari2=safari&&parseInt(version)<522&&!/adobeair/i.test(userAgent),css=jQuery.curCSS,fixed=css(elem,"position")=="fixed";if(elem.getBoundingClientRect){var box=elem.getBoundingClientRect();add(box.left+Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),box.top+Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));add(-doc.documentElement.clientLeft,-doc.documentElement.clientTop);}else{add(elem.offsetLeft,elem.offsetTop);while(offsetParent){add(offsetParent.offsetLeft,offsetParent.offsetTop);if(mozilla&&!/^t(able|d|h)$/i.test(offsetParent.tagName)||safari&&!safari2){border(offsetParent);}if(!fixed&&css(offsetParent,"position")=="fixed"){fixed=true;}offsetChild=/^body$/i.test(offsetParent.tagName)?offsetChild:offsetParent;offsetParent=offsetParent.offsetParent;}while(parent&&parent.tagName&&!/^body|html$/i.test(parent.tagName)){if(!/^inline|table.*$/i.test(css(parent,"display"))){add(-parent.scrollLeft,-parent.scrollTop);}if(mozilla&&css(parent,"overflow")!="visible"){border(parent);}parent=parent.parentNode;}if((safari2&&(fixed||css(offsetChild,"position")=="absolute"))||(mozilla&&css(offsetChild,"position")!="absolute")){add(-doc.body.offsetLeft,-doc.body.offsetTop);}if(fixed){add(Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));}}results={top:top,left:left};}}function border(elem){add(jQuery.curCSS(elem,"borderLeftWidth",true),jQuery.curCSS(elem,"borderTopWidth",true));}function add(l,t){left+=parseInt(l,10)||0;top+=parseInt(t,10)||0;}return results;};jQuery.fn.extend({position:function(){var left=0,top=0,results;if(this[0]){var offsetParent=this.offsetParent(),offset=this.offset(),parentOffset=/^body|html$/i.test(offsetParent[0].tagName)?{top:0,left:0}:offsetParent.offset();offset.top-=num(this,"marginTop");offset.left-=num(this,"marginLeft");parentOffset.top+=num(offsetParent,"borderTopWidth");parentOffset.left+=num(offsetParent,"borderLeftWidth");results={top:offset.top-parentOffset.top,left:offset.left-parentOffset.left};}return results;},offsetParent:function(){var offsetParent=this[0].offsetParent;while(offsetParent&&(!/^body|html$/i.test(offsetParent.tagName)&&jQuery.css(offsetParent,"position")=="static")){offsetParent=offsetParent.offsetParent;}return jQuery(offsetParent);}});jQuery.each(["Left","Top"],function(i,name){var method="scroll"+name;jQuery.fn[method]=function(val){if(!this[0]){return;}return val!=undefined?this.each(function(){this==window||this==document?window.scrollTo(!i?val:jQuery(window).scrollLeft(),i?val:jQuery(window).scrollTop()):this[method]=val;}):this[0]==window||this[0]==document?self[i?"pageYOffset":"pageXOffset"]||jQuery.boxModel&&document.documentElement[method]||document.body[method]:this[0][method];};});jQuery.each(["Height","Width"],function(i,name){var tl=i?"Left":"Top",br=i?"Right":"Bottom";jQuery.fn["inner"+name]=function(){return this[name.toLowerCase()]()+num(this,"padding"+tl)+num(this,"padding"+br);};jQuery.fn["outer"+name]=function(margin){return this["inner"+name]()+num(this,"border"+tl+"Width")+num(this,"border"+br+"Width")+(margin?num(this,"margin"+tl)+num(this,"margin"+br):0);};});})();(function(A,w){function ma(){if(!c.isReady){try{s.documentElement.doScroll("left");}catch(a){setTimeout(ma,1);return;}c.ready();}}function Qa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b);}function X(a,b,d,f,e,j){var i=a.length;if(typeof b==="object"){for(var o in b){X(a,o,b[o],f,e,d);}return a;}if(d!==w){f=!j&&f&&c.isFunction(d);for(o=0;o<i;o++){e(a[o],b,f?d.call(a[o],o,e(a[o],b)):d,j);}return a;}return i?e(a[0],b):w;}function J(){return(new Date).getTime();}function Y(){return false;}function Z(){return true;}function na(a,b,d){d[0].type=a;return c.event.handle.apply(b,d);}function oa(a){var b,d=[],f=[],e=arguments,j,i,o,k,n,r;i=c.data(this,"events");if(!(a.liveFired===this||!i||!i.live||a.button&&a.type==="click")){a.liveFired=this;var u=i.live.slice(0);for(k=0;k<u.length;k++){i=u[k];i.origType.replace(O,"")===a.type?f.push(i.selector):u.splice(k--,1);}j=c(a.target).closest(f,a.currentTarget);n=0;for(r=j.length;n<r;n++){for(k=0;k<u.length;k++){i=u[k];if(j[n].selector===i.selector){o=j[n].elem;f=null;if(i.preType==="mouseenter"||i.preType==="mouseleave"){f=c(a.relatedTarget).closest(i.selector)[0];}if(!f||f!==o){d.push({elem:o,handleObj:i});}}}}n=0;for(r=d.length;n<r;n++){j=d[n];a.currentTarget=j.elem;a.data=j.handleObj.data;a.handleObj=j.handleObj;if(j.handleObj.origHandler.apply(j.elem,e)===false){b=false;break;}}return b;}}function pa(a,b){return"live."+(a&&a!=="*"?a+".":"")+b.replace(/\./g,"`").replace(/ /g,"&");}function qa(a){return !a||!a.parentNode||a.parentNode.nodeType===11;}function ra(a,b){var d=0;b.each(function(){if(this.nodeName===(a[d]&&a[d].nodeName)){var f=c.data(a[d++]),e=c.data(this,f);if(f=f&&f.events){delete e.handle;e.events={};for(var j in f){for(var i in f[j]){c.event.add(this,j,f[j][i],f[j][i].data);}}}}});}function sa(a,b,d){var f,e,j;b=b&&b[0]?b[0].ownerDocument||b[0]:s;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&b===s&&!ta.test(a[0])&&(c.support.checkClone||!ua.test(a[0]))){e=true;if(j=c.fragments[a[0]]){if(j!==1){f=j;}}}if(!f){f=b.createDocumentFragment();c.clean(a,b,f,d);}if(e){c.fragments[a[0]]=j?f:1;}return{fragment:f,cacheable:e};}function K(a,b){var d={};c.each(va.concat.apply([],va.slice(0,b)),function(){d[this]=a;});return d;}function wa(a){return"scrollTo" in a&&a.document?a:a.nodeType===9?a.defaultView||a.parentWindow:false;}var c=function(a,b){return new c.fn.init(a,b);},Ra=A.jQuery,Sa=A.$,s=A.document,T,Ta=/^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,Ua=/^.[^:#\[\.,]*$/,Va=/\S/,Wa=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,Xa=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,P=navigator.userAgent,xa=false,Q=[],L,$=Object.prototype.toString,aa=Object.prototype.hasOwnProperty,ba=Array.prototype.push,R=Array.prototype.slice,ya=Array.prototype.indexOf;c.fn=c.prototype={init:function(a,b){var d,f;if(!a){return this;}if(a.nodeType){this.context=this[0]=a;this.length=1;return this;}if(a==="body"&&!b){this.context=s;this[0]=s.body;this.selector="body";this.length=1;return this;}if(typeof a==="string"){if((d=Ta.exec(a))&&(d[1]||!b)){if(d[1]){f=b?b.ownerDocument||b:s;if(a=Xa.exec(a)){if(c.isPlainObject(b)){a=[s.createElement(a[1])];c.fn.attr.call(a,b,true);}else{a=[f.createElement(a[1])];}}else{a=sa([d[1]],[f]);a=(a.cacheable?a.fragment.cloneNode(true):a.fragment).childNodes;}return c.merge(this,a);}else{if(b=s.getElementById(d[2])){if(b.id!==d[2]){return T.find(a);}this.length=1;this[0]=b;}this.context=s;this.selector=a;return this;}}else{if(!b&&/^\w+$/.test(a)){this.selector=a;this.context=s;a=s.getElementsByTagName(a);return c.merge(this,a);}else{return !b||b.jquery?(b||T).find(a):c(b).find(a);}}}else{if(c.isFunction(a)){return T.ready(a);}}if(a.selector!==w){this.selector=a.selector;this.context=a.context;}return c.makeArray(a,this);},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length;},toArray:function(){return R.call(this,0);},get:function(a){return a==null?this.toArray():a<0?this.slice(a)[0]:this[a];},pushStack:function(a,b,d){var f=c();c.isArray(a)?ba.apply(f,a):c.merge(f,a);f.prevObject=this;f.context=this.context;if(b==="find"){f.selector=this.selector+(this.selector?" ":"")+d;}else{if(b){f.selector=this.selector+"."+b+"("+d+")";}}return f;},each:function(a,b){return c.each(this,a,b);},ready:function(a){c.bindReady();if(c.isReady){a.call(s,c);}else{Q&&Q.push(a);}return this;},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1);},first:function(){return this.eq(0);},last:function(){return this.eq(-1);},slice:function(){return this.pushStack(R.apply(this,arguments),"slice",R.call(arguments).join(","));},map:function(a){return this.pushStack(c.map(this,function(b,d){return a.call(b,d,b);}));},end:function(){return this.prevObject||c(null);},push:ba,sort:[].sort,splice:[].splice};c.fn.init.prototype=c.fn;c.extend=c.fn.extend=function(){var a=arguments[0]||{},b=1,d=arguments.length,f=false,e,j,i,o;if(typeof a==="boolean"){f=a;a=arguments[1]||{};b=2;}if(typeof a!=="object"&&!c.isFunction(a)){a={};}if(d===b){a=this;--b;}for(;b<d;b++){if((e=arguments[b])!=null){for(j in e){i=a[j];o=e[j];if(a!==o){if(f&&o&&(c.isPlainObject(o)||c.isArray(o))){i=i&&(c.isPlainObject(i)||c.isArray(i))?i:c.isArray(o)?[]:{};a[j]=c.extend(f,i,o);}else{if(o!==w){a[j]=o;}}}}}}return a;};c.extend({noConflict:function(a){A.$=Sa;if(a){A.jQuery=Ra;}return c;},isReady:false,ready:function(){if(!c.isReady){if(!s.body){return setTimeout(c.ready,13);}c.isReady=true;if(Q){for(var a,b=0;a=Q[b++];){a.call(s,c);}Q=null;}c.fn.triggerHandler&&c(s).triggerHandler("ready");}},bindReady:function(){if(!xa){xa=true;if(s.readyState==="complete"){return c.ready();}if(s.addEventListener){s.addEventListener("DOMContentLoaded",L,false);A.addEventListener("load",c.ready,false);}else{if(s.attachEvent){s.attachEvent("onreadystatechange",L);A.attachEvent("onload",c.ready);var a=false;try{a=A.frameElement==null;}catch(b){}s.documentElement.doScroll&&a&&ma();}}}},isFunction:function(a){return $.call(a)==="[object Function]";},isArray:function(a){return $.call(a)==="[object Array]";},isPlainObject:function(a){if(!a||$.call(a)!=="[object Object]"||a.nodeType||a.setInterval){return false;}if(a.constructor&&!aa.call(a,"constructor")&&!aa.call(a.constructor.prototype,"isPrototypeOf")){return false;}var b;for(b in a){}return b===w||aa.call(a,b);},isEmptyObject:function(a){for(var b in a){return false;}return true;},error:function(a){throw a;},parseJSON:function(a){if(typeof a!=="string"||!a){return null;}a=c.trim(a);if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){return A.JSON&&A.JSON.parse?A.JSON.parse(a):(new Function("return "+a))();}else{c.error("Invalid JSON: "+a);}},noop:function(){},globalEval:function(a){if(a&&Va.test(a)){var b=s.getElementsByTagName("head")[0]||s.documentElement,d=s.createElement("script");d.type="text/javascript";if(c.support.scriptEval){d.appendChild(s.createTextNode(a));}else{d.text=a;}b.insertBefore(d,b.firstChild);b.removeChild(d);}},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase();},each:function(a,b,d){var f,e=0,j=a.length,i=j===w||c.isFunction(a);if(d){if(i){for(f in a){if(b.apply(a[f],d)===false){break;}}}else{for(;e<j;){if(b.apply(a[e++],d)===false){break;}}}}else{if(i){for(f in a){if(b.call(a[f],f,a[f])===false){break;}}}else{for(d=a[0];e<j&&b.call(d,e,d)!==false;d=a[++e]){}}}return a;},trim:function(a){return(a||"").replace(Wa,"");},makeArray:function(a,b){b=b||[];if(a!=null){a.length==null||typeof a==="string"||c.isFunction(a)||typeof a!=="function"&&a.setInterval?ba.call(b,a):c.merge(b,a);}return b;},inArray:function(a,b){if(b.indexOf){return b.indexOf(a);}for(var d=0,f=b.length;d<f;d++){if(b[d]===a){return d;}}return -1;},merge:function(a,b){var d=a.length,f=0;if(typeof b.length==="number"){for(var e=b.length;f<e;f++){a[d++]=b[f];}}else{for(;b[f]!==w;){a[d++]=b[f++];}}a.length=d;return a;},grep:function(a,b,d){for(var f=[],e=0,j=a.length;e<j;e++){!d!==!b(a[e],e)&&f.push(a[e]);}return f;},map:function(a,b,d){for(var f=[],e,j=0,i=a.length;j<i;j++){e=b(a[j],j,d);if(e!=null){f[f.length]=e;}}return f.concat.apply([],f);},guid:1,proxy:function(a,b,d){if(arguments.length===2){if(typeof b==="string"){d=a;a=d[b];b=w;}else{if(b&&!c.isFunction(b)){d=b;b=w;}}}if(!b&&a){b=function(){return a.apply(d||this,arguments);};}if(a){b.guid=a.guid=a.guid||b.guid||c.guid++;}return b;},uaMatch:function(a){a=a.toLowerCase();a=/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version)?[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||!/compatible/.test(a)&&/(mozilla)(?:.*? rv:([\w.]+))?/.exec(a)||[];return{browser:a[1]||"",version:a[2]||"0"};},browser:{}});P=c.uaMatch(P);if(P.browser){c.browser[P.browser]=true;c.browser.version=P.version;}if(c.browser.webkit){c.browser.safari=true;}if(ya){c.inArray=function(a,b){return ya.call(b,a);};}T=c(s);if(s.addEventListener){L=function(){s.removeEventListener("DOMContentLoaded",L,false);c.ready();};}else{if(s.attachEvent){L=function(){if(s.readyState==="complete"){s.detachEvent("onreadystatechange",L);c.ready();}};}}(function(){c.support={};var a=s.documentElement,b=s.createElement("script"),d=s.createElement("div"),f="script"+J();d.style.display="none";d.innerHTML="   <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";var e=d.getElementsByTagName("*"),j=d.getElementsByTagName("a")[0];if(!(!e||!e.length||!j)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(j.getAttribute("style")),hrefNormalized:j.getAttribute("href")==="/a",opacity:/^0.55$/.test(j.style.opacity),cssFloat:!!j.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:s.createElement("select").appendChild(s.createElement("option")).selected,parentNode:d.removeChild(d.appendChild(s.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};b.type="text/javascript";try{b.appendChild(s.createTextNode("window."+f+"=1;"));}catch(i){}a.insertBefore(b,a.firstChild);if(A[f]){c.support.scriptEval=true;delete A[f];}try{delete b.test;}catch(o){c.support.deleteExpando=false;}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function k(){c.support.noCloneEvent=false;d.detachEvent("onclick",k);});d.cloneNode(true).fireEvent("onclick");}d=s.createElement("div");d.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";a=s.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var k=s.createElement("div");k.style.width=k.style.paddingLeft="1px";s.body.appendChild(k);c.boxModel=c.support.boxModel=k.offsetWidth===2;s.body.removeChild(k).style.display="none";});a=function(k){var n=s.createElement("div");k="on"+k;var r=k in n;if(!r){n.setAttribute(k,"return;");r=typeof n[k]==="function";}return r;};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=e=j=null;}})();c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var G="jQuery"+J(),Ya=0,za={};c.extend({cache:{},expando:G,noData:{embed:true,object:true,applet:true},data:function(a,b,d){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var f=a[G],e=c.cache;if(!f&&typeof b==="string"&&d===w){return null;}f||(f=++Ya);if(typeof b==="object"){a[G]=f;e[f]=c.extend(true,{},b);}else{if(!e[f]){a[G]=f;e[f]={};}}a=e[f];if(d!==w){a[b]=d;}return typeof b==="string"?a[b]:a;}},removeData:function(a,b){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var d=a[G],f=c.cache,e=f[d];if(b){if(e){delete e[b];c.isEmptyObject(e)&&c.removeData(a);}}else{if(c.support.deleteExpando){delete a[c.expando];}else{a.removeAttribute&&a.removeAttribute(c.expando);}delete f[d];}}}});c.fn.extend({data:function(a,b){if(typeof a==="undefined"&&this.length){return c.data(this[0]);}else{if(typeof a==="object"){return this.each(function(){c.data(this,a);});}}var d=a.split(".");d[1]=d[1]?"."+d[1]:"";if(b===w){var f=this.triggerHandler("getData"+d[1]+"!",[d[0]]);if(f===w&&this.length){f=c.data(this[0],a);}return f===w&&d[1]?this.data(d[0]):f;}else{return this.trigger("setData"+d[1]+"!",[d[0],b]).each(function(){c.data(this,a,b);});}},removeData:function(a){return this.each(function(){c.removeData(this,a);});}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var f=c.data(a,b);if(!d){return f||[];}if(!f||c.isArray(d)){f=c.data(a,b,c.makeArray(d));}else{f.push(d);}return f;}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),f=d.shift();if(f==="inprogress"){f=d.shift();}if(f){b==="fx"&&d.unshift("inprogress");f.call(a,function(){c.dequeue(a,b);});}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx";}if(b===w){return c.queue(this[0],a);}return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a);});},dequeue:function(a){return this.each(function(){c.dequeue(this,a);});},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b);},a);});},clearQueue:function(a){return this.queue(a||"fx",[]);}});var Aa=/[\n\t]/g,ca=/\s+/,Za=/\r/g,$a=/href|src|style/,ab=/(button|input)/i,bb=/(button|input|object|select|textarea)/i,cb=/^(a|area)$/i,Ba=/radio|checkbox/;c.fn.extend({attr:function(a,b){return X(this,a,b,true,c.attr);},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a);});},addClass:function(a){if(c.isFunction(a)){return this.each(function(n){var r=c(this);r.addClass(a.call(this,n,r.attr("class")));});}if(a&&typeof a==="string"){for(var b=(a||"").split(ca),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1){if(e.className){for(var j=" "+e.className+" ",i=e.className,o=0,k=b.length;o<k;o++){if(j.indexOf(" "+b[o]+" ")<0){i+=" "+b[o];}}e.className=c.trim(i);}else{e.className=a;}}}}return this;},removeClass:function(a){if(c.isFunction(a)){return this.each(function(k){var n=c(this);n.removeClass(a.call(this,k,n.attr("class")));});}if(a&&typeof a==="string"||a===w){for(var b=(a||"").split(ca),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1&&e.className){if(a){for(var j=(" "+e.className+" ").replace(Aa," "),i=0,o=b.length;i<o;i++){j=j.replace(" "+b[i]+" "," ");}e.className=c.trim(j);}else{e.className="";}}}}return this;},toggleClass:function(a,b){var d=typeof a,f=typeof b==="boolean";if(c.isFunction(a)){return this.each(function(e){var j=c(this);j.toggleClass(a.call(this,e,j.attr("class"),b),b);});}return this.each(function(){if(d==="string"){for(var e,j=0,i=c(this),o=b,k=a.split(ca);e=k[j++];){o=f?o:!i.hasClass(e);i[o?"addClass":"removeClass"](e);}}else{if(d==="undefined"||d==="boolean"){this.className&&c.data(this,"__className__",this.className);this.className=this.className||a===false?"":c.data(this,"__className__")||"";}}});},hasClass:function(a){a=" "+a+" ";for(var b=0,d=this.length;b<d;b++){if((" "+this[b].className+" ").replace(Aa," ").indexOf(a)>-1){return true;}}return false;},val:function(a){if(a===w){var b=this[0];if(b){if(c.nodeName(b,"option")){return(b.attributes.value||{}).specified?b.value:b.text;}if(c.nodeName(b,"select")){var d=b.selectedIndex,f=[],e=b.options;b=b.type==="select-one";if(d<0){return null;}var j=b?d:0;for(d=b?d+1:e.length;j<d;j++){var i=e[j];if(i.selected){a=c(i).val();if(b){return a;}f.push(a);}}return f;}if(Ba.test(b.type)&&!c.support.checkOn){return b.getAttribute("value")===null?"on":b.value;}return(b.value||"").replace(Za,"");}return w;}var o=c.isFunction(a);return this.each(function(k){var n=c(this),r=a;if(this.nodeType===1){if(o){r=a.call(this,k,n.val());}if(typeof r==="number"){r+="";}if(c.isArray(r)&&Ba.test(this.type)){this.checked=c.inArray(n.val(),r)>=0;}else{if(c.nodeName(this,"select")){var u=c.makeArray(r);c("option",this).each(function(){this.selected=c.inArray(c(this).val(),u)>=0;});if(!u.length){this.selectedIndex=-1;}}else{this.value=r;}}}});}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(a,b,d,f){if(!a||a.nodeType===3||a.nodeType===8){return w;}if(f&&b in c.attrFn){return c(a)[b](d);}f=a.nodeType!==1||!c.isXMLDoc(a);var e=d!==w;b=f&&c.props[b]||b;if(a.nodeType===1){var j=$a.test(b);if(b in a&&f&&!j){if(e){b==="type"&&ab.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed");a[b]=d;}if(c.nodeName(a,"form")&&a.getAttributeNode(b)){return a.getAttributeNode(b).nodeValue;}if(b==="tabIndex"){return(b=a.getAttributeNode("tabIndex"))&&b.specified?b.value:bb.test(a.nodeName)||cb.test(a.nodeName)&&a.href?0:w;}return a[b];}if(!c.support.style&&f&&b==="style"){if(e){a.style.cssText=""+d;}return a.style.cssText;}e&&a.setAttribute(b,""+d);a=!c.support.hrefNormalized&&f&&j?a.getAttribute(b,2):a.getAttribute(b);return a===null?w:a;}return c.style(a,b,d);}});var O=/\.(.*)$/,db=function(a){return a.replace(/[^\w\s\.\|`]/g,function(b){return"\\"+b;});};c.event={add:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){if(a.setInterval&&a!==A&&!a.frameElement){a=A;}var e,j;if(d.handler){e=d;d=e.handler;}if(!d.guid){d.guid=c.guid++;}if(j=c.data(a)){var i=j.events=j.events||{},o=j.handle;if(!o){j.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem,arguments):w;};}o.elem=a;b=b.split(" ");for(var k,n=0,r;k=b[n++];){j=e?c.extend({},e):{handler:d,data:f};if(k.indexOf(".")>-1){r=k.split(".");k=r.shift();j.namespace=r.slice(0).sort().join(".");}else{r=[];j.namespace="";}j.type=k;j.guid=d.guid;var u=i[k],z=c.event.special[k]||{};if(!u){u=i[k]=[];if(!z.setup||z.setup.call(a,f,r,o)===false){if(a.addEventListener){a.addEventListener(k,o,false);}else{a.attachEvent&&a.attachEvent("on"+k,o);}}}if(z.add){z.add.call(a,j);if(!j.handler.guid){j.handler.guid=d.guid;}}u.push(j);c.event.global[k]=true;}a=null;}}},global:{},remove:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){var e,j=0,i,o,k,n,r,u,z=c.data(a),C=z&&z.events;if(z&&C){if(b&&b.type){d=b.handler;b=b.type;}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(e in C){c.event.remove(a,e+b);}}else{for(b=b.split(" ");e=b[j++];){n=e;i=e.indexOf(".")<0;o=[];if(!i){o=e.split(".");e=o.shift();k=new RegExp("(^|\\.)"+c.map(o.slice(0).sort(),db).join("\\.(?:.*\\.)?")+"(\\.|$)");}if(r=C[e]){if(d){n=c.event.special[e]||{};for(B=f||0;B<r.length;B++){u=r[B];if(d.guid===u.guid){if(i||k.test(u.namespace)){f==null&&r.splice(B--,1);n.remove&&n.remove.call(a,u);}if(f!=null){break;}}}if(r.length===0||f!=null&&r.length===1){if(!n.teardown||n.teardown.call(a,o)===false){Ca(a,e,z.handle);}delete C[e];}}else{for(var B=0;B<r.length;B++){u=r[B];if(i||k.test(u.namespace)){c.event.remove(a,n,u.handler,B);r.splice(B--,1);}}}}}if(c.isEmptyObject(C)){if(b=z.handle){b.elem=null;}delete z.events;delete z.handle;c.isEmptyObject(z)&&c.removeData(a);}}}}},trigger:function(a,b,d,f){var e=a.type||a;if(!f){a=typeof a==="object"?a[G]?a:c.extend(c.Event(e),a):c.Event(e);if(e.indexOf("!")>=0){a.type=e=e.slice(0,-1);a.exclusive=true;}if(!d){a.stopPropagation();c.event.global[e]&&c.each(c.cache,function(){this.events&&this.events[e]&&c.event.trigger(a,b,this.handle.elem);});}if(!d||d.nodeType===3||d.nodeType===8){return w;}a.result=w;a.target=d;b=c.makeArray(b);b.unshift(a);}a.currentTarget=d;(f=c.data(d,"handle"))&&f.apply(d,b);f=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()])){if(d["on"+e]&&d["on"+e].apply(d,b)===false){a.result=false;}}}catch(j){}if(!a.isPropagationStopped()&&f){c.event.trigger(a,b,f,true);}else{if(!a.isDefaultPrevented()){f=a.target;var i,o=c.nodeName(f,"a")&&e==="click",k=c.event.special[e]||{};if((!k._default||k._default.call(d,a)===false)&&!o&&!(f&&f.nodeName&&c.noData[f.nodeName.toLowerCase()])){try{if(f[e]){if(i=f["on"+e]){f["on"+e]=null;}c.event.triggered=true;f[e]();}}catch(n){}if(i){f["on"+e]=i;}c.event.triggered=false;}}}},handle:function(a){var b,d,f,e;a=arguments[0]=c.event.fix(a||A.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive;if(!b){d=a.type.split(".");a.type=d.shift();f=new RegExp("(^|\\.)"+d.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)");}e=c.data(this,"events");d=e[a.type];if(e&&d){d=d.slice(0);e=0;for(var j=d.length;e<j;e++){var i=d[e];if(b||f.test(i.namespace)){a.handler=i.handler;a.data=i.data;a.handleObj=i;i=i.handler.apply(this,arguments);if(i!==w){a.result=i;if(i===false){a.preventDefault();a.stopPropagation();}}if(a.isImmediatePropagationStopped()){break;}}}}return a.result;},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(a){if(a[G]){return a;}var b=a;a=c.Event(b);for(var d=this.props.length,f;d;){f=this.props[--d];a[f]=b[f];}if(!a.target){a.target=a.srcElement||s;}if(a.target.nodeType===3){a.target=a.target.parentNode;}if(!a.relatedTarget&&a.fromElement){a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement;}if(a.pageX==null&&a.clientX!=null){b=s.documentElement;d=s.body;a.pageX=a.clientX+(b&&b.scrollLeft||d&&d.scrollLeft||0)-(b&&b.clientLeft||d&&d.clientLeft||0);a.pageY=a.clientY+(b&&b.scrollTop||d&&d.scrollTop||0)-(b&&b.clientTop||d&&d.clientTop||0);}if(!a.which&&(a.charCode||a.charCode===0?a.charCode:a.keyCode)){a.which=a.charCode||a.keyCode;}if(!a.metaKey&&a.ctrlKey){a.metaKey=a.ctrlKey;}if(!a.which&&a.button!==w){a.which=a.button&1?1:a.button&2?3:a.button&4?2:0;}return a;},guid:100000000,proxy:c.proxy,special:{ready:{setup:c.bindReady,teardown:c.noop},live:{add:function(a){c.event.add(this,a.origType,c.extend({},a,{handler:oa}));},remove:function(a){var b=true,d=a.origType.replace(O,"");c.each(c.data(this,"events").live||[],function(){if(d===this.origType.replace(O,"")){return b=false;}});b&&c.event.remove(this,a.origType,oa);}},beforeunload:{setup:function(a,b,d){if(this.setInterval){this.onbeforeunload=d;}return false;},teardown:function(a,b){if(this.onbeforeunload===b){this.onbeforeunload=null;}}}}};var Ca=s.removeEventListener?function(a,b,d){a.removeEventListener(b,d,false);}:function(a,b,d){a.detachEvent("on"+b,d);};c.Event=function(a){if(!this.preventDefault){return new c.Event(a);}if(a&&a.type){this.originalEvent=a;this.type=a.type;}else{this.type=a;}this.timeStamp=J();this[G]=true;};c.Event.prototype={preventDefault:function(){this.isDefaultPrevented=Z;var a=this.originalEvent;if(a){a.preventDefault&&a.preventDefault();a.returnValue=false;}},stopPropagation:function(){this.isPropagationStopped=Z;var a=this.originalEvent;if(a){a.stopPropagation&&a.stopPropagation();a.cancelBubble=true;}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=Z;this.stopPropagation();},isDefaultPrevented:Y,isPropagationStopped:Y,isImmediatePropagationStopped:Y};var Da=function(a){var b=a.relatedTarget;try{for(;b&&b!==this;){b=b.parentNode;}if(b!==this){a.type=a.data;c.event.handle.apply(this,arguments);}}catch(d){}},Ea=function(a){a.type=a.data;c.event.handle.apply(this,arguments);};c.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){c.event.special[a]={setup:function(d){c.event.add(this,b,d&&d.selector?Ea:Da,a);},teardown:function(d){c.event.remove(this,b,d&&d.selector?Ea:Da);}};});if(!c.support.submitBubbles){c.event.special.submit={setup:function(){if(this.nodeName.toLowerCase()!=="form"){c.event.add(this,"click.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="submit"||d==="image")&&c(b).closest("form").length){return na("submit",this,arguments);}});c.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="text"||d==="password")&&c(b).closest("form").length&&a.keyCode===13){return na("submit",this,arguments);}});}else{return false;}},teardown:function(){c.event.remove(this,".specialSubmit");}};}if(!c.support.changeBubbles){var da=/textarea|input|select/i,ea,Fa=function(a){var b=a.type,d=a.value;if(b==="radio"||b==="checkbox"){d=a.checked;}else{if(b==="select-multiple"){d=a.selectedIndex>-1?c.map(a.options,function(f){return f.selected;}).join("-"):"";}else{if(a.nodeName.toLowerCase()==="select"){d=a.selectedIndex;}}}return d;},fa=function(a,b){var d=a.target,f,e;if(!(!da.test(d.nodeName)||d.readOnly)){f=c.data(d,"_change_data");e=Fa(d);if(a.type!=="focusout"||d.type!=="radio"){c.data(d,"_change_data",e);}if(!(f===w||e===f)){if(f!=null||e){a.type="change";return c.event.trigger(a,b,d);}}}};c.event.special.change={filters:{focusout:fa,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select"){return fa.call(this,a);}},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple"){return fa.call(this,a);}},beforeactivate:function(a){a=a.target;c.data(a,"_change_data",Fa(a));}},setup:function(){if(this.type==="file"){return false;}for(var a in ea){c.event.add(this,a+".specialChange",ea[a]);}return da.test(this.nodeName);},teardown:function(){c.event.remove(this,".specialChange");return da.test(this.nodeName);}};ea=c.event.special.change.filters;}s.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(f){f=c.event.fix(f);f.type=b;return c.event.handle.call(this,f);}c.event.special[b]={setup:function(){this.addEventListener(a,d,true);},teardown:function(){this.removeEventListener(a,d,true);}};});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,f,e){if(typeof d==="object"){for(var j in d){this[b](j,f,d[j],e);}return this;}if(c.isFunction(f)){e=f;f=w;}var i=b==="one"?c.proxy(e,function(k){c(this).unbind(k,i);return e.apply(this,arguments);}):e;if(d==="unload"&&b!=="one"){this.one(d,f,e);}else{j=0;for(var o=this.length;j<o;j++){c.event.add(this[j],d,i,f);}}return this;};});c.fn.extend({unbind:function(a,b){if(typeof a==="object"&&!a.preventDefault){for(var d in a){this.unbind(d,a[d]);}}else{d=0;for(var f=this.length;d<f;d++){c.event.remove(this[d],a,b);}}return this;},delegate:function(a,b,d,f){return this.live(b,d,f,a);},undelegate:function(a,b,d){return arguments.length===0?this.unbind("live"):this.die(b,null,d,a);},trigger:function(a,b){return this.each(function(){c.event.trigger(a,b,this);});},triggerHandler:function(a,b){if(this[0]){a=c.Event(a);a.preventDefault();a.stopPropagation();c.event.trigger(a,b,this[0]);return a.result;}},toggle:function(a){for(var b=arguments,d=1;d<b.length;){c.proxy(a,b[d++]);}return this.click(c.proxy(a,function(f){var e=(c.data(this,"lastToggle"+a.guid)||0)%d;c.data(this,"lastToggle"+a.guid,e+1);f.preventDefault();return b[e].apply(this,arguments)||false;}));},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a);}});var Ga={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};c.each(["live","die"],function(a,b){c.fn[b]=function(d,f,e,j){var i,o=0,k,n,r=j||this.selector,u=j?this:c(this.context);if(c.isFunction(f)){e=f;f=w;}for(d=(d||"").split(" ");(i=d[o++])!=null;){j=O.exec(i);k="";if(j){k=j[0];i=i.replace(O,"");}if(i==="hover"){d.push("mouseenter"+k,"mouseleave"+k);}else{n=i;if(i==="focus"||i==="blur"){d.push(Ga[i]+k);i+=k;}else{i=(Ga[i]||i)+k;}b==="live"?u.each(function(){c.event.add(this,pa(i,r),{data:f,selector:r,handler:e,origType:i,origHandler:e,preType:n});}):u.unbind(pa(i,r),e);}}return this;};});c.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),function(a,b){c.fn[b]=function(d){return d?this.bind(b,d):this.trigger(b);};if(c.attrFn){c.attrFn[b]=true;}});A.attachEvent&&!A.addEventListener&&A.attachEvent("onunload",function(){for(var a in c.cache){if(c.cache[a].handle){try{c.event.remove(c.cache[a].handle.elem);}catch(b){}}}});(function(){function a(g){for(var h="",l,m=0;g[m];m++){l=g[m];if(l.nodeType===3||l.nodeType===4){h+=l.nodeValue;}else{if(l.nodeType!==8){h+=a(l.childNodes);}}}return h;}function b(g,h,l,m,q,p){q=0;for(var v=m.length;q<v;q++){var t=m[q];if(t){t=t[g];for(var y=false;t;){if(t.sizcache===l){y=m[t.sizset];break;}if(t.nodeType===1&&!p){t.sizcache=l;t.sizset=q;}if(t.nodeName.toLowerCase()===h){y=t;break;}t=t[g];}m[q]=y;}}}function d(g,h,l,m,q,p){q=0;for(var v=m.length;q<v;q++){var t=m[q];if(t){t=t[g];for(var y=false;t;){if(t.sizcache===l){y=m[t.sizset];break;}if(t.nodeType===1){if(!p){t.sizcache=l;t.sizset=q;}if(typeof h!=="string"){if(t===h){y=true;break;}}else{if(k.filter(h,[t]).length>0){y=t;break;}}}t=t[g];}m[q]=y;}}}var f=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e=0,j=Object.prototype.toString,i=false,o=true;[0,0].sort(function(){o=false;return 0;});var k=function(g,h,l,m){l=l||[];var q=h=h||s;if(h.nodeType!==1&&h.nodeType!==9){return[];}if(!g||typeof g!=="string"){return l;}for(var p=[],v,t,y,S,H=true,M=x(h),I=g;(f.exec(""),v=f.exec(I))!==null;){I=v[3];p.push(v[1]);if(v[2]){S=v[3];break;}}if(p.length>1&&r.exec(g)){if(p.length===2&&n.relative[p[0]]){t=ga(p[0]+p[1],h);}else{for(t=n.relative[p[0]]?[h]:k(p.shift(),h);p.length;){g=p.shift();if(n.relative[g]){g+=p.shift();}t=ga(g,t);}}}else{if(!m&&p.length>1&&h.nodeType===9&&!M&&n.match.ID.test(p[0])&&!n.match.ID.test(p[p.length-1])){v=k.find(p.shift(),h,M);h=v.expr?k.filter(v.expr,v.set)[0]:v.set[0];}if(h){v=m?{expr:p.pop(),set:z(m)}:k.find(p.pop(),p.length===1&&(p[0]==="~"||p[0]==="+")&&h.parentNode?h.parentNode:h,M);t=v.expr?k.filter(v.expr,v.set):v.set;if(p.length>0){y=z(t);}else{H=false;}for(;p.length;){var D=p.pop();v=D;if(n.relative[D]){v=p.pop();}else{D="";}if(v==null){v=h;}n.relative[D](y,v,M);}}else{y=[];}}y||(y=t);y||k.error(D||g);if(j.call(y)==="[object Array]"){if(H){if(h&&h.nodeType===1){for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&E(h,y[g]))){l.push(t[g]);}}}else{for(g=0;y[g]!=null;g++){y[g]&&y[g].nodeType===1&&l.push(t[g]);}}}else{l.push.apply(l,y);}}else{z(y,l);}if(S){k(S,q,l,m);k.uniqueSort(l);}return l;};k.uniqueSort=function(g){if(B){i=o;g.sort(B);if(i){for(var h=1;h<g.length;h++){g[h]===g[h-1]&&g.splice(h--,1);}}}return g;};k.matches=function(g,h){return k(g,null,null,h);};k.find=function(g,h,l){var m,q;if(!g){return[];}for(var p=0,v=n.order.length;p<v;p++){var t=n.order[p];if(q=n.leftMatch[t].exec(g)){var y=q[1];q.splice(1,1);if(y.substr(y.length-1)!=="\\"){q[1]=(q[1]||"").replace(/\\/g,"");m=n.find[t](q,h,l);if(m!=null){g=g.replace(n.match[t],"");break;}}}}m||(m=h.getElementsByTagName("*"));return{set:m,expr:g};};k.filter=function(g,h,l,m){for(var q=g,p=[],v=h,t,y,S=h&&h[0]&&x(h[0]);g&&h.length;){for(var H in n.filter){if((t=n.leftMatch[H].exec(g))!=null&&t[2]){var M=n.filter[H],I,D;D=t[1];y=false;t.splice(1,1);if(D.substr(D.length-1)!=="\\"){if(v===p){p=[];}if(n.preFilter[H]){if(t=n.preFilter[H](t,v,l,p,m,S)){if(t===true){continue;}}else{y=I=true;}}if(t){for(var U=0;(D=v[U])!=null;U++){if(D){I=M(D,t,U,v);var Ha=m^!!I;if(l&&I!=null){if(Ha){y=true;}else{v[U]=false;}}else{if(Ha){p.push(D);y=true;}}}}}if(I!==w){l||(v=p);g=g.replace(n.match[H],"");if(!y){return[];}break;}}}}if(g===q){if(y==null){k.error(g);}else{break;}}q=g;}return v;};k.error=function(g){throw"Syntax error, unrecognized expression: "+g;};var n=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(g){return g.getAttribute("href");}},relative:{"+":function(g,h){var l=typeof h==="string",m=l&&!/\W/.test(h);l=l&&!m;if(m){h=h.toLowerCase();}m=0;for(var q=g.length,p;m<q;m++){if(p=g[m]){for(;(p=p.previousSibling)&&p.nodeType!==1;){}g[m]=l||p&&p.nodeName.toLowerCase()===h?p||false:p===h;}}l&&k.filter(h,g,true);},">":function(g,h){var l=typeof h==="string";if(l&&!/\W/.test(h)){h=h.toLowerCase();for(var m=0,q=g.length;m<q;m++){var p=g[m];if(p){l=p.parentNode;g[m]=l.nodeName.toLowerCase()===h?l:false;}}}else{m=0;for(q=g.length;m<q;m++){if(p=g[m]){g[m]=l?p.parentNode:p.parentNode===h;}}l&&k.filter(h,g,true);}},"":function(g,h,l){var m=e++,q=d;if(typeof h==="string"&&!/\W/.test(h)){var p=h=h.toLowerCase();q=b;}q("parentNode",h,m,g,p,l);},"~":function(g,h,l){var m=e++,q=d;if(typeof h==="string"&&!/\W/.test(h)){var p=h=h.toLowerCase();q=b;}q("previousSibling",h,m,g,p,l);}},find:{ID:function(g,h,l){if(typeof h.getElementById!=="undefined"&&!l){return(g=h.getElementById(g[1]))?[g]:[];}},NAME:function(g,h){if(typeof h.getElementsByName!=="undefined"){var l=[];h=h.getElementsByName(g[1]);for(var m=0,q=h.length;m<q;m++){h[m].getAttribute("name")===g[1]&&l.push(h[m]);}return l.length===0?null:l;}},TAG:function(g,h){return h.getElementsByTagName(g[1]);}},preFilter:{CLASS:function(g,h,l,m,q,p){g=" "+g[1].replace(/\\/g,"")+" ";if(p){return g;}p=0;for(var v;(v=h[p])!=null;p++){if(v){if(q^(v.className&&(" "+v.className+" ").replace(/[\t\n]/g," ").indexOf(g)>=0)){l||m.push(v);}else{if(l){h[p]=false;}}}}return false;},ID:function(g){return g[1].replace(/\\/g,"");},TAG:function(g){return g[1].toLowerCase();},CHILD:function(g){if(g[1]==="nth"){var h=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=h[1]+(h[2]||1)-0;g[3]=h[3]-0;}g[0]=e++;return g;},ATTR:function(g,h,l,m,q,p){h=g[1].replace(/\\/g,"");if(!p&&n.attrMap[h]){g[1]=n.attrMap[h];}if(g[2]==="~="){g[4]=" "+g[4]+" ";}return g;},PSEUDO:function(g,h,l,m,q){if(g[1]==="not"){if((f.exec(g[3])||"").length>1||/^\w/.test(g[3])){g[3]=k(g[3],null,null,h);}else{g=k.filter(g[3],h,l,true^q);l||m.push.apply(m,g);return false;}}else{if(n.match.POS.test(g[0])||n.match.CHILD.test(g[0])){return true;}}return g;},POS:function(g){g.unshift(true);return g;}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden";},disabled:function(g){return g.disabled===true;},checked:function(g){return g.checked===true;},selected:function(g){return g.selected===true;},parent:function(g){return !!g.firstChild;},empty:function(g){return !g.firstChild;},has:function(g,h,l){return !!k(l[3],g).length;},header:function(g){return/h\d/i.test(g.nodeName);},text:function(g){return"text"===g.type;},radio:function(g){return"radio"===g.type;},checkbox:function(g){return"checkbox"===g.type;},file:function(g){return"file"===g.type;},password:function(g){return"password"===g.type;},submit:function(g){return"submit"===g.type;},image:function(g){return"image"===g.type;},reset:function(g){return"reset"===g.type;},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button";},input:function(g){return/input|select|textarea|button/i.test(g.nodeName);}},setFilters:{first:function(g,h){return h===0;},last:function(g,h,l,m){return h===m.length-1;},even:function(g,h){return h%2===0;},odd:function(g,h){return h%2===1;},lt:function(g,h,l){return h<l[3]-0;},gt:function(g,h,l){return h>l[3]-0;},nth:function(g,h,l){return l[3]-0===h;},eq:function(g,h,l){return l[3]-0===h;}},filter:{PSEUDO:function(g,h,l,m){var q=h[1],p=n.filters[q];if(p){return p(g,l,h,m);}else{if(q==="contains"){return(g.textContent||g.innerText||a([g])||"").indexOf(h[3])>=0;}else{if(q==="not"){h=h[3];l=0;for(m=h.length;l<m;l++){if(h[l]===g){return false;}}return true;}else{k.error("Syntax error, unrecognized expression: "+q);}}}},CHILD:function(g,h){var l=h[1],m=g;switch(l){case"only":case"first":for(;m=m.previousSibling;){if(m.nodeType===1){return false;}}if(l==="first"){return true;}m=g;case"last":for(;m=m.nextSibling;){if(m.nodeType===1){return false;}}return true;case"nth":l=h[2];var q=h[3];if(l===1&&q===0){return true;}h=h[0];var p=g.parentNode;if(p&&(p.sizcache!==h||!g.nodeIndex)){var v=0;for(m=p.firstChild;m;m=m.nextSibling){if(m.nodeType===1){m.nodeIndex=++v;}}p.sizcache=h;}g=g.nodeIndex-q;return l===0?g===0:g%l===0&&g/l>=0;}},ID:function(g,h){return g.nodeType===1&&g.getAttribute("id")===h;},TAG:function(g,h){return h==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===h;},CLASS:function(g,h){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(h)>-1;},ATTR:function(g,h){var l=h[1];g=n.attrHandle[l]?n.attrHandle[l](g):g[l]!=null?g[l]:g.getAttribute(l);l=g+"";var m=h[2];h=h[4];return g==null?m==="!=":m==="="?l===h:m==="*="?l.indexOf(h)>=0:m==="~="?(" "+l+" ").indexOf(h)>=0:!h?l&&g!==false:m==="!="?l!==h:m==="^="?l.indexOf(h)===0:m==="$="?l.substr(l.length-h.length)===h:m==="|="?l===h||l.substr(0,h.length+1)===h+"-":false;},POS:function(g,h,l,m){var q=n.setFilters[h[2]];if(q){return q(g,l,h,m);}}}},r=n.match.POS;for(var u in n.match){n.match[u]=new RegExp(n.match[u].source+/(?![^\[]*\])(?![^\(]*\))/.source);n.leftMatch[u]=new RegExp(/(^(?:.|\r|\n)*?)/.source+n.match[u].source.replace(/\\(\d+)/g,function(g,h){return"\\"+(h-0+1);}));}var z=function(g,h){g=Array.prototype.slice.call(g,0);if(h){h.push.apply(h,g);return h;}return g;};try{Array.prototype.slice.call(s.documentElement.childNodes,0);}catch(C){z=function(g,h){h=h||[];if(j.call(g)==="[object Array]"){Array.prototype.push.apply(h,g);}else{if(typeof g.length==="number"){for(var l=0,m=g.length;l<m;l++){h.push(g[l]);}}else{for(l=0;g[l];l++){h.push(g[l]);}}}return h;};}var B;if(s.documentElement.compareDocumentPosition){B=function(g,h){if(!g.compareDocumentPosition||!h.compareDocumentPosition){if(g==h){i=true;}return g.compareDocumentPosition?-1:1;}g=g.compareDocumentPosition(h)&4?-1:g===h?0:1;if(g===0){i=true;}return g;};}else{if("sourceIndex" in s.documentElement){B=function(g,h){if(!g.sourceIndex||!h.sourceIndex){if(g==h){i=true;}return g.sourceIndex?-1:1;}g=g.sourceIndex-h.sourceIndex;if(g===0){i=true;}return g;};}else{if(s.createRange){B=function(g,h){if(!g.ownerDocument||!h.ownerDocument){if(g==h){i=true;}return g.ownerDocument?-1:1;}var l=g.ownerDocument.createRange(),m=h.ownerDocument.createRange();l.setStart(g,0);l.setEnd(g,0);m.setStart(h,0);m.setEnd(h,0);g=l.compareBoundaryPoints(Range.START_TO_END,m);if(g===0){i=true;}return g;};}}}(function(){var g=s.createElement("div"),h="script"+(new Date).getTime();g.innerHTML="<a name='"+h+"'/>";var l=s.documentElement;l.insertBefore(g,l.firstChild);if(s.getElementById(h)){n.find.ID=function(m,q,p){if(typeof q.getElementById!=="undefined"&&!p){return(q=q.getElementById(m[1]))?q.id===m[1]||typeof q.getAttributeNode!=="undefined"&&q.getAttributeNode("id").nodeValue===m[1]?[q]:w:[];}};n.filter.ID=function(m,q){var p=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&p&&p.nodeValue===q;};}l.removeChild(g);l=g=null;})();(function(){var g=s.createElement("div");g.appendChild(s.createComment(""));if(g.getElementsByTagName("*").length>0){n.find.TAG=function(h,l){l=l.getElementsByTagName(h[1]);if(h[1]==="*"){h=[];for(var m=0;l[m];m++){l[m].nodeType===1&&h.push(l[m]);}l=h;}return l;};}g.innerHTML="<a href='#'></a>";if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#"){n.attrHandle.href=function(h){return h.getAttribute("href",2);};}g=null;})();s.querySelectorAll&&function(){var g=k,h=s.createElement("div");h.innerHTML="<p class='TEST'></p>";if(!(h.querySelectorAll&&h.querySelectorAll(".TEST").length===0)){k=function(m,q,p,v){q=q||s;if(!v&&q.nodeType===9&&!x(q)){try{return z(q.querySelectorAll(m),p);}catch(t){}}return g(m,q,p,v);};for(var l in g){k[l]=g[l];}h=null;}}();(function(){var g=s.createElement("div");g.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){n.order.splice(1,0,"CLASS");n.find.CLASS=function(h,l,m){if(typeof l.getElementsByClassName!=="undefined"&&!m){return l.getElementsByClassName(h[1]);}};g=null;}}})();var E=s.compareDocumentPosition?function(g,h){return !!(g.compareDocumentPosition(h)&16);}:function(g,h){return g!==h&&(g.contains?g.contains(h):true);},x=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false;},ga=function(g,h){var l=[],m="",q;for(h=h.nodeType?[h]:h;q=n.match.PSEUDO.exec(g);){m+=q[0];g=g.replace(n.match.PSEUDO,"");}g=n.relative[g]?g+"*":g;q=0;for(var p=h.length;q<p;q++){k(g,h[q],l);}return k.filter(m,l);};c.find=k;c.expr=k.selectors;c.expr[":"]=c.expr.filters;c.unique=k.uniqueSort;c.text=a;c.isXMLDoc=x;c.contains=E;})();var eb=/Until$/,fb=/^(?:parents|prevUntil|prevAll)/,gb=/,/;R=Array.prototype.slice;var Ia=function(a,b,d){if(c.isFunction(b)){return c.grep(a,function(e,j){return !!b.call(e,j,e)===d;});}else{if(b.nodeType){return c.grep(a,function(e){return e===b===d;});}else{if(typeof b==="string"){var f=c.grep(a,function(e){return e.nodeType===1;});if(Ua.test(b)){return c.filter(b,f,!d);}else{b=c.filter(b,f);}}}}return c.grep(a,function(e){return c.inArray(e,b)>=0===d;});};c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,f=0,e=this.length;f<e;f++){d=b.length;c.find(a,this[f],b);if(f>0){for(var j=d;j<b.length;j++){for(var i=0;i<d;i++){if(b[i]===b[j]){b.splice(j--,1);break;}}}}}return b;},has:function(a){var b=c(a);return this.filter(function(){for(var d=0,f=b.length;d<f;d++){if(c.contains(this,b[d])){return true;}}});},not:function(a){return this.pushStack(Ia(this,a,false),"not",a);},filter:function(a){return this.pushStack(Ia(this,a,true),"filter",a);},is:function(a){return !!a&&c.filter(a,this).length>0;},closest:function(a,b){if(c.isArray(a)){var d=[],f=this[0],e,j={},i;if(f&&a.length){e=0;for(var o=a.length;e<o;e++){i=a[e];j[i]||(j[i]=c.expr.match.POS.test(i)?c(i,b||this.context):i);}for(;f&&f.ownerDocument&&f!==b;){for(i in j){e=j[i];if(e.jquery?e.index(f)>-1:c(f).is(e)){d.push({selector:i,elem:f});delete j[i];}}f=f.parentNode;}}return d;}var k=c.expr.match.POS.test(a)?c(a,b||this.context):null;return this.map(function(n,r){for(;r&&r.ownerDocument&&r!==b;){if(k?k.index(r)>-1:c(r).is(a)){return r;}r=r.parentNode;}return null;});},index:function(a){if(!a||typeof a==="string"){return c.inArray(this[0],a?c(a):this.parent().children());}return c.inArray(a.jquery?a[0]:a,this);},add:function(a,b){a=typeof a==="string"?c(a,b||this.context):c.makeArray(a);b=c.merge(this.get(),a);return this.pushStack(qa(a[0])||qa(b[0])?b:c.unique(b));},andSelf:function(){return this.add(this.prevObject);}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null;},parents:function(a){return c.dir(a,"parentNode");},parentsUntil:function(a,b,d){return c.dir(a,"parentNode",d);},next:function(a){return c.nth(a,2,"nextSibling");},prev:function(a){return c.nth(a,2,"previousSibling");},nextAll:function(a){return c.dir(a,"nextSibling");},prevAll:function(a){return c.dir(a,"previousSibling");},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d);},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d);},siblings:function(a){return c.sibling(a.parentNode.firstChild,a);},children:function(a){return c.sibling(a.firstChild);},contents:function(a){return c.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes);}},function(a,b){c.fn[a]=function(d,f){var e=c.map(this,b,d);eb.test(a)||(f=d);if(f&&typeof f==="string"){e=c.filter(f,e);}e=this.length>1?c.unique(e):e;if((this.length>1||gb.test(f))&&fb.test(a)){e=e.reverse();}return this.pushStack(e,a,R.call(arguments).join(","));};});c.extend({filter:function(a,b,d){if(d){a=":not("+a+")";}return c.find.matches(a,b);},dir:function(a,b,d){var f=[];for(a=a[b];a&&a.nodeType!==9&&(d===w||a.nodeType!==1||!c(a).is(d));){a.nodeType===1&&f.push(a);a=a[b];}return f;},nth:function(a,b,d){b=b||1;for(var f=0;a;a=a[d]){if(a.nodeType===1&&++f===b){break;}}return a;},sibling:function(a,b){for(var d=[];a;a=a.nextSibling){a.nodeType===1&&a!==b&&d.push(a);}return d;}});var Ja=/ jQuery\d+="(?:\d+|null)"/g,V=/^\s+/,Ka=/(<([\w:]+)[^>]*?)\/>/g,hb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,La=/<([\w:]+)/,ib=/<tbody/i,jb=/<|&#?\w+;/,ta=/<script|<object|<embed|<option|<style/i,ua=/checked\s*(?:[^=]|=\s*.checked.)/i,Ma=function(a,b,d){return hb.test(d)?a:b+"></"+d+">";},F={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};F.optgroup=F.option;F.tbody=F.tfoot=F.colgroup=F.caption=F.thead;F.th=F.td;if(!c.support.htmlSerialize){F._default=[1,"div<div>","</div>"];}c.fn.extend({text:function(a){if(c.isFunction(a)){return this.each(function(b){var d=c(this);d.text(a.call(this,b,d.text()));});}if(typeof a!=="object"&&a!==w){return this.empty().append((this[0]&&this[0].ownerDocument||s).createTextNode(a));}return c.text(this);},wrapAll:function(a){if(c.isFunction(a)){return this.each(function(d){c(this).wrapAll(a.call(this,d));});}if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;){d=d.firstChild;}return d;}).append(this);}return this;},wrapInner:function(a){if(c.isFunction(a)){return this.each(function(b){c(this).wrapInner(a.call(this,b));});}return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a);});},wrap:function(a){return this.each(function(){c(this).wrapAll(a);});},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes);}).end();},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a);});},prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild);});},before:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this);});}else{if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments);}}},after:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this.nextSibling);});}else{if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a;}}},remove:function(a,b){for(var d=0,f;(f=this[d])!=null;d++){if(!a||c.filter(a,[f]).length){if(!b&&f.nodeType===1){c.cleanData(f.getElementsByTagName("*"));c.cleanData([f]);}f.parentNode&&f.parentNode.removeChild(f);}}return this;},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;){b.removeChild(b.firstChild);}}return this;},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,f=this.ownerDocument;if(!d){d=f.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML;}return c.clean([d.replace(Ja,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(V,"")],f)[0];}else{return this.cloneNode(true);}});if(a===true){ra(this,b);ra(this.find("*"),b.find("*"));}return b;},html:function(a){if(a===w){return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Ja,""):null;}else{if(typeof a==="string"&&!ta.test(a)&&(c.support.leadingWhitespace||!V.test(a))&&!F[(La.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Ka,Ma);try{for(var b=0,d=this.length;b<d;b++){if(this[b].nodeType===1){c.cleanData(this[b].getElementsByTagName("*"));this[b].innerHTML=a;}}}catch(f){this.empty().append(a);}}else{c.isFunction(a)?this.each(function(e){var j=c(this),i=j.html();j.empty().append(function(){return a.call(this,e,i);});}):this.empty().append(a);}}return this;},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(c.isFunction(a)){return this.each(function(b){var d=c(this),f=d.html();d.replaceWith(a.call(this,b,f));});}if(typeof a!=="string"){a=c(a).detach();}return this.each(function(){var b=this.nextSibling,d=this.parentNode;c(this).remove();b?c(b).before(a):c(d).append(a);});}else{return this.pushStack(c(c.isFunction(a)?a():a),"replaceWith",a);}},detach:function(a){return this.remove(a,true);},domManip:function(a,b,d){function f(u){return c.nodeName(u,"table")?u.getElementsByTagName("tbody")[0]||u.appendChild(u.ownerDocument.createElement("tbody")):u;}var e,j,i=a[0],o=[],k;if(!c.support.checkClone&&arguments.length===3&&typeof i==="string"&&ua.test(i)){return this.each(function(){c(this).domManip(a,b,d,true);});}if(c.isFunction(i)){return this.each(function(u){var z=c(this);a[0]=i.call(this,u,b?z.html():w);z.domManip(a,b,d);});}if(this[0]){e=i&&i.parentNode;e=c.support.parentNode&&e&&e.nodeType===11&&e.childNodes.length===this.length?{fragment:e}:sa(a,this,o);k=e.fragment;if(j=k.childNodes.length===1?(k=k.firstChild):k.firstChild){b=b&&c.nodeName(j,"tr");for(var n=0,r=this.length;n<r;n++){d.call(b?f(this[n],j):this[n],n>0||e.cacheable||this.length>1?k.cloneNode(true):k);}}o.length&&c.each(o,Qa);}return this;}});c.fragments={};c.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var f=[];d=c(d);var e=this.length===1&&this[0].parentNode;if(e&&e.nodeType===11&&e.childNodes.length===1&&d.length===1){d[b](this[0]);return this;}else{e=0;for(var j=d.length;e<j;e++){var i=(e>0?this.clone(true):this).get();c.fn[b].apply(c(d[e]),i);f=f.concat(i);}return this.pushStack(f,a,d.selector);}};});c.extend({clean:function(a,b,d,f){b=b||s;if(typeof b.createElement==="undefined"){b=b.ownerDocument||b[0]&&b[0].ownerDocument||s;}for(var e=[],j=0,i;(i=a[j])!=null;j++){if(typeof i==="number"){i+="";}if(i){if(typeof i==="string"&&!jb.test(i)){i=b.createTextNode(i);}else{if(typeof i==="string"){i=i.replace(Ka,Ma);var o=(La.exec(i)||["",""])[1].toLowerCase(),k=F[o]||F._default,n=k[0],r=b.createElement("div");for(r.innerHTML=k[1]+i+k[2];n--;){r=r.lastChild;}if(!c.support.tbody){n=ib.test(i);o=o==="table"&&!n?r.firstChild&&r.firstChild.childNodes:k[1]==="<table>"&&!n?r.childNodes:[];for(k=o.length-1;k>=0;--k){c.nodeName(o[k],"tbody")&&!o[k].childNodes.length&&o[k].parentNode.removeChild(o[k]);}}!c.support.leadingWhitespace&&V.test(i)&&r.insertBefore(b.createTextNode(V.exec(i)[0]),r.firstChild);i=r.childNodes;}}if(i.nodeType){e.push(i);}else{e=c.merge(e,i);}}}if(d){for(j=0;e[j];j++){if(f&&c.nodeName(e[j],"script")&&(!e[j].type||e[j].type.toLowerCase()==="text/javascript")){f.push(e[j].parentNode?e[j].parentNode.removeChild(e[j]):e[j]);}else{e[j].nodeType===1&&e.splice.apply(e,[j+1,0].concat(c.makeArray(e[j].getElementsByTagName("script"))));d.appendChild(e[j]);}}}return e;},cleanData:function(a){for(var b,d,f=c.cache,e=c.event.special,j=c.support.deleteExpando,i=0,o;(o=a[i])!=null;i++){if(d=o[c.expando]){b=f[d];if(b.events){for(var k in b.events){e[k]?c.event.remove(o,k):Ca(o,k,b.handle);}}if(j){delete o[c.expando];}else{o.removeAttribute&&o.removeAttribute(c.expando);}delete f[d];}}}});var kb=/z-?index|font-?weight|opacity|zoom|line-?height/i,Na=/alpha\([^)]*\)/,Oa=/opacity=([^)]*)/,ha=/float/i,ia=/-([a-z])/ig,lb=/([A-Z])/g,mb=/^-?\d+(?:px)?$/i,nb=/^-?\d/,ob={position:"absolute",visibility:"hidden",display:"block"},pb=["Left","Right"],qb=["Top","Bottom"],rb=s.defaultView&&s.defaultView.getComputedStyle,Pa=c.support.cssFloat?"cssFloat":"styleFloat",ja=function(a,b){return b.toUpperCase();};c.fn.css=function(a,b){return X(this,a,b,true,function(d,f,e){if(e===w){return c.curCSS(d,f);}if(typeof e==="number"&&!kb.test(f)){e+="px";}c.style(d,f,e);});};c.extend({style:function(a,b,d){if(!a||a.nodeType===3||a.nodeType===8){return w;}if((b==="width"||b==="height")&&parseFloat(d)<0){d=w;}var f=a.style||a,e=d!==w;if(!c.support.opacity&&b==="opacity"){if(e){f.zoom=1;b=parseInt(d,10)+""==="NaN"?"":"alpha(opacity="+d*100+")";a=f.filter||c.curCSS(a,"filter")||"";f.filter=Na.test(a)?a.replace(Na,b):b;}return f.filter&&f.filter.indexOf("opacity=")>=0?parseFloat(Oa.exec(f.filter)[1])/100+"":"";}if(ha.test(b)){b=Pa;}b=b.replace(ia,ja);if(e){f[b]=d;}return f[b];},css:function(a,b,d,f){if(b==="width"||b==="height"){var e,j=b==="width"?pb:qb;function i(){e=b==="width"?a.offsetWidth:a.offsetHeight;f!=="border"&&c.each(j,function(){f||(e-=parseFloat(c.curCSS(a,"padding"+this,true))||0);if(f==="margin"){e+=parseFloat(c.curCSS(a,"margin"+this,true))||0;}else{e-=parseFloat(c.curCSS(a,"border"+this+"Width",true))||0;}});}a.offsetWidth!==0?i():c.swap(a,ob,i);return Math.max(0,Math.round(e));}return c.curCSS(a,b,d);},curCSS:function(a,b,d){var f,e=a.style;if(!c.support.opacity&&b==="opacity"&&a.currentStyle){f=Oa.test(a.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return f===""?"1":f;}if(ha.test(b)){b=Pa;}if(!d&&e&&e[b]){f=e[b];}else{if(rb){if(ha.test(b)){b="float";}b=b.replace(lb,"-$1").toLowerCase();e=a.ownerDocument.defaultView;if(!e){return null;}if(a=e.getComputedStyle(a,null)){f=a.getPropertyValue(b);}if(b==="opacity"&&f===""){f="1";}}else{if(a.currentStyle){d=b.replace(ia,ja);f=a.currentStyle[b]||a.currentStyle[d];if(!mb.test(f)&&nb.test(f)){b=e.left;var j=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;e.left=d==="fontSize"?"1em":f||0;f=e.pixelLeft+"px";e.left=b;a.runtimeStyle.left=j;}}}}return f;},swap:function(a,b,d){var f={};for(var e in b){f[e]=a.style[e];a.style[e]=b[e];}d.call(a);for(e in b){a.style[e]=f[e];}}});if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b=a.offsetWidth,d=a.offsetHeight,f=a.nodeName.toLowerCase()==="tr";return b===0&&d===0&&!f?true:b>0&&d>0&&!f?false:c.curCSS(a,"display")==="none";};c.expr.filters.visible=function(a){return !c.expr.filters.hidden(a);};}var sb=J(),tb=/<script(.|\s)*?\/script>/gi,ub=/select|textarea/i,vb=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,N=/=\?(&|$)/,ka=/\?/,wb=/(\?|&)_=.*?(&|$)/,xb=/^(\w+:)?\/\/([^\/?#]+)/,yb=/%20/g,zb=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!=="string"){return zb.call(this,a);}else{if(!this.length){return this;}}var f=a.indexOf(" ");if(f>=0){var e=a.slice(f,a.length);a=a.slice(0,f);}f="GET";if(b){if(c.isFunction(b)){d=b;b=null;}else{if(typeof b==="object"){b=c.param(b,c.ajaxSettings.traditional);f="POST";}}}var j=this;c.ajax({url:a,type:f,dataType:"html",data:b,complete:function(i,o){if(o==="success"||o==="notmodified"){j.html(e?c("<div />").append(i.responseText.replace(tb,"")).find(e):i.responseText);}d&&j.each(d,[i.responseText,o,i]);}});return this;},serialize:function(){return c.param(this.serializeArray());},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this;}).filter(function(){return this.name&&!this.disabled&&(this.checked||ub.test(this.nodeName)||vb.test(this.type));}).map(function(a,b){a=c(this).val();return a==null?null:c.isArray(a)?c.map(a,function(d){return{name:b.name,value:d};}):{name:b.name,value:a};}).get();}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){c.fn[b]=function(d){return this.bind(b,d);};});c.extend({get:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b=null;}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:f});},getScript:function(a,b){return c.get(a,null,b,"script");},getJSON:function(a,b,d){return c.get(a,b,d,"json");},post:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b={};}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:f});},ajaxSetup:function(a){c.extend(c.ajaxSettings,a);},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:A.XMLHttpRequest&&(A.location.protocol!=="file:"||!A.ActiveXObject)?function(){return new A.XMLHttpRequest;}:function(){try{return new A.ActiveXObject("Microsoft.XMLHTTP");}catch(a){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(a){function b(){e.success&&e.success.call(k,o,i,x);e.global&&f("ajaxSuccess",[x,e]);}function d(){e.complete&&e.complete.call(k,x,i);e.global&&f("ajaxComplete",[x,e]);e.global&&!--c.active&&c.event.trigger("ajaxStop");}function f(q,p){(e.context?c(e.context):c.event).trigger(q,p);}var e=c.extend(true,{},c.ajaxSettings,a),j,i,o,k=a&&a.context||e,n=e.type.toUpperCase();if(e.data&&e.processData&&typeof e.data!=="string"){e.data=c.param(e.data,e.traditional);}if(e.dataType==="jsonp"){if(n==="GET"){N.test(e.url)||(e.url+=(ka.test(e.url)?"&":"?")+(e.jsonp||"callback")+"=?");}else{if(!e.data||!N.test(e.data)){e.data=(e.data?e.data+"&":"")+(e.jsonp||"callback")+"=?";}}e.dataType="json";}if(e.dataType==="json"&&(e.data&&N.test(e.data)||N.test(e.url))){j=e.jsonpCallback||"jsonp"+sb++;if(e.data){e.data=(e.data+"").replace(N,"="+j+"$1");}e.url=e.url.replace(N,"="+j+"$1");e.dataType="script";A[j]=A[j]||function(q){o=q;b();d();A[j]=w;try{delete A[j];}catch(p){}z&&z.removeChild(C);};}if(e.dataType==="script"&&e.cache===null){e.cache=false;}if(e.cache===false&&n==="GET"){var r=J(),u=e.url.replace(wb,"$1_="+r+"$2");e.url=u+(u===e.url?(ka.test(e.url)?"&":"?")+"_="+r:"");}if(e.data&&n==="GET"){e.url+=(ka.test(e.url)?"&":"?")+e.data;}e.global&&!c.active++&&c.event.trigger("ajaxStart");r=(r=xb.exec(e.url))&&(r[1]&&r[1]!==location.protocol||r[2]!==location.host);if(e.dataType==="script"&&n==="GET"&&r){var z=s.getElementsByTagName("head")[0]||s.documentElement,C=s.createElement("script");C.src=e.url;if(e.scriptCharset){C.charset=e.scriptCharset;}if(!j){var B=false;C.onload=C.onreadystatechange=function(){if(!B&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){B=true;b();d();C.onload=C.onreadystatechange=null;z&&C.parentNode&&z.removeChild(C);}};}z.insertBefore(C,z.firstChild);return w;}var E=false,x=e.xhr();if(x){e.username?x.open(n,e.url,e.async,e.username,e.password):x.open(n,e.url,e.async);try{if(e.data||a&&a.contentType){x.setRequestHeader("Content-Type",e.contentType);}if(e.ifModified){c.lastModified[e.url]&&x.setRequestHeader("If-Modified-Since",c.lastModified[e.url]);c.etag[e.url]&&x.setRequestHeader("If-None-Match",c.etag[e.url]);}r||x.setRequestHeader("X-Requested-With","XMLHttpRequest");x.setRequestHeader("Accept",e.dataType&&e.accepts[e.dataType]?e.accepts[e.dataType]+", */*":e.accepts._default);}catch(ga){}if(e.beforeSend&&e.beforeSend.call(k,x,e)===false){e.global&&!--c.active&&c.event.trigger("ajaxStop");x.abort();return false;}e.global&&f("ajaxSend",[x,e]);var g=x.onreadystatechange=function(q){if(!x||x.readyState===0||q==="abort"){E||d();E=true;if(x){x.onreadystatechange=c.noop;}}else{if(!E&&x&&(x.readyState===4||q==="timeout")){E=true;x.onreadystatechange=c.noop;i=q==="timeout"?"timeout":!c.httpSuccess(x)?"error":e.ifModified&&c.httpNotModified(x,e.url)?"notmodified":"success";var p;if(i==="success"){try{o=c.httpData(x,e.dataType,e);}catch(v){i="parsererror";p=v;}}if(i==="success"||i==="notmodified"){j||b();}else{c.handleError(e,x,i,p);}d();q==="timeout"&&x.abort();if(e.async){x=null;}}}};try{var h=x.abort;x.abort=function(){x&&h.call(x);g("abort");};}catch(l){}e.async&&e.timeout>0&&setTimeout(function(){x&&!E&&g("timeout");},e.timeout);try{x.send(n==="POST"||n==="PUT"||n==="DELETE"?e.data:null);}catch(m){c.handleError(e,x,null,m);d();}e.async||g();return x;}},handleError:function(a,b,d,f){if(a.error){a.error.call(a.context||a,b,d,f);}if(a.global){(a.context?c(a.context):c.event).trigger("ajaxError",[b,a,f]);}},active:0,httpSuccess:function(a){try{return !a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status===1223||a.status===0;}catch(b){}return false;},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),f=a.getResponseHeader("Etag");if(d){c.lastModified[b]=d;}if(f){c.etag[b]=f;}return a.status===304||a.status===0;},httpData:function(a,b,d){var f=a.getResponseHeader("content-type")||"",e=b==="xml"||!b&&f.indexOf("xml")>=0;a=e?a.responseXML:a.responseText;e&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter){a=d.dataFilter(a,b);}if(typeof a==="string"){if(b==="json"||!b&&f.indexOf("json")>=0){a=c.parseJSON(a);}else{if(b==="script"||!b&&f.indexOf("javascript")>=0){c.globalEval(a);}}}return a;},param:function(a,b){function d(i,o){if(c.isArray(o)){c.each(o,function(k,n){b||/\[\]$/.test(i)?f(i,n):d(i+"["+(typeof n==="object"||c.isArray(n)?k:"")+"]",n);});}else{!b&&o!=null&&typeof o==="object"?c.each(o,function(k,n){d(i+"["+k+"]",n);}):f(i,o);}}function f(i,o){o=c.isFunction(o)?o():o;e[e.length]=encodeURIComponent(i)+"="+encodeURIComponent(o);}var e=[];if(b===w){b=c.ajaxSettings.traditional;}if(c.isArray(a)||a.jquery){c.each(a,function(){f(this.name,this.value);});}else{for(var j in a){d(j,a[j]);}}return e.join("&").replace(yb,"+");}});var la={},Ab=/toggle|show|hide/,Bb=/^([+-]=)?([\d+-.]+)(.*)$/,W,va=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b){if(a||a===0){return this.animate(K("show",3),a,b);}else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay");this[a].style.display=d||"";if(c.css(this[a],"display")==="none"){d=this[a].nodeName;var f;if(la[d]){f=la[d];}else{var e=c("<"+d+" />").appendTo("body");f=e.css("display");if(f==="none"){f="block";}e.remove();la[d]=f;}c.data(this[a],"olddisplay",f);}}a=0;for(b=this.length;a<b;a++){this[a].style.display=c.data(this[a],"olddisplay")||"";}return this;}},hide:function(a,b){if(a||a===0){return this.animate(K("hide",3),a,b);}else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay");!d&&d!=="none"&&c.data(this[a],"olddisplay",c.css(this[a],"display"));}a=0;for(b=this.length;a<b;a++){this[a].style.display="none";}return this;}},_toggle:c.fn.toggle,toggle:function(a,b){var d=typeof a==="boolean";if(c.isFunction(a)&&c.isFunction(b)){this._toggle.apply(this,arguments);}else{a==null||d?this.each(function(){var f=d?a:c(this).is(":hidden");c(this)[f?"show":"hide"]();}):this.animate(K("toggle",3),a,b);}return this;},fadeTo:function(a,b,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,d);},animate:function(a,b,d,f){var e=c.speed(b,d,f);if(c.isEmptyObject(a)){return this.each(e.complete);}return this[e.queue===false?"each":"queue"](function(){var j=c.extend({},e),i,o=this.nodeType===1&&c(this).is(":hidden"),k=this;for(i in a){var n=i.replace(ia,ja);if(i!==n){a[n]=a[i];delete a[i];i=n;}if(a[i]==="hide"&&o||a[i]==="show"&&!o){return j.complete.call(this);}if((i==="height"||i==="width")&&this.style){j.display=c.css(this,"display");j.overflow=this.style.overflow;}if(c.isArray(a[i])){(j.specialEasing=j.specialEasing||{})[i]=a[i][1];a[i]=a[i][0];}}if(j.overflow!=null){this.style.overflow="hidden";}j.curAnim=c.extend({},a);c.each(a,function(r,u){var z=new c.fx(k,j,r);if(Ab.test(u)){z[u==="toggle"?o?"show":"hide":u](a);}else{var C=Bb.exec(u),B=z.cur(true)||0;if(C){u=parseFloat(C[2]);var E=C[3]||"px";if(E!=="px"){k.style[r]=(u||1)+E;B=(u||1)/z.cur(true)*B;k.style[r]=B+E;}if(C[1]){u=(C[1]==="-="?-1:1)*u+B;}z.custom(B,u,E);}else{z.custom(B,u,"");}}});return true;});},stop:function(a,b){var d=c.timers;a&&this.queue([]);this.each(function(){for(var f=d.length-1;f>=0;f--){if(d[f].elem===this){b&&d[f](true);d.splice(f,1);}}});b||this.dequeue();return this;}});c.each({slideDown:K("show",1),slideUp:K("hide",1),slideToggle:K("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(a,b){c.fn[a]=function(d,f){return this.animate(b,d,f);};});c.extend({speed:function(a,b,d){var f=a&&typeof a==="object"?a:{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};f.duration=c.fx.off?0:typeof f.duration==="number"?f.duration:c.fx.speeds[f.duration]||c.fx.speeds._default;f.old=f.complete;f.complete=function(){f.queue!==false&&c(this).dequeue();c.isFunction(f.old)&&f.old.call(this);};return f;},easing:{linear:function(a,b,d,f){return d+f*a;},swing:function(a,b,d,f){return(-Math.cos(a*Math.PI)/2+0.5)*f+d;}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig){b.orig={};}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]||c.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style){this.elem.style.display="block";}},cur:function(a){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop];}return(a=parseFloat(c.css(this.elem,this.prop,a)))&&a>-10000?a:parseFloat(c.curCSS(this.elem,this.prop))||0;},custom:function(a,b,d){function f(j){return e.step(j);}this.startTime=J();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start;this.pos=this.state=0;var e=this;f.elem=this.elem;if(f()&&c.timers.push(f)&&!W){W=setInterval(c.fx.tick,13);}},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show();},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0);},step:function(a){var b=J(),d=true;if(a||b>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var f in this.options.curAnim){if(this.options.curAnim[f]!==true){d=false;}}if(d){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;a=c.data(this.elem,"olddisplay");this.elem.style.display=a?a:this.options.display;if(c.css(this.elem,"display")==="none"){this.elem.style.display="block";}}this.options.hide&&c(this.elem).hide();if(this.options.hide||this.options.show){for(var e in this.options.curAnim){c.style(this.elem,e,this.options.orig[e]);}}this.options.complete.call(this.elem);}return false;}else{e=b-this.startTime;this.state=e/this.options.duration;a=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||a](this.state,e,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update();}return true;}};c.extend(c.fx,{tick:function(){for(var a=c.timers,b=0;b<a.length;b++){a[b]()||a.splice(b--,1);}a.length||c.fx.stop();},stop:function(){clearInterval(W);W=null;},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){c.style(a.elem,"opacity",a.now);},_default:function(a){if(a.elem.style&&a.elem.style[a.prop]!=null){a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit;}else{a.elem[a.prop]=a.now;}}}});if(c.expr&&c.expr.filters){c.expr.filters.animated=function(a){return c.grep(c.timers,function(b){return a===b.elem;}).length;};}c.fn.offset="getBoundingClientRect" in s.documentElement?function(a){var b=this[0];if(a){return this.each(function(e){c.offset.setOffset(this,a,e);});}if(!b||!b.ownerDocument){return null;}if(b===b.ownerDocument.body){return c.offset.bodyOffset(b);}var d=b.getBoundingClientRect(),f=b.ownerDocument;b=f.body;f=f.documentElement;return{top:d.top+(self.pageYOffset||c.support.boxModel&&f.scrollTop||b.scrollTop)-(f.clientTop||b.clientTop||0),left:d.left+(self.pageXOffset||c.support.boxModel&&f.scrollLeft||b.scrollLeft)-(f.clientLeft||b.clientLeft||0)};}:function(a){var b=this[0];if(a){return this.each(function(r){c.offset.setOffset(this,a,r);});}if(!b||!b.ownerDocument){return null;}if(b===b.ownerDocument.body){return c.offset.bodyOffset(b);}c.offset.initialize();var d=b.offsetParent,f=b,e=b.ownerDocument,j,i=e.documentElement,o=e.body;f=(e=e.defaultView)?e.getComputedStyle(b,null):b.currentStyle;for(var k=b.offsetTop,n=b.offsetLeft;(b=b.parentNode)&&b!==o&&b!==i;){if(c.offset.supportsFixedPosition&&f.position==="fixed"){break;}j=e?e.getComputedStyle(b,null):b.currentStyle;k-=b.scrollTop;n-=b.scrollLeft;if(b===d){k+=b.offsetTop;n+=b.offsetLeft;if(c.offset.doesNotAddBorder&&!(c.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(b.nodeName))){k+=parseFloat(j.borderTopWidth)||0;n+=parseFloat(j.borderLeftWidth)||0;}f=d;d=b.offsetParent;}if(c.offset.subtractsBorderForOverflowNotVisible&&j.overflow!=="visible"){k+=parseFloat(j.borderTopWidth)||0;n+=parseFloat(j.borderLeftWidth)||0;}f=j;}if(f.position==="relative"||f.position==="static"){k+=o.offsetTop;n+=o.offsetLeft;}if(c.offset.supportsFixedPosition&&f.position==="fixed"){k+=Math.max(i.scrollTop,o.scrollTop);n+=Math.max(i.scrollLeft,o.scrollLeft);}return{top:k,left:n};};c.offset={initialize:function(){var a=s.body,b=s.createElement("div"),d,f,e,j=parseFloat(c.curCSS(a,"marginTop",true))||0;c.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"});b.innerHTML="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";a.insertBefore(b,a.firstChild);d=b.firstChild;f=d.firstChild;e=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=f.offsetTop!==5;this.doesAddBorderForTableAndCells=e.offsetTop===5;f.style.position="fixed";f.style.top="20px";this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15;f.style.position=f.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==j;a.removeChild(b);c.offset.initialize=c.noop;},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.curCSS(a,"marginTop",true))||0;d+=parseFloat(c.curCSS(a,"marginLeft",true))||0;}return{top:b,left:d};},setOffset:function(a,b,d){if(/static/.test(c.curCSS(a,"position"))){a.style.position="relative";}var f=c(a),e=f.offset(),j=parseInt(c.curCSS(a,"top",true),10)||0,i=parseInt(c.curCSS(a,"left",true),10)||0;if(c.isFunction(b)){b=b.call(a,d,e);}d={top:b.top-e.top+j,left:b.left-e.left+i};"using" in b?b.using.call(a,d):f.css(d);}};c.fn.extend({position:function(){if(!this[0]){return null;}var a=this[0],b=this.offsetParent(),d=this.offset(),f=/^body|html$/i.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.curCSS(a,"marginTop",true))||0;d.left-=parseFloat(c.curCSS(a,"marginLeft",true))||0;f.top+=parseFloat(c.curCSS(b[0],"borderTopWidth",true))||0;f.left+=parseFloat(c.curCSS(b[0],"borderLeftWidth",true))||0;return{top:d.top-f.top,left:d.left-f.left};},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||s.body;a&&!/^body|html$/i.test(a.nodeName)&&c.css(a,"position")==="static";){a=a.offsetParent;}return a;});}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(f){var e=this[0],j;if(!e){return null;}if(f!==w){return this.each(function(){if(j=wa(this)){j.scrollTo(!a?f:c(j).scrollLeft(),a?f:c(j).scrollTop());}else{this[d]=f;}});}else{return(j=wa(e))?"pageXOffset" in j?j[a?"pageYOffset":"pageXOffset"]:c.support.boxModel&&j.document.documentElement[d]||j.document.body[d]:e[d];}};});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();c.fn["inner"+b]=function(){return this[0]?c.css(this[0],d,false,"padding"):null;};c.fn["outer"+b]=function(f){return this[0]?c.css(this[0],d,false,f?"margin":"border"):null;};c.fn[d]=function(f){var e=this[0];if(!e){return f==null?null:this;}if(c.isFunction(f)){return this.each(function(j){var i=c(this);i[d](f.call(this,j,i[d]()));});}return"scrollTo" in e&&e.document?e.document.compatMode==="CSS1Compat"&&e.document.documentElement["client"+b]||e.document.body["client"+b]:e.nodeType===9?Math.max(e.documentElement["client"+b],e.body["scroll"+b],e.documentElement["scroll"+b],e.body["offset"+b],e.documentElement["offset"+b]):f===w?c.css(e,d):this.css(d,typeof f==="string"?f:f+"px");};});A.jQuery=A.$=c;})(window);jQuery.extend({historyCurrentHash:undefined,historyCallback:undefined,historyIframeSrc:undefined,historyNeedIframe:jQuery.browser.msie&&(jQuery.browser.version<7||document.documentMode<7),historyInit:function(callback,src){jQuery.historyCallback=callback;if(src){jQuery.historyIframeSrc=src;}var current_hash=location.hash;var is_chrome=/chrome/.test(navigator.userAgent.toLowerCase());jQuery.historyCurrentHash=current_hash;if(jQuery.historyNeedIframe){if(jQuery.historyCurrentHash==""){jQuery.historyCurrentHash="#!";}jQuery("body").prepend('<iframe id="jQuery_history" style="display: none;" src="javascript:false;"></iframe>');var ihistory=jQuery("#jQuery_history")[0];var iframe=ihistory.contentWindow.document;iframe.open();iframe.close();iframe.location.hash=current_hash;}else{if(jQuery.browser.safari&&!is_chrome){jQuery.historyBackStack=[];jQuery.historyBackStack.length=history.length;jQuery.historyForwardStack=[];jQuery.lastHistoryLength=history.length;jQuery.isFirst=true;}}if(current_hash){jQuery.historyCallback(current_hash.replace(/^#!/,""));if(current_hash=="#!/"){location.hash="";}else{if(current_hash=="#!"){location.hash="";}}}setInterval(jQuery.historyCheck,100);},historyAddHistory:function(hash){jQuery.historyBackStack.push(hash);jQuery.historyForwardStack.length=0;this.isFirst=true;},historyCheck:function(){var is_chrome=/chrome/.test(navigator.userAgent.toLowerCase());if(jQuery.historyNeedIframe){var ihistory=jQuery("#jQuery_history")[0];var iframe=ihistory.contentDocument||ihistory.contentWindow.document;var current_hash=iframe.location.hash;if(current_hash!=jQuery.historyCurrentHash){location.hash=current_hash;jQuery.historyCurrentHash=current_hash;jQuery.historyCallback(current_hash.replace(/^#!/,""));}}else{if(jQuery.browser.safari&&!is_chrome){if(jQuery.lastHistoryLength==history.length&&jQuery.historyBackStack.length>jQuery.lastHistoryLength){jQuery.historyBackStack.shift();}if(!jQuery.dontCheck){var historyDelta=history.length-jQuery.historyBackStack.length;jQuery.lastHistoryLength=history.length;if(historyDelta){jQuery.isFirst=false;if(historyDelta<0){for(var i=0;i<Math.abs(historyDelta);i++){jQuery.historyForwardStack.unshift(jQuery.historyBackStack.pop());}}else{for(var i=0;i<historyDelta;i++){jQuery.historyBackStack.push(jQuery.historyForwardStack.shift());}}var cachedHash=jQuery.historyBackStack[jQuery.historyBackStack.length-1];if(cachedHash!=undefined){jQuery.historyCurrentHash=location.hash.replace(/\?.*$/,"");jQuery.historyCallback(cachedHash);}}else{if(jQuery.historyBackStack[jQuery.historyBackStack.length-1]==undefined&&!jQuery.isFirst){if(location.hash){var current_hash=location.hash;jQuery.historyCallback(location.hash.replace(/^#!/,""));}else{var current_hash="";jQuery.historyCallback("");}jQuery.isFirst=true;}}}}else{var current_hash=location.hash;if(current_hash=="#!/"){}else{if(current_hash=="#!"){}else{if(current_hash!=jQuery.historyCurrentHash){jQuery.historyCurrentHash=current_hash;jQuery.historyCallback(current_hash.replace(/^#!/,""));}}}}}},historyLoad:function(hash){var newhash;var is_chrome=/chrome/.test(navigator.userAgent.toLowerCase());hash=decodeURIComponent(hash.replace(/\?.*$/,""));if(jQuery.browser.safari){newhash=hash;}else{newhash="#!"+hash;location.hash=newhash;}jQuery.historyCurrentHash=newhash;if(jQuery.historyNeedIframe){var ihistory=jQuery("#jQuery_history")[0];var iframe=ihistory.contentWindow.document;iframe.open();iframe.close();iframe.location.hash=newhash;jQuery.lastHistoryLength=history.length;jQuery.historyCallback(hash);}else{if(jQuery.browser.safari&&!is_chrome){jQuery.dontCheck=true;this.historyAddHistory(hash);var fn=function(){jQuery.dontCheck=false;};window.setTimeout(fn,200);jQuery.historyCallback(hash);location.hash=newhash;}else{jQuery.historyCallback(hash);}}}});function showLogin(){$("ajaxLogin").style.display="block";}function onSuccessfulLogin(){Element.hide("ajaxLogin");Element.hide("loginLink");}function authAjax(){Element.update("loginMessage","Sending request ...");Element.show("loginMessage");var form=document.ajaxLoginForm;var params=Form.serialize(form)+"&spring-security-redirect=/login/ajaxSuccess";Form.disable(form);new Ajax.Request(form.action,{method:"POST",postBody:params,onSuccess:function(response){var responseText=response.responseText||"[]";var json=responseText.evalJSON();if(json.success){Element.hide("ajaxLogin");Element.hide("loginLink");onSuccessfulLogin();}else{if(json.error){Element.update("loginMessage","<span class='errorMessage'>"+json.error+"</error>");Form.enable(document.ajaxLoginForm);}else{Element.update("loginMessage",responseText);Form.enable(document.ajaxLoginForm);}}}});}var menu1=new Array();menu1[0]='<div style="background-image:url(/images/verfiedstatus.png); width:296px; height:279px; text-align:justify;"><table style="text-align:justify; font-size:4px;" height="296" width="279" border="0" cellspacing="0" cellpadding="0"><tr height="279"><td valign="top" colspan="3"></td></tr></table></div>';var menu2=new Array();menu2[0]='<div style="background-image:url(/images/SealOfTrust_Silver1.png); width:330px; height:161px; text-align:justify;position:relative;z-index:0 !important;"><table style="text-align:justify; font-size:4px;" height="330" width="161" border="0" cellspacing="0" cellpadding="0"><tr height="276"><td valign="top" colspan="3"></td></tr></table></div>';var menu3=new Array();menu3[0]='<div style="background-image:url(/images/SealOfTrust_Gold1.png); width:330px; height:323px; text-align:justify;position:relative;z-index:0 !important;"><table style="text-align:justify; font-size:4px;" height="330" width="323" border="0" cellspacing="0" cellpadding="0"><tr height="276"><td valign="top" colspan="3"></td></tr></table></div>';var menu4=new Array();menu4[0]='<div style="background-image:url(/images/reputationpopup.png); width:321px; height:200px; text-align:justify;"><table style="text-align:justify; font-size:4px;" height="321" width="200" border="0" cellspacing="0" cellpadding="0"><tr height="200"><td valign="top" colspan="3"></td></tr></table></div>';var menuwidth="330px";var menubgcolor="#FFFFFF";var disappeardelay=250;var hidemenu_onclick="yes";var ie4=document.all;var ns6=document.getElementById&&!document.all;if(ie4||ns6){document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+menuwidth+";background-color:"+menubgcolor+'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>');}function getposOffset(what,offsettype){var totaloffset=(offsettype=="left")?what.offsetLeft:what.offsetTop;var parentEl=what.offsetParent;while(parentEl!=null){totaloffset=(offsettype=="left")?totaloffset+parentEl.offsetLeft:totaloffset+parentEl.offsetTop;parentEl=parentEl.offsetParent;}return totaloffset;}function showhide(obj,e,visible,hidden,menuwidth){if(ie4||ns6){dropmenuobj.style.left=dropmenuobj.style.top="-500px";}if(menuwidth!=""){dropmenuobj.widthobj=dropmenuobj.style;dropmenuobj.widthobj.width=menuwidth;}if(e.type=="click"&&obj.visibility==hidden||e.type=="mouseover"){obj.visibility=visible;}else{if(e.type=="click"){obj.visibility=hidden;}}}function showhide2(obj,e,visible,hidden,menuwidth){if(ie4||ns6){dropmenuobj.style.left=dropmenuobj.style.top="-500px";}if(menuwidth!=""){dropmenuobj.widthobj=dropmenuobj.style;dropmenuobj.widthobj.width=menuwidth;}if(e.type=="click"&&obj.visibility==hidden||e.type=="mouseover"){obj.visibility=visible;}else{if(e.type=="click"){obj.visibility=hidden;}}}function showhide3(obj,e,visible,hidden,menuwidth){if(ie4||ns6){dropmenuobj.style.left=dropmenuobj.style.top="-500px";}if(menuwidth!=""){dropmenuobj.widthobj=dropmenuobj.style;dropmenuobj.widthobj.width=menuwidth;}if(e.type=="click"&&obj.visibility==hidden||e.type=="mouseover"){obj.visibility=visible;}else{if(e.type=="click"){obj.visibility=hidden;}}}function iecompattest(){return(document.compatMode&&document.compatMode!="BackCompat")?document.documentElement:document.body;}function clearbrowseredge(obj,whichedge){var edgeoffset=0;if(whichedge=="rightedge"){var windowedge=ie4&&!window.opera?iecompattest().scrollLeft+iecompattest().clientWidth-15:window.pageXOffset+window.innerWidth-15;dropmenuobj.contentmeasure=dropmenuobj.offsetWidth;if(windowedge-dropmenuobj.x<dropmenuobj.contentmeasure){edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth;}}else{var topedge=ie4&&!window.opera?iecompattest().scrollTop:window.pageYOffset;var windowedge=ie4&&!window.opera?iecompattest().scrollTop+iecompattest().clientHeight-15:window.pageYOffset+window.innerHeight-18;dropmenuobj.contentmeasure=dropmenuobj.offsetHeight;if(windowedge-dropmenuobj.y<dropmenuobj.contentmeasure){edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight;if((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure){edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge;}}}return edgeoffset;}function populatemenu(what){if(ie4||ns6){dropmenuobj.innerHTML=what.join("");}}function dropdownmenu(obj,e,menucontents,menuwidth){if(window.event){event.cancelBubble=true;}else{if(e.stopPropagation){e.stopPropagation();}}clearhidemenu();dropmenuobj=document.getElementById?document.getElementById("dropmenudiv"):dropmenudiv;populatemenu(menucontents);if(ie4||ns6){showhide(dropmenuobj.style,e,"visible","hidden",menuwidth);dropmenuobj.x=getposOffset(obj,"left");dropmenuobj.y=getposOffset(obj,"top");dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj,"rightedge")+"px";dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj,"bottomedge")+obj.offsetHeight+"px";}return clickreturnvalue();}function dropdownmenu2(obj,e,menucontents,menuwidth){if(window.event){event.cancelBubble=true;}else{if(e.stopPropagation){e.stopPropagation();}}clearhidemenu();dropmenuobj=document.getElementById?document.getElementById("dropmenudiv"):dropmenudiv;populatemenu(menucontents);if(ie4||ns6){showhide(dropmenuobj.style,e,"visible","hidden",menuwidth);dropmenuobj.x=getposOffset(obj,"left");dropmenuobj.y=getposOffset(obj,"top");dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj,"rightedge")+"px";dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj,"bottomedge")+obj.offsetHeight+"px";}return clickreturnvalue();}function dropdownmenu3(obj,e,menucontents,menuwidth){if(window.event){event.cancelBubble=true;}else{if(e.stopPropagation){e.stopPropagation();}}clearhidemenu();dropmenuobj=document.getElementById?document.getElementById("dropmenudiv"):dropmenudiv;populatemenu(menucontents);if(ie4||ns6){showhide(dropmenuobj.style,e,"visible","hidden",menuwidth);dropmenuobj.x=getposOffset(obj,"left");dropmenuobj.y=getposOffset(obj,"top");dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj,"rightedge")+"px";dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj,"bottomedge")+obj.offsetHeight+"px";}return clickreturnvalue();}function clickreturnvalue(){if(ie4||ns6){return false;}else{return true;}}function contains_ns6(a,b){while(b.parentNode){if((b=b.parentNode)==a){return true;}}return false;}function dynamichide(e){if(ie4&&!dropmenuobj.contains(e.toElement)){delayhidemenu();}else{if(ns6&&e.currentTarget!=e.relatedTarget&&!contains_ns6(e.currentTarget,e.relatedTarget)){delayhidemenu();}}}function hidemenu(e){if(typeof dropmenuobj!="undefined"){if(ie4||ns6){dropmenuobj.style.visibility="hidden";}}}function delayhidemenu(){if(ie4||ns6){delayhide=setTimeout("hidemenu()",disappeardelay);}}function clearhidemenu(){if(typeof delayhide!="undefined"){clearTimeout(delayhide);}}if(hidemenu_onclick=="yes"){document.onclick=hidemenu;}var Dy=new Array();var Da=new Array(11,12,13);var Dm;var monthFinal;var ContainerId;ReturnFunc="";function Calendar(iYear,iMonth,iDay,ContainerId,ClassName,dy2,dm,dyear){var setDate=0;var dy=new Array();dy=dy2;MonthNames=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");today=new Date();var icurrYear=today.getFullYear();var icurrMonth=today.getMonth();oDate=new Date();Year=(iYear==null)?oDate.getFullYear():iYear;Month=(iMonth==null)?oDate.getMonth():iMonth-1;while(Month<0){Month+=12;Year--;}while(Month>=12){Month-=12;Year++;}Day=(iDay==null)?0:iDay;oDate=new Date(Year,Month,1);NextMonth=new Date(Year,Month+1,1);WeekStart=oDate.getDay();MonthDays=Math.round((NextMonth.getTime()-oDate.getTime())/86400000)+1;if(ContainerId!=null){ContainerId=ContainerId;Container=document.getElementById(ContainerId);if(!Container){document.write('<div id="'+ContainerId+'"> </div>');}}else{do{ContainerId="tblCalendar"+Math.round(Math.random()*1000);}while(document.getElementById(ContainerId));document.write('<div id="'+ContainerId+'"> </div>');}Container=document.getElementById(ContainerId);ClassName=(ClassName==null)?"tblCalendar":ClassName;HTML='<table border="0"  class="'+ClassName+'" cellspacing="0" cellpadding="0" align="center" valign="middle">';HTML+='<tr height="15"><td colspan="7"></td></tr>';HTML+='<tr class="TitleBar" valign="middle" align="left"><td class="Nav"><a href="javascript:void(0)" onMouseDown="Calendar1('+Year+", "+Month+", "+Day+", '"+ContainerId+"', '"+ClassName+"', '"+dy+"','"+dm+"','"+dyear+'\');"><img src="/images/CalanderLeftArrow.png"/></a></td><td height="30" colspan="5" class="Title" valign="middle"><span class="Caldateformat">'+MonthNames[Month]+"  "+Year+'</span></td><td class="Nav" valign="middle" align="right"><a href="javascript:void(0)" onMouseDown="Calendar1('+Year+", "+(Month+2)+", "+Day+", '"+ContainerId+"', '"+ClassName+"', '"+dy+"','"+dm+"','"+dyear+'\');"><img src="/images/CalanderRightArrow.png"/></a></td></tr>';HTML+='<tr class="WeekName" valign="middle" align="center"><td height="18">S</td><td>M</td><td>T</td><td>W</td><td>T</td><td>F</td><td>S</td></tr>';HTML+='<tr class="Days" align="center">';for(DayCounter=0;DayCounter<WeekStart;DayCounter++){HTML+='<td align="center" width="23"> </td>';}for(DayCounter=1;DayCounter<MonthDays;DayCounter++){for(var i=0;i<=dy.length;i++){if(Month+1==dm[i]){if(DayCounter==dy[i]&&DayCounter==Day){monthFinal=Month+1;if(DayCounter<Day){break;}var j=0;j=i;if(Year==dyear[j]){HTML+='<td height="26" class="SelectedDay2" title="calenderkhanh" align="center" width="23"><a href="#!/classifieds/eventList/188?month='+monthFinal+"&day="+DayCounter+"&year="+Year+'" class="DayLink1"><font size="1" color="white"><b>'+DayCounter+"</b></font></a></td>";setDate=DayCounter;}else{if(i!=dy.length){continue;}else{HTML+='<td height="26" class="SelectedDay2"  align="center" width="23"><font size="1" color="black">'+DayCounter+dy+j+"</font></td>";}}if((DayCounter+WeekStart)%7==0){HTML+="</tr>";}DayCounter++;i=0;continue;}if(DayCounter==dy[i]&&DayCounter!=Day){monthFinal=Month+1;if(DayCounter<Day){break;}HTML+='<td height="26" class="SelectedDay1" align="center" width="23"><a href="/classifieds/eventList/188?month='+monthFinal+"&day="+DayCounter+"&year="+Year+'" class="DayLink1"><font color="blue" size="1"><b>'+DayCounter+"</b></font></a></td>";if((DayCounter+WeekStart)%7==0){HTML+="</tr>";}DayCounter++;i=0;continue;}else{}}}if(DayCounter==Day&&Month==icurrMonth&&Year==icurrYear&&DayCounter!=setDate){HTML+='<td height="26" class="SelectedDay" align="center" width="23"><a class="DayLink" href="javascript:ReturnDate('+DayCounter+')"><font size="1">'+DayCounter+"</font></a></td>";}else{if(DayCounter<MonthDays&&DayCounter!=setDate){HTML+='<td height="26"  align="center" width="23"><a class="DayLink" href="javascript:ReturnDate('+DayCounter+')"><font size="1">'+DayCounter+"</font></a></td>";}}if((DayCounter+WeekStart)%7==0){HTML+="</tr>";}}for(j=(42-(MonthDays+WeekStart)),DayCounter=0;DayCounter<=j;DayCounter++){HTML+='<td  height="26" align="center" width="23"> </td>';if((j-DayCounter)%7==0){HTML+="</tr>";}}HTML+="</table>";Container.innerHTML=HTML;return ContainerId;}function ReturnDate(Day){opener.SetDate(Year,Month+1,Day);window.close();}function Calendar1(iYear,iMonth,iDay,ContainerId,ClassName,dy2,dm,dyear){var YearNext=iYear;var dy=new Array();dy=dy2;today=new Date();var icurrYear=today.getFullYear();var icurrMonth=today.getMonth();MonthNames=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");oDate=new Date();Year=(iYear==null)?oDate.getFullYear():iYear;Month=(iMonth==null)?oDate.getMonth():iMonth-1;while(Month<0){Month+=12;Year--;}while(Month>=12){Month-=12;Year++;}var nextYear=0;if(YearNext<Year||Year>icurrYear){nextYear=1;}else{nextYear=0;}Day=(iDay==null)?0:iDay;oDate=new Date(Year,Month,1);NextMonth=new Date(Year,Month+1,1);WeekStart=oDate.getDay();MonthDays=Math.round((NextMonth.getTime()-oDate.getTime())/86400000)+1;if(ContainerId!=null){ContainerId=ContainerId;Container=document.getElementById(ContainerId);if(!Container){document.write('<div id="'+ContainerId+'"> </div>');}}else{do{ContainerId="tblCalendar"+Math.round(Math.random()*1000);}while(document.getElementById(ContainerId));document.write('<div id="'+ContainerId+'"> </div>');}Container=document.getElementById(ContainerId);ClassName=(ClassName==null)?"tblCalendar":ClassName;HTML='<table  border="0"  class="'+ClassName+'" cellspacing="0" cellpadding="0" align="center" valign="top">';HTML+='<tr height="15"><td colspan="7"></td></tr>';HTML+='<tr class="TitleBar" valign="middle"><td class="Nav" valign="middle"><a href="javascript:void(0)" onMouseDown="Calendar1('+Year+", "+Month+", "+Day+", '"+ContainerId+"', '"+ClassName+"', '"+dy+"','"+dm+"','"+dyear+'\');"><img src="/images/CalanderLeftArrow.png"/></a></td><td height="30" colspan="5" class="Title" valign="middle"><span class="Caldateformat">'+MonthNames[Month]+" "+Year+'</span></td><td class="Nav" valign="middle"><a href="javascript:void(0)" onMouseDown="Calendar1('+Year+", "+(Month+2)+", "+Day+", '"+ContainerId+"', '"+ClassName+"', '"+dy+"','"+dm+"','"+dyear+'\');"><img src="/images/CalanderRightArrow.png"/></a></td></tr>';HTML+='<tr class="WeekName" valign="middle" align="center"><td height="18">S</td><td>M</td><td>T</td><td>W</td><td>T</td><td>F</td><td>S</td></tr>';HTML+='<tr class="Days" align="center">';for(DayCounter=0;DayCounter<WeekStart;DayCounter++){HTML+='<td align="center" width="23"> </td>';}for(DayCounter=1;DayCounter<MonthDays;DayCounter++){for(var i=0;i<=dy.length;i++){if((Month+1==dm[i]+ +dm[i+1])){if(dm[i]+ +dm[i+1]>(today.getMonth()+1)){if(DayCounter==dy[i]+dy[i+1]&&DayCounter==Day){monthFinal=Month+1;if(DayCounter<Day&&Year==dyear[j*5]+ +dyear[j*5+1]+ +dyear[j*5+2]+ +dyear[j*5+3]){break;}var j=0;j=i/3;if(Year==dyear[j*5]+ +dyear[j*5+1]+ +dyear[j*5+2]+ +dyear[j*5+3]){HTML+='<td height="26" class="SelectedDay2" align="center" width="23"><a href="/classifieds/eventList/188?month='+dm[i]+ +dm[i+1]+"&day="+dy[i]+ +dy[i+1]+"&year="+Year+'" class="DayLink1"><font size="1" color="white"><b>'+DayCounter+"</b></font></a></td>";DayCounter++;continue;}else{if(i!=dy.length){i++;continue;}else{HTML+='<td height="26" class="SelectedDay2"  align="center" width="23"><font size="1" color="black">'+DayCounter+"</font></td>";}}if((DayCounter+WeekStart)%7==0){HTML+="</tr>";}DayCounter++;i=0;continue;}if(DayCounter==dy[i]+dy[i+1]&&DayCounter!=Day){monthFinal=Month+1;if(DayCounter<Day){monthFinal=Month+1;}var j=0;j=i/3;if(Year==dyear[j*5]+ +dyear[j*5+1]+ +dyear[j*5+2]+ +dyear[j*5+3]){HTML+='<td height="26" class="SelectedDay1" align="center" width="23"><a href="/classifieds/eventList/188?month='+dm[i]+ +dm[i+1]+"&day="+dy[i]+ +dy[i+1]+"&year="+Year+'" class="DayLink1"><font color="blue" size="1"><b>'+DayCounter+"</b></font></a></td>";}else{HTML+='<td height="26"  align="center" width="23"><font size="1" color="black">'+DayCounter+"</font></td>";}if((DayCounter+WeekStart)%7==0){HTML+="</tr>";}DayCounter++;i=0;continue;}else{}}else{if(((dm[i]+ +dm[i+1]<(today.getMonth()+1))&&(nextYear==1))){if(DayCounter==dy[i]+dy[i+1]&&DayCounter==Day){monthFinal=Month+1;if(DayCounter<Day){break;}HTML+='<td height="26" class="SelectedDay2" align="center" width="23"><a href="/classifieds/eventList/188?month='+dm[i]+ +dm[i+1]+"&day="+dy[i]+ +dy[i+1]+"&year="+Year+'" class="DayLink1"><font size="1" color="white"><b>'+DayCounter+"</b></font></a></td>";if((DayCounter+WeekStart)%7==0){HTML+="</tr>";}DayCounter++;i=0;continue;}if(DayCounter==dy[i]+dy[i+1]&&DayCounter!=Day){monthFinal=Month+1;if(DayCounter<Day){monthFinal=Month+1;}HTML+='<td height="26" class="SelectedDay1" align="center" width="23"><a href="/classifieds/eventList/188?month='+dm[i]+ +dm[i+1]+"&day="+dy[i]+ +dy[i+1]+"&year="+Year+'" class="DayLink1"><font color="blue" size="1"><b>'+DayCounter+"</b></font></a></td>";if((DayCounter+WeekStart)%7==0){HTML+="</tr>";}DayCounter++;i=0;continue;}else{}}else{if(dm[i]+ +dm[i+1]==(today.getMonth()+1)&&(nextYear!=1)){if(DayCounter==dy[i]+dy[i+1]&&DayCounter==Day){var j=0;monthFinal=Month+1;HTML+='<td height="26" class="SelectedDay2" align="center" width="23"><a href="/classifieds/eventList/188?month='+dm[i]+ +dm[i+1]+"&day="+dy[i]+ +dy[i+1]+"&year="+Year+'" class="DayLink1"><font size="1" color="white"><b>'+DayCounter+"</b></font></a></td>";if((DayCounter+WeekStart)%7==0){HTML+="</tr>";}DayCounter++;i=0;continue;}else{if(DayCounter==dy[i]+dy[i+1]&&DayCounter!=Day){j=i/3;monthFinal=Month+1;if(DayCounter<Day&&Year==dyear[j*5]+ +dyear[j*5+1]+ +dyear[j*5+2]+ +dyear[j*5+3]){break;}if(Year==dyear[j*5]+ +dyear[j*5+1]+ +dyear[j*5+2]+ +dyear[j*5+3]){HTML+='<td height="26" class="SelectedDay1" align="center" width="23"><a href="/classifieds/eventList/188?month='+dm[i]+ +dm[i+1]+"&day="+dy[i]+ +dy[i+1]+"&year="+Year+'" class="DayLink1"><font color="blue" size="1"><b>'+DayCounter+"</b></font></a></td>";}else{HTML+='<td height="26"   align="center" width="23"><font size="1" color="black">'+DayCounter+"</font></td>";}if((DayCounter+WeekStart)%7==0){HTML+="</tr>";}DayCounter++;i=0;continue;}else{}}}else{if(dm[i]+ +dm[i+1]==(today.getMonth()+1)&&(nextYear==1)){if(DayCounter==dy[i]+dy[i+1]&&DayCounter==Day){var j=0;j=i/3;if(Year==dyear[j*5]+ +dyear[j*5+1]+ +dyear[j*5+2]+ +dyear[j*5+3]){}monthFinal=Month+1;if(DayCounter<Day&&Year==dyear[j*5]+ +dyear[j*5+1]+ +dyear[j*5+2]+ +dyear[j*5+3]){break;}if(Year==dyear[j*5]+ +dyear[j*5+1]+ +dyear[j*5+2]+ +dyear[j*5+3]){HTML+='<td height="26" class="SelectedDay2" align="center" width="23"><a href="/classifieds/eventList/188?month='+dm[i]+ +dm[i+1]+"&day="+dy[i]+ +dy[i+1]+"&year="+Year+'" class="DayLink1"><font size="1" color="white"><b>'+DayCounter+"</b></font></a></td>";DayCounter++;continue;}else{HTML+='<td height="26" class="SelectedDay2"  align="center" width="23"><font size="1" color="black">'+DayCounter+"</font></td>";}if((DayCounter+WeekStart)%7==0){HTML+="</tr>";}DayCounter++;i=0;continue;}else{if(DayCounter==dy[i]+dy[i+1]&&DayCounter!=Day){j=i/3;monthFinal=Month+1;if(Year==dyear[j*5]+ +dyear[j*5+1]+ +dyear[j*5+2]+ +dyear[j*5+3]){HTML+='<td height="26" class="SelectedDay1" align="center" width="23"><a href="/classifieds/eventList/188?month='+dm[i]+ +dm[i+1]+"&day="+dy[i]+ +dy[i+1]+"&year="+Year+'" class="DayLink1"><font color="blue" size="1"><b>'+DayCounter+"</b></font></a></td>";DayCounter++;continue;}else{if(i!=dy.length){i++;continue;}else{HTML+='<td height="26"  align="center" width="23"><font size="1" color="black">'+DayCounter+"</font></td>";}}if((DayCounter+WeekStart)%7==0){HTML+="</tr>";}DayCounter++;i=0;continue;}else{}}}}}}}}if((DayCounter+WeekStart)%7==1){HTML+='<tr class="Days" align="center">';}if(DayCounter==Day&&Month==icurrMonth&&Year==icurrYear){HTML+='<td height="26" class="SelectedDay" align="center" width="23"><a class="DayLink" href="javascript:ReturnDate('+DayCounter+')"><font size="1">'+DayCounter+"</font></a></td>";}else{if(DayCounter<MonthDays){if(DayCounter==Day){HTML+='<td height="26" class="SelectedDay2" align="center" width="23"><a class="DayLink" href="javascript:ReturnDate('+DayCounter+')"><font size="1">'+DayCounter+"</font></a></td>";}else{HTML+='<td height="26"  align="center" width="23"><a class="DayLink" href="javascript:ReturnDate('+DayCounter+')"><font size="1">'+DayCounter+"</font></a></td>";}}}if((DayCounter+WeekStart)%7==0){HTML+="</tr>";}}for(j=(42-(MonthDays+WeekStart)),DayCounter=0;DayCounter<=j;DayCounter++){HTML+='<td height="26" align="center" width="23"> </td>';if((j-DayCounter)%7==0){HTML+="</tr>";}}HTML+="</table>";Container.innerHTML=HTML;return ContainerId;}function ReturnDate(Day){opener.SetDate(Year,Month+1,Day);window.close();}function MakeDate(iYear,iMonth,iDay,fn,dy,dm,dyear){Dy=dy;Dm=dm;D=new Date();Year=D.getFullYear();Month=D.getMonth()+1;Day=D.getDate();ReturnFunc=fn;if(dy==0){dy=D.getDate();}if(dm==0){dm=D.getMonth()+1;}if(dyear==0){dyear=D.getFullYear();}id=Calendar(Year,Month,Day,"cal","CalendarRed",dy,dm,dyear);}var xmlHttp;var BrowserDetect={init:function(){this.browser=this.searchString(this.dataBrowser)||"An unknown browser";this.version=this.searchVersion(navigator.userAgent)||this.searchVersion(navigator.appVersion)||"an unknown version";this.OS=this.searchString(this.dataOS)||"an unknown OS";},searchString:function(data){for(var i=0;i<data.length;i++){var dataString=data[i].string;var dataProp=data[i].prop;this.versionSearchString=data[i].versionSearch||data[i].identity;if(dataString){if(dataString.indexOf(data[i].subString)!=-1){return data[i].identity;}}else{if(dataProp){return data[i].identity;}}}},searchVersion:function(dataString){var index=dataString.indexOf(this.versionSearchString);if(index==-1){return;}return parseFloat(dataString.substring(index+this.versionSearchString.length+1));},dataBrowser:[{string:navigator.userAgent,subString:"Chrome",identity:"Chrome"},{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:"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:"Win",identity:"Windows"},{string:navigator.platform,subString:"Mac",identity:"Mac"},{string:navigator.platform,subString:"Linux",identity:"Linux"}]};BrowserDetect.init();function makeRequest(){if(window.XMLHttpRequest){httpRequest=new XMLHttpRequest();if(httpRequest.overrideMimeType){httpRequest.overrideMimeType("text/xml");}}else{if(window.ActiveXObject){try{httpRequest=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{httpRequest=new ActiveXObject("Microsoft.XMLHTTP");}catch(e){}}}}if(!httpRequest){alert("Giving up :( Cannot create an XMLHTTP instance");return false;}return httpRequest;}(function(){var small="(a|an|and|as|at|but|by|en|for|if|in|of|on|or|the|to|v[.]?|via|vs[.]?)";var punct="([!\"#$%&'()*+,./:;<=>?@[\\\\\\]^_`{|}~-]*)";this.titleCaps=function(title){var parts=[],split=/[:.;?!] |(?: |^)["?]/g,index=0;while(true){var m=split.exec(title);parts.push(title.substring(index,m?m.index:title.length).replace(/\b([A-Za-z][a-z.'?]*)\b/g,function(all){return/[A-Za-z]\.[A-Za-z]/.test(all)?all:upper(all);}).replace(RegExp("\\b"+small+"\\b","ig"),lower).replace(RegExp("^"+punct+small+"\\b","ig"),function(all,punct,word){return punct+upper(word);}).replace(RegExp("\\b"+small+punct+"$","ig"),upper));index=split.lastIndex;if(m){parts.push(m[0]);}else{break;}}return parts.join("").replace(/ V(s?)\. /ig," v$1. ").replace(/(['?])S\b/ig,"$1s").replace(/\b(AT&T|Q&A)\b/ig,function(all){return all.toUpperCase();});};function lower(word){return word.toLowerCase();}function upper(word){return word.substr(0,1).toUpperCase()+word.substr(1);}})();var cssdropdown={disappeardelay:250,dropdownindicator:"",enablereveal:[true,5],enableiframeshim:1,dropmenuobj:null,asscmenuitem:null,domsupport:document.all||document.getElementById,standardbody:null,iframeshimadded:false,revealtimers:{},getposOffset:function(what,offsettype){var totaloffset=(offsettype=="left")?what.offsetLeft:what.offsetTop;var parentEl=what.offsetParent;while(parentEl!=null){totaloffset=(offsettype=="left")?totaloffset+parentEl.offsetLeft:totaloffset+parentEl.offsetTop;parentEl=parentEl.offsetParent;}return totaloffset;},css:function(el,targetclass,action){var needle=new RegExp("(^|\\s+)"+targetclass+"($|\\s+)","ig");if(action=="check"){return needle.test(el.className);}else{if(action=="remove"){el.className=el.className.replace(needle,"");}else{if(action=="add"&&!needle.test(el.className)){el.className+=" "+targetclass;}}}},showmenu:function(dropmenu,e){if(this.enablereveal[0]){if(!dropmenu._trueheight||dropmenu._trueheight<10){dropmenu._trueheight=dropmenu.offsetHeight;}clearTimeout(this.revealtimers[dropmenu.id]);dropmenu.style.height=dropmenu._curheight=0;dropmenu.style.overflow="hidden";dropmenu.style.visibility="visible";this.revealtimers[dropmenu.id]=setInterval(function(){cssdropdown.revealmenu(dropmenu);},10);}else{dropmenu.style.visibility="visible";}this.css(this.asscmenuitem,"selected","add");},revealmenu:function(dropmenu,dir){var curH=dropmenu._curheight,maxH=dropmenu._trueheight,steps=this.enablereveal[1];if(curH<maxH){var newH=Math.min(curH,maxH);dropmenu.style.height=newH+"px";dropmenu._curheight=newH+Math.round((maxH-newH)/steps)+1;}else{dropmenu.style.height="auto";dropmenu.style.overflow="hidden";clearInterval(this.revealtimers[dropmenu.id]);}},clearbrowseredge:function(obj,whichedge){var edgeoffset=0;if(whichedge=="rightedge"){var windowedge=document.all&&!window.opera?this.standardbody.scrollLeft+this.standardbody.clientWidth-15:window.pageXOffset+window.innerWidth-15;var dropmenuW=this.dropmenuobj.offsetWidth;if(windowedge-this.dropmenuobj.x<dropmenuW){edgeoffset=dropmenuW-obj.offsetWidth;}}else{var topedge=document.all&&!window.opera?this.standardbody.scrollTop:window.pageYOffset;var windowedge=document.all&&!window.opera?this.standardbody.scrollTop+this.standardbody.clientHeight-15:window.pageYOffset+window.innerHeight-18;var dropmenuH=this.dropmenuobj._trueheight;if(windowedge-this.dropmenuobj.y<dropmenuH){edgeoffset=dropmenuH+obj.offsetHeight;if((this.dropmenuobj.y-topedge)<dropmenuH){edgeoffset=this.dropmenuobj.y+obj.offsetHeight-topedge;}}}return edgeoffset;},dropit:function(obj,e,dropmenuID){if(this.dropmenuobj!=null){this.hidemenu();}this.clearhidemenu();this.dropmenuobj=document.getElementById(dropmenuID);this.asscmenuitem=obj;this.showmenu(this.dropmenuobj,e);this.dropmenuobj.x=this.getposOffset(obj,"left");this.dropmenuobj.y=this.getposOffset(obj,"top");this.dropmenuobj.style.left=this.dropmenuobj.x-this.clearbrowseredge(obj,"rightedge")+"px";this.dropmenuobj.style.top=this.dropmenuobj.y-this.clearbrowseredge(obj,"bottomedge")+obj.offsetHeight+1+"px";this.positionshim();},positionshim:function(){if(this.iframeshimadded){if(this.dropmenuobj.style.visibility=="visible"){this.shimobject.style.width=this.dropmenuobj.offsetWidth+"px";this.shimobject.style.height=this.dropmenuobj._trueheight+"px";this.shimobject.style.left=parseInt(this.dropmenuobj.style.left)+"px";this.shimobject.style.top=parseInt(this.dropmenuobj.style.top)+"px";this.shimobject.style.display="block";}}},hideshim:function(){if(this.iframeshimadded){this.shimobject.style.display="none";}},isContained:function(m,e){var e=window.event||e;var c=e.relatedTarget||((e.type=="mouseover")?e.fromElement:e.toElement);while(c&&c!=m){try{c=c.parentNode;}catch(e){c=m;}}if(c==m){return true;}else{return false;}},dynamichide:function(m,e){if(!this.isContained(m,e)){this.delayhidemenu();}},delayhidemenu:function(){this.delayhide=setTimeout("cssdropdown.hidemenu()",this.disappeardelay);},hidemenu:function(){this.css(this.asscmenuitem,"selected","remove");this.dropmenuobj.style.visibility="hidden";this.dropmenuobj.style.left=this.dropmenuobj.style.top="-1000px";this.hideshim();},clearhidemenu:function(){if(this.delayhide!="undefined"){clearTimeout(this.delayhide);}},addEvent:function(target,functionref,tasktype){if(target.addEventListener){target.addEventListener(tasktype,functionref,false);}else{if(target.attachEvent){target.attachEvent("on"+tasktype,function(){return functionref.call(target,window.event);});}}},startchrome:function(){if(!this.domsupport){return;}this.standardbody=(document.compatMode=="CSS1Compat")?document.documentElement:document.body;for(var ids=0;ids<arguments.length;ids++){var menuitems=document.getElementById(arguments[ids]).getElementsByTagName("a");for(var i=0;i<menuitems.length;i++){if(menuitems[i].getAttribute("rel")){var relvalue=menuitems[i].getAttribute("rel");var asscdropdownmenu=document.getElementById(relvalue);this.addEvent(asscdropdownmenu,function(){cssdropdown.clearhidemenu();},"mouseover");this.addEvent(asscdropdownmenu,function(e){cssdropdown.dynamichide(this,e);},"mouseout");this.addEvent(asscdropdownmenu,function(){cssdropdown.delayhidemenu();},"click");try{menuitems[i].innerHTML=menuitems[i].innerHTML+" "+this.dropdownindicator;}catch(e){}this.addEvent(menuitems[i],function(e){if(!cssdropdown.isContained(this,e)){var evtobj=window.event||e;cssdropdown.dropit(this,evtobj,this.getAttribute("rel"));}},"mouseover");this.addEvent(menuitems[i],function(e){cssdropdown.dynamichide(this,e);},"mouseout");this.addEvent(menuitems[i],function(){cssdropdown.delayhidemenu();},"click");}}}if(this.enableiframeshim&&document.all&&!window.XDomainRequest&&!this.iframeshimadded){document.write('<IFRAME id="iframeshim" src="about:blank" frameBorder="0" scrolling="no" style="left:0; top:0; position:absolute; display:none;z-index:90; background: transparent;"></IFRAME>');this.shimobject=document.getElementById("iframeshim");this.shimobject.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)";this.iframeshimadded=true;}}};var cssdropdown2={disappeardelay:250,dropdownindicator:"",enablereveal:[true,5],enableiframeshim:1,dropmenuobj:null,asscmenuitem:null,domsupport:document.all||document.getElementById,standardbody:null,iframeshimadded:false,revealtimers:{},getposOffset:function(what,offsettype){var totaloffset=(offsettype=="left")?what.offsetLeft:what.offsetTop;var parentEl=what.offsetParent;while(parentEl!=null){totaloffset=(offsettype=="left")?totaloffset+parentEl.offsetLeft:totaloffset+parentEl.offsetTop;parentEl=parentEl.offsetParent;}return totaloffset;},css:function(el,targetclass,action){var needle=new RegExp("(^|\\s+)"+targetclass+"($|\\s+)","ig");if(action=="check"){return needle.test(el.className);}else{if(action=="remove"){el.className=el.className.replace(needle,"");}else{if(action=="add"&&!needle.test(el.className)){el.className+=" "+targetclass;}}}},showmenu:function(dropmenu,e){if(this.enablereveal[0]){if(!dropmenu._trueheight||dropmenu._trueheight<10){dropmenu._trueheight=dropmenu.offsetHeight;}clearTimeout(this.revealtimers[dropmenu.id]);dropmenu.style.height=dropmenu._curheight=0;dropmenu.style.overflow="hidden";dropmenu.style.visibility="visible";this.revealtimers[dropmenu.id]=setInterval(function(){cssdropdown.revealmenu(dropmenu);},10);}else{dropmenu.style.visibility="visible";}this.css(this.asscmenuitem,"selected","add");},revealmenu:function(dropmenu,dir){var curH=dropmenu._curheight,maxH=dropmenu._trueheight,steps=this.enablereveal[1];if(curH<maxH){var newH=Math.min(curH,maxH);dropmenu.style.height=newH+"px";dropmenu._curheight=newH+Math.round((maxH-newH)/steps)+1;}else{dropmenu.style.height="auto";dropmenu.style.overflow="hidden";clearInterval(this.revealtimers[dropmenu.id]);}},clearbrowseredge:function(obj,whichedge){var edgeoffset=0;if(whichedge=="rightedge"){var windowedge=document.all&&!window.opera?this.standardbody.scrollLeft+this.standardbody.clientWidth-15:window.pageXOffset+window.innerWidth-15;var dropmenuW=this.dropmenuobj.offsetWidth;if(windowedge-this.dropmenuobj.x<dropmenuW){edgeoffset=dropmenuW-obj.offsetWidth;}}else{var topedge=document.all&&!window.opera?this.standardbody.scrollTop:window.pageYOffset;var windowedge=document.all&&!window.opera?this.standardbody.scrollTop+this.standardbody.clientHeight-15:window.pageYOffset+window.innerHeight-18;var dropmenuH=this.dropmenuobj._trueheight;if(windowedge-this.dropmenuobj.y<dropmenuH){edgeoffset=dropmenuH+obj.offsetHeight;if((this.dropmenuobj.y-topedge)<dropmenuH){edgeoffset=this.dropmenuobj.y+obj.offsetHeight-topedge;}}}return edgeoffset;},dropit:function(obj,e,dropmenuID){if(this.dropmenuobj!=null){this.hidemenu();}this.clearhidemenu();this.dropmenuobj=document.getElementById(dropmenuID);this.asscmenuitem=obj;this.showmenu(this.dropmenuobj,e);this.dropmenuobj.x=this.getposOffset(obj,"left");this.dropmenuobj.y=this.getposOffset(obj,"top");this.dropmenuobj.style.left=this.dropmenuobj.x-this.clearbrowseredge(obj,"rightedge")+"px";this.dropmenuobj.style.top=this.dropmenuobj.y-this.clearbrowseredge(obj,"bottomedge")+obj.offsetHeight+1+"px";this.positionshim();},positionshim:function(){if(this.iframeshimadded){if(this.dropmenuobj.style.visibility=="visible"){this.shimobject.style.width=this.dropmenuobj.offsetWidth+"px";this.shimobject.style.height=this.dropmenuobj._trueheight+"px";this.shimobject.style.left=parseInt(this.dropmenuobj.style.left)+"px";this.shimobject.style.top=parseInt(this.dropmenuobj.style.top)+"px";this.shimobject.style.display="block";}}},hideshim:function(){if(this.iframeshimadded){this.shimobject.style.display="none";}},isContained:function(m,e){var e=window.event||e;var c=e.relatedTarget||((e.type=="mouseover")?e.fromElement:e.toElement);while(c&&c!=m){try{c=c.parentNode;}catch(e){c=m;}}if(c==m){return true;}else{return false;}},dynamichide:function(m,e){if(!this.isContained(m,e)){this.delayhidemenu();}},delayhidemenu:function(){this.delayhide=setTimeout("cssdropdown.hidemenu()",this.disappeardelay);},hidemenu:function(){this.css(this.asscmenuitem,"selected","remove");this.dropmenuobj.style.visibility="hidden";this.dropmenuobj.style.left=this.dropmenuobj.style.top="-1000px";this.hideshim();},clearhidemenu:function(){if(this.delayhide!="undefined"){clearTimeout(this.delayhide);}},addEvent:function(target,functionref,tasktype){if(target.addEventListener){target.addEventListener(tasktype,functionref,false);}else{if(target.attachEvent){target.attachEvent("on"+tasktype,function(){return functionref.call(target,window.event);});}}},startchrome:function(){try{if(!this.domsupport){return;}this.standardbody=(document.compatMode=="CSS1Compat")?document.documentElement:document.body;for(var ids=0;ids<arguments.length;ids++){var menuitemsnew=document.getElementById(arguments[ids]);var menuitems=menuitemsnew.getElementsByTagName("a");for(var i=0;i<menuitems.length;i++){if(menuitems[i].getAttribute("rel")){var relvalue=menuitems[i].getAttribute("rel");var asscdropdownmenu=document.getElementById(relvalue);this.addEvent(asscdropdownmenu,function(){cssdropdown.clearhidemenu();},"mouseover");this.addEvent(asscdropdownmenu,function(e){cssdropdown.dynamichide(this,e);},"mouseout");this.addEvent(asscdropdownmenu,function(){cssdropdown.delayhidemenu();},"click");try{menuitems[i].innerHTML=menuitems[i].innerHTML+" "+this.dropdownindicator;}catch(e){}this.addEvent(menuitems[i],function(e){if(!cssdropdown.isContained(this,e)){var evtobj=window.event||e;cssdropdown.dropit(this,evtobj,this.getAttribute("rel"));}},"mouseover");this.addEvent(menuitems[i],function(e){cssdropdown.dynamichide(this,e);},"mouseout");this.addEvent(menuitems[i],function(){cssdropdown.delayhidemenu();},"click");}}}if(this.enableiframeshim&&document.all&&!window.XDomainRequest&&!this.iframeshimadded){document.write('<IFRAME id="iframeshim" src="about:blank" frameBorder="0" scrolling="no" style="left:0; top:0; position:absolute; display:none;z-index:90; background: transparent;"></IFRAME>');this.shimobject=document.getElementById("iframeshim");this.shimobject.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)";this.iframeshimadded=true;}}catch(err){}}};AIM={frame:function(c){var n="f"+Math.floor(Math.random()*99999);var d=document.createElement("DIV");d.innerHTML='<iframe style="display:none" src="about:blank" id="'+n+'" name="'+n+'" onload="AIM.loaded(\''+n+"')\"></iframe>";document.body.appendChild(d);var i=document.getElementById(n);if(c&&typeof(c.onComplete)=="function"){i.onComplete=c.onComplete;}return n;},form:function(f,name){f.setAttribute("target",name);},submit:function(f,c){AIM.form(f,AIM.frame(c));if(c&&typeof(c.onStart)=="function"){return c.onStart();}else{return true;}},loaded:function(id){var i=document.getElementById(id);if(i.contentDocument){var d=i.contentDocument;}else{if(i.contentWindow){var d=i.contentWindow.document;}else{var d=window.frames[id].document;}}if(d.location.href=="about:blank"){return;}if(typeof(i.onComplete)=="function"){i.onComplete(d.body.innerHTML);}}};(function($){$.event.special.mousewheel={setup:function(){var handler=$.event.special.mousewheel.handler;if($.browser.mozilla){$(this).bind("mousemove.mousewheel",function(event){$.data(this,"mwcursorposdata",{pageX:event.pageX,pageY:event.pageY,clientX:event.clientX,clientY:event.clientY});});}if(this.addEventListener){this.addEventListener(($.browser.mozilla?"DOMMouseScroll":"mousewheel"),handler,false);}else{this.onmousewheel=handler;}},teardown:function(){var handler=$.event.special.mousewheel.handler;$(this).unbind("mousemove.mousewheel");if(this.removeEventListener){this.removeEventListener(($.browser.mozilla?"DOMMouseScroll":"mousewheel"),handler,false);}else{this.onmousewheel=function(){};}$.removeData(this,"mwcursorposdata");},handler:function(event){var args=Array.prototype.slice.call(arguments,1);event=$.event.fix(event||window.event);$.extend(event,$.data(this,"mwcursorposdata")||{});var delta=0,returnValue=true;if(event.wheelDelta){delta=event.wheelDelta/120;}if(event.detail){delta=-event.detail/3;}event.data=event.data||{};event.type="mousewheel";args.unshift(delta);args.unshift(event);return $.event.handle.apply(this,args);}};$.fn.extend({mousewheel:function(fn){return fn?this.bind("mousewheel",fn):this.trigger("mousewheel");},unmousewheel:function(fn){return this.unbind("mousewheel",fn);}});})(jQuery);(function($){$.jScrollPane={active:[]};$.fn.jScrollPane=function(settings){settings=$.extend({},$.fn.jScrollPane.defaults,settings);var rf=function(){return false;};return this.each(function(){var $this=$(this);$this.css("overflow","hidden");var paneEle=this;if($(this).parent().is(".jScrollPaneContainer")){var currentScrollPosition=settings.maintainPosition?$this.position().top:0;var $c=$(this).parent();var paneWidth=$c.innerWidth();var paneHeight=$c.outerHeight();var trackHeight=paneHeight;$(">.jScrollPaneTrack, >.jScrollArrowUp, >.jScrollArrowDown",$c).remove();$this.css({top:0});}else{var currentScrollPosition=0;this.originalPadding=$this.css("paddingTop")+" "+$this.css("paddingRight")+" "+$this.css("paddingBottom")+" "+$this.css("paddingLeft");this.originalSidePaddingTotal=(parseInt($this.css("paddingLeft"))||0)+(parseInt($this.css("paddingRight"))||0);var paneWidth=$this.innerWidth();var paneHeight=$this.innerHeight();var trackHeight=paneHeight;$this.wrap($("<div></div>").attr({className:"jScrollPaneContainer"}).css({height:paneHeight+"px",width:paneWidth+"px"}));$(document).bind("emchange",function(e,cur,prev){$this.jScrollPane(settings);});}if(settings.reinitialiseOnImageLoad){var $imagesToLoad=$.data(paneEle,"jScrollPaneImagesToLoad")||$("img",$this);var loadedImages=[];if($imagesToLoad.length){$imagesToLoad.each(function(i,val){$(this).bind("load",function(){if($.inArray(i,loadedImages)==-1){loadedImages.push(val);$imagesToLoad=$.grep($imagesToLoad,function(n,i){return n!=val;});$.data(paneEle,"jScrollPaneImagesToLoad",$imagesToLoad);settings.reinitialiseOnImageLoad=false;$this.jScrollPane(settings);}}).each(function(i,val){if(this.complete||this.complete===undefined){this.src=this.src;}});});}}var p=this.originalSidePaddingTotal;var cssToApply={height:"auto",width:paneWidth-settings.scrollbarWidth-settings.scrollbarMargin-p+"px"};if(settings.scrollbarOnLeft){cssToApply.paddingLeft=settings.scrollbarMargin+settings.scrollbarWidth+"px";}else{cssToApply.paddingRight=settings.scrollbarMargin+"px";}$this.css(cssToApply);var contentHeight=$this.outerHeight();var percentInView=paneHeight/contentHeight;if(percentInView<0.99){var $container=$this.parent();$container.append($("<div></div>").attr({className:"jScrollPaneTrack"}).css({width:settings.scrollbarWidth+"px"}).append($("<div></div>").attr({className:"jScrollPaneDrag"}).css({width:settings.scrollbarWidth+"px"}).append($("<div></div>").attr({className:"jScrollPaneDragTop"}).css({width:settings.scrollbarWidth+"px"}),$("<div></div>").attr({className:"jScrollPaneDragBottom"}).css({width:settings.scrollbarWidth+"px"}))));var $track=$(">.jScrollPaneTrack",$container);var $drag=$(">.jScrollPaneTrack .jScrollPaneDrag",$container);if(settings.showArrows){var currentArrowButton;var currentArrowDirection;var currentArrowInterval;var currentArrowInc;var whileArrowButtonDown=function(){if(currentArrowInc>4||currentArrowInc%4==0){positionDrag(dragPosition+currentArrowDirection*mouseWheelMultiplier);}currentArrowInc++;};var onArrowMouseUp=function(event){$("html").unbind("mouseup",onArrowMouseUp);currentArrowButton.removeClass("jScrollActiveArrowButton");clearInterval(currentArrowInterval);};var onArrowMouseDown=function(){$("html").bind("mouseup",onArrowMouseUp);currentArrowButton.addClass("jScrollActiveArrowButton");currentArrowInc=0;whileArrowButtonDown();currentArrowInterval=setInterval(whileArrowButtonDown,100);};$container.append($("<a></a>").attr({href:"javascript:;",className:"jScrollArrowUp"}).css({width:settings.scrollbarWidth+"px"}).html("Scroll up").bind("mousedown",function(){currentArrowButton=$(this);currentArrowDirection=-1;onArrowMouseDown();this.blur();return false;}).bind("click",rf),$("<a></a>").attr({href:"javascript:;",className:"jScrollArrowDown"}).css({width:settings.scrollbarWidth+"px"}).html("Scroll down").bind("mousedown",function(){currentArrowButton=$(this);currentArrowDirection=1;onArrowMouseDown();this.blur();return false;}).bind("click",rf));var $upArrow=$(">.jScrollArrowUp",$container);var $downArrow=$(">.jScrollArrowDown",$container);if(settings.arrowSize){trackHeight=paneHeight-settings.arrowSize-settings.arrowSize;$track.css({height:trackHeight+"px",top:settings.arrowSize+"px"});}else{var topArrowHeight=$upArrow.height();settings.arrowSize=topArrowHeight;trackHeight=paneHeight-topArrowHeight-$downArrow.height();$track.css({height:trackHeight+"px",top:topArrowHeight+"px"});}}var $pane=$(this).css({position:"absolute",overflow:"visible"});var currentOffset;var maxY;var mouseWheelMultiplier;var dragPosition=0;var dragMiddle=percentInView*paneHeight/2;var getPos=function(event,c){var p=c=="X"?"Left":"Top";return event["page"+c]||(event["client"+c]+(document.documentElement["scroll"+p]||document.body["scroll"+p]))||0;};var ignoreNativeDrag=function(){return false;};var initDrag=function(){ceaseAnimation();currentOffset=$drag.offset(false);currentOffset.top-=dragPosition;maxY=trackHeight-$drag[0].offsetHeight;mouseWheelMultiplier=2*settings.wheelSpeed*maxY/contentHeight;};var onStartDrag=function(event){initDrag();dragMiddle=getPos(event,"Y")-dragPosition-currentOffset.top;$("html").bind("mouseup",onStopDrag).bind("mousemove",updateScroll);if($.browser.msie){$("html").bind("dragstart",ignoreNativeDrag).bind("selectstart",ignoreNativeDrag);}return false;};var onStopDrag=function(){$("html").unbind("mouseup",onStopDrag).unbind("mousemove",updateScroll);dragMiddle=percentInView*paneHeight/2;if($.browser.msie){$("html").unbind("dragstart",ignoreNativeDrag).unbind("selectstart",ignoreNativeDrag);}};var positionDrag=function(destY){destY=destY<0?0:(destY>maxY?maxY:destY);dragPosition=destY;$drag.css({top:destY+"px"});var p=destY/maxY;$pane.css({top:((paneHeight-contentHeight)*p)+"px"});$this.trigger("scroll");if(settings.showArrows){$upArrow[destY==0?"addClass":"removeClass"]("disabled");$downArrow[destY==maxY?"addClass":"removeClass"]("disabled");}};var updateScroll=function(e){positionDrag(getPos(e,"Y")-currentOffset.top-dragMiddle);};var dragH=Math.max(Math.min(percentInView*(paneHeight-settings.arrowSize*2),settings.dragMaxHeight),settings.dragMinHeight);$drag.css({height:dragH+"px"}).bind("mousedown",onStartDrag);var trackScrollInterval;var trackScrollInc;var trackScrollMousePos;var doTrackScroll=function(){if(trackScrollInc>8||trackScrollInc%4==0){positionDrag((dragPosition-((dragPosition-trackScrollMousePos)/2)));}trackScrollInc++;};var onStopTrackClick=function(){clearInterval(trackScrollInterval);$("html").unbind("mouseup",onStopTrackClick).unbind("mousemove",onTrackMouseMove);};var onTrackMouseMove=function(event){trackScrollMousePos=getPos(event,"Y")-currentOffset.top-dragMiddle;};var onTrackClick=function(event){initDrag();onTrackMouseMove(event);trackScrollInc=0;$("html").bind("mouseup",onStopTrackClick).bind("mousemove",onTrackMouseMove);trackScrollInterval=setInterval(doTrackScroll,100);doTrackScroll();};$track.bind("mousedown",onTrackClick);$container.bind("mousewheel",function(event,delta){initDrag();ceaseAnimation();var d=dragPosition;positionDrag(dragPosition-delta*mouseWheelMultiplier);var dragOccured=d!=dragPosition;return !dragOccured;});var _animateToPosition;var _animateToInterval;function animateToPosition(){var diff=(_animateToPosition-dragPosition)/settings.animateStep;if(diff>1||diff<-1){positionDrag(dragPosition+diff);}else{positionDrag(_animateToPosition);ceaseAnimation();}}var ceaseAnimation=function(){if(_animateToInterval){clearInterval(_animateToInterval);delete _animateToPosition;}};var scrollTo=function(pos,preventAni){if(typeof pos=="string"){$e=$(pos,$this);if(!$e.length){return;}pos=$e.offset().top-$this.offset().top;}$container.scrollTop(0);ceaseAnimation();var destDragPosition=-pos/(paneHeight-contentHeight)*maxY;if(preventAni||!settings.animateTo){positionDrag(destDragPosition);}else{_animateToPosition=destDragPosition;_animateToInterval=setInterval(animateToPosition,settings.animateInterval);}};$this[0].scrollTo=scrollTo;$this[0].scrollBy=function(delta){var currentPos=-parseInt($pane.css("top"))||0;scrollTo(currentPos+delta);};initDrag();scrollTo(-currentScrollPosition,true);$("*",this).bind("focus",function(event){var $e=$(this);var eleTop=0;while($e[0]!=$this[0]){eleTop+=$e.position().top;$e=$e.offsetParent();}var viewportTop=-parseInt($pane.css("top"))||0;var maxVisibleEleTop=viewportTop+paneHeight;var eleInView=eleTop>viewportTop&&eleTop<maxVisibleEleTop;if(!eleInView){var destPos=eleTop-settings.scrollbarMargin;if(eleTop>viewportTop){destPos+=$(this).height()+15+settings.scrollbarMargin-paneHeight;}scrollTo(destPos);}});if(location.hash){scrollTo(location.hash);}$(document).bind("click",function(e){$target=$(e.target);if($target.is("a")){var h=$target.attr("href");if(h.substr(0,1)=="#"){scrollTo(h);}}});$.jScrollPane.active.push($this[0]);}else{$this.css({height:paneHeight+"px",width:paneWidth-this.originalSidePaddingTotal+"px",padding:this.originalPadding});$this.parent().unbind("mousewheel");}});};$.fn.jScrollPane.defaults={scrollbarWidth:10,scrollbarMargin:5,wheelSpeed:18,showArrows:false,arrowSize:0,animateTo:false,dragMinHeight:1,dragMaxHeight:99999,animateInterval:100,animateStep:3,maintainPosition:true,scrollbarOnLeft:false,reinitialiseOnImageLoad:false};$(window).bind("unload",function(){var els=$.jScrollPane.active;for(var i=0;i<els.length;i++){els[i].scrollTo=els[i].scrollBy=null;}});})(jQuery);jQuery(function($){var eventName="emchange";$.em=$.extend({version:"1.0",delay:200,element:$("<div />").css({left:"-100em",position:"absolute",width:"100em"}).prependTo("body")[0],action:function(){var currentWidth=$.em.element.offsetWidth/100;if(currentWidth!=$.em.current){$.em.previous=$.em.current;$.em.current=currentWidth;$.event.trigger(eventName,[$.em.current,$.em.previous]);}}},$.em);$.fn[eventName]=function(fn){return fn?this.bind(eventName,fn):this.trigger(eventName);};$.em.current=$.em.element.offsetWidth/100;$.em.iid=setInterval($.em.action,$.em.delay);});var popupStatus=0;function loadPopup(){if(popupStatus==0){$j("#backgroundPopup").css({opacity:"0.0"});$j("#backgroundPopup").fadeIn("slow");$j("#popupContact").fadeIn("slow");popupStatus=1;}}function disablePopup(){if(popupStatus==1){$j("#backgroundPopup").fadeOut("slow");$j("#popupContact").fadeOut("slow");popupStatus=0;}}function centerPopup(){var windowWidth=document.documentElement.clientWidth;var windowHeight=document.documentElement.clientHeight;var popupHeight=$j("#popupContact").height();var popupWidth=$j("#popupContact").width();$j("#popupContact").css({position:"absolute",top:"110.5px;",left:"320px;"});$j("#backgroundPopup").css({height:windowHeight});}$j(document).ready(function(){$j("#buttonSlides").click(function(){centerPopup();loadPopup();});$j("#popupContactClose").click(function(){disablePopup();});$j("#backgroundPopup").click(function(){disablePopup();});$j(document).keypress(function(e){if(e.keyCode==27&&popupStatus==1){disablePopup();}});});function textCounter(field,countfield,maxlimit){alert("max"+maxlimit);if(field.value.length>maxlimit){field.value=field.value.substring(0,maxlimit);}else{countfield.value=maxlimit-field.value.length;}}function showChar(obj){var max=0;var obj3=document.getElementById("char");if(max==0){max=obj3.firstChild.nodeValue*1;}len=obj.value.length;var cur=max*1;cur=cur-len;if(cur<0){var obj2=document.forms.adForm.elements.description;var str=obj2.value.substring(0,max*1);obj2.value=str;showChar(obj2,max);return false;}else{var obj2=document.getElementById("char");var str=document.createTextNode(cur);obj2.replaceChild(str,obj2.firstChild);return true;}}function maxlength(element,maxvalue){var q=eval("document.adForm."+element+".value.length");var r=q-maxvalue;var msg="Sorry, you have input "+q+" characters into the text area box you just completed. It can return no more than "+maxvalue+" characters to be processed. Please abbreviate your text by at least "+r+" characters";if(q>maxvalue){alert(msg);}}function getAnchorPosition(anchorname){var useWindow=false;var coordinates=new Object();var x=0,y=0;var use_gebi=false,use_css=false,use_layers=false;if(document.getElementById){use_gebi=true;}else{if(document.all){use_css=true;}else{if(document.layers){use_layers=true;}}}if(use_gebi&&document.all){x=AnchorPosition_getPageOffsetLeft(document.all[anchorname]);y=AnchorPosition_getPageOffsetTop(document.all[anchorname]);}else{if(use_gebi){var o=document.getElementById(anchorname);x=AnchorPosition_getPageOffsetLeft(o);y=AnchorPosition_getPageOffsetTop(o);}else{if(use_css){x=AnchorPosition_getPageOffsetLeft(document.all[anchorname]);y=AnchorPosition_getPageOffsetTop(document.all[anchorname]);}else{if(use_layers){var found=0;for(var i=0;i<document.anchors.length;i++){if(document.anchors[i].name==anchorname){found=1;break;}}if(found==0){coordinates.x=0;coordinates.y=0;return coordinates;}x=document.anchors[i].x;y=document.anchors[i].y;}else{coordinates.x=0;coordinates.y=0;return coordinates;}}}}coordinates.x=x;coordinates.y=y;return coordinates;}function getAnchorWindowPosition(anchorname){var coordinates=getAnchorPosition(anchorname);var x=0;var y=0;if(document.getElementById){if(isNaN(window.screenX)){x=coordinates.x-document.body.scrollLeft+window.screenLeft;y=coordinates.y-document.body.scrollTop+window.screenTop;}else{x=coordinates.x+window.screenX+(window.outerWidth-window.innerWidth)-window.pageXOffset;y=coordinates.y+window.screenY+(window.outerHeight-24-window.innerHeight)-window.pageYOffset;}}else{if(document.all){x=coordinates.x-document.body.scrollLeft+window.screenLeft;y=coordinates.y-document.body.scrollTop+window.screenTop;}else{if(document.layers){x=coordinates.x+window.screenX+(window.outerWidth-window.innerWidth)-window.pageXOffset;y=coordinates.y+window.screenY+(window.outerHeight-24-window.innerHeight)-window.pageYOffset;}}}coordinates.x=x;coordinates.y=y;return coordinates;}function AnchorPosition_getPageOffsetLeft(el){var ol=el.offsetLeft;while((el=el.offsetParent)!=null){ol+=el.offsetLeft;}return ol;}function AnchorPosition_getWindowOffsetLeft(el){return AnchorPosition_getPageOffsetLeft(el)-document.body.scrollLeft;}function AnchorPosition_getPageOffsetTop(el){var ot=el.offsetTop;while((el=el.offsetParent)!=null){ot+=el.offsetTop;}return ot;}function AnchorPosition_getWindowOffsetTop(el){return AnchorPosition_getPageOffsetTop(el)-document.body.scrollTop;}var MONTH_NAMES=new Array("January","February","March","April","May","June","July","August","September","October","November","December","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");var DAY_NAMES=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sun","Mon","Tue","Wed","Thu","Fri","Sat");function LZ(x){return(x<0||x>9?"":"0")+x;}function isDate(val,format){var date=getDateFromFormat(val,format);if(date==0){return false;}return true;}function compareDates(date1,dateformat1,date2,dateformat2){var d1=getDateFromFormat(date1,dateformat1);var d2=getDateFromFormat(date2,dateformat2);if(d1==0||d2==0){return -1;}else{if(d1>d2){return 1;}}return 0;}function formatDate(date,format){format=format+"";var result="";var i_format=0;var c="";var token="";var y=date.getYear()+"";var M=date.getMonth()+1;var d=date.getDate();var E=date.getDay();var H=date.getHours();var m=date.getMinutes();var s=date.getSeconds();var yyyy,yy,MMM,MM,dd,hh,h,mm,ss,ampm,HH,H,KK,K,kk,k;var value=new Object();if(y.length<4){y=""+(y-0+1900);}value.y=""+y;value.yyyy=y;value.yy=y.substring(2,4);value.M=M;value.MM=LZ(M);value.MMM=MONTH_NAMES[M-1];value.NNN=MONTH_NAMES[M+11];value.d=d;value.dd=LZ(d);value.E=DAY_NAMES[E+7];value.EE=DAY_NAMES[E];value.H=H;value.HH=LZ(H);if(H==0){value.h=12;}else{if(H>12){value.h=H-12;}else{value.h=H;}}value.hh=LZ(value.h);if(H>11){value.K=H-12;}else{value.K=H;}value.k=H+1;value.KK=LZ(value.K);value.kk=LZ(value.k);if(H>11){value.a="PM";}else{value.a="AM";}value.m=m;value.mm=LZ(m);value.s=s;value.ss=LZ(s);while(i_format<format.length){c=format.charAt(i_format);token="";while((format.charAt(i_format)==c)&&(i_format<format.length)){token+=format.charAt(i_format++);}if(value[token]!=null){result=result+value[token];}else{result=result+token;}}return result;}function _isInteger(val){var digits="1234567890";for(var i=0;i<val.length;i++){if(digits.indexOf(val.charAt(i))==-1){return false;}}return true;}function _getInt(str,i,minlength,maxlength){for(var x=maxlength;x>=minlength;x--){var token=str.substring(i,i+x);if(token.length<minlength){return null;}if(_isInteger(token)){return token;}}return null;}function getDateFromFormat(val,format){val=val+"";format=format+"";var i_val=0;var i_format=0;var c="";var token="";var token2="";var x,y;var now=new Date();var year=now.getYear();var month=now.getMonth()+1;var date=1;var hh=now.getHours();var mm=now.getMinutes();var ss=now.getSeconds();var ampm="";while(i_format<format.length){c=format.charAt(i_format);token="";while((format.charAt(i_format)==c)&&(i_format<format.length)){token+=format.charAt(i_format++);}if(token=="yyyy"||token=="yy"||token=="y"){if(token=="yyyy"){x=4;y=4;}if(token=="yy"){x=2;y=2;}if(token=="y"){x=2;y=4;}year=_getInt(val,i_val,x,y);if(year==null){return 0;}i_val+=year.length;if(year.length==2){if(year>70){year=1900+(year-0);}else{year=2000+(year-0);}}}else{if(token=="MMM"||token=="NNN"){month=0;for(var i=0;i<MONTH_NAMES.length;i++){var month_name=MONTH_NAMES[i];if(val.substring(i_val,i_val+month_name.length).toLowerCase()==month_name.toLowerCase()){if(token=="MMM"||(token=="NNN"&&i>11)){month=i+1;if(month>12){month-=12;}i_val+=month_name.length;break;}}}if((month<1)||(month>12)){return 0;}}else{if(token=="EE"||token=="E"){for(var i=0;i<DAY_NAMES.length;i++){var day_name=DAY_NAMES[i];if(val.substring(i_val,i_val+day_name.length).toLowerCase()==day_name.toLowerCase()){i_val+=day_name.length;break;}}}else{if(token=="MM"||token=="M"){month=_getInt(val,i_val,token.length,2);if(month==null||(month<1)||(month>12)){return 0;}i_val+=month.length;}else{if(token=="dd"||token=="d"){date=_getInt(val,i_val,token.length,2);if(date==null||(date<1)||(date>31)){return 0;}i_val+=date.length;}else{if(token=="hh"||token=="h"){hh=_getInt(val,i_val,token.length,2);if(hh==null||(hh<1)||(hh>12)){return 0;}i_val+=hh.length;}else{if(token=="HH"||token=="H"){hh=_getInt(val,i_val,token.length,2);if(hh==null||(hh<0)||(hh>23)){return 0;}i_val+=hh.length;}else{if(token=="KK"||token=="K"){hh=_getInt(val,i_val,token.length,2);if(hh==null||(hh<0)||(hh>11)){return 0;}i_val+=hh.length;}else{if(token=="kk"||token=="k"){hh=_getInt(val,i_val,token.length,2);if(hh==null||(hh<1)||(hh>24)){return 0;}i_val+=hh.length;hh--;}else{if(token=="mm"||token=="m"){mm=_getInt(val,i_val,token.length,2);if(mm==null||(mm<0)||(mm>59)){return 0;}i_val+=mm.length;}else{if(token=="ss"||token=="s"){ss=_getInt(val,i_val,token.length,2);if(ss==null||(ss<0)||(ss>59)){return 0;}i_val+=ss.length;}else{if(token=="a"){if(val.substring(i_val,i_val+2).toLowerCase()=="am"){ampm="AM";}else{if(val.substring(i_val,i_val+2).toLowerCase()=="pm"){ampm="PM";}else{return 0;}}i_val+=2;}else{if(val.substring(i_val,i_val+token.length)!=token){return 0;}else{i_val+=token.length;}}}}}}}}}}}}}}if(i_val!=val.length){return 0;}if(month==2){if(((year%4==0)&&(year%100!=0))||(year%400==0)){if(date>29){return 0;}}else{if(date>28){return 0;}}}if((month==4)||(month==6)||(month==9)||(month==11)){if(date>30){return 0;}}if(hh<12&&ampm=="PM"){hh=hh-0+12;}else{if(hh>11&&ampm=="AM"){hh-=12;}}var newdate=new Date(year,month-1,date,hh,mm,ss);return newdate.getTime();}function parseDate(val){var preferEuro=(arguments.length==2)?arguments[1]:false;generalFormats=new Array("y-M-d","MMM d, y","MMM d,y","y-MMM-d","d-MMM-y","MMM d");monthFirst=new Array("M/d/y","M-d-y","M.d.y","MMM-d","M/d","M-d");dateFirst=new Array("d/M/y","d-M-y","d.M.y","d-MMM","d/M","d-M");var checkList=new Array("generalFormats",preferEuro?"dateFirst":"monthFirst",preferEuro?"monthFirst":"dateFirst");var d=null;for(var i=0;i<checkList.length;i++){var l=window[checkList[i]];for(var j=0;j<l.length;j++){d=getDateFromFormat(val,l[j]);if(d!=0){return new Date(d);}}}return null;}function PopupWindow_getXYPosition(anchorname){var coordinates;if(this.type=="WINDOW"){coordinates=getAnchorWindowPosition(anchorname);}else{coordinates=getAnchorPosition(anchorname);}this.x=coordinates.x;this.y=coordinates.y;}function PopupWindow_setSize(width,height){this.width=width;this.height=height;}function PopupWindow_populate(contents){this.contents=contents;this.populated=false;}function PopupWindow_setUrl(url){this.url=url;}function PopupWindow_setWindowProperties(props){this.windowProperties=props;}function PopupWindow_refresh(){if(this.divName!=null){if(this.use_gebi){document.getElementById(this.divName).innerHTML=this.contents;}else{if(this.use_css){document.all[this.divName].innerHTML=this.contents;}else{if(this.use_layers){var d=document.layers[this.divName];d.document.open();d.document.writeln(this.contents);d.document.close();}}}}else{if(this.popupWindow!=null&&!this.popupWindow.closed){if(this.url!=""){this.popupWindow.location.href=this.url;}else{this.popupWindow.document.open();this.popupWindow.document.writeln(this.contents);this.popupWindow.document.close();}this.popupWindow.focus();}}}function PopupWindow_showPopup(anchorname){this.getXYPosition(anchorname);this.x+=this.offsetX;this.y+=this.offsetY;if(!this.populated&&(this.contents!="")){this.populated=true;this.refresh();}if(this.divName!=null){if(this.use_gebi){document.getElementById(this.divName).style.left=this.x+"px";document.getElementById(this.divName).style.top=this.y+"px";document.getElementById(this.divName).style.visibility="visible";}else{if(this.use_css){document.all[this.divName].style.left=this.x;document.all[this.divName].style.top=this.y;document.all[this.divName].style.visibility="visible";}else{if(this.use_layers){document.layers[this.divName].left=this.x;document.layers[this.divName].top=this.y;document.layers[this.divName].visibility="visible";}}}}else{if(this.popupWindow==null||this.popupWindow.closed){if(this.x<0){this.x=0;}if(this.y<0){this.y=0;}if(screen&&screen.availHeight){if((this.y+this.height)>screen.availHeight){this.y=screen.availHeight-this.height;}}if(screen&&screen.availWidth){if((this.x+this.width)>screen.availWidth){this.x=screen.availWidth-this.width;}}var avoidAboutBlank=window.opera||(document.layers&&!navigator.mimeTypes["*"])||navigator.vendor=="KDE"||(document.childNodes&&!document.all&&!navigator.taintEnabled);this.popupWindow=window.open(avoidAboutBlank?"":"about:blank","window_"+anchorname,this.windowProperties+",width="+this.width+",height="+this.height+",screenX="+this.x+",left="+this.x+",screenY="+this.y+",top="+this.y+"");}this.refresh();}}function PopupWindow_hidePopup(){if(this.divName!=null){if(this.use_gebi){document.getElementById(this.divName).style.visibility="hidden";}else{if(this.use_css){document.all[this.divName].style.visibility="hidden";}else{if(this.use_layers){document.layers[this.divName].visibility="hidden";}}}}else{if(this.popupWindow&&!this.popupWindow.closed){this.popupWindow.close();this.popupWindow=null;}}}function PopupWindow_isClicked(e){if(this.divName!=null){if(this.use_layers){var clickX=e.pageX;var clickY=e.pageY;var t=document.layers[this.divName];if((clickX>t.left)&&(clickX<t.left+t.clip.width)&&(clickY>t.top)&&(clickY<t.top+t.clip.height)){return true;}else{return false;}}else{if(document.all){var t=window.event.srcElement;while(t.parentElement!=null){if(t.id==this.divName){return true;}t=t.parentElement;}return false;}else{if(this.use_gebi&&e){var t=e.originalTarget;if(typeof(t)!="undefined"){while(t.parentNode!=null){if(t.id==this.divName){return true;}t=t.parentNode;}}return false;}}}return false;}return false;}function PopupWindow_hideIfNotClicked(e){if(this.autoHideEnabled&&!this.isClicked(e)){this.hidePopup();}}function PopupWindow_autoHide(){this.autoHideEnabled=true;}function PopupWindow_hidePopupWindows(e){for(var i=0;i<popupWindowObjects.length;i++){if(popupWindowObjects[i]!=null){var p=popupWindowObjects[i];p.hideIfNotClicked(e);}}}function PopupWindow_attachListener(){if(document.layers){document.captureEvents(Event.MOUSEUP);}window.popupWindowOldEventListener=document.onmouseup;if(window.popupWindowOldEventListener!=null){document.onmouseup=new Function("window.popupWindowOldEventListener();PopupWindow_hidePopupWindows();");}else{document.onmouseup=PopupWindow_hidePopupWindows;}}function PopupWindow(){if(!window.popupWindowIndex){window.popupWindowIndex=0;}if(!window.popupWindowObjects){window.popupWindowObjects=new Array();}if(!window.listenerAttached){window.listenerAttached=true;PopupWindow_attachListener();}this.index=popupWindowIndex++;popupWindowObjects[this.index]=this;this.divName=null;this.popupWindow=null;this.width=0;this.height=0;this.populated=false;this.visible=false;this.autoHideEnabled=false;this.contents="";this.url="";this.windowProperties="toolbar=no,location=no,status=no,menubar=no,scrollbars=auto,resizable,alwaysRaised,dependent,titlebar=no";if(arguments.length>0){this.type="DIV";this.divName=arguments[0];}else{this.type="WINDOW";}this.use_gebi=false;this.use_css=false;this.use_layers=false;if(document.getElementById){this.use_gebi=true;}else{if(document.all){this.use_css=true;}else{if(document.layers){this.use_layers=true;}else{this.type="WINDOW";}}}this.offsetX=0;this.offsetY=0;this.getXYPosition=PopupWindow_getXYPosition;this.populate=PopupWindow_populate;this.setUrl=PopupWindow_setUrl;this.setWindowProperties=PopupWindow_setWindowProperties;this.refresh=PopupWindow_refresh;this.showPopup=PopupWindow_showPopup;this.hidePopup=PopupWindow_hidePopup;this.setSize=PopupWindow_setSize;this.isClicked=PopupWindow_isClicked;this.autoHide=PopupWindow_autoHide;this.hideIfNotClicked=PopupWindow_hideIfNotClicked;}function CP_stop(e){if(e&&e.stopPropagation){e.stopPropagation();}}function CalendarPopup(){var c;if(arguments.length>0){c=new PopupWindow(arguments[0]);}else{c=new PopupWindow();c.setSize(150,175);}c.offsetX=-152;c.offsetY=25;c.autoHide();c.monthNames=new Array("January","February","March","April","May","June","July","August","September","October","November","December");c.monthAbbreviations=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");c.dayHeaders=new Array("S","M","T","W","T","F","S");c.returnFunction="CP_tmpReturnFunction";c.returnMonthFunction="CP_tmpReturnMonthFunction";c.returnQuarterFunction="CP_tmpReturnQuarterFunction";c.returnYearFunction="CP_tmpReturnYearFunction";c.weekStartDay=0;c.isShowYearNavigation=false;c.displayType="date";c.disabledWeekDays=new Object();c.disabledDatesExpression="";c.yearSelectStartOffset=2;c.currentDate=null;c.todayText="Today";c.cssPrefix="";c.isShowNavigationDropdowns=false;c.isShowYearNavigationInput=false;window.CP_calendarObject=null;window.CP_targetInput=null;window.CP_dateFormat="MM/dd/yyyy";c.copyMonthNamesToWindow=CP_copyMonthNamesToWindow;c.setReturnFunction=CP_setReturnFunction;c.setReturnMonthFunction=CP_setReturnMonthFunction;c.setReturnQuarterFunction=CP_setReturnQuarterFunction;c.setReturnYearFunction=CP_setReturnYearFunction;c.setMonthNames=CP_setMonthNames;c.setMonthAbbreviations=CP_setMonthAbbreviations;c.setDayHeaders=CP_setDayHeaders;c.setWeekStartDay=CP_setWeekStartDay;c.setDisplayType=CP_setDisplayType;c.setDisabledWeekDays=CP_setDisabledWeekDays;c.addDisabledDates=CP_addDisabledDates;c.setYearSelectStartOffset=CP_setYearSelectStartOffset;c.setTodayText=CP_setTodayText;c.showYearNavigation=CP_showYearNavigation;c.showCalendar=CP_showCalendar;c.hideCalendar=CP_hideCalendar;c.getStyles=getCalendarStyles;c.refreshCalendar=CP_refreshCalendar;c.getCalendar=CP_getCalendar;c.select=CP_select;c.setCssPrefix=CP_setCssPrefix;c.showNavigationDropdowns=CP_showNavigationDropdowns;c.showYearNavigationInput=CP_showYearNavigationInput;c.copyMonthNamesToWindow();return c;}function CP_copyMonthNamesToWindow(){if(typeof(window.MONTH_NAMES)!="undefined"&&window.MONTH_NAMES!=null){window.MONTH_NAMES=new Array();for(var i=0;i<this.monthNames.length;i++){window.MONTH_NAMES[window.MONTH_NAMES.length]=this.monthNames[i];}for(var i=0;i<this.monthAbbreviations.length;i++){window.MONTH_NAMES[window.MONTH_NAMES.length]=this.monthAbbreviations[i];}}}function CP_tmpReturnFunction(y,m,d){if(window.CP_targetInput!=null){var dt=new Date(y,m-1,d,0,0,0);if(window.CP_calendarObject!=null){window.CP_calendarObject.copyMonthNamesToWindow();}window.CP_targetInput.value=formatDate(dt,window.CP_dateFormat);}else{alert("Use setReturnFunction() to define which function will get the clicked results!");}}function CP_tmpReturnMonthFunction(y,m){alert("Use setReturnMonthFunction() to define which function will get the clicked results!\nYou clicked: year="+y+" , month="+m);}function CP_tmpReturnQuarterFunction(y,q){alert("Use setReturnQuarterFunction() to define which function will get the clicked results!\nYou clicked: year="+y+" , quarter="+q);}function CP_tmpReturnYearFunction(y){alert("Use setReturnYearFunction() to define which function will get the clicked results!\nYou clicked: year="+y);}function CP_setReturnFunction(name){this.returnFunction=name;}function CP_setReturnMonthFunction(name){this.returnMonthFunction=name;}function CP_setReturnQuarterFunction(name){this.returnQuarterFunction=name;}function CP_setReturnYearFunction(name){this.returnYearFunction=name;}function CP_setMonthNames(){for(var i=0;i<arguments.length;i++){this.monthNames[i]=arguments[i];}this.copyMonthNamesToWindow();}function CP_setMonthAbbreviations(){for(var i=0;i<arguments.length;i++){this.monthAbbreviations[i]=arguments[i];}this.copyMonthNamesToWindow();}function CP_setDayHeaders(){for(var i=0;i<arguments.length;i++){this.dayHeaders[i]=arguments[i];}}function CP_setWeekStartDay(day){this.weekStartDay=day;}function CP_showYearNavigation(){this.isShowYearNavigation=(arguments.length>0)?arguments[0]:true;}function CP_setDisplayType(type){if(type!="date"&&type!="week-end"&&type!="month"&&type!="quarter"&&type!="year"){alert("Invalid display type! Must be one of: date,week-end,month,quarter,year");return false;}this.displayType=type;}function CP_setYearSelectStartOffset(num){this.yearSelectStartOffset=num;}function CP_setDisabledWeekDays(){this.disabledWeekDays=new Object();for(var i=0;i<arguments.length;i++){this.disabledWeekDays[arguments[i]]=true;}}function CP_addDisabledDates(start,end){if(arguments.length==1){end=start;}if(start==null&&end==null){return;}if(this.disabledDatesExpression!=""){this.disabledDatesExpression+="||";}if(start!=null){start=parseDate(start);start=""+start.getFullYear()+LZ(start.getMonth()+1)+LZ(start.getDate());}if(end!=null){end=parseDate(end);end=""+end.getFullYear()+LZ(end.getMonth()+1)+LZ(end.getDate());}if(start==null){this.disabledDatesExpression+="(ds<="+end+")";}else{if(end==null){this.disabledDatesExpression+="(ds>="+start+")";}else{this.disabledDatesExpression+="(ds>="+start+"&&ds<="+end+")";}}}function CP_setTodayText(text){this.todayText=text;}function CP_setCssPrefix(val){this.cssPrefix=val;}function CP_showNavigationDropdowns(){this.isShowNavigationDropdowns=(arguments.length>0)?arguments[0]:true;}function CP_showYearNavigationInput(){this.isShowYearNavigationInput=(arguments.length>0)?arguments[0]:true;}function CP_hideCalendar(){if(arguments.length>0){window.popupWindowObjects[arguments[0]].hidePopup();}else{this.hidePopup();}}function CP_refreshCalendar(index){var calObject=window.popupWindowObjects[index];if(arguments.length>1){calObject.populate(calObject.getCalendar(arguments[1],arguments[2],arguments[3],arguments[4],arguments[5]));}else{calObject.populate(calObject.getCalendar());}calObject.refresh();}function CP_showCalendar(anchorname){if(arguments.length>1){if(arguments[1]==null||arguments[1]==""){this.currentDate=new Date();}else{this.currentDate=new Date(parseDate(arguments[1]));}}this.populate(this.getCalendar());this.showPopup(anchorname);}function CP_select(inputobj,linkname,format){var selectedDate=(arguments.length>3)?arguments[3]:null;if(!window.getDateFromFormat){alert("calendar.select: To use this method you must also include 'date.js' for date formatting");return;}if(this.displayType!="date"&&this.displayType!="week-end"){alert("calendar.select: This function can only be used with displayType 'date' or 'week-end'");return;}if(inputobj.type!="text"&&inputobj.type!="hidden"&&inputobj.type!="textarea"){alert("calendar.select: Input object passed is not a valid form input object");window.CP_targetInput=null;return;}if(inputobj.disabled){return;}window.CP_targetInput=inputobj;window.CP_calendarObject=this;this.currentDate=null;var time=0;if(selectedDate!=null){time=getDateFromFormat(selectedDate,format);}else{if(inputobj.value!=""){time=getDateFromFormat(inputobj.value,format);}}if(selectedDate!=null||inputobj.value!=""){if(time==0){this.currentDate=null;}else{this.currentDate=new Date(time);}}window.CP_dateFormat=format;this.showCalendar(linkname);}function getCalendarStyles(){var result="";var p="";if(this!=null&&typeof(this.cssPrefix)!="undefined"&&this.cssPrefix!=null&&this.cssPrefix!=""){p=this.cssPrefix;}result+="<STYLE>\n";result+="."+p+"cpYearNavigation,."+p+"cpMonthNavigation{background-color:#C0C0C0;text-align:center;vertical-align:center;text-decoration:none;color:#000000;font-weight:bold;}\n";result+="."+p+"cpDayColumnHeader, ."+p+"cpYearNavigation,."+p+"cpMonthNavigation,."+p+"cpCurrentMonthDate,."+p+"cpCurrentMonthDateDisabled,."+p+"cpOtherMonthDate,."+p+"cpOtherMonthDateDisabled,."+p+"cpCurrentDate,."+p+"cpCurrentDateDisabled,."+p+"cpTodayText,."+p+"cpTodayTextDisabled,."+p+"cpText{font-family:arial;font-size:8pt;}\n";result+="TD."+p+"cpDayColumnHeader{text-align:right;border:solid thin #C0C0C0;border-width:0px 0px 1px 0px;}\n";result+="."+p+"cpCurrentMonthDate, ."+p+"cpOtherMonthDate, ."+p+"cpCurrentDate{text-align:right;text-decoration:none;}\n";result+="."+p+"cpCurrentMonthDateDisabled, ."+p+"cpOtherMonthDateDisabled, ."+p+"cpCurrentDateDisabled{color:#D0D0D0;text-align:right;text-decoration:line-through;}\n";result+="."+p+"cpCurrentMonthDate, .cpCurrentDate{color:#000000;}\n";result+="."+p+"cpOtherMonthDate{color:#808080;}\n";result+="TD."+p+"cpCurrentDate{color:white;background-color: #C0C0C0;border-width:1px;border:solid thin #800000;}\n";result+="TD."+p+"cpCurrentDateDisabled{border-width:1px;border:solid thin #FFAAAA;}\n";result+="TD."+p+"cpTodayText, TD."+p+"cpTodayTextDisabled{border:solid thin #C0C0C0;border-width:1px 0px 0px 0px;}\n";result+="A."+p+"cpTodayText, SPAN."+p+"cpTodayTextDisabled{height:20px;}\n";result+="A."+p+"cpTodayText{color:black;}\n";result+="."+p+"cpTodayTextDisabled{color:#D0D0D0;}\n";result+="."+p+"cpBorder{border:solid thin #808080;}\n";result+="</STYLE>\n";return result;}function CP_getCalendar(){var now=new Date();if(this.type=="WINDOW"){var windowref="window.opener.";}else{var windowref="";}var result="";if(this.type=="WINDOW"){result+="<HTML><HEAD><TITLE>Calendar</TITLE>"+this.getStyles()+"</HEAD><BODY MARGINWIDTH=0 MARGINHEIGHT=0 TOPMARGIN=0 RIGHTMARGIN=0 LEFTMARGIN=0>\n";result+="<CENTER><TABLE WIDTH=100% BORDER=0 BORDERWIDTH=0 CELLSPACING=0 CELLPADDING=0>\n";}else{result+='<TABLE CLASS="'+this.cssPrefix+'cpBorder" WIDTH=144 BORDER=1 BORDERWIDTH=1 CELLSPACING=0 CELLPADDING=1>\n';result+="<TR><TD ALIGN=CENTER>\n";result+="<CENTER>\n";}if(this.displayType=="date"||this.displayType=="week-end"){if(this.currentDate==null){this.currentDate=now;}if(arguments.length>0){var month=arguments[0];}else{var month=this.currentDate.getMonth()+1;}if(arguments.length>1&&arguments[1]>0&&arguments[1]-0==arguments[1]){var year=arguments[1];}else{var year=this.currentDate.getFullYear();}var daysinmonth=new Array(0,31,28,31,30,31,30,31,31,30,31,30,31);if(((year%4==0)&&(year%100!=0))||(year%400==0)){daysinmonth[2]=29;}var current_month=new Date(year,month-1,1);var display_year=year;var display_month=month;var display_date=1;var weekday=current_month.getDay();var offset=0;offset=(weekday>=this.weekStartDay)?weekday-this.weekStartDay:7-this.weekStartDay+weekday;if(offset>0){display_month--;if(display_month<1){display_month=12;display_year--;}display_date=daysinmonth[display_month]-offset+1;}var next_month=month+1;var next_month_year=year;if(next_month>12){next_month=1;next_month_year++;}var last_month=month-1;var last_month_year=year;if(last_month<1){last_month=12;last_month_year--;}var date_class;if(this.type!="WINDOW"){result+="<TABLE WIDTH=144 BORDER=0 BORDERWIDTH=0 CELLSPACING=0 CELLPADDING=0>";}result+="<TR>\n";var refresh=windowref+"CP_refreshCalendar";var refreshLink="javascript:"+refresh;if(this.isShowNavigationDropdowns){result+='<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="78" COLSPAN="3"><select CLASS="'+this.cssPrefix+'cpMonthNavigation" name="cpMonth" onmouseup="CP_stop(event)" onChange="'+refresh+"("+this.index+",this.options[this.selectedIndex].value-0,"+(year-0)+');">';for(var monthCounter=1;monthCounter<=12;monthCounter++){var selected=(monthCounter==month)?"SELECTED":"";result+='<option value="'+monthCounter+'" '+selected+">"+this.monthNames[monthCounter-1]+"</option>";}result+="</select></TD>";result+='<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="10">&nbsp;</TD>';result+='<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="56" COLSPAN="3"><select CLASS="'+this.cssPrefix+'cpYearNavigation" name="cpYear" onmouseup="CP_stop(event)" onChange="'+refresh+"("+this.index+","+month+',this.options[this.selectedIndex].value-0);">';for(var yearCounter=year-this.yearSelectStartOffset;yearCounter<=year+this.yearSelectStartOffset;yearCounter++){var selected=(yearCounter==year)?"SELECTED":"";result+='<option value="'+yearCounter+'" '+selected+">"+yearCounter+"</option>";}result+="</select></TD>";}else{if(this.isShowYearNavigation){result+='<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="10"><A CLASS="'+this.cssPrefix+'cpMonthNavigation" HREF="'+refreshLink+"("+this.index+","+last_month+","+last_month_year+');">&lt;</A></TD>';result+='<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="58"><SPAN CLASS="'+this.cssPrefix+'cpMonthNavigation">'+this.monthNames[month-1]+"</SPAN></TD>";result+='<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="10"><A CLASS="'+this.cssPrefix+'cpMonthNavigation" HREF="'+refreshLink+"("+this.index+","+next_month+","+next_month_year+');">&gt;</A></TD>';result+='<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="10">&nbsp;</TD>';result+='<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="10"><A CLASS="'+this.cssPrefix+'cpYearNavigation" HREF="'+refreshLink+"("+this.index+","+month+","+(year-1)+');">&lt;</A></TD>';if(this.isShowYearNavigationInput){result+='<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="36"><INPUT NAME="cpYear" CLASS="'+this.cssPrefix+'cpYearNavigation" SIZE="4" MAXLENGTH="4" VALUE="'+year+'" onBlur="'+refresh+"("+this.index+","+month+',this.value-0);"></TD>';}else{result+='<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="36"><SPAN CLASS="'+this.cssPrefix+'cpYearNavigation">'+year+"</SPAN></TD>";}result+='<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="10"><A CLASS="'+this.cssPrefix+'cpYearNavigation" HREF="'+refreshLink+"("+this.index+","+month+","+(year+1)+');">&gt;</A></TD>';}else{result+='<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="22"><A CLASS="'+this.cssPrefix+'cpMonthNavigation" HREF="'+refreshLink+"("+this.index+","+last_month+","+last_month_year+');">&lt;&lt;</A></TD>\n';result+='<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="100"><SPAN CLASS="'+this.cssPrefix+'cpMonthNavigation">'+this.monthNames[month-1]+" "+year+"</SPAN></TD>\n";result+='<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="22"><A CLASS="'+this.cssPrefix+'cpMonthNavigation" HREF="'+refreshLink+"("+this.index+","+next_month+","+next_month_year+');">&gt;&gt;</A></TD>\n';}}result+="</TR></TABLE>\n";result+="<TABLE WIDTH=120 BORDER=0 CELLSPACING=0 CELLPADDING=1 ALIGN=CENTER>\n";result+="<TR>\n";for(var j=0;j<7;j++){result+='<TD CLASS="'+this.cssPrefix+'cpDayColumnHeader" WIDTH="14%"><SPAN CLASS="'+this.cssPrefix+'cpDayColumnHeader">'+this.dayHeaders[(this.weekStartDay+j)%7]+"</TD>\n";}result+="</TR>\n";for(var row=1;row<=6;row++){result+="<TR>\n";for(var col=1;col<=7;col++){var disabled=false;if(this.disabledDatesExpression!=""){var ds=""+display_year+LZ(display_month)+LZ(display_date);eval("disabled=("+this.disabledDatesExpression+")");}var dateClass="";if((display_month==this.currentDate.getMonth()+1)&&(display_date==this.currentDate.getDate())&&(display_year==this.currentDate.getFullYear())){dateClass="cpCurrentDate";}else{if(display_month==month){dateClass="cpCurrentMonthDate";}else{dateClass="cpOtherMonthDate";}}if(disabled||this.disabledWeekDays[col-1]){result+='	<TD CLASS="'+this.cssPrefix+dateClass+'"><SPAN CLASS="'+this.cssPrefix+dateClass+'Disabled">'+display_date+"</SPAN></TD>\n";}else{var selected_date=display_date;var selected_month=display_month;var selected_year=display_year;if(this.displayType=="week-end"){var d=new Date(selected_year,selected_month-1,selected_date,0,0,0,0);d.setDate(d.getDate()+(7-col));selected_year=d.getYear();if(selected_year<1000){selected_year+=1900;}selected_month=d.getMonth()+1;selected_date=d.getDate();}result+='	<TD CLASS="'+this.cssPrefix+dateClass+'"><A HREF="javascript:'+windowref+this.returnFunction+"("+selected_year+","+selected_month+","+selected_date+");"+windowref+"CP_hideCalendar('"+this.index+'\');" CLASS="'+this.cssPrefix+dateClass+'">'+display_date+"</A></TD>\n";}display_date++;if(display_date>daysinmonth[display_month]){display_date=1;display_month++;}if(display_month>12){display_month=1;display_year++;}}result+="</TR>";}var current_weekday=now.getDay()-this.weekStartDay;if(current_weekday<0){current_weekday+=7;}result+="<TR>\n";result+='	<TD COLSPAN=7 ALIGN=CENTER CLASS="'+this.cssPrefix+'cpTodayText">\n';if(this.disabledDatesExpression!=""){var ds=""+now.getFullYear()+LZ(now.getMonth()+1)+LZ(now.getDate());eval("disabled=("+this.disabledDatesExpression+")");}if(disabled||this.disabledWeekDays[current_weekday+1]){result+='		<SPAN CLASS="'+this.cssPrefix+'cpTodayTextDisabled">'+this.todayText+"</SPAN>\n";}else{result+='		<A CLASS="'+this.cssPrefix+'cpTodayText" HREF="javascript:'+windowref+this.returnFunction+"('"+now.getFullYear()+"','"+(now.getMonth()+1)+"','"+now.getDate()+"');"+windowref+"CP_hideCalendar('"+this.index+"');\">"+this.todayText+"</A>\n";}result+="		<BR>\n";result+="	</TD></TR></TABLE></CENTER></TD></TR></TABLE>\n";}if(this.displayType=="month"||this.displayType=="quarter"||this.displayType=="year"){if(arguments.length>0){var year=arguments[0];}else{if(this.displayType=="year"){var year=now.getFullYear()-this.yearSelectStartOffset;}else{var year=now.getFullYear();}}if(this.displayType!="year"&&this.isShowYearNavigation){result+="<TABLE WIDTH=144 BORDER=0 BORDERWIDTH=0 CELLSPACING=0 CELLPADDING=0>";result+="<TR>\n";result+='	<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="22"><A CLASS="'+this.cssPrefix+'cpYearNavigation" HREF="javascript:'+windowref+"CP_refreshCalendar("+this.index+","+(year-1)+');">&lt;&lt;</A></TD>\n';result+='	<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="100">'+year+"</TD>\n";result+='	<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="22"><A CLASS="'+this.cssPrefix+'cpYearNavigation" HREF="javascript:'+windowref+"CP_refreshCalendar("+this.index+","+(year+1)+');">&gt;&gt;</A></TD>\n';result+="</TR></TABLE>\n";}}if(this.displayType=="month"){result+="<TABLE WIDTH=120 BORDER=0 CELLSPACING=1 CELLPADDING=0 ALIGN=CENTER>\n";for(var i=0;i<4;i++){result+="<TR>";for(var j=0;j<3;j++){var monthindex=((i*3)+j);result+='<TD WIDTH=33% ALIGN=CENTER><A CLASS="'+this.cssPrefix+'cpText" HREF="javascript:'+windowref+this.returnMonthFunction+"("+year+","+(monthindex+1)+");"+windowref+"CP_hideCalendar('"+this.index+'\');" CLASS="'+date_class+'">'+this.monthAbbreviations[monthindex]+"</A></TD>";}result+="</TR>";}result+="</TABLE></CENTER></TD></TR></TABLE>\n";}if(this.displayType=="quarter"){result+="<BR><TABLE WIDTH=120 BORDER=1 CELLSPACING=0 CELLPADDING=0 ALIGN=CENTER>\n";for(var i=0;i<2;i++){result+="<TR>";for(var j=0;j<2;j++){var quarter=((i*2)+j+1);result+='<TD WIDTH=50% ALIGN=CENTER><BR><A CLASS="'+this.cssPrefix+'cpText" HREF="javascript:'+windowref+this.returnQuarterFunction+"("+year+","+quarter+");"+windowref+"CP_hideCalendar('"+this.index+'\');" CLASS="'+date_class+'">Q'+quarter+"</A><BR><BR></TD>";}result+="</TR>";}result+="</TABLE></CENTER></TD></TR></TABLE>\n";}if(this.displayType=="year"){var yearColumnSize=4;result+="<TABLE WIDTH=144 BORDER=0 BORDERWIDTH=0 CELLSPACING=0 CELLPADDING=0>";result+="<TR>\n";result+='	<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="50%"><A CLASS="'+this.cssPrefix+'cpYearNavigation" HREF="javascript:'+windowref+"CP_refreshCalendar("+this.index+","+(year-(yearColumnSize*2))+');">&lt;&lt;</A></TD>\n';result+='	<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="50%"><A CLASS="'+this.cssPrefix+'cpYearNavigation" HREF="javascript:'+windowref+"CP_refreshCalendar("+this.index+","+(year+(yearColumnSize*2))+');">&gt;&gt;</A></TD>\n';result+="</TR></TABLE>\n";result+="<TABLE WIDTH=120 BORDER=0 CELLSPACING=1 CELLPADDING=0 ALIGN=CENTER>\n";for(var i=0;i<yearColumnSize;i++){for(var j=0;j<2;j++){var currentyear=year+(j*yearColumnSize)+i;result+='<TD WIDTH=50% ALIGN=CENTER><A CLASS="'+this.cssPrefix+'cpText" HREF="javascript:'+windowref+this.returnYearFunction+"("+currentyear+");"+windowref+"CP_hideCalendar('"+this.index+'\');" CLASS="'+date_class+'">'+currentyear+"</A></TD>";}result+="</TR>";}result+="</TABLE></CENTER></TD></TR></TABLE>\n";}if(this.type=="WINDOW"){result+="</BODY></HTML>\n";}return result;}var dateFormat=function(){var token=/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,timezone=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,timezoneClip=/[^-+\dA-Z]/g,pad=function(val,len){val=String(val);len=len||2;while(val.length<len){val="0"+val;}return val;};return function(date,mask,utc){var dF=dateFormat;if(arguments.length==1&&Object.prototype.toString.call(date)=="[object String]"&&!/\d/.test(date)){mask=date;date=undefined;}date=date?new Date(date):new Date;if(isNaN(date)){throw SyntaxError("invalid date");}mask=String(dF.masks[mask]||mask||dF.masks["default"]);if(mask.slice(0,4)=="UTC:"){mask=mask.slice(4);utc=true;}var _=utc?"getUTC":"get",d=date[_+"Date"](),D=date[_+"Day"](),m=date[_+"Month"](),y=date[_+"FullYear"](),H=date[_+"Hours"](),M=date[_+"Minutes"](),s=date[_+"Seconds"](),L=date[_+"Milliseconds"](),o=utc?0:date.getTimezoneOffset(),flags={d:d,dd:pad(d),ddd:dF.i18n.dayNames[D],dddd:dF.i18n.dayNames[D+7],m:m+1,mm:pad(m+1),mmm:dF.i18n.monthNames[m],mmmm:dF.i18n.monthNames[m+12],yy:String(y).slice(2),yyyy:y,h:H%12||12,hh:pad(H%12||12),H:H,HH:pad(H),M:M,MM:pad(M),s:s,ss:pad(s),l:pad(L,3),L:pad(L>99?Math.round(L/10):L),t:H<12?"a":"p",tt:H<12?"am":"pm",T:H<12?"A":"P",TT:H<12?"AM":"PM",Z:utc?"UTC":(String(date).match(timezone)||[""]).pop().replace(timezoneClip,""),o:(o>0?"-":"+")+pad(Math.floor(Math.abs(o)/60)*100+Math.abs(o)%60,4),S:["th","st","nd","rd"][d%10>3?0:(d%100-d%10!=10)*d%10]};return mask.replace(token,function($0){return $0 in flags?flags[$0]:$0.slice(1,$0.length-1);});};}();dateFormat.masks={"default":"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:ss",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"};dateFormat.i18n={dayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"]};Date.prototype.format=function(mask,utc){return dateFormat(this,mask,utc);};(function($){$.fn.simplyScroll=function(o){return this.each(function(){new $.simplyScroll(this,o);});};var defaults={className:"simply-scroll",frameRate:22,speed:2,horizontal:true,autoMode:"loop",pauseOnHover:true,startOnLoad:false,localJsonSource:"",flickrFeed:"",jsonImgWidth:240,jsonImgHeight:180};$.simplyScroll=function(el,o){var self=this;this.o=$.extend({},defaults,o||{});this.auto=this.o.autoMode!=="off"?true:false;this.$list=$(el);this.$list.addClass("simply-scroll-list").wrap('<div class="simply-scroll-clip"></div>').parent().wrap('<div class="'+this.o.className+' simply-scroll-container"></div>');if(!this.o.auto){this.$list.parent().parent().prepend('<div class="simply-scroll-forward"></div>').prepend('<div class="simply-scroll-back"></div>');}if(this.o.flickrFeed){$.getJSON(this.o.flickrFeed+"&format=json&jsoncallback=?",function(data){json=[];$.each(data.items,function(i,item){json.push({src:item.media.m,title:item.title,link:item.link});});self.renderData(json);});}else{if(this.o.localJsonSource){$.getJSON(this.o.localJsonSource,function(json){self.renderData(json);});}else{if(!this.o.startOnLoad){this.init();}else{$(window).load(function(){self.init();});}}}};$.simplyScroll.fn=$.simplyScroll.prototype={};$.simplyScroll.fn.extend=$.simplyScroll.extend=$.extend;$.simplyScroll.fn.extend({init:function(){this.$items=this.$list.children();this.$clip=this.$list.parent();this.$container=this.$clip.parent();if(!this.o.horizontal){this.itemMax=this.$items[0].offsetHeight;this.clipMax=this.$clip.height();this.dimension="height";this.moveBackClass="simply-scroll-btn-up";this.moveForwardClass="simply-scroll-btn-down";}else{this.itemMax=this.$items[0].offsetWidth;this.clipMax=this.$clip.width();this.dimension="width";this.moveBackClass="simply-scroll-btn-left";this.moveForwardClass="simply-scroll-btn-right";}this.posMin=0;this.posMax=this.$items.length*this.itemMax;this.$list.css(this.dimension,this.posMax+"px");if(this.o.autoMode=="loop"){var addItems=Math.ceil(this.clipMax/this.itemMax);this.$items.slice(0,addItems).clone(true).appendTo(this.$list);this.posMax+=(this.clipMax-this.o.speed);this.$list.css(this.dimension,this.posMax+(this.itemMax*addItems)+"px");}this.interval=null;this.intervalDelay=Math.floor(1000/this.o.frameRate);while(this.itemMax%this.o.speed!==0){this.o.speed--;if(this.o.speed===0){this.o.speed=1;break;}}var self=this;this.trigger=null;this.funcMoveBack=function(){self.trigger=this;self.moveBack();};this.funcMoveForward=function(){self.trigger=this;self.moveForward();};this.funcMoveStop=function(){self.moveStop();};this.funcMoveResume=function(){self.moveResume();};if(this.auto){if(this.o.pauseOnHover){this.$clip.hover(this.funcMoveStop,this.funcMoveResume);}this.moveForward();}else{this.$btnBack=$(".simply-scroll-back",this.$container).addClass("simply-scroll-btn "+this.moveBackClass+" disabled").hover(this.funcMoveBack,this.funcMoveStop);this.$btnForward=$(".simply-scroll-forward",this.$container).addClass("simply-scroll-btn "+this.moveForwardClass).hover(this.funcMoveForward,this.funcMoveStop);}},moveForward:function(){var self=this;this.movement="forward";if(this.trigger!==null){this.$btnBack.removeClass("disabled");}self.interval=setInterval(function(){if(!self.o.horizontal&&self.$clip[0].scrollTop<(self.posMax-self.clipMax)){self.$clip[0].scrollTop+=self.o.speed;}else{if(self.o.horizontal&&self.$clip[0].scrollLeft<(self.posMax-self.clipMax)){self.$clip[0].scrollLeft+=self.o.speed;}else{if(self.o.autoMode=="loop"){self.resetPos();}else{self.moveStop(self.movement);}}}},self.intervalDelay);},moveBack:function(){var self=this;this.movement="back";if(this.trigger!==null){this.$btnForward.removeClass("disabled");}self.interval=setInterval(function(){if(!self.o.horizontal&&self.$clip[0].scrollTop>0){self.$clip[0].scrollTop-=self.o.speed;}else{if(self.o.horizontal&&self.$clip[0].scrollLeft>0){self.$clip[0].scrollLeft-=self.o.speed;}else{if(self.o.autoMode=="loop"){self.resetPos();}else{self.moveStop(self.movement);}}}},self.intervalDelay);},moveStop:function(moveDir){clearInterval(this.interval);if(this.trigger!==null){if(typeof moveDir!="undefined"){$(this.trigger).addClass("disabled");}this.trigger=null;}if(this.auto){if(this.o.autoMode=="bounce"){moveDir=="forward"?this.moveBack():this.moveForward();}}},moveResume:function(){this.movement=="forward"?this.moveForward():this.moveBack();},resetPos:function(){if(!this.o.horizontal){this.$clip[0].scrollTop=0;}else{this.$clip[0].scrollLeft=0;}},renderData:function(json){if(json.length>0){var self=this;$.each(json,function(i,item){$("<img/>").attr({src:item.src,title:item.title,alt:item.title,width:self.o.jsonImgWidth,height:self.o.jsonImgHeight}).appendTo(self.$list);});this.init();}}});})(jQuery);function Validator(frmname){this.formobj=document.forms[frmname];if(!this.formobj){alert("Error: couldnot get Form object "+frmname);return;}if(this.formobj.onsubmit){this.formobj.old_onsubmit=this.formobj.onsubmit;this.formobj.onsubmit=null;}else{this.formobj.old_onsubmit=null;}this.formobj._sfm_form_name=frmname;this.formobj.onsubmit=form_submit_handler;this.addValidation=add_validation;this.setAddnlValidationFunction=set_addnl_vfunction;this.clearAllValidations=clear_all_validations;this.disable_validations=false;document.error_disp_handler=new sfm_ErrorDisplayHandler();this.EnableOnPageErrorDisplay=validator_enable_OPED;this.EnableOnPageErrorDisplaySingleBox=validator_enable_OPED_SB;this.show_errors_together=true;this.EnableMsgsTogether=sfm_enable_show_msgs_together;document.set_focus_onerror=true;this.EnableFocusOnError=sfm_validator_enable_focus;}function sfm_validator_enable_focus(enable){document.set_focus_onerror=enable;}function set_addnl_vfunction(functionname){this.formobj.addnlvalidation=functionname;}function sfm_set_focus(objInput){if(document.set_focus_onerror){objInput.focus();}}function sfm_enable_show_msgs_together(){this.show_errors_together=true;this.formobj.show_errors_together=true;}function clear_all_validations(){for(var itr=0;itr<this.formobj.elements.length;itr++){this.formobj.elements[itr].validationset=null;}}function form_submit_handler(){var bRet=true;document.error_disp_handler.clear_msgs();for(var itr=0;itr<this.elements.length;itr++){if(this.elements[itr].validationset&&!this.elements[itr].validationset.validate()){bRet=false;}if(!bRet&&!this.show_errors_together){break;}}if(this.addnlvalidation){str=" var ret = "+this.addnlvalidation+"()";eval(str);if(!ret){bRet=false;}}if(!bRet){document.error_disp_handler.FinalShowMsg();return false;}return true;}function add_validation(itemname,descriptor,errstr){var condition=null;if(arguments.length>3){condition=arguments[3];}if(!this.formobj){alert("Error: The form object is not set properly");return;}var itemobj=this.formobj[itemname];if(itemobj.length&&isNaN(itemobj.selectedIndex)){itemobj=itemobj[0];}if(!itemobj){alert("Error: Couldnot get the input object named: "+itemname);return;}if(!itemobj.validationset){itemobj.validationset=new ValidationSet(itemobj,this.show_errors_together);}itemobj.validationset.add(descriptor,errstr,condition);itemobj.validatorobj=this;}function validator_enable_OPED(){document.error_disp_handler.EnableOnPageDisplay(false);}function validator_enable_OPED_SB(){document.error_disp_handler.EnableOnPageDisplay(true);}function sfm_ErrorDisplayHandler(){this.msgdisplay=new AlertMsgDisplayer();this.EnableOnPageDisplay=edh_EnableOnPageDisplay;this.ShowMsg=edh_ShowMsg;this.FinalShowMsg=edh_FinalShowMsg;this.all_msgs=new Array();this.clear_msgs=edh_clear_msgs;}function edh_clear_msgs(){this.msgdisplay.clearmsg(this.all_msgs);this.all_msgs=new Array();}function edh_FinalShowMsg(){this.msgdisplay.showmsg(this.all_msgs);}function edh_EnableOnPageDisplay(single_box){if(true==single_box){this.msgdisplay=new SingleBoxErrorDisplay();}else{this.msgdisplay=new DivMsgDisplayer();}}function edh_ShowMsg(msg,input_element){var objmsg=new Array();objmsg.input_element=input_element;objmsg.msg=msg;this.all_msgs.push(objmsg);}function AlertMsgDisplayer(){this.showmsg=alert_showmsg;this.clearmsg=alert_clearmsg;}function alert_clearmsg(msgs){}function alert_showmsg(msgs){var whole_msg="";var first_elmnt=null;for(var m=0;m<msgs.length;m++){if(null==first_elmnt){first_elmnt=msgs[m]["input_element"];}whole_msg+=msgs[m]["msg"]+"\n";}alert(whole_msg);if(null!=first_elmnt){sfm_set_focus(first_elmnt);}}function sfm_show_error_msg(msg,input_elmt){document.error_disp_handler.ShowMsg(msg,input_elmt);}function SingleBoxErrorDisplay(){this.showmsg=sb_div_showmsg;this.clearmsg=sb_div_clearmsg;}function sb_div_clearmsg(msgs){var divname=form_error_div_name(msgs);show_div_msg(divname,"");}function sb_div_showmsg(msgs){var whole_msg="<ul>\n";for(var m=0;m<msgs.length;m++){whole_msg+="<li>"+msgs[m]["msg"]+"</li>\n";}whole_msg+="</ul>";var divname=form_error_div_name(msgs);show_div_msg(divname,whole_msg);}function form_error_div_name(msgs){var input_element=null;for(var m in msgs){input_element=msgs[m]["input_element"];if(input_element){break;}}var divname="";if(input_element){divname=input_element.form._sfm_form_name+"_errorloc";}return divname;}function DivMsgDisplayer(){this.showmsg=div_showmsg;this.clearmsg=div_clearmsg;}function div_clearmsg(msgs){for(var m in msgs){var divname=element_div_name(msgs[m]["input_element"]);show_div_msg(divname,"");}}function element_div_name(input_element){var divname=input_element.form._sfm_form_name+"_"+input_element.name+"_errorloc";divname=divname.replace(/[\[\]]/gi,"");return divname;}function div_showmsg(msgs){var whole_msg;var first_elmnt=null;for(var m in msgs){if(null==first_elmnt){first_elmnt=msgs[m]["input_element"];}var divname=element_div_name(msgs[m]["input_element"]);show_div_msg(divname,msgs[m]["msg"]);}if(null!=first_elmnt){sfm_set_focus(first_elmnt);}}function show_div_msg(divname,msgstring){if(divname.length<=0){return false;}if(document.layers){divlayer=document.layers[divname];if(!divlayer){return;}divlayer.document.open();divlayer.document.write(msgstring);divlayer.document.close();}else{if(document.all){divlayer=document.all[divname];if(!divlayer){return;}divlayer.innerHTML=msgstring;}else{if(document.getElementById){divlayer=document.getElementById(divname);if(!divlayer){return;}divlayer.innerHTML=msgstring;}}}divlayer.style.visibility="visible";}function ValidationDesc(inputitem,desc,error,condition){this.desc=desc;this.error=error;this.itemobj=inputitem;this.condition=condition;this.validate=vdesc_validate;}function vdesc_validate(){if(this.condition!=null){if(!eval(this.condition)){return true;}}if(!validateInput(this.desc,this.itemobj,this.error)){this.itemobj.validatorobj.disable_validations=true;sfm_set_focus(this.itemobj);return false;}return true;}function ValidationSet(inputitem,msgs_together){this.vSet=new Array();this.add=add_validationdesc;this.validate=vset_validate;this.itemobj=inputitem;this.msgs_together=msgs_together;}function add_validationdesc(desc,error,condition){this.vSet[this.vSet.length]=new ValidationDesc(this.itemobj,desc,error,condition);}function vset_validate(){var bRet=true;for(var itr=0;itr<this.vSet.length;itr++){bRet=bRet&&this.vSet[itr].validate();if(!bRet&&!this.msgs_together){break;}}return bRet;}function validateEmail(email){var splitted=email.match("^(.+)@(.+)$");if(splitted==null){return false;}if(splitted[1]!=null){var regexp_user=/^\"?[\w-_\.]*\"?$/;if(splitted[1].match(regexp_user)==null){return false;}}if(splitted[2]!=null){var regexp_domain=/^[\w-\.]*\.[A-Za-z]{2,4}$/;if(splitted[2].match(regexp_domain)==null){var regexp_ip=/^\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\]$/;if(splitted[2].match(regexp_ip)==null){return false;}}return true;}return false;}function IsCheckSelected(objValue,chkValue){var selected=false;var objcheck=objValue.form.elements[objValue.name];if(objcheck.length){var idxchk=-1;for(var c=0;c<objcheck.length;c++){if(objcheck[c].value==chkValue){idxchk=c;break;}}if(idxchk>=0){if(objcheck[idxchk].checked=="1"){selected=true;}}}else{if(objValue.checked=="1"){selected=true;}}return selected;}function TestDontSelectChk(objValue,chkValue,strError){var pass=true;pass=IsCheckSelected(objValue,chkValue)?false:true;if(pass==false){if(!strError||strError.length==0){strError="Can't Proceed as you selected "+objValue.name;}sfm_show_error_msg(strError,objValue);}return pass;}function TestShouldSelectChk(objValue,chkValue,strError){var pass=true;pass=IsCheckSelected(objValue,chkValue)?true:false;if(pass==false){if(!strError||strError.length==0){strError="You should select "+objValue.name;}sfm_show_error_msg(strError,objValue);}return pass;}function TestRequiredInput(objValue,strError){var ret=true;var val=objValue.value;val=val.replace(/^\s+|\s+$/g,"");if(eval(val.length)==0){if(!strError||strError.length==0){strError=objValue.name+" : Required Field";}sfm_show_error_msg(strError,objValue);ret=false;}return ret;}function TestMaxLen(objValue,strMaxLen,strError){var ret=true;if(eval(objValue.value.length)>eval(strMaxLen)){if(!strError||strError.length==0){strError=objValue.name+" : "+strMaxLen+" characters maximum ";}sfm_show_error_msg(strError,objValue);ret=false;}return ret;}function TestMinLen(objValue,strMinLen,strError){var ret=true;if(eval(objValue.value.length)<eval(strMinLen)){if(!strError||strError.length==0){strError=objValue.name+" : "+strMinLen+" characters minimum  ";}sfm_show_error_msg(strError,objValue);ret=false;}return ret;}function TestInputType(objValue,strRegExp,strError,strDefaultError){var ret=true;var charpos=objValue.value.search(strRegExp);if(objValue.value.length>0&&charpos>=0){if(!strError||strError.length==0){strError=strDefaultError;}sfm_show_error_msg(strError,objValue);ret=false;}return ret;}function TestEmail(objValue,strError){var ret=true;if(objValue.value.length>0&&!validateEmail(objValue.value)){if(!strError||strError.length==0){strError=objValue.name+": Enter a valid Email address ";}sfm_show_error_msg(strError,objValue);ret=false;}return ret;}function TestLessThan(objValue,strLessThan,strError){var ret=true;if(isNaN(objValue.value)){sfm_show_error_msg(objValue.name+": Should be a number ",objValue);ret=false;}else{if(eval(objValue.value)>=eval(strLessThan)){if(!strError||strError.length==0){strError=objValue.name+" : value should be less than "+strLessThan;}sfm_show_error_msg(strError,objValue);ret=false;}}return ret;}function TestGreaterThan(objValue,strGreaterThan,strError){var ret=true;if(isNaN(objValue.value)){sfm_show_error_msg(objValue.name+": Should be a number ",objValue);ret=false;}else{if(eval(objValue.value)<=eval(strGreaterThan)){if(!strError||strError.length==0){strError=objValue.name+" : value should be greater than "+strGreaterThan;}sfm_show_error_msg(strError,objValue);ret=false;}}return ret;}function TestRegExp(objValue,strRegExp,strError){var ret=true;if(objValue.value.length>0&&!objValue.value.match(strRegExp)){if(!strError||strError.length==0){strError=objValue.name+": Invalid characters found ";}sfm_show_error_msg(strError,objValue);ret=false;}return ret;}function TestDontSelect(objValue,dont_sel_index,strError){var ret=true;if(objValue.selectedIndex==null){sfm_show_error_msg("ERROR: dontselect command for non-select Item");ret=false;}if(objValue.selectedIndex==eval(dont_sel_index)){if(!strError||strError.length==0){strError=objValue.name+": Please Select one option ";}sfm_show_error_msg(strError,objValue);ret=false;}return ret;}function TestSelectOneRadio(objValue,strError){var objradio=objValue.form.elements[objValue.name];var one_selected=false;for(var r=0;r<objradio.length;r++){if(objradio[r].checked){one_selected=true;break;}}if(false==one_selected){if(!strError||strError.length==0){strError="Please select one option from "+objValue.name;}sfm_show_error_msg(strError,objValue);}return one_selected;}function validateInput(strValidateStr,objValue,strError){var ret=true;var epos=strValidateStr.search("=");var command="";var cmdvalue="";if(epos>=0){command=strValidateStr.substring(0,epos);cmdvalue=strValidateStr.substr(epos+1);}else{command=strValidateStr;}switch(command){case"req":case"required":ret=TestRequiredInput(objValue,strError);break;case"maxlength":case"maxlen":ret=TestMaxLen(objValue,cmdvalue,strError);break;case"minlength":case"minlen":ret=TestMinLen(objValue,cmdvalue,strError);break;case"alnum":case"alphanumeric":ret=TestInputType(objValue,"[^A-Za-z0-9]",strError,objValue.name+": Only alpha-numeric characters allowed ");break;case"alnum_s":case"alphanumeric_space":ret=TestInputType(objValue,"[^A-Za-z0-9\\s]",strError,objValue.name+": Only alpha-numeric characters and space allowed ");break;case"num":case"numeric":ret=TestInputType(objValue,"[^0-9]",strError,objValue.name+": Only digits allowed ");break;case"dec":case"decimal":ret=TestInputType(objValue,"[^0-9.]",strError,objValue.name+": Only numbers allowed ");break;case"alphabetic":case"alpha":ret=TestInputType(objValue,"[^A-Za-z]",strError,objValue.name+": Only alphabetic characters allowed ");break;case"alphabetic_space":case"alpha_s":ret=TestInputType(objValue,"[^A-Za-z\\s]",strError,objValue.name+": Only alphabetic characters and space allowed ");break;case"email":ret=TestEmail(objValue,strError);break;case"lt":case"lessthan":ret=TestLessThan(objValue,cmdvalue,strError);break;case"gt":case"greaterthan":ret=TestGreaterThan(objValue,cmdvalue,strError);break;case"regexp":ret=TestRegExp(objValue,cmdvalue,strError);break;case"dontselect":ret=TestDontSelect(objValue,cmdvalue,strError);break;case"dontselectchk":ret=TestDontSelectChk(objValue,cmdvalue,strError);break;case"shouldselchk":ret=TestShouldSelectChk(objValue,cmdvalue,strError);break;case"selone_radio":ret=TestSelectOneRadio(objValue,strError);break;}return ret;}function VWZ_IsListItemSelected(listname,value){for(var i=0;i<listname.options.length;i++){if(listname.options[i].selected==true&&listname.options[i].value==value){return true;}}return false;}function VWZ_IsChecked(objcheck,value){if(objcheck.length){for(var c=0;c<objcheck.length;c++){if(objcheck[c].checked=="1"&&objcheck[c].value==value){return true;}}}else{if(objcheck.checked=="1"){return true;}}return false;}function fillRawMakes(){for(x=0;x<6;x++){var ddMk=document.getElementById("makeRaw"+x);if(!ddMk){continue;}for(i=0;i<mkRawList.length;i++){disp=unescape(mkRawList[i][1].replace(/\+/g," "));ddMk[ddMk.length]=new Option(disp);}}}function fillMakes(){for(x=0;x<6;x++){var ddMk=document.getElementById("make"+x);if(!ddMk){continue;}for(i=0;i<mkList.length;i++){disp=unescape(mkList[i][1].replace(/\+/g," "));ddMk[ddMk.length]=new Option(disp);}}}function fillModels(x){var ddMk=document.getElementById("make"+x);if(!ddMk){return;}var ddMdl=document.getElementById("model"+x);if(ddMk.options[0].text.match("Select")){makeid=ddMk.selectedIndex-1;if(ddMk.selectedIndex==0){clearModels(x);ddMdl[ddMdl.length]=new Option("Select a Model..","");return;}var first=1;}else{makeid=ddMk.selectedIndex;var first=2;}ddMdl[first]=new Option("All","","");for(i=0;i<mdList.length;i++){if(makeid==mdList[i][0]){disp=unescape(mdList[i][1].replace(/\+/g," "));ddMdl[ddMdl.length]=new Option(disp);}}ddMdl.options[0].text="Select a Model..";ddMdl.options[0].value="";ddMdl.options[0].selected=true;}function fillRawModels(x){var ddMk=document.getElementById("makeRaw"+x);if(!ddMk){return;}var ddMdl=document.getElementById("model"+x);if(ddMk.options[0].text.match("Select")){makeid=ddMk.selectedIndex-1;if(ddMk.selectedIndex==0){clearModels(x);ddMdl[ddMdl.length]=new Option("Select a Model ..."," ");return;}}else{makeid=ddMk.selectedIndex;}ddMdl[ddMdl.length]=new Option("All","","selected");for(i=0;i<mdRawList.length;i++){if(makeid==mdRawList[i][0]){disp=unescape(mdRawList[i][1].replace(/\+/g," "));ddMdl[ddMdl.length]=new Option(disp);}}ddMdl.options[0].selected=true;}function clearModels(idx){var ddMdl=document.getElementById("model"+idx);stopat=0;for(j=ddMdl.options.length;j>=stopat;j--){ddMdl[j]=null;}}var mkList=[[0,"Acura"],[1,"Alfa+Romeo"],[2,"AM+General"],[3,"Aston+Martin"],[4,"Audi"],[5,"Bentley"],[6,"BMW"],[7,"Buick"],[8,"Cadillac"],[9,"Chevrolet"],[10,"Chrysler"],[11,"Daewoo"],[12,"Daihatsu"],[13,"Dodge"],[14,"Eagle"],[15,"Ferrari"],[16,"Ford"],[17,"Geo"],[18,"GMC"],[19,"Honda"],[20,"HUMMER"],[21,"Hyundai"],[22,"Infiniti"],[23,"Isuzu"],[24,"Jaguar"],[25,"Jeep"],[26,"Kia"],[27,"Lamborghini"],[28,"Land+Rover"],[29,"Lexus"],[30,"Lincoln"],[31,"Lotus"],[32,"Maserati"],[33,"Maybach"],[34,"Mazda"],[35,"Mercedes-Benz"],[36,"Mercury"],[37,"Merkur"],[38,"MINI"],[39,"Mitsubishi"],[40,"Nissan"],[41,"Oldsmobile"],[42,"Panoz"],[43,"Peugeot"],[44,"Plymouth"],[45,"Pontiac"],[46,"Porsche"],[47,"Ram"],[48,"Rolls-Royce"],[49,"Saab"],[50,"Saturn"],[51,"Scion"],[52,"Smart"],[53,"Sterling"],[54,"Subaru"],[55,"Suzuki"],[56,"Tesla"],[57,"Toyota"],[58,"Volkswagen"],[59,"Volvo"]];var mkRawList=[[0,"Acura"],[1,"Aston+Martin"],[2,"Audi"],[3,"Bentley"],[4,"BMW"],[5,"Buick"],[6,"Cadillac"],[7,"Chevrolet"],[8,"Chrysler"],[9,"Dodge"],[10,"Ferrari"],[11,"Ford"],[12,"GMC"],[13,"Honda"],[14,"HUMMER"],[15,"Hyundai"],[16,"Infiniti"],[17,"Isuzu"],[18,"Jaguar"],[19,"Jeep"],[20,"Kia"],[21,"Lamborghini"],[22,"Land+Rover"],[23,"Lexus"],[24,"Lincoln"],[25,"Lotus"],[26,"Maserati"],[27,"Maybach"],[28,"Mazda"],[29,"Mercedes-Benz"],[30,"Mercury"],[31,"MINI"],[32,"Mitsubishi"],[33,"Nissan"],[34,"Panoz"],[35,"Pontiac"],[36,"Porsche"],[37,"Ram"],[38,"Rolls-Royce"],[39,"Saab"],[40,"Saturn"],[41,"Scion"],[42,"Smart"],[43,"Subaru"],[44,"Suzuki"],[45,"Tesla"],[46,"Toyota"],[47,"Volkswagen"],[48,"Volvo"]];var mdList=[[0,"CL"],[0,"Integra"],[0,"Legend"],[0,"MDX"],[0,"NSX"],[0,"RDX"],[0,"RL"],[0,"RSX"],[0,"SLX"],[0,"TL"],[0,"TSX"],[0,"Vigor"],[0,"ZDX"],[1,"164+Series"],[1,"Milano"],[1,"Spider"],[2,"Hummer"],[3,"DB7"],[3,"DB9"],[3,"DBS"],[3,"Rapide"],[3,"Vanquish"],[3,"Vanquish+S"],[3,"Vantage"],[4,"100"],[4,"200"],[4,"80"],[4,"90"],[4,"A3"],[4,"A4"],[4,"A5"],[4,"A6"],[4,"A8"],[4,"allroad"],[4,"Cabriolet"],[4,"Coupe+Quattro"],[4,"Q5"],[4,"Q7"],[4,"R8"],[4,"RS"],[4,"S4"],[4,"S5"],[4,"S6"],[4,"S8"],[4,"TT"],[4,"TTS"],[4,"V8+Quattro"],[5,"Arnage"],[5,"Azure"],[5,"Brooklands"],[5,"Continental"],[5,"Mulsanne"],[6,"1+Series"],[6,"3+Series"],[6,"5+Series"],[6,"5+Series+Gran+Turismo"],[6,"6+Series"],[6,"7+Series"],[6,"8+Series"],[6,"M+Roadster"],[6,"M3"],[6,"M5"],[6,"M6"],[6,"X3"],[6,"X5"],[6,"X5+M"],[6,"X6"],[6,"X6+M"],[6,"Z3"],[6,"Z4"],[6,"Z8"],[7,"Century"],[7,"Electra"],[7,"Enclave"],[7,"Estate+Wagon"],[7,"LaCrosse"],[7,"LeSabre"],[7,"Lucerne"],[7,"Park+Avenue"],[7,"Rainier"],[7,"Reatta"],[7,"Regal"],[7,"Rendezvous"],[7,"Riviera"],[7,"Roadmaster"],[7,"Skyhawk"],[7,"Skylark"],[7,"Terraza"],[8,"Allante"],[8,"Brougham"],[8,"Catera"],[8,"Concours"],[8,"CTS"],[8,"CTS+Coupe"],[8,"CTS+Sedan"],[8,"CTS+Wagon"],[8,"CTS-V+Coupe"],[8,"CTS-V+Sedan"],[8,"CTS-V+Wagon"],[8,"d%27Elegance"],[8,"Deville"],[8,"DTS"],[8,"Eldorado"],[8,"Escalade"],[8,"Fleetwood"],[8,"Seville"],[8,"Sixty+Special"],[8,"SRX"],[8,"STS"],[8,"STS-V"],[8,"XLR"],[8,"XLR-V"],[9,"1500-Series+%28before+2003%29"],[9,"2500-Series+%28before+2003%29"],[9,"3500-Series+%28before+2003%29"],[9,"APV"],[9,"Astro"],[9,"Avalanche"],[9,"Aveo"],[9,"Beretta"],[9,"Blazer"],[9,"Camaro"],[9,"Caprice"],[9,"Cavalier"],[9,"Celebrity"],[9,"Classic"],[9,"Cobalt"],[9,"Colorado"],[9,"Corsica"],[9,"Corvette"],[9,"Cruze"],[9,"Equinox"],[9,"Express"],[9,"Geo"],[9,"HHR"],[9,"Impala"],[9,"Lumina"],[9,"Malibu"],[9,"Metro"],[9,"Monte+Carlo"],[9,"Prizm"],[9,"S-10+Blazer"],[9,"S-10+Pickup"],[9,"Silverado"],[9,"SSR"],[9,"Suburban"],[9,"Tahoe"],[9,"Tracker"],[9,"TrailBlazer"],[9,"Traverse"],[9,"Uplander"],[9,"Van"],[9,"Venture"],[9,"Volt"],[9,"W4500+HD+DSL+CREW"],[9,"W4500+HD+DSL+CREW+LSD"],[9,"W4500+HD+DSL+REG+AT"],[9,"W4500+HD+DSL+REG+AT+LSD"],[9,"W4500+HD+DSL+REG+MT"],[9,"W4500+HD+DSL+REG+MT+LSD"],[9,"W4500+HD+GAS+CREW"],[9,"W4500+HD+GAS+REG"],[9,"W5500+DSL+CREW"],[9,"W5500+DSL+CREW+LSD"],[9,"W5500+DSL+REG+AT"],[9,"W5500+DSL+REG+AT+LSD"],[9,"W5500+DSL+REG+MT"],[9,"W5500+DSL+REG+MT+LSD"],[9,"W5500+HD+DSL+REG+AT"],[9,"W5500+HD+DSL+REG+AT+LSD"],[9,"W5500+HD+DSL+REG+MT"],[9,"W5500+HD+DSL+REG+MT+LSD"],[10,"200"],[10,"300-Series"],[10,"Aspen"],[10,"Cirrus"],[10,"Concorde"],[10,"Conquest"],[10,"Crossfire"],[10,"Fifth+Avenue"],[10,"Grand+Voyager"],[10,"Imperial"],[10,"Lebaron"],[10,"LHS"],[10,"New+Yorker"],[10,"Pacifica"],[10,"Prowler"],[10,"PT+Cruiser"],[10,"PT+Cruiser+Classic"],[10,"Salon"],[10,"Sebring"],[10,"TC"],[10,"Town+%26+Country"],[10,"Voyager"],[11,"Lanos"],[11,"Leganza"],[11,"Nubira"],[12,"Charade"],[12,"Rocky"],[13,"Aries+America"],[13,"Avenger"],[13,"Caliber"],[13,"Caravan"],[13,"Challenger"],[13,"Charger"],[13,"Colt"],[13,"D%2FW+Trucks+%28before+1994%29"],[13,"Dakota"],[13,"Diplomat"],[13,"Durango"],[13,"Dynasty"],[13,"Grand+Caravan"],[13,"Intrepid"],[13,"Journey"],[13,"Lancer"],[13,"Magnum"],[13,"Monaco"],[13,"Neon"],[13,"Nitro"],[13,"Omni+America"],[13,"Raider"],[13,"Ram"],[13,"Ram+Charger"],[13,"Ram+SRT-10"],[13,"Ram+Van"],[13,"Ram+Wagon"],[13,"Shadow"],[13,"Spirit"],[13,"Sprinter"],[13,"Stealth"],[13,"Stratus"],[13,"Vans"],[13,"Viper"],[14,"Medallion"],[14,"Premier"],[14,"Summit"],[14,"Talon"],[14,"Vision"],[15,"360"],[15,"430"],[15,"456M"],[15,"458+Italia"],[15,"575M+Maranello"],[15,"599+GTB+Fiorano"],[15,"612+Scaglietti"],[15,"California"],[15,"ENZO"],[16,"Aerostar"],[16,"Aspire"],[16,"Bronco"],[16,"Bronco+II"],[16,"Contour"],[16,"Crown+Victoria"],[16,"E-Super+Duty"],[16,"Econoline"],[16,"Edge"],[16,"Escape"],[16,"Escort"],[16,"Excursion"],[16,"Expedition"],[16,"Explorer"],[16,"F-150"],[16,"F-250"],[16,"F-350"],[16,"F-450"],[16,"F-550"],[16,"F-650"],[16,"F-750"],[16,"F-800"],[16,"F-Super+Duty"],[16,"Festiva"],[16,"Fiesta"],[16,"Five+Hundred"],[16,"Flex"],[16,"Focus"],[16,"Freestar"],[16,"Freestyle"],[16,"Fusion"],[16,"GT"],[16,"Mustang"],[16,"Probe"],[16,"Ranger"],[16,"Super+Duty+F-53+Motorhome"],[16,"Super+Duty+F-59+Stripped+Chassis"],[16,"Taurus"],[16,"Taurus+X"],[16,"Tempo"],[16,"Thunderbird"],[16,"Transit+Connect"],[16,"Transit+Connect+Wagon"],[16,"Windstar"],[16,"ZX2"],[17,"Metro"],[17,"Prizm"],[17,"Storm"],[17,"Tracker"],[18,"1500-Series+%28before+1992%29"],[18,"2500-Series+%28before+1992%29"],[18,"3500-Series+%28before+1992%29"],[18,"Acadia"],[18,"Canyon"],[18,"Envoy"],[18,"Jimmy"],[18,"S-15+Jimmy"],[18,"S-15+Pickup"],[18,"Safari"],[18,"Savana"],[18,"Sierra"],[18,"Sonoma"],[18,"Suburban"],[18,"Terrain"],[18,"Van"],[18,"Vandura"],[18,"W4500+HD+DSL+CREW"],[18,"W4500+HD+DSL+CREW+LSD"],[18,"W4500+HD+DSL+REG+AT"],[18,"W4500+HD+DSL+REG+AT+LSD"],[18,"W4500+HD+DSL+REG+MT"],[18,"W4500+HD+DSL+REG+MT+LSD"],[18,"W4500+HD+GAS+CREW"],[18,"W4500+HD+GAS+REG"],[18,"W5500+DSL+CREW"],[18,"W5500+DSL+CREW+LSD"],[18,"W5500+DSL+REG+AT"],[18,"W5500+DSL+REG+AT+LSD"],[18,"W5500+DSL+REG+MT"],[18,"W5500+DSL+REG+MT+LSD"],[18,"W5500+HD+DSL+REG+AT"],[18,"W5500+HD+DSL+REG+AT+LSD"],[18,"W5500+HD+DSL+REG+MT"],[18,"W5500+HD+DSL+REG+MT+LSD"],[18,"Yukon"],[19,"Accord"],[19,"Civic"],[19,"CR-V"],[19,"CR-Z"],[19,"CRX"],[19,"Element"],[19,"Fit"],[19,"Insight"],[19,"Odyssey"],[19,"Passport"],[19,"Pilot"],[19,"Prelude"],[19,"Ridgeline"],[19,"S2000"],[19,"Wagovan"],[20,"H1"],[20,"H2"],[20,"H3"],[20,"H3+SUV"],[20,"H3T"],[21,"Accent"],[21,"Azera"],[21,"Elantra"],[21,"Elantra+Touring"],[21,"Entourage"],[21,"Equus"],[21,"Excel"],[21,"Genesis"],[21,"Genesis+Coupe"],[21,"Santa+Fe"],[21,"Scoupe"],[21,"Sonata"],[21,"Tiburon"],[21,"Tucson"],[21,"Veracruz"],[21,"XG300"],[21,"XG350"],[22,"EX35"],[22,"FX35"],[22,"FX45"],[22,"FX50"],[22,"G20"],[22,"G25+Sedan"],[22,"G35"],[22,"G37"],[22,"I30"],[22,"I35"],[22,"J30"],[22,"M30"],[22,"M35"],[22,"M37"],[22,"M45"],[22,"M56"],[22,"Q45"],[22,"QX4"],[22,"QX56"],[23,"Amigo"],[23,"Ascender"],[23,"Axiom"],[23,"FTR"],[23,"FVR"],[23,"FXR"],[23,"Hombre"],[23,"HTR"],[23,"HVR"],[23,"HXR"],[23,"i-280"],[23,"i-290"],[23,"i-350"],[23,"i-370"],[23,"I-Mark"],[23,"Impulse"],[23,"NPR+DSL+REG"],[23,"NPR+DSL+REG+AT+ECO-MAX"],[23,"NPR+DSL+REG+LSD"],[23,"NPR+GAS+CREW"],[23,"NPR+GAS+REG"],[23,"NPR+HD+DSL+CREW"],[23,"NPR+HD+DSL+CREW+LSD"],[23,"NPR+HD+DSL+REG+AT"],[23,"NPR+HD+DSL+REG+AT+LSD"],[23,"NPR+HD+DSL+REG+MT"],[23,"NPR+HD+DSL+REG+MT+LSD"],[23,"NPR+HD+GAS+CREW"],[23,"NPR+HD+GAS+REG"],[23,"NQR+DSL+CREW"],[23,"NQR+DSL+CREW+LSD"],[23,"NQR+DSL+REG+AT"],[23,"NQR+DSL+REG+AT+LSD"],[23,"NQR+DSL+REG+MT"],[23,"NQR+DSL+REG+MT+LSD"],[23,"NRR+DSL+REG+AT"],[23,"NRR+DSL+REG+AT+LSD"],[23,"NRR+DSL+REG+MT"],[23,"NRR+DSL+REG+MT+LSD"],[23,"Oasis"],[23,"Pickup"],[23,"Rodeo"],[23,"Rodeo+Sport"],[23,"Stylus"],[23,"Trooper"],[23,"Trooper+II"],[23,"VehiCROSS"],[24,"S-TYPE"],[24,"X-TYPE"],[24,"XF"],[24,"XJ"],[24,"XJ12"],[24,"XJS"],[24,"XK"],[24,"XK+Series"],[24,"XK8"],[25,"Cherokee"],[25,"Comanche"],[25,"Commander"],[25,"Compass"],[25,"Grand+Cherokee"],[25,"Grand+Wagoneer"],[25,"Liberty"],[25,"Patriot"],[25,"Wagoneer+Limited"],[25,"Wrangler"],[25,"Wrangler+Unlimited"],[26,"Amanti"],[26,"Borrego"],[26,"Forte"],[26,"Forte+5-Door"],[26,"Forte+Koup"],[26,"Optima"],[26,"Rio"],[26,"Rondo"],[26,"Sedona"],[26,"Sephia"],[26,"Sorento"],[26,"Soul"],[26,"Spectra"],[26,"Sportage"],[27,"Gallardo"],[27,"Murcielago"],[28,"Defender+110"],[28,"Defender+90"],[28,"Discovery"],[28,"Discovery+Series+II"],[28,"Freelander"],[28,"LR2"],[28,"LR3"],[28,"LR4"],[28,"Range+Rover"],[28,"Range+Rover+Sport"],[29,"CT+200h"],[29,"ES+250"],[29,"ES+300"],[29,"ES+330"],[29,"ES+350"],[29,"GS+300"],[29,"GS+350"],[29,"GS+400"],[29,"GS+430"],[29,"GS+450h"],[29,"GS+460"],[29,"GX+460"],[29,"GX+470"],[29,"HS+250h"],[29,"IS+250"],[29,"IS+250C"],[29,"IS+300"],[29,"IS+350"],[29,"IS+350C"],[29,"IS+F"],[29,"LS+400"],[29,"LS+430"],[29,"LS+460"],[29,"LS+600h+L"],[29,"LX+450"],[29,"LX+470"],[29,"LX+570"],[29,"RX+300"],[29,"RX+330"],[29,"RX+350"],[29,"RX+400h"],[29,"RX+450h"],[29,"SC+300"],[29,"SC+400"],[29,"SC+430"],[30,"Aviator"],[30,"Blackwood"],[30,"Continental"],[30,"LS"],[30,"Mark+LT"],[30,"Mark+VII"],[30,"Mark+VIII"],[30,"MKS"],[30,"MKT"],[30,"MKX"],[30,"MKZ"],[30,"Navigator"],[30,"Navigator+L"],[30,"Town+Car"],[30,"Zephyr"],[31,"Elise"],[31,"Esprit"],[31,"Evora"],[31,"Exige"],[32,"Coupe"],[32,"GranSport"],[32,"GranTurismo"],[32,"GranTurismo+Convertible"],[32,"Quattroporte"],[32,"Spyder"],[33,"57"],[33,"57+Zeppelin"],[33,"57S"],[33,"62"],[33,"62+Zeppelin"],[33,"62S"],[33,"Landaulet"],[34,"2WD+Trucks"],[34,"323"],[34,"4WD+Trucks"],[34,"626"],[34,"929"],[34,"B-Series+Truck"],[34,"CX-7"],[34,"CX-9"],[34,"MAZDA2"],[34,"MAZDA3"],[34,"MAZDA5"],[34,"MAZDA6"],[34,"Miata"],[34,"Millenia"],[34,"MPV"],[34,"MX3"],[34,"MX6"],[34,"Navajo"],[34,"Protege"],[34,"RX-7"],[34,"RX-8"],[34,"Tribute"],[35,"190+Series"],[35,"200+Series"],[35,"260+Series"],[35,"300+Series"],[35,"400+Series"],[35,"420+Series"],[35,"500+Series"],[35,"560+Series"],[35,"600+Series"],[35,"C-Class"],[35,"CL-Class"],[35,"CLK-Class"],[35,"CLS-Class"],[35,"E-Class"],[35,"G-Class"],[35,"GL-Class"],[35,"GLK-Class"],[35,"M-Class"],[35,"R-Class"],[35,"S-Class"],[35,"SL-Class"],[35,"SLK-Class"],[35,"SLR+McLaren"],[35,"SLS+AMG"],[35,"Sprinter+Cargo+Vans"],[35,"Sprinter+Chassis-Cabs"],[35,"Sprinter+Crew+Vans"],[35,"Sprinter+Passenger+Vans"],[36,"Capri"],[36,"Cougar"],[36,"Grand+Marquis"],[36,"Marauder"],[36,"Mariner"],[36,"Milan"],[36,"Montego"],[36,"Monterey"],[36,"Mountaineer"],[36,"Mystique"],[36,"Sable"],[36,"Topaz"],[36,"Tracer"],[36,"Villager"],[37,"Scorpio"],[37,"XR4TI"],[38,"Cooper"],[39,"2WD+Pickups"],[39,"3000GT"],[39,"4WD+Pickups"],[39,"Diamante"],[39,"Eclipse"],[39,"Endeavor"],[39,"Expo"],[39,"Galant"],[39,"Lancer"],[39,"Mighty+Max"],[39,"Mirage"],[39,"Montero"],[39,"Outlander"],[39,"Outlander+Sport"],[39,"Pickups"],[39,"Precis"],[39,"Raider"],[39,"Sigma"],[39,"Starion"],[39,"Van"],[39,"Wagon"],[40,"200SX"],[40,"240SX"],[40,"300ZX"],[40,"350Z"],[40,"370Z"],[40,"Altima"],[40,"Armada"],[40,"Axxess"],[40,"Compact+Trucks"],[40,"cube"],[40,"Frontier"],[40,"GT-R"],[40,"Hardbody"],[40,"JUKE"],[40,"LEAF"],[40,"Maxima"],[40,"Murano"],[40,"NX"],[40,"Pathfinder"],[40,"Pulsar+NX"],[40,"Quest"],[40,"Rogue"],[40,"Sentra"],[40,"Stanza"],[40,"Titan"],[40,"Titan+%282008.5%29"],[40,"Van"],[40,"Versa"],[40,"Xterra"],[41,"88"],[41,"98"],[41,"Achieva"],[41,"Alero"],[41,"Aurora"],[41,"Bravada"],[41,"Ciera"],[41,"Custom+Cruiser"],[41,"Cutlass"],[41,"Intrigue"],[41,"LSS"],[41,"Regency"],[41,"Silhouette"],[41,"Toronado"],[41,"Touring+Sedan"],[42,"Esperante"],[43,"405"],[43,"505"],[44,"Acclaim"],[44,"Breeze"],[44,"Colt"],[44,"Gran+Fury"],[44,"Grand+Voyager"],[44,"Horizon+America"],[44,"Laser"],[44,"Neon"],[44,"Prowler"],[44,"Reliant+America"],[44,"Sundance"],[44,"Voyager"],[45,"6000"],[45,"Aztek"],[45,"Bonneville"],[45,"Firebird"],[45,"G3"],[45,"G5"],[45,"G6"],[45,"G8"],[45,"Grand+Am"],[45,"Grand+Prix"],[45,"GTO"],[45,"Lemans"],[45,"Montana"],[45,"Safari"],[45,"Solstice"],[45,"Sunbird"],[45,"Sunfire"],[45,"Torrent"],[45,"Trans+Sport"],[45,"Vibe"],[46,"911"],[46,"928"],[46,"944"],[46,"964"],[46,"968"],[46,"Boxster"],[46,"Carrera+GT"],[46,"Cayenne"],[46,"Cayman"],[46,"Panamera"],[47,"1500"],[47,"2500"],[47,"3500"],[47,"4500"],[47,"5500"],[47,"Dakota"],[48,"Corniche"],[48,"Ghost"],[48,"Park+Ward"],[48,"Phantom"],[48,"Phantom+Coupe"],[48,"Phantom+Drophead+Coupe"],[48,"Silver+Seraph"],[49,"9-2X"],[49,"9-3"],[49,"9-4X"],[49,"9-5"],[49,"9-7X"],[49,"900"],[49,"900+Turbo"],[49,"9000"],[49,"9000+Turbo"],[49,"9000S"],[49,"900S"],[50,"2dr+Coupe"],[50,"Astra"],[50,"Aura"],[50,"Aura+Hybrid"],[50,"Ion"],[50,"L-Series"],[50,"LS"],[50,"LW"],[50,"Outlook"],[50,"Relay"],[50,"SC"],[50,"Sky"],[50,"SL"],[50,"SW"],[50,"VUE"],[50,"VUE+Hybrid"],[51,"tC"],[51,"xA"],[51,"xB"],[51,"xD"],[52,"fortwo"],[52,"fortwo+electric+drive"],[53,"Sterling"],[54,"3+Dr"],[54,"4+Dr"],[54,"B9+Tribeca"],[54,"Baja"],[54,"Forester"],[54,"Hatchback"],[54,"Impreza"],[54,"Justy"],[54,"Legacy"],[54,"Loyale"],[54,"Outback"],[54,"SVX"],[54,"Touring+Wagon"],[54,"Wagon"],[54,"XT+Coupe"],[55,"Aerio"],[55,"Equator"],[55,"Esteem"],[55,"Forenza"],[55,"Grand+Vitara"],[55,"Kizashi"],[55,"Reno"],[55,"Samurai"],[55,"Sidekick"],[55,"Swift"],[55,"SX4"],[55,"Verona"],[55,"Vitara"],[55,"X-90"],[55,"XL-7"],[55,"XL7"],[56,"Roadster"],[56,"Roadster+2.5"],[57,"2WD+Pickups"],[57,"4Runner"],[57,"4WD+Pickups"],[57,"Avalon"],[57,"Camry"],[57,"Celica"],[57,"Corolla"],[57,"Cressida"],[57,"Echo"],[57,"FJ+Cruiser"],[57,"Highlander"],[57,"Land+Cruiser"],[57,"Matrix"],[57,"MR2"],[57,"Paseo"],[57,"Previa"],[57,"Prius"],[57,"RAV4"],[57,"Sequoia"],[57,"Sienna"],[57,"Solara"],[57,"Supra"],[57,"T100"],[57,"Tacoma"],[57,"Tercel"],[57,"Tundra"],[57,"Tundra+2WD+Truck"],[57,"Tundra+4WD+Truck"],[57,"Vans"],[57,"Venza"],[57,"Yaris"],[58,"Cabrio"],[58,"Cabriolet"],[58,"CC"],[58,"Corrado"],[58,"Eos"],[58,"EuroVan"],[58,"Fox"],[58,"GLI"],[58,"Golf"],[58,"GTI"],[58,"Jetta"],[58,"New+Beetle"],[58,"Passat"],[58,"Phaeton"],[58,"R32"],[58,"Rabbit"],[58,"Routan"],[58,"Tiguan"],[58,"Touareg"],[58,"Touareg+2"],[58,"Vanagon"],[59,"240"],[59,"740"],[59,"760"],[59,"780"],[59,"850"],[59,"900"],[59,"940"],[59,"960"],[59,"C30"],[59,"C70"],[59,"Coupe"],[59,"S40"],[59,"S60"],[59,"S70"],[59,"S80"],[59,"S90"],[59,"V40"],[59,"V50"],[59,"V70"],[59,"V90"],[59,"XC60"],[59,"XC70"],[59,"XC90"]];var mdRawList=[[0,"MDX"],[0,"NSX"],[0,"RDX"],[0,"RL"],[0,"RSX"],[0,"TL"],[0,"TSX"],[0,"ZDX"],[1,"DB9"],[1,"DBS"],[1,"Rapide"],[1,"Vanquish+S"],[1,"Vantage"],[2,"A3"],[2,"A4"],[2,"A5"],[2,"A6"],[2,"A8"],[2,"A8+L"],[2,"allroad"],[2,"Q5"],[2,"Q7"],[2,"R8"],[2,"RS+4"],[2,"S4"],[2,"S5"],[2,"S6"],[2,"S8"],[2,"TT"],[2,"TTS"],[3,"Arnage"],[3,"Azure"],[3,"Brooklands"],[3,"Continental"],[3,"Continental+Flying+Spur"],[3,"Continental+GT"],[3,"Continental+Supersports"],[3,"Mulsanne"],[4,"1+Series"],[4,"3+Series"],[4,"5+Series"],[4,"5+Series+Gran+Turismo"],[4,"6+Series"],[4,"7+Series"],[4,"M+Roadster"],[4,"M3"],[4,"M5"],[4,"M6"],[4,"X3"],[4,"X5"],[4,"X5+M"],[4,"X6"],[4,"X6+M"],[4,"Z4"],[5,"Century"],[5,"Enclave"],[5,"LaCrosse"],[5,"LeSabre"],[5,"Lucerne"],[5,"Park+Avenue"],[5,"Rainier"],[5,"Regal"],[5,"Rendezvous"],[5,"Terraza"],[6,"CTS"],[6,"CTS+Coupe"],[6,"CTS+Sedan"],[6,"CTS+Wagon"],[6,"CTS-V"],[6,"CTS-V+Coupe"],[6,"CTS-V+Sedan"],[6,"CTS-V+Wagon"],[6,"DeVille"],[6,"DTS"],[6,"Escalade"],[6,"Escalade+ESV"],[6,"Escalade+EXT"],[6,"Escalade+Hybrid"],[6,"SRX"],[6,"STS"],[6,"STS-V"],[6,"XLR"],[6,"XLR-V"],[7,"Astro+Cargo+Van"],[7,"Astro+Passenger"],[7,"Avalanche"],[7,"Aveo"],[7,"Blazer"],[7,"Camaro"],[7,"Cavalier"],[7,"Classic"],[7,"Cobalt"],[7,"Colorado"],[7,"Corvette"],[7,"Cruze"],[7,"Equinox"],[7,"Express+Cargo+Van"],[7,"Express+Commercial+Cutaway"],[7,"Express+Passenger"],[7,"HHR"],[7,"Impala"],[7,"Malibu"],[7,"Malibu+Classic"],[7,"Malibu+Hybrid"],[7,"Malibu+Maxx"],[7,"Monte+Carlo"],[7,"Silverado+1500"],[7,"Silverado+1500+Classic"],[7,"Silverado+1500+Classic+Hybrid"],[7,"Silverado+1500+Hybrid"],[7,"Silverado+1500HD"],[7,"Silverado+1500HD+Classic"],[7,"Silverado+2500HD"],[7,"Silverado+2500HD+Classic"],[7,"Silverado+3500"],[7,"Silverado+3500+Classic"],[7,"Silverado+3500HD"],[7,"Silverado+SS"],[7,"Silverado+SS+Classic"],[7,"SSR"],[7,"Suburban"],[7,"Tahoe"],[7,"Tahoe+Hybrid"],[7,"TrailBlazer"],[7,"Traverse"],[7,"Uplander"],[7,"Uplander+Cargo+Van"],[7,"Venture"],[7,"Venture+Cargo+Van"],[7,"Volt"],[7,"W3500+DSL+REG"],[7,"W3500+DSL+REG+LSD"],[7,"W3500+GAS+CREW"],[7,"W3500+GAS+REG"],[7,"W4500+HD+DSL+CREW"],[7,"W4500+HD+DSL+CREW+LSD"],[7,"W4500+HD+DSL+REG+AT"],[7,"W4500+HD+DSL+REG+AT+LSD"],[7,"W4500+HD+DSL+REG+MT"],[7,"W4500+HD+DSL+REG+MT+LSD"],[7,"W4500+HD+GAS+CREW"],[7,"W4500+HD+GAS+REG"],[7,"W5500+DSL+CREW"],[7,"W5500+DSL+CREW+LSD"],[7,"W5500+DSL+REG+AT"],[7,"W5500+DSL+REG+AT+LSD"],[7,"W5500+DSL+REG+MT"],[7,"W5500+DSL+REG+MT+LSD"],[7,"W5500+HD+DSL+REG+AT"],[7,"W5500+HD+DSL+REG+AT+LSD"],[7,"W5500+HD+DSL+REG+MT"],[7,"W5500+HD+DSL+REG+MT+LSD"],[8,"200"],[8,"300"],[8,"Aspen"],[8,"Crossfire"],[8,"Pacifica"],[8,"PT+Cruiser"],[8,"PT+Cruiser+Classic"],[8,"Sebring"],[8,"Sebring+Conv"],[8,"Sebring+Cpe"],[8,"Sebring+Sdn"],[8,"Town+%26+Country"],[8,"Town+%26+Country+LWB"],[8,"Town+%26+Country+SWB"],[9,"Avenger"],[9,"Caliber"],[9,"Caravan"],[9,"Caravan+C%2FV"],[9,"Challenger"],[9,"Charger"],[9,"Dakota"],[9,"Durango"],[9,"Grand+Caravan"],[9,"Grand+Caravan+C%2FV"],[9,"Journey"],[9,"Magnum"],[9,"Neon"],[9,"Nitro"],[9,"Ram+1500"],[9,"Ram+2500"],[9,"Ram+3500"],[9,"Ram+4500"],[9,"Ram+5500"],[9,"Ram+SRT-10"],[9,"Sprinter"],[9,"Sprinter+Wagon"],[9,"Stratus+Cpe"],[9,"Stratus+Sdn"],[9,"Viper"],[10,"430"],[10,"458+Italia"],[10,"599+GTB+Fiorano"],[10,"612+Scaglietti"],[10,"California"],[11,"Crown+Victoria"],[11,"Econoline+Cargo+Van"],[11,"Econoline+Commercial+Chassis"],[11,"Econoline+Commercial+Cutaway"],[11,"Econoline+Wagon"],[11,"Edge"],[11,"Escape"],[11,"Excursion"],[11,"Expedition"],[11,"Expedition+EL"],[11,"Explorer"],[11,"Explorer+Sport+Trac"],[11,"F-150"],[11,"Fiesta"],[11,"Five+Hundred"],[11,"Flex"],[11,"Focus"],[11,"Freestar+Cargo+Van"],[11,"Freestar+Wagon"],[11,"Freestyle"],[11,"Fusion"],[11,"GT"],[11,"Mustang"],[11,"Ranger"],[11,"Super+Duty+F-250"],[11,"Super+Duty+F-350+DRW"],[11,"Super+Duty+F-350+SRW"],[11,"Super+Duty+F-450"],[11,"Super+Duty+F-450+DRW"],[11,"Super+Duty+F-53+Motorhome"],[11,"Super+Duty+F-550+DRW"],[11,"Super+Duty+F-550+Motorhome"],[11,"Super+Duty+F-59+Stripped+Chassis"],[11,"Super+Duty+F-650+Pro+Loader"],[11,"Super+Duty+F-650+Straight+Frame"],[11,"Super+Duty+F-750+Severe+Service"],[11,"Super+Duty+F-750+Straight+Frame"],[11,"Taurus"],[11,"Taurus+X"],[11,"Thunderbird"],[11,"Transit+Connect"],[11,"Transit+Connect+Wagon"],[12,"Acadia"],[12,"Canyon"],[12,"Envoy"],[12,"Envoy+XL"],[12,"Envoy+XUV"],[12,"Safari+Cargo+Van"],[12,"Safari+Passenger"],[12,"Savana+Cargo+Van"],[12,"Savana+Commercial+Cutaway"],[12,"Savana+Cutaway"],[12,"Savana+Passenger"],[12,"Sierra+1500"],[12,"Sierra+1500+Classic"],[12,"Sierra+1500+Classic+Hybrid"],[12,"Sierra+1500+Hybrid"],[12,"Sierra+1500HD"],[12,"Sierra+1500HD+Classic"],[12,"Sierra+2500HD"],[12,"Sierra+2500HD+Classic"],[12,"Sierra+3500"],[12,"Sierra+3500+Classic"],[12,"Sierra+3500HD"],[12,"Sierra+Denali"],[12,"Sierra+Denali+Classic"],[12,"Terrain"],[12,"W3500+DSL+REG"],[12,"W3500+DSL+REG+LSD"],[12,"W3500+GAS+CREW"],[12,"W3500+GAS+REG"],[12,"W4500+HD+DSL+CREW"],[12,"W4500+HD+DSL+CREW+LSD"],[12,"W4500+HD+DSL+REG+AT"],[12,"W4500+HD+DSL+REG+AT+LSD"],[12,"W4500+HD+DSL+REG+MT"],[12,"W4500+HD+DSL+REG+MT+LSD"],[12,"W4500+HD+GAS+CREW"],[12,"W4500+HD+GAS+REG"],[12,"W5500+DSL+CREW"],[12,"W5500+DSL+CREW+LSD"],[12,"W5500+DSL+REG+AT"],[12,"W5500+DSL+REG+AT+LSD"],[12,"W5500+DSL+REG+MT"],[12,"W5500+DSL+REG+MT+LSD"],[12,"W5500+HD+DSL+REG+AT"],[12,"W5500+HD+DSL+REG+AT+LSD"],[12,"W5500+HD+DSL+REG+MT"],[12,"W5500+HD+DSL+REG+MT+LSD"],[12,"Yukon"],[12,"Yukon+Denali"],[12,"Yukon+Hybrid"],[12,"Yukon+Hybrid+Denali"],[12,"Yukon+XL"],[12,"Yukon+XL+Denali"],[13,"Accord+Cpe"],[13,"Accord+Crosstour"],[13,"Accord+Hybrid"],[13,"Accord+Sdn"],[13,"Civic+Cpe"],[13,"Civic+Hybrid"],[13,"Civic+Sdn"],[13,"Civic+Si"],[13,"CR-V"],[13,"CR-Z"],[13,"Element"],[13,"Fit"],[13,"Insight"],[13,"Odyssey"],[13,"Pilot"],[13,"Ridgeline"],[13,"S2000"],[14,"H1"],[14,"H2"],[14,"H3"],[14,"H3+SUV"],[14,"H3T"],[15,"Accent"],[15,"Azera"],[15,"Elantra"],[15,"Elantra+Touring"],[15,"Entourage"],[15,"Equus"],[15,"Genesis"],[15,"Genesis+Coupe"],[15,"Santa+Fe"],[15,"Sonata"],[15,"Tiburon"],[15,"Tucson"],[15,"Veracruz"],[15,"XG350"],[16,"EX35"],[16,"FX35"],[16,"FX45"],[16,"FX50"],[16,"G25+Sedan"],[16,"G35+Coupe"],[16,"G35+Sedan"],[16,"G37+Convertible"],[16,"G37+Coupe"],[16,"G37+Sedan"],[16,"M35"],[16,"M37"],[16,"M45"],[16,"M56"],[16,"Q45"],[16,"QX56"],[17,"Ascender"],[17,"FTR"],[17,"FVR"],[17,"FXR"],[17,"FXR+Tandem"],[17,"HTR"],[17,"HVR"],[17,"HXR"],[17,"HXR+Tandem"],[17,"i-280"],[17,"i-290"],[17,"i-350"],[17,"i-370"],[17,"NPR+DSL+REG"],[17,"NPR+DSL+REG+AT+ECO-MAX"],[17,"NPR+DSL+REG+LSD"],[17,"NPR+GAS+CREW"],[17,"NPR+GAS+REG"],[17,"NPR+HD+DSL+CREW"],[17,"NPR+HD+DSL+CREW+LSD"],[17,"NPR+HD+DSL+REG+AT"],[17,"NPR+HD+DSL+REG+AT+LSD"],[17,"NPR+HD+DSL+REG+MT"],[17,"NPR+HD+DSL+REG+MT+LSD"],[17,"NPR+HD+GAS+CREW"],[17,"NPR+HD+GAS+REG"],[17,"NQR+DSL+CREW"],[17,"NQR+DSL+CREW+LSD"],[17,"NQR+DSL+REG+AT"],[17,"NQR+DSL+REG+AT+LSD"],[17,"NQR+DSL+REG+MT"],[17,"NQR+DSL+REG+MT+LSD"],[17,"NRR+DSL+REG+AT"],[17,"NRR+DSL+REG+AT+LSD"],[17,"NRR+DSL+REG+MT"],[17,"NRR+DSL+REG+MT+LSD"],[18,"S-TYPE"],[18,"X-TYPE"],[18,"XF"],[18,"XJ"],[18,"XJ+Series"],[18,"XK"],[18,"XK+Series"],[18,"XK8"],[19,"Commander"],[19,"Compass"],[19,"Grand+Cherokee"],[19,"Liberty"],[19,"Patriot"],[19,"Wrangler"],[19,"Wrangler+Unlimited"],[20,"Amanti"],[20,"Borrego"],[20,"Forte"],[20,"Forte+5-Door"],[20,"Forte+Koup"],[20,"Optima"],[20,"Rio"],[20,"Rondo"],[20,"Sedona"],[20,"Sorento"],[20,"Soul"],[20,"Spectra"],[20,"Sportage"],[21,"Gallardo"],[21,"Murcielago"],[22,"Freelander"],[22,"LR2"],[22,"LR3"],[22,"LR4"],[22,"Range+Rover"],[22,"Range+Rover+Sport"],[23,"CT+200h"],[23,"ES+330"],[23,"ES+350"],[23,"GS+300"],[23,"GS+350"],[23,"GS+430"],[23,"GS+450h"],[23,"GS+460"],[23,"GX+460"],[23,"GX+470"],[23,"HS+250h"],[23,"IS+250"],[23,"IS+250C"],[23,"IS+300"],[23,"IS+350"],[23,"IS+350C"],[23,"IS+F"],[23,"LS+430"],[23,"LS+460"],[23,"LS+600h+L"],[23,"LX+470"],[23,"LX+570"],[23,"RX+330"],[23,"RX+350"],[23,"RX+400h"],[23,"RX+450h"],[23,"SC+430"],[24,"Aviator"],[24,"LS"],[24,"Mark+LT"],[24,"MKS"],[24,"MKT"],[24,"MKX"],[24,"MKZ"],[24,"Navigator"],[24,"Navigator+L"],[24,"Town+Car"],[24,"Zephyr"],[25,"Elise"],[25,"Evora"],[25,"Exige"],[26,"Coupe"],[26,"GranSport"],[26,"GranTurismo"],[26,"GranTurismo+Convertible"],[26,"Quattroporte"],[26,"Spyder"],[27,"57"],[27,"57+Zeppelin"],[27,"57S"],[27,"62"],[27,"62+Zeppelin"],[27,"62S"],[27,"Landaulet"],[28,"3"],[28,"5"],[28,"6"],[28,"B-Series+2WD+Truck"],[28,"B-Series+4WD+Truck"],[28,"B-Series+Truck"],[28,"CX-7"],[28,"CX-9"],[28,"MAZDA2"],[28,"MPV"],[28,"MX-5+Miata"],[28,"RX-8"],[28,"Tribute"],[29,"C-Class"],[29,"CL-Class"],[29,"CLK-Class"],[29,"CLS-Class"],[29,"E-Class"],[29,"G-Class"],[29,"GL-Class"],[29,"GLK-Class"],[29,"M-Class"],[29,"R-Class"],[29,"S-Class"],[29,"SL-Class"],[29,"SLK-Class"],[29,"SLR+McLaren"],[29,"SLS+AMG"],[29,"Sprinter+Cargo+Vans"],[29,"Sprinter+Chassis-Cabs"],[29,"Sprinter+Crew+Vans"],[29,"Sprinter+Passenger+Vans"],[30,"Grand+Marquis"],[30,"Mariner"],[30,"Milan"],[30,"Montego"],[30,"Monterey"],[30,"Mountaineer"],[30,"Sable"],[31,"Cooper+Clubman"],[31,"Cooper+Convertible"],[31,"Cooper+Countryman"],[31,"Cooper+Hardtop"],[32,"Eclipse"],[32,"Endeavor"],[32,"Galant"],[32,"Lancer"],[32,"Montero"],[32,"Outlander"],[32,"Outlander+Sport"],[32,"Raider"],[33,"350Z"],[33,"370Z"],[33,"Altima"],[33,"Armada"],[33,"cube"],[33,"Frontier"],[33,"Frontier+2WD"],[33,"Frontier+4WD"],[33,"GT-R"],[33,"JUKE"],[33,"LEAF"],[33,"Maxima"],[33,"Murano"],[33,"Pathfinder"],[33,"Quest"],[33,"Rogue"],[33,"Sentra"],[33,"Titan"],[33,"Titan+%282008.5%29"],[33,"Versa"],[33,"Xterra"],[34,"Esperante"],[35,"Aztek"],[35,"Bonneville"],[35,"G3"],[35,"G5"],[35,"G6"],[35,"G8"],[35,"Grand+Am"],[35,"Grand+Prix"],[35,"GTO"],[35,"Montana"],[35,"Montana+SV6"],[35,"Solstice"],[35,"Sunfire"],[35,"Torrent"],[35,"Vibe"],[36,"911"],[36,"Boxster"],[36,"Carrera+GT"],[36,"Cayenne"],[36,"Cayman"],[36,"Panamera"],[37,"1500"],[37,"2500"],[37,"3500"],[37,"4500"],[37,"5500"],[37,"Dakota"],[38,"Ghost"],[38,"Phantom"],[38,"Phantom+Coupe"],[38,"Phantom+Drophead+Coupe"],[39,"9-2X"],[39,"9-3"],[39,"9-4X"],[39,"9-5"],[39,"9-7X"],[40,"Astra"],[40,"Aura"],[40,"Aura+Hybrid"],[40,"Ion"],[40,"L-Series"],[40,"Outlook"],[40,"Relay"],[40,"Sky"],[40,"VUE"],[40,"VUE+Hybrid"],[41,"tC"],[41,"xA"],[41,"xB"],[41,"xD"],[42,"fortwo"],[42,"fortwo+electric+drive"],[43,"B9+Tribeca"],[43,"Baja"],[43,"Baja+%28Natl%29"],[43,"Forester"],[43,"Forester+%28Natl%29"],[43,"Forester+%28NY%2FNJ%29"],[43,"Impreza+Sedan"],[43,"Impreza+Sedan+%28Natl%29"],[43,"Impreza+Sedan+%28NY%2FNJ%29"],[43,"Impreza+Sedan+WRX"],[43,"Impreza+Wagon"],[43,"Impreza+Wagon+%28Natl%29"],[43,"Impreza+Wagon+%28NY%2FNJ%29"],[43,"Impreza+Wagon+WRX"],[43,"Legacy"],[43,"Legacy+%28Natl%29"],[43,"Legacy+%28NY%2FNJ%29"],[43,"Legacy+Outback"],[43,"Legacy+Sedan"],[43,"Legacy+Sedan+%28Natl%29"],[43,"Legacy+Wagon"],[43,"Legacy+Wagon+%28Natl%29"],[43,"Outback"],[43,"Outback+%28Natl%29"],[43,"Outback+%28NY%2FNJ%29"],[43,"Tribeca"],[43,"Tribeca+%28Natl%29"],[43,"Tribeca+%28NY%2FNJ%29"],[44,"Aerio"],[44,"Equator"],[44,"Forenza"],[44,"Grand+Vitara"],[44,"Kizashi"],[44,"Reno"],[44,"SX4"],[44,"Verona"],[44,"XL-7"],[44,"XL7"],[45,"Roadster"],[45,"Roadster+2.5"],[46,"4Runner"],[46,"Avalon"],[46,"Camry"],[46,"Camry+Hybrid"],[46,"Camry+Solara"],[46,"Celica"],[46,"Corolla"],[46,"Echo"],[46,"FJ+Cruiser"],[46,"Highlander"],[46,"Highlander+Hybrid"],[46,"Land+Cruiser"],[46,"Matrix"],[46,"MR2+Spyder"],[46,"Prius"],[46,"RAV4"],[46,"Sequoia"],[46,"Sienna"],[46,"Tacoma"],[46,"Tundra"],[46,"Tundra+2WD+Truck"],[46,"Tundra+4WD+Truck"],[46,"Venza"],[46,"Yaris"],[47,"Beetle"],[47,"CC"],[47,"Eos"],[47,"GLI"],[47,"Golf"],[47,"GTI"],[47,"Jetta+Sedan"],[47,"Jetta+Sedan+A5"],[47,"Jetta+SportWagen"],[47,"Jetta+Wagon"],[47,"New+GTI"],[47,"Passat+Sedan"],[47,"Passat+Wagon"],[47,"Phaeton"],[47,"R32"],[47,"Rabbit"],[47,"Routan"],[47,"Tiguan"],[47,"Touareg"],[47,"Touareg+2"],[48,"C30"],[48,"C70"],[48,"S40"],[48,"S60"],[48,"S80"],[48,"V50"],[48,"V70"],[48,"XC60"],[48,"XC70"],[48,"XC90"]];function clearSingleMakeModelType(){var makeDropdown=document.getElementById("makeDropdown");var modelDropdown=document.getElementById("modelDropdown");removeChildren(makeDropdown);removeChildren(modelDropdown);for(var i=0;i<6;i++){var makeField=document.getElementById("hmake"+i);var modelField=document.getElementById("hmodel"+i);if(makeField.value==""){makeField.parentNode.removeChild(makeField);modelField.parentNode.removeChild(modelField);}}}var ALERT_TITLE="";var ALERT_TITLE1="";var ALERT_BUTTON_TEXT="Close";if(document.getElementById){window.alert=function(txt){createCustomAlert(txt);if(txt.indexOf("Browser")){createCustomAlert1(txt);}else{createCustomAlert(txt);}};}function createCustomAlert(txt){var d=document;if(d.getElementById("modalContainer_alert")){return;}mObj=d.getElementsByTagName("body")[0].appendChild(d.createElement("div"));mObj.id="modalContainer_alert";mObj.style.height=document.documentElement.scrollHeight+"px";alertObj=mObj.appendChild(d.createElement("div"));alertObj.id="alertBox_alert";if(d.all&&!window.opera){alertObj.style.top=document.documentElement.scrollTop+"px";}alertObj.style.left=(d.documentElement.scrollWidth-alertObj.offsetWidth)/2+"px";h1=alertObj.appendChild(d.createElement("h1"));h1.appendChild(d.createTextNode(ALERT_TITLE));notice=alertObj.appendChild(d.createElement("a"));notice.id="notice_alert";notice.appendChild(d.createTextNode("Browser Upgrade Notice"));msg=alertObj.appendChild(d.createElement("p"));msg.innerHTML=txt;alertObj.appendChild(d.createElement("a"));btn=alertObj.appendChild(d.createElement("a"));btn.id="closeBtn_alert";btn.appendChild(d.createTextNode(ALERT_BUTTON_TEXT));btn.href="";btn.target="_top";btn.onclick=function(){removeCustomAlert();return false;};}function removeCustomAlert(){document.getElementsByTagName("body")[0].removeChild(document.getElementById("modalContainer_alert"));}(function($){$.fn.document=function(){var element=this.get(0);if(element.nodeName.toLowerCase()=="iframe"){return element.contentWindow.document;}return this;};$.fn.documentSelection=function(){var element=this.get(0);if(element.contentWindow.document.selection){return element.contentWindow.document.selection.createRange().text;}else{return element.contentWindow.getSelection().toString();}};$.fn.wysiwyg=function(options){if(arguments.length>0&&arguments[0].constructor==String){var action=arguments[0].toString();var params=[];for(var i=1;i<arguments.length;i++){params[i-1]=arguments[i];}if(action in Wysiwyg){return this.each(function(){$.data(this,"wysiwyg").designMode();Wysiwyg[action].apply(this,params);});}else{return this;}}var controls={};if(options&&options.controls){var controls=options.controls;delete options.controls;}options=$.extend({html:'<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">STYLE_SHEET</head><body style="margin: 0px;">INITIAL_CONTENT</body></html>',css:{},debug:false,autoSave:true,rmUnwantedBr:true,brIE:true,controls:{},messages:{}},options);options.messages=$.extend(true,options.messages,Wysiwyg.MSGS_EN);options.controls=$.extend(true,options.controls,Wysiwyg.TOOLBAR);for(var control in controls){if(control in options.controls){$.extend(options.controls[control],controls[control]);}else{options.controls[control]=controls[control];}}return this.each(function(){Wysiwyg(this,options);});};function Wysiwyg(element,options){return this instanceof Wysiwyg?this.init(element,options):new Wysiwyg(element,options);}$.extend(Wysiwyg,{insertImage:function(szURL,attributes){var self=$.data(this,"wysiwyg");if(self.constructor==Wysiwyg&&szURL&&szURL.length>0){if($.browser.msie){self.focus();}if(attributes){self.editorDoc.execCommand("insertImage",false,"#jwysiwyg#");var img=self.getElementByAttributeValue("img","src","#jwysiwyg#");if(img){img.src=szURL;for(var attribute in attributes){img.setAttribute(attribute,attributes[attribute]);}}}else{self.editorDoc.execCommand("insertImage",false,szURL);}}},createLink:function(szURL){var self=$.data(this,"wysiwyg");if(self.constructor==Wysiwyg&&szURL&&szURL.length>0){var selection=$(self.editor).documentSelection();if(selection.length>0){if($.browser.msie){self.focus();}self.editorDoc.execCommand("unlink",false,[]);self.editorDoc.execCommand("createLink",false,szURL);}else{if(self.options.messages.nonSelection){alert(self.options.messages.nonSelection);}}}},insertHtml:function(szHTML){var self=$.data(this,"wysiwyg");if(self.constructor==Wysiwyg&&szHTML&&szHTML.length>0){if($.browser.msie){self.focus();self.editorDoc.execCommand("insertImage",false,"#jwysiwyg#");var img=self.getElementByAttributeValue("img","src","#jwysiwyg#");if(img){$(img).replaceWith(szHTML);}}else{self.editorDoc.execCommand("insertHTML",false,szHTML);}}},setContent:function(newContent){var self=$.data(this,"wysiwyg");self.setContent(newContent);self.saveContent();},clear:function(){var self=$.data(this,"wysiwyg");self.setContent("");self.saveContent();},MSGS_EN:{nonSelection:"select the text you wish to link"},TOOLBAR:{bold:{visible:true,tags:["b","strong"],css:{fontWeight:"bold"},tooltip:"Bold"},italic:{visible:true,tags:["i","em"],css:{fontStyle:"italic"},tooltip:"Italic"},strikeThrough:{visible:true,tags:["s","strike"],css:{textDecoration:"line-through"},tooltip:"Strike-through"},underline:{visible:true,tags:["u"],css:{textDecoration:"underline"},tooltip:"Underline"},separator00:{visible:true,separator:true},justifyLeft:{visible:true,css:{textAlign:"left"},tooltip:"Justify Left"},justifyCenter:{visible:true,tags:["center"],css:{textAlign:"center"},tooltip:"Justify Center"},justifyRight:{visible:true,css:{textAlign:"right"},tooltip:"Justify Right"},justifyFull:{visible:true,css:{textAlign:"justify"},tooltip:"Justify Full"},separator01:{visible:true,separator:true},indent:{visible:true,tooltip:"Indent"},outdent:{visible:true,tooltip:"Outdent"},separator02:{visible:false,separator:true},subscript:{visible:true,tags:["sub"],tooltip:"Subscript"},superscript:{visible:true,tags:["sup"],tooltip:"Superscript"},separator03:{visible:true,separator:true},undo:{visible:true,tooltip:"Undo"},redo:{visible:true,tooltip:"Redo"},separator04:{visible:true,separator:true},insertOrderedList:{visible:true,tags:["ol"],tooltip:"Insert Ordered List"},insertUnorderedList:{visible:true,tags:["ul"],tooltip:"Insert Unordered List"},insertHorizontalRule:{visible:true,tags:["hr"],tooltip:"Insert Horizontal Rule"},separator05:{separator:true},createLink:{visible:true,exec:function(){var selection=$(this.editor).documentSelection();if(selection.length>0){if($.browser.msie){this.focus();this.editorDoc.execCommand("createLink",true,null);}else{var szURL=prompt("URL","http://");if(szURL&&szURL.length>0){this.editorDoc.execCommand("unlink",false,[]);this.editorDoc.execCommand("createLink",false,szURL);}}}else{if(this.options.messages.nonSelection){alert(this.options.messages.nonSelection);}}},tags:["a"],tooltip:"Create link"},insertImage:{visible:true,exec:function(){if($.browser.msie){this.focus();this.editorDoc.execCommand("insertImage",true,null);}else{var szURL=prompt("URL","http://");if(szURL&&szURL.length>0){this.editorDoc.execCommand("insertImage",false,szURL);}}},tags:["img"],tooltip:"Insert image"},separator06:{separator:true},h1mozilla:{visible:true&&$.browser.mozilla,className:"h1",command:"heading",arguments:["h1"],tags:["h1"],tooltip:"Header 1"},h2mozilla:{visible:true&&$.browser.mozilla,className:"h2",command:"heading",arguments:["h2"],tags:["h2"],tooltip:"Header 2"},h3mozilla:{visible:true&&$.browser.mozilla,className:"h3",command:"heading",arguments:["h3"],tags:["h3"],tooltip:"Header 3"},h1:{visible:true&&!($.browser.mozilla),className:"h1",command:"formatBlock",arguments:["<H1>"],tags:["h1"],tooltip:"Header 1"},h2:{visible:true&&!($.browser.mozilla),className:"h2",command:"formatBlock",arguments:["<H2>"],tags:["h2"],tooltip:"Header 2"},h3:{visible:true&&!($.browser.mozilla),className:"h3",command:"formatBlock",arguments:["<H3>"],tags:["h3"],tooltip:"Header 3"},separator07:{visible:false,separator:true},cut:{visible:false,tooltip:"Cut"},copy:{visible:false,tooltip:"Copy"},paste:{visible:false,tooltip:"Paste"},separator08:{separator:false&&!($.browser.msie)},increaseFontSize:{visible:false&&!($.browser.msie),tags:["big"],tooltip:"Increase font size"},decreaseFontSize:{visible:false&&!($.browser.msie),tags:["small"],tooltip:"Decrease font size"},separator09:{separator:true},html:{visible:false,exec:function(){if(this.viewHTML){this.setContent($(this.original).val());$(this.original).hide();}else{this.saveContent();$(this.original).show();}this.viewHTML=!(this.viewHTML);},tooltip:"View source code"},removeFormat:{visible:true,exec:function(){if($.browser.msie){this.focus();}this.editorDoc.execCommand("removeFormat",false,[]);this.editorDoc.execCommand("unlink",false,[]);},tooltip:"Remove formatting"}}});$.extend(Wysiwyg.prototype,{original:null,options:{},element:null,editor:null,focus:function(){$(this.editorDoc.body).focus();},init:function(element,options){var self=this;this.editor=element;this.options=options||{};$.data(element,"wysiwyg",this);var newX=element.width||element.clientWidth;var newY=element.height||element.clientHeight;if(element.nodeName.toLowerCase()=="textarea"){this.original=element;if(newX==0&&element.cols){newX=(element.cols*8)+21;}if(newY==0&&element.rows){newY=(element.rows*16)+16;}var editor=this.editor=$('<iframe src="javascript:false;"></iframe>').css({minHeight:(newY-6).toString()+"px",width:(newX-8).toString()+"px"}).attr("id",$(element).attr("id")+"IFrame").attr("frameborder","0");this.editor.attr("tabindex",$(element).attr("tabindex"));if($.browser.msie){this.editor.css("height",(newY).toString()+"px");}}var panel=this.panel=$('<ul role="menu" class="panel"></ul>');this.appendControls();this.element=$("<div></div>").css({width:(newX>0)?(newX).toString()+"px":"100%"}).addClass("wysiwyg").append(panel).append($("<div><!-- --></div>").css({clear:"both"})).append(editor);$(element).hide().before(this.element);this.viewHTML=false;this.initialHeight=newY-8;this.initialContent=$(element).val();this.initFrame();if(this.initialContent.length==0){this.setContent("");}var form=$(element).closest("form");if(this.options.autoSave){form.submit(function(){self.saveContent();});}form.bind("reset",function(){self.setContent(self.initialContent);self.saveContent();});},initFrame:function(){var self=this;var style="";if(this.options.css&&this.options.css.constructor==String){style='<link rel="stylesheet" type="text/css" media="screen" href="'+this.options.css+'" />';}this.editorDoc=$(this.editor).document();this.editorDoc_designMode=false;try{this.editorDoc.designMode="on";this.editorDoc_designMode=true;}catch(e){$(this.editorDoc).focus(function(){self.designMode();});}this.editorDoc.open();this.editorDoc.write(this.options.html.replace(/INITIAL_CONTENT/,function(){return self.initialContent;}).replace(/STYLE_SHEET/,function(){return style;}));this.editorDoc.close();this.editorDoc.contentEditable="true";if($.browser.msie){setTimeout(function(){$(self.editorDoc.body).css("border","none");},0);}$(this.editorDoc).click(function(event){self.checkTargets(event.target?event.target:event.srcElement);});$(this.original).focus(function(){if(!$.browser.msie){self.focus();}});if(this.options.autoSave){$(this.editorDoc).keydown(function(){self.saveContent();}).keyup(function(){self.saveContent();}).mousedown(function(){self.saveContent();});}if(this.options.css){setTimeout(function(){if(self.options.css.constructor==String){}else{$(self.editorDoc).find("body").css(self.options.css);}},0);}$(this.editorDoc).keydown(function(event){if($.browser.msie&&self.options.brIE&&event.keyCode==13){var rng=self.getRange();rng.pasteHTML("<br />");rng.collapse(false);rng.select();return false;}return true;});},designMode:function(){if(!(this.editorDoc_designMode)){try{this.editorDoc.designMode="on";this.editorDoc_designMode=true;}catch(e){}}},getSelection:function(){return(window.getSelection)?window.getSelection():document.selection;},getRange:function(){var selection=this.getSelection();if(!(selection)){return null;}return(selection.rangeCount>0)?selection.getRangeAt(0):selection.createRange();},getContent:function(){return $($(this.editor).document()).find("body").html();},setContent:function(newContent){$($(this.editor).document()).find("body").html(newContent);},saveContent:function(){if(this.original){var content=this.getContent();if(this.options.rmUnwantedBr){content=(content.substr(-4)=="<br>")?content.substr(0,content.length-4):content;}$(this.original).val(content);}},withoutCss:function(){if($.browser.mozilla){try{this.editorDoc.execCommand("styleWithCSS",false,false);}catch(e){try{this.editorDoc.execCommand("useCSS",false,true);}catch(e){}}}},appendMenu:function(cmd,args,className,fn,tooltip){var self=this;args=args||[];$("<li></li>").append($('<a role="menuitem" tabindex="-1" href="javascript:;">'+(className||cmd)+"</a>").addClass(className||cmd).attr("title",tooltip)).click(function(){if(fn){fn.apply(self);}else{self.withoutCss();self.editorDoc.execCommand(cmd,false,args);}if(self.options.autoSave){self.saveContent();}}).appendTo(this.panel);},appendMenuSeparator:function(){$('<li role="separator" class="separator"></li>').appendTo(this.panel);},appendControls:function(){for(var name in this.options.controls){var control=this.options.controls[name];if(control.separator){if(control.visible!==false){this.appendMenuSeparator();}}else{if(control.visible){this.appendMenu(control.command||name,control.arguments||[],control.className||control.command||name||"empty",control.exec,control.tooltip||control.command||name||"");}}}},checkTargets:function(element){for(var name in this.options.controls){var control=this.options.controls[name];var className=control.className||control.command||name||"empty";$("."+className,this.panel).removeClass("active");if(control.tags){var elm=element;do{if(elm.nodeType!=1){break;}if($.inArray(elm.tagName.toLowerCase(),control.tags)!=-1){$("."+className,this.panel).addClass("active");}}while((elm=elm.parentNode));}if(control.css){var elm=$(element);do{if(elm[0].nodeType!=1){break;}for(var cssProperty in control.css){if(elm.css(cssProperty).toString().toLowerCase()==control.css[cssProperty]){$("."+className,this.panel).addClass("active");}}}while((elm=elm.parent()));}}},getElementByAttributeValue:function(tagName,attributeName,attributeValue){var elements=this.editorDoc.getElementsByTagName(tagName);for(var i=0;i<elements.length;i++){var value=elements[i].getAttribute(attributeName);if($.browser.msie){value=value.substr(value.length-attributeValue.length);}if(value==attributeValue){return elements[i];}}return false;}});})(jQuery);function at_show_aux(parent,child){var p=document.getElementById(parent);var c=document.getElementById(child);var top=(c.at_position=="y")?p.offsetHeight+2:0;var left=(c.at_position=="x")?p.offsetWidth+2:0;for(;p;p=p.offsetParent){top+=p.offsetTop;left+=p.offsetLeft;}c.style.position="absolute";c.style.top=top+"px";c.style.left=left+"px";c.style.visibility="visible";}function at_show(){var p=document.getElementById(this["at_parent"]);var c=document.getElementById(this["at_child"]);at_show_aux(p.id,c.id);clearTimeout(c.at_timeout);}function at_show_zip(parent,child){var p=document.getElementById(parent);var c=document.getElementById(child);at_show_aux(p.id,c.id);clearTimeout(c.at_timeout);}function at_hide(){var p=document.getElementById(this["at_parent"]);var c=document.getElementById(this["at_child"]);c.at_timeout=setTimeout("document.getElementById('"+c.id+"').style.visibility = 'hidden'",333);}function at_click(){var p=document.getElementById(this["at_parent"]);var c=document.getElementById(this["at_child"]);if(c.style.visibility!="visible"){at_show_aux(p.id,c.id);}else{c.style.visibility="hidden";}return false;}function at_attach(parent,child,showtype,position,cursor){var p=document.getElementById(parent);var c=document.getElementById(child);if(p==undefined){return;}if(c==undefined){return;}p.at_parent=p.id;c.at_parent=p.id;p.at_child=c.id;c.at_child=c.id;p.at_position=position;c.at_position=position;c.style.position="absolute";c.style.visibility="hidden";if(cursor!=undefined){p.style.cursor=cursor;}switch(showtype){case"click":p.onclick=at_click;p.onmouseout=at_hide;c.onmouseover=at_show;c.onmouseout=at_hide;break;case"hover":p.onmouseover=at_show;p.onmouseout=at_hide;c.onmouseover=at_show;c.onmouseout=at_hide;break;}}function at_attach2(parent,child,showtype,position,cursor){var p=document.getElementById(parent);var c=document.getElementById(child);p.at_parent=p.id;c.at_parent=p.id;p.at_child=c.id;c.at_child=c.id;p.at_position=position;c.at_position=position;c.style.position="absolute";c.style.visibility="hidden";if(cursor!=undefined){p.style.cursor=cursor;}switch(showtype){case"click":p.onclick=at_click;c.onmouseover=at_show;break;case"hover":p.onmouseover=at_show;c.onmouseover=at_show;break;case"show":var p=document.getElementById(this["at_parent"]);var c=document.getElementById(this["at_child"]);if(c.style.visibility!="visible"){at_show_aux(p.id,c.id);}else{c.style.visibility="hidden";}return false;break;}}function at_hide2(parent,child,showtype,position,cursor){var p=document.getElementById(parent);var c=document.getElementById(child);p.at_parent=p.id;c.at_parent=p.id;p.at_child=c.id;c.at_child=c.id;p.at_position=position;c.at_position=position;c.style.position="absolute";c.style.visibility="hidden";if(cursor!=undefined){p.style.cursor=cursor;}switch(showtype){case"click":p.onclick=at_hide;break;}}var swfobject2=function(){var b="undefined",Q="object",n="Shockwave Flash",p="ShockwaveFlash.ShockwaveFlash",P="application/x-shockwave-flash",m="SWFObjectExprInst",j=window,K=document,T=navigator,o=[],N=[],i=[],d=[],J,Z=null,M=null,l=null,e=false,A=false;var h=function(){var v=typeof K.getElementById!=b&&typeof K.getElementsByTagName!=b&&typeof K.createElement!=b,AC=[0,0,0],x=null;if(typeof T.plugins!=b&&typeof T.plugins[n]==Q){x=T.plugins[n].description;if(x&&!(typeof T.mimeTypes!=b&&T.mimeTypes[P]&&!T.mimeTypes[P].enabledPlugin)){x=x.replace(/^.*\s+(\S+\s+\S+$)/,"$1");AC[0]=parseInt(x.replace(/^(.*)\..*$/,"$1"),10);AC[1]=parseInt(x.replace(/^.*\.(.*)\s.*$/,"$1"),10);AC[2]=/r/.test(x)?parseInt(x.replace(/^.*r(.*)$/,"$1"),10):0;}}else{if(typeof j.ActiveXObject!=b){var y=null,AB=false;try{y=new ActiveXObject(p+".7");}catch(t){try{y=new ActiveXObject(p+".6");AC=[6,0,21];y.AllowScriptAccess="always";}catch(t){if(AC[0]==6){AB=true;}}if(!AB){try{y=new ActiveXObject(p);}catch(t){}}}if(!AB&&y){try{x=y.GetVariable("$version");if(x){x=x.split(" ")[1].split(",");AC=[parseInt(x[0],10),parseInt(x[1],10),parseInt(x[2],10)];}}catch(t){}}}}var AD=T.userAgent.toLowerCase(),r=T.platform.toLowerCase(),AA=/webkit/.test(AD)?parseFloat(AD.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,q=false,z=r?/win/.test(r):/win/.test(AD),w=r?/mac/.test(r):/mac/.test(AD);
/*@cc_on q=true;@if(@_win32)z=true;@elif(@_mac)w=true;@end@*/
return{w3cdom:v,pv:AC,webkit:AA,ie:q,win:z,mac:w};}();var L=function(){if(!h.w3cdom){return;}f(H);if(h.ie&&h.win){try{K.write("<script id=__ie_ondomload defer=true src=//:><\/script>");J=C("__ie_ondomload");if(J){I(J,"onreadystatechange",S);}}catch(q){}}if(h.webkit&&typeof K.readyState!=b){Z=setInterval(function(){if(/loaded|complete/.test(K.readyState)){E();}},10);}if(typeof K.addEventListener!=b){K.addEventListener("DOMContentLoaded",E,null);}R(E);}();function S(){if(J.readyState=="complete"){J.parentNode.removeChild(J);E();}}function E(){if(e){return;}if(h.ie&&h.win){var v=a("span");try{var u=K.getElementsByTagName("body")[0].appendChild(v);u.parentNode.removeChild(u);}catch(w){return;}}e=true;if(Z){clearInterval(Z);Z=null;}var q=o.length;for(var r=0;r<q;r++){o[r]();}}function f(q){if(e){q();}else{o[o.length]=q;}}function R(r){if(typeof j.addEventListener!=b){j.addEventListener("load",r,false);}else{if(typeof K.addEventListener!=b){K.addEventListener("load",r,false);}else{if(typeof j.attachEvent!=b){I(j,"onload",r);}else{if(typeof j.onload=="function"){var q=j.onload;j.onload=function(){q();r();};}else{j.onload=r;}}}}}function H(){var t=N.length;for(var q=0;q<t;q++){var u=N[q].id;if(h.pv[0]>0){var r=C(u);if(r){N[q].width=r.getAttribute("width")?r.getAttribute("width"):"0";N[q].height=r.getAttribute("height")?r.getAttribute("height"):"0";if(c(N[q].swfVersion)){if(h.webkit&&h.webkit<312){Y(r);}W(u,true);}else{if(N[q].expressInstall&&!A&&c("6.0.65")&&(h.win||h.mac)){k(N[q]);}else{O(r);}}}}else{W(u,true);}}}function Y(t){var q=t.getElementsByTagName(Q)[0];if(q){var w=a("embed"),y=q.attributes;if(y){var v=y.length;for(var u=0;u<v;u++){if(y[u].nodeName=="DATA"){w.setAttribute("src",y[u].nodeValue);}else{w.setAttribute(y[u].nodeName,y[u].nodeValue);}}}var x=q.childNodes;if(x){var z=x.length;for(var r=0;r<z;r++){if(x[r].nodeType==1&&x[r].nodeName=="PARAM"){w.setAttribute(x[r].getAttribute("name"),x[r].getAttribute("value"));}}}t.parentNode.replaceChild(w,t);}}function k(w){A=true;var u=C(w.id);if(u){if(w.altContentId){var y=C(w.altContentId);if(y){M=y;l=w.altContentId;}}else{M=G(u);}if(!(/%$/.test(w.width))&&parseInt(w.width,10)<310){w.width="310";}if(!(/%$/.test(w.height))&&parseInt(w.height,10)<137){w.height="137";}K.title=K.title.slice(0,47)+" - Flash Player Installation";var z=h.ie&&h.win?"ActiveX":"PlugIn",q=K.title,r="MMredirectURL="+j.location+"&MMplayerType="+z+"&MMdoctitle="+q,x=w.id;if(h.ie&&h.win&&u.readyState!=4){var t=a("div");x+="SWFObjectNew";t.setAttribute("id",x);u.parentNode.insertBefore(t,u);u.style.display="none";var v=function(){u.parentNode.removeChild(u);};I(j,"onload",v);}U({data:w.expressInstall,id:m,width:w.width,height:w.height},{flashvars2:r},x);}}function O(t){if(h.ie&&h.win&&t.readyState!=4){var r=a("div");t.parentNode.insertBefore(r,t);r.parentNode.replaceChild(G(t),r);t.style.display="none";var q=function(){t.parentNode.removeChild(t);};I(j,"onload",q);}else{t.parentNode.replaceChild(G(t),t);}}function G(v){var u=a("div");if(h.win&&h.ie){u.innerHTML=v.innerHTML;}else{var r=v.getElementsByTagName(Q)[0];if(r){var w=r.childNodes;if(w){var q=w.length;for(var t=0;t<q;t++){if(!(w[t].nodeType==1&&w[t].nodeName=="PARAM")&&!(w[t].nodeType==8)){u.appendChild(w[t].cloneNode(true));}}}}}return u;}function U(AG,AE,t){var q,v=C(t);if(v){if(typeof AG.id==b){AG.id=t;}if(h.ie&&h.win){var AF="";for(var AB in AG){if(AG[AB]!=Object.prototype[AB]){if(AB.toLowerCase()=="data"){AE.movie=AG[AB];}else{if(AB.toLowerCase()=="styleclass"){AF+=' class="'+AG[AB]+'"';}else{if(AB.toLowerCase()!="classid"){AF+=" "+AB+'="'+AG[AB]+'"';}}}}}var AD="";for(var AA in AE){if(AE[AA]!=Object.prototype[AA]){AD+='<param name="'+AA+'" value="'+AE[AA]+'" />';}}v.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+AF+">"+AD+"</object>";i[i.length]=AG.id;q=C(AG.id);}else{if(h.webkit&&h.webkit<312){var AC=a("embed");AC.setAttribute("type",P);for(var z in AG){if(AG[z]!=Object.prototype[z]){if(z.toLowerCase()=="data"){AC.setAttribute("src",AG[z]);}else{if(z.toLowerCase()=="styleclass"){AC.setAttribute("class",AG[z]);}else{if(z.toLowerCase()!="classid"){AC.setAttribute(z,AG[z]);}}}}}for(var y in AE){if(AE[y]!=Object.prototype[y]){if(y.toLowerCase()!="movie"){AC.setAttribute(y,AE[y]);}}}v.parentNode.replaceChild(AC,v);q=AC;}else{var u=a(Q);u.setAttribute("type",P);for(var x in AG){if(AG[x]!=Object.prototype[x]){if(x.toLowerCase()=="styleclass"){u.setAttribute("class",AG[x]);}else{if(x.toLowerCase()!="classid"){u.setAttribute(x,AG[x]);}}}}for(var w in AE){if(AE[w]!=Object.prototype[w]&&w.toLowerCase()!="movie"){F(u,w,AE[w]);}}v.parentNode.replaceChild(u,v);q=u;}}}return q;}function F(t,q,r){var u=a("param");u.setAttribute("name",q);u.setAttribute("value",r);t.appendChild(u);}function X(r){var q=C(r);if(q&&(q.nodeName=="OBJECT"||q.nodeName=="EMBED")){if(h.ie&&h.win){if(q.readyState==4){B(r);}else{j.attachEvent("onload",function(){B(r);});}}else{q.parentNode.removeChild(q);}}}function B(t){var r=C(t);if(r){for(var q in r){if(typeof r[q]=="function"){r[q]=null;}}r.parentNode.removeChild(r);}}function C(t){var q=null;try{q=K.getElementById(t);}catch(r){}return q;}function a(q){return K.createElement(q);}function I(t,q,r){t.attachEvent(q,r);d[d.length]=[t,q,r];}function c(t){var r=h.pv,q=t.split(".");q[0]=parseInt(q[0],10);q[1]=parseInt(q[1],10)||0;q[2]=parseInt(q[2],10)||0;return(r[0]>q[0]||(r[0]==q[0]&&r[1]>q[1])||(r[0]==q[0]&&r[1]==q[1]&&r[2]>=q[2]))?true:false;}function V(v,r){if(h.ie&&h.mac){return;}var u=K.getElementsByTagName("head")[0],t=a("style");t.setAttribute("type","text/css");t.setAttribute("media","screen");if(!(h.ie&&h.win)&&typeof K.createTextNode!=b){t.appendChild(K.createTextNode(v+" {"+r+"}"));}u.appendChild(t);if(h.ie&&h.win&&typeof K.styleSheets!=b&&K.styleSheets.length>0){var q=K.styleSheets[K.styleSheets.length-1];if(typeof q.addRule==Q){q.addRule(v,r);}}}function W(t,q){var r=q?"visible":"hidden";if(e&&C(t)){C(t).style.visibility=r;}else{V("#"+t,"visibility:"+r);}}function g(s){var r=/[\\\"<>\.;]/;var q=r.exec(s)!=null;return q?encodeURIComponent(s):s;}var D=function(){if(h.ie&&h.win){window.attachEvent("onunload",function(){var w=d.length;for(var v=0;v<w;v++){d[v][0].detachEvent(d[v][1],d[v][2]);}var t=i.length;for(var u=0;u<t;u++){X(i[u]);}for(var r in h){h[r]=null;}h=null;for(var q in swfobject){swfobject[q]=null;}swfobject=null;});}}();return{registerObject:function(u,q,t){if(!h.w3cdom||!u||!q){return;}var r={};r.id=u;r.swfVersion=q;r.expressInstall=t?t:false;N[N.length]=r;W(u,false);},getObjectById:function(v){var q=null;if(h.w3cdom){var t=C(v);if(t){var u=t.getElementsByTagName(Q)[0];if(!u||(u&&typeof t.SetVariable!=b)){q=t;}else{if(typeof u.SetVariable!=b){q=u;}}}}return q;},embedSWF:function(x,AE,AB,AD,q,w,r,z,AC){if(!h.w3cdom||!x||!AE||!AB||!AD||!q){return;}AB+="";AD+="";if(c(q)){W(AE,false);var AA={};if(AC&&typeof AC===Q){for(var v in AC){if(AC[v]!=Object.prototype[v]){AA[v]=AC[v];}}}AA.data=x;AA.width=AB;AA.height=AD;var y={};if(z&&typeof z===Q){for(var u in z){if(z[u]!=Object.prototype[u]){y[u]=z[u];}}}if(r&&typeof r===Q){for(var t in r){if(r[t]!=Object.prototype[t]){if(typeof y.flashvars!=b){y.flashvars+="&"+t+"="+r[t];}else{y.flashvars=t+"="+r[t];}}}}f(function(){U(AA,y,AE);if(AA.id==AE){W(AE,true);}});}else{if(w&&!A&&c("6.0.65")&&(h.win||h.mac)){A=true;W(AE,false);f(function(){var AF={};AF.id=AF.altContentId=AE;AF.width=AB;AF.height=AD;AF.expressInstall=w;k(AF);});}}},getFlashPlayerVersion:function(){return{major:h.pv[0],minor:h.pv[1],release:h.pv[2]};},hasFlashPlayerVersion:c,createSWF:function(t,r,q){if(h.w3cdom){return U(t,r,q);}else{return undefined;}},removeSWF:function(q){if(h.w3cdom){X(q);}},createCSS:function(r,q){if(h.w3cdom){V(r,q);}},addDomLoadEvent:f,addLoadEvent:R,getQueryParamValue:function(v){var u=K.location.search||K.location.hash;if(v==null){return g(u);}if(u){var t=u.substring(1).split("&");for(var r=0;r<t.length;r++){if(t[r].substring(0,t[r].indexOf("="))==v){return g(t[r].substring((t[r].indexOf("=")+1)));}}}return"";},expressInstallCallback:function(){if(A&&M){var q=C(m);if(q){q.parentNode.replaceChild(M,q);if(l){W(l,true);if(h.ie&&h.win){M.style.display="block";}}M=null;l=null;A=false;}}}};}();

/* <script src="/lightbox/js/prototype.js" type="text/javascript"></script> */
 /*  Prototype JavaScript framework, version 1.6.0.2
 *  (c) 2005-2008 Sam Stephenson
 *
 *  Prototype is freely distributable under the terms of an MIT-style license.
 *  For details, see the Prototype web site: http://www.prototypejs.org/
 *
 *--------------------------------------------------------------------------*/

var Prototype = {
  Version: '1.6.0.2',

  Browser: {
    IE:     !!(window.attachEvent && !window.opera),
    Opera:  !!window.opera,
    WebKit: navigator.userAgent.indexOf('AppleWebKit/') > -1,
    Gecko:  navigator.userAgent.indexOf('Gecko') > -1 && navigator.userAgent.indexOf('KHTML') == -1,
    MobileSafari: !!navigator.userAgent.match(/Apple.*Mobile.*Safari/)
  },

  BrowserFeatures: {
    XPath: !!document.evaluate,
    ElementExtensions: !!window.HTMLElement,
    SpecificElementExtensions:
      document.createElement('div').__proto__ &&
      document.createElement('div').__proto__ !==
        document.createElement('form').__proto__
  },

  ScriptFragment: '<script[^>]*>([\\S\\s]*?)<\/script>',
  JSONFilter: /^\/\*-secure-([\s\S]*)\*\/\s*$/,

  emptyFunction: function() { },
  K: function(x) { return x }
};

if (Prototype.Browser.MobileSafari)
  Prototype.BrowserFeatures.SpecificElementExtensions = false;


/* Based on Alex Arnell's inheritance implementation. */
var Class = {
  create: function() {
    var parent = null, properties = $A(arguments);
    if (Object.isFunction(properties[0]))
      parent = properties.shift();

    function klass() {
      this.initialize.apply(this, arguments);
    }

    Object.extend(klass, Class.Methods);
    klass.superclass = parent;
    klass.subclasses = [];

    if (parent) {
      var subclass = function() { };
      subclass.prototype = parent.prototype;
      klass.prototype = new subclass;
      parent.subclasses.push(klass);
    }

    for (var i = 0; i < properties.length; i++)
      klass.addMethods(properties[i]);

    if (!klass.prototype.initialize)
      klass.prototype.initialize = Prototype.emptyFunction;

    klass.prototype.constructor = klass;

    return klass;
  }
};

Class.Methods = {
  addMethods: function(source) {
    var ancestor   = this.superclass && this.superclass.prototype;
    var properties = Object.keys(source);

    if (!Object.keys({ toString: true }).length)
      properties.push("toString", "valueOf");

    for (var i = 0, length = properties.length; i < length; i++) {
      var property = properties[i], value = source[property];
      if (ancestor && Object.isFunction(value) &&
          value.argumentNames().first() == "$super") {
        var method = value, value = Object.extend((function(m) {
          return function() { return ancestor[m].apply(this, arguments) };
        })(property).wrap(method), {
          valueOf:  function() { return method },
          toString: function() { return method.toString() }
        });
      }
      this.prototype[property] = value;
    }

    return this;
  }
};

var Abstract = { };

Object.extend = function(destination, source) {
  for (var property in source)
    destination[property] = source[property];
  return destination;
};

Object.extend(Object, {
  inspect: function(object) {
    try {
      if (Object.isUndefined(object)) return 'undefined';
      if (object === null) return 'null';
      return object.inspect ? object.inspect() : String(object);
    } catch (e) {
      if (e instanceof RangeError) return '...';
      throw e;
    }
  },

  toJSON: function(object) {
    var type = typeof object;
    switch (type) {
      case 'undefined':
      case 'function':
      case 'unknown': return;
      case 'boolean': return object.toString();
    }

    if (object === null) return 'null';
    if (object.toJSON) return object.toJSON();
    if (Object.isElement(object)) return;

    var results = [];
    for (var property in object) {
      var value = Object.toJSON(object[property]);
      if (!Object.isUndefined(value))
        results.push(property.toJSON() + ': ' + value);
    }

    return '{' + results.join(', ') + '}';
  },

  toQueryString: function(object) {
    return $H(object).toQueryString();
  },

  toHTML: function(object) {
    return object && object.toHTML ? object.toHTML() : String.interpret(object);
  },

  keys: function(object) {
    var keys = [];
    for (var property in object)
      keys.push(property);
    return keys;
  },

  values: function(object) {
    var values = [];
    for (var property in object)
      values.push(object[property]);
    return values;
  },

  clone: function(object) {
    return Object.extend({ }, object);
  },

  isElement: function(object) {
    return object && object.nodeType == 1;
  },

  isArray: function(object) {
    return object != null && typeof object == "object" &&
      'splice' in object && 'join' in object;
  },

  isHash: function(object) {
    return object instanceof Hash;
  },

  isFunction: function(object) {
    return typeof object == "function";
  },

  isString: function(object) {
    return typeof object == "string";
  },

  isNumber: function(object) {
    return typeof object == "number";
  },

  isUndefined: function(object) {
    return typeof object == "undefined";
  }
});

Object.extend(Function.prototype, {
  argumentNames: function() {
    var names = this.toString().match(/^[\s\(]*function[^(]*\((.*?)\)/)[1].split(",").invoke("strip");
    return names.length == 1 && !names[0] ? [] : names;
  },

  bind: function() {
    if (arguments.length < 2 && Object.isUndefined(arguments[0])) return this;
    var __method = this, args = $A(arguments), object = args.shift();
    return function() {
      return __method.apply(object, args.concat($A(arguments)));
    }
  },

  bindAsEventListener: function() {
    var __method = this, args = $A(arguments), object = args.shift();
    return function(event) {
      return __method.apply(object, [event || window.event].concat(args));
    }
  },

  curry: function() {
    if (!arguments.length) return this;
    var __method = this, args = $A(arguments);
    return function() {
      return __method.apply(this, args.concat($A(arguments)));
    }
  },

  delay: function() {
    var __method = this, args = $A(arguments), timeout = args.shift() * 1000;
    return window.setTimeout(function() {
      return __method.apply(__method, args);
    }, timeout);
  },

  wrap: function(wrapper) {
    var __method = this;
    return function() {
      return wrapper.apply(this, [__method.bind(this)].concat($A(arguments)));
    }
  },

  methodize: function() {
    if (this._methodized) return this._methodized;
    var __method = this;
    return this._methodized = function() {
      return __method.apply(null, [this].concat($A(arguments)));
    };
  }
});

Function.prototype.defer = Function.prototype.delay.curry(0.01);

Date.prototype.toJSON = function() {
  return '"' + this.getUTCFullYear() + '-' +
    (this.getUTCMonth() + 1).toPaddedString(2) + '-' +
    this.getUTCDate().toPaddedString(2) + 'T' +
    this.getUTCHours().toPaddedString(2) + ':' +
    this.getUTCMinutes().toPaddedString(2) + ':' +
    this.getUTCSeconds().toPaddedString(2) + 'Z"';
};

var Try = {
  these: function() {
    var returnValue;

    for (var i = 0, length = arguments.length; i < length; i++) {
      var lambda = arguments[i];
      try {
        returnValue = lambda();
        break;
      } catch (e) { }
    }

    return returnValue;
  }
};

RegExp.prototype.match = RegExp.prototype.test;

RegExp.escape = function(str) {
  return String(str).replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1');
};

/*--------------------------------------------------------------------------*/

var PeriodicalExecuter = Class.create({
  initialize: function(callback, frequency) {
    this.callback = callback;
    this.frequency = frequency;
    this.currentlyExecuting = false;

    this.registerCallback();
  },

  registerCallback: function() {
    this.timer = setInterval(this.onTimerEvent.bind(this), this.frequency * 1000);
  },

  execute: function() {
    this.callback(this);
  },

  stop: function() {
    if (!this.timer) return;
    clearInterval(this.timer);
    this.timer = null;
  },

  onTimerEvent: function() {
    if (!this.currentlyExecuting) {
      try {
        this.currentlyExecuting = true;
        this.execute();
      } finally {
        this.currentlyExecuting = false;
      }
    }
  }
});
Object.extend(String, {
  interpret: function(value) {
    return value == null ? '' : String(value);
  },
  specialChar: {
    '\b': '\\b',
    '\t': '\\t',
    '\n': '\\n',
    '\f': '\\f',
    '\r': '\\r',
    '\\': '\\\\'
  }
});

Object.extend(String.prototype, {
  gsub: function(pattern, replacement) {
    var result = '', source = this, match;
    replacement = arguments.callee.prepareReplacement(replacement);

    while (source.length > 0) {
      if (match = source.match(pattern)) {
        result += source.slice(0, match.index);
        result += String.interpret(replacement(match));
        source  = source.slice(match.index + match[0].length);
      } else {
        result += source, source = '';
      }
    }
    return result;
  },

  sub: function(pattern, replacement, count) {
    replacement = this.gsub.prepareReplacement(replacement);
    count = Object.isUndefined(count) ? 1 : count;

    return this.gsub(pattern, function(match) {
      if (--count < 0) return match[0];
      return replacement(match);
    });
  },

  scan: function(pattern, iterator) {
    this.gsub(pattern, iterator);
    return String(this);
  },

  truncate: function(length, truncation) {
    length = length || 30;
    truncation = Object.isUndefined(truncation) ? '...' : truncation;
    return this.length > length ?
      this.slice(0, length - truncation.length) + truncation : String(this);
  },

  strip: function() {
    return this.replace(/^\s+/, '').replace(/\s+$/, '');
  },

  stripTags: function() {
    return this.replace(/<\/?[^>]+>/gi, '');
  },

  stripScripts: function() {
    return this.replace(new RegExp(Prototype.ScriptFragment, 'img'), '');
  },

  extractScripts: function() {
    var matchAll = new RegExp(Prototype.ScriptFragment, 'img');
    var matchOne = new RegExp(Prototype.ScriptFragment, 'im');
    return (this.match(matchAll) || []).map(function(scriptTag) {
      return (scriptTag.match(matchOne) || ['', ''])[1];
    });
  },

  evalScripts: function() {
    return this.extractScripts().map(function(script) { return eval(script) });
  },

  escapeHTML: function() {
    var self = arguments.callee;
    self.text.data = this;
    return self.div.innerHTML;
  },

  unescapeHTML: function() {
    var div = new Element('div');
    div.innerHTML = this.stripTags();
    return div.childNodes[0] ? (div.childNodes.length > 1 ?
      $A(div.childNodes).inject('', function(memo, node) { return memo+node.nodeValue }) :
      div.childNodes[0].nodeValue) : '';
  },

  toQueryParams: function(separator) {
    var match = this.strip().match(/([^?#]*)(#.*)?$/);
    if (!match) return { };

    return match[1].split(separator || '&').inject({ }, function(hash, pair) {
      if ((pair = pair.split('='))[0]) {
        var key = decodeURIComponent(pair.shift());
        var value = pair.length > 1 ? pair.join('=') : pair[0];
        if (value != undefined) value = decodeURIComponent(value);

        if (key in hash) {
          if (!Object.isArray(hash[key])) hash[key] = [hash[key]];
          hash[key].push(value);
        }
        else hash[key] = value;
      }
      return hash;
    });
  },

  toArray: function() {
    return this.split('');
  },

  succ: function() {
    return this.slice(0, this.length - 1) +
      String.fromCharCode(this.charCodeAt(this.length - 1) + 1);
  },

  times: function(count) {
    return count < 1 ? '' : new Array(count + 1).join(this);
  },

  camelize: function() {
    var parts = this.split('-'), len = parts.length;
    if (len == 1) return parts[0];

    var camelized = this.charAt(0) == '-'
      ? parts[0].charAt(0).toUpperCase() + parts[0].substring(1)
      : parts[0];

    for (var i = 1; i < len; i++)
      camelized += parts[i].charAt(0).toUpperCase() + parts[i].substring(1);

    return camelized;
  },

  capitalize: function() {
    return this.charAt(0).toUpperCase() + this.substring(1).toLowerCase();
  },

  underscore: function() {
    return this.gsub(/::/, '/').gsub(/([A-Z]+)([A-Z][a-z])/,'#{1}_#{2}').gsub(/([a-z\d])([A-Z])/,'#{1}_#{2}').gsub(/-/,'_').toLowerCase();
  },

  dasherize: function() {
    return this.gsub(/_/,'-');
  },

  inspect: function(useDoubleQuotes) {
    var escapedString = this.gsub(/[\x00-\x1f\\]/, function(match) {
      var character = String.specialChar[match[0]];
      return character ? character : '\\u00' + match[0].charCodeAt().toPaddedString(2, 16);
    });
    if (useDoubleQuotes) return '"' + escapedString.replace(/"/g, '\\"') + '"';
    return "'" + escapedString.replace(/'/g, '\\\'') + "'";
  },

  toJSON: function() {
    return this.inspect(true);
  },

  unfilterJSON: function(filter) {
    return this.sub(filter || Prototype.JSONFilter, '#{1}');
  },

  isJSON: function() {
    var str = this;
    if (str.blank()) return false;
    str = this.replace(/\\./g, '@').replace(/"[^"\\\n\r]*"/g, '');
    return (/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(str);
  },

  evalJSON: function(sanitize) {
    var json = this.unfilterJSON();
    try {
      if (!sanitize || json.isJSON()) return eval('(' + json + ')');
    } catch (e) { }
    throw new SyntaxError('Badly formed JSON string: ' + this.inspect());
  },

  include: function(pattern) {
    return this.indexOf(pattern) > -1;
  },

  startsWith: function(pattern) {
    return this.indexOf(pattern) === 0;
  },

  endsWith: function(pattern) {
    var d = this.length - pattern.length;
    return d >= 0 && this.lastIndexOf(pattern) === d;
  },

  empty: function() {
    return this == '';
  },

  blank: function() {
    return /^\s*$/.test(this);
  },

  interpolate: function(object, pattern) {
    return new Template(this, pattern).evaluate(object);
  }
});

if (Prototype.Browser.WebKit || Prototype.Browser.IE) Object.extend(String.prototype, {
  escapeHTML: function() {
    return this.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;');
  },
  unescapeHTML: function() {
    return this.replace(/&amp;/g,'&').replace(/&lt;/g,'<').replace(/&gt;/g,'>');
  }
});

String.prototype.gsub.prepareReplacement = function(replacement) {
  if (Object.isFunction(replacement)) return replacement;
  var template = new Template(replacement);
  return function(match) { return template.evaluate(match) };
};

String.prototype.parseQuery = String.prototype.toQueryParams;

Object.extend(String.prototype.escapeHTML, {
  div:  document.createElement('div'),
  text: document.createTextNode('')
});

with (String.prototype.escapeHTML) div.appendChild(text);

var Template = Class.create({
  initialize: function(template, pattern) {
    this.template = template.toString();
    this.pattern = pattern || Template.Pattern;
  },

  evaluate: function(object) {
    if (Object.isFunction(object.toTemplateReplacements))
      object = object.toTemplateReplacements();

    return this.template.gsub(this.pattern, function(match) {
      if (object == null) return '';

      var before = match[1] || '';
      if (before == '\\') return match[2];

      var ctx = object, expr = match[3];
      var pattern = /^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/;
      match = pattern.exec(expr);
      if (match == null) return before;

      while (match != null) {
        var comp = match[1].startsWith('[') ? match[2].gsub('\\\\]', ']') : match[1];
        ctx = ctx[comp];
        if (null == ctx || '' == match[3]) break;
        expr = expr.substring('[' == match[3] ? match[1].length : match[0].length);
        match = pattern.exec(expr);
      }

      return before + String.interpret(ctx);
    });
  }
});
Template.Pattern = /(^|.|\r|\n)(#\{(.*?)\})/;

var $break = { };

var Enumerable = {
  each: function(iterator, context) {
    var index = 0;
    iterator = iterator.bind(context);
    try {
      this._each(function(value) {
        iterator(value, index++);
      });
    } catch (e) {
      if (e != $break) throw e;
    }
    return this;
  },

  eachSlice: function(number, iterator, context) {
    iterator = iterator ? iterator.bind(context) : Prototype.K;
    var index = -number, slices = [], array = this.toArray();
    while ((index += number) < array.length)
      slices.push(array.slice(index, index+number));
    return slices.collect(iterator, context);
  },

  all: function(iterator, context) {
    iterator = iterator ? iterator.bind(context) : Prototype.K;
    var result = true;
    this.each(function(value, index) {
      result = result && !!iterator(value, index);
      if (!result) throw $break;
    });
    return result;
  },

  any: function(iterator, context) {
    iterator = iterator ? iterator.bind(context) : Prototype.K;
    var result = false;
    this.each(function(value, index) {
      if (result = !!iterator(value, index))
        throw $break;
    });
    return result;
  },

  collect: function(iterator, context) {
    iterator = iterator ? iterator.bind(context) : Prototype.K;
    var results = [];
    this.each(function(value, index) {
      results.push(iterator(value, index));
    });
    return results;
  },

  detect: function(iterator, context) {
    iterator = iterator.bind(context);
    var result;
    this.each(function(value, index) {
      if (iterator(value, index)) {
        result = value;
        throw $break;
      }
    });
    return result;
  },

  findAll: function(iterator, context) {
    iterator = iterator.bind(context);
    var results = [];
    this.each(function(value, index) {
      if (iterator(value, index))
        results.push(value);
    });
    return results;
  },

  grep: function(filter, iterator, context) {
    iterator = iterator ? iterator.bind(context) : Prototype.K;
    var results = [];

    if (Object.isString(filter))
      filter = new RegExp(filter);

    this.each(function(value, index) {
      if (filter.match(value))
        results.push(iterator(value, index));
    });
    return results;
  },

  include: function(object) {
    if (Object.isFunction(this.indexOf))
      if (this.indexOf(object) != -1) return true;

    var found = false;
    this.each(function(value) {
      if (value == object) {
        found = true;
        throw $break;
      }
    });
    return found;
  },

  inGroupsOf: function(number, fillWith) {
    fillWith = Object.isUndefined(fillWith) ? null : fillWith;
    return this.eachSlice(number, function(slice) {
      while(slice.length < number) slice.push(fillWith);
      return slice;
    });
  },

  inject: function(memo, iterator, context) {
    iterator = iterator.bind(context);
    this.each(function(value, index) {
      memo = iterator(memo, value, index);
    });
    return memo;
  },

  invoke: function(method) {
    var args = $A(arguments).slice(1);
    return this.map(function(value) {
      return value[method].apply(value, args);
    });
  },

  max: function(iterator, context) {
    iterator = iterator ? iterator.bind(context) : Prototype.K;
    var result;
    this.each(function(value, index) {
      value = iterator(value, index);
      if (result == null || value >= result)
        result = value;
    });
    return result;
  },

  min: function(iterator, context) {
    iterator = iterator ? iterator.bind(context) : Prototype.K;
    var result;
    this.each(function(value, index) {
      value = iterator(value, index);
      if (result == null || value < result)
        result = value;
    });
    return result;
  },

  partition: function(iterator, context) {
    iterator = iterator ? iterator.bind(context) : Prototype.K;
    var trues = [], falses = [];
    this.each(function(value, index) {
      (iterator(value, index) ?
        trues : falses).push(value);
    });
    return [trues, falses];
  },

  pluck: function(property) {
    var results = [];
    this.each(function(value) {
      results.push(value[property]);
    });
    return results;
  },

  reject: function(iterator, context) {
    iterator = iterator.bind(context);
    var results = [];
    this.each(function(value, index) {
      if (!iterator(value, index))
        results.push(value);
    });
    return results;
  },

  sortBy: function(iterator, context) {
    iterator = iterator.bind(context);
    return this.map(function(value, index) {
      return {value: value, criteria: iterator(value, index)};
    }).sort(function(left, right) {
      var a = left.criteria, b = right.criteria;
      return a < b ? -1 : a > b ? 1 : 0;
    }).pluck('value');
  },

  toArray: function() {
    return this.map();
  },

  zip: function() {
    var iterator = Prototype.K, args = $A(arguments);
    if (Object.isFunction(args.last()))
      iterator = args.pop();

    var collections = [this].concat(args).map($A);
    return this.map(function(value, index) {
      return iterator(collections.pluck(index));
    });
  },

  size: function() {
    return this.toArray().length;
  },

  inspect: function() {
    return '#<Enumerable:' + this.toArray().inspect() + '>';
  }
};

Object.extend(Enumerable, {
  map:     Enumerable.collect,
  find:    Enumerable.detect,
  select:  Enumerable.findAll,
  filter:  Enumerable.findAll,
  member:  Enumerable.include,
  entries: Enumerable.toArray,
  every:   Enumerable.all,
  some:    Enumerable.any
});
function $A(iterable) {
  if (!iterable) return [];
  if (iterable.toArray) return iterable.toArray();
  var length = iterable.length || 0, results = new Array(length);
  while (length--) results[length] = iterable[length];
  return results;
}

if (Prototype.Browser.WebKit) {
  $A = function(iterable) {
    if (!iterable) return [];
    if (!(Object.isFunction(iterable) && iterable == '[object NodeList]') &&
        iterable.toArray) return iterable.toArray();
    var length = iterable.length || 0, results = new Array(length);
    while (length--) results[length] = iterable[length];
    return results;
  };
}

Array.from = $A;

Object.extend(Array.prototype, Enumerable);

if (!Array.prototype._reverse) Array.prototype._reverse = Array.prototype.reverse;

Object.extend(Array.prototype, {
  _each: function(iterator) {
    for (var i = 0, length = this.length; i < length; i++)
      iterator(this[i]);
  },

  clear: function() {
    this.length = 0;
    return this;
  },

  first: function() {
    return this[0];
  },

  last: function() {
    return this[this.length - 1];
  },

  compact: function() {
    return this.select(function(value) {
      return value != null;
    });
  },

  flatten: function() {
    return this.inject([], function(array, value) {
      return array.concat(Object.isArray(value) ?
        value.flatten() : [value]);
    });
  },

  without: function() {
    var values = $A(arguments);
    return this.select(function(value) {
      return !values.include(value);
    });
  },

  reverse: function(inline) {
    return (inline !== false ? this : this.toArray())._reverse();
  },

  reduce: function() {
    return this.length > 1 ? this : this[0];
  },

  uniq: function(sorted) {
    return this.inject([], function(array, value, index) {
      if (0 == index || (sorted ? array.last() != value : !array.include(value)))
        array.push(value);
      return array;
    });
  },

  intersect: function(array) {
    return this.uniq().findAll(function(item) {
      return array.detect(function(value) { return item === value });
    });
  },

  clone: function() {
    return [].concat(this);
  },

  size: function() {
    return this.length;
  },

  inspect: function() {
    return '[' + this.map(Object.inspect).join(', ') + ']';
  },

  toJSON: function() {
    var results = [];
    this.each(function(object) {
      var value = Object.toJSON(object);
      if (!Object.isUndefined(value)) results.push(value);
    });
    return '[' + results.join(', ') + ']';
  }
});

// use native browser JS 1.6 implementation if available
if (Object.isFunction(Array.prototype.forEach))
  Array.prototype._each = Array.prototype.forEach;

if (!Array.prototype.indexOf) Array.prototype.indexOf = function(item, i) {
  i || (i = 0);
  var length = this.length;
  if (i < 0) i = length + i;
  for (; i < length; i++)
    if (this[i] === item) return i;
  return -1;
};

if (!Array.prototype.lastIndexOf) Array.prototype.lastIndexOf = function(item, i) {
  i = isNaN(i) ? this.length : (i < 0 ? this.length + i : i) + 1;
  var n = this.slice(0, i).reverse().indexOf(item);
  return (n < 0) ? n : i - n - 1;
};

Array.prototype.toArray = Array.prototype.clone;

function $w(string) {
  if (!Object.isString(string)) return [];
  string = string.strip();
  return string ? string.split(/\s+/) : [];
}

if (Prototype.Browser.Opera){
  Array.prototype.concat = function() {
    var array = [];
    for (var i = 0, length = this.length; i < length; i++) array.push(this[i]);
    for (var i = 0, length = arguments.length; i < length; i++) {
      if (Object.isArray(arguments[i])) {
        for (var j = 0, arrayLength = arguments[i].length; j < arrayLength; j++)
          array.push(arguments[i][j]);
      } else {
        array.push(arguments[i]);
      }
    }
    return array;
  };
}
Object.extend(Number.prototype, {
  toColorPart: function() {
    return this.toPaddedString(2, 16);
  },

  succ: function() {
    return this + 1;
  },

  times: function(iterator) {
    $R(0, this, true).each(iterator);
    return this;
  },

  toPaddedString: function(length, radix) {
    var string = this.toString(radix || 10);
    return '0'.times(length - string.length) + string;
  },

  toJSON: function() {
    return isFinite(this) ? this.toString() : 'null';
  }
});

$w('abs round ceil floor').each(function(method){
  Number.prototype[method] = Math[method].methodize();
});
function $H(object) {
  return new Hash(object);
};

var Hash = Class.create(Enumerable, (function() {

  function toQueryPair(key, value) {
    if (Object.isUndefined(value)) return key;
    return key + '=' + encodeURIComponent(String.interpret(value));
  }

  return {
    initialize: function(object) {
      this._object = Object.isHash(object) ? object.toObject() : Object.clone(object);
    },

    _each: function(iterator) {
      for (var key in this._object) {
        var value = this._object[key], pair = [key, value];
        pair.key = key;
        pair.value = value;
        iterator(pair);
      }
    },

    set: function(key, value) {
      return this._object[key] = value;
    },

    get: function(key) {
      return this._object[key];
    },

    unset: function(key) {
      var value = this._object[key];
      delete this._object[key];
      return value;
    },

    toObject: function() {
      return Object.clone(this._object);
    },

    keys: function() {
      return this.pluck('key');
    },

    values: function() {
      return this.pluck('value');
    },

    index: function(value) {
      var match = this.detect(function(pair) {
        return pair.value === value;
      });
      return match && match.key;
    },

    merge: function(object) {
      return this.clone().update(object);
    },

    update: function(object) {
      return new Hash(object).inject(this, function(result, pair) {
        result.set(pair.key, pair.value);
        return result;
      });
    },

    toQueryString: function() {
      return this.map(function(pair) {
        var key = encodeURIComponent(pair.key), values = pair.value;

        if (values && typeof values == 'object') {
          if (Object.isArray(values))
            return values.map(toQueryPair.curry(key)).join('&');
        }
        return toQueryPair(key, values);
      }).join('&');
    },

    inspect: function() {
      return '#<Hash:{' + this.map(function(pair) {
        return pair.map(Object.inspect).join(': ');
      }).join(', ') + '}>';
    },

    toJSON: function() {
      return Object.toJSON(this.toObject());
    },

    clone: function() {
      return new Hash(this);
    }
  }
})());

Hash.prototype.toTemplateReplacements = Hash.prototype.toObject;
Hash.from = $H;
var ObjectRange = Class.create(Enumerable, {
  initialize: function(start, end, exclusive) {
    this.start = start;
    this.end = end;
    this.exclusive = exclusive;
  },

  _each: function(iterator) {
    var value = this.start;
    while (this.include(value)) {
      iterator(value);
      value = value.succ();
    }
  },

  include: function(value) {
    if (value < this.start)
      return false;
    if (this.exclusive)
      return value < this.end;
    return value <= this.end;
  }
});

var $R = function(start, end, exclusive) {
  return new ObjectRange(start, end, exclusive);
};

var Ajax = {
  getTransport: function() {
    return Try.these(
      function() {return new XMLHttpRequest()},
      function() {return new ActiveXObject('Msxml2.XMLHTTP')},
      function() {return new ActiveXObject('Microsoft.XMLHTTP')}
    ) || false;
  },

  activeRequestCount: 0
};

Ajax.Responders = {
  responders: [],

  _each: function(iterator) {
    this.responders._each(iterator);
  },

  register: function(responder) {
    if (!this.include(responder))
      this.responders.push(responder);
  },

  unregister: function(responder) {
    this.responders = this.responders.without(responder);
  },

  dispatch: function(callback, request, transport, json) {
    this.each(function(responder) {
      if (Object.isFunction(responder[callback])) {
        try {
          responder[callback].apply(responder, [request, transport, json]);
        } catch (e) { }
      }
    });
  }
};

Object.extend(Ajax.Responders, Enumerable);

Ajax.Responders.register({
  onCreate:   function() { Ajax.activeRequestCount++ },
  onComplete: function() { Ajax.activeRequestCount-- }
});

Ajax.Base = Class.create({
  initialize: function(options) {
    this.options = {
      method:       'post',
      asynchronous: true,
      contentType:  'application/x-www-form-urlencoded',
      encoding:     'UTF-8',
      parameters:   '',
      evalJSON:     true,
      evalJS:       true
    };
    Object.extend(this.options, options || { });

    this.options.method = this.options.method.toLowerCase();

    if (Object.isString(this.options.parameters))
      this.options.parameters = this.options.parameters.toQueryParams();
    else if (Object.isHash(this.options.parameters))
      this.options.parameters = this.options.parameters.toObject();
  }
});

Ajax.Request = Class.create(Ajax.Base, {
  _complete: false,

  initialize: function($super, url, options) {
    $super(options);
    this.transport = Ajax.getTransport();
    this.request(url);
  },

  request: function(url) {
    this.url = url;
    this.method = this.options.method;
    var params = Object.clone(this.options.parameters);

    if (!['get', 'post'].include(this.method)) {
      // simulate other verbs over post
      params['_method'] = this.method;
      this.method = 'post';
    }

    this.parameters = params;

    if (params = Object.toQueryString(params)) {
      // when GET, append parameters to URL
      if (this.method == 'get')
        this.url += (this.url.include('?') ? '&' : '?') + params;
      else if (/Konqueror|Safari|KHTML/.test(navigator.userAgent))
        params += '&_=';
    }

    try {
      var response = new Ajax.Response(this);
      if (this.options.onCreate) this.options.onCreate(response);
      Ajax.Responders.dispatch('onCreate', this, response);

      this.transport.open(this.method.toUpperCase(), this.url,
        this.options.asynchronous);

      if (this.options.asynchronous) this.respondToReadyState.bind(this).defer(1);

      this.transport.onreadystatechange = this.onStateChange.bind(this);
      this.setRequestHeaders();

      this.body = this.method == 'post' ? (this.options.postBody || params) : null;
      this.transport.send(this.body);

      /* Force Firefox to handle ready state 4 for synchronous requests */
      if (!this.options.asynchronous && this.transport.overrideMimeType)
        this.onStateChange();

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

  onStateChange: function() {
    var readyState = this.transport.readyState;
    if (readyState > 1 && !((readyState == 4) && this._complete))
      this.respondToReadyState(this.transport.readyState);
  },

  setRequestHeaders: function() {
    var headers = {
      'X-Requested-With': 'XMLHttpRequest',
      'X-Prototype-Version': Prototype.Version,
      'Accept': 'text/javascript, text/html, application/xml, text/xml, */*'
    };

    if (this.method == 'post') {
      headers['Content-type'] = this.options.contentType +
        (this.options.encoding ? '; charset=' + this.options.encoding : '');

      /* Force "Connection: close" for older Mozilla browsers to work
       * around a bug where XMLHttpRequest sends an incorrect
       * Content-length header. See Mozilla Bugzilla #246651.
       */
      if (this.transport.overrideMimeType &&
          (navigator.userAgent.match(/Gecko\/(\d{4})/) || [0,2005])[1] < 2005)
            headers['Connection'] = 'close';
    }

    // user-defined headers
    if (typeof this.options.requestHeaders == 'object') {
      var extras = this.options.requestHeaders;

      if (Object.isFunction(extras.push))
        for (var i = 0, length = extras.length; i < length; i += 2)
          headers[extras[i]] = extras[i+1];
      else
        $H(extras).each(function(pair) { headers[pair.key] = pair.value });
    }

    for (var name in headers)
      this.transport.setRequestHeader(name, headers[name]);
  },

  success: function() {
    var status = this.getStatus();
    return !status || (status >= 200 && status < 300);
  },

  getStatus: function() {
    try {
      return this.transport.status || 0;
    } catch (e) { return 0 }
  },

  respondToReadyState: function(readyState) {
    var state = Ajax.Request.Events[readyState], response = new Ajax.Response(this);

    if (state == 'Complete') {
      try {
        this._complete = true;
        (this.options['on' + response.status]
         || this.options['on' + (this.success() ? 'Success' : 'Failure')]
         || Prototype.emptyFunction)(response, response.headerJSON);
      } catch (e) {
        this.dispatchException(e);
      }

      var contentType = response.getHeader('Content-type');
      if (this.options.evalJS == 'force'
          || (this.options.evalJS && this.isSameOrigin() && contentType
          && contentType.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i)))
        this.evalResponse();
    }

    try {
      (this.options['on' + state] || Prototype.emptyFunction)(response, response.headerJSON);
      Ajax.Responders.dispatch('on' + state, this, response, response.headerJSON);
    } catch (e) {
      this.dispatchException(e);
    }

    if (state == 'Complete') {
      // avoid memory leak in MSIE: clean up
      this.transport.onreadystatechange = Prototype.emptyFunction;
    }
  },

  isSameOrigin: function() {
    var m = this.url.match(/^\s*https?:\/\/[^\/]*/);
    return !m || (m[0] == '#{protocol}//#{domain}#{port}'.interpolate({
      protocol: location.protocol,
      domain: document.domain,
      port: location.port ? ':' + location.port : ''
    }));
  },

  getHeader: function(name) {
    try {
      return this.transport.getResponseHeader(name) || null;
    } catch (e) { return null }
  },

  evalResponse: function() {
    try {
      return eval((this.transport.responseText || '').unfilterJSON());
    } catch (e) {
      this.dispatchException(e);
    }
  },

  dispatchException: function(exception) {
    (this.options.onException || Prototype.emptyFunction)(this, exception);
    Ajax.Responders.dispatch('onException', this, exception);
  }
});

Ajax.Request.Events =
  ['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete'];

Ajax.Response = Class.create({
  initialize: function(request){
    this.request = request;
    var transport  = this.transport  = request.transport,
        readyState = this.readyState = transport.readyState;

    if((readyState > 2 && !Prototype.Browser.IE) || readyState == 4) {
      this.status       = this.getStatus();
      this.statusText   = this.getStatusText();
      this.responseText = String.interpret(transport.responseText);
      this.headerJSON   = this._getHeaderJSON();
    }

    if(readyState == 4) {
      var xml = transport.responseXML;
      this.responseXML  = Object.isUndefined(xml) ? null : xml;
      this.responseJSON = this._getResponseJSON();
    }
  },

  status:      0,
  statusText: '',

  getStatus: Ajax.Request.prototype.getStatus,

  getStatusText: function() {
    try {
      return this.transport.statusText || '';
    } catch (e) { return '' }
  },

  getHeader: Ajax.Request.prototype.getHeader,

  getAllHeaders: function() {
    try {
      return this.getAllResponseHeaders();
    } catch (e) { return null }
  },

  getResponseHeader: function(name) {
    return this.transport.getResponseHeader(name);
  },

  getAllResponseHeaders: function() {
    return this.transport.getAllResponseHeaders();
  },

  _getHeaderJSON: function() {
    var json = this.getHeader('X-JSON');
    if (!json) return null;
    json = decodeURIComponent(escape(json));
    try {
      return json.evalJSON(this.request.options.sanitizeJSON ||
        !this.request.isSameOrigin());
    } catch (e) {
      this.request.dispatchException(e);
    }
  },

  _getResponseJSON: function() {
    var options = this.request.options;
    if (!options.evalJSON || (options.evalJSON != 'force' &&
      !(this.getHeader('Content-type') || '').include('application/json')) ||
        this.responseText.blank())
          return null;
    try {
      return this.responseText.evalJSON(options.sanitizeJSON ||
        !this.request.isSameOrigin());
    } catch (e) {
      this.request.dispatchException(e);
    }
  }
});

Ajax.Updater = Class.create(Ajax.Request, {
  initialize: function($super, container, url, options) {
    this.container = {
      success: (container.success || container),
      failure: (container.failure || (container.success ? null : container))
    };

    options = Object.clone(options);
    var onComplete = options.onComplete;
    options.onComplete = (function(response, json) {
      this.updateContent(response.responseText);
      if (Object.isFunction(onComplete)) onComplete(response, json);
    }).bind(this);

    $super(url, options);
  },

  updateContent: function(responseText) {
    var receiver = this.container[this.success() ? 'success' : 'failure'],
        options = this.options;

    if (!options.evalScripts) responseText = responseText.stripScripts();

    if (receiver = $(receiver)) {
      if (options.insertion) {
        if (Object.isString(options.insertion)) {
          var insertion = { }; insertion[options.insertion] = responseText;
          receiver.insert(insertion);
        }
        else options.insertion(receiver, responseText);
      }
      else receiver.update(responseText);
    }
  }
});

Ajax.PeriodicalUpdater = Class.create(Ajax.Base, {
  initialize: function($super, container, url, options) {
    $super(options);
    this.onComplete = this.options.onComplete;

    this.frequency = (this.options.frequency || 2);
    this.decay = (this.options.decay || 1);

    this.updater = { };
    this.container = container;
    this.url = url;

    this.start();
  },

  start: function() {
    this.options.onComplete = this.updateComplete.bind(this);
    this.onTimerEvent();
  },

  stop: function() {
    this.updater.options.onComplete = undefined;
    clearTimeout(this.timer);
    (this.onComplete || Prototype.emptyFunction).apply(this, arguments);
  },

  updateComplete: function(response) {
    if (this.options.decay) {
      this.decay = (response.responseText == this.lastText ?
        this.decay * this.options.decay : 1);

      this.lastText = response.responseText;
    }
    this.timer = this.onTimerEvent.bind(this).delay(this.decay * this.frequency);
  },

  onTimerEvent: function() {
    this.updater = new Ajax.Updater(this.container, this.url, this.options);
  }
});
function $(element) {
  if (arguments.length > 1) {
    for (var i = 0, elements = [], length = arguments.length; i < length; i++)
      elements.push($(arguments[i]));
    return elements;
  }
  if (Object.isString(element))
    element = document.getElementById(element);
  return Element.extend(element);
}

if (Prototype.BrowserFeatures.XPath) {
  document._getElementsByXPath = function(expression, parentElement) {
    var results = [];
    var query = document.evaluate(expression, $(parentElement) || document,
      null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
    for (var i = 0, length = query.snapshotLength; i < length; i++)
      results.push(Element.extend(query.snapshotItem(i)));
    return results;
  };
}

/*--------------------------------------------------------------------------*/

if (!window.Node) var Node = { };

if (!Node.ELEMENT_NODE) {
  // DOM level 2 ECMAScript Language Binding
  Object.extend(Node, {
    ELEMENT_NODE: 1,
    ATTRIBUTE_NODE: 2,
    TEXT_NODE: 3,
    CDATA_SECTION_NODE: 4,
    ENTITY_REFERENCE_NODE: 5,
    ENTITY_NODE: 6,
    PROCESSING_INSTRUCTION_NODE: 7,
    COMMENT_NODE: 8,
    DOCUMENT_NODE: 9,
    DOCUMENT_TYPE_NODE: 10,
    DOCUMENT_FRAGMENT_NODE: 11,
    NOTATION_NODE: 12
  });
}

(function() {
  var element = this.Element;
  this.Element = function(tagName, attributes) {
    attributes = attributes || { };
    tagName = tagName.toLowerCase();
    var cache = Element.cache;
    if (Prototype.Browser.IE && attributes.name) {
      tagName = '<' + tagName + ' name="' + attributes.name + '">';
      delete attributes.name;
      return Element.writeAttribute(document.createElement(tagName), attributes);
    }
    if (!cache[tagName]) cache[tagName] = Element.extend(document.createElement(tagName));
    return Element.writeAttribute(cache[tagName].cloneNode(false), attributes);
  };
  Object.extend(this.Element, element || { });
}).call(window);

Element.cache = { };

Element.Methods = {
  visible: function(element) {
    return $(element).style.display != 'none';
  },

  toggle: function(element) {
    element = $(element);
    Element[Element.visible(element) ? 'hide' : 'show'](element);
    return element;
  },

  hide: function(element) {
    $(element).style.display = 'none';
    return element;
  },

  show: function(element) {
    $(element).style.display = '';
    return element;
  },

  remove: function(element) {
    element = $(element);
    element.parentNode.removeChild(element);
    return element;
  },

  update: function(element, content) {
    element = $(element);
    if (content && content.toElement) content = content.toElement();
    if (Object.isElement(content)) return element.update().insert(content);
    content = Object.toHTML(content);
    element.innerHTML = content.stripScripts();
    content.evalScripts.bind(content).defer();
    return element;
  },

  replace: function(element, content) {
    element = $(element);
    if (content && content.toElement) content = content.toElement();
    else if (!Object.isElement(content)) {
      content = Object.toHTML(content);
      var range = element.ownerDocument.createRange();
      range.selectNode(element);
      content.evalScripts.bind(content).defer();
      content = range.createContextualFragment(content.stripScripts());
    }
    element.parentNode.replaceChild(content, element);
    return element;
  },

  insert: function(element, insertions) {
    element = $(element);

    if (Object.isString(insertions) || Object.isNumber(insertions) ||
        Object.isElement(insertions) || (insertions && (insertions.toElement || insertions.toHTML)))
          insertions = {bottom:insertions};

    var content, insert, tagName, childNodes;

    for (var position in insertions) {
      content  = insertions[position];
      position = position.toLowerCase();
      insert = Element._insertionTranslations[position];

      if (content && content.toElement) content = content.toElement();
      if (Object.isElement(content)) {
        insert(element, content);
        continue;
      }

      content = Object.toHTML(content);

      tagName = ((position == 'before' || position == 'after')
        ? element.parentNode : element).tagName.toUpperCase();

      childNodes = Element._getContentFromAnonymousElement(tagName, content.stripScripts());

      if (position == 'top' || position == 'after') childNodes.reverse();
      childNodes.each(insert.curry(element));

      content.evalScripts.bind(content).defer();
    }

    return element;
  },

  wrap: function(element, wrapper, attributes) {
    element = $(element);
    if (Object.isElement(wrapper))
      $(wrapper).writeAttribute(attributes || { });
    else if (Object.isString(wrapper)) wrapper = new Element(wrapper, attributes);
    else wrapper = new Element('div', wrapper);
    if (element.parentNode)
      element.parentNode.replaceChild(wrapper, element);
    wrapper.appendChild(element);
    return wrapper;
  },

  inspect: function(element) {
    element = $(element);
    var result = '<' + element.tagName.toLowerCase();
    $H({'id': 'id', 'className': 'class'}).each(function(pair) {
      var property = pair.first(), attribute = pair.last();
      var value = (element[property] || '').toString();
      if (value) result += ' ' + attribute + '=' + value.inspect(true);
    });
    return result + '>';
  },

  recursivelyCollect: function(element, property) {
    element = $(element);
    var elements = [];
    while (element = element[property])
      if (element.nodeType == 1)
        elements.push(Element.extend(element));
    return elements;
  },

  ancestors: function(element) {
    return $(element).recursivelyCollect('parentNode');
  },

  descendants: function(element) {
    return $(element).select("*");
  },

  firstDescendant: function(element) {
    element = $(element).firstChild;
    while (element && element.nodeType != 1) element = element.nextSibling;
    return $(element);
  },

  immediateDescendants: function(element) {
    if (!(element = $(element).firstChild)) return [];
    while (element && element.nodeType != 1) element = element.nextSibling;
    if (element) return [element].concat($(element).nextSiblings());
    return [];
  },

  previousSiblings: function(element) {
    return $(element).recursivelyCollect('previousSibling');
  },

  nextSiblings: function(element) {
    return $(element).recursivelyCollect('nextSibling');
  },

  siblings: function(element) {
    element = $(element);
    return element.previousSiblings().reverse().concat(element.nextSiblings());
  },

  match: function(element, selector) {
    if (Object.isString(selector))
      selector = new Selector(selector);
    return selector.match($(element));
  },

  up: function(element, expression, index) {
    element = $(element);
    if (arguments.length == 1) return $(element.parentNode);
    var ancestors = element.ancestors();
    return Object.isNumber(expression) ? ancestors[expression] :
      Selector.findElement(ancestors, expression, index);
  },

  down: function(element, expression, index) {
    element = $(element);
    if (arguments.length == 1) return element.firstDescendant();
    return Object.isNumber(expression) ? element.descendants()[expression] :
      element.select(expression)[index || 0];
  },

  previous: function(element, expression, index) {
    element = $(element);
    if (arguments.length == 1) return $(Selector.handlers.previousElementSibling(element));
    var previousSiblings = element.previousSiblings();
    return Object.isNumber(expression) ? previousSiblings[expression] :
      Selector.findElement(previousSiblings, expression, index);
  },

  next: function(element, expression, index) {
    element = $(element);
    if (arguments.length == 1) return $(Selector.handlers.nextElementSibling(element));
    var nextSiblings = element.nextSiblings();
    return Object.isNumber(expression) ? nextSiblings[expression] :
      Selector.findElement(nextSiblings, expression, index);
  },

  select: function() {
    var args = $A(arguments), element = $(args.shift());
    return Selector.findChildElements(element, args);
  },

  adjacent: function() {
    var args = $A(arguments), element = $(args.shift());
    return Selector.findChildElements(element.parentNode, args).without(element);
  },

  identify: function(element) {
    element = $(element);
    var id = element.readAttribute('id'), self = arguments.callee;
    if (id) return id;
    do { id = 'anonymous_element_' + self.counter++ } while ($(id));
    element.writeAttribute('id', id);
    return id;
  },

  readAttribute: function(element, name) {
    element = $(element);
    if (Prototype.Browser.IE) {
      var t = Element._attributeTranslations.read;
      if (t.values[name]) return t.values[name](element, name);
      if (t.names[name]) name = t.names[name];
      if (name.include(':')) {
        return (!element.attributes || !element.attributes[name]) ? null :
         element.attributes[name].value;
      }
    }
    return element.getAttribute(name);
  },

  writeAttribute: function(element, name, value) {
    element = $(element);
    var attributes = { }, t = Element._attributeTranslations.write;

    if (typeof name == 'object') attributes = name;
    else attributes[name] = Object.isUndefined(value) ? true : value;

    for (var attr in attributes) {
      name = t.names[attr] || attr;
      value = attributes[attr];
      if (t.values[attr]) name = t.values[attr](element, value);
      if (value === false || value === null)
        element.removeAttribute(name);
      else if (value === true)
        element.setAttribute(name, name);
      else element.setAttribute(name, value);
    }
    return element;
  },

  getHeight: function(element) {
    return $(element).getDimensions().height;
  },

  getWidth: function(element) {
    return $(element).getDimensions().width;
  },

  classNames: function(element) {
    return new Element.ClassNames(element);
  },

  hasClassName: function(element, className) {
    if (!(element = $(element))) return;
    var elementClassName = element.className;
    return (elementClassName.length > 0 && (elementClassName == className ||
      new RegExp("(^|\\s)" + className + "(\\s|$)").test(elementClassName)));
  },

  addClassName: function(element, className) {
    if (!(element = $(element))) return;
    if (!element.hasClassName(className))
      element.className += (element.className ? ' ' : '') + className;
    return element;
  },

  removeClassName: function(element, className) {
    if (!(element = $(element))) return;
    element.className = element.className.replace(
      new RegExp("(^|\\s+)" + className + "(\\s+|$)"), ' ').strip();
    return element;
  },

  toggleClassName: function(element, className) {
    if (!(element = $(element))) return;
    return element[element.hasClassName(className) ?
      'removeClassName' : 'addClassName'](className);
  },

  // removes whitespace-only text node children
  cleanWhitespace: function(element) {
    element = $(element);
    var node = element.firstChild;
    while (node) {
      var nextNode = node.nextSibling;
      if (node.nodeType == 3 && !/\S/.test(node.nodeValue))
        element.removeChild(node);
      node = nextNode;
    }
    return element;
  },

  empty: function(element) {
    return $(element).innerHTML.blank();
  },

  descendantOf: function(element, ancestor) {
    element = $(element), ancestor = $(ancestor);
    var originalAncestor = ancestor;

    if (element.compareDocumentPosition)
      return (element.compareDocumentPosition(ancestor) & 8) === 8;

    if (element.sourceIndex && !Prototype.Browser.Opera) {
      var e = element.sourceIndex, a = ancestor.sourceIndex,
       nextAncestor = ancestor.nextSibling;
      if (!nextAncestor) {
        do { ancestor = ancestor.parentNode; }
        while (!(nextAncestor = ancestor.nextSibling) && ancestor.parentNode);
      }
      if (nextAncestor && nextAncestor.sourceIndex)
       return (e > a && e < nextAncestor.sourceIndex);
    }

    while (element = element.parentNode)
      if (element == originalAncestor) return true;
    return false;
  },

  scrollTo: function(element) {
    element = $(element);
    var pos = element.cumulativeOffset();
    window.scrollTo(pos[0], pos[1]);
    return element;
  },

  getStyle: function(element, style) {
    element = $(element);
    style = style == 'float' ? 'cssFloat' : style.camelize();
    var value = element.style[style];
    if (!value) {
      var css = document.defaultView.getComputedStyle(element, null);
      value = css ? css[style] : null;
    }
    if (style == 'opacity') return value ? parseFloat(value) : 1.0;
    return value == 'auto' ? null : value;
  },

  getOpacity: function(element) {
    return $(element).getStyle('opacity');
  },

  setStyle: function(element, styles) {
    element = $(element);
    var elementStyle = element.style, match;
    if (Object.isString(styles)) {
      element.style.cssText += ';' + styles;
      return styles.include('opacity') ?
        element.setOpacity(styles.match(/opacity:\s*(\d?\.?\d*)/)[1]) : element;
    }
    for (var property in styles)
      if (property == 'opacity') element.setOpacity(styles[property]);
      else
        elementStyle[(property == 'float' || property == 'cssFloat') ?
          (Object.isUndefined(elementStyle.styleFloat) ? 'cssFloat' : 'styleFloat') :
            property] = styles[property];

    return element;
  },

  setOpacity: function(element, value) {
    element = $(element);
    element.style.opacity = (value == 1 || value === '') ? '' :
      (value < 0.00001) ? 0 : value;
    return element;
  },

  getDimensions: function(element) {
    element = $(element);
    var display = $(element).getStyle('display');
    if (display != 'none' && display != null) // Safari bug
      return {width: element.offsetWidth, height: element.offsetHeight};

    // All *Width and *Height properties give 0 on elements with display none,
    // so enable the element temporarily
    var els = element.style;
    var originalVisibility = els.visibility;
    var originalPosition = els.position;
    var originalDisplay = els.display;
    els.visibility = 'hidden';
    els.position = 'absolute';
    els.display = 'block';
    var originalWidth = element.clientWidth;
    var originalHeight = element.clientHeight;
    els.display = originalDisplay;
    els.position = originalPosition;
    els.visibility = originalVisibility;
    return {width: originalWidth, height: originalHeight};
  },

  makePositioned: function(element) {
    element = $(element);
    var pos = Element.getStyle(element, 'position');
    if (pos == 'static' || !pos) {
      element._madePositioned = true;
      element.style.position = 'relative';
      // Opera returns the offset relative to the positioning context, when an
      // element is position relative but top and left have not been defined
      if (window.opera) {
        element.style.top = 0;
        element.style.left = 0;
      }
    }
    return element;
  },

  undoPositioned: function(element) {
    element = $(element);
    if (element._madePositioned) {
      element._madePositioned = undefined;
      element.style.position =
        element.style.top =
        element.style.left =
        element.style.bottom =
        element.style.right = '';
    }
    return element;
  },

  makeClipping: function(element) {
    element = $(element);
    if (element._overflow) return element;
    element._overflow = Element.getStyle(element, 'overflow') || 'auto';
    if (element._overflow !== 'hidden')
      element.style.overflow = 'hidden';
    return element;
  },

  undoClipping: function(element) {
    element = $(element);
    if (!element._overflow) return element;
    element.style.overflow = element._overflow == 'auto' ? '' : element._overflow;
    element._overflow = null;
    return element;
  },

  cumulativeOffset: function(element) {
    var valueT = 0, valueL = 0;
    do {
      valueT += element.offsetTop  || 0;
      valueL += element.offsetLeft || 0;
      element = element.offsetParent;
    } while (element);
    return Element._returnOffset(valueL, valueT);
  },

  positionedOffset: function(element) {
    var valueT = 0, valueL = 0;
    do {
      valueT += element.offsetTop  || 0;
      valueL += element.offsetLeft || 0;
      element = element.offsetParent;
      if (element) {
        if (element.tagName == 'BODY') break;
        var p = Element.getStyle(element, 'position');
        if (p !== 'static') break;
      }
    } while (element);
    return Element._returnOffset(valueL, valueT);
  },

  absolutize: function(element) {
    element = $(element);
    if (element.getStyle('position') == 'absolute') return;
    // Position.prepare(); // To be done manually by Scripty when it needs it.

    var offsets = element.positionedOffset();
    var top     = offsets[1];
    var left    = offsets[0];
    var width   = element.clientWidth;
    var height  = element.clientHeight;

    element._originalLeft   = left - parseFloat(element.style.left  || 0);
    element._originalTop    = top  - parseFloat(element.style.top || 0);
    element._originalWidth  = element.style.width;
    element._originalHeight = element.style.height;

    element.style.position = 'absolute';
    element.style.top    = top + 'px';
    element.style.left   = left + 'px';
    element.style.width  = width + 'px';
    element.style.height = height + 'px';
    return element;
  },

  relativize: function(element) {
    element = $(element);
    if (element.getStyle('position') == 'relative') return;
    // Position.prepare(); // To be done manually by Scripty when it needs it.

    element.style.position = 'relative';
    var top  = parseFloat(element.style.top  || 0) - (element._originalTop || 0);
    var left = parseFloat(element.style.left || 0) - (element._originalLeft || 0);

    element.style.top    = top + 'px';
    element.style.left   = left + 'px';
    element.style.height = element._originalHeight;
    element.style.width  = element._originalWidth;
    return element;
  },

  cumulativeScrollOffset: function(element) {
    var valueT = 0, valueL = 0;
    do {
      valueT += element.scrollTop  || 0;
      valueL += element.scrollLeft || 0;
      element = element.parentNode;
    } while (element);
    return Element._returnOffset(valueL, valueT);
  },

  getOffsetParent: function(element) {
    if (element.offsetParent) return $(element.offsetParent);
    if (element == document.body) return $(element);

    while ((element = element.parentNode) && element != document.body)
      if (Element.getStyle(element, 'position') != 'static')
        return $(element);

    return $(document.body);
  },

  viewportOffset: function(forElement) {
    var valueT = 0, valueL = 0;

    var element = forElement;
    do {
      valueT += element.offsetTop  || 0;
      valueL += element.offsetLeft || 0;

      // Safari fix
      if (element.offsetParent == document.body &&
        Element.getStyle(element, 'position') == 'absolute') break;

    } while (element = element.offsetParent);

    element = forElement;
    do {
      if (!Prototype.Browser.Opera || element.tagName == 'BODY') {
        valueT -= element.scrollTop  || 0;
        valueL -= element.scrollLeft || 0;
      }
    } while (element = element.parentNode);

    return Element._returnOffset(valueL, valueT);
  },

  clonePosition: function(element, source) {
    var options = Object.extend({
      setLeft:    true,
      setTop:     true,
      setWidth:   true,
      setHeight:  true,
      offsetTop:  0,
      offsetLeft: 0
    }, arguments[2] || { });

    // find page position of source
    source = $(source);
    var p = source.viewportOffset();

    // find coordinate system to use
    element = $(element);
    var delta = [0, 0];
    var parent = null;
    // delta [0,0] will do fine with position: fixed elements,
    // position:absolute needs offsetParent deltas
    if (Element.getStyle(element, 'position') == 'absolute') {
      parent = element.getOffsetParent();
      delta = parent.viewportOffset();
    }

    // correct by body offsets (fixes Safari)
    if (parent == document.body) {
      delta[0] -= document.body.offsetLeft;
      delta[1] -= document.body.offsetTop;
    }

    // set position
    if (options.setLeft)   element.style.left  = (p[0] - delta[0] + options.offsetLeft) + 'px';
    if (options.setTop)    element.style.top   = (p[1] - delta[1] + options.offsetTop) + 'px';
    if (options.setWidth)  element.style.width = source.offsetWidth + 'px';
    if (options.setHeight) element.style.height = source.offsetHeight + 'px';
    return element;
  }
};

Element.Methods.identify.counter = 1;

Object.extend(Element.Methods, {
  getElementsBySelector: Element.Methods.select,
  childElements: Element.Methods.immediateDescendants
});

Element._attributeTranslations = {
  write: {
    names: {
      className: 'class',
      htmlFor:   'for'
    },
    values: { }
  }
};

if (Prototype.Browser.Opera) {
  Element.Methods.getStyle = Element.Methods.getStyle.wrap(
    function(proceed, element, style) {
      switch (style) {
        case 'left': case 'top': case 'right': case 'bottom':
          if (proceed(element, 'position') === 'static') return null;
        case 'height': case 'width':
          // returns '0px' for hidden elements; we want it to return null
          if (!Element.visible(element)) return null;

          // returns the border-box dimensions rather than the content-box
          // dimensions, so we subtract padding and borders from the value
          var dim = parseInt(proceed(element, style), 10);

          if (dim !== element['offset' + style.capitalize()])
            return dim + 'px';

          var properties;
          if (style === 'height') {
            properties = ['border-top-width', 'padding-top',
             'padding-bottom', 'border-bottom-width'];
          }
          else {
            properties = ['border-left-width', 'padding-left',
             'padding-right', 'border-right-width'];
          }
          return properties.inject(dim, function(memo, property) {
            var val = proceed(element, property);
            return val === null ? memo : memo - parseInt(val, 10);
          }) + 'px';
        default: return proceed(element, style);
      }
    }
  );

  Element.Methods.readAttribute = Element.Methods.readAttribute.wrap(
    function(proceed, element, attribute) {
      if (attribute === 'title') return element.title;
      return proceed(element, attribute);
    }
  );
}

else if (Prototype.Browser.IE) {
  // IE doesn't report offsets correctly for static elements, so we change them
  // to "relative" to get the values, then change them back.
  Element.Methods.getOffsetParent = Element.Methods.getOffsetParent.wrap(
    function(proceed, element) {
      element = $(element);
      var position = element.getStyle('position');
      if (position !== 'static') return proceed(element);
      element.setStyle({ position: 'relative' });
      var value = proceed(element);
      element.setStyle({ position: position });
      return value;
    }
  );

  $w('positionedOffset viewportOffset').each(function(method) {
    Element.Methods[method] = Element.Methods[method].wrap(
      function(proceed, element) {
        element = $(element);
        var position = element.getStyle('position');
        if (position !== 'static') return proceed(element);
        // Trigger hasLayout on the offset parent so that IE6 reports
        // accurate offsetTop and offsetLeft values for position: fixed.
        var offsetParent = element.getOffsetParent();
        if (offsetParent && offsetParent.getStyle('position') === 'fixed')
          offsetParent.setStyle({ zoom: 1 });
        element.setStyle({ position: 'relative' });
        var value = proceed(element);
        element.setStyle({ position: position });
        return value;
      }
    );
  });

  Element.Methods.getStyle = function(element, style) {
    element = $(element);
    style = (style == 'float' || style == 'cssFloat') ? 'styleFloat' : style.camelize();
    var value = element.style[style];
    if (!value && element.currentStyle) value = element.currentStyle[style];

    if (style == 'opacity') {
      if (value = (element.getStyle('filter') || '').match(/alpha\(opacity=(.*)\)/))
        if (value[1]) return parseFloat(value[1]) / 100;
      return 1.0;
    }

    if (value == 'auto') {
      if ((style == 'width' || style == 'height') && (element.getStyle('display') != 'none'))
        return element['offset' + style.capitalize()] + 'px';
      return null;
    }
    return value;
  };

  Element.Methods.setOpacity = function(element, value) {
    function stripAlpha(filter){
      return filter.replace(/alpha\([^\)]*\)/gi,'');
    }
    element = $(element);
    var currentStyle = element.currentStyle;
    if ((currentStyle && !currentStyle.hasLayout) ||
      (!currentStyle && element.style.zoom == 'normal'))
        element.style.zoom = 1;

    var filter = element.getStyle('filter'), style = element.style;
    if (value == 1 || value === '') {
      (filter = stripAlpha(filter)) ?
        style.filter = filter : style.removeAttribute('filter');
      return element;
    } else if (value < 0.00001) value = 0;
    style.filter = stripAlpha(filter) +
      'alpha(opacity=' + (value * 100) + ')';
    return element;
  };

  Element._attributeTranslations = {
    read: {
      names: {
        'class': 'className',
        'for':   'htmlFor'
      },
      values: {
        _getAttr: function(element, attribute) {
          return element.getAttribute(attribute, 2);
        },
        _getAttrNode: function(element, attribute) {
          var node = element.getAttributeNode(attribute);
          return node ? node.value : "";
        },
        _getEv: function(element, attribute) {
          attribute = element.getAttribute(attribute);
          return attribute ? attribute.toString().slice(23, -2) : null;
        },
        _flag: function(element, attribute) {
          return $(element).hasAttribute(attribute) ? attribute : null;
        },
        style: function(element) {
          return element.style.cssText.toLowerCase();
        },
        title: function(element) {
          return element.title;
        }
      }
    }
  };

  Element._attributeTranslations.write = {
    names: Object.extend({
      cellpadding: 'cellPadding',
      cellspacing: 'cellSpacing'
    }, Element._attributeTranslations.read.names),
    values: {
      checked: function(element, value) {
        element.checked = !!value;
      },

      style: function(element, value) {
        element.style.cssText = value ? value : '';
      }
    }
  };

  Element._attributeTranslations.has = {};

  $w('colSpan rowSpan vAlign dateTime accessKey tabIndex ' +
      'encType maxLength readOnly longDesc').each(function(attr) {
    Element._attributeTranslations.write.names[attr.toLowerCase()] = attr;
    Element._attributeTranslations.has[attr.toLowerCase()] = attr;
  });

  (function(v) {
    Object.extend(v, {
      href:        v._getAttr,
      src:         v._getAttr,
      type:        v._getAttr,
      action:      v._getAttrNode,
      disabled:    v._flag,
      checked:     v._flag,
      readonly:    v._flag,
      multiple:    v._flag,
      onload:      v._getEv,
      onunload:    v._getEv,
      onclick:     v._getEv,
      ondblclick:  v._getEv,
      onmousedown: v._getEv,
      onmouseup:   v._getEv,
      onmouseover: v._getEv,
      onmousemove: v._getEv,
      onmouseout:  v._getEv,
      onfocus:     v._getEv,
      onblur:      v._getEv,
      onkeypress:  v._getEv,
      onkeydown:   v._getEv,
      onkeyup:     v._getEv,
      onsubmit:    v._getEv,
      onreset:     v._getEv,
      onselect:    v._getEv,
      onchange:    v._getEv
    });
  })(Element._attributeTranslations.read.values);
}

else if (Prototype.Browser.Gecko && /rv:1\.8\.0/.test(navigator.userAgent)) {
  Element.Methods.setOpacity = function(element, value) {
    element = $(element);
    element.style.opacity = (value == 1) ? 0.999999 :
      (value === '') ? '' : (value < 0.00001) ? 0 : value;
    return element;
  };
}

else if (Prototype.Browser.WebKit) {
  Element.Methods.setOpacity = function(element, value) {
    element = $(element);
    element.style.opacity = (value == 1 || value === '') ? '' :
      (value < 0.00001) ? 0 : value;

    if (value == 1)
      if(element.tagName == 'IMG' && element.width) {
        element.width++; element.width--;
      } else try {
        var n = document.createTextNode(' ');
        element.appendChild(n);
        element.removeChild(n);
      } catch (e) { }

    return element;
  };

  // Safari returns margins on body which is incorrect if the child is absolutely
  // positioned.  For performance reasons, redefine Element#cumulativeOffset for
  // KHTML/WebKit only.
  Element.Methods.cumulativeOffset = function(element) {
    var valueT = 0, valueL = 0;
    do {
      valueT += element.offsetTop  || 0;
      valueL += element.offsetLeft || 0;
      if (element.offsetParent == document.body)
        if (Element.getStyle(element, 'position') == 'absolute') break;

      element = element.offsetParent;
    } while (element);

    return Element._returnOffset(valueL, valueT);
  };
}

if (Prototype.Browser.IE || Prototype.Browser.Opera) {
  // IE and Opera are missing .innerHTML support for TABLE-related and SELECT elements
  Element.Methods.update = function(element, content) {
    element = $(element);

    if (content && content.toElement) content = content.toElement();
    if (Object.isElement(content)) return element.update().insert(content);

    content = Object.toHTML(content);
    var tagName = element.tagName.toUpperCase();

    if (tagName in Element._insertionTranslations.tags) {
      $A(element.childNodes).each(function(node) { element.removeChild(node) });
      Element._getContentFromAnonymousElement(tagName, content.stripScripts())
        .each(function(node) { element.appendChild(node) });
    }
    else element.innerHTML = content.stripScripts();

    content.evalScripts.bind(content).defer();
    return element;
  };
}

if ('outerHTML' in document.createElement('div')) {
  Element.Methods.replace = function(element, content) {
    element = $(element);

    if (content && content.toElement) content = content.toElement();
    if (Object.isElement(content)) {
      element.parentNode.replaceChild(content, element);
      return element;
    }

    content = Object.toHTML(content);
    var parent = element.parentNode, tagName = parent.tagName.toUpperCase();

    if (Element._insertionTranslations.tags[tagName]) {
      var nextSibling = element.next();
      var fragments = Element._getContentFromAnonymousElement(tagName, content.stripScripts());
      parent.removeChild(element);
      if (nextSibling)
        fragments.each(function(node) { parent.insertBefore(node, nextSibling) });
      else
        fragments.each(function(node) { parent.appendChild(node) });
    }
    else element.outerHTML = content.stripScripts();

    content.evalScripts.bind(content).defer();
    return element;
  };
}

Element._returnOffset = function(l, t) {
  var result = [l, t];
  result.left = l;
  result.top = t;
  return result;
};

Element._getContentFromAnonymousElement = function(tagName, html) {
  var div = new Element('div'), t = Element._insertionTranslations.tags[tagName];
  if (t) {
    div.innerHTML = t[0] + html + t[1];
    t[2].times(function() { div = div.firstChild });
  } else div.innerHTML = html;
  return $A(div.childNodes);
};

Element._insertionTranslations = {
  before: function(element, node) {
    element.parentNode.insertBefore(node, element);
  },
  top: function(element, node) {
    element.insertBefore(node, element.firstChild);
  },
  bottom: function(element, node) {
    element.appendChild(node);
  },
  after: function(element, node) {
    element.parentNode.insertBefore(node, element.nextSibling);
  },
  tags: {
    TABLE:  ['<table>',                '</table>',                   1],
    TBODY:  ['<table><tbody>',         '</tbody></table>',           2],
    TR:     ['<table><tbody><tr>',     '</tr></tbody></table>',      3],
    TD:     ['<table><tbody><tr><td>', '</td></tr></tbody></table>', 4],
    SELECT: ['<select>',               '</select>',                  1]
  }
};

(function() {
  Object.extend(this.tags, {
    THEAD: this.tags.TBODY,
    TFOOT: this.tags.TBODY,
    TH:    this.tags.TD
  });
}).call(Element._insertionTranslations);

Element.Methods.Simulated = {
  hasAttribute: function(element, attribute) {
    attribute = Element._attributeTranslations.has[attribute] || attribute;
    var node = $(element).getAttributeNode(attribute);
    return node && node.specified;
  }
};

Element.Methods.ByTag = { };

Object.extend(Element, Element.Methods);

if (!Prototype.BrowserFeatures.ElementExtensions &&
    document.createElement('div').__proto__) {
  window.HTMLElement = { };
  window.HTMLElement.prototype = document.createElement('div').__proto__;
  Prototype.BrowserFeatures.ElementExtensions = true;
}

Element.extend = (function() {
  if (Prototype.BrowserFeatures.SpecificElementExtensions)
    return Prototype.K;

  var Methods = { }, ByTag = Element.Methods.ByTag;

  var extend = Object.extend(function(element) {
    if (!element || element._extendedByPrototype ||
        element.nodeType != 1 || element == window) return element;

    var methods = Object.clone(Methods),
      tagName = element.tagName, property, value;

    // extend methods for specific tags
    if (ByTag[tagName]) Object.extend(methods, ByTag[tagName]);

    for (property in methods) {
      value = methods[property];
      if (Object.isFunction(value) && !(property in element))
        element[property] = value.methodize();
    }

    element._extendedByPrototype = Prototype.emptyFunction;
    return element;

  }, {
    refresh: function() {
      // extend methods for all tags (Safari doesn't need this)
      if (!Prototype.BrowserFeatures.ElementExtensions) {
        Object.extend(Methods, Element.Methods);
        Object.extend(Methods, Element.Methods.Simulated);
      }
    }
  });

  extend.refresh();
  return extend;
})();

Element.hasAttribute = function(element, attribute) {
  if (element.hasAttribute) return element.hasAttribute(attribute);
  return Element.Methods.Simulated.hasAttribute(element, attribute);
};

Element.addMethods = function(methods) {
  var F = Prototype.BrowserFeatures, T = Element.Methods.ByTag;

  if (!methods) {
    Object.extend(Form, Form.Methods);
    Object.extend(Form.Element, Form.Element.Methods);
    Object.extend(Element.Methods.ByTag, {
      "FORM":     Object.clone(Form.Methods),
      "INPUT":    Object.clone(Form.Element.Methods),
      "SELECT":   Object.clone(Form.Element.Methods),
      "TEXTAREA": Object.clone(Form.Element.Methods)
    });
  }

  if (arguments.length == 2) {
    var tagName = methods;
    methods = arguments[1];
  }

  if (!tagName) Object.extend(Element.Methods, methods || { });
  else {
    if (Object.isArray(tagName)) tagName.each(extend);
    else extend(tagName);
  }

  function extend(tagName) {
    tagName = tagName.toUpperCase();
    if (!Element.Methods.ByTag[tagName])
      Element.Methods.ByTag[tagName] = { };
    Object.extend(Element.Methods.ByTag[tagName], methods);
  }

  function copy(methods, destination, onlyIfAbsent) {
    onlyIfAbsent = onlyIfAbsent || false;
    for (var property in methods) {
      var value = methods[property];
      if (!Object.isFunction(value)) continue;
      if (!onlyIfAbsent || !(property in destination))
        destination[property] = value.methodize();
    }
  }

  function findDOMClass(tagName) {
    var klass;
    var trans = {
      "OPTGROUP": "OptGroup", "TEXTAREA": "TextArea", "P": "Paragraph",
      "FIELDSET": "FieldSet", "UL": "UList", "OL": "OList", "DL": "DList",
      "DIR": "Directory", "H1": "Heading", "H2": "Heading", "H3": "Heading",
      "H4": "Heading", "H5": "Heading", "H6": "Heading", "Q": "Quote",
      "INS": "Mod", "DEL": "Mod", "A": "Anchor", "IMG": "Image", "CAPTION":
      "TableCaption", "COL": "TableCol", "COLGROUP": "TableCol", "THEAD":
      "TableSection", "TFOOT": "TableSection", "TBODY": "TableSection", "TR":
      "TableRow", "TH": "TableCell", "TD": "TableCell", "FRAMESET":
      "FrameSet", "IFRAME": "IFrame"
    };
    if (trans[tagName]) klass = 'HTML' + trans[tagName] + 'Element';
    if (window[klass]) return window[klass];
    klass = 'HTML' + tagName + 'Element';
    if (window[klass]) return window[klass];
    klass = 'HTML' + tagName.capitalize() + 'Element';
    if (window[klass]) return window[klass];

    window[klass] = { };
    window[klass].prototype = document.createElement(tagName).__proto__;
    return window[klass];
  }

  if (F.ElementExtensions) {
    copy(Element.Methods, HTMLElement.prototype);
    copy(Element.Methods.Simulated, HTMLElement.prototype, true);
  }

  if (F.SpecificElementExtensions) {
    for (var tag in Element.Methods.ByTag) {
      var klass = findDOMClass(tag);
      if (Object.isUndefined(klass)) continue;
      copy(T[tag], klass.prototype);
    }
  }

  Object.extend(Element, Element.Methods);
  delete Element.ByTag;

  if (Element.extend.refresh) Element.extend.refresh();
  Element.cache = { };
};

document.viewport = {
  getDimensions: function() {
    var dimensions = { };
    var B = Prototype.Browser;
    $w('width height').each(function(d) {
      var D = d.capitalize();
      dimensions[d] = (B.WebKit && !document.evaluate) ? self['inner' + D] :
        (B.Opera) ? document.body['client' + D] : document.documentElement['client' + D];
    });
    return dimensions;
  },

  getWidth: function() {
    return this.getDimensions().width;
  },

  getHeight: function() {
    return this.getDimensions().height;
  },

  getScrollOffsets: function() {
    return Element._returnOffset(
      window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft,
      window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop);
  }
};
/* Portions of the Selector class are derived from Jack Slocum’s DomQuery,
 * part of YUI-Ext version 0.40, distributed under the terms of an MIT-style
 * license.  Please see http://www.yui-ext.com/ for more information. */

var Selector = Class.create({
  initialize: function(expression) {
    this.expression = expression.strip();
    this.compileMatcher();
  },

  shouldUseXPath: function() {
    if (!Prototype.BrowserFeatures.XPath) return false;

    var e = this.expression;

    // Safari 3 chokes on :*-of-type and :empty
    if (Prototype.Browser.WebKit &&
     (e.include("-of-type") || e.include(":empty")))
      return false;

    // XPath can't do namespaced attributes, nor can it read
    // the "checked" property from DOM nodes
    if ((/(\[[\w-]*?:|:checked)/).test(this.expression))
      return false;

    return true;
  },

  compileMatcher: function() {
    if (this.shouldUseXPath())
      return this.compileXPathMatcher();

    var e = this.expression, ps = Selector.patterns, h = Selector.handlers,
        c = Selector.criteria, le, p, m;

    if (Selector._cache[e]) {
      this.matcher = Selector._cache[e];
      return;
    }

    this.matcher = ["this.matcher = function(root) {",
                    "var r = root, h = Selector.handlers, c = false, n;"];

    while (e && le != e && (/\S/).test(e)) {
      le = e;
      for (var i in ps) {
        p = ps[i];
        if (m = e.match(p)) {
          this.matcher.push(Object.isFunction(c[i]) ? c[i](m) :
    	      new Template(c[i]).evaluate(m));
          e = e.replace(m[0], '');
          break;
        }
      }
    }

    this.matcher.push("return h.unique(n);\n}");
    eval(this.matcher.join('\n'));
    Selector._cache[this.expression] = this.matcher;
  },

  compileXPathMatcher: function() {
    var e = this.expression, ps = Selector.patterns,
        x = Selector.xpath, le, m;

    if (Selector._cache[e]) {
      this.xpath = Selector._cache[e]; return;
    }

    this.matcher = ['.//*'];
    while (e && le != e && (/\S/).test(e)) {
      le = e;
      for (var i in ps) {
        if (m = e.match(ps[i])) {
          this.matcher.push(Object.isFunction(x[i]) ? x[i](m) :
            new Template(x[i]).evaluate(m));
          e = e.replace(m[0], '');
          break;
        }
      }
    }

    this.xpath = this.matcher.join('');
    Selector._cache[this.expression] = this.xpath;
  },

  findElements: function(root) {
    root = root || document;
    if (this.xpath) return document._getElementsByXPath(this.xpath, root);
    return this.matcher(root);
  },

  match: function(element) {
    this.tokens = [];

    var e = this.expression, ps = Selector.patterns, as = Selector.assertions;
    var le, p, m;

    while (e && le !== e && (/\S/).test(e)) {
      le = e;
      for (var i in ps) {
        p = ps[i];
        if (m = e.match(p)) {
          // use the Selector.assertions methods unless the selector
          // is too complex.
          if (as[i]) {
            this.tokens.push([i, Object.clone(m)]);
            e = e.replace(m[0], '');
          } else {
            // reluctantly do a document-wide search
            // and look for a match in the array
            return this.findElements(document).include(element);
          }
        }
      }
    }

    var match = true, name, matches;
    for (var i = 0, token; token = this.tokens[i]; i++) {
      name = token[0], matches = token[1];
      if (!Selector.assertions[name](element, matches)) {
        match = false; break;
      }
    }

    return match;
  },

  toString: function() {
    return this.expression;
  },

  inspect: function() {
    return "#<Selector:" + this.expression.inspect() + ">";
  }
});

Object.extend(Selector, {
  _cache: { },

  xpath: {
    descendant:   "//*",
    child:        "/*",
    adjacent:     "/following-sibling::*[1]",
    laterSibling: '/following-sibling::*',
    tagName:      function(m) {
      if (m[1] == '*') return '';
      return "[local-name()='" + m[1].toLowerCase() +
             "' or local-name()='" + m[1].toUpperCase() + "']";
    },
    className:    "[contains(concat(' ', @class, ' '), ' #{1} ')]",
    id:           "[@id='#{1}']",
    attrPresence: function(m) {
      m[1] = m[1].toLowerCase();
      return new Template("[@#{1}]").evaluate(m);
    },
    attr: function(m) {
      m[1] = m[1].toLowerCase();
      m[3] = m[5] || m[6];
      return new Template(Selector.xpath.operators[m[2]]).evaluate(m);
    },
    pseudo: function(m) {
      var h = Selector.xpath.pseudos[m[1]];
      if (!h) return '';
      if (Object.isFunction(h)) return h(m);
      return new Template(Selector.xpath.pseudos[m[1]]).evaluate(m);
    },
    operators: {
      '=':  "[@#{1}='#{3}']",
      '!=': "[@#{1}!='#{3}']",
      '^=': "[starts-with(@#{1}, '#{3}')]",
      '$=': "[substring(@#{1}, (string-length(@#{1}) - string-length('#{3}') + 1))='#{3}']",
      '*=': "[contains(@#{1}, '#{3}')]",
      '~=': "[contains(concat(' ', @#{1}, ' '), ' #{3} ')]",
      '|=': "[contains(concat('-', @#{1}, '-'), '-#{3}-')]"
    },
    pseudos: {
      'first-child': '[not(preceding-sibling::*)]',
      'last-child':  '[not(following-sibling::*)]',
      'only-child':  '[not(preceding-sibling::* or following-sibling::*)]',
      'empty':       "[count(*) = 0 and (count(text()) = 0 or translate(text(), ' \t\r\n', '') = '')]",
      'checked':     "[@checked]",
      'disabled':    "[@disabled]",
      'enabled':     "[not(@disabled)]",
      'not': function(m) {
        var e = m[6], p = Selector.patterns,
            x = Selector.xpath, le, v;

        var exclusion = [];
        while (e && le != e && (/\S/).test(e)) {
          le = e;
          for (var i in p) {
            if (m = e.match(p[i])) {
              v = Object.isFunction(x[i]) ? x[i](m) : new Template(x[i]).evaluate(m);
              exclusion.push("(" + v.substring(1, v.length - 1) + ")");
              e = e.replace(m[0], '');
              break;
            }
          }
        }
        return "[not(" + exclusion.join(" and ") + ")]";
      },
      'nth-child':      function(m) {
        return Selector.xpath.pseudos.nth("(count(./preceding-sibling::*) + 1) ", m);
      },
      'nth-last-child': function(m) {
        return Selector.xpath.pseudos.nth("(count(./following-sibling::*) + 1) ", m);
      },
      'nth-of-type':    function(m) {
        return Selector.xpath.pseudos.nth("position() ", m);
      },
      'nth-last-of-type': function(m) {
        return Selector.xpath.pseudos.nth("(last() + 1 - position()) ", m);
      },
      'first-of-type':  function(m) {
        m[6] = "1"; return Selector.xpath.pseudos['nth-of-type'](m);
      },
      'last-of-type':   function(m) {
        m[6] = "1"; return Selector.xpath.pseudos['nth-last-of-type'](m);
      },
      'only-of-type':   function(m) {
        var p = Selector.xpath.pseudos; return p['first-of-type'](m) + p['last-of-type'](m);
      },
      nth: function(fragment, m) {
        var mm, formula = m[6], predicate;
        if (formula == 'even') formula = '2n+0';
        if (formula == 'odd')  formula = '2n+1';
        if (mm = formula.match(/^(\d+)$/)) // digit only
          return '[' + fragment + "= " + mm[1] + ']';
        if (mm = formula.match(/^(-?\d*)?n(([+-])(\d+))?/)) { // an+b
          if (mm[1] == "-") mm[1] = -1;
          var a = mm[1] ? Number(mm[1]) : 1;
          var b = mm[2] ? Number(mm[2]) : 0;
          predicate = "[((#{fragment} - #{b}) mod #{a} = 0) and " +
          "((#{fragment} - #{b}) div #{a} >= 0)]";
          return new Template(predicate).evaluate({
            fragment: fragment, a: a, b: b });
        }
      }
    }
  },

  criteria: {
    tagName:      'n = h.tagName(n, r, "#{1}", c);      c = false;',
    className:    'n = h.className(n, r, "#{1}", c);    c = false;',
    id:           'n = h.id(n, r, "#{1}", c);           c = false;',
    attrPresence: 'n = h.attrPresence(n, r, "#{1}", c); c = false;',
    attr: function(m) {
      m[3] = (m[5] || m[6]);
      return new Template('n = h.attr(n, r, "#{1}", "#{3}", "#{2}", c); c = false;').evaluate(m);
    },
    pseudo: function(m) {
      if (m[6]) m[6] = m[6].replace(/"/g, '\\"');
      return new Template('n = h.pseudo(n, "#{1}", "#{6}", r, c); c = false;').evaluate(m);
    },
    descendant:   'c = "descendant";',
    child:        'c = "child";',
    adjacent:     'c = "adjacent";',
    laterSibling: 'c = "laterSibling";'
  },

  patterns: {
    // combinators must be listed first
    // (and descendant needs to be last combinator)
    laterSibling: /^\s*~\s*/,
    child:        /^\s*>\s*/,
    adjacent:     /^\s*\+\s*/,
    descendant:   /^\s/,

    // selectors follow
    tagName:      /^\s*(\*|[\w\-]+)(\b|$)?/,
    id:           /^#([\w\-\*]+)(\b|$)/,
    className:    /^\.([\w\-\*]+)(\b|$)/,
    pseudo:
/^:((first|last|nth|nth-last|only)(-child|-of-type)|empty|checked|(en|dis)abled|not)(\((.*?)\))?(\b|$|(?=\s|[:+~>]))/,
    attrPresence: /^\[([\w]+)\]/,
    attr:         /\[((?:[\w-]*:)?[\w-]+)\s*(?:([!^$*~|]?=)\s*((['"])([^\4]*?)\4|([^'"][^\]]*?)))?\]/
  },

  // for Selector.match and Element#match
  assertions: {
    tagName: function(element, matches) {
      return matches[1].toUpperCase() == element.tagName.toUpperCase();
    },

    className: function(element, matches) {
      return Element.hasClassName(element, matches[1]);
    },

    id: function(element, matches) {
      return element.id === matches[1];
    },

    attrPresence: function(element, matches) {
      return Element.hasAttribute(element, matches[1]);
    },

    attr: function(element, matches) {
      var nodeValue = Element.readAttribute(element, matches[1]);
      return nodeValue && Selector.operators[matches[2]](nodeValue, matches[5] || matches[6]);
    }
  },

  handlers: {
    // UTILITY FUNCTIONS
    // joins two collections
    concat: function(a, b) {
      for (var i = 0, node; node = b[i]; i++)
        a.push(node);
      return a;
    },

    // marks an array of nodes for counting
    mark: function(nodes) {
      var _true = Prototype.emptyFunction;
      for (var i = 0, node; node = nodes[i]; i++)
        node._countedByPrototype = _true;
      return nodes;
    },

    unmark: function(nodes) {
      for (var i = 0, node; node = nodes[i]; i++)
        node._countedByPrototype = undefined;
      return nodes;
    },

    // mark each child node with its position (for nth calls)
    // "ofType" flag indicates whether we're indexing for nth-of-type
    // rather than nth-child
    index: function(parentNode, reverse, ofType) {
      parentNode._countedByPrototype = Prototype.emptyFunction;
      if (reverse) {
        for (var nodes = parentNode.childNodes, i = nodes.length - 1, j = 1; i >= 0; i--) {
          var node = nodes[i];
          if (node.nodeType == 1 && (!ofType || node._countedByPrototype)) node.nodeIndex = j++;
        }
      } else {
        for (var i = 0, j = 1, nodes = parentNode.childNodes; node = nodes[i]; i++)
          if (node.nodeType == 1 && (!ofType || node._countedByPrototype)) node.nodeIndex = j++;
      }
    },

    // filters out duplicates and extends all nodes
    unique: function(nodes) {
      if (nodes.length == 0) return nodes;
      var results = [], n;
      for (var i = 0, l = nodes.length; i < l; i++)
        if (!(n = nodes[i])._countedByPrototype) {
          n._countedByPrototype = Prototype.emptyFunction;
          results.push(Element.extend(n));
        }
      return Selector.handlers.unmark(results);
    },

    // COMBINATOR FUNCTIONS
    descendant: function(nodes) {
      var h = Selector.handlers;
      for (var i = 0, results = [], node; node = nodes[i]; i++)
        h.concat(results, node.getElementsByTagName('*'));
      return results;
    },

    child: function(nodes) {
      var h = Selector.handlers;
      for (var i = 0, results = [], node; node = nodes[i]; i++) {
        for (var j = 0, child; child = node.childNodes[j]; j++)
          if (child.nodeType == 1 && child.tagName != '!') results.push(child);
      }
      return results;
    },

    adjacent: function(nodes) {
      for (var i = 0, results = [], node; node = nodes[i]; i++) {
        var next = this.nextElementSibling(node);
        if (next) results.push(next);
      }
      return results;
    },

    laterSibling: function(nodes) {
      var h = Selector.handlers;
      for (var i = 0, results = [], node; node = nodes[i]; i++)
        h.concat(results, Element.nextSiblings(node));
      return results;
    },

    nextElementSibling: function(node) {
      while (node = node.nextSibling)
	      if (node.nodeType == 1) return node;
      return null;
    },

    previousElementSibling: function(node) {
      while (node = node.previousSibling)
        if (node.nodeType == 1) return node;
      return null;
    },

    // TOKEN FUNCTIONS
    tagName: function(nodes, root, tagName, combinator) {
      var uTagName = tagName.toUpperCase();
      var results = [], h = Selector.handlers;
      if (nodes) {
        if (combinator) {
          // fastlane for ordinary descendant combinators
          if (combinator == "descendant") {
            for (var i = 0, node; node = nodes[i]; i++)
              h.concat(results, node.getElementsByTagName(tagName));
            return results;
          } else nodes = this[combinator](nodes);
          if (tagName == "*") return nodes;
        }
        for (var i = 0, node; node = nodes[i]; i++)
          if (node.tagName.toUpperCase() === uTagName) results.push(node);
        return results;
      } else return root.getElementsByTagName(tagName);
    },

    id: function(nodes, root, id, combinator) {
      var targetNode = $(id), h = Selector.handlers;
      if (!targetNode) return [];
      if (!nodes && root == document) return [targetNode];
      if (nodes) {
        if (combinator) {
          if (combinator == 'child') {
            for (var i = 0, node; node = nodes[i]; i++)
              if (targetNode.parentNode == node) return [targetNode];
          } else if (combinator == 'descendant') {
            for (var i = 0, node; node = nodes[i]; i++)
              if (Element.descendantOf(targetNode, node)) return [targetNode];
          } else if (combinator == 'adjacent') {
            for (var i = 0, node; node = nodes[i]; i++)
              if (Selector.handlers.previousElementSibling(targetNode) == node)
                return [targetNode];
          } else nodes = h[combinator](nodes);
        }
        for (var i = 0, node; node = nodes[i]; i++)
          if (node == targetNode) return [targetNode];
        return [];
      }
      return (targetNode && Element.descendantOf(targetNode, root)) ? [targetNode] : [];
    },

    className: function(nodes, root, className, combinator) {
      if (nodes && combinator) nodes = this[combinator](nodes);
      return Selector.handlers.byClassName(nodes, root, className);
    },

    byClassName: function(nodes, root, className) {
      if (!nodes) nodes = Selector.handlers.descendant([root]);
      var needle = ' ' + className + ' ';
      for (var i = 0, results = [], node, nodeClassName; node = nodes[i]; i++) {
        nodeClassName = node.className;
        if (nodeClassName.length == 0) continue;
        if (nodeClassName == className || (' ' + nodeClassName + ' ').include(needle))
          results.push(node);
      }
      return results;
    },

    attrPresence: function(nodes, root, attr, combinator) {
      if (!nodes) nodes = root.getElementsByTagName("*");
      if (nodes && combinator) nodes = this[combinator](nodes);
      var results = [];
      for (var i = 0, node; node = nodes[i]; i++)
        if (Element.hasAttribute(node, attr)) results.push(node);
      return results;
    },

    attr: function(nodes, root, attr, value, operator, combinator) {
      if (!nodes) nodes = root.getElementsByTagName("*");
      if (nodes && combinator) nodes = this[combinator](nodes);
      var handler = Selector.operators[operator], results = [];
      for (var i = 0, node; node = nodes[i]; i++) {
        var nodeValue = Element.readAttribute(node, attr);
        if (nodeValue === null) continue;
        if (handler(nodeValue, value)) results.push(node);
      }
      return results;
    },

    pseudo: function(nodes, name, value, root, combinator) {
      if (nodes && combinator) nodes = this[combinator](nodes);
      if (!nodes) nodes = root.getElementsByTagName("*");
      return Selector.pseudos[name](nodes, value, root);
    }
  },

  pseudos: {
    'first-child': function(nodes, value, root) {
      for (var i = 0, results = [], node; node = nodes[i]; i++) {
        if (Selector.handlers.previousElementSibling(node)) continue;
          results.push(node);
      }
      return results;
    },
    'last-child': function(nodes, value, root) {
      for (var i = 0, results = [], node; node = nodes[i]; i++) {
        if (Selector.handlers.nextElementSibling(node)) continue;
          results.push(node);
      }
      return results;
    },
    'only-child': function(nodes, value, root) {
      var h = Selector.handlers;
      for (var i = 0, results = [], node; node = nodes[i]; i++)
        if (!h.previousElementSibling(node) && !h.nextElementSibling(node))
          results.push(node);
      return results;
    },
    'nth-child':        function(nodes, formula, root) {
      return Selector.pseudos.nth(nodes, formula, root);
    },
    'nth-last-child':   function(nodes, formula, root) {
      return Selector.pseudos.nth(nodes, formula, root, true);
    },
    'nth-of-type':      function(nodes, formula, root) {
      return Selector.pseudos.nth(nodes, formula, root, false, true);
    },
    'nth-last-of-type': function(nodes, formula, root) {
      return Selector.pseudos.nth(nodes, formula, root, true, true);
    },
    'first-of-type':    function(nodes, formula, root) {
      return Selector.pseudos.nth(nodes, "1", root, false, true);
    },
    'last-of-type':     function(nodes, formula, root) {
      return Selector.pseudos.nth(nodes, "1", root, true, true);
    },
    'only-of-type':     function(nodes, formula, root) {
      var p = Selector.pseudos;
      return p['last-of-type'](p['first-of-type'](nodes, formula, root), formula, root);
    },

    // handles the an+b logic
    getIndices: function(a, b, total) {
      if (a == 0) return b > 0 ? [b] : [];
      return $R(1, total).inject([], function(memo, i) {
        if (0 == (i - b) % a && (i - b) / a >= 0) memo.push(i);
        return memo;
      });
    },

    // handles nth(-last)-child, nth(-last)-of-type, and (first|last)-of-type
    nth: function(nodes, formula, root, reverse, ofType) {
      if (nodes.length == 0) return [];
      if (formula == 'even') formula = '2n+0';
      if (formula == 'odd')  formula = '2n+1';
      var h = Selector.handlers, results = [], indexed = [], m;
      h.mark(nodes);
      for (var i = 0, node; node = nodes[i]; i++) {
        if (!node.parentNode._countedByPrototype) {
          h.index(node.parentNode, reverse, ofType);
          indexed.push(node.parentNode);
        }
      }
      if (formula.match(/^\d+$/)) { // just a number
        formula = Number(formula);
        for (var i = 0, node; node = nodes[i]; i++)
          if (node.nodeIndex == formula) results.push(node);
      } else if (m = formula.match(/^(-?\d*)?n(([+-])(\d+))?/)) { // an+b
        if (m[1] == "-") m[1] = -1;
        var a = m[1] ? Number(m[1]) : 1;
        var b = m[2] ? Number(m[2]) : 0;
        var indices = Selector.pseudos.getIndices(a, b, nodes.length);
        for (var i = 0, node, l = indices.length; node = nodes[i]; i++) {
          for (var j = 0; j < l; j++)
            if (node.nodeIndex == indices[j]) results.push(node);
        }
      }
      h.unmark(nodes);
      h.unmark(indexed);
      return results;
    },

    'empty': function(nodes, value, root) {
      for (var i = 0, results = [], node; node = nodes[i]; i++) {
        // IE treats comments as element nodes
        if (node.tagName == '!' || (node.firstChild && !node.innerHTML.match(/^\s*$/))) continue;
        results.push(node);
      }
      return results;
    },

    'not': function(nodes, selector, root) {
      var h = Selector.handlers, selectorType, m;
      var exclusions = new Selector(selector).findElements(root);
      h.mark(exclusions);
      for (var i = 0, results = [], node; node = nodes[i]; i++)
        if (!node._countedByPrototype) results.push(node);
      h.unmark(exclusions);
      return results;
    },

    'enabled': function(nodes, value, root) {
      for (var i = 0, results = [], node; node = nodes[i]; i++)
        if (!node.disabled) results.push(node);
      return results;
    },

    'disabled': function(nodes, value, root) {
      for (var i = 0, results = [], node; node = nodes[i]; i++)
        if (node.disabled) results.push(node);
      return results;
    },

    'checked': function(nodes, value, root) {
      for (var i = 0, results = [], node; node = nodes[i]; i++)
        if (node.checked) results.push(node);
      return results;
    }
  },

  operators: {
    '=':  function(nv, v) { return nv == v; },
    '!=': function(nv, v) { return nv != v; },
    '^=': function(nv, v) { return nv.startsWith(v); },
    '$=': function(nv, v) { return nv.endsWith(v); },
    '*=': function(nv, v) { return nv.include(v); },
    '~=': function(nv, v) { return (' ' + nv + ' ').include(' ' + v + ' '); },
    '|=': function(nv, v) { return ('-' + nv.toUpperCase() + '-').include('-' + v.toUpperCase() + '-'); }
  },

  split: function(expression) {
    var expressions = [];
    expression.scan(/(([\w#:.~>+()\s-]+|\*|\[.*?\])+)\s*(,|$)/, function(m) {
      expressions.push(m[1].strip());
    });
    return expressions;
  },

  matchElements: function(elements, expression) {
    var matches = $$(expression), h = Selector.handlers;
    h.mark(matches);
    for (var i = 0, results = [], element; element = elements[i]; i++)
      if (element._countedByPrototype) results.push(element);
    h.unmark(matches);
    return results;
  },

  findElement: function(elements, expression, index) {
    if (Object.isNumber(expression)) {
      index = expression; expression = false;
    }
    return Selector.matchElements(elements, expression || '*')[index || 0];
  },

  findChildElements: function(element, expressions) {
    expressions = Selector.split(expressions.join(','));
    var results = [], h = Selector.handlers;
    for (var i = 0, l = expressions.length, selector; i < l; i++) {
      selector = new Selector(expressions[i].strip());
      h.concat(results, selector.findElements(element));
    }
    return (l > 1) ? h.unique(results) : results;
  }
});

if (Prototype.Browser.IE) {
  Object.extend(Selector.handlers, {
    // IE returns comment nodes on getElementsByTagName("*").
    // Filter them out.
    concat: function(a, b) {
      for (var i = 0, node; node = b[i]; i++)
        if (node.tagName !== "!") a.push(node);
      return a;
    },

    // IE improperly serializes _countedByPrototype in (inner|outer)HTML.
    unmark: function(nodes) {
      for (var i = 0, node; node = nodes[i]; i++)
        node.removeAttribute('_countedByPrototype');
      return nodes;
    }
  });
}

function $$() {
  return Selector.findChildElements(document, $A(arguments));
}
var Form = {
  reset: function(form) {
    $(form).reset();
    return form;
  },

  serializeElements: function(elements, options) {
    if (typeof options != 'object') options = { hash: !!options };
    else if (Object.isUndefined(options.hash)) options.hash = true;
    var key, value, submitted = false, submit = options.submit;

    var data = elements.inject({ }, function(result, element) {
      if (!element.disabled && element.name) {
        key = element.name; value = $(element).getValue();
        if (value != null && (element.type != 'submit' || (!submitted &&
            submit !== false && (!submit || key == submit) && (submitted = true)))) {
          if (key in result) {
            // a key is already present; construct an array of values
            if (!Object.isArray(result[key])) result[key] = [result[key]];
            result[key].push(value);
          }
          else result[key] = value;
        }
      }
      return result;
    });

    return options.hash ? data : Object.toQueryString(data);
  }
};

Form.Methods = {
  serialize: function(form, options) {
    return Form.serializeElements(Form.getElements(form), options);
  },

  getElements: function(form) {
    return $A($(form).getElementsByTagName('*')).inject([],
      function(elements, child) {
        if (Form.Element.Serializers[child.tagName.toLowerCase()])
          elements.push(Element.extend(child));
        return elements;
      }
    );
  },

  getInputs: function(form, typeName, name) {
    form = $(form);
    var inputs = form.getElementsByTagName('input');

    if (!typeName && !name) return $A(inputs).map(Element.extend);

    for (var i = 0, matchingInputs = [], length = inputs.length; i < length; i++) {
      var input = inputs[i];
      if ((typeName && input.type != typeName) || (name && input.name != name))
        continue;
      matchingInputs.push(Element.extend(input));
    }

    return matchingInputs;
  },

  disable: function(form) {
    form = $(form);
    Form.getElements(form).invoke('disable');
    return form;
  },

  enable: function(form) {
    form = $(form);
    Form.getElements(form).invoke('enable');
    return form;
  },

  findFirstElement: function(form) {
    var elements = $(form).getElements().findAll(function(element) {
      return 'hidden' != element.type && !element.disabled;
    });
    var firstByIndex = elements.findAll(function(element) {
      return element.hasAttribute('tabIndex') && element.tabIndex >= 0;
    }).sortBy(function(element) { return element.tabIndex }).first();

    return firstByIndex ? firstByIndex : elements.find(function(element) {
      return ['input', 'select', 'textarea'].include(element.tagName.toLowerCase());
    });
  },

  focusFirstElement: function(form) {
    form = $(form);
    form.findFirstElement().activate();
    return form;
  },

  request: function(form, options) {
    form = $(form), options = Object.clone(options || { });

    var params = options.parameters, action = form.readAttribute('action') || '';
    if (action.blank()) action = window.location.href;
    options.parameters = form.serialize(true);

    if (params) {
      if (Object.isString(params)) params = params.toQueryParams();
      Object.extend(options.parameters, params);
    }

    if (form.hasAttribute('method') && !options.method)
      options.method = form.method;

    return new Ajax.Request(action, options);
  }
};

/*--------------------------------------------------------------------------*/

Form.Element = {
  focus: function(element) {
    $(element).focus();
    return element;
  },

  select: function(element) {
    $(element).select();
    return element;
  }
};

Form.Element.Methods = {
  serialize: function(element) {
    element = $(element);
    if (!element.disabled && element.name) {
      var value = element.getValue();
      if (value != undefined) {
        var pair = { };
        pair[element.name] = value;
        return Object.toQueryString(pair);
      }
    }
    return '';
  },

  getValue: function(element) {
    element = $(element);
    var method = element.tagName.toLowerCase();
    return Form.Element.Serializers[method](element);
  },

  setValue: function(element, value) {
    element = $(element);
    var method = element.tagName.toLowerCase();
    Form.Element.Serializers[method](element, value);
    return element;
  },

  clear: function(element) {
    $(element).value = '';
    return element;
  },

  present: function(element) {
    return $(element).value != '';
  },

  activate: function(element) {
    element = $(element);
    try {
      element.focus();
      if (element.select && (element.tagName.toLowerCase() != 'input' ||
          !['button', 'reset', 'submit'].include(element.type)))
        element.select();
    } catch (e) { }
    return element;
  },

  disable: function(element) {
    element = $(element);
    element.blur();
    element.disabled = true;
    return element;
  },

  enable: function(element) {
    element = $(element);
    element.disabled = false;
    return element;
  }
};

/*--------------------------------------------------------------------------*/

var Field = Form.Element;
var $F = Form.Element.Methods.getValue;

/*--------------------------------------------------------------------------*/

Form.Element.Serializers = {
  input: function(element, value) {
    switch (element.type.toLowerCase()) {
      case 'checkbox':
      case 'radio':
        return Form.Element.Serializers.inputSelector(element, value);
      default:
        return Form.Element.Serializers.textarea(element, value);
    }
  },

  inputSelector: function(element, value) {
    if (Object.isUndefined(value)) return element.checked ? element.value : null;
    else element.checked = !!value;
  },

  textarea: function(element, value) {
    if (Object.isUndefined(value)) return element.value;
    else element.value = value;
  },

  select: function(element, index) {
    if (Object.isUndefined(index))
      return this[element.type == 'select-one' ?
        'selectOne' : 'selectMany'](element);
    else {
      var opt, value, single = !Object.isArray(index);
      for (var i = 0, length = element.length; i < length; i++) {
        opt = element.options[i];
        value = this.optionValue(opt);
        if (single) {
          if (value == index) {
            opt.selected = true;
            return;
          }
        }
        else opt.selected = index.include(value);
      }
    }
  },

  selectOne: function(element) {
    var index = element.selectedIndex;
    return index >= 0 ? this.optionValue(element.options[index]) : null;
  },

  selectMany: function(element) {
    var values, length = element.length;
    if (!length) return null;

    for (var i = 0, values = []; i < length; i++) {
      var opt = element.options[i];
      if (opt.selected) values.push(this.optionValue(opt));
    }
    return values;
  },

  optionValue: function(opt) {
    // extend element because hasAttribute may not be native
    return Element.extend(opt).hasAttribute('value') ? opt.value : opt.text;
  }
};

/*--------------------------------------------------------------------------*/

Abstract.TimedObserver = Class.create(PeriodicalExecuter, {
  initialize: function($super, element, frequency, callback) {
    $super(callback, frequency);
    this.element   = $(element);
    this.lastValue = this.getValue();
  },

  execute: function() {
    var value = this.getValue();
    if (Object.isString(this.lastValue) && Object.isString(value) ?
        this.lastValue != value : String(this.lastValue) != String(value)) {
      this.callback(this.element, value);
      this.lastValue = value;
    }
  }
});

Form.Element.Observer = Class.create(Abstract.TimedObserver, {
  getValue: function() {
    return Form.Element.getValue(this.element);
  }
});

Form.Observer = Class.create(Abstract.TimedObserver, {
  getValue: function() {
    return Form.serialize(this.element);
  }
});

/*--------------------------------------------------------------------------*/

Abstract.EventObserver = Class.create({
  initialize: function(element, callback) {
    this.element  = $(element);
    this.callback = callback;

    this.lastValue = this.getValue();
    if (this.element.tagName.toLowerCase() == 'form')
      this.registerFormCallbacks();
    else
      this.registerCallback(this.element);
  },

  onElementEvent: function() {
    var value = this.getValue();
    if (this.lastValue != value) {
      this.callback(this.element, value);
      this.lastValue = value;
    }
  },

  registerFormCallbacks: function() {
    Form.getElements(this.element).each(this.registerCallback, this);
  },

  registerCallback: function(element) {
    if (element.type) {
      switch (element.type.toLowerCase()) {
        case 'checkbox':
        case 'radio':
          Event.observe(element, 'click', this.onElementEvent.bind(this));
          break;
        default:
          Event.observe(element, 'change', this.onElementEvent.bind(this));
          break;
      }
    }
  }
});

Form.Element.EventObserver = Class.create(Abstract.EventObserver, {
  getValue: function() {
    return Form.Element.getValue(this.element);
  }
});

Form.EventObserver = Class.create(Abstract.EventObserver, {
  getValue: function() {
    return Form.serialize(this.element);
  }
});
if (!window.Event) var Event = { };

Object.extend(Event, {
  KEY_BACKSPACE: 8,
  KEY_TAB:       9,
  KEY_RETURN:   13,
  KEY_ESC:      27,
  KEY_LEFT:     37,
  KEY_UP:       38,
  KEY_RIGHT:    39,
  KEY_DOWN:     40,
  KEY_DELETE:   46,
  KEY_HOME:     36,
  KEY_END:      35,
  KEY_PAGEUP:   33,
  KEY_PAGEDOWN: 34,
  KEY_INSERT:   45,

  cache: { },

  relatedTarget: function(event) {
    var element;
    switch(event.type) {
      case 'mouseover': element = event.fromElement; break;
      case 'mouseout':  element = event.toElement;   break;
      default: return null;
    }
    return Element.extend(element);
  }
});

Event.Methods = (function() {
  var isButton;

  if (Prototype.Browser.IE) {
    var buttonMap = { 0: 1, 1: 4, 2: 2 };
    isButton = function(event, code) {
      return event.button == buttonMap[code];
    };

  } else if (Prototype.Browser.WebKit) {
    isButton = function(event, code) {
      switch (code) {
        case 0: return event.which == 1 && !event.metaKey;
        case 1: return event.which == 1 && event.metaKey;
        default: return false;
      }
    };

  } else {
    isButton = function(event, code) {
      return event.which ? (event.which === code + 1) : (event.button === code);
    };
  }

  return {
    isLeftClick:   function(event) { return isButton(event, 0) },
    isMiddleClick: function(event) { return isButton(event, 1) },
    isRightClick:  function(event) { return isButton(event, 2) },

    element: function(event) {
      var node = Event.extend(event).target;
      return Element.extend(node.nodeType == Node.TEXT_NODE ? node.parentNode : node);
    },

    findElement: function(event, expression) {
      var element = Event.element(event);
      if (!expression) return element;
      var elements = [element].concat(element.ancestors());
      return Selector.findElement(elements, expression, 0);
    },

    pointer: function(event) {
      return {
        x: event.pageX || (event.clientX +
          (document.documentElement.scrollLeft || document.body.scrollLeft)),
        y: event.pageY || (event.clientY +
          (document.documentElement.scrollTop || document.body.scrollTop))
      };
    },

    pointerX: function(event) { return Event.pointer(event).x },
    pointerY: function(event) { return Event.pointer(event).y },

    stop: function(event) {
      Event.extend(event);
      event.preventDefault();
      event.stopPropagation();
      event.stopped = true;
    }
  };
})();

Event.extend = (function() {
  var methods = Object.keys(Event.Methods).inject({ }, function(m, name) {
    m[name] = Event.Methods[name].methodize();
    return m;
  });

  if (Prototype.Browser.IE) {
    Object.extend(methods, {
      stopPropagation: function() { this.cancelBubble = true },
      preventDefault:  function() { this.returnValue = false },
      inspect: function() { return "[object Event]" }
    });

    return function(event) {
      if (!event) return false;
      if (event._extendedByPrototype) return event;

      event._extendedByPrototype = Prototype.emptyFunction;
      var pointer = Event.pointer(event);
      Object.extend(event, {
        target: event.srcElement,
        relatedTarget: Event.relatedTarget(event),
        pageX:  pointer.x,
        pageY:  pointer.y
      });
      return Object.extend(event, methods);
    };

  } else {
    Event.prototype = Event.prototype || document.createEvent("HTMLEvents").__proto__;
    Object.extend(Event.prototype, methods);
    return Prototype.K;
  }
})();

Object.extend(Event, (function() {
  var cache = Event.cache;

  function getEventID(element) {
    if (element._prototypeEventID) return element._prototypeEventID[0];
    arguments.callee.id = arguments.callee.id || 1;
    return element._prototypeEventID = [++arguments.callee.id];
  }

  function getDOMEventName(eventName) {
    if (eventName && eventName.include(':')) return "dataavailable";
    return eventName;
  }

  function getCacheForID(id) {
    return cache[id] = cache[id] || { };
  }

  function getWrappersForEventName(id, eventName) {
    var c = getCacheForID(id);
    return c[eventName] = c[eventName] || [];
  }

  function createWrapper(element, eventName, handler) {
    var id = getEventID(element);
    var c = getWrappersForEventName(id, eventName);
    if (c.pluck("handler").include(handler)) return false;

    var wrapper = function(event) {
      if (!Event || !Event.extend ||
        (event.eventName && event.eventName != eventName))
          return false;

      Event.extend(event);
      handler.call(element, event);
    };

    wrapper.handler = handler;
    c.push(wrapper);
    return wrapper;
  }

  function findWrapper(id, eventName, handler) {
    var c = getWrappersForEventName(id, eventName);
    return c.find(function(wrapper) { return wrapper.handler == handler });
  }

  function destroyWrapper(id, eventName, handler) {
    var c = getCacheForID(id);
    if (!c[eventName]) return false;
    c[eventName] = c[eventName].without(findWrapper(id, eventName, handler));
  }

  function destroyCache() {
    for (var id in cache)
      for (var eventName in cache[id])
        cache[id][eventName] = null;
  }

  if (window.attachEvent) {
    window.attachEvent("onunload", destroyCache);
  }

  return {
    observe: function(element, eventName, handler) {
      element = $(element);
      var name = getDOMEventName(eventName);

      var wrapper = createWrapper(element, eventName, handler);
      if (!wrapper) return element;

      if (element.addEventListener) {
        element.addEventListener(name, wrapper, false);
      } else {
        element.attachEvent("on" + name, wrapper);
      }

      return element;
    },

    stopObserving: function(element, eventName, handler) {
      element = $(element);
      var id = getEventID(element), name = getDOMEventName(eventName);

      if (!handler && eventName) {
        getWrappersForEventName(id, eventName).each(function(wrapper) {
          element.stopObserving(eventName, wrapper.handler);
        });
        return element;

      } else if (!eventName) {
        Object.keys(getCacheForID(id)).each(function(eventName) {
          element.stopObserving(eventName);
        });
        return element;
      }

      var wrapper = findWrapper(id, eventName, handler);
      if (!wrapper) return element;

      if (element.removeEventListener) {
        element.removeEventListener(name, wrapper, false);
      } else {
        element.detachEvent("on" + name, wrapper);
      }

      destroyWrapper(id, eventName, handler);

      return element;
    },

    fire: function(element, eventName, memo) {
      element = $(element);
      if (element == document && document.createEvent && !element.dispatchEvent)
        element = document.documentElement;

      var event;
      if (document.createEvent) {
        event = document.createEvent("HTMLEvents");
        event.initEvent("dataavailable", true, true);
      } else {
        event = document.createEventObject();
        event.eventType = "ondataavailable";
      }

      event.eventName = eventName;
      event.memo = memo || { };

      if (document.createEvent) {
        element.dispatchEvent(event);
      } else {
        element.fireEvent(event.eventType, event);
      }

      return Event.extend(event);
    }
  };
})());

Object.extend(Event, Event.Methods);

Element.addMethods({
  fire:          Event.fire,
  observe:       Event.observe,
  stopObserving: Event.stopObserving
});

Object.extend(document, {
  fire:          Element.Methods.fire.methodize(),
  observe:       Element.Methods.observe.methodize(),
  stopObserving: Element.Methods.stopObserving.methodize(),
  loaded:        false
});

(function() {
  /* Support for the DOMContentLoaded event is based on work by Dan Webb,
     Matthias Miller, Dean Edwards and John Resig. */

  var timer;

  function fireContentLoadedEvent() {
    if (document.loaded) return;
    if (timer) window.clearInterval(timer);
    document.fire("dom:loaded");
    document.loaded = true;
  }

  if (document.addEventListener) {
    if (Prototype.Browser.WebKit) {
      timer = window.setInterval(function() {
        if (/loaded|complete/.test(document.readyState))
          fireContentLoadedEvent();
      }, 0);

      Event.observe(window, "load", fireContentLoadedEvent);

    } else {
      document.addEventListener("DOMContentLoaded",
        fireContentLoadedEvent, false);
    }

  } else {
    document.write("<script id=__onDOMContentLoaded defer src=//:><\/script>");
    $("__onDOMContentLoaded").onreadystatechange = function() {
      if (this.readyState == "complete") {
        this.onreadystatechange = null;
        fireContentLoadedEvent();
      }
    };
  }
})();
/*------------------------------- DEPRECATED -------------------------------*/

Hash.toQueryString = Object.toQueryString;

var Toggle = { display: Element.toggle };

Element.Methods.childOf = Element.Methods.descendantOf;

var Insertion = {
  Before: function(element, content) {
    return Element.insert(element, {before:content});
  },

  Top: function(element, content) {
    return Element.insert(element, {top:content});
  },

  Bottom: function(element, content) {
    return Element.insert(element, {bottom:content});
  },

  After: function(element, content) {
    return Element.insert(element, {after:content});
  }
};

var $continue = new Error('"throw $continue" is deprecated, use "return" instead');

// This should be moved to script.aculo.us; notice the deprecated methods
// further below, that map to the newer Element methods.
var Position = {
  // set to true if needed, warning: firefox performance problems
  // NOT neeeded for page scrolling, only if draggable contained in
  // scrollable elements
  includeScrollOffsets: false,

  // must be called before calling withinIncludingScrolloffset, every time the
  // page is scrolled
  prepare: function() {
    this.deltaX =  window.pageXOffset
                || document.documentElement.scrollLeft
                || document.body.scrollLeft
                || 0;
    this.deltaY =  window.pageYOffset
                || document.documentElement.scrollTop
                || document.body.scrollTop
                || 0;
  },

  // caches x/y coordinate pair to use with overlap
  within: function(element, x, y) {
    if (this.includeScrollOffsets)
      return this.withinIncludingScrolloffsets(element, x, y);
    this.xcomp = x;
    this.ycomp = y;
    this.offset = Element.cumulativeOffset(element);

    return (y >= this.offset[1] &&
            y <  this.offset[1] + element.offsetHeight &&
            x >= this.offset[0] &&
            x <  this.offset[0] + element.offsetWidth);
  },

  withinIncludingScrolloffsets: function(element, x, y) {
    var offsetcache = Element.cumulativeScrollOffset(element);

    this.xcomp = x + offsetcache[0] - this.deltaX;
    this.ycomp = y + offsetcache[1] - this.deltaY;
    this.offset = Element.cumulativeOffset(element);

    return (this.ycomp >= this.offset[1] &&
            this.ycomp <  this.offset[1] + element.offsetHeight &&
            this.xcomp >= this.offset[0] &&
            this.xcomp <  this.offset[0] + element.offsetWidth);
  },

  // within must be called directly before
  overlap: function(mode, element) {
    if (!mode) return 0;
    if (mode == 'vertical')
      return ((this.offset[1] + element.offsetHeight) - this.ycomp) /
        element.offsetHeight;
    if (mode == 'horizontal')
      return ((this.offset[0] + element.offsetWidth) - this.xcomp) /
        element.offsetWidth;
  },

  // Deprecation layer -- use newer Element methods now (1.5.2).

  cumulativeOffset: Element.Methods.cumulativeOffset,

  positionedOffset: Element.Methods.positionedOffset,

  absolutize: function(element) {
    Position.prepare();
    return Element.absolutize(element);
  },

  relativize: function(element) {
    Position.prepare();
    return Element.relativize(element);
  },

  realOffset: Element.Methods.cumulativeScrollOffset,

  offsetParent: Element.Methods.getOffsetParent,

  page: Element.Methods.viewportOffset,

  clone: function(source, target, options) {
    options = options || { };
    return Element.clonePosition(target, source, options);
  }
};

/*--------------------------------------------------------------------------*/

if (!document.getElementsByClassName) document.getElementsByClassName = function(instanceMethods){
  function iter(name) {
    return name.blank() ? null : "[contains(concat(' ', @class, ' '), ' " + name + " ')]";
  }

  instanceMethods.getElementsByClassName = Prototype.BrowserFeatures.XPath ?
  function(element, className) {
    className = className.toString().strip();
    var cond = /\s/.test(className) ? $w(className).map(iter).join('') : iter(className);
    return cond ? document._getElementsByXPath('.//*' + cond, element) : [];
  } : function(element, className) {
    className = className.toString().strip();
    var elements = [], classNames = (/\s/.test(className) ? $w(className) : null);
    if (!classNames && !className) return elements;

    var nodes = $(element).getElementsByTagName('*');
    className = ' ' + className + ' ';

    for (var i = 0, child, cn; child = nodes[i]; i++) {
      if (child.className && (cn = ' ' + child.className + ' ') && (cn.include(className) ||
          (classNames && classNames.all(function(name) {
            return !name.toString().blank() && cn.include(' ' + name + ' ');
          }))))
        elements.push(Element.extend(child));
    }
    return elements;
  };

  return function(className, parentElement) {
    return $(parentElement || document.body).getElementsByClassName(className);
  };
}(Element.Methods);

/*--------------------------------------------------------------------------*/

Element.ClassNames = Class.create();
Element.ClassNames.prototype = {
  initialize: function(element) {
    this.element = $(element);
  },

  _each: function(iterator) {
    this.element.className.split(/\s+/).select(function(name) {
      return name.length > 0;
    })._each(iterator);
  },

  set: function(className) {
    this.element.className = className;
  },

  add: function(classNameToAdd) {
    if (this.include(classNameToAdd)) return;
    this.set($A(this).concat(classNameToAdd).join(' '));
  },

  remove: function(classNameToRemove) {
    if (!this.include(classNameToRemove)) return;
    this.set($A(this).without(classNameToRemove).join(' '));
  },

  toString: function() {
    return $A(this).join(' ');
  }
};

Object.extend(Element.ClassNames.prototype, Enumerable);

/*--------------------------------------------------------------------------*/

Element.addMethods();
 /* <script src="/lightbox/js/scriptaculous.js?load=effects,builder" type="text/javascript"></script>*/
 // script.aculo.us scriptaculous.js v1.8.1, Thu Jan 03 22:07:12 -0500 2008

// Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
// 
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
// 
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
// For details, see the script.aculo.us web site: http://script.aculo.us/

var Scriptaculous = {
  Version: '1.8.1',
  require: function(libraryName) {
    // inserting via DOM fails in Safari 2.0, so brute force approach
    document.write('<script type="text/javascript" src="'+libraryName+'"><\/script>');
  },
  REQUIRED_PROTOTYPE: '1.6.0',
  load: function() {
    function convertVersionString(versionString){
      var r = versionString.split('.');
      return parseInt(r[0])*100000 + parseInt(r[1])*1000 + parseInt(r[2]);
    }
 
    if((typeof Prototype=='undefined') || 
       (typeof Element == 'undefined') || 
       (typeof Element.Methods=='undefined') ||
       (convertVersionString(Prototype.Version) < 
        convertVersionString(Scriptaculous.REQUIRED_PROTOTYPE)))
       throw("script.aculo.us requires the Prototype JavaScript framework >= " +
        Scriptaculous.REQUIRED_PROTOTYPE);
    
    $A(document.getElementsByTagName("script")).findAll( function(s) {
      return (s.src && s.src.match(/scriptaculous\.js(\?.*)?$/))
    }).each( function(s) {
      var path = s.src.replace(/scriptaculous\.js(\?.*)?$/,'');
      var includes = s.src.match(/\?.*load=([a-z,]*)/);
      (includes ? includes[1] : 'builder,effects,dragdrop,controls,slider,sound').split(',').each(
       function(include) { Scriptaculous.require(path+include+'.js') });
    });
  }
}

Scriptaculous.load();
  /*<script src="/lightbox/js/lightbox.js" type="text/javascript"></script>*/
  
  /*<g:javascript library="jquery.flow.1.1.min"/>*/
  (function(A){A.fn.jFlow=function(D){var wid=520;var E=A.extend({},A.fn.jFlow.defaults,D);var F=0;var B=A(".jFlowControl").length;A(this).find(".jFlowControl").each(function(G){A(this).click(function(){A(".jFlowControl").removeClass("jFlowSelected");A(this).addClass("jFlowSelected");var H=Math.abs(F-G);A(E.slides).animate({marginLeft:"-"+(G*wid+"px")},E.duration*(H));F=G;});});A(E.slides).before('<div id="jFlowSlide"></div>').appendTo("#jFlowSlide");A(E.slides).find("div").each(function(){A(this).before('<div class="jFlowSlideContainer"></div>').appendTo(A(this).prev());});A(".jFlowControl").eq(F).addClass("jFlowSelected");var C=function(G){A("#jFlowSlide").css({position:"relative",width:E.width,height:E.height,overflow:"hidden"});A(E.slides).css({position:"relative",width:A("#jFlowSlide").width()*A(".jFlowControl").length+"px",height:A("#jFlowSlide").height()+"px",overflow:"hidden"});A(E.slides).children().css({position:"relative",width:A("#jFlowSlide").width()+"px",height:A("#jFlowSlide").height()+"px","float":"left"});A(E.slides).css({marginLeft:"-"+(F*wid+"px")});};C();A(window).resize(function(){C();});A(".jFlowPrev").click(function(){if(F>0){F--;}else{F=B-1;}A(".jFlowControl").removeClass("jFlowSelected");A(E.slides).animate({marginLeft:"-"+(F*wid+"px")},E.duration);A(".jFlowControl").eq(F).addClass("jFlowSelected");});A(".jTopLink").click(function(){if(F>0){F=6;}else{F=B-1;}A(".jFlowControl").removeClass("jFlowSelected");A(E.slides).animate({marginLeft:"-"+(F*wid+"px")},E.duration);A(".jFlowControl").eq(F).addClass("jFlowSelected");});A(".jMoreFeatureLink").click(function(){if(F>0){F=7;}else{F=B-1;}A(".jFlowControl").removeClass("jFlowSelected");A(E.slides).animate({marginLeft:"-"+(F*wid+"px")},E.duration);A(".jFlowControl").eq(F).addClass("jFlowSelected");});A(".jMoreFeaturesFinalLink").click(function(){if(F>0){$j("#popupContact").fadeOut("slow");}else{F=B-1;}A(".jFlowControl").removeClass("jFlowSelected");A(E.slides).animate({marginLeft:"-"+(F*wid+"px")},E.duration);A(".jFlowControl").eq(F).addClass("jFlowSelected");});A(".jFlowNext").click(function(){if(F<B-1){F++;}else{F=0;}A(".jFlowControl").removeClass("jFlowSelected");A(E.slides).animate({marginLeft:"-"+(F*wid+"px")},E.duration);A(".jFlowControl").eq(F).addClass("jFlowSelected");});};A.fn.jFlow.defaults={easing:"swing",duration:400,width:"100%"};})(jQuery);
   /*<script src="/js/jquery.Jcrop.min.js"></script>*/
   (function($){$.Jcrop=function(obj,opt){var obj=obj,opt=opt;if(typeof(obj)!=="object"){obj=$(obj)[0];}if(typeof(opt)!=="object"){opt={};}if(!("trackDocument" in opt)){opt.trackDocument=$.browser.msie?false:true;if($.browser.msie&&$.browser.version.split(".")[0]=="8"){opt.trackDocument=true;}}if(!("keySupport" in opt)){opt.keySupport=$.browser.msie?false:true;}var defaults={trackDocument:false,baseClass:"jcrop",addClass:null,bgColor:"black",bgOpacity:0.6,borderOpacity:0.4,handleOpacity:0.5,handlePad:5,handleSize:9,handleOffset:5,edgeMargin:14,aspectRatio:0,keySupport:true,cornerHandles:true,sideHandles:true,drawBorders:true,dragEdges:true,boxWidth:0,boxHeight:0,boundary:8,animationDelay:20,swingSpeed:3,allowSelect:true,allowMove:true,allowResize:true,minSelect:[0,0],maxSize:[0,0],minSize:[0,0],onChange:function(){},onSelect:function(){}};var options=defaults;setOptions(opt);var $origimg=$(obj);var $img=$origimg.clone().removeAttr("id").css({position:"absolute"});$img.width($origimg.width());$img.height($origimg.height());$origimg.after($img).hide();presize($img,options.boxWidth,options.boxHeight);var boundx=$img.width(),boundy=$img.height(),$div=$("<div />").width(boundx).height(boundy).addClass(cssClass("holder")).css({position:"relative",backgroundColor:options.bgColor}).insertAfter($origimg).append($img);if(options.addClass){$div.addClass(options.addClass);}var $img2=$("<img />").attr("src",$img.attr("src")).css("position","absolute").width(boundx).height(boundy);var $img_holder=$("<div />").width(pct(100)).height(pct(100)).css({zIndex:310,position:"absolute",overflow:"hidden"}).append($img2);var $hdl_holder=$("<div />").width(pct(100)).height(pct(100)).css("zIndex",320);var $sel=$("<div />").css({position:"absolute",zIndex:300}).insertBefore($img).append($img_holder,$hdl_holder);var bound=options.boundary;var $trk=newTracker().width(boundx+(bound*2)).height(boundy+(bound*2)).css({position:"absolute",top:px(-bound),left:px(-bound),zIndex:290}).mousedown(newSelection);var xlimit,ylimit,xmin,ymin;var xscale,yscale,enabled=true;var docOffset=getPos($img),btndown,lastcurs,dimmed,animating,shift_down;var Coords=function(){var x1=0,y1=0,x2=0,y2=0,ox,oy;function setPressed(pos){var pos=rebound(pos);x2=x1=pos[0];y2=y1=pos[1];}function setCurrent(pos){var pos=rebound(pos);ox=pos[0]-x2;oy=pos[1]-y2;x2=pos[0];y2=pos[1];}function getOffset(){return[ox,oy];}function moveOffset(offset){var ox=offset[0],oy=offset[1];if(0>x1+ox){ox-=ox+x1;}if(0>y1+oy){oy-=oy+y1;}if(boundy<y2+oy){oy+=boundy-(y2+oy);}if(boundx<x2+ox){ox+=boundx-(x2+ox);}x1+=ox;x2+=ox;y1+=oy;y2+=oy;}function getCorner(ord){var c=getFixed();switch(ord){case"ne":return[c.x2,c.y];case"nw":return[c.x,c.y];case"se":return[c.x2,c.y2];case"sw":return[c.x,c.y2];}}function getFixed(){if(!options.aspectRatio){return getRect();}var aspect=options.aspectRatio,min_x=options.minSize[0]/xscale,min_y=options.minSize[1]/yscale,max_x=options.maxSize[0]/xscale,max_y=options.maxSize[1]/yscale,rw=x2-x1,rh=y2-y1,rwa=Math.abs(rw),rha=Math.abs(rh),real_ratio=rwa/rha,xx,yy;if(max_x==0){max_x=boundx*10;}if(max_y==0){max_y=boundy*10;}if(real_ratio<aspect){yy=y2;w=rha*aspect;xx=rw<0?x1-w:w+x1;if(xx<0){xx=0;h=Math.abs((xx-x1)/aspect);yy=rh<0?y1-h:h+y1;}else{if(xx>boundx){xx=boundx;h=Math.abs((xx-x1)/aspect);yy=rh<0?y1-h:h+y1;}}}else{xx=x2;h=rwa/aspect;yy=rh<0?y1-h:y1+h;if(yy<0){yy=0;w=Math.abs((yy-y1)*aspect);xx=rw<0?x1-w:w+x1;}else{if(yy>boundy){yy=boundy;w=Math.abs(yy-y1)*aspect;xx=rw<0?x1-w:w+x1;}}}if(xx>x1){if(xx-x1<min_x){xx=x1+min_x;}else{if(xx-x1>max_x){xx=x1+max_x;}}if(yy>y1){yy=y1+(xx-x1)/aspect;}else{yy=y1-(xx-x1)/aspect;}}else{if(xx<x1){if(x1-xx<min_x){xx=x1-min_x;}else{if(x1-xx>max_x){xx=x1-max_x;}}if(yy>y1){yy=y1+(x1-xx)/aspect;}else{yy=y1-(x1-xx)/aspect;}}}if(xx<0){x1-=xx;xx=0;}else{if(xx>boundx){x1-=xx-boundx;xx=boundx;}}if(yy<0){y1-=yy;yy=0;}else{if(yy>boundy){y1-=yy-boundy;yy=boundy;}}return last=makeObj(flipCoords(x1,y1,xx,yy));}function rebound(p){if(p[0]<0){p[0]=0;}if(p[1]<0){p[1]=0;}if(p[0]>boundx){p[0]=boundx;}if(p[1]>boundy){p[1]=boundy;}return[p[0],p[1]];}function flipCoords(x1,y1,x2,y2){var xa=x1,xb=x2,ya=y1,yb=y2;if(x2<x1){xa=x2;xb=x1;}if(y2<y1){ya=y2;yb=y1;}return[Math.round(xa),Math.round(ya),Math.round(xb),Math.round(yb)];}function getRect(){var xsize=x2-x1;var ysize=y2-y1;if(xlimit&&(Math.abs(xsize)>xlimit)){x2=(xsize>0)?(x1+xlimit):(x1-xlimit);}if(ylimit&&(Math.abs(ysize)>ylimit)){y2=(ysize>0)?(y1+ylimit):(y1-ylimit);}if(ymin&&(Math.abs(ysize)<ymin)){y2=(ysize>0)?(y1+ymin):(y1-ymin);}if(xmin&&(Math.abs(xsize)<xmin)){x2=(xsize>0)?(x1+xmin):(x1-xmin);}if(x1<0){x2-=x1;x1-=x1;}if(y1<0){y2-=y1;y1-=y1;}if(x2<0){x1-=x2;x2-=x2;}if(y2<0){y1-=y2;y2-=y2;}if(x2>boundx){var delta=x2-boundx;x1-=delta;x2-=delta;}if(y2>boundy){var delta=y2-boundy;y1-=delta;y2-=delta;}if(x1>boundx){var delta=x1-boundy;y2-=delta;y1-=delta;}if(y1>boundy){var delta=y1-boundy;y2-=delta;y1-=delta;}return makeObj(flipCoords(x1,y1,x2,y2));}function makeObj(a){return{x:a[0],y:a[1],x2:a[2],y2:a[3],w:a[2]-a[0],h:a[3]-a[1]};}return{flipCoords:flipCoords,setPressed:setPressed,setCurrent:setCurrent,getOffset:getOffset,moveOffset:moveOffset,getCorner:getCorner,getFixed:getFixed};}();var Selection=function(){var start,end,dragmode,awake,hdep=370;var borders={};var handle={};var seehandles=false;var hhs=options.handleOffset;if(options.drawBorders){borders={top:insertBorder("hline").css("top",$.browser.msie?px(-1):px(0)),bottom:insertBorder("hline"),left:insertBorder("vline"),right:insertBorder("vline")};}if(options.dragEdges){handle.t=insertDragbar("n");handle.b=insertDragbar("s");handle.r=insertDragbar("e");handle.l=insertDragbar("w");}options.sideHandles&&createHandles(["n","s","e","w"]);options.cornerHandles&&createHandles(["sw","nw","ne","se"]);function insertBorder(type){var jq=$("<div />").css({position:"absolute",opacity:options.borderOpacity}).addClass(cssClass(type));$img_holder.append(jq);return jq;}function dragDiv(ord,zi){var jq=$("<div />").mousedown(createDragger(ord)).css({cursor:ord+"-resize",position:"absolute",zIndex:zi});$hdl_holder.append(jq);return jq;}function insertHandle(ord){return dragDiv(ord,hdep++).css({top:px(-hhs+1),left:px(-hhs+1),opacity:options.handleOpacity}).addClass(cssClass("handle"));}function insertDragbar(ord){var s=options.handleSize,o=hhs,h=s,w=s,t=o,l=o;switch(ord){case"n":case"s":w=pct(100);break;case"e":case"w":h=pct(100);break;}return dragDiv(ord,hdep++).width(w).height(h).css({top:px(-t+1),left:px(-l+1)});}function createHandles(li){for(i in li){handle[li[i]]=insertHandle(li[i]);}}function moveHandles(c){var midvert=Math.round((c.h/2)-hhs),midhoriz=Math.round((c.w/2)-hhs),north=west=-hhs+1,east=c.w-hhs,south=c.h-hhs,x,y;"e" in handle&&handle.e.css({top:px(midvert),left:px(east)})&&handle.w.css({top:px(midvert)})&&handle.s.css({top:px(south),left:px(midhoriz)})&&handle.n.css({left:px(midhoriz)});"ne" in handle&&handle.ne.css({left:px(east)})&&handle.se.css({top:px(south),left:px(east)})&&handle.sw.css({top:px(south)});"b" in handle&&handle.b.css({top:px(south)})&&handle.r.css({left:px(east)});}function moveto(x,y){$img2.css({top:px(-y),left:px(-x)});$sel.css({top:px(y),left:px(x)});}function resize(w,h){$sel.width(w).height(h);}function refresh(){var c=Coords.getFixed();Coords.setPressed([c.x,c.y]);Coords.setCurrent([c.x2,c.y2]);updateVisible();}function updateVisible(){if(awake){return update();}}function update(){var c=Coords.getFixed();resize(c.w,c.h);moveto(c.x,c.y);options.drawBorders&&borders.right.css({left:px(c.w-1)})&&borders.bottom.css({top:px(c.h-1)});seehandles&&moveHandles(c);awake||show();options.onChange(unscale(c));}function show(){$sel.show();$img.css("opacity",options.bgOpacity);awake=true;}function release(){disableHandles();$sel.hide();$img.css("opacity",1);awake=false;}function showHandles(){if(seehandles){moveHandles(Coords.getFixed());$hdl_holder.show();}}function enableHandles(){seehandles=true;if(options.allowResize){moveHandles(Coords.getFixed());$hdl_holder.show();return true;}}function disableHandles(){seehandles=false;$hdl_holder.hide();}function animMode(v){(animating=v)?disableHandles():enableHandles();}function done(){animMode(false);refresh();}var $track=newTracker().mousedown(createDragger("move")).css({cursor:"move",position:"absolute",zIndex:360});$img_holder.append($track);disableHandles();return{updateVisible:updateVisible,update:update,release:release,refresh:refresh,setCursor:function(cursor){$track.css("cursor",cursor);},enableHandles:enableHandles,enableOnly:function(){seehandles=true;},showHandles:showHandles,disableHandles:disableHandles,animMode:animMode,done:done};}();var Tracker=function(){var onMove=function(){},onDone=function(){},trackDoc=options.trackDocument;if(!trackDoc){$trk.mousemove(trackMove).mouseup(trackUp).mouseout(trackUp);}function toFront(){$trk.css({zIndex:450});if(trackDoc){$(document).mousemove(trackMove).mouseup(trackUp);}}function toBack(){$trk.css({zIndex:290});if(trackDoc){$(document).unbind("mousemove",trackMove).unbind("mouseup",trackUp);}}function trackMove(e){onMove(mouseAbs(e));}function trackUp(e){e.preventDefault();e.stopPropagation();if(btndown){btndown=false;onDone(mouseAbs(e));options.onSelect(unscale(Coords.getFixed()));toBack();onMove=function(){};onDone=function(){};}return false;}function activateHandlers(move,done){btndown=true;onMove=move;onDone=done;toFront();return false;}function setCursor(t){$trk.css("cursor",t);}$img.before($trk);return{activateHandlers:activateHandlers,setCursor:setCursor};}();var KeyManager=function(){var $keymgr=$('<input type="radio" />').css({position:"absolute",left:"-30px"}).keypress(parseKey).blur(onBlur),$keywrap=$("<div />").css({position:"absolute",overflow:"hidden"}).append($keymgr);function watchKeys(){if(options.keySupport){$keymgr.show();$keymgr.focus();}}function onBlur(e){$keymgr.hide();}function doNudge(e,x,y){if(options.allowMove){Coords.moveOffset([x,y]);Selection.updateVisible();}e.preventDefault();e.stopPropagation();}function parseKey(e){if(e.ctrlKey){return true;}shift_down=e.shiftKey?true:false;var nudge=shift_down?10:1;switch(e.keyCode){case 37:doNudge(e,-nudge,0);break;case 39:doNudge(e,nudge,0);break;case 38:doNudge(e,0,-nudge);break;case 40:doNudge(e,0,nudge);break;case 27:Selection.release();break;case 9:return true;}return nothing(e);}if(options.keySupport){$keywrap.insertBefore($img);}return{watchKeys:watchKeys};}();function px(n){return""+parseInt(n)+"px";}function pct(n){return""+parseInt(n)+"%";}function cssClass(cl){return options.baseClass+"-"+cl;}function getPos(obj){var pos=$(obj).offset();return[pos.left,pos.top];}function mouseAbs(e){return[(e.pageX-docOffset[0]),(e.pageY-docOffset[1])];}function myCursor(type){if(type!=lastcurs){Tracker.setCursor(type);lastcurs=type;}}function startDragMode(mode,pos){docOffset=getPos($img);Tracker.setCursor(mode=="move"?mode:mode+"-resize");if(mode=="move"){return Tracker.activateHandlers(createMover(pos),doneSelect);}var fc=Coords.getFixed();var opp=oppLockCorner(mode);var opc=Coords.getCorner(oppLockCorner(opp));Coords.setPressed(Coords.getCorner(opp));Coords.setCurrent(opc);Tracker.activateHandlers(dragmodeHandler(mode,fc),doneSelect);}function dragmodeHandler(mode,f){return function(pos){if(!options.aspectRatio){switch(mode){case"e":pos[1]=f.y2;break;case"w":pos[1]=f.y2;break;case"n":pos[0]=f.x2;break;case"s":pos[0]=f.x2;break;}}else{switch(mode){case"e":pos[1]=f.y+1;break;case"w":pos[1]=f.y+1;break;case"n":pos[0]=f.x+1;break;case"s":pos[0]=f.x+1;break;}}Coords.setCurrent(pos);Selection.update();};}function createMover(pos){var lloc=pos;KeyManager.watchKeys();return function(pos){Coords.moveOffset([pos[0]-lloc[0],pos[1]-lloc[1]]);lloc=pos;Selection.update();};}function oppLockCorner(ord){switch(ord){case"n":return"sw";case"s":return"nw";case"e":return"nw";case"w":return"ne";case"ne":return"sw";case"nw":return"se";case"se":return"nw";case"sw":return"ne";}}function createDragger(ord){return function(e){if(options.disabled){return false;}if((ord=="move")&&!options.allowMove){return false;}btndown=true;startDragMode(ord,mouseAbs(e));e.stopPropagation();e.preventDefault();return false;};}function presize($obj,w,h){var nw=$obj.width(),nh=$obj.height();if((nw>w)&&w>0){nw=w;nh=(w/$obj.width())*$obj.height();}if((nh>h)&&h>0){nh=h;nw=(h/$obj.height())*$obj.width();}xscale=$obj.width()/nw;yscale=$obj.height()/nh;$obj.width(nw).height(nh);}function unscale(c){return{x:parseInt(c.x*xscale),y:parseInt(c.y*yscale),x2:parseInt(c.x2*xscale),y2:parseInt(c.y2*yscale),w:parseInt(c.w*xscale),h:parseInt(c.h*yscale)};}function doneSelect(pos){var c=Coords.getFixed();if(c.w>options.minSelect[0]&&c.h>options.minSelect[1]){Selection.enableHandles();Selection.done();}else{Selection.release();}Tracker.setCursor(options.allowSelect?"crosshair":"default");}function newSelection(e){if(options.disabled){return false;}if(!options.allowSelect){return false;}btndown=true;docOffset=getPos($img);Selection.disableHandles();myCursor("crosshair");var pos=mouseAbs(e);Coords.setPressed(pos);Tracker.activateHandlers(selectDrag,doneSelect);KeyManager.watchKeys();Selection.update();e.stopPropagation();e.preventDefault();return false;}function selectDrag(pos){Coords.setCurrent(pos);Selection.update();}function newTracker(){var trk=$("<div></div>").addClass(cssClass("tracker"));$.browser.msie&&trk.css({opacity:0,backgroundColor:"white"});return trk;}function animateTo(a){var x1=a[0]/xscale,y1=a[1]/yscale,x2=a[2]/xscale,y2=a[3]/yscale;if(animating){return;}var animto=Coords.flipCoords(x1,y1,x2,y2);var c=Coords.getFixed();var animat=initcr=[c.x,c.y,c.x2,c.y2];var interv=options.animationDelay;var x=animat[0];var y=animat[1];var x2=animat[2];var y2=animat[3];var ix1=animto[0]-initcr[0];var iy1=animto[1]-initcr[1];var ix2=animto[2]-initcr[2];var iy2=animto[3]-initcr[3];var pcent=0;var velocity=options.swingSpeed;Selection.animMode(true);var animator=function(){return function(){pcent+=(100-pcent)/velocity;animat[0]=x+((pcent/100)*ix1);animat[1]=y+((pcent/100)*iy1);animat[2]=x2+((pcent/100)*ix2);animat[3]=y2+((pcent/100)*iy2);if(pcent<100){animateStart();}else{Selection.done();}if(pcent>=99.8){pcent=100;}setSelectRaw(animat);};}();function animateStart(){window.setTimeout(animator,interv);}animateStart();}function setSelect(rect){setSelectRaw([rect[0]/xscale,rect[1]/yscale,rect[2]/xscale,rect[3]/yscale]);}function setSelectRaw(l){Coords.setPressed([l[0],l[1]]);Coords.setCurrent([l[2],l[3]]);Selection.update();}function setOptions(opt){if(typeof(opt)!="object"){opt={};}options=$.extend(options,opt);if(typeof(options.onChange)!=="function"){options.onChange=function(){};}if(typeof(options.onSelect)!=="function"){options.onSelect=function(){};}}function tellSelect(){return unscale(Coords.getFixed());}function tellScaled(){return Coords.getFixed();}function setOptionsNew(opt){setOptions(opt);interfaceUpdate();}function disableCrop(){options.disabled=true;Selection.disableHandles();Selection.setCursor("default");Tracker.setCursor("default");}function enableCrop(){options.disabled=false;interfaceUpdate();}function cancelCrop(){Selection.done();Tracker.activateHandlers(null,null);}function destroy(){$div.remove();$origimg.show();}function interfaceUpdate(alt){options.allowResize?alt?Selection.enableOnly():Selection.enableHandles():Selection.disableHandles();Tracker.setCursor(options.allowSelect?"crosshair":"default");Selection.setCursor(options.allowMove?"move":"default");$div.css("backgroundColor",options.bgColor);if("setSelect" in options){setSelect(opt.setSelect);Selection.done();delete (options.setSelect);}if("trueSize" in options){xscale=options.trueSize[0]/boundx;yscale=options.trueSize[1]/boundy;}xlimit=options.maxSize[0]||0;ylimit=options.maxSize[1]||0;xmin=options.minSize[0]||0;ymin=options.minSize[1]||0;if("outerImage" in options){$img.attr("src",options.outerImage);delete (options.outerImage);}Selection.refresh();}$hdl_holder.hide();interfaceUpdate(true);var api={animateTo:animateTo,setSelect:setSelect,setOptions:setOptionsNew,tellSelect:tellSelect,tellScaled:tellScaled,disable:disableCrop,enable:enableCrop,cancel:cancelCrop,focus:KeyManager.watchKeys,getBounds:function(){return[boundx*xscale,boundy*yscale];},getWidgetSize:function(){return[boundx,boundy];},release:Selection.release,destroy:destroy};$origimg.data("Jcrop",api);return api;};$.fn.Jcrop=function(options){function attachWhenDone(from){var loadsrc=options.useImg||from.src;var img=new Image();img.onload=function(){$.Jcrop(from,options);};img.src=loadsrc;}if(typeof(options)!=="object"){options={};}this.each(function(){if($(this).data("Jcrop")){if(options=="api"){return $(this).data("Jcrop");}else{$(this).data("Jcrop").setOptions(options);}}else{attachWhenDone(this);}});return this;};})(jQuery);
     /*   <script src="/js/jquery.Jcrop.js"></script>*/
  (function($){$.Jcrop=function(obj,opt){var obj=obj,opt=opt;if(typeof(obj)!=="object"){obj=$(obj)[0];}if(typeof(opt)!=="object"){opt={};}if(!("trackDocument" in opt)){opt.trackDocument=$.browser.msie?false:true;if($.browser.msie&&$.browser.version.split(".")[0]=="8"){opt.trackDocument=true;}}if(!("keySupport" in opt)){opt.keySupport=$.browser.msie?false:true;}var defaults={trackDocument:false,baseClass:"jcrop",addClass:null,bgColor:"black",bgOpacity:0.6,borderOpacity:0.4,handleOpacity:0.5,handlePad:5,handleSize:9,handleOffset:5,edgeMargin:14,aspectRatio:0,keySupport:true,cornerHandles:true,sideHandles:true,drawBorders:true,dragEdges:true,boxWidth:0,boxHeight:0,boundary:8,animationDelay:20,swingSpeed:3,allowSelect:true,allowMove:true,allowResize:true,minSelect:[0,0],maxSize:[0,0],minSize:[0,0],onChange:function(){},onSelect:function(){}};var options=defaults;setOptions(opt);var $origimg=$(obj);var $img=$origimg.clone().removeAttr("id").css({position:"absolute"});$img.width($origimg.width());$img.height($origimg.height());$origimg.after($img).hide();presize($img,options.boxWidth,options.boxHeight);var boundx=$img.width(),boundy=$img.height(),$div=$("<div />").width(boundx).height(boundy).addClass(cssClass("holder")).css({position:"relative",backgroundColor:options.bgColor}).insertAfter($origimg).append($img);if(options.addClass){$div.addClass(options.addClass);}var $img2=$("<img />").attr("src",$img.attr("src")).css("position","absolute").width(boundx).height(boundy);var $img_holder=$("<div />").width(pct(100)).height(pct(100)).css({zIndex:310,position:"absolute",overflow:"hidden"}).append($img2);var $hdl_holder=$("<div />").width(pct(100)).height(pct(100)).css("zIndex",320);var $sel=$("<div />").css({position:"absolute",zIndex:300}).insertBefore($img).append($img_holder,$hdl_holder);var bound=options.boundary;var $trk=newTracker().width(boundx+(bound*2)).height(boundy+(bound*2)).css({position:"absolute",top:px(-bound),left:px(-bound),zIndex:290}).mousedown(newSelection);var xlimit,ylimit,xmin,ymin;var xscale,yscale,enabled=true;var docOffset=getPos($img),btndown,lastcurs,dimmed,animating,shift_down;var Coords=function(){var x1=0,y1=0,x2=0,y2=0,ox,oy;function setPressed(pos){var pos=rebound(pos);x2=x1=pos[0];y2=y1=pos[1];}function setCurrent(pos){var pos=rebound(pos);ox=pos[0]-x2;oy=pos[1]-y2;x2=pos[0];y2=pos[1];}function getOffset(){return[ox,oy];}function moveOffset(offset){var ox=offset[0],oy=offset[1];if(0>x1+ox){ox-=ox+x1;}if(0>y1+oy){oy-=oy+y1;}if(boundy<y2+oy){oy+=boundy-(y2+oy);}if(boundx<x2+ox){ox+=boundx-(x2+ox);}x1+=ox;x2+=ox;y1+=oy;y2+=oy;}function getCorner(ord){var c=getFixed();switch(ord){case"ne":return[c.x2,c.y];case"nw":return[c.x,c.y];case"se":return[c.x2,c.y2];case"sw":return[c.x,c.y2];}}function getFixed(){if(!options.aspectRatio){return getRect();}var aspect=options.aspectRatio,min_x=options.minSize[0]/xscale,min_y=options.minSize[1]/yscale,max_x=options.maxSize[0]/xscale,max_y=options.maxSize[1]/yscale,rw=x2-x1,rh=y2-y1,rwa=Math.abs(rw),rha=Math.abs(rh),real_ratio=rwa/rha,xx,yy;if(max_x==0){max_x=boundx*10;}if(max_y==0){max_y=boundy*10;}if(real_ratio<aspect){yy=y2;w=rha*aspect;xx=rw<0?x1-w:w+x1;if(xx<0){xx=0;h=Math.abs((xx-x1)/aspect);yy=rh<0?y1-h:h+y1;}else{if(xx>boundx){xx=boundx;h=Math.abs((xx-x1)/aspect);yy=rh<0?y1-h:h+y1;}}}else{xx=x2;h=rwa/aspect;yy=rh<0?y1-h:y1+h;if(yy<0){yy=0;w=Math.abs((yy-y1)*aspect);xx=rw<0?x1-w:w+x1;}else{if(yy>boundy){yy=boundy;w=Math.abs(yy-y1)*aspect;xx=rw<0?x1-w:w+x1;}}}if(xx>x1){if(xx-x1<min_x){xx=x1+min_x;}else{if(xx-x1>max_x){xx=x1+max_x;}}if(yy>y1){yy=y1+(xx-x1)/aspect;}else{yy=y1-(xx-x1)/aspect;}}else{if(xx<x1){if(x1-xx<min_x){xx=x1-min_x;}else{if(x1-xx>max_x){xx=x1-max_x;}}if(yy>y1){yy=y1+(x1-xx)/aspect;}else{yy=y1-(x1-xx)/aspect;}}}if(xx<0){x1-=xx;xx=0;}else{if(xx>boundx){x1-=xx-boundx;xx=boundx;}}if(yy<0){y1-=yy;yy=0;}else{if(yy>boundy){y1-=yy-boundy;yy=boundy;}}return last=makeObj(flipCoords(x1,y1,xx,yy));}function rebound(p){if(p[0]<0){p[0]=0;}if(p[1]<0){p[1]=0;}if(p[0]>boundx){p[0]=boundx;}if(p[1]>boundy){p[1]=boundy;}return[p[0],p[1]];}function flipCoords(x1,y1,x2,y2){var xa=x1,xb=x2,ya=y1,yb=y2;if(x2<x1){xa=x2;xb=x1;}if(y2<y1){ya=y2;yb=y1;}return[Math.round(xa),Math.round(ya),Math.round(xb),Math.round(yb)];}function getRect(){var xsize=x2-x1;var ysize=y2-y1;if(xlimit&&(Math.abs(xsize)>xlimit)){x2=(xsize>0)?(x1+xlimit):(x1-xlimit);}if(ylimit&&(Math.abs(ysize)>ylimit)){y2=(ysize>0)?(y1+ylimit):(y1-ylimit);}if(ymin&&(Math.abs(ysize)<ymin)){y2=(ysize>0)?(y1+ymin):(y1-ymin);}if(xmin&&(Math.abs(xsize)<xmin)){x2=(xsize>0)?(x1+xmin):(x1-xmin);}if(x1<0){x2-=x1;x1-=x1;}if(y1<0){y2-=y1;y1-=y1;}if(x2<0){x1-=x2;x2-=x2;}if(y2<0){y1-=y2;y2-=y2;}if(x2>boundx){var delta=x2-boundx;x1-=delta;x2-=delta;}if(y2>boundy){var delta=y2-boundy;y1-=delta;y2-=delta;}if(x1>boundx){var delta=x1-boundy;y2-=delta;y1-=delta;}if(y1>boundy){var delta=y1-boundy;y2-=delta;y1-=delta;}return makeObj(flipCoords(x1,y1,x2,y2));}function makeObj(a){return{x:a[0],y:a[1],x2:a[2],y2:a[3],w:a[2]-a[0],h:a[3]-a[1]};}return{flipCoords:flipCoords,setPressed:setPressed,setCurrent:setCurrent,getOffset:getOffset,moveOffset:moveOffset,getCorner:getCorner,getFixed:getFixed};}();var Selection=function(){var start,end,dragmode,awake,hdep=370;var borders={};var handle={};var seehandles=false;var hhs=options.handleOffset;if(options.drawBorders){borders={top:insertBorder("hline").css("top",$.browser.msie?px(-1):px(0)),bottom:insertBorder("hline"),left:insertBorder("vline"),right:insertBorder("vline")};}if(options.dragEdges){handle.t=insertDragbar("n");handle.b=insertDragbar("s");handle.r=insertDragbar("e");handle.l=insertDragbar("w");}options.sideHandles&&createHandles(["n","s","e","w"]);options.cornerHandles&&createHandles(["sw","nw","ne","se"]);function insertBorder(type){var jq=$("<div />").css({position:"absolute",opacity:options.borderOpacity}).addClass(cssClass(type));$img_holder.append(jq);return jq;}function dragDiv(ord,zi){var jq=$("<div />").mousedown(createDragger(ord)).css({cursor:ord+"-resize",position:"absolute",zIndex:zi});$hdl_holder.append(jq);return jq;}function insertHandle(ord){return dragDiv(ord,hdep++).css({top:px(-hhs+1),left:px(-hhs+1),opacity:options.handleOpacity}).addClass(cssClass("handle"));}function insertDragbar(ord){var s=options.handleSize,o=hhs,h=s,w=s,t=o,l=o;switch(ord){case"n":case"s":w=pct(100);break;case"e":case"w":h=pct(100);break;}return dragDiv(ord,hdep++).width(w).height(h).css({top:px(-t+1),left:px(-l+1)});}function createHandles(li){for(i in li){handle[li[i]]=insertHandle(li[i]);}}function moveHandles(c){var midvert=Math.round((c.h/2)-hhs),midhoriz=Math.round((c.w/2)-hhs),north=west=-hhs+1,east=c.w-hhs,south=c.h-hhs,x,y;"e" in handle&&handle.e.css({top:px(midvert),left:px(east)})&&handle.w.css({top:px(midvert)})&&handle.s.css({top:px(south),left:px(midhoriz)})&&handle.n.css({left:px(midhoriz)});"ne" in handle&&handle.ne.css({left:px(east)})&&handle.se.css({top:px(south),left:px(east)})&&handle.sw.css({top:px(south)});"b" in handle&&handle.b.css({top:px(south)})&&handle.r.css({left:px(east)});}function moveto(x,y){$img2.css({top:px(-y),left:px(-x)});$sel.css({top:px(y),left:px(x)});}function resize(w,h){$sel.width(w).height(h);}function refresh(){var c=Coords.getFixed();Coords.setPressed([c.x,c.y]);Coords.setCurrent([c.x2,c.y2]);updateVisible();}function updateVisible(){if(awake){return update();}}function update(){var c=Coords.getFixed();resize(c.w,c.h);moveto(c.x,c.y);options.drawBorders&&borders.right.css({left:px(c.w-1)})&&borders.bottom.css({top:px(c.h-1)});seehandles&&moveHandles(c);awake||show();options.onChange(unscale(c));}function show(){$sel.show();$img.css("opacity",options.bgOpacity);awake=true;}function release(){disableHandles();$sel.hide();$img.css("opacity",1);awake=false;}function showHandles(){if(seehandles){moveHandles(Coords.getFixed());$hdl_holder.show();}}function enableHandles(){seehandles=true;if(options.allowResize){moveHandles(Coords.getFixed());$hdl_holder.show();return true;}}function disableHandles(){seehandles=false;$hdl_holder.hide();}function animMode(v){(animating=v)?disableHandles():enableHandles();}function done(){animMode(false);refresh();}var $track=newTracker().mousedown(createDragger("move")).css({cursor:"move",position:"absolute",zIndex:360});$img_holder.append($track);disableHandles();return{updateVisible:updateVisible,update:update,release:release,refresh:refresh,setCursor:function(cursor){$track.css("cursor",cursor);},enableHandles:enableHandles,enableOnly:function(){seehandles=true;},showHandles:showHandles,disableHandles:disableHandles,animMode:animMode,done:done};}();var Tracker=function(){var onMove=function(){},onDone=function(){},trackDoc=options.trackDocument;if(!trackDoc){$trk.mousemove(trackMove).mouseup(trackUp).mouseout(trackUp);}function toFront(){$trk.css({zIndex:450});if(trackDoc){$(document).mousemove(trackMove).mouseup(trackUp);}}function toBack(){$trk.css({zIndex:290});if(trackDoc){$(document).unbind("mousemove",trackMove).unbind("mouseup",trackUp);}}function trackMove(e){onMove(mouseAbs(e));}function trackUp(e){e.preventDefault();e.stopPropagation();if(btndown){btndown=false;onDone(mouseAbs(e));options.onSelect(unscale(Coords.getFixed()));toBack();onMove=function(){};onDone=function(){};}return false;}function activateHandlers(move,done){btndown=true;onMove=move;onDone=done;toFront();return false;}function setCursor(t){$trk.css("cursor",t);}$img.before($trk);return{activateHandlers:activateHandlers,setCursor:setCursor};}();var KeyManager=function(){var $keymgr=$('<input type="radio" />').css({position:"absolute",left:"-30px"}).keypress(parseKey).blur(onBlur),$keywrap=$("<div />").css({position:"absolute",overflow:"hidden"}).append($keymgr);function watchKeys(){if(options.keySupport){$keymgr.show();$keymgr.focus();}}function onBlur(e){$keymgr.hide();}function doNudge(e,x,y){if(options.allowMove){Coords.moveOffset([x,y]);Selection.updateVisible();}e.preventDefault();e.stopPropagation();}function parseKey(e){if(e.ctrlKey){return true;}shift_down=e.shiftKey?true:false;var nudge=shift_down?10:1;switch(e.keyCode){case 37:doNudge(e,-nudge,0);break;case 39:doNudge(e,nudge,0);break;case 38:doNudge(e,0,-nudge);break;case 40:doNudge(e,0,nudge);break;case 27:Selection.release();break;case 9:return true;}return nothing(e);}if(options.keySupport){$keywrap.insertBefore($img);}return{watchKeys:watchKeys};}();function px(n){return""+parseInt(n)+"px";}function pct(n){return""+parseInt(n)+"%";}function cssClass(cl){return options.baseClass+"-"+cl;}function getPos(obj){var pos=$(obj).offset();return[pos.left,pos.top];}function mouseAbs(e){return[(e.pageX-docOffset[0]),(e.pageY-docOffset[1])];}function myCursor(type){if(type!=lastcurs){Tracker.setCursor(type);lastcurs=type;}}function startDragMode(mode,pos){docOffset=getPos($img);Tracker.setCursor(mode=="move"?mode:mode+"-resize");if(mode=="move"){return Tracker.activateHandlers(createMover(pos),doneSelect);}var fc=Coords.getFixed();var opp=oppLockCorner(mode);var opc=Coords.getCorner(oppLockCorner(opp));Coords.setPressed(Coords.getCorner(opp));Coords.setCurrent(opc);Tracker.activateHandlers(dragmodeHandler(mode,fc),doneSelect);}function dragmodeHandler(mode,f){return function(pos){if(!options.aspectRatio){switch(mode){case"e":pos[1]=f.y2;break;case"w":pos[1]=f.y2;break;case"n":pos[0]=f.x2;break;case"s":pos[0]=f.x2;break;}}else{switch(mode){case"e":pos[1]=f.y+1;break;case"w":pos[1]=f.y+1;break;case"n":pos[0]=f.x+1;break;case"s":pos[0]=f.x+1;break;}}Coords.setCurrent(pos);Selection.update();};}function createMover(pos){var lloc=pos;KeyManager.watchKeys();return function(pos){Coords.moveOffset([pos[0]-lloc[0],pos[1]-lloc[1]]);lloc=pos;Selection.update();};}function oppLockCorner(ord){switch(ord){case"n":return"sw";case"s":return"nw";case"e":return"nw";case"w":return"ne";case"ne":return"sw";case"nw":return"se";case"se":return"nw";case"sw":return"ne";}}function createDragger(ord){return function(e){if(options.disabled){return false;}if((ord=="move")&&!options.allowMove){return false;}btndown=true;startDragMode(ord,mouseAbs(e));e.stopPropagation();e.preventDefault();return false;};}function presize($obj,w,h){var nw=$obj.width(),nh=$obj.height();if((nw>w)&&w>0){nw=w;nh=(w/$obj.width())*$obj.height();}if((nh>h)&&h>0){nh=h;nw=(h/$obj.height())*$obj.width();}xscale=$obj.width()/nw;yscale=$obj.height()/nh;$obj.width(nw).height(nh);}function unscale(c){return{x:parseInt(c.x*xscale),y:parseInt(c.y*yscale),x2:parseInt(c.x2*xscale),y2:parseInt(c.y2*yscale),w:parseInt(c.w*xscale),h:parseInt(c.h*yscale)};}function doneSelect(pos){var c=Coords.getFixed();if(c.w>options.minSelect[0]&&c.h>options.minSelect[1]){Selection.enableHandles();Selection.done();}else{Selection.release();}Tracker.setCursor(options.allowSelect?"crosshair":"default");}function newSelection(e){if(options.disabled){return false;}if(!options.allowSelect){return false;}btndown=true;docOffset=getPos($img);Selection.disableHandles();myCursor("crosshair");var pos=mouseAbs(e);Coords.setPressed(pos);Tracker.activateHandlers(selectDrag,doneSelect);KeyManager.watchKeys();Selection.update();e.stopPropagation();e.preventDefault();return false;}function selectDrag(pos){Coords.setCurrent(pos);Selection.update();}function newTracker(){var trk=$("<div></div>").addClass(cssClass("tracker"));$.browser.msie&&trk.css({opacity:0,backgroundColor:"white"});return trk;}function animateTo(a){var x1=a[0]/xscale,y1=a[1]/yscale,x2=a[2]/xscale,y2=a[3]/yscale;if(animating){return;}var animto=Coords.flipCoords(x1,y1,x2,y2);var c=Coords.getFixed();var animat=initcr=[c.x,c.y,c.x2,c.y2];var interv=options.animationDelay;var x=animat[0];var y=animat[1];var x2=animat[2];var y2=animat[3];var ix1=animto[0]-initcr[0];var iy1=animto[1]-initcr[1];var ix2=animto[2]-initcr[2];var iy2=animto[3]-initcr[3];var pcent=0;var velocity=options.swingSpeed;Selection.animMode(true);var animator=function(){return function(){pcent+=(100-pcent)/velocity;animat[0]=x+((pcent/100)*ix1);animat[1]=y+((pcent/100)*iy1);animat[2]=x2+((pcent/100)*ix2);animat[3]=y2+((pcent/100)*iy2);if(pcent<100){animateStart();}else{Selection.done();}if(pcent>=99.8){pcent=100;}setSelectRaw(animat);};}();function animateStart(){window.setTimeout(animator,interv);}animateStart();}function setSelect(rect){setSelectRaw([rect[0]/xscale,rect[1]/yscale,rect[2]/xscale,rect[3]/yscale]);}function setSelectRaw(l){Coords.setPressed([l[0],l[1]]);Coords.setCurrent([l[2],l[3]]);Selection.update();}function setOptions(opt){if(typeof(opt)!="object"){opt={};}options=$.extend(options,opt);if(typeof(options.onChange)!=="function"){options.onChange=function(){};}if(typeof(options.onSelect)!=="function"){options.onSelect=function(){};}}function tellSelect(){return unscale(Coords.getFixed());}function tellScaled(){return Coords.getFixed();}function setOptionsNew(opt){setOptions(opt);interfaceUpdate();}function disableCrop(){options.disabled=true;Selection.disableHandles();Selection.setCursor("default");Tracker.setCursor("default");}function enableCrop(){options.disabled=false;interfaceUpdate();}function cancelCrop(){Selection.done();Tracker.activateHandlers(null,null);}function destroy(){$div.remove();$origimg.show();}function interfaceUpdate(alt){options.allowResize?alt?Selection.enableOnly():Selection.enableHandles():Selection.disableHandles();Tracker.setCursor(options.allowSelect?"crosshair":"default");Selection.setCursor(options.allowMove?"move":"default");$div.css("backgroundColor",options.bgColor);if("setSelect" in options){setSelect(opt.setSelect);Selection.done();delete (options.setSelect);}if("trueSize" in options){xscale=options.trueSize[0]/boundx;yscale=options.trueSize[1]/boundy;}xlimit=options.maxSize[0]||0;ylimit=options.maxSize[1]||0;xmin=options.minSize[0]||0;ymin=options.minSize[1]||0;if("outerImage" in options){$img.attr("src",options.outerImage);delete (options.outerImage);}Selection.refresh();}$hdl_holder.hide();interfaceUpdate(true);var api={animateTo:animateTo,setSelect:setSelect,setOptions:setOptionsNew,tellSelect:tellSelect,tellScaled:tellScaled,disable:disableCrop,enable:enableCrop,cancel:cancelCrop,focus:KeyManager.watchKeys,getBounds:function(){return[boundx*xscale,boundy*yscale];},getWidgetSize:function(){return[boundx,boundy];},release:Selection.release,destroy:destroy};$origimg.data("Jcrop",api);return api;};$.fn.Jcrop=function(options){function attachWhenDone(from){var loadsrc=options.useImg||from.src;var img=new Image();img.onload=function(){$.Jcrop(from,options);};img.src=loadsrc;}if(typeof(options)!=="object"){options={};}this.each(function(){if($(this).data("Jcrop")){if(options=="api"){return $(this).data("Jcrop");}else{$(this).data("Jcrop").setOptions(options);}}else{attachWhenDone(this);}});return this;};})(jQuery);
  /*<script type="text/javascript" src="/fancybox/jquery.fancybox-1.3.3.pack.js"></script>*/
   /*
 * FancyBox - jQuery Plugin
 * Simple and fancy lightbox alternative
 *
 * Examples and documentation at: http://fancybox.net
 * 
 * Copyright (c) 2008 - 2010 Janis Skarnelis
 * That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated.
 * 
 * Version: 1.3.3 (04/11/2010)
 * Requires: jQuery v1.3+
 *
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 */

;(function(a){var m,t,u,f,D,j,E,n,z,A,q=0,e={},o=[],p=0,c={},l=[],G=null,v=new Image,J=/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i,W=/[^\.]\.(swf)\s*$/i,K,L=1,y=0,s="",r,i,h=false,B=a.extend(a("<div/>")[0],{prop:0}),M=a.browser.msie&&a.browser.version<7&&!window.XMLHttpRequest,N=function(){t.hide();v.onerror=v.onload=null;G&&G.abort();m.empty()},O=function(){if(false===e.onError(o,q,e)){t.hide();h=false}else{e.titleShow=false;e.width="auto";e.height="auto";m.html('<p id="fancybox-error">The requested content cannot be loaded.<br />Please try again later.</p>');
F()}},I=function(){var b=o[q],d,g,k,C,P,w;N();e=a.extend({},a.fn.fancybox.defaults,typeof a(b).data("fancybox")=="undefined"?e:a(b).data("fancybox"));w=e.onStart(o,q,e);if(w===false)h=false;else{if(typeof w=="object")e=a.extend(e,w);k=e.title||(b.nodeName?a(b).attr("title"):b.title)||"";if(b.nodeName&&!e.orig)e.orig=a(b).children("img:first").length?a(b).children("img:first"):a(b);if(k===""&&e.orig&&e.titleFromAlt)k=e.orig.attr("alt");d=e.href||(b.nodeName?a(b).attr("href"):b.href)||null;if(/^(?:javascript)/i.test(d)||
d=="#")d=null;if(e.type){g=e.type;if(!d)d=e.content}else if(e.content)g="html";else if(d)g=d.match(J)?"image":d.match(W)?"swf":a(b).hasClass("iframe")?"iframe":d.indexOf("#")===0?"inline":"ajax";if(g){if(g=="inline"){b=d.substr(d.indexOf("#"));g=a(b).length>0?"inline":"ajax"}e.type=g;e.href=d;e.title=k;if(e.autoDimensions&&e.type!=="iframe"&&e.type!=="swf"){e.width="auto";e.height="auto"}if(e.modal){e.overlayShow=true;e.hideOnOverlayClick=false;e.hideOnContentClick=false;e.enableEscapeButton=false;
e.showCloseButton=false}e.padding=parseInt(e.padding,10);e.margin=parseInt(e.margin,10);m.css("padding",e.padding+e.margin);a(".fancybox-inline-tmp").unbind("fancybox-cancel").bind("fancybox-change",function(){a(this).replaceWith(j.children())});switch(g){case "html":m.html(e.content);F();break;case "inline":if(a(b).parent().is("#fancybox-content")===true){h=false;break}a('<div class="fancybox-inline-tmp" />').hide().insertBefore(a(b)).bind("fancybox-cleanup",function(){a(this).replaceWith(j.children())}).bind("fancybox-cancel",
function(){a(this).replaceWith(m.children())});a(b).appendTo(m);F();break;case "image":h=false;a.fancybox.showActivity();v=new Image;v.onerror=function(){O()};v.onload=function(){h=true;v.onerror=v.onload=null;e.width=v.width;e.height=v.height;a("<img />").attr({id:"fancybox-img",src:v.src,alt:e.title}).appendTo(m);Q()};v.src=d;break;case "swf":e.scrolling="no";e.autoDimensions=false;C='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+e.width+'" height="'+e.height+'"><param name="movie" value="'+
d+'"></param>';P="";a.each(e.swf,function(x,H){C+='<param name="'+x+'" value="'+H+'"></param>';P+=" "+x+'="'+H+'"'});C+='<embed src="'+d+'" type="application/x-shockwave-flash" width="'+e.width+'" height="'+e.height+'"'+P+"></embed></object>";m.html(C);F();break;case "ajax":h=false;a.fancybox.showActivity();e.ajax.win=e.ajax.success;G=a.ajax(a.extend({},e.ajax,{url:d,data:e.ajax.data||{},error:function(x){x.status>0&&O()},success:function(x,H,R){if((typeof R=="object"?R:G).status==200){if(typeof e.ajax.win==
"function"){w=e.ajax.win(d,x,H,R);if(w===false){t.hide();return}else if(typeof w=="string"||typeof w=="object")x=w}m.html(x);F()}}}));break;case "iframe":e.autoDimensions=false;Q()}}else O()}},F=function(){m.wrapInner('<div style="width:'+(e.width=="auto"?"auto":e.width+"px")+";height:"+(e.height=="auto"?"auto":e.height+"px")+";overflow: "+(e.scrolling=="auto"?"auto":e.scrolling=="yes"?"scroll":"hidden")+'"></div>');e.width=m.width();e.height=m.height();Q()},Q=function(){var b,d;t.hide();if(f.is(":visible")&&
false===c.onCleanup(l,p,c)){a.event.trigger("fancybox-cancel");h=false}else{h=true;a(j.add(u)).unbind();a(window).unbind("resize.fb scroll.fb");a(document).unbind("keydown.fb");f.is(":visible")&&c.titlePosition!=="outside"&&f.css("height",f.height());l=o;p=q;c=e;if(c.overlayShow){u.css({"background-color":c.overlayColor,opacity:c.overlayOpacity,cursor:c.hideOnOverlayClick?"pointer":"auto",height:a(document).height()});if(!u.is(":visible")){M&&a("select:not(#fancybox-tmp select)").filter(function(){return this.style.visibility!==
"hidden"}).css({visibility:"hidden"}).one("fancybox-cleanup",function(){this.style.visibility="inherit"});u.show()}}else u.hide();i=X();s=c.title||"";y=0;n.empty().removeAttr("style").removeClass();if(c.titleShow!==false){if(a.isFunction(c.titleFormat))b=c.titleFormat(s,l,p,c);else b=s&&s.length?c.titlePosition=="float"?'<table id="fancybox-title-float-wrap" cellpadding="0" cellspacing="0"><tr><td id="fancybox-title-float-left"></td><td id="fancybox-title-float-main">'+s+'</td><td id="fancybox-title-float-right"></td></tr></table>':
'<div id="fancybox-title-'+c.titlePosition+'">'+s+"</div>":false;s=b;if(!(!s||s==="")){n.addClass("fancybox-title-"+c.titlePosition).html(s).appendTo("body").show();switch(c.titlePosition){case "inside":n.css({width:i.width-c.padding*2,marginLeft:c.padding,marginRight:c.padding});y=n.outerHeight(true);n.appendTo(D);i.height+=y;break;case "over":n.css({marginLeft:c.padding,width:i.width-c.padding*2,bottom:c.padding}).appendTo(D);break;case "float":n.css("left",parseInt((n.width()-i.width-40)/2,10)*
-1).appendTo(f);break;default:n.css({width:i.width-c.padding*2,paddingLeft:c.padding,paddingRight:c.padding}).appendTo(f)}}}n.hide();if(f.is(":visible")){a(E.add(z).add(A)).hide();b=f.position();r={top:b.top,left:b.left,width:f.width(),height:f.height()};d=r.width==i.width&&r.height==i.height;j.fadeTo(c.changeFade,0.3,function(){var g=function(){j.html(m.contents()).fadeTo(c.changeFade,1,S)};a.event.trigger("fancybox-change");j.empty().removeAttr("filter").css({"border-width":c.padding,width:i.width-
c.padding*2,height:e.autoDimensions?"auto":i.height-y-c.padding*2});if(d)g();else{B.prop=0;a(B).animate({prop:1},{duration:c.changeSpeed,easing:c.easingChange,step:T,complete:g})}})}else{f.removeAttr("style");j.css("border-width",c.padding);if(c.transitionIn=="elastic"){r=V();j.html(m.contents());f.show();if(c.opacity)i.opacity=0;B.prop=0;a(B).animate({prop:1},{duration:c.speedIn,easing:c.easingIn,step:T,complete:S})}else{c.titlePosition=="inside"&&y>0&&n.show();j.css({width:i.width-c.padding*2,height:e.autoDimensions?
"auto":i.height-y-c.padding*2}).html(m.contents());f.css(i).fadeIn(c.transitionIn=="none"?0:c.speedIn,S)}}}},Y=function(){if(c.enableEscapeButton||c.enableKeyboardNav)a(document).bind("keydown.fb",function(b){if(b.keyCode==27&&c.enableEscapeButton){b.preventDefault();a.fancybox.close()}else if((b.keyCode==37||b.keyCode==39)&&c.enableKeyboardNav&&b.target.tagName!=="INPUT"&&b.target.tagName!=="TEXTAREA"&&b.target.tagName!=="SELECT"){b.preventDefault();a.fancybox[b.keyCode==37?"prev":"next"]()}});if(c.showNavArrows){if(c.cyclic&&
l.length>1||p!==0)z.show();if(c.cyclic&&l.length>1||p!=l.length-1)A.show()}else{z.hide();A.hide()}},S=function(){if(!a.support.opacity){j.get(0).style.removeAttribute("filter");f.get(0).style.removeAttribute("filter")}if(e.autoDimensions){f.css("height","auto");j.css("height","auto")}s&&s.length&&n.show();c.showCloseButton&&E.show();Y();c.hideOnContentClick&&j.bind("click",a.fancybox.close);c.hideOnOverlayClick&&u.bind("click",a.fancybox.close);a(window).bind("resize.fb",a.fancybox.resize);c.centerOnScroll&&
a(window).bind("scroll.fb",a.fancybox.center);if(c.type=="iframe")a('<iframe id="fancybox-frame" name="fancybox-frame'+(new Date).getTime()+'" frameborder="0" hspace="0" '+(a.browser.msie?'allowtransparency="true""':"")+' scrolling="'+e.scrolling+'" src="'+c.href+'"></iframe>').appendTo(j);f.show();h=false;a.fancybox.center();c.onComplete(l,p,c);var b,d;if(l.length-1>p){b=l[p+1].href;if(typeof b!=="undefined"&&b.match(J)){d=new Image;d.src=b}}if(p>0){b=l[p-1].href;if(typeof b!=="undefined"&&b.match(J)){d=
new Image;d.src=b}}},T=function(b){var d={width:parseInt(r.width+(i.width-r.width)*b,10),height:parseInt(r.height+(i.height-r.height)*b,10),top:parseInt(r.top+(i.top-r.top)*b,10),left:parseInt(r.left+(i.left-r.left)*b,10)};if(typeof i.opacity!=="undefined")d.opacity=b<0.5?0.5:b;f.css(d);j.css({width:d.width-c.padding*2,height:d.height-y*b-c.padding*2})},U=function(){return[a(window).width()-c.margin*2,a(window).height()-c.margin*2,a(document).scrollLeft()+c.margin,a(document).scrollTop()+c.margin]},
X=function(){var b=U(),d={},g=c.autoScale,k=c.padding*2;d.width=c.width.toString().indexOf("%")>-1?parseInt(b[0]*parseFloat(c.width)/100,10):c.width+k;d.height=c.height.toString().indexOf("%")>-1?parseInt(b[1]*parseFloat(c.height)/100,10):c.height+k;if(g&&(d.width>b[0]||d.height>b[1]))if(e.type=="image"||e.type=="swf"){g=c.width/c.height;if(d.width>b[0]){d.width=b[0];d.height=parseInt((d.width-k)/g+k,10)}if(d.height>b[1]){d.height=b[1];d.width=parseInt((d.height-k)*g+k,10)}}else{d.width=Math.min(d.width,
b[0]);d.height=Math.min(d.height,b[1])}d.top=parseInt(Math.max(b[3]-20,b[3]+(b[1]-d.height-40)*0.5),10);d.left=parseInt(Math.max(b[2]-20,b[2]+(b[0]-d.width-40)*0.5),10);return d},V=function(){var b=e.orig?a(e.orig):false,d={};if(b&&b.length){d=b.offset();d.top+=parseInt(b.css("paddingTop"),10)||0;d.left+=parseInt(b.css("paddingLeft"),10)||0;d.top+=parseInt(b.css("border-top-width"),10)||0;d.left+=parseInt(b.css("border-left-width"),10)||0;d.width=b.width();d.height=b.height();d={width:d.width+c.padding*
2,height:d.height+c.padding*2,top:d.top-c.padding-20,left:d.left-c.padding-20}}else{b=U();d={width:c.padding*2,height:c.padding*2,top:parseInt(b[3]+b[1]*0.5,10),left:parseInt(b[2]+b[0]*0.5,10)}}return d},Z=function(){if(t.is(":visible")){a("div",t).css("top",L*-40+"px");L=(L+1)%12}else clearInterval(K)};a.fn.fancybox=function(b){if(!a(this).length)return this;a(this).data("fancybox",a.extend({},b,a.metadata?a(this).metadata():{})).unbind("click.fb").bind("click.fb",function(d){d.preventDefault();
if(!h){h=true;a(this).blur();o=[];q=0;d=a(this).attr("rel")||"";if(!d||d==""||d==="nofollow")o.push(this);else{o=a("a[rel="+d+"], area[rel="+d+"]");q=o.index(this)}I()}});return this};a.fancybox=function(b,d){var g;if(!h){h=true;g=typeof d!=="undefined"?d:{};o=[];q=parseInt(g.index,10)||0;if(a.isArray(b)){for(var k=0,C=b.length;k<C;k++)if(typeof b[k]=="object")a(b[k]).data("fancybox",a.extend({},g,b[k]));else b[k]=a({}).data("fancybox",a.extend({content:b[k]},g));o=jQuery.merge(o,b)}else{if(typeof b==
"object")a(b).data("fancybox",a.extend({},g,b));else b=a({}).data("fancybox",a.extend({content:b},g));o.push(b)}if(q>o.length||q<0)q=0;I()}};a.fancybox.showActivity=function(){clearInterval(K);t.show();K=setInterval(Z,66)};a.fancybox.hideActivity=function(){t.hide()};a.fancybox.next=function(){return a.fancybox.pos(p+1)};a.fancybox.prev=function(){return a.fancybox.pos(p-1)};a.fancybox.pos=function(b){if(!h){b=parseInt(b);o=l;if(b>-1&&b<l.length){q=b;I()}else if(c.cyclic&&l.length>1){q=b>=l.length?
0:l.length-1;I()}}};a.fancybox.cancel=function(){if(!h){h=true;a.event.trigger("fancybox-cancel");N();e.onCancel(o,q,e);h=false}};a.fancybox.close=function(){function b(){u.fadeOut("fast");n.empty().hide();f.hide();a.event.trigger("fancybox-cleanup");j.empty();c.onClosed(l,p,c);l=e=[];p=q=0;c=e={};h=false}if(!(h||f.is(":hidden"))){h=true;if(c&&false===c.onCleanup(l,p,c))h=false;else{N();a(E.add(z).add(A)).hide();a(j.add(u)).unbind();a(window).unbind("resize.fb scroll.fb");a(document).unbind("keydown.fb");
j.find("iframe").attr("src",M&&/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank");c.titlePosition!=="inside"&&n.empty();f.stop();if(c.transitionOut=="elastic"){r=V();var d=f.position();i={top:d.top,left:d.left,width:f.width(),height:f.height()};if(c.opacity)i.opacity=1;n.empty().hide();B.prop=1;a(B).animate({prop:0},{duration:c.speedOut,easing:c.easingOut,step:T,complete:b})}else f.fadeOut(c.transitionOut=="none"?0:c.speedOut,b)}}};a.fancybox.resize=function(){u.is(":visible")&&
u.css("height",a(document).height());a.fancybox.center(true)};a.fancybox.center=function(b){var d,g;if(!h){g=b===true?1:0;d=U();!g&&(f.width()>d[0]||f.height()>d[1])||f.stop().animate({top:parseInt(Math.max(d[3]-20,d[3]+(d[1]-j.height()-40)*0.5-c.padding)),left:parseInt(Math.max(d[2]-20,d[2]+(d[0]-j.width()-40)*0.5-c.padding))},typeof b=="number"?b:200)}};a.fancybox.init=function(){if(!a("#fancybox-wrap").length){a("body").append(m=a('<div id="fancybox-tmp"></div>'),t=a('<div id="fancybox-loading"><div></div></div>'),
u=a('<div id="fancybox-overlay"></div>'),f=a('<div id="fancybox-wrap"></div>'));D=a('<div id="fancybox-outer"></div>').append('<div class="fancybox-bg" id="fancybox-bg-n"></div><div class="fancybox-bg" id="fancybox-bg-ne"></div><div class="fancybox-bg" id="fancybox-bg-e"></div><div class="fancybox-bg" id="fancybox-bg-se"></div><div class="fancybox-bg" id="fancybox-bg-s"></div><div class="fancybox-bg" id="fancybox-bg-sw"></div><div class="fancybox-bg" id="fancybox-bg-w"></div><div class="fancybox-bg" id="fancybox-bg-nw"></div>').appendTo(f);
D.append(j=a('<div id="fancybox-content"></div>'),E=a('<a id="fancybox-close"></a>'),n=a('<div id="fancybox-title"></div>'),z=a('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'),A=a('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>'));E.click(a.fancybox.close);t.click(a.fancybox.cancel);z.click(function(b){b.preventDefault();a.fancybox.prev()});A.click(function(b){b.preventDefault();a.fancybox.next()});
a.fn.mousewheel&&f.bind("mousewheel.fb",function(b,d){if(h||c.type=="image")b.preventDefault();a.fancybox[d>0?"prev":"next"]()});a.support.opacity||f.addClass("fancybox-ie");if(M){t.addClass("fancybox-ie6");f.addClass("fancybox-ie6");a('<iframe id="fancybox-hide-sel-frame" scrolling="no" border="0" frameborder="0" tabindex="1001" src="'+(/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank")+'"></iframe>').prependTo(D)}}};a.fn.fancybox.defaults={padding:10,margin:40,opacity:false,
modal:false,cyclic:false,scrolling:"auto",width:560,height:340,autoScale:true,autoDimensions:true,centerOnScroll:false,ajax:{},swf:{wmode:"transparent"},hideOnOverlayClick:true,hideOnContentClick:false,overlayShow:true,overlayOpacity:0.7,overlayColor:"#777",titleShow:true,titlePosition:"float",titleFormat:null,titleFromAlt:false,transitionIn:"fade",transitionOut:"fade",speedIn:300,speedOut:300,changeSpeed:300,changeFade:"fast",easingIn:"swing",easingOut:"swing",showCloseButton:true,showNavArrows:true,
enableEscapeButton:true,enableKeyboardNav:true,onStart:function(){},onCancel:function(){},onComplete:function(){},onCleanup:function(){},onClosed:function(){},onError:function(){}};a(document).ready(function(){a.fancybox.init()})})(jQuery);
   /*<script type="text/javascript" src="/fancybox/jquery.easing-1.4.pack.js"></script>*/
   
/*<script type="text/javascript" src="/fancybox/jquery.mousewheel-3.0.4.pack.js"></script>*/
/*! Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net)
* Licensed under the MIT License (LICENSE.txt).
*
* Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
* Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
* Thanks to: Seamus Leahy for adding deltaX and deltaY
*
* Version: 3.0.4
*
* Requires: 1.2.2+
*/

(function(d){function g(a){var b=a||window.event,i=[].slice.call(arguments,1),c=0,h=0,e=0;a=d.event.fix(b);a.type="mousewheel";if(a.wheelDelta)c=a.wheelDelta/120;if(a.detail)c=-a.detail/3;e=c;if(b.axis!==undefined&&b.axis===b.HORIZONTAL_AXIS){e=0;h=-1*c}if(b.wheelDeltaY!==undefined)e=b.wheelDeltaY/120;if(b.wheelDeltaX!==undefined)h=-1*b.wheelDeltaX/120;i.unshift(a,c,h,e);return d.event.handle.apply(this,i)}var f=["DOMMouseScroll","mousewheel"];d.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a=
f.length;a;)this.addEventListener(f[--a],g,false);else this.onmousewheel=g},teardown:function(){if(this.removeEventListener)for(var a=f.length;a;)this.removeEventListener(f[--a],g,false);else this.onmousewheel=null}};d.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})})(jQuery);
 
  /*<script type="text/javascript" src="/js/jquery.simplyscroll-1.0.4.js"></script>*/
  (function($){$.fn.simplyScroll=function(o){return this.each(function(){new $.simplyScroll(this,o);});};var defaults={className:"simply-scroll",frameRate:22,speed:2,horizontal:true,autoMode:"loop",pauseOnHover:true,startOnLoad:false,localJsonSource:"",flickrFeed:"",jsonImgWidth:240,jsonImgHeight:180};$.simplyScroll=function(el,o){var self=this;this.o=$.extend({},defaults,o||{});this.auto=this.o.autoMode!=="off"?true:false;this.$list=$(el);this.$list.addClass("simply-scroll-list").wrap('<div class="simply-scroll-clip"></div>').parent().wrap('<div class="'+this.o.className+' simply-scroll-container"></div>');if(!this.o.auto){this.$list.parent().parent().prepend('<div class="simply-scroll-forward"></div>').prepend('<div class="simply-scroll-back"></div>');}if(this.o.flickrFeed){$.getJSON(this.o.flickrFeed+"&format=json&jsoncallback=?",function(data){json=[];$.each(data.items,function(i,item){json.push({src:item.media.m,title:item.title,link:item.link});});self.renderData(json);});}else{if(this.o.localJsonSource){$.getJSON(this.o.localJsonSource,function(json){self.renderData(json);});}else{if(!this.o.startOnLoad){this.init();}else{$(window).load(function(){self.init();});}}}};$.simplyScroll.fn=$.simplyScroll.prototype={};$.simplyScroll.fn.extend=$.simplyScroll.extend=$.extend;$.simplyScroll.fn.extend({init:function(){this.$items=this.$list.children();this.$clip=this.$list.parent();this.$container=this.$clip.parent();if(!this.o.horizontal){this.itemMax=this.$items[0].offsetHeight;this.clipMax=this.$clip.height();this.dimension="height";this.moveBackClass="simply-scroll-btn-up";this.moveForwardClass="simply-scroll-btn-down";}else{this.itemMax=this.$items[0].offsetWidth;this.clipMax=this.$clip.width();this.dimension="width";this.moveBackClass="simply-scroll-btn-left";this.moveForwardClass="simply-scroll-btn-right";}this.posMin=0;this.posMax=this.$items.length*this.itemMax;this.$list.css(this.dimension,this.posMax+"px");if(this.o.autoMode=="loop"){var addItems=Math.ceil(this.clipMax/this.itemMax);this.$items.slice(0,addItems).clone(true).appendTo(this.$list);this.posMax+=(this.clipMax-this.o.speed);this.$list.css(this.dimension,this.posMax+(this.itemMax*addItems)+"px");}this.interval=null;this.intervalDelay=Math.floor(1000/this.o.frameRate);while(this.itemMax%this.o.speed!==0){this.o.speed--;if(this.o.speed===0){this.o.speed=1;break;}}var self=this;this.trigger=null;this.funcMoveBack=function(){self.trigger=this;self.moveBack();};this.funcMoveForward=function(){self.trigger=this;self.moveForward();};this.funcMoveStop=function(){self.moveStop();};this.funcMoveResume=function(){self.moveResume();};if(this.auto){if(this.o.pauseOnHover){this.$clip.hover(this.funcMoveStop,this.funcMoveResume);}this.moveForward();}else{this.$btnBack=$(".simply-scroll-back",this.$container).addClass("simply-scroll-btn "+this.moveBackClass+" disabled").hover(this.funcMoveBack,this.funcMoveStop);this.$btnForward=$(".simply-scroll-forward",this.$container).addClass("simply-scroll-btn "+this.moveForwardClass).hover(this.funcMoveForward,this.funcMoveStop);}},moveForward:function(){var self=this;this.movement="forward";if(this.trigger!==null){this.$btnBack.removeClass("disabled");}self.interval=setInterval(function(){if(!self.o.horizontal&&self.$clip[0].scrollTop<(self.posMax-self.clipMax)){self.$clip[0].scrollTop+=self.o.speed;}else{if(self.o.horizontal&&self.$clip[0].scrollLeft<(self.posMax-self.clipMax)){self.$clip[0].scrollLeft+=self.o.speed;}else{if(self.o.autoMode=="loop"){self.resetPos();}else{self.moveStop(self.movement);}}}},self.intervalDelay);},moveBack:function(){var self=this;this.movement="back";if(this.trigger!==null){this.$btnForward.removeClass("disabled");}self.interval=setInterval(function(){if(!self.o.horizontal&&self.$clip[0].scrollTop>0){self.$clip[0].scrollTop-=self.o.speed;}else{if(self.o.horizontal&&self.$clip[0].scrollLeft>0){self.$clip[0].scrollLeft-=self.o.speed;}else{if(self.o.autoMode=="loop"){self.resetPos();}else{self.moveStop(self.movement);}}}},self.intervalDelay);},moveStop:function(moveDir){clearInterval(this.interval);if(this.trigger!==null){if(typeof moveDir!="undefined"){$(this.trigger).addClass("disabled");}this.trigger=null;}if(this.auto){if(this.o.autoMode=="bounce"){moveDir=="forward"?this.moveBack():this.moveForward();}}},moveResume:function(){this.movement=="forward"?this.moveForward():this.moveBack();},resetPos:function(){if(!this.o.horizontal){this.$clip[0].scrollTop=0;}else{this.$clip[0].scrollLeft=0;}},renderData:function(json){if(json.length>0){var self=this;$.each(json,function(i,item){$("<img/>").attr({src:item.src,title:item.title,alt:item.title,width:self.o.jsonImgWidth,height:self.o.jsonImgHeight}).appendTo(self.$list);});this.init();}}});})(jQuery);
  /*<script src="/twitter/widget.js"></script>*/
  /**
 * Twitter - http://twitter.com
 * Copyright (C) 2010 Twitter
 * Author: Dustin Diaz (dustin@twitter.com)
 *
 * V 2.2.5 Twitter search/profile/faves/list widget
 * http://twitter.com/widgets
 * For full documented source see http://twitter.com/javascripts/widgets/widget.js
 * Hosting and modifications of the original source IS allowed.
 */
TWTR=window.TWTR||{};if(!Array.forEach){Array.prototype.filter=function(E,F){var D=F||window;var A=[];for(var C=0,B=this.length;C<B;++C){if(!E.call(D,this[C],C,this)){continue}A.push(this[C])}return A};Array.prototype.indexOf=function(B,C){var C=C||0;for(var A=0;A<this.length;++A){if(this[A]===B){return A}}return -1}}(function(){if(TWTR&&TWTR.Widget){return }function B(D,G,C){for(var F=0,E=D.length;F<E;++F){G.call(C||window,D[F],F,D)}}function A(C,E,D){this.el=C;this.prop=E;this.from=D.from;this.to=D.to;this.time=D.time;this.callback=D.callback;this.animDiff=this.to-this.from}A.canTransition=function(){var C=document.createElement("twitter");C.style.cssText="-webkit-transition: all .5s linear;";return !!C.style.webkitTransitionProperty}();A.prototype._setStyle=function(C){switch(this.prop){case"opacity":this.el.style[this.prop]=C;this.el.style.filter="alpha(opacity="+C*100+")";break;default:this.el.style[this.prop]=C+"px";break}};A.prototype._animate=function(){var C=this;this.now=new Date();this.diff=this.now-this.startTime;if(this.diff>this.time){this._setStyle(this.to);if(this.callback){this.callback.call(this)}clearInterval(this.timer);return }this.percentage=(Math.floor((this.diff/this.time)*100)/100);this.val=(this.animDiff*this.percentage)+this.from;this._setStyle(this.val)};A.prototype.start=function(){var C=this;this.startTime=new Date();this.timer=setInterval(function(){C._animate.call(C)},15)};TWTR.Widget=function(C){this.init(C)};(function(){var R={};var O=location.protocol.match(/https/);var Q=/^.+\/profile_images/;var W="https://s3.amazonaws.com/twitter_production/profile_images";var f={};var d=function(h){var g=f[h];if(!g){g=new RegExp("(?:^|\\s+)"+h+"(?:\\s+|$)");f[h]=g}return g};var D=function(l,p,m,n){var p=p||"*";var m=m||document;var h=[],g=m.getElementsByTagName(p),o=d(l);for(var j=0,k=g.length;j<k;++j){if(o.test(g[j].className)){h[h.length]=g[j];if(n){n.call(g[j],g[j])}}}return h};var e=function(){var g=navigator.userAgent;return{ie:g.match(/MSIE\s([^;]*)/)}}();var H=function(g){if(typeof g=="string"){return document.getElementById(g)}return g};var X=function(g){return g.replace(/^\s+|\s+$/g,"")};var V=function(){var g=self.innerHeight;var h=document.compatMode;if((h||e.ie)){g=(h=="CSS1Compat")?document.documentElement.clientHeight:document.body.clientHeight}return g};var c=function(i,g){var h=i.target||i.srcElement;return g(h)};var T=function(h){try{if(h&&3==h.nodeType){return h.parentNode}else{return h}}catch(g){}};var U=function(h){var g=h.relatedTarget;if(!g){if(h.type=="mouseout"){g=h.toElement}else{if(h.type=="mouseover"){g=h.fromElement}}}return T(g)};var Z=function(h,g){g.parentNode.insertBefore(h,g.nextSibling)};var a=function(h){try{h.parentNode.removeChild(h)}catch(g){}};var Y=function(g){return g.firstChild};var C=function(i){var h=U(i);while(h&&h!=this){try{h=h.parentNode}catch(g){h=this}}if(h!=this){return true}return false};var G=function(){if(document.defaultView&&document.defaultView.getComputedStyle){return function(h,k){var j=null;var i=document.defaultView.getComputedStyle(h,"");if(i){j=i[k]}var g=h.style[k]||j;return g}}else{if(document.documentElement.currentStyle&&e.ie){return function(g,i){var h=g.currentStyle?g.currentStyle[i]:null;return(g.style[i]||h)}}}}();var b={has:function(g,h){return new RegExp("(^|\\s)"+h+"(\\s|$)").test(H(g).className)},add:function(g,h){if(!this.has(g,h)){H(g).className=X(H(g).className)+" "+h}},remove:function(g,h){if(this.has(g,h)){H(g).className=H(g).className.replace(new RegExp("(^|\\s)"+h+"(\\s|$)","g"),"")}}};var E={add:function(i,h,g){if(i.addEventListener){i.addEventListener(h,g,false)}else{i.attachEvent("on"+h,function(){g.call(i,window.event)})}},remove:function(i,h,g){if(i.removeEventListener){i.removeEventListener(h,g,false)}else{i.detachEvent("on"+h,g)}}};var N=function(){function h(j){return parseInt((j).substring(0,2),16)}function g(j){return parseInt((j).substring(2,4),16)}function i(j){return parseInt((j).substring(4,6),16)}return function(j){return[h(j),g(j),i(j)]}}();var I={bool:function(g){return typeof g==="boolean"},def:function(g){return !(typeof g==="undefined")},number:function(g){return typeof g==="number"&&isFinite(g)},string:function(g){return typeof g==="string"},fn:function(g){return typeof g==="function"},array:function(g){if(g){return I.number(g.length)&&I.fn(g.splice)}return false}};var M=["January","February","March","April","May","June","July","August","September","October","November","December"];var S=function(j){var m=new Date(j);if(e.ie){m=Date.parse(j.replace(/( \+)/," UTC$1"))}var h="";var g=function(){var n=m.getHours();if(n>0&&n<13){h="am";return n}else{if(n<1){h="am";return 12}else{h="pm";return n-12}}}();var i=m.getMinutes();var l=m.getSeconds();function k(){var n=new Date();if(n.getDate()!=m.getDate()||n.getYear()!=m.getYear()||n.getMonth()!=m.getMonth()){return" - "+M[m.getMonth()]+" "+m.getDate()+", "+m.getFullYear()}else{return""}}return g+":"+i+h+k()};var K=function(m){var o=new Date();var k=new Date(m);if(e.ie){k=Date.parse(m.replace(/( \+)/," UTC$1"))}var n=o-k;var h=1000,i=h*60,j=i*60,l=j*24,g=l*7;if(isNaN(n)||n<0){return""}if(n<h*2){return"right now"}if(n<i){return Math.floor(n/h)+" seconds ago"}if(n<i*2){return"about 1 minute ago"}if(n<j){return Math.floor(n/i)+" minutes ago"}if(n<j*2){return"about 1 hour ago"}if(n<l){return Math.floor(n/j)+" hours ago"}if(n>l&&n<l*2){return"yesterday"}if(n<l*365){return Math.floor(n/l)+" days ago"}else{return"over a year ago"}};var F={link:function(g){return g.replace(/\b(((https*\:\/\/)|www\.)[^\"\']+?)(([!?,.\)]+)?(\s|$))/g,function(m,l,j,i,h){var k=j.match(/w/)?"http://":"";return'<a class="twtr-hyperlink" target="_blank" href="'+k+l+'">'+((l.length>25)?l.substr(0,24)+"...":l)+"</a>"+h})},at:function(g){return g.replace(/\B[@@]([a-zA-Z0-9_]{1,20})/g,function(h,i){return'@<a target="_blank" class="twtr-atreply" href="http://twitter.com/'+i+'">'+i+"</a>"})},list:function(g){return g.replace(/\B[@@]([a-zA-Z0-9_]{1,20}\/\w+)/g,function(h,i){return'@<a target="_blank" class="twtr-atreply" href="http://twitter.com/'+i+'">'+i+"</a>"})},hash:function(g){return g.replace(/(^|\s+)#(\w+)/gi,function(h,i,j){return i+'<a target="_blank" class="twtr-hashtag" href="http://twitter.com/search?q=%23'+j+'">#'+j+"</a>"})},clean:function(g){return this.hash(this.at(this.list(this.link(g))))}};function P(h,i,g){this.job=h;this.decayFn=i;this.interval=g;this.decayRate=1;this.decayMultiplier=1.25;this.maxDecayTime=3*60*1000}P.prototype={start:function(){this.stop().run();return this},stop:function(){if(this.worker){window.clearTimeout(this.worker)}return this},run:function(){var g=this;this.job(function(){g.decayRate=g.decayFn()?Math.max(1,g.decayRate/g.decayMultiplier):g.decayRate*g.decayMultiplier;var h=g.interval*g.decayRate;h=(h>=g.maxDecayTime)?g.maxDecayTime:h;h=Math.floor(h);g.worker=window.setTimeout(function(){g.run.call(g)},h)})},destroy:function(){this.stop();this.decayRate=1;return this}};function J(h,g,i){this.time=h||6000;this.loop=g||false;this.repeated=0;this.callback=i;this.haystack=[]}J.prototype={set:function(g){this.haystack=g},add:function(g){this.haystack.unshift(g)},start:function(){if(this.timer){return this}this._job();var g=this;this.timer=setInterval(function(){g._job.call(g)},this.time);return this},stop:function(){if(this.timer){window.clearInterval(this.timer);this.timer=null}return this},_next:function(){var g=this.haystack.shift();if(g&&this.loop){this.haystack.push(g)}return g||null},_job:function(){var g=this._next();if(g){this.callback(g)}return this}};function L(i){function g(){if(i.needle.metadata&&i.needle.metadata.result_type&&i.needle.metadata.result_type=="popular"){return'<span class="twtr-popular">'+i.needle.metadata.recent_retweets+"+ recent retweets</span>"}else{return""}}if(O){i.avatar=i.avatar.replace(Q,W)}var h='<div class="twtr-tweet-wrap">         <div class="twtr-avatar">           <div class="twtr-img"><a target="_blank" href="http://twitter.com/'+i.user+'"><img alt="'+i.user+' profile" src="'+i.avatar+'"></a></div>         </div>         <div class="twtr-tweet-text">           <p>             <a target="_blank" href="http://twitter.com/'+i.user+'" class="twtr-user">'+i.user+"</a> "+i.tweet+'             <em>            <a target="_blank" class="twtr-timestamp" time="'+i.timestamp+'" href="http://twitter.com/'+i.user+"/status/"+i.id+'">'+i.created_at+'</a>             <a target="_blank" class="twtr-reply" href="http://twitter.com/?status=@'+i.user+"%20&in_reply_to_status_id="+i.id+"&in_reply_to="+i.user+'">reply</a>             </em> '+g()+"           </p>         </div>       </div>";var j=document.createElement("div");j.id="tweet-id-"+ ++L._tweetCount;j.className="twtr-tweet";j.innerHTML=h;this.element=j}L._tweetCount=0;R.loadStyleSheet=function(i,h){if(!TWTR.Widget.loadingStyleSheet){TWTR.Widget.loadingStyleSheet=true;var g=document.createElement("link");g.href=i;g.rel="stylesheet";g.type="text/css";document.getElementsByTagName("head")[0].appendChild(g);var j=setInterval(function(){var k=G(h,"position");if(k=="relative"){clearInterval(j);j=null;TWTR.Widget.hasLoadedStyleSheet=true}},50)}};(function(){var g=false;R.css=function(j){var i=document.createElement("style");i.type="text/css";if(e.ie){i.styleSheet.cssText=j}else{var k=document.createDocumentFragment();k.appendChild(document.createTextNode(j));i.appendChild(k)}function h(){document.getElementsByTagName("head")[0].appendChild(i)}if(!e.ie||g){h()}else{window.attachEvent("onload",function(){g=true;h()})}}})();TWTR.Widget.isLoaded=false;TWTR.Widget.loadingStyleSheet=false;TWTR.Widget.hasLoadedStyleSheet=false;TWTR.Widget.WIDGET_NUMBER=0;TWTR.Widget.matches={mentions:/^@[a-zA-Z0-9_]{1,20}\b/,any_mentions:/\b@[a-zA-Z0-9_]{1,20}\b/};TWTR.Widget.jsonP=function(h,i){var g=document.createElement("script");g.type="text/javascript";g.src=h;document.body.insertBefore(g,document.body.firstChild);i(g);return g};TWTR.Widget.prototype=function(){var j=O?"https://":"http://";var l=j+"search.twitter.com/search.";var m=j+"api.twitter.com/1/statuses/user_timeline.";var i=j+"twitter.com/favorites/";var k=j+"twitter.com/";var h=25000;var g=O?"https://twitter-widgets.s3.amazonaws.com/j/1/default.gif":"http://widgets.twimg.com/j/1/default.gif";return{init:function(o){var n=this;this._widgetNumber=++TWTR.Widget.WIDGET_NUMBER;TWTR.Widget["receiveCallback_"+this._widgetNumber]=function(p){n._prePlay.call(n,p)};this._cb="TWTR.Widget.receiveCallback_"+this._widgetNumber;this.opts=o;this._base=l;this._isRunning=false;this._hasOfficiallyStarted=false;this._hasNewSearchResults=false;this._rendered=false;this._profileImage=false;this._isCreator=!!o.creator;this._setWidgetType(o.type);this.timesRequested=0;this.runOnce=false;this.newResults=false;this.results=[];this.jsonMaxRequestTimeOut=19000;this.showedResults=[];this.sinceId=1;this.source="TWITTERINC_WIDGET";this.id=o.id||"twtr-widget-"+this._widgetNumber;this.tweets=0;this.setDimensions(o.width,o.height);this.interval=o.interval||6000;this.format="json";this.rpp=o.rpp||50;this.subject=o.subject||"";this.title=o.title||"";this.setFooterText(o.footer);this.setSearch(o.search);this._setUrl();this.theme=o.theme?o.theme:this._getDefaultTheme();if(!o.id){document.write('<div class="twtr-widget" id="'+this.id+'"></div>')}this.widgetEl=H(this.id);if(o.id){b.add(this.widgetEl,"twtr-widget")}if(o.version>=2&&!TWTR.Widget.hasLoadedStyleSheet){if(O){R.loadStyleSheet("http://localhost:8080/twitter/widget.css",this.widgetEl)}else{if(o.creator){R.loadStyleSheet("http://localhost:8080/twitter/widget.css",this.widgetEl)}else{R.loadStyleSheet("http://localhost:8080/twitter/widget.css",this.widgetEl)}}}this.occasionalJob=new P(function(p){n.decay=p;n._getResults.call(n)},function(){return n._decayDecider.call(n)},h);this._ready=I.fn(o.ready)?o.ready:function(){};this._isRelativeTime=true;this._tweetFilter=false;this._avatars=true;this._isFullScreen=false;this._isLive=true;this._isScroll=false;this._loop=true;this._showTopTweets=(this._isSearchWidget)?true:false;this._behavior="default";this.setFeatures(this.opts.features);this.intervalJob=new J(this.interval,this._loop,function(p){n._normalizeTweet(p)});return this},setDimensions:function(n,o){this.wh=(n&&o)?[n,o]:[250,300];if(n=="auto"||n=="100%"){this.wh[0]="100%"}else{this.wh[0]=((this.wh[0]<150)?150:this.wh[0])+"px"}this.wh[1]=((this.wh[1]<100)?100:this.wh[1])+"px";return this},setRpp:function(n){var n=parseInt(n);this.rpp=(I.number(n)&&(n>0&&n<=100))?n:30;return this},_setWidgetType:function(n){this._isSearchWidget=false,this._isProfileWidget=false,this._isFavsWidget=false,this._isListWidget=false;switch(n){case"profile":this._isProfileWidget=true;break;case"search":this._isSearchWidget=true,this.search=this.opts.search;break;case"faves":case"favs":this._isFavsWidget=true;break;case"list":case"lists":this._isListWidget=true;break}return this},setFeatures:function(o){if(o){if(I.def(o.filters)){this._tweetFilter=o.filters}if(I.def(o.dateformat)){this._isRelativeTime=!!(o.dateformat!=="absolute")}if(I.def(o.fullscreen)&&I.bool(o.fullscreen)){if(o.fullscreen){this._isFullScreen=true;this.wh[0]="100%";this.wh[1]=(V()-90)+"px";var p=this;E.add(window,"resize",function(s){p.wh[1]=V();p._fullScreenResize()})}}if(I.def(o.loop)&&I.bool(o.loop)){this._loop=o.loop}if(I.def(o.behavior)&&I.string(o.behavior)){switch(o.behavior){case"all":this._behavior="all";break;case"preloaded":this._behavior="preloaded";break;default:this._behavior="default";break}}if(I.def(o.toptweets)&&I.bool(o.toptweets)){this._showTopTweets=o.toptweets;var n=(this._showTopTweets)?"inline-block":"none";R.css("#"+this.id+" .twtr-popular { display: "+n+"; }")}if(!I.def(o.toptweets)){this._showTopTweets=true;var n=(this._showTopTweets)?"inline-block":"none";R.css("#"+this.id+" .twtr-popular { display: "+n+"; }")}if(I.def(o.avatars)&&I.bool(o.avatars)){if(!o.avatars){R.css("#"+this.id+" .twtr-avatar, #"+this.id+" .twtr-user { display: none; } #"+this.id+" .twtr-tweet-text { margin-left: 0; }");this._avatars=false}else{var q=(this._isFullScreen)?"90px":"40px";R.css("#"+this.id+" .twtr-avatar { display: block; } #"+this.id+" .twtr-user { display: inline; } #"+this.id+" .twtr-tweet-text { margin-left: "+q+"; }");this._avatars=true}}else{if(this._isProfileWidget){this.setFeatures({avatars:false});this._avatars=false}else{this.setFeatures({avatars:true});this._avatars=true}}if(I.def(o.hashtags)&&I.bool(o.hashtags)){(!o.hashtags)?R.css("#"+this.id+" a.twtr-hashtag { display: none; }"):""}if(I.def(o.timestamp)&&I.bool(o.timestamp)){var r=o.timestamp?"block":"none";R.css("#"+this.id+" em { display: "+r+"; }")}if(I.def(o.live)&&I.bool(o.live)){this._isLive=o.live}if(I.def(o.scrollbar)&&I.bool(o.scrollbar)){this._isScroll=o.scrollbar}}else{if(this._isProfileWidget){this.setFeatures({avatars:false});this._avatars=false}if(this._isProfileWidget||this._isFavsWidget){this.setFeatures({behavior:"all"})}}return this},_fullScreenResize:function(){var n=D("twtr-timeline","div",document.body,function(o){o.style.height=(V()-90)+"px"})},setTweetInterval:function(n){this.interval=n;return this},setBase:function(n){this._base=n;return this},setUser:function(o,n){this.username=o;this.realname=n||" ";if(this._isFavsWidget){this.setBase(i+o+".")}else{if(this._isProfileWidget){this.setBase(m+this.format+"?screen_name="+o)}}this.setSearch(" ");return this},setList:function(o,n){this.listslug=n.replace(/ /g,"-").toLowerCase();this.username=o;this.setBase(k+o+"/lists/"+this.listslug+"/statuses.");this.setSearch(" ");return this},setProfileImage:function(n){this._profileImage=n;this.byClass("twtr-profile-img","img").src=O?n.replace(Q,W):n;this.byClass("twtr-profile-img-anchor","a").href="http://twitter.com/"+this.username;return this},setTitle:function(n){this.title=" ";this.widgetEl.getElementsByTagName("h3")[0].innerHTML=this.title;return this},setCaption:function(n){this.subject="&nbsp;SafeList.com";this.widgetEl.getElementsByTagName("h4")[0].innerHTML=this.subject;return this},setFooterText:function(n){this.footerText=(I.def(n)&&I.string(n))?n:"Join the conversation";if(this._rendered){this.byClass("twtr-join-conv","a").innerHTML=this.footerText}return this},setSearch:function(o){this.searchString=o||"";this.search=encodeURIComponent(this.searchString);this._setUrl();if(this._rendered){var n=this.byClass("twtr-join-conv","a");n.href="http://twitter.com/"+this._getWidgetPath()}return this},_getWidgetPath:function(){if(this._isProfileWidget){return this.username}else{if(this._isFavsWidget){return this.username+"/favorites"}else{if(this._isListWidget){return this.username+"/lists/"+this.listslug}else{return"#search?q="+this.search}}}},_setUrl:function(){var o=this;function n(){return"&"+(+new Date)+"=cachebust"}function p(){return(o.sinceId==1)?"":"&since_id="+o.sinceId+"&refresh=true"}if(this._isProfileWidget){this.url=this._base+"&callback="+this._cb+"&include_rts=true&count="+this.rpp+p()+"&clientsource="+this.source}else{if(this._isFavsWidget||this._isListWidget){this.url=this._base+this.format+"?callback="+this._cb+p()+"&include_rts=true&clientsource="+this.source}else{this.url=this._base+this.format+"?q="+this.search+"&include_rts=true&callback="+this._cb+"&rpp="+this.rpp+p()+"&clientsource="+this.source;if(!this.runOnce){this.url+="&result_type=mixed"}}}this.url+=n();return this},_getRGB:function(n){return N(n.substring(1,7))},setTheme:function(t,n){var r=this;var p=" !important";var s=((window.location.hostname.match(/twitter\.com/))&&(window.location.pathname.match(/goodies/)));if(n||s){p=""}this.theme={shell:{background:function(){return t.shell.background||r._getDefaultTheme().shell.background}(),color:function(){return t.shell.color||r._getDefaultTheme().shell.color}()},tweets:{background:function(){return t.tweets.background||r._getDefaultTheme().tweets.background}(),color:function(){return t.tweets.color||r._getDefaultTheme().tweets.color}(),links:function(){return t.tweets.links||r._getDefaultTheme().tweets.links}()}};var q="#"+this.id+" .twtr-doc,                      #"+this.id+" .twtr-hd a,                      #"+this.id+" h3,                      #"+this.id+" h4,                      #"+this.id+" .twtr-popular {            background-color: "+this.theme.shell.background+p+";            color: "+this.theme.shell.color+p+";          }          #"+this.id+" .twtr-popular {            color: "+this.theme.tweets.color+p+";            background-color: rgba("+this._getRGB(this.theme.shell.background)+", .3)"+p+";          }          #"+this.id+" .twtr-tweet a {            color: "+this.theme.tweets.links+p+";          }          #"+this.id+" .twtr-bd, #"+this.id+" .twtr-timeline i a,           #"+this.id+" .twtr-bd p {            color: "+this.theme.tweets.color+p+";          }          #"+this.id+" .twtr-new-results,           #"+this.id+" .twtr-results-inner,           #"+this.id+" .twtr-timeline {            background: "+this.theme.tweets.background+p+";          }";if(e.ie){q+="#"+this.id+" .twtr-tweet { background: "+this.theme.tweets.background+p+"; }"}R.css(q);return this},byClass:function(q,n,o){var p=D(q,n,H(this.id));return(o)?p:p[0]},render:function(){var p=this;if(!TWTR.Widget.hasLoadedStyleSheet){window.setTimeout(function(){p.render.call(p)},50);return this}this.setTheme(this.theme,this._isCreator);if(this._isProfileWidget){b.add(this.widgetEl,"twtr-widget-profile")}if(this._isScroll){b.add(this.widgetEl,"twtr-scroll")}if(!this._isLive&&!this._isScroll){this.wh[1]="auto"}if(this._isSearchWidget&&this._isFullScreen){document.title="Twitter search: "+escape(this.searchString)}this.widgetEl.innerHTML=this._getWidgetHtml();var o=this.byClass("twtr-timeline","div");if(this._isLive&&!this._isFullScreen){var q=function(r){if(p._behavior==="all"){return }if(C.call(this,r)){p.pause.call(p)}};var n=function(r){if(p._behavior==="all"){return }if(C.call(this,r)){p.resume.call(p)}};this.removeEvents=function(){E.remove(o,"mouseover",q);E.remove(o,"mouseout",n)};E.add(o,"mouseover",q);E.add(o,"mouseout",n)}this._rendered=true;this._ready();return this},removeEvents:function(){},_getDefaultTheme:function(){return{shell:{background:"#8ec1da",color:"#ffffff"},tweets:{background:"#ffffff",color:"#444444",links:"#1985b5"}}},_getWidgetHtml:function(){var p=this;function r(){if(p._isProfileWidget){return'<a target="_blank" href="http://twitter.com/" class="twtr-profile-img-anchor"><img alt="profile" class="twtr-profile-img" src="'+g+'"></a>                      <h3></h3>                      <h4></h4>'}else{return"<h3>"+p.title+"</h3><h4>"+p.subject+"</h4>"}}function o(){return p._isFullScreen?" twtr-fullscreen":""}var q=O?"https://twitter-widgets.s3.amazonaws.com/i/widget-logo.png":"http://widgets.twimg.com/i/widget-logo.png";if(this._isFullScreen){q="https://twitter-widgets.s3.amazonaws.com/i/widget-logo-fullscreen.png"}var n='<div class="twtr-doc'+o()+'" style="width: '+this.wh[0]+';">            <div class="twtr-hd">'+r()+'             </div>            <div class="twtr-bd">              <div class="twtr-timeline" style="height: '+this.wh[1]+';">                <div class="twtr-tweets">                  <div class="twtr-reference-tweet"></div>                  <!-- tweets show here -->                </div>              </div>            </div>            <div class="twtr-ft">              <div><a target="_blank" href="http://twitter.com"><img alt="" src="'+q+'"></a>                <span><a target="_blank" class="twtr-join-conv" style="color:'+this.theme.shell.color+'" href="http://twitter.com/'+this._getWidgetPath()+'">'+this.footerText+"</a></span>              </div>            </div>          </div>";return n},_appendTweet:function(n){this._insertNewResultsNumber();Z(n,this.byClass("twtr-reference-tweet","div"));return this},_slide:function(o){var p=this;var n=Y(o).offsetHeight;if(this.runOnce){new A(o,"height",{from:0,to:n,time:500,callback:function(){p._fade.call(p,o)}}).start()}return this},_fade:function(n){var o=this;if(A.canTransition){n.style.webkitTransition="opacity 0.5s ease-out";n.style.opacity=1;return this}new A(n,"opacity",{from:0,to:1,time:500}).start();return this},_chop:function(){if(this._isScroll){return this}var s=this.byClass("twtr-tweet","div",true);var t=this.byClass("twtr-new-results","div",true);if(s.length){for(var p=s.length-1;p>=0;p--){var r=s[p];var q=parseInt(r.offsetTop);if(q>parseInt(this.wh[1])){a(r)}else{break}}if(t.length>0){var n=t[t.length-1];var o=parseInt(n.offsetTop);if(o>parseInt(this.wh[1])){a(n)}}}return this},_appendSlideFade:function(o){var n=o||this.tweet.element;this._chop()._appendTweet(n)._slide(n);return this},_createTweet:function(n){n.timestamp=n.created_at;n.created_at=this._isRelativeTime?K(n.created_at):S(n.created_at);this.tweet=new L(n);if(this._isLive&&this.runOnce){this.tweet.element.style.opacity=0;this.tweet.element.style.filter="alpha(opacity:0)";this.tweet.element.style.height="0"}return this},_getResults:function(){var n=this;this.timesRequested++;this.jsonRequestRunning=true;this.jsonRequestTimer=window.setTimeout(function(){if(n.jsonRequestRunning){clearTimeout(n.jsonRequestTimer);n.jsonRequestTimer=null}n.jsonRequestRunning=false;a(n.scriptElement);n.newResults=false;n.decay()},this.jsonMaxRequestTimeOut);TWTR.Widget.jsonP(n.url,function(o){n.scriptElement=o})},clear:function(){var o=this.byClass("twtr-tweet","div",true);var n=this.byClass("twtr-new-results","div",true);o=o.concat(n);B(o,function(p){a(p)});return this},_sortByMagic:function(n){var o=this;if(this._tweetFilter){if(this._tweetFilter.negatives){n=n.filter(function(p){if(!o._tweetFilter.negatives.test(p.text)){return p}})}if(this._tweetFilter.positives){n=n.filter(function(p){if(o._tweetFilter.positives.test(p.text)){return p}})}}switch(this._behavior){case"all":this._sortByLatest(n);break;case"preloaded":default:this._sortByDefault(n);break}if(this._isLive&&this._behavior!=="all"){this.intervalJob.set(this.results);this.intervalJob.start()}return this},_loadTopTweetsAtTop:function(p){var q=[],r=[],o=[];B(p,function(s){if(s.metadata&&s.metadata.result_type&&s.metadata.result_type=="popular"){r.push(s)}else{q.push(s)}});var n=r.concat(q);return n},_sortByLatest:function(n){this.results=n;this.results=this.results.slice(0,this.rpp);this.results=this._loadTopTweetsAtTop(this.results);this.results.reverse();return this},_sortByDefault:function(o){var p=this;var n=function(r){return new Date(r).getTime()};this.results.unshift.apply(this.results,o);B(this.results,function(r){if(!r.views){r.views=0}});this.results.sort(function(s,r){if(n(s.created_at)>n(r.created_at)){return -1}else{if(n(s.created_at)<n(r.created_at)){return 1}else{return 0}}});this.results=this.results.slice(0,this.rpp);this.results=this._loadTopTweetsAtTop(this.results);var q=this.results;this.results=this.results.sort(function(s,r){if(s.views<r.views){return -1}else{if(s.views>r.views){return 1}}return 0});if(!this._isLive){this.results.reverse()}},_prePlay:function(o){if(this.jsonRequestTimer){clearTimeout(this.jsonRequestTimer);this.jsonRequestTimer=null}if(!e.ie){a(this.scriptElement)}if(o.error){this.newResults=false}else{if(o.results&&o.results.length>0){this.response=o;this.newResults=true;this.sinceId=o.max_id;this._sortByMagic(o.results);if(this.isRunning()){this._play()}}else{if((this._isProfileWidget||this._isFavsWidget||this._isListWidget)&&I.array(o)&&o.length&&o.length>0){this.newResults=true;if(!this._profileImage&&this._isProfileWidget){var n=o[0].user.screen_name;this.setProfileImage(o[0].user.profile_image_url);this.setTitle(o[0].user.name);this.setCaption('<a target="_blank" href="http://twitter.com/'+n+'">'+n+"</a>")}this.sinceId=o[0].id;this._sortByMagic(o);if(this.isRunning()){this._play()}}else{this.newResults=false}}}this._setUrl();if(this._isLive){this.decay()}},_play:function(){var n=this;if(this.runOnce){this._hasNewSearchResults=true}if(this._avatars){this._preloadImages(this.results)}if(this._isRelativeTime&&(this._behavior=="all"||this._behavior=="preloaded")){B(this.byClass("twtr-timestamp","a",true),function(o){o.innerHTML=K(o.getAttribute("time"))})}if(!this._isLive||this._behavior=="all"||this._behavior=="preloaded"){B(this.results,function(p){if(p.retweeted_status){p=p.retweeted_status}if(n._isProfileWidget){p.from_user=p.user.screen_name;p.profile_image_url=p.user.profile_image_url}if(n._isFavsWidget||n._isListWidget){p.from_user=p.user.screen_name;p.profile_image_url=p.user.profile_image_url}n._createTweet({id:p.id,user:p.from_user,tweet:F.clean(p.text),avatar:p.profile_image_url,created_at:p.created_at,needle:p});var o=n.tweet.element;(n._behavior=="all")?n._appendSlideFade(o):n._appendTweet(o)});if(this._behavior!="preloaded"){return this}}return this},_normalizeTweet:function(o){var n=this;o.views++;if(this._isProfileWidget){o.from_user=n.username;o.profile_image_url=o.user.profile_image_url}if(this._isFavsWidget||this._isListWidget){o.from_user=o.user.screen_name;o.profile_image_url=o.user.profile_image_url}if(this._isFullScreen){o.profile_image_url=o.profile_image_url.replace(/_normal\./,"_bigger.")}this._createTweet({id:o.id,user:o.from_user,tweet:F.clean(o.text),avatar:o.profile_image_url,created_at:o.created_at,needle:o})._appendSlideFade()},_insertNewResultsNumber:function(){if(!this._hasNewSearchResults){this._hasNewSearchResults=false;return }if(this.runOnce&&this._isSearchWidget){var q=this.response.total>this.rpp?this.response.total:this.response.results.length;var n=q>1?"s":"";var p=(this.response.warning&&this.response.warning.match(/adjusted since_id/))?"more than":"";var o=document.createElement("div");b.add(o,"twtr-new-results");o.innerHTML='<div class="twtr-results-inner"> &nbsp; </div><div class="twtr-results-hr"> &nbsp; </div><span>'+p+" <strong>"+q+"</strong> new tweet"+n+"</span>";Z(o,this.byClass("twtr-reference-tweet","div"));this._hasNewSearchResults=false}},_preloadImages:function(n){if(this._isProfileWidget||this._isFavsWidget||this._isListWidget){B(n,function(p){var o=new Image();o.src=p.user.profile_image_url})}else{B(n,function(o){(new Image()).src=o.profile_image_url})}},_decayDecider:function(){var n=false;if(!this.runOnce){this.runOnce=true;n=true}else{if(this.newResults){n=true}}return n},start:function(){var n=this;if(!this._rendered){setTimeout(function(){n.start.call(n)},50);return this}if(!this._isLive){this._getResults()}else{this.occasionalJob.start()}this._isRunning=true;this._hasOfficiallyStarted=true;return this},stop:function(){this.occasionalJob.stop();if(this.intervalJob){this.intervalJob.stop()}this._isRunning=false;return this},pause:function(){if(this.isRunning()&&this.intervalJob){this.intervalJob.stop();b.add(this.widgetEl,"twtr-paused");this._isRunning=false}if(this._resumeTimer){clearTimeout(this._resumeTimer);this._resumeTimer=null}return this},resume:function(){var n=this;if(!this.isRunning()&&this._hasOfficiallyStarted&&this.intervalJob){this._resumeTimer=window.setTimeout(function(){n.intervalJob.start();n._isRunning=true;b.remove(n.widgetEl,"twtr-paused")},2000)}return this},isRunning:function(){return this._isRunning},destroy:function(){this.stop();this.clear();this.runOnce=false;this._hasOfficiallyStarted=false;this._profileImage=false;this._isLive=true;this._tweetFilter=false;this._isScroll=false;this.newResults=false;this._isRunning=false;this.sinceId=1;this.results=[];this.showedResults=[];this.occasionalJob.destroy();if(this.jsonRequestRunning){clearTimeout(this.jsonRequestTimer)}b.remove(this.widgetEl,"twtr-scroll");this.removeEvents();return this}}}()})()})();

