function delReg(module,id,ip) {
	if(confirm('Deseja realmente excluir este registro?')) {
		location.replace(module+'_del.php?id='+id+'&n='+ip);
	}
}

		function clearForm(form) {
		  $(':input', form).each(function() {
			var type = this.type;
			var tag = this.tagName.toLowerCase(); // normalize case
			if (type == 'text' || type == 'password' || tag == 'textarea')
			  this.value = "";
			else if (type == 'checkbox' || type == 'radio')
			  this.checked = false;
			else if (tag == 'select')
			  this.selectedIndex = 0;
		  });
		};

function validateMac(macaddr){
			if(macaddr == "") {
				return false;
			}
            var mac = macaddr.toLowerCase();
            var regex = /^[a-f0-9]{12}$/;  
            if( regex.test( mac ) ){
                return true;  
            }  
            else {  
                alert( "Digite um endereço MAC válido." );
				document.getElementById("mac_addr").focus();				
                return false;
            }  
}

		var formHelp = function() {
			return {
				init: function() {
					var $form = $('form');
					var tip = null;
					$(':text',$form).each(function(){
						$(this).bind('focus',function(){
							tip = document.createElement('span');
							
							$(this).after( $(tip).text( $(this).attr('hlp') ) );
						}).blur(function(){
							if (tip) {
								$(tip).remove();
								tip = null;
							}
						return;
					});
				});
		}}}();
