/*

	Masked Input plugin for jQuery

	Copyright (c) 2007-2009 Josh Bush (digitalbush.com)

	Licensed under the MIT license (http://digitalbush.com/projects/masked-input-plugin/#license) 

	Version: 1.2.2 (03/09/2009 22:39:06)

*/

(function(a){var c=(a.browser.msie?"paste":"input")+".mask";var b=(window.orientation!=undefined);a.mask={definitions:{"9":"[0-9]",a:"[A-Za-z]","*":"[A-Za-z0-9]"}};a.fn.extend({caret:function(e,f){if(this.length==0){return}if(typeof e=="number"){f=(typeof f=="number")?f:e;return this.each(function(){if(this.setSelectionRange){this.focus();this.setSelectionRange(e,f)}else{if(this.createTextRange){var g=this.createTextRange();g.collapse(true);g.moveEnd("character",f);g.moveStart("character",e);g.select()}}})}else{if(this[0].setSelectionRange){e=this[0].selectionStart;f=this[0].selectionEnd}else{if(document.selection&&document.selection.createRange){var d=document.selection.createRange();e=0-d.duplicate().moveStart("character",-100000);f=e+d.text.length}}return{begin:e,end:f}}},unmask:function(){return this.trigger("unmask")},mask:function(j,d){if(!j&&this.length>0){var f=a(this[0]);var g=f.data("tests");return a.map(f.data("buffer"),function(l,m){return g[m]?l:null}).join("")}d=a.extend({placeholder:"_",completed:null},d);var k=a.mask.definitions;var g=[];var e=j.length;var i=null;var h=j.length;a.each(j.split(""),function(m,l){if(l=="?"){h--;e=m}else{if(k[l]){g.push(new RegExp(k[l]));if(i==null){i=g.length-1}}else{g.push(null)}}});return this.each(function(){var r=a(this);var m=a.map(j.split(""),function(x,y){if(x!="?"){return k[x]?d.placeholder:x}});var n=false;var q=r.val();r.data("buffer",m).data("tests",g);function v(x){while(++x<=h&&!g[x]){}return x}function t(x){while(!g[x]&&--x>=0){}for(var y=x;y<h;y++){if(g[y]){m[y]=d.placeholder;var z=v(y);if(z<h&&g[y].test(m[z])){m[y]=m[z]}else{break}}}s();r.caret(Math.max(i,x))}function u(y){for(var A=y,z=d.placeholder;A<h;A++){if(g[A]){var B=v(A);var x=m[A];m[A]=z;if(B<h&&g[B].test(x)){z=x}else{break}}}}function l(y){var x=a(this).caret();var z=y.keyCode;n=(z<16||(z>16&&z<32)||(z>32&&z<41));if((x.begin-x.end)!=0&&(!n||z==8||z==46)){w(x.begin,x.end)}if(z==8||z==46||(b&&z==127)){t(x.begin+(z==46?0:-1));return false}else{if(z==27){r.val(q);r.caret(0,p());return false}}}function o(B){if(n){n=false;return(B.keyCode==8)?false:null}B=B||window.event;var C=B.charCode||B.keyCode||B.which;var z=a(this).caret();if(B.ctrlKey||B.altKey||B.metaKey){return true}else{if((C>=32&&C<=125)||C>186){var x=v(z.begin-1);if(x<h){var A=String.fromCharCode(C);if(g[x].test(A)){u(x);m[x]=A;s();var y=v(x);a(this).caret(y);if(d.completed&&y==h){d.completed.call(r)}}}}}return false}function w(x,y){for(var z=x;z<y&&z<h;z++){if(g[z]){m[z]=d.placeholder}}}function s(){return r.val(m.join("")).val()}function p(y){var z=r.val();var C=-1;for(var B=0,x=0;B<h;B++){if(g[B]){m[B]=d.placeholder;while(x++<z.length){var A=z.charAt(x-1);if(g[B].test(A)){m[B]=A;C=B;break}}if(x>z.length){break}}else{if(m[B]==z[x]&&B!=e){x++;C=B}}}if(!y&&C+1<e){r.val("");w(0,h)}else{if(y||C+1>=e){s();if(!y){r.val(r.val().substring(0,C+1))}}}return(e?B:i)}if(!r.attr("readonly")){r.one("unmask",function(){r.unbind(".mask").removeData("buffer").removeData("tests")}).bind("focus.mask",function(){q=r.val();var x=p();s();setTimeout(function(){if(x==j.length){r.caret(0,x)}else{r.caret(x)}},0)}).bind("blur.mask",function(){p();if(r.val()!=q){r.change()}}).bind("keydown.mask",l).bind("keypress.mask",o).bind(c,function(){setTimeout(function(){r.caret(p(true))},0)})}p()})}})})(jQuery);


