
/* lib.js */
if(typeof(Sonata)=='undefined')Sonata={};Sonata.JSROOT="/";Sonata.JSPLATFORM="/sonata.lib/";Sonata.isCSS=false;Sonata.isW3C=false;Sonata.isIE4=false;Sonata.isNN4=false;Sonata.isIE6CSS=false;Sonata.isOpera=navigator.userAgent.indexOf("Opera")>-1;if(Sonata.isOpera)Sonata.isIE4=false;Sonata.isIE55=navigator.userAgent.indexOf("MSIE 5.5;")>-1;Sonata.isIE60=navigator.userAgent.indexOf("MSIE 6.0;")>-1;Sonata.isIE70=navigator.userAgent.indexOf("MSIE 7.0;")>-1;Sonata.isFirefox=navigator.userAgent.indexOf("Firefox")>-1;Sonata.isGecko=navigator.userAgent.indexOf("Gecko")>-1;Sonata.isMac=navigator.userAgent.indexOf("Macintosh")>-1;Sonata.isSafari=navigator.userAgent.indexOf("Safari")>-1;if(navigator.userAgent.indexOf("AppleWebKit")>-1)
Sonata.isSafari=true;if(Sonata.isMac||Sonata.isSafari)Sonata.isGecko=false;if(Sonata.isIE55||Sonata.isIE60)Sonata.isIE4=true;Sonata.isIE=false;if(Sonata.isIE4||Sonata.isIE55||Sonata.isIE60||Sonata.isIE70)
Sonata.isIE=true;if(Sonata.isOpera)Sonata.isIE=false;Sonata.init=function()
{var ua=navigator.userAgent;if(document.images)
{Sonata.isCSS=(document.body&&document.body.style)?true:false;Sonata.isW3C=(Sonata.isCSS&&document.getElementById)?true:false;Sonata.isIE4=(Sonata.isCSS&&document.all)?true:false;Sonata.isNN4=(document.layers)?true:false;Sonata.isIE6CSS=(document.compatMode&&document.compatMode.indexOf("CSS1")>=0)?true:false;Sonata.isOpera=ua.indexOf("Opera")>-1;if(Sonata.isOpera)Sonata.isIE4=false;Sonata.isIE55=ua.indexOf("MSIE 5.5;")>-1;Sonata.isIE60=ua.indexOf("MSIE 6.0;")>-1;Sonata.isIE70=ua.indexOf("MSIE 7.0")>-1;}}
$(document).ready(Sonata.init);Sonata.eval=function(text)
{var v='('+text+')';return eval(v);}
Sonata.defArg=function(arg,def){var ret=typeof arg=='undefined'?def:arg;return ret;}
if(typeof Sonata=='undefined')
Sonata={};Sonata.include_lib=function(file)
{Sonata.include(Sonata.JSPLATFORM+file);}
Sonata.include_root=function(file)
{Sonata.include(Sonata.JSROOT+file);}
Sonata.include=function(script_filename)
{Sonata.include.include_once(script_filename);}
include=Sonata.include;include_lib=Sonata.include_lib;include_root=Sonata.include_root;Sonata.include.included_files=new Array();Sonata.include._include_string="";Sonata.include.include_once=function(script_filename)
{if(!in_array(script_filename,Sonata.include.included_files))
{Sonata.include.included_files[Sonata.include.included_files.length]=script_filename;Sonata.include.include_dom(script_filename);}
function in_array(name,arr)
{var i,n=arr.length;for(i=0;i<n;i++)
{if(name==arr[i])return true;}
return false;}}
Sonata.include._include_write=function(script_filename)
{document.write('<'+'script');document.write(' language="javascript"');document.write(' type="text/javascript"');document.write(' src="'+script_filename+'">');document.write('</'+'script'+'>');}
Sonata.include._include_write_css=function(script_filename)
{document.write('<'+'link');document.write(' rel="stylesheet"');document.write(' type="text/css"');document.write(' href="'+script_filename+'">');document.write('</'+'link'+'>');}
Sonata.include.include_dom=function(script_filename)
{var html_doc=document.getElementsByTagName('head').item(0);var t=script_filename.substring(script_filename.lastIndexOf('.')+1);var file=null;var sel=2;if(Sonata.isIE55||Sonata.isIE)sel=2;if(Sonata.isFirefox||Sonata.isGecko||Sonata.isOpera)sel=1;if(t=='js')
{if(sel==2)
{Sonata.include._include_write(script_filename);Sonata.include._include_string+="WRITE:"+script_filename+"\n";}
else
{file=document.createElement('script');file.setAttribute('language','javascript');file.setAttribute('type','text/javascript');file.setAttribute('src',script_filename);Sonata.include._include_string+="DOM:"+script_filename+"\n";html_doc.appendChild(file);}}
else if(t=='css')
{if(sel==2)
{Sonata.include._include_write_css(script_filename);Sonata.include._include_string+="WRITE:"+script_filename+"\n";}
else
{file=document.createElement('link');file.setAttribute('rel','stylesheet');file.setAttribute('type','text/css');file.setAttribute('href',script_filename);html_doc.appendChild(file);}}
return false;}
document._uniqueIdCnt=1149;document.uniqueId=function(base,cnt)
{function getnext()
{return document._uniqueIdCnt++;}
if(typeof cnt=="undefined")
cnt=1;if(typeof base=="undefined")
base="u";var id;if(cnt==1)
{id=getnext();return base+id;}
var i;var ret=new Array(cnt);for(i=0;i<cnt;i++)
{id=getnext();ret[i]=base+id;}
return ret;}
Sonata.debugToMain=function(msg,doNewline)
{if(typeof msg=="undefined")msg="";doNewline=typeof doNewline=='undefined'?true:doNewline;if(!Sonata.debugToMain.box)
{createBox();}
prt();function prt()
{msg=cnv(msg);var div;if(doNewline)div=document.createElement('div');else div=document.createElement('span');div.innerHTML=msg;Sonata.debugToMain.box.appendChild(div);return;}
function cnv(str)
{str=str.replace(/\n/g,"<br>");str=str.replace(/\t/g,"&nbsp;&nbsp;&nbsp;&nbsp;");return str;}
function createBox()
{Sonata.debugToMain.box=document.createElement("div");Sonata.debugToMain.box.style.backgroundColor="white";Sonata.debugToMain.box.style.fontFamily="monospace";Sonata.debugToMain.box.style.border="solid red 3px";Sonata.debugToMain.box.style.padding="10px";document.body.appendChild(Sonata.debugToMain.box);var h1=document.createElement("h1");h1.style.textAlign="center";h1.style.backgroundColor="pink";h1.appendChild(document.createTextNode("Debugging Output"));Sonata.debugToMain.box.appendChild(h1);}}
Sonata.debugToMain.box=null;mprint_text=function(msg)
{mprintstr("");var d=document.createTextNode(msg);Sonata.debugToMain.box.appendChild(d);mprint("");}
mprint=function(msg)
{Sonata.debugToMain(msg,true);}
mprintstr=function(msg)
{Sonata.debugToMain(msg,false);}
Sonata.prObject=function(text,obj){var name;mprint(text+" = "+obj);for(name in obj){var v=obj[name];if(typeof v=='function')
v="function";mprint(text+": name="+name+" value="+v);}}
jQuery.timer=function(time,func,callback){var a={timer:setTimeout(func,time),callback:null}
if(typeof(callback)=='function'){a.callback=callback;}
return a;};jQuery.clearTimer=function(a){clearTimeout(a.timer);if(typeof(a.callback)=='function'){a.callback();};return this;};Sonata.Timer=function(time,func){this.timer=setTimeout(func,time);}
Sonata.Timer.prototype.clear=function(){clearTimeout(this.timer);}
Sonata.Timer.setTimer=function(func,time){var t=new Sonata.Timer(time,func);return t;}
GenLib={};GenLib.init=function(){}
if(typeof Doc=='undefined')
Doc={};Doc.POS_LEFT=1;Doc.POS_TOP=2;Doc.POS_RIGHT=3;Doc.POS_BOTTOM=4;Doc.POS_BOTTOMRIGHT=5;Doc.POS_MIDDLERIGHT=6;document.rect=function(left,top,width,height)
{if(typeof left=="undefined")left=0;if(typeof top=="undefined")top=0;if(typeof width=="undefined")width=0;if(typeof height=="undefined")height=0;var r={left:left,top:top,width:width,height:height,right:left+width,bottom:top+height,toString:asString};return r;function asString(label)
{if(typeof label=="undefined")label="";s=label+" left="+r.left+" top="+r.top+" width="+r.width+" height="+r.height+" right="+r.right+" bottom="+r.bottom;return s;}}
document.getPositionElem=function(obj,relative)
{var p=$(obj);var pos=p.offset();var height=p.height();var width=p.width();return document.rect(pos.left,pos.top,width,height);}
Doc.getPositionElem=function(elem){return document.getPositionElem(elem);}
Doc.setPositionAt=function(elemId,atElemId,pos,addLeft,addTop,relative)
{var p=Doc.getPositionAt(elemId,atElemId,pos,addLeft,addTop,relative);Doc.setPosition(elemId,p.left,p.top,relative);return p;}
Doc.uniqueId=function(base,cnt)
{return document.uniqueId(base,cnt);}
Doc.getElementById=function(elemId){var e=$("#"+elemId);if(e.size()!=0)return e[0];return null;}
Doc.setPosition=function(elemId,left,top,relative)
{var d=Doc.getElementById(elemId);if(d)
{Doc.setPositionElem(d,left,top,relative)}}
Doc.setPositionElem=function(d,left,top,relative)
{if(d)
{d.style.left=left+"px";d.style.top=top+"px";function fixup()
{var drect=Doc.getPosition(elemId,relative);if(drect.top!=top)
{d.style.top=(top+2*Math.abs(drect.top-top))+"px";}
if(drect.left!=left)
{d.style.left=(left+2*Math.abs(drect.left-left))+"px";}}}}
Doc.getPositionAt=function(elemId,atElemId,pos,addLeft,addTop,relative)
{var d=Doc.getElementById(elemId);var at=Doc.getElementById(atElemId);return Doc.getPositionElemAt(d,at,pos,addLeft,addTop,relative);}
Doc.getPositionElemAt=function(d,at,pos,addLeft,addTop,relative)
{var left=0;var top=0;if(d&&at)
{if(typeof addLeft=="undefined")
addLeft=0;if(typeof addTop=="undefined")
addTop=0;var drect=Doc.getPositionElem(d,relative);var atrect=Doc.getPositionElem(at,relative);var isie=Sonata.isIE;var adjBottom=isie?-1:1;var adjTop=isie?2:3;var adjRight=isie?2:1;var adjLeft=isie?2:3;var movLeft=isie?0:2;var movDown=isie?0:2;left=atrect.left;top=atrect.top;if(pos==Doc.POS_BOTTOM)
{top=atrect.bottom+adjBottom;left+=movLeft;}
else if(pos==Doc.POS_TOP)
{top=atrect.top+adjTop-drect.height;left+=movLeft;}
else if(pos==Doc.POS_RIGHT)
{left=atrect.right+adjRight;top+=movDown;}
else if(pos==Doc.POS_LEFT)
{left=atrect.left+adjLeft-drect.width;top+=movDown;}
else if(pos==Doc.POS_BOTTOMRIGHT)
{left=atrect.right+adjRight;top=atrect.bottom;}
else if(pos==Doc.POS_MIDDLERIGHT)
{left=atrect.right+adjRight;top=atrect.bottom-atrect.height/2;}
left+=addLeft;top+=addTop;}
return{left:left,top:top,toString:function()
{return"left="+left+" top="+top;}};}
Doc.really_private_counter=100;Doc.bringToFront=function(elementToDrag)
{var par=elementToDrag.parentNode;if(par.childNodes[par.childNodes.length-1]!==elementToDrag)
{elementToDrag.style.zIndex=Doc.really_private_counter+"";Doc.really_private_counter++;par.appendChild(elementToDrag);}}
Sonata.roundies=function(cls,diam){DD_roundies.addRule(cls,diam+'px',true);DD_roundies.addRule(cls+'-top',diam+'px '+diam+'px 0px 0px',true);DD_roundies.addRule(cls+'-bottom','0px 0px '+diam+'px '+diam+'px',true);}
Sonata.getRedArrow=function(e,opts){var defopts=Sonata.getRedArrow.defaultOptions;opts=$.extend(defopts,opts);var textid=document.uniqueId("arrow");var ret={arrow:mkarrow(textid),show:show,hide:hide,textid:textid};return ret;function show(text){var offs=e.offset();var arrow=ret.arrow;arrow.css("position","absolute");arrow.css("display","inline");$('body').append(arrow);if(typeof text=='string'){$("#"+textid).html(text);}
var w=arrow.width();arrow.css("left",(offs.left-w+opts.dx)+'px');arrow.css("top",(offs.top+opts.dy)+'px');arrow.css("visibility","visible");}
function hide(){var arrow=ret.arrow[0];arrow.style.visibility="hidden";try{$("body").remove(arrow);}
catch(excep){}}
function mkarrow(textid){var offs=e.offset();var arrow=$("<span>");arrow.css("position","absolute");arrow.css("left",(offs.left-120)+'px');arrow.css("top",(offs.top)+'px');arrow.attr("id",document.uniqueId("arrow"));var name;for(name in opts.css){arrow.css(name,opts.css[name]);}
arrow.css("display","inline");arrow.html("<span id='"+textid+"' style='cursor:default;'>"+opts.text+"</span> <img src='/sonata.lib/images/redarrow.gif'>");arrow.hide();return arrow;}}
Sonata.getRedArrow.defaultOptions={text:"Please complete",css:{'background-color':"transparent",'font-size':"9pt",'font-family':"arial",color:"red",cursor:"default"},dx:-10,dy:0};;(function($){$.fn.redarrow=fnc;$.fn.redarrow.defOptions=Sonata.getRedArrow.defaultOptions;function fnc(cmd,opts){var dataname="sonataRedArrow";if(typeof cmd!='string'){cmd="make";opts=$.extend({},$.fn.redarrow.defOptions,cmd);}
else{opts=$.extend({},$.fn.redarrow.defOptions,opts);}
var getarr=[];this.each(doit);if(cmd=='get'){if(getarr.length==1)return getarr[0];return getarr;}
return this;function doit(i){var p=$(this);var arrow;switch(cmd){case'make':p.data(dataname,Sonata.getRedArrow(p,opts));break;case'hide':arrow=p.data(dataname);if(arrow)arrow.hide();break;case'show':arrow=p.data(dataname);if(arrow)arrow.show();break;case'get':arrow=p.data(dataname);if(arrow)getarr.push(arrow);else{arrow=Sonata.getRedArrow(p,opts);p.data(dataname,arrow);getarr.push(arrow);}
break;}}}})(jQuery);Sonata.AFTERLIBJS=true;
/* sonata.dropmenu.js */
Sonata.DropLinkOnly=function(idMenuName){this.idMenuName=idMenuName;this.jqMenuName=$("#"+this.idMenuName);this.jqMenuName.mouseenter(Sonata.DropMenu.hideOthers);}
Sonata.DropMenu=function(idMenuName,idMenuItems,options){var thisptr=this;this._setOptions(options);this.idMenuName=idMenuName;this.idMenuItems=idMenuItems;this.isAttached=false;this.attach();this.jqMenuName=$("#"+this.idMenuName);this.jqMenuItems=$("#"+this.idMenuItems);this.timers={show:{},hide:{}};this.isVisible=false;if(this.options.attach)this.attach();Sonata.DropMenu._allMenus.push(this);}
Sonata.DropMenu._defOptions={showDelay:200,hideDelay:500,attach:true,zIndex:100,dx:10,dy:0,blockItem:true,minWidth:0,onshow:null,onhide:null}
Sonata.DropMenu._allMenus=[];Sonata.DropMenu.prototype._setOptions=function(options){var d=Sonata.DropMenu._defOptions;if(typeof(options)=='undefined'){options={};}
var name;var opt={};for(name in d){opt[name]=d[name];}
for(name in options){opt[name]=options[name];}
this.options=opt;}
Sonata.DropMenu.prototype.attach=function(){var thisptr=this;if(this.isAttached)return;this.isAttached=true;this.jqMenuName=$("#"+this.idMenuName);this.jqMenuItems=$("#"+this.idMenuItems);this.jqMenuName.mouseenter(over);this.jqMenuName.mouseleave(out);this.jqMenuItems.mouseenter(overItem);this.jqMenuItems.mouseleave(outItem);this.jqMenuItems.click(clickItem);this.jqMenuItems.css("z-index",this.options.zIndex);if(this.options.blockItem){var hrefs=$("#"+this.idMenuItems+" a");hrefs.css("display","block");}
function over(){thisptr.hideOthers();thisptr.timers.show=jQuery.timer(thisptr.options.showDelay,showOver);}
function showOver(){thisptr.cancelHide();thisptr.timers.show={};thisptr.showItems();}
function out(){thisptr.cancelShow();thisptr.timers.hide=jQuery.timer(thisptr.options.hideDelay,hideOut);}
function hideOut(){thisptr.timers.hide={};thisptr.hideItems();}
function overItem(){thisptr.cancelHide();}
function outItem(){out();}
function clickItem(event){if(typeof event.originalTarget!='undefined'&&typeof event.originalTarget.blur!='undefined')
event.originalTarget.blur();thisptr.hideItems();}
function clickHref(event){this.blur();thisptr.hideItems();event.preventDefault();}}
Sonata.DropMenu.prototype.setMinWidth=function(){var hrefs=$("#"+this.idMenuItems+" a");var hW=hrefs.width();if(this.options.minWidth>0){var w=this.options.minWidth;if(w>hW){hrefs.width(w);}}}
Sonata.DropMenu.prototype.cancelHide=function(){if(typeof this.timers.hide.timer!='undefined')
jQuery.clearTimer(this.timers.hide);this.timers.hide={};}
Sonata.DropMenu.prototype.cancelShow=function(){if(typeof this.timers.show.timer!='undefined')
jQuery.clearTimer(this.timers.show);this.timers.show={};}
Sonata.DropMenu.prototype.showItems=function(){if(this.isVisible)return;this.cancelHide();this.isVisible=true;var menu=this.jqMenuName;var pos=menu.position();var h=menu.height();var w=menu.width();var dx=this.options.dx;var dy=this.options.dy;this.jqMenuItems.css({"left":pos.left+dx,"top":pos.top+h+dy});this.jqMenuItems.show();if(typeof this.options.onshow=='function')
this.options.onshow(this);if(this.options.minWidth>0)
this.setMinWidth();}
Sonata.DropMenu.prototype.hideItems=function(){if(this.isVisible==false)return;this.isVisible=false;this.cancelShow();this.jqMenuItems.hide();if(typeof this.options.onhide=='function')
this.options.onhide(this);}
Sonata.DropMenu.prototype.hideOthers=function(){Sonata.DropMenu.hideOthers();}
Sonata.DropMenu.hideOthers=function(){var a=Sonata.DropMenu._allMenus;var i,n=a.length;var m;for(i=0;i<n;i++){m=a[i];m.hideItems();}}
Sonata.AFTERDROPMENUJS=true;
/* sonata.dialog.js */
Sonata.DialogCtrl=function(options){var defaults={dialogId:"",moverId:"",moverBgColor:"",closeBtnId:"",closeCB:function(dlg){return true;},closeOnEsc:false,modal:true,zindex:90,jqBgPanel:null,bgColor:"#000000",bgAlpha:.5,cb:function(){},userData:{}};this.visible=false;this.isIE6=typeof document.addEventListener!=='function'&&!window.XMLHttpRequest;this.hiddenData={};this.options={};this.options=$.extend(this.options,defaults,options);this.jqDialog=$("#"+this.options.dialogId);this.jqMover=$("#"+this.options.moverId);this.jqCloseBtn=$("#"+this.options.closeBtnId);this.jqBgPanel=options.jqBgPanel;if(this.jqBgPanel==null)
this.jqBgPanel=this.mkBgPanel(options);this.moverData=this.defMoverData;this.jqDialog.hide();this.jqBgPanel.hide();this.jqDialog.css("position","absolute");this.jqDialog.css("z-index",this.options.zindex);this.jqBgPanel.css("position","absolute");this.jqBgPanel.css("left","0px");this.jqBgPanel.css("top","0px");this.$center();}
Sonata.DialogCtrl.prototype.isVisible=function(){return this.visible;}
Sonata.DialogCtrl.prototype.mkBgPanel=function(options){var thisptr=this;var defaults={bgColor:"#000000",bgAlpha:.5};var opt=$.extend(defaults,options);var dlg=$("<div>");var wd="100%";var ht="100%";var w=$(document.body);dlg.css("width",wd);dlg.css("height",ht);dlg.css("background-color",opt.bgColor);dlg.fadeTo(1,opt.bgAlpha);return dlg;}
Sonata.DialogCtrl.prototype.defMoverData={mousedown:false,x:0,y:0};Sonata.DialogCtrl.prototype.attachMover=function(doattach){var jqmover=this.jqMover;var thisptr=this;if(doattach){this.moverData=this.defMoverData;var data=this.moverData;jqmover.hover(mover,mout);jqmover.mousedown(mdown);jqmover.mouseup(mup);jqmover.mousemove(mmove);this.jqDialog.mousemove(mmove);$(document).keyup(keyd);this.jqCloseBtn.click(close);this.jqCloseBtn.css("cursor","default");if(this.options.modal){this.jqBgPanel.mousemove(mmove);$(window).scroll(scroll);}else{$(document.body).mousemove(mmove);}}
else{var data=this.moverData;jqmover.unbind("mouseover",mover);jqmover.unbind("mouseout",mout);jqmover.unbind("mouseup",mup);jqmover.unbind("mousedown",mdown);this.jqDialog.unbind("mousemove",mmove);this.jqCloseBtn.unbind("click",close);$(document).unbind("keyup",keyd);if(this.options.modal){this.jqBgPanel.unbind("mousemove",mmove);$(window).unbind("scroll",scroll);}else{$(document.body).unbind("mousemove",mmove);}}
function mover(event){if(thisptr.visible==false)return;jqmover.css("cursor","move");}
function mout(event){if(thisptr.visible==false)return;jqmover.css("cursor","default");}
function mdown(event){if(thisptr.visible==false)return;data.mousedown=true;data.x=event.pageX;data.y=event.pageY;data.offset=thisptr.jqDialog.offset();data.difx=data.x-data.offset.left;data.dify=data.y-data.offset.top;}
function mup(event){if(thisptr.visible==false)return;data.mousedown=false;}
function mmove(event){if(thisptr.visible==false)return;if(data.mousedown){var left=event.pageX-data.difx;var top=event.pageY-data.dify;thisptr.jqDialog.css("left",left+"px");thisptr.jqDialog.css("top",top+"px");event.stopPropagation();event.preventDefault();}}
function keyd(event){if(thisptr.visible==false)return;var ESC=27;if(event.keyCode==ESC&&thisptr.options.closeOnEsc)
close(event);}
function close(event){if(thisptr.visible==false)return;if(thisptr.options.closeCB(thisptr))
thisptr.hide();}
function clickbg(event){if(thisptr.visible==false)return;thisptr.jqDialog.focus();event.stopPropagation();}
function scroll(event){if(thisptr.options.modal)
thisptr.positionBG();}}
Sonata.DialogCtrl.prototype.setCloseCB=function(cb){if(typeof cb!='function'){cb=function(){return true;};}
this.options.closeCB=cb;}
Sonata.DialogCtrl.prototype.positionBG=function(){if(this.modal==false)return;var scr=this.getScrollXY();this.jqBgPanel.css("left",scr.left+"px");this.jqBgPanel.css("top",scr.top+"px");return{left:scr.left,top:scr.top};}
Sonata.DialogCtrl.prototype.getPrevXY=function(){var xy=Sonata.defArg(this.hiddenData.prevXY,{left:-1,top:-1});return xy;}
Sonata.DialogCtrl.prototype.show=function(opt){opt=Sonata.defArg(opt,{});this.moverData=this.defMoverData;if(this.jqBgPanel.size()==0)return;if(this.jqDialog.size()==0)return;this.visible=true;try{if(this.options.modal)
document.body.appendChild(this.jqBgPanel[0]);document.body.appendChild(this.jqDialog[0]);}catch(e){}
var left=Sonata.defArg(opt.left,-1);var top=Sonata.defArg(opt.top,-1);if(left==-1&&top==-1)
this.$center();else{this.jqDialog.css("left",left+"px");this.jqDialog.css("top",top+"px");}
this.positionBG();this.jqBgPanel.show();this.jqDialog.show();if(this.isIE6&&this.options.modal){$("select").hide();}
if(this.options.moverBgColor!=""){if(Sonata.isIE&&this.options.moverBgColor!=""){this.jqMover.css("background-color","#ffffff");this.jqMover.css("background-color",this.options.moverBgColor);}}
this.jqDialog.focus();if(this.jqMover.size()==1){this.attachMover(true);}}
Sonata.DialogCtrl.prototype.getScrollXY=function(){return{left:$(window).scrollLeft(),top:$(window).scrollTop()};}
Sonata.DialogCtrl.prototype.$center=function(){this.jqBgPanel.css("left","0px");this.jqBgPanel.css("top","0px");var w=this.jqDialog.width();var h=this.jqDialog.height();var bw=$(window).width();var bh=$(window).height();if(w<bw&&h<bh){var scr=this.getScrollXY();var left=scr.left+(bw-w)/2;var top=scr.top+(bh-h)/2;this.jqDialog.css("left",left+"px");this.jqDialog.css("top",top+"px");}}
Sonata.DialogCtrl.prototype.hide=function(){this.hiddenData.html=this.jqDialog.html();this.hiddenData.prevXY=this.jqDialog.offset();this.moverData=this.defMoverData;this.visible=false;if(this.jqBgPanel.size()==0)return;if(this.jqDialog.size()==0)return;this.jqBgPanel.hide();this.jqDialog.hide();if(this.isIE6){$("select").show();}
if(this.jqMover.size()==1){this.attachMover(false);}
try{if(this.options.modal)
document.body.removeChild(this.jqBgPanel[0]);document.body.removeChild(this.jqDialog[0]);}catch(e){}}
Sonata.DialogCtrl.prototype.setHtml=function(id,html){var e=$("#"+id,this.jqDialog);e.html(html);}
Sonata.DialogCtrl.prototype.getHtml=function(id){var e=$("#"+id,this.jqDialog);return e.html();}
Sonata.DialogCtrl.prototype.addHtml=function(id,html){var e=$("#"+id,this.jqDialog);var h=e.html()+html;e.html(h);}
Sonata.DialogCtrl.makeDialogBox=function(inoptions){var id=document.uniqueId();var defopts={dialogId:"dlgbox"+id,moverId:"dlgboxmoverid"+id,moverBgColor:"#cccccc",moverCss:"",closeBtn:true,closeBtnId:"dlgboxclosebtn"+id,titleid:"dlgboxtitleid"+id,titleCss:"",bodyid:"dlgboxbodyid"+id,bodyCss:"",closeOnEsc:false,modal:true,bgColor:"#000000",bgAlpha:.4}
opts=$.extend(defopts,inoptions);var html=""
+"<div id='dlgbox"+id+"' class='sonata-round-box' style='display:none;position:absolute;background-color:#ffffff; border: solid 1px black;width:400px;font-family:verdana;font-size:10pt;'>"
+"<div id='dlgboxmoverid"+id+"' class='sonata-round-box-top' style='height:20px;padding:4px;background-color:"+opts.moverBgColor+";color:#000000;"+opts.moverCss+"'>"
+"<table width='100%' cellpadding='0' cellspacing='0' border='0' style='font-family:verdana;font-size:10pt;'>"
+"<tr><td width='90%' valign='top' align='left'><div id='dlgboxtitleid"+id+"' style='font-weight:bold;color:#000000;"+opts.titleCss+"'>The title bar</div></td>"
+"<td valign='top' align='right'>";if(opts.closeBtn){html+="<div id='dlgboxclosebtn"+id+"' class='sonata-dlg-close-btn'>x</div>";}
else{html+="&nbsp;";}
html+="</td></tr>"
+"</table></div>"
+" <div id='dlgboxbodyidwrapper"+id+"' class='sonata-round-box-bottom' style='background-color:#ffffff;height:100%;padding:10px;padding-bottom:5px;'>"
+"<div id='dlgboxbodyid"+id+"' style='padding:5px 10px 8px 10px;"+opts.bodyCss+"'>"
+" The body</div></div></div>";var div=$("<div>");div.html(html);$('body').append(div);dlg=new Sonata.DialogCtrl(opts);return dlg;}
Sonata.AFTERDIALOGJS=true;
/* sonata.drawer.js */
Sonata.drawer=function(drawer,options){var defopts={direction:Sonata.drawer.RIGHT,removedrawer:false,div:null,duration:500,dx:2,dy:2};var w=drawer.width();var h=drawer.height();var opts={};$.extend(opts,defopts,options);var dir=opts.direction;var div=opts.div;if(div==null){div=$("#not_a_valid_id",drawer);}
var w=drawer.width();var h=drawer.height();div.css("position","relative");if(Sonata.isIE){opts.dx-=2;opts.dy-=2;}
div.width(w-opts.dx);div.height(h-opts.dy);var thisptr=this;this.options=opts;this.visible=false;this.drawer=drawer;this.div=div;this.setDirection(dir);this.removeDrawer();}
Sonata.drawer.RIGHT=0;Sonata.drawer.LEFT=1;Sonata.drawer.TOP=2;Sonata.drawer.BOTTOM=3;Sonata.drawer.prototype.removeDrawer=function()
{try{document.body.removeChild(this.drawer[0]);}
catch(e){}}
Sonata.drawer.prototype.setDirection=function(dir){var show_css={};var hide_css={};var div=this.div;var w=this.drawer.width();var h=this.drawer.height();div.hide();switch(dir){case Sonata.drawer.RIGHT:div.css("left",w+"px");show_css={left:0+"px"};hide_css={left:w+"px"};break;case Sonata.drawer.LEFT:div.css("left",(-w)+"px");show_css={left:0+"px"};hide_css={left:(-w)+"px"};break;case Sonata.drawer.TOP:div.css("top",(-h)+"px");show_css={top:0+"px"};hide_css={top:(-h)+"px"};break;case Sonata.drawer.BOTTOM:div.css("top",h+"px");show_css={top:0+"px"};hide_css={top:h+"px"};break;}
this.show_css=show_css;this.hide_css=hide_css;div.css("visibility","visible");}
Sonata.drawer.prototype.show=function(){if(this.visible)return;this.visible=true;$("body").append(this.drawer);this.drawer.show();this.drawer.attr("visibility","visible");this.div.show();this.div.attr("visibility","visible");this.div.animate(this.show_css,{queue:false,duration:this.options.duration});}
Sonata.drawer.prototype.hide=function(){if(this.visible==false)return;var thisptr=this;this.visible=false;this.div.animate(this.hide_css,{queue:false,duration:this.options.duration,complete:ondone});function ondone(){if(thisptr.options.removedrawer){thisptr.removeDrawer();}}}
Sonata.drawer.prototype.isVisible=function(){return this.visible;}
/* sonata.mousetracker.js */
Sonata.MouseTracker=function(opts){var thisptr=this;this.options=$.extend({},Sonata.MouseTracker.defOptions,opts);this.divs=[];this.body=$(document.body);function cb(type,rdiv,evt){if(typeof thisptr.options.cb=='function')
thisptr.options.cb(thisptr,type,rdiv,evt);}
function doGetDims(d){if(typeof thisptr.options.getDims=='function')
return thisptr.options.getDims(thisptr,d);return thisptr.getDims(d);}
this.getDims=function(d){var i,n=d.length;var rdivs=[];for(i=0;i<n;i++){var p=d[i];var offs=p.offset();var w=p.outerWidth();var h=p.outerHeight();rdivs.push({elem:p,left:offs.left,top:offs.top,width:w,height:h,right:offs.left+w,bottom:offs.top+h});}
if(this.options.connector.on){if(n==2){var rdiv3=this.connectRDivs(rdivs[0],rdivs[1]);if(rdiv3!=null)rdivs.push(rdiv3);}
else
this.options.connector.on=false;}
return rdivs;}
this.connectDivs=function(div1,div2){var d=[div1,div2];var rd=thisptr.getDims(d);var r1=rd[0];var r2=rd[1];return this.connectRDivs(r1,r2);}
this.connectRDivs=function(r1,r2){if(r1.width>r2.width){var tr1=r1;r1=r2;r2=tr1;}
var p={elem:null,left:0,top:0,width:0,height:0,right:0,bottom:0};if(r1.top<r2.top||r1.top>=r2.bottom){if(r1.top<r2.top){p.left=r1.left;p.right=r1.right;p.width=r1.width;p.top=r1.bottom;p.bottom=r2.top;p.height=p.bottom-p.top;}
else{p.left=r1.left;p.right=r1.right;p.width=r1.width;p.top=r2.bottom;p.bottom=r1.top;p.height=p.bottom-p.top;}
mkConnector(p);return p;}
else if(r1.left<r2.left||r1.left>=r2.right){if(r1.left<=r2.left){p.top=r1.top;p.bottom=r1.bottom;p.height=r1.height;p.left=r1.right;p.right=r2.left;p.width=p.left-p.right;}
else{p.top=r1.top;p.bottom=r1.bottom;p.height=r1.height;p.left=r2.left;p.right=r1.right;p.width=p.left-p.right;}
mkConnector(p);return p;}
return null;}
function mkConnector(p){var cinfo=thisptr.options.connector;if(cinfo.on){p.elem=$("<div>");p.elem.css({position:'absolute',left:p.left,top:p.top,width:p.width+"px",height:p.height+"px",'z-index':80,'background-color':'#ffffff',visibility:'hidden'});if(cinfo.css){p.elem.css(cinfo.css);}
thisptr.options.connector.addConnectorDiv=addConnectorDiv;thisptr.options.connector.removeConnectorDiv=removeConnectorDiv;}
function addConnectorDiv(){if(p.elem!=null){var alpha=cinfo.alpha?cinfo.alpha:.01;document.body.appendChild(p.elem[0]);p.elem.fadeTo(1,alpha,cb);}
function cb(){p.elem.css("visibility","visible");}}
function removeConnectorDiv(){if(p.elem!=null){document.body.removeChild(p.elem[0]);}}}
this.inDivs=function(x,y){var d=thisptr.divs;var i,n=d.length;for(i=0;i<n;i++){p=d[i];if(x>=p.left&&x<=p.right&&y>=p.top&&y<=p.bottom)
return p;}
return null;}
function tracker(evt){var indiv=thisptr.inDivs(evt.pageX,evt.pageY);if(indiv!=null)cb(Sonata.MouseTracker.TYPE_IN,indiv,evt);else cb(Sonata.MouseTracker.TYPE_OUT,indiv,evt);}
this.bindTracker=function(){thisptr.body.bind("mousemove",tracker);}
this.unbindTracker=function(){thisptr.body.unbind("mousemove",tracker);}
this.start=function(){thisptr.divs=doGetDims(thisptr.options.divs);thisptr.bindTracker();if(thisptr.options.connector.on)
thisptr.options.connector.addConnectorDiv();}
this.stop=function(){if(thisptr.options.connector.on)
thisptr.options.connector.removeConnectorDiv();thisptr.unbindTracker();}}
Sonata.MouseTracker.defOptions={divs:[],cb:null,getDims:null,connector:{on:false,css:{'background-color':'#ffffff'},alpha:.01}}
Sonata.MouseTracker.TYPE_IN=1;Sonata.MouseTracker.TYPE_OUT=2;
/* sonata.runswf.js */
var SonataSwf={};SonataSwf.bFlashReady=false;SonataSwf.bJSReady=false;SonataSwf.readyCB=null;$(document).ready(function(){SonataSwf.bJSReady=true;});SonataSwf.jsFlashReady=function(){SonataSwf.bFlashReady=true;if(typeof SonataSwf.readyCB=='function')
SonataSwf.readyCB();return SonataSwf.bJSReady;}
SonataSwf.defSWFOptions={swfDivId:false,outId:document.uniqueId("swf"),vwid:600,vht:600,bgcolor:"#000000",swf:false,controlbar:false,directions:false,directionsSpeed:2000,jsflashreadyfnc:"SonataSwf.jsFlashReady",readyCB:null,args:{}};SonataSwf.runSwf=function(opts){var options={};$.extend(options,SonataSwf.defSWFOptions,opts);if(options.swfDivId==false){mprint("SonataSwf.runSwf: no swfDivId");Sonata.prObject("opts",opts);Sonata.prObject("options",options);return;}
if(options.swf==false){mprint("SonataSwf.runSwf: no swf file");Sonata.prObject("opts",opts);Sonata.prObject("options",options);return;}
SonataSwf.bFlashReady=false;SonataSwf.readyCB=options.readyCB;var so=new SWFObject(options.swf,options.outId,options.vwid,options.vht,'9',options.bgcolor);so.addParam('allowfullscreen','true');so.addParam('quality','high');so.addParam('allowScriptAccess','sameDomain');so.addParam("wmode","transparent");so.addVariable('bgcolor',options.bgcolor);so.addVariable('jsflashreadyfnc',options.jsflashreadyfnc);so.addVariable('controlbar',options.controlbar?"true":"false");so.addVariable('directions',options.directions?"true":"false");so.addVariable('directionsSpeed',""+options.directionsSpeed);var arg;for(arg in options.args){so.addVariable(arg,options.args[arg]);}
so.write(options.swfDivId);return options.outId;}
/* swfobject.min.js *//**
 * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 */
