var bIE = (navigator.appName.indexOf("Microsoft Internet Explorer") != -1) ? true : false;    // true for Internet Explorer
var bNetscape = (navigator.appName.indexOf("Netscape") != -1) ? true : false;    	      // true for Netscape

var sClientLine = "the Savannah Bed & Breakfast Association, Blackbaud LLC., the Virtual Wellness Networks and";

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}


function getLongDay(intDay) {
	var dayArray = new Array("Sunday", "Monday", "Tuesday", "Wednesday",
								 "Thursday", "Friday", "Saturday");
	return dayArray[intDay];
}

function getLongMonth(intMonth) {
	var monthArray = new Array("January", "February", "March",
								   "April", "May", "June",
								   "July", "August", "September",
								   "October", "November", "December");
	return monthArray[intMonth];
}

function getTodaysDate() {
	var today = new Date();
	var ld = today.getDay();
	var dayofweek = getLongDay(ld);
	var d = today.getDate();
	var day = (d < 10) ? '0'+d : d;
	var m = today.getMonth();
	var month = getLongMonth(m);
	var yy = today.getYear();
	var year = (yy < 2000) ? yy + 1900 : yy;
	
	var todayStr = dayofweek +",&nbsp;" + month + " " + day + ", " + year;
	
	return todayStr;
}

function eZone(){
  alert("... you are definitely not ready for this ...");
}

var bWinBWPortal = 0;

function popupBWPortal(){
  if(bWinBWPortal == 0){
  	hWinBWPortal = window.open('bwportal.htm', 'hWinBWPortal', 'toolbar=0,scrollbars=0,location=0,status=0,menubar=0,resizable=0,width=380,height=400,top=40,left=200,screenX=40,screenY=200');
    bWinBWPortal = 1;
  }
  else{
    if(hWinBWPortal.closed){
      hWinBWPortal = window.open('bwportal.htm', 'hWinBWPortal', 'toolbar=0,scrollbars=0,location=0,status=0,menubar=0,resizable=0,width=380,height=400,top=40,left=200,screenX=40,screenY=200');
    }
    else{
      hWinBWPortal.focus();
    }
  }
  startAnimatedGIF();
}

var bWinIUPortal = 0;

function popupIUPortal(){
  if(bWinIUPortal == 0){
  	hWinIUPortal = window.open('iuportal.htm', 'hWinIUPortal', 'toolbar=0,scrollbars=0,location=0,status=0,menubar=0,resizable=0,width=380,height=400,top=40,left=40,screenX=40,screenY=40');
    bWinIUPortal = 1;
  }
  else{
    if(hWinIUPortal.closed){
      hWinIUPortal = window.open('iuportal.htm', 'hWinIUPortal', 'toolbar=0,scrollbars=0,location=0,status=0,menubar=0,resizable=0,width=380,height=400,top=40,left=40,screenX=40,screenY=40');
    }
    else{
      hWinIUPortal.focus();
    }
  }
  startAnimatedGIF();
}

var bWinDBPortal = 0;

function popupDBPortal(){
  if(bWinDBPortal == 0){
  	hWinDBPortal = window.open('dbportal.htm', 'hWinDBPortal', 'toolbar=0,scrollbars=0,location=0,status=0,menubar=0,resizable=0,width=380,height=600,top=40,left=120,screenX=40,screenY=120');
    bWinDBPortal = 1;
  }
  else{
    if(hWinDBPortal.closed){
      hWinDBPortal = window.open('dbportal.htm', 'hWinDBPortal', 'toolbar=0,scrollbars=0,location=0,status=0,menubar=0,resizable=0,width=380,height=600,top=40,left=120,screenX=40,screenY=120');
    }
    else{
      hWinDBPortal.focus();
    }
  }
  startAnimatedGIF();
}

var bWinPROPortal = 0;

function popupPROPortal(){
  if(bWinPROPortal == 0){
  	hWinPROPortal = window.open('proportal.htm', 'hWinPROPortal', 'toolbar=0,scrollbars=0,location=0,status=0,menubar=0,resizable=0,width=600,height=420,top=50,left=50,screenX=50,screenY=50');
    bWinPROPortal = 1;
  }
  else{
    if(hWinPROPortal.closed){
      hWinPROPortal = window.open('proportal.htm', 'hWinPROPortal', 'toolbar=0,scrollbars=0,location=0,status=0,menubar=0,resizable=0,width=600,height=420,top=50,left=50,screenX=50,screenY=50');
    }
    else{
      hWinPROPortal.focus();
    }
  }
  startAnimatedGIF();
}

