function toggle_visibility(id) {
       var e = document.getElementById(id);
       if(e.style.display == 'block')
          e.style.display = 'none';
       else
          e.style.display = 'block';
    }
function nameempty()
{
    if ( document.form.email.value == '' )
    {
        document.form.email.style.background='#FFD4D4';
        var valid = "no"
    }
    
    if ( document.form.signuppassword.value.length == '' )
    {
        document.form.signuppassword.style.background='#FFD4D4';
        var valid = "no"
    }
    if ( document.form.sector.value == 'null' )
    {
        document.form.sector.style.background='#FFD4D4';
        var valid = "no"
    }
    if ( document.form.title.value == 'null' )
    {
        document.form.title.style.background='#FFD4D4';
        var valid = "no"
    }
    if ( document.form.firstname.value == '' )
    {
        document.form.firstname.style.background='#FFD4D4';
        var valid = "no"
    }
    if ( document.form.surname.value == '' )
    {
        document.form.surname.style.background='#FFD4D4';
        var valid = "no"
    }
    if ( valid=="no")
    {
     	alert('Errors have been found in the form, please complete the indicated fields.')
        return false;
    }
}
function update() {
 	var limit = 100
   	var old = document.form.counter.value;
   	document.form.counter.value=document.form.reason.value.length;
   	if(document.form.counter.value > 100 && old <= limit) {
    	alert('Too much data in the text reason!\n Anything over 100 characters will not be sent!');
     	if(document.styleSheets) {
       		document.form.counter.style.fontWeight = 'bold';
       		document.form.counter.style.color = '#ff0000'; } 
	}
   	else if(document.form.counter.value <= 100 && old > 100 && document.styleSheets ) {
       document.form.counter.style.fontWeight = 'normal';
       document.form.counter.style.color = '#000000'; 
	} 
}