
	var Cscr = document.getElementById('scrollconts')
	Cscr.style.marginLeft = "0px";
	var ticktimer = 20
	var MixX = 690 - parseInt(Cscr.style.width) // 300 is the width of the parent Div
	
	var shooftDestination = 0;
	var shooftDivider = 3
	function shooft(ammount)
	{
		
			if (shooftDestination + ammount > 0)
			{
				shooftDestination = 0;
			}
			else if (shooftDestination + ammount < MixX)			
			{
				shooftDestination = MixX;	
			}
			else 
			{
				shooftDestination += ammount;
			}

			scrollDiv();
			

	}


	function scrollDiv()
	{
		var X = Number(parseFloat(Cscr.style.marginLeft));
		Xdist = shooftDestination - X;

		if((Xdist / shooftDivider) < 0.1 && (Xdist/shooftDivider) > -0.1)
			{Xstr = shooftDestination+"px";}
		
		else if (Xdist > 10 )
		{ Xstr = X+12+"px"; OStr = "farLeft";}
		else if (Xdist <= 10 && Xdist > 0)
		{ Xstr = X+2+"px"; OStr = "closeLeft"; }
		
		else if (Xdist < -10 )
		{ Xstr = X-12+"px"; OStr = "farRight"; }
		else if (Xdist >= -10 && Xdist < 0)
		{ Xstr = X-2+"px"; OStr = "closeRight";}
		else {alert("no proc");}
		Cscr.style.marginLeft = Xstr;



		if(Xdist != 0)
		{ timer = setTimeout("scrollDiv()",ticktimer);}
		else { clearTimeout(timer);

		if(shooftDestination == 0) {greyLeft()} else {ungreyL()}
		if(shooftDestination == MixX) {greyRight()} else {ungreyR()}

		}
		
		
		
	}


    var TimeToFade = 500.0;
    
    
    function fade(eid)
    {
		
      var element = document.getElementById(eid);
      if(element == null)
        {return; }
       

      if(element.FadeState == null)
      {
        if(element.style.opacity == null 
            || element.style.opacity == '' 
            || element.style.opacity == '1')
        {
          element.FadeState = 2;
        }
        else
        {
          element.FadeState = -2;
        }
      }
        
      if(element.FadeState == 1 || element.FadeState == -1)
      {
        element.FadeState = element.FadeState == 1 ? -1 : 1;
        element.FadeTimeLeft = TimeToFade - element.FadeTimeLeft;
      }
      else
      {
        element.FadeState = element.FadeState == 2 ? -1 : 1;
        element.FadeTimeLeft = TimeToFade;
        setTimeout("animateFade(" + new Date().getTime() + ",'" + eid + "')", 33);
      }  
    }
    
    
    function animateFade(lastTick, eid)
    {  
      var curTick = new Date().getTime();
      var elapsedTicks = curTick - lastTick;
      
      var element = document.getElementById(eid);
     
      if(element.FadeTimeLeft <= elapsedTicks)
      {
        element.style.opacity = element.FadeState == 1 ? '1' : '0';
        element.style.filter = 'alpha(opacity = ' 
            + (element.FadeState == 1 ? '100' : '0') + ')';
        element.FadeState = element.FadeState == 1 ? 2 : -2;
        return;
      }
     
      element.FadeTimeLeft -= elapsedTicks;
      var newOpVal = element.FadeTimeLeft/TimeToFade;
      if(element.FadeState == 1)
        newOpVal = 1 - newOpVal;
    
      element.style.opacity = newOpVal;
      element.style.filter = 'alpha(opacity = ' + (newOpVal*100) + ')';
      
      setTimeout("animateFade(" + curTick + ",'" + eid + "')", 33);
    }

	function greyLeft()
    {  
	
	fadeout('leftarrow'); 
	}
    
    function greyRight()
    { fadeout('rightarrow') }
    
    function ungreyL()
    { 

		fadein('leftarrow');
		
	}
	function ungreyR()
	{
		fadein('rightarrow');
	}
	function fadeout(element)
	{
 
		
		
		element = document.getElementById(element);
		output.value = output.value + "="+element.FadeState 
		if (element.style.opacity != 1 && element.FadeState != 1 ) {element.FadeState = -2;fade(element.id);}
	}
	function fadein(element)
	{
		
		element = document.getElementById(element);
		if (element.style.opacity != 0 ) {element.FadeState = 2;fade(element.id); }
	}
	
	function hobbychange(pagename)
	{
		var param = new Array();
	
		param[0] = new Array( 'hobby',pagename );
		param[1] = new Array( 'AN', 'AN');
	
		doPost("PHP_includes/Hobbies_SubBar.php",param,1,'Hobbies_links');
		doPost("RC4_hobbies/"+ pagename+".php","",0,'hobby_data_conts');
	}
