// JavaScript Document
(function($){var canvasElements=[];var pollCounter=0;var plugins={};function Area(canvas){var stack=[];$.extend(this,{width:canvas.width,height:canvas.height,ctx:canvas.getContext("2d"),save:function(){this.ctx.save();stack.push({width:this.width,height:this.height});},restore:function(){this.ctx.restore();$.extend(this,stack.pop());}});}
var Plugin=(function(){var shrink=function(area,steps){area.ctx.translate(steps,steps);area.width-=2*steps;area.height-=2*steps;};return{action:{paint:function(){}},shrink:shrink,defaultShrink:shrink,setAction:function(action){this.action=action;}};})();function newPlugin(hash,opts){return $.extend({},Plugin,hash,{opts:opts,savedOpts:opts});}
function pluginFromPlugins(plugins){return newPlugin({paint:function(area){area.save();this.action.opts=$.extend(true,this.action.savedOpts);$.each(plugins,function(){this.paint(area);});area.restore();},setAction:function(action){this.action=action;$.each(plugins,function(){this.action=action;});}});}
var pluginFromApplications=pluginFromPlugins;function pluginFromName(name,opts){var plugin=plugins[name];if(!plugin)throw"Unknown plugin: "+name;opts=$.extend({},plugin.defaultOpts||{},opts);return newPlugin(plugin,opts);}
function parse(s){s+=" ";var index=0;function err(m){msg=m+" at "+index+": ..."+s.substring(index)+"\nin "+s;alert(msg);throw msg;}
function cur(){return s.charAt(index);}
function next(){if(index>s.length)throw("Unexpected end");return s.charAt(index+1)}
function eat(){return s.charAt(index++);}
function skipWhite(){while(/\s/.exec(cur()))eat();}
function check(c){skipWhite();for(var i=0;i<c.length;++i){if(cur()!=c.charAt(i))err("Expected '"+c.charAt(i)+"' found '"+cur()+"'");eat();}}
function parseWord(){skipWhite();for(var word=[];/\w/.exec(cur());word.push(eat()));return word.join("");}
function parseNumber(){skipWhite();for(var n=[];/\d/.exec(cur());n.push(eat()));return parseInt(n.join(""));}
function parseString(){skipWhite();var s=[],start=cur();if(/[^\'\"]/.exec(start)){err("String expected")}
eat();while(cur()!=start){if(cur()=="\\")s.eat();s.push(eat());}
check(start);return s.join("");}
function parseValue(){skipWhite();for(var s=[];/[^;}]/.exec(cur());s.push(eat()));return s.join("");}
function parseLiteral(){skipWhite();if(/\d/.exec(cur()))return parseNumber();if(/['"]/.exec(cur()))return parseString();return parseValue();}
function parseOpts(){check("{");skipWhite();var opts={};while(cur()!="}"){var key=parseWord();check(":");opts[key]=parseLiteral();skipWhite();if(cur()=="}")break;check(";");}
check("}");return opts;}
function parsePlugin(){var name=parseWord();skipWhite();opts=cur()=="{"?parseOpts():{};return pluginFromName(name,opts);}
function parsePlugins(){check("[");skipWhite();var plugins=[];while(cur()!="]"){plugins.push(parsePlugin());skipWhite();}
check("]");return pluginFromPlugins(plugins);}
function parseActors(){skipWhite();return cur()=="["?parsePlugins():parsePlugin();}
function parseAction(){var action;skipWhite();if(cur()=="("){eat();action=parseApplications();check(")");}else{action=parsePlugin();}
return action;}
function parseApplication(){var actors=parseActors();check("=>");var action=parseAction();actors.setAction(action);return actors;}
function parseApplications(){var applications=[];while(true){applications.push(parseApplication());skipWhite();if(cur()!=",")break;check(",");}
return pluginFromApplications(applications);}
return parseApplications();}
function checkResize(container,force){var $container=$(container);var data=$container.data('liquid-canvas');if(!data)return;var canvas=data.canvas;var $canvas=$(canvas);var w=$container.outerWidth();var h=$container.outerHeight();if(force||canvas.width!=w||canvas.height!=h||canvas.offsetTop!=container.offsetTop||canvas.offsetLeft!=container.offsetLeft){pollCounter=100;$canvas.css({left:container.offsetLeft+"px",top:container.offsetTop+"px"});canvas.width=w;canvas.height=h;var area=new Area(canvas);area.save();data.paint(area);area.restore();}}
function checkAllResize(force){$.each(canvasElements,function(){checkResize(this,force);});}
function poll(){checkAllResize();pollCounter--;if(pollCounter<0){pollCounter=0;setTimeout(poll,1000);}else{setTimeout(poll,1000/60);}}
jQuery.fn.extend({liquidCanvas:function(func){this.each(function(){var canvas;if(window.G_vmlCanvasManager){$(this).before('<div width="0" height="0" style="position:absolute; top:0px; left:0px;"></div>');canvas=G_vmlCanvasManager.initElement($(this).prev("div").get(0));}else{$(this).before('<canvas width="0" height="0" style="position:absolute; top:0px; left:0px;"></canvas>');canvas=$(this).prev("canvas").get(0);}
var paint;if($.isFunction(func)){paint=func;}else{var plugin=parse(func)
paint=function(area){plugin.paint(area);};}
$(this).data("liquid-canvas",{"canvas":canvas,"paint":paint});$(this).css({background:"transparent"});if($(this).css("position")!="absolute")$(this).css({position:"relative"});canvasElements.push(this);checkResize(this,true);});}});jQuery.extend({registerLiquidCanvasPlugin:function(plugin){plugins[plugin.name]=$.extend({},Plugin,plugin);}});$(document).ready(checkAllResize);poll();})(jQuery);(function($){$.registerLiquidCanvasPlugin({name:"rect",paint:function(area){area.ctx.beginPath();area.ctx.rect(0,0,area.width,area.height);area.ctx.closePath();if(this.action)this.action.paint(area);}});$.registerLiquidCanvasPlugin({name:"roundedRect",defaultOpts:{radius:20},paint:function(area){var ctx=area.ctx;var opts=this.opts;ctx.beginPath();ctx.moveTo(0,opts.radius);ctx.lineTo(0,area.height-opts.radius);ctx.quadraticCurveTo(0,area.height,opts.radius,area.height);ctx.lineTo(area.width-opts.radius,area.height);ctx.quadraticCurveTo(area.width,area.height,area.width,area.height-opts.radius);ctx.lineTo(area.width,opts.radius);ctx.quadraticCurveTo(area.width,0,area.width-opts.radius,0);ctx.lineTo(opts.radius,0);ctx.quadraticCurveTo(0,0,0,opts.radius);ctx.closePath();if(this.action)this.action.paint(area);},shrink:function(area,steps){this.defaultShrink(area,steps);this.opts.radius-=steps;}});$.registerLiquidCanvasPlugin({name:"fill",defaultOpts:{color:"#aaa"},paint:function(area){area.ctx.fillStyle=this.opts.color;this.action.paint(area);area.ctx.fill();}});$.registerLiquidCanvasPlugin({name:"image",defaultOpts:{url:""},paint:function(area){var image=new Image();image.src=this.opts.url;image.onload=function(){area.ctx.drawImage(this,0,0);};}});$.registerLiquidCanvasPlugin({name:"gradient1",defaultOpts:{from:"#fff",to:"#f5f5f5"},paint:function(area){var grad=area.ctx.createLinearGradient(0,0,0,area.height);grad.addColorStop(0,this.opts.from);grad.addColorStop(1,this.opts.to);area.ctx.fillStyle=grad;this.action.paint(area);area.ctx.fill();}});$.registerLiquidCanvasPlugin({name:"gradient2",defaultOpts:{from:"#fff",to:"#dbdef2"},paint:function(area){var grad=area.ctx.createLinearGradient(0,0,0,area.height);grad.addColorStop(0,this.opts.from);grad.addColorStop(1,this.opts.to);area.ctx.fillStyle=grad;this.action.paint(area);area.ctx.fill();}});$.registerLiquidCanvasPlugin({name:"gradient3",defaultOpts:{from:"#fff",to:"#fff"},paint:function(area){var grad=area.ctx.createLinearGradient(0,0,0,area.height);grad.addColorStop(0,this.opts.from);grad.addColorStop(1,this.opts.to);area.ctx.fillStyle=grad;this.action.paint(area);area.ctx.fill();}});$.registerLiquidCanvasPlugin({name:"gradient4",defaultOpts:{from:"#ffffec",to:"#f1f2d7"},paint:function(area){var grad=area.ctx.createLinearGradient(0,0,0,area.height);grad.addColorStop(0,this.opts.from);grad.addColorStop(1,this.opts.to);area.ctx.fillStyle=grad;this.action.paint(area);area.ctx.fill();}});$.registerLiquidCanvasPlugin({name:"gradient5",defaultOpts:{from:"#f5b404",to:"#d1442f"},paint:function(area){var grad=area.ctx.createLinearGradient(0,0,0,area.height);grad.addColorStop(0,this.opts.from);grad.addColorStop(1,this.opts.to);area.ctx.fillStyle=grad;this.action.paint(area);area.ctx.fill();}});$.registerLiquidCanvasPlugin({name:"shadow",defaultOpts:{width:3,color:'#000',shift:2},paint:function(area){var sw=this.opts.width;area.ctx.fillStyle=this.opts.color;area.ctx.globalAlpha=1.0/sw;for(var s=0;s<sw;++s){this.action.paint(area);area.ctx.fill();this.action.shrink(area,1);}
area.ctx.globalAlpha=1;area.ctx.translate(0,-this.opts.shift);}});$.registerLiquidCanvasPlugin({name:"border",defaultOpts:{color:'#d7d7d7',width:1},paint:function(area){var bw=this.opts.width;area.ctx.strokeStyle=this.opts.color;area.ctx.lineWidth=bw;this.action.shrink(area,bw/2);this.action.paint(area);area.ctx.stroke();this.action.shrink(area,bw/2);}});})(jQuery);this.label2value=function(){var inactive="inactive";var active="active";var focused="focused";$("label").each(function(){obj=document.getElementById($(this).attr("for"));if(($(obj).attr("type")=="text")||(obj.tagName.toLowerCase()=="textarea")){$(obj).addClass(inactive);var text=$(this).text();$(this).css("display","none");$(obj).val(text);$(obj).focus(function(){$(this).addClass(focused);$(this).removeClass(inactive);$(this).removeClass(active);if($(this).val()==text)$(this).val("");});$(obj).blur(function(){$(this).removeClass(focused);if($(this).val()==""){$(this).val(text);$(this).addClass(inactive);}else{$(this).addClass(active);};});};});};$(document).ready(function(){label2value();});var ddaccordion={contentclassname:{},expandone:function(headerclass,selected){this.toggleone(headerclass,selected,"expand")},collapseone:function(headerclass,selected){this.toggleone(headerclass,selected,"collapse")},expandall:function(headerclass){var $=jQuery
var $headers=$('.'+headerclass)
$('.'+this.contentclassname[headerclass]+':hidden').each(function(){$headers.eq(parseInt($(this).attr('contentindex'))).trigger("evt_accordion")})},collapseall:function(headerclass){var $=jQuery
var $headers=$('.'+headerclass)
$('.'+this.contentclassname[headerclass]+':visible').each(function(){$headers.eq(parseInt($(this).attr('contentindex'))).trigger("evt_accordion")})},toggleone:function(headerclass,selected,optstate){var $=jQuery
var $targetHeader=$('.'+headerclass).eq(selected)
var $subcontent=$('.'+this.contentclassname[headerclass]).eq(selected)
if(typeof optstate=="undefined"||optstate=="expand"&&$subcontent.is(":hidden")||optstate=="collapse"&&$subcontent.is(":visible"))
$targetHeader.trigger("evt_accordion")},expandit:function($targetHeader,$targetContent,config,useractivated,directclick){this.transformHeader($targetHeader,config,"expand")
$targetContent.slideDown(config.animatespeed,function(){config.onopenclose($targetHeader.get(0),parseInt($targetHeader.attr('headerindex')),$targetContent.css('display'),useractivated)
if(config.postreveal=="gotourl"&&directclick){var targetLink=($targetHeader.is("a"))?$targetHeader.get(0):$targetHeader.find('a:eq(0)').get(0)
if(targetLink)
setTimeout(function(){location=targetLink.href},200)}})},collapseit:function($targetHeader,$targetContent,config,isuseractivated){this.transformHeader($targetHeader,config,"collapse")
$targetContent.slideUp(config.animatespeed,function(){config.onopenclose($targetHeader.get(0),parseInt($targetHeader.attr('headerindex')),$targetContent.css('display'),isuseractivated)})},transformHeader:function($targetHeader,config,state){$targetHeader.addClass((state=="expand")?config.cssclass.expand:config.cssclass.collapse).removeClass((state=="expand")?config.cssclass.collapse:config.cssclass.expand)
if(config.htmlsetting.location=='src'){$targetHeader=($targetHeader.is("img"))?$targetHeader:$targetHeader.find('img').eq(0)
$targetHeader.attr('src',(state=="expand")?config.htmlsetting.expand:config.htmlsetting.collapse)}
else if(config.htmlsetting.location=="prefix")
$targetHeader.find('.accordprefix').html((state=="expand")?config.htmlsetting.expand:config.htmlsetting.collapse)
else if(config.htmlsetting.location=="suffix")
$targetHeader.find('.accordsuffix').html((state=="expand")?config.htmlsetting.expand:config.htmlsetting.collapse)},urlparamselect:function(headerclass){var result=window.location.search.match(new RegExp(headerclass+"=((\\d+)(,(\\d+))*)","i"))
if(result!=null)
result=RegExp.$1.split(',')
return result},getCookie:function(Name){var re=new RegExp(Name+"=[^;]+","i")
if(document.cookie.match(re))
return document.cookie.match(re)[0].split("=")[1]
return null},setCookie:function(name,value){document.cookie=name+"="+value+"; path=/"},init:function(config){document.write('<style type="text/css">\n')
document.write('.'+config.contentclass+'{display: none}\n')
document.write('<\/style>')
jQuery(document).ready(function($){ddaccordion.urlparamselect(config.headerclass)
var persistedheaders=ddaccordion.getCookie(config.headerclass)
ddaccordion.contentclassname[config.headerclass]=config.contentclass
config.cssclass={collapse:config.toggleclass[0],expand:config.toggleclass[1]}
config.revealtype=config.revealtype||"click"
config.revealtype=config.revealtype.replace(/mouseover/i,"mouseenter")
if(config.revealtype=="clickgo"){config.postreveal="gotourl"
config.revealtype="click"}
if(typeof config.togglehtml=="undefined")
config.htmlsetting={location:"none"}
else
config.htmlsetting={location:config.togglehtml[0],collapse:config.togglehtml[1],expand:config.togglehtml[2]}
config.oninit=(typeof config.oninit=="undefined")?function(){}:config.oninit
config.onopenclose=(typeof config.onopenclose=="undefined")?function(){}:config.onopenclose
var lastexpanded={}
var expandedindices=ddaccordion.urlparamselect(config.headerclass)||((config.persiststate&&persistedheaders!=null)?persistedheaders:config.defaultexpanded)
if(typeof expandedindices=='string')
expandedindices=expandedindices.replace(/c/ig,'').split(',')
var $subcontents=$('.'+config["contentclass"])
if(expandedindices.length==1&&expandedindices[0]=="-1")
expandedindices=[]
if(config["collapseprev"]&&expandedindices.length>1)
expandedindices=[expandedindices.pop()]
if(config["onemustopen"]&&expandedindices.length==0)
expandedindices=[0]
$('.'+config["headerclass"]).each(function(index){if(/(prefix)|(suffix)/i.test(config.htmlsetting.location)&&$(this).html()!=""){$('<span class="accordprefix"></span>').prependTo(this)
$('<span class="accordsuffix"></span>').appendTo(this)}
$(this).attr('headerindex',index+'h')
$subcontents.eq(index).attr('contentindex',index+'c')
var $subcontent=$subcontents.eq(index)
var needle=(typeof expandedindices[0]=="number")?index:index+''
if(jQuery.inArray(needle,expandedindices)!=-1){if(config.animatedefault==false)
$subcontent.show()
ddaccordion.expandit($(this),$subcontent,config,false)
lastexpanded={$header:$(this),$content:$subcontent}}
else{$subcontent.hide()
config.onopenclose($(this).get(0),parseInt($(this).attr('headerindex')),$subcontent.css('display'),false)
ddaccordion.transformHeader($(this),config,"collapse")}})
$('.'+config["headerclass"]).bind("evt_accordion",function(e,isdirectclick){var $subcontent=$subcontents.eq(parseInt($(this).attr('headerindex')))
if($subcontent.css('display')=="none"){ddaccordion.expandit($(this),$subcontent,config,true,isdirectclick)
if(config["collapseprev"]&&lastexpanded.$header&&$(this).get(0)!=lastexpanded.$header.get(0)){ddaccordion.collapseit(lastexpanded.$header,lastexpanded.$content,config,true)}
lastexpanded={$header:$(this),$content:$subcontent}}
else if(!config["onemustopen"]||config["onemustopen"]&&lastexpanded.$header&&$(this).get(0)!=lastexpanded.$header.get(0)){ddaccordion.collapseit($(this),$subcontent,config,true)}})
$('.'+config["headerclass"]).bind(config.revealtype,function(){if(config.revealtype=="mouseenter"){clearTimeout(config.revealdelay)
var headerindex=parseInt($(this).attr("headerindex"))
config.revealdelay=setTimeout(function(){ddaccordion.expandone(config["headerclass"],headerindex)},config.mouseoverdelay||0)}
else{$(this).trigger("evt_accordion",[true])
return false}})
$('.'+config["headerclass"]).bind("mouseleave",function(){clearTimeout(config.revealdelay)})
config.oninit($('.'+config["headerclass"]).get(),expandedindices)
$(window).bind('unload',function(){$('.'+config["headerclass"]).unbind()
var expandedindices=[]
$('.'+config["contentclass"]+":visible").each(function(index){expandedindices.push($(this).attr('contentindex'))})
if(config.persiststate==true&&$('.'+config["headerclass"]).length>0){expandedindices=(expandedindices.length==0)?'-1c':expandedindices
ddaccordion.setCookie(config.headerclass,expandedindices)}})})}}
var scrolltotop={setting:{startline:100,scrollto:0,scrollduration:500,fadeduration:[500,500]},controlHTML:'<span class="top_img"></span>',controlattrs:{offsetx:15,offsety:15},anchorkeyword:'#top',state:{isvisible:false,shouldvisible:false},scrollup:function(){if(!this.cssfixedsupport)
this.$control.css({opacity:0})
var dest=isNaN(this.setting.scrollto)?this.setting.scrollto:parseInt(this.setting.scrollto)
if(typeof dest=="string"&&jQuery('#'+dest).length==1)
dest=jQuery('#'+dest).offset().top
else
dest=0
this.$body.animate({scrollTop:dest},this.setting.scrollduration);},keepfixed:function(){var $window=jQuery(window)
var controlx=$window.scrollLeft()+$window.width()-this.$control.width()-this.controlattrs.offsetx
var controly=$window.scrollTop()+$window.height()-this.$control.height()-this.controlattrs.offsety
this.$control.css({left:controlx+'px',top:controly+'px'})},togglecontrol:function(){var scrolltop=jQuery(window).scrollTop()
if(!this.cssfixedsupport)
this.keepfixed()
this.state.shouldvisible=(scrolltop>=this.setting.startline)?true:false
if(this.state.shouldvisible&&!this.state.isvisible){this.$control.stop().animate({opacity:1},this.setting.fadeduration[0])
this.state.isvisible=true}
else if(this.state.shouldvisible==false&&this.state.isvisible){this.$control.stop().animate({opacity:0},this.setting.fadeduration[1])
this.state.isvisible=false}},init:function(){jQuery(document).ready(function($){var mainobj=scrolltotop
var iebrws=document.all
mainobj.cssfixedsupport=!iebrws||iebrws&&document.compatMode=="CSS1Compat"&&window.XMLHttpRequest
mainobj.$body=(window.opera)?(document.compatMode=="CSS1Compat"?$('html'):$('body')):$('html,body')
mainobj.$control=$('<div id="topcontrol">'+mainobj.controlHTML+'</div>').css({position:mainobj.cssfixedsupport?'fixed':'absolute',bottom:mainobj.controlattrs.offsety,right:mainobj.controlattrs.offsetx,opacity:0,cursor:'pointer'}).attr({title:''}).click(function(){mainobj.scrollup();return false}).appendTo('body')
if(document.all&&!window.XMLHttpRequest&&mainobj.$control.text()!='')
mainobj.$control.css({width:mainobj.$control.width()})
mainobj.togglecontrol()
$('a[href="'+mainobj.anchorkeyword+'"]').click(function(){mainobj.scrollup()
return false})
$(window).bind('scroll resize',function(e){mainobj.togglecontrol()})})}}
scrolltotop.init()
function browserdetect(){var agent=navigator.userAgent.toLowerCase();this.isIE=agent.indexOf("msie")>-1;this.ieVer=this.isIE?/msie\s(\d\.\d)/.exec(agent)[1]:0;this.isMoz=agent.indexOf('firefox')!=-1;this.isSafari=agent.indexOf('safari')!=-1;this.quirksMode=this.isIE&&(!document.compatMode||document.compatMode.indexOf("BackCompat")>-1);this.isOp='opera'in window;this.isWebKit=agent.indexOf('webkit')!=-1;if(this.isIE){this.get_style=function(obj,prop){if(!(prop in obj.currentStyle))return"";var matches=/^([\d.]+)(\w*)/.exec(obj.currentStyle[prop]);if(!matches)return obj.currentStyle[prop];if(matches[1]==0)return'0';if(matches[2]&&matches[2]!=='px'){var style=obj.style.left;var rtStyle=obj.runtimeStyle.left;obj.runtimeStyle.left=obj.currentStyle.left;obj.style.left=matches[1]+matches[2];matches[0]=obj.style.pixelLeft;obj.style.left=style;obj.runtimeStyle.left=rtStyle;}
return matches[0];};}
else{this.get_style=function(obj,prop){prop=prop.replace(/([a-z])([A-Z])/g,'$1-$2').toLowerCase();return document.defaultView.getComputedStyle(obj,'').getPropertyValue(prop);};}}
var curvyBrowser=new browserdetect;if(curvyBrowser.isIE){try{document.execCommand("BackgroundImageCache",false,true);}
catch(e){};}
function curvyCnrSpec(selText){this.selectorText=selText;this.tlR=this.trR=this.blR=this.brR=0;this.tlu=this.tru=this.blu=this.bru="";this.antiAlias=true;}
curvyCnrSpec.prototype.setcorner=function(tb,lr,radius,unit){if(!tb){this.tlR=this.trR=this.blR=this.brR=parseInt(radius);this.tlu=this.tru=this.blu=this.bru=unit;}
else{propname=tb.charAt(0)+lr.charAt(0);this[propname+'R']=parseInt(radius);this[propname+'u']=unit;}}
curvyCnrSpec.prototype.get=function(prop){if(/^(t|b)(l|r)(R|u)$/.test(prop))return this[prop];if(/^(t|b)(l|r)Ru$/.test(prop)){var pname=prop.charAt(0)+prop.charAt(1);return this[pname+'R']+this[pname+'u'];}
if(/^(t|b)Ru?$/.test(prop)){var tb=prop.charAt(0);tb+=this[tb+'lR']>this[tb+'rR']?'l':'r';var retval=this[tb+'R'];if(prop.length===3&&prop.charAt(2)==='u')
retval+=this[tb='u'];return retval;}
throw new Error('Don\'t recognize property '+prop);}
curvyCnrSpec.prototype.radiusdiff=function(tb){if(tb!=='t'&&tb!=='b')throw new Error("Param must be 't' or 'b'");return Math.abs(this[tb+'lR']-this[tb+'rR']);}
curvyCnrSpec.prototype.setfrom=function(obj){this.tlu=this.tru=this.blu=this.bru='px';if('tl'in obj)this.tlR=obj.tl.radius;if('tr'in obj)this.trR=obj.tr.radius;if('bl'in obj)this.blR=obj.bl.radius;if('br'in obj)this.brR=obj.br.radius;if('antiAlias'in obj)this.antiAlias=obj.antiAlias;};curvyCnrSpec.prototype.cloneOn=function(box){var props=['tl','tr','bl','br'];var converted=0;var i,propu;for(i in props)if(!isNaN(i)){propu=this[props[i]+'u'];if(propu!==''&&propu!=='px'){converted=new curvyCnrSpec;break;}}
if(!converted)
converted=this;else{var propi,propR,save=curvyBrowser.get_style(box,'left');for(i in props)if(!isNaN(i)){propi=props[i];propu=this[propi+'u'];propR=this[propi+'R'];if(propu!=='px'){var save=box.style.left;box.style.left=propR+propu;propR=box.style.pixelLeft;box.style.left=save;}
converted[propi+'R']=propR;converted[propi+'u']='px';}
box.style.left=save;}
return converted;}
curvyCnrSpec.prototype.radiusSum=function(tb){if(tb!=='t'&&tb!=='b')throw new Error("Param must be 't' or 'b'");return this[tb+'lR']+this[tb+'rR'];}
curvyCnrSpec.prototype.radiusCount=function(tb){var count=0;if(this[tb+'lR'])++count;if(this[tb+'rR'])++count;return count;}
curvyCnrSpec.prototype.cornerNames=function(){var ret=[];if(this.tlR)ret.push('tl');if(this.trR)ret.push('tr');if(this.blR)ret.push('bl');if(this.brR)ret.push('br');return ret;}
function operasheet(sheetnumber){var txt=document.styleSheets.item(sheetnumber).ownerNode.text;txt=txt.replace(/\/\*(\n|\r|.)*?\*\//g,'');var pat=new RegExp("^\s*([\\w.#][-\\w.#, ]+)[\\n\\s]*\\{([^}]+border-((top|bottom)-(left|right)-)?radius[^}]*)\\}","mg");var matches;this.rules=[];while((matches=pat.exec(txt))!==null){var pat2=new RegExp("(..)border-((top|bottom)-(left|right)-)?radius:\\s*([\\d.]+)(in|em|px|ex|pt)","g");var submatches,cornerspec=new curvyCnrSpec(matches[1]);while((submatches=pat2.exec(matches[2]))!==null)
if(submatches[1]!=="z-")
cornerspec.setcorner(submatches[3],submatches[4],submatches[5],submatches[6]);this.rules.push(cornerspec);}}
operasheet.contains_border_radius=function(sheetnumber){return/border-((top|bottom)-(left|right)-)?radius/.test(document.styleSheets.item(sheetnumber).ownerNode.text);}
function curvyCorners(){var i,j,boxCol,settings,startIndex;if(typeof arguments[0]!=="object")throw curvyCorners.newError("First parameter of curvyCorners() must be an object.");if(arguments[0]instanceof curvyCnrSpec){settings=arguments[0];if(!settings.selectorText&&typeof arguments[1]==='string')
settings.selectorText=arguments[1];}
else{if(typeof arguments[1]!=="object"&&typeof arguments[1]!=="string")throw curvyCorners.newError("Second parameter of curvyCorners() must be an object or a class name.");j=arguments[1];if(typeof j!=='string')j='';if(j!==''&&j.charAt(0)!=='.'&&'autoPad'in arguments[0])j='.'+j;settings=new curvyCnrSpec(j);settings.setfrom(arguments[0]);}
if(settings.selectorText){startIndex=0;var args=settings.selectorText.replace(/\s+$/,'').split(/,\s*/);boxCol=new Array;function idof(str){var ret=str.split('#');return(ret.length===2?"#":"")+ret.pop();}
for(i=0;i<args.length;++i){var arg=idof(args[i]);var argbits=arg.split(' ');switch(arg.charAt(0)){case'#':j=argbits.length===1?arg:argbits[0];j=document.getElementById(j.substr(1));if(j===null)
curvyCorners.alert("No object with ID "+arg+" exists yet.\nCall curvyCorners(settings, obj) when it is created.");else if(argbits.length===1)
boxCol.push(j);else
boxCol=boxCol.concat(curvyCorners.getElementsByClass(argbits[1],j));break;default:if(argbits.length===1)
boxCol=boxCol.concat(curvyCorners.getElementsByClass(arg));else{var encloser=curvyCorners.getElementsByClass(argbits[0]);for(j=0;j<encloser.length;++j){boxCol=boxCol.concat(curvyCorners.getElementsByClass(argbits[1],encloser));}}}}}
else{startIndex=1;boxCol=arguments;}
for(i=startIndex,j=boxCol.length;i<j;++i){if(boxCol[i]&&(!('IEborderRadius'in boxCol[i].style)||boxCol[i].style.IEborderRadius!='set')){if(boxCol[i].className&&boxCol[i].className.indexOf('curvyRedraw')!==-1){if(typeof curvyCorners.redrawList==='undefined')curvyCorners.redrawList=new Array;curvyCorners.redrawList.push({node:boxCol[i],spec:settings,copy:boxCol[i].cloneNode(false)});}
boxCol[i].style.IEborderRadius='set';var obj=new curvyObject(settings,boxCol[i]);obj.applyCorners();}}}
curvyCorners.prototype.applyCornersToAll=function(){curvyCorners.alert('This function is now redundant. Just call curvyCorners(). See documentation.');};curvyCorners.redraw=function(){if(!curvyBrowser.isOp&&!curvyBrowser.isIE)return;if(!curvyCorners.redrawList)throw curvyCorners.newError('curvyCorners.redraw() has nothing to redraw.');var old_block_value=curvyCorners.bock_redraw;curvyCorners.block_redraw=true;for(var i in curvyCorners.redrawList){if(isNaN(i))continue;var o=curvyCorners.redrawList[i];if(!o.node.clientWidth)continue;var newchild=o.copy.cloneNode(false);for(var contents=o.node.firstChild;contents!=null;contents=contents.nextSibling)
if(contents.className==='autoPadDiv')break;if(!contents){curvyCorners.alert('Couldn\'t find autoPad DIV');break;}
o.node.parentNode.replaceChild(newchild,o.node);while(contents.firstChild)newchild.appendChild(contents.removeChild(contents.firstChild));o=new curvyObject(o.spec,o.node=newchild);o.applyCorners();}
curvyCorners.block_redraw=old_block_value;}
curvyCorners.adjust=function(obj,prop,newval){if(curvyBrowser.isOp||curvyBrowser.isIE){if(!curvyCorners.redrawList)throw curvyCorners.newError('curvyCorners.adjust() has nothing to adjust.');var i,j=curvyCorners.redrawList.length;for(i=0;i<j;++i)if(curvyCorners.redrawList[i].node===obj)break;if(i===j)throw curvyCorners.newError('Object not redrawable');obj=curvyCorners.redrawList[i].copy;}
if(prop.indexOf('.')===-1)
obj[prop]=newval;else eval('obj.'+prop+"='"+newval+"'");}
curvyCorners.handleWinResize=function(){if(!curvyCorners.block_redraw)curvyCorners.redraw();}
curvyCorners.setWinResize=function(onoff){curvyCorners.block_redraw=!onoff;}
curvyCorners.newError=function(errorMessage){return new Error("curvyCorners Error:\n"+errorMessage)}
curvyCorners.alert=function(errorMessage){if(typeof curvyCornersVerbose==='undefined'||curvyCornersVerbose)alert(errorMessage);}
function curvyObject(){var boxDisp;this.box=arguments[1];this.settings=arguments[0];this.topContainer=this.bottomContainer=this.shell=boxDisp=null;var boxWidth=this.box.clientWidth;if(!boxWidth&&curvyBrowser.isIE){this.box.style.zoom=1;boxWidth=this.box.clientWidth;}
if(!boxWidth){if(!this.box.parentNode)throw this.newError("box has no parent!");for(boxDisp=this.box;;boxDisp=boxDisp.parentNode){if(!boxDisp||boxDisp.tagName==='BODY'){this.applyCorners=function(){}
curvyCorners.alert(this.errmsg("zero-width box with no accountable parent","warning"));return;}
if(boxDisp.style.display==='none')break;}
boxDisp.style.display='block';boxWidth=this.box.clientWidth;}
if(arguments[0]instanceof curvyCnrSpec)
this.spec=arguments[0].cloneOn(this.box);else{this.spec=new curvyCnrSpec('');this.spec.setfrom(this.settings);}
var borderWidth=curvyBrowser.get_style(this.box,"borderTopWidth");var borderWidthB=curvyBrowser.get_style(this.box,"borderBottomWidth");var borderWidthL=curvyBrowser.get_style(this.box,"borderLeftWidth");var borderWidthR=curvyBrowser.get_style(this.box,"borderRightWidth");var borderColour=curvyBrowser.get_style(this.box,"borderTopColor");var borderColourB=curvyBrowser.get_style(this.box,"borderBottomColor");var borderColourL=curvyBrowser.get_style(this.box,"borderLeftColor");var boxColour=curvyBrowser.get_style(this.box,"backgroundColor");var backgroundImage=curvyBrowser.get_style(this.box,"backgroundImage");var backgroundRepeat=curvyBrowser.get_style(this.box,"backgroundRepeat");if(this.box.currentStyle&&this.box.currentStyle.backgroundPositionX){var backgroundPosX=curvyBrowser.get_style(this.box,"backgroundPositionX");var backgroundPosY=curvyBrowser.get_style(this.box,"backgroundPositionY");}
else{var backgroundPosX=curvyBrowser.get_style(this.box,'backgroundPosition');backgroundPosX=backgroundPosX.split(' ');var backgroundPosY=backgroundPosX[1];backgroundPosX=backgroundPosX[0];}
var boxPosition=curvyBrowser.get_style(this.box,"position");var topPadding=curvyBrowser.get_style(this.box,"paddingTop");var bottomPadding=curvyBrowser.get_style(this.box,"paddingBottom");var leftPadding=curvyBrowser.get_style(this.box,"paddingLeft");var rightPadding=curvyBrowser.get_style(this.box,"paddingRight");var border=curvyBrowser.get_style(this.box,"border");filter=curvyBrowser.ieVer>7?curvyBrowser.get_style(this.box,'filter'):null;var topMaxRadius=this.spec.get('tR');var botMaxRadius=this.spec.get('bR');var styleToNPx=function(val){if(typeof val==='number')return val;if(typeof val!=='string')throw new Error('unexpected styleToNPx type '+typeof val);var matches=/^[-\d.]([a-z]+)$/.exec(val);if(matches&&matches[1]!='px')throw new Error('Unexpected unit '+matches[1]);if(isNaN(val=parseInt(val)))val=0;return val;}
var min0Px=function(val){return val<=0?"0":val+"px";}
try{this.borderWidth=styleToNPx(borderWidth);this.borderWidthB=styleToNPx(borderWidthB);this.borderWidthL=styleToNPx(borderWidthL);this.borderWidthR=styleToNPx(borderWidthR);this.boxColour=curvyObject.format_colour(boxColour);this.topPadding=styleToNPx(topPadding);this.bottomPadding=styleToNPx(bottomPadding);this.leftPadding=styleToNPx(leftPadding);this.rightPadding=styleToNPx(rightPadding);this.boxWidth=boxWidth;this.boxHeight=this.box.clientHeight;this.borderColour=curvyObject.format_colour(borderColour);this.borderColourB=curvyObject.format_colour(borderColourB);this.borderColourL=curvyObject.format_colour(borderColourL);this.borderString=this.borderWidth+"px"+" solid "+this.borderColour;this.borderStringB=this.borderWidthB+"px"+" solid "+this.borderColourB;this.backgroundImage=((backgroundImage!="none")?backgroundImage:"");this.backgroundRepeat=backgroundRepeat;}
catch(e){throw this.newError('getMessage'in e?e.getMessage():e.message);}
var clientHeight=this.boxHeight;var clientWidth=boxWidth;if(curvyBrowser.isOp){backgroundPosX=styleToNPx(backgroundPosX);backgroundPosY=styleToNPx(backgroundPosY);if(backgroundPosX){var t=clientWidth+this.borderWidthL+this.borderWidthR;if(backgroundPosX>t)backgroundPosX=t;backgroundPosX=(t/backgroundPosX*100)+'%';}
if(backgroundPosY){var t=clientHeight+this.borderWidth+this.borderWidthB;if(backgroundPosY>t)backgroundPosY=t;backgroundPosY=(t/backgroundPosY*100)+'%';}}
if(curvyBrowser.quirksMode){}
else{this.boxWidth-=this.leftPadding+this.rightPadding;this.boxHeight-=this.topPadding+this.bottomPadding;}
this.contentContainer=document.createElement("div");if(filter)this.contentContainer.style.filter=filter;while(this.box.firstChild)this.contentContainer.appendChild(this.box.removeChild(this.box.firstChild));if(boxPosition!="absolute")this.box.style.position="relative";this.box.style.padding='0';this.box.style.border=this.box.style.backgroundImage='none';this.box.style.backgroundColor='transparent';this.box.style.width=(clientWidth+this.borderWidthL+this.borderWidthR)+'px';this.box.style.height=(clientHeight+this.borderWidth+this.borderWidthB)+'px';var newMainContainer=document.createElement("div");newMainContainer.style.position="absolute";if(filter)newMainContainer.style.filter=filter;if(curvyBrowser.quirksMode){newMainContainer.style.width=(clientWidth+this.borderWidthL+this.borderWidthR)+'px';}else{newMainContainer.style.width=clientWidth+'px';}
newMainContainer.style.height=min0Px(clientHeight+this.borderWidth+this.borderWidthB-topMaxRadius-botMaxRadius);newMainContainer.style.padding="0";newMainContainer.style.top=topMaxRadius+"px";newMainContainer.style.left="0";if(this.borderWidthL)
newMainContainer.style.borderLeft=this.borderWidthL+"px solid "+this.borderColourL;if(this.borderWidth&&!topMaxRadius)
newMainContainer.style.borderTop=this.borderWidth+"px solid "+this.borderColour;if(this.borderWidthR)
newMainContainer.style.borderRight=this.borderWidthR+"px solid "+this.borderColourL;if(this.borderWidthB&&!botMaxRadius)
newMainContainer.style.borderBottom=this.borderWidthB+"px solid "+this.borderColourB;newMainContainer.style.backgroundColor=boxColour;newMainContainer.style.backgroundImage=this.backgroundImage;newMainContainer.style.backgroundRepeat=this.backgroundRepeat;this.shell=this.box.appendChild(newMainContainer);boxWidth=curvyBrowser.get_style(this.shell,"width");if(boxWidth===""||boxWidth==="auto"||boxWidth.indexOf("%")!==-1)throw this.newError('Shell width is '+boxWidth);this.boxWidth=(boxWidth!=""&&boxWidth!="auto"&&boxWidth.indexOf("%")==-1)?parseInt(boxWidth):this.shell.clientWidth;this.applyCorners=function(){if(this.backgroundObject){var bgOffset=function(style,imglen,boxlen){if(style===0)return 0;var retval;if(style==='right'||style==='bottom')return boxlen-imglen;if(style==='center')return(boxlen-imglen)/2;if(style.indexOf('%')>0)return(boxlen-imglen)*100/parseInt(style);return styleToNPx(style);}
this.backgroundPosX=bgOffset(backgroundPosX,this.backgroundObject.width,clientWidth);this.backgroundPosY=bgOffset(backgroundPosY,this.backgroundObject.height,clientHeight);}
else if(this.backgroundImage){this.backgroundPosX=styleToNPx(backgroundPosX);this.backgroundPosY=styleToNPx(backgroundPosY);}
if(topMaxRadius){newMainContainer=document.createElement("div");newMainContainer.style.width=this.boxWidth+"px";newMainContainer.style.fontSize="1px";newMainContainer.style.overflow="hidden";newMainContainer.style.position="absolute";newMainContainer.style.paddingLeft=this.borderWidth+"px";newMainContainer.style.paddingRight=this.borderWidth+"px";newMainContainer.style.height=topMaxRadius+"px";newMainContainer.style.top=-topMaxRadius+"px";newMainContainer.style.left=-this.borderWidthL+"px";this.topContainer=this.shell.appendChild(newMainContainer);}
if(botMaxRadius){var newMainContainer=document.createElement("div");newMainContainer.style.width=this.boxWidth+"px";newMainContainer.style.fontSize="1px";newMainContainer.style.overflow="hidden";newMainContainer.style.position="absolute";newMainContainer.style.paddingLeft=this.borderWidthB+"px";newMainContainer.style.paddingRight=this.borderWidthB+"px";newMainContainer.style.height=botMaxRadius+"px";newMainContainer.style.bottom=-botMaxRadius+"px";newMainContainer.style.left=-this.borderWidthL+"px";this.bottomContainer=this.shell.appendChild(newMainContainer);}
var corners=this.spec.cornerNames();for(var i in corners)if(!isNaN(i)){var cc=corners[i];var specRadius=this.spec[cc+'R'];var bwidth,bcolor,borderRadius,borderWidthTB;if(cc=="tr"||cc=="tl"){bwidth=this.borderWidth;bcolor=this.borderColour;borderWidthTB=this.borderWidth;}else{bwidth=this.borderWidthB;bcolor=this.borderColourB;borderWidthTB=this.borderWidthB;}
borderRadius=specRadius-borderWidthTB;var newCorner=document.createElement("div");newCorner.style.height=this.spec.get(cc+'Ru');newCorner.style.width=this.spec.get(cc+'Ru');newCorner.style.position="absolute";newCorner.style.fontSize="1px";newCorner.style.overflow="hidden";var intx,inty,outsideColour;var trans=filter?parseInt(/alpha\(opacity.(\d+)\)/.exec(filter)[1]):100;for(intx=0;intx<specRadius;++intx){var y1=(intx+1>=borderRadius)?-1:Math.floor(Math.sqrt(Math.pow(borderRadius,2)-Math.pow(intx+1,2)))-1;if(borderRadius!=specRadius){var y2=(intx>=borderRadius)?-1:Math.ceil(Math.sqrt(Math.pow(borderRadius,2)-Math.pow(intx,2)));var y3=(intx+1>=specRadius)?-1:Math.floor(Math.sqrt(Math.pow(specRadius,2)-Math.pow((intx+1),2)))-1;}
var y4=(intx>=specRadius)?-1:Math.ceil(Math.sqrt(Math.pow(specRadius,2)-Math.pow(intx,2)));if(y1>-1)this.drawPixel(intx,0,this.boxColour,trans,(y1+1),newCorner,true,specRadius);if(borderRadius!=specRadius){if(this.spec.antiAlias){for(inty=y1+1;inty<y2;++inty){if(this.backgroundImage!=""){var borderFract=curvyObject.pixelFraction(intx,inty,borderRadius)*100;this.drawPixel(intx,inty,bcolor,trans,1,newCorner,borderFract>=30,specRadius);}
else if(this.boxColour!=='transparent'){var pixelcolour=curvyObject.BlendColour(this.boxColour,bcolor,curvyObject.pixelFraction(intx,inty,borderRadius));this.drawPixel(intx,inty,pixelcolour,trans,1,newCorner,false,specRadius);}
else this.drawPixel(intx,inty,bcolor,trans>>1,1,newCorner,false,specRadius);}
if(y3>=y2){if(y2==-1)y2=0;this.drawPixel(intx,y2,bcolor,trans,(y3-y2+1),newCorner,false,0);}
outsideColour=bcolor;inty=y3;}
else{if(y3>y1){this.drawPixel(intx,(y1+1),bcolor,trans,(y3-y1),newCorner,false,0);}}}
else{outsideColour=this.boxColour;inty=y1;}
if(this.spec.antiAlias){while(++inty<y4){this.drawPixel(intx,inty,outsideColour,(curvyObject.pixelFraction(intx,inty,specRadius)*trans),1,newCorner,borderWidthTB<=0,specRadius);}}}
for(var t=0,k=newCorner.childNodes.length;t<k;++t){var pixelBar=newCorner.childNodes[t];var pixelBarTop=parseInt(pixelBar.style.top);var pixelBarLeft=parseInt(pixelBar.style.left);var pixelBarHeight=parseInt(pixelBar.style.height);if(cc=="tl"||cc=="bl"){pixelBar.style.left=(specRadius-pixelBarLeft-1)+"px";}
if(cc=="tr"||cc=="tl"){pixelBar.style.top=(specRadius-pixelBarHeight-pixelBarTop)+"px";}
pixelBar.style.backgroundRepeat=this.backgroundRepeat;if(this.backgroundImage)switch(cc){case"tr":pixelBar.style.backgroundPosition=(this.backgroundPosX-this.borderWidthL+specRadius-clientWidth-pixelBarLeft)+"px "+(this.backgroundPosY+pixelBarHeight+pixelBarTop+this.borderWidth-specRadius)+"px";break;case"tl":pixelBar.style.backgroundPosition=(this.backgroundPosX-specRadius+pixelBarLeft+this.borderWidthL)+"px "+(this.backgroundPosY-specRadius+pixelBarHeight+pixelBarTop+this.borderWidth)+"px";break;case"bl":pixelBar.style.backgroundPosition=(this.backgroundPosX-specRadius+pixelBarLeft+1+this.borderWidthL)+"px "+(this.backgroundPosY-clientHeight-this.borderWidth+(curvyBrowser.quirksMode?pixelBarTop:-pixelBarTop)+specRadius)+"px";break;case"br":if(curvyBrowser.quirksMode){pixelBar.style.backgroundPosition=(this.backgroundPosX+this.borderWidthL-clientWidth+specRadius-pixelBarLeft)+"px "+(this.backgroundPosY-clientHeight-this.borderWidth+pixelBarTop+specRadius)+"px";}else{pixelBar.style.backgroundPosition=(this.backgroundPosX-this.borderWidthL-clientWidth+specRadius-pixelBarLeft)+"px "+(this.backgroundPosY-clientHeight-this.borderWidth+specRadius-pixelBarTop)+"px";}}}
switch(cc){case"tl":newCorner.style.top=newCorner.style.left="0";this.topContainer.appendChild(newCorner);break;case"tr":newCorner.style.top=newCorner.style.right="0";this.topContainer.appendChild(newCorner);break;case"bl":newCorner.style.bottom=newCorner.style.left="0";this.bottomContainer.appendChild(newCorner);break;case"br":newCorner.style.bottom=newCorner.style.right="0";this.bottomContainer.appendChild(newCorner);}}
var radiusDiff={t:this.spec.radiusdiff('t'),b:this.spec.radiusdiff('b')};for(z in radiusDiff){if(typeof z==='function')continue;if(!this.spec.get(z+'R'))continue;if(radiusDiff[z]){if(this.backgroundImage&&this.spec.radiusSum(z)!==radiusDiff[z])
curvyCorners.alert(this.errmsg('Not supported: unequal non-zero top/bottom radii with background image'));var smallerCornerType=(this.spec[z+"lR"]<this.spec[z+"rR"])?z+"l":z+"r";var newFiller=document.createElement("div");newFiller.style.height=radiusDiff[z]+"px";newFiller.style.width=this.spec.get(smallerCornerType+'Ru');newFiller.style.position="absolute";newFiller.style.fontSize="1px";newFiller.style.overflow="hidden";newFiller.style.backgroundColor=this.boxColour;switch(smallerCornerType){case"tl":newFiller.style.bottom=newFiller.style.left="0";newFiller.style.borderLeft=this.borderString;this.topContainer.appendChild(newFiller);break;case"tr":newFiller.style.bottom=newFiller.style.right="0";newFiller.style.borderRight=this.borderString;this.topContainer.appendChild(newFiller);break;case"bl":newFiller.style.top=newFiller.style.left="0";newFiller.style.borderLeft=this.borderStringB;this.bottomContainer.appendChild(newFiller);break;case"br":newFiller.style.top=newFiller.style.right="0";newFiller.style.borderRight=this.borderStringB;this.bottomContainer.appendChild(newFiller);}}
var newFillerBar=document.createElement("div");if(filter)newFillerBar.style.filter=filter;newFillerBar.style.position="relative";newFillerBar.style.fontSize="1px";newFillerBar.style.overflow="hidden";newFillerBar.style.width=this.fillerWidth(z);newFillerBar.style.backgroundColor=this.boxColour;newFillerBar.style.backgroundImage=this.backgroundImage;newFillerBar.style.backgroundRepeat=this.backgroundRepeat;switch(z){case"t":if(this.topContainer){if(curvyBrowser.quirksMode){newFillerBar.style.height=100+topMaxRadius+"px";}else{newFillerBar.style.height=100+topMaxRadius-this.borderWidth+"px";}
newFillerBar.style.marginLeft=this.spec.tlR?(this.spec.tlR-this.borderWidthL)+"px":"0";newFillerBar.style.borderTop=this.borderString;if(this.backgroundImage){var x_offset=this.spec.tlR?(this.backgroundPosX-(topMaxRadius-this.borderWidthL))+"px ":"0 ";newFillerBar.style.backgroundPosition=x_offset+this.backgroundPosY+"px";this.shell.style.backgroundPosition=this.backgroundPosX+"px "+(this.backgroundPosY-topMaxRadius+this.borderWidthL)+"px";}
this.topContainer.appendChild(newFillerBar);}
break;case"b":if(this.bottomContainer){if(curvyBrowser.quirksMode){newFillerBar.style.height=botMaxRadius+"px";}else{newFillerBar.style.height=botMaxRadius-this.borderWidthB+"px";}
newFillerBar.style.marginLeft=this.spec.blR?(this.spec.blR-this.borderWidthL)+"px":"0";newFillerBar.style.borderBottom=this.borderStringB;if(this.backgroundImage){var x_offset=this.spec.blR?(this.backgroundPosX+this.borderWidthL-botMaxRadius)+"px ":this.backgroundPosX+"px ";newFillerBar.style.backgroundPosition=x_offset+(this.backgroundPosY-clientHeight-this.borderWidth+botMaxRadius)+"px";}
this.bottomContainer.appendChild(newFillerBar);}}}
this.contentContainer.style.position="absolute";this.contentContainer.className="autoPadDiv";this.contentContainer.style.left=this.borderWidthL+"px";this.contentContainer.style.paddingTop=this.topPadding+"px";this.contentContainer.style.top=this.borderWidth+"px";this.contentContainer.style.paddingLeft=this.leftPadding+"px";this.contentContainer.style.paddingRight=this.rightPadding+"px";z=clientWidth;if(!curvyBrowser.quirksMode)z-=this.leftPadding+this.rightPadding;this.contentContainer.style.width=z+"px";this.contentContainer.style.textAlign=curvyBrowser.get_style(this.box,'textAlign');this.box.style.textAlign='left';this.box.appendChild(this.contentContainer);if(boxDisp)boxDisp.style.display='none';}
if(this.backgroundImage){backgroundPosX=this.backgroundCheck(backgroundPosX);backgroundPosY=this.backgroundCheck(backgroundPosY);if(this.backgroundObject){this.backgroundObject.holdingElement=this;this.dispatch=this.applyCorners;this.applyCorners=function(){if(this.backgroundObject.complete)
this.dispatch();else this.backgroundObject.onload=new Function('curvyObject.dispatch(this.holdingElement);');}}}}
curvyObject.prototype.backgroundCheck=function(style){if(style==='top'||style==='left'||parseInt(style)===0)return 0;if(!(/^[-\d.]+px$/.test(style))&&!this.backgroundObject){this.backgroundObject=new Image;var imgName=function(str){var matches=/url\("?([^'"]+)"?\)/.exec(str);return(matches?matches[1]:str);}
this.backgroundObject.src=imgName(this.backgroundImage);}
return style;}
curvyObject.dispatch=function(obj){if('dispatch'in obj)
obj.dispatch();else throw obj.newError('No dispatch function');}
curvyObject.prototype.drawPixel=function(intx,inty,colour,transAmount,height,newCorner,image,cornerRadius){var pixel=document.createElement("div");pixel.style.height=height+"px";pixel.style.width="1px";pixel.style.position="absolute";pixel.style.fontSize="1px";pixel.style.overflow="hidden";var topMaxRadius=this.spec.get('tR');pixel.style.backgroundColor=colour;if(image&&this.backgroundImage!=""){pixel.style.backgroundImage=this.backgroundImage;pixel.style.backgroundPosition="-"+(this.boxWidth-(cornerRadius-intx)+this.borderWidth)+"px -"+((this.boxHeight+topMaxRadius+inty)-this.borderWidth)+"px";}
if(transAmount!=100)curvyObject.setOpacity(pixel,transAmount);pixel.style.top=inty+"px";pixel.style.left=intx+"px";newCorner.appendChild(pixel);}
curvyObject.prototype.fillerWidth=function(tb){var bWidth=curvyBrowser.quirksMode?0:this.spec.radiusCount(tb)*this.borderWidthL;return(this.boxWidth-this.spec.radiusSum(tb)+bWidth)+'px';}
curvyObject.prototype.errmsg=function(msg,gravity){var extradata="\ntag: "+this.box.tagName;if(this.box.id)extradata+="\nid: "+this.box.id;if(this.box.className)extradata+="\nclass: "+this.box.className;var parent;if((parent=this.box.parentNode)===null)
extradata+="\n(box has no parent)";else{extradata+="\nParent tag: "+parent.tagName;if(parent.id)extradata+="\nParent ID: "+parent.id;if(parent.className)extradata+="\nParent class: "+parent.className;}
if(gravity===undefined)gravity='warning';return'curvyObject '+gravity+":\n"+msg+extradata;}
curvyObject.prototype.newError=function(msg){return new Error(this.errmsg(msg,'exception'));}
curvyObject.IntToHex=function(strNum){var hexdig=['0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'];return hexdig[strNum>>>4]+''+hexdig[strNum&15];}
curvyObject.BlendColour=function(Col1,Col2,Col1Fraction){if(Col1==='transparent'||Col2==='transparent')throw this.newError('Cannot blend with transparent');if(Col1.charAt(0)!=='#'){Col1=curvyObject.format_colour(Col1);}
if(Col2.charAt(0)!=='#'){Col2=curvyObject.format_colour(Col2);}
var red1=parseInt(Col1.substr(1,2),16);var green1=parseInt(Col1.substr(3,2),16);var blue1=parseInt(Col1.substr(5,2),16);var red2=parseInt(Col2.substr(1,2),16);var green2=parseInt(Col2.substr(3,2),16);var blue2=parseInt(Col2.substr(5,2),16);if(Col1Fraction>1||Col1Fraction<0)Col1Fraction=1;var endRed=Math.round((red1*Col1Fraction)+(red2*(1-Col1Fraction)));if(endRed>255)endRed=255;if(endRed<0)endRed=0;var endGreen=Math.round((green1*Col1Fraction)+(green2*(1-Col1Fraction)));if(endGreen>255)endGreen=255;if(endGreen<0)endGreen=0;var endBlue=Math.round((blue1*Col1Fraction)+(blue2*(1-Col1Fraction)));if(endBlue>255)endBlue=255;if(endBlue<0)endBlue=0;return"#"+curvyObject.IntToHex(endRed)+curvyObject.IntToHex(endGreen)+curvyObject.IntToHex(endBlue);}
curvyObject.pixelFraction=function(x,y,r){var fraction;var rsquared=r*r;var xvalues=new Array(2);var yvalues=new Array(2);var point=0;var whatsides="";var intersect=Math.sqrt(rsquared-Math.pow(x,2));if(intersect>=y&&intersect<(y+1)){whatsides="Left";xvalues[point]=0;yvalues[point]=intersect-y;++point;}
intersect=Math.sqrt(rsquared-Math.pow(y+1,2));if(intersect>=x&&intersect<(x+1)){whatsides+="Top";xvalues[point]=intersect-x;yvalues[point]=1;++point;}
intersect=Math.sqrt(rsquared-Math.pow(x+1,2));if(intersect>=y&&intersect<(y+1)){whatsides+="Right";xvalues[point]=1;yvalues[point]=intersect-y;++point;}
intersect=Math.sqrt(rsquared-Math.pow(y,2));if(intersect>=x&&intersect<(x+1)){whatsides+="Bottom";xvalues[point]=intersect-x;yvalues[point]=0;}
switch(whatsides){case"LeftRight":fraction=Math.min(yvalues[0],yvalues[1])+((Math.max(yvalues[0],yvalues[1])-Math.min(yvalues[0],yvalues[1]))/2);break;case"TopRight":fraction=1-(((1-xvalues[0])*(1-yvalues[1]))/2);break;case"TopBottom":fraction=Math.min(xvalues[0],xvalues[1])+((Math.max(xvalues[0],xvalues[1])-Math.min(xvalues[0],xvalues[1]))/2);break;case"LeftBottom":fraction=yvalues[0]*xvalues[1]/2;break;default:fraction=1;}
return fraction;}
curvyObject.rgb2Array=function(rgbColour){var rgbValues=rgbColour.substring(4,rgbColour.indexOf(")"));return rgbValues.split(", ");}
curvyObject.rgb2Hex=function(rgbColour){try{var rgbArray=curvyObject.rgb2Array(rgbColour);var red=parseInt(rgbArray[0]);var green=parseInt(rgbArray[1]);var blue=parseInt(rgbArray[2]);var hexColour="#"+curvyObject.IntToHex(red)+curvyObject.IntToHex(green)+curvyObject.IntToHex(blue);}
catch(e){var msg='getMessage'in e?e.getMessage():e.message;throw new Error("Error ("+msg+") converting RGB value to Hex in rgb2Hex");}
return hexColour;}
curvyObject.setOpacity=function(obj,opacity){opacity=(opacity==100)?99.999:opacity;if(curvyBrowser.isSafari&&obj.tagName!="IFRAME"){var rgbArray=curvyObject.rgb2Array(obj.style.backgroundColor);var red=parseInt(rgbArray[0]);var green=parseInt(rgbArray[1]);var blue=parseInt(rgbArray[2]);obj.style.backgroundColor="rgba("+red+", "+green+", "+blue+", "+opacity/100+")";}
else if(typeof obj.style.opacity!=="undefined"){obj.style.opacity=opacity/100;}
else if(typeof obj.style.MozOpacity!=="undefined"){obj.style.MozOpacity=opacity/100;}
else if(typeof obj.style.filter!="undefined"){obj.style.filter="alpha(opacity="+opacity+")";}
else if(typeof obj.style.KHTMLOpacity!="undefined"){obj.style.KHTMLOpacity=opacity/100;}}
function addEvent(elm,evType,fn,useCapture){if(elm.addEventListener){elm.addEventListener(evType,fn,useCapture);return true;}
if(elm.attachEvent)return elm.attachEvent('on'+evType,fn);elm['on'+evType]=fn;return false;}
curvyObject.getComputedColour=function(colour){var d=document.createElement('DIV');d.style.backgroundColor=colour;document.body.appendChild(d);if(window.getComputedStyle){var rtn=document.defaultView.getComputedStyle(d,null).getPropertyValue('background-color');d.parentNode.removeChild(d);if(rtn.substr(0,3)==="rgb")rtn=curvyObject.rgb2Hex(rtn);return rtn;}
else{var rng=document.body.createTextRange();rng.moveToElementText(d);rng.execCommand('ForeColor',false,colour);var iClr=rng.queryCommandValue('ForeColor');var rgb="rgb("+(iClr&0xFF)+", "+((iClr&0xFF00)>>8)+", "+((iClr&0xFF0000)>>16)+")";d.parentNode.removeChild(d);rng=null;return curvyObject.rgb2Hex(rgb);}}
curvyObject.format_colour=function(colour){if(colour!=""&&colour!="transparent"){if(colour.substr(0,3)==="rgb"){colour=curvyObject.rgb2Hex(colour);}
else if(colour.charAt(0)!=='#'){colour=curvyObject.getComputedColour(colour);}
else if(colour.length===4){colour="#"+colour.charAt(1)+colour.charAt(1)+colour.charAt(2)+colour.charAt(2)+colour.charAt(3)+colour.charAt(3);}}
return colour;}
curvyCorners.getElementsByClass=function(searchClass,node){var classElements=new Array;if(node===undefined)node=document;searchClass=searchClass.split('.');var tag='*';if(searchClass.length===1){tag=searchClass[0];searchClass=false;}
else{if(searchClass[0])tag=searchClass[0];searchClass=searchClass[1];}
var i,els,elsLen;if(tag.charAt(0)==='#'){els=document.getElementById(tag.substr(1));if(els)classElements.push(els);}
else{els=node.getElementsByTagName(tag);elsLen=els.length;if(searchClass){var pattern=new RegExp("(^|\\s)"+searchClass+"(\\s|$)");for(i=0;i<elsLen;++i){if(pattern.test(els[i].className))classElements.push(els[i]);}}
else for(i=0;i<elsLen;++i)classElements.push(els[i]);}
return classElements;}
if(curvyBrowser.isMoz||curvyBrowser.isWebKit)
var curvyCornersNoAutoScan=true;else{curvyCorners.scanStyles=function(){function units(num){var matches=/^[\d.]+(\w+)$/.exec(num);return matches[1];}
var t,i,j;if(curvyBrowser.isIE){function procIEStyles(rule){var style=rule.style;if(curvyBrowser.ieVer>6.0){var allR=style['-webkit-border-radius']||0;var tR=style['-webkit-border-top-right-radius']||0;var tL=style['-webkit-border-top-left-radius']||0;var bR=style['-webkit-border-bottom-right-radius']||0;var bL=style['-webkit-border-bottom-left-radius']||0;}
else{var allR=style['webkit-border-radius']||0;var tR=style['webkit-border-top-right-radius']||0;var tL=style['webkit-border-top-left-radius']||0;var bR=style['webkit-border-bottom-right-radius']||0;var bL=style['webkit-border-bottom-left-radius']||0;}
if(allR||tL||tR||bR||bL){var settings=new curvyCnrSpec(rule.selectorText);if(allR)
settings.setcorner(null,null,parseInt(allR),units(allR));else{if(tR)settings.setcorner('t','r',parseInt(tR),units(tR));if(tL)settings.setcorner('t','l',parseInt(tL),units(tL));if(bL)settings.setcorner('b','l',parseInt(bL),units(bL));if(bR)settings.setcorner('b','r',parseInt(bR),units(bR));}
curvyCorners(settings);}}
for(t=0;t<document.styleSheets.length;++t){if(document.styleSheets[t].imports){for(i=0;i<document.styleSheets[t].imports.length;++i)
for(j=0;j<document.styleSheets[t].imports[i].rules.length;++j)
procIEStyles(document.styleSheets[t].imports[i].rules[j]);}
for(i=0;i<document.styleSheets[t].rules.length;++i)
procIEStyles(document.styleSheets[t].rules[i]);}}
else if(curvyBrowser.isOp){for(t=0;t<document.styleSheets.length;++t){if(operasheet.contains_border_radius(t)){j=new operasheet(t);for(i in j.rules)if(!isNaN(i))
curvyCorners(j.rules[i]);}}}
else curvyCorners.alert('Scanstyles does nothing in Webkit/Firefox');};curvyCorners.init=function(){if(arguments.callee.done)return;arguments.callee.done=true;if(curvyBrowser.isWebKit&&curvyCorners.init.timer){clearInterval(curvyCorners.init.timer);curvyCorners.init.timer=null;}
curvyCorners.scanStyles();};}
if(typeof curvyCornersNoAutoScan==='undefined'||curvyCornersNoAutoScan===false){if(curvyBrowser.isOp)
document.addEventListener("DOMContentLoaded",curvyCorners.init,false);else addEvent(window,'load',curvyCorners.init,false);}
var arrowimages={down:['downarrowclass','includes/images/plus.gif',25],right:['rightarrowclass','includes/images/plus.gif']}
var jquerycssmenu={fadesettings:{overduration:100,outduration:100},buildmenu:function(menuid,arrowsvar){jQuery(document).ready(function($){var $mainmenu=$("#"+menuid+">ul")
var $headers=$mainmenu.find("ul").parent()
$headers.each(function(i){var $curobj=$(this)
var $subul=$(this).find('ul:eq(0)')
this._dimensions={w:this.offsetWidth,h:this.offsetHeight,subulw:$subul.outerWidth(),subulh:$subul.outerHeight()}
this.istopheader=$curobj.parents("ul").length==1?true:false
$subul.css({top:this.istopheader?this._dimensions.h+"px":0})
$curobj.children("a:eq(0)").css(this.istopheader?{paddingRight:arrowsvar.down[2]}:{}).append('<img src="'+(this.istopheader?arrowsvar.down[1]:arrowsvar.right[1])
+'" class="'+(this.istopheader?arrowsvar.down[0]:arrowsvar.right[0])
+'" style="border:0;" />')
$curobj.hover(function(e){var $targetul=$(this).children("ul:eq(0)")
this._offsets={left:$(this).offset().left,top:$(this).offset().top}
var menuleft=this.istopheader?0:this._dimensions.w
menuleft=(this._offsets.left+menuleft+this._dimensions.subulw>$(window).width())?(this.istopheader?-this._dimensions.subulw+this._dimensions.w:-this._dimensions.w):menuleft
$targetul.css({left:menuleft+"px"}).fadeIn(jquerycssmenu.fadesettings.overduration)},function(e){$(this).children("ul:eq(0)").fadeOut(jquerycssmenu.fadesettings.outduration)})})
$mainmenu.find("ul").css({display:'none',visibility:'visible'})})}}
jquerycssmenu.buildmenu("myjquerymenu",arrowimages)
$.fn.equalHeights=function(px){$(this).each(function(){var currentTallest=0;$(this).children().each(function(i){if($(this).height()>currentTallest){currentTallest=$(this).height();}});if(!px||!Number.prototype.pxToEm)currentTallest=currentTallest.pxToEm();if($.browser.msie&&$.browser.version==6.0){$(this).children().css({'height':currentTallest});}
$(this).children().css({'min-height':currentTallest});});return this;};$.fn.equalWidths=function(px){$(this).each(function(){var currentWidest=0;$(this).children().each(function(i){if($(this).width()>currentWidest){currentWidest=$(this).width();}});if(!px||!Number.prototype.pxToEm)currentWidest=currentWidest.pxToEm();if($.browser.msie&&$.browser.version==6.0){$(this).children().css({'width':currentWidest});}
$(this).children().css({'min-width':currentWidest});});return this;};Number.prototype.pxToEm=String.prototype.pxToEm=function(settings){settings=jQuery.extend({scope:'body',reverse:false},settings);var pxVal=(this=='')?0:parseFloat(this);var scopeVal;var getWindowWidth=function(){var de=document.documentElement;return self.innerWidth||(de&&de.clientWidth)||document.body.clientWidth;};if(settings.scope=='body'&&$.browser.msie&&(parseFloat($('body').css('font-size'))/getWindowWidth()).toFixed(1)>0.0){var calcFontSize=function(){return(parseFloat($('body').css('font-size'))/getWindowWidth()).toFixed(3)*16;};scopeVal=calcFontSize();}
else{scopeVal=parseFloat(jQuery(settings.scope).css("font-size"));};var result=(settings.reverse==true)?(pxVal*scopeVal).toFixed(2)+'px':(pxVal/scopeVal).toFixed(2)+'em';return result;};
(function(C){C.ui={plugin:{add:function(E,D,H){var G=C.ui[E].prototype;for(var F in H){G.plugins[F]=G.plugins[F]||[];G.plugins[F].push([D,H[F]])}},call:function(D,F,E){var H=D.plugins[F];if(!H){return}for(var G=0;G<H.length;G++){if(D.options[H[G][0]]){H[G][1].apply(D.element,E)}}}},cssCache:{},css:function(D){if(C.ui.cssCache[D]){return C.ui.cssCache[D]}var E=C('<div class="ui-gen">').addClass(D).css({position:"absolute",top:"-5000px",left:"-5000px",display:"block"}).appendTo("body");C.ui.cssCache[D]=!!((!(/auto|default/).test(E.css("cursor"))||(/^[1-9]/).test(E.css("height"))||(/^[1-9]/).test(E.css("width"))||!(/none/).test(E.css("backgroundImage"))||!(/transparent|rgba\(0, 0, 0, 0\)/).test(E.css("backgroundColor"))));try{C("body").get(0).removeChild(E.get(0))}catch(F){}return C.ui.cssCache[D]},disableSelection:function(D){C(D).attr("unselectable","on").css("MozUserSelect","none")},enableSelection:function(D){C(D).attr("unselectable","off").css("MozUserSelect","")},hasScroll:function(G,D){var F=/top/.test(D||"top")?"scrollTop":"scrollLeft",E=false;if(G[F]>0){return true}G[F]=1;E=G[F]>0?true:false;G[F]=0;return E}};var A=C.fn.remove;C.fn.remove=function(){C("*",this).add(this).triggerHandler("remove");return A.apply(this,arguments)};function B(F,D,G){var E=C[F][D].getter||[];E=(typeof E=="string"?E.split(/,?\s+/):E);return(C.inArray(G,E)!=-1)}C.widget=function(D,E){var F=D.split(".")[0];D=D.split(".")[1];C.fn[D]=function(J){var H=(typeof J=="string"),I=Array.prototype.slice.call(arguments,1);if(H&&B(F,D,J)){var G=C.data(this[0],D);return(G?G[J].apply(G,I):undefined)}return this.each(function(){var K=C.data(this,D);if(H&&K&&C.isFunction(K[J])){K[J].apply(K,I)}else{if(!H){C.data(this,D,new C[F][D](this,J))}}})};C[F][D]=function(H,I){var G=this;this.widgetName=D;this.widgetBaseClass=F+"-"+D;this.options=C.extend({},C.widget.defaults,C[F][D].defaults,I);this.element=C(H).bind("setData."+D,function(L,J,K){return G.setData(J,K)}).bind("getData."+D,function(K,J){return G.getData(J)}).bind("remove",function(){return G.destroy()});this.init()};C[F][D].prototype=C.extend({},C.widget.prototype,E)};C.widget.prototype={init:function(){},destroy:function(){this.element.removeData(this.widgetName)},getData:function(D){return this.options[D]},setData:function(D,E){this.options[D]=E;if(D=="disabled"){this.element[E?"addClass":"removeClass"](this.widgetBaseClass+"-disabled")}},enable:function(){this.setData("disabled",false)},disable:function(){this.setData("disabled",true)}};C.widget.defaults={disabled:false};C.ui.mouse={mouseInit:function(){var D=this;this.element.bind("mousedown."+this.widgetName,function(E){return D.mouseDown(E)});if(C.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");this.element.attr("unselectable","on")}this.started=false},mouseDestroy:function(){this.element.unbind("."+this.widgetName);(C.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable))},mouseDown:function(F){(this._mouseStarted&&this.mouseUp(F));this._mouseDownEvent=F;var D=this,G=(F.which==1),E=(typeof this.options.cancel=="string"?C(F.target).parents().add(F.target).filter(this.options.cancel).length:false);if(!G||E||!this.mouseCapture(F)){return true}this._mouseDelayMet=!this.options.delay;if(!this._mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){D._mouseDelayMet=true},this.options.delay)}if(this.mouseDistanceMet(F)&&this.mouseDelayMet(F)){this._mouseStarted=(this.mouseStart(F)!==false);if(!this._mouseStarted){F.preventDefault();return true}}this._mouseMoveDelegate=function(H){return D.mouseMove(H)};this._mouseUpDelegate=function(H){return D.mouseUp(H)};C(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);return false},mouseMove:function(D){if(C.browser.msie&&!D.button){return this.mouseUp(D)}if(this._mouseStarted){this.mouseDrag(D);return false}if(this.mouseDistanceMet(D)&&this.mouseDelayMet(D)){this._mouseStarted=(this.mouseStart(this._mouseDownEvent,D)!==false);(this._mouseStarted?this.mouseDrag(D):this.mouseUp(D))}return!this._mouseStarted},mouseUp:function(D){C(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this.mouseStop(D)}return false},mouseDistanceMet:function(D){return(Math.max(Math.abs(this._mouseDownEvent.pageX-D.pageX),Math.abs(this._mouseDownEvent.pageY-D.pageY))>=this.options.distance)},mouseDelayMet:function(D){return this._mouseDelayMet},mouseStart:function(D){},mouseDrag:function(D){},mouseStop:function(D){},mouseCapture:function(D){return true}};C.ui.mouse.defaults={cancel:null,distance:1,delay:0}})(jQuery);(function(A){A.widget("ui.tabs",{init:function(){this.options.event+=".tabs";this.tabify(true)},setData:function(B,C){if((/^selected/).test(B)){this.select(C)}else{this.options[B]=C;this.tabify()}},length:function(){return this.$tabs.length},tabId:function(B){return B.title&&B.title.replace(/\s/g,"_").replace(/[^A-Za-z0-9\-_:\.]/g,"")||this.options.idPrefix+A.data(B)},ui:function(C,B){return{options:this.options,tab:C,panel:B,index:this.$tabs.index(C)}},tabify:function(P){this.$lis=A("li:has(a[href])",this.element);this.$tabs=this.$lis.map(function(){return A("a",this)[0]});this.$panels=A([]);var O=this,E=this.options;this.$tabs.each(function(R,Q){if(Q.hash&&Q.hash.replace("#","")){O.$panels=O.$panels.add(Q.hash)}else{if(A(Q).attr("href")!="#"){A.data(Q,"href.tabs",Q.href);A.data(Q,"load.tabs",Q.href);var T=O.tabId(Q);Q.href="#"+T;var S=A("#"+T);if(!S.length){S=A(E.panelTemplate).attr("id",T).addClass(E.panelClass).insertAfter(O.$panels[R-1]||O.element);S.data("destroy.tabs",true)}O.$panels=O.$panels.add(S)}else{E.disabled.push(R+1)}}});if(P){this.element.addClass(E.navClass);this.$panels.each(function(){var Q=A(this);Q.addClass(E.panelClass)});if(E.selected===undefined){if(location.hash){this.$tabs.each(function(T,Q){if(Q.hash==location.hash){E.selected=T;if(A.browser.msie||A.browser.opera){var S=A(location.hash),R=S.attr("id");S.attr("id","");setTimeout(function(){S.attr("id",R)},500)}scrollTo(0,0);return false}})}else{if(E.cookie){var I=parseInt(A.cookie("ui-tabs"+A.data(O.element)),10);if(I&&O.$tabs[I]){E.selected=I}}else{if(O.$lis.filter("."+E.selectedClass).length){E.selected=O.$lis.index(O.$lis.filter("."+E.selectedClass)[0])}}}}E.selected=E.selected===null||E.selected!==undefined?E.selected:0;E.disabled=A.unique(E.disabled.concat(A.map(this.$lis.filter("."+E.disabledClass),function(R,Q){return O.$lis.index(R)}))).sort();if(A.inArray(E.selected,E.disabled)!=-1){E.disabled.splice(A.inArray(E.selected,E.disabled),1)}this.$panels.addClass(E.hideClass);this.$lis.removeClass(E.selectedClass);if(E.selected!==null){this.$panels.eq(E.selected).show().removeClass(E.hideClass);this.$lis.eq(E.selected).addClass(E.selectedClass);var B=function(){A(O.element).triggerHandler("tabsshow",[O.fakeEvent("tabsshow"),O.ui(O.$tabs[E.selected],O.$panels[E.selected])],E.show)};if(A.data(this.$tabs[E.selected],"load.tabs")){this.load(E.selected,B)}else{B()}}A(window).bind("unload",function(){O.$tabs.unbind(".tabs");O.$lis=O.$tabs=O.$panels=null})}for(var H=0,N;N=this.$lis[H];H++){A(N)[A.inArray(H,E.disabled)!=-1&&!A(N).hasClass(E.selectedClass)?"addClass":"removeClass"](E.disabledClass)}if(E.cache===false){this.$tabs.removeData("cache.tabs")}var J,D,K={"min-width":0,duration:1},F="normal";if(E.fx&&E.fx.constructor==Array){J=E.fx[0]||K,D=E.fx[1]||K}else{J=D=E.fx||K}var C={display:"",overflow:"",height:""};if(!A.browser.msie){C.opacity=""}function M(R,Q,S){Q.animate(J,J.duration||F,function(){Q.addClass(E.hideClass).css(C);if(A.browser.msie&&J.opacity){Q[0].style.filter=""}if(S){L(R,S,Q)}})}function L(R,S,Q){if(D===K){S.css("display","block")}S.animate(D,D.duration||F,function(){S.removeClass(E.hideClass).css(C);if(A.browser.msie&&D.opacity){S[0].style.filter=""}A(O.element).triggerHandler("tabsshow",[O.fakeEvent("tabsshow"),O.ui(R,S[0])],E.show)})}function G(R,T,Q,S){T.addClass(E.selectedClass).siblings().removeClass(E.selectedClass);M(R,Q,S)}this.$tabs.unbind(".tabs").bind(E.event,function(){var T=A(this).parents("li:eq(0)"),Q=O.$panels.filter(":visible"),S=A(this.hash);if((T.hasClass(E.selectedClass)&&!E.unselect)||T.hasClass(E.disabledClass)||A(this).hasClass(E.loadingClass)||A(O.element).triggerHandler("tabsselect",[O.fakeEvent("tabsselect"),O.ui(this,S[0])],E.select)===false){this.blur();return false}O.options.selected=O.$tabs.index(this);if(E.unselect){if(T.hasClass(E.selectedClass)){O.options.selected=null;T.removeClass(E.selectedClass);O.$panels.stop();M(this,Q);this.blur();return false}else{if(!Q.length){O.$panels.stop();var R=this;O.load(O.$tabs.index(this),function(){T.addClass(E.selectedClass).addClass(E.unselectClass);L(R,S)});this.blur();return false}}}if(E.cookie){A.cookie("ui-tabs"+A.data(O.element),O.options.selected,E.cookie)}O.$panels.stop();if(S.length){var R=this;O.load(O.$tabs.index(this),Q.length?function(){G(R,T,Q,S)}:function(){T.addClass(E.selectedClass);L(R,S)})}else{throw"jQuery UI Tabs: Mismatching fragment identifier."}if(A.browser.msie){this.blur()}return false});if(!(/^click/).test(E.event)){this.$tabs.bind("click.tabs",function(){return false})}},add:function(E,D,C){if(C==undefined){C=this.$tabs.length}var G=this.options;var I=A(G.tabTemplate.replace(/#\{href\}/g,E).replace(/#\{label\}/g,D));I.data("destroy.tabs",true);var H=E.indexOf("#")==0?E.replace("#",""):this.tabId(A("a:first-child",I)[0]);var F=A("#"+H);if(!F.length){F=A(G.panelTemplate).attr("id",H).addClass(G.hideClass).data("destroy.tabs",true)}F.addClass(G.panelClass);if(C>=this.$lis.length){I.appendTo(this.element);F.appendTo(this.element[0].parentNode)}else{I.insertBefore(this.$lis[C]);F.insertBefore(this.$panels[C])}G.disabled=A.map(G.disabled,function(K,J){return K>=C?++K:K});this.tabify();if(this.$tabs.length==1){I.addClass(G.selectedClass);F.removeClass(G.hideClass);var B=A.data(this.$tabs[0],"load.tabs");if(B){this.load(C,B)}}this.element.triggerHandler("tabsadd",[this.fakeEvent("tabsadd"),this.ui(this.$tabs[C],this.$panels[C])],G.add)},remove:function(B){var D=this.options,E=this.$lis.eq(B).remove(),C=this.$panels.eq(B).remove();if(E.hasClass(D.selectedClass)&&this.$tabs.length>1){this.select(B+(B+1<this.$tabs.length?1:-1))}D.disabled=A.map(A.grep(D.disabled,function(G,F){return G!=B}),function(G,F){return G>=B?--G:G});this.tabify();this.element.triggerHandler("tabsremove",[this.fakeEvent("tabsremove"),this.ui(E.find("a")[0],C[0])],D.remove)},enable:function(B){var C=this.options;if(A.inArray(B,C.disabled)==-1){return}var D=this.$lis.eq(B).removeClass(C.disabledClass);if(A.browser.safari){D.css("display","inline-block");setTimeout(function(){D.css("display","block")},0)}C.disabled=A.grep(C.disabled,function(F,E){return F!=B});this.element.triggerHandler("tabsenable",[this.fakeEvent("tabsenable"),this.ui(this.$tabs[B],this.$panels[B])],C.enable)},disable:function(C){var B=this,D=this.options;if(C!=D.selected){this.$lis.eq(C).addClass(D.disabledClass);D.disabled.push(C);D.disabled.sort();this.element.triggerHandler("tabsdisable",[this.fakeEvent("tabsdisable"),this.ui(this.$tabs[C],this.$panels[C])],D.disable)}},select:function(B){if(typeof B=="string"){B=this.$tabs.index(this.$tabs.filter("[href$="+B+"]")[0])}this.$tabs.eq(B).trigger(this.options.event)},load:function(G,K){var L=this,D=this.options,E=this.$tabs.eq(G),J=E[0],H=K==undefined||K===false,B=E.data("load.tabs");K=K||function(){};if(!B||!H&&A.data(J,"cache.tabs")){K();return}var M=function(N){var O=A(N),P=O.find("*:last");return P.length&&P.is(":not(img)")&&P||O};var C=function(){L.$tabs.filter("."+D.loadingClass).removeClass(D.loadingClass).each(function(){if(D.spinner){M(this).parent().html(M(this).data("label.tabs"))}});L.xhr=null};if(D.spinner){var I=M(J).html();M(J).wrapInner("<em></em>").find("em").data("label.tabs",I).html(D.spinner)}var F=A.extend({},D.ajaxOptions,{url:B,success:function(O,N){A(J.hash).html(O);C();if(D.cache){A.data(J,"cache.tabs",true)}A(L.element).triggerHandler("tabsload",[L.fakeEvent("tabsload"),L.ui(L.$tabs[G],L.$panels[G])],D.load);D.ajaxOptions.success&&D.ajaxOptions.success(O,N);K()}});if(this.xhr){this.xhr.abort();C()}E.addClass(D.loadingClass);setTimeout(function(){L.xhr=A.ajax(F)},0)},url:function(C,B){this.$tabs.eq(C).removeData("cache.tabs").data("load.tabs",B)},destroy:function(){var B=this.options;this.element.unbind(".tabs").removeClass(B.navClass).removeData("tabs");this.$tabs.each(function(){var C=A.data(this,"href.tabs");if(C){this.href=C}var D=A(this).unbind(".tabs");A.each(["href","load","cache"],function(F,E){D.removeData(E+".tabs")})});this.$lis.add(this.$panels).each(function(){if(A.data(this,"destroy.tabs")){A(this).remove()}else{A(this).removeClass([B.selectedClass,B.unselectClass,B.disabledClass,B.panelClass,B.hideClass].join(" "))}})},fakeEvent:function(B){return A.event.fix({type:B,target:this.element[0]})}});A.ui.tabs.defaults={unselect:false,event:"click",disabled:[],cookie:null,spinner:"Loading&#8230;",cache:false,idPrefix:"ui-tabs-",ajaxOptions:{},fx:null,tabTemplate:'<li><a href="#{href}"><span>#{label}</span></a></li>',panelTemplate:"<div></div>",navClass:"ui-tabs-nav",selectedClass:"ui-tabs-selected",unselectClass:"ui-tabs-unselect",disabledClass:"ui-tabs-disabled",panelClass:"ui-tabs-panel",hideClass:"ui-tabs-hide",loadingClass:"ui-tabs-loading"};A.ui.tabs.getter="length";A.extend(A.ui.tabs.prototype,{rotation:null,rotate:function(C,F){F=F||false;var B=this,E=this.options.selected;function G(){B.rotation=setInterval(function(){E=++E<B.$tabs.length?E:0;B.select(E)},C)}function D(H){if(!H||H.clientX){clearInterval(B.rotation)}}if(C){G();if(!F){this.$tabs.bind(this.options.event,D)}else{this.$tabs.bind(this.options.event,function(){D();E=B.options.selected;G()})}}else{D();this.$tabs.unbind(this.options.event,D)}}})})(jQuery);
