            
/* This script and many more are available free online at
The JavaScript Source!! http://javascript.internet.com
Created by: Konstantin Jagello | http://javascript-array.com/ */

var TimeOut         = 300;
var currentLayer    = null;
var currentitem     = null;
var currentLayerNum = 0;
var noClose         = 0;
var closeTimer      = null;

function mopen(n) {
  var l  = document.getElementById("menu"+n);
  var mm = document.getElementById("mmenu"+n);
	
  if(l) {
    mcancelclosetime();
    l.style.visibility='visible';
    if(currentLayer && (currentLayerNum != n))
      currentLayer.style.visibility='hidden';
    currentLayer = l;
    currentitem = mm;
    currentLayerNum = n;			
  } else if(currentLayer) {
    currentLayer.style.visibility='hidden';
    currentLayerNum = 0;
    currentitem = null;
    currentLayer = null;
 	}
}

function mclosetime() {
  closeTimer = window.setTimeout(mclose, TimeOut);
}

function mcancelclosetime() {
  if(closeTimer) {
    window.clearTimeout(closeTimer);
    closeTimer = null;
  }
}

function mclose() {
  if(currentLayer && noClose!=1)   {
    currentLayer.style.visibility='hidden';
    currentLayerNum = 0;
    currentLayer = null;
    currentitem = null;
  } else {
    noClose = 0;
  }
  currentLayer = null;
  currentitem = null;
}

document.onclick = mclose; 


window.onload = function() {   
    //画像のプリロード   
    //MM_preloadImages('/common/img/btn_clear_on.gif','/common/img/btn_check_on.gif','/common/img/btn_retry_on.gif','/common/img/btn_send_on.gif');   
    if ( document.getElementById("btn2") ) {   
        with(document) {   
            getElementById("btn2").disabled = true;   
            getElementById("btn2").setAttribute("src","img/btn_check_off.gif");   
            getElementById("no").onclick = function() { bt_transrate(this,"btn2"); }   
            getElementById("yes").onclick = function() { bt_transrate(this,"btn2"); }   
        }   
        if ( document.getElementById("yes").checked ) {   
            bt_transrate(document.getElementById("yes"),"btn2");   
        }   
    }   
}   
  
function bt_transrate(obj,inp) {   
    var radioBT = obj.value;   
    var subBT = document.getElementById(inp);   
    if ( radioBT == "yes" ) {   
        with(document) {   
            subBT.disabled = false;   
            subBT.setAttribute("src","img/btn_check_on.gif");   
        }   
        return true;   
    }   
    if ( radioBT == "no" ) {   
        with(document) {   
            subBT.disabled = true;   
            subBT.setAttribute("src","img/btn_check_off.gif");   
        }   
        return true;   
    }   
}  
window.onload = function() {
	//画像のプリロード
	//MM_preloadImages('/common/img/btn_clear_on.gif','/common/img/btn_check_on.gif','/common/img/btn_retry_on.gif','/common/img/btn_send_on.gif');
	if ( document.getElementById("btn2") ) {
		with(document) {
			getElementById("btn2").disabled = true;
			getElementById("btn2").setAttribute("src","img/btn_check_off.gif");
			getElementById("no").onclick = function() { bt_transrate(this,"btn2"); }
			getElementById("yes").onclick = function() { bt_transrate(this,"btn2"); }
		}
		if ( document.getElementById("yes").checked ) {
			bt_transrate(document.getElementById("yes"),"btn2");
		}
	}
}

function bt_transrate(obj,inp) {
	var radioBT = obj.value;
	var subBT = document.getElementById(inp);
	if ( radioBT == "yes" ) {
		with(document) {
			subBT.disabled = false;
			subBT.setAttribute("src","img/btn_check_on.gif");
		}
		return true;
	}
	if ( radioBT == "no" ) {
		with(document) {
			subBT.disabled = true;
			subBT.setAttribute("src","img/btn_check_off.gif");
		}
		return true;
	}
}

HTML


          
