function pickPicture() {

	image = new Array;

	image[1]="images/jeffanddevra.jpg"
	image[2]="images/HeidiMattVirginia.jpg";
	image[3]="images/befitgang.jpg" ;
	image[4]="images/AFC2007.jpg" ;

// Create a random number between 1 and five
	random_num = (Math.round((Math.random()*3)+1));


// Write the image tag with a random array element
	document.write("<img src=\"" + image[random_num] + "\">");

}

// Open Page
function OpenPage(index)   {  

	switch(index){

		case 0:
			file = "nominated.html"
			break
			
		case 1:
			file = "trickortreat.html"
			break
			
		case 2:
			file = "http://bestof.signonsandiego.com/2007/vote/best-gym/"
			break
		case 3:
			file = "http://www.competitor.com/bestof/?r=1"
			break
		case 4:
			file = "docs/BeFitLabTests.pdf"
			break

	}
	
	PopUpPage(file)
}

// Open Testimonial Page
function OpenTestimonial(index)   {  

	switch(index){

		case 0:
			file = "testimonial_andrewspurgin.html"
			break
		case 1:
			file = "testimonial_margstark.html"
			break
		case 2:
			file = "testimonial_jimrider.html"
			break
		case 3:
			file = "testimonial_patstark.html"
			break
		case 4:
			file = "testimonial_michelepeters.html"
			break
		case 5:
			file = "testimonial_tnt.html"
			break
		case 6:
			file = "testimonial_joywill.html"
			break
		case 7:
			file = "testimonial_victoria.html"
			break
		case 8:
			file = "testimonial_jenjung.html"
			break
		case 9:
			file = "testimonial_alexa.html"
			break
		case 10:
			file = "testimonial_dave.html"
			break
		case 11:
			file = "testimonial_deborah_christine.html"
			break
		case 12:
			file = "testimonial_michelepeters_2.html"
			break
		case 13:
			file = "testimonial_cindyerdman.html"
			break
		case 14:
			file = "testimonial_jackiecorbeil.html"
			break
	}
	
	PopUpTestimonial(file)
}

// Open 8 Week Challenge Page
function Open8WeekChallenge(index)   {  

	switch(index){

		case 0:
			file = "200602_8_week_challenge.html"
			break
			
	}
	
	PopUpChallenge(file)
}

// Open Event Page
function OpenEvent(index)   {  

	switch(index){

		case 0:
			file = "http://carlsbadmarathon.com/site5.aspx/"
			break
		case 1:
			file = "http://www.lajollahalfmarathon.com/"
			break
		case 2:
			file = "http://www.kathyloperevents.com/cor15K/"
			break
		case 3:
			file = "docs/2007fitnessappreciation.pdf"
			break
		case 4:
			file = "http://www.afchalf.com/"
			break
		case 5:
			file = "http://www.nike.com/nikemarathon/"
			break
		case 6:
			file = "http://www.tntformularun.com"
			break	
		case 7:
			file = "http://disneyworldsports.disney.go.com/dwws/en_US/westcoast/listing?name=WestCoastEventListingPage&CMP=KNC-DLHalfGoogle&HBX_PK=disneyland+half+marathon&HBX_OU=50&bhcp=1"
			break	
		case 8:
			file = "http://www.tourdepoway.com/"
			break	
		case 9:
			file = "http://www.stjude.org/"
			break	
		case 10:
			file = "http://www.mwrtoday.com/Sandiego/events.htm"
			break
		
	
	}
	
	PopUpEventPage(file)
}

// Open New Leaf Page
function OpenNewLeaf(index)   {  

	switch(index){

		case 0:
			file = "http://www.newleaffitness.com"
			break
	}
	
	PopUpEventPage(file)
}

// Open News Page
function OpenNews(index)   {  



	switch(index){

		case 0:
			file = "http://www.emailthis.clickability.com/et/emailThis?clickMap=viewThis&etMailToID=791585549&pt=Y"
			break
			
		case 1:
			file = "docs/presidiosentinel.pdf"
			break
			
		case 2:
			file = "http://www.news8online.com/features/healthcast/story.php?id=49995"
			break
			
		case 3:
			file = "docs/8_week_challenge.pdf"
			break
			
		case 4:
			file = "http://www.gaylesbiantimes.com/?id=8457"
			break
			
		case 5:
			file = "http://www.kusi.com/news/goodmorning/4876736.html"
			break
		case 6:
			file = "docs/BeFit_Buzz.pdf"
			break
		case 7:
			file = "http://kfmb.com/features/healthcast/story.php?id=74224"
			break
	}
	
	PopUpEventPage(file)
}

// Open Certificate Page
function OpenCertificate(index)   {  

	switch(index){

		case 0:
			file = "docs/circuitcertificate.pdf"
			break
	}
	
	PopUpEventPage(file)
}

// Open Dinner Studio Page
function OpenDinnerStudio(index)   {  

	switch(index){

		case 0:
			file = "http://www.dinnerstudio.com/"
			break
	}
	
	PopUpEventPage(file)
}

