﻿var colorTimer = null;
var om = 0;

function online_mouseover()
{
	om=1;
}

function online_mouseout()
{
	om=0;
}

function first_switch()
{
	//document.getElementById("img_violet").style.display="block";
}


function make_online()
{
	colorTimer = setInterval (change_color, 2500);	
}


make_online();


var colors = ["img_violet","img_magenta","img_yellow","img_orange","img_blue","img_green","img_light_red","img_red"];
var colors_index = 0;
var colors_direction = "up";
var colors_stop_rotate = 0;

function change_color() {
    if (om == 1)
        return;
    
    $("#" + colors[colors_index]).css("display", "none");

    if (colors_direction == "up") {
        colors_index++;
        if (colors_index == colors.length) {
            colors_index -= 2;
            colors_direction = "down";
        }
    }
    else {
        colors_index--;
        if (colors_index == -1) {
            colors_index += 2;
            colors_direction = "up";
        }
    }

    $("#" + colors[colors_index]).css("display", "block");
}

function red_img(){
	this.style.display="none";
	$("#img_red").css("display", "block");
}



