// JavaScript Document

	//server hosts default.htm
	var serverPath = 'http://www.lhm.org/'       
//	var serverPath = 'http://10.1.2.666/'   		 

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;
}

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];}}
}

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];}
}

function MM_findObj(n, d) { //v4.0
  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 && document.getElementById) x=document.getElementById(n); return x;
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function OpenSubscribe(){
	var sURL = 'http://www.lhm.org/email/login.asp'
	//var sURL = 'http://www.lhm.org/pmtupdate/'		
	var windowSettings='toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,' +
								'resizable=yes,width=600,height=425,top=200,left=250';
  window.open(sURL,'',windowSettings);
}	

function OpenPassword(){
	var windowSettings='toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,' +
								'resizable=yes,width=460,height=300,top=150,left=400';
  window.open('forgotpwd.asp','',windowSettings);
}	

function OpenGuide(){
	var windowSettings='toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,' +
								'resizable=yes,width=460,height=400,top=150,left=400';
  window.open('bbsguide.htm','',windowSettings);
}	

function MyOpenWindow(URL) {
	var windowSettings="toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,"+
								"resizable=yes,width=600,height=425,top=200,left=250";
  window.open(URL,'',windowSettings);
}

	function URLHandler(pageURL,newWindow){
		var myPage
		var myNew 
		
		if (pageURL == 'broadcastinformation.htm') { 
			myPage = 'broadcastinformation.asp';
			myNew = 0;	
		}	
		else {
			myPage = pageURL;
			myNew = newWindow;
		}

		if (myPage.substr(0,4) !='http'){
			myPage = serverPath + myPage;
		}
		
	  if (myNew != 1) {
			location.href = myPage;
		}
		else {
  		window.open(myPage);
		}
	}

	function GoDevotions() {  
//		var date = new Date();
//		var day  = date.getDate();
//		var month = date.getMonth() + 1;
//		var yy = date.getYear();
//		var year = (yy < 1000) ? yy + 1900 : yy;
//		
//		var sDay = (day <10) ? '0' + day : '' + day;
//		var sMonth = (month < 10) ? '0' + month : '' + month;
//		
//		if (((year + sMonth + sDay) < '20021201') || ((year + sMonth + sDay) > '20030106')) {
//			location.href = serverPath + 'devotions/' + month + '.'  + day + '.' + year + '.htm';
//		}
//		else {
//		  location.href = 'http://www.adventdevotions.net/' + month + '.'  + day + '.' + year + '.htm';
//		}
// JTH 11/14/2003 - CHANGED LOCATION.HREF TO ABSOLUTE PATH SINCE FILES IN SUBFOLDERS ALSO USE THIS SCRIPT.
//                  PAGE WAS NOT BEING LOCATED.
//		location.href = serverPath + 'dailydevotions.asp'
		location.href = 'http://www.lhm.org/dailydevotions.asp'
	}

function EmailStory(sDate)
	{
		var URL = 'http://www.lhm.org/emailpg.asp?PageName=http://www.lhm.org/equipping/newsletter.asp?date=' + sDate
		var windowSettings = 'height=530,width=560,top=100,left=250,resizable=yes,resizable=yes,scrollbars=yes,menubar=no,toolbar=no,location=no';
		window.open(URL,'', windowSettings);
  }
