(function($){$.fn.do_search_collapse=function()
{return this.each(function(){function check_used(element)
{e=$(element);if(e.find('input[id$=_toggle]:checkbox').length>0)
{if(e.find('input[id$=_toggle]:checkbox:checked').length==0)
{return true;}};if(e.find(':text[value]').length>0){return true;};if(e.find('select .default_option').length>0)
{if(e.find('select .default_option:selected').length==0)
{return true;}}
return false;};var indicator=$(this).find('.collapser:first');var collapse=$(this).find('.collapse:first');indicator.click(function()
{var container=$(this).parent();target=container.find('.collapse:first');target.slideToggle('normal');$(this).toggleClass('expanded');$(this).toggleClass('collapsed');});if(check_used(this)){indicator.addClass('expanded');}else{collapse.hide();indicator.addClass('collapsed');};});};})(jQuery);function toggleSelect(selectbutton,id,initialState,formName){id=id||'ids:list'
var state=selectbutton.isSelected;state=state==null?Boolean(initialState):state;selectbutton.isSelected=!state;var base=formName?jQuery(document.forms[formName]):jQuery(document);base.find(':checkbox[name='+id+']').attr('checked',!state);};(function($){$.fn.superfish=function(op){var sf=$.fn.superfish,c=sf.c,$arrow=$(['<span class="',c.arrowClass,'"> »</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(){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:'navTreeItemInPath, selected',pathLevels:1,delay:400,animation:{opacity:'show'},speed:50,autoArrows:true,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);jQuery(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:0,timeout:100};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.fn.fancyZoom=function(options){var options=options||{};var directory=options&&options.directory?options.directory:'++resource++collective.fancyzoomview.images';var zooming=false;if($('#zoom').length==0){var ext=$.browser.msie?'gif':'png';var html='<div id="zoom" style="display:none; z-index: 999;"> \
                  <table id="zoom_table" style="border-collapse:collapse; width:100%; height:100%;"> \
                    <tbody> \
                      <tr> \
                        <td class="tl" style="background:url('+directory+'/tl.'+ext+') 0 0 no-repeat; width:20px; height:20px; overflow:hidden;" /> \
                        <td class="tm" style="background:url('+directory+'/tm.'+ext+') 0 0 repeat-x; height:20px; overflow:hidden;" /> \
                        <td class="tr" style="background:url('+directory+'/tr.'+ext+') 100% 0 no-repeat; width:20px; height:20px; overflow:hidden;" /> \
                      </tr> \
                      <tr> \
                        <td class="ml" style="background:url('+directory+'/ml.'+ext+') 0 0 repeat-y; width:20px; overflow:hidden;" /> \
                        <td class="mm" style="background:#fff; vertical-align:top; padding:10px;"> \
                          <div id="zoom_content"> \
                          </div> \
                        </td> \
                        <td class="mr" style="background:url('+directory+'/mr.'+ext+') 100% 0 repeat-y;  width:20px; overflow:hidden;" /> \
                      </tr> \
                      <tr> \
                        <td class="bl" style="background:url('+directory+'/bl.'+ext+') 0 100% no-repeat; width:20px; height:20px; overflow:hidden;" /> \
                        <td class="bm" style="background:url('+directory+'/bm.'+ext+') 0 100% repeat-x; height:20px; overflow:hidden;" /> \
                        <td class="br" style="background:url('+directory+'/br.'+ext+') 100% 100% no-repeat; width:20px; height:20px; overflow:hidden;" /> \
                      </tr> \
                    </tbody> \
                  </table> \
                  <a href="#" title="Close" id="zoom_close" style="position:absolute; top:0; left:0;"> \
                    <img src="'+directory+'/closebox.'+ext+'" alt="Close" style="border:none; margin:0; padding:0;" /> \
                  </a> \
                </div>';$('body').append(html);$('html').click(function(e){if($(e.target).parents('#zoom:visible').length==0)hide();});$(document).keyup(function(event){if(event.keyCode==27&&$('#zoom:visible').length>0)hide();});$('#zoom_close').click(hide);}
var zoom=$('#zoom');var zoom_table=$('#zoom_table');var zoom_close=$('#zoom_close');var zoom_content=$('#zoom_content');var middle_row=$('td.ml,td.mm,td.mr');this.each(function(i){$($(this).attr('href')).hide();$(this).click(show);});return this;function show(e){if(zooming)return false;zooming=true;var content_div=$($(this).attr('href'));var zoom_width=options.width;var zoom_height=options.height;var width=window.innerWidth||(window.document.documentElement.clientWidth||window.document.body.clientWidth);var height=window.innerHeight||(window.document.documentElement.clientHeight||window.document.body.clientHeight);var x=window.pageXOffset||(window.document.documentElement.scrollLeft||window.document.body.scrollLeft);var y=window.pageYOffset||(window.document.documentElement.scrollTop||window.document.body.scrollTop);var window_size={'width':width,'height':height,'x':x,'y':y}
var width=(zoom_width||content_div.width())+60;var height=(zoom_height||content_div.height())+60;var d=window_size;var newTop=Math.max((d.height/2)-(height/2)+y,0);var newLeft=(d.width/2)-(width/2);var curTop=e.pageY;var curLeft=e.pageX;zoom_close.attr('curTop',curTop);zoom_close.attr('curLeft',curLeft);zoom_close.attr('scaleImg',options.scaleImg?'true':'false');$('#zoom').hide().css({position:'absolute',top:curTop+'px',left:curLeft+'px',width:'1px',height:'1px'});fixBackgroundsForIE();zoom_close.hide();if(options.closeOnClick){$('#zoom').click(hide);}
if(options.scaleImg){zoom_content.html(content_div.html());$('#zoom_content img').css('width','100%');}else{zoom_content.html('');}
$('#zoom').animate({top:newTop+'px',left:newLeft+'px',opacity:"show",width:width,height:height},500,null,function(){if(options.scaleImg!=true){zoom_content.html(content_div.html());}
unfixBackgroundsForIE();zoom_close.show();zooming=false;})
return false;}
function hide(){if(zooming)return false;zooming=true;$('#zoom').unbind('click');fixBackgroundsForIE();if(zoom_close.attr('scaleImg')!='true'){zoom_content.html('');}
zoom_close.hide();$('#zoom').animate({top:zoom_close.attr('curTop')+'px',left:zoom_close.attr('curLeft')+'px',opacity:"hide",width:'1px',height:'1px'},500,null,function(){if(zoom_close.attr('scaleImg')=='true'){zoom_content.html('');}
unfixBackgroundsForIE();zooming=false;});return false;}
function switchBackgroundImagesTo(to){$('#zoom_table td').each(function(i){var bg=$(this).css('background-image').replace(/\.(png|gif|none)\"\)$/,'.'+to+'")');$(this).css('background-image',bg);});var close_img=zoom_close.children('img');var new_img=close_img.attr('src').replace(/\.(png|gif|none)$/,'.'+to);close_img.attr('src',new_img);}
function fixBackgroundsForIE(){if($.browser.msie&&parseFloat($.browser.version)>=7){switchBackgroundImagesTo('gif');}}
function unfixBackgroundsForIE(){if($.browser.msie&&$.browser.version>=7){switchBackgroundImagesTo('png');}}}
$(function(){$("ul.tabs").tabs("div.panes > div");$("#carousel").scrollable({vertical:true,mousewheel:true}).navigator("ul#carousel_navi");$("#carousel_navi li").click(function(){if($(this).hasClass("active")){return;}
$("#carousel_navi li").removeClass("active");$(this).addClass("active");}).filter(":first").click();$("#loginbox input").focus(function(){$(this).removeClass();});jQuery('ul.sf-menu').superfish();$(".standard-document").each(function(div){$(this).find("a:first").each(function(a){$(this).parent().parent().parent().children("h2").wrapInner('<a href="'+$(this).attr('href')+'" />');});});});
