
//************************************* Attention **************************************
//
//   ドリーマブログのメニュー内検索メニューの幅とマージンを設定できるスクリプトです。
//
//********************************* DreamNet's Satake **********************************



function searchDetail( Menu1Name , Menu2Name , KeyWidth , ButtonWidth , ItemMargin ){

//メニューIDが入っていれば変数を設定
if ( Menu1Name != '' ){
	if(document.getElementById(Menu1Name)) {
		var menu1Forms = document.getElementById(Menu1Name).getElementsByTagName('input');
	}else{
		Menu1Name	= '';
	}
}
if ( Menu2Name != '' ){
	if(document.getElementById(Menu2Name)) {
		var menu2Forms = document.getElementById(Menu2Name).getElementsByTagName('input');
	}else{
		Menu2Name	= '';
	}
}

//メニュー１の検索窓
if ( Menu1Name != '' ){
for (var ai=0; ai<menu1Forms.length; ai++){
	if (menu1Forms[ai].name == 'sr_text'){
		menu1Forms[ai].style.width = KeyWidth + 'px';
	}
	else if (menu1Forms[ai].value == '検索'){
		menu1Forms[ai].style.width = ButtonWidth + 'px';
		menu1Forms[ai].style.marginLeft = ItemMargin + 'px';
	}
}
}

//メニュー２の検索窓
if ( Menu2Name != '' ){
for (var bi=0; bi<menu2Forms.length; bi++){
	if (menu2Forms[bi].name == 'sr_text'){
		menu2Forms[bi].style.width = KeyWidth + 'px';
	}
	else if (menu2Forms[bi].value == '検索'){
		menu2Forms[bi].style.width = ButtonWidth + 'px';
		menu2Forms[bi].style.marginLeft = ItemMargin + 'px';
	}
}
}

}
