// menu fixed onscroll
$("document").ready(function($){
var nav = $('#header');    
$(window).scroll(function () {
        if ($(this).scrollTop() > 100) {
            nav.addClass("smaller");
        } else {
            nav.removeClass("smaller");
        }
    });
$(".fadehover img.a").hover(
	function() {
		//$(this).stop().animate({"opacity": "0"}, "fast");
		$(this).hide();
	},
	function() {
		//$(this).stop().animate({"opacity": "1"}, "fast");
		$(this).show();
	});
});
function MM_openBrWindow(theURL,winName,features){  
 	window.open(theURL,winName,features);
}
function scrollto(anc){  
     target = $(anc);  
     $('html, body').animate({  
         scrollTop: target.offset().top  
     }, 1000);  
};
(function(){var special=$.event.special,uid1='D'+(+new Date()),uid2='D'+(+new Date()+1);special.scrollstart={setup:function(){var timer,handler=function(evt){var _self=this,_args=arguments;if(timer){clearTimeout(timer)}else{evt.type='scrollstart';$.event.handle.apply(_self,_args)}timer=setTimeout(function(){timer=null},special.scrollstop.latency)};$(this).bind('scroll',handler).data(uid1, handler)},teardown:function(){$(this).unbind('scroll',$(this).data(uid1))}};special.scrollstop={latency:300,setup:function(){var timer,handler=function(evt){var _self=this,_args=arguments;if(timer){clearTimeout(timer)}timer=setTimeout(function(){timer=null;evt.type='scrollstop';$.event.handle.apply(_self, _args)},special.scrollstop.latency)};$(this).bind('scroll',handler).data(uid2,handler)},teardown:function(){$(this).unbind('scroll',jQuery(this).data(uid2))}}})()
$(function(){
   $('div.top>a').click(function(e){$('html,body').animate({scrollTop:'0px'},800);return false})
   $(window).scroll(function(){if($(this).scrollTop()>100){$('div.top').fadeIn()}else{$('div.top').fadeOut()}})
   init_events();
});
function init_events(){
	$('a.scrolltop').click(function(e){$('html,body').animate({scrollTop:'0px'},800);return false});
}
function AlertConfirm(url,msg) {
	doConfirm = confirm(msg);
	if (doConfirm == true) { 
		window.location = url;  
	} else {
		return;
	}
}

function audio_play_pause(id) {
  var myAudio = document.getElementById(id);
  if (myAudio.paused) {
    myAudio.play();
  } else {
    myAudio.pause();
  }
}