var agt=navigator.userAgent.toLowerCase();
var is_ie   = (agt.indexOf("msie") != -1);

//show or hides sub menus
function show_hide_menus_top(tmp)
{
	//shows or hides sub menu for clicked main menu depending on sub menus current state
	//if tmp == 0 user has moved off menu so we close all sub menus
	if (tmp != 0)
	{
		state = eval("submenu_0" + tmp).style.visibility
		if (state == 'visible')
		{
			eval("submenu_0" + tmp).style.visibility='hidden'
		} else {
			eval("submenu_0" + tmp).style.visibility='visible'
		}
	}
	
	//makes sure all other sub menus are hidden
	for (cnt=1;cnt<=5;cnt++)
	{
		if (cnt != tmp)
		{
			eval("submenu_0" + cnt).style.visibility='hidden'	
		}					
	}	
}

//show or hides sub menus
function show_hide_menus(tmp)
{
	//shows or hides sub menu for clicked main menu depending on sub menus current state
	//if tmp == 0 user has moved off menu so we close all sub menus
	if (tmp != 0)
	{
		state = eval("parent.submenu_0" + tmp).style.visibility
		if (state == 'visible')
		{
			eval("parent.submenu_0" + tmp).style.visibility='hidden'
		} else {
			eval("parent.submenu_0" + tmp).style.visibility='visible'
		}
	}
	
	//makes sure all other sub menus are hidden
	for (cnt=1;cnt<=5;cnt++)
	{
		if (cnt != tmp)
		{
			eval("parent.submenu_0" + cnt).style.visibility='hidden'	
		}					
	}	
}

function mouseon(tmp)
{         		
   menuitem = tmp;    
   menuitem.style.color="#000000";
   if (is_ie)
   {            
   	menuitem.style.cursor = "hand";	
   } else {
    menuitem.style.cursor = "pointer";
   }   
   menuitem.style.background = "#727272"
}

function mouseoff(tmp)
{
   menuitem = tmp;
   if (mus)
   {   
   menuitem.style.color="#202157";
   } else {
   menuitem.style.color="#ffffff";
   }
   menuitem.style.background = ""
}


function pagechange(tmp)
{	
	parent.contentFrame.location = tmp;	
}


function changeMusic(song)
{

	 if (song == 0)
	 {	 
	 Player.stop();	
	 return;
	 }
	 
	if (song == 1)
	{
		fileurl = 'music/brothers_in_arms.wma' 
	} 
	if (song == 2)
	{
		fileurl = 'music/USMC_Patriotic_songs_marches_12_Marines_Hymm.asx' 
	}
	if (song == 3)
	{		
		fileurl =  'music/BridgeOverTheRiverKwai.asx' 
	}
	if (song == 4)
	{
		fileurl = 'music/band_of_brothers.wma' 
	}
	if (song == 5)
	{
		fileurl = 'music/US_Army_Marches_Medley.mp3' 
	}
	if (song == 6)
	{
		fileurl = 'music/marching_melody.wma' 
	}
	if (song == 7)
	{
		fileurl = 'music/rat_patrol.wma' 
	}
	if (song == 8)
	{
		fileurl = 'music/Reveille_Assembly_Cadence.asx' 
	}	
	if (song == 9)
	{
		fileurl = 'music/Military-US_Marine_Corps_Band_Taps.asx' 
	}	
	if (song == 10)
	{
		fileurl = 'music.m3u'
	}

	Player.FileName = fileurl;
	Player.play();

}


var em1 = "admin"
var em2 = "@"
var em3 = "jeep4ever"
var em4 = "."
var em5 = "ca"
function emailer()
{
	document.write("<a href='mailto:" + em1+em2+em3+em4+em5 + "?subject=from jeep4ever.ca' ");
}



//show pics and videos
var windowTag = 0
var Images
function showPic(pic)
{
   if (windowTag)
   {
        Images.close()
   }
   windowTag = 1
   picName = pic + ".jpg"
   Images = window.open(picName, "","toolbar=0,resizable=1,scrollbars=1,left=0,top=0")   
}

function showVideo(thevideo, thewidth, theheight)
{
  windowName = "vids/" +  thevideo
  Images = window.open(windowName, "","toolbar=0,resizable=1,scrollbars=1,left=0,top=0,height=" + theheight
        + ", width=" + thewidth)
}






