function activateHesehusCycle(strElementSelector, strFX, intSpeed, intTimeout, booPause, booPauseOnPagerHover, strPrevSelector, strNextSelector, strPagerSelector, strPagerHeaderTextSelector, funcPrevNextClick, funcBefore, funcAfter) {
    var objElements = jQuery(strElementSelector);
    if (objElements.length > 0) {
        objElements.cycle(buildHesehusCycleOptions(strFX, intSpeed, intTimeout, booPause, booPauseOnPagerHover, strPrevSelector, strNextSelector, strPagerSelector, strPagerHeaderTextSelector, funcPrevNextClick, funcBefore, funcAfter));
    }
}

function buildHesehusCycleOptions(strFX, intSpeed, intTimeout, booPause, booPauseOnPagerHover, strPrevSelector, strNextSelector, strPagerSelector, strPagerHeaderTextSelector, funcPrevNextClick, funcBefore, funcAfter) {
    var allOptions = {
        fx: strFX,
        speed: intSpeed,
        timeout: intTimeout,
        pause: booPause,
        pauseOnPagerHover: booPauseOnPagerHover,
        prevNextClick: funcPrevNextClick,
        before: funcBefore,
        after: funcAfter
    };
    
    var optionalPrevOption = null;
    var optionalNextOption = null;
    var optionalPagerOption = null;
    var optionalPagerAnchorBuilderOption = null;
    
    if (strPrevSelector != "") optionalPrevOption = { prev: strPrevSelector };
    if (strNextSelector != "") optionalNextOption = { next: strNextSelector };
    if (strPagerSelector != "") optionalPagerOption = { pager: strPagerSelector };
    if (strPagerSelector != "") {
        optionalPagerAnchorBuilderOption = { pagerAnchorBuilder: function(idx, slide) {
            var strText = '';
            if (strPagerHeaderTextSelector != "") {
                var elementWithText = jQuery(slide).find(strPagerHeaderTextSelector);
                if (elementWithText.length > 0) {
                    if (elementWithText.text() != "") {
                        strText = elementWithText.text();
                    }
                }
            }
            if ((strText == "") && (jQuery(slide).attr("rel") != undefined)) {
                strText = jQuery(slide).attr("rel");
            }
            if ((strText == "") && (jQuery(slide).attr("title") != undefined)) {
                strText = jQuery(slide).attr("title");
            }
            if ((strText == "") && (jQuery(slide).attr("alt") != undefined)) {
                strText = jQuery(slide).attr("alt");
            }
            if (strText == "") {
                strText = (idx + 1);
            }
            return '<li><a href="javascript:void(0);">' + strText + '</a></li>';
        }};
    }

    // Join all options
    if (optionalPrevOption != null) for (var i in optionalPrevOption) allOptions[i] = optionalPrevOption[i];
    if (optionalNextOption != null) for (var j in optionalNextOption) allOptions[j] = optionalNextOption[j];
    if (optionalPagerOption != null) for (var k in optionalPagerOption) allOptions[k] = optionalPagerOption[k];
    if (optionalPagerAnchorBuilderOption != null) for (var l in optionalPagerAnchorBuilderOption) allOptions[l] = optionalPagerAnchorBuilderOption[l];

    return allOptions;
}
