if(navigator)
{
	user = navigator
	IS_NETSCAPE = (user.appName.toLowerCase().indexOf("netscape") != -1);
	IS_IE = (user.appName.toLowerCase().indexOf("internet") != -1);
	IS_SAFARI = (user.userAgent.toLowerCase().indexOf("safari") != -1);
	
	IS_OPERA = (user.appName.toLowerCase() == "opera");
	
	if(user.userAgent.indexOf("Opera")>-1)
	{
		IS_IE = false;
		IS_OPERA = true;
	}
	// browser version
	if (user.appVersion)
	{  // don't try to parseInt a string (NA = "")
		VERSION_IS = parseInt(user.appVersion);
		if (IS_IE)
		{  // fix for IE 5.0 appVersion bug (returns 4.0 version number)
			if (navigator.userAgent.indexOf("5.0") != -1) VERSION_IS = parseInt(user.appVersion);
		}
	}
	// user OS/platform
	if (user.userAgent && user.appVersion)
	{
		agt = user.userAgent.toLowerCase();  // abbreviation
		IS_WIN = ((agt.indexOf("win") != -1) || (agt.indexOf("16bit") != -1));
		IS_MAC = (agt.indexOf("mac") != -1);
		
		IS_OSX = IS_MAC && (agt.indexOf("os x") != -1);
	}
}	

function changeContent(id,shtml) {
   if (document.getElementById || document.all) {
      var el = document.getElementById? document.getElementById(id): document.all[id];
      if (el && typeof el.innerHTML != "undefined") el.innerHTML = shtml;
   }
}


var scroll_to_position2_array = new Array(0,-21,-55,-97,-142,-188,-231,-271,-306,-336,-361,-381,-397,-409,-418,-424,-428,-430,-431,-431,-430,-429,-428,-426,-424,-423,-422,-421,-420,-420);
var scroll_to_position1_array = new Array(0,0,1,2,3,5,7,9,11,12,13,13,11,8,3,-5,-17,-33,-54,-79,-109,-145,-185,-229,-275,-321,-364,-399,-420,-420);

var arrows1 = '<img src="web_images/newitems_left_off.gif" name="newitems_left" width="17" height="18" border="0" align="absmiddle"> <a onClick="return scroll_to_position2(\'scrollarea\');" href="javascript:void(0);" onMouseOver="MM_swapImage(\'newitems_right\',\'\',\'web_images/newitems_right_on.gif\',1)" onMouseOut="MM_swapImgRestore()"><img src="web_images/newitems_right_off.gif" name="newitems_right" width="17" height="18" border="0" align="absmiddle"></a>';

var arrows2 = '<a onClick="return scroll_to_position1(\'scrollarea\');" href="javascript:void(0);" onMouseOver="MM_swapImage(\'newitems_left\',\'\',\'web_images/newitems_left_on.gif\',1)" onMouseOut="MM_swapImgRestore()"><img src="web_images/newitems_left_off.gif" name="newitems_left" width="17" height="18" border="0" align="absmiddle"></a> <img src="web_images/newitems_right_off.gif" name="newitems_right" width="17" height="18" border="0" align="absmiddle">';

var arrowsoff = '<img src="web_images/newitems_left_off.gif" name="newitems_left" width="17" height="18" border="0" align="absmiddle"> <img src="web_images/newitems_right_off.gif" name="newitems_right" width="17" height="18" border="0" align="absmiddle">';

var pathIndex=0; 
var scrollID=null;
	
delay=10;

// ============================================

function scroll_to_position2(id)
{
	changeContent('expand',arrowsoff);
	
	var scrollElm = document.getElementById(id);
	
	if(scrollElm.pathIndex==null) scrollElm.pathIndex=0; 
	if(scrollElm.scrollID!=null) clearTimeout(scrollElm.scrollID);
	
	var xPos = scroll_to_position2_array[scrollElm.pathIndex++];
	scrollElm.style.left=xPos+"px";
	
	if(scrollElm.pathIndex<scroll_to_position2_array.length-1)
	{
	scrollElm.scrollID=setTimeout("scroll_to_position2(\""+id+"\")",delay);
	}else{
	changeContent('expand',arrows2);	
	}
	return false;
}


function scroll_to_position1(id)
{

	changeContent('expand',arrowsoff);
	
	var scrollElm = document.getElementById(id);
	if(scrollElm.scrollID!=null) clearTimeout(scrollElm.scrollID);
	
	var xPos = scroll_to_position1_array[scrollElm.pathIndex--];
	scrollElm.style.left=xPos+"px";

	if(scrollElm.pathIndex>0){
	scrollElm.scrollID=setTimeout("scroll_to_position1(\""+id+"\")",delay);
	}else{
	changeContent('expand',arrows1);	
	}
	return false;
}
