window.addEvent('domready', function(){
	var data = {
		'_home_1.jpg': { caption: '' }, 
		'_home_2.jpg': { caption: '' },
		'_home_3.jpg': { caption: '' },
		'_home_4.jpg': { caption: '' },
		'_home_5.jpg': { caption: '' }
	};
	var myShow = new Slideshow('show', data, {controller: false, height: 287, hu: 'templates/wrung_fr_summer_10/images/shop_illustrations/', thumbnails: false, caption: false, width: 740});

	$('navigation').getElements('li.submenu').each( function( elem ){
		var list = elem.getElement('ul.sublinks');	
		var myFx = new Fx.Slide(list).hide();			
		elem.addEvents({
			'mouseenter' : function(){ 					
				myFx.cancel();
				myFx.slideIn();					
			},
			'mouseleave' : function(){ 
				myFx.cancel();
				myFx.slideOut();					
			}
		});	
	})

	var verticalmenu = new BySlideMenu('image-menu-h', {vertical: true});
});

// setup a controlled popup window
function popup(url, popup, options){
/*
url, required: the url to open, eg 'http://jimmont.com' or '/resrc/'
popup, optional: the name or target for the window to open, eg 'my_popup' or 'portfolioWindow'
options, optional: if present are using instead of the defaults
*/
	// if you didn't give a location to open, just skip out using 'return'
	if(!url) return;
	var mypopup;
	// setup a place to save a list of opened windows
	if(!arguments.callee.popups) arguments.callee.popups = {};
	// if you previously opened this window-name re-use the window
	if(popup && arguments.callee.popups[popup]) mypopup = arguments.callee.popups[popup];
	// popup window chrome details: 0 is same as no/false, 1 is same as yes/true
	var details = (typeof options == 'string' && /=/.test(options))? options : 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,width='+(screen.availWidth/3)+',height='+(screen.availHeight/2)+',top=200,left=500';
	// create the popup, or redirect an existing one to this place
	if(typeof mypopup != 'undefined' && !mypopup.closed) mypopup.location = url;
	else mypopup = window.open(url,(typeof popup == 'string' ? popup :''),details);
	if(typeof popup != 'undefined' && !arguments.callee.popups[popup]) arguments.callee.popups[popup] = mypopup;
	// bring the popup window into the foreground
	if(mypopup && mypopup.focus) mypopup.focus();
};
