var IE = document.all?true:false;
$J.fn.trimval = function() {
	return $J(this).val().toString().replace(/^\s+|\s+$/g,"");
};

$J(document).ready(function() {
	$J('.btn_over').mouseover(function(){
		$J(this).attr('src', $J(this).attr('src').toString().replace('.g','_over.g'));
    }).mouseout(function(){
		$J(this).attr('src', $J(this).attr('src').toString().replace('_over.g','.g'));
    });
	
	$J('table.whole_table').css('background-color', '#eaeaea');
	$J('table.whole_table').css('border', '#eaeaea solid 2px');
	
	$J('tr.background:even td').css('background-color', '#f8f8f8');
	$J('tr.background:odd td').css('background-color', '#f3f3f3');
	$J('tr.background td').css('border', '#d0d0d0 solid 1px');
	
	$J('td.input_td').css('background-color', '#f2f2f2');
	$J('td.input_td').css('border', '#d0d0d0 solid 1px');
	
	var current_dir = location.href.replace(/\/[^\/\.]*\.php.*/gi, '').match(/[^\/]*$/i);
	var current_page = location.href.match(/[^\/]*$/i).toString().replace(/\?.*$/i,'');
	$J('#topBtns a').each(function(){
		if($J(this).attr('href').search(current_dir) != -1){
			$J(this).replaceWith($J(this).html().replace('.g','_over.g'));
		}
	});
	$J('#topBtns1 a').each(function(){
		if($J(this).attr('href').search(current_dir) != -1){
			$J(this).replaceWith($J(this).html().replace('.g','_over.g'));
		}
	});
	$J('#topBtns2 a').each(function(){
		if($J(this).attr('href').search(current_dir) != -1){
			$J(this).replaceWith($J(this).html().replace('.g','_over.g'));
		}
	});
	$J('#topBtns3 a').each(function(){
		if($J(this).attr('href').search(current_dir) != -1){
			$J(this).replaceWith($J(this).html().replace('.g','_over.g'));
		}
	});
	$J('#topBtns4 a').each(function(){
		if($J(this).attr('href').search(current_dir) != -1){
			$J(this).replaceWith($J(this).html().replace('.g','_over.g'));
		}
	});
	$J('#topBtns5 a').each(function(){
		if($J(this).attr('href').search(current_dir) != -1){
			$J(this).replaceWith($J(this).html().replace('.g','_over.g'));
		}
	});
	$J('#topBtns6 a').each(function(){
		if($J(this).attr('href').search(current_dir) != -1){
			$J(this).replaceWith($J(this).html().replace('.g','_over.g'));
		}
	});
	$J('#topBtns7 a').each(function(){
		if($J(this).attr('href').search(current_dir) != -1){
			$J(this).replaceWith($J(this).html().replace('.g','_over.g'));
		}
	});

	$J('.subnavtext a').each(function(){
		if($J(this).attr('href').search(current_page) != -1){
			$J(this).parent().toggleClass("subnavtext_o");
			$J(this).replaceWith($J(this).html());
		}
	});
});