// Open Run/Walk Group Page
function OpenRunDirections(index)   {  

	switch(index){

		case 0:
			file = "docs/directions.pdf"
			break
	}
	
	PopUpEventPage(file)
}


// Open Training Schedule
function OpenTrainingSchedule(index)   {  

	switch(index){

		case 0:
			file = "docs/2007_NIKE_Half_Marathon_21week_Training_Program.pdf"
			break
		case 1:
			file = "docs/FallCircuitTrainingSchedule.pdf"
			break
		case 2:
			file = "docs/2008_Carlsbad_Training_Program.pdf"
			break
			
		case 3:
			file = "docs/2007Qtr1Schedule.pdf"
			break
			
		case 4:
			file = "docs/2008_La_Jolla_Half_Marathon.pdf"
			break
		case 5:
			file = "docs/2008_AFC_Half_Marathon_Training_Program.pdf"
			break
			
		case 6:
			file = "docs/2007_AFC_and_NIKE_Full_Marathon_25week_Training_Program.pdf"
			break
		case 7:
			file = "docs/2007_AFC_and_NIKE_Half_Marathon_25week_Training_Program.pdf"
			break
		case 8:
			file = "docs/2009_SurfCity_Training_Program.pdf"
			break
		case 9:
			file = "docs/2009_AFC_Half_Marathon_Training_Program.pdf"
			break
	}
	
	PopUpEventPage(file)
}

// Open Newsletter
function OpenNewsletter(index)   {  

	switch(index){

		case 0:
			file = "docs/2006fallnewsletter.pdf"
			break
	}
	
	PopUpEventPage(file)
}

// Open Questionnaire
function OpenQuestionnaire(index)   {  

	switch(index){

		case 0:
			file = "docs/BeFitInitialConsultQuestionnaire2009.pdf"
			break
	}
	
	PopUpEventPage(file)
}

// Open Holidays
function OpenHolidays(index)   {  

	switch(index){

		case 0:
			file = "docs/Official_Holidays.pdf"
			break
	}
	
	PopUpEventPage(file)
}

// Open SpecialEvent
function OpenSpecialEvent(index)   {  

	switch(index){

		case 0:
			file = "docs/cyclingclinic.pdf"
			break
		case 1:
			file = "docs/wellnessclinic.pdf"
			break
			
		case 2:
			file = "http://ashleymatte.com"
			break
	}
	
	PopUpEventPage(file)
}

function OpenSite(index)   {  

	switch(index){

		case 0:
			file = "http://www.nealstreetdesign.com"
			break
	
	}
	
	PopUpSite(file)
}


// Open Bootcamp Page
function OpenBootcamp(index)   {  

	switch(index){

		case 0:
			file = "bootcamp_meganbeauvais.html"
			break
		case 1:
			file = "bootcamp_saradurkavich.html"
			break
	}
	
	PopUpBootcamp(file)
}


// Pop up example page
function PopUpEventPage(file)   { 
	PopUpWindow=window.open(file, "PopUp",
    "resizable=yes,toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,copyhistory=0,width=900,height=700"); 
  PopUpWindow.location=file;  
	PopUpWindow.focus();

}

// Pop up example page
function PopUpTestimonial(file)   { 
	PopUpWindow=window.open(file, "PopUp",
    "resizable=yes,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,copyhistory=0,width=700,height=400"); 
  PopUpWindow.location=file;  
	PopUpWindow.focus();

}

// Pop up page
function PopUpPage(file)   { 
	PopUpWindow=window.open(file, "PopUp",
    "resizable=yes,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,copyhistory=0,width=900,height=700"); 
  PopUpWindow.location=file;  
	PopUpWindow.focus();

}

// Pop up challenge page
function PopUpChallenge(file)   { 
	PopUpWindow=window.open(file, "PopUp",
    "resizable=yes,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,copyhistory=0,width=800,height=600"); 
  PopUpWindow.location=file;  
	PopUpWindow.focus();

}

// Pop up site
function PopUpSite(file)   { 
	PopUpWindow=window.open(file, "PopUp",
    "resizable=yes,toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,copyhistory=0,width=900,height=600"); 
  PopUpWindow.location=file;  
	PopUpWindow.focus();

}

// Pop up bootcamp page
function PopUpBootcamp(file)   { 
	PopUpWindow=window.open(file, "PopUp",
    "resizable=yes,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,copyhistory=0,width=700,height=400"); 
  PopUpWindow.location=file;  
	PopUpWindow.focus();

}

//Index scrolling banner
/*Example message arrays for the two demo scrollers*/

var pausecontent2=new Array()
pausecontent2[0]='<a href="specialevents.html#buddy_special">Buddy Training Special!</a>'
pausecontent2[1]='<a href="specialevents.html#spartan">Calling all Spartans - the Next Sparta Challenge</a>'
pausecontent2[2]='<a href="testimonials.html">Check Out Our Client Comments</a>'
pausecontent2[3]='<a href="circuittraining.html">NEW 9am SATURDAY Circuit Class</a>'



