function check(err_not_fill, err_email, err_email_confirm)

{

 if (document.all.name.value==''){

    alert(err_not_fill);

    document.all.name.focus();

    exit();

    }

 if (document.all.surname.value==''){

    alert(err_not_fill);

    document.all.surname.focus();

    exit();

    }

 if (document.all.address.value==''){

    alert(err_not_fill);

    document.all.address.focus();

    exit();

    }

 if (document.all.email.value==''){

    alert(err_not_fill);

    document.all.email.focus();

    exit();

    }

 if((document.all.email.value.indexOf('@') == -1) || (document.all.email.value.indexOf('@') == -1)){

    alert(err_email);

    document.all.email.focus();

    exit();

    }

 if (document.all.email.value!=document.all.confirm_email.value){

    alert(err_email_confirm);

    document.all.email.focus();

    exit();

    }

 if (document.all.letter.value==''){

    alert(err_not_fill);

    document.all.letter.focus();

    exit();

    }

 document.form1.submit();

 }
 
 function TickAll(){
	tot=document.forms.form1.company.length;
	if(isNaN(tot)){
		BoxObj=document.forms.form1.company;
		BoxObj.checked = true;
	}else{
		for(counter=0;counter<tot;counter++){
			BoxObj=document.forms.form1.company[counter];
			BoxObj.checked = true;
		}
	}
}

function UnTickAll(){
	tot=document.forms.form1.company.length;
	if(isNaN(tot)){
		BoxObj=document.forms.form1.company;
		BoxObj.checked = false;
	}else{
		for(counter=0;counter<tot;counter++){
			BoxObj=document.forms.form1.company[counter];
			BoxObj.checked = false;
		}
	}
}


function SetUnsetAllCheckBoxes(FormName, FieldName, CheckControlFieldName, OtherCheckControlFieldName)
{
	if(!document.forms[FormName])
		return;
	var objCheckBoxes = document.forms[FormName].elements[FieldName];
	if(!objCheckBoxes)
		return;
	var objCheckControl = document.forms[FormName].elements[CheckControlFieldName];
	if(!objCheckControl)
		return;
	var countCheckBoxes = objCheckBoxes.length;
	if(document.forms[FormName].elements[CheckControlFieldName].checked == false)
     {
		for(var i = 0; i < countCheckBoxes; i++)
			objCheckBoxes[i].checked = false;
		document.forms[FormName].elements[OtherCheckControlFieldName].checked = false ;
     }
	else
		// set the check value for all check boxes
     {
		for(var i = 0; i < countCheckBoxes; i++)
			objCheckBoxes[i].checked = true;
		document.forms[FormName].elements[OtherCheckControlFieldName].checked = true ;
     }
}

