function formCheck(formobj){
	// Enter name of mandatory fields
	var fieldRequired = Array("CustomerName", "CustomerTelephone", "Customeremail", "DeliveryAddress", "DeliveryPostCode", "agree");
	// Enter field description to appear in the dialog box
	var fieldDescription = Array("Your Name", "Your Telephone Number", "Your Email", "Your Delivery Address", "Your Postal/Zip Code", "Accept our Terms and Conditions");
	// dialog message
	var alertMsg = "Please complete the following fields:\n";
	
	var l_Msg = alertMsg.length;
	
	for (var i = 0; i < fieldRequired.length; i++){
		var obj = formobj.elements[fieldRequired[i]];
		if (obj){
			switch(obj.type){
			case "checkbox":
				if (obj.checked == false){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			case "text":
			case "textarea":
				if (obj.value == "" || obj.value == null){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			default:
			}
			if (obj.type == undefined){
				var blnchecked = false;
				for (var j = 0; j < obj.length; j++){
					if (obj[j].checked){
						blnchecked = true;
					}
				}
				if (!blnchecked){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
			}
		}
	}

	if (alertMsg.length == l_Msg){
		return true;
	}else{
		alert(alertMsg);
		return false;
	}
}




// terms and conditions acceptance
//function checkCheckBox(f){
//if (f.agree.checked == false )
//{
//alert('You must click the box and accept our terms and conditions before you can proceed.');
//return false;
//}
//else
//return true;
//}



function addbookmark()
{
bookmarkurl="http://www.housedustmite.org/"
bookmarktitle="HouseDustMite.org, Asthma, Rhinitis, Eczema and Allergen avoidance help"
if (document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitle)
}





//popup for flashbooks
function openWin( windowURL, windowName, windowFeatures ) 
{ 
	return window.open( windowURL, windowName, windowFeatures ) ; 
} 



function validate_form ( )
{
	valid = true;
	if ( document.addtocart.colour.value == "" )
	{
		alert ( "Please select a colour");
		valid = false;
	}
	if ( document.addtocart.size.value == "" )
	{
		alert ( "Please select type");
		valid = false;
	}
	return valid;
}

function expand()
{
        expandoptions="toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=320,height=300";
        expandpage=open('','expandpage',expandoptions);
}


function tcexpand()
{
        tcexpandoptions="toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=500,height=400";
        tcexpandpage=open('','tcexpandpage',tcexpandoptions);
}