//pop! for jQuery
//  v0.2 requires jQuery v1.2 or later
//  Licensed under the MIT:
//  http://www.opensource.org/licenses/mit-license.php
//  Copyright 2007,2008 SEAOFCLOUDS [http://seaofclouds.com]
(function($) {$.pop = function(options){var settings = { pop_class : '.pop', pop_toggle_text : ''};function initpops (){$(settings.pop_class).each(function() {var pop_classes = $(this).attr("class");$(this).addClass("pop_menu");$(this).wrap("<div class='"+pop_classes+"'></div>");$(".pop_menu").attr("class", "pop_menu");$(this).before('<div class="pop_toggle">'+settings.pop_toggle_text+'</div>');});}initpops();var totalpops = $(settings.pop_class).size() + 1000;$(settings.pop_class).each(function(i) {var popzindex = totalpops - i;$(this).css({ zIndex: popzindex });});activePop = null;function closeInactivePop() {$(settings.pop_class).each(function (i) { if ($(this).hasClass('active') && i!=activePop) {$(this).removeClass('active');}});return false;};$(settings.pop_class).mouseover(function() { activePop = $(settings.pop_class).index(this); });$(settings.pop_class).mouseout(function() { activePop = null; }); $(document.body).click(function(){ closeInactivePop();});$(".pop_toggle").click(function(){$(this).parent(settings.pop_class).toggleClass("active");});};})(jQuery);


////jquery tips
(function($) { $.fn.tipsy = function(opts) {opts = $.extend({fade: false, gravity: 'n'}, opts || {});var tip = null, cancelHide = false;this.hover(function() {$.data(this, 'cancel.tipsy', true); var tip = $.data(this, 'active.tipsy'); if (!tip) {tip = $('<div class="tipsy"><div class="tipsy-inner">' + $(this).attr('title') + '</div></div>');         tip.css({position: 'absolute', zIndex: 100000}); $(this).attr('title', '');$.data(this, 'active.tipsy', tip);}var pos = $.extend({}, $(this).offset(), {width: this.offsetWidth, height: this.offsetHeight});tip.remove().css({top: 0, left: 0, visibility: 'hidden', display: 'block'}).appendTo(document.body);var actualWidth = tip[0].offsetWidth, actualHeight = tip[0].offsetHeight; switch (opts.gravity.charAt(0)) { case 'n': tip.css({top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2}).addClass('tipsy-north');    break; case 's':tip.css({top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2}).addClass('tipsy-south'); break; case 'e': tip.css({top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth}).addClass('tipsy-east');break;case 'w':tip.css({top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width}).addClass('tipsy-west'); break;};if (opts.fade) {tip.css({opacity: 0, display: 'block', visibility: 'visible'}).animate({opacity: 1});} else {tip.css({visibility: 'visible'});};}, function() { $.data(this, 'cancel.tipsy', false); var self = this; setTimeout(function() { if ($.data(this, 'cancel.tipsy')) return; var tip = $.data(self, 'active.tipsy'); if (opts.fade) {tip.stop().fadeOut(function() { $(this).remove(); }); } else {tip.remove();} }, 100); });};})(jQuery);


//////yükseklik eşitşe
(function($){$.fn.yukseklikEsitle=function(){var nesneSay=this.length;var enYuksek=this.eq(0).height();for(i=1;i<nesneSay;++i){var currHeight=this.eq(i).height();if(currHeight>enYuksek){enYuksek=currHeight}}this.height(enYuksek);return this}})(jQuery);




