
function formNewPictures(){
var URL = document.FormNewPictures.NewPictures.options[document.FormNewPictures.NewPictures.selectedIndex].value;
parent.home.location.href = URL;
//window.location.href = URL;
}

function formLanguage(){
var URL = document.FormLanguage.Language.options[document.FormLanguage.Language.selectedIndex].value;
parent.top.location.href = URL;
//window.location.href = URL;
}


function show_sub(Table) {
if ((navigator.appName == "Netscape") && (navigator.appVersion.substring(0,1) >= 4)){
	document.submenuflag.visibility = "hidden";
	Table.visibility= "visible";
	}
else if ((navigator.appName.substring(0,9) == "Microsoft") && (navigator.appVersion.substring(0,1) >= 4)){
	submenuflag.style.visibility = "hidden";
	Table.style.visibility = "visible";	
	}
}

function hide_sub() {
if ((navigator.appName == "Netscape") && (navigator.appVersion.substring(0,1) >= 4)){
	document.submenuflag.visibility = "hidden";
	document.submenuprog.visibility = "hidden";
	}
else if ((navigator.appName.substring(0,9) == "Microsoft") && (navigator.appVersion.substring(0,1) >= 4)){
	submenuflag.style.visibility = "hidden";
	submenuprog.style.visibility = "hidden";
	}
}

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_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_findObj(n, d) { //v3.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); return x;
}

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_callJS(jsStr) { //v2.0
  return eval(jsStr)
}

function barColor(Site) {
	if (document.all) {
		if (Site == "A") {
			document.body.style.scrollbarBaseColor = '#FFFFFF';
		}
   }
}

function printWindow() {
bV = parseInt(navigator.appVersion);
if (bV >= 4) window.print();
}

// this is for opening pop-up windows
function OpenPopup( url, name, openerUrl )
{
	var widgets = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=320,height=230";	var host = location.hostname;
	var popupWin = window.open( url, name, widgets );	popupWin.focus();

	if ( popupWin && popupWin.opener ) {
		if ( openerUrl )
		{
			popupWin.opener.location = openerUrl;
			popupWin.focus();
		}
		popupWin.opener.top.name = "opener";
	}
}


var theImages = new Array()
theImages[0] = 'WebSplash1.jpg'
theImages[1] = 'WebSplash2.jpg'
theImages[2] = 'WebSplash5.jpg'


//theImages[0] = 'Homepicture511.jpg'
//theImages[1] = 'Homepicture4.jpg'
//theImages[2] = 'AltaGreetings.jpg'

//theImages[2] = 'WebAdvantageSHOWCASE.jpg'

//theImages[0] = 'Homepicture1.jpg'
//theImages[1] = 'Homepicture2.jpg'
//theImages[2] = 'Homepicture3.jpg'
//theImages[3] = 'Homepicture4.jpg'

//theImages[0] = 'DGWebLonger1.jpg'
//theImages[1] = 'DGWebLonger2.jpg'
//theImages[2] = 'DGWebLonger3.jpg'

//theImages[0] = 'HomeAltaMate.jpg'
//theImages[1] = 'HomeHealthPlus.jpg'
//theImages[2] = 'HomeConceiving.jpg'
//theImages[3] = 'HomeConceptPlus.jpg'
//theImages[4] = 'HomeAltaPreg.jpg'
//theImages[5] = 'HomeAdvantage.jpg'
//theImages[6] = 'HomeCheesemaker.jpg'

//theImages[0] = 'Advantage0.jpg'
//theImages[1] = 'Advantage1.jpg'
//theImages[2] = 'Advantage2-3.jpg'
//theImages[3] = 'Advantage4.jpg'
//theImages[4] = 'Advantage5.jpg'
//theImages[5] = 'Advantage6.jpg'

//theImages[0] = 'MissionBanner.jpg'

var j = 0
var howMany = theImages.length;
var preBuffer = new Array()
for (i = 0; i < howMany; i++){
   preBuffer[i] = new Image()
   preBuffer[i].src = "images/"+theImages[i]
}
var whichImage = Math.round(Math.random()*(howMany-1));
var timeDelay = 10;
timeDelay *= 800;
//var PicCurrentNum = 0;
var PicCurrentNum = whichImage;

function startPix() {
	setInterval("slideshow()", timeDelay);
}
function slideshow() {
	PicCurrentNum++;
	if (PicCurrentNum == howMany) {
		PicCurrentNum = 0;
	}
	if (document.all){
		document.images.homepicture.style.filter="blendTrans(duration=2)";
		document.images.homepicture.filters.blendTrans.Apply();
	}
	document["homepicture"].src = "images/"+theImages[PicCurrentNum];
	if (document.all) document.images.homepicture.filters.blendTrans.Play();
}

function showImage(){
// var Caption = new Array();
// Caption[1]  = "Text";
// if (document.getElementById) document.getElementById("CaptionBox").innerHTML= Caption[jss];
	document["homepicture"].src = "images/"+theImages[whichImage];
	startPix();
}


function autoIframe(frameId) {
    try {
        frame = document.getElementById(frameId);
        innerDoc = (frame.contentDocument) ? frame.contentDocument : frame.contentWindow.document;
        objToResize = (frame.style) ? frame.style : frame;

        if (innerDoc.body.scrollHeight > 1250) {
            objToResize.height = innerDoc.body.scrollHeight + 30;
        }
        else {
            objToResize.height = 1250;
        }

    }
    catch (err) {
        window.status = err.message;
    }
}

function calcHeight() {
    //find the height of the internal page
    var the_height =
    document.getElementById('home').contentWindow.document.body.scrollHeight;

    // if the_height < 1250 {
    //     the_height = 1250;
    // }

    //change the height of the iframe
    document.getElementById('home').height = the_height;

    //setup polling in case frame is changed
    //setTimeout("calcHeight()", 1234); //wait 1.234 seconds before resizing frame
}