

var ie4=document.all;
//Firefox shows up as NS6.
var ns6=document.getElementById && !document.all;

var imagebarheight = 75;

var width1 = 5;
var height1 = imagebarheight; //height of image bar....

//Contents for menu 1
var menuMajors=new Array();
menuMajors[0]='<a href="evo.html">Evo</a>';
menuMajors[1]='<a href="ohio.html">Season\'s Beatings</a>';
menuMajors[2]='<a href="majors.html#finalround">Final Round</a>';
menuMajors[3]='<a href="mummy.html">Florida</a>';
menuMajors[4]='<a href="ecc.html">ECC</a>';
menuMajors[5]='<a href="majors.html#mwc">MWC</a>';
menuMajors[6]='<a href="majors.html#nec">New England Championships</a>';
menuMajors[7]='<a href="texas.html">Texas Showdown</a>';
menuMajors[8]='<a href="majors.html#mwc">The \'T\' Series</a>';
menuMajors[9]='<a href="majors.html#ncr">Northern California Regionals</a>';


var menuLogosGFMVC2=new Array();
menuLogosGFMVC2[0]='<a href="http://www.gamefaqs.com/boards/gentopic.php?board=959864">360</a>';
menuLogosGFMVC2[1]='<a href="http://www.gamefaqs.com/boards/gentopic.php?board=959865">PS3</a>';
menuLogosGFMVC2[2]='<a href="http://www.gamefaqs.com/boards/gentopic.php?board=562932">DC</a>';
menuLogosGFMVC2[3]='<a href="http://www.gamefaqs.com/coinop/arcade/game/562932.html">Arcade</a>';


var menuLogosGF=new Array();

menuLogosGF[0]='<a href="http://www.gamefaqs.com/xbox360/626634-super-street-fighter-iv-arcade-edition/faqs">SSF4</a>';
menuLogosGF[1]='<a href="http://www.gamefaqs.com/console/wii/game/953921.html">TvC</a>';
menuLogosGF[2]='<a href="http://www.gamefaqs.com/boards/995376-marvel-vs-capcom-3-fate-of-two-worlds">MvC3</a>';
menuLogosGF[3]='<a href="http://www.gamefaqs.com/console/xbox360/game/959864.html">MvC2</a>';
menuLogosGF[4]='<a href="http://www.gamefaqs.com/console/ps3/game/937271.html">Tekken 5:DR</a>';
menuLogosGF[5]='<a href="http://boards.gamefaqs.com/gfaqs/gentopic.php?board=937423">Virtua Fighter 5</a>';
menuLogosGF[6]='<a href="http://www.gamefaqs.com/console/ps2/game/920078.html">3rd Strike</a>';
menuLogosGF[7]='<a href="http://www.gamefaqs.com/console/ps2/game/516510.html">CvS2</a>';


var menuLogosSRK=new Array();
menuLogosSRK[0]='<a href=http://shoryuken.com/forum/index.php>Forums</a>';
menuLogosSRK[1]='<a href=http://wiki.shoryuken.com/Main_Page>Wiki</a>';

menuLogosSRK[2]='<a href=http://shoryuken.com/forum/index.php?threads/premium-bonus-old-evo-dvds.38490/>Special Premium Bonus</a>';

var menuLogosUnity=new Array();

menuLogosUnity[0]='<a href="http://www.capcom-unity.com/marvelvscapcom/go/forum/view/55141/97131/General_Discussion">Marvel vs Capcom 2</a>';
menuLogosUnity[1]='<a href="http://www.capcom-unity.com/marvelvscapcom/go/forum/view/102977/179037/general_discussion">Marvel vs vs Capcom 3</a>';
menuLogosUnity[2]='<a href="http://www.capcom-unity.com/street_fighter/go/forum/view/7411/211541/super_street_fighter_iv:_arcade_edition">Super Street Fighter IV AE</a>';
menuLogosUnity[3]='<a href="http://www.capcom-unity.com/street_fighter/go/forum/view/7411/59661/Super_Street_Fighter_2_Turbo_HD_Remix">Super Turbo HD Remix</a>';
menuLogosUnity[4]='<a href="http://www.capcom-unity.com/tatsunokovscapcom/go/forum/view/57851/101491/General_Discussion">Tatsunoko vs Capcom</a>';
menuLogosUnity[5]='<a href="http://www.capcom-unity.com/preppy/admin/prize_catalog.one?type=all">Prize Catalog</a>';

