/* --- Used for dropdown Navigation on all pages --- */

function dropdownMenu()
	{
	if(navigator.appVersion.indexOf("MSIE")==-1)
		{return;}
 
	var i,k,g,lg,r=/\s*p7hvr/,nn='',c,cs='p7hvr',bv='p7menubar';
 
	for(i=0;i<10;i++)
		{
		g=document.getElementById(bv+nn);

		if(g)
			{
			lg=g.getElementsByTagName("LI");if(lg){for(k=0;k<lg.length;k++)
				{
				lg[k].onmouseover=function()
					{
					c=this.className;cl=(c)?c+' '+cs:cs;
 					this.className=cl;};lg[k].onmouseout=function()
						{
						c=this.className;
 						this.className=(c)?c.replace(r,''):'';
						};
					}
				}
			}
		nn=i+1;
		}
	}

/* --- Past Years drop down Menus --- */
//new Option("text","value")

//this code changes menus
function nullOptionsDMA(aMenu)
	{
	var tot=aMenu.options.length
	for (i=0;i<tot;i++)
		{
		aMenu.options[i]=null
		}
	aMenu.options.length=0;
	}

function MySubjectDMA0(aMenu)
	{
	nullOptionsDMA(aMenu)
	with (aMenu)
		{
		//Rewrites the text and values year 2008
		options[0]=new Option("","");
		options[1]=new Option("Camp Summary","2008/08Summary.php");
		options[2]=new Option("Pictures","2008/pictures/index.html");
		options[3]=new Option("Tournament Results","2008/08Results.php");
		options[0].selected=true
		}
	}
	
function MySubjectDMA1(aMenu)
	{
	nullOptionsDMA(aMenu)
	with (aMenu)
		{
		//Rewrites the text and values year 2007
		options[0]=new Option("","");
		options[1]=new Option("Camp Summary","2007/07Summary.php");
		options[2]=new Option("Pictures","2007/07Pictures/index.htm");
		options[3]=new Option("Tournament Standings","2007/07Tournament.php");
		options[4]=new Option("Blitz Tournament Standings","2007/07_blitz_tourney.htm");
		options[0].selected=true
		}
	}

function MySubjectDMA2(aMenu)
	{
	nullOptionsDMA(aMenu)
	with (aMenu)
		{
		//Rewrites the text and values year 2006
		options[0]=new Option("","");
		options[1]=new Option("Camp Summary","2006/06Summary.php");
		options[2]=new Option("Games","files/games/06games.htm");
		options[3]=new Option("Pictures","2006/06Pictures/index.htm");
		options[4]=new Option("Tournament Standings","2006/06Tournament.php");
		options[5]=new Option("Blitz Tournament Standings","2006/06Blitz.htm");
		options[0].selected=true
		}
	}

function MySubjectDMA3(aMenu)
	{
	nullOptionsDMA(aMenu)
	with (aMenu)
		{
		//Rewrites the text and values year 2005
		options[0]=new Option("","");
		options[1]=new Option("Camp Summary","2005/05Summary.php");
		options[2]=new Option("Camp Participants","2005/05Participants.php");
		options[3]=new Option("Games","files/games/05games.htm");
		options[4]=new Option("Pictures","2005/05Pictures/index.htm");
		options[5]=new Option("Tournament Standings","2005/05Tournament.php");
		options[6]=new Option("Blitz Tournament Standings","2005/05Blitz.htm");
		options[0].selected=true
		}
	}

function MySubjectDMA4(aMenu)
	{
	nullOptionsDMA(aMenu)
	with (aMenu)
		{
		//Rewrites the text and values year 2004
		options[0]=new Option("","");
		options[1]=new Option("Camp Summary","2004/04Summary.php");
		options[2]=new Option("Camp Participants","2004/04Participants.php");
		options[3]=new Option("Tournament Standings","2004/04Tournament.php");
		options[4]=new Option("Camp Blitz and Bullet Tournament","2004/04Camp_Blitz_and_Bullet.php");
		options[5]=new Option("Blitz Tournament Standings","2004/04Blitz.htm");
		options[0].selected=true
		}
	}

/* ####################### dropDown go ################## */

function dropdown(mySel)
	{
	var myWin, myVal;
	myVal = mySel.options[mySel.selectedIndex].value;
	if(myVal)
  		{
  		if(mySel.form.target)myWin = parent[mySel.form.target];
  		else myWin = window.open();  /* was "else myWin = window;" opened in _parent; changed to window.open() to open in _blank */
  		if (! myWin) return true;
   		myWin.location = myVal;
   		}
	return false;
	}
	
/* ####################### setUp ####################### */

function setUpDMA()
	{
	with (document.formDoubleMenuDMA)
		{
		if (menuSubjectsDMA.selectedIndex==0)
			{
			menuSubjectsDMA.options[0].selected=true
			menuFilesDMA.options[0].selected=true
			}
		if (menuSubjectsDMA.selectedIndex==1)
			MySubjectDMA0(menuFilesDMA)
		if (menuSubjectsDMA.selectedIndex==2)
			MySubjectDMA1(menuFilesDMA)
		if (menuSubjectsDMA.selectedIndex==3)
			MySubjectDMA2(menuFilesDMA)
		if (menuSubjectsDMA.selectedIndex==4)
			MySubjectDMA3(menuFilesDMA)
		if (menuSubjectsDMA.selectedIndex==5)
			MySubjectDMA4(menuFilesDMA)
		}
	}

/* ####################### changeFiles ####################### */

function changeFilesDMA()
	{
	aMenu=document.formDoubleMenuDMA.menuSubjectsDMA
	aMenu2=document.formDoubleMenuDMA.menuFilesDMA
	with (aMenu)
		{
		switch (selectedIndex) 
			{
			case 0:
				aMenu2.options.length=0;
				aMenu2.options[0]=
				new Option("Tournaments appear here","none")
				aMenu2.options[0].selected=true;
				history.go(0)
				break
			case 1:
				MySubjectDMA0(aMenu2)
				aMenu2.options[0].text="-----"
				break
			case 2:
				MySubjectDMA1(aMenu2)
				aMenu2.options[0].text="-----"
				break
			case 3:
				MySubjectDMA2(aMenu2)
				aMenu2.options[0].text="-----"
				break
			case 4:
				MySubjectDMA3(aMenu2)
				aMenu2.options[0].text="-----"
				break
			case 5:
				MySubjectDMA4(aMenu2)
				aMenu2.options[0].text="-----"
				break
			}
		}
	}