function chk_find_contractor(con_form){
	if (con_form.title.value=='' ) {
		alert('Customer name is a required field.')
		return false;
    }
	if (con_form.businesstypeid.value==0 ) {
		alert('Waste type is a required field.')
		return false;
    }
	if (con_form.regionid.value==0 ) {
		alert('Region is a required field.')
		return false;
    }
	if (con_form.countyid.value==0 ) {
		alert('County is a required field.')
		return false;
    }
	if (con_form.description.value==0 ) {
		alert('Please enter a description, such as `Cardboard recycling in Norwich`.')
		return false;
    }
	return true;

}

function check_top_search_enquiry(top_form){
	if (top_form.name.value=='' ) {
		alert('Name is a required field.')
		return false;
    }
	if (top_form.company.value=='' ) {
		alert('Company is a required field.')
		return false;
    }
	if (top_form.email.value=='' ) {
		alert('Email is a required field.')
		return false;
    }
	return true;

}

function confirm_payment(payment){
	if (payment.checked == true){
		return true;
	}
	else {
		alert('Please tick box to confirm that you acknowledge fee for this item');
		return false;
	}
}


function confirm_non_payment(payment){
	if (payment.checked == true){
		return true;
	}
	else {
		alert('Please tick box to confirm that you accept free promotional registration');
		return false;
	}
}

function confirm_directory_entry(t_and_c,payment,homepage,previous_homepage) {
	if (confirm_t_and_c(t_and_c) && confirm_weblink(payment,homepage,previous_homepage)) {
		return true;
	}
	else {
		return false;
	}
}

function confirm_t_and_c(t_and_c){
	if (t_and_c.checked == true){
		return true;
	}
	else {
		alert('Please tick box to confirm that you have read the Subit Terms and Conditions');
		return false;
	}
}


function confirm_weblink(payment,homepage,previous_homepage) {
	if (homepage.value != previous_homepage.value && homepage.value != '' && payment.checked == false) {
		alert('Please tick box to confirm that you accept homepage fee');
		return false;
	}
	else {
		return true;
	}
}


function confirm_extend_notice(fee) {
	return confirm('Extending the notice incurs a fee of ' + fee + '.\n Please confirm you order.');
}


function confirm_extend_job(fee) {
	return confirm('Extending the job incurs a fee of ' + fee + '.\n Please confirm you order.');
}

function confirm_view_job(fee) {
	return confirm('Viewing this job incurs a fee of ' + fee + '.\n Please confirm you order.');
}

function checkAll() {
for (var j = 1; j <= 14; j++) {
box = eval("document.checkboxform.C" + j);
if (box.checked == false) box.checked = true;
   }
}

function uncheckAll() {
for (var j = 1; j <= 14; j++) {
box = eval("document.checkboxform.C" + j);
if (box.checked == true) box.checked = false;
   }
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_changeProp(objName,x,theProp,theValue) { //v6.0
  var obj = MM_findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
    if (theValue == true || theValue == false)
      eval("obj."+theProp+"="+theValue);
    else eval("obj."+theProp+"='"+theValue+"'");
  }
}

