/*
======== table of content. =================================

Description: init page ( /service/web/index.html )
Update: 2010/06/16-
Author: Japan Electronic Industrial Arts Co.Ltd.
        http://jeia.co.jp/

============================================================
*/

new function() {
	
	if ( typeof jQuery == 'undefined' ) {
		return;
	}
	
	$(document).ready( function() {
		init();
	});
	
	/**
	 * 初期化
	 */
	function init() {
		
		// process
		var $processes = $( '#process_list .process_element' );
		
		$processes.each( function() {
			
			$(this).find( 'commentbox' ).css({ 'display': 'block' }).hide();
			
			$(this).bind( 'mouseenter', function(_e) {
				var  $box = $(this).find( '.commentbox' );
				
				if ( typeof DD_belatedPNG != 'undefined' ) {
					DD_belatedPNG.fixPng( $box.get(0) );
				}
				
				$box.css({
					'opacity': 0,
					'bottom': $(this).height() - 60
				}).show();
				
				$box.animate({
					'opacity': 1,
					'bottom': $(this).height() - 40
				}, 400, 'swing' );
			}).
			bind( 'mouseleave', function(_e) {
				var $box = $(this).find( '.commentbox' );
				
				$box.fadeOut();
			});
		});
		
		
		// service list
		var $services = $( '#service_list .service_element' );
		
		$services.each( function() {
			$(this).find( '.link a' ).hover( function(_e) {
				$(this).parent().parent().
				addClass( 'hover' ).
				css( { 'backgroundColor' : '#FFFFFF' } ).
				animate( { 'backgroundColor' : '#000000' }, 300 );
			},
			function(_e) {
				$(this).parent().parent().
				removeClass( 'hover' ).stop().css( { 'backgroundColor': 'transparent' } );
			});
		});
		
		
	}
}

