dom=new Array("","aol","bigpond","highway1","hotmail","iinet","iprimus","netserv","optusnet","starday","westnet","wn","echidna","h-l","ruralpress","synergyccs","westernpower","wpcorp","mns","sdea", "bordernet");
loc=new Array("","com","com.au","net.au","id.au");
var ISP="";

function newWindow (file,w,h) {
xpos=(screen.width-w)/2;
ypos=(screen.height-h)/2;
window.open(file,'','width='+w+',height='+h+',left='+xpos+',top='+ypos+', scrollbars=yes, resizeable=no, location=no');
}

function eMail(to,isp,ext) {
  addr=to+'@'+dom[isp]+'.'+loc[ext];
  if(isp==0) {alert("Sorry, no e-mail address")}
  else {window.location="mailto:"+addr+"?subject=E-mail via Mumby Community Web Site"}
}


function emailAll() {
  var addrSt="";
  for (i=0;i<membersArray.length-3;i++) {
    if (membersArray[i][7]=="") {
      if (membersArray[i][9]=="") { }
      else { addrSt+=membersArray[i][9]+"@"+membersArray[i][10]+"; " }
    }
    else { addrSt+=membersArray[i][7]+"@"+membersArray[i][8]+"; " }
  }
  newWindow=window.open('','','width=600,height=150');
  newWindow.document.write("<html><head><title>  ***  <\/title><link rel='stylesheet' href='CollieStyle.css' type='text/css'><\/head><body><p>If you get an error (older browsers) cut and paste these addresses into the \"to\" field of your email program:<br>"+addrSt+"<\/body><\/html>");
  newWindow.document.close();
  window.location="mailto:"+addrSt+"?subject=E-mail via Mumby Community Web Site" }

function pageprint() {
if (window.parent.content) {
   window.parent.content.focus();
   window.parent.content.print() }
else { window.print() }
}

function openingPage() {
  if (top.location==self.location) {
    document.write("<html><head><link rel='stylesheet' href='CollieStyle.css' type='text/css'></head><body><h1>Sorry, page is protected.<br>Please log in.</h1><script language='javascript'>setTimeout('kick()',1000);function kick() { top.location.href='Index.html' }</script></html>");
  }
}

function openingPageSub() {
  if (parent.dummy||top.location==self.location) {
    document.write("<html><head><link rel='stylesheet' href='../CollieStyle.css' type='text/css'></head><body><h1>Sorry, page is protected.<br>Please log in.</h1><script language='javascript'>setTimeout('kick()',1000);function kick() { top.location.href='../Index.html' }</script></html>");
  }
}

function memData(memno) {
   document.memForm.partner.value=membersArray[memno][2];
   document.memForm.homePh.value=membersArray[memno][3];
   document.memForm.busPh.value=membersArray[memno][4];
   document.memForm.mobPh.value=membersArray[memno][5];
   document.memForm.fax.value=membersArray[memno][6];
   if (membersArray[memno][7]=="") { document.memForm.homeEM.value="" }
   else {document.memForm.homeEM.value=membersArray[memno][7]+'@'+membersArray[memno][8] }
   if (membersArray[memno][9]=="") { document.memForm.busEM.value="" }
   else {document.memForm.busEM.value=membersArray[memno][9]+'@'+membersArray[memno][10] }
   document.memForm.postAd.value=membersArray[memno][11];
   document.memForm.classif.value=membersArray[memno][12];
   document.memForm.office.value=membersArray[memno][13]+" "+membersArray[memno][14];
}


monthNumbers="Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(",");
for(i=0;i<monthNumbers.length;i++)
monthNumbers[monthNumbers[i]]=i;

function dateToTime(dateString) {
      if (dateString.indexOf("-")>0) { dateString=dateString.split("-") }
      else { if (dateString.indexOf('/')>0) { dateString=dateString.split("/") }
            else {if (dateString.indexOf(' ')>0) { dateString=dateString.split(" ") }
			}
	  }
      if (dateString[1]*13>12) { dateString[1]=dateString[1]-1} 
	  else { dateString[1]=monthNumbers[dateString[1]] } 
      if(dateString[2]<1900) { dateString[2]=dateString[2]*1+2000; }
      var dateString3=new Date(dateString[2],dateString[1],dateString[0]);
      return dateString3.getTime();
   }

