/** jQuery UI 1.5.3 * Copyright (c) 2008 Paul Bakaus (ui.jquery.com) * Dual licensed under the MIT (MIT-LICENSE.txt) * and GPL (GPL-LICENSE.txt) licenses. * http://docs.jquery.com/UI */
;(function($){$.ui={plugin:{add:function(a,b,c){var d=$.ui[a].prototype;for(var i in c){d.plugins[i]=d.plugins[i]||[];d.plugins[i].push([b,c[i]])}},call:function(a,b,c){var d=a.plugins[b];if(!d){return}for(var i=0;i<d.length;i++){if(a.options[d[i][0]]){d[i][1].apply(a.element,c)}}}},cssCache:{},css:function(a){if($.ui.cssCache[a]){return $.ui.cssCache[a]}var b=$('<div class="ui-gen">').addClass(a).css({position:'absolute',top:'-5000px',left:'-5000px',display:'block'}).appendTo('body');$.ui.cssCache[a]=!!((!(/auto|default/).test(b.css('cursor'))||(/^[1-9]/).test(b.css('height'))||(/^[1-9]/).test(b.css('width'))||!(/none/).test(b.css('backgroundImage'))||!(/transparent|rgba\(0, 0, 0, 0\)/).test(b.css('backgroundColor'))));try{$('body').get(0).removeChild(b.get(0))}catch(e){}return $.ui.cssCache[a]},disableSelection:function(a){$(a).attr('unselectable','on').css('MozUserSelect','none')},enableSelection:function(a){$(a).attr('unselectable','off').css('MozUserSelect','')},hasScroll:function(e,a){var b=/top/.test(a||"top")?'scrollTop':'scrollLeft',has=false;if(e[b]>0)return true;e[b]=1;has=e[b]>0?true:false;e[b]=0;return has}};var j=$.fn.remove;$.fn.remove=function(){$("*",this).add(this).triggerHandler("remove");return j.apply(this,arguments)};function getter(a,b,c){var d=$[a][b].getter||[];d=(typeof d=="string"?d.split(/,?\s+/):d);return($.inArray(c,d)!=-1)}$.widget=function(g,h){var i=g.split(".")[0];g=g.split(".")[1];$.fn[g]=function(b){var c=(typeof b=='string'),args=Array.prototype.slice.call(arguments,1);if(c&&getter(i,g,b)){var d=$.data(this[0],g);return(d?d[b].apply(d,args):undefined)}return this.each(function(){var a=$.data(this,g);if(c&&a&&$.isFunction(a[b])){a[b].apply(a,args)}else if(!c){$.data(this,g,new $[i][g](this,b))}})};$[i][g]=function(c,d){var f=this;this.widgetName=g;this.widgetBaseClass=i+'-'+g;this.options=$.extend({},$.widget.defaults,$[i][g].defaults,d);this.element=$(c).bind('setData.'+g,function(e,a,b){return f.setData(a,b)}).bind('getData.'+g,function(e,a){return f.getData(a)}).bind('remove',function(){return f.destroy()});this.init()};$[i][g].prototype=$.extend({},$.widget.prototype,h)};$.widget.prototype={init:function(){},destroy:function(){this.element.removeData(this.widgetName)},getData:function(a){return this.options[a]},setData:function(a,b){this.options[a]=b;if(a=='disabled'){this.element[b?'addClass':'removeClass'](this.widgetBaseClass+'-disabled')}},enable:function(){this.setData('disabled',false)},disable:function(){this.setData('disabled',true)}};$.widget.defaults={disabled:false};$.ui.mouse={mouseInit:function(){var a=this;this.element.bind('mousedown.'+this.widgetName,function(e){return a.mouseDown(e)});if($.browser.msie){this._mouseUnselectable=this.element.attr('unselectable');this.element.attr('unselectable','on')}this.started=false},mouseDestroy:function(){this.element.unbind('.'+this.widgetName);($.browser.msie&&this.element.attr('unselectable',this._mouseUnselectable))},mouseDown:function(e){(this._mouseStarted&&this.mouseUp(e));this._mouseDownEvent=e;var a=this,btnIsLeft=(e.which==1),elIsCancel=(typeof this.options.cancel=="string"?$(e.target).parents().add(e.target).filter(this.options.cancel).length:false);if(!btnIsLeft||elIsCancel||!this.mouseCapture(e)){return true}this._mouseDelayMet=!this.options.delay;if(!this._mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){a._mouseDelayMet=true},this.options.delay)}if(this.mouseDistanceMet(e)&&this.mouseDelayMet(e)){this._mouseStarted=(this.mouseStart(e)!==false);if(!this._mouseStarted){e.preventDefault();return true}}this._mouseMoveDelegate=function(e){return a.mouseMove(e)};this._mouseUpDelegate=function(e){return a.mouseUp(e)};$(document).bind('mousemove.'+this.widgetName,this._mouseMoveDelegate).bind('mouseup.'+this.widgetName,this._mouseUpDelegate);return false},mouseMove:function(e){if($.browser.msie&&!e.button){return this.mouseUp(e)}if(this._mouseStarted){this.mouseDrag(e);return false}if(this.mouseDistanceMet(e)&&this.mouseDelayMet(e)){this._mouseStarted=(this.mouseStart(this._mouseDownEvent,e)!==false);(this._mouseStarted?this.mouseDrag(e):this.mouseUp(e))}return!this._mouseStarted},mouseUp:function(e){$(document).unbind('mousemove.'+this.widgetName,this._mouseMoveDelegate).unbind('mouseup.'+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this.mouseStop(e)}return false},mouseDistanceMet:function(e){return(Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance)},mouseDelayMet:function(e){return this._mouseDelayMet},mouseStart:function(e){},mouseDrag:function(e){},mouseStop:function(e){},mouseCapture:function(e){return true}};$.ui.mouse.defaults={cancel:null,distance:1,delay:0}})(jQuery);(function($){$.widget("ui.accordion",{init:function(){var a=this.options;if(a.navigation){var b=this.element.find("a").filter(a.navigationFilter);if(b.length){if(b.filter(a.header).length){a.active=b}else{a.active=b.parent().parent().prev();b.addClass("current")}}}a.headers=this.element.find(a.header);a.active=findActive(a.headers,a.active);if($.browser.msie){this.element.find('a').css('zoom','1')}var c;if(a.fillSpace){c=this.element.parent().height();a.headers.each(function(){c-=$(this).outerHeight()});var d=0;a.headers.next().each(function(){d=Math.max(d,$(this).innerHeight()-$(this).height())}).height(c-d)}else if(a.autoHeight){c=0;a.headers.next().each(function(){c=Math.max(c,$(this).outerHeight())}).height(c)}a.headers.not(a.active||"").next().hide();a.active.parent().andSelf().addClass(a.selectedClass);if(a.event){this.element.bind((a.event)+".accordion",clickHandler)}},activate:function(a){clickHandler.call(this.element[0],{target:findActive(this.options.headers,a)[0]})}});function scopeCallback(a,b){return function(){return a.apply(b,arguments)}};function completed(a){if(!$.data(this,"accordion")){return}var b=$.data(this,"accordion");var c=b.options;c.running=a?0:--c.running;if(c.running){return}if(c.clearStyle){c.toShow.add(c.toHide).css({height:"",overflow:""})}$(this).triggerHandler("accordionchange",[$.event.fix({type:'accordionchange',target:b.element[0]}),c.data],c.change)}function toggle(a,b,c,d,e){var f=$.data(this,"accordion").options;f.toShow=a;f.toHide=b;f.data=c;var g=scopeCallback(completed,this);f.running=b.size()===0?a.size():b.size();if(f.animated){if(!f.alwaysOpen&&d){$.ui.accordion.animations[f.animated]({toShow:jQuery([]),toHide:b,complete:g,down:e,autoHeight:f.autoHeight})}else{$.ui.accordion.animations[f.animated]({toShow:a,toHide:b,complete:g,down:e,autoHeight:f.autoHeight})}}else{if(!f.alwaysOpen&&d){a.toggle()}else{b.hide();a.show()}g(true)}}function clickHandler(a){var b=$.data(this,"accordion").options;if(b.disabled){return false}if(!a.target&&!b.alwaysOpen){b.active.parent().andSelf().toggleClass(b.selectedClass);var c=b.active.next(),data={options:b,newHeader:jQuery([]),oldHeader:b.active,newContent:jQuery([]),oldContent:c},f=(b.active=$([]));toggle.call(this,f,c,data);return false}var d=$(a.target);d=$(d.parents(b.header)[0]||d);var e=d[0]==b.active[0];if(b.running||(b.alwaysOpen&&e)){return false}if(!d.is(b.header)){return}b.active.parent().andSelf().toggleClass(b.selectedClass);if(!e){d.parent().andSelf().addClass(b.selectedClass)}var f=d.next(),c=b.active.next(),data={options:b,newHeader:d,oldHeader:b.active,newContent:f,oldContent:c},down=b.headers.index(b.active[0])>b.headers.index(d[0]);b.active=e?$([]):d;toggle.call(this,f,c,data,e,down);return false};function findActive(a,b){return b!=undefined?typeof b=="number"?a.filter(":eq("+b+")"):a.not(a.not(b)):b===false?$([]):a.filter(":eq(0)")}$.extend($.ui.accordion,{defaults:{selectedClass:"selected",alwaysOpen:true,active:false,animated:'slide',event:"mouseover",header:".head",autoHeight:false,running:0,navigation:true,fillSpace:false,clearStyle:true,navigationFilter:function(){if(this.href.indexOf("#") == this.href.length-1){return false;}return this.href.toLowerCase().substr(this.href.toLowerCase().indexOf("sectionid")+10, 3) == location.href.toLowerCase().substr(location.href.toLowerCase().indexOf("sectionid")+10, 3);}},animations:{slide:function(c,d){c=$.extend({easing:"swing",duration:600},c,d);if(!c.toHide.size()){c.toShow.animate({height:"show"},c);return}var e=c.toHide.height(),showHeight=c.toShow.height(),difference=showHeight/e;c.toShow.css({height:0,overflow:'hidden'}).show();c.toHide.filter(":hidden").each(c.complete).end().filter(":visible").animate({height:"hide"},{step:function(a){var b=(e-a)*difference;if($.browser.msie||$.browser.opera){b=Math.ceil(b)}c.toShow.height(b)},duration:c.duration,easing:c.easing,complete:function(){if(!c.autoHeight){c.toShow.css("height","auto")}c.complete()}})}}});$.fn.activate=function(a){return this.accordion("activate",a)}})(jQuery);

