(function($){$.extend($.fn,{livequery:function(type,fn,fn2){var self=this,q;if($.isFunction(type))
fn2=fn,fn=type,type=undefined;$.each($.livequery.queries,function(i,query){if(self.selector==query.selector&&self.context==query.context&&type==query.type&&(!fn||fn.$lqguid==query.fn.$lqguid)&&(!fn2||fn2.$lqguid==query.fn2.$lqguid))
return(q=query)&&false;});q=q||new $.livequery(this.selector,this.context,type,fn,fn2);q.stopped=false;q.run();return this;},expire:function(type,fn,fn2){var self=this;if($.isFunction(type))
fn2=fn,fn=type,type=undefined;$.each($.livequery.queries,function(i,query){if(self.selector==query.selector&&self.context==query.context&&(!type||type==query.type)&&(!fn||fn.$lqguid==query.fn.$lqguid)&&(!fn2||fn2.$lqguid==query.fn2.$lqguid)&&!this.stopped)
$.livequery.stop(query.id);});return this;}});$.livequery=function(selector,context,type,fn,fn2){this.selector=selector;this.context=context||document;this.type=type;this.fn=fn;this.fn2=fn2;this.elements=[];this.stopped=false;this.id=$.livequery.queries.push(this)-1;fn.$lqguid=fn.$lqguid||$.livequery.guid++;if(fn2)fn2.$lqguid=fn2.$lqguid||$.livequery.guid++;return this;};$.livequery.prototype={stop:function(){var query=this;if(this.type)
this.elements.unbind(this.type,this.fn);else if(this.fn2)
this.elements.each(function(i,el){query.fn2.apply(el);});this.elements=[];this.stopped=true;},run:function(){if(this.stopped)return;var query=this;var oEls=this.elements,els=$(this.selector,this.context),nEls=els.not(oEls);this.elements=els;if(this.type){nEls.bind(this.type,this.fn);if(oEls.length>0)
$.each(oEls,function(i,el){if($.inArray(el,els)<0)
$.event.remove(el,query.type,query.fn);});}
else{nEls.each(function(){query.fn.apply(this);});if(this.fn2&&oEls.length>0)
$.each(oEls,function(i,el){if($.inArray(el,els)<0)
query.fn2.apply(el);});}}};$.extend($.livequery,{guid:0,queries:[],queue:[],running:false,timeout:null,checkQueue:function(){if($.livequery.running&&$.livequery.queue.length){var length=$.livequery.queue.length;while(length--)
$.livequery.queries[$.livequery.queue.shift()].run();}},pause:function(){$.livequery.running=false;},play:function(){$.livequery.running=true;$.livequery.run();},registerPlugin:function(){$.each(arguments,function(i,n){if(!$.fn[n])return;var old=$.fn[n];$.fn[n]=function(){var r=old.apply(this,arguments);$.livequery.run();return r;}});},run:function(id){if(id!=undefined){if($.inArray(id,$.livequery.queue)<0)
$.livequery.queue.push(id);}
else
$.each($.livequery.queries,function(id){if($.inArray(id,$.livequery.queue)<0)
$.livequery.queue.push(id);});if($.livequery.timeout)clearTimeout($.livequery.timeout);$.livequery.timeout=setTimeout($.livequery.checkQueue,20);},stop:function(id){if(id!=undefined)
$.livequery.queries[id].stop();else
$.each($.livequery.queries,function(id){$.livequery.queries[id].stop();});}});$.livequery.registerPlugin('append','prepend','after','before','wrap','attr','removeAttr','addClass','removeClass','toggleClass','empty','remove');$(function(){$.livequery.play();});var init=$.prototype.init;$.prototype.init=function(a,c){var r=init.apply(this,arguments);if(a&&a.selector)
r.context=a.context,r.selector=a.selector;if(typeof a=='string')
r.context=c||document,r.selector=a;return r;};$.prototype.init.prototype=$.prototype;})(jQuery);jQuery.fn.inspect=function(output){jQuery.inspect($(this),output);return this;}
jQuery.inspect=function(obj,output){output=(output?output:'alert')
var text="";var _build=null;var _dump=null;switch(output){case'console':_build=jQuery.inspect._buildText;_dump=jQuery.inspect._console;break;case'window':_build=jQuery.inspect._buildHTML;_dump=jQuery.inspect._window;break;default:_build=jQuery.inspect._buildText;_dump=jQuery.inspect._alert;}
switch(typeof obj){case'string':text="String: "+obj;break;case'number':text="Number: "+obj;break;case'boolean':text="Boolean: "+obj;break;case'undefined':alert('Object is undefined');return true;default:text=jQuery.inspect._parseObject(obj,_build);}
_dump(text);}
jQuery.inspect._parseObject=function(obj,_dumpTo){var text=""
for(field in obj){try{text+=_dumpTo(field,obj[field]);}
catch(err){}}
return text;}
jQuery.inspect._buildText=function(key,value){return key+":"+value+"\n";}
jQuery.inspect._buildHTML=function(key,value){return"<tr><td>"+key+"</td><td>"+value+"</td></tr>\n";}
jQuery.inspect._console=function(text){console.log(text);}
jQuery.inspect._alert=function(text){alert(text);}
jQuery.inspect._window=function(text){text="<html><head>"+jQuery.inspect._windowSettings.styles+"</head><body><table>"+text+"</table></body></html>";dump_window=window.open('','',jQuery.inspect._windowSettings.config);dump_window.document.write(text);dump_window.document.close();dump_window.focus();}
jQuery.inspect._windowSettings=jQuery.extend({width:800,height:600});jQuery.inspect._windowSettings.styles="\
<style> \
 * { \
   margin: 0; \
 } \
 html, body { \
   height: 100%; \
   text-align: center; \
   margin-bottom: 1px; \
   font-family: verdana,helvetica,sans-serif; \
 } \
 table { \
  width: "+(jQuery.inspect._windowSettings.width-20)+"px; \
  border: 1px solid black; \
  } \
  td { \
    vertical-align: top; \
  } \
</style>";jQuery.inspect._windowSettings.config="width="+jQuery.inspect._windowSettings.width+",height="+jQuery.inspect._windowSettings.height+",scrollbars=yes,location=no,menubar=no,toolbar=no";(function($)
{$.fn.document=function()
{var element=this.get(0);if(element.nodeName.toLowerCase()=='iframe')
{return element.contentWindow.document;}
return this;};$.fn.documentSelection=function()
{var element=this.get(0);if(element.contentWindow.document.selection)
return element.contentWindow.document.selection.createRange().text;else
return element.contentWindow.getSelection().toString();};$.fn.wysiwyg=function(options)
{if(arguments.length>0&&arguments[0].constructor==String)
{var action=arguments[0].toString();var params=[];for(var i=1;i<arguments.length;i++)
params[i-1]=arguments[i];if(action in Wysiwyg)
{return this.each(function()
{$.data(this,'wysiwyg').designMode();Wysiwyg[action].apply(this,params);});}
else return this;}
var controls={};if(options&&options.controls)
{var controls=options.controls;delete options.controls;}
options=$.extend({html:'<'+'?xml version="1.0" encoding="UTF-8"?'+'><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">STYLE_SHEET</head><body style="margin: 0px;">INITIAL_CONTENT</body></html>',css:{},debug:false,autoSave:true,rmUnwantedBr:true,brIE:true,controls:{},messages:{}},options);options.messages=$.extend(true,options.messages,Wysiwyg.MSGS_EN);options.controls=$.extend(true,options.controls,Wysiwyg.TOOLBAR);for(var control in controls)
{if(control in options.controls)
$.extend(options.controls[control],controls[control]);else
options.controls[control]=controls[control];}
return this.each(function()
{Wysiwyg(this,options);});};function Wysiwyg(element,options)
{return this instanceof Wysiwyg?this.init(element,options):new Wysiwyg(element,options);}
$.extend(Wysiwyg,{insertImage:function(szURL,attributes)
{var self=$.data(this,'wysiwyg');if(self.constructor==Wysiwyg&&szURL&&szURL.length>0)
{if($.browser.msie)self.focus();if(attributes)
{self.editorDoc.execCommand('insertImage',false,'#jwysiwyg#');var img=self.getElementByAttributeValue('img','src','#jwysiwyg#');if(img)
{img.src=szURL;for(var attribute in attributes)
{img.setAttribute(attribute,attributes[attribute]);}}}
else
{self.editorDoc.execCommand('insertImage',false,szURL);}}},createLink:function(szURL)
{var self=$.data(this,'wysiwyg');if(self.constructor==Wysiwyg&&szURL&&szURL.length>0)
{var selection=$(self.editor).documentSelection();if(selection.length>0)
{if($.browser.msie)self.focus();self.editorDoc.execCommand('unlink',false,[]);self.editorDoc.execCommand('createLink',false,szURL);}
else if(self.options.messages.nonSelection)
alert(self.options.messages.nonSelection);}},insertHtml:function(szHTML)
{var self=$.data(this,'wysiwyg');if(self.constructor==Wysiwyg&&szHTML&&szHTML.length>0)
{if($.browser.msie)
{self.focus();self.editorDoc.execCommand('insertImage',false,'#jwysiwyg#');var img=self.getElementByAttributeValue('img','src','#jwysiwyg#');if(img)
{$(img).replaceWith(szHTML);}}
else
{self.editorDoc.execCommand('insertHTML',false,szHTML);}}},setContent:function(newContent)
{var self=$.data(this,'wysiwyg');self.setContent(newContent);self.saveContent();},clear:function()
{var self=$.data(this,'wysiwyg');self.setContent('');self.saveContent();},MSGS_EN:{nonSelection:'select the text you wish to link'},TOOLBAR:{bold:{visible:true,tags:['b','strong'],css:{fontWeight:'bold'},tooltip:"Bold"},italic:{visible:true,tags:['i','em'],css:{fontStyle:'italic'},tooltip:"Italic"},strikeThrough:{visible:false,tags:['s','strike'],css:{textDecoration:'line-through'},tooltip:"Strike-through"},underline:{visible:true,tags:['u'],css:{textDecoration:'underline'},tooltip:"Underline"},separator00:{visible:true,separator:true},justifyLeft:{visible:true,css:{textAlign:'left'},tooltip:"Justify Left"},justifyCenter:{visible:true,tags:['center'],css:{textAlign:'center'},tooltip:"Justify Center"},justifyRight:{visible:true,css:{textAlign:'right'},tooltip:"Justify Right"},justifyFull:{visible:false,css:{textAlign:'justify'},tooltip:"Justify Full"},separator01:{visible:true,separator:true},indent:{visible:true,tooltip:"Indent"},outdent:{visible:true,tooltip:"Outdent"},separator02:{visible:false,separator:true},subscript:{visible:false,tags:['sub'],tooltip:"Subscript"},superscript:{visible:false,tags:['sup'],tooltip:"Superscript"},separator03:{visible:false,separator:true},insertOrderedList:{visible:true,tags:['ol'],tooltip:"Insert Ordered List"},insertUnorderedList:{visible:true,tags:['ul'],tooltip:"Insert Unordered List"},insertHorizontalRule:{visible:false,tags:['hr'],tooltip:"Insert Horizontal Rule"},separator05:{separator:true},createLink:{visible:true,exec:function()
{var selection=$(this.editor).documentSelection();if(selection.length>0)
{if($.browser.msie)
{this.focus();this.editorDoc.execCommand('createLink',true,null);}
else
{var szURL=prompt('URL','http://');if(szURL&&szURL.length>0)
{this.editorDoc.execCommand('unlink',false,[]);this.editorDoc.execCommand('createLink',false,szURL);}}}
else if(this.options.messages.nonSelection)
alert(this.options.messages.nonSelection);},tags:['a'],tooltip:"Create link"},insertImage:{visible:true,exec:function()
{if($.browser.msie)
{this.focus();this.editorDoc.execCommand('insertImage',true,null);}
else
{var szURL=prompt('URL','http://');if(szURL&&szURL.length>0)
this.editorDoc.execCommand('insertImage',false,szURL);}},tags:['img'],tooltip:"Insert image"},separator06:{separator:true},h1mozilla:{visible:true&&$.browser.mozilla,className:'h1',command:'heading',arguments:['h1'],tags:['h1'],tooltip:"Header 1"},h2mozilla:{visible:true&&$.browser.mozilla,className:'h2',command:'heading',arguments:['h2'],tags:['h2'],tooltip:"Header 2"},h3mozilla:{visible:true&&$.browser.mozilla,className:'h3',command:'heading',arguments:['h3'],tags:['h3'],tooltip:"Header 3"},h1:{visible:true&&!($.browser.mozilla),className:'h1',command:'formatBlock',arguments:['<H1>'],tags:['h1'],tooltip:"Header 1"},h2:{visible:true&&!($.browser.mozilla),className:'h2',command:'formatBlock',arguments:['<H2>'],tags:['h2'],tooltip:"Header 2"},h3:{visible:true&&!($.browser.mozilla),className:'h3',command:'formatBlock',arguments:['<H3>'],tags:['h3'],tooltip:"Header 3"},separator07:{visible:false,separator:true},cut:{visible:false,tooltip:"Cut"},copy:{visible:false,tooltip:"Copy"},paste:{visible:false,tooltip:"Paste"},separator08:{separator:false&&!($.browser.msie)},increaseFontSize:{visible:false&&!($.browser.msie),tags:['big'],tooltip:"Increase font size"},decreaseFontSize:{visible:false&&!($.browser.msie),tags:['small'],tooltip:"Decrease font size"},separator09:{separator:true},word:{visible:true,tooltip:'Clean Microsoft Word Tags',exec:function()
{var html=this.getContent();function CleanWord(html)
{html=html.replace(/<(\/)*(\\?xml:|span|p|style|font|del|ins|st1:|[ovwxp]:)(.*?)>/gi,'');html=html.replace(/(class|style|type|start)="(.*?)"/gi,'');html=html.replace(/\s*mso-[^:]+:[^;"]+;?/gi,'');html=html.replace(/<\s*(\w[^>]*) class=([^ |>]*)([^>]*)/gi,"<$1$3");html=html.replace(/<(\w[^>]*) onmouseover="([^\"]*)"([^>]*)/gi,"<$1$3");html=html.replace(/<(\w[^>]*) onmouseout="([^\"]*)"([^>]*)/gi,"<$1$3");html=html.replace(/<script(.*?)script>/gi,'');html=html.replace(/<!--(.*?)-->/gi,'');html=html.replace(/<\/?(span)[^>]*>/gi,'');html=html.replace(/<\/?(span)[^>]*>/gi,'');html=html.replace(/<\/?(img|font|style|p|div|v:\w+)[^>]*>/gi,'');html=html.replace(/\s*style="\s*"/gi,'');html=html.replace(/<SPAN\s*[^>]*>\s*&nbsp;\s*<\/SPAN>/gi,'&nbsp;');html=html.replace(/<SPAN\s*[^>]*><\/SPAN>/gi,'');return html;var html;}
CleanWord(html);$($(this.editor).document()).find('body').html(html);}},undo:{visible:true,tooltip:"Undo"},redo:{visible:true,tooltip:"Redo"},html:{visible:true,exec:function()
{if(this.viewHTML)
{this.setContent($(this.original).val());$(this.original).hide();}
else
{this.saveContent();$(this.original).show();}
this.viewHTML=!(this.viewHTML);},tooltip:"View source code"},removeFormat:{visible:true,exec:function()
{if($.browser.msie)this.focus();this.editorDoc.execCommand('removeFormat',false,[]);this.editorDoc.execCommand('unlink',false,[]);},tooltip:"Remove formatting"}}});$.extend(Wysiwyg.prototype,{original:null,options:{},element:null,editor:null,focus:function()
{$(this.editorDoc.body).focus();},init:function(element,options)
{var self=this;this.editor=element;this.options=options||{};$.data(element,'wysiwyg',this);var newX=element.width||element.clientWidth;var newY=element.height||element.clientHeight;if(element.nodeName.toLowerCase()=='textarea')
{this.original=element;if(newX==0&&element.cols)
newX=(element.cols*8)+21;if(newY==0&&element.rows)
newY=(element.rows*16)+16;var editor=this.editor=$('<iframe src="javascript:false;"></iframe>').css({minHeight:(newY-6).toString()+'px',width:(newX-8).toString()+'px'}).attr('id',$(element).attr('id')+'IFrame').attr('frameborder','0');this.editor.attr('tabindex',$(element).attr('tabindex'));if($.browser.msie)
{this.editor.css('height',(newY).toString()+'px');}}
var panel=this.panel=$('<ul role="menu" class="panel"></ul>');this.appendControls();this.element=$('<div></div>').css({width:(newX>0)?(newX).toString()+'px':'100%'}).addClass('wysiwyg').append(panel).append($('<div><!-- --></div>').css({clear:'both'})).append(editor);$(element).hide().before(this.element);this.viewHTML=false;this.initialHeight=newY-8;this.initialContent=$(element).val();this.initFrame();if(this.initialContent.length==0)
this.setContent('');var form=$(element).closest('form');if(this.options.autoSave)
{form.submit(function(){self.saveContent();});}
form.bind('reset',function()
{self.setContent(self.initialContent);self.saveContent();});},initFrame:function()
{var self=this;var style='';if(this.options.css&&this.options.css.constructor==String)
{style='<link rel="stylesheet" type="text/css" media="screen" href="'+this.options.css+'" />';}
this.editorDoc=$(this.editor).document();this.editorDoc_designMode=false;try{this.editorDoc.designMode='on';this.editorDoc_designMode=true;}catch(e){$(this.editorDoc).focus(function()
{self.designMode();});}
this.editorDoc.open();this.editorDoc.write(this.options.html.replace(/INITIAL_CONTENT/,function(){return self.initialContent;}).replace(/STYLE_SHEET/,function(){return style;}));this.editorDoc.close();this.editorDoc.contentEditable='true';if($.browser.msie)
{setTimeout(function(){$(self.editorDoc.body).css('border','none');},0);}
$(this.editorDoc).click(function(event)
{self.checkTargets(event.target?event.target:event.srcElement);});$(this.original).focus(function()
{if(!$.browser.msie)
{self.focus();}});if(this.options.autoSave)
{$(this.editorDoc).keydown(function(){self.saveContent();}).keyup(function(){self.saveContent();}).mousedown(function(){self.saveContent();});}
if(this.options.css)
{setTimeout(function()
{if(self.options.css.constructor==String)
{}
else
$(self.editorDoc).find('body').css(self.options.css);},0);}
$(this.editorDoc).keydown(function(event)
{if($.browser.msie&&self.options.brIE&&event.keyCode==13)
{var rng=self.getRange();rng.pasteHTML('<br />');rng.collapse(false);rng.select();return false;}
return true;});},designMode:function()
{if(!(this.editorDoc_designMode))
{try{this.editorDoc.designMode='on';this.editorDoc_designMode=true;}catch(e){}}},getSelection:function()
{return(window.getSelection)?window.getSelection():document.selection;},getRange:function()
{var selection=this.getSelection();if(!(selection))
return null;return(selection.rangeCount>0)?selection.getRangeAt(0):selection.createRange();},getContent:function()
{return $($(this.editor).document()).find('body').html();},setContent:function(newContent)
{$($(this.editor).document()).find('body').html(newContent);},saveContent:function()
{if(this.original)
{var content=this.getContent();if(this.options.rmUnwantedBr)
{content=(content.substr(-4)=='<br>')?content.substr(0,content.length-4):content;}
$(this.original).val(content);}},withoutCss:function()
{if($.browser.mozilla)
{try
{this.editorDoc.execCommand('styleWithCSS',false,false);}
catch(e)
{try
{this.editorDoc.execCommand('useCSS',false,true);}
catch(e)
{}}}},appendMenu:function(cmd,args,className,fn,tooltip)
{var self=this;args=args||[];$('<li></li>').append($('<a role="menuitem" tabindex="-1" href="javascript:;">'+(className||cmd)+'</a>').addClass(className||cmd).attr('title',tooltip)).click(function(){if(fn)fn.apply(self);else
{self.withoutCss();self.editorDoc.execCommand(cmd,false,args);}
if(self.options.autoSave)self.saveContent();}).appendTo(this.panel);},appendMenuSeparator:function()
{$('<li role="separator" class="separator"></li>').appendTo(this.panel);},appendControls:function()
{for(var name in this.options.controls)
{var control=this.options.controls[name];if(control.separator)
{if(control.visible!==false)
this.appendMenuSeparator();}
else if(control.visible)
{this.appendMenu(control.command||name,control.arguments||[],control.className||control.command||name||'empty',control.exec,control.tooltip||control.command||name||'');}}},checkTargets:function(element)
{for(var name in this.options.controls)
{var control=this.options.controls[name];var className=control.className||control.command||name||'empty';$('.'+className,this.panel).removeClass('active');if(control.tags)
{var elm=element;do{if(elm.nodeType!=1)
break;if($.inArray(elm.tagName.toLowerCase(),control.tags)!=-1)
$('.'+className,this.panel).addClass('active');}while((elm=elm.parentNode));}
if(control.css)
{var elm=$(element);do{if(elm[0].nodeType!=1)
break;for(var cssProperty in control.css)
if(elm.css(cssProperty).toString().toLowerCase()==control.css[cssProperty])
$('.'+className,this.panel).addClass('active');}while((elm=elm.parent()));}}},getElementByAttributeValue:function(tagName,attributeName,attributeValue)
{var elements=this.editorDoc.getElementsByTagName(tagName);for(var i=0;i<elements.length;i++)
{var value=elements[i].getAttribute(attributeName);if($.browser.msie)
{value=value.substr(value.length-attributeValue.length);}
if(value==attributeValue)
return elements[i];}
return false;}});})(jQuery);(function($){$.facebox=function(data,klass){$.facebox.loading(data)
if(data.ajax)fillFaceboxFromAjax(data.ajax)
else if(data.image)fillFaceboxFromImage(data.image)
else if(data.div)fillFaceboxFromHref(data.div)
else if($.isFunction(data))data.call($)
else $.facebox.reveal(data,klass)}
$.extend($.facebox,{settings:{opacity:0.3,overlay:true,modal:true,loadingImage:'/images/loading.gif',closeImage:'/images/closelabel.gif',imageTypes:['png','jpg','jpeg','gif','bmp'],faceboxHtml:'\
    <div id="facebox" style="display:none;"> \
      <div class="popup"> \
        <table cellpadding="0" cellspacing="0"> \
          <tbody> \
            <tr> \
              <td class="tl"/><td class="b"/><td class="tr"/> \
            </tr> \
            <tr> \
              <td class="b"/> \
              <td class="body" id="facebox_body"> \
                <div class="content"> \
                </div> \
                <div class="footer"> \
                  <a href="#" class="close"> \
                    <img src="/images/closelabel.gif" title="close" class="close_image" /> \
                  </a> \
                </div> \
              </td> \
              <td class="b"/> \
            </tr> \
            <tr> \
              <td class="bl"/><td class="b"/><td class="br"/> \
            </tr> \
          </tbody> \
        </table> \
      </div> \
    </div>'},loading:function(data){init()
if(data.style){$.facebox.settings.style=data.style
$('.body').attr({style:$.facebox.settings.style})}
if($('#facebox .loading').length==1)return true
showOverlay()
$('#facebox .content').empty()
$('#facebox .body').children().hide().end().append('<div class="loading"><img src="'+$.facebox.settings.loadingImage+'"/></div>')
$('#facebox').css({top:getPageScroll()[1]+(getPageHeight()/10),left:385.5}).show()
if(!$.facebox.settings.modal){$(document).bind('keydown.facebox',function(e){if(e.keyCode==27)$.facebox.close()
return true})}
$(document).trigger('loading.facebox')},reveal:function(data,klass){$(document).trigger('beforeReveal.facebox')
if(klass)$('#facebox .content').addClass(klass)
$('#facebox .content').empty()
$('#facebox .content').append(data)
$('#facebox .loading').remove()
$('#facebox .body').children().fadeIn('normal')
$('#facebox').css('left',$(window).width()/2-($('#facebox table').width()/2))
$(document).trigger('reveal.facebox').trigger('afterReveal.facebox')},close:function(){$(document).trigger('close.facebox')
return false}})
$.fn.facebox=function(settings){init(settings)
function clickHandler(){$.facebox.loading(true)
var klass=this.rel.match(/facebox\[?\.(\w+)\]?/)
if(klass)klass=klass[1]
fillFaceboxFromHref(this.href,klass)
return false}
return this.click(clickHandler)}
function init(settings){if($.facebox.settings.inited)return true
else $.facebox.settings.inited=true
$(document).trigger('init.facebox')
makeCompatible()
var imageTypes=$.facebox.settings.imageTypes.join('|')
$.facebox.settings.imageTypesRegexp=new RegExp('\.'+imageTypes+'$','i')
if(settings)$.extend($.facebox.settings,settings)
$('body').append($.facebox.settings.faceboxHtml)
var preload=[new Image(),new Image()]
preload[0].src=$.facebox.settings.closeImage
preload[1].src=$.facebox.settings.loadingImage
$('#facebox').find('.b:first, .bl, .br, .tl, .tr').each(function(){preload.push(new Image())
preload.slice(-1).src=$(this).css('background-image').replace(/url\((.+)\)/,'$1')})
$('#facebox .close').click($.facebox.close)
$('#facebox .close_image').attr('src',$.facebox.settings.closeImage)}
function getPageScroll(){var xScroll,yScroll;if(self.pageYOffset){yScroll=self.pageYOffset;xScroll=self.pageXOffset;}else if(document.documentElement&&document.documentElement.scrollTop){yScroll=document.documentElement.scrollTop;xScroll=document.documentElement.scrollLeft;}else if(document.body){yScroll=document.body.scrollTop;xScroll=document.body.scrollLeft;}
return new Array(xScroll,yScroll)}
function getPageHeight(){var windowHeight
if(self.innerHeight){windowHeight=self.innerHeight;}else if(document.documentElement&&document.documentElement.clientHeight){windowHeight=document.documentElement.clientHeight;}else if(document.body){windowHeight=document.body.clientHeight;}
return windowHeight}
function makeCompatible(){var $s=$.facebox.settings
$s.loadingImage=$s.loading_image||$s.loadingImage
$s.closeImage=$s.close_image||$s.closeImage
$s.imageTypes=$s.image_types||$s.imageTypes
$s.faceboxHtml=$s.facebox_html||$s.faceboxHtml}
function fillFaceboxFromHref(href,klass){if(href.match(/#/)){var url=window.location.href.split('#')[0]
var target=href.replace(url,'')
$.facebox.reveal($(target).clone().show(),klass)}else if(href.match($.facebox.settings.imageTypesRegexp)){fillFaceboxFromImage(href,klass)}else{fillFaceboxFromAjax(href,klass)}}
function fillFaceboxFromImage(href,klass){var image=new Image()
image.onload=function(){$.facebox.reveal('<div class="image"><img src="'+image.src+'" /></div>',klass)}
image.src=href}
function fillFaceboxFromAjax(href,klass){$.get(href,function(data){$.facebox.reveal(data,klass)})}
function skipOverlay(){return $.facebox.settings.overlay==false||$.facebox.settings.opacity===null}
function showOverlay(){if(skipOverlay())return
if($('facebox_overlay').length==0)
$("body").append('<div id="facebox_overlay" class="facebox_hide"></div>')
$('#facebox_overlay').hide().addClass("facebox_overlayBG").css('opacity',$.facebox.settings.opacity).fadeIn(200)
if(!$.facebox.settings.modal){$('#facebox_overlay').click(function(){$(document).trigger('close.facebox')})}
return false}
function hideOverlay(){if(skipOverlay())return
$('#facebox_overlay').fadeOut(200,function(){$("#facebox_overlay").removeClass("facebox_overlayBG")
$("#facebox_overlay").addClass("facebox_hide")
$("#facebox_overlay").remove()})
return false}
$(document).bind('close.facebox',function(){$(document).unbind('keydown.facebox')
$('#facebox').fadeOut(function(){$('#facebox .content').removeClass().addClass('content')
hideOverlay()
$('#facebox .loading').remove()
if($('#loaded_article_id').attr('value')!=''&&$('#loaded_article_id').attr('value')!=null){bindHotkeys($('#loaded_article_id').attr('value'));}})})})(jQuery);;(function($){$.fn.supersubs=function(options){var opts=$.extend({},$.fn.supersubs.defaults,options);return this.each(function(){var $$=$(this);var o=$.meta?$.extend({},opts,$$.data()):opts;var fontsize=$('<li id="menu-fontsize">&#8212;</li>').css({'padding':0,'position':'absolute','top':'-999em','width':'auto'}).appendTo($$).width();$('#menu-fontsize').remove();$ULs=$$.find('ul');$ULs.each(function(i){var $ul=$ULs.eq(i);var $LIs=$ul.children();var $As=$LIs.children('a');var liFloat=$LIs.css('white-space','nowrap').css('float');var emWidth=$ul.add($LIs).add($As).css({'float':'none','width':'auto'}).end().end()[0].clientWidth/fontsize;emWidth+=o.extraWidth;if(emWidth>o.maxWidth){emWidth=o.maxWidth;}
else if(emWidth<o.minWidth){emWidth=o.minWidth;}
emWidth+='em';$ul.css('width',emWidth);$LIs.css({'float':liFloat,'width':'100%','white-space':'normal'}).each(function(){var $childUl=$('>ul',this);var offsetDirection=$childUl.css('left')!==undefined?'left':'right';$childUl.css(offsetDirection,emWidth);});});});};$.fn.supersubs.defaults={minWidth:9,maxWidth:25,extraWidth:0};})(jQuery);;(function($){$.fn.superfish=function(op){var sf=$.fn.superfish,c=sf.c,$arrow=$(['<span class="',c.arrowClass,'"> &#187;</span>'].join('')),over=function(){var $$=$(this),menu=getMenu($$);clearTimeout(menu.sfTimer);$$.showSuperfishUl().siblings().hideSuperfishUl();},out=function(){var $$=$(this),menu=getMenu($$),o=sf.op;clearTimeout(menu.sfTimer);menu.sfTimer=setTimeout(function(){o.retainPath=($.inArray($$[0],o.$path)>-1);$$.hideSuperfishUl();if(o.$path.length&&$$.parents(['li.',o.hoverClass].join('')).length<1){over.call(o.$path);}},o.delay);},getMenu=function($menu){var menu=$menu.parents(['ul.',c.menuClass,':first'].join(''))[0];sf.op=sf.o[menu.serial];return menu;},addArrow=function($a){$a.addClass(c.anchorClass).append($arrow.clone());};return this.each(function(){var s=this.serial=sf.o.length;var o=$.extend({},sf.defaults,op);o.$path=$('li.'+o.pathClass,this).slice(0,o.pathLevels).each(function(){$(this).addClass([o.hoverClass,c.bcClass].join(' ')).filter('li:has(ul)').removeClass(o.pathClass);});sf.o[s]=sf.op=o;$('li:has(ul)',this)[($.fn.hoverIntent&&!o.disableHI)?'hoverIntent':'hover'](over,out).each(function(){if(o.autoArrows)addArrow($('>a:first-child',this));}).not('.'+c.bcClass).hideSuperfishUl();var $a=$('a',this);$a.each(function(i){var $li=$a.eq(i).parents('li');$a.eq(i).focus(function(){over.call($li);}).blur(function(){out.call($li);});});o.onInit.call(this);}).each(function(){var menuClasses=[c.menuClass];if(sf.op.dropShadows&&!($.browser.msie&&$.browser.version<7))menuClasses.push(c.shadowClass);$(this).addClass(menuClasses.join(' '));});};var sf=$.fn.superfish;sf.o=[];sf.op={};sf.IE7fix=function(){var o=sf.op;if($.browser.msie&&$.browser.version>6&&o.dropShadows&&o.animation.opacity!=undefined)
this.toggleClass(sf.c.shadowClass+'-off');};sf.c={bcClass:'sf-breadcrumb',menuClass:'sf-js-enabled',anchorClass:'sf-with-ul',arrowClass:'sf-sub-indicator',shadowClass:'sf-shadow'};sf.defaults={hoverClass:'sfHover',pathClass:'overideThisToUse',pathLevels:1,delay:800,animation:{opacity:'show'},speed:'normal',autoArrows:false,dropShadows:true,disableHI:false,onInit:function(){},onBeforeShow:function(){},onShow:function(){},onHide:function(){}};$.fn.extend({hideSuperfishUl:function(){var o=sf.op,not=(o.retainPath===true)?o.$path:'';o.retainPath=false;var $ul=$(['li.',o.hoverClass].join(''),this).add(this).not(not).removeClass(o.hoverClass).find('>ul').hide().css('visibility','hidden');o.onHide.call($ul);return this;},showSuperfishUl:function(){var o=sf.op,sh=sf.c.shadowClass+'-off',$ul=this.addClass(o.hoverClass).find('>ul:hidden').css('visibility','visible');sf.IE7fix.call($ul);o.onBeforeShow.call($ul);$ul.animate(o.animation,o.speed,function(){sf.IE7fix.call($ul);o.onShow.call($ul);});return this;}});})(jQuery);(function($){$.fn.autoResize=function(options){var settings=$.extend({onResize:function(){},animate:true,animateDuration:150,animateCallback:function(){},extraSpace:20,limit:1000},options);this.filter('textarea').each(function(){var textarea=$(this).css({resize:'none','overflow-y':'hidden'}),origHeight=textarea.height(),clone=(function(){var props=['height','width','lineHeight','textDecoration','letterSpacing'],propOb={};$.each(props,function(i,prop){propOb[prop]=textarea.css(prop);});return textarea.clone().removeAttr('id').removeAttr('name').css({position:'absolute',top:0,left:-9999}).css(propOb).attr('tabIndex','-1').insertBefore(textarea);})(),lastScrollTop=null,updateSize=function(){clone.height(0).val($(this).val()).scrollTop(10000);var scrollTop=Math.max(clone.scrollTop(),origHeight)+settings.extraSpace,toChange=$(this).add(clone);if(lastScrollTop===scrollTop){return;}
lastScrollTop=scrollTop;if(scrollTop>=settings.limit){$(this).css('overflow-y','');return;}
settings.onResize.call(this);settings.animate&&textarea.css('display')==='block'?toChange.stop().animate({height:scrollTop},settings.animateDuration,settings.animateCallback):toChange.height(scrollTop);};textarea.unbind('.dynSiz').bind('keyup.dynSiz',updateSize).bind('keydown.dynSiz',updateSize).bind('change.dynSiz',updateSize);});return this;};})(jQuery);
