// JavaScript Document
/* ####################### begins list of images to be used
 ####################### */
currentIndx=0;
AdImages=new Array();
//AdImages[1]="images/Programs/FJC.jpg";
//AdImages[2]="images/Programs/ads/VictimsRightsWeek10.jpg";

//AdImages[1]="images/Programs/ads/wam11.jpg";
//AdImages[0]="images/Programs/ads/wam10.jpg";

AdImages[0]="images/Programs/ads/fugitives.jpg";


//AdImages[0]="images/Programs/ads/CollegeAcademy.jpg";
//AdImages[0]="images/Programs/ar2008.jpg";
ImgAlt=new Array();
//ImgAlt[1]="Family Justice Center";
//ImgAlt[2]="National Crime Victims' Rights Week";

//ImgAlt[1]="WALK-A-MILE 2011";
//ImgAlt[0]="Victim's Rights Week";

//ImgAlt[0]="Fugitives - PDF Listing";
ImgAlt[0]="";


//ImgAlt[0]="Internship Opportunity";
//ImgAlt[0]="2008 Annual Report";
Titles=new Array();
//Titles[1]="We've Moved!";
//Titles[2]="National Crime Victims' Rights Week";

//Titles[1]="Walk-A-Mile 2011";
//Titles[0] = "Victim's Rights Week";

//Titles[0] = "Fugitives";
Titles[0] = "";


//Titles[0]="College Academy";
//Titles[0]="2008 Annual Report";
AdDates=new Array();
//AdDates[1]="April 1st, 11:30 AM - 1:30 PM";
//AdDates[2]="April 18 - 24, 2010";

AdDates[0]="";
//AdDates[1]="";

//AdDates[0]="Winter 2011";
//AdDates[0]="ROD PACHECO";
AdDesc=new Array();
//AdDesc[1]="The Riverside County Family Justice Center Open House";
//AdDesc[2]="Please join us to ensure \"A Victim's Voice Will Be Heard\"";

//AdDesc[1]="WALK-A-MILE 2011";
//AdDesc[0] = "VICTIM'S RIGHTS WEEK 2011";

//AdDesc[0] = "Fugitives";
AdDesc[0] = "";

//AdDesc[0]="Internship opportunity available for motivated and enthusiastic students.";
//AdDesc[0]="Riverside County District Attorney";
AdLinksHref=new Array();
AdLinksHref[0]="";
//AdLinksHref[1]="";
//AdLinksHref[2]="";
//AdLinksHref[3]="";
//AdLinksHref[2]="";
//AdLinksHref[2]="";
//AdLinksHref[3]="";
//AdLinksHref[2]="javascript:openVideo('Programs/VictimRightsProj/Video.html');";
AdLinksText=new Array();
AdLinksText[0]="";
//AdLinksText[1]="";
//AdLinksText[2]="";
//AdLinksText[3]="";
//AdLinksText[1]="";
//AdLinksText[2]="";
//AdLinksText[3]="";
//AdLinksText[2]="<img src='Images/video_icon.gif' align='bottom' border='0' />&nbsp;Victim Rights Video";
/* ####################### now we preload the images ####################### */
//adImagesPreloaded = new Array(2)
adImagesPreloaded = new Array(1)
for (var i = 0; i < AdImages.length ; i++) 
{
adImagesPreloaded[i] = new Image(161,136)
adImagesPreloaded[i].src=AdImages[i]
}
/* ####################### we create the functions to go forward and go back ####################### */
var newwindow;
function openVideo(url) {
	newwindow=window.open(url,'name','height=540,width=752,left=50,top=50');
	if (window.focus) {newwindow.focus()}
}

function getAdsobject(obj){
if (document.getElementById)
return document.getElementById(obj)
else if (document.all)
return document.all[obj]
}

