	/*
		*	Main Application Class
		* 	Author: Ark Rozycki
	*/
	
	var propMapr = new function(){
		
		this.map;
		this.mapMgr;
		this.arrFilters = [];
		this.initialLoad = false;
		this.isZoomed = false;
		this.queryString = null;
		this.arrCurrentImages = [];
		this.markers = [];
		this.iid;
		this.pid;
		this.zoomLvl;
		
		// create the google maps, assign it to the canvas, center coordinates are about middle of country
		this.loadGoogleMap = function(){
				
			this.zoomLvl = ($(window).width() <= 1280) ? 4 : 5;
			this.map = new google.maps.Map(
				document.getElementById("map_canvas"), 
				{
					zoom: this.zoomLvl,
					center: new google.maps.LatLng(37.0625,-95.677068),
					mapTypeId: google.maps.MapTypeId.ROADMAP, //TERRAIN
					streetViewControl: true
				}
			);
			
			return;
		};
		
		// get the latest filters and set the local store
		this.setFilters = function(){
			var filters = document.filterForm;
			
			// setup the local filter stores
			this.arrFilters['search'] = true;
			this.arrFilters['state'] = filters.elements['state'].value;
			this.arrFilters['priceLow'] = filters.elements['priceLow'].value;
			this.arrFilters['priceHigh'] = filters.elements['priceHigh'].value;
			this.arrFilters['sqftLow'] = filters.elements['sqftLow'].value;
			this.arrFilters['sqftHigh'] = filters.elements['sqftHigh'].value;
			this.arrFilters['beds'] = utility.getCheckboxGroupVals(filters.elements['beds[]']);
			this.arrFilters['baths'] = utility.getCheckboxGroupVals(filters.elements['baths[]']);
								
			// save the filters to local cookie
			cookieMgr.save(this.arrFilters);
			
			// setup the search info window
			propMapr.updateInfoWindow();
			
			// close the filter window after setting
			winMgr.close('#filtersBox');
			return;
		};
				
		// update the search info window
		this.updateInfoWindow = function(){
			$('#searchInfoBox').show();
			var HTML = 	'Currently Searching on - State: ' + this.arrFilters['state'] + ' | ' + 
						'Price: $' + utility.digits(this.arrFilters['priceLow']) + ' - ' + '$' + utility.digits(this.arrFilters['priceHigh']) + ' | ' +
						'SqFt: ' + utility.digits(this.arrFilters['sqftLow']) + ' - ' + utility.digits(this.arrFilters['sqftHigh']);
			
			if(this.arrFilters['beds'].length > 0)
				HTML += ' | Beds: ' + this.arrFilters['beds'];
			
			if(this.arrFilters['baths'].length > 0)
				HTML += ' | Baths: ' + this.arrFilters['baths'];
				
			$('#searchInfoBox').html(HTML);
		} 
		
		// runs the property search (e.g. clicking search button)
		this.runPropertySearch = function(){
			// set the filters
			this.setFilters();
			
			// get the state count values and setup the markers
			// this.getStateCounts();
			this.getProperties();
			return;
		};
		
		// load the property search form with data from a previous session (cookie)
		this.loadFormData = function(){
			if (!cookieMgr.cookie['haveResetStupidPrice']) {
				if (cookieMgr.cookie['priceHigh'] == 750000)
					cookieMgr.cookie['priceHigh'] = 10000000;
				cookieMgr.cookie['haveResetStupidPrice'] = true;
				cookieMgr.save(cookieMgr.cookie);
			}
			if (!cookieMgr.cookie['haveResetStupidSqFt']) {
				if (cookieMgr.cookie['priceHigh'] == 3000)
					cookieMgr.cookie['priceHigh'] == 15000;
				cookieMgr.cookie['haveResetStupidSqFt'] = true;
				cookieMgr.save(cookieMgr.cookie);
			}

			var objForm = document.filterForm;
			objForm.elements['state'].value = cookieMgr.cookie['state'];
			objForm.elements['priceLow'].value = cookieMgr.cookie['priceLow'];
			objForm.elements['priceHigh'].value = cookieMgr.cookie['priceHigh'];
			objForm.elements['sqftLow'].value = cookieMgr.cookie['sqftLow'];
			objForm.elements['sqftHigh'].value = cookieMgr.cookie['sqftHigh'];
			if(cookieMgr.cookie['beds']){
				var tmpBeds = unescape(cookieMgr.cookie['beds']);
				var arrBeds = tmpBeds.split(',');
				for(var i = 0; i < arrBeds.length; i++){
					$('#bed'+arrBeds[i]).attr('checked', true);
				}
			}
			
			if(cookieMgr.cookie['baths']){
				var tmpBaths = unescape(cookieMgr.cookie['baths']);
				var arrBaths = tmpBaths.split(',');
				for(var i = 0; i < arrBaths.length; i++){
					$('#bath'+arrBaths[i]).attr('checked', true);
				}
			}
			
			return;
		};
		
		// get the count of properties grouped by state, set the markers on the google map
		this.getStateCounts = function(){
			// clear the markers if any
			if(this.initialLoad)	
				this.clearMarkers();
			
			// send teh ajax request for the properties
			$.ajax({
				type: "POST",
				url: "/property/getStateCounts",
				data: ({
					state: this.arrFilters['state'],
					priceLow: this.arrFilters['priceLow'],
					priceHigh: this.arrFilters['priceHigh'],
					sqftLow: this.arrFilters['sqftLow'],
					sqftHigh: this.arrFilters['sqftHigh'],
					beds: this.arrFilters['beds'],
					baths: this.arrFilters['baths']
				}),
				dataType: 'json',
				success: function(objResponse){
					// loop through the response and create markers for each state with numbers using the google charts API
					// using an array to store them all before adding them to the marker manager
					for (var intIndex = 0; intIndex < objResponse.states.length; intIndex++){
						if(objResponse.states[intIndex]['Latitude'] != '' && objResponse.states[intIndex]['Longitude'] != ''){
							propMapr.markers.push(
								new google.maps.Marker({
									clickable: false,
									map: propMapr.map,
									visible: true,
									icon: 'http://chart.apis.google.com/chart?chst=d_map_spin&chld=1.0|0|F8F8F8|10|b|'+objResponse.states[intIndex]['state']+'|'+objResponse.states[intIndex]['cnt'],
									position: new google.maps.LatLng(objResponse.states[intIndex]['Latitude'],objResponse.states[intIndex]['Longitude'])
								})
							);
						}
					}
				}
			});
			
			return;
		};	
		
		// get the property markers for the search params
		this.getProperties = function(){
			$('#objLoading').children('div.content').html('Loading Properties ...');
			winMgr.center('#objLoading');
			
			// clear the markers if any
			if(this.initialLoad)	
				this.clearMarkers();
				
			// send teh ajax request for the properties
			$.ajax({
				type: "POST",
				url: "/property/getProperties",
				data: ({
					iid: this.queryString['iid'],
					state: this.arrFilters['state'],
					priceLow: this.arrFilters['priceLow'],
					priceHigh: this.arrFilters['priceHigh'],
					sqftLow: this.arrFilters['sqftLow'],
					sqftHigh: this.arrFilters['sqftHigh'],
					beds: this.arrFilters['beds'],
					baths: this.arrFilters['baths']
				}),
				dataType: 'json',
				success: function(objResponse){
					// loop through the response and create markers for each state with numbers using the google charts API
					// using an array to store them all before adding them to the marker manager
					for (var intIndex = 0; intIndex < objResponse.properties.length; intIndex++){
						if(objResponse.properties[intIndex]['lat'] != '' && objResponse.properties[intIndex]['lng'] != '')
							propMapr.markers.push( 
								propMapr.addMarker(
									objResponse.properties[intIndex]['iid'], 
									objResponse.properties[intIndex]['id'], 
									objResponse.properties[intIndex]['lat'], 
									objResponse.properties[intIndex]['lng'], 
									objResponse.properties[intIndex]['address'], 
									objResponse.properties[intIndex]['city'], 
									objResponse.properties[intIndex]['state'], 
									objResponse.properties[intIndex]['zip'],
									objResponse.properties[intIndex]['photo'],
									objResponse.properties[intIndex]['bed'],
									objResponse.properties[intIndex]['bath'],
									objResponse.properties[intIndex]['sqft'],
									objResponse.properties[intIndex]['price']
								)
							);
					}
					
					// recenter map if we need to 
					if(objResponse.center.lat)
						propMapr.mapReCenterTo(objResponse.center.lat, objResponse.center.lng, 6);
					else
						propMapr.mapReCenterTo(37.0625, -95.677068, propMapr.zoomLvl);
						
					// close the loading window
					winMgr.close('#objLoading');
				},
				failure: function(err){
					// TODO: display error window
					
					// close the loading window
					winMgr.close('#objLoading');
				}
			});
			
			return;
		};
		
		// recenter the map to a new location specified
		this.mapReCenterTo = function(lat, lng, zoom){
			propMapr.map.setZoom(zoom);
			propMapr.map.panTo(new google.maps.LatLng(lat,lng));
			return;
		};
		
		// create a marker and a click event for the marker
		this.addMarker = function(iid, pid, lat, lng, title, city, state, zip, photo, bed, bath, sqft, price){
			// create a google marker
			var marker = new google.maps.Marker({
				iid: iid,
				pid: pid,
				clickable: true,
				map: propMapr.map,
				visible: true,
				title: title,
				position: new google.maps.LatLng(lat, lng)
			});

			// create the listener for the marker click
			/*
			google.maps.event.addListener(marker, 'click', function() {
				// upon a click the property details are requested
				propMapr.getPropertyDetails(marker.iid, marker.pid);
			});
			*/
			
			var ammenities = '<div class="ammenities">';
			ammenities += (price) ? '<strong>' + utility.CurrencyFormatted(price) + '</strong> ' : '';
			ammenities += (bed) ? bed + ' beds ' : '';
			ammenities += (bath) ? bath + ' baths ' : '';
			ammenities += (sqft) ? sqft + ' sqft ' : '';
			ammenities += '</div>';
			var img = (photo) ? '<div class="smartImg"><img src="http://myproptrackr.com/res/thumbs/tim.php?src=http://myproptrackr.com/res/propertyPhotos/'+iid+'/'+pid+'/'+photo+'&h=100&w=200&zc=1&q=100" height="100" /></div>' : '<div class="smartImg"><img src="/res/images/nophoto.png" height="100" /></div>';
			var content = 	'<a href="javascript:;" onClick="propMapr.getPropertyDetails('+iid+','+pid+');" class="mapPopLink">' +
							'<div class="mapPop">' + 
								title + '<br/>' + city + ', ' + state + ' ' + zip + 
								'<br/>' + ammenities +
								img +
								'<div class="note">click to view more details</div>' +
							'</div></a>';
			
			google.maps.event.addListener(marker, 'click', function(e) {
				var infobox = new SmartInfoWindow({position: marker.getPosition(), map: propMapr.map, content: content});
			});
			
			return marker;
		};
		
		// get the property details
		this.getPropertyDetails = function(iid, pid){
			// currently viewing
			this.iid = iid;
			this.pid = pid;
			
			// if UID present, we have an instance viewer, otherwise, display normal form
			if(propMapr.queryString['uid']){
				$('#ol_MoreInfo table').hide();
				$('#ol_AddToMyProps').show();
			}
			else
				$('#ol_MoreInfo table').show();
			// show the thank you
			$('#ol_MoreInfo #submitted').hide();
			
			// load form values for more info from cookie
			this.loadMoreInfo();
			
			// display the loading screen
			$('#objLoading').children('div.content').html('Loading Property Details ...');
			winMgr.center('#objLoading');
			
			// make the ajax call
			$.ajax({
				type: "POST",
				url: "/property/getPropertyDetails",
				data: ({
					iid: iid,
					pid: pid
				}),
				dataType: 'json',
				success: function(objResponse){
					// close the loading window
					winMgr.close('#objLoading');
					
					// show the property data received in a nice pop up window
					propMapr.showPropertyDetails(iid, pid, objResponse.property[0], objResponse.photos);

				},
				failure: function(err){
					// TODO: display error window
					
					// close the loading window
					winMgr.close('#objLoading');
				}
			});
		};
		
		// get the property details
		this.getPropertyList = function(iid){
			// display the loading screen
			$('#objLoading').children('div.content').html('Loading Property List ...');
			winMgr.center('#objLoading');
			
			// clear the markers if any
			if(this.initialLoad)	
				this.clearMarkers();
				// propMapr.mapMgr.clearMarkers();
				
			// make the ajax call
			$.ajax({
				type: "POST",
				url: "/property/getPropertyList",
				data: ({
					iid: iid,
					state: this.arrFilters['state'],
					priceLow: this.arrFilters['priceLow'],
					priceHigh: this.arrFilters['priceHigh'],
					sqftLow: this.arrFilters['sqftLow'],
					sqftHigh: this.arrFilters['sqftHigh'],
					beds: this.arrFilters['beds'],
					baths: this.arrFilters['baths']
				}),
				dataType: 'json',
				success: function(objResponse){
					// loop through the response and create markers for each state with numbers using the google charts API
					// using an array to store them all before adding them to the marker manager
					for (var intIndex = 0; intIndex < objResponse.properties.length; intIndex++){
						if(objResponse.properties[intIndex]['lat'] != '' && objResponse.properties[intIndex]['lng'] != '')
							propMapr.markers.push( propMapr.addMarker(objResponse.properties[intIndex]['iid'], objResponse.properties[intIndex]['id'], objResponse.properties[intIndex]['lat'], objResponse.properties[intIndex]['lng'], objResponse.properties[intIndex]['address'], objResponse.properties[intIndex]['city'], objResponse.properties[intIndex]['state'], objResponse.properties[intIndex]['zip'], objResponse.properties[intIndex]['filename']) );
					}
					
					// add the marker to the marker manager
					// propMapr.mapMgr.addMarkers(markers, 1);
					
					// close the loading window
					winMgr.close('#objLoading');
				},
				failure: function(err){
					// TODO: display error window
					
					// close the loading window
					winMgr.close('#objLoading');
				}
			});
		};
		
		// clears all the markers from the map
		this.clearMarkers = function(){
			for(i= 0; i < propMapr.markers.length; i++) { 
				mk = propMapr.markers[i]; 
				mk.setMap(null); 
			}
			
			this.markers = null;			
	        this.markers = [];
		}
		
		// show the property details
		this.showPropertyDetails = function(iid, pid, objProperty, objPhotos){
			
			
			$('#divWalkScore').html('');
			$('#divGreatSchools').html('');
			
			$('#mainPropPhoto').attr('src','/res/images/nophoto.png');
			$('#ol_tPhotos').html('');	
			
			$('#ol_address').children('div.street').html(objProperty.address);
			$('#ol_address').children('div.city').html(objProperty.city + ', ');
			$('#ol_address').children('div.state').html(objProperty.state);
			$('#ol_address').children('div.zip').html(objProperty.zip);
			
			// format the property type
			var propType = '';
			if(objProperty.propertyType != ''){
				if(objProperty.propertyType == 'Residential')
					propType = (objProperty.residenceType != '') ? 'Residential ' + objProperty.residenceType : 'Residential';
				else
					propType = (objProperty.commercialType != '') ? 'Commercial ' + objProperty.commercialType : 'Commercial';
			}
			
			$('#ol_propType').html('Property Type: ' + propType);
			
			// price
			$('#ol_propPrice').html('Price ' + utility.CurrencyFormatted(objProperty.currentListingPrice));
			
			this.arrCurrentImages = [];
			$('#largeImageLink').hide();
			
			if(objPhotos.length > 0){
				$('#largeImageLink').show();
				$('#mainPropPhoto').attr('src', 'http://myproptrackr.com/res/thumbs/tim.php?src=/res/propertyPhotos/'+iid+'/' + pid + '/' + objPhotos[0].filename + '&h=200&w=300&zc=1&q=100');
				
				// add the image thumbnails
				for(var i = 0; i < objPhotos.length; i++){
					this.arrCurrentImages.push('http://myproptrackr.com/res/propertyPhotos/'+iid+'/'+pid+'/'+objPhotos[i].filename);
					$('#ol_tPhotos').append('<div id="ol_tPhoto"><img src="http://myproptrackr.com/res/thumbs/tim.php?src=/res/propertyPhotos/'+iid+'/'+pid+'/'+objPhotos[i].filename +'&h=50&w=50&zc=1&q=100'+'" onMouseOver="propMapr.updateOverlayMainPhoto(\'http://myproptrackr.com/res/thumbs/tim.php?src=/res/propertyPhotos/'+iid+'/'+pid+'/'+objPhotos[i].filename +'&h=200&w=300&zc=1&q=100\');" width="50" height="50"/></div>');
				}
			}
									
			// add the property summary
			if(objProperty.summary != '')
				$('#ol_PropSummary').html('<div class="ol_PropDescTitle">Summary</div>' + objProperty.summary);
			else
				$('#ol_PropSummary').html('');
				
			// add the property details
			$('#ol_PropDetailItems').html('');
						
			if(objProperty.MLS)
				$('#ol_PropDetailItems').append('<div class="ol_PropDetailItem">MLS '+objProperty.MLS+'</div>');
			
			if(objProperty.lotSize)
				$('#ol_PropDetailItems').append('<div class="ol_PropDetailItem">Lot size of '+objProperty.lotSize+' sqft</div>');
			
			if(objProperty.squarefeet)
				$('#ol_PropDetailItems').append('<div class="ol_PropDetailItem">'+objProperty.squarefeet+' finished sqft</div>');
			
			if(objProperty.bedrooms)
				$('#ol_PropDetailItems').append('<div class="ol_PropDetailItem">'+objProperty.bedrooms+' bedrooms</div>');
			
			if(objProperty.bathrooms)
				$('#ol_PropDetailItems').append('<div class="ol_PropDetailItem">'+objProperty.bathrooms+' bathrooms</div>');			
			
			if(objProperty.yearBuilt)
				$('#ol_PropDetailItems').append('<div class="ol_PropDetailItem">Built in '+objProperty.yearBuilt+'</div>');
				
			if(objProperty.basementSQFT != 0)
				$('#ol_PropDetailItems').append('<div class="ol_PropDetailItem">Basement is '+objProperty.basementSQFT+' sqft</div>');
			
			
			if(objProperty.parkingSpaces && objProperty.parkingType){
				objProperty.parkingType = (objProperty.parkingType == 1) ? 'Garage' : (objProperty.parkingType == 2) ? 'Covered' : 'Uncovered';
				$('#ol_PropDetailItems').append('<div class="ol_PropDetailItem">'+objProperty.parkingSpaces + ' ' + objProperty.parkingType  +' parking spaces</div>');
			}
			if(objProperty.floors)
				$('#ol_PropDetailItems').append('<div class="ol_PropDetailItem">'+objProperty.floors+' floors</div>');
			
			// add the property features data
			$('#ol_PropFeaturesItems').html('');
			if(objProperty.featuresData != ''){
				$('#ol_PropFeaturesItems').append('<div class="ol_PropDescTitle">Features</div>');
				var arrFeatures = objProperty.featuresData.split('|');
				for(var i = 0; i < arrFeatures.length; i++)
					$('#ol_PropFeaturesItems').append('<div class="ol_PropDetailItem">'+arrFeatures[i]+'</div>');
			}
			
			// add the directlink
			$('#directLink').html('Direct link: http://propmapr.com/property/view/'+iid+'/'+pid);
						
			$('#a_StreetView').click(function() { propMapr.showStreetView(objProperty.lat,objProperty.lng); });
						
			// add the instance contact info
			var htmlContactInfo = '';
			if(objProperty.Company)
				htmlContactInfo += '<div class="company">'+objProperty.Company+'</div>';
				
			if(objProperty.ContactPhone)
				htmlContactInfo += '<div class="phone">'+objProperty.ContactPhone+'</div>';
			
			if(objProperty.CustomerServiceEmail)
				htmlContactInfo += '<div class="email">'+objProperty.CustomerServiceEmail+'</div>';
			
												
			$('#boxContactInfo').html(htmlContactInfo);
			
			var address = escape(objProperty.address+','+objProperty.city+','+objProperty.state) ;
			$('#walkToggleLink').click(function() { propMapr.toggleWalkScore(address); });
			$('#schoolToggleLink').click(function() { propMapr.toggleSchool(address); });
			// $('#iFrameGreatSchool').attr('src', 'http://www.greatschools.org/widget/schoolSearch.page?searchQuery='+ address +'&textColor=228899&bordersColor=cccccc&width=600&height=400&zoom=13');
			// show the overlay
			winMgr.showOverlay('#overlayDetails');
		};
		
		this.toggleWalkScore = function(address){
			var width = $('#walkscore').width() - 20;
			$('#divWalkScore').html('<iframe id="iFrameWalkScore" src="http://www.walkscore.com/serve-walkscore-tile.php?wsid=466bf0390d900686a230a43c238e8da1&street='+ address +'&width='+width+'&layout=horizontal&height=268&footheight=18" width="'+width+'" height="300" frameborder="0" scrolling="no"></iframe>');
		};
		
		this.toggleSchool = function(address){
			var width = $('#greatschools').width() - 20;
			$('#divGreatSchools').html('<iframe id="iFrameSchool" src="http://www.greatschools.org/widget/schoolSearch.page?searchQuery='+ address +'&textColor=228899&bordersColor=cccccc&width='+width+'&height=400&zoom=13" width="'+width+'" height="400" frameborder="0" scrolling="no"></iframe>');
		};
		
		// change the image showing in the main property overlay
		this.updateOverlayMainPhoto = function(srcImage){
			srcImage = srcImage.replace('thumb_', '');
			$('#mainPropPhoto').attr('src', srcImage);
		};
		
		this.loadURLRequests = function(){
			
			if(propMapr.queryString['iid'])
				this.setFilters();
			
			// check the url for any specific property requests
			if(propMapr.queryString['pid']){
				propMapr.getPropertyDetails(propMapr.queryString['iid'], propMapr.queryString['pid']);
			}
			
			// check for any instance requests
			if(propMapr.queryString['iid']){
				propMapr.getPropertyList(propMapr.queryString['iid']);
			}
		};
		
		this.showStreetView = function(lat, lng){			
			
			winMgr.center('#overlayStreetView', true);
			
			var sv = new google.maps.StreetViewPanorama(
				document.getElementById("objStreetView"), 
				{
			  		position: new google.maps.LatLng(lat,lng),
			  		pov: {
			    		heading: 180,
			    		pitch: 10,
			    		zoom: 2
					}
			  	}
			);
			// load the street view in the div
			propMapr.map.setStreetView(sv);
						
		};
		
		this.submitMoreInfo = function(){
			var form = document.moreInfoForm;
			
			// save the form in a cookie
			propMapr.saveMoreInfo(form);
			
			// check all the elements are included
			if( form.elements['fFirst'].value != '' &&
				form.elements['fLast'].value != '' &&
				form.elements['fEmail'].value != ''){
					
				// make the ajax call
				$.ajax({
					type: "POST",
					url: "/property/submitMoreInfo",
					data: ({
						iid: propMapr.iid,
						pid: propMapr.pid,
						question: form.elements['fQuestion'].value,
						firstName: form.elements['fFirst'].value,
						lastName: form.elements['fLast'].value,
						eMail: form.elements['fEmail'].value,
						phone: form.elements['fPhone'].value
					}),
					dataType: 'json',
					success: function(objResponse){
						// hide the form
						$('#ol_MoreInfo table').hide();
						// show the thank you
						$('#ol_MoreInfo #submitted').show();

					},
					failure: function(err){
						// TODO: display error window
						alert('form failed');
					}
				});
			} else {
				alert('All required * fields must be completed.');
			}
		};
		
		this.saveMoreInfo = function(form){
			cookieMgr.save(
				{
					miQuestion: form.elements['fQuestion'].value,
					miFirstName: form.elements['fFirst'].value,
					miLastName: form.elements['fLast'].value,
					miEmail: form.elements['fEmail'].value,
					miPhone: form.elements['fPhone'].value
				}
			);
			return;
		};
		
		this.loadMoreInfo = function(){
			
			if(cookieMgr.cookie['miFirstName']){
				$('#fFirst').attr('value', unescape(cookieMgr.cookie['miFirstName']));
				$('#fLast').attr('value', unescape(cookieMgr.cookie['miLastName']));
				$('#fEmail').attr('value', unescape(cookieMgr.cookie['miEmail']));
				$('#fPhone').attr('value', unescape(cookieMgr.cookie['miPhone']));
				$('#fQuestion').attr('value', unescape(cookieMgr.cookie['miQuestion']));
			}
		};
		
		this.addToMyProperties = function(){
			// make the ajax call
			$.ajax({
				type: "POST",
				url: "/property/addToMyProperties",
				data: ({
					iid: propMapr.iid,
					pid: propMapr.pid,
					uid: propMapr.queryString['uid']
				}),
				dataType: 'json',
				success: function(objResponse){
					// hide the form
					$('#ol_AddToMyProps').hide();
					// show the thank you
					$('#ol_MoreInfo #submitted').show();

				},
				failure: function(err){
					// TODO: display error window
					alert('form failed');
				}
			});
		}
	};

