/************************************************************/
/*												*/
/* Scripts for SSAA web site 							*/
/* Created 03/06/2006								*/
/*												*/
/************************************************************/

function randomImage( pageID)
{
	var randomNum = Math.floor(Math.random()*13)
	
	if(randomNum == 0)
	{
		randomNum += 1;
	}
	if ( pageID == 34)
	{
		randomNum = 1;
	}
	document.writeln("<img src=images/banner_image_" + randomNum + ".jpg width=550 height=147 alt=SSAA banner image />");
}

function randomPhrase()
{
     var phraseList = new Array("SSAA VICTORIA<br />Relaxation<br/ >Stress relief<br/ >Challenge<br/ >Excitement",
	                           "COMMUNITY<br />SSAA Victoria is conscious about its role in the community and is always working to improve and benefit society.",
                                "SKILLS<br />Develop the skill of concentration, build confidence, challenge yourself… Join the Shooting Sports",
                                "SAFETY<br />The SSAA conducts regular safety seminars and practical instruction on firearm safety.",
                                "FUN<br />It's not only relaxing and challenging, it's a lot of fun! Come and try!",
                                "ENVIRONMENT<br />Our commitment is to promote ethical hunting, protect the environment and advocate fauna conservation.",
                                "YOU<br />SSAA Vic offers a special program adapted to your needs and interests",
                                "CHALLENGE<br />SSAA Vic recognised for program initiative &quot;Shooting for All&quot;");
	 
     	var randomNum = Math.floor(Math.random()*4)
	
	document.writeln("<p>" + phraseList[randomNum] + "</p>");
}

startList = function() 
	{
	if (document.all && document.getElementById) 
	{
		navRoot = document.getElementById("nav");
		for (i=0; i < navRoot.childNodes.length; i++) 
		{
			node = navRoot.childNodes[i];
			if (node.nodeName == "LI")
			{
				node.onmouseover = function() 
				{
					this.className += " over";
				}
				node.onmouseout = function()
				{
					this.className= this.className.replace(" over", "");
				}
			}
		}
	}
}

function showPic (whichpic)
{
	if (document.getElementById) 
	{
		document.getElementById('placeholder').src = whichpic;
		window.location.hash = undefined;
		window.location.hash = "#";
	} 
	else
	{
		return true;
	}
}

function MM_openBrWindow(theURL,winName) 
{
window.open(theURL,"_blank","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=570,height=600");
}

window.onload=function()
{
	startList();
}