//HomeScroller

function stopError()
	{
		return true;
	}
	
	window.onerror = stopError;
	var ns4 = (document.layers)? true:false;
	var ie4 = (document.all && !document.getElementById) ? true:false;
	var ie5 = (document.all && document.getElementById) ? true:false;
	var ns6 = (!document.all && document.getElementById) ? true:false;
	
		

	var secWidth = 344;
	//var currPos = 0;
	var maxPos = 24;
	var currPos = Math.round(Math.random()*(maxPos))
	//var currPos = 22;
	var active = 1;
	var loaded = 0;
	
	function preload(imgObj, imgSrc)  
		{
			
 		if (ns4 || ie4 || ie5 || ns6) 
 			{
 				eval(imgObj + " = new Image()");
 				eval(imgObj + '.src = "' + imgSrc + '"');
 			}
 		}

	
	



	


function initScrolling()
{
	
	//establish of units are to be appended to any position properties
	//if (ns4) units = "";
	//else units = "px";
	//initializes DIV layer for scrolling
	
	if (ns4) 
       		{
				scrollDiv = document.scrClip.document.scrDiv;
  			}
	if (ie4) 
       		{
       			scrollDiv = divTimeline.style;       		
       		}
    if (ns6 || ie5)
       		{
       			scrollDiv = document.getElementById("scrDiv");	
       		}
    //alert(currPos);
    slideTo(-(currPos)*344);
	loaded = 1;
	active = 0;
	//coasterWiggle();
}


function scrposShift (x)
{
	if (active == 0)
	{
		
		active = 1;
		startPos = currPos
		currPos += x;
		dir = x;

		if ((dir == 1) && (currPos > maxPos))
			{
				//alert("cant go any further right");
				currPos = 0;
				active = 0;
				slideTo(0);
			}
		else if ((dir == -1) && (currPos < 0))
			{
			//alert("cant go any further left");
				currPos = 24;
				active = 0;
				slideTo(maxPos*-secWidth);
			}
		else 
			{
			
				ticker = 0;
				slideTimeline();
			}
		
	}
}





function slideTimeline ()
{
	ticker += 1.5;
	scrPos = Math.round((startPos * -344) - (dir*((Math.sin(ticker*.0174))*344)));
	//alert(scrPos);
	
	slideTo (scrPos);
	if (ticker > 90) 
	{
		active = 0;
		clearTimeout (scrSlidin);
	}
	else 
	{
		
		scrSlidin = setTimeout("slideTimeline()",10);

	}
	
	
}





function slideTo (x)
{

	if (ns4) scrollDiv.left = x;
	if (ie4) scrollDiv.posLeft = x;

	if (ie5 || ns6) scrollDiv.style.left = x + "px";

}


function FindQuery(){
	query = document.location.search;
	return query;
}