/*Jquery Dimentions*/
/* Copyright (c) 2007 Paul Bakaus (paul.bakaus@googlemail.com) and Brandon Aaron (brandon.aaron@gmail.com || http://brandonaaron.net) * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. * $LastChangedDate: 2007-12-20 08:43:48 -0600 (Thu, 20 Dec 2007) $ * $Rev: 4257 $ * Version: 1.2 * Requires: jQuery 1.2+ */
(function($){$.dimensions={version:'1.2'};$.each(['Height','Width'],function(i,name){$.fn['inner'+name]=function(){if(!this[0])return;var torl=name=='Height'?'Top':'Left',borr=name=='Height'?'Bottom':'Right';return this.is(':visible')?this[0]['client'+name]:num(this,name.toLowerCase())+num(this,'padding'+torl)+num(this,'padding'+borr);};$.fn['outer'+name]=function(options){if(!this[0])return;var torl=name=='Height'?'Top':'Left',borr=name=='Height'?'Bottom':'Right';options=$.extend({margin:false},options||{});var val=this.is(':visible')?this[0]['offset'+name]:num(this,name.toLowerCase())+num(this,'border'+torl+'Width')+num(this,'border'+borr+'Width')+num(this,'padding'+torl)+num(this,'padding'+borr);return val+(options.margin?(num(this,'margin'+torl)+num(this,'margin'+borr)):0);};});$.each(['Left','Top'],function(i,name){$.fn['scroll'+name]=function(val){if(!this[0])return;return val!=undefined?this.each(function(){this==window||this==document?window.scrollTo(name=='Left'?val:$(window)['scrollLeft'](),name=='Top'?val:$(window)['scrollTop']()):this['scroll'+name]=val;}):this[0]==window||this[0]==document?self[(name=='Left'?'pageXOffset':'pageYOffset')]||$.boxModel&&document.documentElement['scroll'+name]||document.body['scroll'+name]:this[0]['scroll'+name];};});$.fn.extend({position:function(){var left=0,top=0,elem=this[0],offset,parentOffset,offsetParent,results;if(elem){offsetParent=this.offsetParent();offset=this.offset();parentOffset=offsetParent.offset();offset.top-=num(elem,'marginTop');offset.left-=num(elem,'marginLeft');parentOffset.top+=num(offsetParent,'borderTopWidth');parentOffset.left+=num(offsetParent,'borderLeftWidth');results={top:offset.top-parentOffset.top,left:offset.left-parentOffset.left};}return results;},offsetParent:function(){var offsetParent=this[0].offsetParent;while(offsetParent&&(!/^body|html$/i.test(offsetParent.tagName)&&$.css(offsetParent,'position')=='static'))offsetParent=offsetParent.offsetParent;return $(offsetParent);}});function num(el,prop){return parseInt($.curCSS(el.jquery?el[0]:el,prop,true))||0;};})(jQuery);
/** jQuery Tooltip plugin 1.3 * http://bassistance.de/jquery-plugins/jquery-plugin-tooltip/* http://docs.jquery.com/Plugins/Tooltip * Copyright (c) 2006 - 2008 Jörn Zaefferer * $Id: jquery.tooltip.js 5741 2008-06-21 15:22:16Z joern.zaefferer $ * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html */
;(function($){var e={},current,title,tID,IE=$.browser.msie&&/MSIE\s(5\.5|6\.)/.test(navigator.userAgent),track=false;$.tooltip={blocked:false,defaults:{delay:200,fade:false,showURL:true,extraClass:"",top:15,left:15,id:"tooltip",opacity:.1},block:function(){$.tooltip.blocked=!$.tooltip.blocked}};$.fn.extend({tooltip:function(a){a=$.extend({},$.tooltip.defaults,a);createHelper(a);return this.each(function(){$.data(this,"tooltip",a);this.tOpacity=e.parent.css("opacity");this.tooltipText=this.title;$(this).removeAttr("title");this.alt=""}).mouseover(save).mouseout(hide).click(hide)},fixPNG:IE?function(){return this.each(function(){var b=$(this).css('backgroundImage');if(b.match(/^url\(["']?(.*\.png)["']?\)$/i)){b=RegExp.$1;$(this).css({'backgroundImage':'none','filter':"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop, src='"+b+"')"}).each(function(){var a=$(this).css('position');if(a!='absolute'&&a!='relative')$(this).css('position','relative')})}})}:function(){return this},unfixPNG:IE?function(){return this.each(function(){$(this).css({'filter':'',backgroundImage:''})})}:function(){return this},hideWhenEmpty:function(){return this.each(function(){$(this)[$(this).html()?"show":"hide"]()})},url:function(){return this.attr('href')||this.attr('src')}});function createHelper(a){if(e.parent)return;e.parent=$('<div id="'+a.id+'"><h3></h3><div class="body"></div><div class="url"></div><div class="bottom"></div></div>').appendTo(document.body).hide();if($.fn.bgiframe)e.parent.bgiframe();e.title=$('h3',e.parent);e.body=$('div.body',e.parent);e.url=$('div.url',e.parent)}function settings(a){return $.data(a,"tooltip")}function handle(a){if(settings(this).delay)tID=setTimeout(show,settings(this).delay);else show();track=!!settings(this).track;$(document.body).bind('mousemove',update);update(a)}function save(){if($.tooltip.blocked||this==current||(!this.tooltipText&&!settings(this).bodyHandler))return;current=this;title=this.tooltipText;if(settings(this).bodyHandler){e.title.hide();var a=settings(this).bodyHandler.call(this);if(a.nodeType||a.jquery){e.body.empty().append(a)}else{e.body.html(a)}e.body.show()}else if(settings(this).showBody){var b=title.split(settings(this).showBody);e.title.html(b.shift()).show();e.body.empty();for(var i=0,part;(part=b[i]);i++){if(i>0)e.body.append("<br/>");e.body.append(part)}e.body.hideWhenEmpty()}else{e.title.html(title).show();e.body.hide()}if(settings(this).showURL&&$(this).url())e.url.html($(this).url().replace('http://','')).show();else e.url.hide();e.parent.addClass(settings(this).extraClass);if(settings(this).fixPNG)e.parent.fixPNG();handle.apply(this,arguments)}function show(){tID=null;if((!IE||!$.fn.bgiframe)&&settings(current).fade){if(e.parent.is(":animated"))e.parent.stop().show().fadeTo(settings(current).fade,current.tOpacity);else e.parent.is(':visible')?e.parent.fadeTo(settings(current).fade,current.tOpacity):e.parent.fadeIn(settings(current).fade)}else{e.parent.show()}update()}function update(a){if($.tooltip.blocked)return;if(a&&a.target.tagName=="OPTION"){return}if(!track&&e.parent.is(":visible")){$(document.body).unbind('mousemove',update)}if(current==null){$(document.body).unbind('mousemove',update);return}e.parent.removeClass("viewport-right").removeClass("viewport-bottom");var b=e.parent[0].offsetLeft;var c=e.parent[0].offsetTop;if(a){b=a.pageX+settings(current).left;c=a.pageY+settings(current).top;var d='auto';if(settings(current).positionLeft){d=$(window).width()-b;b='auto'}e.parent.css({left:b,right:d,top:c})}var v=viewport(),h=e.parent[0];if(v.x+v.cx<h.offsetLeft+h.offsetWidth){b-=h.offsetWidth+20+settings(current).left;e.parent.css({left:b+'px'}).addClass("viewport-right")}if(v.y+v.cy<h.offsetTop+h.offsetHeight){c-=h.offsetHeight+20+settings(current).top;e.parent.css({top:c+'px'}).addClass("viewport-bottom")}}function viewport(){return{x:$(window).scrollLeft(),y:$(window).scrollTop(),cx:$(window).width(),cy:$(window).height()}}function hide(a){if($.tooltip.blocked)return;if(tID)clearTimeout(tID);current=null;var b=settings(this);function complete(){e.parent.removeClass(b.extraClass).hide().css("opacity","")}if((!IE||!$.fn.bgiframe)&&b.fade){if(e.parent.is(':animated'))e.parent.stop().fadeTo(b.fade,0,complete);else e.parent.stop().fadeOut(b.fade,complete)}else complete();if(settings(this).fixPNG)e.parent.unfixPNG()}})(jQuery);

/** jQuery Expander plugin * Version 0.4  (12/09/2008) * @requires jQuery v1.1.1+ * * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html * */
(function($){$.fn.expander=function(options){var opts=$.extend({},$.fn.expander.defaults,options);var delayedCollapse;return this.each(function(){var $this=$(this);var o=$.meta?$.extend({},opts,$this.data()):opts;var cleanedTag,startTags,endTags;var allText=$this.html();var startText=allText.slice(0,o.slicePoint).replace(/\w+$/,'');startTags=startText.match(/<\w[^>]*>/g);if(startTags){startText=allText.slice(0,o.slicePoint+startTags.join('').length).replace(/\w+$/,'');}
if(startText.lastIndexOf('<')>startText.lastIndexOf('>')){startText=startText.slice(0,startText.lastIndexOf('<'));}
var endText=allText.slice(startText.length);if(!$('span.details',this).length){if(endText.replace(/\s+$/,'').split(' ').length<o.widow){return;}
if(endText.indexOf('</')>-1){endTags=endText.match(/<(\/)?[^>]*>/g);for(var i=0;i<endTags.length;i++){if(endTags[i].indexOf('</')>-1){var startTag,startTagExists=false;for(var j=0;j<i;j++){startTag=endTags[j].slice(0,endTags[j].indexOf(' ')).replace(/(\w)$/,'$1>');if(startTag==rSlash(endTags[i])){startTagExists=true;}}
if(!startTagExists){startText=startText+endTags[i];var matched=false;for(var s=startTags.length-1;s>=0;s--){if(startTags[s].slice(0,startTags[s].indexOf(' ')).replace(/(\w)$/,'$1>')==rSlash(endTags[i])&&matched==false){cleanedTag=cleanedTag?startTags[s]+cleanedTag:startTags[s];matched=true;}};}}}
endText=cleanedTag&&cleanedTag+endText||endText;}
$this.html([startText,'<span class="readmore">',o.expandPrefix,'<a href="#">',o.expandText,'</a>','</span>','<span class="details">',endText,'</span>'].join(''));}
var $thisDetails=$('span.details',this),$readMore=$('span.readmore',this);$thisDetails.hide();$readMore.find('a').click(function(){$readMore.hide();if(o.expandEffect==='show'&&!o.expandSpeed){o.beforeExpand($this);$thisDetails.show();o.afterExpand($this);delayCollapse(o,$thisDetails);}else{o.beforeExpand($this);$thisDetails[o.expandEffect](o.expandSpeed,function(){$thisDetails.css({zoom:''});o.afterExpand($this);delayCollapse(o,$thisDetails);});}
return false;});if(o.userCollapse){$this.find('span.details').append('<span class="readmore">'+o.userCollapsePrefix+'<a href="#">'+o.userCollapseText+'</a></span>');$this.find('span.readmore a').click(function(){clearTimeout(delayedCollapse);var $detailsCollapsed=$(this).parents('span.details');reCollapse($detailsCollapsed);o.onCollapse($this,true);return false;});}});function reCollapse(el){el.hide().prev('span.readmore').show();}
function delayCollapse(option,$collapseEl){if(option.collapseTimer){delayedCollapse=setTimeout(function(){reCollapse($collapseEl);option.onCollapse($collapseEl.parent(),false);},option.collapseTimer);}}
function rSlash(rString){return rString.replace(/\//,'');}};$.fn.expander.defaults={slicePoint:250,widow:4,expandText:'READ MORE',expandPrefix:'... ',collapseTimer:0,expandEffect:'fadeIn',expandSpeed:'',userCollapse:true,userCollapseText:'COLLAPSE TEXT',userCollapsePrefix:'... ',beforeExpand:function($thisEl){},afterExpand:function($thisEl){},onCollapse:function($thisEl,byUser){}};})(jQuery);

///*function for animated scrolling*/
//$(document).ready(function() {
//function filterPath(string) {
//return string
//  .replace(/^\//,'')
//  .replace(/(index|default).[a-zA-Z]{3,4}$/,'')
//  .replace(/\/$/,'');
//}
//var locationPath = filterPath(location.pathname);
//$('a[href*=#]').each(function() {
//  var thisPath = filterPath(this.pathname) || locationPath;
//  if (  locationPath == thisPath
//  && (location.hostname == this.hostname || !this.hostname)
//  && this.hash.replace(/#/,'') ) {
//	var $target = $(this.hash), target = this.hash;
//	if (target) {
//	  var targetOffset = $target.offset().top;
//	  $(this).click(function(event) {
//		event.preventDefault();
//		$('html, body').animate({scrollTop: targetOffset}, 400, function() {
//		  location.hash = target;
//		});
//	  });
//	}
//  }
//});
//});

function userAgent(){return navigator.userAgent;};
function appVersion(){return navigator.appVersion;};

function sendToJavaScript(title, description) 
{
    document.getElementById('galleryTitleStyle').innerHTML = title;
	document.getElementById('galleryDescriptionStyle').innerHTML = description;
}

