//
// Functionality common to all Help Center pages
//

Behaviour.register({
	//
	// ensure some text is entered into a search field
	//
	'form.search' : function (el) {
		el.onsubmit = function() {
			if (el.q.value.strip() == '') {
				alert('Please enter some search terms.');
				return false;
			}
			return true;
		}
	},
	'#bookmark2' : function (el) {
		if (BookmarkController.canBookmarkFromJS()) {
			var img = document.createElement('img');
			img.src = 'http://help.securepaynet.net/images/btn_bookmark.gif';
			img.alt = img.title = 'Bookmark this Page';
			img.onclick = function() {
				bookmark(window.location, document.title);
				return false;
			}
			el.appendChild(img);
		}
	}
});