$(document).ready(function()
{ var NavFactory=hzdg.nav.NavFactory;var CaseNavModel=hzdg.nav.model.CaseNavModel;var CaseNavItemModel=hzdg.nav.model.CaseNavItemModel;var element=$("ul.header-nav");var headerNav=new NavFactory(element).create();$(headerNav.items()).each(function(i,item){var subElement=$("> ul.header-subnav",item.element());if(subElement.length)
{var headerSubnav=new NavFactory(subElement).create();item.subnav(headerSubnav);$(headerSubnav.items()).each(function(i,item){var subElement=$("> ul.case-nav",item.element());if(subElement.length)
{var caseNav=new NavFactory(subElement).create();item.subnav(caseNav);}});}});headerNav.show();});window.getset=window.getset||{};window.getset.create=function(getter,setter)
{var fn=function()
{if(arguments.length==0)
{if(arguments.callee.get)
return arguments.callee.get.call(this);else
throw new Error("No getter is defined.");}
else if(arguments.length==1)
{if(arguments.callee.set)
{arguments.callee.set.call(this,arguments[0]);return arguments.callee.get.call(this);}
else
{throw new Error("No setter is defined.");}}
else
{throw new Error("Incorrect number of arguments.");}}
fn.get=getter;fn.set=setter;return fn;};jQuery.easing['jswing']=jQuery.easing['swing'];jQuery.extend(jQuery.easing,{def:'easeOutQuad',swing:function(x,t,b,c,d){return jQuery.easing[jQuery.easing.def](x,t,b,c,d);},easeInQuad:function(x,t,b,c,d){return c*(t/=d)*t+b;},easeOutQuad:function(x,t,b,c,d){return-c*(t/=d)*(t-2)+b;},easeInOutQuad:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t+b;return-c/2*((--t)*(t-2)-1)+b;},easeInCubic:function(x,t,b,c,d){return c*(t/=d)*t*t+b;},easeOutCubic:function(x,t,b,c,d){return c*((t=t/d-1)*t*t+1)+b;},easeInOutCubic:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t+b;return c/2*((t-=2)*t*t+2)+b;},easeInQuart:function(x,t,b,c,d){return c*(t/=d)*t*t*t+b;},easeOutQuart:function(x,t,b,c,d){return-c*((t=t/d-1)*t*t*t-1)+b;},easeInOutQuart:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t+b;return-c/2*((t-=2)*t*t*t-2)+b;},easeInQuint:function(x,t,b,c,d){return c*(t/=d)*t*t*t*t+b;},easeOutQuint:function(x,t,b,c,d){return c*((t=t/d-1)*t*t*t*t+1)+b;},easeInOutQuint:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t*t+b;return c/2*((t-=2)*t*t*t*t+2)+b;},easeInSine:function(x,t,b,c,d){return-c*Math.cos(t/d*(Math.PI/2))+c+b;},easeOutSine:function(x,t,b,c,d){return c*Math.sin(t/d*(Math.PI/2))+b;},easeInOutSine:function(x,t,b,c,d){return-c/2*(Math.cos(Math.PI*t/d)-1)+b;},easeInExpo:function(x,t,b,c,d){return(t==0)?b:c*Math.pow(2,10*(t/d-1))+b;},easeOutExpo:function(x,t,b,c,d){return(t==d)?b+c:c*(-Math.pow(2,-10*t/d)+1)+b;},easeInOutExpo:function(x,t,b,c,d){if(t==0)return b;if(t==d)return b+c;if((t/=d/2)<1)return c/2*Math.pow(2,10*(t-1))+b;return c/2*(-Math.pow(2,-10*--t)+2)+b;},easeInCirc:function(x,t,b,c,d){return-c*(Math.sqrt(1-(t/=d)*t)-1)+b;},easeOutCirc:function(x,t,b,c,d){return c*Math.sqrt(1-(t=t/d-1)*t)+b;},easeInOutCirc:function(x,t,b,c,d){if((t/=d/2)<1)return-c/2*(Math.sqrt(1-t*t)-1)+b;return c/2*(Math.sqrt(1-(t-=2)*t)+1)+b;},easeInElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4;}
else var s=p/(2*Math.PI)*Math.asin(c/a);return-(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;},easeOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4;}
else var s=p/(2*Math.PI)*Math.asin(c/a);return a*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+c+b;},easeInOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d/2)==2)return b+c;if(!p)p=d*(.3*1.5);if(a<Math.abs(c)){a=c;var s=p/4;}
else var s=p/(2*Math.PI)*Math.asin(c/a);if(t<1)return-.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;return a*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*.5+c+b;},easeInBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;return c*(t/=d)*t*((s+1)*t-s)+b;},easeOutBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b;},easeInOutBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;if((t/=d/2)<1)return c/2*(t*t*(((s*=(1.525))+1)*t-s))+b;return c/2*((t-=2)*t*(((s*=(1.525))+1)*t+s)+2)+b;},easeInBounce:function(x,t,b,c,d){return c-jQuery.easing.easeOutBounce(x,d-t,0,c,d)+b;},easeOutBounce:function(x,t,b,c,d){if((t/=d)<(1/2.75)){return c*(7.5625*t*t)+b;}else if(t<(2/2.75)){return c*(7.5625*(t-=(1.5/2.75))*t+.75)+b;}else if(t<(2.5/2.75)){return c*(7.5625*(t-=(2.25/2.75))*t+.9375)+b;}else{return c*(7.5625*(t-=(2.625/2.75))*t+.984375)+b;}},easeInOutBounce:function(x,t,b,c,d){if(t<d/2)return jQuery.easing.easeInBounce(x,t*2,0,c,d)*.5+b;return jQuery.easing.easeOutBounce(x,t*2-d,0,c,d)*.5+c*.5+b;}});(function($){var hzdg=(window.hzdg||(window.hzdg={}));hzdg.utils=hzdg.utils||(hzdg.utils={});var Dispatcher=hzdg.utils.Dispatcher=function()
{}
Dispatcher.prototype.dispatcher=function()
{return this._dispatcher;}
Dispatcher.prototype.initialize=function(element)
{this._dispatcher=$(this);return this;}})(jQuery);(function($){var hzdg=(window.hzdg||(window.hzdg={}));hzdg.utils=hzdg.utils||(hzdg.utils={});var Dispatcher=hzdg.utils.Dispatcher;var Selectable=hzdg.utils.Selectable=function()
{Dispatcher.call(this);this._isSelected=false;}
Selectable.prototype=new Dispatcher();Selectable.prototype.constructor=Selectable;
Selectable.prototype.initialize=function(selected)
{Dispatcher.prototype.initialize.call(this);if(selected!==undefined)
this.setIsSelected(selected);return this;}
Selectable.prototype.isSelected=function()
{return this._isSelected;}
Selectable.prototype.setIsSelected=function(value)
{if(value!=this.isSelected())
{this._isSelected=value;var event=new $.Event("isSelectedChange");event.isSelected=value;this.dispatcher().trigger(event);}}})(jQuery);(function($){var hzdg=(window.hzdg||(window.hzdg={}));hzdg.utils=hzdg.utils||(hzdg.utils={});var SingleSelectionList=hzdg.utils.SingleSelectionList=function()
{hzdg.utils.Dispatcher.call(this);this._items=[];this._selectedItemIndex=0;this._itemSelectedChangeHandler=$.proxy(SingleSelectionList.prototype._itemSelectedChangeHandler,this);this._updateItemIsSelected=$.proxy(SingleSelectionList.prototype._updateItemIsSelected,this);}
SingleSelectionList.prototype=new hzdg.utils.Dispatcher();SingleSelectionList.prototype.constructor=SingleSelectionList;
SingleSelectionList.prototype.initialize=function(items)
{hzdg.utils.Dispatcher.prototype.initialize.call(this);if(items)
{for(var i=0,item;item=items[i];i++)
{this.add(item);}
this._updateItemIsSelected(this.getSelectedItem(),true);}
return this;}
SingleSelectionList.prototype.add=function(item)
{this._items.push(item);if(item.dispatcher&&item.setIsSelected)
{item.dispatcher().bind('isSelectedChange',this._itemSelectedChangeHandler);if(item==this.getSelectedItem())
this._updateItemIsSelected(item,true);}}
SingleSelectionList.prototype.getItemAt=function(index)
{if(index<0||index>=this.getCount())
return null;return this._items[index];}
SingleSelectionList.prototype.getCount=function()
{return this._items.length;}
SingleSelectionList.prototype.indexOf=function(item)
{return $.inArray(item,this._items);}
SingleSelectionList.prototype.getSelectedItem=function()
{return this._items[this._selectedItemIndex]||null;}
SingleSelectionList.prototype.setSelectedItem=function(value)
{this.setSelectedItemIndex(this.indexOf(value));}
SingleSelectionList.prototype.getSelectedItemIndex=function()
{return this._selectedItemIndex;}
SingleSelectionList.prototype.setSelectedItemIndex=function(value)
{var newIndex=value;var oldIndex=this._selectedItemIndex;if(newIndex!=oldIndex)
{var oldItem=this.getSelectedItem();this._selectedItemIndex=newIndex;var newItem=this.getSelectedItem();this._updateItemIsSelected(oldItem,false);this._updateItemIsSelected(newItem,true);var event=new $.Event("selectedItemChange");event.oldIndex=oldIndex;event.newIndex=newIndex;event.oldItem=oldItem;event.newItem=newItem;this.dispatcher().trigger(event);}}
SingleSelectionList.prototype._itemSelectedChangeHandler=function(event)
{if(event.currentTarget.isSelected())
this.setSelectedItem(event.currentTarget);}
SingleSelectionList.prototype._updateItemIsSelected=function(item,isSelected)
{if(item&&item.setIsSelected)
{item.setIsSelected(isSelected);}}})(jQuery);(function($){var hzdg=(window.hzdg||(window.hzdg={}));hzdg.nav=hzdg.nav||(hzdg.nav={});var Dispatcher=hzdg.utils.Dispatcher;var BaseNav=hzdg.nav.BaseNav=function()
{Dispatcher.call(this);};BaseNav.prototype=new Dispatcher();BaseNav.prototype.constructor=BaseNav;
BaseNav.prototype.element=function()
{return this._element;}
BaseNav.prototype.items=function()
{return this._items;}
BaseNav.prototype.initialize=function(element,items)
{Dispatcher.prototype.initialize.call(this);this._items=items;this._isHidden=true;this._element=$(element);this._element.css({'display':'none'});return this;}
BaseNav.prototype.show=function()
{this._element.stop(true,true).fadeIn();}
BaseNav.prototype.hide=function()
{this._element.stop(true,true).fadeOut();}
BaseNav.prototype.toggle=function(){if(this._isHidden)
{this._isHidden=false;this.show();}
else
{this._isHidden=true;this.hide();}
return!this._isHidden;}})(jQuery);(function($){var hzdg=(window.hzdg||(window.hzdg={}));hzdg.nav=hzdg.nav||(hzdg.nav={});var Dispatcher=hzdg.utils.Dispatcher;var BaseNavItem=hzdg.nav.BaseNavItem=function()
{Dispatcher.call(this);this._selected=false;this._subnav=null;};BaseNavItem.prototype=new Dispatcher();BaseNavItem.prototype.constructor=BaseNavItem;
BaseNavItem.prototype.selected=getset.create();BaseNavItem.prototype.selected.get=function()
{return this._selected;}
BaseNavItem.prototype.selected.set=function(value)
{var oldValue=this._selected;if(value!=oldValue)
this._updateSelectedState((this._selected=value));}
BaseNavItem.prototype.element=function()
{return this._element;}
BaseNavItem.prototype.subnav=getset.create();BaseNavItem.prototype.subnav.get=function()
{return this._subnav;}
BaseNavItem.prototype.subnav.set=function(value)
{if(value&&this.selected())
value.show();return(this._subnav=value);}
BaseNavItem.prototype.initialize=function(element,subnav)
{Dispatcher.prototype.initialize.call(this);this._element=$(element);if(subnav)
this.subnav(subnav);$(element).bind('mouseleave',$.proxy(this._rollOutHandler,this));$(element).bind('mouseenter',$.proxy(this._rollOverHandler,this));return this;}
BaseNavItem.prototype._rollOutHandler=function(event)
{this.selected(false);}
BaseNavItem.prototype._rollOverHandler=function(event)
{this.selected(true);}
BaseNavItem.prototype._updateSelectedState=function(value)
{if(value)
{this._element.addClass('selected');if(this.subnav())
this.subnav().show();}
else
{this._element.removeClass('selected');if(this.subnav())
this.subnav().hide();}}})(jQuery);(function($){var hzdg=window.hzdg||(window.hzdg={});hzdg.nav=hzdg.nav||(hzdg.nav={});hzdg.nav.model=hzdg.nav.model||(hzdg.nav.model={});var SingleSelectionList=hzdg.utils.SingleSelectionList;var CaseNavModel=hzdg.nav.model.CaseNavModel=function()
{SingleSelectionList.call(this);}
CaseNavModel.prototype=new SingleSelectionList();CaseNavModel.prototype.constructor=CaseNavModel;})(jQuery);(function($){var hzdg=window.hzdg||(window.hzdg={});hzdg.nav=hzdg.nav||(hzdg.nav={});hzdg.nav.model=hzdg.nav.model||(hzdg.nav.model={});var Selectable=hzdg.utils.Selectable;var CaseNavItemModel=hzdg.nav.model.CaseNavItemModel=function()
{Selectable.call(this);}
CaseNavItemModel.prototype=new Selectable();CaseNavItemModel.prototype.constructor=CaseNavItemModel;})(jQuery);(function($){var hzdg=(window.hzdg||(window.hzdg={}));hzdg.nav=hzdg.nav||(hzdg.nav={});var BaseNav=hzdg.nav.BaseNav;var CaseNav=hzdg.nav.CaseNav=function()
{BaseNav.call(this);};CaseNav.prototype=new BaseNav();CaseNav.prototype.constructor=CaseNav;CaseNav._visible=false;CaseNav.hide=function(){CaseNav._visible=false;if(CaseNav._instance)
CaseNav._instance.hide();}
CaseNav.prototype.initialize=function(element,items)
{this._parent=element.parent();if(!CaseNav._element)
{CaseNav._element=element;}
else
{element.remove();element.children().remove();element=CaseNav._element;}
return BaseNav.prototype.initialize.call(this,element,items);}
CaseNav.prototype.show=function()
{CaseNav._instance=this;this._parent.append(this._element);this._element.children().stop(true,true).remove();var height=0;$(this.items()).each($.proxy(function(i,item)
{var itemElement=item.element();this._element.append(itemElement);this._element.show();height+=itemElement.height();this._element.hide();$(itemElement).stop().hide().delay(i*100).fadeIn();},this));if(!CaseNav._visible)
{this._element.css('height',height);this._element.stop(true,true).slideDown(300);CaseNav._visible=true;}
else
{this._element.stop(true,true).show().animate({'height':height});}}
CaseNav.prototype.hide=function()
{if(CaseNav._visible)
this._element.hide();else
this._element.stop(true,true).slideUp('fast');}})(jQuery);(function($){var hzdg=(window.hzdg||(window.hzdg={}));hzdg.nav=hzdg.nav||(hzdg.nav={});var BaseNavItem=hzdg.nav.BaseNavItem;var CaseNavItem=hzdg.nav.CaseNavItem=function()
{BaseNavItem.call(this);};CaseNavItem.prototype=new BaseNavItem();CaseNavItem.prototype.constructor=CaseNavItem;})(jQuery);(function($){var hzdg=(window.hzdg||(window.hzdg={}));hzdg.nav=hzdg.nav||(hzdg.nav={});var BaseNav=hzdg.nav.BaseNav;var SingleSelectionList=hzdg.utils.SingleSelectionList;var HeaderNav=hzdg.nav.HeaderNav=function()
{BaseNav.call(this);};HeaderNav.prototype=new BaseNav();HeaderNav.prototype.constructor=HeaderNav;
HeaderNav.prototype.initialize=function(element,items)
{BaseNav.prototype.initialize.call(this,element,items);var model=new SingleSelectionList().initialize();$(items).each(function(i,item){model.add(item.model());});this._model=model;this._model.setSelectedItemIndex(-1);return this;}
HeaderNav.prototype.show=function()
{this._element.show();}})(jQuery);(function($){var hzdg=(window.hzdg||(window.hzdg={}));hzdg.nav=hzdg.nav||(hzdg.nav={});var BaseNavItem=hzdg.nav.BaseNavItem;var Selectable=hzdg.utils.Selectable;var HeaderNavItem=hzdg.nav.HeaderNavItem=function()
{BaseNavItem.call(this);};HeaderNavItem.prototype=new BaseNavItem();HeaderNavItem.prototype.constructor=HeaderNavItem;HeaderNavItem.prototype.initialize=function(element,subnav)
{BaseNavItem.prototype.initialize.call(this,element,subnav);this._model=new Selectable().initialize(this._element.hasClass('selected'));this._model.dispatcher().bind('isSelectedChange',$.proxy(this._selectedChangeHandler,this));this._element.bind('click',$.proxy(this._clickHandler,this));return this;}
HeaderNavItem.prototype.model=function()
{return this._model;}
HeaderNavItem.prototype._updateSelectedState=function(value)
{this._model.setIsSelected(value);return BaseNavItem.prototype._updateSelectedState.call(this,value);}
HeaderNavItem.prototype._clickHandler=function(event)
{if(this.subnav())
this.selected(this.subnav().toggle());else
this.selected(!this.selected);}
HeaderNavItem.prototype._selectedChangeHandler=function(event)
{this.selected(event.isSelected);}})(jQuery);(function($){var hzdg=(window.hzdg||(window.hzdg={}));hzdg.nav=hzdg.nav||(hzdg.nav={});var BaseNav=hzdg.nav.BaseNav;var CaseNav=hzdg.nav.CaseNav;var HeaderSubnav=hzdg.nav.HeaderSubnav=function()
{BaseNav.call(this);};HeaderSubnav.prototype=new BaseNav();HeaderSubnav.prototype.constructor=HeaderSubnav;HeaderSubnav.prototype.initialize=function(element,items)
{BaseNav.prototype.initialize.call(this,element,items);this._element.bind('mouseleave',$.proxy(this.rollOutHandler,this));return this;}
HeaderSubnav.prototype.rollOutHandler=function(event)
{CaseNav.hide();}
HeaderSubnav.prototype.hide=function()
{this._element.hide();}})(jQuery);(function($){var hzdg=(window.hzdg||(window.hzdg={}));hzdg.nav=hzdg.nav||(hzdg.nav={});var BaseNavItem=hzdg.nav.BaseNavItem;var HeaderSubnavItem=hzdg.nav.HeaderSubnavItem=function()
{BaseNavItem.call(this);};HeaderSubnavItem.prototype=new BaseNavItem();HeaderSubnavItem.prototype.constructor=HeaderSubnavItem;HeaderSubnavItem.prototype._updateSelectedState=function(value)
{if(value)
{this._element.addClass('selected');if(this.subnav())
this.subnav().show();}
else
{this._element.removeClass('selected');}}})(jQuery);(function($){var hzdg=window.hzdg||(window.hzdg={});hzdg.nav=hzdg.nav||(hzdg.nav={}); var HeaderNav=hzdg.nav.HeaderNav;var HeaderNavItem=hzdg.nav.HeaderNavItem;var HeaderSubnav=hzdg.nav.HeaderSubnav;var HeaderSubnavItem=hzdg.nav.HeaderSubnavItem;var CaseNav=hzdg.nav.CaseNav;var CaseNavItem=hzdg.nav.CaseNavItem;var CLASS_MAP={'header-nav':HeaderNav,'header-nav-item':HeaderNavItem,'header-subnav':HeaderSubnav,'header-subnav-item':HeaderSubnavItem,'case-nav':CaseNav,'case-nav-item':CaseNavItem};var NavFactory=hzdg.nav.NavFactory=function(element)
{this._nav=null;if(element)
this._parse(element);}
NavFactory.prototype.create=function(element)
{if(element)
this._parse(element);return this._nav;}
NavFactory.prototype._parse=function(element)
{this._nav=null;if(element.length)
{var navClass;var cls;var classList=element.attr('class').split(/\s+/);$.each(classList,function(i,c)
{if((navClass=CLASS_MAP[(cls=c)]))
return false;});if(navClass)
{var items=[];var itemElements=$('> li.'+cls+'-item',element);itemElements.each(function(i,itemElement)
{var navItemClass;var classList=$(itemElement).attr('class').split(/\s+/);$.each(classList,function(i,c)
{if((navItemClass=CLASS_MAP[c]))
return false;});if(navItemClass)
{items.push(new navItemClass().initialize(itemElement));}});this._nav=new navClass().initialize(element,items);}}
return this._nav;}})(jQuery);(function($){var hzdg=(window.hzdg||(window.hzdg={}));hzdg.gallery=hzdg.gallery||(hzdg.gallery={});hzdg.gallery.model=hzdg.gallery.model||(hzdg.gallery.model={});var GalleryModel=hzdg.gallery.model.GalleryModel=function()
{hzdg.utils.SingleSelectionList.call(this);}
GalleryModel.prototype=new hzdg.utils.SingleSelectionList();GalleryModel.prototype.constructor=GalleryModel;
GalleryModel.prototype.next=function()
{var nextItemIndex=(this.getSelectedItemIndex()+1)%this.getCount();this.setSelectedItemIndex(nextItemIndex);}
GalleryModel.prototype.previous=function()
{var count=this.getCount();var previousItemIndex=(this.getSelectedItemIndex()+count-1)%count;this.setSelectedItemIndex(previousItemIndex);}})(jQuery);(function($){var hzdg=(window.hzdg||(window.hzdg={}));hzdg.gallery=hzdg.gallery||(hzdg.gallery={});hzdg.gallery.model=hzdg.gallery.model||(hzdg.gallery.model={});var GalleryItemModel=hzdg.gallery.model.GalleryItemModel=function()
{hzdg.utils.Selectable.call(this);this._url=null;this._caption=null;}
GalleryItemModel.prototype=new hzdg.utils.Selectable();GalleryItemModel.prototype.constructor=GalleryItemModel;
GalleryItemModel.prototype.getUrl=function()
{return this._url;}
GalleryItemModel.prototype.getCaption=function()
{return this._caption;}
GalleryItemModel.prototype.initialize=function(url,caption)
{hzdg.utils.Selectable.prototype.initialize.call(this);this._url=url;this._caption=caption;return this;}})(jQuery);(function($){var hzdg=window.hzdg||(window.hzdg={});hzdg.gallery=hzdg.gallery||(hzdg.gallery={});hzdg.gallery.model=hzdg.gallery.model||(hzdg.gallery.model={});var GalleryModel=hzdg.gallery.model.GalleryModel;var GalleryItemModel=hzdg.gallery.model.GalleryItemModel;var GalleryModelFactory=hzdg.gallery.model.GalleryModelFactory=function(data)
{this._model=null;if(data)
this._parse(data);};
GalleryModelFactory.prototype.create=function(data)
{if(data)
this._parse(data);return this._model;}
GalleryModelFactory.prototype._parse=function(data)
{this._model=null;if(data)
{var model=new GalleryModel().initialize();$(data).each(function(i,item)
{model.add(new GalleryItemModel().initialize(item.url,item.caption));});this._model=model;}}})(jQuery);(function($){var hzdg=(window.hzdg||(window.hzdg={}));hzdg.gallery=hzdg.gallery||(hzdg.gallery={});hzdg.gallery.view=hzdg.gallery.view||(hzdg.gallery.view={});var GalleryItem=hzdg.gallery.view.GalleryItem=function()
{hzdg.utils.Dispatcher.call(this);this._element=null;this._model=null;this._x=0;this._y=0;this._callbacks={};}
GalleryItem.prototype=new hzdg.utils.Dispatcher();GalleryItem.prototype.constructor=GalleryItem;
GalleryItem.prototype.element=function()
{return this._element;}
GalleryItem.prototype.height=function()
{return this._element.height();}
GalleryItem.prototype.model=getset.create();GalleryItem.prototype.model.get=function()
{return this._model;}
GalleryItem.prototype.model.set=function(value)
{var oldValue=value;if(oldValue!==value)
{this._model=value;}}
GalleryItem.prototype.width=function()
{return this._element.width();}
GalleryItem.prototype.x=getset.create();GalleryItem.prototype.x.get=function()
{return this._x;}
GalleryItem.prototype.x.set=function(value)
{var oldValue=this._x;if(value!=oldValue)
{this._x=value;this._element.css('left',value);}}
GalleryItem.prototype.y=getset.create();GalleryItem.prototype.y.get=function()
{return this._y;}
GalleryItem.prototype.y.set=function(value)
{var oldValue=this._y;if(value!=oldValue)
{this._y=value;this._element.css('left',value);}}
GalleryItem.prototype.addReadyHandler=function(fn)
{var cb=$.proxy(function(){fn(this);},this);this._callbacks[fn]=cb;this._element.bind('load',cb);var el=this._element[0];if(el.complete||el.complete===undefined)
cb();}
GalleryItem.prototype.hide=function(hideImmediately)
{if(hideImmediately)
this._element.stop(true,true).hide();else
this._element.stop(true,true).fadeOut(1000);return this;}
GalleryItem.prototype.initialize=function(element,model)
{hzdg.utils.Dispatcher.prototype.initialize.call(this);this._element=$(element);this._x=this._element.css('left')||0;this._y=this._element.css('top')||0;this._model=model;this.hide(true);return this;}
GalleryItem.prototype.removeReadyHandler=function(fn)
{this._element.unbind('load',this._callbacks[fn]);}
GalleryItem.prototype.show=function(showImmediately)
{if(showImmediately)
this._element.stop(true,true).show();else
this._element.stop(true,true).fadeIn(1000);return this;}})(jQuery);(function($){var hzdg=(window.hzdg||(window.hzdg={}));hzdg.gallery=hzdg.gallery||(hzdg.gallery={});hzdg.gallery.view=hzdg.gallery.view||(hzdg.gallery.view={});var GalleryItem=hzdg.gallery.view.GalleryItem;var Gallery=hzdg.gallery.view.Gallery=function()
{hzdg.utils.Dispatcher.call(this);this._model=null;this._element=null;this._currentItem=null;this._items=null;this._autoPlay=false;this._galleryItemClass=GalleryItem;};Gallery.prototype=new hzdg.utils.Dispatcher();Gallery.prototype.constructor=Gallery;
Gallery.prototype.autoPlay=getset.create();Gallery.prototype.autoPlay.get=function()
{return this._autoPlay;}
Gallery.prototype.autoPlay.set=function(value)
{var oldValue=this._autoPlay;if(oldValue!=value)
{this._autoPlay=value;if(value)
this._startTimer();else
this._stopTimer();}}
Gallery.prototype.galleryItemClass=getset.create();Gallery.prototype.galleryItemClass.get=function()
{return this._galleryItemClass;}
Gallery.prototype.galleryItemClass.set=function(value)
{if($.isFunction(value))
this._galleryItemClass=value;else
throw"Invalid type "+typeof value+" for galleryItemClass!";}
Gallery.prototype.getItemFor=function(model)
{var index=this._model.indexOf(model);var item=this._items[index];if(!item)
{var element;var match=$("img[src$='"+model.getUrl()+"'][caption='"+model.getCaption()+"']");if(match.length)
{element=match[0];}
else
{element=$('<img src="'+model.getUrl()+'" alt="'+model.getCaption()+'" />');this._element.append(element);}
var cls=this.galleryItemClass();item=new cls().initialize(element,model);this._items[index]=item;}
return item;}
Gallery.prototype.selectedItemChangeHandler=function(event)
{this._stopTimer();if(this._currentItem.model()!=event.newItem)
{var newItem=this.getItemFor(event.newItem);newItem.addReadyHandler(this._itemReadyHandler);}}
Gallery.prototype.showItem=function(item)
{if(item.model()!=this._model.getSelectedItem())
{this._model.setSelectedItem(item.model());}
else
{if(this._currentItem.model()!=item.model())
{this._currentItem.hide();this._currentItem=item;}
item.show();}}
Gallery.prototype.initialize=function(element,model,items,autoPlay)
{hzdg.utils.Dispatcher.prototype.initialize.call(this);this._model=model;this._next=$.proxy(model.next,model)
if(autoPlay!==undefined)
this.autoPlay(autoPlay);this._items=items;this._element=$(element);this._currentItem=this.getItemFor(this._model.getItemAt(0));this._itemReadyHandler=$.proxy(this._itemReadyHandler,this);this._currentItem.addReadyHandler(this._itemReadyHandler);this.selectedItemChangeHandler=$.proxy(this.selectedItemChangeHandler,this);this._model.dispatcher().bind('selectedItemChange',this.selectedItemChangeHandler);return this;}
Gallery.prototype._itemReadyHandler=function(item)
{item.removeReadyHandler(this._itemReadyHandler);this.showItem(item);if(this._autoPlay)
this._startTimer();}
Gallery.prototype._startTimer=function()
{this._timeoutId=setTimeout(this._next,5000);}
Gallery.prototype._stopTimer=function()
{clearTimeout(this._timeoutId);}})(jQuery);(function($){var hzdg=(window.hzdg||(window.hzdg={}));hzdg.gallery=hzdg.gallery||(hzdg.gallery={});hzdg.gallery.view=hzdg.gallery.view||(hzdg.gallery.view={});var ThumbnailGallery=hzdg.gallery.view.ThumbnailGallery=function()
{hzdg.utils.Dispatcher.call(this);this._model=null;this._element=null;this._items=null;this._scrollIntervalId=NaN;this._scrollValue=0;this._maxPosition=0;this._maxIndex=0;this._isScrolling=false;this._isScrubbing=false;this._scrollStartTime;this._oldScrubPosition=NaN;this._touchTarget=null;this.ACCEL_DURATION=1000;this.SCRUB_CHANGE=100;this.LEFT="left";this.MAX_SCROLL_ACCEL=0.2;this.MAX_SCRUB_ACCEL=1.0;this.MIN_SCRUB_DISTANCE=10;this.SCROLL_UPDATE_INTERVAL=32;this.RIGHT="right";this.CLICK_THRESHOLD=200;this._leftArrowMouseHandler=$.proxy(ThumbnailGallery.prototype._leftArrowMouseHandler,this);this._rightArrowMouseHandler=$.proxy(ThumbnailGallery.prototype._rightArrowMouseHandler,this);this._updateScroll=$.proxy(ThumbnailGallery.prototype._updateScroll,this);this._stopScroll=$.proxy(ThumbnailGallery.prototype._stopScroll,this);};ThumbnailGallery.prototype=new hzdg.utils.Dispatcher();ThumbnailGallery.prototype.constructor=ThumbnailGallery;
ThumbnailGallery.prototype.initialize=function(element,model,items)
{hzdg.utils.Dispatcher.prototype.initialize.call(this);this._model=model;this._element=$(element);this._items=items;this._container=$('ul',this._element);this._container.css('position','relative');this._mask=$('<div class="thumbnail-gallery-container mask"></div>').prependTo(this._element).append(this._container).css({'position':'relative','overflow':'hidden'});this._touchStartHandler=$.proxy(this._touchStartHandler,this);this._touchMoveHandler=$.proxy(this._touchMoveHandler,this);this._touchEndHandler=$.proxy(this._touchEndHandler,this);this._mask.bind('touchstart',this._touchStartHandler);this._initializeItemLayout();this._updateControls();this._maskBounds={}
this._maskBounds.left=this._mask.offset().left;this._maskBounds.right=this._maskBounds.left+this._mask.width();return this;}
ThumbnailGallery.prototype._handleArrowMouseEvent=function(event,direction)
{this._startScroll(direction);event.preventDefault();}
ThumbnailGallery.prototype._initializeControl=function(control,handler)
{control.height(this._mask.height());control.bind('mousedown',handler);control.bind('touchstart',handler);}
ThumbnailGallery.prototype._initializeItemLayout=function()
{this._element.show();var nx=0;var maxHeight=0;var minWidth=100000;$(this._items).each(function(i,item){item.x(nx);nx+=item.width();maxHeight=Math.max(maxHeight,item.height());minWidth=Math.min(minWidth,item.width());var el=item.element();el.hide();el.delay(700+i*100).fadeIn(500);});this._scrollSize=minWidth;this._mask.height(maxHeight);var maskWidth=this._mask.width();if(nx>maskWidth)
{this._leftArrow=$('<div class="thumbnail-gallery-control left-arrow"></div>').css({opacity:0}).prependTo(this._element);this._initializeControl(this._leftArrow,this._leftArrowMouseHandler);this._rightArrow=$('<div class="thumbnail-gallery-control right-arrow"></div>').css({opacity:0}).appendTo(this._element);this._initializeControl(this._rightArrow,this._rightArrowMouseHandler);maskWidth=this._rightArrow.offset().left-this._leftArrow.width()-this._leftArrow.offset().left;this._mask.css({left:this._leftArrow.width(),width:maskWidth});}
var w=0;var i=this._items.length-1;while(w<maskWidth&&i>=0)
{w+=this._items[i].width();i--;}
this._maxIndex=i+1;this._maxPosition=nx-maskWidth;}
ThumbnailGallery.prototype._leftArrowMouseHandler=function(event)
{this._handleArrowMouseEvent(event,this.LEFT);}
ThumbnailGallery.prototype._rightArrowMouseHandler=function(event)
{this._handleArrowMouseEvent(event,this.RIGHT);}
ThumbnailGallery.prototype._setArrowEnabled=function(button,enabled)
{var cursor,opacity;if(enabled)
{cursor='pointer';opacity=1;}
else
{cursor='auto';opacity=0.2;}
button.css({cursor:cursor}).animate({opacity:opacity},{queue:false});}
ThumbnailGallery.prototype._startScroll=function(direction)
{this._isScrolling=direction;this._scrollStartTime=new Date().getTime();clearInterval(this._scrollIntervalId);this._scrollIntervalId=setInterval(this._updateScroll,this.SCROLL_UPDATE_INTERVAL,direction);this._updateScroll(direction);$(document).bind('mouseup',this._stopScroll);$(document).bind('touchend',this._stopScroll);}
ThumbnailGallery.prototype._startScrubbing=function()
{this._isScrubbing=true;}
ThumbnailGallery.prototype._stopScroll=function()
{$(document).unbind('mouseup',this._stopScroll);$(document).unbind('touchend',this._stopScroll);var direction=this._isScrolling;this._isScrolling=null;clearInterval(this._scrollIntervalId);if(direction)
this._updateScroll(direction);}
ThumbnailGallery.prototype._stopScrubbing=function()
{this._isScrubbing=false;}
ThumbnailGallery.prototype._touchCancelHandler=function(event)
{this._stopScrubbing();this._touchTarget=null;$(document).unbind('touchmove',this._touchMoveHandler);$(document).unbind('touchend',this._touchEndHandler);$(document).unbind('touchcancel',this._touchCancelHandler);}
ThumbnailGallery.prototype._touchEndHandler=function(event)
{if(!this._isScrubbing&&this._touchTarget)
{var url=$(this._touchTarget).parent().attr('href');for(var i=0;i<this._model.getCount();i++)
{if(this._model.getItemAt(i).getUrl()==url)
{this._model.setSelectedItemIndex(i);break;}}}
else if(this._isScrubbing)
{event.preventDefault();}
this._touchCancelHandler(event);}
ThumbnailGallery.prototype._touchMoveHandler=function(event)
{event=event.originalEvent;if(event.touches.length==1)
{if(!this._isScrubbing)
{var delta=event.touches[0].pageX-this._oldScrubPosition;if(Math.abs(delta)>=this.MIN_SCRUB_DISTANCE)
this._startScrubbing();}
if(this._isScrubbing)
{this._updateScrub(event.touches[0].pageX);event.preventDefault();}}
else
{this._touchCancelHandler(event);}}
ThumbnailGallery.prototype._touchStartHandler=function(event)
{var event=event.originalEvent;if(event.touches.length==1)
{event.preventDefault();this._touchTarget=event.target;this._startScrubPosition=this._oldScrubPosition=event.touches[0].pageX;$(document).bind('touchmove',this._touchMoveHandler);$(document).bind('touchend',this._touchEndHandler);}
else
{this._touchCancelHandler(event);}}
ThumbnailGallery.prototype._updateControls=function()
{if(this._rightArrow&&this._leftArrow)
{this._setArrowEnabled(this._leftArrow,this._scrollValue!=0);this._setArrowEnabled(this._rightArrow,this._maxIndex&&this._scrollValue!=this._maxIndex);}}
ThumbnailGallery.prototype._updatePosition=function()
{nx=-this._maxPosition*(this._scrollValue/this._maxIndex);this._container.stop().animate({'left':nx},250,'easeOutCirc');}
ThumbnailGallery.prototype._updateScroll=function(direction)
{direction=direction||this._isScrolling;var newValue;var now=new Date().getTime();var timeDelta=now-this._scrollStartTime;if(!this._isScrolling&&timeDelta<this.CLICK_THRESHOLD)
{if(direction==this.RIGHT)
newValue=Math.ceil(this._scrollValue);else if(direction==this.LEFT)
newValue=Math.floor(this._scrollValue);}
else
{var accel=Math.min(this.ACCEL_DURATION,timeDelta)/this.ACCEL_DURATION*this.MAX_SCROLL_ACCEL;newValue=this._scrollValue+(direction==this.RIGHT?1:-1)*accel;}
this._updateScrollValue(newValue);}
ThumbnailGallery.prototype._updateScrollValue=function(newValue)
{newValue=Math.min(this._maxIndex,Math.max(0,newValue));if(this._scrollValue!=newValue)
{this._scrollValue=newValue;this._updatePosition();this._updateControls();}}
ThumbnailGallery.prototype._updateScrub=function(newPos)
{var delta=newPos-this._oldScrubPosition;this._oldScrubPosition=newPos;var direction=delta>0?this.LEFT:this.RIGHT;var accel=Math.min(this.SCRUB_CHANGE,Math.abs(delta))/this.SCRUB_CHANGE*this.MAX_SCRUB_ACCEL;var newValue=this._scrollValue+(direction==this.RIGHT?1:-1)*accel;this._updateScrollValue(newValue);}})(jQuery);(function($){var hzdg=(window.hzdg||(window.hzdg={}));hzdg.gallery=hzdg.gallery||(hzdg.gallery={});hzdg.gallery.view=hzdg.gallery.view||(hzdg.gallery.view={});var GalleryItem=hzdg.gallery.view.GalleryItem;var ThumbnailGalleryItem=hzdg.gallery.view.ThumbnailGalleryItem=function()
{GalleryItem.call(this);};ThumbnailGalleryItem.prototype=new GalleryItem();ThumbnailGalleryItem.prototype.constructor=ThumbnailGalleryItem;
ThumbnailGalleryItem.prototype.initialize=function(element,model)
{GalleryItem.prototype.initialize.call(this,element,model);this._element.css({'position':'absolute','left':this.x(),'top':this.y()});this._element.bind('click',$.proxy(this._clickHandler,this));this._element.bind('mouseleave',$.proxy(this._mouseLeaveHandler,this));this._element.bind('mouseenter',$.proxy(this._mouseEnterHandler,this));this._model.dispatcher().bind('isSelectedChange',$.proxy(this._isSelectedChangeHandler,this));this._isSelectedChangeHandler(null);return this;}
ThumbnailGalleryItem.prototype._clickHandler=function(event)
{event.preventDefault();if(!this._model.isSelected())
this._model.setIsSelected(true);}
ThumbnailGalleryItem.prototype._isSelectedChangeHandler=function(event)
{if(this._model.isSelected())
this._element.addClass('selected');else
this._element.removeClass('selected');}
ThumbnailGalleryItem.prototype._mouseEnterHandler=function(event)
{if(!this._model.isSelected())
this._element.addClass('selected');}
ThumbnailGalleryItem.prototype._mouseLeaveHandler=function(event)
{if(!this._model.isSelected())
this._element.removeClass('selected');}})(jQuery);(function($){var hzdg=window.hzdg||(window.hzdg={});hzdg.gallery=hzdg.gallery||(hzdg.gallery={});hzdg.gallery.view=hzdg.gallery.view||(hzdg.gallery.view={});var Gallery=hzdg.gallery.view.Gallery;var TouchGallery=hzdg.gallery.view.TouchGallery=function()
{Gallery.call(this);this._oldScrubPosition=0;this._targetX=0;this._isScrubbing=false;this._itemLeft=null;this._itemRight=null;this._nextCurrentItem=null;
this.ITEM_PADDING=20;this.MIN_SCRUB_DISTANCE=10;}
TouchGallery.prototype=new Gallery();TouchGallery.prototype.constructor=TouchGallery;
TouchGallery.prototype.initialize=function(element,model,items,autoPlay)
{Gallery.prototype.initialize.call(this,element,model,items,autoPlay);this._animationCompleteHandler=$.proxy(this._animationCompleteHandler,this);this._touchStartHandler=$.proxy(this._touchStartHandler,this);this._touchMoveHandler=$.proxy(this._touchMoveHandler,this);this._touchEndHandler=$.proxy(this._touchEndHandler,this);this._touchCancelHandler=$.proxy(this._touchCancelHandler,this);this._element.bind('touchstart',this._touchStartHandler);return this;}
Gallery.prototype.showItem=function(item)
{if(item.model()!=this._model.getSelectedItem())
{this._model.setSelectedItem(item.model());}
else
{var instantly=this._nextCurrentItem===item;this._nextCurrentItem=null;if(this._currentItem.model()!=item.model())
{this._currentItem.hide(instantly);this._currentItem=item;}
item.show(instantly);}}
TouchGallery.prototype._animationCompleteHandler=function()
{if(this._nextCurrentItem)
this._model.setSelectedItem(this._nextCurrentItem.model());this._element.css('left',0);this._currentItem.x(0);if(this._itemLeft!=null)
{this._itemLeft.hide(true);this._itemLeft.x(0);this._itemLeft=null;}
if(this._itemRight!=null)
{this._itemRight.hide(true);this._itemRight.x(0);this._itemRight=null;}
this._oldScrubPosition=0;this._targetX=0;}
TouchGallery.prototype._startScrubbing=function()
{this._isScrubbing=true;var index=this._model.getSelectedItemIndex();if(index>0)
{var prevItem=this.getItemFor(this._model.getItemAt(index-1));prevItem.x(-prevItem.width()-this.ITEM_PADDING);prevItem.show(true);this._itemLeft=prevItem;}
if(index<this._model.getCount()-1)
{var nextItem=this.getItemFor(this._model.getItemAt(index+1));nextItem.x(nextItem.width()+this.ITEM_PADDING);nextItem.show(true);this._itemRight=nextItem;}}
TouchGallery.prototype._stopScrubbing=function()
{this._isScrubbing=false;}
TouchGallery.prototype._touchCancelHandler=function(event)
{if(this._isScrubbing)
{this._stopScrubbing();this._updateScrub();}
$(document).unbind('touchmove',this._touchMoveHandler);$(document).unbind('touchend',this._touchEndHandler);$(document).unbind('touchcancel',this._touchCancelHandler);}
TouchGallery.prototype._touchEndHandler=function(event)
{if(this._isScrubbing)
event.preventDefault();this._touchCancelHandler(event);}
TouchGallery.prototype._touchMoveHandler=function(event)
{event=event.originalEvent;if(event.touches.length==1)
{if(!this._isScrubbing)
{var deltaX=event.touches[0].pageX-this._oldScrubPosition;if(Math.abs(deltaX)>=this.MIN_SCRUB_DISTANCE)
this._startScrubbing();}
if(this._isScrubbing)
{this._updateScrub(event.touches[0].pageX);event.preventDefault();}}
else
{this._touchCancelHandler(event);}}
TouchGallery.prototype._touchStartHandler=function(event)
{event=event.originalEvent;if(event.touches.length==1)
{this._oldScrubPosition=event.touches[0].pageX;$(document).bind('touchmove',this._touchMoveHandler);$(document).bind('touchend',this._touchEndHandler);$(document).bind('touchcancel',this._touchCancelHandler);}
else
{this._touchCancelHandler(event);}}
TouchGallery.prototype._updateScrub=function(value)
{if(value!==undefined)
{var delta=value-this._oldScrubPosition;this._targetX+=delta;this._oldScrubPosition=value;}
var handler=null;if(!this._isScrubbing)
{var w=this._currentItem.width();var hw=w/2;if(this._itemLeft&&this._targetX>hw)
{this._targetX=w+this.ITEM_PADDING;this._nextCurrentItem=this._itemLeft;this._itemLeft=null;}
else if(this._itemRight&&this._targetX<-hw)
{this._nextCurrentItem=this._itemRight;this._itemRight=null;this._targetX=-w-this.ITEM_PADDING;}
else
{this._targetX=0;}
handler=this._animationCompleteHandler;}
this._element.stop().animate({'left':this._targetX},250,'easeOutCirc',handler);}})(jQuery);(function($){var hzdg=window.hzdg||(window.hzdg={});hzdg.linksList=hzdg.linksList||(hzdg.linksList={});var LinksList=hzdg.linksList.LinksList=function()
{this._element=null;this._isToggled=false;};
LinksList.prototype.initialize=function(element)
{this._element=$(element);this._element.bind('mouseenter',$.proxy(this._mouseEnterHandler,this));this._element.bind('mouseleave',$.proxy(this._mouseLeaveHandler,this));this._element.bind('click',$.proxy(this._clickHandler,this));}
LinksList.prototype._clickHandler=function(event)
{this._toggle();}
LinksList.prototype._mouseEnterHandler=function(event)
{this._toggle(true);}
LinksList.prototype._mouseLeaveHandler=function(event)
{this._toggle(false);}
LinksList.prototype._toggle=function(value)
{if(value===undefined||value!=this._isToggled)
{this._isToggled=!this._isToggled;if(this._isToggled)
{$('h3',this._element).css('background-position','bottom right');$('ul',this._element).stop(true,true).slideDown('fast');}
else
{$('h3',this._element).css('background-position','top right');$('ul',this._element).stop(true,true).slideUp('fast');}}}})(jQuery);(function($){var hzdg=(window.hzdg||(window.hzdg={}));hzdg.feature=hzdg.feature||(hzdg.feature={});var FeaturesWidget=hzdg.feature.FeaturesWidget=function()
{hzdg.utils.Dispatcher.call(this);this._features=[];this._selectedFeature=null;this._tabMenu=null;}
FeaturesWidget.prototype=new hzdg.utils.Dispatcher();FeaturesWidget.prototype.constructor=FeaturesWidget;FeaturesWidget.prototype.initialize=function(element,features)
{hzdg.utils.Dispatcher.prototype.initialize.call(this);element.prepend('<div id="tab-menu"></div>');this._tabMenu=element.find('#tab-menu');this._tabMenu.css({'z-index':2,'overflow':'hidden'});if(features!=null)
{for(var i=0;i<features.length;i++)
{this.addFeature(features[i]);};}
return this;}
FeaturesWidget.prototype.addFeature=function(feature)
{this._tabMenu.append(feature.tab());feature.tab().css({'float':'left','cursor':'pointer'});if(feature.selected())
{this._setSelectedFeature(feature);}
this._features.push(feature);feature.dispatcher().bind(hzdg.feature.Feature.SELECTED_STATE_CHANGE,$.proxy(FeaturesWidget.prototype._selectedStateChangeHandler,this));}
FeaturesWidget.prototype._selectedStateChangeHandler=function(event)
{if(event.target.selected()){this._setSelectedFeature(event.target);}}
FeaturesWidget.prototype._setSelectedFeature=function(feature)
{if(this._selectedFeature)
{this._selectedFeature.selected(false);$(this._selectedFeature._element).css('z-index',0);this._selectedFeature=null;}
if(feature)
{this._selectedFeature=feature;$(this._selectedFeature._element).css('z-index',1);}}
FeaturesWidget.prototype._tabButtonClickHandler=function(event)
{index=parseInt($(event.target).attr('id').replace(/^tab-button-(\d+)$/,'$1'));this._features[index].selected(true);}})(jQuery);(function($){var hzdg=(window.hzdg||(window.hzdg={}));hzdg.feature=hzdg.feature||(hzdg.feature={});var Feature=hzdg.feature.Feature=function()
{hzdg.utils.Dispatcher.apply(this);this._element=null;this._selected=undefined;this._tab=null;}
Feature.prototype=new hzdg.utils.Dispatcher();Feature.prototype.constructor=Feature;var SELECTED_STATE_CHANGE=Feature.SELECTED_STATE_CHANGE="selectedStateChange";
Feature.prototype.dispatcher=function()
{return this._dispatcher;}
Feature.prototype.tab=function()
{return this._tab;}
Feature.prototype.selected=getset.create();Feature.prototype.selected.get=function()
{return this._selected;}
Feature.prototype.selected.set=function(value)
{var oldValue=this._selected;if(value!=oldValue)
{if(value)
{this._tab.addClass('selected');}
else
{this._tab.removeClass('selected');}
this._selected=value;this.dispatcher().trigger(SELECTED_STATE_CHANGE);}}
Feature.prototype.initialize=function(element)
{hzdg.utils.Dispatcher.prototype.initialize.call(this);this._element=element;var el=$(element);this._tab=el.find('.feature-tab');this._tab.bind('click',$.proxy(Feature.prototype._tabClickHandler,this));el.css({position:"absolute"});this.selected(this._tab.hasClass('selected'));return this;}
Feature.prototype._tabClickHandler=function(event)
{this.selected(true);}})(jQuery);$(document).ready(function(){ var Feature=hzdg.feature.Feature;var FeaturesWidget=hzdg.feature.FeaturesWidget;var Gallery=hzdg.gallery.view.Gallery;var GalleryItem=hzdg.gallery.view.GalleryItem;var GalleryModelFactory=hzdg.gallery.model.GalleryModelFactory;var element=$("#features");if(element.length)
{var feature_elements=element.find('.feature');if(feature_elements.length)
{var features=[]
feature_elements.each(function(i,element){features.push(new Feature().initialize(element));});}
var featuresWidget=new FeaturesWidget().initialize(element,features);element.show();}
var data=[];data.push({'url':"/media/galleries/home-background/HP_BB_Rogues&amp;G.jpg",'caption':""});data.push({'url':"/media/galleries/home-background/HP_Redskins.jpg",'caption':""});data.push({'url':"/media/galleries/home-background/HP_VW.jpg",'caption':""});data.push({'url':"/media/galleries/home-background/HP_MonaTaner.jpg",'caption':""});data.push({'url':"/media/galleries/home-background/hp-coco.jpg",'caption':""});data.push({'url':"/media/galleries/home-background/HP_Waldorf.jpg",'caption':""});data.push({'url':"/media/galleries/home-background/HP_Addys.jpg",'caption':""});data.push({'url':"/media/galleries/home-background/HP_NDB.jpg",'caption':""});data.push({'url':"/media/galleries/home-background/HP_Dormify.jpg",'caption':""});data.push({'url':"/media/galleries/home-background/HP_360state.jpg",'caption':""});data.push({'url':"/media/galleries/home-background/HP_forum-new.jpg",'caption':""});data.push({'url':"/media/galleries/home-background/hp-legacy_1.jpg",'caption':""});data.push({'url':"/media/galleries/home-background/HP_Nine.jpg",'caption':""});data.push({'url':"/media/galleries/home-background/HP_SiloPoint.jpg",'caption':""});data.push({'url':"/media/galleries/home-background/HP_StoneHenge.jpg",'caption':""});var galleryModel=new GalleryModelFactory(data).create();element=$("#background-gallery");if(element.length)
{var galleryItems=[];var items=element.find('img');if(items.length)
{items.each(function(i,item){galleryItems.push(new GalleryItem().initialize(item,galleryModel.getItemAt(i)));});var gallery=new Gallery().initialize(element,galleryModel,galleryItems,true);}}});