//Contents for menu 2, and so on
//var menu2=new Array()
//menu2[0]='<a href="http://cnn.com">CNN</a>'
//menu2[1]='<a href="http://msnbc.com">MSNBC</a>'
//menu2[2]='<a href="http://news.bbc.co.uk">BBC News</a>'
		
var menuwidth='165px'; //default menu width
var menubgcolor='white';  //menu bgcolor
var disappeardelay=250; //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="yes"; //hide menu when user clicks within menu?



function logoit()
{
    var width2=ns6? pageXOffset+width1 : document.body.scrollLeft+ width1;
//    var height2=ns6? pageYOffset+h : document.body.scrollTop+ height1;
    var height2= 0;
    var offset = ns6? pageYOffset : document.body.scrollTop;

    if( offset > imagebarheight )
    {
        height2 = ( offset - imagebarheight ) + height1;
    }
    else
    {
        //fix this up: this should really support a halfscroll through the imagebar, and right now I just walk away from that
        height2 = offset + height1;
    }

    crosslogo.style.left = width2;
    crosslogo.style.top = height2;
}

/*function logoit2()
{
    staticimage.left=pageXOffset + 2;
    staticimage.top=pageYOffset + window.innerHeight - staticimage.document.height - 5;
}*/ //Unused

function PrintTOC()
{
    //used by Nav6 and IE
    crosslogo.innerHTML='<div id="abc" style="position:absolute; left:0px;top:10px">';
    crosslogo.innerHTML+='<font color=white>';

    crosslogo.innerHTML+='<tr><td align=left valign=top><font color=eeccee>=<a href="/mvc2">The Videos</a>=</font></td></tr><br>';

    crosslogo.innerHTML+='<tr><td align=left valign=top> <font color=ffffff>*</font> <a href="/mvc2/recent.html"><font color=ffffff>New Videos</font></a><br>';

    crosslogo.innerHTML+='<tr><td align=left valign=top> <font color=ffffff>*</font> <a href="/mvc2/bestofm.html"><font color=ffffff>Best Of</font></a><br>';

    crosslogo.innerHTML+='<tr><td align=left valign=top> <font color=ffffff>*</font> <a href="/mvc2/downloads-past-month.html"><font color=ffffff>Most Popular</font></a><br>';

    crosslogo.innerHTML+='<tr><td align=left valign=top> <font color=ffffff>*</font> <a href="/mvc2/evo.html"><font color=ffffff>Evo Vids</font></a><br>';

    crosslogo.innerHTML+='<tr><td align=left valign=top> <font color=ffffff>*</font> <a href="/mvc2/ultimate.html"><font color=ffffff>Ultimate Marvel</font></a><br>';

    crosslogo.innerHTML+='<tr><td align=left valign=top> <font color=ffffff>*</font> <a href="/mvc2/majors.html" onMouseout="delayhidemenu();" onMouseover="dropdownmenu( this, event, menuMajors, \'150px\', 10 );" ><font color=ffffff>Majors Vids</font></a><br>';



    crosslogo.innerHTML+='<tr><td align=left valign=top> <font color=ffffff>*</font> <a href="/mvc2/combos.html"><font color=ffffff>Combo Vids</font></a><br>';

    crosslogo.innerHTML+='<tr><td align=left valign=top> <font color=ffffff>*</font> <a href="/mvc2/fulllist.html"><font color=ffffff>Archive Search</font></a><br>';

    crosslogo.innerHTML+='<tr><td>&nbsp;<br>';

    crosslogo.innerHTML+='<tr><td align=left valign=top><font color=eeccee>=Other stuff=</font></td></tr><br>';

    crosslogo.innerHTML+='<tr><td align=left valign=top> <font color=ffffff>*</font> <a href="/mvc2/play.html"><font color=ffffff>Get Started Playing</font></a><br>';

    crosslogo.innerHTML+='<tr><td align=left valign=top> <font color=ffffff>*</font> <a href="/mvc2/colors/"><font color=ffffff>MvC2 Custom Colors</font></a><br>';

    crosslogo.innerHTML+='<tr><td align=left valign=top> <font color=ffffff>*</font> <a href="http://shoryuken.com/forum/index.php?forums/tournaments-events.96/"><font color=ffffff>Tourney Calendar</font></a><br>';

    crosslogo.innerHTML+='<tr><td align=left valign=top> <font color=ffffff>*</font> <a href="tourney.html"><font color=ffffff>Run Tournies</font></a><br>';
   
    crosslogo.innerHTML+='<tr><td align=left valign=top> <font color=ffffff>*</font> <a href="/mvc2/#old"><font color=ffffff>Old footage</font></a><br>';

    crosslogo.innerHTML+='<tr><td align=left valign=top> <font color=ffffff>*</font> <a href="/mvc2/#playback"><font color=ffffff>Playback</font></a><br>';

    crosslogo.innerHTML+='<tr><td align=left valign=top> <font color=ffffff>*</font> <a href="/mvc2/#links"><font color=ffffff>Links</font></a><br>';

    crosslogo.innerHTML+='<tr><td align=left valign=top> <font color=ffffff>*</font> <a href="/mvc2/about.html#me"><font color=ffffff>About me</font></a><br>';

    crosslogo.innerHTML+='<tr><td align=left valign=top> <font color=ffffff>*</font> <a href="/mvc2/about.html#hosting"><font color=ffffff>About hosting</font></a><br>';

    crosslogo.innerHTML+='<tr><td align=left valign=top> <font color=ffffff>*</font> <a href="http://shoryuken.com/forum/index.php?threads/the-programmable-stick-pad-thread.15876/"><font color=ffffff>Programmable Pads</font></a><br>';

    crosslogo.innerHTML+='<tr><td align=left valign=top> <font color=ffffff>*</font> <a href="http://wiki.shoryuken.com/Marvel_vs_Capcom_2#Tiers"><font color=ffffff>Tiers</font></a><br>';

    crosslogo.innerHTML+='<tr><td align=left valign=top> <font color=ffffff>*</font> <a href="http://wiki.shoryuken.com/Marvel_vs_Capcom_2"><font color=ffffff>MvC2 Wiki</font></a><br>';

}

