window.onload=function ()
{	styleCurrentLink();
	if (document.getElementById("CaseStudyList"))	scrollCaseStudyList();
}


/*
function getRandomIMG() 
{	var		iCount	=	15;	//start at 0
	var		iIMG = Math.round(Math.random() * iCount);
	return 	"<img src='../i/Banners/i%22%20+%20iIMG%20+%20%22.jpg' width='308' height='208'>";
}
*/
function scrollCaseStudyList()
{	var		iCount	=	7;	//start at 0
	var		iCase = Math.round(Math.random() * iCount);
	document.URL += "#iF_" + iCase;
	return 	true;
}

function getRandomIMG() 
{	var		iCount	=	15;	//start at 0
	var		iIMG = Math.round(Math.random() * iCount);
	return 	"<img src='../i/Banners/i%22%20+%20iIMG%20+%20%22.jpg' width='308' height='208'>";
}
function resetBanner() 
{	var		iCount	=	15;	//start at 0
	var		iIMG = Math.round(Math.random() * iCount);
	if (document.getElementById("Banner"))	{ document.getElementById("Banner").src = "./i/Banners/i" + iIMG + ".jpg";}
}

function styleCurrentLink()
{	if (document.getElementsByTagName("a"))
	{	var	BugMSG="styleCurrentLink\n:ThisURL = "+document.URL;
		var	ThisURL			=	document.URL;
		var	aLink			=	document.getElementsByTagName("a");
		var	LinkQTY			=	aLink.length;
		for (var i = 0; i < LinkQTY; i++)	{	if (aLink[i] == ThisURL) aLink[i].className = " here"; 	}
		if (ThisURL.indexOf("/research.")>-1 && document.getElementById("navServices")) 
		{document.getElementById("navServices").className = " here";
		};
		if (ThisURL.indexOf("/strategy.")>-1 && document.getElementById("navServices")) 
		{document.getElementById("navServices").className = " here";
		};
		if (ThisURL.indexOf("/pr.")>-1 && document.getElementById("navServices")) 
		{document.getElementById("navServices").className = " here";
		};
		if (ThisURL.indexOf("/creative.")>-1 && document.getElementById("navServices")) 
		{document.getElementById("navServices").className = " here";
		};
		if (ThisURL.indexOf("/outmarketing.")>-1 && document.getElementById("navServices")) 
		{document.getElementById("navServices").className = " here";
		};

		if (ThisURL.indexOf("/testimonials.")>-1 && document.getElementById("navClients")) 
		{document.getElementById("navClients").className = " here";
		};
		if (ThisURL.indexOf("/casestudies.")>-1 && document.getElementById("navClients")) 
		{document.getElementById("navClients").className = " here";
		};
		if (ThisURL.indexOf("/cs_")>-1 && document.getElementById("navClients")) 
		{document.getElementById("navClients").className = " here";
		};

		if (ThisURL.indexOf("/news.")>-1 && document.getElementById("navAbout")) 
		{document.getElementById("navAbout").className = " here";
		};
		if (ThisURL.indexOf("/bios.")>-1 && document.getElementById("navAbout")) 
		{document.getElementById("navAbout").className = " here";
		};
		if (ThisURL.indexOf("/careers.")>-1 && document.getElementById("navAbout")) 
		{document.getElementById("navAbout").className = " here";
		};

		if (ThisURL.indexOf("/awards.")>-1 && document.getElementById("navHome")) 
		{document.getElementById("navHome").className = " here";
		};
		if (ThisURL.indexOf("/reading.")>-1 && document.getElementById("navHome")) 
		{document.getElementById("navHome").className = " here";
		};

	}
	//alert(BugMSG);
}
