// ajax
function ajaxFunction(element_id, path) {

	var ajaxRequest;

	try {
		ajaxRequest = new XMLHttpRequest();
	} catch (e) {
		try {
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {
				alert("Your browser does not support JavaScript!");
				return false;
			}
		}
	}

	ajaxRequest.onreadystatechange = function() {
		if (ajaxRequest.readyState == 4) {
			var ajaxDisplay = document.getElementById(element_id);
			ajaxDisplay.innerHTML = ajaxRequest.responseText;
		}
	}

	ajaxRequest.open("GET", path, true);
	ajaxRequest.send(null);

}

// tabs switch
function tbswitch(id, num) {

    for (i = 0; i < num; i++) {

        var tb = document.getElementById("tb_" + i);
        var tc = document.getElementById("tc_" + i);
        
        if (i == id) {
            tb.className = "tab_switch_but_on";
            tc.style.display = "block";

            if(i==4) { map_onload(); }
            
        } else {
            tb.className = "tab_switch_but";
            tc.style.display = "none";
        }
    }
}

// login box top
function login_tbox_sw() {
	
	var log_box = document.getElementById("login_box_top");
	var but_login = document.getElementById("but_login_top");
	
	if(log_box.style.display == "block") {
		log_box.style.display = "none";
		but_login.setAttribute("class", "but_login_top_off");
	} else {
		log_box.style.display = "block";
		but_login.setAttribute("class", "but_login_top_on");
	}
	
}
