function LinkIt(LinkIt){
    document.location.href = LinkIt;
}

function PopIt(filename, h, w, s){
    popup = window.open(filename, "popDialog", "toolbar=no,status=no,scrollbars=" + s + ",location=no,menubar=no,directories=no,width=" + w + ",height=" + h + "");
    //	popup = window.open(filename,"popDialog","height="+h+",width="+w+", scrollbars="+s+", toolbars='no', resizable='no'")  
    if (popup.document.close()) {
        popup.document.close()
    }
}
// to avoid getting spam 
function emalIt(name, comp){
    emalItWithName(name, comp, name + '@' + comp);
}

function emalItWithName(name, comp, disp){
    document.write('<a href="mailto:' + name + '@' + comp + '.com">' + disp + '</a>');
}

function imgclass(){
    this.over = new Array();
    this.src = new Array();
    this.store = store;
    
    function store(src, over){
        var AL = this.src.length;
        this.src[AL] = new Image();
        this.src[AL].src = src;
        this.over[AL] = new Image();
        this.over[AL].src = over;
    }
}

var ih = new imgclass();

function preloader(t){
    for (i = 0; i < t.length; i++) {
        if (t[i].getAttribute('imgover')) {
        
            storeimages(t[i]);
            var checker = '';
            //checker=(t[i].getAttribute('imgover'))?checker+'A':checker+'';
            checker = t[i].getAttribute('imgover');
            
            if (checker = 'A') {
                mouseover(t[i]);
                mouseout(t[i]);
            }
            else {
                return;
            }
            
            if (t[i].src) {
                t[i].setAttribute("oldsrc", t[i].src);
            }
        }
    }
}

function mouseover(t){
    var newmouseover;
    if (t.onmouseover) {
        t.oldmouseover = t.onmouseover;
        newmouseover = function(){
            this.src = this.getAttribute("imgover");
            this.oldmouseover();
        }
    }
    else {
        newmouseover = function(){
            this.src = this.getAttribute("imgover");
        }
    }
    t.onmouseover = newmouseover;
}

function mouseout(t){
    var newmouseout;
    if (t.onmouseout) {
        t.oldmouseout = t.onmouseout;
        newmouseout = function(){
            this.src = this.getAttribute("oldsrc");
            this.oldmouseout();
        }
    }
    else {
        newmouseout = function(){
            this.src = this.getAttribute("oldsrc");
        }
    }
    t.onmouseout = newmouseout;
}

function storeimages(t){
    var simg = (t.getAttribute('src')) ? t.getAttribute('src') : '';
    var oimg = (t.getAttribute('imgover')) ? t.getAttribute('imgover') : '';
    ih.store(simg, oimg);
}

function preloadimgsrc(){
    if (!document.getElementById) 
        return;
    var it = document.getElementsByTagName('IMG');
    preloader(it);
}

if (window.addEventListener) {
    window.addEventListener("load", preloadimgsrc, false);
}
else {
    if (window.attachEvent) {
        window.attachEvent("onload", preloadimgsrc);
    }
    else {
        if (document.getElementById) {
            window.onload = preloadimgsrc;
        }
    }
}

// FLoater Text box
var gFloater = null;

function initFloater(){
    var anchors = document.getElementsByTagName("a");
    for (i = 0; i < anchors.length; i++) {
        var a = anchors[i];
        if (a.id && a.id.indexOf('d2fl_') >= 0) {
            a.onmouseover = showfloater;
            a.onmouseout = hidefloater;
        }
    }
}


function showfloater(e){
    var e = (e) ? e : event;
    var tgt = (e.target) ? e.target : e.srcElement;
    var x = e.clientX + document.body.scrollLeft;
    var y = e.clientY + document.body.scrollTop;
    if (x && y) 
        floatMessage(x + 10, y + 10, tgt.id);
    return false;
}

function floatMessage(x, y, id){
    // look for an element with the ID of floater_"id"
    gFloater = document.getElementById("floater_" + id);
    if (gFloater) {
        gFloater.style.display = 'none';
        gFloater.style.position = "absolute";
        gFloater.style.width = 250;
        gFloater.style.left = x;
        gFloater.style.top = y;
        gFloater.style.display = 'block';
    }
}

function hidefloater(){
    if (gFloater) 
        gFloater.style.display = 'none';
}
