function scrollThis(parentElement, childElement, num){
	$("#"+childElement+" p:last").css("margin-bottom","0");
	$("#"+childElement).css("marginTop", "0px");
  	//find height of container, inner container, and scrolling speeed
  	$(".scroll").css("overflow","hidden");
	
	contentHeight = $("#"+childElement).attr('offsetHeight');
	
	//$(".scroll").css("overflow","auto");
  	containerHeight = $("#"+parentElement).height();  
  	scrollingHeight = contentHeight-containerHeight; 
	
  	//sees if the scrolling content is larger than the container; this will make it so no errors are thrown.  
  	if(scrollingHeight > 0){
	  
    	var scrollTo = ""+"-"+scrollingHeight+"px";
    	var scrollSpeed = parseInt(scrollingHeight+"0");

    	//change the css, so we can use the custom scrolling; otherwise, will default to html scrollbar
    	$(".scroll").css("overflow","hidden");

    	//add an up and down arrow after the content div; these will control the up and down movement
    	$("#"+parentElement+".scroll").after("<ul id='scroll-controls"+num+"'><li id='up"+num+"'><a href='#up'><img src='/assets/images/global/arrow-up.gif' width='8' height='8' alt='scroll up' /></a></li><li id='down"+num+"'><a href='#down'><img src='/assets/images/global/arrow-down.gif' width='8' height='8' alt='scroll down' /></a></li></ul>");    
    	//trigger when the up and down hover/click functions happen
   		$("#up"+num+" a").hover(function(){scrollUp(scrollSpeed, parentElement, childElement)},function(){scrollOut(parentElement, childElement)});
    	$("#down"+num+" a").hover(function(){scrollDown(scrollTo,scrollSpeed, parentElement, childElement)},function(){scrollOut(parentElement, childElement)});

  		//no need for a click event
  		$("#up"+num+" a").click(function(){return false;});
  		$("#down"+num+" a").click(function(){return false;});
  
  }
  
  
};

//a function for scrolling up
function scrollUp(scrollSpeed, parentElement, childElement){
  scrollOffset = Math.abs(parseInt($("#"+childElement).css("marginTop")));
  scrollSpeed = parseInt(scrollOffset+"0");
//  alert(scrollSpeed)
  $('#'+parentElement+' #'+childElement).animate({marginTop: '0px'},scrollSpeed,"linear");
}

//a function for scrolling down
function scrollDown(scrollTo,scrollSpeed, parentElement, childElement){
  scrollHeight = parseInt($("#"+childElement).height());
  scrollOffset = Math.abs(parseInt($("#"+childElement).css("marginTop")));
  scrollLeft = (scrollHeight-scrollOffset-containerHeight);
  scrollSpeed = parseInt(scrollLeft+"0");
  if(scrollSpeed > 0){
    scrolling = $('#'+parentElement+' #'+childElement).animate({marginTop: scrollTo},scrollSpeed,"linear");
  }else{
    $('#'+parentElement+' #'+childElement).stop();
  }
}

//a rollout/do nothing function
function scrollOut(parentElement, childElement){
  $('#'+parentElement+' #'+childElement).stop();
}

