function trigger_effect(src_element,div_id, effect, first_img, second_img){
	Effect.toggle(div_id, effect, {beforeFinish:function(){
	image = src_element.getElementsByTagName('img')[0];
	image.src = image.src.match(first_img) ? second_img : first_img;
	}});
	return true;
}

function sendToFriend(showHide,itemName){
	var sendDiv = document.getElementById("sendToFriendDiv")
	if(showHide=='show') {
		sendDiv.src=sendDivSrc;
		var divPosition=$('sendToFriendLink').cumulativeOffset();
		var framePosition=$('sendToFriendLink').cumulativeOffset();
		sendDiv.style.top=divPosition[1]+"px";
		sendDiv.style.left=(divPosition[0]-framePosition[0]+40)+"px";
		Effect.Appear('sendToFriendDiv',{duration: 1.5});
//		s.pageName="Forms - Send to Friend - <%=FormVars("sendItem")%><%=IIF(sent," - Sent","")%>";
//		s.channel="Forms";
//		s.prop1="Send to Friend";
//		s.track;
		//sendDiv.style.display='block';
	} else {
		Effect.Fade('sendToFriendDiv',{duration: 1.5});
		//sendDiv.style.display='none';
	}
}

var footerTab=new Array();
footerTab[1]=0;
footerTab[2]=0;
footerTab[3]=0;
footerTab[4]=0;

function footerShowTab(tabNum) {
	if(	footerTab[tabNum]==0) {
		footerTab[tabNum]=1;
		$('tab'+tabNum).morph('height:88px;',{ duration: 0.1});
		Effect.BlindUp('t'+tabNum+'-col', { duration: 0.2 });
		Effect.BlindDown('t'+tabNum+'-exp', { duration: 0.3 });
		setTimeout("footerResetTab('exp',"+tabNum+");footerTab["+tabNum+"]=0;",300);
	}
}
function footerHideTab(tabNum) {
	if(footerTab[tabNum]==0) {
		footerTab[tabNum]=1;
		$('tab'+tabNum).morph('height:38px;',{ duration: 0.1});
		Effect.BlindDown('t'+tabNum+'-col', { duration: 0.3 });
		$('t'+tabNum+'-exp').hide();
		setTimeout("footerResetTab('col',"+tabNum+");footerTab["+tabNum+"]=0;",300);
	} else {
		if(	footerTab[tabNum]==1) {
			footerTab[tabNum]=2
			setTimeout("footerHideTab(" + tabNum + ")",300);
		}
	}
}
function footerResetTab(expCol,tabNum) {
	document.getElementById('t'+tabNum+'-col').style.height='';
	document.getElementById('t'+tabNum+'-exp').style.height='';
	if(expCol=='exp') {
		document.getElementById('t'+tabNum+'-col').style.display='none';
		document.getElementById('t'+tabNum+'-exp').style.display='';
	} else {
		document.getElementById('t'+tabNum+'-exp').style.display='none';
		document.getElementById('t'+tabNum+'-col').style.display='';
	}
}

function navThumbSlide(itemID, direction, distance, numberVisible) {
	var navThumbWindowInner=document.getElementById(itemID+'WindowInner');
	var navThumbUL=document.getElementById(itemID+'UL');
	if(parseInt(navThumbWindowInner.style.left.toString().replace('px','')) % distance==0) {
		if(direction=="left") {
			if(parseInt(navThumbWindowInner.style.left.toString().replace('px',''))<=-distance) {
				new Effect.Move(navThumbWindowInner,{x: distance,y: 0});
			}
		} else if(direction=="right") {
			if(parseInt(navThumbUL.offsetWidth.toString().replace('px',''))+parseInt(navThumbWindowInner.style.left.toString().replace('px',''))>distance*numberVisible) {
				new Effect.Move(navThumbWindowInner,{x: -distance,y: 0});
			}
		}
		setTimeout("navThumbArrows('"+itemID+"',"+distance+","+numberVisible+")",500);
	}
}
function navThumbArrows(itemID,distance,numberVisible) {
	var navThumbWindowInner=document.getElementById(itemID+'WindowInner');
	var navThumbUL=document.getElementById(itemID+'UL');
	leftArrow=document.getElementById(itemID+'LeftArrow');
	rightArrow=document.getElementById(itemID+'RightArrow');
	if(rightArrow.style.display=='none') {
		if(parseInt(navThumbUL.offsetWidth.toString().replace('px',''))+parseInt(navThumbWindowInner.style.left.toString().replace('px',''))>distance*numberVisible) {
			rightArrow.style.display='inline'
		}
	} else {
		if(parseInt(navThumbUL.offsetWidth.toString().replace('px',''))+parseInt(navThumbWindowInner.style.left.toString().replace('px',''))<=((numberVisible+1)*distance)-1) {
			rightArrow.style.display='none'
		}
	}
	if(leftArrow.style.display=='none') {
		if(parseInt(navThumbWindowInner.style.left.toString().replace('px',''))<0) {
			leftArrow.style.display='inline';
		}
	} else {
		if(parseInt(navThumbWindowInner.style.left.toString().replace('px',''))>-distance) {
			leftArrow.style.display='none';
		}
	}

}

