/***********************************************
* DHTML slideshow script-  © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice must stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

var photos=new Array()
var photoslink=new Array()
var caption=new Array()
var which=0

var lft_img_on="images/btn_accouncements_lft.gif"
var lft_img_off="images/btn_accouncements_lft_blk.gif"
var rt_img_on="images/btn_accouncements_rht.gif"
var rt_img_off="images/btn_accouncements_rht_blk.gif"

//define images. You can have as many as you want:
photos[0]="images/announce_senior_small.jpg"
//photos[1]="images/announce_healthcare_small.jpg"
photos[1]="images/announce_greatdoctors_small.jpg"
photos[2]="images/announce_volunteers_small.jpg"
photos[3]="images/announce_bariatric_small.jpg"
photos[4]="images/announce_gold_award_small.jpg"
photos[5]="images/announce_frick_small.jpg"
photos[6]="images/announce_jeanette_small.jpg"
photos[7]="images/announce_medcare_small.jpg"
photos[8]="images/announce_stroke_small.jpg"

//Specify whether images should be linked or not (1=linked)
var linkornot=1

//Set corresponding URLs for above images. Define ONLY if variable linkornot equals "1"
photoslink[0]="images/announce_seniorhealthfair.jpg"
//photoslink[1]="images/announce_healthcare.jpg"
photoslink[1]="images/announce_greatdoctors.jpg"
photoslink[2]="images/announce_volunteers.jpg"
photoslink[3]="images/announce_bariatric.jpg"
photoslink[4]="images/announce_gold_award.jpg"
photoslink[5]="images/announce_frick.jpg"
photoslink[6]="images/announce_jeanette.jpg"
photoslink[7]="images/announce_medcare.jpg"
photoslink[8]="images/announce_stroke.jpg"

//Specify whether images should have captions or not (1=captions)
var captions=0

//Set corresponding URLs for above images. Define ONLY if variable linkornot equals "1"
caption[0]="Image 1"
caption[1]="Image 2"
caption[2]="Image 3"

//do NOT edit pass this line

var preloadedimages=new Array()
for (i=0;i<photos.length;i++){
preloadedimages[i]=new Image()
preloadedimages[i].src=photos[i]
}

function applyrighteffect(){
if (document.all && photoslider.filters){
photoslider.filters.revealTrans.Transition=7
photoslider.filters.revealTrans.stop()
photoslider.filters.revealTrans.apply()
}
}

/*function changecaption() {
document.getElementById('caption').innerHTML=caption[which]
}*/


function applylefteffect(){
if (document.all && photoslider.filters){
photoslider.filters.revealTrans.Transition=6
photoslider.filters.revealTrans.stop()
photoslider.filters.revealTrans.apply()
}
}

function playeffect(){
if (document.all && photoslider.filters)
photoslider.filters.revealTrans.play()
}

function keeptrack(){
window.status="Accouncement "+(which+1)+" of "+photos.length
//window.status=photoslink[which]
}

function backward(){
	if (which==1){
		which--
		applylefteffect()
		document.images.photoslider.src=photos[which]
		document.images.lft_img.src=lft_img_off
		document.images.rt_img.src=rt_img_on
		playeffect()
		keeptrack()
		//changecaption()
	} else if (which>0) {
		which--
		applylefteffect()
		document.images.photoslider.src=photos[which]
		document.images.lft_img.src=lft_img_on
		document.images.rt_img.src=rt_img_on
		playeffect()
		keeptrack()
		//changecaption()
	} else {
		document.images.lft_img.src=lft_img_off
	}
}

function forward(){
	if (which+1==photos.length-1){
		//Last Forwward Item
		which++
		applyrighteffect()
		document.images.photoslider.src=photos[which]
		document.images.rt_img.src=rt_img_off
		document.images.lft_img.src=lft_img_on
		playeffect()
		keeptrack()
		//changecaption()
	} else if (which<photos.length-1) {
		//All other Forward Items
		which++
		applyrighteffect()
		document.images.photoslider.src=photos[which]
		document.images.rt_img.src=rt_img_on
		document.images.lft_img.src=lft_img_on
		playeffect()
		keeptrack()
		//changecaption()
	} else {
		document.images.rt_img.src=rt_img_off
	}
}

function ViewAccouncement() {
	if ([which] == 4 || [which] == 1) {
		var w = 400;
		var h = 380;
	}
	if ([which] == 2) {
		var w = 338;
		var h = 380;
	}
	if ([which] == 3) {
		var w = 554;
		var h = 500;
	}
	//if ([which] == 1) {
		//var w = 380;
		//var h = 507;
	//}
	if ([which] == 0) {
		var w = 302;
		var h = 380;
	}
	if ([which] == 5) {
		var w = 550;
		var h = 626;
	}
	if ([which] == 6) {
		var w = 550;
		var h = 710;
	}
	if ([which] == 7) {
		var w = 575;
		var h = 521;
	}
	if ([which] == 8) {
		var w = 500;
		var h = 573;
	}

	var left = (screen.width/2)-(w/2);
	var top = (screen.height/2)-(h/2);
	window.open(photoslink[which],'Accouncement','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left)
}