if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return "";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;

/* jquery.hoverIntent.min.js *//*
* hoverIntent r5 // 2007.03.27 // jQuery 1.1.2
* <http://cherne.net/brian/resources/jquery.hoverIntent.html>
* 
* @param  f  onMouseOver function || An object with configuration options
* @param  g  onMouseOut function  || Nothing (use configuration options object)
* @return    The object (aka "this") that called hoverIntent, and the event object
* @author    Brian Cherne <brian@cherne.net>
*/
(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY;};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev]);}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev]);};var handleHover=function(e){var p=(e.type=="mouseover"?e.fromElement:e.toElement)||e.relatedTarget;while(p&&p!=this){try{p=p.parentNode;}catch(e){p=this;}}
if(p==this){return false;}
var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);}
if(e.type=="mouseover"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob);},cfg.timeout);}}};return this.mouseover(handleHover).mouseout(handleHover);};})(jQuery);

/* jquery.cycle.all.min.js *//*
 * jQuery Cycle Plugin (with Transition Definitions)
 * Examples and documentation at: http://jquery.malsup.com/cycle/
 * Copyright (c) 2007-2010 M. Alsup
 * Version: 2.75 (10-FEB-2010)
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 * Requires: jQuery v1.2.6 or later
 */
(function($){var ver="2.75";if($.support==undefined){$.support={opacity:!($.browser.msie)};}function debug(s){if($.fn.cycle.debug){log(s);}}function log(){if(window.console&&window.console.log){window.console.log("[cycle] "+Array.prototype.join.call(arguments," "));}}$.fn.cycle=function(options,arg2){var o={s:this.selector,c:this.context};if(this.length===0&&options!="stop"){if(!$.isReady&&o.s){log("DOM not ready, queuing slideshow");$(function(){$(o.s,o.c).cycle(options,arg2);});return this;}log("terminating; zero elements found by selector"+($.isReady?"":" (DOM not ready)"));return this;}return this.each(function(){var opts=handleArguments(this,options,arg2);if(opts===false){return;}opts.updateActivePagerLink=opts.updateActivePagerLink||$.fn.cycle.updateActivePagerLink;if(this.cycleTimeout){clearTimeout(this.cycleTimeout);}this.cycleTimeout=this.cyclePause=0;var $cont=$(this);var $slides=opts.slideExpr?$(opts.slideExpr,this):$cont.children();var els=$slides.get();if(els.length<2){log("terminating; too few slides: "+els.length);return;}var opts2=buildOptions($cont,$slides,els,opts,o);if(opts2===false){return;}var startTime=opts2.continuous?10:getTimeout(opts2.currSlide,opts2.nextSlide,opts2,!opts2.rev);if(startTime){startTime+=(opts2.delay||0);if(startTime<10){startTime=10;}debug("first timeout: "+startTime);this.cycleTimeout=setTimeout(function(){go(els,opts2,0,!opts2.rev);},startTime);}});};function handleArguments(cont,options,arg2){if(cont.cycleStop==undefined){cont.cycleStop=0;}if(options===undefined||options===null){options={};}if(options.constructor==String){switch(options){case"stop":cont.cycleStop++;if(cont.cycleTimeout){clearTimeout(cont.cycleTimeout);}cont.cycleTimeout=0;$(cont).removeData("cycle.opts");return false;case"toggle":cont.cyclePause=(cont.cyclePause===1)?0:1;return false;case"pause":cont.cyclePause=1;return false;case"resume":cont.cyclePause=0;if(arg2===true){options=$(cont).data("cycle.opts");if(!options){log("options not found, can not resume");return false;}if(cont.cycleTimeout){clearTimeout(cont.cycleTimeout);cont.cycleTimeout=0;}go(options.elements,options,1,1);}return false;case"prev":case"next":var opts=$(cont).data("cycle.opts");if(!opts){log('options not found, "prev/next" ignored');return false;}$.fn.cycle[options](opts);return false;default:options={fx:options};}return options;}else{if(options.constructor==Number){var num=options;options=$(cont).data("cycle.opts");if(!options){log("options not found, can not advance slide");return false;}if(num<0||num>=options.elements.length){log("invalid slide index: "+num);return false;}options.nextSlide=num;if(cont.cycleTimeout){clearTimeout(cont.cycleTimeout);cont.cycleTimeout=0;}if(typeof arg2=="string"){options.oneTimeFx=arg2;}go(options.elements,options,1,num>=options.currSlide);return false;}}return options;}function removeFilter(el,opts){if(!$.support.opacity&&opts.cleartype&&el.style.filter){try{el.style.removeAttribute("filter");}catch(smother){}}}function buildOptions($cont,$slides,els,options,o){var opts=$.extend({},$.fn.cycle.defaults,options||{},$.metadata?$cont.metadata():$.meta?$cont.data():{});if(opts.autostop){opts.countdown=opts.autostopCount||els.length;}var cont=$cont[0];$cont.data("cycle.opts",opts);opts.$cont=$cont;opts.stopCount=cont.cycleStop;opts.elements=els;opts.before=opts.before?[opts.before]:[];opts.after=opts.after?[opts.after]:[];opts.after.unshift(function(){opts.busy=0;});if(!$.support.opacity&&opts.cleartype){opts.after.push(function(){removeFilter(this,opts);});}if(opts.continuous){opts.after.push(function(){go(els,opts,0,!opts.rev);});}saveOriginalOpts(opts);if(!$.support.opacity&&opts.cleartype&&!opts.cleartypeNoBg){clearTypeFix($slides);}if($cont.css("position")=="static"){$cont.css("position","relative");}if(opts.width){$cont.width(opts.width);}if(opts.height&&opts.height!="auto"){$cont.height(opts.height);}if(opts.startingSlide){opts.startingSlide=parseInt(opts.startingSlide);}if(opts.random){opts.randomMap=[];for(var i=0;i<els.length;i++){opts.randomMap.push(i);}opts.randomMap.sort(function(a,b){return Math.random()-0.5;});opts.randomIndex=1;opts.startingSlide=opts.randomMap[1];}else{if(opts.startingSlide>=els.length){opts.startingSlide=0;}}opts.currSlide=opts.startingSlide||0;var first=opts.startingSlide;$slides.css({position:"absolute",top:0,left:0}).hide().each(function(i){var z=first?i>=first?els.length-(i-first):first-i:els.length-i;$(this).css("z-index",z);});$(els[first]).css("opacity",1).show();removeFilter(els[first],opts);if(opts.fit&&opts.width){$slides.width(opts.width);}if(opts.fit&&opts.height&&opts.height!="auto"){$slides.height(opts.height);}var reshape=opts.containerResize&&!$cont.innerHeight();if(reshape){var maxw=0,maxh=0;for(var j=0;j<els.length;j++){var $e=$(els[j]),e=$e[0],w=$e.outerWidth(),h=$e.outerHeight();if(!w){w=e.offsetWidth;}if(!h){h=e.offsetHeight;}maxw=w>maxw?w:maxw;maxh=h>maxh?h:maxh;}if(maxw>0&&maxh>0){$cont.css({width:maxw+"px",height:maxh+"px"});}}if(opts.pause){$cont.hover(function(){this.cyclePause++;},function(){this.cyclePause--;});}if(supportMultiTransitions(opts)===false){return false;}var requeue=false;options.requeueAttempts=options.requeueAttempts||0;$slides.each(function(){var $el=$(this);this.cycleH=(opts.fit&&opts.height)?opts.height:$el.height();this.cycleW=(opts.fit&&opts.width)?opts.width:$el.width();if($el.is("img")){var loadingIE=($.browser.msie&&this.cycleW==28&&this.cycleH==30&&!this.complete);var loadingFF=($.browser.mozilla&&this.cycleW==34&&this.cycleH==19&&!this.complete);var loadingOp=($.browser.opera&&((this.cycleW==42&&this.cycleH==19)||(this.cycleW==37&&this.cycleH==17))&&!this.complete);var loadingOther=(this.cycleH==0&&this.cycleW==0&&!this.complete);if(loadingIE||loadingFF||loadingOp||loadingOther){if(o.s&&opts.requeueOnImageNotLoaded&&++options.requeueAttempts<100){log(options.requeueAttempts," - img slide not loaded, requeuing slideshow: ",this.src,this.cycleW,this.cycleH);setTimeout(function(){$(o.s,o.c).cycle(options);},opts.requeueTimeout);requeue=true;return false;}else{log("could not determine size of image: "+this.src,this.cycleW,this.cycleH);}}}return true;});if(requeue){return false;}opts.cssBefore=opts.cssBefore||{};opts.animIn=opts.animIn||{};opts.animOut=opts.animOut||{};$slides.not(":eq("+first+")").css(opts.cssBefore);if(opts.cssFirst){$($slides[first]).css(opts.cssFirst);}if(opts.timeout){opts.timeout=parseInt(opts.timeout);if(opts.speed.constructor==String){opts.speed=$.fx.speeds[opts.speed]||parseInt(opts.speed);}if(!opts.sync){opts.speed=opts.speed/2;}while((opts.timeout-opts.speed)<250){opts.timeout+=opts.speed;}}if(opts.easing){opts.easeIn=opts.easeOut=opts.easing;}if(!opts.speedIn){opts.speedIn=opts.speed;}if(!opts.speedOut){opts.speedOut=opts.speed;}opts.slideCount=els.length;opts.currSlide=opts.lastSlide=first;if(opts.random){if(++opts.randomIndex==els.length){opts.randomIndex=0;}opts.nextSlide=opts.randomMap[opts.randomIndex];}else{opts.nextSlide=opts.startingSlide>=(els.length-1)?0:opts.startingSlide+1;}if(!opts.multiFx){var init=$.fn.cycle.transitions[opts.fx];if($.isFunction(init)){init($cont,$slides,opts);}else{if(opts.fx!="custom"&&!opts.multiFx){log("unknown transition: "+opts.fx,"; slideshow terminating");return false;}}}var e0=$slides[first];if(opts.before.length){opts.before[0].apply(e0,[e0,e0,opts,true]);}if(opts.after.length>1){opts.after[1].apply(e0,[e0,e0,opts,true]);}if(opts.next){$(opts.next).bind(opts.prevNextEvent,function(){return advance(opts,opts.rev?-1:1);});}if(opts.prev){$(opts.prev).bind(opts.prevNextEvent,function(){return advance(opts,opts.rev?1:-1);});}if(opts.pager){buildPager(els,opts);}exposeAddSlide(opts,els);return opts;}function saveOriginalOpts(opts){opts.original={before:[],after:[]};opts.original.cssBefore=$.extend({},opts.cssBefore);opts.original.cssAfter=$.extend({},opts.cssAfter);opts.original.animIn=$.extend({},opts.animIn);opts.original.animOut=$.extend({},opts.animOut);$.each(opts.before,function(){opts.original.before.push(this);});$.each(opts.after,function(){opts.original.after.push(this);});}function supportMultiTransitions(opts){var i,tx,txs=$.fn.cycle.transitions;if(opts.fx.indexOf(",")>0){opts.multiFx=true;opts.fxs=opts.fx.replace(/\s*/g,"").split(",");for(i=0;i<opts.fxs.length;i++){var fx=opts.fxs[i];tx=txs[fx];if(!tx||!txs.hasOwnProperty(fx)||!$.isFunction(tx)){log("discarding unknown transition: ",fx);opts.fxs.splice(i,1);i--;}}if(!opts.fxs.length){log("No valid transitions named; slideshow terminating.");return false;}}else{if(opts.fx=="all"){opts.multiFx=true;opts.fxs=[];for(p in txs){tx=txs[p];if(txs.hasOwnProperty(p)&&$.isFunction(tx)){opts.fxs.push(p);}}}}if(opts.multiFx&&opts.randomizeEffects){var r1=Math.floor(Math.random()*20)+30;for(i=0;i<r1;i++){var r2=Math.floor(Math.random()*opts.fxs.length);opts.fxs.push(opts.fxs.splice(r2,1)[0]);}debug("randomized fx sequence: ",opts.fxs);}return true;}function exposeAddSlide(opts,els){opts.addSlide=function(newSlide,prepend){var $s=$(newSlide),s=$s[0];if(!opts.autostopCount){opts.countdown++;}els[prepend?"unshift":"push"](s);if(opts.els){opts.els[prepend?"unshift":"push"](s);}opts.slideCount=els.length;$s.css("position","absolute");$s[prepend?"prependTo":"appendTo"](opts.$cont);if(prepend){opts.currSlide++;opts.nextSlide++;}if(!$.support.opacity&&opts.cleartype&&!opts.cleartypeNoBg){clearTypeFix($s);}if(opts.fit&&opts.width){$s.width(opts.width);}if(opts.fit&&opts.height&&opts.height!="auto"){$slides.height(opts.height);}s.cycleH=(opts.fit&&opts.height)?opts.height:$s.height();s.cycleW=(opts.fit&&opts.width)?opts.width:$s.width();$s.css(opts.cssBefore);if(opts.pager){$.fn.cycle.createPagerAnchor(els.length-1,s,$(opts.pager),els,opts);}if($.isFunction(opts.onAddSlide)){opts.onAddSlide($s);}else{$s.hide();}};}$.fn.cycle.resetState=function(opts,fx){fx=fx||opts.fx;opts.before=[];opts.after=[];opts.cssBefore=$.extend({},opts.original.cssBefore);opts.cssAfter=$.extend({},opts.original.cssAfter);opts.animIn=$.extend({},opts.original.animIn);opts.animOut=$.extend({},opts.original.animOut);opts.fxFn=null;$.each(opts.original.before,function(){opts.before.push(this);});$.each(opts.original.after,function(){opts.after.push(this);});var init=$.fn.cycle.transitions[fx];if($.isFunction(init)){init(opts.$cont,$(opts.elements),opts);}};function go(els,opts,manual,fwd){if(manual&&opts.busy&&opts.manualTrump){$(els).stop(true,true);opts.busy=false;}if(opts.busy){return;}var p=opts.$cont[0],curr=els[opts.currSlide],next=els[opts.nextSlide];if(p.cycleStop!=opts.stopCount||p.cycleTimeout===0&&!manual){return;}if(!manual&&!p.cyclePause&&((opts.autostop&&(--opts.countdown<=0))||(opts.nowrap&&!opts.random&&opts.nextSlide<opts.currSlide))){if(opts.end){opts.end(opts);}return;}if(manual||!p.cyclePause){var fx=opts.fx;curr.cycleH=curr.cycleH||$(curr).height();curr.cycleW=curr.cycleW||$(curr).width();next.cycleH=next.cycleH||$(next).height();next.cycleW=next.cycleW||$(next).width();if(opts.multiFx){if(opts.lastFx==undefined||++opts.lastFx>=opts.fxs.length){opts.lastFx=0;}fx=opts.fxs[opts.lastFx];opts.currFx=fx;}if(opts.oneTimeFx){fx=opts.oneTimeFx;opts.oneTimeFx=null;}$.fn.cycle.resetState(opts,fx);if(opts.before.length){$.each(opts.before,function(i,o){if(p.cycleStop!=opts.stopCount){return;}o.apply(next,[curr,next,opts,fwd]);});}var after=function(){$.each(opts.after,function(i,o){if(p.cycleStop!=opts.stopCount){return;}o.apply(next,[curr,next,opts,fwd]);});};if(opts.nextSlide!=opts.currSlide){opts.busy=1;if(opts.fxFn){opts.fxFn(curr,next,opts,after,fwd);}else{if($.isFunction($.fn.cycle[opts.fx])){$.fn.cycle[opts.fx](curr,next,opts,after);}else{$.fn.cycle.custom(curr,next,opts,after,manual&&opts.fastOnEvent);}}}opts.lastSlide=opts.currSlide;if(opts.random){opts.currSlide=opts.nextSlide;if(++opts.randomIndex==els.length){opts.randomIndex=0;}opts.nextSlide=opts.randomMap[opts.randomIndex];}else{var roll=(opts.nextSlide+1)==els.length;opts.nextSlide=roll?0:opts.nextSlide+1;opts.currSlide=roll?els.length-1:opts.nextSlide-1;}if(opts.pager){opts.updateActivePagerLink(opts.pager,opts.currSlide,opts.activePagerClass);}}var ms=0;if(opts.timeout&&!opts.continuous){ms=getTimeout(curr,next,opts,fwd);}else{if(opts.continuous&&p.cyclePause){ms=10;}}if(ms>0){p.cycleTimeout=setTimeout(function(){go(els,opts,0,!opts.rev);},ms);}}$.fn.cycle.updateActivePagerLink=function(pager,currSlide,clsName){$(pager).each(function(){$(this).find("a").removeClass(clsName).filter("a:eq("+currSlide+")").addClass(clsName);});};function getTimeout(curr,next,opts,fwd){if(opts.timeoutFn){var t=opts.timeoutFn(curr,next,opts,fwd);while((t-opts.speed)<250){t+=opts.speed;}debug("calculated timeout: "+t+"; speed: "+opts.speed);if(t!==false){return t;}}return opts.timeout;}$.fn.cycle.next=function(opts){advance(opts,opts.rev?-1:1);};$.fn.cycle.prev=function(opts){advance(opts,opts.rev?1:-1);};function advance(opts,val){var els=opts.elements;var p=opts.$cont[0],timeout=p.cycleTimeout;if(timeout){clearTimeout(timeout);p.cycleTimeout=0;}if(opts.random&&val<0){opts.randomIndex--;if(--opts.randomIndex==-2){opts.randomIndex=els.length-2;}else{if(opts.randomIndex==-1){opts.randomIndex=els.length-1;}}opts.nextSlide=opts.randomMap[opts.randomIndex];}else{if(opts.random){opts.nextSlide=opts.randomMap[opts.randomIndex];}else{opts.nextSlide=opts.currSlide+val;if(opts.nextSlide<0){if(opts.nowrap){return false;}opts.nextSlide=els.length-1;}else{if(opts.nextSlide>=els.length){if(opts.nowrap){return false;}opts.nextSlide=0;}}}}if($.isFunction(opts.prevNextClick)){opts.prevNextClick(val>0,opts.nextSlide,els[opts.nextSlide]);}go(els,opts,1,val>=0);return false;}function buildPager(els,opts){var $p=$(opts.pager);$.each(els,function(i,o){$.fn.cycle.createPagerAnchor(i,o,$p,els,opts);});opts.updateActivePagerLink(opts.pager,opts.startingSlide,opts.activePagerClass);}$.fn.cycle.createPagerAnchor=function(i,el,$p,els,opts){var a;if($.isFunction(opts.pagerAnchorBuilder)){a=opts.pagerAnchorBuilder(i,el);}else{a='<a href="#">'+(i+1)+"</a>";}if(!a){return;}var $a=$(a);if($a.parents("body").length===0){var arr=[];if($p.length>1){$p.each(function(){var $clone=$a.clone(true);$(this).append($clone);arr.push($clone[0]);});$a=$(arr);}else{$a.appendTo($p);}}$a.bind(opts.pagerEvent,function(e){e.preventDefault();opts.nextSlide=i;var p=opts.$cont[0],timeout=p.cycleTimeout;if(timeout){clearTimeout(timeout);p.cycleTimeout=0;}if($.isFunction(opts.pagerClick)){opts.pagerClick(opts.nextSlide,els[opts.nextSlide]);}go(els,opts,1,opts.currSlide<i);return false;});if(opts.pagerEvent!="click"){$a.click(function(){return false;});}if(opts.pauseOnPagerHover){$a.hover(function(){opts.$cont[0].cyclePause++;},function(){opts.$cont[0].cyclePause--;});}};$.fn.cycle.hopsFromLast=function(opts,fwd){var hops,l=opts.lastSlide,c=opts.currSlide;if(fwd){hops=c>l?c-l:opts.slideCount-l;}else{hops=c<l?l-c:l+opts.slideCount-c;}return hops;};function clearTypeFix($slides){function hex(s){s=parseInt(s).toString(16);return s.length<2?"0"+s:s;}function getBg(e){for(;e&&e.nodeName.toLowerCase()!="html";e=e.parentNode){var v=$.css(e,"background-color");if(v.indexOf("rgb")>=0){var rgb=v.match(/\d+/g);return"#"+hex(rgb[0])+hex(rgb[1])+hex(rgb[2]);}if(v&&v!="transparent"){return v;}}return"#ffffff";}$slides.each(function(){$(this).css("background-color",getBg(this));});}$.fn.cycle.commonReset=function(curr,next,opts,w,h,rev){$(opts.elements).not(curr).hide();opts.cssBefore.opacity=1;opts.cssBefore.display="block";if(w!==false&&next.cycleW>0){opts.cssBefore.width=next.cycleW;}if(h!==false&&next.cycleH>0){opts.cssBefore.height=next.cycleH;}opts.cssAfter=opts.cssAfter||{};opts.cssAfter.display="none";$(curr).css("zIndex",opts.slideCount+(rev===true?1:0));$(next).css("zIndex",opts.slideCount+(rev===true?0:1));};$.fn.cycle.custom=function(curr,next,opts,cb,speedOverride){var $l=$(curr),$n=$(next);var speedIn=opts.speedIn,speedOut=opts.speedOut,easeIn=opts.easeIn,easeOut=opts.easeOut;$n.css(opts.cssBefore);if(speedOverride){if(typeof speedOverride=="number"){speedIn=speedOut=speedOverride;}else{speedIn=speedOut=1;}easeIn=easeOut=null;}var fn=function(){$n.animate(opts.animIn,speedIn,easeIn,cb);};$l.animate(opts.animOut,speedOut,easeOut,function(){if(opts.cssAfter){$l.css(opts.cssAfter);}if(!opts.sync){fn();}});if(opts.sync){fn();}};$.fn.cycle.transitions={fade:function($cont,$slides,opts){$slides.not(":eq("+opts.currSlide+")").css("opacity",0);opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts);opts.cssBefore.opacity=0;});opts.animIn={opacity:1};opts.animOut={opacity:0};opts.cssBefore={top:0,left:0};}};$.fn.cycle.ver=function(){return ver;};$.fn.cycle.defaults={fx:"fade",timeout:4000,timeoutFn:null,continuous:0,speed:1000,speedIn:null,speedOut:null,next:null,prev:null,prevNextClick:null,prevNextEvent:"click",pager:null,pagerClick:null,pagerEvent:"click",pagerAnchorBuilder:null,before:null,after:null,end:null,easing:null,easeIn:null,easeOut:null,shuffle:null,animIn:null,animOut:null,cssBefore:null,cssAfter:null,fxFn:null,height:"auto",startingSlide:0,sync:1,random:0,fit:0,containerResize:1,pause:0,pauseOnPagerHover:0,autostop:0,autostopCount:0,delay:0,slideExpr:null,cleartype:!$.support.opacity,cleartypeNoBg:false,nowrap:0,fastOnEvent:0,randomizeEffects:1,rev:0,manualTrump:true,requeueOnImageNotLoaded:true,requeueTimeout:250,activePagerClass:"activeSlide",updateActivePagerLink:null};})(jQuery);
/*
 * jQuery Cycle Plugin Transition Definitions
 * This script is a plugin for the jQuery Cycle Plugin
 * Examples and documentation at: http://malsup.com/jquery/cycle/
 * Copyright (c) 2007-2008 M. Alsup
 * Version:	 2.72
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 */
(function($){$.fn.cycle.transitions.none=function($cont,$slides,opts){opts.fxFn=function(curr,next,opts,after){$(next).show();$(curr).hide();after();};};$.fn.cycle.transitions.scrollUp=function($cont,$slides,opts){$cont.css("overflow","hidden");opts.before.push($.fn.cycle.commonReset);var h=$cont.height();opts.cssBefore={top:h,left:0};opts.cssFirst={top:0};opts.animIn={top:0};opts.animOut={top:-h};};$.fn.cycle.transitions.scrollDown=function($cont,$slides,opts){$cont.css("overflow","hidden");opts.before.push($.fn.cycle.commonReset);var h=$cont.height();opts.cssFirst={top:0};opts.cssBefore={top:-h,left:0};opts.animIn={top:0};opts.animOut={top:h};};$.fn.cycle.transitions.scrollLeft=function($cont,$slides,opts){$cont.css("overflow","hidden");opts.before.push($.fn.cycle.commonReset);var w=$cont.width();opts.cssFirst={left:0};opts.cssBefore={left:w,top:0};opts.animIn={left:0};opts.animOut={left:0-w};};$.fn.cycle.transitions.scrollRight=function($cont,$slides,opts){$cont.css("overflow","hidden");opts.before.push($.fn.cycle.commonReset);var w=$cont.width();opts.cssFirst={left:0};opts.cssBefore={left:-w,top:0};opts.animIn={left:0};opts.animOut={left:w};};$.fn.cycle.transitions.scrollHorz=function($cont,$slides,opts){$cont.css("overflow","hidden").width();opts.before.push(function(curr,next,opts,fwd){$.fn.cycle.commonReset(curr,next,opts);opts.cssBefore.left=fwd?(next.cycleW-1):(1-next.cycleW);opts.animOut.left=fwd?-curr.cycleW:curr.cycleW;});opts.cssFirst={left:0};opts.cssBefore={top:0};opts.animIn={left:0};opts.animOut={top:0};};$.fn.cycle.transitions.scrollVert=function($cont,$slides,opts){$cont.css("overflow","hidden");opts.before.push(function(curr,next,opts,fwd){$.fn.cycle.commonReset(curr,next,opts);opts.cssBefore.top=fwd?(1-next.cycleH):(next.cycleH-1);opts.animOut.top=fwd?curr.cycleH:-curr.cycleH;});opts.cssFirst={top:0};opts.cssBefore={left:0};opts.animIn={top:0};opts.animOut={left:0};};$.fn.cycle.transitions.slideX=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$(opts.elements).not(curr).hide();$.fn.cycle.commonReset(curr,next,opts,false,true);opts.animIn.width=next.cycleW;});opts.cssBefore={left:0,top:0,width:0};opts.animIn={width:"show"};opts.animOut={width:0};};$.fn.cycle.transitions.slideY=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$(opts.elements).not(curr).hide();$.fn.cycle.commonReset(curr,next,opts,true,false);opts.animIn.height=next.cycleH;});opts.cssBefore={left:0,top:0,height:0};opts.animIn={height:"show"};opts.animOut={height:0};};$.fn.cycle.transitions.shuffle=function($cont,$slides,opts){var i,w=$cont.css("overflow","visible").width();$slides.css({left:0,top:0});opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,true,true);});if(!opts.speedAdjusted){opts.speed=opts.speed/2;opts.speedAdjusted=true;}opts.random=0;opts.shuffle=opts.shuffle||{left:-w,top:15};opts.els=[];for(i=0;i<$slides.length;i++){opts.els.push($slides[i]);}for(i=0;i<opts.currSlide;i++){opts.els.push(opts.els.shift());}opts.fxFn=function(curr,next,opts,cb,fwd){var $el=fwd?$(curr):$(next);$(next).css(opts.cssBefore);var count=opts.slideCount;$el.animate(opts.shuffle,opts.speedIn,opts.easeIn,function(){var hops=$.fn.cycle.hopsFromLast(opts,fwd);for(var k=0;k<hops;k++){fwd?opts.els.push(opts.els.shift()):opts.els.unshift(opts.els.pop());}if(fwd){for(var i=0,len=opts.els.length;i<len;i++){$(opts.els[i]).css("z-index",len-i+count);}}else{var z=$(curr).css("z-index");$el.css("z-index",parseInt(z)+1+count);}$el.animate({left:0,top:0},opts.speedOut,opts.easeOut,function(){$(fwd?this:curr).hide();if(cb){cb();}});});};opts.cssBefore={display:"block",opacity:1,top:0,left:0};};$.fn.cycle.transitions.turnUp=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,false);opts.cssBefore.top=next.cycleH;opts.animIn.height=next.cycleH;});opts.cssFirst={top:0};opts.cssBefore={left:0,height:0};opts.animIn={top:0};opts.animOut={height:0};};$.fn.cycle.transitions.turnDown=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,false);opts.animIn.height=next.cycleH;opts.animOut.top=curr.cycleH;});opts.cssFirst={top:0};opts.cssBefore={left:0,top:0,height:0};opts.animOut={height:0};};$.fn.cycle.transitions.turnLeft=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,false,true);opts.cssBefore.left=next.cycleW;opts.animIn.width=next.cycleW;});opts.cssBefore={top:0,width:0};opts.animIn={left:0};opts.animOut={width:0};};$.fn.cycle.transitions.turnRight=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,false,true);opts.animIn.width=next.cycleW;opts.animOut.left=curr.cycleW;});opts.cssBefore={top:0,left:0,width:0};opts.animIn={left:0};opts.animOut={width:0};};$.fn.cycle.transitions.zoom=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,false,false,true);opts.cssBefore.top=next.cycleH/2;opts.cssBefore.left=next.cycleW/2;opts.animIn={top:0,left:0,width:next.cycleW,height:next.cycleH};opts.animOut={width:0,height:0,top:curr.cycleH/2,left:curr.cycleW/2};});opts.cssFirst={top:0,left:0};opts.cssBefore={width:0,height:0};};$.fn.cycle.transitions.fadeZoom=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,false,false);opts.cssBefore.left=next.cycleW/2;opts.cssBefore.top=next.cycleH/2;opts.animIn={top:0,left:0,width:next.cycleW,height:next.cycleH};});opts.cssBefore={width:0,height:0};opts.animOut={opacity:0};};$.fn.cycle.transitions.blindX=function($cont,$slides,opts){var w=$cont.css("overflow","hidden").width();opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts);opts.animIn.width=next.cycleW;opts.animOut.left=curr.cycleW;});opts.cssBefore={left:w,top:0};opts.animIn={left:0};opts.animOut={left:w};};$.fn.cycle.transitions.blindY=function($cont,$slides,opts){var h=$cont.css("overflow","hidden").height();opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts);opts.animIn.height=next.cycleH;opts.animOut.top=curr.cycleH;});opts.cssBefore={top:h,left:0};opts.animIn={top:0};opts.animOut={top:h};};$.fn.cycle.transitions.blindZ=function($cont,$slides,opts){var h=$cont.css("overflow","hidden").height();var w=$cont.width();opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts);opts.animIn.height=next.cycleH;opts.animOut.top=curr.cycleH;});opts.cssBefore={top:h,left:w};opts.animIn={top:0,left:0};opts.animOut={top:h,left:w};};$.fn.cycle.transitions.growX=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,false,true);opts.cssBefore.left=this.cycleW/2;opts.animIn={left:0,width:this.cycleW};opts.animOut={left:0};});opts.cssBefore={width:0,top:0};};$.fn.cycle.transitions.growY=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,false);opts.cssBefore.top=this.cycleH/2;opts.animIn={top:0,height:this.cycleH};opts.animOut={top:0};});opts.cssBefore={height:0,left:0};};$.fn.cycle.transitions.curtainX=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,false,true,true);opts.cssBefore.left=next.cycleW/2;opts.animIn={left:0,width:this.cycleW};opts.animOut={left:curr.cycleW/2,width:0};});opts.cssBefore={top:0,width:0};};$.fn.cycle.transitions.curtainY=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,false,true);opts.cssBefore.top=next.cycleH/2;opts.animIn={top:0,height:next.cycleH};opts.animOut={top:curr.cycleH/2,height:0};});opts.cssBefore={left:0,height:0};};$.fn.cycle.transitions.cover=function($cont,$slides,opts){var d=opts.direction||"left";var w=$cont.css("overflow","hidden").width();var h=$cont.height();opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts);if(d=="right"){opts.cssBefore.left=-w;}else{if(d=="up"){opts.cssBefore.top=h;}else{if(d=="down"){opts.cssBefore.top=-h;}else{opts.cssBefore.left=w;}}}});opts.animIn={left:0,top:0};opts.animOut={opacity:1};opts.cssBefore={top:0,left:0};};$.fn.cycle.transitions.uncover=function($cont,$slides,opts){var d=opts.direction||"left";var w=$cont.css("overflow","hidden").width();var h=$cont.height();opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,true,true);if(d=="right"){opts.animOut.left=w;}else{if(d=="up"){opts.animOut.top=-h;}else{if(d=="down"){opts.animOut.top=h;}else{opts.animOut.left=-w;}}}});opts.animIn={left:0,top:0};opts.animOut={opacity:1};opts.cssBefore={top:0,left:0};};$.fn.cycle.transitions.toss=function($cont,$slides,opts){var w=$cont.css("overflow","visible").width();var h=$cont.height();opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,true,true);if(!opts.animOut.left&&!opts.animOut.top){opts.animOut={left:w*2,top:-h/2,opacity:0};}else{opts.animOut.opacity=0;}});opts.cssBefore={left:0,top:0};opts.animIn={left:0};};$.fn.cycle.transitions.wipe=function($cont,$slides,opts){var w=$cont.css("overflow","hidden").width();var h=$cont.height();opts.cssBefore=opts.cssBefore||{};var clip;if(opts.clip){if(/l2r/.test(opts.clip)){clip="rect(0px 0px "+h+"px 0px)";}else{if(/r2l/.test(opts.clip)){clip="rect(0px "+w+"px "+h+"px "+w+"px)";}else{if(/t2b/.test(opts.clip)){clip="rect(0px "+w+"px 0px 0px)";}else{if(/b2t/.test(opts.clip)){clip="rect("+h+"px "+w+"px "+h+"px 0px)";}else{if(/zoom/.test(opts.clip)){var top=parseInt(h/2);var left=parseInt(w/2);clip="rect("+top+"px "+left+"px "+top+"px "+left+"px)";}}}}}}opts.cssBefore.clip=opts.cssBefore.clip||clip||"rect(0px 0px 0px 0px)";var d=opts.cssBefore.clip.match(/(\d+)/g);var t=parseInt(d[0]),r=parseInt(d[1]),b=parseInt(d[2]),l=parseInt(d[3]);opts.before.push(function(curr,next,opts){if(curr==next){return;}var $curr=$(curr),$next=$(next);$.fn.cycle.commonReset(curr,next,opts,true,true,false);opts.cssAfter.display="block";var step=1,count=parseInt((opts.speedIn/13))-1;(function f(){var tt=t?t-parseInt(step*(t/count)):0;var ll=l?l-parseInt(step*(l/count)):0;var bb=b<h?b+parseInt(step*((h-b)/count||1)):h;var rr=r<w?r+parseInt(step*((w-r)/count||1)):w;$next.css({clip:"rect("+tt+"px "+rr+"px "+bb+"px "+ll+"px)"});(step++<=count)?setTimeout(f,13):$curr.css("display","none");})();});opts.cssBefore={display:"block",opacity:1,top:0,left:0};opts.animIn={left:0};opts.animOut={left:0};};})(jQuery);
/* jquery.metadata.min.js *//*
 * Metadata - jQuery plugin for parsing metadata from elements
 *
 * Copyright (c) 2006 John Resig, Yehuda Katz, J?örn Zaefferer, Paul McLanahan
 *
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 *
 * Revision: $Id: jquery.metadata.js 3640 2007-10-11 18:34:38Z pmclanahan $
 *
 */
 (function($){$.extend({metadata:{defaults:{type:'class',name:'metadata',cre:/({.*})/,single:'metadata'},setType:function(type,name){this.defaults.type=type;this.defaults.name=name;},get:function(elem,opts){var settings=$.extend({},this.defaults,opts);if(!settings.single.length)settings.single='metadata';var data=$.data(elem,settings.single);if(data)return data;data="{}";var getData=function(data){if(typeof data!="string")return data;if(data.indexOf('{')<0){data=eval("("+data+")");}}
var getObject=function(data){if(typeof data!="string")return data;data=eval("("+data+")");return data;}
if(settings.type=="html5"){var object={};$(elem.attributes).each(function(){var name=this.nodeName;if(name.match(/^data-/))name=name.replace(/^data-/,'');else return true;object[name]=getObject(this.nodeValue);});}else{if(settings.type=="class"){var m=settings.cre.exec(elem.className);if(m)
data=m[1];}else if(settings.type=="elem"){if(!elem.getElementsByTagName)return;var e=elem.getElementsByTagName(settings.name);if(e.length)
data=$.trim(e[0].innerHTML);}else if(elem.getAttribute!=undefined){var attr=elem.getAttribute(settings.name);if(attr)
data=attr;}
object=getObject(data.indexOf("{")<0?"{"+data+"}":data);}
$.data(elem,settings.single,object);return object;}}});$.fn.metadata=function(opts){return $.metadata.get(this[0],opts);};})(jQuery);

