
/***********************************************
* Scrollable Menu Links- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* Visit http://www.dynamicDrive.com for hundreds of DHTML scripts
* This notice must stay intact for legal use
***********************************************/

//configure path for left and right arrows
var goleftimage='images/thumbnails/scroll_leftoff.jpg';
var gorightimage='images/thumbnails/scroll_right.jpg';
//configure menu width (in px):
var menuwidth=698;
//configure menu height (in px):
var menuheight=120;
//Specify scroll buttons directions ("normal" or "reverse"):
var scrolldir="reverse";
//configure scroll speed (1-10), where larger is faster
var scrollspeed = 70;
//specify menu content
//var menucontents='<nobr><table width="696" border="1"><tr><td width="50%">123456789123456789123456798244</td><td width="50%">abcdabcdabcdabcdaueyetebbdcjgc</td></tr></table></nobr>'
var lefttime, righttime;

////NO NEED TO EDIT BELOW THIS LINE////////////

var iedom=document.all||document.getElementById
var leftdircode='onclick="myMoveLeft();" onmouseover="myMouseOverLeft()" onmouseout="myMouseOutLeft()"'
var rightdircode='onclick="myMoveRight();" onmouseover="myMouseOverRight()" onmouseout="myMouseOutRight()"'
if (scrolldir=="reverse"){
var tempswap=leftdircode
leftdircode=rightdircode
rightdircode=tempswap
}
if (iedom)
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100;left:-5000">'+menucontents+'</span>')
var actualwidth=''
var cross_scroll, ns_scroll
var loadedyes=0

function fillup(){
	if (iedom){
		cross_scroll=document.getElementById? document.getElementById("test2") : document.all.test2
		cross_scroll.innerHTML=menucontents
		actualwidth=document.all? cross_scroll.offsetWidth : document.getElementById("temp").offsetWidth
	}
	else if (document.layers){
		ns_scroll=document.ns_scrollmenu.document.ns_scrollmenu2
		ns_scroll.document.write(menucontents)
		ns_scroll.document.close()
		actualwidth=ns_scroll.document.width
	}
	loadedyes=1
}

window.onload=fillup


function moveleft(){
	if (loadedyes){
	if (iedom&&parseInt(cross_scroll.style.left)>(menuwidth-actualwidth))
	{
	cross_scroll.style.left=parseInt(cross_scroll.style.left)-scrollspeed+"px"
	}
	else if (document.layers&&ns_scroll.left>(menuwidth-actualwidth))
	ns_scroll.left-=scrollspeed
	}
	lefttime=window.setTimeout("moveleft()", 50)
}

function moveright(){
	if (loadedyes){
		if (iedom&&parseInt(cross_scroll.style.left)<0)
			cross_scroll.style.left=parseInt(cross_scroll.style.left)+scrollspeed+"px"
		else if (document.layers&&ns_scroll.left<0)
			ns_scroll.left+=scrollspeed
	}
	righttime=window.setTimeout("moveright()", 50)
}


if (iedom||document.layers){
with (document){
write('<table border="0" cellspacing="0" cellpadding="0"><tr>')
write('<td valign="top"><a href="#" '+leftdircode+'><img id="scrollLeftImage" src="'+goleftimage+'" border="0"></a></td>')
write('<td width="'+menuwidth+'px" valign="bottom">')
if (iedom){
	write('<div style="position:relative;width:'+menuwidth+'px;height:'+menuheight+'px;overflow:hidden;">')
	write('<div id="test2" style="position:absolute;left:0;top:0">')
	write('</div></div>')
}
else if (document.layers){
	write('<ilayer width='+menuwidth+' height='+menuheight+' name="ns_scrollmenu">')
	write('<layer name="ns_scrollmenu2" left=0 top=0></layer></ilayer>')
}
write('</td>')
write('<td valign="top"><a href="#" '+rightdircode+'>')
write('<img id="scrollRightImage" src="'+gorightimage+'" border="0"></a>')
write('</td></tr></table>')
}
}

function myMoveLeft()
{
		window.clearTimeout(lefttime);
		window.clearTimeout(righttime);
		
		var imagePath = document.getElementById("scrollLeftImage").src;
		var imageName = imagePath.substring(imagePath.lastIndexOf("/") + 1, imagePath.length);
		//alert('moving left ' + imageName);

		if (imageName == "scroll_leftoff.jpg")
		{
			document.getElementById("scrollLeftImage").src = "images/thumbnails/scroll_left.jpg";
			document.getElementById("scrollRightImage").src = "images/thumbnails/scroll_rightoff.jpg";
			moveleft();
		}		
	
}

function myMoveRight()
{
		window.clearTimeout(lefttime);
		window.clearTimeout(righttime);

		var imagePath = document.getElementById("scrollRightImage").src;
		var imageName = imagePath.substring(imagePath.lastIndexOf("/") + 1, imagePath.length);
		//alert('moving right ' + imageName);

		if (imageName == "scroll_rightoff.jpg")
		{			
			document.getElementById("scrollRightImage").src = "images/thumbnails/scroll_right.jpg";
			document.getElementById("scrollLeftImage").src = "images/thumbnails/scroll_leftoff.jpg";
			moveright();
		}
		
}

function myMouseOverLeft()
{
		var imagePath = document.getElementById("scrollLeftImage").src;
		var imageName = imagePath.substring(imagePath.lastIndexOf("/") + 1, imagePath.length);
		//alert('mouse over left ' + imageName);

		if (imageName == "scroll_leftoff.jpg")
		{
			document.getElementById("scrollRightImage").src = "images/thumbnails/scroll_rightover.jpg";
		}
}

function myMouseOverRight()
{
		var imagePath = document.getElementById("scrollRightImage").src;
		var imageName = imagePath.substring(imagePath.lastIndexOf("/") + 1, imagePath.length);
		//alert('moving right ' + imageName);

		if (imageName == "scroll_rightoff.jpg")
		{			
			document.getElementById("scrollLeftImage").src = "images/thumbnails/scroll_leftover.jpg";
		}
}

function myMouseOutLeft()
{
		var imagePath = document.getElementById("scrollLeftImage").src;
		var imageName = imagePath.substring(imagePath.lastIndexOf("/") + 1, imagePath.length);
		//alert('moving left ' + imageName);

		if (imageName == "scroll_leftoff.jpg")
		{
			document.getElementById("scrollRightImage").src = "images/thumbnails/scroll_right.jpg";
		}
}

function myMouseOutRight()
{
		var imagePath = document.getElementById("scrollRightImage").src;
		var imageName = imagePath.substring(imagePath.lastIndexOf("/") + 1, imagePath.length);
		//alert('moving right ' + imageName);

		if (imageName == "scroll_rightoff.jpg")
		{			
			document.getElementById("scrollLeftImage").src = "images/thumbnails/scroll_left.jpg";
		}
}

