function PropertyCart_Send_OnSubmit(o){
try{
	if ( o.txtSenderName.value.length == 0 ){
		alert("Please enter your name");
		o.txtSenderName.focus();
		return false;
	}
	if ( o.txtEmailAddress.value.length == 0 ){
		alert("Please enter the person\'s email address you wish to send your saved properties to");
		o.txtEmailAddress.focus();
		return false;
	}
	//at least one property type
	var apropertytypes = new Array();
	var opropertytypes = new EstateWeb_Objects_Property_PropertyTypes();
	if ( HttpManager.Document.GetObject("chkSendProperties_Residential") ){
		if ( HttpManager.Document.GetObject("chkSendProperties_Residential").checked ){
			apropertytypes[apropertytypes.length] = opropertytypes.residential;	
		}
	}
	if ( HttpManager.Document.GetObject("chkSendProperties_Commercial") ){
		if ( HttpManager.Document.GetObject("chkSendProperties_Commercial").checked ){
			apropertytypes[apropertytypes.length] = opropertytypes.commercial;	
		}
	}
	if ( HttpManager.Document.GetObject("chkSendProperties_Overseas") ){
		if ( HttpManager.Document.GetObject("chkSendProperties_Overseas").checked ){
			apropertytypes[apropertytypes.length] = opropertytypes.overseas;	
		}
	}
	//if no options then use the default
	if ( HttpManager.Document.GetObject("chkSendProperties_Residential") || HttpManager.Document.GetObject("chkSendProperties_Commercial") || HttpManager.Document.GetObject("chkSendProperties_Overseas") ) {
		if ( apropertytypes.length == 0 ){
			alert("You must select at least one property type to include in this email");
			return false;
		}	
	}else{

		apropertytypes[apropertytypes.length] = HttpManager.Document.GetObject("_ctl1_cntrlPropertyCartTools_txtSendProperties").value;
	}

	PropertyCart.EmailProperties( o.txtSenderName.value, o.txtEmailAddress.value, null, apropertytypes.join(",") );
	}catch(e){
		alert("There was an error while processing your request, please contact the agent");
		return false;
	}
	return false;
}

function PropertyCart_ArrangeViewing_OnClick(){
	if ( HttpManager.Document.GetObject("_ctl1_CenterRegion_cntrlPropertyCartTools_slpropertytypes") ){
		location.href = "arrangeviewing.aspx?pt="+HttpManager.Document.GetObject("_ctl1_CenterRegion_cntrlPropertyCartTools_slpropertytypes").value;
	}else{
		location.href = "arrangeviewing.aspx?pt="+HttpManager.Document.GetObject("_ctl1_cntrlPropertyCartTools_txtSendProperties").value;
	}
}
