$(document).ready(function(){

	$("#index #emer img,#floor img,#gui_acce .linkBtn img,.class_contents a img,#gui_bus .linkBtn a img,#next_month img,#current_month img,.hos_contents #zu img").hover(
		function(){
			this.src = this.src.replace('off.','on.');
		},
		function(){
			this.src = this.src.replace('on.','off.');
		}
	);
	
	
	$(".navi .open").click(
		function(){

			if( $(this).next().css('display') == 'none' ) {
				$(".navi ul").each( function() {
					if( $(this).css('display') == 'block' ) $(this).css('display', 'none');
				});
			}
			$(this).next().css('display', 'block');
		}
	);

	$(".class_contents h5").click(
		function(){

			if( $(this).next().css('display') == 'none' ) {
				$(".class_contents .class_box").each( function() {
					if( $(this).css('display') == 'block' ) $(this).css('display', 'none');
				});
			}
			$(this).next().css('display', 'block');
		}
	);
  
  	$(".class_contents .line_box h5").hover(
		function(){
			$(this).css('color','#AB6866');
		},
		function(){
			$(this).css('color','#595757');
		}
	);
	
	$("#hos h5").hover(
		function(){
			var id = '#'+$(this).attr('class').replace('a','p');
			$("#view dl").each( function() {
				if( $(this).css('display') == 'block' ) {
					$(this).css('display','none');
				}
			});
			$(id).css('display','block');
		},
		function(){
			$("#view dl").each( function() {
				if( $(this).css('display') == 'block' ) {
					$(this).css('display','none');
				}
			});
		}
	);




/*
	SCROLL_HDL = null;
	$(".sc-up").mouseup(
		function(){
			clearInterval(SCROLL_HDL);
		}
	);
	$(".sc-up").mousedown(
		function(){
			id = '#'+$(this).attr('id').replace('-up','');
			SCROLL_HDL = setInterval( "scrollup('"+id+"')", 100 );
		}
	);

	$(".sc-dn").mouseup(
		function(){
			clearInterval(SCROLL_HDL);
		}
	);
	$(".sc-dn").mousedown(
		function(){
			id = '#'+$(this).attr('id').replace('-dn','');
			SCROLL_HDL = setInterval( "scrolldown('"+id+"')", 100 );
		}
	);
	$(".sc-up, .sc-dn").hover(
		function(){},
		function(){
			clearInterval(SCROLL_HDL);
		}
	);
*/
	$(".sc-up").mouseup(
		function(){
			scrollup('#'+$(this).attr('id').replace('-up',''));
		}
	);
	$(".sc-dn").mouseup(
		function(){
			scrolldown('#'+$(this).attr('id').replace('-dn',''));
		}
	);


	$(".hovImg").hover(
		function(){
			this.src = this.src.replace('off.','on.');
		},
		function(){
			this.src = this.src.replace('on.','off.');
		}
	);

	$(".newWindow").click(
		function(){
			window.open(this.href); return false;
		}
	);

	$(".backBtn").click(
		function(){
			history.back(); return false;
		}
	);

	$(".topBtn").click(
		function(){
			$("html,body").animate({ scrollTop: 0 }, 500); return false;
		}
	);

});

function scrolldown( id ) {
			pos = $(id).attr('scrollTop');
			pos += 10;
			$(id).attr('scrollTop',pos);
}
function scrollup( id ) {
			pos = $(id).attr('scrollTop');
			pos -= 10;
			$(id).attr('scrollTop',pos);
}
