// JavaScript Document
function alertDelete(url) {
	
	if (window.confirm('Are you sure you want to Delete this item?')) {
		location = url;
	}
}


function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function reOrderMenu(id, url) {
	
	m = document.getElementById(id);
	list = '';
	// check li id names
	for (var i in m.childNodes) {
		s = m.childNodes[i];
		if (s.id)
			list += s.id + '-';
	}
	
	// got order page
	
	location = (url + '&order=order_menu&reorderlist=' + list);
	
}

function clearInput(id) {
	gId = document.getElementById(id);
	if (gId) {
	
		gId.value = '';
		
	}
}