var restarea=20 //1) width of the "neutral" area in the center of the gallery in px
var maxspeed=3 //2) top scroll speed in pixels. Script auto creates a range from 0 to top speed.
var endofgallerymsg="<span style='font-size: 11px'>End of Gallery</span>" //3) message to show at end of gallery. Enter "" to disable message.

function ShowInfo(Person){ 
var message = ""
	switch(Person){
		case "David":
			message="David is Trent's younger brother.  He is also Trent's Best Man for the wedding.  He recently came home from serving as an MP for the Army in Kosovo.  David is working on completing his Bachelor's degree.  He just hasn't decided in what yet.  Although Trent and David have a 12 year age difference, and Trent gave David a very hard time growing up, they have become very close friends over the years and Trent is happy to have David as his Best Man.";
			break;
		case "Brad":
			message="Brad and Trent met while Trent lived in Capitola, near Santa Cruz.  They worked together in a machine shop.  Brad worked as a mechanical designer.  Brad now works for Bell Helmets and is a lead person working on the next Lance Armstrong helmet.  He has a 10 year old daughter, is an avid snowboarder, basketball player, and mountain biker.  Even though Trent has moved down south, he and Brad have continued to stay good friends.";
			break;
		case "Mike":
			message="Mike is Trent's brother-in-law.  There is a lot that can be said about Mike.  Trent introduced his sister to Mike who was his high school water polo coach at the time.  Mike is a very good athlete himself, although he could stand to improve his golf game.  Mike works as a civil engineer for the San Bernardino Valley Municipal Water District, and he and his family just built a new house in Yucaipa that they recently moved into.  Mike is a big USC and Oakland Raider fan.  Try not to hold that against him.";
			break;
		case "Jami":
			message="Jami is Cherry's younger sister and her Maid of Honor.  Jami and Cherry have been through happy, heartbreaking, and comical times together.  She has the purest of hearts and is the kindest person to know.  She is a great sister and a devoted daughter.  Her smile and her positive attitude are very contagious.  She is the type of person that you just love to be with.  Cherry and Jami have shared laughter and heartbreaks, success and disappointments and on this very special day, Cherry is truly thankful that she is right here beside her.  She could not ask for anything more from a sister and a friend.";
			break;
		case "Camille":
			message="Camille is Cherry's Cousin.  Cherry remembers taking her pictures when they were both younger and she would pose for Cherry with no care in the world.  She hasn't changed much since then.  She still is the same curious little girl who has grown into an intelligent and beautiful woman.";
			break;
		case "Margarita":
			message="Margarita (Maggie) and Cherry met through Trent's friend Geoff.  Maggie is Geoff's girlfriend, and Cherry and Maggie quickly became close friends themselves.  Whenever Cherry and Maggie get together, mischief is sure to follow.  Maggie is one spicy latina who is not afraid to speak her mind.  She is a great cook, and an even better blended Strawberry Margarita maker.  Maggie is hoping to rope Geoff into marriage herself in the near future.";
			break;
		case "Christine":
			message="Christine is Cherry's 'lil sis'.  Cherry has witnessed Christine grow-up from a charming young girl to a bright and beautiful lady that she is extremely proud of.  It is so wonderful to watch her mature.  She helped Cherry pick out her wedding gown.  That was a very memorable experience for Cherry, and she helped to make it extra special.";
			break;
		case "Kaitlyn":
			message="Kaitlyn is Trent's only niece and is the flower girl for the wedding.  She has three brothers. One is older, and 2 are younger.  This makes her the princess of the family.  She is the most girly girl anyone could imagine.  Kaitlyn loves to make crafts and to draw and paint pictures.  She is turning into a talented little artist.  You might want to ask for her autograph before she becomes too famous.";
			break;	
		case "Lucas":
			message="Lucas is the youngest of 4 children and he is the ring bearer for the wedding.  His middle name is Trent after his Uncle Trent that is getting married.  That is obviously where he gets his good looks from!  Lucas has such a fun personality, it is contagious.  He loves to laugh, can be shy at times, but definitely is an independent little man.  Be sure to ask him to give you his 'evil' laugh.  You may just start laughing yourself!";
			break;
	}
	document.getElementById('attendantinfo').value=message;
}