function timeToDate(timeStamp) {
//alert(timeStamp);                 //Number for this moment
     jsDate=new Date();
//alert(jsDate);                    //Long format date
     jsDate.setTime(timeStamp);
     dd=jsDate.getDate();
     mm=monthNumbers[jsDate.getMonth()];
     yy=jsDate.getYear();
     return dd+"-"+mm+"-"+yy;
}


function dataWindow() {
     data=document.members.membersdata.value;
     newWindow=window.open('','data','toolbars=true,scrollbars=yes,width=800,height=500');
     newWindow.document.write("<html><head><title>Members</title><style type='text/css'>body{color:black; background:white; text-align:left; font-family:arial,sans-serif; font-size:9pt;}</style></head><body>");
     newWindow.document.write("Hint: For best print, copy and paste into spreadsheet and print in landscape mode.<br><br>");
     newWindow.document.write("<table border=0 style='color:black; background:white; text-align:left; font-family:arial,sans-serif; font-size:9pt;'><td colspan=2>Member</td><td>Partner</td><td>Home Ph.</td><td>Work Ph.</td><td>Mobile Ph.</td><td>Fax No.</td><td colspan=2>E-Mail 1</td><td colspan=2>E-Mail 2</td><td>Address</td><td>Classification</td><td>Office 1</td><td>Office 2</td>");
     for (i=0;i<membersArray.length-3;i++) {
        if(membersArray[i][7]==""){
           newWindow.document.write('<tr><td nowrap>'+membersArray[i][0]+'</td><td nowrap>'+membersArray[i][1]+'</td><td nowrap>'+membersArray[i][2]+'</td><td nowrap>'+membersArray[i][3]+'</td><td nowrap>'+membersArray[i][4]+'</td><td nowrap>'+membersArray[i][5]+'</td><td nowrap>'+membersArray[i][6]+'</td><td colspan=2 nowrap>'+membersArray[i][7]+membersArray[i][8]+'</td><td colspan=2 nowrap>'+membersArray[i][9]+membersArray[i][10]+'</td><td nowrap>'+membersArray[i][11]+'</td><td nowrap>'+membersArray[i][12]+'</td><td nowrap>'+membersArray[i][13]+'</td><td nowrap>'+membersArray[i][14]+'</td>') }
        else {
           if(membersArray[i][9]==""){
               newWindow.document.write('<tr><td nowrap>'+membersArray[i][0]+'</td><td nowrap>'+membersArray[i][1]+'</td><td nowrap>'+membersArray[i][2]+'</td><td nowrap>'+membersArray[i][3]+'</td><td nowrap>'+membersArray[i][4]+'</td><td nowrap>'+membersArray[i][5]+'</td><td nowrap>'+membersArray[i][6]+'</td><td colspan=2 nowrap>'+membersArray[i][7]+'@'+membersArray[i][8]+'</td><td colspan=2 nowrap>'+membersArray[i][9]+membersArray[i][10]+'</td><td nowrap>'+membersArray[i][11]+'</td><td nowrap>'+membersArray[i][12]+'</td><td nowrap>'+membersArray[i][13]+'</td><td nowrap>'+membersArray[i][14]+'</td>') }
  	   else {
               newWindow.document.write('<tr><td nowrap>'+membersArray[i][0]+'</td><td nowrap>'+membersArray[i][1]+'</td><td nowrap>'+membersArray[i][2]+'</td><td nowrap>'+membersArray[i][3]+'</td><td nowrap>'+membersArray[i][4]+'</td><td nowrap>'+membersArray[i][5]+'</td><td nowrap>'+membersArray[i][6]+'</td><td colspan=2 nowrap>'+membersArray[i][7]+'@'+membersArray[i][8]+'</td><td colspan=2 nowrap>'+membersArray[i][9]+'@'+membersArray[i][10]+'</td><td nowrap>'+membersArray[i][11]+'</td><td nowrap>'+membersArray[i][12]+'</td><td nowrap>'+membersArray[i][13]+'</td><td nowrap>'+membersArray[i][14]+'</td>') }
        }
     }
     newWindow.document.write("</table></html>");
}

