function CSPDContact(CLast,CFirst,CMiddle,CTitle,CAreaCode,CPhone,CFax,CCell,CEmail,CPic)  {

this.CLast = CLast;
this.CFirst = CFirst;
this.CMiddle = CMiddle;
this.CTitle = CTitle;
this.CAreaCode = CAreaCode;
this.CPhone = CPhone;
this.CFax = CFax;
this.CCell = CCell;
this.CEmail = CEmail;
this.CPic = CPic;

}


Gene = new CSPDContact("Thompson","Eugene","R.","Dr.","505","726-6300","","862-1165","ethompson@salud.unm.edu","gene.jpg")
Daisy = new CSPDContact("Thompson","Daisy","","","505","726-6301","","862-1180","dathompson@salud.unm.edu","daisy.jpg");
Mette = new CSPDContact("Pedersen","Mette","","","505","272-1040","272-3917","","mpedersen@salud.unm.edu","");
Brenda = new CSPDContact("","","","","","","","","","");
Dawn = new CSPDContact("Giegerich","Dawn","","","505","272-6988","272-3917","","dgiegerich@salud.unm.edu","");
Diane = new CSPDContact("","","","","","","","","","");
Peggy = new CSPDContact("Garito","Peggy","","","928","523-4833","523-9127","","Peggy.Garito@nau.edu","");
Genevieve =  new CSPDContact("Begay","Genevieve","","","928","523-4017","523-9127","","Genevieve.R.Begay@nau.edu","");

Contacts = new Array();

Contacts[0] = Gene;
Contacts[1] = Daisy;
Contacts[2] = Mette;
Contacts[3] = Brenda;
Contacts[4] = Dawn;
Contacts[5] = Genevieve;
Contacts[6] = Diane;
Contacts[7] = Peggy;



//////////////////////////////////////////////////
//                                              //
//              GetContact(num)                 //
//                                              //
//  THE FOLLOWING SCRIPT GENERATES A WINDOW     //
//  AND WRITES THE SELECTED CONTACT'S INFO      //
//  INTO THE WINDOW. if() STATEMENTS ARE USED   //
//  TO IDENTIFY NON-EXISTENT PROPERTIES OF      //
//  THE SELECTED CSPDContact OBJECT.  ALL       //
//  AVAILABLE PROPERTIES ARE WRITTEN INTO       //
//  THE NEW INSTANCE OF THE WINDOW OBJECT.      //
//                                              //
//////////////////////////////////////////////////

function GetContact(num) {

ContactWin = window.open("","ContactWin","width=350,height=230");

with(ContactWin.document) {

open();

write("<link rel='stylesheet' type='text/css' href='../CSS/CSPDContactScript.css'>");


write("<style type='text/css'>");
write("body  {background-color:#cccc99;font-family:tahoma;}");
write("#mainbox h1    {font-size:1.2em;}");
write("#mainbox p     {font-size:.8em;}");

write("#mainbox  {margin-left:8px;margin-right:8px;margin-top:8px;border: solid 1 px black;background-color:#ffffff;padding:6px;}");
write("</style>");

write("<body>");
write("<div id='mainbox'>");
write("<h1>" + Contacts[num].CTitle + " " + Contacts[num].CFirst + " " + Contacts[num].CMiddle + " " + Contacts[num].CLast + "</h1>");
write("<p>");

if(Contacts[num].CPhone != "") {
write(Contacts[num].CAreaCode + "-" + Contacts[num].CPhone + " (Office)<br>");
}

if(Contacts[num].CFax != "") {
write(Contacts[num].CAreaCode + "-" + Contacts[num].CFax + " (Fax)<br>");
}

if(Contacts[num].CCell != "") {
write(Contacts[num].CAreaCode + "-" + Contacts[num].CCell + " (Cell)<br>");
}

if(Contacts[num].CEmail != "") {
write("<a href='mailto:" + Contacts[num].CEmail + "'>" + Contacts[num].CEmail + "</a>");
}

write("</p>");

write("<hr>");

write("<p>");
write("<a href='javascript:window.close();'>Close Window</a>");
write("</p>");
write("</div>");

close();

}

ContactWin.focus();

}


function WriteContacts()  {
for(i in Contacts)  {
document.write("<a href='javascript:GetContact(" + i + ");'>" + Contacts[i].CFirst + " " + Contacts[i].CLast + "</a><br>");
}
}

function WriteContactsFull()  {
for(w in Contacts)  {

var showhr = false

//if(Contacts[w].CPic != "") {
//document.write("<img src='" + Contacts[w].CPic + "' alt='" + Contacts[w].CFirst + " " + Contacts[w]CLast + "' align='right'>");
//document.write("<p>");
//showhr = true;
//}

if(Contacts[w].CFirst != "" && Contacts[w].CLast != "" ) {
document.write("<h3>" + Contacts[w].CTitle + " " + Contacts[w].CFirst + " " + Contacts[w].CMiddle + " " + Contacts[w].CLast + "</h3>");
document.write("<p>");
showhr = true;
}

if(Contacts[w].CPhone != "") {
document.write(Contacts[w].CAreaCode + "-" + Contacts[w].CPhone + " (Office)<br>");
showhr = true;
}

if(Contacts[w].CFax != "") {
document.write(Contacts[w].CAreaCode + "-" + Contacts[w].CFax + " (Fax)<br>");
showhr = true;
}

if(Contacts[w].CCell != "") {
document.write(Contacts[w].CAreaCode + "-" + Contacts[w].CCell + " (Cell)<br>");
showhr = true;
}

if(Contacts[w].CEmail != "") {
document.write("<a href='mailto:" + Contacts[w].CEmail + "'>" + Contacts[w].CEmail + "</a><br>");
showhr = true;
}

if(showhr) {
document.write("<hr>");
}
 
}
}