// JavaScript Document


function checkForm(){
	var errorMessage = "";
	var errorCount = 0;
	if(document.getElementById('firstname').value == ""){
		errorMessage = errorMessage + "First Name field must not blank\n";
		errorCount++;
	}
	if(document.getElementById('lastname').value == ""){
		errorMessage =  errorMessage + "Last Name field must not blank\n";
		errorCount++;
	}
	if(document.getElementById('email').value == ""){
		errorMessage =  errorMessage + "Email field must not blank\n";
		errorCount++;
	}
	if(document.getElementById('workphone').value == ""){
		errorMessage =  errorMessage + "Telephone field must not blank\n";
		errorCount++;
	}
	if (errorCount > 0){
		alert("There are " + errorCount + " Errors in form, Remove all error before submit form\n\n" +  errorMessage );
		return false;
	}
}

function ShowHideWhatOutcome(){
	var listsVal = document.getElementById('WhatOutcome').value;
	var DivOther1 = document.getElementById('divPurposeofAssetSale');
	var DivOther2 = document.getElementById('divPurposeofValuation');

	if(listsVal == "Sell Assets"){
	DivOther1.style.display = "block";
		DivOther2.style.display = "none";
	}else{
		DivOther1.style.display = "none";
		DivOther2.style.display = "block";
	}
}
function ShowHideOtherAssetType(){
	var listsVal = document.getElementById('AssetType').value;
	var DivOther = document.getElementById('OtherAssetType');
	if(listsVal == "Other"){
		DivOther.style.display = "block";
	}else{
		DivOther.style.display = "none";
	}
}

function ShowHidePurposeofAssetSale(){
	var listsVal = document.getElementById('PurposeofAssetSale').value;
	var DivOther = document.getElementById('OtherPurposeofAssetSale');
	if(listsVal == "Other"){
		DivOther.style.display = "block";
	}else{
		DivOther.style.display = "none";
	}
}

function ShowHidePurposeofValuation(){
	var listsVal = document.getElementById('PurposeofValuation').value;
	var DivOther = document.getElementById('OtherPurposeofValuation');
	if(listsVal == "Other"){
		DivOther.style.display = "block";
	}else{
		DivOther.style.display = "none";
	}
}

function ShowHideOwnerofAssets(){
	var listsVal = document.getElementById('OwnerofAssets').value;
	var DivOther = document.getElementById('OtherOwnerofAssets');
	if(listsVal == "Other"){
		DivOther.style.display = "block";
	}else{
		DivOther.style.display = "none";
	}
}
