// JavaScript Document

/***********************************************
* Image Thumbnail Viewer II script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* Visit http://www.dynamicDrive.com for hundreds of DHTML scripts
* This notice must stay intact for legal use
***********************************************/

//Specify image paths and optional link (set link to "" for no link):
var dynimages2=new Array()
dynimages2[0]=["images/videos/jerkristinge.jpg", "window.open('video_pages/jeramie_kristin_jam.htm','Videos','width=255px, height=275px, scrollbars=no, toolbar=no, resizable=no status=no menubar=no');"]
dynimages2[1]=["images/videos/nap_dyn.jpg", "window.open('video_pages/nap_dyn.htm','Videos','width=255px, height=275px, scrollbars=no, toolbar=no, resizable=no status=no menubar=no');"]
dynimages2[2]=["images/videos/jerevita02.jpg", "window.open('video_pages/jeramie_evita_02.htm','Videos','width=255px, height=275px, scrollbars=no, toolbar=no, resizable=no status=no menubar=no');"]
dynimages2[3]=["images/videos/jercrista06.jpg", "window.open('video_pages/jeramie_crista_06.htm','Videos','width=255px, height=275px, scrollbars=no, toolbar=no, resizable=no status=no menubar=no');"]



//Preload images ("yes" or "no"):
var preloadimg2="yes"

//Set optional link target to be added to all images with a link:
var optlinktarget2=""

//Set image border width
var imgborderwidth2=0

//Optionally, change 1.0 and 0.7 below to affect Wipe gradient size and duration in seconds in IE5.5+:
var filterstring2="progid:DXImageTransform.Microsoft.GradientWipe(GradientSize=1.0 Duration=0.7)"

///////No need to edit beyond here/////

if (preloadimg2=="yes"){
for (x=0; x<dynimages2.length; x++){
var myimage2=new Image()
myimage2.src=dynimages2[x][0]
}
}

function returnimgcode2(theimg){
var imghtml2=""
if (theimg[1]!="")
imghtml2='<a href="#" onclick="'+theimg[1]+'" target="'+optlinktarget2+'">'
imghtml2+='<img src="'+theimg[0]+'" border="'+imgborderwidth2+'">'
if (theimg[1]!="")
imghtml2+='</a>'
return imghtml2
}

function modifyimage2(loadarea, imgindex){
if (document.getElementById){
var imgobj2=document.getElementById(loadarea)
if (imgobj2.filters && window.createPopup){
imgobj2.style.filter=filterstring2
imgobj2.filters[0].Apply()
}
imgobj2.innerHTML=returnimgcode2(dynimages2[imgindex])
if (imgobj2.filters && window.createPopup)
imgobj2.filters[0].Play()
return false
}
}

/***********************************************
* Image Thumbnail Viewer II script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* Visit http://www.dynamicDrive.com for hundreds of DHTML scripts
* This notice must stay intact for legal use
***********************************************/

//Specify image paths and optional link (set link to "" for no link):
var dynimages=new Array()
dynimages[0]=["images/media/photos/photos_01.jpg", ""]
dynimages[1]=["images/media/photos/photos_02.jpg", ""]
dynimages[2]=["images/media/photos/photos_03.jpg", ""]
dynimages[3]=["images/media/photos/photos_04.jpg", ""]
dynimages[4]=["images/media/photos/photos_05.jpg", ""]
dynimages[5]=["images/media/photos/photos_06.jpg", ""]
dynimages[6]=["images/media/photos/photos_07.jpg", ""]
dynimages[7]=["images/media/photos/photos_08.jpg", ""]
dynimages[8]=["images/media/photos/photos_09.jpg", ""]
dynimages[9]=["images/media/photos/photos_10.jpg", ""]
dynimages[10]=["images/media/photos/photos_11.jpg", ""]
dynimages[11]=["images/media/photos/photos_12.jpg", ""]
dynimages[12]=["images/media/photos/photos_13.jpg", ""]
dynimages[13]=["images/media/photos/photos_14.jpg", ""]
dynimages[14]=["images/media/photos/photos_15.jpg", ""]
dynimages[15]=["images/media/photos/photos_16.jpg", ""]
dynimages[16]=["images/media/photos/photos_17.jpg", ""]
dynimages[17]=["images/media/photos/photos_18.jpg", ""]
dynimages[18]=["images/media/photos/photos_19.jpg", ""]
dynimages[19]=["images/media/photos/photos_20.jpg", ""]
dynimages[20]=["images/media/photos/photos_21.jpg", ""]
dynimages[21]=["images/media/photos/photos_22.jpg", ""]
dynimages[22]=["images/media/photos/photos_23.jpg", ""]
dynimages[23]=["images/media/photos/photos_24.jpg", ""]
dynimages[24]=["images/media/photos/photos_25.jpg", ""]
dynimages[25]=["images/media/photos/photos_26.jpg", ""]
dynimages[26]=["images/media/photos/photos_27.jpg", ""]

//Preload images ("yes" or "no"):
var preloadimg="no"

//Set optional link target to be added to all images with a link:
var optlinktarget=""

//Set image border width
var imgborderwidth=0

