scrollCurrent=300;
scrollSpace=150;
scrollStep=15;
scrollTimer="";


function toLeft(id){
  document.getElementById(id).scrollLeft=0
}
function toRight(id){
  document.getElementById(id).scrollLeft=document.getElementById(id).scrollWidth
}
function scrollDiv(id,where){
  clearTimeout(scrollTimer);
  scrollCurrent += scrollStep;
  if(scrollCurrent > scrollSpace)
  {
    scrollCurrent = 0;
	return;
  }
  
  if(where=='left')
	document.getElementById(id).scrollLeft+=scrollStep;
  else
	document.getElementById(id).scrollLeft-=scrollStep;
  
  scrollTimer=setTimeout("scrollDiv('"+id+"','"+where+"')",5);
}
function scrollDivLeft(id){
	if(parseInt(document.getElementById('hold').style.width) <= document.getElementById(id).scrollLeft + scrollSpace + 900)
	return;

  if(scrollCurrent != scrollSpace)
	scrollCurrent = scrollCurrent - scrollSpace;
  else
	scrollCurrent=0;

  scrollDiv(id, "left");
}
function scrollDivRight(id){

  if(scrollCurrent != scrollSpace)
	scrollCurrent = scrollCurrent - scrollSpace;
  else
	scrollCurrent=0;
  scrollDiv(id, "right");
}
function stopMe(){
  clearTimeout(scrollTimer) 
}

function doImg(img)
{
	document.getElementById('projectimg').style.backgroundImage = 'url(' +img+ ')';
	
}

function getHash() {
  var hash = window.location.hash;
  return hash.substring(1); // remove #
}