// clear fields script
function clearText(field){

    if (field.defaultValue == field.value) field.value = '';
    else if (field.value == '') field.value = field.defaultValue;

}

function myfunk(){
}

// Sitemap effect
SSS_faq = {
	init : function() {
		$('div.sitemap .subcategories').not(':first').slideToggle('slow');
		$('div.sitemap .categories').click(function() { SSS_faq.toggle(this) });
	},
	
	toggle : function(elt) {
		$(elt).toggleClass('active');
		$(elt).siblings('.subcategories').slideToggle('slow');
	}
}

jQuery(document).ready(function() {
    if (document.getElementById("mycarousel"))
    {
    jQuery('#mycarousel').jcarousel({
        wrap: 'circular',
				auto: 4,
				scroll:1,
        itemVisibleInCallback: {onBeforeAnimation: mycarousel_itemVisibleInCallback},
        itemVisibleOutCallback: {onAfterAnimation: mycarousel_itemVisibleOutCallback},
				initCallback: mycarousel_initCallback
    });
		$('.jcarousel-prev').css('visibility:', 'hidden');
		$('.jcarousel-next').css('visibility:', 'hidden');
    }
});

/*     jCarousel Script Promo     */
function mycarousel_initCallback(carousel)
{
    // Disable autoscrolling if the user clicks the prev or next button.
    carousel.buttonNext.bind('click', function() {
        carousel.startAuto(0);
    });

    carousel.buttonPrev.bind('click', function() {
        carousel.startAuto(0);
    });

    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });
};

function mycarousel_itemVisibleInCallback(carousel, item, i, state, evt)
{
    // The index() method calculates the index from a
    // given index who is out of the actual item range.
    var idx = carousel.index(i, mycarousel_itemList.length);
    carousel.add(i, mycarousel_getItemHTML(mycarousel_itemList[idx - 1]));
};

function mycarousel_itemVisibleOutCallback(carousel, item, i, state, evt)
{
    carousel.remove(i);
};

/**
 * Item html creation helper.
 */
function mycarousel_getItemHTML(item)
{
    return '<img src="' + item.url + '" width="483" height="302" alt="' + item.title + '" />';
};