﻿function findElement(elementName)

{
	
if (window.navigator.appName.toLowerCase().indexOf("netscape") > -1)
		
return document.getElementById(elementName);
	
else
		
return document.all[elementName];

}


function MarkButton(buttonID, col) {
    findElement(buttonID).className = col;
}


function ShowMyTR(ID)
{

if (findElement(ID).style.display == "none")
{
  findElement(ID).style.display = "block";
}	
//else
//{
//  findElement(ID).style.display = "none";
//}
return false;
}

function HideMyTR(ID)
{

if (findElement(ID).style.display == "none")
{
  //findElement(ID).style.display = "block";
}	
else
{
  findElement(ID).style.display = "none";
}
return false;
}

var speed = 1
var Logospeed = 3
var currentpos = 0, alt = 1, curpos1 = 0, curpos2 = -1

var currentposGr = 0, altGr = 1, curpos1Gr = 0, curpos2Gr = -1
var stopautoscroll = 0
var timID
function initialize(){
startit()
}
function scrollwindow()
{
    if (stopautoscroll == 1)
        return false;

    if (document.all)
        temp = findElement('OurClientsDIV').scrollTop;
    else
        temp = findElement('OurClientsDIV').scrollTop;

    curpos1 = curpos2

    curpos2 = findElement('OurClientsDIV').scrollTop;
    
    if (curpos1!=curpos2) {

        findElement('OurClientsDIV').scrollTop -= this.speed;//findElement('OurClientsDIV').scrollCursor;
        
    }
    else
    {
        findElement('OurClientsDIV').scrollTop = findElement('OurClientsDIV').scrollHeight-3;
    }



}



function scrollLogos() {
    if (stopautoscroll == 1)
        return false;

    if (document.all)
        temp = findElement('our_clients_logos').scrollLeft;
    else
        temp = findElement('our_clients_logos').scrollLeft;

    curpos1 = curpos2

    curpos2 = findElement('our_clients_logos').scrollLeft;

    if (curpos1 != curpos2) {

        findElement('our_clients_logos').scrollLeft += this.Logospeed; //findElement('OurClientsDIV').scrollCursor;

    }
    else {
        findElement('our_clients_logos').scrollLeft = Logospeed;
    }



}

function scrollGreetings() {
    ///GREETINGS

    if (document.all)
        temp = findElement('Greetings').scrollTop;
    else
        temp = findElement('Greetings').scrollTop;

    curpos1Gr = curpos2Gr

    curpos2Gr = findElement('Greetings').scrollTop;

    if (curpos1Gr != curpos2Gr) {

        findElement('Greetings').scrollTop += this.speed; //findElement('OurClientsDIV').scrollCursor;

    }
    else {
        findElement('Greetings').scrollTop = speed;
    }

}



var scrollspeed=2
var TimerID
var WinID
function scrollwindowup()
{
    var win = WinID

        
        if (document.all)
        {
            
            findElement(win).scrollTop = findElement(win).scrollTop + scrollspeed;
            //findElement(win).scrollCursor = findElement(win).scrollCursor + scrollspeed;
            }
        else
        {
            findElement(win).pageYOffset =findElement(win).pageYOffset+scrollspeed
            //findElement(win).scrollCursor = findElement(win).scrollCursor + scrollspeed;
        }
   
}

function scrollwindowdown()
{
var win = WinID
         
        if (document.all)
        {
            
            findElement(win).scrollTop = findElement(win).scrollTop - scrollspeed;
            //findElement(win).scrollCursor = findElement(win).scrollCursor + scrollspeed;
            }
        else
        {
            findElement(win).pageYOffset =findElement(win).pageYOffset - scrollspeed
            //findElement(win).scrollCursor = findElement(win).scrollCursor + scrollspeed;
        }
   
}



function startit(){
    timID = setInterval("scrollwindow()", 50)
   //setInterval("scrollGreetings()", 80)
}

function startlogos() {
    
    setInterval("scrollLogos()", 20)
}


function startfunc(func, win){
TimerID = setInterval(func+"("+win+")",80)
}

window.onload = initialize



function TextScroll(scrollname, div_name, up_name, down_name)
{
    this.div_name = div_name;
    this.name = scrollname;
    this.scrollCursor = 0;
    this.speed = 6;
    this.timeoutID = 0;
    this.div_obj = null;
    this.up_name = up_name;
    this.dn_name = down_name;

    {
        if (document.getElementById) {
            div_obj = document.getElementById(this.div_name);
            if (div_obj) {
                this.div_obj = div_obj;
                this.div_obj.style.overflow = 'hidden';
            }
            div_up_obj = document.getElementById(this.up_name);
            div_dn_obj = document.getElementById(this.dn_name);
            if (div_up_obj && div_dn_obj) {

                div_up_obj.onmouseover = function() { div_up_obj.src = 'images/up_a.gif'; eval(scrollname + '.scrollUp();') };
                div_up_obj.onmouseout = function() { div_up_obj.src = 'images/up.gif'; eval(scrollname + '.stopScroll();') };

                div_dn_obj.onmouseover = function() { div_dn_obj.src = 'images/down_a.gif'; eval(scrollname + '.scrollDown();') };
                div_dn_obj.onmouseout = function() { div_dn_obj.src = 'images/down.gif'; eval(scrollname + '.stopScroll();') };

            }
        }
    }

this.stopScroll = function() {
        clearTimeout(this.timeoutID);
    }

this.scrollUp = function() {
        if (this.div_obj) {
            this.scrollCursor = (this.scrollCursor - this.speed) < 0 ? 0 : this.scrollCursor - this.speed;
            this.div_obj.scrollTop = this.scrollCursor;
            this.timeoutID = setTimeout(this.name + '.scrollUp()', 30);
        }
    }

this.scrollDown = function() {
        if (this.div_obj) {
            this.scrollCursor += this.speed;
            this.div_obj.scrollTop = this.scrollCursor;
            this.timeoutID = setTimeout(this.name + '.scrollDown()', 30);
        }
    }

this.resetScroll = function() {
        if (this.div_obj) {
            this.div_obj.scrollTop = 0;
            this.scrollCursor = 0;
        }
    }
}





