/*
BA - Before and after mouth shots ONLY
-------------------------------------------------*/

function casesBA(galNumber,beforeMouth,afterMouth,caption) {
	
	// Make before and after mouth invisible
	beforeMouth.style.opacity = 0/100;
	beforeMouth.style.filter = "alpha(opacity=" + 0 + ")";
	afterMouth.style.opacity = 0/100;
	afterMouth.style.filter = "alpha(opacity=" + 0 + ")";
	
	// Add "Before" and "After" Img caption
	imgText_before = document.createElement("span");
	imgText_beforeTxt = document.createTextNode("Before");
	
	imgText_before.appendChild(imgText_beforeTxt);
	beforeMouth.appendChild(imgText_before);
	
	imgText_after = document.createElement("span");
	imgText_afterTxt = document.createTextNode("After");
	
	imgText_after.appendChild(imgText_afterTxt);
	afterMouth.appendChild(imgText_after);
	
	// Get dimensions
	var beforeMouth_img = beforeMouth.getElementsByTagName("img");
	var beforeMouth_imgWidth = beforeMouth_img[0].getAttribute("width");
	var beforeMouth_imgHeight = beforeMouth_img[0].getAttribute("height");
	
	var afterMouth_img = afterMouth.getElementsByTagName("img");
	var afterMouth_imgWidth = afterMouth_img[0].getAttribute("width");
	var afterMouth_imgHeight = afterMouth_img[0].getAttribute("height");
	
	// Position the before mouth and after mouth LIs
	beforeMouth.style.width = beforeMouth_imgWidth;
	beforeMouth.style.left = "50%";
	beforeMouth_imgWidth = (beforeMouth_imgWidth * -1)/2;
	beforeMouth_imgWidth = beforeMouth_imgWidth.toString();
	beforeMouth.style.marginLeft = beforeMouth_imgWidth + "px";
	beforeMouth.style.top = "50%";
	beforeMouth_imgHeight = (beforeMouth_imgHeight * -1)/2;
	beforeMouth_imgHeight = beforeMouth_imgHeight.toString();
	beforeMouth.style.marginTop = beforeMouth_imgHeight + "px";
	
	afterMouth.style.width = afterMouth_imgWidth;
	afterMouth.style.left = "50%";
	afterMouth_imgWidth = (afterMouth_imgWidth * -1)/2;
	afterMouth_imgWidth = afterMouth_imgWidth.toString();
	afterMouth.style.marginLeft = afterMouth_imgWidth + "px";
	afterMouth.style.top = "50%";
	afterMouth_imgHeight = (afterMouth_imgHeight * -1)/2;
	afterMouth_imgHeight = afterMouth_imgHeight.toString();
	afterMouth.style.marginTop = afterMouth_imgHeight + "px";
	
	// Fade in before mouth
	i = 0;
	speed = 5;
	whichElem = beforeMouth;
	fadeIn();
	
	// Fade in after (wait 2 seconds)
	afterFadeIn = function() {
						i = 0;
						speed = 5;
						whichElem = afterMouth;
						fadeIn();
					}
	afterFadeIn_moving = setTimeout(afterFadeIn,2500);
	
	// Move before and after
	beforeFinal_x = (1.75 * beforeMouth_imgWidth);
	beforeFinal_x = Math.ceil(beforeFinal_x);
	beforeFinal_y = (1.75 * beforeMouth_imgHeight);
	beforeFinal_y = Math.ceil(beforeFinal_y);
	afterFinal_x = (.25 * afterMouth_imgWidth);
	afterFinal_x = Math.ceil(afterFinal_x);
	afterFinal_y = (.25 * afterMouth_imgHeight);
	afterFinal_y = Math.ceil(afterFinal_y);
	
	moveBeforeAfterMouth = function() {
								moveBefore = moveElement(beforeMouth,beforeFinal_x,beforeFinal_y,40);
								moveAfter = moveElement(afterMouth,afterFinal_x,afterFinal_y,40);
								};
	moveBeforeAfterMouth_moving = setTimeout(moveBeforeAfterMouth,4000);
	}

/*
BAF - Before and after mouth shots WITH face after shot
-------------------------------------------------*/

