Eileen, The skin.css and the rotator.js are in the \Portals\_default\Skins\Greytness2 directory.
Sunil, Here is the function that is in rotator.js:
function ItemRotator(sContainerId, bDisableAutoRotate) {
var oBoat = jQuery('#' + sContainerId + ' .boat');
var oNav = jQuery('#' + sContainerId + ' .nav');
var _bRotating = !bDisableAutoRotate;
var _bAnimating = false;
var _iCurrentIndex = 0;
var _oItems = [];
var _iJoustWidth = jQuery('#' + sContainerId).width();
jQuery.each(oBoat.find('img'), function (_iIndex) {
var _oCurrItem = jQuery(this);
if (_oCurrItem.parent().get(0).nodeName.toLowerCase() == 'a') {
var _sHref = _oCurrItem.parent().attr('href');
_oCurrItem.click(function () {
window.location.href = _sHref;
}).css('cursor', 'pointer');
}
_oItems.push(_oCurrItem);
if (_iIndex > 0) {
_oCurrItem.css({ display: 'none' });
} else {
_oVisibleItem = _oCurrItem;
}
});
if (_bRotating) {
var _iRotatingInterval = setInterval(function () {
if (_bRotating) {
__NavigateTo((_iCurrentIndex + 1 >= _oItems.length) ? 0 : _iCurrentIndex + 1, false, false);
} else {
clearInterval(_iRotatingInterval);
}
}, 8000);
}
if (oNav.length) {
var _oNavClicker = jQuery(document.createElement('li')).addClass('prev').text('Previous').click(function () {
__NavigateTo(_iCurrentIndex - 1, true, true);
});
oNav.html('').append(_oNavClicker);
jQuery.each(_oItems, function (__iIndex, __oItem) {
_oNavClicker = jQuery(document.createElement('li')).addClass('off').click(function () {
__NavigateTo(__iIndex, true, (__iIndex < _iCurrentIndex));
});
if (__iIndex == 0)
_oNavClicker.addClass('on');
oNav.append(_oNavClicker);
});
_oNavClicker = jQuery(document.createElement('li')).addClass('next').text('Next').click(function () {
__NavigateTo(_iCurrentIndex + 1, true);
});
oNav.append(_oNavClicker);
}
function __NavigateTo(_iNewIndex, _bStopRotate, _bPrev) {
_bRotating = !_bStopRotate;
if (!_bRotating)
clearInterval(_iRotatingInterval);
if (!_bAnimating && _iNewIndex >= 0 && _iNewIndex < _oItems.length && _iNewIndex != _iCurrentIndex) {
_bAnimating = true;
var _iPrevIndex = _iCurrentIndex;
_iCurrentIndex = _iNewIndex;
jQuery.each(oNav.children(), function (__iNavIndex) {
if (__iNavIndex == _iCurrentIndex + 1)
jQuery(this).addClass('on');
else
jQuery(this).removeClass('on');
});
if (!_bPrev) {
//Next
oBoat.stop(true).append(_oItems[_iCurrentIndex].css({ display: 'block' })).animate({ 'margin-left': '-' + _iJoustWidth + 'px' }, { duration: 800, complete: function () {
_oItems[_iPrevIndex].css({ display: 'none' });
jQuery(this).css('margin-left', 0);
_bAnimating = false;
}
});
} else {
//Prev
oBoat.stop(true).css('margin-left', '-' + _iJoustWidth + 'px').prepend(_oItems[_iCurrentIndex].css({ display: 'block' })).animate({ 'margin-left': 0 }, { duration: 800, complete: function () {
_oItems[_iPrevIndex].css({ display: 'none' });
_bAnimating = false;
}
});
}
}
}
}