//Beginning of "test.js" file
var accepted_domains=new Array("internationalpoetrymuseum.org","nationalpoetry.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

if (!accepted_ok){
alert("Script Access Restricted")
history.back(-1)
}

var textOff="t10"
var bg=0

function nextText(textOn){
bg=bg+1
if (bg>5) {
bg=0
}
var on=document.body
on.style.backgroundImage="url(graphics/poet"+bg+size+".gif)"
if (textOn!=textOff) {
on=document.getElementById(textOff)
on.style.display="none"
on=document.getElementById(textOn)
on.style.display="block"
textOff=textOn
}
if (textOn!="t80"){
layout("")
}
if (textOn=="t10"){
layout("about")
}
if (textOn=="t80"){
layout("endorse")
}
}

function layout(config){
var on=""
if (config!="endorse"){
on=document.getElementById("voice2")
on.style.display="none"
on=document.getElementById("poet4")
on.style.backgroundPosition="center bottom"
on=document.getElementById("poet5")
on.style.display="none"
on=document.getElementById("poet1")
on.style.backgroundImage="url(graphics/parker"+size+".gif)"
on.style.backgroundPosition="center bottom"
voice('"Let the Voice of the Poet be heard around the World!"','voice1')
}
if (config=="endorse"){
on=document.getElementById("voice2")
on.style.display="inline"
on.style.textAlign="center"
on=document.getElementById("poet5")
on.style.display="inline"
on=document.getElementById("poet4")
on.style.backgroundPosition="center top"
on=document.getElementById("t80")
on.style.marginTop="17%"
on=document.getElementById("poet1")
on.style.backgroundImage="url(graphics/mirikitani"+size+".jpg)"
on.style.backgroundPosition="center bottom"
voice('"Of course I support the International Poetry Museum."<br />- Janice Mirikitani','voice2')
voice('"I and all the poets you support, lift you up with praise and encouragement."<br />-Maya Angelou','voice1')
}
}

function voice(msg,box) {
var target=document.getElementById(box) 
target.innerHTML=msg
}

function changeTopic(){
var target=document.getElementById("email2")
target.innerHTML='<a href="#" title="email" onmouseover="javascript:elink();">compose message</a> '
}

function elink(){
var target=document.getElementById("topic")
var loci=target.selectedIndex
var subject=target.options[loci].innerHTML
var mailink='<a href="mailto:info@internationalpoetrymuseum.org,motherearthpoetry@earthlink.net,akayfetz@aol.com,ccemmett@there.net?subject='+subject+'">Compose Message</a> '
target=document.getElementById("email2")
target.innerHTML=mailink
}

function staffMail(staff){
var write=""
var target=document.getElementById(staff)
var add1='<a href="mailto:'
var add2=""
var add3=""
add3='?subject='+target.innerHTML+'- IPM Campaign">'
var add4=target.innerHTML+'</a>'
if(staff=="unsubscribe"){
add4='Please Cancel My IPM Subscription</a>'
}
if (staff=="herman"){
add2='info@internationalpoetrymuseum.org,motherearthpoetry@earthlink.net'
write="hb"
}
if (staff=="barbara"){
add2='akayfetz@aol.com'
write="bk"
}
if (staff=="chad"){
add2='ccemmett@there.net'
write="cc"
}
if (staff=="subscribe"){
add2='ccemmett@there.net'
add3='?subject=New IPM Subscription">'
write="sub"
}
if (staff=="unsubscribe"){
add2='ccemmett@there.net'
add3='?subject=Please Cancel My IPM Subscription">'
write="unsub"
}
target=document.getElementById(write)
target.innerHTML=add1+add2+add3+add4
}