/* jquery.validate.min.js *//*
 * jQuery validation plug-in 1.6
 *
 * http://bassistance.de/jquery-plugins/jquery-plugin-validation/
 * http://docs.jquery.com/Plugins/Validation
 *
 * Copyright (c) 2006 - 2008 JÃ¶rn Zaefferer
 *
 * $Id: jquery.validate.js 6403 2009-06-17 14:27:16Z joern.zaefferer $
 *
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 */
(function($){$.extend($.fn,{validate:function(options){if(!this.length){options&&options.debug&&window.console&&console.warn("nothing selected, can't validate, returning nothing");return;}var validator=$.data(this[0],'validator');if(validator){return validator;}validator=new $.validator(options,this[0]);$.data(this[0],'validator',validator);if(validator.settings.onsubmit){this.find("input, button").filter(".cancel").click(function(){validator.cancelSubmit=true;});if(validator.settings.submitHandler){this.find("input, button").filter(":submit").click(function(){validator.submitButton=this;});}this.submit(function(event){if(validator.settings.debug)event.preventDefault();function handle(){if(validator.settings.submitHandler){if(validator.submitButton){var hidden=$("<input type='hidden'/>").attr("name",validator.submitButton.name).val(validator.submitButton.value).appendTo(validator.currentForm);}validator.settings.submitHandler.call(validator,validator.currentForm);if(validator.submitButton){hidden.remove();}return false;}return true;}if(validator.cancelSubmit){validator.cancelSubmit=false;return handle();}if(validator.form()){if(validator.pendingRequest){validator.formSubmitted=true;return false;}return handle();}else{validator.focusInvalid();return false;}});}return validator;},valid:function(){if($(this[0]).is('form')){return this.validate().form();}else{var valid=true;var validator=$(this[0].form).validate();this.each(function(){valid&=validator.element(this);});return valid;}},removeAttrs:function(attributes){var result={},$element=this;$.each(attributes.split(/\s/),function(index,value){result[value]=$element.attr(value);$element.removeAttr(value);});return result;},rules:function(command,argument){var element=this[0];if(command){var settings=$.data(element.form,'validator').settings;var staticRules=settings.rules;var existingRules=$.validator.staticRules(element);switch(command){case"add":$.extend(existingRules,$.validator.normalizeRule(argument));staticRules[element.name]=existingRules;if(argument.messages)settings.messages[element.name]=$.extend(settings.messages[element.name],argument.messages);break;case"remove":if(!argument){delete staticRules[element.name];return existingRules;}var filtered={};$.each(argument.split(/\s/),function(index,method){filtered[method]=existingRules[method];delete existingRules[method];});return filtered;}}var data=$.validator.normalizeRules($.extend({},$.validator.metadataRules(element),$.validator.classRules(element),$.validator.attributeRules(element),$.validator.staticRules(element)),element);if(data.required){var param=data.required;delete data.required;data=$.extend({required:param},data);}return data;}});$.extend($.expr[":"],{blank:function(a){return!$.trim(""+a.value);},filled:function(a){return!!$.trim(""+a.value);},unchecked:function(a){return!a.checked;}});$.validator=function(options,form){this.settings=$.extend({},$.validator.defaults,options);this.currentForm=form;this.init();};$.validator.format=function(source,params){if(arguments.length==1)return function(){var args=$.makeArray(arguments);args.unshift(source);return $.validator.format.apply(this,args);};if(arguments.length>2&&params.constructor!=Array){params=$.makeArray(arguments).slice(1);}if(params.constructor!=Array){params=[params];}$.each(params,function(i,n){source=source.replace(new RegExp("\\{"+i+"\\}","g"),n);});return source;};$.extend($.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",validClass:"valid",errorElement:"label",focusInvalid:true,errorContainer:$([]),errorLabelContainer:$([]),onsubmit:true,ignore:[],ignoreTitle:false,onfocusin:function(element){this.lastActive=element;if(this.settings.focusCleanup&&!this.blockFocusCleanup){this.settings.unhighlight&&this.settings.unhighlight.call(this,element,this.settings.errorClass,this.settings.validClass);this.errorsFor(element).hide();}},onfocusout:function(element){if(!this.checkable(element)&&(element.name in this.submitted||!this.optional(element))){this.element(element);}},onkeyup:function(element){if(element.name in this.submitted||element==this.lastElement){this.element(element);}},onclick:function(element){if(element.name in this.submitted)this.element(element);else if(element.parentNode.name in this.submitted)this.element(element.parentNode)},highlight:function(element,errorClass,validClass){$(element).addClass(errorClass).removeClass(validClass);},unhighlight:function(element,errorClass,validClass){$(element).removeClass(errorClass).addClass(validClass);}},setDefaults:function(settings){$.extend($.validator.defaults,settings);},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",number:"Please enter a valid number.",digits:"Please enter only digits.",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",accept:"Please enter a value with a valid extension.",maxlength:$.validator.format("Please enter no more than {0} characters."),minlength:$.validator.format("Please enter at least {0} characters."),rangelength:$.validator.format("Please enter a value between {0} and {1} characters long."),range:$.validator.format("Please enter a value between {0} and {1}."),max:$.validator.format("Please enter a value less than or equal to {0}."),min:$.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:false,prototype:{init:function(){this.labelContainer=$(this.settings.errorLabelContainer);this.errorContext=this.labelContainer.length&&this.labelContainer||$(this.currentForm);this.containers=$(this.settings.errorContainer).add(this.settings.errorLabelContainer);this.submitted={};this.valueCache={};this.pendingRequest=0;this.pending={};this.invalid={};this.reset();var groups=(this.groups={});$.each(this.settings.groups,function(key,value){$.each(value.split(/\s/),function(index,name){groups[name]=key;});});var rules=this.settings.rules;$.each(rules,function(key,value){rules[key]=$.validator.normalizeRule(value);});function delegate(event){var validator=$.data(this[0].form,"validator");validator.settings["on"+event.type]&&validator.settings["on"+event.type].call(validator,this[0]);}$(this.currentForm).delegate("focusin focusout keyup",":text, :password, :file, select, textarea",delegate).delegate("click",":radio, :checkbox, select, option",delegate);if(this.settings.invalidHandler)$(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler);},form:function(){this.checkForm();$.extend(this.submitted,this.errorMap);this.invalid=$.extend({},this.errorMap);if(!this.valid())$(this.currentForm).triggerHandler("invalid-form",[this]);this.showErrors();return this.valid();},checkForm:function(){this.prepareForm();for(var i=0,elements=(this.currentElements=this.elements());elements[i];i++){this.check(elements[i]);}return this.valid();},element:function(element){element=this.clean(element);this.lastElement=element;this.prepareElement(element);this.currentElements=$(element);var result=this.check(element);if(result){delete this.invalid[element.name];}else{this.invalid[element.name]=true;}if(!this.numberOfInvalids()){this.toHide=this.toHide.add(this.containers);}this.showErrors();return result;},showErrors:function(errors){if(errors){$.extend(this.errorMap,errors);this.errorList=[];for(var name in errors){this.errorList.push({message:errors[name],element:this.findByName(name)[0]});}this.successList=$.grep(this.successList,function(element){return!(element.name in errors);});}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors();},resetForm:function(){if($.fn.resetForm)$(this.currentForm).resetForm();this.submitted={};this.prepareForm();this.hideErrors();this.elements().removeClass(this.settings.errorClass);},numberOfInvalids:function(){return this.objectLength(this.invalid);},objectLength:function(obj){var count=0;for(var i in obj)count++;return count;},hideErrors:function(){this.addWrapper(this.toHide).hide();},valid:function(){return this.size()==0;},size:function(){return this.errorList.length;},focusInvalid:function(){if(this.settings.focusInvalid){try{$(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus();}catch(e){}}},findLastActive:function(){var lastActive=this.lastActive;return lastActive&&$.grep(this.errorList,function(n){return n.element.name==lastActive.name;}).length==1&&lastActive;},elements:function(){var validator=this,rulesCache={};return $([]).add(this.currentForm.elements).filter(":input").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){!this.name&&validator.settings.debug&&window.console&&console.error("%o has no name assigned",this);if(this.name in rulesCache||!validator.objectLength($(this).rules()))return false;rulesCache[this.name]=true;return true;});},clean:function(selector){return $(selector)[0];},errors:function(){return $(this.settings.errorElement+"."+this.settings.errorClass,this.errorContext);},reset:function(){this.successList=[];this.errorList=[];this.errorMap={};this.toShow=$([]);this.toHide=$([]);this.currentElements=$([]);},prepareForm:function(){this.reset();this.toHide=this.errors().add(this.containers);},prepareElement:function(element){this.reset();this.toHide=this.errorsFor(element);},check:function(element){element=this.clean(element);if(this.checkable(element)){element=this.findByName(element.name)[0];}var rules=$(element).rules();var dependencyMismatch=false;for(method in rules){var rule={method:method,parameters:rules[method]};try{var result=$.validator.methods[method].call(this,element.value.replace(/\r/g,""),element,rule.parameters);if(result=="dependency-mismatch"){dependencyMismatch=true;continue;}dependencyMismatch=false;if(result=="pending"){this.toHide=this.toHide.not(this.errorsFor(element));return;}if(!result){this.formatAndAdd(element,rule);return false;}}catch(e){this.settings.debug&&window.console&&console.log("exception occured when checking element "+element.id
+", check the '"+rule.method+"' method",e);throw e;}}if(dependencyMismatch)return;if(this.objectLength(rules))this.successList.push(element);return true;},customMetaMessage:function(element,method){if(!$.metadata)return;var meta=this.settings.meta?$(element).metadata()[this.settings.meta]:$(element).metadata();return meta&&meta.messages&&meta.messages[method];},customMessage:function(name,method){var m=this.settings.messages[name];return m&&(m.constructor==String?m:m[method]);},findDefined:function(){for(var i=0;i<arguments.length;i++){if(arguments[i]!==undefined)return arguments[i];}return undefined;},defaultMessage:function(element,method){return this.findDefined(this.customMessage(element.name,method),this.customMetaMessage(element,method),!this.settings.ignoreTitle&&element.title||undefined,$.validator.messages[method],"<strong>Warning: No message defined for "+element.name+"</strong>");},formatAndAdd:function(element,rule){var message=this.defaultMessage(element,rule.method),theregex=/\$?\{(\d+)\}/g;if(typeof message=="function"){message=message.call(this,rule.parameters,element);}else if(theregex.test(message)){message=jQuery.format(message.replace(theregex,'{$1}'),rule.parameters);}this.errorList.push({message:message,element:element});this.errorMap[element.name]=message;this.submitted[element.name]=message;},addWrapper:function(toToggle){if(this.settings.wrapper)toToggle=toToggle.add(toToggle.parent(this.settings.wrapper));return toToggle;},defaultShowErrors:function(){for(var i=0;this.errorList[i];i++){var error=this.errorList[i];this.settings.highlight&&this.settings.highlight.call(this,error.element,this.settings.errorClass,this.settings.validClass);this.showLabel(error.element,error.message);}if(this.errorList.length){this.toShow=this.toShow.add(this.containers);}if(this.settings.success){for(var i=0;this.successList[i];i++){this.showLabel(this.successList[i]);}}if(this.settings.unhighlight){for(var i=0,elements=this.validElements();elements[i];i++){this.settings.unhighlight.call(this,elements[i],this.settings.errorClass,this.settings.validClass);}}this.toHide=this.toHide.not(this.toShow);this.hideErrors();this.addWrapper(this.toShow).show();},validElements:function(){return this.currentElements.not(this.invalidElements());},invalidElements:function(){return $(this.errorList).map(function(){return this.element;});},showLabel:function(element,message){var label=this.errorsFor(element);if(label.length){label.removeClass().addClass(this.settings.errorClass);label.attr("generated")&&label.html(message);}else{label=$("<"+this.settings.errorElement+"/>").attr({"for":this.idOrName(element),generated:true}).addClass(this.settings.errorClass).html(message||"");if(this.settings.wrapper){label=label.hide().show().wrap("<"+this.settings.wrapper+"/>").parent();}if(!this.labelContainer.append(label).length)this.settings.errorPlacement?this.settings.errorPlacement(label,$(element)):label.insertAfter(element);}if(!message&&this.settings.success){label.text("");typeof this.settings.success=="string"?label.addClass(this.settings.success):this.settings.success(label);}this.toShow=this.toShow.add(label);},errorsFor:function(element){var name=this.idOrName(element);return this.errors().filter(function(){return $(this).attr('for')==name});},idOrName:function(element){return this.groups[element.name]||(this.checkable(element)?element.name:element.id||element.name);},checkable:function(element){return/radio|checkbox/i.test(element.type);},findByName:function(name){var form=this.currentForm;return $(document.getElementsByName(name)).map(function(index,element){return element.form==form&&element.name==name&&element||null;});},getLength:function(value,element){switch(element.nodeName.toLowerCase()){case'select':return $("option:selected",element).length;case'input':if(this.checkable(element))return this.findByName(element.name).filter(':checked').length;}return value.length;},depend:function(param,element){return this.dependTypes[typeof param]?this.dependTypes[typeof param](param,element):true;},dependTypes:{"boolean":function(param,element){return param;},"string":function(param,element){return!!$(param,element.form).length;},"function":function(param,element){return param(element);}},optional:function(element){return!$.validator.methods.required.call(this,$.trim(element.value),element)&&"dependency-mismatch";},startRequest:function(element){if(!this.pending[element.name]){this.pendingRequest++;this.pending[element.name]=true;}},stopRequest:function(element,valid){this.pendingRequest--;if(this.pendingRequest<0)this.pendingRequest=0;delete this.pending[element.name];if(valid&&this.pendingRequest==0&&this.formSubmitted&&this.form()){$(this.currentForm).submit();this.formSubmitted=false;}else if(!valid&&this.pendingRequest==0&&this.formSubmitted){$(this.currentForm).triggerHandler("invalid-form",[this]);this.formSubmitted=false;}},previousValue:function(element){return $.data(element,"previousValue")||$.data(element,"previousValue",{old:null,valid:true,message:this.defaultMessage(element,"remote")});}},classRuleSettings:{required:{required:true},email:{email:true},url:{url:true},date:{date:true},dateISO:{dateISO:true},dateDE:{dateDE:true},number:{number:true},numberDE:{numberDE:true},digits:{digits:true},creditcard:{creditcard:true}},addClassRules:function(className,rules){className.constructor==String?this.classRuleSettings[className]=rules:$.extend(this.classRuleSettings,className);},classRules:function(element){var rules={};var classes=$(element).attr('class');classes&&$.each(classes.split(' '),function(){if(this in $.validator.classRuleSettings){$.extend(rules,$.validator.classRuleSettings[this]);}});return rules;},attributeRules:function(element){var rules={};var $element=$(element);for(method in $.validator.methods){var value=$element.attr(method);if(value){rules[method]=value;}}if(rules.maxlength&&/-1|2147483647|524288/.test(rules.maxlength)){delete rules.maxlength;}return rules;},metadataRules:function(element){if(!$.metadata)return{};var meta=$.data(element.form,'validator').settings.meta;return meta?$(element).metadata()[meta]:$(element).metadata();},staticRules:function(element){var rules={};var validator=$.data(element.form,'validator');if(validator.settings.rules){rules=$.validator.normalizeRule(validator.settings.rules[element.name])||{};}return rules;},normalizeRules:function(rules,element){$.each(rules,function(prop,val){if(val===false){delete rules[prop];return;}if(val.param||val.depends){var keepRule=true;switch(typeof val.depends){case"string":keepRule=!!$(val.depends,element.form).length;break;case"function":keepRule=val.depends.call(element,element);break;}if(keepRule){rules[prop]=val.param!==undefined?val.param:true;}else{delete rules[prop];}}});$.each(rules,function(rule,parameter){rules[rule]=$.isFunction(parameter)?parameter(element):parameter;});$.each(['minlength','maxlength','min','max'],function(){if(rules[this]){rules[this]=Number(rules[this]);}});$.each(['rangelength','range'],function(){if(rules[this]){rules[this]=[Number(rules[this][0]),Number(rules[this][1])];}});if($.validator.autoCreateRanges){if(rules.min&&rules.max){rules.range=[rules.min,rules.max];delete rules.min;delete rules.max;}if(rules.minlength&&rules.maxlength){rules.rangelength=[rules.minlength,rules.maxlength];delete rules.minlength;delete rules.maxlength;}}if(rules.messages){delete rules.messages}return rules;},normalizeRule:function(data){if(typeof data=="string"){var transformed={};$.each(data.split(/\s/),function(){transformed[this]=true;});data=transformed;}return data;},addMethod:function(name,method,message){$.validator.methods[name]=method;$.validator.messages[name]=message!=undefined?message:$.validator.messages[name];if(method.length<3){$.validator.addClassRules(name,$.validator.normalizeRule(name));}},methods:{required:function(value,element,param){if(!this.depend(param,element))return"dependency-mismatch";switch(element.nodeName.toLowerCase()){case'select':var val=$(element).val();return val&&val.length>0;case'input':if(this.checkable(element))return this.getLength(value,element)>0;default:return $.trim(value).length>0;}},remote:function(value,element,param){if(this.optional(element))return"dependency-mismatch";var previous=this.previousValue(element);if(!this.settings.messages[element.name])this.settings.messages[element.name]={};previous.originalMessage=this.settings.messages[element.name].remote;this.settings.messages[element.name].remote=previous.message;param=typeof param=="string"&&{url:param}||param;if(previous.old!==value){previous.old=value;var validator=this;this.startRequest(element);var data={};data[element.name]=value;$.ajax($.extend(true,{url:param,mode:"abort",port:"validate"+element.name,dataType:"json",data:data,success:function(response){validator.settings.messages[element.name].remote=previous.originalMessage;var valid=response===true;if(valid){var submitted=validator.formSubmitted;validator.prepareElement(element);validator.formSubmitted=submitted;validator.successList.push(element);validator.showErrors();}else{var errors={};var message=(previous.message=response||validator.defaultMessage(element,"remote"));errors[element.name]=$.isFunction(message)?message(value):message;validator.showErrors(errors);}previous.valid=valid;validator.stopRequest(element,valid);}},param));return"pending";}else if(this.pending[element.name]){return"pending";}return previous.valid;},minlength:function(value,element,param){return this.optional(element)||this.getLength($.trim(value),element)>=param;},maxlength:function(value,element,param){return this.optional(element)||this.getLength($.trim(value),element)<=param;},rangelength:function(value,element,param){var length=this.getLength($.trim(value),element);return this.optional(element)||(length>=param[0]&&length<=param[1]);},min:function(value,element,param){return this.optional(element)||value>=param;},max:function(value,element,param){return this.optional(element)||value<=param;},range:function(value,element,param){return this.optional(element)||(value>=param[0]&&value<=param[1]);},email:function(value,element){return this.optional(element)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(value);},url:function(value,element){return this.optional(element)||/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(value);},date:function(value,element){return this.optional(element)||!/Invalid|NaN/.test(new Date(value));},dateISO:function(value,element){return this.optional(element)||/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(value);},number:function(value,element){return this.optional(element)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(value);},digits:function(value,element){return this.optional(element)||/^\d+$/.test(value);},creditcard:function(value,element){if(this.optional(element))return"dependency-mismatch";if(/[^0-9-]+/.test(value))return false;var nCheck=0,nDigit=0,bEven=false;value=value.replace(/\D/g,"");for(var n=value.length-1;n>=0;n--){var cDigit=value.charAt(n);var nDigit=parseInt(cDigit,10);if(bEven){if((nDigit*=2)>9)nDigit-=9;}nCheck+=nDigit;bEven=!bEven;}return(nCheck%10)==0;},accept:function(value,element,param){param=typeof param=="string"?param.replace(/,/g,'|'):"png|jpe?g|gif";return this.optional(element)||value.match(new RegExp(".("+param+")$","i"));},equalTo:function(value,element,param){var target=$(param).unbind(".validate-equalTo").bind("blur.validate-equalTo",function(){$(element).valid();});return value==target.val();}}});$.format=$.validator.format;})(jQuery);;(function($){var ajax=$.ajax;var pendingRequests={};$.ajax=function(settings){settings=$.extend(settings,$.extend({},$.ajaxSettings,settings));var port=settings.port;if(settings.mode=="abort"){if(pendingRequests[port]){pendingRequests[port].abort();}return(pendingRequests[port]=ajax.apply(this,arguments));}return ajax.apply(this,arguments);};})(jQuery);;(function($){$.each({focus:'focusin',blur:'focusout'},function(original,fix){$.event.special[fix]={setup:function(){if($.browser.msie)return false;this.addEventListener(original,$.event.special[fix].handler,true);},teardown:function(){if($.browser.msie)return false;this.removeEventListener(original,$.event.special[fix].handler,true);},handler:function(e){arguments[0]=$.event.fix(e);arguments[0].type=fix;return $.event.handle.apply(this,arguments);}};});$.extend($.fn,{delegate:function(type,delegate,handler){return this.bind(type,function(event){var target=$(event.target);if(target.is(delegate)){return handler.apply(target,arguments);}});},triggerEvent:function(type,target){return this.triggerHandler(type,[$.event.fix({type:type,target:target})]);}})})(jQuery);
/* jquery.labelify.min.js *//**
 * jQuery.labelify - Display in-textbox hints
 * Stuart Langridge, http://www.kryogenix.org/
 * Released into the public domain
 * Date: 25th June 2008
 * @author Stuart Langridge
 * @version 1.3
 *
 *
 * Basic calling syntax: $("input").labelify();
 * Defaults to taking the in-field label from the field's title attribute
 *
 * You can also pass an options object with the following keys:
 *   text
 *     "title" to get the in-field label from the field's title attribute 
 *      (this is the default)
 *     "label" to get the in-field label from the inner text of the field's label
 *      (note that the label must be attached to the field with for="fieldid")
 *     a function which takes one parameter, the input field, and returns
 *      whatever text it likes
 *
 *   labelledClass
 *     a class that will be applied to the input field when it contains the
 *      label and removed when it contains user input. Defaults to blank.
 *  
 */