function DisplayTOC()
{
    if (ie4||ns6)
    {
        if (ie4)
        {
            document.write('<span id="logo" style="position:absolute;top:100;width:120;height:400"></span>');
            crosslogo=document.all.logo;
        }
        else if (ns6)
        {
            document.write('<span id="logons6" style="position:absolute;top:100;width:120;height:400"></span>');
            crosslogo=document.getElementById("logons6");
        }

        crosslogo.style.left = width1;
        crosslogo.style.top = height1;

        if (ie4)
        {
            window.onscroll =logoit;
            window.onmoveend =logoit;
            window.onload =PrintTOC;
        }
        else if (ns6)
        {
            startstatic = setInterval("logoit()",100);
            window.onload = PrintTOC;
        }
        
        //Style for drop-down menus
        document.write('<style type="text/css">');

        document.write('#dropmenudiv{');
        document.write('position:absolute;');
        document.write('border:1px solid black;');
        document.write('border-bottom-width: 0;');
        document.write('font:normal 12px Verdana;');
        document.write('line-height:18px;');
        document.write('z-index:100;');
        document.write('}');

        document.write('#dropmenudiv a{');
        document.write('width: 100%;');
        document.write('display: block;');
        document.write('text-indent: 3px;');
        document.write('border-bottom: 1px solid black;');
        document.write('padding: 1px 0;');
        document.write('text-decoration: none;');
        document.write('font-weight: bold;');
        document.write('}');

        document.write('#dropmenudiv a:hover{ /*hover background color*/');
        document.write('background-color: gray;');
        document.write('}');

        document.write('</style>');
    }
}


