var name = "#floatMenu";
var menuYloc = null;
var defaultTopOffset = 144;

$(function(){
	setTimeout(init,100);
}); 

function init(){
	
	$('.zoom').fancyzoom({Speed:200,showoverlay:true,overlay:5/10});
	//menuYloc = parseInt($(name).css("top").substring(0,$(name).css("top").indexOf("px")))
	
	$('#floatmenulink a').each(function(){
		$(this).parent().find('.swfarrow').height($(this).height());
	});

	var off = $("#float-cont").offset();
	menuYloc =  off.top;
	
	$(name).css('position','absolute');
	$(name).css('top', off.top+'px');
	$(name).css('left',off.left+'px');
	
	$(window).scroll(function (){
		nameOFF = $(name).offset();
		offset = Math.max( defaultTopOffset,$(document).scrollTop() )+"px";
		floatlimit = $(document).scrollTop()+$(name).height();
		limit = $(".footer:first").offset().top;
		if( floatlimit <= limit){
			$(name).animate({top:offset},{duration:1000,queue:false});
		}
	});
	
	$(name).css({top:defaultTopOffset});
	
	$(window).resize(function(){var o = $('#float-cont').offset();$(name).css('left',o.left+'px')});

	function thisMovie(movieName) {
		if (navigator.appName.indexOf("Microsoft") != -1) {
			return window[movieName];
		}	
		else {	
			return document[movieName];
		}
	}
	
	
		$('#floatmenulink a').hover(function(){
		var s=$(this).attr('id');
		thisMovie("f"+s.substring(1,s.length)).hover();
		},function(){
		var s=$(this).attr('id');
		thisMovie("f"+s.substring(1,s.length)).out();
		});
}