jQuery.fn.labelify=function(settings){settings=jQuery.extend({text:"title",labelledClass:""},settings);var lookups={title:function(input){return $(input).attr("title");},label:function(input){return $("label[for="+input.id+"]").text();}};var lookup;var jQuery_labellified_elements=$(this);return $(this).each(function(){if(typeof settings.text==="string"){lookup=lookups[settings.text];}else{lookup=settings.text;};if(typeof lookup!=="function"){return;}
var lookupval=lookup(this);if(!lookupval){return;}
$(this).data("label",lookup(this).replace(/\n/g,''));$(this).focus(function(){if(this.value===$(this).data("label")){this.value=this.defaultValue;$(this).removeClass(settings.labelledClass);}}).blur(function(){if(this.value===this.defaultValue){this.value=$(this).data("label");$(this).addClass(settings.labelledClass);}});var removeValuesOnExit=function(){jQuery_labellified_elements.each(function(){if(this.value===$(this).data("label")){this.value=this.defaultValue;$(this).removeClass(settings.labelledClass);}})};$(this).parents("form").submit(removeValuesOnExit);$(window).unload(removeValuesOnExit);if(this.value!==this.defaultValue){return;}
this.value=$(this).data("label");$(this).addClass(settings.labelledClass);});};
/* JSON.min.js *//*
Copyright (c) 2005 JSON.org

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 Software shall be used for Good, not Evil.

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.
*/
var JSON={org:'http://www.JSON.org',copyright:'(c)2005 JSON.org',license:'http://www.crockford.com/JSON/license.html',encode:function(arg){return JSON.stringify(arg);},decode:function(arg){return JSON.parse(arg);},stringify:function(arg){var c,i,l,s='',v;switch(typeof arg){case'object':if(arg){if(arg.______array=='______array'){for(i=0;i<arg.length;++i){v=this.stringify(arg[i]);if(s){s+=',';}
s+=v;}
return'['+s+']';}else if(typeof arg.toString!='undefined'){for(i in arg){v=arg[i];if(typeof v!='undefined'&&typeof v!='function'){v=this.stringify(v);if(s){s+=',';}
s+=this.stringify(i)+':'+v;}}
return'{'+s+'}';}}
return'null';case'number':return isFinite(arg)?String(arg):'null';case'string':l=arg.length;s='"';for(i=0;i<l;i+=1){c=arg.charAt(i);if(c>=' '){if(c=='\\'||c=='"'){s+='\\';}
s+=c;}else{switch(c){case'\b':s+='\\b';break;case'\f':s+='\\f';break;case'\n':s+='\\n';break;case'\r':s+='\\r';break;case'\t':s+='\\t';break;default:c=c.charCodeAt();s+='\\u00'+Math.floor(c/16).toString(16)+
(c%16).toString(16);}}}
return s+'"';case'boolean':return String(arg);default:return'null';}},parse:function(text){var at=0;var ch=' ';function error(m){throw{name:'JSONError',message:m,at:at-1,text:text};}
function next(){ch=text.charAt(at);at+=1;return ch;}
function white(){while(ch!==''&&ch<=' '){next();}}
function str(){var i,s='',t,u;if(ch=='"'){outer:while(next()){if(ch=='"'){next();return s;}else if(ch=='\\'){switch(next()){case'b':s+='\b';break;case'f':s+='\f';break;case'n':s+='\n';break;case'r':s+='\r';break;case't':s+='\t';break;case'u':u=0;for(i=0;i<4;i+=1){t=parseInt(next(),16);if(!isFinite(t)){break outer;}
u=u*16+t;}
s+=String.fromCharCode(u);break;default:s+=ch;}}else{s+=ch;}}}
error("Bad string");}
function arr(){var a=[];if(ch=='['){next();white();if(ch==']'){next();return a;}
while(ch){a.push(val());white();if(ch==']'){next();return a;}else if(ch!=','){break;}
next();white();}}
error("Bad array");}
function obj(){var k,o={};if(ch=='{'){next();white();if(ch=='}'){next();return o;}
while(ch){k=str();white();if(ch!=':'){break;}
next();o[k]=val();white();if(ch=='}'){next();return o;}else if(ch!=','){break;}
next();white();}}
error("Bad object");}
function num(){var n='',v;if(ch=='-'){n='-';next();}
while(ch>='0'&&ch<='9'){n+=ch;next();}
if(ch=='.'){n+='.';while(next()&&ch>='0'&&ch<='9'){n+=ch;}}
if(ch=='e'||ch=='E'){n+='e';next();if(ch=='-'||ch=='+'){n+=ch;next();}
while(ch>='0'&&ch<='9'){n+=ch;next();}}
v=+n;if(!isFinite(v)){error("Bad number");}else{return v;}}
function word(){switch(ch){case't':if(next()=='r'&&next()=='u'&&next()=='e'){next();return true;}
break;case'f':if(next()=='a'&&next()=='l'&&next()=='s'&&next()=='e'){next();return false;}
break;case'n':if(next()=='u'&&next()=='l'&&next()=='l'){next();return null;}
break;}
error("Syntax error");}
function val(){white();switch(ch){case'{':return obj();case'[':return arr();case'"':return str();case'-':return num();default:return ch>='0'&&ch<='9'?num():word();}}
return val();}};
/* jquery.json-2.2.min.js *//*
 * jQuery JSON Plugin
 * version: 2.1 (2009-08-14)
 *
 * This document is licensed as free software under the terms of the
 * MIT License: http://www.opensource.org/licenses/mit-license.php
 *
 * Brantley Harris wrote this plugin. It is based somewhat on the JSON.org 
 * website's http://www.json.org/json2.js, which proclaims:
 * "NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.", a sentiment that
 * I uphold.
 *
 * It is also influenced heavily by MochiKit's serializeJSON, which is 
 * copyrighted 2005 by Bob Ippolito.
 */
