
var _minWindowWidth=850;
var _minWindowHeight=550;
function pixStrToInt(pixelString){
return pixelString.replace("px","")*1;}
function getWindowWidth(){
var rawWindowWidth=document.viewport.getWidth();
return(rawWindowWidth>_minWindowWidth?rawWindowWidth:_minWindowWidth);}
function getWindowHeight(){
var rawWindowHeight=document.viewport.getHeight();
return(rawWindowHeight>_minWindowHeight?rawWindowHeight:_minWindowHeight);}
function getWinDimensions(){
return{width:getWindowWidth(),height:getWindowHeight()};}
function horCenterDivInWindow(divid){
var divDimensions=Element.getDimensions(divid);
var winDimensions=getWinDimensions();
Element.setStyle(divid,{left:((winDimensions.width-divDimensions.width)/2)+'px'});}
function verCenterDivInWindow(divid){
var divDimensions=Element.getDimensions(divid);
var winDimensions=getWinDimensions();
Element.setStyle(divid,{top:((winDimensions.height-divDimensions.height)/2)+'px'});}
function horCenterDivInParent(divid){
var divDimensions=Element.getDimensions(divid);
var parentDimensions=Element.getDimensions($(divid).parentNode.id);
Element.setStyle(divid,{left:((parentDimensions.width-divDimensions.width)/2)+'px'});}
function verCenterDivInParent(divid){
var divDimensions=Element.getDimensions(divid);
var parentDimensions=Element.getDimensions($(divid).parentNode.id);
Element.setStyle(divid,{top:((parentDimensions.height-divDimensions.height)/2)+'px'});}
function centerDivInWindow(divid){
horCenterDivInWindow(divid);
verCenterDivInWindow(divid);}
function centerDivInParent(divid){
horCenterDivInParent(divid);
verCenterDivInParent(divid);}
Object.cloneAndExtend=function(destination,source){
return Object.extend(Object.extend({},destination),source);}
Element.shrinkToFit=function(container,element){
var imageDims=Element.getDimensions(element);
var elementWidth=pixStrToInt(Element.getStyle(container,'width'));
var elementHeight=pixStrToInt(Element.getStyle(container,'height'));
var widthRatio=imageDims.width/elementWidth;
var heightRatio=imageDims.height/elementHeight;
if(widthRatio>1||heightRatio>1){
if(widthRatio>heightRatio){
var shrinkRatio=imageDims.width/(elementWidth-(pixStrToInt(Element.getStyle(element,'border-top-width'))+pixStrToInt(Element.getStyle(element,'border-bottom-width'))));
Element.setStyle(element,{width:(imageDims.width/shrinkRatio)+'px', height:(imageDims.height/shrinkRatio)+'px'});}
else{
var shrinkRatio=imageDims.height/(elementHeight-(pixStrToInt(Element.getStyle(element,'border-left-width'))+pixStrToInt(Element.getStyle(element,'border-right-width'))));
Element.setStyle(element,{width:(imageDims.width/shrinkRatio)+'px', height:(imageDims.height/shrinkRatio)+'px'});}}}
function externalLinks(){
if(!document.getElementsByTagName)return;
$A(document.getElementsByTagName("a")).each(function(elem){
if(elem.getAttribute("href")&&elem.getAttribute("rel")=="external")
elem.target="_blank";});}
function detectMacXFF(){
var userAgent=navigator.userAgent.toLowerCase();
if(userAgent.indexOf('mac')!=-1&&(userAgent.indexOf('firefox')!=-1||userAgent.indexOf('camino')!=-1||userAgent.indexOf('netscape')!=-1)){
return true;}
return false;}
var ComboBox=Class.create();
ComboBox.i=0;
ComboBox.Autocompleter=Autocompleter.Local;
ComboBox.Autocompleter.prototype.onBlur=function(event){
if(Element.getStyle(this.update,'display')=='none'){return;}
setTimeout(this.hide.bind(this),250);
this.hasFocus=false;
this.active=false;}
ComboBox.prototype={
initialize:function(textElement,array,options){
ComboBox.i=ComboBox.i+1;
this.myIndex=ComboBox.i;
var listName=textElement;
if($(textElement).match('select')){
var selectElements=$(textElement).descendants();
for(var i=0;i<selectElements.length;i++){
if(selectElements[i].match('option')){
array[array.length]=selectElements[i].value;}}
var comboNode=$(textElement);
var parentNode=comboNode.parentNode;
var laterSiblings=comboNode.nextSiblings();
var newTextElement=Element.extend(Builder.node('div'));
if(comboNode.getStyle('width')!=null)
newTextElement.setStyle({'width':comboNode.getStyle('width')});
if(comboNode.readAttribute('name')!=null)
listName=comboNode.readAttribute('name');
parentNode.removeChild(comboNode);
newTextElement.id=textElement;
if(laterSiblings.length>0)
laterSiblings.first().insertBefore(newTextElement);
else
parentNode.appendChild(newTextElement);}
this.textElement=$(textElement);
this.textElement.id='combo-outer'+this.myIndex;
this.textElement.className="combo-outer";
this.results=Element.extend(Builder.node('div'));
this.results.id='combo-results'+this.myIndex;
this.results.className="combo-results";
this.textBox=Element.extend(Builder.node('input',{name:listName,type:"text"}));
this.textBox.id='combo-input'+this.myIndex;
this.textBox.className="combo-input";
this.arrow=Element.extend(Builder.node('div'));
this.arrow.id='combo-arrow'+this.myIndex;
this.arrow.className="combo-arrow";
this.textElement.appendChild(this.textBox);
this.textElement.appendChild(this.arrow);
this.textElement.appendChild(this.results);
this.array=array;
var comboInnerWidth=pixStrToInt(Element.getStyle(this.textElement,'width'));
var inputPadding=pixStrToInt(Element.getStyle(this.textBox,'paddingLeft'))+pixStrToInt(Element.getStyle(this.textBox,'paddingRight'));
Element.setStyle(this.textBox,{width:(comboInnerWidth-inputPadding)+'px'});
Element.setStyle(this.textBox,{zIndex:1});
Element.setStyle(this.arrow,{zIndex:2});
Element.setStyle(this.results,{zIndex:3});
this.results.style.display='none';
this.events={
showChoices:this.showChoices.bindAsEventListener(this),
hideChoices:this.hideChoices.bindAsEventListener(this),
click:this.click.bindAsEventListener(this),
keyDown:this.keyDown.bindAsEventListener(this)}
this.autocompleter=new ComboBox.Autocompleter(this.textBox,this.results,this.array,options);
Event.observe(this.arrow,'click',this.events.click);
Event.observe(this.textBox,'keydown',this.events.keyDown);},
getAllChoices:function(e){
var choices=this.array.collect(function(choice){return '<li>'+choice+'</li>';});
var html='<ul>'+choices.join('')+'</ul>';
this.autocompleter.updateChoices(html);},
keyDown:function(e){
if(e.keyCode==Event.KEY_DOWN&&this.choicesVisible()){
this.showChoices(null);}},
choicesVisible:function(){return(Element.getStyle(this.autocompleter.update,'display')=='none');},
click:function(e){
if(this.choicesVisible()){
this.showChoices(null);}else{
this.hideChoices(null);}},
showChoices:function(e){
this.textBox.focus();
this.autocompleter.changed=false;
this.autocompleter.hasFocus=true;
this.getAllChoices();},
hideChoices:function(e){
this.autocompleter.onBlur();}}
var Scroller=Class.create();
Scroller.ids=new Object();
Scroller.i=0;
Scroller.prototype={
initialize:function(el){
this.outerBox=el;
this.decorate();
Event.observe(el.id,'DOMMouseScroll',this.onWheel.bindAsEventListener(this));
Event.observe(el.id,'mousewheel',this.onWheel.bindAsEventListener(this));},
decorate:function(){
Element.makePositioned(this.outerBox);
Scroller.i=Scroller.i+1;
this.myIndex=Scroller.i;
this.trackPadding=10;
this.innerBox=document.createElement("DIV");
this.innerBox.className="scroll-innerBox";
Element.makePositioned(this.innerBox);
this.innerBox.style.cssFloat=this.innerBox.style.styleFloat='left';
this.innerBox.innerHTML=this.outerBox.innerHTML;
this.outerBox.innerHTML="";
this.outerBox.appendChild(this.innerBox);
this.innerBox.style.paddingRight=this.trackPadding+'px';
this.track=document.createElement("DIV");
this.track.className="scroll-track";
Element.makePositioned(this.track);
this.track.style.cssFloat=this.track.style.styleFloat='left';
this.track.id="scroll-track"+Scroller.i;
this.track.style.display='none';
this.buttonup=document.createElement("DIV");
this.buttonup.className="scroll-up";
Element.makePositioned(this.buttonup);
this.buttonup.style.cssFloat=this.buttonup.style.styleFloat='left';
this.buttonup.id="scroll-up"+Scroller.i;
this.buttonup.style.display='none';
this.buttondown=document.createElement("DIV");
this.buttondown.className="scroll-down";
Element.makePositioned(this.buttondown);
this.buttondown.style.cssFloat=this.buttondown.style.styleFloat='left';
this.buttondown.id="scroll-down"+Scroller.i;
this.buttondown.style.display='none';
this.viewportHeight=Element.getHeight(this.outerBox);
this.buttonHeight=15;
this.trackHeight=this.viewportHeight-(this.buttonHeight*2);
this.track.style.height=this.trackHeight+"px";
this.buttonup.style.height=this.buttonHeight+"px";
this.buttondown.style.height=this.buttonHeight+"px";
this.handle=document.createElement("DIV");
this.handle.className="scroll-handle";
this.handle.id="scroll-handle"+Scroller.i;
this.innerHeight=this.getHeight(this.innerBox);
if(this.innerHeight>0)
this.handleHeight=Math.round((this.trackHeight*this.viewportHeight)/this.innerHeight);
else
this.handleHeight=10;
if(this.handleHeight<10)this.handleHeight=10;
this.handle.style.height=this.handleHeight+"px";
this.track.appendChild(this.handle);
this.outerBox.appendChild(this.buttonup);
this.outerBox.appendChild(this.track);
this.outerBox.appendChild(this.buttondown);
this.outerBox.style.overflow="hidden";
this.slider=new Control.Slider(this.handle.id,this.track.id,{axis:'vertical',
minimum:0,
maximum:this.trackHeight});
this.slider.options.onSlide=this.slider.options.onChange=this.onChange.bind(this);
Event.observe(this.buttonup.id,'click',this.onButtonUp.bind(this));
Event.observe(this.buttondown.id,'click',this.onButtonDown.bind(this));
setTimeout(this.resetScrollbar.bind(this,false),10);},
resetScrollbar:function(full){
if(full)
this.track.style.display='none';
this.innerHeight=this.getHeight(this.innerBox);
this.viewportHeight=this.getHeight(this.outerBox);
this.buttonHeight=15;
this.trackPadding=10;
this.trackHeight=this.viewportHeight-(this.buttonHeight*2);
this.slider.trackLength=this.trackHeight;
this.track.style.height=this.trackHeight+"px";
this.handleHeight=Math.round((this.trackHeight*this.viewportHeight)/this.innerHeight);
if(this.handleHeight<10)this.handleHeight=10;
this.handle.style.height=this.handleHeight+"px";
this.slider.handleLength=this.handleHeight;
if(this.handleHeight<this.trackHeight){
if(Element.getStyle(this.track,"display")=='none'){
this.buttonup.style.display='inline';
this.track.style.display='inline';
this.buttondown.style.display='inline';
this.setWidth();}}else{
this.slider.setValue(0);
this.buttonup.style.display='none';
this.track.style.display='none';
this.buttondown.style.display='none';
this.innerBox.style.width=this.getWidth(this.outerBox)+"px";}},
setWidth:function(){
var newWidth=(this.getWidth(this.outerBox)-this.getWidth(this.track)-this.trackPadding)+"px";
this.innerBox.style.width=newWidth;
setTimeout(this.resetScrollbar.bind(this,false),10);},
getHeight:function(el){
var h=Element.getHeight(el);
var borderWidth=0;
if((borderWidth=Element.getStyle(el,'border-width').replace("px",""))==""){
h=el.clientHeight;}
else{
if(!isNaN(borderWidth))
h-=(borderWidth)*2;}
return h;},
getWidth:function(el){
var w=Element.getWidth(el);
var borderWidth=0;
if((borderWidth=Element.getStyle(el,'border-width').replace("px",""))==""){
w=el.clientWidth;}
else{
if(!isNaN(borderWidth))
w-=(borderWidth)*2;}
return w;},
onChange:function(val){
if(this.track){
var moveRatio=(this.innerHeight-this.getHeight(this.outerBox))/100;
this.innerBox.style.top=(val*100*moveRatio*-1)+"px";}},
onWheel:function(event){
if(this.track.style.display!='none'){
var delta=0;
if(!event)
event=window.event;
if(event.wheelDelta){
delta=event.wheelDelta/120;
if(window.opera)
delta=-delta;}else if(event.detail){
delta=-event.detail/3;}
if(delta)
this.slider.setValueBy(-delta);
if(event.preventDefault)
event.preventDefault();
event.returnValue=false;}},
onButtonUp:function(event){
var delta=0.1;
this.slider.setValueBy(-delta);},
onButtonDown:function(event){
var delta=0.1;
this.slider.setValueBy(delta);}}
Scroller.setAll=function(){
var sliderBoxes=document.getElementsByClassName("makeScroll");
for(i=0;i<sliderBoxes.length;i++){
Scroller.ids[sliderBoxes[i].id]=new Scroller(sliderBoxes[i]);}}
Scroller.reset=function(body_id){
if($(body_id).className.match(new RegExp("(^|\\s)makeScroll(\\s|$)"))){
Scroller.ids[body_id]=new Scroller($(body_id));}}
Scroller.updateAll=function(){
for(var key in Scroller.ids){
Scroller.ids[key].resetScrollbar(true);}}
var SlideShow=Class.create();
SlideShow.i=0;
SlideShow.prototype={
initialize:function(element,imagelist,ssoptions){
this.element=$(element);
if(!this.element)throw(Effect._elementDoesNotExistError);
this.slideShowImages=imagelist.evalJSON(true);
this.options=Object.extend({
defaultDisplayTime:2.0,
defaultFadeInEffect:"Effect.Appear",
defaultFadeInEffectOptions:{duration:1.0},
defaultFadeOutEffect:"Effect.Fade",
defaultFadeOutEffectOptions:{duration:1.0},
defaultTransitionDelay:0,
defaultBorder:'2px #FFFFFF solid',
cycleSlides:true,
fadeOutLast:true,
loadingIconPath:'',
onPreloadHandler:null,
onCompleteHandler:null},ssoptions||{});
this.mergeSlideOptions();
SlideShow.i=SlideShow.i+1;
this.myIndex=SlideShow.i;
this.slideStore=Element.extend(Builder.node('div'));
this.slideStore.id='slideshow-images'+this.myIndex;
this.slideStore.className="slideshow-images";
Element.makePositioned(this.slideStore);
this.element.appendChild(this.slideStore);
Element.setStyle(this.slideStore,{position:'absolute',
top:'0px',
left:'0px',
width:'5px',
height:'5px',
textAlign:'center',
visibility:'hidden',
overflow:'hidden'});
if(this.options.loadingIconPath.length>0){
this.loadingImage=Element.extend(Builder.node('img'));
this.loadingImage.id="img_"+this.myIndex+"_loading";
this.loadingImage.onload=this.init.bindAsEventListener(this,true);
Element.makePositioned(this.loadingImage);
this.slideStore.appendChild(this.loadingImage);
this.loadingImage.src=this.options.loadingIconPath;}
else
this.init(null,false);},
mergeSlideOptions:function(){
for(var i=0;i<this.slideShowImages.length;i++){
if(this.slideShowImages[i].displayTime==null)
this.slideShowImages[i].displayTime=this.options.defaultDisplayTime;
if(this.slideShowImages[i].fadeInEffect==null)
this.slideShowImages[i].fadeInEffect=this.options.defaultFadeInEffect;
if(this.slideShowImages[i].fadeInEffectOptions==null)
this.slideShowImages[i].fadeInEffectOptions=Object.cloneAndExtend(this.options.defaultFadeInEffectOptions,this.slideShowImages[i].fadeInEffectOptions);
if(this.slideShowImages[i].fadeOutEffect==null)
this.slideShowImages[i].fadeOutEffect=this.options.defaultFadeOutEffect;
if(this.slideShowImages[i].fadeOutEffectOptions==null)
this.slideShowImages[i].fadeOutEffectOptions=Object.cloneAndExtend(this.options.defaultFadeOutEffectOptions,this.slideShowImages[i].fadeOutEffectOptions);
if(this.slideShowImages[i].transitionDelay==null)
this.slideShowImages[i].transitionDelay=this.options.defaultTransitionDelay;
if(this.slideShowImages[i].border==null)
this.slideShowImages[i].border=this.options.defaultBorder;
this.slideShowImages[i].fadeInEffect=eval(this.slideShowImages[i].fadeInEffect);
this.slideShowImages[i].fadeOutEffect=eval(this.slideShowImages[i].fadeOutEffect);}},
init:function(eventObj,useLoadingImage){
this.loading=Element.extend(Builder.node('div'));
this.loading.id='slideshow-loading'+this.myIndex;
this.loading.className="slideshow-loading";
this.element.appendChild(this.loading);
Element.setStyle(this.loading,{position:'absolute',
zIndex:3,
top:'0px',
left:'0px',
textAlign:'center',
background:'transparent'});
if(useLoadingImage){
this.loadingImage.onload="";
var loadingImageDimensions=$('img_'+this.myIndex+'_loading').getDimensions();
Element.setStyle(this.loading,{width:loadingImageDimensions.width+'px',height:loadingImageDimensions.height+'px'});
this.loading.appendChild(this.loadingImage);}
else
this.loading.update("Loading...");
centerDivInParent(this.loading.id);
this.fgSlide=Element.extend(Builder.node('img'));
this.fgSlide.id='slideshow_'+this.myIndex+'_1';
this.fgSlide.className="slideshow-slide";
this.element.appendChild(this.fgSlide);
Element.setStyle(this.fgSlide,{position:'absolute',
zIndex:1,
top:'0px',
left:'0px',
display:'none',
background:'transparent'});
this.bgSlide=Element.extend(Builder.node('img'));
this.bgSlide.id='slideshow_'+this.myIndex+"_2";
this.bgSlide.className="slideshow-slide";
this.element.appendChild(this.bgSlide);
Element.setStyle(this.bgSlide,{position:'absolute',
zIndex:2,
top:'0px',
left:'0px',
display:'none',
background:'transparent'});
this.firstSlidePosition=-1;
for(var i=0;i<this.slideShowImages.length;i++){
if((!this.slideShowImages[i].skip)&&(this.firstSlidePosition==-1)){
this.slideShowImages[i].preLoad=true;
this.firstSlidePosition=i;}
if(this.slideShowImages[i].preLoad==true){
this.loadImage(i);}}
this.stopSlideShow=true;
this.waitForPreload();},
loadImage:function(imageIndex){
if(this.slideShowImages[imageIndex].imageObject==null&&this.stopSlideShow!=true){
this.slideShowImages[imageIndex].imageObject=Element.extend(Builder.node('img'));
this.slideShowImages[imageIndex].imageObject.id="img_"+this.myIndex+"_"+imageIndex;
this.slideShowImages[imageIndex].loaded=false;
this.slideShowImages[imageIndex].imageObject.onload=this.markImageLoaded.bindAsEventListener(this,imageIndex);
this.slideStore.appendChild(this.slideShowImages[imageIndex].imageObject);
this.slideShowImages[imageIndex].imageObject.src=this.slideShowImages[imageIndex].src;
Element.setStyle(this.slideShowImages[imageIndex].imageObject,{border:this.slideShowImages[imageIndex].border});}},
markImageLoaded:function(eventObj,imageIndex){
this.slideShowImages[imageIndex].imageObject.onload="";
this.slideShowImages[imageIndex].loaded=true;},
isImageLoaded:function(ssImage){
return(ssImage.loaded==true||ssImage.imageObject.complete==true||ssImage.imageObject.readyState=='complete');},
waitForPreload:function(){
var preLoadComplete=true;
for(var i=0;i<this.slideShowImages.length;i++){
if((this.slideShowImages[i].preLoad==true)&&(!this.isImageLoaded(this.slideShowImages[i]))){
setTimeout(this.waitForPreload.bind(this),100);
preLoadComplete=false;
break;}}
if(preLoadComplete){
this.onPreload();
Element.hide(this.loading);
if(this.firstSlidePosition>=0)
this.start();}},
fadeInAndOut:function(){
this.slideTimer=null;
var nextSlide=this.slideShowImages[this.nextSlidePosition];
var currSlide=this.currSlidePosition>=0?this.slideShowImages[this.currSlidePosition]:null;
if(this.pauseSlideShow==true){
return;}
if(this.stopSlideShow==true){
if(this.options.fadeOutLast==true&&currSlide!=null)
new currSlide.fadeOutEffect(this.fgSlide,Object.cloneAndExtend(currSlide.fadeOutEffectOptions,{afterFinish:this.onComplete.bind(this)}));
else
this.onComplete();
return;}
if(nextSlide.skip==true||nextSlide.imageObject==null){
this.loadNextAndWait(50);
return;}
if(!this.isImageLoaded(nextSlide)){
setTimeout(this.fadeInAndOut.bind(this),100);
return;}
if(Element.getStyle(this.bgSlide,'display')=='none'){
Element.setStyle(this.bgSlide,{visibility:'hidden',display:''});}
this.bgSlide.src=nextSlide.imageObject.src;
Element.setStyle(this.bgSlide,{border:nextSlide.border});
Element.setStyle(this.bgSlide,{width:nextSlide.imageObject.width+'px',height:nextSlide.imageObject.height+'px'});
Element.shrinkToFit(this.element,this.bgSlide);
centerDivInParent(this.bgSlide.id);
if(Element.getStyle(this.bgSlide,'visibility')=='hidden'){
Element.setStyle(this.bgSlide,{display:'none',visibility:'visible'});}
if(currSlide!=null)new currSlide.fadeOutEffect(this.fgSlide,currSlide.fadeOutEffectOptions);
this.transitionTimer=setTimeout(this.fadeIn.bind(this,currSlide,nextSlide),currSlide!=null?currSlide.transitionDelay*1000:0);},
fadeIn:function(currSlide,nextSlide){
this.transitionTimer=null;
new nextSlide.fadeInEffect(this.bgSlide,Object.cloneAndExtend(nextSlide.fadeInEffectOptions,{afterFinish:this.fadeInDone.bind(this)}));},
fadeInDone:function(){
var tempSlide=this.fgSlide;
this.fgSlide=this.bgSlide;
this.bgSlide=tempSlide;
this.currSlidePosition=this.nextSlidePosition;
if(this.stopSlideShow==true)
this.loadNextAndWait(0);
else
this.loadNextAndWait(this.slideShowImages[this.currSlidePosition].displayTime);},
loadNextAndWait:function(timeToWait){
if(!this.incNextSlidePosition())return;
this.loadImage(this.nextSlidePosition);
if(timeToWait>0)
this.slideTimer=setTimeout(this.fadeInAndOut.bind(this),timeToWait*1000);
else
this.fadeInAndOut();},
incNextSlidePosition:function(){
var initialPosition=this.nextSlidePosition;
do{
this.nextSlidePosition++;
if(this.nextSlidePosition>=this.slideShowImages.length)
this.nextSlidePosition=0;
if(this.nextSlidePosition<=this.currSlidePosition){
if(!this.options.cycleSlides){
if(this.options.fadeOutLast)
this.stopSlideShow=true;
else{
this.onComplete();
return false;}}}
if(this.nextSlidePosition==initialPosition)return false;}
while(this.slideShowImages[this.nextSlidePosition].skip==true);
return true;},
onComplete:function(){
if(this.options.onCompleteHandler!=null)this.options.onCompleteHandler();},
onPreload:function(){
if(this.options.onPreloadHandler!=null)this.options.onPreloadHandler();},
start:function(){
if(this.stopSlideShow==true){
this.stopSlideShow=false;
this.currSlidePosition=-1;
this.nextSlidePosition=this.firstSlidePosition;
this.fadeInAndOut();}},
stop:function(){
if(this.stopSlideShow==false){
this.stopSlideShow=true;
if(this.transitionTimer!=null){
clearTimeout(this.transitionTimer);
this.onComplete();}
else if(this.slideTimer!=null){
clearTimeout(this.slideTimer);
this.fadeInAndOut();}}},
pause:function(){
this.pauseSlideShow=true;},
unpause:function(){
if(this.pauseSlideShow==true){
this.pauseSlideShow=false;
this.slideTimer=setTimeout(this.fadeInAndOut.bind(this),this.slideShowImages[this.currSlidePosition].displayTime*1000);}},
resize:function(){
if((this.pauseSlideShow==true)||(this.slideTimer!=null&&this.currSlidePosition>=0)){
var currSlide=this.slideShowImages[this.currSlidePosition];
Element.setStyle(this.fgSlide,{visibility:'hidden'});
Element.setStyle(this.fgSlide,{width:currSlide.imageObject.width+'px',height:currSlide.imageObject.height+'px'});
Element.shrinkToFit(this.element,this.fgSlide);
centerDivInParent(this.fgSlide.id);
Element.setStyle(this.fgSlide,{visibility:'visible'});}}};
function sendFeedback(){
var params=Form.serialize($('feedback'));
new Ajax.Request('serverside/sendfeedback.php',{
onSuccess:function(resp){alert(resp.responseText);if(resp.responseText.include('Success')==true)$('feedback').reset();},
onFailure:function(resp){alert("Error sending feedback. Please try again.");},
parameters:params+'&usingjs=true',
asynchronous:true});}
var gIntroSlideShow=null;
var gLogoTop=0;
var gLogoLeft=0;
var gImagineTop=0;
var gImagineLeft=0;
var gCreateTop=0;
var gCreateLeft=0;
var gInspireTop=0;
var gInspireLeft=0;
var gIntroCompleted=false;
var gCurrentItem=null;
var gGalleryCache=new Object;
var gGalleryContentBackground=null;
var gActiveGallery=null;
var gActivatingGallery=null;
var gGalleryInfoCache=new Object;
var gActiveGalleryInfo=null;
var gActivatingGalleryInfo=null;
var gOtherContentCache=new Object;
var gActiveOtherContent=null;
var gActivatingOtherContent=null;
var gOtherContentScroller=null;
var gOtherContentVisible=false;
var gComboBox=null;
var gSlideShow=null;
var gMaxUsableWidth=1024;
var gMaxUsableHeight=768;
var gGalleriesSupportingLogin=new Array('weddings');
var gActivatingLoginInfo=null;
var gDoQuickIntro=false;
function onSimpleViewerLoaded(){
if(detectMacXFF()){
Element.show('showgalleryinfo');
if(gGalleriesSupportingLogin.indexOf(gActivatingGallery)>=0)
Element.show('showlogin');
Element.show('gallerytitle');}
else{
new Effect.Appear('showgalleryinfo',{duration:0.5});
if(gGalleriesSupportingLogin.indexOf(gActivatingGallery)>=0)
new Effect.Appear('showlogin',{duration:0.5});
new Effect.Appear('gallerytitle',{duration:0.5});}}
function registerActionHandlers(actionItems){
for(i=0;i<actionItems.length;i++){
Event.observe(actionItems[i],'click',function(e){eval(Element.classNames(Event.element(e))+'OnClick(Event.element(e))')});
Event.observe(actionItems[i],'mouseover',function(e){buttonOver(e);});
Event.observe(actionItems[i],'mousedown',function(e){buttonDown(e);});}}
function buttonSelect(newElem,oldElem){
if(newElem!=null)
$(newElem).src="images/"+$(newElem).id+"_selected.gif";
if((oldElem!=null)&&(newElem!=oldElem))
$(oldElem).src="images/"+oldElem+"_normal.gif";}
function buttonOver(e){
var elem=Event.element(e);
if(elem.id!=gCurrentItem){
elem.src="images/"+elem.id+"_highlight.gif";
setTimeout("if ($('"+elem.id+"').src == \"" + elem.src + "\") $('"+elem.id+"').src = \"images/" + elem.id + "_normal.gif\";",200);}}
function buttonDown(e){
var elem=Event.element(e);
if(elem.id!=gCurrentItem){
elem.src="images/"+elem.id+"_pressed.gif";
setTimeout("if ($('"+elem.id+"').src == \"" + elem.src + "\") $('"+elem.id+"').src = \"images/" + elem.id + "_normal.gif\";",2000);}}
function onLoadHandler(){
new Ajax.Request('serverside/applayout.php',{method:'get',asynchronous:true,onSuccess:appLayoutLoaded});}
function appLayoutLoaded(transport){
document.body.innerHTML=transport.responseText;
registerActionHandlers(['skipintro','btn_showgalleryinfo','btn_showlogin','about','commercial','weddings','people','art','styling','blog','contact']);
Event.observe(window,'resize',function(){positionScreenElements();});
Event.observe('galleryinfoclose','click',function(){hideGalleryInfo();});
Event.observe('fcmodality','click',function(){hideGalleryInfo();});
Event.observe('logo','click',function(){activateSlideShow()});
positionScreenElements();
doIntroStep1();}
function positionScreenElements(){
if(Element.getStyle('curtain','display')=='none'){
Element.setStyle('curtain',{visibility:'hidden',display:''});}
if(Element.getStyle('loading','display')=='none'){
Element.setStyle('loading',{visibility:'hidden',display:''});}
if(Element.getStyle('slideshowbackground','display')=='none'){
Element.setStyle('slideshowbackground',{visibility:'hidden',display:''});}
var siteMargin=Element.getHeight('header');
var winDimensions=getWinDimensions();
winDimensions.width=winDimensions.width>gMaxUsableWidth?gMaxUsableWidth:winDimensions.width;
winDimensions.height=winDimensions.height>gMaxUsableHeight?gMaxUsableHeight:winDimensions.height;
var contentWidth=(winDimensions.width-(siteMargin*2))+'px';
var contentHeight=(winDimensions.height-(siteMargin*2))+'px';
Element.setStyle('outer',{width:winDimensions.width+'px'});
Element.setStyle('header',{width:contentWidth});
Element.setStyle('slideshowbackground',{width:contentWidth});
Element.setStyle('slideshow',{width:(pixStrToInt(contentWidth)-160)+'px'});
Element.setStyle('flashcontent',{width:contentWidth});
Element.setStyle('curtain',{width:contentWidth});
Element.setStyle('fcmodality',{width:contentWidth});
Element.setStyle('footer',{width:contentWidth});
Element.setStyle('outer',{height:winDimensions.height+'px'});
Element.setStyle('leftmargin',{height:winDimensions.height+'px'});
Element.setStyle('rightmargin',{height:winDimensions.height+'px'});
Element.setStyle('slideshowbackground',{height:contentHeight});
Element.setStyle('slideshow',{height:(pixStrToInt(contentHeight)-80)+'px'});
Element.setStyle('flashcontent',{height:contentHeight});
Element.setStyle('contentbackground',{height:contentHeight});
Element.setStyle('curtain',{height:contentHeight});
Element.setStyle('fcmodality',{height:contentHeight});
var footerTop=pixStrToInt(Element.getStyle('flashcontent','top'))+pixStrToInt(Element.getStyle('flashcontent','height'));
Element.setStyle('footer',{top:footerTop+'px'});
Element.setStyle('rightmargin',{left:(40+pixStrToInt(contentWidth))+'px'});
Element.setStyle('copyrite',{top:(siteMargin+pixStrToInt(contentHeight)-20)+'px'});
Element.setStyle('copyrite',{left:(siteMargin+pixStrToInt(contentWidth)-500)+'px'});
centerDivInParent('loading');
var logoWidth=pixStrToInt(Element.getStyle('logo','width'));
var logoOverlap=logoWidth-siteMargin;
var menuItemsLeft=(((pixStrToInt(contentWidth)-logoOverlap)/2)-(pixStrToInt(Element.getStyle('menuitems','width'))/2))+logoWidth;
Element.setStyle('menuitems',{left:menuItemsLeft+'px'});
if(gSlideShow!=null)gSlideShow.resize();
centerDivInWindow('outer');
positionFooterAndIntro(contentWidth,footerTop);
positionGalleryInfo();
positionOtherContent();
if(Element.getStyle('slideshowbackground','visibility')=='hidden'){
Element.setStyle('slideshowbackground',{display:'none',visibility:'visible'});}
if(Element.getStyle('loading','visibility')=='hidden'){
Element.setStyle('loading',{display:'none',visibility:'visible'});}
if(Element.getStyle('curtain','visibility')=='hidden'){
Element.setStyle('curtain',{display:'none',visibility:'visible'});}}
function positionFooterAndIntro(contentWidth,footerTop){
var footerImagineLeft=(pixStrToInt(contentWidth)-570)/2;
var footerCreateLeft=footerImagineLeft+190;
var footerInspireLeft=footerCreateLeft+190;
Element.setStyle('imagine',{left:footerImagineLeft+'px'});
Element.setStyle('create',{left:footerCreateLeft+'px'});
Element.setStyle('inspire',{left:footerInspireLeft+'px'});
if(gIntroCompleted)return;
var outerTop=pixStrToInt(Element.getStyle('outer','top'));
var outerLeft=pixStrToInt(Element.getStyle('outer','left'));
gLogoTop=outerTop+12;
gLogoLeft=outerLeft+11;
gImagineTop=gCreateTop=gInspireTop=footerTop+outerTop;
gImagineLeft=footerImagineLeft+40+outerLeft;
gCreateLeft=footerCreateLeft+40+outerLeft;
gInspireLeft=footerInspireLeft+40+outerLeft;
if(Element.getStyle('skipintro','display')=='none'){
Element.setStyle('skipintro',{visibility:'hidden',display:''});}
if(Element.getStyle('intro_split_logo','display')=='none'){
Element.setStyle('intro_split_logo',{visibility:'hidden',display:''});}
if(Element.getStyle('intro_split_imagine','display')=='none'){
Element.setStyle('intro_split_imagine',{visibility:'hidden',display:''});}
if(Element.getStyle('intro_split_create','display')=='none'){
Element.setStyle('intro_split_create',{visibility:'hidden',display:''});}
if(Element.getStyle('intro_split_inspire','display')=='none'){
Element.setStyle('intro_split_inspire',{visibility:'hidden',display:''});}
var winDims=getWinDimensions();
Element.setStyle('intro',{width:winDims.width+'px',height:winDims.height+'px'});
centerDivInWindow('intro');
Element.setStyle('introslideshow',{width:winDims.width+'px',height:winDims.height+'px'});
centerDivInParent('introslideshow');
centerDivInParent('intro_dummy_logo');
var logoTop=pixStrToInt(Element.getStyle('intro_dummy_logo','top'));
var logoLeft=pixStrToInt(Element.getStyle('intro_dummy_logo','left'));
var logoImagineOffset=217;
var logoCreateOffset=251;
var logoInspireOffset=284;
Element.setStyle('intro_split_logo',{top:logoTop+'px',left:logoLeft+'px',height:'220px'});
Element.setStyle('intro_split_imagine',{top:(logoTop+logoImagineOffset)+'px',left:logoLeft+'px'});
Element.setStyle('intro_split_create',{top:(logoTop+logoCreateOffset)+'px',left:logoLeft+'px'});
Element.setStyle('intro_split_inspire',{top:(logoTop+logoInspireOffset)+'px',left:logoLeft+'px'});
if(gIntroSlideShow!=null)gIntroSlideShow.resize();
Element.setStyle('skipintro',{left:(winDims.width-100)+'px',top:(winDims.height-25)+'px'});
if(Element.getStyle('intro_split_inspire','visibility')=='hidden'){
Element.setStyle('intro_split_inspire',{display:'none',visibility:'visible'});}
if(Element.getStyle('intro_split_create','visibility')=='hidden'){
Element.setStyle('intro_split_create',{display:'none',visibility:'visible'});}
if(Element.getStyle('intro_split_imagine','visibility')=='hidden'){
Element.setStyle('intro_split_imagine',{display:'none',visibility:'visible'});}
if(Element.getStyle('intro_split_logo','visibility')=='hidden'){
Element.setStyle('intro_split_logo',{display:'none',visibility:'visible'});}
if(Element.getStyle('skipintro','visibility')=='hidden'){
Element.setStyle('skipintro',{display:'none',visibility:'visible'});}}
function positionGalleryInfo(){
if(Element.getStyle('galleryinfo','display')=='none'){
Element.setStyle('galleryinfo',{visibility:'hidden',display:''});}
if(Element.getStyle('gallerytitle','display')=='none'){
Element.setStyle('gallerytitle',{visibility:'hidden',display:''});}
if(Element.getStyle('showgalleryinfo','display')=='none'){
Element.setStyle('showgalleryinfo',{visibility:'hidden',display:''});}
if(Element.getStyle('showlogin','display')=='none'){
Element.setStyle('showlogin',{visibility:'hidden',display:''});}
var siteMargin=Element.getHeight('header');
var stagePadding=40;
var thumbsWidth=224;
var thumbsHeight=224;
var titlePadding=8;
var infoPadding=14;
var maxImageWidth=600;
var maxOverallWidth=(stagePadding*3)+thumbsWidth+maxImageWidth;
var galleryDimensions=Element.getDimensions('outer');
galleryDimensions.width-=siteMargin*2;
galleryDimensions.height-=siteMargin*2;
var galleryInfoDimensions=Element.getDimensions('galleryinfo');
var showGalleryInfoDimensions=Element.getDimensions('showgalleryinfo');
var showLoginDimensions=Element.getDimensions('showlogin');
var galleryTitleDimensions=Element.getDimensions('gallerytitle');
if(galleryDimensions.width<=maxOverallWidth){
var estimatedImageSize=galleryDimensions.width-((stagePadding*3)+thumbsWidth);
var imageLeft=(siteMargin+(stagePadding*2)+thumbsWidth+((estimatedImageSize-galleryInfoDimensions.width)/2))+'px';
Element.setStyle('galleryinfo',{left:imageLeft});
Element.setStyle('gallerytitle',{left:(siteMargin+stagePadding+((thumbsWidth-galleryTitleDimensions.width)/2))+'px'});
Element.setStyle('showgalleryinfo',{left:(siteMargin+stagePadding+((thumbsWidth-showGalleryInfoDimensions.width)/2))+'px'});
Element.setStyle('showlogin',{left:(siteMargin+stagePadding+((thumbsWidth-showLoginDimensions.width)/2))+'px'});}
else{
var estimatedImageSize=maxImageWidth;
var imageLeft=(siteMargin+((galleryDimensions.width-maxOverallWidth)/2)+(stagePadding*2)+thumbsWidth+((maxImageWidth-galleryInfoDimensions.width)/2))+'px';
Element.setStyle('galleryinfo',{left:imageLeft});
Element.setStyle('gallerytitle',{left:(siteMargin+((galleryDimensions.width-maxOverallWidth)/2)+stagePadding+((thumbsWidth-galleryTitleDimensions.width)/2))+'px'});
Element.setStyle('showgalleryinfo',{left:(siteMargin+((galleryDimensions.width-maxOverallWidth)/2)+stagePadding+((thumbsWidth-showGalleryInfoDimensions.width)/2))+'px'});
Element.setStyle('showlogin',{left:(siteMargin+((galleryDimensions.width-maxOverallWidth)/2)+stagePadding+((thumbsWidth-showLoginDimensions.width)/2))+'px'});}
verCenterDivInParent('galleryinfo');
Element.setStyle('gallerytitle',{top:(siteMargin+((galleryDimensions.height-thumbsHeight)/2)-titlePadding-galleryTitleDimensions.height)+'px'});
Element.setStyle('showgalleryinfo',{top:(siteMargin+((galleryDimensions.height-thumbsHeight)/2)+thumbsHeight+infoPadding)+'px'});
Element.setStyle('showlogin',{top:(siteMargin+((galleryDimensions.height-thumbsHeight)/2)+thumbsHeight+infoPadding+showGalleryInfoDimensions.height+infoPadding)+'px'});
if(Element.getStyle('galleryinfo','visibility')=='hidden'){
Element.setStyle('galleryinfo',{display:'none',visibility:'visible'});}
if(Element.getStyle('showlogin','visibility')=='hidden'){
Element.setStyle('showlogin',{display:'none',visibility:'visible'});}
if(Element.getStyle('showgalleryinfo','visibility')=='hidden'){
Element.setStyle('showgalleryinfo',{display:'none',visibility:'visible'});}
if(Element.getStyle('gallerytitle','visibility')=='hidden'){
Element.setStyle('gallerytitle',{display:'none',visibility:'visible'});}}
function positionOtherContent(){
if(Element.getStyle('othercontent','display')=='none'){
Element.setStyle('othercontent',{visibility:'hidden',display:''});}
var siteMargin=Element.getHeight('header');
var outerMargin=20;
var otherContentTextBorder=10;
var outerDimensions=Element.getDimensions('outer');
var otherContentDimensions=Element.getDimensions('othercontent');
otherContentDimensions.width=outerDimensions.width-(outerMargin*2)-(siteMargin*2);
otherContentDimensions.height=outerDimensions.height-(outerMargin*2)-(siteMargin*2);
Element.setStyle('othercontent',{width:otherContentDimensions.width+'px'});
Element.setStyle('othercontent',{height:otherContentDimensions.height+'px'});
centerDivInParent('othercontent');
Element.setStyle('othercontentmargin',{height:otherContentDimensions.height+'px'});
_positionOtherContentMarginImages();
Element.setStyle('othercontenttext',{width:(otherContentDimensions.width-(Element.getWidth('othercontentmargin')+outerMargin)-(otherContentTextBorder*2))+'px'});
Element.setStyle('othercontenttext',{height:(otherContentDimensions.height-(otherContentTextBorder*2))+'px'});
if(gOtherContentVisible==true)gOtherContentScroller.resetScrollbar(true);
if(Element.getStyle('othercontent','visibility')=='hidden'){
Element.setStyle('othercontent',{display:'none',visibility:'visible'});}}
function doIntroStep1(){
var imagesToPreLoad=',{"src":"images/skipintro_normal.gif","preLoad":true,"skip":true},{"src":"images/skipintro_highlight.gif","preLoad":true,"skip":true},{"src":"images/skipintro_pressed.gif","preLoad":true,"skip":true}'+
',{"src":"images/intro_split_logo.jpg","preLoad":true,"skip":true},{"src":"images/intro_split_imagine.gif","preLoad":true,"skip":true},{"src":"images/intro_split_create.gif","preLoad":true,"skip":true},{"src":"images/intro_split_inspire.gif","preLoad":true,"skip":true}'+
',{"src":"images/logo.gif","preLoad":true,"skip":true},{"src":"images/close.gif","preLoad":true,"skip":true},{"src":"images/hourglass_grey.gif","preLoad":true,"skip":true}'+
',{"src":"images/btn_showgalleryinfo_normal.gif","preLoad":true,"skip":true},{"src":"images/btn_showgalleryinfo_highlight.gif","preLoad":true,"skip":true},{"src":"images/btn_showgalleryinfo_pressed.gif","preLoad":true,"skip":true}'+
',{"src":"images/btn_showlogin_normal.gif","preLoad":true,"skip":true},{"src":"images/btn_showlogin_highlight.gif","preLoad":true,"skip":true},{"src":"images/btn_showlogin_pressed.gif","preLoad":true,"skip":true}'+
',{"src":"images/about_normal.gif","preLoad":true,"skip":true},{"src":"images/about_highlight.gif","preLoad":true,"skip":true},{"src":"images/about_pressed.gif","preLoad":true,"skip":true},{"src":"images/about_selected.gif","preLoad":true,"skip":true}'+
',{"src":"images/commercial_normal.gif","preLoad":true,"skip":true},{"src":"images/commercial_highlight.gif","preLoad":true,"skip":true},{"src":"images/commercial_pressed.gif","preLoad":true,"skip":true},{"src":"images/commercial_selected.gif","preLoad":true,"skip":true}'+
',{"src":"images/weddings_normal.gif","preLoad":true,"skip":true},{"src":"images/weddings_highlight.gif","preLoad":true,"skip":true},{"src":"images/weddings_pressed.gif","preLoad":true,"skip":true},{"src":"images/weddings_selected.gif","preLoad":true,"skip":true}'+
',{"src":"images/people_normal.gif","preLoad":true,"skip":true},{"src":"images/people_highlight.gif","preLoad":true,"skip":true},{"src":"images/people_pressed.gif","preLoad":true,"skip":true},{"src":"images/people_selected.gif","preLoad":true,"skip":true}'+
',{"src":"images/art_normal.gif","preLoad":true,"skip":true},{"src":"images/art_highlight.gif","preLoad":true,"skip":true},{"src":"images/art_pressed.gif","preLoad":true,"skip":true},{"src":"images/art_selected.gif","preLoad":true,"skip":true}'+
',{"src":"images/styling_normal.gif","preLoad":true,"skip":true},{"src":"images/styling_highlight.gif","preLoad":true,"skip":true},{"src":"images/styling_pressed.gif","preLoad":true,"skip":true},{"src":"images/styling_selected.gif","preLoad":true,"skip":true}'+
',{"src":"images/blog_normal.gif","preLoad":true,"skip":true},{"src":"images/blog_highlight.gif","preLoad":true,"skip":true},{"src":"images/blog_pressed.gif","preLoad":true,"skip":true},{"src":"images/blog_selected.gif","preLoad":true,"skip":true}'+
',{"src":"images/contact_normal.gif","preLoad":true,"skip":true},{"src":"images/contact_highlight.gif","preLoad":true,"skip":true},{"src":"images/contact_pressed.gif","preLoad":true,"skip":true},{"src":"images/contact_selected.gif","preLoad":true,"skip":true}'+
',{"src":"images/scrollarrowup.gif","preLoad":true,"skip":true},{"src":"images/scrollarrowdown.gif","preLoad":true,"skip":true}';
if(detectMacXFF()){
imagesToPreLoad+=',{"src":"images/macff_invisible.png","preLoad":true,"skip":true},{"src":"images/macff_transparent.png","preLoad":true,"skip":true}';}
var imageinfo='[{"src":"images/intro.jpg","transitionDelay":1.0,"fadeInEffect":"Effect.Grow","fadeInEffectOptions":{"duration":2.0},"border":"0px","displayTime":0.5,"fadeOutEffect":"Effect.Fade"},{"src":"images/slideshow/20080828_01.jpg"},{"src":"images/slideshow/20080828_02.jpg"},{"src":"images/slideshow/20080828_03.jpg"},{"src":"images/slideshow/20080828_04.jpg"}'+imagesToPreLoad+']';
gIntroSlideShow=new SlideShow('introslideshow',imageinfo,{loadingIconPath:'images/hourglass_black.gif',onCompleteHandler:doIntroStep2,cycleSlides:false,onPreloadHandler:introPreloadDone,fadeOutLast:true});}
function doIntroStep2(){
new Effect.Fade('skipintro');
setTimeout("new Effect.Appear('intro_split_logo')",0);
setTimeout("new Effect.Appear('intro_split_imagine',{duration:1.0})",gDoQuickIntro?0:2000);
setTimeout("new Effect.Appear('intro_split_create')",gDoQuickIntro?0:3500);
setTimeout("new Effect.Appear('intro_split_inspire')",gDoQuickIntro?0:5000);
setTimeout("new Effect.Morph('intro_split_imagine',{style:'top:'+gImagineTop+'px;left:'+gImagineLeft+'px;'})",gDoQuickIntro?1500:6500);
setTimeout("new Effect.Morph('intro_split_create',{style:'top:'+gCreateTop+'px;left:'+gCreateLeft+'px;'})",gDoQuickIntro?1500:6500);
setTimeout("new Effect.Morph('intro_split_inspire',{style:'top:'+gInspireTop+'px;left:'+gInspireLeft+'px;'})",gDoQuickIntro?1500:6500);
setTimeout("new Effect.Morph('intro_split_logo',{style:'top:'+gLogoTop+'px;left:'+gLogoLeft+'px;height:100px;width:86px;', afterFinish : doIntroStep3})",gDoQuickIntro?1500:6500);}
function doIntroStep3(){
Element.setStyle('outer',{visibility:"visible"});
new Effect.Fade("intro",{afterFinish:function(e){gIntroCompleted=true;Element.setStyle('outer',{zIndex:0});}});
var initialSection=getInitialSection();
if(initialSection=='index')
activateSlideShow();
else if(['about','styling','contact'].indexOf(initialSection)!=-1)
showOtherContent(initialSection);
else if(['blog'].indexOf(initialSection)!=-1)
var doNothing=1;
else
activateGallery(initialSection);}
function introPreloadDone(){
$('skipintro').src="images/skipintro_normal.gif";
$('intro_split_logo').src="images/intro_split_logo.jpg";
$('intro_split_imagine').src="images/intro_split_imagine.gif";
$('intro_split_create').src="images/intro_split_create.gif";
$('intro_split_inspire').src="images/intro_split_inspire.gif";
$('imglogo').src="images/logo.gif";
$('btn_showgalleryinfo').src="images/btn_showgalleryinfo_normal.gif";
$('btn_showlogin').src="images/btn_showlogin_normal.gif";
$('about').src="images/about_normal.gif";
$('commercial').src="images/commercial_normal.gif";
$('weddings').src="images/weddings_normal.gif";
$('people').src="images/people_normal.gif";
$('art').src="images/art_normal.gif";
$('styling').src="images/styling_normal.gif";
$('blog').src="images/blog_normal.gif";
$('contact').src="images/contact_normal.gif";
$('imggalleryinfoclose').src="images/close.gif";
$('imgloading').src="images/hourglass_grey.gif";
$('imagine').src="images/intro_split_imagine.gif";
$('create').src="images/intro_split_create.gif";
$('inspire').src="images/intro_split_inspire.gif";
new Effect.Appear('skipintro');}
function skipintroOnClick(element){
$('skipintro').src='images/skipintro_normal.gif';
new Effect.Fade('skipintro');
if(gIntroSlideShow!=null){
gDoQuickIntro=true;
gIntroSlideShow.stop();}}
var handlingSlideShowEvent=false;
function deactivateSlideShow(){
if(!handlingSlideShowEvent){
if(gSlideShow!=null){
gSlideShow.pause();
Element.hide('slideshowbackground');}}}
function activateSlideShow(){
if(gCurrentItem=='slideshow')
return;
if((gCurrentItem!='slideshow')&&!handlingSlideShowEvent){
handlingSlideShowEvent=true;
buttonSelect(null,gCurrentItem);
gCurrentItem='slideshow';
new Effect.Appear('curtain',{duration:0.8,afterFinish:activateSlideShowDone});}}
function activateSlideShowDone(){
hideGalleryInfo(true);
hideOtherContent();
Element.setStyle('contentbackground',{zIndex:4});
if(gActiveGallery){
Element.removeClassName(gGalleryCache[gActiveGallery].id,'flashgallery');
Element.addClassName(gGalleryCache[gActiveGallery].id,'flashgalleryhidden');}
Element.hide('gallerytitle');
Element.hide('showgalleryinfo');
Element.hide('showlogin');
Element.show('slideshowbackground');
if(gSlideShow==null){
var imageinfo='[{"src":"images/slideshow/20080828_05.jpg"},{"src":"images/slideshow/20080828_06.jpg"},{"src":"images/slideshow/20080828_07.jpg"},{"src":"images/slideshow/20080828_08.jpg"},{"src":"images/slideshow/20080828_01.jpg"},{"src":"images/slideshow/20080828_02.jpg"},{"src":"images/slideshow/20080828_03.jpg"},{"src":"images/slideshow/20080828_04.jpg"}]';
gSlideShow=new SlideShow('slideshow',imageinfo,{loadingIconPath:'images/hourglass_grey.gif'});}
else{
gSlideShow.resize();
gSlideShow.unpause();}
new Effect.Fade('curtain',{duration:0.8});
handlingSlideShowEvent=false;}
function actiongalleryOnClick(element){
activateGallery(element.id)}
function activateGallery(galleryName,noFading){
if(gCurrentItem==galleryName)
return;
gActivatingGallery=galleryName;
buttonSelect(gActivatingGallery,gCurrentItem);
if(noFading){
_activateGallery(null);}
else{
if(detectMacXFF()){
Element.show('curtain');
_activateGallery(true);}
else{
new Effect.Appear('curtain',{duration:0.5,afterFinish:_activateGallery});}}}
function _activateGallery(effectObj){
deactivateSlideShow();
hideOtherContent();
hideGalleryInfo(true);
Element.hide('showgalleryinfo');
Element.hide('showlogin');
Element.hide('gallerytitle');
Element.setStyle('contentbackground',{zIndex:2});
if(gActiveGallery&&(gActivatingGallery!=gActiveGallery)){
Element.setStyle(gGalleryCache[gActiveGallery].id,{zIndex:1});
Element.removeClassName(gGalleryCache[gActiveGallery].id,'flashgallery');
Element.addClassName(gGalleryCache[gActiveGallery].id,'flashgalleryhidden');}
$('gallerytitleimg').src="images/"+gActivatingGallery+"_gallerytitle.gif";
if(gGalleryCache[gActivatingGallery]==null){
gGalleryCache[gActivatingGallery]=Element.extend(Builder.node('div'));
gGalleryCache[gActivatingGallery].id="gallery"+gActivatingGallery;
$('flashcontent').appendChild(gGalleryCache[gActivatingGallery]);
Element.addClassName(gGalleryCache[gActivatingGallery].id,"flashgallery");
$(gGalleryCache[gActivatingGallery].id).update('This website requires Macromedia Flash. <a href="http://www.macromedia.com/go/getflashplayer/"><b>Click Here to Get Macromedia Flash.</b></a> If you have Flash installed, <a href="index.html?detectflash=false"><b>click to view gallery</b></a>');
var fo=new SWFObject("flash/viewer.swf","viewer","100%","100%","7","#222222");
fo.addParam("wmode","transparent");
fo.addVariable("xmlDataPath","galleries/"+gActivatingGallery+"/gallery.xml");
fo.write(gGalleryCache[gActivatingGallery].id);}
else{
Element.removeClassName(gGalleryCache[gActivatingGallery].id,'flashgalleryhidden');
Element.addClassName(gGalleryCache[gActivatingGallery].id,"flashgallery");
Element.show('showgalleryinfo');
if(gGalleriesSupportingLogin.indexOf(gActivatingGallery)>=0)
Element.show('showlogin');
Element.show('gallerytitle');}
Element.setStyle(gGalleryCache[gActivatingGallery].id,{zIndex:3});
gActiveGallery=gActivatingGallery;
gCurrentItem=gActivatingGallery;
if(effectObj){
if(detectMacXFF())
Element.hide('curtain');
else
new Effect.Fade('curtain',{duration:0.5});}}
var handlingLoginEvent=false;
function actionloginOnClick(element){
if(gGalleriesSupportingLogin.indexOf(gActiveGallery)>=0){
gActivatingLoginInfo=gActiveGallery+'_login';
showGalleryInfo();}}
var handlingGalleryInfoEvent=false;
function actiongalleryinfoOnClick(element){
showGalleryInfo();}
function showGalleryInfo(){
if(!handlingGalleryInfoEvent){
handlingGalleryInfoEvent=true;
if(detectMacXFF()){
Element.setStyle('fcmodality',{background:"url('images/macff_invisible.png') repeat"});
Element.setStyle('galleryinfobackground',{background:"url('images/macff_transparent.png') repeat"});}
else{
Element.setOpacity('fcmodality',0);
Element.setOpacity('galleryinfobackground',0.9);}
$('btn_showgalleryinfo').src="images/btn_showgalleryinfo_normal.gif";
$('btn_showlogin').src="images/btn_showlogin_normal.gif";
Element.show('fcmodality');
Element.setStyle('galleryinfotext',{visibility:'hidden'});
new Effect.BlindDown('galleryinfo',{beforeStart:activateGalleryInfo,afterFinish:showGalleryInfoDone});}}
function showGalleryInfoDone(){
handlingGalleryInfoEvent=false;}
function hideGalleryInfo(quick){
if(!handlingGalleryInfoEvent){
handlingGalleryInfoEvent=true;
if(quick){
Element.hide('galleryinfo');
hideGalleryInfoDone(quick);}
else{
new Effect.BlindUp('galleryinfo',{afterFinish:hideGalleryInfoDone});}}}
function hideGalleryInfoDone(quick){
if(quick){}
else{}
Element.hide('fcmodality');
handlingGalleryInfoEvent=false;}
function activateGalleryInfo(){
if((!gActivatingLoginInfo)&&(gActiveGallery==gActiveGalleryInfo)){
Element.setStyle('galleryinfotext',{visibility:'visible'});
return;}
if(gActivatingLoginInfo!=null){
gActivatingGalleryInfo=gActivatingLoginInfo;
gActivatingLoginInfo=null;}
else
gActivatingGalleryInfo=gActiveGallery;
if(gGalleryInfoCache[gActivatingGalleryInfo]==null){
if(Element.getStyle('galleryinfo','display')=='none'){
Element.setStyle('galleryinfo',{visibility:'hidden',display:''});}
$('galleryinfotext').update('<img id="galleryinfoloading" src="images/hourglass_black.gif" alt="Loading..." />');
centerDivInParent('galleryinfoloading');
Element.setStyle('galleryinfotext',{visibility:'visible'});
if(Element.getStyle('galleryinfo','visibility')=='hidden'){
Element.setStyle('galleryinfo',{display:'none',visibility:'visible'});}
new Ajax.Updater('galleryinfotext','content/'+gActivatingGalleryInfo+'.php',{method:'get',asynchronous:true,onComplete:_activateGalleryInfo});}
else{
$('galleryinfotext').update(gGalleryInfoCache[gActivatingGalleryInfo]);
Element.setStyle('galleryinfotext',{visibility:'visible'});
_activateGalleryInfo(null);}}
function _activateGalleryInfo(request){
if(request!=null){
gGalleryInfoCache[gActivatingGalleryInfo]=request.responseText;}
externalLinks();
gActiveGalleryInfo=gActivatingGalleryInfo;}
function actionhyperlinkOnClick(element){
window.open('http://blog.dayates.com.au/');}
var handlingOtherContentEvent=false;
function hideOtherContent(){
gOtherContentVisible=false;
Element.hide('othercontent');}
function actionothercontentOnClick(element){
showOtherContent(element.id);}
function showOtherContent(contentName){
if((gCurrentItem!=contentName)&&!handlingOtherContentEvent){
handlingOtherContentEvent=true;
buttonSelect(contentName,gCurrentItem);
gCurrentItem=contentName;
new Effect.Appear('curtain',{duration:0.8,afterFinish:showOtherContentDone});}}
function showOtherContentDone(){
hideGalleryInfo(true);
deactivateSlideShow();
Element.setStyle('contentbackground',{zIndex:4});
if(gActiveGallery){
Element.removeClassName(gGalleryCache[gActiveGallery].id,'flashgallery');
Element.addClassName(gGalleryCache[gActiveGallery].id,'flashgalleryhidden');}
Element.hide('gallerytitle');
Element.hide('showgalleryinfo');
Element.hide('showlogin');
Element.show('othercontent');
gOtherContentVisible=true;
if(activateOtherContent(gCurrentItem)){
new Effect.Fade('curtain',{duration:0.8});}
handlingOtherContentEvent=false;}
function activateOtherContent(contentName){
if(contentName==gActiveOtherContent){
gOtherContentScroller.resetScrollbar(true);
return true;}
gActivatingOtherContent=contentName;
if(gOtherContentCache[gActivatingOtherContent]==null){
Element.show('loading');
new Ajax.Updater('othercontenttext','content/'+gActivatingOtherContent+'.php',{method:'get',asynchronous:true,onComplete:_activateOtherContent});}
else{
$('othercontenttext').update(gOtherContentCache[gActivatingOtherContent]);
_activateOtherContent(null);}
return false;}
function _activateOtherContent(request){
if(request!=null){
gOtherContentCache[gActivatingOtherContent]=request.responseText;
var maxMarginImages=document.getElementsByClassName('margin-image').length;
var imagesToPreLoad='[{"src":"images/scrollarrowup.gif","preLoad":true,"skip":true},{"src":"images/scrollarrowdown.gif","preLoad":true,"skip":true}';
for(var i=0;i<maxMarginImages;i++)
imagesToPreLoad+=',{"src":"'+'images/margin/'+gActivatingOtherContent+(i+1)+'.jpg","preLoad":true,"skip":true}';
if(gActivatingOtherContent=="about")
imagesToPreLoad+=',{"src":"images/denise.jpg","preLoad":true,"skip":true}';
if(gActivatingOtherContent=="styling")
imagesToPreLoad+=',{"src":"images/meg.jpg","preLoad":true,"skip":true},{"src":"images/style-fusion-logo.jpg","preLoad":true,"skip":true}';
if(gActivatingOtherContent=="contact")
imagesToPreLoad+=',{"src":"images/comboarrow.gif","preLoad":true,"skip":true},{"src":"images/denise.jpg","preLoad":true,"skip":true}';
imagesToPreLoad+=']';
new SlideShow('othercontentimagepreloader',imagesToPreLoad,{onPreloadHandler:_activateOtherContent});
return;}
gOtherContentScroller=new Scroller($('othercontenttext'));
externalLinks();
if(gActivatingOtherContent=='contact'){
gComboBox=new ComboBox('hearaboutus',[],{});}
_loadOtherContentMarginImages(gActivatingOtherContent);
setTimeout("Element.hide('loading'); new Effect.Fade('curtain',{ duration : 0.8 });",20);
gActiveOtherContent=gActivatingOtherContent;}
function _positionOtherContentMarginImages(){
var minVerticalPadding=10;
var topVerticalPadding=80;
var marginHeight=Element.getHeight('othercontentmargin')-topVerticalPadding;
var maxMarginImages=document.getElementsByClassName('margin-image').length;
var marginImageWidth=104;
var marginImageHeight=124;
var numVisibleImages=maxMarginImages;
var verticalPadding=minVerticalPadding;
while((marginImageHeight*numVisibleImages)+(minVerticalPadding*(numVisibleImages+1))>marginHeight)
numVisibleImages--;
verticalPadding=(marginHeight-(marginImageHeight*numVisibleImages))/(numVisibleImages+1);
for(var i=0;i<maxMarginImages;i++)
Element.setStyle('midiv'+(i+1),{top:(topVerticalPadding+verticalPadding+(i*(verticalPadding+marginImageHeight)))+'px'});}
function _loadOtherContentMarginImages(contentName){
var maxMarginImages=document.getElementsByClassName('margin-image').length;
for(var i=0;i<maxMarginImages;i++)
$('mi'+(i+1)).src='images/margin/'+contentName+(i+1)+'.jpg';}
function getInitialSection(){
var queryParams=document.location.href.toQueryParams();
var validSections=new Array('about','commercial','weddings','people','art','styling','blog','contact');
var initialSection='index';
if(queryParams['section']&&validSections.indexOf(queryParams['section'].toLowerCase())!=-1)
initialSection=queryParams['section'].toLowerCase();
return(initialSection);}
Event.observe(window,'load',function(){onLoadHandler();});

