$(document).ready(function () {
    $("#slider").easySlider({
        auto: true,
        continuous: true,
        numeric: true,
        auto: true,
        continuous: true,
        speed: 800,
        pause: 4000
    });

    $('.special_button').mouseover(function () {
        $(this).animate({ right: '-=15' }, 300, function () { });
    });
    $('.special_button').mouseout(function () {
        $(this).animate({ right: '+=15' }, 300, function () { });
    });
	
//	$('.play_icon').mouseover(function() {
//		$(this).animate({left: '-=260'}, 300, function() {});
//	});
//	$('.play_icon').mouseout(function() {
//		$(this).animate({left: '+=260'}, 300, function() {});
//	});
	
	$('.homebox-button').click(function () {
		var first=$(this).parents('.homeboxwrapper').children().eq(0);
		var second=$(this).parents('.homeboxwrapper').children().eq(1);
		first.hide();
		second.show();
    });
	
	$('.closehomebox').click(function () {
        var first=$(this).parents('.homeboxwrapper').children().eq(0);
		var second=$(this).parents('.homeboxwrapper').children().eq(1);
		first.show();
		second.hide();
    });
	
    $('.gototop').click(function () {
        var destination = $('body').offset().top;
        $("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination }, 500);
    });
    var scrollcustom = document.URL;
    var scrollcustomuri = scrollcustom.split("#scrollto:");
    if (scrollcustomuri[1]) {
        var dest = $('#' + scrollcustomuri[1]).offset().top;
        $("html:not(:animated),body:not(:animated)").animate({ scrollTop: dest }, 500);
    }
    $('.scrollto').click(function () {
        var target = jQuery(this).attr('id');
        var destin = $('#scrolled_' + target).offset().top;
        $("html:not(:animated),body:not(:animated)").animate({ scrollTop: destin }, 500);
    });

    $('.toggleboxhead').each(function () {
        var this_id = jQuery(this).attr('id');
        var cn = 0;
        $(this).click(function () {
            jQuery('.' + this_id + ' .toggleboxcon-in').fadeToggle('slow');
            jQuery(this).toggleClass('toggleboxheadactive');
            var toggleconheight = $('.' + this_id + ' .toggleboxcon-in').height();
            if (cn == 0) { $("." + this_id).animate({ height: toggleconheight + 5 }); cn = 1; }
            else { $("." + this_id).animate({ height: 0 }); cn = 0; }
        });

    });

    /* IE7 not compatible
	$('.homebox-button').click(function () {
        $(this).parents('.homeboxwrapper').css('top', '-205px');
    }); */
});	
