// JavaScript Document

	<!-- Begin - Disable right-click
	function right(e) {
		var msg = "Sorry, you don't have permission to right-click.";
		if (navigator.appName == 'Netscape' && e.which == 3) {
			alert(msg);
			return false;
			}
		if (navigator.appName == 'Microsoft Internet Explorer' && event.button==2) {
			alert(msg);
			return false;
			}
		else 
			return true;
			}
		
		function disablerighclick() {
			if(document.images) {
				for(i=0;i<document.images.length;i++) {
					document.images[i].onmousedown = right;
					document.images[i].onmouseup = right;
					}
				}
		}
	// End - Disable right-click

	function jump(vPage,newURL) {
		var newLocation;
        newLocation = vPage+'?'+newURL;
        window.location = newLocation;
	}

	//Open new browser window
	function NewWindow(mypage, myname, w, h, scroll) {
		var winl = (screen.width - w) / 2;
		var wint = (screen.height - h) / 2;
		winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
		winChild = window.open(mypage, myname, winprops)
		if (parseInt(navigator.appVersion) >= 4) { winChild.window.focus(); }
	}

	//swap image - usually onmouseover event
	function MM_swapImage() { //v3.0
	  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
	   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
	}

	//swap image back to original - usually onmouseout event
	function MM_swapImgRestore() { //v3.0
	  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
	}

	//preload any images - primarily those used for swapping
	function MM_preloadImages() { //v3.0
	  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
		var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
		if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
	}

	//used with ??
	function MM_findObj(n, d) { //v4.01
	  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
		d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
	  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	  if(!x && d.getElementById) x=d.getElementById(n); return x;
	}



	// Start - E-mail subscription to COMPASS
	var good;
	function checkEmailAddress(field) {
	// the following expression must be all on one line...
	var goodEmail = field.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi);
	if (goodEmail) {
		good = true;
		}
	else {
		alert('Please enter a valid e-mail address.');
		field.focus();
		field.select();
		good = false;
	   }
	}

	//u = window.location;
	good = false;
	function SubscribeCompass() {
	checkEmailAddress(document.eMailer.address);
	if (good) {
		s = "Subscription to TheJourney COMPASS";
		b = "Please sign me up for the Compass e-mailing.  My e-mail address is: ";
		// the following expression must be all on one line...
		window.location = "mailto:compassmail@journeybound.org?subject="+s+"&body="+b+" "+document.eMailer.address.value;
	   }
	}

	function UnsubscribeCompass() {
	checkEmailAddress(document.eMailer.address);
	if (good) {
		s = "Un-Subscribe to TheJourney COMPASS";
		b = "Please remove my e-mail address from the COMPASS e-mailing.  My e-mail address is: ";
		// the following expression must be all on one line...
		window.location = "mailto:compassmail@journeybound.org?subject="+s+"&body="+b+" "+document.eMailer.address.value;
	   }
	}
	// End - E-mail subscription to COMPASS

	function FeedbackEmail(s) {
		// the following expression must be all on one line...
		window.location = "mailto:feedback@journeybound.org?subject=Feedback - "+s;
	}
	// End - E-mail Feedback

	function GeneralEmail(r,s) {
		// the following expression must be all on one line...
		window.location = "mailto:"+r+"?subject="+s;
	}
	// End - General E-mail

	// Start - Marquee scroll in e-mail text box
	ScrollSpeed = 200;
	ScrollChars = 1;
	
	function ScrollMarquee() {
		window.setTimeout('ScrollMarquee()', ScrollSpeed);
		var msg = document.eMailer.address.value;
		document.eMailer.address.value = msg.substring(ScrollChars) + msg.substring(0, ScrollChars);
	}
	//  End - Marquee scroll in e-mail text box

	// Start - Fading Slideshow	
	var slideShowSpeed = 5000		// Set slideShowSpeed (milliseconds)	
	var crossFadeDuration = 3		// Duration of crossfade (seconds)
		
	function runSlideShow(){
		if (document.all){
			document.images.SlideShow.style.filter="blendTrans(duration=2)"
			document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)"
			document.images.SlideShow.filters.blendTrans.Apply()      
		}
		document.images.SlideShow.src = preLoad[j].src
		if (document.all){
			document.images.SlideShow.filters.blendTrans.Play()
		}
		j = j + 1
		if (j > (p-1)) j=0
			t = setTimeout('runSlideShow()', slideShowSpeed)
	}
	// End - Fading Slideshow

	// Explicitly Set visibility (Show or Hide) an object
	function ShowHide(ID, optSelected) {
		var ElementID, IE, NS, state;
		IE = (document.all)? true:false
		NS = (document.layers)? true:false
		ElementID = ID;
		if (IE) 
			{
			if (optSelected == 0) {document.all[ElementID].style.visibility = "hidden"}
			else {document.all[ElementID].style.visibility = "visible"}
			}
		else if (NS) 
			{
			if (optSelected == 0) {document.all[ElementID].style.visibility = "hide"}
			else {document.all[ElementID].style.visibility = "show"}
			}
	} 		
	
	
	function GoAudio(filetoplay) {
			location.href = filetoplay;
		}
//end function

