$(document).ready(function(){
	
	
	$(".topslide,.bottomslide ").css("width",$(".scrollholder").css("width"));
	
	
						   scrollheight=$(".scrollcontent").height();
						   function donedown(){
							   
							  $(".topslide").css("background-image","url(/images/2011RD/sliderbg.png)");
						   }
						   function doneup(){
							   
							  $(".bottomslide").css("background-image","url(/images/2011RD/sliderbg.png)");
						   }
						   
						   function startdown(){
							   
							  $(".topslide").css("background-image","url(/images/2011RD/sliderbgUA.png)");
						   }
						   
						    function startup(){
							   
							  $(".bottomslide").css("background-image","url(/images/2011RD/sliderbgDA.png)");
						   }
						   
						   
						   
						   
						   function getscrollpos(){
							   scrollposition=$(myscroller).css("top").substring(0,$(myscroller).css("top").indexOf("px"));
							   return scrollposition;
						   }
						   
						   
						   
						   //alert("here is scrollheight"+scrollheight);
						
		$(".bottomslide").mouseover(function(){ 
									myscroller=$(this).siblings(".scrollholder").children(".scrollcontent");
									startdown();
										//alert("im in thismove");
										thismove=scrollheight*-1+$(".scrollholder").height();
									
									//alert (getscrollpos());
									mydivider=(scrollheight)/(scrollheight-Math.abs(getscrollpos()));
									
									//alert(mydivider);
									myduration=4000;
									myduration=myduration/mydivider;
									//alert(myduration);
									
									$(myscroller).animate({top:''+thismove+'px'},{queue:false, duration:myduration, complete:doneup});
									
									 //$(".scrollcontent").animate({top:'+thismove+'px'},{queue:false, duration:1500, easing: 'easeOutExpo'});
									 
									 });
                 				   
			$(".bottomslide").mouseout(function(){ 
									
									
									//alert (thismove);
									$(myscroller).stop();
									
									 //$(".scrollcontent").animate({top:'+thismove+'px'},{queue:false, duration:1500, easing: 'easeOutExpo'});
									 
									 });			   
						   
			$(".topslide").mouseover(function(){ 
											  startup();
									myscroller=$(this).siblings(".scrollholder").children(".scrollcontent");
									
										//alert("im in thismove");
										thismove=0;
										mydivider=Math.abs(scrollheight/(scrollheight-Math.abs(scrollheight-getscrollpos())));
									
									//alert (mydivider);
									myduration=4000;
									myduration=myduration/mydivider;
									$(myscroller).animate({top:''+thismove+'px'},{queue:false, duration:myduration, complete:donedown});
									
									 //$(".scrollcontent").animate({top:'+thismove+'px'},{queue:false, duration:1500, easing: 'easeOutExpo'});
									 
									 });
                 				   
			$(".topslide").mouseout(function(){ 
									
									
									//alert (thismove);
									$(myscroller).stop();
									
									 //$(".scrollcontent").animate({top:'+thismove+'px'},{queue:false, duration:1500, easing: 'easeOutExpo'});
									 
									 });				   
						   
						   
						   
						   
						   
						   
						   }); //end of jquery
