		window.addEvent('domready', function(){

			if(document.getElementById("ask_form")) {
			$('ask_form').addEvent('submit', function(e) {

				/**
				 * Prevent the submit event
				 */
				new Event(e).stop();

				/**
				 * This empties the log and shows the spinning indicator
				 */
				/**
				 * send takes care of encoding and returns the Ajax instance.
				 * onComplete removes the spinner from the log.
				 */

				var errortext = '';

				if(document.ask_form.name.value == '') {
					errortext += 'You must enter a name.\n';
				}

				if(errortext != '') {

					window.alert(errortext);
					
				} else {

					this.set('send',{
						onComplete:function(){
							topdistance = findPageOffset();
							document.getElementById("log_res_message").innerHTML = "Thanks for your message. We'll get back to you soon!";
		        	                        document.getElementById("fade").style.top = parseInt(topdistance[1]) + "px";
 	                        	                document.getElementById("log_res").style.top = parseInt(topdistance[1]) + 100 + "px";
			        			document.getElementById("fade").style.display = "block";
			        			document.getElementById("log_res").style.display = "block";
						}
					}).send();

				}
			});
			}

var szNormal = 257, szSmall  = 151, szFull   = 466;

if($("kwicks")) {
var kwicks = $$("#kwicks .kwick");
var fx = new Fx.Elements(kwicks, {wait: false, duration: 300, transition: Fx.Transitions.Back.easeOut});
kwicks.each(function(kwick, i) {
        kwick.addEvent("mouseenter", function(event) {
                var o = {};
                o[i] = {width: [kwick.getStyle("width").toInt(), szFull]}
		$(kwick.id + "_bullets").style.display = "block";
		$(kwick.id + "_info").style.display = "none";
                kwicks.each(function(other, j) {
                        if(i != j) {
                                var w = other.getStyle("width").toInt();
                                if(w != szSmall) {
					o[j] = {width: [w, szSmall]};
					$(other.id + "_bullets").style.display = "none";
					$(other.id + "_info").style.display = "inline";
				}
                        }
                });
                fx.start(o);
        });
});

$("kwicks").addEvent("mouseleave", function(event) {
        var o = {};
        kwicks.each(function(kwick, i) {
                o[i] = {width: [kwick.getStyle("width").toInt(), szNormal]}
		$(kwick.id + "_bullets").style.display = "none";
		$(kwick.id + "_info").style.display = "inline";
        });
        fx.start(o);

})
}


		});

		function showMoreExamples() {

			new_height = $('imagewrapper').scrollHeight - 20;

			$('imagewrapper').morph({height: new_height});

		}

		function showLessExamples() {

			$('imagewrapper').morph({height: 273});

		}


