
function confirmAdd(){
	var agree=confirm("By adding a submenu to this button the link in this button will disappear ");
	if (agree)
		return true ;
	else
		return false ;
}

function confirmDelete(){
	var agree=confirm("Are you sure you want to delete this");
	if (agree)
		return true ;
	else
		return false ;
}

function errorDelete(){
	var agree=alert("Can't Delete, the menu is not empty");
	if (agree)
		return true ;
	else
		return false ;
		}
function confirmRestore(){
	var agree=confirm("All the changes will be deleted, Are you sure?");
	if (agree)
		return true ;
	else
		return false ;
		}
	
function disableIt(obj)
{
	obj.disabled = !(obj.disabled);
	var z = (obj.disabled) ? 'disabled' : 'enabled';
	//alert(obj.type + ' now ' + z);
}

function securityCheck(){
		
		var xmlHttp;
		var lijst = document.getElementById ('autoResult');
		try{
			// Firefox, Opera 8.0+, Safari
			xmlHttp=new XMLHttpRequest ();
			}
		catch (e){
			// Internet Explorer
			try{
				xmlHttp=new ActiveXObject ("Msxml2.XMLHTTP");
				}
			catch (e){
				try{
					xmlHttp=new ActiveXObject ("Microsoft.XMLHTTP");
					}
				catch (e){
					alert ("Your browser does not support AJAX!");
					return false;
				}
			}
		}
		xmlHttp.onreadystatechange=function (){
			if (xmlHttp.readyState == 4)
				{
				lijst.display = '';
				lijst.innerHTML =xmlHttp.responseText;
				//alert(xmlHttp.responseText);
				}
			}
		var get = document.getElementById('Beveilings Code').value;
		if (get.length > 3) {
			//alert("lengte is groter dan 0");
			xmlHttp.open ("GET", "/assets/includes/securityCheck.php?value=" + get, true);
			
			xmlHttp.send (null);
			}
		else {
			lijst.display = 'none';
			lijst.innerHTML = '';
		}
	}