// open new window
  function openWin(url) {
    window.open(url,'Win','toolbar=0,location=0,directories=0,status=0,menubar=1,scrollbars=1,resizable=1');
  }

// Code for Email-a-Page Option
var good;
u = window.location;
m = "I thought this might interest you...";
function checkEmailAddress(field) {
// the following expression must be all on one line...
var goodEmail = field.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi);
if (goodEmail){
   good = true
} else {
   alert('Please enter a valid e-mail address.')
   field.focus()
   field.select()
   good = false
   }
}

function mailThisUrl(){
   good = false
   checkEmailAddress(document.eMailFriend.address)
   if (good){
	 
	 // first executes sdc code to track mailtoo's
	 
var pagetitle="(Mail to) "+document.title;
var gImages=new Array;
var gIndex=0;
var DCS=new Object();
var WT=new Object();
var DCSext=new Object();

var gDomain="sdc.plcu.com";
var gDcsId="";
// Add customizations here
//WT.sp="@@SPLITVALUE@@";

function dcsMultiTrack(){
	for (var i=0;i<arguments.length;i++){
		if (arguments[i].indexOf('WT.')==0){
				WT[arguments[i].substring(3)]=arguments[i+1];
				i++;
		}
		if (arguments[i].indexOf('DCS.')==0){
				DCS[arguments[i].substring(4)]=arguments[i+1];
				i++;
		}
		if (arguments[i].indexOf('DCSext.')==0){
				DCSext[arguments[i].substring(7)]=arguments[i+1];
				i++;
		}
	}
	var dCurrent=new Date();
	DCS.dcsdat=dCurrent.getTime();
	dcsTag();
}

function dcsVar(){
	var dCurrent=new Date();
	WT.tz=dCurrent.getTimezoneOffset()/60*-1;
	if (WT.tz==0){
		WT.tz="0";
	}
	WT.bh=dCurrent.getHours();
	WT.ul=navigator.appName=="Netscape"?navigator.language:navigator.userLanguage;
	if (typeof(screen)=="object"){
		WT.cd=navigator.appName=="Netscape"?screen.pixelDepth:screen.colorDepth;
		WT.sr=screen.width+"x"+screen.height;
	}
	if (typeof(navigator.javaEnabled())=="boolean"){
		WT.jo=navigator.javaEnabled()?"Yes":"No";
	}
	if (document.title){
		WT.ti=document.title;
		WT.ti=pagetitle;
		WT.cg_n=pagetitle;
	}
	WT.js="Yes";
	if (typeof(gVersion)!="undefined"){
		WT.jv=gVersion;
	}
	DCS.dcsdat=dCurrent.getTime();
	DCS.dcssip="www.plcu.com";
	DCS.dcsuri="/mailto/" + document.title + ".eml";
	// DCS.dcsuri=window.location.pathname;
	if (window.location.search){
		DCS.dcsqry=window.location.search;
	}
	if ((window.document.referrer!="")&&(window.document.referrer!="-")){
		if (!(navigator.appName=="Microsoft Internet Explorer"&&parseInt(navigator.appVersion)<4)){
			DCS.dcsref=window.document.referrer;
		}
	}
}

function A(N,V){
	return "&"+N+"="+dcsEscape(V);
}

function dcsEscape(S){
	if (typeof(RE)!="undefined"){
		var retStr = new String(S);
		for (R in RE){
			retStr = retStr.replace(RE[R],R);
		}
		return retStr;
	}
	else{
		return escape(S);
	}
}

function dcsCreateImage(dcsSrc){
	if (document.images){
		gImages[gIndex]=new Image;
		gImages[gIndex].src=dcsSrc;
		gIndex++;
	}
	else{
		document.write('<IMG BORDER="0" NAME="DCSIMG" WIDTH="1" HEIGHT="1" SRC="'+dcsSrc+'">');
	}
}

function dcsMeta(){
	var myDocumentElements;
	if (document.all){
		myDocumentElements=document.all.tags("meta");
	}
	else if (document.documentElement){
		myDocumentElements=document.getElementsByTagName("meta");
	}
	if (typeof(myDocumentElements)!="undefined"){
		for (var i=1;i<=myDocumentElements.length;i++){
			myMeta=myDocumentElements.item(i-1);
			if (myMeta.name){
				if (myMeta.name.indexOf('WT.')==0){
					WT[myMeta.name.substring(3)]=myMeta.content;
				}
				else if (myMeta.name.indexOf('DCSext.')==0){
					DCSext[myMeta.name.substring(7)]=myMeta.content;
				}
				else if (myMeta.name.indexOf('DCS.')==0){
					DCS[myMeta.name.substring(4)]=myMeta.content;
				}
			}
		}
	}
}

function dcsTag(){
	var P="http"+(window.location.protocol.indexOf('https:')==0?'s':'')+"://"+gDomain+(gDcsId==""?'':'/'+gDcsId)+"/dcs.gif?";
	for (N in DCS){
		if (DCS[N]) {
			P+=A(N,DCS[N]);
		}
	}
	for (N in WT){
		if (WT[N]) {
			P+=A("WT."+N,WT[N]);
		}
	}
	for (N in DCSext){
		if (DCSext[N]) {
			P+=A(N,DCSext[N]);
		}
	}
	if (P.length>2048&&navigator.userAgent.indexOf('MSIE')>=0){
		P=P.substring(0,2040)+"&WT.tu=1";
	}
	dcsCreateImage(P);
}

dcsVar();
dcsMeta();
dcsTag();

// Now executes the Mailto to actuall send the e-mail
	 
      // the following expression must be all on one line...
      window.location = "mailto:"+document.eMailFriend.address.value+"?subject=I'm sending you a link...&body=I found this page on Point Loma's website, and thought you might find it interesting.  %0A%0A"+document.title+"%0A%0A"+u;
			
   }
}


