function LoadContent() {
  try {
  	var TheSettings = document.getElementById('InnerDIV');
  	var URL = 'images.asp?Articlecode=<%=articletouse%>&r=' + Math.random();  
    req.abort(); //abort any previous request send
    //window.open(URL)
    if (req) {     
      req.open('GET', URL, true); 
      req.onreadystatechange=function() {
        if (req.readyState==4) {
          TheSettings.innerHTML = req.responseText;
          LoadArrows();
        }
      }
      req.send(null);       
    }        
  } catch(e) {
  	//error tracking messages here.
  }  
}


  function LoadArrows() {
    var TheSettings = document.getElementById('InnerDIV');  
    var Left = parseInt(TheSettings.style.left);
    if(isNaN(Left)) Left  = 0;    
    var Width = document.getElementById ? document.getElementById('TheTable').offsetWidth : TheSettings.offsetWidth;
  	if(-Left + MaxWidth  >= Width ) {
  		document.images['ScrollBtnRight'].style.cursor = 'arrow';
  	} else {
  		document.images['ScrollBtnRight'].style.cursor = 'pointer';
  	}
  	if(Left >= 0) {
  		document.images['ScrollBtnLeft'].style.cursor = 'arrow';		
  	} else {
  		document.images['ScrollBtnLeft'].style.cursor = 'pointer';
  	}
  
  }
  
var timer_id = null;


function ScrollTo(Where) {
	var Timeout  = 20;
	var ScrollAmount = 4;
  var TheSettings = document.getElementById('InnerDIV');  
  var Left = parseInt(TheSettings.style.left);
  var Width = document.getElementById ? document.getElementById('TheTable').offsetWidth : TheSettings.offsetWidth;
  if(isNaN(Left)) Left  = 0;
  if(isNaN(Width )) Width = 0;
  var IsNextTimer = true;
  if(Width < MaxWidth){
  	return false
  }
  else{
  if(Where < 0) {
 	  Left-=ScrollAmount ;
	  if(-Left + MaxWidth  > Width ) {
	  	Left = -(Width - MaxWidth );
	  	IsNextTimer = false;
	  }
	} else {
		Left+=ScrollAmount ;
		if(Left > 0) {
			Left = 0;
	  	IsNextTimer = false;			
		}
	}
  TheSettings.style.left = Left + 'px';
  LoadArrows();
  if(IsNextTimer) {
	  timer_id = setTimeout("ScrollTo(" + Where + ")", Timeout  );
	} 
	} 
}

function showLargeImage(url)
{
	var splitimages
	document.images['largeimage'].src = url
	splitimages = url.split('/')
	document.forms['qListForm'].LargeImageName.value=splitimages[3];
}

function stopScroll() 
{ 
	if (timer_id) clearTimeout(timer_id); 
}
