 /**
    * Function to submit a HTML form into a Highslide iframe popup.
    */
    function submitToHighslide(form) {

    	// identify the submit button to start the animation from
    	var anchor;
    	for (var i = 0; i < form.elements.length; i++) {
    		if (form.elements[i].type == 'submit') {
				anchor = form.elements[i];
				break;
			}
		}

		// open an expander and submit our form when the iframe is ready
		hs.overrides.push('onAfterExpand');
		hs.htmlExpand(anchor, {
			objectType: 'iframe',
			src: 'about:blank',
			width: 800,
			height: 600,
			onAfterExpand: function(expander) {
				form.target = expander.iframe.name;
				form.submit();
			}
		});

		// return false to delay the sumbit until the iframe is ready
		return false;
	}