IE=false,AOL=false,SF=false,MZ=false,OP=false;if(navigator.appName=="Microsoft Internet Explorer"){IE=true;if(navigator.userAgent.indexOf("AOL")>=0)AOL=true;}
else if(navigator.userAgent.indexOf("Safari")>=0)SF=true;else if(navigator.appName=="Netscape")MZ=true;else if(navigator.appName=="Opera")OP=true;winOS=(navigator.platform.substring(0,3)=="Win");winIE=(winOS&&IE);macOS=(navigator.platform.substring(0,3)=="Mac");macIE=(macOS&&IE);theHost=document.location.hostname;local = ( /^\d+\.\d+\.\d+\.\d+$/.test(theHost)||theHost==""||theHost=="localhost");live=!local;qStr=unescape(document.location.search).substring(1);homePage="default.aspx"
path=document.location.pathname;delimeter=(path.indexOf("\\")>=0)?"\\":"/";if(path.charAt(path.length-1)==delimeter)path+=homePage;Path=path.split(delimeter);fileName=Path[Path.length-1];if(typeof window.DB=="object"){if(typeof window.DB.Administrators=="object"){for(var key in DB.Administrators){eMailOut="";eMailIn=DB.Administrators[key][0].replace(/\s{2}/g, "." );
eMailIn=eMailIn.replace(/\s{1}/g, "@" );
for(i=0;i<=eMailIn.length;i++)eMailOut=eMailIn.charAt(i)+eMailOut;DB.Administrators[key][0]=eMailOut;}}
if(typeof window.DB.Contact=="object"){eMailOut="";eMailIn=DB.Contact.Email.replace(/\s{2}/g, "." );
eMailIn=eMailIn.replace(/\s{1}/g, "@" );
for(i=0;i<=eMailIn.length;i++)eMailOut=eMailIn.charAt(i)+eMailOut;DB.Contact.Email=eMailOut;}}
pathSecure="https://www.konacoffeehawaii.biz/";pathUnsecure="http://www.konacoffeehawaii.biz/";testEmail="David"+"@DavidRegier.com";Settings=new Array();Settings.IeTransNum=2;Settings.transDur=.8;Settings.folder="images/";Settings.defaultCaption="Downes Grounds &nbsp;&#149;&nbsp; 100% Kona Coffee";Settings.borderWidDW=2;Settings.disableContextImgMenu=1;Settings.SS=new Array();Settings.SS.speed=4.5;Settings.SS.randomStart=0;Settings.SS.Music=[null];if(local)Settings.SS.randomStart=0;Settings.TN=new Array();Settings.TN.ProgressBar=new Array();Settings.TN.ProgressBar.hideOnSuccess=1;Settings.TN.ProgressBar.width=350;Settings.TN.ProgressBar.progressColor="rgb( 153,0,0 )";Settings.TN.ProgressBar.bgColor="rgb( 171,131,66 )";Settings.TN.ProgressBar.fontColor="rgb( 255,255,255 )";Settings.TN.bordColOff="rgb( 221,209,189 )";Settings.TN.bordColOn="rgb( 204,0,0 )";Settings.TN.pageTitle="Demo: Photo Presentation Software";Settings.TN.align="center";Settings.TN.nImagesRow=8;Settings.TN.width=100;Settings.TN.height=100;function getCookieDomain(){var cookieDomain=null;if(live&&theHost){var Host=theHost.split("."),hLen=Host.length;if(hLen>=2)cookieDomain="."+Host[hLen-2]+"."+Host[hLen-1];}
return cookieDomain;}
function getCookieVal(offset){var endstr=document.cookie.indexOf(";",offset);if(endstr==-1)endstr=document.cookie.length;return unescape(document.cookie.substring(offset,endstr));}
function GetCookie(name){var arg=name+"=";var alen=arg.length;var clen=document.cookie.length;var i=0;while(i<clen){var j=i+alen;if(document.cookie.substring(i,j)==arg)return getCookieVal(j);i=document.cookie.indexOf(" ",i)+1;if(i==0)break;}
  return null;}