/***********************************************
* Pausing up-down scroller- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/

function pausescroller(content, divId, divClass, delay){
this.content=content //message array content
this.tickerid=divId //ID of ticker div to display information
this.delay=delay //Delay between msg change, in miliseconds.
this.mouseoverBol=0 //Boolean to indicate whether mouse is currently over scroller (and pause it if it is)
this.hiddendivpointer=1 //index of message array for hidden div
document.write('<div id="'+divId+'" class="'+divClass+'" style="position: relative; overflow: hidden"><div class="innerDiv" style="position: absolute; width: 100%" id="'+divId+'1">'+content[0]+'</div><div class="innerDiv" style="position: absolute; width: 100%; visibility: hidden" id="'+divId+'2">'+content[1]+'</div></div>')
var scrollerinstance=this
if (window.addEventListener) //run onload in DOM2 browsers
window.addEventListener("load", function(){scrollerinstance.initialize()}, false)
else if (window.attachEvent) //run onload in IE5.5+
window.attachEvent("onload", function(){scrollerinstance.initialize()})
else if (document.getElementById) //if legacy DOM browsers, just start scroller after 0.5 sec
setTimeout(function(){scrollerinstance.initialize()}, 500)
}

// -------------------------------------------------------------------
// initialize()- Initialize scroller method.
// -Get div objects, set initial positions, start up down animation
// -------------------------------------------------------------------

pausescroller.prototype.initialize=function(){
this.tickerdiv=document.getElementById(this.tickerid)
this.visiblediv=document.getElementById(this.tickerid+"1")
this.hiddendiv=document.getElementById(this.tickerid+"2")
this.visibledivtop=parseInt(pausescroller.getCSSpadding(this.tickerdiv))
//set width of inner DIVs to outer DIV's width minus padding (padding assumed to be top padding x 2)
this.visiblediv.style.width=this.hiddendiv.style.width=this.tickerdiv.offsetWidth-(this.visibledivtop*2)+"px"
this.getinline(this.visiblediv, this.hiddendiv)
this.hiddendiv.style.visibility="visible"
var scrollerinstance=this
document.getElementById(this.tickerid).onmouseover=function(){scrollerinstance.mouseoverBol=1}
document.getElementById(this.tickerid).onmouseout=function(){scrollerinstance.mouseoverBol=0}
if (window.attachEvent) //Clean up loose references in IE
window.attachEvent("onunload", function(){scrollerinstance.tickerdiv.onmouseover=scrollerinstance.tickerdiv.onmouseout=null})
setTimeout(function(){scrollerinstance.animateup()}, this.delay)
}


// -------------------------------------------------------------------
// animateup()- Move the two inner divs of the scroller up and in sync
// -------------------------------------------------------------------

pausescroller.prototype.animateup=function(){
var scrollerinstance=this
if (parseInt(this.hiddendiv.style.top)>(this.visibledivtop+5)){
this.visiblediv.style.top=parseInt(this.visiblediv.style.top)-5+"px"
this.hiddendiv.style.top=parseInt(this.hiddendiv.style.top)-5+"px"
setTimeout(function(){scrollerinstance.animateup()}, 50)
}
else{
this.getinline(this.hiddendiv, this.visiblediv)
this.swapdivs()
setTimeout(function(){scrollerinstance.setmessage()}, this.delay)
}
}

// -------------------------------------------------------------------
// swapdivs()- Swap between which is the visible and which is the hidden div
// -------------------------------------------------------------------

pausescroller.prototype.swapdivs=function(){
var tempcontainer=this.visiblediv
this.visiblediv=this.hiddendiv
this.hiddendiv=tempcontainer
}

pausescroller.prototype.getinline=function(div1, div2){
div1.style.top=this.visibledivtop+"px"
div2.style.top=Math.max(div1.parentNode.offsetHeight, div1.offsetHeight)+"px"
}

// -------------------------------------------------------------------
// setmessage()- Populate the hidden div with the next message before it's visible
// -------------------------------------------------------------------

pausescroller.prototype.setmessage=function(){
var scrollerinstance=this
if (this.mouseoverBol==1) //if mouse is currently over scoller, do nothing (pause it)
setTimeout(function(){scrollerinstance.setmessage()}, 100)
else{
var i=this.hiddendivpointer
var ceiling=this.content.length
this.hiddendivpointer=(i+1>ceiling-1)? 0 : i+1
this.hiddendiv.innerHTML=this.content[this.hiddendivpointer]
this.animateup()
}
}

pausescroller.getCSSpadding=function(tickerobj){ //get CSS padding value, if any
if (tickerobj.currentStyle)
return tickerobj.currentStyle["paddingTop"]
else if (window.getComputedStyle) //if DOM2
return window.getComputedStyle(tickerobj, "").getPropertyValue("padding-top")
else
return 0
}





