// ----------------------------------------------------------------
// スタイルシートを動的に変更するスクリプト
// ---------------------------------------------------------------- 

// ----------------------------------------------------------------
// ■JSONでスタイルシートのプロパティ値変更
// パラメータ説明
// id    : 変更したい要素のCSSのidを指定
// style : 変更したいスタイル(JSON)を指定
//          (例）以下の場合には styleに H2_JSON_L_OPEN と指定する
//          h2_JSON_L_OPEN = {
//	          "height":"32px",
//          	"background":"url(images/bg_h2longbox.gif) 0% 50% no-repeat #EFEFEF"
//          }
//          ※上記JSONの定義はHTMLまたはJavaScriptファイルに記述する
// ---------------------------------------------------------------- 
function chgJsonStyle(id, style){
	obj = document.getElementById(id);
	Element.setStyle($(obj), style);
}

// ----------------------------------------------------------------
// ■スタイルシートのプロパティ値変更
// パラメータ説明
// id    : 変更したい要素のCSSのidを指定
// style : 変更したいスタイルのプロパティ
//         (例）"height"
// value : 変更したい値
//         (例）"100px"
// ---------------------------------------------------------------- 
function chgStyle(obj, style, value){
	obj = document.getElementById(id);
	$(obj).style[style.camelize()] = value;
}

// ----------------------------------------------------------------
// ■スタイルシートのクラス値変更
// パラメータ説明
// i    : 変更したい要素のCSSのidを指定
// c    : 変更後のCSSのClassを指定
// ---------------------------------------------------------------- 
function chgClass(i, c){
	if(document.all){
		document.all(i).className = c;
	}
	else if(document.getElementById){
		document.getElementById(i).className = c; 
	}
}