function NextAd(){
if (currentIndx<adImagesPreloaded.length-1){
currentIndx=currentIndx+1;
getAdsobject("_adImage").src=adImagesPreloaded[currentIndx].src;
getAdsobject("_adImage").alt=ImgAlt[currentIndx];
getAdsobject("_title").innerHTML = Titles[currentIndx];
getAdsobject("_date").innerHTML = AdDates[currentIndx];
getAdsobject("_desc").innerHTML = AdDesc[currentIndx];
getAdsobject("_link").href = AdLinksHref[currentIndx];
getAdsobject("_link").innerHTML = AdLinksText[currentIndx];
}
else {
currentIndx=0
getAdsobject("_adImage").src=adImagesPreloaded[currentIndx].src;
getAdsobject("_adImage").alt=ImgAlt[currentIndx];
getAdsobject("_title").innerHTML = Titles[currentIndx];
getAdsobject("_date").innerHTML = AdDates[currentIndx];
getAdsobject("_desc").innerHTML = AdDesc[currentIndx];
getAdsobject("_link").href = AdLinksHref[currentIndx];
getAdsobject("_link").innerHTML = AdLinksText[currentIndx];
}
}

function BackAd(){
if (currentIndx>0){
currentIndx=currentIndx-1;
getAdsobject("_adImage").src=adImagesPreloaded[currentIndx].src;
getAdsobject("_adImage").alt=ImgAlt[currentIndx];
getAdsobject("_title").innerHTML = Titles[currentIndx];
getAdsobject("_date").innerHTML = AdDates[currentIndx];
getAdsobject("_desc").innerHTML = AdDesc[currentIndx];
getAdsobject("_link").href = AdLinksHref[currentIndx];
getAdsobject("_link").innerHTML = AdLinksText[currentIndx];
}
else {
currentIndx=2
getAdsobject("_adImage").src=adImagesPreloaded[currentIndx].src;
getAdsobject("_adImage").alt=ImgAlt[currentIndx];
getAdsobject("_title").innerHTML = Titles[currentIndx];
getAdsobject("_date").innerHTML = AdDates[currentIndx];
getAdsobject("_desc").innerHTML = AdDesc[currentIndx];
getAdsobject("_link").href = AdLinksHref[currentIndx];
getAdsobject("_link").innerHTML = AdLinksText[currentIndx];
}
}

function automatic_Ads() {
if (currentIndx<adImagesPreloaded.length-1){
currentIndx=currentIndx+1;
}
else {
currentIndx=0
}	
getAdsobject("_adImage").src=adImagesPreloaded[currentIndx].src;
getAdsobject("_adImage").alt=ImgAlt[currentIndx];
getAdsobject("_title").innerHTML = Titles[currentIndx];
getAdsobject("_date").innerHTML = AdDates[currentIndx];
getAdsobject("_desc").innerHTML = AdDesc[currentIndx];
getAdsobject("_link").href = AdLinksHref[currentIndx];
getAdsobject("_link").innerHTML = AdLinksText[currentIndx];
var delay = setTimeout("automatic_Ads()",5000)
}

function changepage() {
//newlocation = location.href;
//if (currentIndx == 2) {
//		newlocation = "VS/rightsweek.html"
//		location.href = newlocation
//	}
//if (currentIndx == 0) {
//		newlocation = "programs.html#CollegeAcademy"
//		location.href = newlocation
//	}


if (currentIndx == 0) {
		newlocation = "http://www.rivcoda.org/bureau/fugitive.html"
		location.href = newlocation
	}


	
	
//	else if (currentIndx == 1) {
//		newlocation = "Programs/RiversideFJC_OpenHouse.pdf"
//		location.href = newlocation
//	}
}

function changeflyer() {
//newlocation = location.href;
//if (currentIndx == 2) {
//		newlocation = "Programs/RightsWeek10/Flyer%202010.pdf"
//		window.open(newlocation,'','','')
//	}
if (currentIndx == 0) {
		newlocation = "http://www.rivcoda.org/bureau/fugitive.html"
		window.open(newlocation,'','','')
	}


/*
if (currentIndx == 0) {
		newlocation = "Programs/wam10.pdf"
		window.open(newlocation,'','','')
	}
		else if (currentIndx == 1) {
		newlocation = "Programs/wam11.pdf"
		window.open(newlocation,'','','')
	}
*/

	
	
//	else if (currentIndx == 1) {
//		newlocation = "Programs/RiversideFJC_OpenHouse.pdf"
//		window.open(newlocation,'','','')
//	}
}
var newwindow;
function openVideo(url) {
	newwindow=window.open(url,'name','height=540,width=752,left=50,top=50');
	if (window.focus) {newwindow.focus()}
}
