if( window == top )
    window.location = "http://www.netroglycerine.com/top_of_mmotw.shtml";
body_width = 450;
head_rule_width = body_width - (body_width/10);
tail_rule_width = head_rule_width - 50;
border_width = body_width/20;

count = 0;
function head( tag, center_it )
{
    d = document;
    d.write( "<tr>" );
    d.write( "<td width=" );
    d.write( border_width );
    d.write( " bgcolor='#F9E4C5' align=center>" );
    if( tag == "" )
        d.write( "&nbsp;" );
    else
    {
        var name = "click_" + count++;
        d.write( "<a onMouseOver='highlight(" +
            '"' + name + '"' + ");' " );
        d.write( " onMouseOut='lowlight(" +
            '"' + name + '"' + ");' href='" );
        d.write( tag  );
        d.write( "'>" );
        d.write( "<img border=0 name='" + name +
            "' src='click_here.jpg'></a>" );
    }
    d.write( "</td>" );
    d.write( "<td width=" );
    d.write( border_width );
    d.write( " align=center>" );
    d.write( "&nbsp;" );
    d.write( "</td>" );
    if( center_it )
        d.write( "<td align=center width=" );
    else
        d.write( "<td width=" );
    d.write( body_width + ">" );
    d.write( '<font face="Verdana, Arial, Helvetica" size=-1>' );
}

function tail()
{
    d = document;
    d.write( "</td>" );
    d.write( "<td width=" );
    d.write( border_width );
    d.write( " align=center>" );
    d.write( "&nbsp;" );
    d.write( "</td>" );
    d.write( "</tr>" );
}

function tail_rule()
{
    d = document;
    d.write( '<img src="hrule.jpg" width=' );
    d.write( tail_rule_width );
    d.write( ' height=10 align=left>' );
}

function head_rule()
{
    d = document;
    d.write( '<br><img src="hrule.jpg" width=' );
    d.write( head_rule_width );
    d.write( ' height=10 align=left><br>' );
}

function highlight( link )
{
    document.images[link].src = "click_here_hi.jpg";
}

function lowlight( link )
{
    document.images[link].src = "click_here.jpg";
}

function next()
{
    tail();
    head( "", 0 );
}

if( up_to_date )
{
    pages = new Array();

    pages[0]  = "mm_page1.shtml";
    pages[1]  = "mm_page2.shtml";
    pages[2]  = "mm_page3.shtml";
    pages[3]  = "mm_page4.shtml";
    pages[4]  = "mm_page5.shtml";
    pages[5]  = "mm_page6.shtml";
    pages[6]  = "mm_page7.shtml";
    pages[7]  = "mm_page8.shtml";
    pages[8]  = "mm_page9.shtml";
    pages[9]  = "mm_page10.shtml";
    pages[10] = "mm_page11.shtml";
    pages[11] = "mm_page12.shtml";

    num_pages = 12;
    this_page = 0;
}

function next_page()
{
    if( up_to_date )
    {
        this_page++;
        if( this_page >= num_pages )
            this_page = 0;
        parent.content.location = pages[this_page];
    }
}

function center()
{
    tail();
    head( "", 1 );
}

function click_here( link )
{
    tail();
    head( link );
}

function click_finish( link )
{
    var str = "<a onMouseOver='highlight(this);' href=" +
            "'" +
            link +
            "'>" +
            "<img border=0 src='click_here.jpg'></a>";
    head( str );
}

function outside( link )
{
    window.open( link );
}

function outside_link( link, text )
{
    document.write( '<a href="javascript:window.open('
        + "'"
        + link
        + "'"
        + ');history.go(-1);">'
        + text + '</a>'
        );
}

function count_banner_ad_clicks()
{
    top.banner_clicks++;
    document.banner_ad_form.banner_button.value = top.banner_clicks;
    top.support.document.do_count.submit();
    return false;
}

//function update_count()
//{
//    js_counter =
//        parseInt('<!--#counterpo file="banner_hits.txt"-->') - 1;
//    if( typeof( top.banner_clicks ) != "undefined" )
//    {
//        if( js_counter < top.banner_clicks )
//            js_counter = top.banner_clicks;
//    }
//    top.banner_clicks = js_counter;
//    document.banner_ad_form.banner_button.value = top.banner_clicks;
//    my_hits = parseInt('<!--#counterpo file="mycounter"-->');
//    // document.banner_ad_form.page_button.value = my_hits;
//
//}

function loaded()
{
    update_count();
}

function dollars( amt )
{
    if( typeof( amt ) == "undefined" )
	amt = 0;
    var cents = (amt * 100) % 100;
    var dollar = amt - cents/100;
    var dollar_str = "" + dollar;
    if( dollar_str.indexOf("." ) >= 0 )
    {
        dollar_str =
            dollar_str.substring(0,dollar_str.indexOf("."));
    }
    var pennies = "" + cents;
    if( pennies.length < 2 )
        pennies += "0";
    if( pennies.length > 2 )
        pennies = pennies.substring(0,2);
    return "$" + dollar_str + "." + pennies;
}

