﻿
function navRO_top(x) {
    var y=x.getElementsByTagName('img');
	if(y[0].src.indexOf("_RO") > -1){y[0].src = y[0].src.replace("_RO","");	} 
	else {y[0].src = y[0].src.substring(0, y[0].src.lastIndexOf(".")) + "_RO" + y[0].src.substring(y[0].src.lastIndexOf("."))}
}

function navOn_main(x) {
    var y=x.parentNode;  
    
    if (y.style.background.indexOf("_RO.png") <= 0 ){
        y.style.background = "url(/images/buttons/nav_" + y.id +"_RO.png) no-repeat"
    }
}

function navOff_main(x) {
    var y=x.parentNode;  
    
    if (y.style.background.indexOf("_RO.png") >= 0 ){
        y.style.background = "none";
    }
}

        function LoadImage(image) {
            var nImage = new Image;
            myImages[image] = nImage;

            nImage.src = image;
        }


function init(temp){
    var x = document.getElementById('nav').getElementsByTagName('li');
    for (var i=0;i<x.length;i++)
	{
	    if (x[i].className == ""){
	        var z = x[i].getElementsByTagName('a');
            z[0].onmouseover = function () {navOn_main(this);}
	        z[0].onmouseout = function () {navOff_main(this);}
		}
	}
	
	var y = document.getElementById(temp).getElementsByTagName('a');
    for (i=0;i<y.length;i++)
	{
        y[i].onmouseover = function () {navRO_top(this);}
        y[i].onmouseout = function () {navRO_top(this);}
	}
	
	
}

var quotes = new Array;
var counter = Math.floor(Math.random()*8);
var section = "";
quotes[0] = "images/quote1.png";
quotes[1] = "images/quote2.png";
quotes[2] = "images/quote3.png";
quotes[3] = "images/quote4.png";
quotes[4] = "images/quote5.png";
quotes[5] = "images/quote6.png";
quotes[6] = "images/quote7.png";
quotes[7] = "images/quote8.png";


function quote_change(temp){
	section=temp;
	if(counter>=quotes.length){counter=0;}
	document.getElementById('quote_'+section).src = quotes[counter];
	counter+=1;
	setTimeout('quote_change(section)', 8000);
}