
function thisMovie(movieName){if(navigator.appName.indexOf("Microsoft")!=-1){return window[movieName]}else{return document[movieName]}}
function movieIsLoaded(theMovie){if(typeof(theMovie)!="undefined"){return theMovie.PercentLoaded()==100;}else{return false;}}
function playkitchen(){if(movieIsLoaded(getFlashMovieObject(movieName))){var marginBox=dojo.marginBox(dojo.byId("kmenu"));if(marginBox.h<30){getFlashMovieObject(movieName).TGotoFrame("_level0/",55);getFlashMovieObject(movieName).TPlay("_level0/");}}}
function playbar(){if(movieIsLoaded(getFlashMovieObject(movieName))){var marginBox=dojo.marginBox(dojo.byId("bmenu"));if(marginBox.h<30){getFlashMovieObject(movieName).TGotoFrame("_level0/",3);getFlashMovieObject(movieName).TPlay("_level0/");}}}
function startbar(){if(movieIsLoaded(getFlashMovieObject(movieName))){getFlashMovieObject(movieName).TGotoFrame("_level0/",38);getFlashMovieObject(movieName).TPlay("_level0/");}}
function startintro(){if(movieIsLoaded(getFlashMovieObject(introMovie))){getFlashMovieObject(introMovie).TGotoFrame("_level0/",3);getFlashMovieObject(introMovie).TPlay("_level0/");}}
function getFlashMovieObject(movieName)
{if(window.document[movieName])
{return window.document[movieName];}
if(navigator.appName.indexOf("Microsoft Internet")==-1)
{if(document.embeds&&document.embeds[movieName])
return document.embeds[movieName];}
else{return document.getElementById(movieName);}}
dojo.require("dojo.fx.easing");var fadeBOut=dojo.fadeOut({node:"background1",duration:1000});var fadeBIn=dojo.fadeIn({node:"background1",duration:1000});var fadeKOut=dojo.fadeOut({node:"background2",duration:1000});var fadeKIn=dojo.fadeIn({node:"background2",duration:1000});dojo.require("dojo.fx");
function OnetoTwo(){dojo.fadeOut({node:"background1",duration:1000}).play();dojo.fadeIn({node:"background2",duration:1000}).play();}
function TwotoOne(){dojo.fadeOut({node:"background2",duration:1000}).play();dojo.fadeIn({node:"background1",duration:1000}).play();}
function ChangeContent(pagetoturnon){dojo.fadeOut({node:"background2",duration:1000}).play();dojo.fadeIn({node:pagetoturnon,duration:1000}).play();}
function blink(){var fadeout=dojo.fadeOut({node:'contentbox',duration:500});var fadein=dojo.fadeIn({node:'contentbox',duration:500});dojo.fx.chain([fadeout,fadein]).play();}
function getText(pagetoget){var defer=function(){pagetoget="../simcms/"+pagetoget;dojo.xhrGet({url:pagetoget,load:function(response,ioArgs){dojo.byId("contentbox").innerHTML=response;return response;},error:function(response,ioArgs){dojo.byId("contentbox").innerHTML="An error occurred, with response: "+response;return response;},handleAs:"text",timeout:2000});}
setTimeout(defer,500);blink();}
function doAll(){getText();doAnimation();doSlide();}
function KtoB(){dojo.animateProperty({node:"kmenu",duration:1000,properties:{height:{end:28}}}).play();dojo.animateProperty({node:"bmenu",duration:1000,properties:{height:{end:170}}}).play();TwotoOne();dijit.byId('mainTabContainer').selectChild(dijit.byId('bar'));}
function BtoK(){dojo.animateProperty({node:"bmenu",duration:1000,properties:{height:{end:28}}}).play();dojo.animateProperty({node:"kmenu",duration:1000,properties:{height:{end:170}}}).play();OnetoTwo();dijit.byId('mainTabContainer').selectChild(dijit.byId('kitchen'));}
dojo.require("dojo.parser");dojo.require("dijit.layout.ContentPane");dojo.require("dijit.layout.StackContainer");function FadeIntro(){baron('bar_01k','bar_00');dojo.animateProperty({node:"introflash",duration:0,properties:{height:{end:1}}}).play();toggleLayerOff('introflash');var fooNode=dojo.byId("flashbox");dojo.style(fooNode,{visibility:"visible"});dijit.byId('mainTabContainer').selectChild(dijit.byId('kitchen'));}
function FadeBar(){var moviename2='topnav';baron('bar_01b','bar_00');dojo.animateProperty({node:"kmenu",duration:1000,properties:{height:{end:28}}}).play();dojo.animateProperty({node:"bmenu",duration:1000,properties:{height:{end:170}}}).play();TwotoOne();dojo.animateProperty({node:"introflash",duration:0,properties:{height:{end:1}}}).play();var fooNode=dojo.byId("flashbox");dojo.style(fooNode,{visibility:"visible"});toggleLayerOff('introflash');playbar();}
function PlayIntroFlash(){toggleLayerOff('preintro');}
function toggleLayerOff(whichLayer){if(document.getElementById)
{var style2=document.getElementById(whichLayer).style;style2.display="none";}else if(document.all){var style2=document.all[whichLayer].style;style2.display="none";}else if(document.layers){var style2=document.layers[whichLayer].style;style2.display="none";}}
function baron(imgName,destName){imgOn=eval(imgName+".src");document[destName].src=imgOn;}
