// JavaScript Document
// gift guide javascript functions

//ACCORDION-TYPE FUNCTIONS FOR DISPLAYING GIFT DETAIL 
//set global for lastgift
var lastgift = 'none';
function showGiftDetail(detailid,giftid) {
	// reset last gift
	if (lastgift != 'none' && lastgift != giftid && $(lastdetail).style.display != 'none') { 
		Effect.toggle(lastdetail,'blind', {duration:.2, queue: {position: 'parallel', scope: 'giftscope', limit:2} }); 
		$(lastgift).style.backgroundColor='#F0EEE4';
		}
	// expand this gift and change bg color
	Effect.toggle(detailid,'blind', {duration:.5, queue: {position: 'end', scope: 'giftscope', limit:2} });
	if ($(detailid).style.display == 'none') { $(giftid).style.backgroundColor='#E5E0CC'; } else { $(giftid).style.backgroundColor='#F0EEE4'; }
	lastgift = giftid;
	lastdetail = detailid;
}

//FUNCTION FOR NAVIGATION TOGGLING SUBMENUS
function toggleSubMenu(submenuId){ 
	Effect.toggle(submenuId,'blind',  {duration:.5, queue: {position: 'parallel', scope: 'menuscope', limit:2} });
	Effect.toggle(submenuId,'appear', {duration:.5, queue: {position: 'parallel', scope: 'menuscope', limit:2} }); 
		
	last = submenuId;
}



function change_arrow(container) {
		
			//you may want to change the paths to absolute...will prob work better
			var container = $(container);
			if(container.style.backgroundImage.match('down_lightgrey.gif')){
				container.style.backgroundImage = "url(../images/layout/right_lightgrey.gif)";
			} else {
				container.style.backgroundImage = "url(../images/layout/down_lightgrey.gif)";
			}		
		}