// Copyright (c) 1999-2003 Cyber-dynamics Inc. All Rights Reserved

 
var img = new Array(),imgs = new Array(),iReady=false;

function supportsSwapping() {
	var appname= navigator.appName;
	var appversion = navigator.appVersion;
	var majorver = appversion.substring(0, 1);
	if ( (appname == "Netscape") && ( majorver >= 3 ) ) return 1;
	if ( (appname == "Microsoft Internet Explorer") && (majorver >= 4) ) return 1;
	return 0;
}

function getImages(){
	if (supportsSwapping()) {
		imgs[0] = "images/subscribeb.gif";
		imgs[1] = "images/subscribe.gif";
		imgs[2] = "images/i_addfo.gif";
		imgs[3] = "images/i_addf.gif";
		imgs[4] = "images/i_emailpo.gif";
		imgs[5] = "images/i_emailp.gif";
		imgs[6] = "images/i_makeh2o.gif";
		imgs[7] = "images/i_makeh2.gif";
		imgs[8] = "images/i_printpo.gif";
		imgs[9] = "images/i_printp.gif";
		for (var i = 0; i < imgs.length; i++) {
			img[i] = new Image();
			img[i].src = imgs[i];
		}
		iReady=true;
	}
}

function sw(i,imgn){
	if(iReady){
		
	document[imgn].src=img[i].src;
	
} }

function init() {
	getImages();
}

function bookM(){if (document.all){var uRL=self.location.href,txt=self.document.title;window.external.AddFavorite(uRL,txt);}else{alert("Please click OK then press CTRL-D");}}

function homeP(){if (document.all){document.all[0].style.behavior='url(#default#homepage)';document.all[0].setHomePage(self.location.href);}else{alert("Please click OK then View/Options or Parameters and set Current Page as Home Page");}}

function printP(){if (parseInt(navigator.appVersion)>=4){window.print();}else{alert("This action is not supported by your browser\nPlease select File/Print");}}


function submitSub() {
var f=document.newsletterActions,sErr='';
 if ((badField(f.Name.value,3))||(f.Name.value=='your name')){sErr += ', Name'}
 if ((badEmail(f.Email.value))||(f.Email.value=='you@yourhost.com')){sErr += ', Email'}
 if(sErr){alert('Please check the following entries and resubmit:\n'+sErr.substr(2));
 }else{
  if (popper) {if (! popper.closed) {popper.close();}}
  popUp('CDDSdownload.html',100,100,220,350);
  tellWait();
  f.title.value=document.title;
  f.target="popper";
  f.submit();
  }
  return false;
}
function checkForm(){var err = "";f=document.inquiry;
iFields = new Array;iFields = f._required.value.split(",");for (var i=0;i<iFields.length;i++){if(iFields[i].length>1){
if(iFields[i].indexOf("Email")>-1){if(badEmail(f[iFields[i]].value)) {err+=", "+iFields[i];}}else{if (badField(f[iFields[i]].value,3)){err+=", "+iFields[i];}}}}
if(err){alert("Please check the following entries and then submit this form:\n"+err.substr(2));return false;}else{
  if (popper) {if (! popper.closed) {popper.close();}}
  popUp('CDDSdownload.html',100,100,220,350);
  tellWait();
  f.title.value=document.title;
  f.target="popper";
  f.submit();
  }
  return false;
}
function tellWait() {var s="<html><head><title>Downloading - please wait</title></head><body bgcolor='#f5f9fc'><p style='text-align:center;font-family:Arial,Helvetica,sans-serif;font-size:11px;'><br /><br /><b>D O W N L O A D I NG</b><br /><br />Please Wait</p></body></html>";
popper.document.open;popper.document.write(s);popper.document.close;}

function clickClear(oMe,sVal) {if (oMe.value==sVal){oMe.value='';}}

function sStatus(sStr) {window.status=sStr;document.returnValue=true;}
function mSt(s) {window.status=s;document.returnValue=true;}

function badEmail(str){if (isBlank(str)||(str.indexOf("@")==-1)||(str.indexOf(".")==-1)||(str.length<6)){return true}else{return false}}	 

function badField(str,minlength){if(isBlank(str)||(str.length<minlength)){return true}else{return false}}	 

function isBlank(str){if(str.length==0){return true};for(i=0;i<=str.length-1;i++){if(str.charAt(i)!=" "){return false}}return true;}
var popper; function popUp(url,pLeft,pTop,pWidth,pHeight){var str='left='+pLeft+',top='+pTop+',width='+pWidth+',height='+pHeight+',resizable=no,scrollbars=no';url=url; 
popper=window.open(url,"popper",str);if (!popper.opener){popper.opener = self;}if (popper.focus != null) {popper.focus();}return false;}
var srchr; function srchUp(url){var str='left=0,top=0,width=450,height='+(screen.height-100)+',resizable=yes,scrollbars=yes';url=url; 
srchr=window.open(url,"srchr",str);if (!srchr.opener){srchr.opener = self;}if (srchr.focus != null) {srchr.focus();}return false;}

function bookM(){if (document.all){var uRL=self.location.href,txt=self.document.title;window.external.AddFavorite(uRL,txt);}else{alert("Please click OK then press CTRL-D");}}

function homeP(){if (document.all){document.all[0].style.behavior='url(#default#homepage)';document.all[0].setHomePage(self.location.href);}else{alert("Please click OK then View/Options or Parameters and set Current Page as Home Page");}}
function printP(){if (parseInt(navigator.appVersion)>=4){window.print();}else{alert("This action is not supported by your browser\nPlease select File/Print");}}

function pDate() {
var monthNames=new Array("January","February","March","April","May","June","July","August","September","October","November","December");
var dayNames=new Array("Sun","Mon","Tues","Wednes","Thurs","Fri","Satur");
var now=new Date(),yr = now.getYear();if (yr<1900){yr+=1900;}
document.write(dayNames[now.getDay()]+"day, ");document.write(monthNames[now.getMonth()]+" "+now.getDate()+", "+yr);}

function getTime() {
 var time=new Date(); time.setTime(time.getTime());
 var iHr=time.getHours(),iMin=time.getMinutes(),iSec=time.getSeconds(),
 tp =""+((iHr>12)?iHr-12:iHr); 
 tp+=((iMin<10)?":0":":")+iMin; tp+=((iSec<10)?":0":":")+iSec;tp+=(iHr>=12)?" PM":" AM";
 document.fm.WTclock.value = tp; var i=setTimeout("getTime()",1000);
}