function list_data_over(id) {
	document.getElementById(id).className = 'item over';
}

function list_data_out(id) {
	document.getElementById(id).className = 'item';
}

function menu_over(id) {
	document.getElementById(id).className = 'item over';
}

function menu_out(id) {
	document.getElementById(id).className = 'item';
}

var active_accordion = "";
var active_accordion_item = "";

function closeActiveAccordion() {
	if (active_accordion != "") {
		document.getElementById(active_accordion).style.visibility = "hidden";
		document.getElementById(active_accordion).style.display = "none";
	}
}
function closeClickedItem(clicked){
	document.getElementById(clicked).style.visibility = "hidden";
	document.getElementById(clicked).style.display = "none";
}
function openClickedItem(clicked){
	if(active_accordion_item!=""){
		document.getElementById(active_accordion_item).style.visibility = "visible";
		document.getElementById(active_accordion_item).style.display = "block";
	}
}
function openAccordion(id) {
	closeClickedItem(id);
	openClickedItem();
	closeActiveAccordion();
	active_accordion = "date_detail_" + id;
	active_accordion_item  = id;
	document.getElementById(active_accordion).style.visibility = "visible";
	document.getElementById(active_accordion).style.display = "block";
}

function is_numeric(sText) {
	var ValidChars = "0123456789.";
	var IsNumber = true;
	var Char;

	for (i = 0; i < sText.length && IsNumber == true; i++) {
		Char = sText.charAt(i);
		if (ValidChars.indexOf(Char) == -1) {
			IsNumber = false;
		}
	}
	return IsNumber;

}

function numbersonly(e) {
	var unicode = e.charCode ? e.charCode : e.keyCode;
	if (unicode != 8) {
		if (unicode < 48 || unicode > 57)
			return false;
		else
			return true;
	}
}

function email_validate(str) {

	var at = "@"
	var dot = "."
	var lat = str.indexOf(at)
	var lstr = str.length
	var ldot = str.indexOf(dot)
	if (str.indexOf(at) == -1) {
		// alert("Invalid E-mail ID")
		return false
	}

	if (str.indexOf(at) == -1 || str.indexOf(at) == 0
			|| str.indexOf(at) == lstr) {
		// alert("Invalid E-mail ID")
		return false
	}

	if (str.indexOf(dot) == -1 || str.indexOf(dot) == 0
			|| str.indexOf(dot) == lstr) {
		// alert("Invalid E-mail ID")
		return false
	}

	if (str.indexOf(at, (lat + 1)) != -1) {
		// alert("Invalid E-mail ID")
		return false
	}

	if (str.substring(lat - 1, lat) == dot
			|| str.substring(lat + 1, lat + 2) == dot) {
		// alert("Invalid E-mail ID")
		return false
	}

	if (str.indexOf(dot, (lat + 2)) == -1) {
		// alert("Invalid E-mail ID")
		return false
	}

	if (str.indexOf(" ") != -1) {
		// alert("Invalid E-mail ID")
		return false
	}

	return true
}