var bWinCredits = 0;

function popupCredits(){
  if(bWinCredits == 0){
  	hWinCredits = window.open('credits.htm', 'hWinCredits', 'toolbar=0,scrollbars=0,location=0,status=0,menubar=0,resizable=0,width=600,height=200,top=10,left=10,screenX=10,screenY=10');
    bWinCredits = 1;
  }
  else{
    if(hWinCredits.closed){
      hWinCredits = window.open('credits.htm', 'hWinCredits', 'toolbar=0,scrollbars=0,location=0,status=0,menubar=0,resizable=0,width=600,height=200,top=10,left=10,screenX=10,screenY=10');
    }
    else{
      hWinCredits.focus();
    }
  }
  startAnimatedGIF();
}

var bWinAwards = 0;

function popupAwards(){
  if(bWinAwards == 0){
  	hWinAwards = window.open('awards.htm', 'hWinAwards', 'toolbar=0,scrollbars=0,location=0,status=0,menubar=0,resizable=0,width=600,height=200,top=10,left=10,screenX=10,screenY=10');
    bWinAwards = 1;
  }
  else{
    if(hWinAwards.closed){
      hWinAwards = window.open('awards.htm', 'hWinAwards', 'toolbar=0,scrollbars=0,location=0,status=0,menubar=0,resizable=0,width=600,height=200,top=10,left=10,screenX=10,screenY=10');
    }
    else{
      hWinAwards.focus();
    }
  }
  startAnimatedGIF();
}

var bWinLinks = 0;

function popupLinks(){
  if(bWinLinks == 0){
  	hWinLinks = window.open('links.htm', 'hWinLinks', 'toolbar=0,scrollbars=0,location=0,status=0,menubar=0,resizable=0,width=600,height=200,top=10,left=10,screenX=10,screenY=10');
    bWinLinks = 1;
  }
  else{
    if(hWinLinks.closed){
      hWinLinks = window.open('links.htm', 'hWinLinks', 'toolbar=0,scrollbars=0,location=0,status=0,menubar=0,resizable=0,width=600,height=200,top=10,left=10,screenX=10,screenY=10');
    }
    else{
      hWinLinks.focus();
    }
  }
  startAnimatedGIF();
}

var bWinOtherWork = "0";

function popupOtherWork(){
  if(bWinOtherWork == 0){
  	hWinOtherWork = window.open('otherwork.htm', 'hWinOtherWork', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=770,height=440,top=22,left=22');
    bWinOtherWork = 1;
  }
  else{
    if(hWinOtherWork.closed){
      hWinOtherWork = window.open('otherwork.htm', 'hWinOtherWork', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=770,height=440,top=22,left=22');
    }
    else{
      hWinOtherWork.focus();
    }
  }
  startAnimatedGIF();
}

function getObjbyId(name){
  this.obj = document.getElementById(name);
  this.style = document.getElementById(name).style;
}

function getObjbyAll(name){
  this.obj = document.all[name];
  this.style = document.all[name].style;
}

function getObjbyLayers(name){
  this.obj = document.layers[name];
  this.style = document.layers[name].style;
}

function dismissBWWarning(){ 
  if(document.getElementById){ 
	var x = new getObjbyId('spanBWWarning');
	x.style.visibility = "hidden";
  }
  else if(document.all){ 
        var y = new getObjbyAll('spanBWWarning');
	y.style.visibility = "hidden";
  }
  else if(document.layers){ 
	var z = new getObjbyLayers('spanBWWarning');
	z.style.visibility = "hidden";
  }
}

var imgAGURL = "images/rtLogos.gif";

function startAnimatedGIF(){
  if(document.imgRTLogos){
  	document.imgRTLogos.src = imgAGURL;
  }
}

var preloadFlag = false;

function winInit(){
  if(document.images){ 
	imgIX00 = newImage("images/miguel.gif");
	imgIR01 = newImage("images/inlayresp01_16x75.gif");
	imgIR02 = newImage("images/inlayresp02_16x75.gif");
	imgIR03 = newImage("images/inlayresp03_16x75.gif");
	imgBKGD10 = newImage("images/backdrop10_over.gif");
	preloadFlag = true;

	dismissBWWarning();

	return true;
  }
}
