// montageflash.js

monTimeout = 20000;
var urls = new Array();
var imgs = new Array();
var caps = new Array();

// montage decalration.js
var monBlock = null;
var monImg = null;
var monIdx = 0;
var monContainer = null;
var monTimeout = 7000;
//end of montage decalration.js

urls[0] = "default.aspx";
imgs[0] = "../image/Fr2.gif";
caps[0] = "First Registrars 0";

urls[1] = "default.aspx";
imgs[1] = "../image/Tigerfocus.jpg";
caps[1] = "First Registrars";

urls[2] = "default.aspx";
imgs[2] = "../image/lion.jpg";
caps[2] = "First Registrars";

urls[3] = "default.aspx";
imgs[3] = "../image/Cheetah.jpg";
caps[3] = "First Registrars";

urls[4] = "default.aspx";
imgs[4] = "../image/penguim.jpg";
caps[4] = "First Registrars";

urls[5] = "default.aspx";
imgs[5] = "../image/FR2.gif";
caps[5] = "First Registrars 5";

urls[6] = "default.aspx";
imgs[6] = "../image/lion.jpg";
caps[6] = "First Registrars";

urls[7] = "default.aspx";
imgs[7] = "../image/Tigerfocus.jpg";
caps[7] = "First Registrars";

urls[8] = "default.aspx";
imgs[8] = "../image/cheetah.jpg";
caps[8] = "First Registrars";

urls[9] = "default.aspx";
imgs[9] = "../image/Fr2.gif";
caps[9] = "First Registrars";

urls[10] = "default.aspx";
imgs[10] = "../image/penguim.jpg";
caps[10] = "First Registrars";

// end montageflash.js

montage(urls, imgs, caps, 427);


// montage.js
//



function montage(href, src, caption, width, animate) {
    // this is the case for browsers that don't support filters...
    var cycle = Math.floor(Math.random() * href.length);



    // go build all of the nested divs out
    monIdx = cycle;

    document.writeln("<div id=\"container\" style=\"width:427px;height:138px\">");

    for (i = 0; i < src.length; i++) {
        // set up a placeholder
        document.writeln("\t<div id=\"montage" + i + "\" style=\"display:none\">");

        montagePicker(href, src, caption, i);

        document.writeln("\t</div>");
    }

    document.writeln("</div>");

    // pull the images out
    monBlock = new Array(src.length);
    monImg = new Array(src.length);

    for (i = 0; i < src.length; i++) {
        monBlock[i] = document.getElementById("montage" + i).style;
        monImg[i] = document.getElementById("monimg" + i);

        if (monImg[i] == null) {
            montagePicker(href, src, caption, i);
            return;
        }
        //	alert( "foo" );
    }

    monContainer = document.getElementById("container");

    montageEffects();
}

function montageEffects() {
    var nextImage = (monIdx + 1) % monImg.length;

    // run the transition
    if (readIEVer() >= 4.0) {
        monContainer.style.filter = "blendTrans(duration=1.5) revealTrans(duration=1.0,transition=7)";

        monContainer.filters(0).apply();
        monContainer.filters(1).apply();

        montageSelect(nextImage);

        monContainer.filters(0).play();
        monContainer.filters(1).play();
    }
    else {
        montageSelect(nextImage);
    }

    // asked to be called again a little later
    setTimeout("montageSwap()", monTimeout);
}

function montageSelect(nextImage) {
    //alert( monImg[monIdx].style.visibility );
    monBlock[monIdx].display = "none";
    monIdx = nextImage;
    monBlock[monIdx].display = "block";
}

function montageSwap() {
    if (monImg[monIdx].complete) {
        // move the image index along
        montageEffects();
    }
    else {
        // check again 3 seconds later
        setTimeout("montageSwap()", 9000);
    }
}

function montagePicker(href, src, caption, cycle) {
    if (href[cycle] != null) {
        document.writeln("\t\t<A HREF=\"" + href[cycle] + "\"><IMG SRC=\"" + src[cycle] + "\" alt=\"" + caption[cycle] + "\" BORDER=\"0\" ID=\"monimg" + cycle + "\"></a>");
    }
    else {
        document.writeln("\t\t<IMG SRC=\"" + src[cycle] + "\" ID=\"monimg" + cycle + "\">");
    }
}

