﻿var preloadFlag = true;
function preloadImages() {
	if (document.images) {
		pre_contactdown = newImage('common/contactdown.gif');
		pre_homedown = newImage('common/homedown.gif');
		pre_home_over = newImage('navigation/home_over.jpg');
		pre_birthmother_over = newImage('navigation/birthmother_over.jpg');
		pre_adoptive_parents_over = newImage('navigation/adoptive_parents_over.jpg');
		pre_financing_over = newImage('navigation/financing_over.jpg');
		pre_homestudy_over = newImage('navigation/homestudy_over.jpg');
		pre_know_over = newImage('navigation/know_over.jpg');
		pre_kidcounseling_over = newImage('navigation/kidcounseling_over.jpg');
		pre_seminar2_over = newImage('home/seminar2_over.jpg');
		pre_remember_over = newImage('home/remember_over.gif');
		pre_subs_birth1b = newImage('birth/subs_birth1b.png');
		pre_subs_birth2b = newImage('birth/subs_birth2b.png');
		pre_subs_birth3b = newImage('birth/subs_birth3b.png');
		pre_subs_birth4b = newImage('birth/subs_birth4b.png');
		pre_subs_birth5b = newImage('birth/subs_birth5b.png');
		pre_subs_adoptive1b = newImage('adoptive/subs_adoptive1b.gif');
		pre_subs_adoptive2b = newImage('adoptive/subs_adoptive2b.gif');
		pre_subs_adoptive3b = newImage('adoptive/subs_adoptive3b.gif');
		pre_subs_adoptive4b = newImage('adoptive/subs_adoptive4b.gif');
		pre_subs_adoptive5b = newImage('adoptive/subs_adoptive5b.gif');
		preloadFlag = true;
	}
}

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImagesArray(array) {
	if (preloadFlag == true) {
		var d = document; var img;
		for (var i=0; i<array.length; i+=2) {
			img = null; var n = array[i];
			if (d.images) {img = d.images[n];}
			if (!img && d.getElementById) {img = d.getElementById(n);}
			if (img) {img.src = array[i+1];}
		}
	}
}

function changeImages() {
	changeImagesArray(changeImages.arguments);
}


//Copyright 2002 B ontrager Conection, LLC
//
// Type the number of images you are rotating.

NumberOfImagesToRotate = 8;

// Specify the first and last part of the image tag.

FirstPart = '<img src="home/bmomad/bmomad';
LastPart = '.png" height="255" width="155" border="0">';

function printImage() {
var r = Math.ceil(Math.random() * NumberOfImagesToRotate);
document.write(FirstPart + r + LastPart);
}


mArray=new Array();
mArray[1] = "adoptionsupportcenter,info,com";  
	
function openmail(id) {
		minfo=mArray[id].split(",");
		addr=minfo[1]+"@"+minfo[0]+"."+minfo[2];
		document.location.href="mai" + "lto:" + addr;
}
