//begin CIP init
	if ( document[__formToMonitor] ){
		var formInstance = document[__formToMonitor];
		var fncOnSubmit = formInstance.onsubmit;

		formInstance.onsubmit = function(){ 
			var bcancontinue = true;
			if ( fncOnSubmit ){
				bcancontinue = PropertySearch_OnSubmit( formInstance );
			}
			if ( bcancontinue && __selectionStatus == 0 ){
				//prompt for cip
				var oparams = [];
				with ( oparams ){
					push( "listingtype=" + MonitoredForm_ListingType_GetValue(formInstance) );
					push( "minprice=" + formInstance.minprice.value );
					push( "maxprice=" + formInstance.maxprice.value );
					push( "bedrooms=" + formInstance.bedrooms.value );
					if ( formInstance.area ){
						push( "area=" + formInstance.area.value );
					}
					if ( formInstance.location ){
						push( "location=" + formInstance.location.value );
					}
					
					push( "allowlistingtypeselection=" + __cip_allowListingTypeSelection );
					
				}
				CIPInlineRegistration_onStart(__cipServiceDomain, oparams.join("&") + "&continueURL=search.aspx");
				return false;
			}else{
				return true;
			}
		}
	}else{
		alert("Unable to find form '"+__formToMonitor+"'");
	}
	
	function MonitoredForm_ListingType_GetValue(form){
		if ( form.ListingType ){
			if ( typeof form.ListingType.value != "undefined" ){
				return form.ListingType.value;
			}else if ( typeof form.ListingType.length != "undefined" ){
				for ( var i = 0; i < form.ListingType.length; i ++ ){
					if ( form.ListingType[i].checked ){
						return form.ListingType[i].value;
					}
				}
			}		
		}else{
			return "";	
		}
	}
