var scrollframe = null;
var mt = 0; 
var offset  =0;
var initDelay = 0;
var initStepSize = 0;
var inPause = false;
var gtagIdContainer = null;
var gtagIdContent = null;
var contents = null;
var contentHeight = 0;

function InitMarquee(tagIdContainer, tagIdContent, delay, stepSize){
  gtagIdContent   = tagIdContent;
  gtagIdContainer = tagIdContainer;
  scrollframe     = document.getElementById(tagIdContainer);
  contents 				= document.getElementById(gtagIdContent);
  contentHeight		= contents.clientHeight;
  
  mt = 0; 
  offset = scrollframe.clientHeight;
  initDelay = delay;
  initStepSize = stepSize;
  ScrollMarquee();
}

function ScrollMarquee(){
  if (! inPause && contents){
	  mt = mt + initStepSize;
	  
	  maxMT = contentHeight;
	  if (mt > (maxMT + offset)) {
	    mt = 0;
	  }    
	  
	  contents.style.marginTop = ((mt - offset ) * -1) + "px";
	  self.setTimeout("ScrollMarquee();", initDelay);
  }
}

function pauseMarquee(){
  inPause = true;
}

function resumeMarquee(){
  inPause = false;
  ScrollMarquee();
}
