/* MOUSE OVER */

$(function() {
$("#contact li").hover(function() {
	$(this).children('ul').show();
}, function() {
	$(this).children('ul').hide();
});
});



/* FORM CUSTOM */

$(function(){
			$('form').jqTransform({imgPath:'../images/formimg/'});
		});




/* TOP PICTURE SLIDER */

$(document).ready(function() {
  $('#slider').bxSlider({
    auto: true,
    autoControls: false,
    pager: false,
    mode: 'horizontal',
    speed: 800,
    controls: true,
    prevText: '&lt;',
    nextText: '&gt;',
    pause: 8000,
    easing: 'swing', /* swing or linear */
    autoHover: true
  });
jQuery(document).ready(function(){
    	jQuery(".bx-prev,.bx-next").wrapAll("<div class='prev-next'></div>");
  	});
});




/* NEWS TICKER */

$(document).ready(
	function(){
		$('#newsticker').innerfade({
			animationtype: 'fade',
			speed: 1000,
			timeout: 5000,
			type: 'sequence',
			containerheight: '1.8em'
		});

	}
);



/* IMAGE MOUSE OVER */

$(document).ready(function() {
  $(".img_mouseover a img")
  .hover(
    function() {
      $(this).fadeTo(250, 0.5);
    },
    function() {
      $(this).fadeTo(250, 1.0);
    }
  );
});



/* SCROLL */

$(function(){
     $(".pagetop a").click(function(){
     $('html,body').animate({ scrollTop: $($(this).attr("href")).offset().top }, 'fast','linear');
     return false;
     })
});





/* PARALLAX */

$(function() {
$(window).scroll(function(){
var y = $(this).scrollTop();
$('#background01').css('background-position', '0 ' + parseInt( -y / 0 ) + 'em');
$('#background02').css('background-position', '0 ' + parseInt( -y / 10 ) + 'em');
$('#background03').css('background-position', '0 ' + parseInt( -y / 20 ) + 'em');

});
});


/* BLOCK LINK */

$(function(){
     $(".blocklink").click(function(){
         window.location=$(this).find("a").attr("href");
         return false;
    });
});


/* FIXED FLOATING */

(function ($) {
    $.fn.floatingWidget = function () {
        return this.each(function () {
            var $this = $(this),
                $parent = $this.offsetParent(),
                $window = $(window),
                top = $this.offset().top - parseFloat($this.css('marginTop').replace(/auto/, 0)),
                bottom = $parent.offset().top + $parent.height() - $this.outerHeight(true),
                floatingClass = 'floating',
                pinnedBottomClass = 'pinned-bottom';
            if ($parent.height() > $this.outerHeight(true)) {
                $window.scroll(function () {
                    var y = $window.scrollTop();
                    if (y > top) {
                        $this.addClass(floatingClass);
                        if (y > bottom) {
                            $this.removeClass(floatingClass).addClass(pinnedBottomClass);
                        } else {
                            $this.removeClass(pinnedBottomClass);
                        }
                    } else {
                        $this.removeClass(floatingClass);
                    }
                });
            }
        });
    };
})(jQuery);



