/*
-------------------------------------------------------------------------------------------------
	[common.js] JavaScript
-------------------------------------------------------------------------------------------------
	copyright          : Lampros co.,Ltd.
	author             : Atsushi Umehara
	making day         : 2010-06-23
*/


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

common

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

jQuery(function($) {


	var overImg = '_f2';

	// current hilite
	var path = document.URL;
	var filename = path.substring( path.lastIndexOf("/") + 1, path.length );
	if(filename.indexOf("#") != -1){
		filename = filename.substring( 0,filename.lastIndexOf("#") );
	}
	if(filename == "") filename = "index.html";
	$('#menuArea a[href*="' + filename + '"] img').each(function(){
		var imgout = $(this).attr("src");
		var imgovr = imgout.replace('.jpg', overImg + '.jpg');
		$(this).attr("src", imgovr);
		$(this).removeClass('btn');
	});

	// rolloveer
	$('.btn').each(function(){
		var classes = $(this).attr("class");
		var imgout = $(this).attr("src");
		var imgovr = imgout.replace('.gif', overImg + '.gif').replace('.jpg', overImg + '.jpg').replace('.png', overImg + '.png');
		$(this).hover(
			function(){ $(this).attr("src", imgovr); },
			function(){ $(this).attr("src", imgout); }
		);
	});

	//odd even
	$('ul').each(function(){
		$(this).find('li:first').addClass('first');
		$(this).find('li:odd').addClass('odd');
		$(this).find('li:even').addClass('even');
		$(this).find('li:last').addClass('last');
	});
	$('table').each(function(){
		$(this).find('tr:first').addClass('first');
		$(this).find('tr:odd').addClass('odd');
		$(this).find('tr:even').addClass('even');
		$(this).find('tr:last').addClass('last');
	});
	
});