(function($){$.toJSON=function(o)
{if(typeof(JSON)=='object'&&JSON.stringify)
return JSON.stringify(o);var type=typeof(o);if(o===null)
return"null";if(type=="undefined")
return undefined;if(type=="number"||type=="boolean")
return o+"";if(type=="string")
return $.quoteString(o);if(type=='object')
{if(typeof o.toJSON=="function")
return $.toJSON(o.toJSON());if(o.constructor===Date)
{var month=o.getUTCMonth()+1;if(month<10)month='0'+month;var day=o.getUTCDate();if(day<10)day='0'+day;var year=o.getUTCFullYear();var hours=o.getUTCHours();if(hours<10)hours='0'+hours;var minutes=o.getUTCMinutes();if(minutes<10)minutes='0'+minutes;var seconds=o.getUTCSeconds();if(seconds<10)seconds='0'+seconds;var milli=o.getUTCMilliseconds();if(milli<100)milli='0'+milli;if(milli<10)milli='0'+milli;return'"'+year+'-'+month+'-'+day+'T'+
hours+':'+minutes+':'+seconds+'.'+milli+'Z"';}
if(o.constructor===Array)
{var ret=[];for(var i=0;i<o.length;i++)
ret.push($.toJSON(o[i])||"null");return"["+ret.join(",")+"]";}
var pairs=[];for(var k in o){var name;var type=typeof k;if(type=="number")
name='"'+k+'"';else if(type=="string")
name=$.quoteString(k);else
continue;if(typeof o[k]=="function")
continue;var val=$.toJSON(o[k]);pairs.push(name+":"+val);}
return"{"+pairs.join(", ")+"}";}};$.evalJSON=function(src)
{if(typeof(JSON)=='object'&&JSON.parse)
return JSON.parse(src);return eval("("+src+")");};$.secureEvalJSON=function(src)
{if(typeof(JSON)=='object'&&JSON.parse)
return JSON.parse(src);var filtered=src;filtered=filtered.replace(/\\["\\\/bfnrtu]/g,'@');filtered=filtered.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,']');filtered=filtered.replace(/(?:^|:|,)(?:\s*\[)+/g,'');if(/^[\],:{}\s]*$/.test(filtered))
return eval("("+src+")");else
throw new SyntaxError("Error parsing JSON, source is not valid.");};$.quoteString=function(string)
{if(string.match(_escapeable))
{return'"'+string.replace(_escapeable,function(a)
{var c=_meta[a];if(typeof c==='string')return c;c=a.charCodeAt();return'\\u00'+Math.floor(c/16).toString(16)+(c%16).toString(16);})+'"';}
return'"'+string+'"';};var _escapeable=/["\\\x00-\x1f\x7f-\x9f]/g;var _meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'};})(jQuery);
/* DD_roundies.min.js *//**
* DD_roundies, this adds rounded-corner CSS in standard browsers and VML sublayers in IE that accomplish a similar appearance when comparing said browsers.
* Author: Drew Diller
* Email: drew.diller@gmail.com
* URL: http://www.dillerdesign.com/experiment/DD_roundies/
* Version: 0.0.2a
* Licensed under the MIT License: http://dillerdesign.com/experiment/DD_roundies/#license
*
* Usage:
* DD_roundies.addRule('#doc .container', '10px 5px'); // selector and multiple radii
* DD_roundies.addRule('.box', 5, true); // selector, radius, and optional addition of border-radius code for standard browsers.
* 
* Just want the PNG fixing effect for IE6, and don't want to also use the DD_belatedPNG library?  Don't give any additional arguments after the CSS selector.
* DD_roundies.addRule('.your .example img');
* 
* VML - Vector Markup Language (competes with SVG)
**/
var DD_roundies={ns:'DD_roundies',IE6:false,IE7:false,IE8:false,IEversion:function(){if(document.documentMode!=8&&document.namespaces&&!document.namespaces[this.ns]){this.IE6=true;this.IE7=true;}
else if(document.documentMode==8){this.IE8=true;}},querySelector:document.querySelectorAll,selectorsToProcess:[],imgSize:{},createVmlNameSpace:function(){if(this.IE6||this.IE7){document.namespaces.add(this.ns,'urn:schemas-microsoft-com:vml');}
if(this.IE8){document.writeln('<?import namespace="'+this.ns+'" implementation="#default#VML" ?>');}},createVmlStyleSheet:function(){var style=document.createElement('style');document.documentElement.firstChild.insertBefore(style,document.documentElement.firstChild.firstChild);if(style.styleSheet){try{var styleSheet=style.styleSheet;styleSheet.addRule(this.ns+'\\:*','{behavior:url(#default#VML)}');this.styleSheet=styleSheet;}catch(err){}}
else{this.styleSheet=style;}},addRule:function(selector,rad,standards){if(typeof rad=='undefined'||rad===null){rad=0;}
if(rad.constructor.toString().search('Array')==-1){rad=rad.toString().replace(/[^0-9 ]/g,'').split(' ');}
for(var i=0;i<4;i++){rad[i]=(!rad[i]&&rad[i]!==0)?rad[Math.max((i-2),0)]:rad[i];}
if(this.styleSheet){if(this.styleSheet.addRule){var selectors=selector.split(',');for(var i=0;i<selectors.length;i++){this.styleSheet.addRule(selectors[i],'behavior:expression(DD_roundies.roundify.call(this, ['+rad.join(',')+']))');}}
else if(standards){var moz_implementation=rad.join('px ')+'px';this.styleSheet.appendChild(document.createTextNode(selector+' {-moz-border-radius-topleft:'+rad[0]+'px '+rad[0]+'px; -moz-border-radius-topright:'+rad[1]+'px '+rad[1]+'px; -moz-border-radius-bottomright:'+rad[2]+'px '+rad[2]+'px; -moz-border-radius-bottomleft:'+rad[3]+'px '+rad[3]+'px;}'));this.styleSheet.appendChild(document.createTextNode(selector+' {-webkit-border-top-left-radius:'+rad[0]+'px '+rad[0]+'px; -webkit-border-top-right-radius:'+rad[1]+'px '+rad[1]+'px; -webkit-border-bottom-right-radius:'+rad[2]+'px '+rad[2]+'px; -webkit-border-bottom-left-radius:'+rad[3]+'px '+rad[3]+'px;}'));this.styleSheet.appendChild(document.createTextNode(selector+' {-khtml-border-radius-topleft:'+rad[0]+'px '+rad[0]+'px; -khtml-border-radius-topright:'+rad[1]+'px '+rad[1]+'px; -khtml-border-radius-bottomright:'+rad[2]+'px '+rad[2]+'px; -khtml-border-radius-bottomleft:'+rad[3]+'px '+rad[3]+'px;}'));this.styleSheet.appendChild(document.createTextNode(selector+' {border-top-left-radius:'+rad[0]+'px '+rad[0]+'px; -border-top-right-radius:'+rad[1]+'px '+rad[1]+'px; border-bottom-right-radius:'+rad[2]+'px '+rad[2]+'px; border-bottom-left-radius:'+rad[3]+'px '+rad[3]+'px;}'));}}
else if(this.IE8){this.selectorsToProcess.push({'selector':selector,'radii':rad});}},readPropertyChanges:function(el){switch(event.propertyName){case'style.border':case'style.borderWidth':case'style.padding':this.applyVML(el);break;case'style.borderColor':this.vmlStrokeColor(el);break;case'style.backgroundColor':case'style.backgroundPosition':case'style.backgroundRepeat':this.applyVML(el);break;case'style.display':el.vmlBox.style.display=(el.style.display=='none')?'none':'block';break;case'style.filter':this.vmlOpacity(el);break;case'style.zIndex':el.vmlBox.style.zIndex=el.style.zIndex;break;}},applyVML:function(el){el.runtimeStyle.cssText='';this.vmlFill(el);this.vmlStrokeColor(el);this.vmlStrokeWeight(el);this.vmlOffsets(el);this.vmlPath(el);this.nixBorder(el);this.vmlOpacity(el);},vmlOpacity:function(el){if(el.currentStyle.filter.search('lpha')!=-1){var trans=el.currentStyle.filter;trans=parseInt(trans.substring(trans.lastIndexOf('=')+1,trans.lastIndexOf(')')),10)/100;for(var v in el.vml){el.vml[v].filler.opacity=trans;}}},vmlFill:function(el){if(!el.currentStyle){return;}else{var elStyle=el.currentStyle;}
el.runtimeStyle.backgroundColor='';el.runtimeStyle.backgroundImage='';var noColor=(elStyle.backgroundColor=='transparent');var noImg=true;if(elStyle.backgroundImage!='none'||el.isImg){if(!el.isImg){el.vmlBg=elStyle.backgroundImage;el.vmlBg=el.vmlBg.substr(5,el.vmlBg.lastIndexOf('")')-5);}
else{el.vmlBg=el.src;}
var lib=this;if(!lib.imgSize[el.vmlBg]){var img=document.createElement('img');img.attachEvent('onload',function(){this.width=this.offsetWidth;this.height=this.offsetHeight;lib.vmlOffsets(el);});img.className=lib.ns+'_sizeFinder';img.runtimeStyle.cssText='behavior:none; position:absolute; top:-10000px; left:-10000px; border:none;';img.src=el.vmlBg;img.removeAttribute('width');img.removeAttribute('height');document.body.insertBefore(img,document.body.firstChild);lib.imgSize[el.vmlBg]=img;}
el.vml.image.filler.src=el.vmlBg;noImg=false;}
el.vml.image.filled=!noImg;el.vml.image.fillcolor='none';el.vml.color.filled=!noColor;el.vml.color.fillcolor=elStyle.backgroundColor;el.runtimeStyle.backgroundImage='none';el.runtimeStyle.backgroundColor='transparent';},vmlStrokeColor:function(el){el.vml.stroke.fillcolor=el.currentStyle.borderColor;},vmlStrokeWeight:function(el){var borders=['Top','Right','Bottom','Left'];el.bW={};for(var b=0;b<4;b++){el.bW[borders[b]]=parseInt(el.currentStyle['border'+borders[b]+'Width'],10)||0;}},vmlOffsets:function(el){var dims=['Left','Top','Width','Height'];for(var d=0;d<4;d++){el.dim[dims[d]]=el['offset'+dims[d]];}
var assign=function(obj,topLeft){obj.style.left=(topLeft?0:el.dim.Left)+'px';obj.style.top=(topLeft?0:el.dim.Top)+'px';obj.style.width=el.dim.Width+'px';obj.style.height=el.dim.Height+'px';};for(var v in el.vml){var mult=(v=='image')?1:2;el.vml[v].coordsize=(el.dim.Width*mult)+', '+(el.dim.Height*mult);assign(el.vml[v],true);}
assign(el.vmlBox,false);if(DD_roundies.IE8){el.vml.stroke.style.margin='-1px';if(typeof el.bW=='undefined'){this.vmlStrokeWeight(el);}
el.vml.color.style.margin=(el.bW.Top-1)+'px '+(el.bW.Left-1)+'px';}},vmlPath:function(el){var coords=function(direction,w,h,r,aL,aT,mult){var cmd=direction?['m','qy','l','qx','l','qy','l','qx','l']:['qx','l','qy','l','qx','l','qy','l','m'];aL*=mult;aT*=mult;w*=mult;h*=mult;var R=r.slice();for(var i=0;i<4;i++){R[i]*=mult;R[i]=Math.min(w/2,h/2,R[i]);}
var coords=[cmd[0]+Math.floor(0+aL)+','+Math.floor(R[0]+aT),cmd[1]+Math.floor(R[0]+aL)+','+Math.floor(0+aT),cmd[2]+Math.ceil(w-R[1]+aL)+','+Math.floor(0+aT),cmd[3]+Math.ceil(w+aL)+','+Math.floor(R[1]+aT),cmd[4]+Math.ceil(w+aL)+','+Math.ceil(h-R[2]+aT),cmd[5]+Math.ceil(w-R[2]+aL)+','+Math.ceil(h+aT),cmd[6]+Math.floor(R[3]+aL)+','+Math.ceil(h+aT),cmd[7]+Math.floor(0+aL)+','+Math.ceil(h-R[3]+aT),cmd[8]+Math.floor(0+aL)+','+Math.floor(R[0]+aT)];if(!direction){coords.reverse();}
var path=coords.join('');return path;};if(typeof el.bW=='undefined'){this.vmlStrokeWeight(el);}
var bW=el.bW;var rad=el.DD_radii.slice();var outer=coords(true,el.dim.Width,el.dim.Height,rad,0,0,2);rad[0]-=Math.max(bW.Left,bW.Top);rad[1]-=Math.max(bW.Top,bW.Right);rad[2]-=Math.max(bW.Right,bW.Bottom);rad[3]-=Math.max(bW.Bottom,bW.Left);for(var i=0;i<4;i++){rad[i]=Math.max(rad[i],0);}
var inner=coords(false,el.dim.Width-bW.Left-bW.Right,el.dim.Height-bW.Top-bW.Bottom,rad,bW.Left,bW.Top,2);var image=coords(true,el.dim.Width-bW.Left-bW.Right+1,el.dim.Height-bW.Top-bW.Bottom+1,rad,bW.Left,bW.Top,1);el.vml.color.path=inner;el.vml.image.path=image;el.vml.stroke.path=outer+inner;this.clipImage(el);},nixBorder:function(el){var s=el.currentStyle;var sides=['Top','Left','Right','Bottom'];for(var i=0;i<4;i++){el.runtimeStyle['padding'+sides[i]]=(parseInt(s['padding'+sides[i]],10)||0)+(parseInt(s['border'+sides[i]+'Width'],10)||0)+'px';}
el.runtimeStyle.border='none';},clipImage:function(el){var lib=DD_roundies;if(!el.vmlBg||!lib.imgSize[el.vmlBg]){return;}
var thisStyle=el.currentStyle;var bg={'X':0,'Y':0};var figurePercentage=function(axis,position){var fraction=true;switch(position){case'left':case'top':bg[axis]=0;break;case'center':bg[axis]=0.5;break;case'right':case'bottom':bg[axis]=1;break;default:if(position.search('%')!=-1){bg[axis]=parseInt(position,10)*0.01;}
else{fraction=false;}}
var horz=(axis=='X');bg[axis]=Math.ceil(fraction?((el.dim[horz?'Width':'Height']-(el.bW[horz?'Left':'Top']+el.bW[horz?'Right':'Bottom']))*bg[axis])-(lib.imgSize[el.vmlBg][horz?'width':'height']*bg[axis]):parseInt(position,10));bg[axis]+=1;};for(var b in bg){figurePercentage(b,thisStyle['backgroundPosition'+b]);}
el.vml.image.filler.position=(bg.X/(el.dim.Width-el.bW.Left-el.bW.Right+1))+','+(bg.Y/(el.dim.Height-el.bW.Top-el.bW.Bottom+1));var bgR=thisStyle.backgroundRepeat;var c={'T':1,'R':el.dim.Width+1,'B':el.dim.Height+1,'L':1};var altC={'X':{'b1':'L','b2':'R','d':'Width'},'Y':{'b1':'T','b2':'B','d':'Height'}};if(bgR!='repeat'){c={'T':(bg.Y),'R':(bg.X+lib.imgSize[el.vmlBg].width),'B':(bg.Y+lib.imgSize[el.vmlBg].height),'L':(bg.X)};if(bgR.search('repeat-')!=-1){var v=bgR.split('repeat-')[1].toUpperCase();c[altC[v].b1]=1;c[altC[v].b2]=el.dim[altC[v].d]+1;}
if(c.B>el.dim.Height){c.B=el.dim.Height+1;}}
el.vml.image.style.clip='rect('+c.T+'px '+c.R+'px '+c.B+'px '+c.L+'px)';},pseudoClass:function(el){var self=this;setTimeout(function(){self.applyVML(el);},1);},reposition:function(el){this.vmlOffsets(el);this.vmlPath(el);},roundify:function(rad){this.style.behavior='none';if(!this.currentStyle){return;}
else{var thisStyle=this.currentStyle;}
var allowed={BODY:false,TABLE:false,TR:false,TD:false,SELECT:false,OPTION:false,TEXTAREA:false};if(allowed[this.nodeName]===false){return;}
var self=this;var lib=DD_roundies;this.DD_radii=rad;this.dim={};var handlers={resize:'reposition',move:'reposition'};if(this.nodeName=='A'){var moreForAs={mouseleave:'pseudoClass',mouseenter:'pseudoClass',focus:'pseudoClass',blur:'pseudoClass'};for(var a in moreForAs){handlers[a]=moreForAs[a];}}
for(var h in handlers){this.attachEvent('on'+h,function(){lib[handlers[h]](self);});}
this.attachEvent('onpropertychange',function(){lib.readPropertyChanges(self);});var giveLayout=function(el){el.style.zoom=1;if(el.currentStyle.position=='static'){el.style.position='relative';}};giveLayout(this.offsetParent);giveLayout(this);this.vmlBox=document.createElement('ignore');this.vmlBox.runtimeStyle.cssText='behavior:none; position:absolute; margin:0; padding:0; border:0; background:none;';this.vmlBox.style.zIndex=thisStyle.zIndex;this.vml={'color':true,'image':true,'stroke':true};for(var v in this.vml){this.vml[v]=document.createElement(lib.ns+':shape');this.vml[v].filler=document.createElement(lib.ns+':fill');this.vml[v].appendChild(this.vml[v].filler);this.vml[v].stroked=false;this.vml[v].style.position='absolute';this.vml[v].style.zIndex=thisStyle.zIndex;this.vml[v].coordorigin='1,1';this.vmlBox.appendChild(this.vml[v]);}
this.vml.image.fillcolor='none';this.vml.image.filler.type='tile';this.parentNode.insertBefore(this.vmlBox,this);this.isImg=false;if(this.nodeName=='IMG'){this.isImg=true;this.style.visibility='hidden';}
setTimeout(function(){lib.applyVML(self);},1);}};try{document.execCommand("BackgroundImageCache",false,true);}catch(err){}
DD_roundies.IEversion();DD_roundies.createVmlNameSpace();DD_roundies.createVmlStyleSheet();if(DD_roundies.IE8&&document.attachEvent&&DD_roundies.querySelector){document.attachEvent('onreadystatechange',function(){if(document.readyState=='complete'){var selectors=DD_roundies.selectorsToProcess;var length=selectors.length;var delayedCall=function(node,radii,index){setTimeout(function(){DD_roundies.roundify.call(node,radii);},index*100);};for(var i=0;i<length;i++){var results=document.querySelectorAll(selectors[i].selector);var rLength=results.length;for(var r=0;r<rLength;r++){if(results[r].nodeName!='INPUT'){delayedCall(results[r],selectors[i].radii,r);}}}}});}
Sonata.AFTERDDROUNDIESJS=true;
