
var currentTime=new Date();var month=currentTime.getMonth()+1;var day=currentTime.getDate();var year=currentTime.getFullYear();function addLoadEvent(func){var oldonload=window.onload;if(typeof window.onload!='function'){window.onload=func;}else{window.onload=function(){if(oldonload){oldonload();}
func();}}}
function SetFeratelStartDate(){var TheDate=day+'/'+month+'/'+year;FeratelDatumPrihoda.value=TheDate;}
function getSize(what){var myWidth=0,myHeight=0;if(typeof(window.innerWidth)=='number'){myWidth=window.innerWidth;myHeight=window.innerHeight;}else if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){myWidth=document.documentElement.clientWidth;myHeight=document.documentElement.clientHeight;}else if(document.body&&(document.body.clientWidth||document.body.clientHeight)){myWidth=document.body.clientWidth;myHeight=document.body.clientHeight;}
if(what=="width"){return myWidth;}
if(what=="Height"){return myHeight;}}
function getSizeParentWindow(what){var myWidth=0,myHeight=0;if(typeof(window.parent.innerWidth)=='number'){myWidth=window.parent.innerWidth;myHeight=window.parent.innerHeight;}else if(document.documentElement&&(document.parent.documentElement.clientWidth||document.parent.documentElement.clientHeight)){myWidth=document.parent.documentElement.clientWidth;myHeight=document.parent.documentElement.clientHeight;}else if(document.body&&(document.body.clientWidth||document.body.clientHeight)){myWidth=document.parent.body.clientWidth;myHeight=document.parent.body.clientHeight;}
if(what=="width"){return myWidth;}
if(what=="Height"){return myHeight;}}
function popUp(URL){newwindow=window.open(url,'name','height=1024,width=768');if(window.focus){newwindow.focus()}
return false;}
function SendAsPostCard(img){ImageToSend.src=img;ImageUrl.value=img;$(PostCardsSendingDiv).dialog({width:750,show:'fade',hide:'fade',open:function(type,data){$(this).parent().appendTo("form");}});}
function OpenPhotoDownLoadPanel(img){document.getElementById('SelectedPhoto').value=img;document.getElementById('PhotoDownloadPanel').style.display='block';}
function OpenPhotoDownload(size){LoadUserIframe('/PhotoDownload.aspx?size='+size+'&img='+document.getElementById('SelectedPhoto').value,800,600);document.getElementById('PhotoDownloadPanel').style.display='none';}
function PhotosBigOpen(BigSrc,refreshImage){var BigImg=document.getElementById('BigImg');BigImg.src=BigSrc;BigImg.style.display='block';var Wwidth=$(window).width();var scrollTop=$(window).scrollTop();var Wheight=$(window).height();var width=BigImg.clientWidth;var height=BigImg.clientHeight;if(Wwidth<width){width=Wwidth;}
if(Wheight<height){height=Wheight;}
var PosX=(Wwidth-width)/2;var PosY=(Wheight-height)/2;BigImg.style.width=width+'px';BigImg.style.height=height+'px';BigImg.style.left=PosX+'px';BigImg.style.top=scrollTop+PosY+'px';if(refreshImage=='true'){BigImageLoadInterval=setInterval("ImageLoad('BigImg', '"+BigSrc+"')",1000);}
else{BigImageLoadInterval=setInterval(null,100000);}}
function ImageLoad(imgid,imgsrc){newurl=imgsrc.replace("amp;counter=","");random=new Date().getTime();var trickname="&amp;counter="+random;document.getElementById(imgid).src=newurl+'&amp;'+trickname;return;}
function PhotosBigClose(){document.getElementById('BigImg').src='';document.getElementById('BigImg').style.display='none';if(BigImageLoadInterval!=null){clearInterval(BigImageLoadInterval);}}
function CenterPositionElement(elementId,width,height){var element=document.getElementById(elementId);var Wwidth=$(window).width();var scrollTop=$(window).scrollTop();var Wheight=$(window).height();if(Wwidth<width){width=Wwidth;}
if(Wheight<height){height=Wheight;}
var PosX=(Wwidth-width)/2;var PosY=(Wheight-height)/2;element.style.width=width+'px';element.style.height=height+'px';element.style.left=PosX+'px';element.style.top=scrollTop+PosY+'px';}
function LoadUserIframe(source,Dwidth,Dheight){var IframeElem=document.getElementById('UserIframe');var UserOverlay=document.getElementById('UserOverlay');IframeElem.src=source;var Wwidth=$(window).width();var Wheight=$(window).height();if(Wwidth<Dwidth){Dwidth=Wwidth;}
if(Wheight<Dheight){Dheight=Wheight;}
IframeElem.style.width=Dwidth-20+'px';IframeElem.style.height=Dheight-20+'px';UserOverlay.style.width=Dwidth-20+'px';UserOverlay.style.height=Dheight-20+'px';$('#UserOverlay').dialog({show:'blind',width:Dwidth-20,height:Dheight-20,beforeclose:function(){unLoadUserIframe();}});}
function unLoadUserIframe(){var IframeElem=document.getElementById('UserIframe');var UserOverlay=document.getElementById('UserOverlay');UserOverlay.style.width='0px';UserOverlay.style.height='0px';IframeElem.style.width='0px';IframeElem.style.height='0px';UserOverlay.style.left='0px';UserOverlay.style.top='0px';UserOverlay.style.display='none';IframeElem.src='';}
function ChangeResults(){__doPostBack(SearchRefreshButton,'');}
function CloseResultsDiv(){document.getElementById('SearchTitlesDiv').style.display='none';}
function ElementDisplay(ElementId,mode){document.getElementById(ElementId).style.display=mode;}
function SwitchPageStyle(StyleName){$.cookie('StylePreference',StyleName);if(navigator.userAgent.indexOf('MSIE')!=-1)
{location.reload();}
else{setTimeout("ElementDisplay('ctl00_htmlbody', 'none')",80);setTimeout("$('#PageStyle').attr('href', '/css/pageC"+StyleName+".css.aspx')",20);setTimeout("ElementDisplay('ctl00_htmlbody', 'block')",1800);}}
function getRadioCheckedValue(radio_name){var oRadio=document.forms[0].elements[radio_name];for(var i=0;i<oRadio.length;i++){if(oRadio[i].checked){return oRadio[i].value;}}
return'';}
function getSelectedValue(Element_Id){var selected_index=Element_Id.selectedIndex;if(selected_index>0){return Element_Id.options[selected_index].value;}
else{return'';}}
function OpenFeratelFrame(){var AccT=FeratelAccTypeList.options[FeratelAccTypeList.selectedIndex].value;var Loc=FeratelSrchOrte.options[FeratelSrchOrte.selectedIndex].value;var dateString=FeratelDatumPrihoda.value.split('/');var FromMonth=dateString[1];var FromDay=dateString[0];var FromYear=dateString[2];if(FromMonth.length==1){FromMonth='0'+FromMonth;}
if(FromDay.length==1){FromDay='0'+FromDay;}
var OnlyOnline='0';if(document.getElementById('SrchBookOnly').checked){OnlyOnline='1';}
link="http://web.deskline.net/maribor/"+FeratelLangCode+"/qfind_accommodation?qfdAccommodationType="+AccT+"&qfdArrivalDate="+FromYear+FromMonth+FromDay+"&qfdLocation="+Loc+"&SrchFromDay="+dateString[0]+"&SrchFromMonth="+dateString[1]+"&SrchFromYear="+FromYear+"&qfdNights="+FeratelNoci.value+"&qfdNumberOfUnits="+FeratelSob.value+"&qfdAdults="+FeratelOseb.value+"&qfdOnlyBookable="+OnlyOnline+"&qfdShowOnMap=checked";var FeratelDiv=document.getElementById('feratel_div');var VsebinskiDiv=document.getElementById('contentCell');var FeratelFrame=document.getElementById('feratel_frame');FeratelDiv.style.display='block';VsebinskiDiv.style.display='none';FeratelFrame.src=link;}
function ExposeLargeMap(){var GmapHolderWidth=getSize("width")-20;var GmapHolderHeight=getSize("Height");var GmapWidth=GmapHolderWidth-145;var GmapHeight=GmapHolderHeight;var currWindowPosTop=($(window).scrollTop());var currWindowPosLeft=($(window).scrollLeft());GmapHolder.style.left=currWindowPosLeft+'px';GmapHolder.style.top=currWindowPosTop+'px';GmapHolder.style.backgroundColor='White';GmapHolder.style.width=GmapHolderWidth+'px';GmapHolder.style.height=GmapHolderHeight+'px';Gmap.style.width=GmapWidth+'px';Gmap.style.height=GmapHeight+'px';EnLargeMapButton.onclick=CloseLargeMap;GmapLogoImg.style.display='block';map.checkResize();map.addControl(new google.maps.LocalSearch());}
function CloseLargeMap(){GmapHolder.style.removeProperty("left");GmapHolder.style.removeProperty("top");GmapHolder.style.removeProperty("left");GmapHolder.style.backgroundColor='#EEEEEE';GmapHolder.style.width='360px';GmapHolder.style.height='126px';Gmap.style.width='220px';Gmap.style.height='126px';GmapLogoImg.style.display='none';map.checkResize();EnLargeMapButton.onclick=ExposeLargeMap;}
function reloadStylesheets(){var stylesheets=$('link[rel="stylesheet"]');var reloadQueryString='?reload='+new Date().getTime();stylesheets.each(function(){this.href=this.href.replace(/\?.*|$/,reloadQueryString);});}
function FullScreenSlideShow(){var WindowWidth=($(window).width());var WindowHeight=($(window).height());LoadUserIframe('/FullScreenSlideShow.aspx',WindowWidth-80,WindowHeight-50);}
(function($){$.fn.lazyload=function(options){var settings={threshold:0,failurelimit:0,event:"scroll",effect:"show",container:window};if(options){$.extend(settings,options);}
var elements=this;if("scroll"==settings.event){$(settings.container).bind("scroll",function(event){var counter=0;elements.each(function(){if($.abovethetop(this,settings)||$.leftofbegin(this,settings)){}else if(!$.belowthefold(this,settings)&&!$.rightoffold(this,settings)){$(this).trigger("appear");}else{if(counter++>settings.failurelimit){return false;}}});var temp=$.grep(elements,function(element){return!element.loaded;});elements=$(temp);});}
return this.each(function(){var self=this;$(self).data("original",$(self).attr("src"));if("scroll"!=settings.event||($.abovethetop(self,settings)||$.leftofbegin(self,settings)||$.belowthefold(self,settings)||$.rightoffold(self,settings))){if(settings.placeholder){$(self).attr("src",settings.placeholder);}else{$(self).removeAttr("src");}
self.loaded=false;}else{self.loaded=true;}
$(self).one("appear",function(){if(!this.loaded){$("<img />").bind("load",function(){$(self).hide().attr("src",$(self).data("original"))
[settings.effect](settings.effectspeed);self.loaded=true;}).attr("src",$(self).data("original"));};});if("scroll"!=settings.event){$(self).bind(settings.event,function(event){if(!self.loaded){$(self).trigger("appear");}});}});};$.belowthefold=function(element,settings){if(settings.container===undefined||settings.container===window){var fold=$(window).height()+$(window).scrollTop();}else{var fold=$(settings.container).offset().top+$(settings.container).height();}
return fold<=$(element).offset().top-settings.threshold;};$.rightoffold=function(element,settings){if(settings.container===undefined||settings.container===window){var fold=$(window).width()+$(window).scrollLeft();}else{var fold=$(settings.container).offset().left+$(settings.container).width();}
return fold<=$(element).offset().left-settings.threshold;};$.abovethetop=function(element,settings){if(settings.container===undefined||settings.container===window){var fold=$(window).scrollTop();}else{var fold=$(settings.container).offset().top;}
return fold>=$(element).offset().top+settings.threshold+$(element).height();};$.leftofbegin=function(element,settings){if(settings.container===undefined||settings.container===window){var fold=$(window).scrollLeft();}else{var fold=$(settings.container).offset().left;}
return fold>=$(element).offset().left+settings.threshold+$(element).width();};$.extend($.expr[':'],{"below-the-fold":"$.belowthefold(a, {threshold : 0, container: window})","above-the-fold":"!$.belowthefold(a, {threshold : 0, container: window})","right-of-fold":"$.rightoffold(a, {threshold : 0, container: window})","left-of-fold":"!$.rightoffold(a, {threshold : 0, container: window})"});})(jQuery);(function($){var dropShadowZindex=1;$.fn.dropShadow=function(options){var opt=$.extend({left:4,top:4,blur:2,opacity:.5,color:"black",swap:false},options);var jShadows=$([]);this.not(".dropShadow").each(function(){var jthis=$(this);var shadows=[];var blur=(opt.blur<=0)?0:opt.blur;var opacity=(blur==0)?opt.opacity:opt.opacity/(blur*8);var zOriginal=(opt.swap)?dropShadowZindex:dropShadowZindex+1;var zShadow=(opt.swap)?dropShadowZindex+1:dropShadowZindex;var shadowId;if(this.id){shadowId=this.id+"_dropShadow";}
else{shadowId="ds"+(1+Math.floor(9999*Math.random()));}
$.data(this,"shadowId",shadowId);$.data(this,"shadowOptions",options);jthis.attr("shadowId",shadowId).css("zIndex",zOriginal);if(jthis.css("position")!="absolute"){jthis.css({position:"relative",zoom:1});}
bgColor=jthis.css("backgroundColor");if(bgColor=="rgba(0, 0, 0, 0)")bgColor="transparent";if(bgColor!="transparent"||jthis.css("backgroundImage")!="none"||this.nodeName=="SELECT"||this.nodeName=="INPUT"||this.nodeName=="TEXTAREA"){shadows[0]=$("<div></div>").css("background",opt.color);}
else{shadows[0]=jthis.clone().removeAttr("id").removeAttr("name").removeAttr("shadowId").css("color",opt.color);}
shadows[0].addClass("dropShadow").css({height:jthis.outerHeight(),left:blur,opacity:opacity,position:"absolute",top:blur,width:jthis.outerWidth(),zIndex:zShadow});var layers=(8*blur)+1;for(i=1;i<layers;i++){shadows[i]=shadows[0].clone();}
var i=1;var j=blur;while(j>0){shadows[i].css({left:j*2,top:0});shadows[i+1].css({left:j*4,top:j*2});shadows[i+2].css({left:j*2,top:j*4});shadows[i+3].css({left:0,top:j*2});shadows[i+4].css({left:j*3,top:j});shadows[i+5].css({left:j*3,top:j*3});shadows[i+6].css({left:j,top:j*3});shadows[i+7].css({left:j,top:j});i+=8;j--;}
var divShadow=$("<div></div>").attr("id",shadowId).addClass("dropShadow").css({left:jthis.position().left+opt.left-blur,marginTop:jthis.css("marginTop"),marginRight:jthis.css("marginRight"),marginBottom:jthis.css("marginBottom"),marginLeft:jthis.css("marginLeft"),position:"absolute",top:jthis.position().top+opt.top-blur,zIndex:zShadow});for(i=0;i<layers;i++){divShadow.append(shadows[i]);}
jthis.after(divShadow);jShadows=jShadows.add(divShadow);$(window).resize(function(){try{divShadow.css({left:jthis.position().left+opt.left-blur,top:jthis.position().top+opt.top-blur});}
catch(e){}});dropShadowZindex+=2;});return this.pushStack(jShadows);};$.fn.redrawShadow=function(){this.removeShadow();return this.each(function(){var shadowOptions=$.data(this,"shadowOptions");$(this).dropShadow(shadowOptions);});};$.fn.removeShadow=function(){return this.each(function(){var shadowId=$(this).shadowId();$("div#"+shadowId).remove();});};$.fn.shadowId=function(){return $.data(this[0],"shadowId");};$(function(){var noPrint="<style type='text/css' media='print'>";noPrint+=".dropShadow{visibility:hidden;}</style>";$("head").append(noPrint);});})(jQuery);(function($){$.jScrollPane={active:[]};$.fn.jScrollPane=function(settings){settings=$.extend({},$.fn.jScrollPane.defaults,settings);var rf=function(){return false;};return this.each(function(){var $this=$(this);var paneEle=this;var currentScrollPosition=0;var paneWidth;var paneHeight;var trackHeight;var trackOffset=settings.topCapHeight;var $container;if($(this).parent().is('.jScrollPaneContainer')){$container=$(this).parent();currentScrollPosition=settings.maintainPosition?$this.position().top:0;var $c=$(this).parent();paneWidth=$c.innerWidth();paneHeight=$c.outerHeight();$('>.jScrollPaneTrack, >.jScrollArrowUp, >.jScrollArrowDown, >.jScrollCap',$c).remove();$this.css({'top':0});}else{$this.data('originalStyleTag',$this.attr('style'));$this.css('overflow','hidden');this.originalPadding=$this.css('paddingTop')+' '+$this.css('paddingRight')+' '+$this.css('paddingBottom')+' '+$this.css('paddingLeft');this.originalSidePaddingTotal=(parseInt($this.css('paddingLeft'))||0)+(parseInt($this.css('paddingRight'))||0);paneWidth=$this.innerWidth();paneHeight=$this.innerHeight();$container=$('<div></div>').attr({'className':'jScrollPaneContainer'}).css({'height':paneHeight+'px','width':paneWidth+'px'});if(settings.enableKeyboardNavigation){$container.attr('tabindex',settings.tabIndex);}
$this.wrap($container);$container=$this.parent();$(document).bind('emchange',function(e,cur,prev){$this.jScrollPane(settings);});}
trackHeight=paneHeight;if(settings.reinitialiseOnImageLoad){var $imagesToLoad=$.data(paneEle,'jScrollPaneImagesToLoad')||$('img',$this);var loadedImages=[];if($imagesToLoad.length){$imagesToLoad.each(function(i,val){$(this).bind('load readystatechange',function(){if($.inArray(i,loadedImages)==-1){loadedImages.push(val);$imagesToLoad=$.grep($imagesToLoad,function(n,i){return n!=val;});$.data(paneEle,'jScrollPaneImagesToLoad',$imagesToLoad);var s2=$.extend(settings,{reinitialiseOnImageLoad:false});$this.jScrollPane(s2);}}).each(function(i,val){if(this.complete||this.complete===undefined){this.src=this.src;}});});};}
var p=this.originalSidePaddingTotal;var realPaneWidth=paneWidth-settings.scrollbarWidth-settings.scrollbarMargin-p;var cssToApply={'height':'auto','width':realPaneWidth+'px'}
if(settings.scrollbarOnLeft){cssToApply.paddingLeft=settings.scrollbarMargin+settings.scrollbarWidth+'px';}else{cssToApply.paddingRight=settings.scrollbarMargin+'px';}
$this.css(cssToApply);var contentHeight=$this.outerHeight();var percentInView=paneHeight/contentHeight;var isScrollable=percentInView<.99;$container[isScrollable?'addClass':'removeClass']('jScrollPaneScrollable');if(isScrollable){$container.append($('<div></div>').addClass('jScrollCap jScrollCapTop').css({height:settings.topCapHeight}),$('<div></div>').attr({'className':'jScrollPaneTrack'}).css({'width':settings.scrollbarWidth+'px'}).append($('<div></div>').attr({'className':'jScrollPaneDrag'}).css({'width':settings.scrollbarWidth+'px'}).append($('<div></div>').attr({'className':'jScrollPaneDragTop'}).css({'width':settings.scrollbarWidth+'px'}),$('<div></div>').attr({'className':'jScrollPaneDragBottom'}).css({'width':settings.scrollbarWidth+'px'}))),$('<div></div>').addClass('jScrollCap jScrollCapBottom').css({height:settings.bottomCapHeight}));var $track=$('>.jScrollPaneTrack',$container);var $drag=$('>.jScrollPaneTrack .jScrollPaneDrag',$container);var currentArrowDirection;var currentArrowTimerArr=[];var currentArrowInc;var whileArrowButtonDown=function(){if(currentArrowInc>4||currentArrowInc%4==0){positionDrag(dragPosition+currentArrowDirection*mouseWheelMultiplier);}
currentArrowInc++;};if(settings.enableKeyboardNavigation){$container.bind('keydown.jscrollpane',function(e){switch(e.keyCode){case 38:currentArrowDirection=-1;currentArrowInc=0;whileArrowButtonDown();currentArrowTimerArr[currentArrowTimerArr.length]=setInterval(whileArrowButtonDown,100);return false;case 40:currentArrowDirection=1;currentArrowInc=0;whileArrowButtonDown();currentArrowTimerArr[currentArrowTimerArr.length]=setInterval(whileArrowButtonDown,100);return false;case 33:case 34:return false;default:}}).bind('keyup.jscrollpane',function(e){if(e.keyCode==38||e.keyCode==40){for(var i=0;i<currentArrowTimerArr.length;i++){clearInterval(currentArrowTimerArr[i]);}
return false;}});}
if(settings.showArrows){var currentArrowButton;var currentArrowInterval;var onArrowMouseUp=function(event){$('html').unbind('mouseup',onArrowMouseUp);currentArrowButton.removeClass('jScrollActiveArrowButton');clearInterval(currentArrowInterval);};var onArrowMouseDown=function(){$('html').bind('mouseup',onArrowMouseUp);currentArrowButton.addClass('jScrollActiveArrowButton');currentArrowInc=0;whileArrowButtonDown();currentArrowInterval=setInterval(whileArrowButtonDown,100);};$container.append($('<a></a>').attr({'href':'javascript:;','className':'jScrollArrowUp','tabindex':-1}).css({'width':settings.scrollbarWidth+'px','top':settings.topCapHeight+'px'}).html('Scroll up').bind('mousedown',function(){currentArrowButton=$(this);currentArrowDirection=-1;onArrowMouseDown();this.blur();return false;}).bind('click',rf),$('<a></a>').attr({'href':'javascript:;','className':'jScrollArrowDown','tabindex':-1}).css({'width':settings.scrollbarWidth+'px','bottom':settings.bottomCapHeight+'px'}).html('Scroll down').bind('mousedown',function(){currentArrowButton=$(this);currentArrowDirection=1;onArrowMouseDown();this.blur();return false;}).bind('click',rf));var $upArrow=$('>.jScrollArrowUp',$container);var $downArrow=$('>.jScrollArrowDown',$container);}
if(settings.arrowSize){trackHeight=paneHeight-settings.arrowSize-settings.arrowSize;trackOffset+=settings.arrowSize;}else if($upArrow){var topArrowHeight=$upArrow.height();settings.arrowSize=topArrowHeight;trackHeight=paneHeight-topArrowHeight-$downArrow.height();trackOffset+=topArrowHeight;}
trackHeight-=settings.topCapHeight+settings.bottomCapHeight;$track.css({'height':trackHeight+'px',top:trackOffset+'px'})
var $pane=$(this).css({'position':'absolute','overflow':'visible'});var currentOffset;var maxY;var mouseWheelMultiplier;var dragPosition=0;var dragMiddle=percentInView*paneHeight/2;var getPos=function(event,c){var p=c=='X'?'Left':'Top';return event['page'+c]||(event['client'+c]+(document.documentElement['scroll'+p]||document.body['scroll'+p]))||0;};var ignoreNativeDrag=function(){return false;};var initDrag=function(){ceaseAnimation();currentOffset=$drag.offset(false);currentOffset.top-=dragPosition;maxY=trackHeight-$drag[0].offsetHeight;mouseWheelMultiplier=2*settings.wheelSpeed*maxY/contentHeight;};var onStartDrag=function(event){initDrag();dragMiddle=getPos(event,'Y')-dragPosition-currentOffset.top;$('html').bind('mouseup',onStopDrag).bind('mousemove',updateScroll);if($.browser.msie){$('html').bind('dragstart',ignoreNativeDrag).bind('selectstart',ignoreNativeDrag);}
return false;};var onStopDrag=function(){$('html').unbind('mouseup',onStopDrag).unbind('mousemove',updateScroll);dragMiddle=percentInView*paneHeight/2;if($.browser.msie){$('html').unbind('dragstart',ignoreNativeDrag).unbind('selectstart',ignoreNativeDrag);}};var positionDrag=function(destY){$container.scrollTop(0);destY=destY<0?0:(destY>maxY?maxY:destY);dragPosition=destY;$drag.css({'top':destY+'px'});var p=destY/maxY;$this.data('jScrollPanePosition',(paneHeight-contentHeight)*-p);$pane.css({'top':((paneHeight-contentHeight)*p)+'px'});$this.trigger('scroll');if(settings.showArrows){$upArrow[destY==0?'addClass':'removeClass']('disabled');$downArrow[destY==maxY?'addClass':'removeClass']('disabled');}};var updateScroll=function(e){positionDrag(getPos(e,'Y')-currentOffset.top-dragMiddle);};var dragH=Math.max(Math.min(percentInView*(paneHeight-settings.arrowSize*2),settings.dragMaxHeight),settings.dragMinHeight);$drag.css({'height':dragH+'px'}).bind('mousedown',onStartDrag);var trackScrollInterval;var trackScrollInc;var trackScrollMousePos;var doTrackScroll=function(){if(trackScrollInc>8||trackScrollInc%4==0){positionDrag((dragPosition-((dragPosition-trackScrollMousePos)/2)));}
trackScrollInc++;};var onStopTrackClick=function(){clearInterval(trackScrollInterval);$('html').unbind('mouseup',onStopTrackClick).unbind('mousemove',onTrackMouseMove);};var onTrackMouseMove=function(event){trackScrollMousePos=getPos(event,'Y')-currentOffset.top-dragMiddle;};var onTrackClick=function(event){initDrag();onTrackMouseMove(event);trackScrollInc=0;$('html').bind('mouseup',onStopTrackClick).bind('mousemove',onTrackMouseMove);trackScrollInterval=setInterval(doTrackScroll,100);doTrackScroll();return false;};$track.bind('mousedown',onTrackClick);$container.bind('mousewheel',function(event,delta){delta=delta||(event.wheelDelta?event.wheelDelta/120:(event.detail)?-event.detail/3:0);initDrag();ceaseAnimation();var d=dragPosition;positionDrag(dragPosition-delta*mouseWheelMultiplier);var dragOccured=d!=dragPosition;return!dragOccured;});var _animateToPosition;var _animateToInterval;function animateToPosition(){var diff=(_animateToPosition-dragPosition)/settings.animateStep;if(diff>1||diff<-1){positionDrag(dragPosition+diff);}else{positionDrag(_animateToPosition);ceaseAnimation();}}
var ceaseAnimation=function(){if(_animateToInterval){clearInterval(_animateToInterval);delete _animateToPosition;}};var scrollTo=function(pos,preventAni){if(typeof pos=="string"){try{$e=$(pos,$this);}catch(err){return;}
if(!$e.length)return;pos=$e.offset().top-$this.offset().top;}
ceaseAnimation();var maxScroll=contentHeight-paneHeight;pos=pos>maxScroll?maxScroll:pos;$this.data('jScrollPaneMaxScroll',maxScroll);var destDragPosition=pos/maxScroll*maxY;if(preventAni||!settings.animateTo){positionDrag(destDragPosition);}else{$container.scrollTop(0);_animateToPosition=destDragPosition;_animateToInterval=setInterval(animateToPosition,settings.animateInterval);}};$this[0].scrollTo=scrollTo;$this[0].scrollBy=function(delta){var currentPos=-parseInt($pane.css('top'))||0;scrollTo(currentPos+delta);};initDrag();scrollTo(-currentScrollPosition,true);$('*',this).bind('focus',function(event){var $e=$(this);var eleTop=0;while($e[0]!=$this[0]){eleTop+=$e.position().top;$e=$e.offsetParent();}
var viewportTop=-parseInt($pane.css('top'))||0;var maxVisibleEleTop=viewportTop+paneHeight;var eleInView=eleTop>viewportTop&&eleTop<maxVisibleEleTop;if(!eleInView){var destPos=eleTop-settings.scrollbarMargin;if(eleTop>viewportTop){destPos+=$(this).height()+15+settings.scrollbarMargin-paneHeight;}
scrollTo(destPos);}})
if(settings.observeHash){if(location.hash&&location.hash.length>1){setTimeout(function(){scrollTo(location.hash);},$.browser.safari?100:0);}
$(document).bind('click',function(e){$target=$(e.target);if($target.is('a')){var h=$target.attr('href');if(h&&h.substr(0,1)=='#'&&h.length>1){setTimeout(function(){scrollTo(h,!settings.animateToInternalLinks);},$.browser.safari?100:0);}}});}
function onSelectScrollMouseDown(e){$(document).bind('mousemove.jScrollPaneDragging',onTextSelectionScrollMouseMove);$(document).bind('mouseup.jScrollPaneDragging',onSelectScrollMouseUp);}
var textDragDistanceAway;var textSelectionInterval;function onTextSelectionInterval(){direction=textDragDistanceAway<0?-1:1;$this[0].scrollBy(textDragDistanceAway/2);}
function clearTextSelectionInterval(){if(textSelectionInterval){clearInterval(textSelectionInterval);textSelectionInterval=undefined;}}
function onTextSelectionScrollMouseMove(e){var offset=$this.parent().offset().top;var maxOffset=offset+paneHeight;var mouseOffset=getPos(e,'Y');textDragDistanceAway=mouseOffset<offset?mouseOffset-offset:(mouseOffset>maxOffset?mouseOffset-maxOffset:0);if(textDragDistanceAway==0){clearTextSelectionInterval();}else{if(!textSelectionInterval){textSelectionInterval=setInterval(onTextSelectionInterval,100);}}}
function onSelectScrollMouseUp(e){$(document).unbind('mousemove.jScrollPaneDragging').unbind('mouseup.jScrollPaneDragging');clearTextSelectionInterval();}
$container.bind('mousedown.jScrollPane',onSelectScrollMouseDown);$.jScrollPane.active.push($this[0]);}else{$this.css({'height':paneHeight+'px','width':paneWidth-this.originalSidePaddingTotal+'px','padding':this.originalPadding});$this[0].scrollTo=$this[0].scrollBy=function(){};$this.parent().unbind('mousewheel').unbind('mousedown.jScrollPane').unbind('keydown.jscrollpane').unbind('keyup.jscrollpane');}})};$.fn.jScrollPaneRemove=function(){$(this).each(function(){$this=$(this);var $c=$this.parent();if($c.is('.jScrollPaneContainer')){$this.css({'top':'','height':'','width':'','padding':'','overflow':'','position':''});$this.attr('style',$this.data('originalStyleTag'));$c.after($this).remove();}});}
$.fn.jScrollPane.defaults={scrollbarWidth:10,scrollbarMargin:5,wheelSpeed:18,showArrows:false,arrowSize:0,animateTo:false,dragMinHeight:1,dragMaxHeight:99999,animateInterval:100,animateStep:3,maintainPosition:true,scrollbarOnLeft:false,reinitialiseOnImageLoad:false,tabIndex:0,enableKeyboardNavigation:true,animateToInternalLinks:false,topCapHeight:0,bottomCapHeight:0,observeHash:true};$(window).bind('unload',function(){var els=$.jScrollPane.active;for(var i=0;i<els.length;i++){els[i].scrollTo=els[i].scrollBy=null;}});})(jQuery);(function($){$.fn.gradient=function(options){options=$.extend({from:'000000',to:'ffffff',direction:'horizontal',position:'top',length:null},options||{});var createColorPath=function(startColor,endColor,distance){var colorPath=[],colorPercent=1.0,distance=(distance<100)?distance:100;do{colorPath[colorPath.length]=setColorHue(longHexToDec(startColor),colorPercent,longHexToDec(endColor));colorPercent-=((100/distance)*0.01);}while(colorPercent>0);return colorPath;},setColorHue=function(originColor,opacityPercent,maskRGB){var returnColor=[];for(var i=0;i<originColor.length;i++)
returnColor[i]=Math.round(originColor[i]*opacityPercent)+Math.round(maskRGB[i]*(1.0-opacityPercent));return returnColor;},longHexToDec=function(longHex){return new Array(toDec(longHex.substring(0,2)),toDec(longHex.substring(2,4)),toDec(longHex.substring(4,6)));},toDec=function(hex){return parseInt(hex,16);};return this.each(function(){var $this=$(this),width=$this.innerWidth(),height=$this.innerHeight(),x=0,y=0,w=1,h=1,html=[],length=options.length||(options.direction=='vertical'?width:height),position=(options.position=='bottom'?'bottom:0;':'top:0;')+(options.position=='right'?'right:0;':'left:0;'),colorArray=createColorPath(options.from,options.to,length);if(options.direction=='horizontal'){h=Math.round(length/colorArray.length)||1;w=width;}else{w=Math.round(length/colorArray.length)||1;h=height;}
html.push('<div class="gradient" style="position: absolute; '+position+' width: '+(options.direction=='vertical'?length+"px":"100%")+'; height: '+(options.direction=='vertical'?"100%":length+"px")+'; overflow: hidden; z-index: 0; background-color: #'+(options.position.indexOf('bottom')!=-1?options.from:options.to)+'">');for(var i=0;i<colorArray.length;i++){html.push('<div style="position:absolute;z-index:1;top:'+y+'px;left:'+x+'px;height:'+(options.direction=='vertical'?"100%":h+"px")+';width:'+(options.direction=='vertical'?w+"px":"100%")+';background-color:rgb('+colorArray[i][0]+','+colorArray[i][1]+','+colorArray[i][2]+');"></div>');options.direction=='vertical'?x+=w:y+=h;if(y>=height||x>=width)break;}
html.push('</div>');if($this.css('position')=='static')
$this.css('position','relative');$this.html('<div style="display:'+$this.css("display")+'; position: relative; z-index: 2;">'+this.innerHTML+'</div>').prepend(html.join(''));});};})(jQuery);(function($){var
undefined,dataFlag="watermark",dataClass="watermarkClass",dataFocus="watermarkFocus",dataFormSubmit="watermarkSubmit",dataMaxLen="watermarkMaxLength",dataPassword="watermarkPassword",dataText="watermarkText",selWatermarkDefined=":data("+dataFlag+")",selWatermarkAble=":text,:password,:search,textarea",triggerFns=["Page_ClientValidate"],pageDirty=false;$.extend($.expr[":"],{"search":function(elem){return"search"===(elem.type||"");},"data":function(element,index,matches,set){var data,parts=/^((?:[^=!^$*]|[!^$*](?!=))+)(?:([!^$*]?=)(.*))?$/.exec(matches[3]);if(parts){data=$(element).data(parts[1]);if(data!==undefined){if(parts[2]){data=""+data;switch(parts[2]){case"=":return(data==parts[3]);case"!=":return(data!=parts[3]);case"^=":return(data.slice(0,parts[3].length)==parts[3]);case"$=":return(data.slice(-parts[3].length)==parts[3]);case"*=":return(data.indexOf(parts[3])!==-1);}}
return true;}}
return false;}});$.watermark={version:"3.0.6",options:{className:"watermark",useNative:true},hide:function(selector){$(selector).filter(selWatermarkDefined).each(function(){$.watermark._hide($(this));});},_hide:function($input,focus){var inputVal=$input.val()||"",inputWm=$input.data(dataText)||"",maxLen=$input.data(dataMaxLen)||0,className=$input.data(dataClass);if((inputWm.length)&&(inputVal==inputWm)){$input.val("");if($input.data(dataPassword)){if(($input.attr("type")||"")==="text"){var $pwd=$input.data(dataPassword)||[],$wrap=$input.parent()||[];if(($pwd.length)&&($wrap.length)){$wrap[0].removeChild($input[0]);$wrap[0].appendChild($pwd[0]);$input=$pwd;}}}
if(maxLen){$input.attr("maxLength",maxLen);$input.removeData(dataMaxLen);}
if(focus){$input.attr("autocomplete","off");window.setTimeout(function(){$input.select();},1);}}
className&&$input.removeClass(className);},show:function(selector){$(selector).filter(selWatermarkDefined).each(function(){$.watermark._show($(this));});},_show:function($input){var val=$input.val()||"",text=$input.data(dataText)||"",type=$input.attr("type")||"",className=$input.data(dataClass);if(((val.length==0)||(val==text))&&(!$input.data(dataFocus))){pageDirty=true;if($input.data(dataPassword)){if(type==="password"){var $pwd=$input.data(dataPassword)||[],$wrap=$input.parent()||[];if(($pwd.length)&&($wrap.length)){$wrap[0].removeChild($input[0]);$wrap[0].appendChild($pwd[0]);$input=$pwd;$input.attr("maxLength",text.length);}}}
if((type==="text")||(type==="search")){var maxLen=$input.attr("maxLength")||0;if((maxLen>0)&&(text.length>maxLen)){$input.data(dataMaxLen,maxLen);$input.attr("maxLength",text.length);}}
className&&$input.addClass(className);$input.val(text);}
else{$.watermark._hide($input);}},hideAll:function(){if(pageDirty){$.watermark.hide(selWatermarkAble);pageDirty=false;}},showAll:function(){$.watermark.show(selWatermarkAble);}};$.fn.watermark=function(text,options){if(!this.length){return this;}
var hasClass=false,hasText=(typeof(text)==="string");if(typeof(options)==="object"){hasClass=(typeof(options.className)==="string");options=$.extend({},$.watermark.options,options);}
else if(typeof(options)==="string"){hasClass=true;options=$.extend({},$.watermark.options,{className:options});}
else{options=$.watermark.options;}
if(typeof(options.useNative)!=="function"){options.useNative=options.useNative?function(){return true;}:function(){return false;};}
return this.each(function(){var $input=$(this);if(!$input.is(selWatermarkAble)){return;}
if($input.data(dataFlag)){if(hasText||hasClass){$.watermark._hide($input);if(hasText){$input.data(dataText,text);}
if(hasClass){$input.data(dataClass,options.className);}}}
else{if(options.useNative.call(this,$input)){if(((""+$input.css("-webkit-appearance")).replace("undefined","")!=="")&&(($input.attr("tagName")||"")!=="TEXTAREA")){if(hasText){$input.attr("placeholder",text);}
return;}}
$input.data(dataText,hasText?text:"");$input.data(dataClass,options.className);$input.data(dataFlag,1);if(($input.attr("type")||"")==="password"){var $wrap=$input.wrap("<span>").parent(),$wm=$($wrap.html().replace(/type=["']?password["']?/i,'type="text"'));$wm.data(dataText,$input.data(dataText));$wm.data(dataClass,$input.data(dataClass));$wm.data(dataFlag,1);$wm.attr("maxLength",text.length);$wm.focus(function(){$.watermark._hide($wm,true);}).bind("dragenter",function(){$.watermark._hide($wm);}).bind("dragend",function(){window.setTimeout(function(){$wm.blur();},1);});$input.blur(function(){$.watermark._show($input);}).bind("dragleave",function(){$.watermark._show($input);});$wm.data(dataPassword,$input);$input.data(dataPassword,$wm);}
else{$input.focus(function(){$input.data(dataFocus,1);$.watermark._hide($input,true);}).blur(function(){$input.data(dataFocus,0);$.watermark._show($input);}).bind("dragenter",function(){$.watermark._hide($input);}).bind("dragleave",function(){$.watermark._show($input);}).bind("dragend",function(){window.setTimeout(function(){$.watermark._show($input);},1);}).bind("drop",function(evt){var dropText=evt.originalEvent.dataTransfer.getData("Text");if($input.val().replace(dropText,"")===$input.data(dataText)){$input.val(dropText);}
$input.focus();});}
if(this.form){var form=this.form,$form=$(form);if(!$form.data(dataFormSubmit)){$form.submit($.watermark.hideAll);if(form.submit){$form.data(dataFormSubmit,form.submit);form.submit=(function(f,$f){return function(){var nativeSubmit=$f.data(dataFormSubmit);$.watermark.hideAll();if(nativeSubmit.apply){nativeSubmit.apply(f,Array.prototype.slice.call(arguments));}
else{nativeSubmit();}};})(form,$form);}
else{$form.data(dataFormSubmit,1);form.submit=(function(f){return function(){$.watermark.hideAll();delete f.submit;f.submit();};})(form);}}}}
$.watermark._show($input);});};if(triggerFns.length){$(function(){var i,name,fn;for(i=triggerFns.length-1;i>=0;i--){name=triggerFns[i];fn=window[name];if(typeof(fn)==="function"){window[name]=(function(origFn){return function(){$.watermark.hideAll();return origFn.apply(null,Array.prototype.slice.call(arguments));};})(fn);}}});}})(jQuery);(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);jQuery.cookie=function(key,value,options){if(arguments.length>1&&(value===null||typeof value!=="object")){options=jQuery.extend({},options);if(value===null){options.expires=-1;}
if(typeof options.expires==='number'){var days=options.expires,t=options.expires=new Date();t.setDate(t.getDate()+days);}
return(document.cookie=[encodeURIComponent(key),'=',options.raw?String(value):encodeURIComponent(String(value)),options.expires?'; expires='+options.expires.toUTCString():'',options.path?'; path='+options.path:'',options.domain?'; domain='+options.domain:'',options.secure?'; secure':''].join(''));}
options=value||{};var result,decode=options.raw?function(s){return s;}:decodeURIComponent;return(result=new RegExp('(?:^|; )'+encodeURIComponent(key)+'=([^;]*)').exec(document.cookie))?decode(result[1]):null;};
