function changeButton() {
    var aryInput = $('input');

    for ( var i = 0; i < aryInput.length; i++ ) {
        if ( 'button' == aryInput.get(i).className) {
            aryInput.get(i).onmouseover = function(){this.className = this.className + '_hover';}
            aryInput.get(i).onmouseout  = function(){this.className = this.className.replace('_hover', '');}
        }
    }
}

$(document).ready( function() {
    changeButton();
} );

function showGoogleMap(id, address) {
    var map = null;
    var geocoder = null;

    if ( GBrowserIsCompatible() ) {
        map = new GMap2(document.getElementById( id ));
        map.setCenter(new GLatLng(35.67431, 139.69082), 13);

        geocoder = new GClientGeocoder();

        geocoder.getLatLng(
            address,
            function(point) {
                if (!point) {
                    //alert(address + " not found");
                } else {
                    map.setCenter(point, 13);
                    var marker = new GMarker(point);
                    map.addOverlay(marker);
                    //marker.openInfoWindowHtml(address);
                }
            }
        );
    }
}

function goWeekReport( is_member ) {
    if ( false === is_member ) {
        alert( '「週報」の閲覧には会員ログインが必要です' );
    } else {
        window.open("http://www.tokyochuo-rotary.org/members/syuho.html");;
    }
}



function isUsableFlash() {
    fflag=0;
    if ( document.layers || document.all || document.getElementById ) {
        if (document.all && !window.opera && navigator.userAgent.indexOf('Win')> -1 ) {
            document.write('<scr' + 'ipt type="text/vbscript"\> \n');
            document.write('on error resume next \n');
            document.write('fflag=( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6")))\n');
            document.write('</scr' + 'ipt> \n');
        } else if (navigator.plugins['Shockwave Flash']) {
            fflag = 1;
        }
    }

    return 1 == fflag ? true : false;
}

function outputToppageFlash() {
    if ( true === isUsableFlash() ) {
        var strFlash = "<div id=\"toppage_flash\">\n"
                     + "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0\" width=\"1100\" height=\"302\">\n"
                     + "<param name=movie value=\"./material/main_visual.swf\">\n"
                     + "<param name=quality value=high>\n"
                     + "<embed src=\"./material/main_visual.swf\" quality=high pluginspage=\"http://www.macromedia.com/jp/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" width=\"1100\" height=\"302\"></embed>\n"
                     + "</object>\n"
                     + "</div>\n";
        document.write( strFlash );
    } else {
        var strHtml = "<div id=\"toppage_animation\">\n"
                    + "<iframe id=\"thumbnail_list\" src=\"./main_visual_image.php\" frameborder=\"0\" width=\"510\" height=\"110\"></iframe>\n"
                    + "<div id=\"arrow_left\"></div>\n"
                    + "<div id=\"arrow_right\"></div>\n"
                    + "<a href=\"./club/about.html\" id=\"animation_about\"></a>\n"
                    + "<a href=\"./club/song.html\" id=\"animation_song\"></a>\n"
                    + "<a href=\"./club/dictionary.html\" id=\"animation_dictionary\"></a>\n"
                    + "<a href=\"./volunteer/index.html\" id=\"animation_volunteer\"></a>\n"
                    + "<img id=\"disp_image\" src=\"./contents/images/l_logo.png\" />\n"
                    + "</div>\n";
        document.write( strHtml );
    }
}
