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

Description: init /index.html
Update: 2010/06/25-
Author: Japan Electronic Industrial Arts Co.Ltd.
        http://jeia.co.jp/

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

new function() {
	
	if ( typeof jQuery == 'undefined' ) {
		return;
	}
	
	$(document).ready( function() {
		init();
	});
	
	/**
	 * init
	 */
	function init() {
		
		// service
		$( '#service_list .service_element' ).
		hover( overServiceElement, outServiceElement );
	}
	
	/**
	 * rollover/out service_element
	 */
	var reverseClass = 'reverse';
	
	// over
	function overServiceElement( _e ) {
		
		var w = $(this).find( '.box .data' ).width();
		var h = $(this).find( '.box .data' ).height();
		
		$(this).find( '.box' ).stop().
		addClass( reverseClass ).
		css({
			backgroundColor: '#FFFFFF'
		}).
		animate({
			width: (w + 40) + 'px',
			height: (h + 40) + 'px',
			top: '-20px',
			left: '-20px',
			backgroundColor: '#000000'
		}, 160, 'linear' );
	}
	// out
	function outServiceElement( _e ) {
		
		var w = $(this).find( '.box .data' ).width();
		var h = $(this).find( '.box .data' ).height();
		
		$(this).find( '.box' ).stop().
		removeClass( reverseClass ).
		animate({
			width: w + 'px',
			height: h + 'px',
			left: '0px',
			top: '0px',
			backgroundColor: '#FFFFFF'
		}, 160, 'linear', function() {
			$(this).css({
				backgroundColor: 'transparent'
			});
		});
	}
}

