var scroll_handler = 0;
var scroll_dir = 0;
var scroll_2up = function(){ if(!scroll_handler) { scroll_dir=-5; scroll_handler = window.setInterval(scroll_step,60); } }
var scroll_2down = function(){ if(!scroll_handler) { scroll_dir=5; scroll_handler = window.setInterval(scroll_step,60); } }
var scroll_stop  = function(){ if(scroll_handler) { window.clearInterval(scroll_handler); scroll_handler = 0; } }
var scroll_step  = function() {
	if (!scroll_handler) return;
	var avail_height = jQuery("#scroll")[0].scrollHeight;
	var child_height = jQuery("#scroll .scroll_content")[0].scrollHeight;
	var d = jQuery("#scroll .scroll_content");
	var offset = parseInt( d.css("margin-top") );
	if (
(scroll_dir < 0 && offset < 0) ||
(scroll_dir > 0 && child_height + offset + 24 > avail_height)
   ) { d.css({ marginTop: offset - scroll_dir }); } else scroll_stop();
}
jQuery(function(){
	jQuery("#arrows #scroll_top").show();
	jQuery("#arrows #scroll_down").show();
	jQuery("#scroll .scroll_content").css({marginTop:0});
//            jQuery("#scroll_top").mousedown(function(){ jQuery("#scroll .scroll_content").css({marginTop:0}) });
	jQuery("#scroll_top").mouseup(scroll_stop).mouseout(scroll_stop).mousedown(scroll_2up);
	jQuery("#scroll_down").mouseup(scroll_stop).mouseout(scroll_stop).mousedown(scroll_2down);



	var hotspot1 = jQuery(".hotspot_1 .hotspot_2_td_1 table");
	if (jQuery("a", hotspot1).length != 0) {
		jQuery(hotspot1).css({'cursor': 'pointer'});
		jQuery(hotspot1).click(function() {
			location.href = jQuery("a", hotspot1).eq(0).attr('href')
		});
	}

	var hotspot2 = jQuery(".hotspot_1 .hotspot_2_td_2 table");
	if (jQuery("a", hotspot2).length != 0) {
		jQuery(hotspot2).css({'cursor': 'pointer'});
		jQuery(hotspot2).click(function() {
			location.href = jQuery("a", hotspot2).eq(0).attr('href')
		});
	}

	var hotspot3 = jQuery(".hotspot_1 .hotspot_2_td_3 table");
	if (jQuery("a", hotspot3).length != 0) {
		jQuery(hotspot3).css({'cursor': 'pointer'});
		jQuery(hotspot3).click(function() {
			location.href = jQuery("a", hotspot3).eq(0).attr('href')
		});
	}

	var hotspot4 = jQuery("#header .top_hotspot").eq(0);
	if (jQuery("a", hotspot4).length != 0) {
		jQuery(hotspot4).css({'cursor': 'pointer'});
		jQuery(hotspot4).click(function() {
			location.href = jQuery("a", hotspot4).eq(0).attr('href')
		});
	}

	var hotspot5 = jQuery("#header .top_hotspot").eq(1);
	if (jQuery("a", hotspot5).length != 0) {
		jQuery(hotspot5).css({'cursor': 'pointer'});
		jQuery(hotspot5).click(function() {
			location.href = jQuery("a", hotspot5).eq(0).attr('href')
		});
	}
});