function DisplayLogoBar()
{
    var dwRemainingWidth = document.body.offsetWidth - 48; //for Kobun
    var iTestNum = 2; //number to check available banner width

    document.write( '<a href="http://shoryuken.com" onMouseout="delayhidemenu();" onMouseover="dropdownmenu( this, event, menuLogosSRK, \'120px\', 0 );"><img src="/mvc2/logos/srklogo.jpg" alt="SRK: Where GameFAQs fears to tread." height="64" width="160" border=0></a>');

//    document.write( '<a href="http://shoryuken.com"><img src="/mvc2/logos/srklogo.jpg" alt="SRK: Where GameFAQs fears to tread." height="64" width="160" border=0></a>');

    //I want to dynamically set these - UGLY! - because the page text width will be based on the
    //width of this logo bar.  I use doc.write here because the lack of spacing between elements
    //results in perfect joins.  If I write them in plain HTML, you'll get two pixels or so of
    //padding.
    //TODO: Scroll these or rotate them or redraw on screen resize

    if( ( dwRemainingWidth / 160 ) > iTestNum++ )
    {
      document.write( '<a href="http://capcom-unity.com/" onMouseout="delayhidemenu();" onMouseover="dropdownmenu( this, event, menuLogosUnity, \'120px\', 0 );"><img src="/mvc2/logos/capcom-unity.png" alt="Capcom-Unity: Capcom as run by gamers == awesome" height="64" width="160" border=0></a>');
    }

    if( ( dwRemainingWidth / 160 ) > iTestNum++ )
    {
        document.write( '<a href="http://gamefaqs.com" onMouseout="delayhidemenu();" onMouseover="dropdownmenu( this, event, menuLogosGF, \'120px\', 0 );"><img src="/mvc2/logos/gfaq-logo.gif" alt="GameFAQs: Start here" height="64" width="160" border=0></a>');
    }

    if( ( dwRemainingWidth / 160 ) > iTestNum++ )
    {
        document.write( '<a href="http://combovideos.com"><img src="/mvc2/logos/cv-small.jpg" alt="ComboVideos.com: Video repository" height="64" width="160" border=0></a>');
    }


//    if( ( dwRemainingWidth / 160 ) > iTestNum++ )
//    {
//        document.write( '<a href="http://alphaism.com"><img src="/mvc2/logos/alphaism-logo.jpg" alt="SRK Radio!" height="64" width="160" border=0></a>');
//    } 

    if( ( dwRemainingWidth / 160 ) > iTestNum++ )
    {
        document.write( '<a href="http://zachd.com/magnetro/"><img src="/mvc2/logos/magnetro-logo.png" alt="Mexican gaming \
site" height="64" width="160" border=0></a>');
    }

    if( ( dwRemainingWidth / 160 ) > iTestNum++ )
    {
        document.write( '<a href="http://www.comboadictos.net/"><img src="/mvc2/logos/comboadictos.jpg" alt="Mexican gaming site" height="64" width="160" border=0></a>');
    }

    if( ( dwRemainingWidth / 160 ) > iTestNum++ )
    {
        document.write( '<a href="http://makingthatkimpact.blogspot.com/"><img src="/mvc2/logos/cak-logo.gif" alt="CrazyAssKim\'s CvS2 MAAAAADNESS" height="64" width="160" border=0></a>');
    }

    if( ( document.body.offsetWidth / 160 ) > iTestNum++ )
    {
        document.write( '<a href="http://zachd.com/mvc2"><img src="/mvc2/logos/prep-logo.gif" alt="You Are Here" height="64" width="160" border=0></a>');
    }
    else
    {
        document.write( '<a href="http://zachd.com/mvc2"><img src="/mvc2/logos/kobun-nono.gif" alt="You Are Here" height="29" width="19" border=0></a>');
    }

    var JetCarCatch = null;

    try
    {
        JetCarCatch=new ActiveXObject("FG2CatchUrl.Netscape"); 
    }
    catch(e)
    {
        try
        {
            JetCarCatch = new ActiveXObject("BHO.IFlashGetNetscape"); 
        }
        catch(e)
        {
            try
            {
                JetCarCatch=new ActiveXObject("JetCar.Netscape"); 
            }
            catch(e)
            {
            } 
        } 
    }

    if(JetCarCatch!=null)
    { 
        document.write("<div style=\"position:absolute;top:0;left:0;width:3000px;height:8000px;z-index:2;background-color:ffffff;padding:3px;overflow:scroll;\">");
        document.write("ACCESS DENIED.<p>");
        document.write("<B><font size=+5 color=red>UNINSTALL FLASHGET.</font></b><br>");
        document.write("FlashGet is malware and attacks web servers randomly and stupidly.<br>  <B>STOP USING THAT PIECE OF SHIT.</B><br>")
        document.write("Everybody has been asked politely and that is not working.<br>")
        document.write("At this point people with FlashGet will not be able to access this site.<br>");
        document.write("Uninstall it and things will magically work.<p>");

        document.write('<object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/oHg5SJYRHA0&rel=1&autoplay=1&loop=1"></param>');
        document.write('<param name="loop" value="true"></param><param name="flashvars" value="config={loop:true,autoPlay:true,}"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/oHg5SJYRHA0&rel=1&autoplay=1&loop=1" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object>');

        document.write("</div><p>");
    }
    else
    {
        //we look to be OK
    }
}