function hasBroadband() {
    if (readIEVer() < 5.0) {
        return false;
    }

    try {
        document.body.addBehavior("#default#clientCaps");

        return (typeof (document.body.connectionType) != "undefined" && document.body.connectionType == "lan");
    }
    catch (e) {
        return false;
    }
}

// -------------------------------------------------------------
// end of montage.js
// -------------------------------------------------------------



//Start Home.js
//
// home.js
//

// -------------------------------------------------------------
// cross-browser helper functions
// -------------------------------------------------------------

// Global variables
var isCSS = false;
var isW3C = false;
var isIE4 = false;
var isNN4 = false;
var isIE6 = false;
var isGecko = false;
var isOpera = false;
var isDHTML = false;
var suppressMenus = false;
var legacyMode = false;
var timerID = null;
var subtimerID = null;

// initialize upon load to let all browsers establish content objects
function autoconfig() {
    if (document && document.images) {
        isCSS = (document.body && document.body.style) ? true : false;
        isW3C = (isCSS && document.getElementById) ? true : false;
        isIE4 = (isCSS && document.all && readIEVer() >= 4.0) ? true : false;
        isNN4 = (document.layers) ? true : false;
        isGecko = (isCSS && navigator && navigator.product && navigator.product == "Gecko");
        isOpera = (isCSS && navigator.userAgent.indexOf("Opera") != -1);
        isIE6CSS = (document.compatMode && document.compatMode.indexOf("CSS1") >= 0) ? true : false;
        isIE6 = (isIE6CSS && readIEVer() >= 6.0);
        isDHTML = isCSS && (isIE4 || isGecko || isOpera);

        if (suppressMenus || (isOpera && readOperaVer() < 7) || (isGecko && navigator.productSub <= 20011022) || (isGecko && navigator.productSub == 20030107)) {
            // Opera 6.x doesn't seem to like the DHTML...
            // Netscape 6.2 puts the menus in the wrong place...
            // Safari, the menus don't go away... problem in ResetMenu
            isDHTML = false;
        }
    }
}

function readIEVer() {
    var agent = navigator.userAgent;
    var offset = agent.indexOf("MSIE");
    if (offset < 0) {
        return 0;
    }
    return parseFloat(agent.substring(offset + 5, agent.indexOf(";", offset)));
}

function readOperaVer() {
    var agent = navigator.userAgent;
    var offset = agent.indexOf("Opera");
    if (offset < 0) {
        return 0;
    }
    return parseFloat(agent.substring(offset + 6));
}

// -------------------------------------------------------------
// client-side masthead
// -------------------------------------------------------------

var m_pnlinks;
var m_crumbs;
var m_mhFixed = false;
var m_isHome = false;
var m_isSegHome = false;
var m_mda = null;
var m_printLink = null;
var m_emailLink = false;
var m_production = true;
var m_menudef = "content/public/menudef.aspx";

function mhFixupLink(href, extra) {
    if (typeof (extra) == "undefined") {
        extra = "&~ck=mn";
    }

    if (href) {
        var anchor = null;
        var anchorix = href.indexOf("#");

        if (anchorix != -1) {
            anchor = href.substr(anchorix);
            href = href.substr(0, anchorix);
        }

        if (href.indexOf("?") == -1) {
            extra = "?" + extra.substr(1);
        }

        if (href.toLowerCase().indexOf("javascript:") == -1) {
            href += extra;
        }
        else {
            start = href.indexOf("?");

            if (start != -1) {
                ix = href.indexOf("\'", start);

                if (ix == -1) {
                    ix = href.indexOf("\\", start);

                    if (ix == -1) {
                        ix = href.indexOf("\"", start);
                    }
                }

                if (ix != -1) {
                    href = href.substr(0, ix) + extra + href.substr(ix);
                }
            }
        }

        if (anchor) {
            href += anchor;
        }
    }

    return href;
}

function menuItem(text, href) {
    this.Text = text;
    this.Href = mhFixupLink(href, "&~ck=mn");
    this.IsSeparator = false;
    this.IsCaption = false;
    this.MenuItems = null;
}

