function popyoutubesane(vid) {
	var url = '/adjuct/youtubeb.php?id=' + vid;
	newwindow = window.open(url, 'youtube', 'height=420,width=460');
};

window.addEvent('domready', function() {

	var togglers = $$('a.toggler');
	var stretchers =  $$('div.stretcher');
	var lists = $$('div.stretcher ul');
	var expand = '';
	
	var strFx = new Fx.Elements(stretchers, {
		link: 'cancel',
		duration: 440
	});

	var initial = {};
	var heights = {};
	stretchers.each(function(item, index){
		var size = lists[index].getSize();
		heights[index] = size.y;
		if (item.id == 'selected') {
			initial[index] = {'height': size.y};
		} else {
			initial[index] = {'height': '0px'};
		};
	});

	strFx.set(initial);

	togglers.each(function(toggler, idx){

		toggler.addEvent('click', function(e){
			new Event(e).stop();

			hider = {};
			stretchers.each(function(item, indx){
				if ((indx == idx) && (!item.hasClass('open'))) {
					hider[indx] = {'height': heights[indx]};
					item.addClass('open');
				} else {
					hider[indx] = {'height': '0px'};
					item.removeClass('open');
				}
			});

			strFx.start(hider);
	
		});

	});

	// background switcher

	/* var body = $(document.body);

	$('red').addEvent('click', function(e){
		e.stop();
		$('master').set('styles', {
			'background-image': 'url("/images/vpd_texturerust.png")'
		});
		body.set('class', 'red');
	});

	$('blue').addEvent('click', function(e){
		e.stop();
		$('master').set('styles', {
			'background-image': 'url("/images/vpd_textureblue.png")'
		});
		body.set('class', 'blue');
	});
	
	*/

});