////NO NEED TO EDIT BELOW THIS LINE////////////

var iedom=document.all||document.getElementById
var scrollspeed=0
var movestate=""

var actualwidth=''
var cross_scroll, ns_scroll
var loadedyes=0

function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function creatediv(){
statusdiv=document.createElement("div")
statusdiv.setAttribute("id","statusdiv")
document.body.appendChild(statusdiv)
statusdiv=document.getElementById("statusdiv")
statusdiv.innerHTML=endofgallerymsg
}

function positiondiv(){
menuheight=parseInt(crossmain.offsetHeight)
mainobjoffsetH=getposOffset(crossmain, "top")
statusdiv.style.left=mainobjoffset+(menuwidth/2)-(statusdiv.offsetWidth/2)+"px"
statusdiv.style.top=menuheight+mainobjoffsetH+"px"
}

function showhidediv(what){
if (endofgallerymsg!="")
statusdiv.style.visibility=what
}

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft: what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}


function moveleft(){
if (loadedyes){
movestate="left"
if (iedom&&parseInt(cross_scroll.style.left)>(menuwidth-actualwidth)){
cross_scroll.style.left=parseInt(cross_scroll.style.left)-scrollspeed+"px"
showhidediv("hidden")
}
else
showhidediv("visible")
}
lefttime=setTimeout("moveleft()",10)
}

function moveright(){
if (loadedyes){
movestate="right"
if (iedom&&parseInt(cross_scroll.style.left)<0){
cross_scroll.style.left=parseInt(cross_scroll.style.left)+scrollspeed+"px"
showhidediv("hidden")
}
else
showhidediv("visible")
}
righttime=setTimeout("moveright()",10)
}

function motionengine(e){
var dsocx=(window.pageXOffset)? pageXOffset: ietruebody().scrollLeft;
var dsocy=(window.pageYOffset)? pageYOffset : ietruebody().scrollTop;
var curposy=window.event? event.clientX : e.clientX? e.clientX: ""
curposy-=mainobjoffset-dsocx
var leftbound=(menuwidth-restarea)/2
var rightbound=(menuwidth+restarea)/2
if (curposy>rightbound){
scrollspeed=(curposy-rightbound)/((menuwidth-restarea)/2) * maxspeed
if (window.righttime) clearTimeout(righttime)
if (movestate!="left") moveleft()
}
else if (curposy<leftbound){
scrollspeed=(leftbound-curposy)/((menuwidth-restarea)/2) * maxspeed
if (window.lefttime) clearTimeout(lefttime)
if (movestate!="right") moveright()
}
else
scrollspeed=0
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function stopmotion(e){
if ((window.event&&!crossmain.contains(event.toElement)) || (e && e.currentTarget && e.currentTarget!= e.relatedTarget && !contains_ns6(e.currentTarget, e.relatedTarget))){
if (window.lefttime) clearTimeout(lefttime)
if (window.righttime) clearTimeout(righttime)
movestate=""
}
}

function fillup(){
if (iedom){
crossmain=document.getElementById? document.getElementById("motioncontainer") : document.all.motioncontainer
menuwidth=parseInt(crossmain.style.width)
mainobjoffset=getposOffset(crossmain, "left")
cross_scroll=document.getElementById? document.getElementById("attendantgallery") : document.all.attendantgallery
actualwidth=document.all? cross_scroll.offsetWidth : document.getElementById("trueContainer").offsetWidth

crossmain.onmousemove=function(e){
motionengine(e)
}

crossmain.onmouseout=function(e){
stopmotion(e)
showhidediv("hidden")
}
}
loadedyes=1
if (endofgallerymsg!=""){
creatediv()
positiondiv()
}
}
window.onload=fillup