function SetCookie(name,value,expires){var path="/",domain=getCookieDomain(),secure=null;document.cookie=name+"="+escape(value)+((expires)?"; expires="+expires.toGMTString():"")+((path)?"; path="+path:"")+((domain)?"; domain="+domain:"")+((secure)?"; secure":"");}
function DeleteCookie(name){var path="/",domain=getCookieDomain();if(GetCookie(name)){document.cookie=name+"="+((path)?"; path="+path:"")+((domain)?"; domain="+domain:"")+"; expires=Thu, 01-Jan-70 00:00:01 GMT";}}
function recordToCookie(key,value,CookieExpDate){var cookieName=this.toString();var data=GetCookie(cookieName);if(!data)data="";value=value.toString();value=value.replace(/&/g, "and" ).replace(/=/g, "is" );
var KeyVals=data.split("&");var existingKey=0;for(var i=0;i<KeyVals.length;i++){var ThisPair=KeyVals[i].split("=");if(key==ThisPair[0]){if(value)KeyVals[i]=key+"="+value;else
KeyVals.splice(i,1);data=KeyVals.join("&");existingKey=1;break;}}
if(value&&!existingKey)data+=((data)?"&":"")+key+"="+value;if(data)SetCookie(cookieName,data,((CookieExpDate)?CookieExpDate:null));else
DeleteCookie(cookieName);}
String.prototype.recordToCookie=recordToCookie;var expDate12Mon=new Date();expDate12Mon.setTime(expDate12Mon.getTime()+(24*60*60*365*1000));SaveCartExpDate=new Date();SaveCartExpDate.setTime(SaveCartExpDate.getTime()+(24*60*60*60*1000));userWithWritePrivileges=GetCookie("userWithWritePrivileges");if(userWithWritePrivileges){userWithWritePrivilegesFirstName=userWithWritePrivileges.split("_")[0];userWithWritePrivileges=userWithWritePrivileges.replace(/_/, " " );}
if(userWithWritePrivileges||local)Settings.disableContextImgMenu=0;if(!GetCookie("theReferrer")){var refPageQstr=(qStr&&qStr.indexOf("ref=")==0)?qStr.split("ref=")[1]:"";if(refPageQstr)SetCookie("theReferrer",refPageQstr,null,"/");else{var refPage="";try{refPage=document.referrer;}
catch(E){refPage="Blocked";}
var refPageLC=refPage.toLowerCase();SetCookie("theReferrer",refPage,null,"/");}}
function getAjaxRequest(){var Request=null;if(window.XMLHttpRequest){try{Request=new XMLHttpRequest();}
catch(Err){Request=null;}}
else if(window.ActiveXObject){try{Request=new ActiveXObject("Msxml2.XMLHTTP");}
catch(Err){try{Request=new ActiveXObject("Microsoft.XMLHTTP");}
catch(Err){Request=null;}}}
return Request;}
function initAJAX(){if(window.FW&&userWithWritePrivileges)FW.pollAdministrators();else
PL.run();if(qStr&&qStr.getVal("ss")){var dataFile=qStr.getVal("ss");var playMusic=(qStr.getVal("music")=="yes");launchSS(null,dataFile,playMusic);}}
function PreLoader(){this.Files=["images/arrowLeftSsTnOff.gif","images/arrowLeftSsTnOn.gif","images/arrowRightSsTnOff.gif","images/arrowRightSsTnOn.gif","images/pauseSsOff.gif","images/pauseSsOn.gif","images/pauseSsPaused.gif","images-slideshow.js","slide-show.js","images/ssFotolia_6904314_S.jpg","images/infoOff.gif","images/infoOn.gif","images/ContactUs.jpg","images/header.jpg","purchase.aspx","coffee-cart.js","images/productCafeWholebean16ozTN.jpg","images/productCafeGround2ozTN.jpg","images/productDarkWholebean8ozTN.jpg","images/productDarkWholebeanTrio8ozTN.jpg","images/productDarkWholebeanCloseup8ozTN.jpg","images/productMediumWholebean16ozTN.jpg","cart.aspx","about.aspx","images/ssFotolia_9027644_STN.jpg","images/surf3TN.jpg","images/ssFotolia_2612954_STN.jpg","images/Fotolia_6498426_STN.jpg","images/P1060571TN.jpg","faq.aspx","images/panoCoffeeHatTN.jpg","recipes.aspx","images/panoBreakfastTN.jpg","default.aspx","images/homePage.jpg",null];this.debug=0;try{if(top.qStr&&top.qStr.indexOf("preloader=show")!=-1)this.debug=1;}
catch(Err){}
if(this.debug)DeleteCookie("nFilesCached");this.Request=null;this.timer=0;this.nFilesCachedCookie=GetCookie("nFilesCached");this.nFilesCached=(this.nFilesCachedCookie)?parseInt(this.nFilesCachedCookie):0;this.run=run;function run(){this.Request=getAjaxRequest();clearTimeout(PL.timer);if(this.Request){if(this.nFilesCached<this.Files.length-1){this.Request.onreadystatechange=function(){try{if(PL.Request.readyState==4){if(PL.Request.status==200||PL.Request.status==304){if(PL.debug)top.document.title=PL.Files[PL.nFilesCached]+" preloaded; #"+((PL.nFilesCached+1)+" of "+(PL.Files.length-1));}
else{if(PL.debug)alert("File preloader encountered an error retrieving: \n "+PL.Files[PL.nFilesCached]+"\n Status: "+PL.Request.status+"\n StatusText: "+PL.Request.statusText+"\n Number "+((PL.nFilesCached+1)+" of "+(PL.Files.length-1)));}
PL.nFilesCached++;SetCookie("nFilesCached",PL.nFilesCached);PL.timer=setTimeout("if( window.PL ) PL.run();",100);}}
catch(Err){var eMsg="Exception at PL.run()\n\n";for(var i in Err)eMsg+=i+": "+Err[i]+"\n";try{if(PL.debug)alert(eMsg);} catch(Err){}}}
this.Request.open("GET",this.Files[this.nFilesCached],true);this.Request.send(null);}}
else if(PL.debug)top.document.title="Browser does not support the HttpRequest Request Protocol";}} PL=new PreLoader();function getMonthName(nChars){var Months=["January","February","March","April","May","June","July","August","September","October","November","December"];var monthName=Months[this.getMonth()];return(nChars)?monthName.substring(0,nChars):monthName;}
Date.prototype.getMonthName=getMonthName;function getDayName(nChars){var Days=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var dayName=Days[this.getDay()];return(nChars)?dayName.substring(0,nChars):dayName;}
Date.prototype.getDayName=getDayName;function getVal(key){var value=null;var strToSearch=this.toString();var KeyVals=strToSearch.split("&");for(member in KeyVals){var ThisPair=KeyVals[member].split("=");if(key==ThisPair[0]){value=ThisPair[1];break;}}
if(typeof value=="undefined")value="";return value;}
String.prototype.getVal=getVal;function trim(){var str=this.toString();return str.replace(/^\s*|\s*$/g, "" );}
String.prototype.trim=trim;Msg=new Array();Msg.BuyCoffee="Purchase 100% Kona Coffee"
Msg.About="About Downes Grounds";Msg.Checkout="Submit your completed order";Msg.Contact="Contact Info \u2022 Address, E-Mails, Phones...";Msg.Enlarge="View Enlargement";Msg.FAQ="Frequently Asked Coffee Questions";Msg.Recipes="Our Favorite Coffee Recipes";Msg.Links="Other Web Sites";Msg.Photos="View our Slide-Show";Msg.Cart="View, edit & submit your order";Msg.Home="Homepage";Msg.Login="Website administrator log-in";Msg.Logoff="Log off as website administrator";Msg.MailSubject="Downes Grounds Web Site Inquiry";FadeObj=null;transNum=-1;transDur=-1;transDelay=-1;fadeOpacity=0,fadeOpacityTimer=0,fadeStartTime=0;opacityStep=(window.Settings&&window.Settings.SS&&Settings.transDur)?1/(Settings.transDur/.04):.05;function randompick(){return randompick.arguments[Math.floor(Math.random()*randompick.arguments.length)];}
function getTransition(transNum,duration){var trans="";if(winIE){var d=duration;if(parseFloat(navigator.userAgent.split("MSIE")[1])>=5.5){var thisTrans=(transNum==1)?Math.floor(Math.random()*17)+2:transNum;switch(thisTrans){case 2:trans="Fade(duration="+d+",overlap=1)";break;case 3:trans="Blinds(duration="+d+",bands="+randompick(2,4,6,8)+",direction="+randompick('up','down','right','left')+")";break;case 4:trans="CheckerBoard(duration="+d+",squaresX="+randompick(2,4,8,12)+",squaresY="+randompick(2,4,8,12)+",direction="+randompick('up','down','right','left')+")";break;case 5:trans="Barn(duration="+d+",motion="+randompick('in','out')+",orientation=",randompick('horizontal','vertical')+")";break;case 6:trans="GradientWipe(duration="+d+",gradientSize="+randompick(0,0.1,0.3,0.5,0.7,0.9,1)+",wipeStyle="+randompick(0,1)+",motion="+randompick('forward','reverse')+")";break;case 7:trans="Inset(duration="+d+")";break;case 8:trans="Iris(duration="+d+",irisStyle="+randompick('DIAMOND','CIRCLE','CROSS','PLUS','SQUARE','STAR')+",motion="+randompick('in','out')+")";break;case 9:trans="RadialWipe(duration="+d+",wipeStyle="+randompick('CLOCK','WEDGE','RADIAL')+")";break;case 10:trans="RandomBars(duration="+d+",orientation="+randompick('horizontal','vertical')+")";break;case 11:trans="RandomBars(duration="+d+")";break;case 12:trans="Slide(duration="+d+",pushStyle="+randompick('HIDE','PUSH','SWAP')+",bands="+randompick(1,2,3,4,5,6,7)+")";break;case 13:trans="Spiral(duration="+d+",gridSizeX="+randompick(8,16,32,64)+",gridSizeY="+randompick(8,16,32,64)+")";break;case 14:trans="Stretch(duration="+d+",stretchStyle="+randompick('HIDE','PUSH','SPIN')+")";break;case 15:trans="Strips(duration="+d+",motion="+randompick('leftdown','leftup','rightdown','rightup')+")";break;case 16:trans="Wheel(duration="+d+",spokes="+randompick(2,4,10,16,20)+")";break;case 17:trans="Zigzag(duration="+d+",gridSizeX="+randompick(8,16,32,64)+",gridSizeY="+randompick(8,16,32,64)+")";break;case 18:trans="RandomDissolve(duration="+d+")";break;default:alert("SWITCH/CASE ERROR: Case caught by default handler in \"getTransition\"");}
trans="progid:DXImageTransform.Microsoft."+trans;}
else{switch(transNum){case 2:trans="blendTrans(duration="+d+")";break;default:trans="revealTrans(duration="+d+",transition="+Math.floor(Math.random()*23)+")";}}}
return trans;}
function getOpacity(){var opac="";if(winIE)opac="visibility:hidden;";else if(MZ)opac="opacity:0;";else if(SF||OP)opac="opacity:0;";return opac;}
function startFade(FadeObj,transNum,transDur,transDelay){if((winIE||MZ||SF||OP)&&window.FadeObj==null){window.FadeObj=FadeObj;if(winIE){window.transNum=transNum;window.transDur=transDur;window.transDelay=transDelay;setTimeout("fadeInDirectX()",transDelay);}
else{fadeStartTime=new Date().getTime();FadeObj.onload=function(){};(transDelay)?setTimeout("fadeIn()",transDelay):fadeIn();}}
else{if(IE)FadeObj.style.visibility="visible";else if(MZ)FadeObj.style.opacity=0.9999;else FadeObj.style.opacity=0.9999;FadeObj.style.visibility="visible";}}
function fadeIn(){if(MZ)FadeObj.style.opacity=fadeOpacity;else FadeObj.style.opacity=fadeOpacity;fadeOpacity+=opacityStep;if(fadeOpacity<1)fadeOpacityTimer=setTimeout("fadeIn();",40);else{if(MZ)FadeObj.style.opacity=0.9999;else FadeObj.style.opacity=0.9999;clearTimeout(fadeOpacityTimer);fadeOpacity=0;var fadeEndTime=new Date().getTime();var fadeDuration=fadeEndTime-fadeStartTime;fadeStartTime=0;if(fadeDuration>1500)opacityStep+=.03;FadeObj=null;}}
function fadeInDirectX(){try{FadeObj.style.filter=getTransition(transNum,transDur);FadeObj.filters(0).apply();FadeObj.style.visibility="visible";FadeObj.filters(0).play();FadeObj.onfilterchange=function(){FadeObj=null;}}
catch(Err){if(local){var eMsg="Exception Caught in fadeInDirectX function:\n\n";for(var i in Err)eMsg+=i+": "+Err[i]+"\n";alert(eMsg);}
FadeObj.style.visibility="visible";}}
function initImagesArr(){try{Images.pop();}
catch(Err){alert("Images array cannot be initialized because:\n 1) Data file \""+window.dataFile+"\" is non-existent; OR\n 2) The data it contains is malformed (bad syntax)");}}
fileNameErr=false;function checkImgName(fileName){var rePattern=/\s+/g;if( !fileNameErr && rePattern.test(fileName)){fileNameErr=true;alert("An image file named \""+fileName+"\" contains forbidden white-space characters.");}}
ImgReal=null;checkDimTimer=0;function checkDim(imgRealSrc,widDB,hgtDB){if((userWithWritePrivileges||local)&&widDB>0&&hgtDB>0){if(ImgReal==null){ImgReal=new Image();ImgReal.src=imgRealSrc;}
if(ImgReal.complete){clearTimeout(checkDimTimer);var realWid=ImgReal.width,realHgt=ImgReal.height;if(realWid>1&&realHgt>1&&(realWid!=widDB||realHgt!=hgtDB)){var FileComponents=ImgReal.src.split("/");var fileName=FileComponents[FileComponents.length-1];var eMsg=fileName+" has incorrect dimensions: \n  1) "+widDB+" x "+hgtDB+" are the errant values \n  2) "+realWid+" x "+realHgt+" are the true values";if(IE)eMsg+="\n\nWe see you are using Internet Explorer. It suffers from a peculiar bug such that even if you correct the dimensions, it may continue to report this error! If so, then change the file name too, for example:\nbeach.jpg \u2192 beach1.jpg";alert(eMsg);}
ImgReal=null;}
else{clearTimeout(checkDimTimer);eval("checkDimTimer = setTimeout( 'checkDim( \""+imgRealSrc+"\", "+widDB+", "+hgtDB+" )', 250 );");}}}
function largePic(cap,wid,hgt,Link,evt){if(window.DW){DW.createWindow([cap,"imgSrc="+Link.href],[0,wid,hgt],Link,evt,0,[4,0,0]);return false;}
else
return true;}
RequestCode=null,RequestData=null;function launchSS(Link,dataFile,playMusic){if(window.TN)TN.kill();window.playMusic=(playMusic)?true:false;if(Link){var titleOrig=Link.title;Link.style.cursor="wait";Link.title="Starting slide-show, please wait...";}
RequestCode=getAjaxRequest();if(RequestCode){RequestCode.onreadystatechange=function(){try{if(RequestCode.readyState==4){if(RequestCode.status==200||RequestCode.status==304){eval(RequestCode.responseText);RequestData=getAjaxRequest();RequestData.onreadystatechange=function(){try{if(RequestData.readyState==4){if(RequestData.status==200||RequestData.status==304){eval(RequestData.responseText);SS=new SlideShow();SS.init();SS.slideNum=(Settings.SS.randomStart&&!userWithWritePrivileges)?Math.floor(Math.random()*Images.length):0;SS.nFirstSlide=SS.slideNum;var PhotoInfo=SS.getImgInfoSS(Images[SS.nFirstSlide][3],SS.nFirstSlide,0);if(Link){Link.style.cursor = ( /a/i.test(Link.tagName))?"pointer":"default";Link.title=titleOrig;Link.blur();}
DW.createWindow([PhotoInfo[0],"imgSrc="+Settings.folder+Images[SS.nFirstSlide][0]],[0,Images[SS.nFirstSlide][1],Images[SS.nFirstSlide][2]],null,null,0,[4,0,0],"SS");var TdCount=document.getElementById("dwTitleLeft");TdCount.innerHTML=PhotoInfo[1];}
else
alert("AJAX error retrieving file \""+dataFile+"\" at function launchSS");}}
catch(Err){var eMsg="AJAX exception at function launchSS\n\n";for(var i in Err)eMsg+=i+": "+Err[i]+"\n";try{alert(eMsg);} catch(Err){}}}
RequestData.open("GET",dataFile+"?"+Math.random(),true);RequestData.send(null);}
else
alert("AJAX error retrieving file \"slide-show.js\" at function launchSS");}}
catch(Err){var eMsg="AJAX exception at function launchSS\n\n";for(var i in Err)eMsg+=i+": "+Err[i]+"\n";try{alert(eMsg);} catch(Err){}}}
if(live)RequestCode.open("GET","slide-show.js",true);else
RequestCode.open("GET","slide-show.js?"+Math.random(),true);RequestCode.send(null);}
else
alert("We're sorry, but it seems your browser is unable to make an AJAX (Asynchronous JavaScript And XML) request. As a result, you will not be able to play our slide-show.");return false;}
function DynamicWindow(transNum,transDur){var Htm=new Array();Htm.push("<table border=0 align='center' style='margin-top:5px; margin-bottom:5px;'>");Htm.push("<tr>");Htm.push("<td align='left'>");Htm.push("<table align='center'>");if(DB.Contact.Email){Htm.push("<tr>");Htm.push("<td class='ContactUsCol' style='padding-top:0px;'>");Htm.push(getEmailLink(DB.Contact.Email));Htm.push("</td>");Htm.push("</tr>");}
Htm.push("<tr>");Htm.push("<td class='ContactUsCol'>It&rsquo;s&nbsp;<span id='hawaii_time'></span>&nbsp; in Hawaii</td>");Htm.push("</tr>");if(DB.Contact.SkypeId){Htm.push("<tr>");Htm.push("<td class='ContactUsCol'>Skype ID: ");Htm.push(DB.Contact.SkypeId);Htm.push("</td>");Htm.push("</tr>");}
if(DB.Contact.Address1||DB.Contact.Address2||DB.Contact.Address3){Htm.push("<tr>");Htm.push("<td class='ContactUsCol'>");Htm.push("Downes Grounds<br/>");if(DB.Contact.Address1){Htm.push(DB.Contact.Address1);Htm.push("<br/>");}
if(DB.Contact.Address2){Htm.push(DB.Contact.Address2);Htm.push("<br/>");}
if(DB.Contact.Address3){Htm.push(DB.Contact.Address3);Htm.push("<br/>");}
Htm.push("</tr>");}
if(DB.Contact.Phone){Htm.push("<tr>");Htm.push("<td class='ContactUsCol'>");Htm.push(DB.Contact.Phone);Htm.push("</td>");Htm.push("</tr>");}
Htm.push("</table>");Htm.push("</td>");Htm.push("<td class='ContactUsImg'>");Htm.push("<img src='images/ContactUs.jpg' onLoad='startFade( this, 2, .8, 500 )' class='ContactUs' style='");Htm.push(getOpacity());Htm.push("'>");Htm.push("</td>");Htm.push("</tr>");Htm.push("</table>");var adminNotes=(userWithWritePrivileges&&DB.Administrators[userWithWritePrivileges][1]==1)?"<div style='font-variant:normal; font-weight:normal; font-size:9pt;'>"+userWithWritePrivilegesFirstName+": To change photo upload a new one named ContactUs.jpg at 330&times;189 pixels</div>":"";this.ContactUs=["Aloha from Brian Downes"+adminNotes,Htm.join("")];this.ssTnskewIeX=2;this.ssTnskewIeY=6;this.skewIeX=2;this.skewIeY=2;this.Msg=new Array();this.Msg.enlarge="View Enlargement";this.alwaysAddOverlay=0;window.gClickPos=null;this.transNum=(transNum)?transNum:2;this.transDur=(transDur)?transDur:0.8;this.dWinOffsetX=0;this.dWinOffsetY=0;this.Window=null;this.overTitleBar=false;this.Photo=null;this.TheBody=null;this.winType;this.addOverlay=addOverlay;this.cancelEvt=cancelEvt;this.reCenter=reCenter;this.createWindow=createWindow;this.showImg=showImg;this.keepInWin=keepInWin;this.getClickPosition=getClickPosition;this.getData=getData;this.loadingImage=loadingImage;this.mouseDown=mouseDown;this.mouseMove=mouseMove;this.moveTopImage=moveTopImage;this.otherFunctionalityOnRemoveWin=otherFunctionalityOnRemoveWin;this.removeWin=removeWin;this.mouseUp=mouseUp;document.onmousedown=this.mouseDown;document.onmousemove=this.mouseMove;document.onmouseup=this.mouseUp;function otherFunctionalityOnRemoveWin(){}
function createWindow(dataSrc,WinDim,TheLink,theEvent,bodyMargin,RequestedPos,winType,centerContent,addOverlay){this.TheBody=(document.compatMode&&document.compatMode!="BackCompat")?document.documentElement:document.body;if(TheLink)TheLink.blur();if(!bodyMargin)bodyMargin=0;this.winType=(winType)?winType:"";var Data=this.getData(dataSrc,TheLink),title,body;title=Data[0].replace(/\^\^/g, "'" );
title=title.replace(/\^/g, "\"" );
body=Data[1].replace(/\^\^/g, "'" );
body=body.replace(/\^/g, "\"" );
var showImg=(body.indexOf("imgSrc=")==0);var scrollStyle=(WinDim[0])?" overflow:auto;":"";var winWid=WinDim[1];var winHgt=WinDim[2];var clickPos=(RequestedPos)?(RequestedPos[0]==1):true;var aboveClkPos=(RequestedPos)?(RequestedPos[0]==2):false;var topCent=(RequestedPos)?(RequestedPos[0]==3):false;var center=(RequestedPos)?(RequestedPos[0]==4):false;var botCent=(RequestedPos)?(RequestedPos[0]==5):false;var xOffset=(RequestedPos)?RequestedPos[1]:0;var yOffset=(RequestedPos)?RequestedPos[2]:15;if(showImg){var imgSrc=body.split("imgSrc=")[1];var body="<img src='"+imgSrc+"' border='0' hspace='0' vspace='0' galleryimg='no' style='"+getOpacity()+" width:"+winWid+"px; height:"+winHgt+"px;' onload='DW.showImg( this );' onAbort='this.src=this.src;' id='ImageDW'>";if(this.winType=="TN"){var titleBarGUI="<table align='center' id='tnTable'><tr align='center'><td class='dwBackEnlargementSsTn' id='SsTnBackTD' onmousedown='DW.cancelEvt( event );'><a href='javascript:TN.nextImage( 0 );' title='Last enlargement' onmousedown='DW.cancelEvt( event );'><img src='images/arrowLeftSsTnOff.gif' class='dwArrowSsTn' onMouseover='src=\"images/arrowLeftSsTnOn.gif\";' onMouseout='src=\"images/arrowLeftSsTnOff.gif\";' /></a></td><td class='dwTitle dwImgTitleSS' id='SsTnTitle'>"+title+"</td><td class='dwNextEnlargementSsTn'><a href='javascript:TN.nextImage( 1 );' title='Next enlargement, or click photo...' onmousedown='DW.cancelEvt( event );' id='SsTnNext'><img src='images/arrowRightSsTnOff.gif' class='dwArrowSsTn' onMouseover='src=\"images/arrowRightSsTnOn.gif\";' onMouseout='src=\"images/arrowRightSsTnOff.gif\";' /></a></td></tr></table>";this.title=titleBarGUI;}
else if(this.winType=="SS"){var titleBarGUI="<table align='center' id='tnTable'><tr align='center'><td class='dwBackEnlargementSsTn' id='SsTnBackTD' onmousedown='DW.cancelEvt( event );'><a href='javascript:SS.back();' title='Back' onmousedown='DW.cancelEvt( event );'><img src='images/arrowLeftSsTnOff.gif' class='dwArrowSsTn' onMouseover='src=\"images/arrowLeftSsTnOn.gif\";' onMouseout='src=\"images/arrowLeftSsTnOff.gif\";' /></a></td><td class='dwTitle dwImgTitleSS' id='SsTnTitle'>"+title+"</td><td class='dwNextEnlargementSsTn'><a href='javascript:void(0);' onClick='SS.next( event );' title='Next' onmousedown='DW.cancelEvt( event );' id='SsTnNext'><img src='images/arrowRightSsTnOff.gif' class='dwArrowSsTn' onMouseover='src=\"images/arrowRightSsTnOn.gif\";' onMouseout='src=\"images/arrowRightSsTnOff.gif\";' /></a></td></tr></table>";this.title=titleBarGUI;}
else
this.title=title;var loading="<div class='loadingImg'>Loading Image<span id='dot1' class='dotOff'>.</span><span id='dot2' class='dotOff'>.</span><span id='dot3' class='dotOff'>.</span><span id='dot4' class='dotOff'>.</span></div>";if(title.indexOf("[")!=-1){title=title.replace(/^.*?\[/, loading + "[" );
title=title.replace(/\[/g, "<div class='dwTitleLine2Off'>" );
title=title.replace(/]/g, "</div>" );}
else
title=loading;}
var Window=document.getElementById("dWinID");if(Window)document.body.removeChild(Window);var NewWindow=document.createElement("DIV"),scrollSt,bodyHgtSt;bodyHgtStyle=(winHgt)?" height:"+winHgt+"px;":"";NewWindow.id="dWinID";NewWindow.className="dwWin";document.body.appendChild(NewWindow);NewWindow.style.visibility="hidden"
NewWindow.style.position="absolute";NewWindow.style.width=(IE&&document.compatMode!="CSS1Compat")?(winWid+2*parseInt(NewWindow.currentStyle["borderWidth"]))+"px":winWid+"px";NewWindow.style.top=(screen.height*-1)+"px";NewWindow.style.left=(screen.width*-1)+"px";NewWindow.style.zIndex=10000;var counterCell=(this.winType=="TN"||this.winType=="SS")?"<td class='dwCounterSsTn' id='dwTitleLeft'></td>":"";var pauseBut=(this.winType=="SS")?"&nbsp;<a href='javascript:SS.pause( ( SS.running ) ? 1 : 0 );' title='Pause'><img src='images/pauseSsOff.gif' id='PauseSs' class='dwPauseSs' onMouseover='SS.highlightPause( this, 1 );' onMouseout='SS.highlightPause( this, 0 );'></a>&nbsp;":"";var myWindow="<div class='dwTitleRow' id='dwTitleRowID' onmouseover='DW.overTitleBar=true;' onmouseout='DW.overTitleBar=false;'><table align='center'><tr>"+counterCell+"<td class='dwTitle' style='width:100%; text-align:center;' id='dwTitleCenter'>"+title+"</td><td valign='top' id='dwTitleRight' onmousedown='DW.cancelEvt( event );' style='white-space:nowrap;'>"+pauseBut+"<a href='javascript:DW.removeWin();' title='Close' id='dwX' class='dwX'>&nbsp;&times;&nbsp;</a></td></tr></table></div><div class='"+((showImg)?"dwBodyParentImg":"dwBodyParent")+"' style='width:100%;"+bodyHgtStyle+scrollStyle+"'><div class='dwBody' id='dwBodyID' style='margin:"+bodyMargin+"px;'>";if(centerContent)myWindow+="<table align='center'><tr><td>";myWindow+=body;if(centerContent)myWindow+="</td></tr></table>";myWindow+="</div></div>";NewWindow.innerHTML=myWindow;var xPos=0,yPos=0;if(clickPos||aboveClkPos){if(theEvent)var ClickPos=this.getClickPosition(theEvent);else if(window.gClickPos)var ClickPos=gClickPos;window.gClickPos=ClickPos;xPos=ClickPos[0];var vPortWid=(document.body.clientWidth)?document.body.clientWidth:window.innerWidth;var skew=Math.round(100*xPos/vPortWid)/100;xPos=xPos-(skew*NewWindow.offsetWidth);if(clickPos)yPos=ClickPos[1]+yOffset;else
yPos=ClickPos[1]-NewWindow.offsetHeight+yOffset;}
else if(topCent||center||botCent){var scrollX,scrollY,bodyWid,bodyHgt;if(IE){scrollX=this.TheBody.scrollLeft;scrollY=this.TheBody.scrollTop;bodyWid=this.TheBody.clientWidth;bodyHgt=this.TheBody.clientHeight;}
else{scrollX=window.pageXOffset;scrollY=window.pageYOffset;bodyWid=window.innerWidth;bodyHgt=window.innerHeight;}
winHgt=NewWindow.offsetHeight;winWid=NewWindow.offsetWidth;xPos=parseInt((bodyWid-winWid)/2+scrollX+xOffset);if(topCent)yPos=parseInt(scrollY+yOffset);else if(center)yPos=parseInt((bodyHgt-winHgt)/2+scrollY+yOffset);else yPos=parseInt(bodyHgt-winHgt+scrollY+yOffset);}
else{var Component=(window.ComponentDW)?window.ComponentDW:document.getElementById(RequestedPos[3]);if(SF){var Target=(theEvent.target)?theEvent.target:theEvent.srcElement;if(Target.nodeType==3)Component=Component.parentNode;}
var CurComponent=Component;var parPosAbs=false;while(CurComponent){yPos+=CurComponent.offsetTop;xPos+=CurComponent.offsetLeft;CurComponent=CurComponent.offsetParent;}
switch(RequestedPos[0]){case 10:xPos+=xOffset;yPos-=NewWindow.offsetHeight-yOffset;break;case 11:xPos+=Component.offsetWidth+xOffset;yPos-=NewWindow.offsetHeight-yOffset;break;case 12:xPos+=Component.offsetWidth+xOffset;yPos+=yOffset;break;case 13:xPos+=Component.offsetWidth+xOffset;yPos+=Component.offsetHeight+yOffset;break;case 14:xPos+=xOffset;yPos+=Component.offsetHeight+yOffset;break;case 15:xPos+=Component.offsetWidth+xOffset-NewWindow.offsetWidth;yPos+=Component.offsetHeight+yOffset;break;case 16:xPos+=xOffset-NewWindow.offsetWidth;yPos+=Component.offsetHeight+yOffset;break;case 17:xPos+=xOffset-NewWindow.offsetWidth;yPos+=yOffset;break;default:alert("Switch/Case Error at DW.createWindow: RequestedPos[ 0 ] has a value of "+RequestedPos[0]+" which is invalid.");}}
var NewWindowPos=this.keepInWin(NewWindow,xPos,yPos);xPos=Math.round(NewWindowPos[0]);yPos=Math.round(NewWindowPos[1]);NewWindow.style.left=xPos+"px";NewWindow.style.top=yPos+"px";if(showImg||this.alwaysAddOverlay||addOverlay)this.addOverlay();NewWindow.style.visibility="visible";if(showImg)this.loadingImage();}
function addOverlay(){if(window.SSE&&SSE.running)SSE.pauseSS(1);window.onscroll=function(){var Overlay=document.getElementById("dwOverlay");if(Overlay){document.body.removeChild(Overlay);if(window.SSE&&!SSE.running)SSE.pauseSS(0);}}
var Overlay=document.createElement("DIV");Overlay.id="dwOverlay";Overlay.className="dwOverlay";if(this.winType=="TN"||this.winType=="SS"){var TopImage=document.getElementById("TopImage");if(TopImage){document.body.removeChild(TopImage);(this.winType=="SS")?SS.TopImage=null:TN.TopImage=null;}}
else{Overlay.onclick=function(event){document.body.removeChild(this);}}
document.body.appendChild(Overlay);try{var wid=this.TheBody.clientWidth;var hgt=this.TheBody.clientHeight;var xPos=(IE)?this.TheBody.scrollLeft:window.pageXOffset;var yPos=(IE)?this.TheBody.scrollTop:window.pageYOffset;Overlay.style.left=xPos+"px";Overlay.style.top=yPos+"px";Overlay.style.width=wid+"px";Overlay.style.height=hgt+"px";}
catch(Err){if(local){var eMsg="Exception caught at DW.addOverlay:\n\n";for(var i in Err)eMsg+=i+": "+Err[i]+"\n";alert(eMsg);}
self.status="Exception caught at DW.addOverlay";document.body.removeChild(Overlay);}}
function reCenter(DW){var scrollX,scrollY,bodyWid,bodyHgt,xPos,yPos;if(IE){scrollX=this.TheBody.scrollLeft;scrollY=this.TheBody.scrollTop;bodyWid=this.TheBody.clientWidth;bodyHgt=this.TheBody.clientHeight;}
else{scrollX=window.pageXOffset;scrollY=window.pageYOffset;bodyWid=window.innerWidth;bodyHgt=window.innerHeight;}
winHgt=DW.offsetHeight;winWid=DW.offsetWidth;xPos=parseInt((bodyWid-winWid)/2+scrollX);yPos=parseInt((bodyHgt-winHgt)/2+scrollY);if(winHgt>bodyHgt)yPos=scrollY+10;if(winWid>bodyWid)xPos=scrollX+10;DW.style.left=xPos+"px";DW.style.top=yPos+"px";}
function loadingImage(){var Dot1=document.getElementById("dot1");var Dot2=document.getElementById("dot2");var Dot3=document.getElementById("dot3");var Dot4=document.getElementById("dot4");if(Dot1&&Dot2&&Dot3&&Dot4){if(Dot1.className=="dotOff")Dot1.className="dwDotOn";else if(Dot2.className=="dotOff")Dot2.className="dwDotOn";else if(Dot3.className=="dotOff")Dot3.className="dwDotOn";else if(Dot4.className=="dotOff")Dot4.className="dwDotOn";else{Dot1.className="dotOff";Dot2.className="dotOff";Dot3.className="dotOff";Dot4.className="dotOff";}
setTimeout("DW.loadingImage()",300);}}
function showImg(Photo){Photo.oncontextmenu=function(event){if(DW.winType=="SS")return SS.rightClick(this,event);else if(Settings.disableContextImgMenu)return false;};if(this.winType=="TN"){Photo.title="Next enlargement";Photo.onclick=function(){TN.nextImage(1);this.title="";}
document.getElementById("dwTitleLeft").onmouseover=function(){var Numbers=this.innerHTML.split("/");this.title="Photo #"+Numbers[0]+" of "+Numbers[1];}
TN.preloadNext();}
else if(this.winType=="SS"){Photo.title="Next";Photo.onclick=function(event){SS.next(event);this.title="";}
document.getElementById("dwTitleLeft").onmouseover=function(){var Numbers=this.innerHTML.split("/");this.title="Photo #"+Numbers[0]+" of "+Numbers[1];}
SS.preLoadNext();}
else{Photo.onclick=DW.removeWin;Photo.title="Click to close";}
Photo.style.cursor="pointer";var title=this.title;title=title.replace(/\[/g, "<div class='dwTitleLine2'>" ).replace(/]/g, "</div>" );
document.getElementById("dwTitleCenter").innerHTML=title;startFade(Photo,this.transNum,this.transDur,0);setTimeout("if( window.checkDim ) checkDim( \""+Photo.src+"\", "+Photo.width+", "+Photo.height+" );",(this.transDur*1000+100));if(this.winType=="SS")setTimeout("if( window.SS ) SS.playMusic();",(this.transDur*1000+101));}
function keepInWin(NewWindow,leftEdge,topEdge){var bodyHgt=(IE)?this.TheBody.clientHeight:window.innerHeight;var bodyWid=(IE)?this.TheBody.clientWidth:window.innerWidth;var winHgt=NewWindow.offsetHeight;var yOffset=(IE)?this.TheBody.scrollTop:window.pageYOffset;var vScreenPos=topEdge-yOffset;var vSkew=bodyHgt-vScreenPos;if(vScreenPos<10)topEdge=10+yOffset;else if(vSkew<winHgt+10)topEdge-=winHgt-vSkew+10;var winWid=NewWindow.offsetWidth;var xOffset=(IE)?this.TheBody.scrollLeft:window.pageXOffset;var hScreenPos=leftEdge-xOffset;var hSkew=bodyWid-hScreenPos;if(hScreenPos<10)leftEdge=10+xOffset;else if(hSkew<winWid+10){leftEdge-=winWid-hSkew+10;if(!IE&&this.TheBody.scrollHeight>bodyHgt)leftEdge-=15;}
if(leftEdge<11)leftEdge=10;if(topEdge<11)topEdge=10;return[leftEdge,topEdge];}
function getClickPosition(theEvent){try{if(IE){var x=event.clientX+this.TheBody.scrollLeft;var y=event.clientY+this.TheBody.scrollTop;}
else{var x=theEvent.pageX;var y=theEvent.pageY;}}
catch(err){var x=0;var y=0;}
return[x,y];}
function getData(dataSrc,TheLink){if(dataSrc=="nextSibling"){if(eval("typeof this.LastSrc")=="object")eval("this.LastSrc.innerHTML = this.lastData");try{var DataSource=(TheLink.nextSibling.innerHTML)?TheLink.nextSibling:TheLink.nextSibling.nextSibling;}
catch(err){alert("EXCEPTION: Data source not found");return false;}
try{var Title=(DataSource.firstChild.innerHTML)?DataSource.firstChild:DataSource.firstChild.nextSibling;var title=Title.innerHTML;}
catch(err){alert("EXCEPTION: Title source not found");return false;}
try{var Body=(Title.nextSibling.innerHTML)?Title.nextSibling:Title.nextSibling.nextSibling;var body=Body.innerHTML;}
catch(err){alert("EXCEPTION: Body source not found");return false;}
eval("this.LastSrc = DataSource");eval("this.lastData = DataSource.innerHTML");DataSource.innerHTML="";}
else{var title=dataSrc[0];var body=dataSrc[1];}
return[title,body];}
function mouseDown(e){if(DW.overTitleBar){this.Window=document.getElementById("dWinID");if(IE){var borderWid=parseInt(this.Window.currentStyle.borderWidth);if(DW.winType=="TN"||DW.winType=="SS"){this.dWinOffsetX=event.offsetX+borderWid+DW.ssTnskewIeX;this.dWinOffsetY=event.offsetY+borderWid+DW.ssTnskewIeY;var Elem=event.srcElement,ParentElem=Elem.offsetParent;if(Elem.id=="dwTitleCenter")this.dWinOffsetX+=document.getElementById("dwTitleLeft").scrollWidth;else if(Elem.id=="SsTnTitle"||ParentElem.id=="SsTnTitle"){var CurComponent=Elem;var xPos=0,yPos=0;while(CurComponent){if(CurComponent.id=="tnTable"){yPos=CurComponent.offsetTop;xPos=CurComponent.offsetLeft;break;}
CurComponent=CurComponent.offsetParent;}
this.dWinOffsetX+=document.getElementById("dwTitleLeft").scrollWidth+document.getElementById("SsTnBackTD").scrollWidth+xPos;}
else if(Elem.id=="dwTitleRight"){var CurComponent=Elem;var xPos=0,yPos=0;while(CurComponent){if(CurComponent.id=="dwTitleRight"){yPos=CurComponent.offsetTop;xPos=CurComponent.offsetLeft;break;}
CurComponent=CurComponent.offsetParent;}
this.dWinOffsetX+=xPos;}}
else{this.dWinOffsetX=event.offsetX+borderWid+DW.skewIeX;this.dWinOffsetY=event.offsetY+borderWid+DW.skewIeY;}}
else{this.dWinOffsetX=e.layerX;this.dWinOffsetY=e.layerY;return false;}}}
function mouseMove(e){if(this.Window&&!OP){var ClickPos=DW.getClickPosition(e);if(ClickPos[0]<=0||ClickPos[1]<=0){this.Window=null;return false;}
if(IE){if(event.button!=1)return false;this.Window.style.left=(event.clientX-this.dWinOffsetX+DW.TheBody.scrollLeft)+"px";this.Window.style.top=(event.clientY-this.dWinOffsetY+DW.TheBody.scrollTop)+"px";DW.moveTopImage();return false;}
else{this.Window.style.top=(e.pageY-this.dWinOffsetY)+"px";this.Window.style.left=(e.pageX-this.dWinOffsetX)+"px";DW.moveTopImage();}}}
function removeWin(){var EvalOnClose=document.getElementById("EvalOnClose");if(EvalOnClose)eval(EvalOnClose.value);var Window=document.getElementById("dWinID");if(Window)document.body.removeChild(Window);var Overlay=document.getElementById("dwOverlay");if(Overlay)document.body.removeChild(Overlay);if(window.SSE&&!SSE.running)SSE.pauseSS(0);DW.overTitleBar=false;switch(DW.winType){case "SS":if(window.SS)SS.kill();break;case "TN":if(window.TN)TN.kill();break;}
DW.otherFunctionalityOnRemoveWin();}
function moveTopImage(){var TopImage=document.getElementById("TopImage");if(TopImage){var BotImage=document.getElementById("ImageDW");var x=0;var y=0;TheElement=BotImage;var parPosAbs=false;while(TheElement){if(SF){if(!parPosAbs)parPosAbs=(TheElement.style.position=="absolute");if(parPosAbs&&TheElement==document.body)break;}
y+=TheElement.offsetTop;x+=TheElement.offsetLeft;TheElement=TheElement.offsetParent;}
var borderWid=(OP)?0:Settings.borderWidDW;TopImage.style.left=(x+borderWid-parseInt(BotImage.parentNode.style.marginLeft))+"px";TopImage.style.top=(y+borderWid-parseInt(BotImage.parentNode.style.marginTop))+"px";}}
function mouseUp(){this.Window=null;}
function cancelEvt(evt){if(window.event&&window.event.cancelBubble!=null)window.event.cancelBubble=true;else
evt.stopPropagation();}}
DW=new DynamicWindow();function DynamicMenu(FormElements){this.homePage=homePage;this.clearAll=clearAll;this.write=write;this.show=show;this.hide=hide;this.keepAlive=keepAlive;this.kill=kill;this.on=on;this.off=off;this.refreshItems=refreshItems;this.resetItems=resetItems;this.setVis=setVis;this.getElement=getElement;this.init=init;this.write();this.resetItems();function init(){}
function clearAll(){kill(["Admin_Data","ExternalLinks"]);}
function write(){Menus=new Array();ExternalLinks.pop();Menus.push("<div id='ExternalLinks' onMouseOver='Menu.keepAlive([\"ExternalLinks\"]);' onMouseOut='Menu.clearAll();' class='menu'><table align='left' class='menuBorder'>");if(ExternalLinks.length){for(var i=0;i<ExternalLinks.length;i++){Menus.push("<tr><td><a href='");Menus.push(ExternalLinks[i][0]);Menus.push("' class='menu' onClick='PopUp.openWin(this.href); return false;'><div onMouseOver='Menu.on(this);' onMouseOut='Menu.off(this);' class='menuItemOff'><div class='menuItem'>");Menus.push(ExternalLinks[i][1]);Menus.push("</div></div></a></td></tr>");}}
else
Menus.push("<tr><td></td></tr>");Menus.push("</table></div>");Menus.push("<div id='Admin_Data' onMouseOver='Menu.keepAlive([\"Admin_Data\"]);' onMouseOut='Menu.clearAll();' class='menu'><table align='left' class='menuBorder'>");Menus.push("<tr><td><a href='external-links.aspx' class='menu'><div onMouseOver='Menu.on(this);' onMouseOut='Menu.off(this);' class='menuItemOff'><div class='menuItem'>Links to Other Sites</div></div></a></td></tr>");Menus.push("<tr><td><a href='data.aspx' class='menu'><div onMouseOver='Menu.on(this);' onMouseOut='Menu.off(this);' class='menuItemOff'><div class='menuItem'>E-Commerce Data</div></div></a></td></tr>");Menus.push("<tr><td><a href='xml.aspx' class='menu'><div onMouseOver='Menu.on(this);' onMouseOut='Menu.off(this);' class='menuItemOff'><div class='menuItem'>Edit XML Data</div></div></a></td></tr>");Menus.push("<tr><td><a href='explanations.aspx' class='menu'><div onMouseOver='Menu.on(this);' onMouseOut='Menu.off(this);' class='menuItemOff'><div class='menuItem'>Edit Explanations</div></div></a></td></tr>");Menus.push("<tr><td><a href='slide-show.aspx' class='menu'><div onMouseOver='Menu.on(this);' onMouseOut='Menu.off(this);' class='menuItemOff'><div class='menuItem'>Edit Slide-Show</div></div></a></td></tr>");Menus.push("<tr><td><a href='javascript:PopUp.openWin( \"uploader.aspx\", 650, 300, 2, 0, 0, 1, 0, 0, 0 );' class='menu'><div onMouseOver='Menu.on(this);' onMouseOut='Menu.off(this);' class='menuItemOff'><div class='menuItem'>Upload Images</div></div></a></td></tr>");Menus.push("<tr><td><a href='javascript:FW.logOff();' class='menu'><div onMouseOver='Menu.on(this);' onMouseOut='Menu.off(this);' class='menuItemOff'><div class='menuItem'>Logoff</div></div></a></td></tr>");Menus.push("</table></div>");document.write(Menus.join(""));}
function show(Link,menuID,menuPos,evt,xOffset,yOffset,hideMeID){var TheMenu=getElement(menuID);if(typeof menuPos!="number")menuPos=this.subMenuPos;this.setVis(hideMeID,"hidden");this.keepAlive([menuID]);var e=(window.event)?event:evt;var Body=(IE&&document.compatMode=="CSS1Compat")?document.documentElement:document.body;with(TheMenu.style){position="absolute";left=(screen.width*-1)+"px";top=(screen.height*-1)+"px";visibility="hidden";display="block";}
var x=0,y=0;if(menuPos==0){x=(IE)?e.clientX+Body.scrollLeft:e.pageX;y=(IE)?e.clientY+Body.scrollTop:e.pageY;}
else{var ThisLink=Link;var parPosAbs=false;if(SF){var Target=(evt.target)?evt.target:evt.srcElement;if(Target.nodeType==3)ThisLink=ThisLink.parentNode;}
while(ThisLink){y+=ThisLink.offsetTop;x+=ThisLink.offsetLeft;ThisLink=ThisLink.offsetParent;}}
switch(menuPos){case 0:x+=xOffset;y+=yOffset;break;case 14:x+=xOffset;y-=TheMenu.offsetHeight+yOffset;break;case 21:x+=Link.offsetWidth+xOffset;y+=Link.offsetHeight-TheMenu.offsetHeight-yOffset;break;case 23:x+=Link.offsetWidth+xOffset;y+=yOffset;break;case 34:x+=xOffset;y+=Link.offsetHeight+yOffset;break;case 44:x=x-TheMenu.offsetWidth+xOffset;y=y+yOffset;break;default:alert("Switch/Case Error at Menu.show: menuPos \""+menuPos+"\" is invalid.");}
var bodyHgt=(IE)?Body.clientHeight:window.innerHeight;var bodyWid=(IE)?Body.clientWidth:window.innerWidth;var menuHgt=TheMenu.offsetHeight;var yFromTop=(IE)?Body.scrollTop:window.pageYOffset;var vScreenPos=y-yFromTop;var vSkew=bodyHgt-vScreenPos;if(vSkew<menuHgt+10)y-=menuHgt-vSkew+10;else if(vScreenPos<10)y=10+yFromTop;var menuWid=TheMenu.offsetWidth;var xFromLeft=(IE)?Body.scrollLeft:window.pageXOffset;var hScreenPos=x-xFromLeft;var hSkew=bodyWid-hScreenPos;if(hSkew<menuWid+10)x-=menuWid-hSkew+10;else if(hScreenPos<10)x=10+xFromLeft;with(TheMenu.style){left=x+"px";top=y+"px";visibility="visible";}}
function hide(Settings){for(var i=0;i<Settings.length;i++){var menuID=Settings[i][0],delay=Settings[i][1],hideMeID=Settings[i][2];if(getElement(menuID)){if(typeof delay=="undefined")delay=1000;if(window.Menu&&eval("Menu.timer"+menuID+" == 0")){eval("Menu.timer"+menuID+" = setTimeout( \"Menu.timer"+menuID+" = 0; document.getElementById( '"+menuID+"' ).style.display = 'none'; Menu.setVis( '"+hideMeID+"', 'visible' );\", "+delay+" )");}}}}
function keepAlive(MenuID){for(var i in MenuID){if(getElement(MenuID[i])){clearTimeout(eval("Menu.timer"+MenuID[i]));eval("Menu.timer"+MenuID[i]+" = 0;");}}}
function kill(MenuID){for(var i in MenuID){if(getElement(MenuID[i])){keepAlive([MenuID[i]]);hide([[MenuID[i],0]]);}}}
function on(Elem){if(typeof Elem=="string")Elem=document.getElementById(Elem);if(Elem.className=="menuItemOff")Elem.className="menuItemOn";else if(Elem.className=="menuItemNoClickOff")Elem.className="menuItemNoClickOn";}
function off(Elem){if(typeof Elem=="string")Elem=document.getElementById(Elem);if(Elem.className=="menuItemOn")Elem.className="menuItemOff";else if(Elem.className=="menuItemNoClickOn")Elem.className="menuItemNoClickOff";}
function refreshItems(Div){this.targetPage=Div.parentNode.href;this.resetItems();}
function resetItems(){var Links=document.links;for(var i=0;i<Links.length;i++){if(Links[i].className=="menu"){var target=Links[i].target;var targetLC=target.toLowerCase();if(target.charAt(0)!="_"||target=="_top"||target=="_parent"||targetLC=="_self"){var frame=(target&&target.charAt(0)!="_")?"parent."+target+".":"";if(frame&&parent==self)frame="";var targetPage=(this.targetPage)?this.targetPage:eval(frame+"document.location.href");if(targetPage.charAt(targetPage.length-1)=="/")targetPage+=this.homePage;var Div=(Links[i].firstChild.tagName)?Links[i].firstChild:Links[i].firstChild.nextSibling;if(Links[i].href==targetPage){if(Div.innerHTML.indexOf("menuArrow")==-1)Div.className="menuItemDisable";}
else if(Div.className=="menuItemDisable")Div.className="menuItemOff";}}}}
function setVis(hideMeID,vis){if(hideMeID&&winIE&&document.getElementById(hideMeID))document.getElementById(hideMeID).style.visibility=vis;}
function getElement(menuID){var Elem=null;if(document.getElementById(menuID))Elem=document.getElementById(menuID);else{var callFun=getElement.caller.toString().replace(/\n/g, "" );
callFun=callFun.split("(")[0];alert("ERROR: Menu.getElement unable to getElementById( \""+menuID+"\" )\n\nCALLER: "+callFun);}
return Elem;}}
function initHomepage(){try{var Body=(IE&&document.compatMode=="CSS1Compat")?document.documentElement:document.body;var bodyHeight=(IE)?Body.clientHeight:window.innerHeight;var contentHeight=parseInt(document.getElementById("content").style.height);var marginTop=Math.round((bodyHeight-contentHeight)/2);if(marginTop<0)marginTop=0;document.getElementById("content").style.marginTop=marginTop+"px";SSE.repositionElements();var HomePage=document.getElementById("HomePage");if(qStr&&qStr.getVal("referrer")=="david"||GetCookie("referrer")=="david"){SetCookie("referrer","david");HomePage.innerHTML="<br/>We are a family operated coffee farm located above Kona on the Big Island of Hawaii. We plant, grow, prune, harvest, dry, roast & bag all of our own coffee to ensure the quality of every cup. We guarantee you will enjoy the smooth, full body flavor of Downes Grounds every day ...just like we do!";}
self.status="";}
catch(Err){self.status="Exception at function initHomepage(), trying again...";setTimeout("initHomepage();",100);}}
function refreshCookies(){var saveCart=GetCookie("saveCart");var showWelcome=GetCookie("showWelcome");if(saveCart){SetCookie("saveCart","yes",SaveCartExpDate);var cartData=GetCookie("cartData");if(cartData)SetCookie("cartData",cartData,SaveCartExpDate);if(!showWelcome&&cartData){SetCookie("showWelcome","no");var htm="<b>W</b>elcome & Aloha! Per your request, we saved your shopping cart from your previous visit. Would you like to review your shopping cart now?<div align='center' style='margin:15px 0px 0px 0px;'><input type='button' value='Yes' class='DwOkCancel' onClick='document.location.href=\"cart.aspx\";' title='Go to view-cart page' /> &nbsp; <input type='button' value='No' class='DwOkCancel' onClick='DW.removeWin();' title='Stay on current page' /></div>";DW.createWindow(["Downes Grounds",htm],[0,400,0],null,null,10,[4,0,0],null,1,1);}}}
function initPage(){try{if(qStr&&qStr.getVal("referrer")=="david")SetCookie("referrer","david");if(fileName!="cart.aspx"&&fileName!="checkout.aspx")FW=new FileWriter();var Links=document.links;for(var i=0;i<Links.length;i++){var LinkComponents=Links[i].href.split("/");var file=LinkComponents[LinkComponents.length-1].replace(/\?.*/, "" ).toLowerCase();
if(file==fileName.toLowerCase()){if(Links[i].className=="navTop")Links[i].className="navTopDisabled";if(Links[i].className=="navBot")Links[i].className="navBotDisabled";}
else{var Link=Links[i];var linkName=Link.innerHTML.toLowerCase();switch(linkName){case "about":Link.title=Msg.About;Link.onmouseover=function(){Menu.clearAll();}
break;case "my cart":Link.title=Msg.Cart;Link.onmouseover=function(){Menu.clearAll();}
break;case "checkout":if(Link.className=="navTop"||Link.className=="navBot"){Link.title=Msg.Checkout;Link.onmouseover=function(){Menu.clearAll();}}
break;case "contact":Link.title=Msg.Contact;Link.onmouseover=function(){Menu.clearAll();}
break;case "faq":Link.title=Msg.FAQ;Link.onmouseover=function(){Menu.clearAll();}
break;case "home":Link.title=Msg.Home;Link.onmouseover=function(){Menu.clearAll();}
break;case "links":Link.title=Msg.Links;break;case "login":Link.title=Msg.Login;Link.onmouseover=function(){Menu.clearAll();}
break;case "photos":Link.title=Msg.Photos;Link.onmouseover=function(){Menu.clearAll();}
break;case "buy coffee":case "best coffee":case "purchase coffee":case "purchased coffee":Link.title=Msg.BuyCoffee;Link.onmouseover=function(){Menu.clearAll();}
break;case "recipes":Link.title=Msg.Recipes;Link.onmouseover=function(){Menu.clearAll();}
break;}}}
for(var i=0;i<Links.length;i++){var linkCls=Links[i].className;var linkProtocol=Links[i].protocol;var httpLink = ( /^http/i.test(linkProtocol));if(httpLink&&(linkCls=="navTop"||linkCls=="navTopDisabled"||linkCls=="navBot"||linkCls=="navBotDisabled")){var Link=Links[i];var RequestedPath=Link.pathname.split("/");var requestedPage=RequestedPath[RequestedPath.length-1];if(requestedPage=="cart.aspx")Links[i].onclick=function(event){return getShipTaxStatus(this,event,"cart.aspx",3);}
else
Links[i].onclick=function(){return setURL(this);}
Links[i].oncontextmenu=function(event){return reviewData(this,event);}}}
var Images=document.images;for(var i=0;i<Images.length;i++){if( ( Images[ i ].className == "tn" || Images[ i ].className == "tnLeft" || Images[ i ].className == "tnRight" || Images[ i ].className == "panoramic" ) && Images[ i ].parentNode && /a/i.test(Images[i].parentNode.tagName))Images[i].title=Msg.Enlarge;if(Images[i].className=="MoreInfo"){Images[i].onmouseover=function(){this.src="images/infoOn.gif";}
Images[i].onmouseout=function(){this.src="images/infoOff.gif";}}}
var LogInLink=document.getElementById("LogInLink");if(window.aspError)DW.createWindow(["Internal Server Error",aspError],[0,800,0],null,null,10,[4,0,0],null,1,1);else if(window.FileWriterLocked)DW.createWindow([FileWriterLocked[0],FileWriterLocked[1]],[0,500,0],null,null,10,[4,0,0],null,1,1);if(window.FW&&userWithWritePrivileges){var AdminTdLinkBot=document.getElementById("AdminTdLinkBot");if(AdminTdLinkBot){AdminTdBulletBot.className="navBulletBot";AdminTdLinkBot.className="navLink";}
if(LogInLink){LogInLink.innerHTML="Logoff";LogInLink.onmouseover=function(){this.title=Msg.Logoff;Menu.clearAll();}
LogInLink.onclick=function(){FW.logOff();}}}
if(!window.FW&&LogInLink){if(LogInLink){LogInLink.parentNode.previousSibling.className="off";LogInLink.className="off";}}
if(fileName!="cart.aspx"&&fileName!="checkout.aspx")refreshCookies();if(fileName=="cart.aspx")SC.displayCheckoutNavLinks();if(fileName=="purchase.aspx"&&Minimum_Pounds==-1){var MinPoundIncentive=document.getElementById("MinPoundIncentive");if(MinPoundIncentive)MinPoundIncentive.className="off";}
Menu=new DynamicMenu();DI=new DynamicIndex(1);DI.maintainState();self.status="";}
catch(Err){if(local){var err="";for(member in Err)err+=member+": "+Err[member]+"\n";alert("Exception at initPage function:\n\n"+err);}
else{setTimeout("initPage();",250);self.status="Running initPage function, one moment please...";}}}
function PopUp(){this.winName="davidWin";this.PrinterFriendlyContactInfo=null;this.printerFriendlyCss="";this.Win=null;this.openWin=openWin;this.printerFriendly=printerFriendly;this.closeWin=closeWin;this.linkToWin=linkToWin;function openWin(url,wWid,wHgt,wPos,tBar,lBar,sBar,mBar,scBar,reSize){this.closeWin();if(typeof wWid=="undefined")wWid=.8;if(typeof wHgt=="undefined")wHgt=.6;if(typeof wPos=="undefined")wPos=1;if(typeof tBar=="undefined")tBar=1;if(typeof lBar=="undefined")lBar=1;if(typeof sBar=="undefined")sBar=1;if(typeof mBar=="undefined")mBar=1;if(typeof scBar=="undefined")scBar=1;if(typeof reSize=="undefined")reSize=1;var avWid=screen.availWidth-10;var avHgt=screen.availHeight-30;if(wWid<1)wWid=wWid*avWid;if(wHgt<1)wHgt=wHgt*avHgt;if(wWid>avWid*0.90||wWid==1)wWid=avWid*0.90;if(wHgt>avHgt*0.70||wHgt==1)wHgt=avHgt*0.70;var leftPos=0;var topPos=0;switch(wPos){case 1:leftPos=parseInt((avWid-wWid)/2);break;case 2:leftPos=parseInt((avWid-wWid)/2);topPos=parseInt((avHgt-wHgt)/2);break;}
this.Win=window.open(url,PopUp.winName,"toolbar="+tBar+",location="+lBar+",directories=0,status="+sBar+",menubar="+mBar+",scrollbars="+scBar+",resizable="+reSize+",width="+wWid+",height="+wHgt+",top="+topPos+",left="+leftPos);}
function printerFriendly(removeImages,ExcludedPfContentSections){if(ExcludedPfContentSections){for(var i=0;i<ExcludedPfContentSections.length;i++){if(document.getElementById(ExcludedPfContentSections[i]))document.getElementById(ExcludedPfContentSections[i]).className="pfHide";}}
var nTitle=1;var pageTitle="";while(document.getElementById("pfTitle"+nTitle)){pageTitle+=document.getElementById("pfTitle"+nTitle).innerHTML+" ";pageTitle=pageTitle.replace(/<a\s.*?>/gi , "" );
pageTitle=pageTitle.replace(/<\/a.*?>/gi , "" );
nTitle++;}
var pfPageTitle=(pageTitle)?pageTitle:document.title;var htm="<html><head><title>"+document.title+"</title><link rel='stylesheet' href='"+this.printerFriendlyCss+"' type='text\/css'></head>";htm+=(live)?"<body onLoad='if( window.print ) window.print();'>":"<body>";htm+="<div class='pfTitle'>"+pfPageTitle+"</div><div class='pfOtherData'>"+theHost;if(this.PrinterFriendlyContactInfo){for(var i=0;i<this.PrinterFriendlyContactInfo.length;i++){htm+=this.PrinterFriendlyContactInfo[i][0]+eval(this.PrinterFriendlyContactInfo[i][1])+this.PrinterFriendlyContactInfo[i][2];}}
htm+="</div>";var nContent=1;outer:while(document.getElementById("pfContent"+nContent)){var content=document.getElementById("pfContent"+nContent).innerHTML;content=content.replace(/<a\s.*?>/gi , "" );
content=content.replace(/<\/a.*?>/gi , "" );
if(removeImages)content=content.replace(/<img\s.*?>/gi , "" );
content=content.replace(/<script[\d\D]*?<\/script>/gi , "" );
htm+=content;nContent++;}
if(document.getElementById("pfFooter"))htm+="<p class='pfFooter'>"+document.getElementById("pfFooter").innerHTML+"</p>";htm+="</body></html>";if(nContent>1){this.closeWin();this.openWin("",1);this.Win.document.write(htm);this.Win.document.close();}
else
alert("Error at PopUp.printerFriendly. No printer friendly sections (pfContent*) found...");if(ExcludedPfContentSections){for(var i=0;i<ExcludedPfContentSections.length;i++){if(document.getElementById(ExcludedPfContentSections[i]))document.getElementById(ExcludedPfContentSections[i]).className="pfShow";}}}
function closeWin(){try{if(this.Win&&this.Win.open&&!this.Win.closed){this.Win.close();this.Win=null;}}
catch(e){}}
function linkToWin(){if(PopUp&&PopUp.Win&&PopUp.Win.registered){if(PopUp.Win.MyOpener!=self)PopUp.Win.MyOpener=self;}
else setTimeout("PopUp.linkToWin()",250);}} PopUp=new PopUp();function DynamicIndex(setEvtHandlers){this.Msg=new Array();this.Msg.show="Show content";this.Msg.hide="Hide content";this.getPlusMinus=getPlusMinus;this.onClickMore=onClickMore;this.reset=reset;this.switchDisplay=switchDisplay;this.showTip=showTip;this.maintainState=maintainState;this.setEventHandlers=setEventHandlers;if(setEvtHandlers)this.setEventHandlers();function onClickMore(Link,evt){}
function setEventHandlers(){try{var AllLinks=document.getElementsByTagName("a");for(var i=0;i<AllLinks.length;i++){if(AllLinks[i].className=="diHeading"){AllLinks[i].onclick=function(event){if(window.DI){DI.onClickMore(this,event);DI.switchDisplay(this);}}
AllLinks[i].onmouseover=function(){if(window.DI)DI.showTip(this);return true;}}
if(AllLinks[i].className=="diPlusMinus"){AllLinks[i].onclick=function(event){if(window.DI){DI.onClickMore(this.nextSibling,event);DI.switchDisplay(this.nextSibling);}}
AllLinks[i].onmouseover=function(){if(window.DI)DI.showTip(this.nextSibling);return true;}}}
self.status="";}
catch(Err){self.status="Initializing DI.setEventHandlers() method, one moment please...";setTimeout("DI.setEventHandlers();",250);}}
function maintainState(){try{var path=document.location.pathname;var delimeter=(path.indexOf("\\")>=0)?"\\":"/";this.cookieName=fileName.split(".")[0];var diState=GetCookie(this.cookieName);if(diState){var AllLinks=document.getElementsByTagName("a");var DiState=diState.split("_");for(var i=0;i<AllLinks.length;i++){for(var k in DiState){if(DiState[k]&&parseInt(DiState[k])==i){try{DI.switchDisplay(AllLinks[i],AllLinks[i].id)} catch(e){};}}}}
self.status="";}
catch(Err){self.status="Initializing DI.maintainState() method, one moment please...";setTimeout("DI.maintainState();",250);}}
function getPlusMinus(Link){return Link.previousSibling;}
function reset(OtherID){for(var i=0;i<OtherID.length;i++){var PlusMinus=document.getElementById("plusMinus_"+OtherID[i]);if(PlusMinus){PlusMinus.innerHTML="-";this.switchDisplay(null,OtherID[i]);}
else{alert("ERROR: DI.reset unable to initialize PlusMinus as an Object.\nPROBLEM: \"plusMinus_"+OtherID[i]+"\" cannot be found.");return;}}}
function switchDisplay(Link,contentID,focuserID){if(!Link)Link=document.getElementById(contentID);var PlusMinus=getPlusMinus(Link);var expanding=(PlusMinus.innerHTML=="+"),contracting=!expanding;var Caption=document.getElementById("caption_"+Link.id);if(Caption)Caption.className=(expanding)?"diCaptionOn":"diCaptionOff";var Img=document.getElementById("img_"+Link.id);if(Img)Img.className=(expanding)?"diTnOn":"diTn";PlusMinus.innerHTML=(expanding)?"-":"+";var AllLinks=document.getElementsByTagName("a");var valOld=GetCookie(this.cookieName),valNew="";for(var i=0;i<AllLinks.length;i++){if(AllLinks[i]==Link){if(valOld){var key="_"+i+"_";if(valOld.indexOf(key)>=0){if(contracting){var ValOld=valOld.split(key);valNew=((ValOld[0])?ValOld[0]:"")+"_"+((ValOld[1])?ValOld[1]:"");(valNew=="_")?DeleteCookie(this.cookieName):SetCookie(this.cookieName,valNew);}
break;}
if(expanding)valNew=valOld+i+"_";}
else if(expanding)valNew="_"+i+"_";if(valNew)SetCookie(this.cookieName,valNew);break;}}
if(contentID)var Content=document.getElementById("content_"+contentID);else
var Content=(Link.parentNode.nextSibling.style)?Link.parentNode.nextSibling:Link.parentNode.nextSibling.nextSibling;try{Content.style.display=(contracting)?"none":"block";}
catch(Err){var problem=(contentID)?"\nPROBLEM: \"content_"+contentID+"\" cannot be found.":"";alert("ERROR: DI.switchDisplay unable to initialize Content as an Object."+problem);}
if(focuserID&&expanding){var FocusCont=document.getElementById(focuserID);FocusCont.innerHTML="<a href='javascript:void(0);'>.</a>";var FocusLink=FocusCont.firstChild;FocusLink.focus();Link.focus();FocusCont.innerHTML="";}
showTip(Link);}
function showTip(Link,msgOn,msgOff){var PlusMinus=getPlusMinus(Link);if(PlusMinus.innerHTML=="+"){Link.title=(msgOn)?msgOn:DI.Msg.show;PlusMinus.title=(msgOn)?msgOn:DI.Msg.show;}
else{Link.title=(msgOff)?msgOff:DI.Msg.hide;PlusMinus.title=(msgOff)?msgOff:DI.Msg.hide;}}}
function FileWriter(){this.HtmNotes=new Array();this.HtmButtons=new Array();this.HtmButtons.push("<button onClick='FW.insertTags( \"<br/>\", \"\", \"EditedHTML\" ); return false;' title='Insert line-break tag at cursor position' class='htmlTags'>&lt;br/&gt;</button>");this.HtmButtons.push("<button onClick='FW.insertTags( \"<br/><br/>\", \"\", \"EditedHTML\" ); return false;' title='Insert 2 line-breaks at cursor position' class='htmlTags'>&lt;br/&gt;&lt;br/&gt;</button>");this.HtmButtons.push("<button onClick='FW.insertTags( \"<b>\", \"</b>\", \"EditedHTML\" ); return false;' title='Insert bold tags around highlighted text' class='htmlTags'><b>B</b></button>");switch(fileName){case "slide-show.aspx":this.JsNotes=new Array();this.JsButtons=new Array();this.JsButtons.push("<button onClick='PopUp.openWin( \"uploader.aspx\", 650, 300, 2, 0, 0, 1, 0, 0, 0 ); return false;' title='Upload images to the server' class='htmlTags'>Upload</button>");this.JsButtons.push("<button onClick='FW.insertTags( \"[\\\"\", \"\\\",750,500,\\\"\\\"],\", \"EditedJS\" ); return false;' title='Insert new blank data structure at cursor position' class='htmlTags'>New Image</button>");this.JsButtons.push("<button onClick='FW.insertTags( \"{#149}\", \"\", \"EditedJS\" ); return false;' title='Insert bullet &#149; character entity at cursor position' class='htmlTags'>&#149;</button>");this.JsButtons.push("<button onClick='FW.insertTags( \"{ldquo}\", \"{rdquo}\", \"EditedJS\" ); return false;' title='Insert &ldquo;double-quotes&rdquo; around highlighted text' class='htmlTags'>&ldquo;Quotes&rdquo;</button>");break;case "external-links.aspx":this.JsNotes=new Array();this.JsButtons=new Array();this.JsButtons.push("<button onClick='FW.insertTags( \"[\\\"\", \"\\\", \\\"\\\"],\", \"EditedJS\" ); return false;' title='Insert new blank data structure at cursor position' class='htmlTags'>New Link</button>");break;default:this.JsNotes=new Array();this.JsButtons=new Array();break;}
this.XmlNotes=new Array();this.XmlNotes.push("<div class='underline'>Here's why you may need to edit this XML data:</div>");this.XmlNotes.push("<ol>");this.XmlNotes.push("<li>Change contact information like Name, Address, Phone, etc.</li>");this.XmlNotes.push("<li>To change Administrator Names, E-mails, Passwords & Editing Privileges");this.XmlNotes.push("<ol class='fSize10' type='a'>");this.XmlNotes.push("<li>Set it to yes to allow administrator to edit that particular data type</li>");this.XmlNotes.push("<li>Set it to no to prohibit administrator from editing that particular data type</li>");this.XmlNotes.push("</ol>");this.XmlNotes.push("</li>");this.XmlNotes.push("<li>To add new administrators. There are several blank administrator records for you. Anytime you need to add a new administrator just fill one out & publish, here's some tips:");this.XmlNotes.push("<ol class='fSize10' type='a'>");this.XmlNotes.push("<li>By setting the editing-privileges (for each of the data types) to &ldquo;no&rdquo;, the new administrator can only edit the calendar. They will not see the HTML, JavaScript or XML text boxes (like the one directly below).</li>");this.XmlNotes.push("<li>Under calendar-preferences, set subscribe-to-updates to &ldquo;yes&rdquo; to receive an e-mail update whenever the calendar is published. Set show-in-send-mail-list to &ldquo;yes&rdquo; to be included in the read-all pop-up email list.</li>");this.XmlNotes.push("</ol>");this.XmlNotes.push("</li>");this.XmlNotes.push("<li>Under calendar-settings you can change number of past/future months calendar will show (values must be whole numbers). You may also change the calendar read-all password.</li>");this.XmlNotes.push("</ol>");if(userWithWritePrivileges&&DB.Administrators[userWithWritePrivileges][1]&&DB.Administrators[userWithWritePrivileges][2]&&DB.Administrators[userWithWritePrivileges][3]){var AdminBullet=document.getElementById("AdminBullet");var AdminLink=document.getElementById("AdminLink");if(AdminBullet&&AdminLink){AdminBullet.className="navBullet";AdminLink.className="navLink";}
var AdminBulletBot=document.getElementById("AdminBulletBot");var AdminLinkBot=document.getElementById("AdminLinkBot");if(AdminBulletBot&&AdminLinkBot){AdminBulletBot.className="navBulletBot";AdminLinkBot.className="navLink";}}
this.AdminLinks="";this.getLogInGUI=getLogInGUI;this.logIn=logIn;this.recordPW=recordPW;this.pollAdministrators=pollAdministrators;if(!userWithWritePrivileges){var loginFailed=(qStr&&qStr.getVal("login_failure"))?qStr.getVal("login_failure"):"";if(loginFailed){if(loginFailed=="pw")alert("Incorrect Password");else
alert("User \u201C"+qStr.getVal("bad_name")+"\u201D not found");}
return;}
this.dataUnmodified=dataUnmodified;this.help=help;this.showHelp=showHelp;this.restore=restore;this.insertTags=insertTags;this.init=init;this.checkContent=checkContent;this.resetUI=resetUI;this.reLoad=reLoad;this.logOff=logOff;this.cursorReadyHtm=false;this.cursorReadyJS=false;this.init();function showHelp(Link){var PlsMin=Link.previousSibling;var Content=Link.nextSibling;if(Content.className=="fw1"){Content.className="fw0";PlsMin.innerHTML="+";}
else{Content.className="fw1";PlsMin.innerHTML="-";}}
function help(nType,Link,evt){function getHelpTxt(helpType){var Now=new Date();var todayOut=Now.getDayName()+" "+Now.getMonthName()+" "+Now.getDate()+", "+Now.getFullYear()+".";var Htm=new Array();Htm.push("<div class='fwHelpSect'>");Htm.push("<a href='javascript:void(0)' onClick='FW.showHelp(this.nextSibling);' class='fwPlusMinus'>+</a><a href='javascript:void(0);' onClick='FW.showHelp(this);' class='dwLink'>Reload & Cache</a>");Htm.push("<div class='fw0'>");Htm.push("<u>Cache Defined</u>: All browsers seamlessly store all recent pages that you have visited on your hard drive. This process is called \"caching\" and it greatly speeds up your web browsing because your browser is able to later retrieve these web pages off your hard drive much quicker than downloading them again from the server.<br/><br/>");Htm.push("<u>Caching will cause problems for you</u> because after you press Publish, and the page reloads, you may be looking at a past cached version of that page rather than the most recent version which you just published and are naturally expecting to see.<br/><br/>");Htm.push("<u>Remember this mantra</u> & you will eliminate cache frustrations forever!<br/>");Htm.push("&nbsp;&nbsp;\"Just Published but don't see your changes? Then press Reload\"");Htm.push("</div>");Htm.push("</div>");Htm.push("<div class='fwHelpSect'>");Htm.push("<a href='javascript:void(0)' onClick='FW.showHelp(this.nextSibling);' class='fwPlusMinus'>+</a><a href='javascript:void(0);' onClick='FW.showHelp(this);' class='dwLink'>Publish ");Htm.push(helpType);Htm.push("</a>");Htm.push("<div class='fw0'>");Htm.push("Press Publish-");Htm.push(helpType);Htm.push(" after you have made your edits. Your changes will be permanently written to file and the page will be reloaded. After the page reloads, verify your changes. If you don't see them press Reload.");if(helpType=="XML")Htm.push(" Changes made to XML data update across entire site immediately");Htm.push("</div>");Htm.push("</div>");Htm.push("<div class='fwHelpSect'>");Htm.push("<a href='javascript:void(0)' onClick='FW.showHelp(this.nextSibling);' class='fwPlusMinus'>+</a><a href='javascript:void(0);' onClick='FW.showHelp(this);' class='dwLink'>Reset</a>");Htm.push("<div class='fw0'>");Htm.push("Press Reset if you made edits but then changed your mind or you just want to start over. The content in the text-box will revert back to original start-up values since you last published, or if you haven't published, since you logged in. If you need to go back to an earlier date or time, try Restore...");Htm.push("</div>");Htm.push("</div>");Htm.push("<div class='fwHelpSect'>");Htm.push("<a href='javascript:void(0)' onClick='FW.showHelp(this.nextSibling);' class='fwPlusMinus'>+</a><a href='javascript:void(0);' onClick='FW.showHelp(this);' class='dwLink'>Restore</a>");Htm.push("<div class='fw0'>");Htm.push("Restore is the ultimate &ldquo;safety net&rdquo; and more powerful that reset because it let's you go back to an earlier date & time. If you made a mistake, which you only realized after publishing, then try restore. Today is ");Htm.push(todayOut);Htm.push("<div align='center' style='margin:4px 0px 0px 0px;'><form>");if(helpType=="HTML"){var BackUpHTM=document.AspForm.BackUpHTM;Htm.push("<input type='button' value='Restore To:' onClick='return FW.restore( \"RestoreHTM\" );' title='Restore this file to a prior selected time' />&nbsp;&nbsp;");Htm.push("<select id='BackUpHTM_PopUp' title='Select a prior restore point'>");if(BackUpHTM.length>1){for(var i=0;i<BackUpHTM.length;i++){if(i==0){Htm.push("<option value='");Htm.push(BackUpHTM[i].value);Htm.push("'>Undo Restore</option>");}
else{Htm.push("<option value='");Htm.push(BackUpHTM[i].value);Htm.push("'");if(i==1)Htm.push(" selected='selected'");Htm.push(">");Htm.push(i);Htm.push(". ");Htm.push((new Date(parseInt(BackUpHTM[i].text))).toLocaleString());Htm.push("</option>");}}}
else{Htm.push("<option value=''>");Htm.push(BackUpHTM[0].text);Htm.push("</option>");}
Htm.push("</select>");}
else if(helpType=="JavaScript"){var BackUpJS=document.AspForm.BackUpJS;Htm.push("<input type='button' value='Restore To:' onClick='return FW.restore( \"RestoreJS\" );' title='Restore this file to a prior selected time' />&nbsp;&nbsp;");Htm.push("<select id='BackUpJS_PopUp' title='Select a prior restore point'>");if(BackUpJS.length>1){for(var i=0;i<BackUpJS.length;i++){if(i==0){Htm.push("<option value='");Htm.push(BackUpJS[i].value);Htm.push("'>Undo Restore</option>");}
else{Htm.push("<option value='");Htm.push(BackUpJS[i].value);Htm.push("'");if(i==1)Htm.push(" selected='selected'");Htm.push(">");Htm.push(i);Htm.push(". ");Htm.push((new Date(parseInt(BackUpJS[i].text))).toLocaleString());Htm.push("</option>");}}}
else{Htm.push("<option value=''>");Htm.push(BackUpJS[0].text);Htm.push("</option>");}
Htm.push("</select>");}
else{var BackUpXML=document.AspForm.BackUpXML;Htm.push("<input type='button' value='Restore To:' onClick='return FW.restore( \"RestoreXML\" );' title='Restore this file to a prior selected time' />&nbsp;&nbsp;");Htm.push("<select id='BackUpXML_PopUp' title='Select a prior restore point'>");if(BackUpXML.length>1){for(var i=0;i<BackUpXML.length;i++){if(i==0){Htm.push("<option value='");Htm.push(BackUpXML[i].value);Htm.push("'>Undo Restore</option>");}
else{Htm.push("<option value='");Htm.push(BackUpXML[i].value);Htm.push("'");if(i==1)Htm.push(" selected='selected'");Htm.push(">");Htm.push(i);Htm.push(". ");Htm.push((new Date(parseInt(BackUpXML[i].text))).toLocaleString());Htm.push("</option>");}}}
else{Htm.push("<option value=''>");Htm.push(BackUpXML[0].text);Htm.push("</option>");}
Htm.push("</select>");}
Htm.push("</form></div>");Htm.push("<ol style='margin-top:4px; margin-bottom:4px;'>");Htm.push("<li style='margin-left:-10px;'>Select a restore date. They will be listed & numbered with the most recent at the top.</li>");Htm.push("<li style='margin-left:-10px;'>If you don't know which date to select, try the immediate prior backup. It will be #1 and selected for you by default. \"Restore To\" the selected date & time. If that doesn't help try #2, #3 and so on...</li>");Htm.push("<li style='margin-left:-10px;'>After restoring, if it appears the problem is not resolved, first press reload before doing another restore.</li>");Htm.push("<li style='margin-left:-10px;'>The restore process itself is completely reversible and you can go back in time, then come forward again. After performing restore(s), you can even come right back to where you began by restoring to &ldquo;Undo Restore&rdquo; from the top of the list.</li>");Htm.push("</ol>");Htm.push("</div>");Htm.push("</div>");Htm.push("<div class='fwHelpSect'>");Htm.push("<a href='javascript:void(0)' onClick='FW.showHelp(this.nextSibling);' class='fwPlusMinus'>+</a><a href='javascript:void(0);' onClick='FW.showHelp(this);' class='dwLink'>About ");Htm.push(helpType);Htm.push("</a>");Htm.push("<div class='fw0'>");if(helpType=="HTML")Htm.push("<ol style='margin-top:4px; margin-bottom:4px;'><li style='margin-left:-10px;'>HTML (<b>H</b>yper <b>T</b>ext <b>M</b>arkup <b>L</b>anguage) is a web formating language: <a href='javascript:PopUp.openWin( \"http://en.wikipedia.org/wiki/Html\" );' class='dwLink'>Learn more</a></li><li style='margin-left:-10px;'>Need help with your HTML skills? Try <a href='javascript:PopUp.openWin( \"http://www.w3schools.com/html/html_primary.asp\" );' class='dwLink'>W3schools.com</a></li></ol>");else if(helpType=="JavaScript")Htm.push("JavaScript is a popular web programming language: <a href='javascript:PopUp.openWin( \"http://en.wikipedia.org/wiki/JavaScript\" );' class='dwLink'>Learn more</a>");else
Htm.push("XML (e<b>X</b>tensible <b>M</b>arkup <b>L</b>anguage) is a web data-base language: <a href='javascript:PopUp.openWin( \"http://en.wikipedia.org/wiki/Xml\" );' class='dwLink'>Learn more</a>");Htm.push("</div>");Htm.push("</div>");return Htm.join("");}
var DataSrc;switch(nType){case 1:DataSrc=["Publishing HTML",getHelpTxt("HTML")];break;case 2:DataSrc=["Publishing JavaScript",getHelpTxt("JavaScript")];break;case 3:DataSrc=["Publishing XML",getHelpTxt("XML")];break;}
if(window.DW)DW.createWindow(DataSrc,[1,600,300],Link,evt,6,[2,0,-15]);}
function restore(aspJob){var Form=document.AspForm;if(aspJob=="RestoreHTM"&&Form.BackUpHTM&&Form.BackUpHTM[Form.BackUpHTM.selectedIndex].value==""||aspJob=="RestoreJS"&&Form.BackUpJS&&Form.BackUpJS[Form.BackUpJS.selectedIndex].value==""||aspJob=="RestoreXML"&&Form.BackUpXML&&Form.BackUpXML[Form.BackUpXML.selectedIndex].value==""){alert("No action taken: There are no restore dates...");return false;}
switch(aspJob){case "RestoreHTM":Form.BackUpHTM.selectedIndex=document.getElementById("BackUpHTM_PopUp").selectedIndex;break;case "RestoreJS":Form.BackUpJS.selectedIndex=document.getElementById("BackUpJS_PopUp").selectedIndex;break;case "RestoreXML":Form.BackUpXML.selectedIndex=document.getElementById("BackUpXML_PopUp").selectedIndex;break;default:alert("Switch/Case Error at FW.restore");}
Form.ASP_Job.value=aspJob;Form.submit();}
function insertTags(tagOpen,tagClose,TextBoxID){tagOpen=tagOpen.replace(/\{/g, "&" ).replace(/\}/g, ";" );
tagClose=tagClose.replace(/\{/g, "&" ).replace(/\}/g, ";" );
var editHTML=(TextBoxID=="EditedHTML");var editDATA=!editHTML;if(this.cursorReadyHtm&&editHTML||this.cursorReadyJS&&editDATA){var TextArea=document.getElementById(TextBoxID);if(IE){var theSelection=document.selection.createRange().text;TextArea.focus();if(theSelection.charAt(theSelection.length-1)==" "){theSelection=theSelection.substring(0,theSelection.length-1);document.selection.createRange().text=tagOpen+theSelection+tagClose+" ";}
else
document.selection.createRange().text=tagOpen+theSelection+tagClose;}
else{var replaced=false;var startPos=TextArea.selectionStart;var endPos=TextArea.selectionEnd;if(endPos-startPos)replaced=true;var scrollTop=TextArea.scrollTop;var myText=(TextArea.value).substring(startPos,endPos);if(myText.charAt(myText.length-1)==" ")subst=tagOpen+myText.substring(0,(myText.length-1))+tagClose+" ";else
subst=tagOpen+myText+tagClose;TextArea.value=TextArea.value.substring(0,startPos)+subst+TextArea.value.substring(endPos,TextArea.value.length);TextArea.focus();if(replaced){var cPos=startPos+(tagOpen.length+myText.length+tagClose.length);TextArea.selectionStart=cPos;TextArea.selectionEnd=cPos;}
else{TextArea.selectionStart=startPos+tagOpen.length;TextArea.selectionEnd=startPos+tagOpen.length+myText.length;}
TextArea.scrollTop=scrollTop;}
if(TextArea.createTextRange)TextArea.caretPos=document.selection.createRange().duplicate();if(editHTML)document.getElementById("PublishHTM").className="publishOn";else
document.getElementById("PublishJS").className="publishOn";}
else
alert("To auto-insert you must either:\n1) Place your cursor at the location where you are inserting into, or...\n2) If you are applying an HTML formatting tag (like bold), highlight the text you would like formatted.");}
function init(){var help="About Caching, Reload, Publish, Reset & Restore";var justPub="Refresh page to override cached (old) version";try{var TheBody=(document.compatMode&&document.compatMode!="BackCompat")?document.documentElement:document.body;var textBoxWid=TheBody.clientWidth-140;textBoxWid=(textBoxWid>1200)?1200:textBoxWid;var EditContainerHTM=document.getElementById("EditContainerHTM");var table1="<table align='center'><tr><td>",table2="</td></tr></table>";var notesBot="Just published but don&rsquo;t see your changes? Press Reload &nbsp;&#149;&nbsp; Completely ruined a page? Go to Help &rArr; Restore";if(EditContainerHTM&&EditContainerHTM.className=="on"){var HtmTitle=document.getElementById("HtmTitle");if(HtmTitle.innerHTML=="")HtmTitle.innerHTML="HTML CONTENT FOR THIS PAGE";var HtmNotes=document.getElementById("HtmNotes");if(this.HtmNotes.length&&!HtmNotes.innerHTML){this.HtmNotes.unshift(table1);this.HtmNotes.push(table2);HtmNotes.innerHTML=this.HtmNotes.join("");}
HtmNotes.style.width=textBoxWid+"px";var HtmButtons=document.getElementById("HtmButtons");if(this.HtmButtons.length&&!HtmButtons.innerHTML)HtmButtons.innerHTML=this.HtmButtons.join("");var EditedHTML=document.getElementById("EditedHTML");EditedHTML.onfocus=function(){this.title="Edit text then press \"Publish HTML\"";FW.cursorReadyHtm=true;}
EditedHTML.onkeyup=function(){document.getElementById("PublishHTM").className=(this.value==this.defaultValue)?"publishOff":"publishOn";}
EditedHTML.style.width=textBoxWid+"px";var HtmNotesBot=document.getElementById("HtmNotesBot");HtmNotesBot.innerHTML=notesBot;var HelpHTM=document.getElementById("HelpHTM");HelpHTM.onmouseover=function(){this.title=help;}
var ReloadHTM=document.getElementById("ReloadHTM");ReloadHTM.onmouseover=function(){this.title=justPub;}
ReloadHTM.onclick=function(){FW.reLoad("EditedHTML");}
var PublishHTM=document.getElementById("PublishHTM");PublishHTM.style.width=(PublishHTM.offsetWidth+10)+"px";PublishHTM.onmouseover=function(){this.title="Save HTML to the web";}
PublishHTM.onclick=function(){return FW.checkContent(1);}
var ResetHTM=document.getElementById("ResetHTM");ResetHTM.onmouseover=function(){this.title="Revert HTML back to original values since you last published";}
ResetHTM.onclick=function(){FW.resetUI("EditedHTML");}}
var EditContainerJS=document.getElementById("EditContainerJS");if(EditContainerJS&&EditContainerJS.className=="on"){var JsTitle=document.getElementById("JsTitle");if(JsTitle.innerHTML=="")JsTitle.innerHTML="JAVASCRIPT DATA";var JsNotes=document.getElementById("JsNotes");if(this.JsNotes.length&&!JsNotes.innerHTML){this.JsNotes.unshift(table1);this.JsNotes.push(table2);JsNotes.innerHTML=this.JsNotes.join("");}
JsNotes.style.width=textBoxWid+"px";var JsButtons=document.getElementById("JsButtons");if(this.JsButtons.length&&!JsButtons.innerHTML)JsButtons.innerHTML=this.JsButtons.join("");var EditedJS=document.getElementById("EditedJS");EditedJS.onfocus=function(){this.title="Edit data then press \"Publish JavaScript\"";FW.cursorReadyJS=true;}
EditedJS.onkeyup=function(){document.getElementById("PublishJS").className=(this.value==this.defaultValue)?"publishOff":"publishOn";}
EditedJS.style.width=textBoxWid+"px";var JsNotesBot=document.getElementById("JsNotesBot");JsNotesBot.innerHTML=notesBot;var HelpJS=document.getElementById("HelpJS");HelpJS.onmouseover=function(){this.title=help;}
var ReloadJS=document.getElementById("ReloadJS");ReloadJS.onmouseover=function(){this.title=justPub;}
ReloadJS.onclick=function(){FW.reLoad("EditedJS");}
var PublishJS=document.getElementById("PublishJS");PublishJS.style.width=(PublishJS.offsetWidth+10)+"px";PublishJS.onmouseover=function(){this.title="Save JavaScript to the web";}
PublishJS.onclick=function(){return FW.checkContent(2);}
var ResetJS=document.getElementById("ResetJS");ResetJS.onmouseover=function(){this.title="Revert JavaScript back to original values since you last published";}
ResetJS.onclick=function(){FW.resetUI("EditedJS");}}
var EditContainerXML=document.getElementById("EditContainerXML");if(EditContainerXML&&EditContainerXML.className=="on"){var XmlTitle=document.getElementById("XmlTitle");if(XmlTitle.innerHTML=="")XmlTitle.innerHTML="GLOBAL XML DATA";var XmlNotes=document.getElementById("XmlNotes");if(this.XmlNotes.length&&!XmlNotes.innerHTML){this.XmlNotes.unshift(table1);this.XmlNotes.push(table2);XmlNotes.innerHTML=this.XmlNotes.join("");}
XmlNotes.style.width=textBoxWid+"px";var EditedXML=document.getElementById("EditedXML");EditedXML.onfocus=function(){this.title="Edit data then press \"Publish XML\"";}
EditedXML.onkeyup=function(){document.getElementById("PublishXML").className=(this.value==this.defaultValue)?"publishOff":"publishOn";}
EditedXML.style.width=textBoxWid+"px";var XmlNotesBot=document.getElementById("XmlNotesBot");XmlNotesBot.innerHTML=notesBot;var HelpXML=document.getElementById("HelpXML");HelpXML.onmouseover=function(){this.title=help;}
var ReloadXML=document.getElementById("ReloadXML");ReloadXML.onmouseover=function(){this.title=justPub;}
ReloadXML.onclick=function(){FW.reLoad("EditedXML");}
var PublishXML=document.getElementById("PublishXML");PublishXML.style.width=(PublishXML.offsetWidth+10)+"px";PublishXML.onmouseover=function(){this.title="Save XML to the web";}
PublishXML.onclick=function(){return FW.checkContent(3);}
var ResetXML=document.getElementById("ResetXML");ResetXML.onmouseover=function(){this.title="Revert XML back to original values since you last published";}
ResetXML.onclick=function(){FW.resetUI("EditedXML");}}
var htm="<div class='otherFunctions'><a href='javascript:FW.logOff();' title='Log off as administrator' class='fw'>Log Off</a>";htm+=this.AdminLinks;htm+="</div>";var FwBottomRow=document.getElementById("fwBottomRow");if(FwBottomRow)FwBottomRow.innerHTML=htm;self.status="";}
catch(Err){if(local){var err="";for(member in Err)err+=member+": "+Err[member]+"\n";alert("Exception at method FW.init:\n\n"+err);}
else{setTimeout("FW.init();",250);self.status="Initializing File Writer: FW.init()...";}}}
function checkContent(dataType){function subDisableTextBoxes(htm,js,xml){if(htm&&document.getElementById("EditedHTML"))document.getElementById("EditedHTML").disabled=true;if(js&&document.getElementById("EditedJS"))document.getElementById("EditedJS").disabled=true;if(xml&&document.getElementById("EditedXML"))document.getElementById("EditedXML").disabled=true;}
var Form=document.AspForm;var EditedHTML=Form.EditedHTML;var EditedJS=Form.EditedJS;var EditedXML=Form.EditedXML;if(dataType==1){if(this.dataUnmodified(dataType)){alert("Edit the text then press Publish HTML...");EditedHTML.focus();FW.cursorReadyHtm=false;return false;}
else{var htm=EditedHTML.value.trim();htm=htm.replace(/largePic\( *'/g, "largePic( '" );
var LargePic=htm.split("largePic( '");for(var i=1;i<LargePic.length;i++){var LargePicArgs=LargePic[i].split(");");var otherArgs=LargePicArgs[0].substring(LargePicArgs[0].lastIndexOf("'"));LargePicArgs[0]=LargePicArgs[0].substring(0,LargePicArgs[0].lastIndexOf("'"));LargePicArgs[0]=LargePicArgs[0].replace(/"/g, "&#34;" ).replace(/'/g, "\\&#39;" ) + otherArgs;
LargePicArgs=LargePicArgs.join(");");LargePic[i]=LargePicArgs;}
htm=LargePic.join("largePic( '");EditedHTML.value=htm;document.getElementById("PublishHTM").disabled=true;Form.Which_Button.value="html";subDisableTextBoxes(0,1,1);}}
else if(dataType==2){if(this.dataUnmodified(dataType)){alert("Edit the data then press Publish JavaScript...");EditedJS.focus();FW.cursorReadyJS=false;return false;}
else{try{eval(EditedJS.value);}
catch(Err){var err="";for(member in Err)err+=member+": "+Err[member]+"\n";alert("Sorry, you have mistakenly broken JavaScript's rigid syntax. As a result, the file cannot be saved to disk. Fix the error & try again or click \"Reset\"...\n\n"+err);return false;}
EditedJS.value=EditedJS.value.trim();document.getElementById("PublishJS").disabled=true;Form.Which_Button.value="js";subDisableTextBoxes(1,0,1);}}
else{if(this.dataUnmodified(dataType)){alert("Edit the text then press Publish XML...");EditedXML.focus();return false;}
else{var textOrig=EditedXML.defaultValue;var textNew=EditedXML.value.trim();var xmlOrig=textOrig.replace(/>[^<>]*</g, "><" );
var nLinesOrig=textOrig.split("\n").length;var xmlNew=textNew.replace(/>[^<>]*</g, "><" );
var nLinesNew=textNew.split("\n").length;if(xmlOrig==xmlNew&&nLinesOrig==nLinesNew){var xml=EditedXML.value;xml=xml.replace(/&amp;/g, "a_m_p_e_r_s_a_n_d" );
xml=xml.replace(/\\\"/g, "q_u_o_t_e" );
xml=xml.replace(/&/g, "&amp;" );
xml=xml.replace(/\"/g, "\\\"" );
xml=xml.replace(/q_u_o_t_e/g, "\\\"" );
xml=xml.replace(/a_m_p_e_r_s_a_n_d/g, "&amp;" );
EditedXML.value=xml;document.getElementById("PublishXML").disabled=true;Form.Which_Button.value="xml";subDisableTextBoxes(1,1,0);}
else{var err=", as a result, the file cannot be saved to disk. Please edit the data only then press Publish XML.\n\n==> Fix the error & try again or click \"Reset\"";if(nLinesOrig!=nLinesNew)alert("ERROR: You have added or removed lines"+err);else
alert("ERROR: You have edited XML tag(s)"+err);EditedXML.focus();return false;}}
var xml=EditedXML.value.trim();var XML=xml.split(">");for(var i=0;i<XML.length;i++)XML[i]=XML[i].replace(/^ +/g, "" );
xml=XML.join(">");var XML=xml.split("</");for(var i=0;i<XML.length;i++)if(XML[i].indexOf("<")>=0)XML[i]=XML[i].replace(/ +$/g, "" );
xml=XML.join("</");EditedXML.value=xml;}
Form.ASP_Job.value="File_Writer";Form.submit();return true;}
function dataUnmodified(dataType){var Form=document.AspForm;dateUnedited="",dateEdited="";switch(dataType){case 1:dateUnedited=Form.EditedHTML.value;dateEdited=Form.EditedHTML.defaultValue;break;case 2:dateUnedited=Form.EditedJS.value;dateEdited=Form.EditedJS.defaultValue;break;case 3:dateUnedited=Form.EditedXML.value;dateEdited=Form.EditedXML.defaultValue;break;default:alert("Switch/Case Error at FW.dataUnmodified; Bad dataType: "+dataType);}
return(dateUnedited==dateEdited);}
function resetUI(TextBox){if(TextBox=="EditedHTML"){this.cursorReadyHtm=false;document.getElementById("PublishHTM").className="publishOff";}
else if(TextBox=="EditedJS"){this.cursorReadyJS=false;document.getElementById("PublishJS").className="publishOff";}
else
document.getElementById("PublishXML").className="publishOff";eval("document.AspForm."+TextBox+".value = document.AspForm."+TextBox+".defaultValue;");}
function reLoad(TextBox){if(eval("document.AspForm."+TextBox+".value")==eval("document.AspForm."+TextBox+".defaultValue"))document.location.reload(true);else if(confirm("You have made edits but have not saved (published) them. Your unpublished edits will be lost upon reloading this page. Do you still want to reload?\n\n1) Click OK to reload, unpublished edits will be lost.\n2) Click Cancel to stop the page from reloading."))document.location.reload(true);}
function logOff(){var url=fileName+"?logoff=yes"
if(qStr&&qStr.getVal("db"))url+="&db="+qStr.getVal("db");document.location.replace(url);}
function logIn(Form){var UserName=Form.user;var userNameFW=UserName.value.trim();UserName.value=userNameFW;var PW=Form.pw;var pwFW=PW.value.trim();PW.value=pwFW;if(userNameFW==""){alert("Please enter your user name");UserName.focus();return false;}
else if(pwFW==""){alert("Please enter your password");PW.focus();return false;}
else{if(Form.remember_pw.checked){var pwOut="";var pwIn=Form.pw.value;for(var i=0;i<=pwIn.length;i++)pwOut=pwIn.charAt(i)+pwOut;SetCookie("pwFW",pwOut,expDate12Mon);}
else
DeleteCookie("pwFW");}
if(userNameFW)SetCookie("userNameFW",userNameFW,expDate12Mon);return true;}
function recordPW(CheckBox){if(CheckBox.checked){var pw=document.LogIn.pw.value;if(pw){var pwOut="";for(var i=0;i<=pw.length;i++)pwOut=pw.charAt(i)+pwOut;SetCookie("pwFW",pwOut,expDate12Mon);}}
else
DeleteCookie("pwFW");}
function getLogInGUI(evt,RequestedPos){if(!evt)evt=window.event;var userNameFW=(GetCookie("userNameFW"))?GetCookie("userNameFW"):"";var pwFW=(GetCookie("pwFW"))?GetCookie("pwFW"):"";var pwOut="";if(pwFW)for(var i=0;i<=pwFW.length;i++)pwOut=pwFW.charAt(i)+pwOut;var pwChecked=(pwFW)?" checked":"";var Htm=new Array();Htm.push("<form name='LogIn' method='post' onSubmit='return FW.logIn( this );' style='margin:0px;'>");Htm.push("<table align='center'>");Htm.push("<tr>");Htm.push("<td>");Htm.push("<table align='center'>");Htm.push("<tr>");Htm.push("<td class='fwField' style='padding-top:6px;'>");Htm.push("User Name");Htm.push("</td>");Htm.push("<td class='fwValue' style='padding-top:6px;' id='tdBookingID'>");Htm.push("<input type='text' name='user' class='fwText' title='Case sensitive user-name' value='");Htm.push(userNameFW);Htm.push("' />");Htm.push("</td>");Htm.push("</tr>");Htm.push("<tr>");Htm.push("<td class='fwField' style='padding-top:6px;'>");Htm.push("Password");Htm.push("</td>");Htm.push("<td class='fwValue' style='padding-top:6px;' id='tdBookingID'>");Htm.push("<input type='");(local)?Htm.push("text"):Htm.push("password");Htm.push("' name='pw' autocomplete='off' value='");Htm.push(pwOut);Htm.push("' class='fwText' title='Case sensitive password' />");Htm.push("</td>");Htm.push("</tr>");Htm.push("<tr>");Htm.push("<td align='center' colspan='2' class='fwValue' style='padding-top:6px; white-space:nowrap;'>");Htm.push("<input type='checkbox' id='remember_pw' name='remember_pw' onClick='FW.recordPW( this );'");Htm.push(pwChecked);Htm.push(" /><label for='remember_pw'> Remember Me</label>");Htm.push("</td>");Htm.push("</tr>");Htm.push("<tr>");Htm.push("<td align='center' colspan='2' style='padding:10px 0px 0px 0px; white-space:nowrap;'>");Htm.push("<input type='submit' name='OK' value='OK' class='logInButtons' />");Htm.push("<input type='button' value='Cancel' class='logInButtons' onClick='DW.removeWin();' />");Htm.push("</td>");Htm.push("</tr>");Htm.push("</table>");Htm.push("</td>");Htm.push("</tr>");Htm.push("</table>");Htm.push("</form>");RequestedPos=(RequestedPos)?RequestedPos:null;DW.createWindow(["Administrator Log-In",Htm.join("")],[0,300,0],null,evt,6,RequestedPos);if(userNameFW&&pwFW)setTimeout("document.LogIn.OK.focus();",100);else if(userNameFW)setTimeout("document.LogIn.pw.focus();",100);else
setTimeout("document.LogIn.user.focus();",100);}
function pollAdministrators(){if(userWithWritePrivileges){var EditContainer=document.getElementById("EditContainer");if(EditContainer&&EditContainer.className!="offScreen"||fileName=="calendar.aspx"){if(window.XMLHttpRequest){try{this.Request=new XMLHttpRequest();}
catch(Err){this.Request=null;}}
else if(window.ActiveXObject){try{this.Request=new ActiveXObject("Msxml2.XMLHTTP");}
catch(Err){try{this.Request=new ActiveXObject("Microsoft.XMLHTTP");}
catch(Err){this.Request=null;}}}
if(this.Request){this.Request.onreadystatechange=function(){if(FW.Request.readyState==4){if(FW.Request.status==200||FW.Request.status==304){var XmlDoc=FW.Request.responseXML;var User=XmlDoc.getElementsByTagName("user");var thisUserMS=0;var OtherUsers=new Array();var db=qStr.getVal("db")?"?db="+qStr.getVal("db"):"";for(var i=0;i<User.length;i++){var UserNode=(User[i].firstChild.nodeType==1)?User[i].firstChild:User[i].firstChild.nextSibling;var userXML=UserNode.childNodes[0].nodeValue.replace(/_/, " " );
var PageNode=(UserNode.nextSibling.nodeType==1)?UserNode.nextSibling:UserNode.nextSibling.nextSibling;var pageXML=PageNode.childNodes[0].nodeValue;var forcedOutBy=PageNode.getAttribute("forced-out-by").replace(/_/, " " );
var TimeNode=(PageNode.nextSibling.nodeType==1)?PageNode.nextSibling:PageNode.nextSibling.nextSibling;var timeXML=parseInt(TimeNode.childNodes[0].nodeValue);if(pageXML==fileName+db){if(userWithWritePrivileges==userXML){thisUserMS=timeXML;if(forcedOutBy&&EditContainer.className!="off"){alert("Sorry, but "+forcedOutBy+" has just forced a log-in to this page, as a result, your editing privileges are suspended. Note however, you haven't been logged off and may continue editing other pages.");EditContainer.className="off";if(fileName=="calendar.aspx"){document.getElementById("CalGreeting").className="off";document.getElementById("calButtonsTop").className="off";document.getElementById("calButtonsBot").className="off";}
break;}}
else
OtherUsers.push([userXML,pageXML,forcedOutBy,timeXML]);}}
if(OtherUsers.length){var otherUsers="";for(var i=0;i<OtherUsers.length;i++){if(thisUserMS>OtherUsers[i][3]&&OtherUsers[i][2]==""){var Now=new Date();var nowMS=Now.getTime();var timeDiffSec=(nowMS-OtherUsers[i][3])/1000;var timeDiffMin=timeDiffSec/60;var timeDiffOut="";if(timeDiffMin<2)timeDiffOut=Math.round(timeDiffSec)+" seconds";else if(timeDiffMin>=2&&timeDiffMin<=120)timeDiffOut=Math.round(timeDiffMin)+" minutes";else if(timeDiffMin>120&&timeDiffMin<=(2*1440))timeDiffOut=Math.round(timeDiffMin/60)+" hours";else{var UserLoginDate=new Date(OtherUsers[i][3]);var UserLoginMidNite=new Date(UserLoginDate.getFullYear(),UserLoginDate.getMonth(),UserLoginDate.getDate());var NowMidNite=new Date(Now.getFullYear(),Now.getMonth(),Now.getDate());var userLoginMidNite=UserLoginMidNite.getTime();var nowMidNite=NowMidNite.getTime();var timeDiffMS=nowMidNite-userLoginMidNite;var timeDiffDays=timeDiffMS/86400000;timeDiffOut=Math.floor(timeDiffDays)+" days";}
otherUsers+=OtherUsers[i][0]+" logged into this page "+timeDiffOut+" ago.\n";}}
if(otherUsers){if(confirm("Concurrent Administrators Detected. To protect the integrity of our data, two or more users editing the same page at the same time is prohibited. The following users are logged into this page, or may have forgotten to log-off:\n\n"+otherUsers+"\n1. Click OK to force log-in which immediately suspends privileges for other users.\n2. Click Cancel & you'll remain logged with suspended privileges on this page.")){SetCookie("forcedLogin","yes");document.location.reload();}
else{SetCookie("cancelForceLogin","yes");document.location.replace(fileName+"?cancelForceLogin=yes"+db.replace(/^\?/, "&" ) );}}}}
FW.timer=setTimeout("FW.pollAdministrators();",5000);}}
this.Request.open("GET","users.xml?"+Math.random());this.Request.send(null);}}}}}
function showHawaiiTime(){var gmtOffset=10;var now=new Date();var difhrs=now.getTimezoneOffset()/60;var lochrs=now.getHours();GMThours=lochrs+difhrs;now.setHours(GMThours-gmtOffset);var am_pm="AM";var hours=now.getHours();if(hours>=12)am_pm="PM";if(hours>=13)hours-=12;if(hours==0)hours="12";var minutes=now.getMinutes();if(minutes<10)minutes="0"+minutes;var seconds=now.getSeconds();if(seconds<10)seconds="0"+seconds;try{document.getElementById("hawaii_time").innerHTML=hours+":"+minutes+":"+seconds+" "+am_pm;}
catch(Err){}
finally{setTimeout("showHawaiiTime()",1000);}}
function getEmailLink(emailAddress){return "<a href='mailto:"+emailAddress+"?subject="+encodeURIComponent(Msg.MailSubject)+"' title='Send an e-mail' class='dwLink'>"+emailAddress+"</a>";}
function writeExplanation(elementID){var Elem=document.getElementById(elementID),htm="";if(Elem){htm=Elem.innerHTML;htm=htm.replace(/<script.*?>.*<\/script>/gi, "" );}
else
htm="Error, cannot find elementID: &ldquo;"+elementID+"&rdquo;";document.write(htm);}
function explanationPopup(Link,evt,belowLink,explanationID,optWidth){var DwTitle=document.getElementById(explanationID+"_Title");var dwTitle=(DwTitle)?document.getElementById(explanationID+"_Title").innerHTML:"Error: Cannot find element by id &ldquo;"+explanationID+"_Title&rdquo;";var Explanation=document.getElementById(explanationID);var dwBody=(Explanation)?document.getElementById(explanationID).innerHTML:"Error: Cannot find element by id &ldquo;"+explanationID+"&rdquo;";var wid=(optWidth)?optWidth:450;var Pos=(belowLink)?[1,0,14]:[2,0,-14];DW.createWindow([dwTitle,dwBody],[0,wid,0],Link,evt,10,Pos,null,1);return false;}
function businessCard(Link,evt,pos){var Pos,overlay;switch(pos){case 0:Pos=[4,0,0];overlay=1;break;case 1:Pos=[1,0,15];overlay=0;break;case 2:Pos=[2,0,-15];overlay=0;break;default:alert("Switch/Case Error at businessCard. Bad case: "+pos);}
DW.createWindow(DW.ContactUs,[0,610,0],Link,evt,0,Pos,null,null,overlay);showHawaiiTime();return false;}
function SlideShowEmbedded(){try{ImagesSSE.pop();}
catch(Err){alert("Embedded Slide-Show Images array cannot be initialized because:\n 1) Data file is non-existent; OR\n 2) The data it contains is malformed (bad syntax)");}
this.slideNum=(SettingsSSE.randomStart&&!userWithWritePrivileges)?Math.floor(Math.random()*ImagesSSE.length):0;this.nFirstSlide=this.slideNum;this.speedActual=SettingsSSE.speed*1000;this.SPEED_FAST=500;this.preLoadTimer=0;this.NextImage=null;this.slideDelay=0;this.running=true;this.buttons=false;this.dissolve=true;this.maxDissolveMZ=1000*1000;this.init=init;this.start=start;this.showSlide=showSlide;this.skipErrantSlide=skipErrantSlide;this.preLoadNext=preLoadNext;this.mouseOverImg=mouseOverImg;this.getCoordinates=getCoordinates;this.next=next;this.repositionElements=repositionElements;this.pauseSS=pauseSS;window.onresize=this.repositionElements;this.setFileSize=setFileSize;this.setFirstImg=setFirstImg;this.reportImgName=reportImgName;this.switchSpeed=switchSpeed;this.writeSlideShow=writeSlideShow;this.Msg=new Array();this.Msg.ClickImg=(userWithWritePrivileges)?"Click to skip \u2022 Right-click "+((macOS)?"(ctrl+click) ":"")+"to pause":"Skip to next image";function writeSlideShow(){var htm="<div id='slideShowContainer' class='ssContainer' style='"+getOpacity()+"'><img id='slideShow' class='ssImage' onClick='SSE.next( event );' oncontextmenu='return SSE.reportImgName( this, event );' src='images/"+ImagesSSE[SSE.nFirstSlide][0]+"' onMouseover='SSE.mouseOverImg( this );'></div>";document.write(htm);}
function setFirstImg(){startFade(document.getElementById("slideShowContainer"),2,0.8,0,1,1);SSE.start();}
function mouseOverImg(Img){Img.title=this.Msg.ClickImg;if(userWithWritePrivileges){Img.style.cursor="pointer";}}
function start(){this.repositionElements();this.preLoadNext();}
function getCoordinates(TheImage){var x=0;var y=0;TheElement=TheImage;var parPosAbs=false;while(TheElement){if(SF){if(!parPosAbs)parPosAbs=(TheElement.style.position=="absolute");if(parPosAbs&&TheElement==document.body)break;}
y+=TheElement.offsetTop;x+=TheElement.offsetLeft;TheElement=TheElement.offsetParent;}
var skewX=0,skewY=0;if(SF){skewX=SettingsSSE.Skew.SF[0];skewY=SettingsSSE.Skew.SF[1];}
else if(MZ&&macOS){skewX=SettingsSSE.Skew.MacFF[0];skewY=SettingsSSE.Skew.MacFF[1];}
x+=skewX;y+=skewY;return[x,y];}
function repositionElements(){if(SSE.ImgOverlay){var OverlayPos=SSE.getCoordinates(document.getElementById("slideShow").parentNode);SSE.ImgOverlay.style.left=OverlayPos[0]+"px";SSE.ImgOverlay.style.top=OverlayPos[1]+"px";}}
function showSlide(){if(this.NextImage){var TheImage=document.getElementById("slideShow");var widNew=ImagesSSE[this.slideNum][1];var hgtNew=ImagesSSE[this.slideNum][2];var imgArea=widNew*hgtNew;checkDim(this.NextImage.src,widNew,hgtNew);if(this.dissolve&&(winIE||MZ||SF||OP)&&SettingsSSE.transNum>=1&&this.speedActual>this.SPEED_FAST){var nNewImg=(ImagesSSE.length==this.slideNum)?0:this.slideNum;var nOldImg=(nNewImg==0)?ImagesSSE.length-1:nNewImg-1;TheImage.width=ImagesSSE[nOldImg][1];TheImage.height=ImagesSSE[nOldImg][2];TheImage.src=SettingsSSE.folder+ImagesSSE[nOldImg][0];if(SettingsSSE.borderWid)TheImage.style.borderColor="rgb( "+SettingsSSE.borderCol+" )";var imgStyle=(SettingsSSE.borderWid)?" style='border:"+SettingsSSE.borderWid+"px solid rgb("+SettingsSSE.borderCol+");'":"";var newImg="<img name='slideShowNew' src='"+SettingsSSE.folder+ImagesSSE[nNewImg][0]+"' title='"+TheImage.title+"'"+imgStyle+" onClick='SSE.next( event );' oncontextmenu='return SSE.reportImgName( this, event );' onMouseover='SSE.mouseOverImg( this );' class='ssImage'>";if(!SSE.ImgOverlay){SSE.ImgOverlay=document.createElement("DIV");SSE.ImgOverlay.style.top=(screen.height*-1)+"px";SSE.ImgOverlay.style.left=(screen.width*-1)+"px";SSE.ImgOverlay.style.zIndex=1000;SSE.ImgOverlay.style.position="absolute";document.body.appendChild(SSE.ImgOverlay);}
SSE.ImgOverlay.style.width=(SettingsSSE.Dimension[0]+2*SettingsSSE.borderWid)+"px";SSE.ImgOverlay.style.height=(SettingsSSE.Dimension[1]+2*SettingsSSE.borderWid)+"px";if(winIE)SSE.ImgOverlay.style.visibility="hidden";if(MZ)SSE.ImgOverlay.style.opacity=0;else SSE.ImgOverlay.style.opacity=0;var OverlayPos=SSE.getCoordinates(TheImage.parentNode);SSE.ImgOverlay.style.left=OverlayPos[0]+"px";SSE.ImgOverlay.style.top=OverlayPos[1]+"px";SSE.ImgOverlay.innerHTML=newImg;startFade(SSE.ImgOverlay,SettingsSSE.transNum,SettingsSSE.transDur,0);}
else{if(this.ImgOverlay){document.body.removeChild(this.ImgOverlay);this.ImgOverlay=null;}
TheImage.style.visibility="hidden";TheImage.width=widNew;TheImage.height=hgtNew;if(SettingsSSE.borderWid)TheImage.style.borderColor="rgb( "+SettingsSSE.borderCol+" )";TheImage.src=this.NextImage.src;TheImage.style.visibility="visible";}
this.dissolve=true;}}
function skipErrantSlide(){if(local||userWithWritePrivileges||SSE.speedActual==SSE.SPEED_FAST){if(!SSE.errReported){alert("Slide #"+(SSE.slideNum+1)+"; "+SSE.NextImage.src+" failed to load");SSE.errReported=true;}}
SSE.NextImage=null;}
function preLoadNext(){var recursionTimer=100;this.slideDelay+=recursionTimer;if(!this.NextImage){if(this.SPEED_FAST!=this.speedActual)this.speedActual=ImagesSSE[this.slideNum][3]*1000;this.slideNum++;if(this.slideNum==ImagesSSE.length)this.slideNum=0;this.NextImage=new Image();this.NextImage.onerror=this.skipErrantSlide;this.NextImage.src=SettingsSSE.folder+ImagesSSE[this.slideNum][0];}
if(this.NextImage&&this.NextImage.complete&&this.slideDelay>this.speedActual){this.slideDelay=0;this.showSlide();this.NextImage=null;clearTimeout(this.preLoadTimer);this.preLoadNext();}
else
this.preLoadTimer=setTimeout("SSE.preLoadNext()",recursionTimer);}
function next(evt){if(!evt)evt=window.event;if(evt.ctrlKey)return;clearTimeout(this.preLoadTimer);this.dissolve=(userWithWritePrivileges||local)?false:true;this.pauseSS(false);}
function pauseSS(pause){if(pause){clearTimeout(this.preLoadTimer);this.running=false;}
else{this.slideDelay=SettingsSSE.speed*1000+1;this.preLoadNext();this.running=true;}}
function init(){var maxWid=-1,maxHgt=-1,bordWid=SettingsSSE.borderWid*2;for(var i=0;i<ImagesSSE.length;i++){ImagesSSE[i][1]=SettingsSSE.Dimension[0];ImagesSSE[i][2]=SettingsSSE.Dimension[1];ImagesSSE[i][3]=SettingsSSE.speed;checkImgName(ImagesSSE[i][0]);}}
function switchSpeed(hiSpeed){this.speedActual=(hiSpeed)?this.SPEED_FAST:SettingsSSE.speed*1000;}
function reportImgName(Link,evt){if(userWithWritePrivileges){this.pauseSS(1);var imageNum=this.slideNum-1;if(imageNum==-1)imageNum=ImagesSSE.length-1;if(window.ImagesSSE==null)window.ImagesSSE=this.ImagesOriginal;var Img=ImagesSSE[imageNum];var wid=Img[1],hgt=Img[2];var shape=(wid>hgt)?"horizontal":((wid<hgt)?"vertical":"square");var tnHgt=150;var tnWid=parseInt(wid*tnHgt/hgt);var speedHTM=(this.speedActual!=this.SPEED_FAST)?"<a href='javascript:SSE.switchSpeed(1); DW.removeWin();' class='dwLink' title='Run at hi-speed'>Fast</a><span class='ssSpeed'> &#149; Normal</span>":"<span class='ssSpeed'>Fast &#149; </span><a href='javascript:SSE.switchSpeed(0); DW.removeWin();' class='dwLink' title='Revert to normal speed'>Normal</a>";var htm="<table align='left'><tr><td align=center valign=top><img src='"+SettingsSSE.folder+Img[0]+"' width='"+tnWid+"' height='"+tnHgt+"'></td><td align=center valign=middle style='padding:4px;'><table align='center' class='dwText'><tr><td align=right>Name:&nbsp;</td><td align=left>"+Img[0]+"</td></tr><tr><td align=right>Number:&nbsp;</td><td align=left>"+(imageNum+1)+" of "+ImagesSSE.length+"</td></tr><tr><td align=right>Dimensions:&nbsp;</td><td align=left>"+wid+" &times; "+hgt+" px; "+shape+"</td></tr><tr><td align=right>File Size:&nbsp;</td><td id='fileSizeSSE' align=left></td></tr><tr><td align=right>Speed:&nbsp;</td><td align=left>"+speedHTM+"</td></tr><tr><td align=right>Paused:&nbsp;</td><td align=left><a href='javascript:SSE.dissolve=false; DW.removeWin();' class='dwLink' title='Slide-show is paused \u2022 Resume to play'>Resume</a></td></tr></table></td></table>";if(window.DW){DW.createWindow(["Image Properties",htm],[0,tnWid+400,0],Link,evt);this.setFileSize(imageNum);}
return false;}
return(SettingsSSE.disableContextImgMenu&&live)?false:true;}
function setFileSize(imageNum){this.Request=getAjaxRequest();if(this.Request){this.Request.onreadystatechange=function(){try{if(SSE.Request.readyState==4){if(SSE.Request.status==200||SSE.Request.status==304){var fileSize=parseInt(SSE.Request.getResponseHeader("Content-Length"))/1024;var FileSizeSSE=document.getElementById("fileSizeSSE");if(FileSizeSSE)FileSizeSSE.innerHTML=Math.round(fileSize)+" KB";}
else
alert("Error retrieving photo at method SSE.setFileSize");}}
catch(Err){var eMsg="Exception at method SSE.setFileSize\n\n";for(var i in Err)eMsg+=i+": "+Err[i]+"\n";try{alert(eMsg);} catch(Err){}}}
this.Request.open("GET",Settings.folder+ImagesSSE[imageNum][0],true);this.Request.send(null);}}}
nOuncesMinGlobal=8;nOuncesGlobal=0;belowMinMsg="We're sorry, your order is below our minimum of 8 ounces (&frac12 pound). If you would like to purchase our coffee you must increase your order to 8 ounces or more. Mahalo...";function setURL(Link){var RequestedPath=Link.pathname.split("/");var requestedPage=RequestedPath[RequestedPath.length-1];var requestedPageQstr=Link.search.substring(1);if(requestedPageQstr)requestedPageQstr="?"+requestedPageQstr;var enteringSSL=(requestedPage=="checkout.aspx");var leavingSSL=(fileName=="checkout.aspx");if(enteringSSL&&nOuncesGlobal&&nOuncesGlobal<nOuncesMinGlobal){DW.createWindow(["Below Minimum",belowMinMsg],[0,400,0],null,null,10,[4,0,0]);return false;}
else if(live&&(enteringSSL||leavingSSL)){requestedPage+=requestedPageQstr;var theURL=(enteringSSL)?pathSecure+requestedPage:pathUnsecure+requestedPage;Link.href=theURL;return true;}}
function getShipTaxStatus(Link,evt,requestedPage,placement){if(window.SC)clearTimeout(SC.addToCartTimer);var cartData=GetCookie("cartData");var cartShipTax=GetCookie("cartShipTax");var shipTaxUnknown=(cartShipTax)?false:true;var userReviewing=!requestedPage;if(cartData&&(shipTaxUnknown||userReviewing)){var RequestedPos=new Array();switch(placement){case 1:RequestedPos=[2,0,-15];break;case 2:RequestedPos=[1,0,20];break;case 3:RequestedPos=[4,0,0];break;default:alert("Switch/Case Error at getShipTaxStatus. Bad case: "+placement);}
var Htm=new Array();Htm.push("<form name='shipTaxForm' style='margin:6px 0px 0px 6px; text-align:left;' onSubmit='setShipTaxStatus( this ); return false;'>");Htm.push("<table align='center'>");Htm.push("<tr>");Htm.push("<td align='left'>");Htm.push("<div style='margin:10px 0px 0px 0px;' id='SendOrderTo'>Please Send My Order To:</div>");Htm.push("<input type='radio' name='LocationShip' id='LocationShip0' style='margin:3px 0px 0px 18px;'><label for='LocationShip0'> The United States, Alaska or Hawaii</label><br/>");Htm.push("<input type='radio' name='LocationShip' id='LocationShip1' style='margin:0px 0px 0px 18px;'><label for='LocationShip1'> Canada</label><br/>");Htm.push("<input type='radio' name='LocationShip' id='LocationShip2' style='margin:0px 0px 0px 18px;'><label for='LocationShip2'> Hong Kong</label><br/>");Htm.push("<input type='radio' name='LocationShip' id='LocationShip3' style='margin:0px 0px 0px 18px;'><label for='LocationShip3'> Other Foreign Country</label><br/>");Htm.push("<div style='margin:10px 0px 0px 0px;' id='OrderingFrom'>I'm Placing This Order From:</div>");Htm.push("<input type='radio' name='LocationTax' id='LocationTax0' style='margin:3px 0px 0px 18px;'><label for='LocationTax0'> Outside of Hawaii, state tax is waived</label><br/>");Htm.push("<input type='radio' name='LocationTax' id='LocationTax1' style='margin:0px 0px 0px 18px;'><label for='LocationTax1'> Within Hawaii, state tax is added</label><br/>");Htm.push("</td>");Htm.push("</tr>");Htm.push("<tr>");Htm.push("<td nowrap align='center'>");Htm.push("<input type='submit' value='&nbsp;OK&nbsp;' style='margin:10px 0px 0px 0px;' title='Click to set your shipping & tax status'>");Htm.push("</td>");Htm.push("</tr>");Htm.push("</table>");Htm.push("<input type='hidden' length='10' name='destination'>");Htm.push("</form>");var shipTaxGUI=Htm.join("");var ShipTax=["Shipping & Taxes<div class='fSize9' style='font-weight:normal; font-variant:normal;'><span class=on id='shipTaxTipID'>This info must be provided to view your cart</span></div>",shipTaxGUI];if(placement==3)DW.createWindow(ShipTax,[0,360,0],Link,evt,6,RequestedPos,null,null,1);else
DW.createWindow(ShipTax,[0,360,0],Link,evt,6,RequestedPos);if(live&&requestedPage=="checkout.aspx")requestedPage=pathSecure+requestedPage;document.shipTaxForm.destination.value=requestedPage;if(userReviewing)document.getElementById("shipTaxTipID").className="off";if(cartShipTax&&userReviewing){var ShipTax=cartShipTax.split(".");var loc=parseInt(ShipTax[0]);var tax=parseInt(ShipTax[1]);var Form=document.shipTaxForm;Form.LocationShip[loc].checked=true;Form.LocationTax[tax].checked=true;}
return false;}
else{DW.removeWin();return setURL(Link);}}
function setShipTaxStatus(Form){var SendOrderTo=document.getElementById("SendOrderTo");var OrderingFrom=document.getElementById("OrderingFrom");SendOrderTo.className="";OrderingFrom.className="";var locShip=true,loc=-1;for(var i=0;i<Form.LocationShip.length;i++)if(Form.LocationShip[i].checked){loc=i;locShip=false;}
var locTax=true,tax=-1;for(var i=0;i<Form.LocationTax.length;i++)if(Form.LocationTax[i].checked){tax=i;locTax=false;}
if(locShip){SendOrderTo.className="alertOn";Form.LocationShip[0].focus();}
else if(locTax){OrderingFrom.className="alertOn";Form.LocationTax[0].focus();}
else{SetCookie("cartShipTax",loc+"."+tax,expDate12Mon);if(Form.destination.value)document.location.href=Form.destination.value;else
document.getElementById("shopping_cart").innerHTML=SC.getCart();DW.removeWin();}}
function reviewData(Link,evt,key){if(userWithWritePrivileges||local){if(!evt)evt=window.event;if(window.SC)clearTimeout(SC.addToCartTimer);var Htm=new Array();Htm.push("<table align='center' cellspacing='5' class='fSize12' style='border-collapse:separate;'>");if(key){Htm.push("<tr>");Htm.push("<td nowrap valign='top' align='right'>");Htm.push("Lookup Key:&nbsp;&nbsp;");Htm.push("</td>");Htm.push("<td>");Htm.push("Item.");Htm.push(key);Htm.push("</td>");Htm.push("</tr>");Htm.push("<tr>");Htm.push("<td nowrap valign='top' align='right'>");Htm.push("Price:&nbsp;&nbsp;");Htm.push("</td>");Htm.push("<td>");Htm.push(Item[key][0]);Htm.push("</td>");Htm.push("</tr>");Htm.push("<tr>");Htm.push("<td nowrap valign='top' align='right'>");Htm.push("Name:&nbsp;&nbsp;");Htm.push("</td>");Htm.push("<td>");Htm.push(Item[key][1]);Htm.push("</td>");Htm.push("</tr>");Htm.push("<tr>");Htm.push("<td nowrap valign='top' align='right'>");Htm.push("Description:&nbsp;&nbsp;");Htm.push("</td>");Htm.push("<td>");Htm.push(Item[key][2]);Htm.push("</td>");Htm.push("</tr>");}
Htm.push("<tr>");Htm.push("<td nowrap valign='top' align='right'>");Htm.push("cartData:&nbsp;&nbsp;");Htm.push("</td>");Htm.push("<td>");Htm.push("<input type='text' id='CartDataAdmin' value='");Htm.push(GetCookie("cartData"));Htm.push("' style='width:300px;' />");Htm.push("</td>");Htm.push("</tr>");Htm.push("<tr>");Htm.push("<td nowrap valign='top' align='right'>");Htm.push("cartShipTax:&nbsp;&nbsp;");Htm.push("</td>");Htm.push("<td>");Htm.push("<input type='text' id='CartShipTaxAdmin' value='");Htm.push(GetCookie("cartShipTax"));Htm.push("' style='width:300px;' />");Htm.push("</td>");Htm.push("</tr>");Htm.push("<tr>");Htm.push("<td nowrap valign='top' align='right'>");Htm.push("saveCart:&nbsp;&nbsp;");Htm.push("</td>");Htm.push("<td>");Htm.push("<input type='text' id='CartSaveCart' value='");Htm.push(GetCookie("saveCart"));Htm.push("' style='width:300px;' />");Htm.push("</td>");Htm.push("</tr>");Htm.push("<tr>");Htm.push("<td nowrap valign='top' align='right'>");Htm.push("showWelcome:&nbsp;&nbsp;");Htm.push("</td>");Htm.push("<td>");Htm.push("<input type='text' id='CartShowWelcome' value='");Htm.push(GetCookie("showWelcome"));Htm.push("' style='width:300px;' />");Htm.push("</td>");Htm.push("</tr>");Htm.push("<tr>");Htm.push("<td nowrap valign='top' align='right'>");Htm.push("Delete Cookies:&nbsp;&nbsp;");Htm.push("</td>");Htm.push("<td>");Htm.push("<button onClick='DeleteCookie( \"cartData\" ); document.getElementById( \"CartDataAdmin\" ).value = \"\";' title='Delete \u201CcartData\u201D Cookie'>Data</button> <button onClick='DeleteCookie( \"cartShipTax\" ); document.getElementById( \"CartShipTaxAdmin\" ).value = \"\";' title='Delete \u201CcartShipTax\u201D Cookie'>Ship/Tax</button> <button onClick='DeleteCookie( \"saveCart\" ); document.getElementById( \"CartSaveCart\" ).value = \"\";' title='Delete \u201CsaveCart\u201D Cookie'>Save Cart</button> <button onClick='DeleteCookie( \"showWelcome\" ); document.getElementById( \"CartShowWelcome\" ).value = \"\";' title='Delete \u201CshowWelcome\u201D Cookie'>Welcome</button>");Htm.push("</td>");Htm.push("</tr>");Htm.push("<tr>");Htm.push("<td nowrap valign='top' align='right'>");Htm.push("Links:&nbsp;&nbsp;");Htm.push("</td>");Htm.push("<td class='fColorGray102'>");Htm.push("<a href='cart.aspx' class='dwLink'>View Cart</a> &nbsp;&#149;&nbsp; <a href='checkout.aspx' onClick='return setURL( this );' class='dwLink'>Checkout</a> &nbsp;&#149;&nbsp; <a href='purchase.aspx' class='dwLink'>Buy Coffee</a>");Htm.push("</td>");Htm.push("</tr>");Htm.push("</table>");var htm=Htm.join("");DW.createWindow(["Analytics & Troubleshooting",htm],[1,500,0],Link,evt,6,[1,0,15]);return false;}}
function getRequestBody(Form){function encodeNameAndValue(theName,theValue){var output=encodeURIComponent(theName);output+="=";output+=encodeURIComponent(theValue);return output;}
var NameVals=new Array();for(var i=0;i<Form.elements.length;i++){var Field=Form.elements[i];switch(Field.type){case "button":case "submit":case "reset":break;case "checkbox":case "radio":if(!Field.checked)break;case "text":case "hidden":case "password":NameVals.push(encodeNameAndValue(Field.name,Field.value));break;case "textarea":var val=Field.value.replace(/\r/g, "" ).replace(/\n/g, "\r\n" );
NameVals.push(encodeNameAndValue(Field.name,val));break;case "select-one":NameVals.push(encodeNameAndValue(Field.name,Field.options[Field.selectedIndex].value));break;case "select-multiple":break;default:NameVals.push(encodeNameAndValue(Field.name,Field.value));}}
return NameVals.join("&");}