function writeMH(phoneTitle, phoneMsg, phoneTariff, segmentTitle, hasLocale, logoLink, pnmsg) {
    autoconfig();


    m_mhFixed = true;

    document.writeln("<a name=\"mastheadtop\"></a>");


    // phone strip

    if (phoneTitle || phoneMsg) {
        document.write("<span class=\"mhTextEmph\">");

        if (phoneTitle) {
            document.write(phoneTitle);
            document.write(" ");
        }

        if (phoneMsg) {
            document.write(phoneMsg);
        }

        document.write("</span>");
    }

    if (phoneTariff) {
        document.write("<span class=\"mhTextTrf\"> " + phoneTariff + "</span>");
    }



    if (pnmsg) {
        //	document.write( "<span class=\"mhTextPnMsg\">&nbsp;&nbsp;&nbsp;&nbsp;" + pnmsg + "</span>" );
    }


    // mda

    document.write("</table>");
}


function mhLink(text, href, icon, extra) {
    href = mhFixupLink(href, extra);

    this.Text = text;
    this.Href = href;
    this.Icon = icon;
}

function addPnLink(text, href, icon) {
    if (!m_pnlinks) {
        m_pnlinks = new Array();
    }

    m_pnlinks[m_pnlinks.length] = new mhLink(text, href, icon);
}

function addCrumb(text, href) {
    if (!m_crumbs) {
        m_crumbs = new Array();
    }

    m_crumbs[m_crumbs.length] = new mhLink(text, href, null);
}

// -------------------------------------------------------------
// client-side footer
// -------------------------------------------------------------


// -------------------------------------------------------------
// Flash handling
// -------------------------------------------------------------

var activeX = false;
var swf = false;

function writeFlash(swfFile, altFile, width, height, ver, params) {
    var s = '';
    bgcolor = '#FFFFFF';
    if (hasFlash(ver)) {
        if (!activeX) {
            s = '<embed src="' + swfFile + '" quality="high" pluginspage="../www.macromedia.com/shockwave/download/index.cgi@P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="' + width + '" height="' + height + '" bgcolor="' + bgcolor + '" wmode="opaque"></embed>\n';
        } else {
            var st = 0;

            s = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="../download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0" width="' + width + '" height="' + height + '">\n';
            s += '\t<param name="movie" value="' + swfFile + '" />\n';
            s += '\t<param name="quality" value="high" />\n';
            s += '\t<param name="menu" value="false" />\n';
            s += '\t<param name="wmode" value="opaque" />\n';
            s += '\t<param name="bgcolor" value="' + bgcolor + '" />\n';

            if (params && params.length > 0) {
                while (true) {
                    var e = (params.indexOf('&', st) > 0) ? params.indexOf('&', st) : params.length - 1;
                    var t = params.substr(st, params.indexOf('=', st));
                    var v = params.substr(params.indexOf('=', st) + 1, (e - (params.indexOf('=', st) + 1)));
                    s += '\t<param name="' + t + '" value="' + v + '" />\n';
                    if (e >= params.length - 1) break;
                    params = params.substr(e + 1);
                }
            }

            s += '</object>\n\n';
        }
    } else {
        if (altFile.search(/(.gif)|(.jpg)$/gi) != -1) {
            s = '<img src="' + altFile + '" width="' + width + '" height="' + height + '" border="0" alt="" />\n';
        } else {
            window.location.href = altFile;
            return;
        }
    }
    with (document) {
        open('text/html');
        write(s);
        close();
    }
}

function hasFlash(ver) {
    if (!window.ua) ua = window;
    if (!ua.ver) {
        var av = navigator.appVersion;
        ua.mac = (av.indexOf("Mac") != -1);
        ua.ie = (av.indexOf("MSIE") != -1);
    }
    if (!ver) ver = 0;
    if (!ua.mac && ua.ie) {
        for (var i = ver; i <= 5 && i != 1 && swf != true; i++) {
            execScript('on error resume next: swf=IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash' + ((i == 0) ? '' : '.' + i) + '"))', 'VBScript');
        }
        activeX = swf;
    }
    else if (navigator && navigator.plugins) {
        var n, m, t, d, v;
        n = navigator;
        m = n.mimeTypes;
        t = 'application/x-shockwave-flash';
        if (m && m[t] && m[t].enabledPlugin && m[t].enabledPlugin.description) {
            d = m[t].enabledPlugin.description;
            v = d.charAt(d.indexOf('.') - 1);
            if (v >= ver) swf = true;
        }
    }
    return swf;
}

// -------------------------------------------------------------
// end of home.js
// -------------------------------------------------------------