// Courtesy of SimplytheBest.net - http://simplythebest.net/scripts/
function create() {
        this.width = ''
        this.height = ''
        this.src = ''
        this.href = ''
        this.border = ''
        this.mouseover = ''
        this.sponsor = ''
}
ads = new Array()
for(var xxi=1; xxi<=5; xxi++) { ads[xxi] = new create() }

ads[1].width = "103"
ads[1].height = "40"
ads[1].src = "/images/secureblue.gif"
ads[1].href = "javascript:openWin(\"/ddef.asp\")"
ads[1].border = "0"
ads[1].mouseover = "Learn About Security on your Computer"
ads[1].sponsor = ""

ads[2].width = "103"
ads[2].height = "40"
ads[2].src = "/images/securered.gif"
ads[2].href = "javascript:openWin(\"/ddef.asp\")"
ads[2].border = "0"
ads[2].mouseover = "Free Training - Secure your Computer"
ads[2].sponsor = ""

ads[3].width = "103"
ads[3].height = "40"
ads[3].src = "/images/securegreen.gif"
ads[3].href = "javascript:openWin(\"/ddef.asp\")"
ads[3].border = "0"
ads[3].mouseover = "NEW! Security Training for Home Computers"
ads[3].sponsor = ""

ads[4].width = "103"
ads[4].height = "40"
ads[4].src = "/images/securedred.gif"
ads[4].href = "javascript:openWin(\"/ddef.asp\")"
ads[4].border = "0"
ads[4].mouseover = "Click Here! Free Security Education"
ads[4].sponsor = ""

ads[5].width = "103"
ads[5].height = "40"
ads[5].src = "/images/securepurp.gif"
ads[5].href = "javascript:openWin(\"/ddef.asp\")"
ads[5].border = "0"
ads[5].mouseover = "Learn How to Protect your Computer"
ads[5].sponsor = ""

var xxn = Math.random() + ''
xxn = parseInt(xxn.charAt(5))
if(xxn >5) {
        xxn = xxn - 5
}
else if(xxn==0) {
        xxn = xxn + 5
}
xxn += ""

var xximage = ads[xxn]
var ad = ""
ad += '<a href="' + xximage.href + '" \n'
ad += 'onMouseOver="self.status=\'' + xximage.mouseover + '\'\;return true" \n'
ad += 'onMouseOut="self.status=\'\'"> \n'
ad += '<img src="' + xximage.src + '" width=' + xximage.width
ad += '\n height=' + xximage.height + ' border=' + xximage.border
ad += '\n><br>Please visit our sponsor: ' + xximage.sponsor + '</a>'

