<!--
//=============================
// Flash Detection Script
//=============================

var isFlash3 = false;
var isFlash4 = false;
var isFlash5 = false;
var isFlash6 = false;
var isFlash7 = false;
var isFlash8 = false;
var isFlash9 = false;
var isFlash10 = false;

// true if we're on ie
var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;         
// true if we're on windows
var isWin = (navigator.appVersion.indexOf("Windows") != -1) ? true : false; 

// VBScript Detection on IE/Windows
if(isIE && isWin){ 
        document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
        document.write('on error resume next \n');
        document.write('isFlash3 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.3"))) \n');
        document.write('isFlash4 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4"))) \n');
        document.write('isFlash5 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5"))) \n');
        document.write('isFlash6 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6"))) \n');
        document.write('isFlash7 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.7"))) \n');
        document.write('isFlash8 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.8"))) \n');
        document.write('isFlash9 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.9"))) \n');
        document.write('isFlash10 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.10"))) \n');

        document.write('</SCR' + 'IPT\> \n');
}

// Netscape PlugIn Detection
function detectFlash(){ 
        if (navigator.plugins){
                if (navigator.plugins["Shockwave Flash 2.0"]
                || navigator.plugins["Shockwave Flash"]){
                        var isVersion2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
                        var flashDescription = navigator.plugins["Shockwave Flash" + isVersion2].description;
                        var flashVersion = parseInt(flashDescription.substring(flashDescription.indexOf(".") - 2,flashDescription.indexOf(".")));

                        var String1 = flashDescription.substring(flashDescription.indexOf(".") - 2, flashDescription.indexOf("."));

                        isFlash3 = flashVersion == 3;
                        isFlash4 = flashVersion == 4;
                        isFlash5 = flashVersion == 5;
                        isFlash6 = flashVersion == 6;
                        isFlash7 = flashVersion == 7;
                        isFlash8 = flashVersion == 8;
                        isFlash9 = flashVersion == 9;
                        isFlash10 = flashVersion == 10;
                }
        }       
}
detectFlash();

// Returns HTML Code to Embed a SWF File
function flashEmbed(swf,width,height,bgcolor) {
                if (!bgcolor) bgcolor="#000000";
                var code = '<OBJECT CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'
                + 'WIDTH="'+width+'" HEIGHT="'+height+'"'
                + 'CODEBASE="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">'
                + '<PARAM NAME="MOVIE" VALUE="'+swf+'">'
                + '<PARAM NAME="PLAY" VALUE="true">'
                + '<PARAM NAME="LOOP" VALUE="false">'
                + '<PARAM NAME="QUALITY" VALUE="high">'
                + '<PARAM NAME="MENU" VALUE="false">'
                + '<PARAM NAME=salign VALUE=LT>'
                + '<PARAM NAME=bgcolor VALUE="'+bgcolor+'"> '
                + '<EMBED SRC="'+swf+'" '
                + 'WIDTH="'+width+'" HEIGHT="'+height+'" '
                + 'salign=LT '
                + 'PLAY="true" '
                + 'LOOP="false" '
                + 'QUALITY="high" '
                + 'MENU="false" '
                + 'BGCOLOR="'+bgcolor+'" '
                + 'TYPE="application/x-shockwave-flash" '
                + 'PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">'
                + '</EMBED>'
                + '</OBJECT>';
                return(code);
}

// Descision Code for Flash Checking
function flashChecker() 
{   
    // checking for flash 3 or flash 4 or flash 5 or flash 6
    if ( isFlash4 || isFlash5 || isFlash6 || isFlash7  || isFlash8  || isFlash9  || isFlash10  ) 
    {
            document.write(flashEmbed('/images/img_flas.swf','727','183','#FFFFFF'));
    } else {
            document.writeln('    <table width="727" border="0" cellspacing="0" cellpadding="0">');
            document.writeln('        <tr> ');
            document.writeln('            <td bgcolor="#D8E7F6" rowspan="2"><img src="images/img_logo_hm2.gif" width="181" height="78" alt="Port of Oakland"></td>');
            document.writeln('            <td width="551" background="/images/port_home_tile.gif"><img src="images/spacer.gif" width="8" height="39"></td>');
            document.writeln('        </tr>');
            document.writeln('        <tr> ');
            document.writeln('            <td bgcolor="#D8E7F6" width="551"><img src="images/img_logo_text1.gif" width="424" height="39" alt="Port of Oakland"></td>');
            document.writeln('        </tr>');
            document.writeln('        <tr> ');
            document.writeln('            <td bgcolor="#6F91B2" width="176">&nbsp;</td>');
            document.writeln('            <td bgcolor="#6F91B2" width="551"><img src="images/img_tag.gif" width="473" height="43" alt="Working for you to make a difference"></td>');
            document.writeln('        </tr>');
            document.writeln('        <tr> ');
            document.writeln('            <td colspan="2"><img src="images/img_home.jpg" width="727" height="59" usemap="#iMap" border="0"></td>');
            document.writeln('        </tr>');
            document.writeln('        <tr> ');
            document.writeln('            <td bgcolor="#FFFFFF" colspan="2"><img src="images/spacer.gif" width="1" height="4"></td>');
            document.writeln('        </tr>');
            document.writeln('    </table>');
            document.writeln('    <map name="iMap"> <area shape="rect" coords="1,2,178,57" href="portnyou/index.asp">');
            document.writeln('        <area shape="rect" coords="180,3,361,57" href="maritime/index.asp">');
            document.writeln('        <area shape="rect" coords="364,3,542,56" href="airport/index.asp">');
            document.writeln('        <area shape="rect" coords="545,2,724,57" href="communit/index.asp">');
            document.writeln('    </map>');
    }
}

// -->