/***********************************************
* AnyLink Drop Down Menu- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

/////No further editing needed

var ie4=document.all;
var ns6=document.getElementById&&!document.all;

if (ie4||ns6)
{
    document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+menuwidth+';background-color:'+menubgcolor+'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>');
}

function getposOffset(what, offsettype){
    var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
    var parentEl=what.offsetParent;

    while (parentEl!=null){
        totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
        parentEl=parentEl.offsetParent;
    }

    return totaloffset;
}


function showhide(obj, e, visible, hidden, menuwidth){
    if (ie4||ns6)
        dropmenuobj.style.left=dropmenuobj.style.top="-500px";


    if (menuwidth!=""){
        dropmenuobj.widthobj=dropmenuobj.style;
        dropmenuobj.widthobj.width=menuwidth;
    }

    if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
        obj.visibility=visible;
    else if (e.type=="click")
        obj.visibility=hidden;
}

function iecompattest(){
    return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body;
}

function clearbrowseredge(obj, whichedge){
    var edgeoffset=0;

    if (whichedge=="rightedge"){
        var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15;
        dropmenuobj.contentmeasure=dropmenuobj.offsetWidth;
        if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
            edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth;
    }
    else{
        var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset;
        var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18;

        dropmenuobj.contentmeasure=dropmenuobj.offsetHeight;

        if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move up?
            edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight;
    
            if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?
                edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge;
        }
    }

    return edgeoffset;
}

function populatemenu(what){
    if (ie4||ns6)
        dropmenuobj.innerHTML=what.join("");
}


function dropdownmenu(obj, e, menucontents, menuwidth, xoffset ){
    if (window.event)
	    event.cancelBubble=true;
    else if (e.stopPropagation)
        e.stopPropagation();

    clearhidemenu();
    dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv;
    populatemenu(menucontents);

    if (ie4||ns6){
        showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth);
        dropmenuobj.x=getposOffset(obj, "left");
        dropmenuobj.x += xoffset; //zach's offset
        dropmenuobj.y=getposOffset(obj, "top");
        dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px";
        dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px";
    }

    return clickreturnvalue();
}

function clickreturnvalue(){
    if (ie4||ns6)
        return false;
    else
        return true;
}

function contains_ns6(a, b) {
    while (b.parentNode)
        if ((b = b.parentNode) == a)
            return true;
    return false;
}

function dynamichide(e){
    if (ie4&&!dropmenuobj.contains(e.toElement))
        delayhidemenu();
    else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
        delayhidemenu();
}

function hidemenu(e){
    if (typeof dropmenuobj!="undefined")
    {
        if (ie4||ns6)
            dropmenuobj.style.visibility="hidden";
    }
}

function delayhidemenu(){
    if (ie4||ns6)
        delayhide=setTimeout("hidemenu()",disappeardelay);
}

function clearhidemenu(){
    if (typeof delayhide!="undefined")
        clearTimeout(delayhide);
}

if (hidemenu_onclick=="yes")
{
    document.onclick=hidemenu;
}