//Optionally, change 1.0 and 0.7 below to affect Wipe gradient size and duration in seconds in IE5.5+:
var filterstring="progid:DXImageTransform.Microsoft.GradientWipe(GradientSize=1.0 Duration=0.7)"

///////No need to edit beyond here/////

if (preloadimg=="yes"){
for (x=0; x<dynimages.length; x++){
var myimage=new Image()
myimage.src=dynimages[x][0]
}
}

function returnimgcode(theimg){
var imghtml=""
if (theimg[1]!="")
imghtml='<a href="'+theimg[1]+'" target="'+optlinktarget+'">'
imghtml+='<img src="'+theimg[0]+'" border="'+imgborderwidth+'">'
if (theimg[1]!="")
imghtml+='</a>'
return imghtml
}

function modifyimage(loadarea, imgindex){
if (document.getElementById){
var imgobj=document.getElementById(loadarea)
if (imgobj.filters && window.createPopup){
imgobj.style.filter=filterstring
imgobj.filters[0].Apply()
}
imgobj.innerHTML=returnimgcode(dynimages[imgindex])
if (imgobj.filters && window.createPopup)
imgobj.filters[0].Play()
return false
}
}



/***********************************************
* CMotion Image Gallery- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* Visit http://www.dynamicDrive.com for source code
* This copyright notice must stay intact for legal use
* Modified for autowidth and optional starting positions in
* http://www.dynamicdrive.com/forums/showthread.php?t=11839 by jschuer1 8/5/06
***********************************************/

 //1) Set width of the "neutral" area in the center of the gallery.
var restarea=200;
 //2) Set top scroll speed in pixels. Script auto creates a range from 0 to top speed.
var maxspeed=7;
 //3) Set to maximum width for gallery - must be less than the actual length of the image train.
var maxwidth=1000;
 //4) Set to 1 for left start, 0 for right, 2 for center.
var startpos=0;
 //5) Set message to show at end of gallery. Enter "" to disable message.
var endofgallerymsg="";

function enlargeimage(path, optWidth, optHeight){ //function to enlarge image. Change as desired.
var actualWidth=typeof optWidth!="undefined" ? optWidth : "600px" //set 600px to default width
var actualHeight=typeof optHeight!="undefined" ? optHeight : "500px" //set 500px to  default height
var winattributes="width="+actualWidth+",height="+actualHeight+",resizable=yes"
window.open(path,"", winattributes)
}

////NO NEED TO EDIT BELOW THIS LINE////////////

var iedom=document.all||document.getElementById, scrollspeed=0, movestate='', actualwidth='', cross_scroll, ns_scroll, statusdiv, loadedyes=0, lefttime, righttime;

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(){
var mainobjoffset=getposOffset(crossmain, "left"),
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!="") {
positiondiv();
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 mainobjoffset=getposOffset(crossmain, "left"),
dsocx=(window.pageXOffset)? pageXOffset: ietruebody().scrollLeft,
dsocy=(window.pageYOffset)? pageYOffset : ietruebody().scrollTop,
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;
clearTimeout(righttime);
if (movestate!="left") moveleft();
}
else if (curposy<leftbound){
scrollspeed=(leftbound-curposy)/((menuwidth-restarea)/2) * maxspeed;
clearTimeout(lefttime);
if (movestate!="right") moveright();
}
else
scrollspeed=0;
}

function contains_ns6(a, b) {
if (b!==null)
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function stopmotion(e){
if (!window.opera||(window.opera&&e.relatedTarget!==null))
if ((window.event&&!crossmain.contains(event.toElement)) || (e && e.currentTarget && e.currentTarget!= e.relatedTarget && !contains_ns6(e.currentTarget, e.relatedTarget))){
clearTimeout(lefttime);
clearTimeout(righttime);
movestate="";
}
}

function fillup(){
if (iedom){
crossmain=document.getElementById? document.getElementById("motioncontainer") : document.all.motioncontainer;
if(typeof crossmain.style.maxWidth!=='undefined')
crossmain.style.maxWidth=maxwidth+'px';
menuwidth=crossmain.offsetWidth;
cross_scroll=document.getElementById? document.getElementById("motiongallery") : document.all.motiongallery;
actualwidth=document.getElementById? document.getElementById("trueContainer").offsetWidth : document.all['trueContainer'].offsetWidth;
if (startpos)
cross_scroll.style.left=(menuwidth-actualwidth)/startpos+'px';
crossmain.onmousemove=function(e){
motionengine(e);
}

crossmain.onmouseout=function(e){
stopmotion(e);
showhidediv("hidden");
}
}
loadedyes=1
if (endofgallerymsg!=""){
creatediv();
positiondiv();
}
if (document.body.filters)
onresize()
}
window.onload=fillup;

onresize=function(){
if (typeof motioncontainer!=='undefined'&&motioncontainer.filters){
motioncontainer.style.width="0";
motioncontainer.style.width="";
motioncontainer.style.width=Math.min(motioncontainer.offsetWidth, maxwidth)+'px';
}
menuwidth=crossmain.offsetWidth;
cross_scroll.style.left=startpos? (menuwidth-actualwidth)/startpos+'px' : 0;
}