//<![CDATA[

function httpHandler_conf(){
	if(xmlhttp_conf.readyState == 4 && xmlhttp_conf.status== 200) {
		document.getElementById("bottom_display_design").innerHTML = xmlhttp_conf.responseText;
	}
}

function display_login_menu_conf(num) {
	var url_conf = "../php/request_send_conf.php";

	var iv1_elm = document.getElementById("input_value1");
	if (iv1_elm) {var iv1_vl = document.getElementById("input_value1").value;}

	var iv2_elm = document.getElementById("input_value2");
	if (iv2_elm) {var iv2_vl = document.getElementById("input_value2").value;}

	var iv3_elm = document.getElementById("input_value3");
	if (iv3_elm) {var iv3_vl = document.getElementById("input_value3").value;}

	var iv4_elm = document.getElementById("input_value4");
	if (iv4_elm) {var iv4_vl = document.getElementById("input_value4").value;}

	var iv5_elm = document.getElementById("input_value5");
	if (iv5_elm) {var iv5_vl = document.getElementById("input_value5").value;}

	var iv6_elm = document.getElementById("input_value6");
	if (iv6_elm) {var iv6_vl = document.getElementById("input_value6").value;}

	var data_by_post_conf = "displogin_code=" + 818 + "&menu_code=" + num + "&iv1=" + iv1_vl + "&iv2=" + iv2_vl + "&iv3=" + iv3_vl + "&iv4=" + iv4_vl + "&iv5=" + iv5_vl + "&iv6=" + iv6_vl;

	if (document.uniqueID ) {
		xmlhttp_conf = new ActiveXObject("Microsoft.XMLHTTP");
	} else {
		xmlhttp_conf = new XMLHttpRequest();
	}

	xmlhttp_conf.onreadystatechange = httpHandler_conf;
	xmlhttp_conf.open("POST", url_conf);
	xmlhttp_conf.setRequestHeader("Content-Type" , "application/x-www-form-urlencoded");
	xmlhttp_conf.send(data_by_post_conf);

}

function conf_btn() {
	display_login_menu_conf(current_login_menu_num);
}

function httpHandler(){
	if(xmlhttp.readyState == 4 && xmlhttp.status== 200) {
		document.getElementById("bottom_display_design").innerHTML = xmlhttp.responseText;
	}
}

function display_login_menu(num) {
	var url = "../php/disp_login_menu.php";
	var data_by_post = "displogin_code=" + 817 + "&menu_code=" + num;

	if (document.uniqueID ) {
		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	} else {
		xmlhttp = new XMLHttpRequest();
	}

	xmlhttp.onreadystatechange = httpHandler;
	xmlhttp.open("POST", url);
	xmlhttp.setRequestHeader("Content-Type" , "application/x-www-form-urlencoded");
	xmlhttp.send(data_by_post);

}

function lmc(num) {
	var current_login_menu = document.getElementById("lm" + current_login_menu_num + "_on");
	current_login_menu.id = "lm" + current_login_menu_num + "_off";

	var current_login_ttl = document.getElementById("lm_ttl_" + current_login_menu_num + "_on");
	current_login_ttl.id = "lm_ttl_" + current_login_menu_num + "_off";

	var new_login_menu = document.getElementById("lm" + num + "_off");
	new_login_menu.id = "lm" + num + "_on";

	var new_login_ttl = document.getElementById("lm_ttl_" + num + "_off");
	new_login_ttl.id = "lm_ttl_" + num + "_on";

	current_login_menu_num = num;
	display_login_menu(num);

}

function erase_msg(num) {
	if (num == 6) {
		var is_iv6_elm = document.getElementById("input_value" + num + "_er");
		if (is_iv6_elm) {
			var erase_field = document.getElementById("input_value" + num + "_er");
		} else {
			var erase_field = document.getElementById("input_value" + num);
		}

/*		var textNode = erase_field.childNodes[0].nodeValue;
		alert (textNode);
		var blanktextNode = "1";
		erase_field.appendChild(blanktextNode);
		erase_field.childNodes[0].nodeValue = "1";
		erase_field.replaceChild(blanktextNode, textNode);
		erase_field.childNodes[0].removeChild(textNode);
*/
		erase_field.id = "input_value" + num;
		erase_field.onclick = dummy();

	} else {
		var erase_field = document.getElementById("input_value" + num + "_er");
		erase_field.value = "";
		erase_field.id = "input_value" + num;
		erase_field.onclick = dummy();
	}

}

function dummy() {}

function first_load() {
	display_login_menu(1);
}

function loginBtn() {
	var pwd_value = document.getElementById("pazwd_fld");
	var p_code_analys = viewing_counts + pwd_value.value;

	var md5cs = document.getElementById("cs");
	md5cs.value = MD5_hexhash(p_code_analys);

	pwd_value.value = "";

	document.login_form.submit();
	return true;
}

addListener(window, "load", first_load, false);
//]]>