function casesBAF(galNumber,beforeMouth,afterMouth,afterFace,caption) {
	
	// Make before & after mouth and after face invisible
	beforeMouth.style.opacity = 0/100;
	beforeMouth.style.filter = "alpha(opacity=" + 0 + ")";
	afterMouth.style.opacity = 0/100;
	afterMouth.style.filter = "alpha(opacity=" + 0 + ")";
	afterFace.style.opacity = 0/100;
	afterFace.style.filter = "alpha(opacity=" + 0 + ")";
	
	// Add "Before" and "After" Img caption
	imgText_before = document.createElement("span");
	imgText_beforeTxt = document.createTextNode("Before");
	
	imgText_before.appendChild(imgText_beforeTxt);
	beforeMouth.appendChild(imgText_before);
	
	imgText_after = document.createElement("span");
	imgText_afterTxt = document.createTextNode("After");
	
	imgText_after.appendChild(imgText_afterTxt);
	afterMouth.appendChild(imgText_after);
	
	// Get dimensions
	var beforeMouth_img = beforeMouth.getElementsByTagName("img");
	var beforeMouth_imgWidth = beforeMouth_img[0].getAttribute("width");
	var beforeMouth_imgHeight = beforeMouth_img[0].getAttribute("height");
	
	var afterMouth_img = afterMouth.getElementsByTagName("img");
	var afterMouth_imgWidth = afterMouth_img[0].getAttribute("width");
	var afterMouth_imgHeight = afterMouth_img[0].getAttribute("height");
	
	var afterFace_img = afterFace.getElementsByTagName("img");
	var afterFace_imgWidth = afterFace_img[0].getAttribute("width");
	var afterFace_imgHeight = afterFace_img[0].getAttribute("height");
	
	// Position the before mouth, after mouth and after face LIs
	beforeMouth.style.width = beforeMouth_imgWidth;
	beforeMouth.style.left = "50%";
	beforeMouth_imgWidth = (beforeMouth_imgWidth * -1)/2;
	beforeMouth_imgWidth = beforeMouth_imgWidth.toString();
	beforeMouth.style.marginLeft = beforeMouth_imgWidth + "px";
	beforeMouth.style.top = "40%";
	beforeMouth_imgHeight = (beforeMouth_imgHeight * -1)/2;
	beforeMouth_imgHeight = beforeMouth_imgHeight.toString();
	beforeMouth.style.marginTop = beforeMouth_imgHeight + "px";
	
	afterMouth.style.width = afterMouth_imgWidth;
	afterMouth.style.left = "50%";
	afterMouth_imgWidth = (afterMouth_imgWidth * -1)/2;
	afterMouth_imgWidth = afterMouth_imgWidth.toString();
	afterMouth.style.marginLeft = afterMouth_imgWidth + "px";
	afterMouth.style.top = "40%";
	afterMouth_imgHeight = (afterMouth_imgHeight * -1)/2;
	afterMouth_imgHeight = afterMouth_imgHeight.toString();
	afterMouth.style.marginTop = afterMouth_imgHeight + "px";
	
	afterFace.style.width = afterFace_imgWidth;
	afterFace.style.left = "50%";
	afterFace_imgWidth = (afterFace_imgWidth * -1);
	afterFace_imgWidth = afterFace_imgWidth.toString();
	afterFace.style.marginLeft = afterFace_imgWidth + "px";
	afterFace.style.top = "40%";
	afterFace_imgHeight = (afterFace_imgHeight * -1)/2;
	afterFace_imgHeight = afterFace_imgHeight.toString();
	afterFace.style.marginTop = afterFace_imgHeight + "px";
	
	// Fade in before mouth
	i = 0;
	speed = 5;
	whichElem = beforeMouth;
	fadeIn();
	
	// Fade in after (wait 2 seconds)
	afterFadeIn = function() {
						i = 0;
						speed = 5;
						whichElem = afterMouth;
						fadeIn();
					}
	afterFadeIn_moving = setTimeout(afterFadeIn,2500);
	
	// Move before and after
	beforeFinal_x = (1.75 * beforeMouth_imgWidth) + 250;
	beforeFinal_x = Math.ceil(beforeFinal_x);
	beforeFinal_y = (2 * beforeMouth_imgHeight);
	beforeFinal_y = Math.ceil(beforeFinal_y);
	afterFinal_x = (1.75 * afterMouth_imgWidth) + 250;
	afterFinal_x = Math.ceil(afterFinal_x);
	afterFinal_y = (-.15 * afterMouth_imgHeight);
	afterFinal_y = Math.ceil(afterFinal_y);
	
	moveBeforeAfterMouth = function() {
								moveBefore = moveElement(beforeMouth,beforeFinal_x,beforeFinal_y,40);
								moveAfter = moveElement(afterMouth,afterFinal_x,afterFinal_y,40);
								};
	moveBeforeAfterMouth_moving = setTimeout(moveBeforeAfterMouth,4000);
	
	// Fade face in after (wait 5 seconds)
	afterFaceFadeIn = function() {
						i = 0;
						speed = 5;
						whichElem = afterFace;
						fadeIn();
					}
	afterFaceFadeIn_moving = setTimeout(afterFaceFadeIn,5000);
	}
