window.addEvent('domready', function() {
	new Fx.Style('bush', 'height', { duration : 0 }).start(0, 360);
	new Fx.Style('wgmo', 'height', { duration : 0 }).start(0, 360);
	new Fx.Style('ac', 'height', { duration : 0 }).start(0, 360);
	
	$('open_video').value = "bush";
	$('open_motion').value = "wgmo";
	$('open_print').value = "ac";
	
	var vids = $$(".vids");
	var mos = $$(".mos");
	var prints = $$(".prints");
	
	vids.each(function(vid, i) {
		vid.addEvents({
			'click' : function(e) {
				new Event(e).stop();
				var ov = $('open_video');
				new Fx.Style(ov.value, 'height', { duration : 1000 }).start('360', '0');
				(function(){new Fx.Style(vid.rel, 'height', { duration : 1000 }).start('0', '360');}).delay(1000);
				ov.value = vid.rel;
			},
			'mouseenter' : function() {
				$('video_tip').setHTML(vid.title);
			},
			'mouseleave' : function() {
				$('video_tip').setHTML("");
			}
		});
	});
	
	mos.each(function(mo, i) {
		mo.addEvents({
			'click' : function(e) {
				new Event(e).stop();
				var om = $('open_motion');
				new Fx.Style(om.value, 'height', { duration : 1000 }).start('360', '0');
				(function(){new Fx.Style(mo.rel, 'height', { duration : 1000 }).start('0', '360');}).delay(1000);
				om.value = mo.rel;
			},
			'mouseenter' : function() {
				$('mo_tip').setHTML(mo.title);
			},
			'mouseleave' : function() {
				$('mo_tip').setHTML("");
			}
		});
	});
	
	prints.each(function(print, i) {
		print.addEvents({
			'click' : function(e) {
				new Event(e).stop();
				var op = $('open_print');
				new Fx.Style(op.value, 'height', { duration : 1000 }).start('360', '0');
				(function(){
						new Fx.Style(print.rel, 'height', { duration : 1000 }).start('0', '360');
					}).delay(1000);
				op.value = print.rel;
			},
			'mouseenter' : function() {
				$('print_tip').setHTML(print.title);
			},
			'mouseleave' : function() {
				$('print_tip').setHTML("");
			}
		});
	});
});