var onLoad = [];
function addOnLoad(func) {
	onLoad[onLoad.length] = func;
}

var menuload = function () {
	if ($.browser.msie && parseInt(jQuery.browser.version) < 8 )
		$('#hmenu li').each(function() {
			$(this).hover(function() {
				this.className+=" iehover";
			}, function() {
				this.className=this.className.replace(new RegExp(" iehover\\b"), "");
			});
		});
}

function topButton() {
	if (window.innerHeight && window.scrollMaxY) {
		yWithScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ 
		yWithScroll = document.body.scrollHeight;
	} else { 
		yWithScroll = document.body.offsetHeight;
	}
	if(yWithScroll > (document.documentElement.clientHeight||document.body.clientHeight||document.body.scrollHeight) ) {
		$('#topbutton').css('display','block');
		$('#topbutton > img').click(function() {
			window.scrollTo(0, 0);
		});
	}else{
		$('#topbutton').css('display','none');
	}
}
topButtonDecor = function(){topButton();}
addOnLoad(topButtonDecor);
addOnLoad(menuload);

$(document).ready(function() {
    jQuery('#mv_hd').cycle();
    for(func in onLoad)
	onLoad[func]();
var lbOptions = {
imageLoading: siteAddr+'images/lightbox-ico-loading.gif',
imageBtnClose: siteAddr+'images/lightbox-btn-close.gif',
imageBtnPrev: siteAddr+'images/lightbox-btn-prev.gif',
imageBtnNext: siteAddr+'images/lightbox-btn-next.gif',
imageBlank: siteAddr+'images/lightbox-blank.gif'
};
    $('a[href^="'+siteAddr+'images/"]').lightBox(lbOptions);
});
