/* Carousel config START */
function carousel_initCallback(carousel) {
	
	jQuery('.jcarousel-scroll').show();
	
    jQuery('.jcarousel-control span').bind('click', function() {
        carousel.scroll(jQuery.jcarousel.intval(jQuery(this).text()));
        return false;
    });
						
    jQuery('#carousel-next').bind('click', function() {
        carousel.next();
        return false;
    });

    jQuery('#carousel-prev').bind('click', function() {
        carousel.prev();
        return false;
    });
};
/* Carousel config END */



/* Font-resize config START */
function makeFontBigger() {
	jQuery("h1").css('font-size', '19px');
	jQuery("h2").css('font-size', '17px');
	jQuery("h4, p, ul a, ul, ol a, ol, .sidebarRight a, .level1, .breadcrumb, .metaNavi, .table a, label, .checkRadiobreadcrumb, .metaNavi span, .form textarea, .errorNote").css('font-size', '14px'); 
	jQuery(".headItems").css('font-size', '13px');
	jQuery(".fontBigger").css('text-decoration', 'underline');
	//set the cookie
	jQuery.cookie('hwkFontResize', 'bigger');
};

function makeFontNormal() {
	jQuery(".fontBigger, h1, h2, h4, p, ul a, ul, ol a, ol, .sidebarRight a, .level1, .breadcrumb, .metaNavi, .table a, label, .checkRadiobreadcrumb, .metaNavi span, .form textarea, .errorNote, .headItems").removeAttr('style');
	//reset the cookie
	jQuery.cookie('hwkFontResize', 'normal');
};
/* Font-resize config END */



/* Slimbox2: AUTOLOAD CODE BLOCK */
if (!/android|iphone|ipod|series60|symbian|windows ce|blackberry/i.test(navigator.userAgent)) {
	jQuery(function($) {
		$("a[rel^='lightbox']").slimbox({
			/* Put custom options here */
			counterText: "Bild {x} von {y}",
			nextKeys: [39, 87],
			previousKeys: [37, 90]
			}, null, function(el) {
			return (this == el) || ((this.rel.length > 8) && (this.rel == el.rel));
		});
	});
}



/* document ready */
jQuery(document).ready(function() {
	
	/* Carousel START */
    jQuery("#carousel").jcarousel({
        scroll: 1,
		wrap: 'circular',
        initCallback: carousel_initCallback,
        buttonNextHTML: null,
        buttonPrevHTML: null
    });
    /* Carousel END */
    
    
    
    /* Font-resize START */
    // check cookie value
    if (jQuery.cookie('hwkFontResize') == 'bigger') {
    	makeFontBigger();
    };
    
    // click-event: bigger font-size
    jQuery(".fontBigger").click(function() {
    	makeFontBigger()
    });
    
    // click-event: normal font-size
    jQuery(".fontNormal").click(function() {
    	makeFontNormal()
    });
    /* Font-resize END */

});


