(function($){$.fn.loopedCarousel=function(options){var defaults={container:'.container',slides:'.slides',pagination:'.pagination',autoStart:0,slidespeed:300,fadespeed:300,items:3,padding:10,showPagination:true,vertical:false};this.each(function(){var obj=$(this);var o=$.extend(defaults,options);var i=o.items;var m=0;var t=1;var s=$(o.slides,obj).children().size();var w=$(o.slides,obj).children().outerWidth()+o.padding;var h=$(o.slides,obj).children().outerHeight()+o.padding;var c=Math.ceil($(o.slides,obj).children().size()/i);var pd=o.padding/2;var p=0;var u=false;var n=0;var pt=0;var os=i*c-s;var params={};if(o.vertical===true){w=h;}
if(o.showPagination){var buttons=s/i;$(obj).append('<ul class="pagination">');$(o.slides,obj).children().each(function(){if(n<buttons){$(o.pagination,obj).append('<li><a rel="'+(n+1)+'" href="#" >'+(n+1)+'</a></li>');n=n+1;}else{n=0;return false;}
$(o.pagination+' li a:eq(0)',obj).parent().addClass('active');});}
if(o.vertical===true){$(o.container,obj).css({height:(w*i)});$(o.slides,obj).css({height:(s*w)});}else{$(o.container,obj).css({width:(w*i)});$(o.slides,obj).css({width:(s*w)});}
$(o.slides,obj).children().each(function(){if(o.vertical===true){$(this).css({position:'absolute',top:p+pd,display:'block'});}else{$(this).css({position:'absolute',left:p+pd,display:'block'});}
p=p+w;});$(o.slides,obj).children().each(function(){pt=pt+1;if(pt<i+1){params[o.vertical?'top':'left']=(-w*pt)+pd-(w*os);$(o.slides,obj).children(':eq('+(s-pt)+')').css(params);}
if(pt===i+2){pt=0;return false;}});$('.next',obj).click(function(){if(u===false){animate('next',true);if(o.autoStart){clearInterval(sliderIntervalID);}}
return false;});$('.previous',obj).click(function(){if(u===false){animate('prev',true);if(o.autoStart){clearInterval(sliderIntervalID);}}return false;});$(o.pagination+' li a',obj).click(function(){if($(this).parent().hasClass('active')){return false;}
else{t=$(this).attr('rel');$(o.pagination+' li a',obj).parent().siblings().removeClass('active');$(this).parent().addClass('active');animate('fade',t);if(o.autoStart){clearInterval(sliderIntervalID);}}return false;});if(o.autoStart){sliderIntervalID=setInterval(function(){if(u===false){animate('next',true);}},o.autoStart);}
function current(t){if(t===c+1){t=1;}
if(t===0){t=c;}
$(o.pagination+' li a',obj).parent().siblings().removeClass('active');$(o.pagination+' li a[rel="'+(t)+'"]',obj).parent().addClass('active');}
function animate(dir,clicked){u=true;switch(dir){case'next':t=t+1;m=(-(t*w-w)*i);current(t);params[o.vertical?'top':'left']=m;$(o.slides,obj).animate(params,o.slidespeed,function(){if(t===c+1){t=1;params[o.vertical?'top':'left']=0;$(o.slides,obj).css(params,function(){$(o.slides,obj).animate(params);});$(o.slides,obj).children().each(function(){if(pt<i){params[o.vertical?'top':'left']=(w*pt)+pd;$(o.slides,obj).children(':eq('+pt+')').css(params);params[o.vertical?'top':'left']=-(w*(pt+os+1)-pd);$(o.slides,obj).children(':eq('+(s-(pt+1))+')').css(params);}else{pt=0;return false;}
pt=pt+1;});}
if(t===c){$(o.slides,obj).children().each(function(){if(pt<i){params[o.vertical?'top':'left']=w*(s+pt+os)+pd;$(o.slides,obj).children(':eq('+(pt)+')').css(params);}else{pt=0;return false;}
pt=pt+1;});}
if(t===2){$(o.slides,obj).children().each(function(){pt=pt+1;if(pt<i+1){params[o.vertical?'top':'left']=((w*s)+pd)-(w*pt);$(o.slides,obj).children(':eq('+(s-pt)+')').css(params);}else{pt=0;return false;}});}
u=false;});break;case'prev':t=t-1;m=(-(t*w-w)*i);current(t);params[o.vertical?'top':'left']=m;$(o.slides,obj).animate(params,o.slidespeed,function(){if(t===0){t=c;params[o.vertical?'top':'left']=-w*(s-i)-(w*os);$(o.slides,obj).css(params);$(o.slides,obj).children().each(function(){if(pt<i){params[o.vertical?'top':'left']=w*(s+pt+os)+pd;$(o.slides,obj).children(':eq('+pt+')').css(params);params[o.vertical?'top':'left']=(s*w)+pd-(pt*w)-w;$(o.slides,obj).children(':eq('+((s-1)-pt)+')').css(params);}else{pt=0;return false;}
pt=pt+1;});}
if(t===2){$(o.slides,obj).children().each(function(){if(pt<i){params[o.vertical?'top':'left']=(w*pt)+pd;$(o.slides,obj).children(':eq('+pt+')').css(params);}else{pt=0;return false;}
pt=pt+1;});}
if(t===1){$(o.slides,obj).children().each(function(){if(pt<i){params[o.vertical?'top':'left']=-(w*pt)-w+pd-(w*os);$(o.slides,obj).children(':eq('+((s-1)-pt)+')').css(params);}else{pt=0;return false;}
pt=pt+1;});}
u=false;});break;case'fade':t=[t]*1;m=(-(t*w-w)*i);current(t);$(o.slides,obj).children().fadeOut(o.fadespeed,function(){params[o.vertical?'top':'left']=m;$(o.slides,obj).css(params);$(o.slides,obj).children().each(function(){if(pt<i){params[o.vertical?'top':'left']=(pt*w)+pd;$(o.slides,obj).children(':eq('+pt+')').css(params);params[o.vertical?'top':'left']=w*(s-pt)-w+pd;$(o.slides,obj).children(':eq('+((s-1)-pt)+')').css(params);}else{pt=0;return false;}
pt=pt+1;});if(t===c){$(o.slides,obj).children().each(function(){if(pt<i){params[o.vertical?'top':'left']=w*(s+pt+os)+pd;$(o.slides,obj).children(':eq('+(pt)+')').css(params);}else{pt=0;return false;}
pt=pt+1;});}
if(t===1){$(o.slides,obj).children().each(function(){pt=pt+1;if(pt<i+1){params[o.vertical?'top':'left']=-(w*pt)+pd-(w*os);$(o.slides,obj).children(':eq('+(s-pt)+')').css(params);}else{pt=0;return false;}});}
$(o.slides,obj).children().fadeIn(o.fadespeed);u=false;});break;default:break;}}});};})(jQuery);(function($)
{var _options={};var _container={};var _breadCrumbElements={};var _autoIntervalArray=[];var _easingEquation;jQuery.fn.jBreadCrumb=function(options)
{_options=$.extend({},$.fn.jBreadCrumb.defaults,options);return this.each(function()
{_container=$(this);setupBreadCrumb();});};function setupBreadCrumb()
{if(typeof(jQuery.easing)=='object')
{_easingEquation='easeOutQuad'}
else
{_easingEquation='swing'}
_breadCrumbElements=jQuery(_container).find('li');jQuery(_container).find('ul').wrap('<div style="overflow:hidden; position:relative;  width: '+jQuery(_container).css("width")+';"><div>');jQuery(_container).find('ul').width(5000);if(_breadCrumbElements.length>0)
{jQuery(_breadCrumbElements[_breadCrumbElements.length-1]).addClass('last');jQuery(_breadCrumbElements[0]).addClass('first');if(_breadCrumbElements.length>_options.minimumCompressionElements)
{compressBreadCrumb();};};};function compressBreadCrumb()
{var finalElement=jQuery(_breadCrumbElements[_breadCrumbElements.length-1]);if(jQuery(finalElement).width()>_options.maxFinalElementLength)
{if(_options.beginingElementsToLeaveOpen>0)
{_options.beginingElementsToLeaveOpen--;}
if(_options.endElementsToLeaveOpen>0)
{_options.endElementsToLeaveOpen--;}}
if(jQuery(finalElement).width()<_options.maxFinalElementLength&&jQuery(finalElement).width()>_options.minFinalElementLength)
{if(_options.beginingElementsToLeaveOpen>0)
{_options.beginingElementsToLeaveOpen--;}}
var itemsToRemove=_breadCrumbElements.length-1-_options.endElementsToLeaveOpen;jQuery(_breadCrumbElements[_breadCrumbElements.length-1]).css({background:'none'});$(_breadCrumbElements).each(function(i,listElement)
{if(i>_options.beginingElementsToLeaveOpen&&i<itemsToRemove)
{jQuery(listElement).find('a').wrap('<span></span>').width(jQuery(listElement).find('a').width()+10);jQuery(listElement).append(jQuery('<div class="'+_options.overlayClass+'"></div>').css({display:'block'})).css({background:'none'});if(isIE6OrLess())
{fixPNG(jQuery(listElement).find('.'+_options.overlayClass).css({width:'20px',right:"-1px"}));}
var options={id:i,width:jQuery(listElement).width(),listElement:jQuery(listElement).find('span'),isAnimating:false,element:jQuery(listElement).find('span')};jQuery(listElement).bind('mouseover',options,expandBreadCrumb).bind('mouseout',options,shrinkBreadCrumb);jQuery(listElement).find('a').unbind('mouseover',expandBreadCrumb).unbind('mouseout',shrinkBreadCrumb);listElement.autoInterval=setInterval(function()
{clearInterval(listElement.autoInterval);jQuery(listElement).find('span').animate({width:_options.previewWidth},_options.timeInitialCollapse,_options.easing);},(150*(i-2)));}});};function expandBreadCrumb(e)
{var elementID=e.data.id;var originalWidth=e.data.width;jQuery(e.data.element).stop();jQuery(e.data.element).animate({width:originalWidth},{duration:_options.timeExpansionAnimation,easing:_options.easing,queue:false});return false;};function shrinkBreadCrumb(e)
{var elementID=e.data.id;jQuery(e.data.element).stop();jQuery(e.data.element).animate({width:_options.previewWidth},{duration:_options.timeCompressionAnimation,easing:_options.easing,queue:false});return false;};function isIE6OrLess()
{var isIE6=$.browser.msie&&/MSIE\s(5\.5|6\.)/.test(navigator.userAgent);return isIE6;};function fixPNG(element)
{var image;if(jQuery(element).is('img'))
{image=jQuery(element).attr('src');}
else
{image=$(element).css('backgroundImage');image.match(/^url\(["']?(.*\.png)["']?\)$/i);image=RegExp.$1;;}
$(element).css({'backgroundImage':'none','filter':"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=scale, src='"+image+"')"});};jQuery.fn.jBreadCrumb.defaults={maxFinalElementLength:400,minFinalElementLength:200,minimumCompressionElements:5,endElementsToLeaveOpen:1,beginingElementsToLeaveOpen:1,timeExpansionAnimation:800,timeCompressionAnimation:500,timeInitialCollapse:600,easing:_easingEquation,overlayClass:'chevronOverlay',previewWidth:20};})(jQuery);jQuery.easing['jswing']=jQuery.easing['swing'];jQuery.extend(jQuery.easing,{def:'easeOutQuad',swing:function(x,t,b,c,d){return jQuery.easing[jQuery.easing.def](x,t,b,c,d);},easeInQuad:function(x,t,b,c,d){return c*(t/=d)*t+b;},easeOutQuad:function(x,t,b,c,d){return-c*(t/=d)*(t-2)+b;},easeInOutQuad:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t+b;return-c/2*((--t)*(t-2)-1)+b;},easeInCubic:function(x,t,b,c,d){return c*(t/=d)*t*t+b;},easeOutCubic:function(x,t,b,c,d){return c*((t=t/d-1)*t*t+1)+b;},easeInOutCubic:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t+b;return c/2*((t-=2)*t*t+2)+b;},easeInQuart:function(x,t,b,c,d){return c*(t/=d)*t*t*t+b;},easeOutQuart:function(x,t,b,c,d){return-c*((t=t/d-1)*t*t*t-1)+b;},easeInOutQuart:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t+b;return-c/2*((t-=2)*t*t*t-2)+b;},easeInQuint:function(x,t,b,c,d){return c*(t/=d)*t*t*t*t+b;},easeOutQuint:function(x,t,b,c,d){return c*((t=t/d-1)*t*t*t*t+1)+b;},easeInOutQuint:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t*t+b;return c/2*((t-=2)*t*t*t*t+2)+b;},easeInSine:function(x,t,b,c,d){return-c*Math.cos(t/d*(Math.PI/2))+c+b;},easeOutSine:function(x,t,b,c,d){return c*Math.sin(t/d*(Math.PI/2))+b;},easeInOutSine:function(x,t,b,c,d){return-c/2*(Math.cos(Math.PI*t/d)-1)+b;},easeInExpo:function(x,t,b,c,d){return(t==0)?b:c*Math.pow(2,10*(t/d-1))+b;},easeOutExpo:function(x,t,b,c,d){return(t==d)?b+c:c*(-Math.pow(2,-10*t/d)+1)+b;},easeInOutExpo:function(x,t,b,c,d){if(t==0)return b;if(t==d)return b+c;if((t/=d/2)<1)return c/2*Math.pow(2,10*(t-1))+b;return c/2*(-Math.pow(2,-10*--t)+2)+b;},easeInCirc:function(x,t,b,c,d){return-c*(Math.sqrt(1-(t/=d)*t)-1)+b;},easeOutCirc:function(x,t,b,c,d){return c*Math.sqrt(1-(t=t/d-1)*t)+b;},easeInOutCirc:function(x,t,b,c,d){if((t/=d/2)<1)return-c/2*(Math.sqrt(1-t*t)-1)+b;return c/2*(Math.sqrt(1-(t-=2)*t)+1)+b;},easeInElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4;}
else var s=p/(2*Math.PI)*Math.asin(c/a);return-(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;},easeOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4;}
else var s=p/(2*Math.PI)*Math.asin(c/a);return a*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+c+b;},easeInOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d/2)==2)return b+c;if(!p)p=d*(.3*1.5);if(a<Math.abs(c)){a=c;var s=p/4;}
else var s=p/(2*Math.PI)*Math.asin(c/a);if(t<1)return-.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;return a*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*.5+c+b;},easeInBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;return c*(t/=d)*t*((s+1)*t-s)+b;},easeOutBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b;},easeInOutBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;if((t/=d/2)<1)return c/2*(t*t*(((s*=(1.525))+1)*t-s))+b;return c/2*((t-=2)*t*(((s*=(1.525))+1)*t+s)+2)+b;},easeInBounce:function(x,t,b,c,d){return c-jQuery.easing.easeOutBounce(x,d-t,0,c,d)+b;},easeOutBounce:function(x,t,b,c,d){if((t/=d)<(1/2.75)){return c*(7.5625*t*t)+b;}else if(t<(2/2.75)){return c*(7.5625*(t-=(1.5/2.75))*t+.75)+b;}else if(t<(2.5/2.75)){return c*(7.5625*(t-=(2.25/2.75))*t+.9375)+b;}else{return c*(7.5625*(t-=(2.625/2.75))*t+.984375)+b;}},easeInOutBounce:function(x,t,b,c,d){if(t<d/2)return jQuery.easing.easeInBounce(x,t*2,0,c,d)*.5+b;return jQuery.easing.easeOutBounce(x,t*2-d,0,c,d)*.5+c*.5+b;}});(function($){$.prettyPhoto={version:'3.0'};$.fn.prettyPhoto=function(pp_settings){pp_settings=jQuery.extend({animation_speed:'fast',slideshow:false,autoplay_slideshow:false,opacity:0.80,show_title:true,allow_resize:true,default_width:500,default_height:344,counter_separator_label:'/',theme:'facebook',hideflash:false,wmode:'opaque',autoplay:true,modal:false,overlay_gallery:true,keyboard_shortcuts:true,changepicturecallback:function(){},callback:function(){},markup:'<div class="pp_pic_holder"> \
      <div class="ppt">&nbsp;</div> \
      <div class="pp_top"> \
       <div class="pp_left"></div> \
       <div class="pp_middle"></div> \
       <div class="pp_right"></div> \
      </div> \
      <div class="pp_content_container"> \
       <div class="pp_left"> \
       <div class="pp_right"> \
        <div class="pp_content"> \
         <div class="pp_loaderIcon"></div> \
         <div class="pp_fade"> \
          <a href="#" class="pp_expand" title="Expand the image">Expand</a> \
          <div class="pp_hoverContainer"> \
           <a class="pp_next" href="#">next</a> \
           <a class="pp_previous" href="#">previous</a> \
          </div> \
          <div id="pp_full_res"></div> \
          <div class="pp_details clearfix"> \
           <p class="pp_description"></p> \
           <a class="pp_close" href="#">Close</a> \
           <div class="pp_nav"> \
            <a href="#" class="pp_arrow_previous">Previous</a> \
            <p class="currentTextHolder">0/0</p> \
            <a href="#" class="pp_arrow_next">Next</a> \
           </div> \
          </div> \
         </div> \
        </div> \
       </div> \
       </div> \
      </div> \
      <div class="pp_bottom"> \
       <div class="pp_left"></div> \
       <div class="pp_middle"></div> \
       <div class="pp_right"></div> \
      </div> \
     </div> \
     <div class="pp_overlay"></div>',gallery_markup:'<div class="pp_gallery"> \
        <a href="#" class="pp_arrow_previous">Previous</a> \
        <ul> \
         {gallery} \
        </ul> \
        <a href="#" class="pp_arrow_next">Next</a> \
       </div>',image_markup:'<img id="fullResImage" src="" />',flash_markup:'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="{width}" height="{height}"><param name="wmode" value="{wmode}" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="{path}" /><embed src="{path}" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="{width}" height="{height}" wmode="{wmode}"></embed></object>',quicktime_markup:'<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" height="{height}" width="{width}"><param name="src" value="{path}"><param name="autoplay" value="{autoplay}"><param name="type" value="video/quicktime"><embed src="{path}" height="{height}" width="{width}" autoplay="{autoplay}" type="video/quicktime" pluginspage="http://www.apple.com/quicktime/download/"></embed></object>',iframe_markup:'<iframe src ="{path}" width="{width}" height="{height}" frameborder="no"></iframe>',inline_markup:'<div class="pp_inline clearfix">{content}</div>',custom_markup:''},pp_settings);var matchedObjects=this,percentBased=false,correctSizes,pp_open,pp_contentHeight,pp_contentWidth,pp_containerHeight,pp_containerWidth,windowHeight=$(window).height(),windowWidth=$(window).width(),pp_slideshow;doresize=true,scroll_pos=_get_scroll();$(window).unbind('resize').resize(function(){_center_overlay();_resize_overlay();});if(pp_settings.keyboard_shortcuts){$(document).unbind('keydown').keydown(function(e){if(typeof $pp_pic_holder!='undefined'){if($pp_pic_holder.is(':visible')){switch(e.keyCode){case 37:$.prettyPhoto.changePage('previous');break;case 39:$.prettyPhoto.changePage('next');break;case 27:if(!settings.modal)
$.prettyPhoto.close();break;};return false;};};});}
$.prettyPhoto.initialize=function(){settings=pp_settings;if($.browser.msie&&parseInt($.browser.version)==6)settings.theme="light_square";_buildOverlay(this);if(settings.allow_resize)
$(window).scroll(function(){_center_overlay();});_center_overlay();set_position=jQuery.inArray($(this).attr('href'),pp_images);$.prettyPhoto.open();return false;}
$.prettyPhoto.open=function(event){if(typeof settings=="undefined"){settings=pp_settings;if($.browser.msie&&$.browser.version==6)settings.theme="light_square";_buildOverlay(event.target);pp_images=$.makeArray(arguments[0]);pp_titles=(arguments[1])?$.makeArray(arguments[1]):$.makeArray("");pp_descriptions=(arguments[2])?$.makeArray(arguments[2]):$.makeArray("");isSet=(pp_images.length>1)?true:false;set_position=0;}
if($.browser.msie&&$.browser.version==6)$('select').css('visibility','hidden');if(settings.hideflash)$('object,embed').css('visibility','hidden');_checkPosition($(pp_images).size());$('.pp_loaderIcon').show();if($ppt.is(':hidden'))$ppt.css('opacity',0).show();$pp_overlay.show().fadeTo(settings.animation_speed,settings.opacity);$pp_pic_holder.find('.currentTextHolder').text((set_position+1)+settings.counter_separator_label+$(pp_images).size());$pp_pic_holder.find('.pp_description').show().html(unescape(pp_descriptions[set_position]));(settings.show_title&&pp_titles[set_position]!=""&&typeof pp_titles[set_position]!="undefined")?$ppt.html(unescape(pp_titles[set_position])):$ppt.html('&nbsp;');movie_width=(parseFloat(grab_param('width',pp_images[set_position])))?grab_param('width',pp_images[set_position]):settings.default_width.toString();movie_height=(parseFloat(grab_param('height',pp_images[set_position])))?grab_param('height',pp_images[set_position]):settings.default_height.toString();if(movie_width.indexOf('%')!=-1||movie_height.indexOf('%')!=-1){movie_height=parseFloat(($(window).height()*parseFloat(movie_height)/100)-150);movie_width=parseFloat(($(window).width()*parseFloat(movie_width)/100)-150);percentBased=true;}else{percentBased=false;}
$pp_pic_holder.fadeIn(function(){imgPreloader="";switch(_getFileType(pp_images[set_position])){case'image':imgPreloader=new Image();nextImage=new Image();if(isSet&&set_position>$(pp_images).size())nextImage.src=pp_images[set_position+1];prevImage=new Image();if(isSet&&pp_images[set_position-1])prevImage.src=pp_images[set_position-1];$pp_pic_holder.find('#pp_full_res')[0].innerHTML=settings.image_markup;$pp_pic_holder.find('#fullResImage').attr('src',pp_images[set_position]);imgPreloader.onload=function(){correctSizes=_fitToViewport(imgPreloader.width,imgPreloader.height);_showContent();};imgPreloader.onerror=function(){alert('Image cannot be loaded. Make sure the path is correct and image exist.');$.prettyPhoto.close();};imgPreloader.src=pp_images[set_position];break;case'youtube':correctSizes=_fitToViewport(movie_width,movie_height);movie='http://www.youtube.com/v/'+grab_param('v',pp_images[set_position]);if(settings.autoplay)movie+="&autoplay=1";toInject=settings.flash_markup.replace(/{width}/g,correctSizes['width']).replace(/{height}/g,correctSizes['height']).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,movie);break;case'vimeo':correctSizes=_fitToViewport(movie_width,movie_height);movie_id=pp_images[set_position];var regExp=/http:\/\/(www\.)?vimeo.com\/(\d+)/;var match=movie_id.match(regExp);movie='http://player.vimeo.com/video/'+match[2]+'?title=0&amp;byline=0&amp;portrait=0';if(settings.autoplay)movie+="&autoplay=1;";vimeo_width=correctSizes['width']+'/embed/?moog_width='+correctSizes['width'];toInject=settings.iframe_markup.replace(/{width}/g,vimeo_width).replace(/{height}/g,correctSizes['height']).replace(/{path}/g,movie);break;case'quicktime':correctSizes=_fitToViewport(movie_width,movie_height);correctSizes['height']+=15;correctSizes['contentHeight']+=15;correctSizes['containerHeight']+=15;toInject=settings.quicktime_markup.replace(/{width}/g,correctSizes['width']).replace(/{height}/g,correctSizes['height']).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,pp_images[set_position]).replace(/{autoplay}/g,settings.autoplay);break;case'flash':correctSizes=_fitToViewport(movie_width,movie_height);flash_vars=pp_images[set_position];flash_vars=flash_vars.substring(pp_images[set_position].indexOf('flashvars')+10,pp_images[set_position].length);filename=pp_images[set_position];filename=filename.substring(0,filename.indexOf('?'));toInject=settings.flash_markup.replace(/{width}/g,correctSizes['width']).replace(/{height}/g,correctSizes['height']).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,filename+'?'+flash_vars);break;case'iframe':correctSizes=_fitToViewport(movie_width,movie_height);frame_url=pp_images[set_position];frame_url=frame_url.substr(0,frame_url.indexOf('iframe')-1);toInject=settings.iframe_markup.replace(/{width}/g,correctSizes['width']).replace(/{height}/g,correctSizes['height']).replace(/{path}/g,frame_url);break;case'custom':correctSizes=_fitToViewport(movie_width,movie_height);toInject=settings.custom_markup;break;case'inline':myClone=$(pp_images[set_position]).clone().css({'width':settings.default_width}).wrapInner('<div id="pp_full_res"><div class="pp_inline clearfix"></div></div>').appendTo($('body'));correctSizes=_fitToViewport($(myClone).width(),$(myClone).height());$(myClone).remove();toInject=settings.inline_markup.replace(/{content}/g,$(pp_images[set_position]).html());break;};if(!imgPreloader){$pp_pic_holder.find('#pp_full_res')[0].innerHTML=toInject;_showContent();};});return false;};$.prettyPhoto.changePage=function(direction){currentGalleryPage=0;if(direction=='previous'){set_position--;if(set_position<0){set_position=0;return;};}else if(direction=='next'){set_position++;if(set_position>$(pp_images).size()-1){set_position=0;}}else{set_position=direction;};if(!doresize)doresize=true;$('.pp_contract').removeClass('pp_contract').addClass('pp_expand');_hideContent(function(){$.prettyPhoto.open();});};$.prettyPhoto.changeGalleryPage=function(direction){if(direction=='next'){currentGalleryPage++;if(currentGalleryPage>totalPage){currentGalleryPage=0;};}else if(direction=='previous'){currentGalleryPage--;if(currentGalleryPage<0){currentGalleryPage=totalPage;};}else{currentGalleryPage=direction;};itemsToSlide=(currentGalleryPage==totalPage)?pp_images.length-((totalPage)*itemsPerPage):itemsPerPage;$pp_pic_holder.find('.pp_gallery li').each(function(i){$(this).animate({'left':(i*itemWidth)-((itemsToSlide*itemWidth)*currentGalleryPage)});});};$.prettyPhoto.startSlideshow=function(){if(typeof pp_slideshow=='undefined'){$pp_pic_holder.find('.pp_play').unbind('click').removeClass('pp_play').addClass('pp_pause').click(function(){$.prettyPhoto.stopSlideshow();return false;});pp_slideshow=setInterval($.prettyPhoto.startSlideshow,settings.slideshow);}else{$.prettyPhoto.changePage('next');};}
$.prettyPhoto.stopSlideshow=function(){$pp_pic_holder.find('.pp_pause').unbind('click').removeClass('pp_pause').addClass('pp_play').click(function(){$.prettyPhoto.startSlideshow();return false;});clearInterval(pp_slideshow);pp_slideshow=undefined;}
$.prettyPhoto.close=function(){clearInterval(pp_slideshow);$pp_pic_holder.stop().find('object,embed').css('visibility','hidden');$('div.pp_pic_holder,div.ppt,.pp_fade').fadeOut(settings.animation_speed,function(){$(this).remove();});$pp_overlay.fadeOut(settings.animation_speed,function(){if($.browser.msie&&$.browser.version==6)$('select').css('visibility','visible');if(settings.hideflash)$('object,embed').css('visibility','visible');$(this).remove();$(window).unbind('scroll');settings.callback();doresize=true;pp_open=false;delete settings;});};_showContent=function(){$('.pp_loaderIcon').hide();$ppt.fadeTo(settings.animation_speed,1);projectedTop=scroll_pos['scrollTop']+((windowHeight/2)-(correctSizes['containerHeight']/2));if(projectedTop<0)projectedTop=0;$pp_pic_holder.find('.pp_content').animate({'height':correctSizes['contentHeight']},settings.animation_speed);$pp_pic_holder.animate({'top':projectedTop,'left':(windowWidth/2)-(correctSizes['containerWidth']/2),'width':correctSizes['containerWidth']},settings.animation_speed,function(){$pp_pic_holder.find('.pp_hoverContainer,#fullResImage').height(correctSizes['height']).width(correctSizes['width']);$pp_pic_holder.find('.pp_fade').fadeIn(settings.animation_speed);if(isSet&&_getFileType(pp_images[set_position])=="image"){$pp_pic_holder.find('.pp_hoverContainer').show();}else{$pp_pic_holder.find('.pp_hoverContainer').hide();}
if(correctSizes['resized'])$('a.pp_expand,a.pp_contract').fadeIn(settings.animation_speed);if(settings.autoplay_slideshow&&!pp_slideshow&&!pp_open)$.prettyPhoto.startSlideshow();settings.changepicturecallback();pp_open=true;});_insert_gallery();};function _hideContent(callback){$pp_pic_holder.find('#pp_full_res object,#pp_full_res embed').css('visibility','hidden');$pp_pic_holder.find('.pp_fade').fadeOut(settings.animation_speed,function(){$('.pp_loaderIcon').show();callback();});};function _checkPosition(setCount){if(set_position==setCount-1){$pp_pic_holder.find('a.pp_next').css('visibility','hidden');$pp_pic_holder.find('a.pp_next').addClass('disabled').unbind('click');}else{$pp_pic_holder.find('a.pp_next').css('visibility','visible');$pp_pic_holder.find('a.pp_next.disabled').removeClass('disabled').bind('click',function(){$.prettyPhoto.changePage('next');return false;});};if(set_position==0){$pp_pic_holder.find('a.pp_previous').css('visibility','hidden').addClass('disabled').unbind('click');}else{$pp_pic_holder.find('a.pp_previous.disabled').css('visibility','visible').removeClass('disabled').bind('click',function(){$.prettyPhoto.changePage('previous');return false;});};(setCount>1)?$('.pp_nav').show():$('.pp_nav').hide();};function _fitToViewport(width,height){resized=false;_getDimensions(width,height);imageWidth=width,imageHeight=height;if(((pp_containerWidth>windowWidth)||(pp_containerHeight>windowHeight))&&doresize&&settings.allow_resize&&!percentBased){resized=true,fitting=false;while(!fitting){if((pp_containerWidth>windowWidth)){imageWidth=(windowWidth-200);imageHeight=(height/width)*imageWidth;}else if((pp_containerHeight>windowHeight)){imageHeight=(windowHeight-200);imageWidth=(width/height)*imageHeight;}else{fitting=true;};pp_containerHeight=imageHeight,pp_containerWidth=imageWidth;};_getDimensions(imageWidth,imageHeight);};return{width:Math.floor(imageWidth),height:Math.floor(imageHeight),containerHeight:Math.floor(pp_containerHeight),containerWidth:Math.floor(pp_containerWidth)+40,contentHeight:Math.floor(pp_contentHeight),contentWidth:Math.floor(pp_contentWidth),resized:resized};};function _getDimensions(width,height){width=parseFloat(width);height=parseFloat(height);$pp_details=$pp_pic_holder.find('.pp_details');$pp_details.width(width);detailsHeight=parseFloat($pp_details.css('marginTop'))+parseFloat($pp_details.css('marginBottom'));$pp_details=$pp_details.clone().appendTo($('body')).css({'position':'absolute','top':-10000});detailsHeight+=$pp_details.height();detailsHeight=(detailsHeight<=34)?36:detailsHeight;if($.browser.msie&&$.browser.version==7)detailsHeight+=8;$pp_details.remove();pp_contentHeight=height+detailsHeight;pp_contentWidth=width;pp_containerHeight=pp_contentHeight+$ppt.height()+$pp_pic_holder.find('.pp_top').height()+$pp_pic_holder.find('.pp_bottom').height();pp_containerWidth=width;}
function _getFileType(itemSrc){if(itemSrc.match(/youtube\.com\/watch/i)){return'youtube';}else if(itemSrc.match(/vimeo\.com/i)){return'vimeo';}else if(itemSrc.indexOf('.mov')!=-1){return'quicktime';}else if(itemSrc.indexOf('.swf')!=-1){return'flash';}else if(itemSrc.indexOf('iframe')!=-1){return'iframe';}else if(itemSrc.indexOf('custom')!=-1){return'custom';}else if(itemSrc.substr(0,1)=='#'){return'inline';}else{return'image';};};function _center_overlay(){if(doresize&&typeof $pp_pic_holder!='undefined'){scroll_pos=_get_scroll();titleHeight=$ppt.height(),contentHeight=$pp_pic_holder.height(),contentwidth=$pp_pic_holder.width();projectedTop=(windowHeight/2)+scroll_pos['scrollTop']-(contentHeight/2);$pp_pic_holder.css({'top':projectedTop,'left':(windowWidth/2)+scroll_pos['scrollLeft']-(contentwidth/2)});};};function _get_scroll(){if(self.pageYOffset){return{scrollTop:self.pageYOffset,scrollLeft:self.pageXOffset};}else if(document.documentElement&&document.documentElement.scrollTop){return{scrollTop:document.documentElement.scrollTop,scrollLeft:document.documentElement.scrollLeft};}else if(document.body){return{scrollTop:document.body.scrollTop,scrollLeft:document.body.scrollLeft};};};function _resize_overlay(){windowHeight=$(window).height(),windowWidth=$(window).width();if(typeof $pp_overlay!="undefined")$pp_overlay.height($(document).height());};function _insert_gallery(){if(isSet&&settings.overlay_gallery&&_getFileType(pp_images[set_position])=="image"){itemWidth=52+5;navWidth=(settings.theme=="facebook")?58:38;itemsPerPage=Math.floor((correctSizes['containerWidth']-100-navWidth)/itemWidth);itemsPerPage=(itemsPerPage<pp_images.length)?itemsPerPage:pp_images.length;totalPage=Math.ceil(pp_images.length/itemsPerPage)-1;if(totalPage==0){navWidth=0;$pp_pic_holder.find('.pp_gallery .pp_arrow_next,.pp_gallery .pp_arrow_previous').hide();}else{$pp_pic_holder.find('.pp_gallery .pp_arrow_next,.pp_gallery .pp_arrow_previous').show();};galleryWidth=itemsPerPage*itemWidth+navWidth;$pp_pic_holder.find('.pp_gallery').width(galleryWidth).css('margin-left',-(galleryWidth/2));$pp_pic_holder.find('.pp_gallery ul').width(itemsPerPage*itemWidth).find('li.selected').removeClass('selected');goToPage=(Math.floor(set_position/itemsPerPage)<=totalPage)?Math.floor(set_position/itemsPerPage):totalPage;if(itemsPerPage){$pp_pic_holder.find('.pp_gallery').hide().show().removeClass('disabled');}else{$pp_pic_holder.find('.pp_gallery').hide().addClass('disabled');}
$.prettyPhoto.changeGalleryPage(goToPage);$pp_pic_holder.find('.pp_gallery ul li:eq('+set_position+')').addClass('selected');}else{$pp_pic_holder.find('.pp_content').unbind('mouseenter mouseleave');$pp_pic_holder.find('.pp_gallery').hide();}}
function _buildOverlay(caller){theRel=$(caller).attr('rel');galleryRegExp=/\[(?:.*)\]/;isSet=(galleryRegExp.exec(theRel))?true:false;pp_images=(isSet)?jQuery.map(matchedObjects,function(n,i){if($(n).attr('rel').indexOf(theRel)!=-1)return $(n).attr('href');}):$.makeArray($(caller).attr('href'));pp_titles=(isSet)?jQuery.map(matchedObjects,function(n,i){if($(n).attr('rel').indexOf(theRel)!=-1)return($(n).find('img').attr('alt'))?$(n).find('img').attr('alt'):"";}):$.makeArray($(caller).find('img').attr('alt'));pp_descriptions=(isSet)?jQuery.map(matchedObjects,function(n,i){if($(n).attr('rel').indexOf(theRel)!=-1)return($(n).attr('title'))?$(n).attr('title'):"";}):$.makeArray($(caller).attr('title'));$('body').append(settings.markup);$pp_pic_holder=$('.pp_pic_holder'),$ppt=$('.ppt'),$pp_overlay=$('div.pp_overlay');if(isSet&&settings.overlay_gallery){currentGalleryPage=0;toInject="";for(var i=0;i<pp_images.length;i++){var regex=new RegExp("(.*?)\.(jpg|jpeg|png|gif)$");var results=regex.exec(pp_images[i]);if(!results){classname='default';}else{classname='';}
toInject+="<li class='"+classname+"'><a href='#'><img src='"+pp_images[i]+"' width='50' alt='' /></a></li>";};toInject=settings.gallery_markup.replace(/{gallery}/g,toInject);$pp_pic_holder.find('#pp_full_res').after(toInject);$pp_pic_holder.find('.pp_gallery .pp_arrow_next').click(function(){$.prettyPhoto.changeGalleryPage('next');$.prettyPhoto.stopSlideshow();return false;});$pp_pic_holder.find('.pp_gallery .pp_arrow_previous').click(function(){$.prettyPhoto.changeGalleryPage('previous');$.prettyPhoto.stopSlideshow();return false;});$pp_pic_holder.find('.pp_content').hover(function(){$pp_pic_holder.find('.pp_gallery:not(.disabled)').fadeIn();},function(){$pp_pic_holder.find('.pp_gallery:not(.disabled)').fadeOut();});itemWidth=52+5;$pp_pic_holder.find('.pp_gallery ul li').each(function(i){$(this).css({'position':'absolute','left':i*itemWidth});$(this).find('a').unbind('click').click(function(){$.prettyPhoto.changePage(i);$.prettyPhoto.stopSlideshow();return false;});});};if(settings.slideshow){$pp_pic_holder.find('.pp_nav').prepend('<a href="#" class="pp_play">Play</a>')
$pp_pic_holder.find('.pp_nav .pp_play').click(function(){$.prettyPhoto.startSlideshow();return false;});}
$pp_pic_holder.attr('class','pp_pic_holder '+settings.theme);$pp_overlay.css({'opacity':0,'height':$(document).height(),'width':$(document).width()}).bind('click',function(){if(!settings.modal)$.prettyPhoto.close();});$('a.pp_close').bind('click',function(){$.prettyPhoto.close();return false;});$('a.pp_expand').bind('click',function(e){if($(this).hasClass('pp_expand')){$(this).removeClass('pp_expand').addClass('pp_contract');doresize=false;}else{$(this).removeClass('pp_contract').addClass('pp_expand');doresize=true;};_hideContent(function(){$.prettyPhoto.open();});return false;});$pp_pic_holder.find('.pp_previous, .pp_nav .pp_arrow_previous').bind('click',function(){$.prettyPhoto.changePage('previous');$.prettyPhoto.stopSlideshow();return false;});$pp_pic_holder.find('.pp_next, .pp_nav .pp_arrow_next').bind('click',function(){$.prettyPhoto.changePage('next');$.prettyPhoto.stopSlideshow();return false;});_center_overlay();};return this.unbind('click').click($.prettyPhoto.initialize);};function grab_param(name,url){name=name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");var regexS="[\\?&]"+name+"=([^&#]*)";var regex=new RegExp(regexS);var results=regex.exec(url);return(results==null)?"":results[1];}})(jQuery);var xmlHttp
function showMessages(receiver_id)
{xmlHttp=GetXmlHttpObject()
if(xmlHttp==null)
{alert("Browser does not support HTTP Request")
return}
var url="getmessage.php?receiver_id="+receiver_id;xmlHttp.onreadystatechange=stateChanged
xmlHttp.open("GET",url,true)
xmlHttp.send(null)}
function stateChanged()
{if(xmlHttp.readyState==4||xmlHttp.readyState=="complete")
{if(xmlHttp.responseText>0){$.pnotify({pnotify_title:' <font color=\'#ff0000\'>Neked '+xmlHttp.responseText+' olvasatlan üzented van!</font>',pnotify_text:'<a href=\'members_area.php?page=messaging&section=received\'>Az üzenetek elolvasához, kérlek kattints ide!</a>',pnotify_notice_icon:'picon picon-mail-unread-new',pnotify_hide:true,pnotify_shadow:false,pnotify_delay:4000,pnotify_animation:{effect_in:'show',effect_out:'slide'}})}}}
function GetXmlHttpObject()
{var xmlHttp=null;try
{xmlHttp=new XMLHttpRequest();}
catch(e)
{try
{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}
catch(e)
{xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}}
return xmlHttp;}
(function($){var history_handle_top,timer;var body;var jwindow;$.extend({pnotify_remove_all:function(){var body_data=body.data("pnotify");if(body_data&&body_data.length){$.each(body_data,function(){if(this.pnotify_remove)
this.pnotify_remove();});}},pnotify_position_all:function(){if(timer)
clearTimeout(timer);timer=null;var body_data=body.data("pnotify");if(!body_data||!body_data.length)
return;$.each(body_data,function(){var s=this.opts.pnotify_stack;if(!s)return;if(!s.nextpos1)
s.nextpos1=s.firstpos1;if(!s.nextpos2)
s.nextpos2=s.firstpos2;if(!s.addpos2)
s.addpos2=0;if(this.css("display")!="none"){var curpos1,curpos2;var animate={};var csspos1;switch(s.dir1){case"down":csspos1="top";break;case"up":csspos1="bottom";break;case"left":csspos1="right";break;case"right":csspos1="left";break;}
curpos1=parseInt(this.css(csspos1));if(isNaN(curpos1))
curpos1=0;if(typeof s.firstpos1=="undefined"){s.firstpos1=curpos1;s.nextpos1=s.firstpos1;}
var csspos2;switch(s.dir2){case"down":csspos2="top";break;case"up":csspos2="bottom";break;case"left":csspos2="right";break;case"right":csspos2="left";break;}
curpos2=parseInt(this.css(csspos2));if(isNaN(curpos2))
curpos2=0;if(typeof s.firstpos2=="undefined"){s.firstpos2=curpos2;s.nextpos2=s.firstpos2;}
if((s.dir1=="down"&&s.nextpos1+this.height()>jwindow.height())||(s.dir1=="up"&&s.nextpos1+this.height()>jwindow.height())||(s.dir1=="left"&&s.nextpos1+this.width()>jwindow.width())||(s.dir1=="right"&&s.nextpos1+this.width()>jwindow.width())){s.nextpos1=s.firstpos1;s.nextpos2+=s.addpos2+10;s.addpos2=0;}
if(s.animation&&s.nextpos2<curpos2){switch(s.dir2){case"down":animate.top=s.nextpos2+"px";break;case"up":animate.bottom=s.nextpos2+"px";break;case"left":animate.right=s.nextpos2+"px";break;case"right":animate.left=s.nextpos2+"px";break;}}else
this.css(csspos2,s.nextpos2+"px");switch(s.dir2){case"down":case"up":if(this.outerHeight(true)>s.addpos2)
s.addpos2=this.height();break;case"left":case"right":if(this.outerWidth(true)>s.addpos2)
s.addpos2=this.width();break;}
if(s.nextpos1){if(s.animation&&(curpos1>s.nextpos1||animate.top||animate.bottom||animate.right||animate.left)){switch(s.dir1){case"down":animate.top=s.nextpos1+"px";break;case"up":animate.bottom=s.nextpos1+"px";break;case"left":animate.right=s.nextpos1+"px";break;case"right":animate.left=s.nextpos1+"px";break;}}else
this.css(csspos1,s.nextpos1+"px");}
if(animate.top||animate.bottom||animate.right||animate.left)
this.animate(animate,{duration:500,queue:false});switch(s.dir1){case"down":case"up":s.nextpos1+=this.height()+10;break;case"left":case"right":s.nextpos1+=this.width()+10;break;}}});$.each(body_data,function(){var s=this.opts.pnotify_stack;if(!s)return;s.nextpos1=s.firstpos1;s.nextpos2=s.firstpos2;s.addpos2=0;s.animation=true;});},pnotify:function(options){if(!body)
body=$("body");if(!jwindow)
jwindow=$(window);var animating;var opts;if(typeof options!="object"){opts=$.extend({},$.pnotify.defaults);opts.pnotify_text=options;}else{opts=$.extend({},$.pnotify.defaults,options);}
if(opts.pnotify_before_init){if(opts.pnotify_before_init(opts)===false)
return null;}
var nonblock_last_elem;var nonblock_pass=function(e,e_name){pnotify.css("display","none");var element_below=document.elementFromPoint(e.clientX,e.clientY);pnotify.css("display","block");var jelement_below=$(element_below);var cursor_style=jelement_below.css("cursor");pnotify.css("cursor",cursor_style!="auto"?cursor_style:"default");if(!nonblock_last_elem||nonblock_last_elem.get(0)!=element_below){if(nonblock_last_elem){dom_event.call(nonblock_last_elem.get(0),"mouseleave",e.originalEvent);dom_event.call(nonblock_last_elem.get(0),"mouseout",e.originalEvent);}
dom_event.call(element_below,"mouseenter",e.originalEvent);dom_event.call(element_below,"mouseover",e.originalEvent);}
dom_event.call(element_below,e_name,e.originalEvent);nonblock_last_elem=jelement_below;};var pnotify=$("<div />",{"class":"ui-pnotify "+opts.pnotify_addclass,"css":{"display":"none"},"mouseenter":function(e){if(opts.pnotify_nonblock)e.stopPropagation();if(opts.pnotify_mouse_reset&&animating=="out"){pnotify.stop(true);animating="in";pnotify.css("height","auto").animate({"width":opts.pnotify_width,"opacity":opts.pnotify_nonblock?opts.pnotify_nonblock_opacity:opts.pnotify_opacity},"fast");}
if(opts.pnotify_nonblock){pnotify.animate({"opacity":opts.pnotify_nonblock_opacity},"fast");}
if(opts.pnotify_hide&&opts.pnotify_mouse_reset)pnotify.pnotify_cancel_remove();if(opts.pnotify_closer&&!opts.pnotify_nonblock)pnotify.closer.show();},"mouseleave":function(e){if(opts.pnotify_nonblock)e.stopPropagation();nonblock_last_elem=null;pnotify.css("cursor","auto");if(opts.pnotify_nonblock&&animating!="out")
pnotify.animate({"opacity":opts.pnotify_opacity},"fast");if(opts.pnotify_hide&&opts.pnotify_mouse_reset)pnotify.pnotify_queue_remove();pnotify.closer.hide();$.pnotify_position_all();},"mouseover":function(e){if(opts.pnotify_nonblock)e.stopPropagation();},"mouseout":function(e){if(opts.pnotify_nonblock)e.stopPropagation();},"mousemove":function(e){if(opts.pnotify_nonblock){e.stopPropagation();nonblock_pass(e,"onmousemove");}},"mousedown":function(e){if(opts.pnotify_nonblock){e.stopPropagation();e.preventDefault();nonblock_pass(e,"onmousedown");}},"mouseup":function(e){if(opts.pnotify_nonblock){e.stopPropagation();e.preventDefault();nonblock_pass(e,"onmouseup");}},"click":function(e){if(opts.pnotify_nonblock){e.stopPropagation();nonblock_pass(e,"onclick");}},"dblclick":function(e){if(opts.pnotify_nonblock){e.stopPropagation();nonblock_pass(e,"ondblclick");}}});pnotify.opts=opts;if(opts.pnotify_shadow&&!$.browser.msie)
pnotify.shadow_container=$("<div />",{"class":"ui-widget-shadow ui-corner-all ui-pnotify-shadow"}).prependTo(pnotify);pnotify.container=$("<div />",{"class":"ui-widget ui-widget-content ui-corner-all ui-pnotify-container "+(opts.pnotify_type=="error"?"ui-state-error":"ui-state-highlight")})
.appendTo(pnotify);pnotify.pnotify_version="1.0.1";pnotify.pnotify=function(options){var old_opts=opts;if(typeof options=="string")
opts.pnotify_text=options;else
opts=$.extend({},opts,options);pnotify.opts=opts;if(opts.pnotify_shadow!=old_opts.pnotify_shadow){if(opts.pnotify_shadow&&!$.browser.msie)
pnotify.shadow_container=$("<div />",{"class":"ui-widget-shadow ui-pnotify-shadow"}).prependTo(pnotify);else
pnotify.children(".ui-pnotify-shadow").remove();}
if(opts.pnotify_addclass===false)
pnotify.removeClass(old_opts.pnotify_addclass);else if(opts.pnotify_addclass!==old_opts.pnotify_addclass)
pnotify.removeClass(old_opts.pnotify_addclass).addClass(opts.pnotify_addclass);if(opts.pnotify_title===false)
pnotify.title_container.hide("fast");else if(opts.pnotify_title!==old_opts.pnotify_title)
pnotify.title_container.html(opts.pnotify_title).show(200);if(opts.pnotify_text===false){pnotify.text_container.hide("fast");}else if(opts.pnotify_text!==old_opts.pnotify_text){if(opts.pnotify_insert_brs)
opts.pnotify_text=opts.pnotify_text.replace(/\n/g,"<br />");pnotify.text_container.html(opts.pnotify_text).show(200);}
pnotify.pnotify_history=opts.pnotify_history;if(opts.pnotify_type!=old_opts.pnotify_type)
pnotify.container.toggleClass("ui-state-error ui-state-highlight");if((opts.pnotify_notice_icon!=old_opts.pnotify_notice_icon&&opts.pnotify_type=="notice")||(opts.pnotify_error_icon!=old_opts.pnotify_error_icon&&opts.pnotify_type=="error")||(opts.pnotify_type!=old_opts.pnotify_type)){pnotify.container.find("div.ui-pnotify-icon").remove();if((opts.pnotify_error_icon&&opts.pnotify_type=="error")||(opts.pnotify_notice_icon)){$("<div />",{"class":"ui-pnotify-icon"})
.append($("<span />",{"class":opts.pnotify_type=="error"?opts.pnotify_error_icon:opts.pnotify_notice_icon}))
.prependTo(pnotify.container);}}
if(opts.pnotify_width!==old_opts.pnotify_width)
pnotify.animate({width:opts.pnotify_width});if(opts.pnotify_min_height!==old_opts.pnotify_min_height)
pnotify.container.animate({minHeight:opts.pnotify_min_height});if(opts.pnotify_opacity!==old_opts.pnotify_opacity)
pnotify.fadeTo(opts.pnotify_animate_speed,opts.pnotify_opacity);if(!opts.pnotify_hide)
pnotify.pnotify_cancel_remove();else if(!old_opts.pnotify_hide)
pnotify.pnotify_queue_remove();pnotify.pnotify_queue_position();return pnotify;};pnotify.pnotify_queue_position=function(){if(timer)
clearTimeout(timer);timer=setTimeout($.pnotify_position_all,10);};pnotify.pnotify_display=function(){if(!pnotify.parent().length)
pnotify.appendTo(body);if(opts.pnotify_before_open){if(opts.pnotify_before_open(pnotify)===false)
return;}
pnotify.pnotify_queue_position();if(opts.pnotify_animation=="fade"||opts.pnotify_animation.effect_in=="fade"){pnotify.show().fadeTo(0,0).hide();}else{if(opts.pnotify_opacity!=1)
pnotify.show().fadeTo(0,opts.pnotify_opacity).hide();}
pnotify.animate_in(function(){if(opts.pnotify_after_open)
opts.pnotify_after_open(pnotify);pnotify.pnotify_queue_position();if(opts.pnotify_hide)
pnotify.pnotify_queue_remove();});};pnotify.pnotify_remove=function(){if(pnotify.timer){window.clearTimeout(pnotify.timer);pnotify.timer=null;}
if(opts.pnotify_before_close){if(opts.pnotify_before_close(pnotify)===false)
return;}
pnotify.animate_out(function(){if(opts.pnotify_after_close){if(opts.pnotify_after_close(pnotify)===false)
return;}
pnotify.pnotify_queue_position();if(opts.pnotify_remove)
pnotify.detach();});};pnotify.animate_in=function(callback){animating="in";var animation;if(typeof opts.pnotify_animation.effect_in!="undefined")
animation=opts.pnotify_animation.effect_in;else
animation=opts.pnotify_animation;if(animation=="none"){pnotify.show();callback();}else if(animation=="show")
pnotify.show(opts.pnotify_animate_speed,callback);else if(animation=="fade")
pnotify.show().fadeTo(opts.pnotify_animate_speed,opts.pnotify_opacity,callback);else if(animation=="slide")
pnotify.slideDown(opts.pnotify_animate_speed,callback);else if(typeof animation=="function")
animation("in",callback,pnotify);else if(pnotify.effect)
pnotify.effect(animation,{},opts.pnotify_animate_speed,callback);};pnotify.animate_out=function(callback){animating="out";var animation;if(typeof opts.pnotify_animation.effect_out!="undefined")
animation=opts.pnotify_animation.effect_out;else
animation=opts.pnotify_animation;if(animation=="none"){pnotify.hide();callback();}else if(animation=="show")
pnotify.hide(opts.pnotify_animate_speed,callback);else if(animation=="fade")
pnotify.fadeOut(opts.pnotify_animate_speed,callback);else if(animation=="slide")
pnotify.slideUp(opts.pnotify_animate_speed,callback);else if(typeof animation=="function")
animation("out",callback,pnotify);else if(pnotify.effect)
pnotify.effect(animation,{},opts.pnotify_animate_speed,callback);};pnotify.pnotify_cancel_remove=function(){if(pnotify.timer)
window.clearTimeout(pnotify.timer);};pnotify.pnotify_queue_remove=function(){pnotify.pnotify_cancel_remove();pnotify.timer=window.setTimeout(function(){pnotify.pnotify_remove();},(isNaN(opts.pnotify_delay)?0:opts.pnotify_delay));};pnotify.closer=$("<div />",{"class":"ui-pnotify-closer","css":{"cursor":"pointer","display":"none"},"click":function(){pnotify.pnotify_remove();pnotify.closer.hide();}})
.append($("<span />",{"class":"ui-icon ui-icon-circle-close"}))
.appendTo(pnotify.container);if((opts.pnotify_error_icon&&opts.pnotify_type=="error")||(opts.pnotify_notice_icon)){$("<div />",{"class":"ui-pnotify-icon"})
.append($("<span />",{"class":opts.pnotify_type=="error"?opts.pnotify_error_icon:opts.pnotify_notice_icon}))
.appendTo(pnotify.container);}
pnotify.title_container=$("<div />",{"class":"ui-pnotify-title","html":opts.pnotify_title})
.appendTo(pnotify.container);if(opts.pnotify_title===false)
pnotify.title_container.hide();if(opts.pnotify_insert_brs&&typeof opts.pnotify_text=="string")
opts.pnotify_text=opts.pnotify_text.replace(/\n/g,"<br />");pnotify.text_container=$("<div />",{"class":"ui-pnotify-text","html":opts.pnotify_text})
.appendTo(pnotify.container);if(opts.pnotify_text===false)
pnotify.text_container.hide();if(typeof opts.pnotify_width=="string")
pnotify.css("width",opts.pnotify_width);if(typeof opts.pnotify_min_height=="string")
pnotify.container.css("min-height",opts.pnotify_min_height);pnotify.pnotify_history=opts.pnotify_history;var body_data=body.data("pnotify");if(body_data==null||typeof body_data!="object")
body_data=[];if(opts.pnotify_stack.push=="top")
body_data=$.merge([pnotify],body_data);else
body_data=$.merge(body_data,[pnotify]);body.data("pnotify",body_data);if(opts.pnotify_after_init)
opts.pnotify_after_init(pnotify);if(opts.pnotify_history){var body_history=body.data("pnotify_history");if(typeof body_history=="undefined"){body_history=$("<div />",{"class":"ui-pnotify-history-container ui-state-default ui-corner-bottom","mouseleave":function(){body_history.animate({top:"-"+history_handle_top+"px"},{duration:100,queue:false});}})
.append($("<div />",{"class":"ui-pnotify-history-header","text":"Redisplay"}))
.append($("<button />",{"class":"ui-pnotify-history-all ui-state-default ui-corner-all","text":"All","mouseenter":function(){$(this).addClass("ui-state-hover");},"mouseleave":function(){$(this).removeClass("ui-state-hover");},"click":function(){$.each(body_data,function(){if(this.pnotify_history&&this.pnotify_display)
this.pnotify_display();});return false;}}))
.append($("<button />",{"class":"ui-pnotify-history-last ui-state-default ui-corner-all","text":"Last","mouseenter":function(){$(this).addClass("ui-state-hover");},"mouseleave":function(){$(this).removeClass("ui-state-hover");},"click":function(){var i=1;while(!body_data[body_data.length-i]||!body_data[body_data.length-i].pnotify_history||body_data[body_data.length-i].is(":visible")){if(body_data.length-i===0)
return false;i++;}
var n=body_data[body_data.length-i];if(n.pnotify_display)
n.pnotify_display();return false;}}))
.appendTo(body);var handle=$("<span />",{"class":"ui-pnotify-history-pulldown ui-icon ui-icon-grip-dotted-horizontal","mouseenter":function(){body_history.animate({top:"0"},{duration:100,queue:false});}})
.appendTo(body_history);history_handle_top=handle.offset().top+2;body_history.css({top:"-"+history_handle_top+"px"});body.data("pnotify_history",body_history);}}
opts.pnotify_stack.animation=false;pnotify.pnotify_display();return pnotify;}});var re_on=/^on/;var re_mouse_events=/^(dbl)?click$|^mouse(move|down|up|over|out|enter|leave)$|^contextmenu$/;var re_ui_events=/^(focus|blur|select|change|reset)$|^key(press|down|up)$/;var re_html_events=/^(scroll|resize|(un)?load|abort|error)$/;var dom_event=function(e,orig_e){var event_object;e=e.toLowerCase();if(document.createEvent&&this.dispatchEvent){e=e.replace(re_on,'');if(e.match(re_mouse_events)){$(this).offset();event_object=document.createEvent("MouseEvents");event_object.initMouseEvent(e,orig_e.bubbles,orig_e.cancelable,orig_e.view,orig_e.detail,orig_e.screenX,orig_e.screenY,orig_e.clientX,orig_e.clientY,orig_e.ctrlKey,orig_e.altKey,orig_e.shiftKey,orig_e.metaKey,orig_e.button,orig_e.relatedTarget);}else if(e.match(re_ui_events)){event_object=document.createEvent("UIEvents");event_object.initUIEvent(e,orig_e.bubbles,orig_e.cancelable,orig_e.view,orig_e.detail);}else if(e.match(re_html_events)){event_object=document.createEvent("HTMLEvents");event_object.initEvent(e,orig_e.bubbles,orig_e.cancelable);}
if(!event_object)return;this.dispatchEvent(event_object);}else{if(!e.match(re_on))e="on"+e;event_object=document.createEventObject(orig_e);this.fireEvent(e,event_object);}};$.pnotify.defaults={pnotify_title:false,pnotify_text:false,pnotify_addclass:"",pnotify_nonblock:false,pnotify_nonblock_opacity:.2,pnotify_history:true,pnotify_width:"300px",pnotify_min_height:"16px",pnotify_type:"notice",pnotify_notice_icon:"ui-icon ui-icon-info",pnotify_error_icon:"ui-icon ui-icon-alert",pnotify_animation:"fade",pnotify_animate_speed:"slow",pnotify_opacity:1,pnotify_shadow:false,pnotify_closer:true,pnotify_hide:true,pnotify_delay:8000,pnotify_mouse_reset:true,pnotify_remove:true,pnotify_insert_brs:true,pnotify_stack:{"dir1":"down","dir2":"left","push":"bottom"}};})(jQuery);this.imagePreview=function(){xOffset=10;yOffset=30;$("img.preview").hover(function(e){this.t=this.title;this.title="";var x=this.src.replace("&w=50&sq=Y&b=Y","");x=x.replace("thumbnail.php?pic=","")
if(this.t.length>50){this.t=this.t.substring(0,50)+"...";}else{this.t=this.t;}
var c=(this.t!="")?""+this.t:"";$("body").append("<table id='preview'><tr><td align='center'><img src='"+x+"' alt='Image preview' width='300px' /></td></tr><tr class='c1' ><td >"+this.t+"</td></tr></table>");$("#preview")
.css("top",(e.pageY-xOffset)+"px")
.css("left",(e.pageX+yOffset)+"px")
.fadeIn("fast");},function(){if(this.t.length>50){this.title=this.t.substring(0,50)+"...";}else{this.title=this.t;}
$("#preview").remove();});$("a.preview").mousemove(function(e){$("#preview")
.css("top",(e.pageY-xOffset)+"px")
.css("left",(e.pageX+yOffset)+"px");});};$(document).ready(function(){imagePreview();});(function($){var ajax=$.ajax;var pendingRequests={};var synced=[];var syncedData=[];$.ajax=function(settings){settings=jQuery.extend(settings,jQuery.extend({},jQuery.ajaxSettings,settings));var port=settings.port;switch(settings.mode){case"abort":if(pendingRequests[port]){pendingRequests[port].abort();}
return pendingRequests[port]=ajax.apply(this,arguments);case"queue":var _old=settings.complete;settings.complete=function(){if(_old)
_old.apply(this,arguments);jQuery([ajax]).dequeue("ajax"+port);;};jQuery([ajax]).queue("ajax"+port,function(){ajax(settings);});return;case"sync":var pos=synced.length;synced[pos]={error:settings.error,success:settings.success,complete:settings.complete,done:false};syncedData[pos]={error:[],success:[],complete:[]};settings.error=function(){syncedData[pos].error=arguments;};settings.success=function(){syncedData[pos].success=arguments;};settings.complete=function(){syncedData[pos].complete=arguments;synced[pos].done=true;if(pos==0||!synced[pos-1])
for(var i=pos;i<synced.length&&synced[i].done;i++){if(synced[i].error)synced[i].error.apply(jQuery,syncedData[i].error);if(synced[i].success)synced[i].success.apply(jQuery,syncedData[i].success);if(synced[i].complete)synced[i].complete.apply(jQuery,syncedData[i].complete);synced[i]=null;syncedData[i]=null;}};}
return ajax.apply(this,arguments);};})(jQuery);;(function($){$.fn.extend({autocomplete:function(urlOrData,options){var isUrl=typeof urlOrData=="string";options=$.extend({},$.Autocompleter.defaults,{url:isUrl?urlOrData:null,data:isUrl?null:urlOrData,delay:isUrl?$.Autocompleter.defaults.delay:10,max:options&&!options.scroll?10:150},options);options.highlight=options.highlight||function(value){return value;};options.formatMatch=options.formatMatch||options.formatItem;return this.each(function(){new $.Autocompleter(this,options);});},result:function(handler){return this.bind("result",handler);},search:function(handler){return this.trigger("search",[handler]);},flushCache:function(){return this.trigger("flushCache");},setOptions:function(options){return this.trigger("setOptions",[options]);},unautocomplete:function(){return this.trigger("unautocomplete");}});$.Autocompleter=function(input,options){var KEY={UP:38,DOWN:40,DEL:46,TAB:9,RETURN:13,ESC:27,COMMA:188,PAGEUP:33,PAGEDOWN:34,BACKSPACE:8};var $input=$(input).attr("autocomplete","off").addClass(options.inputClass);var timeout;var previousValue="";var cache=$.Autocompleter.Cache(options);var hasFocus=0;var lastKeyPressCode;var config={mouseDownOnSelect:false};var select=$.Autocompleter.Select(options,input,selectCurrent,config);var blockSubmit;$.browser.opera&&$(input.form).bind("submit.autocomplete",function(){if(blockSubmit){blockSubmit=false;return false;}});$input.bind(($.browser.opera?"keypress":"keydown")+".autocomplete",function(event){hasFocus=1;lastKeyPressCode=event.keyCode;switch(event.keyCode){case KEY.UP:event.preventDefault();if(select.visible()){select.prev();}else{onChange(0,true);}
break;case KEY.DOWN:event.preventDefault();if(select.visible()){select.next();}else{onChange(0,true);}
break;case KEY.PAGEUP:event.preventDefault();if(select.visible()){select.pageUp();}else{onChange(0,true);}
break;case KEY.PAGEDOWN:event.preventDefault();if(select.visible()){select.pageDown();}else{onChange(0,true);}
break;case options.multiple&&$.trim(options.multipleSeparator)==","&&KEY.COMMA:case KEY.TAB:case KEY.RETURN:if(selectCurrent()){event.preventDefault();blockSubmit=true;return false;}
break;case KEY.ESC:select.hide();break;default:clearTimeout(timeout);timeout=setTimeout(onChange,options.delay);break;}}).focus(function(){hasFocus++;}).blur(function(){hasFocus=0;if(!config.mouseDownOnSelect){hideResults();}}).click(function(){if(hasFocus++>1&&!select.visible()){onChange(0,true);}}).bind("search",function(){var fn=(arguments.length>1)?arguments[1]:null;function findValueCallback(q,data){var result;if(data&&data.length){for(var i=0;i<data.length;i++){if(data[i].result.toLowerCase()==q.toLowerCase()){result=data[i];break;}}}
if(typeof fn=="function")fn(result);else $input.trigger("result",result&&[result.data,result.value]);}
$.each(trimWords($input.val()),function(i,value){request(value,findValueCallback,findValueCallback);});}).bind("flushCache",function(){cache.flush();}).bind("setOptions",function(){$.extend(options,arguments[1]);if("data"in arguments[1])
cache.populate();}).bind("unautocomplete",function(){select.unbind();$input.unbind();$(input.form).unbind(".autocomplete");});function selectCurrent(){var selected=select.selected();if(!selected)
return false;var v=selected.result;previousValue=v;if(options.multiple){var words=trimWords($input.val());if(words.length>1){var seperator=options.multipleSeparator.length;var cursorAt=$(input).selection().start;var wordAt,progress=0;$.each(words,function(i,word){progress+=word.length;if(cursorAt<=progress){wordAt=i;return false;}
progress+=seperator;});words[wordAt]=v;v=words.join(options.multipleSeparator);}
v+=options.multipleSeparator;}
$input.val(v);hideResultsNow();$input.trigger("result",[selected.data,selected.value]);return true;}
function onChange(crap,skipPrevCheck){if(lastKeyPressCode==KEY.DEL){select.hide();return;}
var currentValue=$input.val();if(!skipPrevCheck&&currentValue==previousValue)
return;previousValue=currentValue;currentValue=lastWord(currentValue);if(currentValue.length>=options.minChars){$input.addClass(options.loadingClass);if(!options.matchCase)
currentValue=currentValue.toLowerCase();request(currentValue,receiveData,hideResultsNow);}else{stopLoading();select.hide();}};function trimWords(value){if(!value)
return[""];if(!options.multiple)
return[$.trim(value)];return $.map(value.split(options.multipleSeparator),function(word){return $.trim(value).length?$.trim(word):null;});}
function lastWord(value){if(!options.multiple)
return value;var words=trimWords(value);if(words.length==1)
return words[0];var cursorAt=$(input).selection().start;if(cursorAt==value.length){words=trimWords(value)}else{words=trimWords(value.replace(value.substring(cursorAt),""));}
return words[words.length-1];}
function autoFill(q,sValue){if(options.autoFill&&(lastWord($input.val()).toLowerCase()==q.toLowerCase())&&lastKeyPressCode!=KEY.BACKSPACE){$input.val($input.val()+sValue.substring(lastWord(previousValue).length));$(input).selection(previousValue.length,previousValue.length+sValue.length);}};function hideResults(){clearTimeout(timeout);timeout=setTimeout(hideResultsNow,200);};function hideResultsNow(){var wasVisible=select.visible();select.hide();clearTimeout(timeout);stopLoading();if(options.mustMatch){$input.search(function(result){if(!result){if(options.multiple){var words=trimWords($input.val()).slice(0,-1);$input.val(words.join(options.multipleSeparator)+(words.length?options.multipleSeparator:""));}
else{$input.val("");$input.trigger("result",null);}}});}};function receiveData(q,data){if(data&&data.length&&hasFocus){stopLoading();select.display(data,q);autoFill(q,data[0].value);select.show();}else{hideResultsNow();}};function request(term,success,failure){if(!options.matchCase)
term=term.toLowerCase();var data=cache.load(term);if(data&&data.length){success(term,data);}else if((typeof options.url=="string")&&(options.url.length>0)){var extraParams={timestamp:+new Date()};$.each(options.extraParams,function(key,param){extraParams[key]=typeof param=="function"?param():param;});$.ajax({mode:"abort",port:"autocomplete"+input.name,dataType:options.dataType,url:options.url,data:$.extend({q:lastWord(term),limit:options.max},extraParams),success:function(data){var parsed=options.parse&&options.parse(data)||parse(data);cache.add(term,parsed);success(term,parsed);}});}else{select.emptyList();failure(term);}};function parse(data){var parsed=[];var rows=data.split("\n");for(var i=0;i<rows.length;i++){var row=$.trim(rows[i]);if(row){row=row.split("|");parsed[parsed.length]={data:row,value:row[0],result:options.formatResult&&options.formatResult(row,row[0])||row[0]};}}
return parsed;};function stopLoading(){$input.removeClass(options.loadingClass);};};$.Autocompleter.defaults={inputClass:"ac_input",resultsClass:"ac_results",loadingClass:"ac_loading",minChars:1,delay:400,matchCase:false,matchSubset:true,matchContains:false,cacheLength:10,max:100,mustMatch:false,extraParams:{},selectFirst:true,formatItem:function(row){return row[0];},formatMatch:null,autoFill:false,width:0,multiple:false,multipleSeparator:", ",highlight:function(value,term){return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)("+term.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi,"\\$1")+")(?![^<>]*>)(?![^&;]+;)","gi"),"<strong>$1</strong>");},scroll:true,scrollHeight:180};$.Autocompleter.Cache=function(options){var data={};var length=0;function matchSubset(s,sub){if(!options.matchCase)
s=s.toLowerCase();var i=s.indexOf(sub);if(options.matchContains=="word"){i=s.toLowerCase().search("\\b"+sub.toLowerCase());}
if(i==-1)return false;return i==0||options.matchContains;};function add(q,value){if(length>options.cacheLength){flush();}
if(!data[q]){length++;}
data[q]=value;}
function populate(){if(!options.data)return false;var stMatchSets={},nullData=0;if(!options.url)options.cacheLength=1;stMatchSets[""]=[];for(var i=0,ol=options.data.length;i<ol;i++){var rawValue=options.data[i];rawValue=(typeof rawValue=="string")?[rawValue]:rawValue;var value=options.formatMatch(rawValue,i+1,options.data.length);if(value===false)
continue;var firstChar=value.charAt(0).toLowerCase();if(!stMatchSets[firstChar])
stMatchSets[firstChar]=[];var row={value:value,data:rawValue,result:options.formatResult&&options.formatResult(rawValue)||value};stMatchSets[firstChar].push(row);if(nullData++<options.max){stMatchSets[""].push(row);}};$.each(stMatchSets,function(i,value){options.cacheLength++;add(i,value);});}
setTimeout(populate,25);function flush(){data={};length=0;}
return{flush:flush,add:add,populate:populate,load:function(q){if(!options.cacheLength||!length)
return null;if(!options.url&&options.matchContains){var csub=[];for(var k in data){if(k.length>0){var c=data[k];$.each(c,function(i,x){if(matchSubset(x.value,q)){csub.push(x);}});}}
return csub;}else
if(data[q]){return data[q];}else
if(options.matchSubset){for(var i=q.length-1;i>=options.minChars;i--){var c=data[q.substr(0,i)];if(c){var csub=[];$.each(c,function(i,x){if(matchSubset(x.value,q)){csub[csub.length]=x;}});return csub;}}}
return null;}};};$.Autocompleter.Select=function(options,input,select,config){var CLASSES={ACTIVE:"ac_over"};var listItems,active=-1,data,term="",needsInit=true,element,list;function init(){if(!needsInit)
return;element=$("<div/>")
.hide()
.addClass(options.resultsClass)
.css("position","absolute")
.appendTo(document.body);list=$("<ul/>").appendTo(element).mouseover(function(event){if(target(event).nodeName&&target(event).nodeName.toUpperCase()=='LI'){active=$("li",list).removeClass(CLASSES.ACTIVE).index(target(event));$(target(event)).addClass(CLASSES.ACTIVE);}}).click(function(event){$(target(event)).addClass(CLASSES.ACTIVE);select();input.focus();return false;}).mousedown(function(){config.mouseDownOnSelect=true;}).mouseup(function(){config.mouseDownOnSelect=false;});if(options.width>0)
element.css("width",options.width);needsInit=false;}
function target(event){var element=event.target;while(element&&element.tagName!="LI")
element=element.parentNode;if(!element)
return[];return element;}
function moveSelect(step){listItems.slice(active,active+1).removeClass(CLASSES.ACTIVE);movePosition(step);var activeItem=listItems.slice(active,active+1).addClass(CLASSES.ACTIVE);if(options.scroll){var offset=0;listItems.slice(0,active).each(function(){offset+=this.offsetHeight;});if((offset+activeItem[0].offsetHeight-list.scrollTop())>list[0].clientHeight){list.scrollTop(offset+activeItem[0].offsetHeight-list.innerHeight());}else if(offset<list.scrollTop()){list.scrollTop(offset);}}};function movePosition(step){active+=step;if(active<0){active=listItems.size()-1;}else if(active>=listItems.size()){active=0;}}
function limitNumberOfItems(available){return options.max&&options.max<available
?options.max
:available;}
function fillList(){list.empty();var max=limitNumberOfItems(data.length);for(var i=0;i<max;i++){if(!data[i])
continue;var formatted=options.formatItem(data[i].data,i+1,max,data[i].value,term);if(formatted===false)
continue;var li=$("<li/>").html(options.highlight(formatted,term)).addClass(i%2==0?"ac_even":"ac_odd").appendTo(list)[0];$.data(li,"ac_data",data[i]);}
listItems=list.find("li");if(options.selectFirst){listItems.slice(0,1).addClass(CLASSES.ACTIVE);active=0;}
if($.fn.bgiframe)
list.bgiframe();}
return{display:function(d,q){init();data=d;term=q;fillList();},next:function(){moveSelect(1);},prev:function(){moveSelect(-1);},pageUp:function(){if(active!=0&&active-8<0){moveSelect(-active);}else{moveSelect(-8);}},pageDown:function(){if(active!=listItems.size()-1&&active+8>listItems.size()){moveSelect(listItems.size()-1-active);}else{moveSelect(8);}},hide:function(){element&&element.hide();listItems&&listItems.removeClass(CLASSES.ACTIVE);active=-1;},visible:function(){return element&&element.is(":visible");},current:function(){return this.visible()&&(listItems.filter("."+CLASSES.ACTIVE)[0]||options.selectFirst&&listItems[0]);},show:function(){var offset=$(input).offset();element.css({width:typeof options.width=="string"||options.width>0?options.width:$(input).width(),top:offset.top+input.offsetHeight,left:offset.left}).show();if(options.scroll){list.scrollTop(0);list.css({maxHeight:options.scrollHeight,overflow:'auto'});if($.browser.msie&&typeof document.body.style.maxHeight==="undefined"){var listHeight=0;listItems.each(function(){listHeight+=this.offsetHeight;});var scrollbarsVisible=listHeight>options.scrollHeight;list.css('height',scrollbarsVisible?options.scrollHeight:listHeight);if(!scrollbarsVisible){listItems.width(list.width()-parseInt(listItems.css("padding-left"))-parseInt(listItems.css("padding-right")));}}}},selected:function(){var selected=listItems&&listItems.filter("."+CLASSES.ACTIVE).removeClass(CLASSES.ACTIVE);return selected&&selected.length&&$.data(selected[0],"ac_data");},emptyList:function(){list&&list.empty();},unbind:function(){element&&element.remove();}};};$.fn.selection=function(start,end){if(start!==undefined){return this.each(function(){if(this.createTextRange){var selRange=this.createTextRange();if(end===undefined||start==end){selRange.move("character",start);selRange.select();}else{selRange.collapse(true);selRange.moveStart("character",start);selRange.moveEnd("character",end);selRange.select();}}else if(this.setSelectionRange){this.setSelectionRange(start,end);}else if(this.selectionStart){this.selectionStart=start;this.selectionEnd=end;}});}
var field=this[0];if(field.createTextRange){var range=document.selection.createRange(),orig=field.value,teststring="<->",textLength=range.text.length;range.text=teststring;var caretAt=field.value.indexOf(teststring);field.value=orig;this.selection(caretAt,caretAt+textLength);return{start:caretAt,end:caretAt+textLength}}else if(field.selectionStart!==undefined){return{start:field.selectionStart,end:field.selectionEnd}}};})(jQuery);(function(f,h,i){function k(a,c){var b=(a[0]||0)-(c[0]||0);return b>0||!b&&a.length>0&&k(a.slice(1),c.slice(1))}function l(a){if(typeof a!=g)return a;var c=[],b="";for(var d in a){b=typeof a[d]==g?l(a[d]):[d,m?encodeURI(a[d]):a[d]].join("=");c.push(b)}return c.join("&")}function n(a){var c=[];for(var b in a)a[b]&&c.push([b,'="',a[b],'"'].join(""));return c.join(" ")}function o(a){var c=[];for(var b in a)c.push(['<param name="',b,'" value="',l(a[b]),'" />'].join(""));return c.join("")}var g="object",m=true;try{var j=i.description||function(){return(new i("ShockwaveFlash.ShockwaveFlash")).GetVariable("$version")}()}catch(p){j="Unavailable"}var e=j.match(/\d+/g)||[0];f[h]={available:e[0]>0,activeX:i&&!i.name,version:{original:j,array:e,string:e.join("."),major:parseInt(e[0],10)||0,minor:parseInt(e[1],10)||0,release:parseInt(e[2],10)||0},hasVersion:function(a){a=/string|number/.test(typeof a)?a.toString().split("."):/object/.test(typeof a)?[a.major,a.minor]:a||[0,0];return k(e,a)},encodeParams:true,expressInstall:"expressInstall.swf",expressInstallIsActive:false,create:function(a){if(!a.swf||this.expressInstallIsActive||!this.available&&!a.hasVersionFail)return false;if(!this.hasVersion(a.hasVersion||1)){this.expressInstallIsActive=true;if(typeof a.hasVersionFail=="function")if(!a.hasVersionFail.apply(a))return false;a={swf:a.expressInstall||this.expressInstall,height:137,width:214,flashvars:{MMredirectURL:location.href,MMplayerType:this.activeX?"ActiveX":"PlugIn",MMdoctitle:document.title.slice(0,47)+" - Flash Player Installation"}}}attrs={data:a.swf,type:"application/x-shockwave-flash",id:a.id||"flash_"+Math.floor(Math.random()*999999999),width:a.width||320,height:a.height||180,style:a.style||""};m=typeof a.useEncode!=="undefined"?a.useEncode:this.encodeParams;a.movie=a.swf;a.wmode=a.wmode||"opaque";delete a.fallback;delete a.hasVersion;delete a.hasVersionFail;delete a.height;delete a.id;delete a.swf;delete a.useEncode;delete a.width;var c=document.createElement("div");c.innerHTML=["<object ",n(attrs),">",o(a),"</object>"].join("");return c.firstChild}};f.fn[h]=function(a){var c=this.find(g).andSelf().filter(g);/string|object/.test(typeof a)&&this.each(function(){var b=f(this),d;a=typeof a==g?a:{swf:a};a.fallback=this;if(d=f[h].create(a)){b.children().remove();b.html(d)}});typeof a=="function"&&c.each(function(){var b=this;b.jsInteractionTimeoutMs=b.jsInteractionTimeoutMs||0;if(b.jsInteractionTimeoutMs<660)b.clientWidth||b.clientHeight?a.call(b):setTimeout(function(){f(b)[h](a)},b.jsInteractionTimeoutMs+66)});return c}})(jQuery,"flash",navigator.plugins["Shockwave Flash"]||window.ActiveXObject);var ddaccordion={ajaxloadingmsg:'<img src="loading2.gif" /><br />Loading Content...',headergroup:{},contentgroup:{},preloadimages:function($images){$images.each(function(){var preloadimage=new Image()
preloadimage.src=this.src})},expandone:function(headerclass,selected){this.toggleone(headerclass,selected,"expand")},collapseone:function(headerclass,selected){this.toggleone(headerclass,selected,"collapse")},expandall:function(headerclass){var $headers=this.headergroup[headerclass]
this.contentgroup[headerclass].filter(':hidden').each(function(){$headers.eq(parseInt($(this).attr('contentindex'))).trigger("evt_accordion")})},collapseall:function(headerclass){var $headers=this.headergroup[headerclass]
this.contentgroup[headerclass].filter(':visible').each(function(){$headers.eq(parseInt($(this).attr('contentindex'))).trigger("evt_accordion")})},toggleone:function(headerclass,selected,optstate){var $targetHeader=this.headergroup[headerclass].eq(selected)
var $subcontent=this.contentgroup[headerclass].eq(selected)
if(typeof optstate=="undefined"||optstate=="expand"&&$subcontent.is(":hidden")||optstate=="collapse"&&$subcontent.is(":visible"))
$targetHeader.trigger("evt_accordion")},ajaxloadcontent:function($targetHeader,$targetContent,config,callback){var ajaxinfo=$targetHeader.data('ajaxinfo')
function handlecontent(content){if(content){ajaxinfo.cacheddata=content
ajaxinfo.status="cached"
if($targetContent.queue("fx").length==0){$targetContent.hide().html(content)
ajaxinfo.status="complete"
callback()}}
if(ajaxinfo.status!="complete"){setTimeout(function(){handlecontent(ajaxinfo.cacheddata)},100)}}
if(ajaxinfo.status=="none"){$targetContent.html(this.ajaxloadingmsg)
$targetContent.slideDown(config.animatespeed)
ajaxinfo.status="loading"
$.ajax({url:ajaxinfo.url,error:function(ajaxrequest){handlecontent('Error fetching content. Server Response: '+ajaxrequest.responseText)},success:function(content){content=(content=="")?" ":content
handlecontent(content)}})}
else if(ajaxinfo.status=="loading")
handlecontent(ajaxinfo.cacheddata)},expandit:function($targetHeader,$targetContent,config,useractivated,directclick,skipanimation){var ajaxinfo=$targetHeader.data('ajaxinfo')
if(ajaxinfo){if(ajaxinfo.status=="none"||ajaxinfo.status=="loading")
this.ajaxloadcontent($targetHeader,$targetContent,config,function(){ddaccordion.expandit($targetHeader,$targetContent,config,useractivated,directclick)})
else if(ajaxinfo.status=="cached"){$targetContent.html(ajaxinfo.cacheddata)
ajaxinfo.cacheddata=null
ajaxinfo.status="complete"}}
this.transformHeader($targetHeader,config,"expand")
$targetContent.slideDown(skipanimation?0:config.animatespeed,function(){config.onopenclose($targetHeader.get(0),parseInt($targetHeader.attr('headerindex')),$targetContent.css('display'),useractivated)
if(config.postreveal=="gotourl"&&directclick){var targetLink=($targetHeader.is("a"))?$targetHeader.get(0):$targetHeader.find('a:eq(0)').get(0)
if(targetLink)
setTimeout(function(){location=targetLink.href},200)}})},collapseit:function($targetHeader,$targetContent,config,isuseractivated){this.transformHeader($targetHeader,config,"collapse")
$targetContent.slideUp(config.animatespeed,function(){config.onopenclose($targetHeader.get(0),parseInt($targetHeader.attr('headerindex')),$targetContent.css('display'),isuseractivated)})},transformHeader:function($targetHeader,config,state){$targetHeader.addClass((state=="expand")?config.cssclass.expand:config.cssclass.collapse)
.removeClass((state=="expand")?config.cssclass.collapse:config.cssclass.expand)
if(config.htmlsetting.location=='src'){$targetHeader=($targetHeader.is("img"))?$targetHeader:$targetHeader.find('img').eq(0)
$targetHeader.attr('src',(state=="expand")?config.htmlsetting.expand:config.htmlsetting.collapse)}
else if(config.htmlsetting.location=="prefix")
$targetHeader.find('.accordprefix').html((state=="expand")?config.htmlsetting.expand:config.htmlsetting.collapse)
else if(config.htmlsetting.location=="suffix")
$targetHeader.find('.accordsuffix').html((state=="expand")?config.htmlsetting.expand:config.htmlsetting.collapse)},urlparamselect:function(headerclass){var result=window.location.search.match(new RegExp(headerclass+"=((\\d+)(,(\\d+))*)","i"))
if(result!=null)
result=RegExp.$1.split(',')
return result},getCookie:function(Name){var re=new RegExp(Name+"=[^;]+","i")
if(document.cookie.match(re))
return document.cookie.match(re)[0].split("=")[1]
return null},setCookie:function(name,value){document.cookie=name+"="+value+"; path=/"},init:function(config){document.write('<style type="text/css">\n')
document.write('.'+config.contentclass+'{display: none}\n')
document.write('a.hiddenajaxlink{display: none}\n')
document.write('<\/style>')
jQuery(document).ready(function($){ddaccordion.urlparamselect(config.headerclass)
var persistedheaders=ddaccordion.getCookie(config.headerclass)
ddaccordion.headergroup[config.headerclass]=$('.'+config.headerclass)
ddaccordion.contentgroup[config.headerclass]=$('.'+config.contentclass)
var $headers=ddaccordion.headergroup[config.headerclass]
var $subcontents=ddaccordion.contentgroup[config.headerclass]
config.cssclass={collapse:config.toggleclass[0],expand:config.toggleclass[1]}
config.revealtype=config.revealtype||"click"
config.revealtype=config.revealtype.replace(/mouseover/i,"mouseenter")
if(config.revealtype=="clickgo"){config.postreveal="gotourl"
config.revealtype="click"}
if(typeof config.togglehtml=="undefined")
config.htmlsetting={location:"none"}
else
config.htmlsetting={location:config.togglehtml[0],collapse:config.togglehtml[1],expand:config.togglehtml[2]}
config.oninit=(typeof config.oninit=="undefined")?function(){}:config.oninit
config.onopenclose=(typeof config.onopenclose=="undefined")?function(){}:config.onopenclose
var lastexpanded={}
var expandedindices=ddaccordion.urlparamselect(config.headerclass)||((config.persiststate&&persistedheaders!=null)?persistedheaders:config.defaultexpanded)
if(typeof expandedindices=='string')
expandedindices=expandedindices.replace(/c/ig,'').split(',')
if(expandedindices.length==1&&expandedindices[0]=="-1")
expandedindices=[]
if(config["collapseprev"]&&expandedindices.length>1)
expandedindices=[expandedindices.pop()]
if(config["onemustopen"]&&expandedindices.length==0)
expandedindices=[0]
$headers.each(function(index){var $header=$(this)
if(/(prefix)|(suffix)/i.test(config.htmlsetting.location)&&$header.html()!=""){$('<span class="accordprefix"></span>').prependTo(this)
$('<span class="accordsuffix"></span>').appendTo(this)}
$header.attr('headerindex',index+'h')
$subcontents.eq(index).attr('contentindex',index+'c')
var $subcontent=$subcontents.eq(index)
var $hiddenajaxlink=$subcontent.find('a.hiddenajaxlink:eq(0)')
if($hiddenajaxlink.length==1){$header.data('ajaxinfo',{url:$hiddenajaxlink.attr('href'),cacheddata:null,status:'none'})}
var needle=(typeof expandedindices[0]=="number")?index:index+''
if(jQuery.inArray(needle,expandedindices)!=-1){ddaccordion.expandit($header,$subcontent,config,false,false,!config.animatedefault)
lastexpanded={$header:$header,$content:$subcontent}}
else{$subcontent.hide()
config.onopenclose($header.get(0),parseInt($header.attr('headerindex')),$subcontent.css('display'),false)
ddaccordion.transformHeader($header,config,"collapse")}})
$headers.bind("evt_accordion",function(e,isdirectclick){var $subcontent=$subcontents.eq(parseInt($(this).attr('headerindex')))
if($subcontent.css('display')=="none"){ddaccordion.expandit($(this),$subcontent,config,true,isdirectclick)
if(config["collapseprev"]&&lastexpanded.$header&&$(this).get(0)!=lastexpanded.$header.get(0)){ddaccordion.collapseit(lastexpanded.$header,lastexpanded.$content,config,true)}
lastexpanded={$header:$(this),$content:$subcontent}}
else if(!config["onemustopen"]||config["onemustopen"]&&lastexpanded.$header&&$(this).get(0)!=lastexpanded.$header.get(0)){ddaccordion.collapseit($(this),$subcontent,config,true)}})
$headers.bind(config.revealtype,function(){if(config.revealtype=="mouseenter"){clearTimeout(config.revealdelay)
var headerindex=parseInt($(this).attr("headerindex"))
config.revealdelay=setTimeout(function(){ddaccordion.expandone(config["headerclass"],headerindex)},config.mouseoverdelay||0)}
else{$(this).trigger("evt_accordion",[true])
return false}})
$headers.bind("mouseleave",function(){clearTimeout(config.revealdelay)})
config.oninit($headers.get(),expandedindices)
$(window).bind('unload',function(){$headers.unbind()
var expandedindices=[]
$subcontents.filter(':visible').each(function(index){expandedindices.push($(this).attr('contentindex'))})
if(config.persiststate==true&&$headers.length>0){expandedindices=(expandedindices.length==0)?'-1c':expandedindices
ddaccordion.setCookie(config.headerclass,expandedindices)}})})}}
ddaccordion.preloadimages(jQuery(ddaccordion.ajaxloadingmsg).filter('img'));
