
//
// テーブル行の背景色を変更する
// param rowObj   : 行のオブジェクト
//       chgColor : 変更する色(例. #FF90A0)
//
// return ture:
//        false:
//
function LC_setRowColor( rowObj, chgColor )
{
var theCells  = null;
var domDetect = null;

    // スタイル取得チェック
	if( typeof(rowObj.style) == 'undefined' )
	{
		return( false );
	}

	// 列オブジェクトの取得
	if( typeof( document.getElementsByTagName ) != 'undefined')		theCells = rowObj.getElementsByTagName('td');
	else if( typeof( rowObj.cells ) != 'undefined' )				theCells = rowObj.cells;
	else															return( false );

	// 色の設定方法を判定
	if( typeof(theCells[0].getAttribute) != 'undefined' )	domDetect = true;		// getAttribute() 使用可能
	else													domDetect = false;		// getAttribute() 使用不能

	// 変更色の設定
	if( chgColor != '' )
	{
		for( var c=0; c<theCells.length; c++ )
		{
			if( domDetect )	theCells[c].setAttribute( 'bgcolor', chgColor, 0 );
			else			theCells[c].style.backgroundColor = chgColor;
		}
	}

	return( true );
}


//
// テーブル列（フィールド）の背景色を変更する
// param rowObj   : 列（フィールド）オブジェクト
//       chgColor : 変更する色(例. #FF90A0)
//
// return ture:
//        false:
//
function LC_setColColor( colObj, chgColor )
{
var domDetect = null;


	// スタイル取得チェック
	if( typeof(colObj.style) == 'undefined' )
	{
		return( false );
	}

	// 色の設定方法を判定
	if( typeof(colObj.getAttribute) != 'undefined' )	domDetect = true;		// getAttribute() 使用可能
	else												domDetect = false;		// getAttribute() 使用不能

	// 変更色の設定
	if( chgColor != '' )
	{
		if( domDetect )	colObj.setAttribute( 'bgcolor', chgColor, 0 );
		else			colObj.style.backgroundColor = chgColor;
	}

	return( true );
}




// フォームのサブミットを行う
// param : fid フォームID
//
function LC_formSubmit( fid )
{
	g = document.getElementById( fid );
	g.submit();
}


//
// フレームチェック
// param cstr   : チェック用（比較用）ＵＲＬ
//
// return 
//
function LC_URLCheck( cstr )
{
	if( parent.location.href != cstr || parent.G_tmp != "INIT" )
	{
		 parent.location.href = cstr;
	}
}


// ラジオボタンの変更に伴う入力領域の有効・無効切替
// rname:ラジオボタン名
// rno:ラジオボタン数
// tname:ターゲットＩＤ
//
function LC_setAble( rname, rno, tid )
{
	fOBJ = document.sFORM;
	for( i=0; i<rno; i++ )
	{
		if( fOBJ[rname][i].checked )	fOBJ[tid+i].disabled = false;
		else							fOBJ[tid+i].disabled = true;
	}
}



// マウス位置(X)取得
//
function getMouseX( e )
{
	if( navigator.userAgent.search( "Opera(\ |\/)6" ) != -1 )	return e.clientX;								//o6用
	else if( document.all )										return document.body.scrollLeft+event.clientX;	//e4,e5,e6用
	else if( document.layers || document.getElementById )		return e.pageX;									//n4,n6,n7,m1,o7,s1用
}

// マウス位置(Y)取得
//
function getMouseY( e )
{
	if( navigator.userAgent.search( "Opera(\ |\/)6" ) != -1 )	return e.clientY;								//o6用
	else if( document.all )										return document.body.scrollTop+event.clientY;	//e4,e5,e6用
	else if( document.layers || document.getElementById )		return e.pageY;									//n4,n6,n7,m1,o7,s1用
}