/////Galeri

/* ------------------------------------------------------------------------
 * 	Class: prettyPhoto
 * 	Use: Lightbox clone for jQuery
 * 	Author: Stephane Caron (http://www.no-margin-for-errors.com)
 * 	Version: 2.5.6
 ------------------------------------------------------------------------- */

(function($){$.prettyPhoto={version:'2.5.6'};$.fn.prettyPhoto=function(settings){settings=jQuery.extend({animationSpeed:'normal',opacity:0.80,showTitle:true,allowresize:true,default_width:500,default_height:344,counter_separator_label:'/',theme:'light_rounded',hideflash:false,wmode:'opaque',autoplay:true,modal:false,changepicturecallback:function(){},callback:function(){},markup:'<div class="pp_pic_holder"> \
      <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"> \
           <a class="pp_close" href="#">Close</a> \
           <p class="pp_description"></p> \
           <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> \
     <div class="ppt"></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>'},settings);if($.browser.msie&&parseInt($.browser.version)==6){settings.theme="light_square";}
if($('.pp_overlay').size()==0)_buildOverlay();var doresize=true,percentBased=false,correctSizes,$pp_pic_holder,$ppt,$pp_overlay,pp_contentHeight,pp_contentWidth,pp_containerHeight,pp_containerWidth,windowHeight=$(window).height(),windowWidth=$(window).width(),setPosition=0,scrollPos=_getScroll();$(window).scroll(function(){scrollPos=_getScroll();_centerOverlay();_resizeOverlay();});$(window).resize(function(){_centerOverlay();_resizeOverlay();});$(document).keydown(function(e){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;};});$(this).each(function(){$(this).bind('click',function(){_self=this;theRel=$(this).attr('rel');galleryRegExp=/\[(?:.*)\]/;theGallery=galleryRegExp.exec(theRel);var images=new Array(),titles=new Array(),descriptions=new Array();if(theGallery){$('a[rel*='+theGallery+']').each(function(i){if($(this)[0]===$(_self)[0])setPosition=i;images.push($(this).attr('href'));titles.push($(this).find('img').attr('alt'));descriptions.push($(this).attr('title'));});}else{images=$(this).attr('href');titles=($(this).find('img').attr('alt'))?$(this).find('img').attr('alt'):'';descriptions=($(this).attr('title'))?$(this).attr('title'):'';}
$.prettyPhoto.open(images,titles,descriptions);return false;});});$.prettyPhoto.open=function(gallery_images,gallery_titles,gallery_descriptions){if($.browser.msie&&$.browser.version==6){$('select').css('visibility','hidden');};if(settings.hideflash)$('object,embed').css('visibility','hidden');images=$.makeArray(gallery_images);titles=$.makeArray(gallery_titles);descriptions=$.makeArray(gallery_descriptions);image_set=($(images).size()>0)?true:false;_checkPosition($(images).size());$('.pp_loaderIcon').show();$pp_overlay.show().fadeTo(settings.animationSpeed,settings.opacity);$pp_pic_holder.find('.currentTextHolder').text((setPosition+1)+settings.counter_separator_label+$(images).size());if(descriptions[setPosition]){$pp_pic_holder.find('.pp_description').show().html(unescape(descriptions[setPosition]));}else{$pp_pic_holder.find('.pp_description').hide().text('');};if(titles[setPosition]&&settings.showTitle){hasTitle=true;$ppt.html(unescape(titles[setPosition]));}else{hasTitle=false;};movie_width=(parseFloat(grab_param('width',images[setPosition])))?grab_param('width',images[setPosition]):settings.default_width.toString();movie_height=(parseFloat(grab_param('height',images[setPosition])))?grab_param('height',images[setPosition]):settings.default_height.toString();if(movie_width.indexOf('%')!=-1||movie_height.indexOf('%')!=-1){movie_height=parseFloat(($(window).height()*parseFloat(movie_height)/100)-100);movie_width=parseFloat(($(window).width()*parseFloat(movie_width)/100)-100);percentBased=true;}
$pp_pic_holder.fadeIn(function(){imgPreloader="";switch(_getFileType(images[setPosition])){case'image':imgPreloader=new Image();nextImage=new Image();if(image_set&&setPosition>$(images).size())nextImage.src=images[setPosition+1];prevImage=new Image();if(image_set&&images[setPosition-1])prevImage.src=images[setPosition-1];$pp_pic_holder.find('#pp_full_res')[0].innerHTML=settings.image_markup;$pp_pic_holder.find('#fullResImage').attr('src',images[setPosition]);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=images[setPosition];break;case'youtube':correctSizes=_fitToViewport(movie_width,movie_height);movie='http://www.youtube.com/v/'+grab_param('v',images[setPosition]);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=images[setPosition];movie='http://vimeo.com/moogaloop.swf?clip_id='+movie_id.replace('http://vimeo.com/','');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'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,images[setPosition]).replace(/{autoplay}/g,settings.autoplay);break;case'flash':correctSizes=_fitToViewport(movie_width,movie_height);flash_vars=images[setPosition];flash_vars=flash_vars.substring(images[setPosition].indexOf('flashvars')+10,images[setPosition].length);filename=images[setPosition];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=images[setPosition];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'inline':myClone=$(images[setPosition]).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,$(images[setPosition]).html());break;};if(!imgPreloader){$pp_pic_holder.find('#pp_full_res')[0].innerHTML=toInject;_showContent();};});};$.prettyPhoto.changePage=function(direction){if(direction=='previous'){setPosition--;if(setPosition<0){setPosition=0;return;};}else{if($('.pp_arrow_next').is('.disabled'))return;setPosition++;};if(!doresize)doresize=true;_hideContent(function(){$.prettyPhoto.open(images,titles,descriptions)});$('a.pp_expand,a.pp_contract').fadeOut(settings.animationSpeed);};$.prettyPhoto.close=function(){$pp_pic_holder.find('object,embed').css('visibility','hidden');$('div.pp_pic_holder,div.ppt,.pp_fade').fadeOut(settings.animationSpeed);$pp_overlay.fadeOut(settings.animationSpeed,function(){$('#pp_full_res').html('');$pp_pic_holder.attr('style','').find('div:not(.pp_hoverContainer)').attr('style','');_centerOverlay();if($.browser.msie&&$.browser.version==6){$('select').css('visibility','visible');};if(settings.hideflash)$('object,embed').css('visibility','visible');setPosition=0;settings.callback();});doresize=true;};_showContent=function(){$('.pp_loaderIcon').hide();projectedTop=scrollPos['scrollTop']+((windowHeight/2)-(correctSizes['containerHeight']/2));if(projectedTop<0)projectedTop=0+$ppt.height();$pp_pic_holder.find('.pp_content').animate({'height':correctSizes['contentHeight']},settings.animationSpeed);$pp_pic_holder.animate({'top':projectedTop,'left':(windowWidth/2)-(correctSizes['containerWidth']/2),'width':correctSizes['containerWidth']},settings.animationSpeed,function(){$pp_pic_holder.find('.pp_hoverContainer,#fullResImage').height(correctSizes['height']).width(correctSizes['width']);$pp_pic_holder.find('.pp_fade').fadeIn(settings.animationSpeed);if(image_set&&_getFileType(images[setPosition])=="image"){$pp_pic_holder.find('.pp_hoverContainer').show();}else{$pp_pic_holder.find('.pp_hoverContainer').hide();}
if(settings.showTitle&&hasTitle){$ppt.css({'top':$pp_pic_holder.offset().top-25,'left':$pp_pic_holder.offset().left+20,'display':'none'});$ppt.fadeIn(settings.animationSpeed);};if(correctSizes['resized'])$('a.pp_expand,a.pp_contract').fadeIn(settings.animationSpeed);settings.changepicturecallback();});};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.animationSpeed,function(){$('.pp_loaderIcon').show();if(callback)callback();});$ppt.fadeOut(settings.animationSpeed);}
function _checkPosition(setCount){if(setPosition==setCount-1){$pp_pic_holder.find('a.pp_next').css('visibility','hidden');$pp_pic_holder.find('a.pp_arrow_next').addClass('disabled').unbind('click');}else{$pp_pic_holder.find('a.pp_next').css('visibility','visible');$pp_pic_holder.find('a.pp_arrow_next.disabled').removeClass('disabled').bind('click',function(){$.prettyPhoto.changePage('next');return false;});};if(setPosition==0){$pp_pic_holder.find('a.pp_previous').css('visibility','hidden');$pp_pic_holder.find('a.pp_arrow_previous').addClass('disabled').unbind('click');}else{$pp_pic_holder.find('a.pp_previous').css('visibility','visible');$pp_pic_holder.find('a.pp_arrow_previous.disabled').removeClass('disabled').bind('click',function(){$.prettyPhoto.changePage('previous');return false;});};if(setCount>1){$('.pp_nav').show();}else{$('.pp_nav').hide();}};function _fitToViewport(width,height){hasBeenResized=false;_getDimensions(width,height);imageWidth=width;imageHeight=height;if(((pp_containerWidth>windowWidth)||(pp_containerHeight>windowHeight))&&doresize&&settings.allowresize&&!percentBased){hasBeenResized=true;notFitting=true;while(notFitting){if((pp_containerWidth>windowWidth)){imageWidth=(windowWidth-200);imageHeight=(height/width)*imageWidth;}else if((pp_containerHeight>windowHeight)){imageHeight=(windowHeight-200);imageWidth=(width/height)*imageHeight;}else{notFitting=false;};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:hasBeenResized};};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.substr(0,1)=='#'){return'inline';}else{return'image';};};function _centerOverlay(){if(doresize){titleHeight=$ppt.height();contentHeight=$pp_pic_holder.height();contentwidth=$pp_pic_holder.width();projectedTop=(windowHeight/2)+scrollPos['scrollTop']-((contentHeight+titleHeight)/2);$pp_pic_holder.css({'top':projectedTop,'left':(windowWidth/2)+scrollPos['scrollLeft']-(contentwidth/2)});$ppt.css({'top':projectedTop-titleHeight,'left':(windowWidth/2)+scrollPos['scrollLeft']-(contentwidth/2)+20});};};function _getScroll(){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 _resizeOverlay(){windowHeight=$(window).height();windowWidth=$(window).width();$pp_overlay.css({'height':$(document).height()});};function _buildOverlay(){$('body').append(settings.markup);$pp_pic_holder=$('.pp_pic_holder');$ppt=$('.ppt');$pp_overlay=$('div.pp_overlay');$pp_pic_holder.attr('class','pp_pic_holder '+settings.theme);$pp_overlay.css({'opacity':0,'height':$(document).height()}).bind('click',function(){if(!settings.modal)
$.prettyPhoto.close();});$('a.pp_close').bind('click',function(){$.prettyPhoto.close();return false;});$('a.pp_expand').bind('click',function(){$this=$(this);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(images,titles,descriptions)});$pp_pic_holder.find('.pp_fade').fadeOut(settings.animationSpeed);return false;});$pp_pic_holder.find('.pp_previous, .pp_arrow_previous').bind('click',function(){$.prettyPhoto.changePage('previous');return false;});$pp_pic_holder.find('.pp_next, .pp_arrow_next').bind('click',function(){$.prettyPhoto.changePage('next');return false;});};_centerOverlay();};function grab_param(name,url){name=name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");var regexS="[\\?&]"+name+"=([^&#]*)";var regex=new RegExp(regexS);var results=regex.exec(url);if(results==null)
return"";else
return results[1];}})(jQuery);



