﻿// JScript File


function StartUp()  {

    populate();
    blink();
    
}


var AbtActiveID = 'About_Org';
var ImgActiveID = '2010';


function ToggleList(listID) {

    var lObj;
    
    lObj = document.getElementById(listID);
    
    if (lObj.style.display == 'none' || lObj.style.display == "") {
          lObj.style.display = 'block';
        } else {
          lObj.style.display = 'none';
        }

    TShirtMouseOver('2010');
   
}

function AboutMO(z) {

    var nObj, pObj;

    nObj = document.getElementById(z);
    pObj = document.getElementById(AbtActiveID);
    pObj.style.display = 'none';
    nObj.style.display = 'block';
    
    AbtActiveID = z;
    

    return false;
}






function TShirtMouseOver(Tid) {

    var x, y;
    var imgNext;
    var imgActive;
    var imgParent;
 
    imgActive = document.getElementById(ImgActiveID);
    imgActive.style.visibility = "hidden";
    imgNext = document.getElementById(Tid);
    imgParent = document.getElementById('TImgs');

    x = getPageOffsetLeft(imgParent) + 2;
    y = getPageOffsetTop(imgParent) + 2;

  // For IE, adjust position.

  if (browser.isIE) {
    x += imgParent.offsetParent.clientLeft;
    y += imgParent.offsetParent.clientTop;
  }
    
    imgNext.style.left = x + "px";
    imgNext.style.top = y + "px";
    imgNext.style.visibility = "visible";
    ImgActiveID = Tid;
    
    return false;
}



function TShirtMouseOut(event) {


    var imgActive;
    var el;
    var reset;
    
    if (browser.isIE)
        el = window.event.toElement;
    else if (event.relatedTarget != null)
        el = (event.relatedTarget.tagName ? event.relatedTarget : event.relatedTarget.parentNode);
    
    if (el == null || event.relatedTarget == null) {

            imgActive = document.getElementById(ImgActiveID);
            imgActive.style.visibility = "hidden";
            ImgActiveID = '2010';
            imgActive = document.getElementById(ImgActiveID);
            imgActive.style.visibility = "visible";
    }
        
    return false;
}



// JScript File


var b_timer = null; // blink timer
var b_on = true; // blink state
var blnkrs = null; // array of spans

var blnkDecay = 100;  //incremental decrease to blink rate

function blink() {

    var tmp = document.getElementsByTagName("span");
        
    if (tmp) {

        blnkrs = new Array();
        var b_count = 0;

        for (var i = 0; i < tmp.length; ++i) {
            if (tmp[i].className == "blink" || tmp[i].className == "blinkWeight" || tmp[i].className == "blinkBackground") {
                blnkrs[b_count] = tmp[i];   
                ++b_count;
            }
        }
        // time in m.secs between blinks
        // 500 = 1/2 second
        blinkTimer(500);
    }
}

function blinkTimer(ival) {

    if (b_timer) {
        window.clearTimeout(b_timer);
        b_timer = null;
    }
    
    blinkIt();
    ival = ival + blnkDecay;
    b_timer = window.setTimeout('blinkTimer(' + ival + ')', ival);
}

function blinkIt() {


    for (var i = 0; i < blnkrs.length; ++i) {
        
        if (blnkrs[i].className == "blink") {
            if (b_on == true) {
            blnkrs[i].style.visibility = "hidden";
            }
            else {
            blnkrs[i].style.visibility = "visible";
            }
        }
        else if (blnkrs[i].className == "blinkWeight") {
            if (b_on == true) {
            blnkrs[i].style.fontWeight = "bold";
            //blnkrs[i].style.fontSize = "12pt";
            }
            else {
            blnkrs[i].style.fontWeight = "normal";
            //blnkrs[i].style.fontSize = "13pt";
            }
        }
        else if (blnkrs[i].className == "blinkBackground") {
            if (b_on == true) {
            blnkrs[i].style.backgroundColor = "red";
            }
            else {
            blnkrs[i].style.backgroundColor = "white";
            }
        } 
    }
    b_on =!b_on;
} 

