
//This script restricts access to this script by limiting it to the domain: cagreens.org
var accepted_domains=new Array("cagreens.org")

var domaincheck=document.location.href //retrieve the current URL of user browser
var accepted_ok=false //set acess to false by default

if (domaincheck.indexOf("http")!=-1){ //if this is a http request
for (r=0;r<accepted_domains.length;r++){
if (domaincheck.indexOf(accepted_domains[r])!=-1){ //if a match is found
accepted_ok=true //set access to true, and break out of loop
break
}
}
}
else
accepted_ok=true
//Anyone attempting to use this script outside of cagreens.org gets tossed back
//to square one with a little message
if (!accepted_ok){
alert("Script Access Restricted")
history.back(-1)
}

//who = a reference to the email address or addresses that pertain to an individual or group
//where = a reference to the id of the tag that contains the email link
//**the function replaces the contents of this tag with an appropriate email link 
//what = the subject of the email 
function mailLink(who,where,what){
var target=document.getElementById(who)
var add1='<a href="mailto:'
var add2=""
var add3='?subject='+target.innerHTML+': '+what+'" title="compose email">'
var add4=target.innerHTML+'</a>'
if (who=="website"){
add2='ccemmett@there.net'
}
if (who=="posts"){
add2='ccemmett@there.net'
}
if (who=="agenda"){
add2='richardlb@alamedanet.net,irenefd@alamedanet.net,ccemmett@there.net'
}
if (who=="volunteer1" || who=="volunteer2"){
add2='richardlb@alamedanet.net,irenefd@alamedanet.net,ccemmett@there.net'
}
if (who=="general"){
add2='richardlb@alamedanet.net,irenefd@alamedanet.net,ccemmett@there.net'
}
target=document.getElementById(where)
target.innerHTML=add1+add2+add3+add4
}

function mailLinkBlu(who,where,what){
var target=document.getElementById(who)
var add1='<a href="mailto:'
var add2=""
var add3='?subject='+target.innerHTML+': '+what+'" title="compose email" class="blu">'
var add4=target.innerHTML+'</a>'
if (who=="website"){
add2='ccemmett@there.net'
}
if (who=="posts"){
add2='ccemmett@there.net'
}
if (who=="agenda"){
add2='richardlb@alamedanet.net,irenefd@alamedanet.net,ccemmett@there.net'
}
if (who=="volunteer1" || who=="volunteer2"){
add2='richardlb@alamedanet.net,irenefd@alamedanet.net,ccemmett@there.net'
}
if (who=="general"){
add2='richardlb@alamedanet.net,irenefd@alamedanet.net,ccemmett@there.net'
}
target=document.getElementById(where)
target.innerHTML=add1+add2+add3+add4
}