/////DatePicker

DateInput=(function(A){function B(C,D){if(typeof (D)!="object"){D={}}A.extend(this,B.DEFAULT_OPTS,D);this.input=A(C);this.bindMethodsToObj("show","hide","hideIfClickOutside","keydownHandler","selectDate");this.build();this.selectDate();this.hide()}B.DEFAULT_OPTS={month_names:["January","February","March","April","May","June","July","August","September","October","November","December"],short_month_names:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],short_day_names:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],start_of_week:1};B.prototype={build:function(){var C=A('<p class="month_nav"><span class="button prev" title="[Page-Up]">&#171;</span> <span class="month_name"></span> <span class="button next" title="[Page-Down]">&#187;</span></p>');this.monthNameSpan=A(".month_name",C);A(".prev",C).click(this.bindToObj(function(){this.moveMonthBy(-1)}));A(".next",C).click(this.bindToObj(function(){this.moveMonthBy(1)}));var D=A('<p class="year_nav"><span class="button prev" title="[Ctrl+Page-Up]">&#171;</span> <span class="year_name"></span> <span class="button next" title="[Ctrl+Page-Down]">&#187;</span></p>');this.yearNameSpan=A(".year_name",D);A(".prev",D).click(this.bindToObj(function(){this.moveMonthBy(-12)}));A(".next",D).click(this.bindToObj(function(){this.moveMonthBy(12)}));var E=A('<div class="nav"></div>').append(C,D);var F="<table><thead><tr>";A(this.adjustDays(this.short_day_names)).each(function(){F+="<th>"+this+"</th>"});F+="</tr></thead><tbody></tbody></table>";this.dateSelector=this.rootLayers=A('<div class="date_selector"></div>').append(E,F).insertAfter(this.input);if(A.browser.msie&&A.browser.version<7){this.ieframe=A('<iframe class="date_selector_ieframe" frameborder="0" src="#"></iframe>').insertBefore(this.dateSelector);this.rootLayers=this.rootLayers.add(this.ieframe);A(".button",E).mouseover(function(){A(this).addClass("hover")});A(".button",E).mouseout(function(){A(this).removeClass("hover")})}this.tbody=A("tbody",this.dateSelector);this.input.change(this.bindToObj(function(){this.selectDate()}));this.selectDate()},selectMonth:function(D){var J=new Date(D.getFullYear(),D.getMonth(),1);if(!this.currentMonth||!(this.currentMonth.getFullYear()==J.getFullYear()&&this.currentMonth.getMonth()==J.getMonth())){this.currentMonth=J;var I=this.rangeStart(D),H=this.rangeEnd(D);var C=this.daysBetween(I,H);var F="";for(var E=0;E<=C;E++){var G=new Date(I.getFullYear(),I.getMonth(),I.getDate()+E,12,0);if(this.isFirstDayOfWeek(G)){F+="<tr>"}if(G.getMonth()==D.getMonth()){F+='<td class="selectable_day" date="'+this.dateToString(G)+'">'+G.getDate()+"</td>"}else{F+='<td class="unselected_month" date="'+this.dateToString(G)+'">'+G.getDate()+"</td>"}if(this.isLastDayOfWeek(G)){F+="</tr>"}}this.tbody.empty().append(F);this.monthNameSpan.empty().append(this.monthName(D));this.yearNameSpan.empty().append(this.currentMonth.getFullYear());A(".selectable_day",this.tbody).click(this.bindToObj(function(K){this.changeInput(A(K.target).attr("date"))}));A("td[date="+this.dateToString(new Date())+"]",this.tbody).addClass("today");A("td.selectable_day",this.tbody).mouseover(function(){A(this).addClass("hover")});A("td.selectable_day",this.tbody).mouseout(function(){A(this).removeClass("hover")})}A(".selected",this.tbody).removeClass("selected");A("td[date="+this.selectedDateString+"]",this.tbody).addClass("selected")},selectDate:function(C){if(typeof (C)=="undefined"){C=this.stringToDate(this.input.val())}if(!C){C=new Date()}this.selectedDate=C;this.selectedDateString=this.dateToString(this.selectedDate);this.selectMonth(this.selectedDate)},changeInput:function(C){this.input.val(C).change();this.hide()},show:function(){this.rootLayers.css("display","block");A([window,document.body]).click(this.hideIfClickOutside);this.input.unbind("focus",this.show);A(document.body).keydown(this.keydownHandler);this.setPosition()},hide:function(){this.rootLayers.css("display","none");A([window,document.body]).unbind("click",this.hideIfClickOutside);this.input.focus(this.show);A(document.body).unbind("keydown",this.keydownHandler)},hideIfClickOutside:function(C){if(C.target!=this.input[0]&&!this.insideSelector(C)){this.hide()}},insideSelector:function(C){var D=this.dateSelector.position();D.right=D.left+this.dateSelector.outerWidth();D.bottom=D.top+this.dateSelector.outerHeight();return C.pageY<D.bottom&&C.pageY>D.top&&C.pageX<D.right&&C.pageX>D.left},keydownHandler:function(C){switch(C.keyCode){case 9:case 27:this.hide();return ;break;case 13:this.changeInput(this.selectedDateString);break;case 33:this.moveDateMonthBy(C.ctrlKey?-12:-1);break;case 34:this.moveDateMonthBy(C.ctrlKey?12:1);break;case 38:this.moveDateBy(-7);break;case 40:this.moveDateBy(7);break;case 37:this.moveDateBy(-1);break;case 39:this.moveDateBy(1);break;default:return }C.preventDefault()},stringToDate:function(C){var D;if(D=C.match(/^(\d{1,2}) ([^\s]+) (\d{4,4})$/)){return new Date(D[3],this.shortMonthNum(D[2]),D[1],12,0)}else{return null}},dateToString:function(C){return C.getDate()+" "+this.short_month_names[C.getMonth()]+" "+C.getFullYear()},setPosition:function(){var C=this.input.offset();this.rootLayers.css({top:C.top+this.input.outerHeight(),left:C.left});if(this.ieframe){this.ieframe.css({width:this.dateSelector.outerWidth(),height:this.dateSelector.outerHeight()})}},moveDateBy:function(D){var C=new Date(this.selectedDate.getFullYear(),this.selectedDate.getMonth(),this.selectedDate.getDate()+D);this.selectDate(C)},moveDateMonthBy:function(D){var C=new Date(this.selectedDate.getFullYear(),this.selectedDate.getMonth()+D,this.selectedDate.getDate());if(C.getMonth()==this.selectedDate.getMonth()+D+1){C.setDate(0)}this.selectDate(C)},moveMonthBy:function(C){var D=new Date(this.currentMonth.getFullYear(),this.currentMonth.getMonth()+C,this.currentMonth.getDate());this.selectMonth(D)},monthName:function(C){return this.month_names[C.getMonth()]},bindToObj:function(D){var C=this;return function(){return D.apply(C,arguments)}},bindMethodsToObj:function(){for(var C=0;C<arguments.length;C++){this[arguments[C]]=this.bindToObj(this[arguments[C]])}},indexFor:function(E,D){for(var C=0;C<E.length;C++){if(D==E[C]){return C}}},monthNum:function(C){return this.indexFor(this.month_names,C)},shortMonthNum:function(C){return this.indexFor(this.short_month_names,C)},shortDayNum:function(C){return this.indexFor(this.short_day_names,C)},daysBetween:function(D,C){D=Date.UTC(D.getFullYear(),D.getMonth(),D.getDate());C=Date.UTC(C.getFullYear(),C.getMonth(),C.getDate());return(C-D)/86400000},changeDayTo:function(C,D,E){var F=E*(Math.abs(D.getDay()-C-(E*7))%7);return new Date(D.getFullYear(),D.getMonth(),D.getDate()+F)},rangeStart:function(C){return this.changeDayTo(this.start_of_week,new Date(C.getFullYear(),C.getMonth()),-1)},rangeEnd:function(C){return this.changeDayTo((this.start_of_week-1)%7,new Date(C.getFullYear(),C.getMonth()+1,0),1)},isFirstDayOfWeek:function(C){return C.getDay()==this.start_of_week},isLastDayOfWeek:function(C){return C.getDay()==(this.start_of_week-1)%7},adjustDays:function(E){var D=[];for(var C=0;C<E.length;C++){D[C]=E[(C+this.start_of_week)%7]}return D}};A.fn.date_input=function(C){return this.each(function(){new B(this,C)})};A.date_input={initialize:function(C){A("input.date_input").date_input(C)}};return B})(jQuery)

