var $gclContentRotatorLinks;
var $gclContentRotatorContents;
var gclContentRotatorLinkCurPos = 0;
var gclNumContentRotatorContents;

$(document).ready(function() {

  $gclContentRotatorLinks    = $("#vSlideNav li a");
  $gclContentRotatorContents = $("#gcl-content-rotator li");
  $gclContentRotatorLinks.attr({'href': 'javascript:void(0)'});
  
   gclNumContentRotatorContents = $gclContentRotatorContents.length;
   
  $gclContentRotatorContents.slice(1).hide();

  //if ($.browser.msie) { gclContentRotatorLinkHeight += 2; }
  
  $gclContentRotatorLinks.click(function () { 
	if(gclContentRotatorLinkCurPos != $gclContentRotatorLinks.index(this)) {
		gclContentRotatorLinkCurPos = $gclContentRotatorLinks.index(this);
		slideContentRotator();
	}
  });
  
  
  $("a.slide_up").click(function () { 
	if(gclContentRotatorLinkCurPos > 0) {
		gclContentRotatorLinkCurPos--;
		slideContentRotator();
	}
  });
  
  $("a.slide_down").click(function () { 
	if(gclContentRotatorLinkCurPos < gclNumContentRotatorContents) {
		gclContentRotatorLinkCurPos++;
		slideContentRotator();
	}
  });


});  



function slideContentRotator () 
{
		//$("#gcl-content-rotator-arrow").animate({ top:(gclContentRotatorLinkCurPos*gclContentRotatorLinkHeight)+gclContentRotatorLinkTop }, "fast");
		$gclContentRotatorLinks.show("fast");
		$gclContentRotatorLinks.eq(gclContentRotatorLinkCurPos).animate({opacity: "hide"}, 10);  

		$gclContentRotatorContents.hide("fast");
		$gclContentRotatorContents.eq(gclContentRotatorLinkCurPos).show("slow");
}