// JavaScript Document
/* ####################### begins list of images to be used
 ####################### */
currentNewsIndx=0;
NewsDates=new Array();
NewsDates[1]="March 9, 2010";
NewsDates[2]="March 8, 2010";
NewsDates[3]="March 4, 2010";
NewsDates[4]="March 4, 2010";
NewsDates[0]="March 1, 2010";

Headline=new Array();
Headline[1] = "JURY CONVICTS PERRIS MAN OF 1985 MURDER OF RETIRED RIVERSIDE POLICE SERGEANT DURING ROBBERY"
Headline[2] = "TWO MEN HELD TO ANSWER IN MURDER OF DESERT HOT SPRINGS MAN"
Headline[3] = "FIVE HELD TO ANSWER FOR MURDER OF CANADIAN BUSINESSMAN"
Headline[4] = "MAN MUST STAND TRIAL FOR JURY TAMPERING DURING RAYMOND OYLER ARSON TRIAL"
Headline[0] = "PRIEST SENTENCED TO PRISON IN ILLEGAL DRUG SALES, POSSESSION CASE"


NewsDesc=new Array();
NewsDesc[1]="A Perris man has been convicted of the 1985 murder "
NewsDesc[2]="Today, a Riverside County judge ordered two defendants to stand trial for the murder"
NewsDesc[3]=" Today, a Riverside County judge ordered five defendants to stand trial for the  murder"
NewsDesc[4]="The brother-in-law of convicted arsonist and death row inmate Raymond Lee Oyler"
NewsDesc[0]="A Riverside County Superior Court judge today, March 1, 2010, sentenced a"

/* ####################### now we preload the images ####################### */
NewsDatesPreloaded = new Array(5)
/*{
for (var i = 0; i < NewsDates.length ; i++) 
imagesPreloaded[i] = new Image(161,136)
imagesPreloaded[i].src=MyImages[i]
} */
/* ####################### we create the functions to go forward and go back ####################### */
function getNewsobject(obj){
if (document.getElementById)
return document.getElementById(obj)
else if (document.all)
return document.all[obj]
}

function NextNews(){
if (currentNewsIndx<NewsDatesPreloaded.length-1){
currentNewsIndx=currentNewsIndx+1;
getNewsobject("_newsDate").innerHTML = NewsDates[currentNewsIndx];
getNewsobject("_Headline").innerHTML = Headline[currentNewsIndx];
getNewsobject("_newsDesc").innerHTML = NewsDesc[currentNewsIndx];
}
else {
currentNewsIndx=0
getNewsobject("_newsDate").innerHTML = NewsDates[currentNewsIndx];
getNewsobject("_Headline").innerHTML = Headline[currentNewsIndx];
getNewsobject("_newsDesc").innerHTML = NewsDesc[currentNewsIndx];
}
}

function BackNews(){
if (currentNewsIndx>0){
currentNewsIndx=currentNewsIndx-1;
getNewsobject("_newsDate").innerHTML = NewsDates[currentNewsIndx];
getNewsobject("_Headline").innerHTML = Headline[currentNewsIndx];
getNewsobject("_newsDesc").innerHTML = NewsDesc[currentNewsIndx];
}
else {
currentNewsIndx=4
getNewsobject("_newsDate").innerHTML = NewsDates[currentNewsIndx];
getNewsobject("_Headline").innerHTML = Headline[currentNewsIndx];
getNewsobject("_newsDesc").innerHTML = NewsDesc[currentNewsIndx];
}
}

function automatic_News() {
if (currentNewsIndx<NewsDatesPreloaded.length-1){
currentNewsIndx=currentNewsIndx+1;
}
else {
currentNewsIndx=0
}	
getNewsobject("_newsDate").innerHTML = NewsDates[currentNewsIndx];
getNewsobject("_Headline").innerHTML = Headline[currentNewsIndx];
getNewsobject("_newsDesc").innerHTML = NewsDesc[currentNewsIndx];
var delay = setTimeout("automatic_News()",8000)
}

function changeNewspage() {
//newlocation = location.href;
if (currentNewsIndx == 1) {
newlocation = "newsrelease/NEWS RELEASE -- Jury convicts Perris man of 1985 murder of retired Riverside police sergeant.pdf"
window.open(newlocation,'','','')
//window.location.href="News/PressReleases/122909.html"
}
if (currentNewsIndx == 2) {
newlocation = "newsrelease/03.08.10 CRIMINAL CASE UPDATE - Two men held to answer on murder charge.pdf"
window.open(newlocation,'','','')
//window.location.href="News/PressReleases/122909.html"
}
if (currentNewsIndx == 3) {
newlocation = "newsrelease/03.04.10 CRIMINAL CASE UPDATE - Five held to answer for murder of businessman.pdf"
window.open(newlocation,'','','')
//window.location.href="News/PressReleases/122909.html"
}
if (currentNewsIndx == 4) {
newlocation = "newsrelease/03.04.10 CCU -- Hillman to stand trial for jury tampering.pdf"
window.open(newlocation,'','','')
//window.location.href="News/PressReleases/122909.html"
}
if (currentNewsIndx == 0) {
newlocation = "newsrelease/03 01 10 CCU -- Home Gardens priest sentenced in drug sales case.pdf"
window.open(newlocation,'','','')
//window.location.href="News/PressReleases/122909.html"
}
}
