// JavaScript Document

/***********************************************
* 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/logo_scroll_left.gif'
var gorightimage='/images/logo_scroll_right.gif'
//configure menu width (in px):
var menuwidth=500
//configure menu height (in px):
var menuheight=66
var speedmulti=18;
var scrolloffset=55;
var alp_globalmenuheight
if (alp_globalmenuheight > 0)
{
	menuheight = alp_globalmenuheight;
}
if (alp_globalmenuwidth > 0)
{
	menuwidth = alp_globalmenuwidth;
}

//Specify scroll buttons directions ("normal" or "reverse"):
var scrolldir="reverse"
//configure scroll speed (1-10), where larger is faster
var scrollspeed=6

////NO NEED TO EDIT BELOW THIS LINE////////////

var iedom=document.all||document.getElementById
var leftdircode='onMouseover="$(\'#recentProds\').stop(); moveleft()" onMouseout="clearTimeout(lefttime)"'
var rightdircode='onMouseover="$(\'#recentProds\').stop(); moveright()" onMouseout="clearTimeout(righttime)"'
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("recentProds") : document.all.recentProds
        cross_scroll.innerHTML=menucontents
        actualwidth=recentProdswidth
    }
    else if (document.layers){
        ns_scroll=document.ns_scrollmenu.document.ns_scrollmenu2
        ns_scroll.document.write(menucontents)
        ns_scroll.document.close()
        actualwidth=recentProdswidth
    }
    loadedyes=1
}


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=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=setTimeout("moveright()",50)
}
 
if (iedom||document.layers){
    with (document){
        write('<table border="0" cellspacing="0" cellpadding="0">')
        write('<td valign="middle"><a id="leftarrow" style="cursor: pointer;" '+leftdircode+'><img width="53" height="72" border="0" src="/images/logo_scroll_left.gif"></a></td>')
        write('<td width="'+menuwidth+'px" valign="top" style="background:url(\'../images/logo_scroll_bg.gif\') repeat-x scroll 0 0 transparent;">')
        
        if (iedom){
            write('<div style="position:relative;width:'+menuwidth+'px;height:'+menuheight+'px;overflow:hidden;">')
            write('<div id="recentProds" style="position:absolute;left:0;top:0;width:'+recentProdswidth+'px;">')
            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="middle"><a id="rightarrow" style="cursor: pointer;" '+rightdircode+'><img width="53" height="72" border="0" src="/images/logo_scroll_right.gif"></a>')
        write('</td></table>')
    }
} 
function startup(){
    var moveit=-((-(actualwidth-menuwidth))-parseInt($('#recentProds').css('left'))+scrolloffset);
    $('#recentProds').mouseover(function() {
        moveit=-((-(actualwidth-menuwidth))-parseInt($('#recentProds').css('left'))+scrolloffset);
        if (moveit < scrolloffset)
            moveit=scrolloffset;
        $('#recentProds').stop();
    });
	$('#recentProds').mouseout(function() {
        moveit=-((-(actualwidth-menuwidth))-parseInt($('#recentProds').css('left'))+scrolloffset);
        if (moveit < scrolloffset)
            moveit=scrolloffset;
        $('#recentProds').animate({"left": "-="+moveit+"px"}, moveit*speedmulti, "linear");
    });
	$('#leftarrow').mouseout(function() {
        moveit=-((-(actualwidth-menuwidth))-parseInt($('#recentProds').css('left'))+scrolloffset);
        if (moveit < scrolloffset)
            moveit=scrolloffset;
        $('#recentProds').animate({"left": "-="+moveit+"px"}, moveit*speedmulti, "linear");
    });
	$('#rightarrow').mouseout(function() {
        moveit=-((-(actualwidth-menuwidth))-parseInt($('#recentProds').css('left'))+scrolloffset);
        if (moveit < scrolloffset)
            moveit=scrolloffset;
        $('#recentProds').animate({"left": "-="+moveit+"px"}, moveit*speedmulti, "linear");
    });
    $('#recentProds').animate({"left": "-="+(moveit)+"px"}, moveit*speedmulti, "linear");

}


var temp12=function(){ return 1;};
if( window.onload )
{
      //override "placeholder" with whatever already exists in onload
     temp12 = window.onload;
}
window.onload=function(){ fillup(); startup();  temp12();};

