// Anti-Spam Email Displayer- By JavaScriptKit.com
// Visit JavaScript Kit (http://javascriptkit.com) for this script and more.
// This notice must stay intact for use

var contacts=new Array()
contacts[0]=["WebMaster", "webmaster[at]starhost1[dot]com"]
contacts[1]=["Relo", "relo[at]ranchandsea[dot]com"]
contacts[2]=["La Costa", "jerri[at]ranchandsea[dot]com"]
contacts[3]=["eric@ranchandsea.com", "eric[at]ranchandsea[dot]com"]
contacts[4]=["Carlsbad", "carlsbad[at]ranchandsea[dot]com"]
contacts[5]=["Oceanside", "oceanside2[at]ranchandsea[dot]com"]
contacts[6]=["Del Mar", "delmar[at]ranchandsea[dot]com"]
contacts[7]=["Rentals", "rentals[at]ranchandsea[dot]com"]
contacts[8]=["Vacation Rental - Stephanie", "stephanie[at]ranchandsea[dot]com"]
contacts[9]=["Rose", "rose[at]ranchandsea[dot]com"]
contacts[10]=["Mydgie", "mydgie[at]ranchandsea[dot]com"]
contacts[11]=["Management", "management[at]ranchandsea[dot]com"]
contacts[12]=["elcajon@ranchandsea.com", "elcajon[at]ranchandsea[dot]com"]
contacts[13]=["tracy@ranchandsea.com", "tracy[at]ranchandsea[dot]com"]
contacts[14]=["kathy@ranchandsea.com", "kathy[at]ranchandsea[dot]com"]


var dropmenucaption="CONTACT US FORM "

function displaycontact(emailarray, cssclass, displaymethod, extrainfo){
if (displaymethod=="text"){
document.write('<span class="' + cssclass + '">\n')
if (typeof emailarray[0]=="object"){ //if array passed consists of multiple elements
for (i=0; i<emailarray.length; i++){
var seperator=(i<emailarray.length-1)? extrainfo : ""
document.write('<a href="mailto:' + modifyemail(emailarray[i][1])+ '">'+ emailarray[i][0] + '</a>' + seperator)
}
}
else //else if it is a single array element
document.write('<a href="mailto:' + modifyemail(emailarray[1])+ '">'+ emailarray[0] + '</a>')
document.write('</span>')
}
else if (displaymethod=="form"){
document.write('<form>\n')
document.write('<select size="' + extrainfo + '" onChange="jumptooption(this)" class="' + cssclass + '">\n')
document.write('<option value="caption">' + dropmenucaption + '</option>\n')
for (i=0; i<emailarray.length; i++)
document.write('<option value="mailto:' + modifyemail(emailarray[i][1]) +'">' + emailarray[i][0] + ' </option>\n')
document.write('</select></form>\n')
}
}

function modifyemail(emailitem){
var modified=emailitem.replace(/\[at]/gi, "@")
modified=modified.replace(/\[dot]/gi, ".")
return modified
}

function jumptooption(themenu){
if (themenu.options[themenu.selectedIndex].value !="caption")
location=themenu.options[themenu.selectedIndex].value
}
