﻿var spotLight;
var x, y, direction;

function showSlideLight() {
    if (document.all) {
        spotLight = document.getElementById('spotLightImg');
        x = 0;
        y = spotLight.height;
        direction = "right";
        spotLight.filters.light.addPoint(100,50,100,255,255,255,90);
        setInterval('slidelight()', 50);
    }
}

function slidelight(){
    spotLight.filters.light.MoveLight(0,x,y,200,-1);

    if (x < spotLight.width + 200 && direction == "right")
        x += 10;
    else if (x > spotLight.width + 200) {
        direction = "left";
        x -= 10;
    }
    else if (x > -200 && x < -185) {
        direction = "right";
        x += 10;
    }
    else{
        x -= 10;
        direction = "left";
    }
}

