<!--
/*

This Script is copyrighted Web-design material by:
Planet Networks and/or Vanity Tel Corp.
Under no circumstances does any individual or entity have the right to distribute,
copy or modify this program without the exclusive written permission of Planet Networks.
For information regarding this script or to report a bug please write to:
webmaster@vanitytel.com
*/

var ua = navigator.userAgent
var IEver = 0
var NSver = 0
var MZver = 0
var IEmac

/*
alert(" userAgent: "+ ua + "\n\n appVersion: " + navigator.appVersion + 
"\n\n appName: "+ navigator.appName)
*/

var ST, IEfrm, TRLfrm, timerUnFrame
CurLocation = location.href.toLowerCase()
CurRoot = CurLocation.substring(0,CurLocation.lastIndexOf("/"))
NoSSL = CurRoot.replace("https://","http://")


clearTimeout(timerUnFrame)
timerUnFrame = setTimeout("UnFrame",20000)

function UnFrame() {

if (top.frames.length!=0) { // site opened inside a frame
 if (window.location.href.replace)
 top.location.replace(self.location.href)
 else
 top.location.href=self.document.href
 }
}



msie = ua.indexOf("MSIE ")
if (msie > 0) // is Microsoft Internet Explorer; return version number
{ IEver = parseInt( ua.substring (msie+5,ua.indexOf(".",msie)))

if (ua.indexOf("Mac") > 0) { IEmac = true }
}

if (navigator.appName.indexOf("Netscape") != -1) {
NSver = parseInt(navigator.appVersion.substring(0,1))
}

MZcomp = ua.indexOf("Mozilla/")
if (MZcomp != -1) // Mozilla compatible; return version number
{ MZver = parseInt(ua.substring(MZcomp+8, ua.indexOf(".",MZcomp))) }

var TestedBrowsers
if (MZver >= 5 || IEver >= 5) { TestedBrowsers = true }


var PSbox = "<table border=0 cellpadding=0 cellspacing=0 "+
"STYLE=\"display: none\" ID=SpellBox><tr>"+
"<form name=f onSubmit=\"return NumVal(this)\" action=\""+NoSSL+"/PhoneSpell.asp\" "+
" target=\"_top\">"+
"<input type=hidden name=submitted value=yes><td>"+
"<table bgColor=#0A0067 border=0 class=txt cellpadding=1 cellspacing=0 "+
"width=\"100%\"><tr><td><img src=\"images/favicon.gif\"></td><td>"+
"<font size=2 color=white face=\"tahoma,arial\"><nobr>"+
"&nbsp;Find phone spelling...</nobr></td>"+
"<td align=right><a href=\"javascript:CloseSpellBox()\">"+
"<img src=\"images/x.gif\" border=0></a></td></tr><tr><td colspan=3>"+
"<table bgColor=silver border=0 cellpadding=2 cellspacing=0 width=\"100%\"><tr>"+
"<td align=center><table bgColor=silver border=0 class=txt cellpadding=2 "+
"cellspacing=0 width=\"100%\"><tr><td align=right>"+
"<nobr><b>7 digit #:</b></nobr></td><td>"+
"<nobr><input type=text name=n_Phone1 ID=xf onKeyUp=\"OnlyNumbers(this,3)\" "+
"size=3 maxlength=3 class=pf2>-<input "+
"type=text name=n_Phone2 onKeyUp=\"OnlyNumbers(this,4,0)\" "+ 
"size=4 maxlength=4 class=pf2></nobr>"+
"</td></tr><tr><td align=right>"+
"<b>Word(s):</b></td><td>"+
"<input type=text name=word size=11 maxlength=15 class=pf2 "+
"onKeyUp=\"PhoneNum(this.value)\" onBlur=\"PhoneNum(this.value)\">"+
"</td></tr><tr><td colspan=2 align=center>"+
"<input type=submit value=\"Search...\" class=pf2></td></tr></table>"+
"</td></tr></table></td></tr></table>"+
"</td></form></tr></table>"


function ShowSpellBox() {

if (!ST) if (ST.style.display != "none") location = "SearchAgain.asp"

window.scrollTo(0,0)
ST.style.display = "block"

o = document.f.n_Phone1
o.focus()
o.style.backgroundColor = "yellow"

FlashField(0,o)
}

function FlashField(x,o) {

if (x < 9) { x++

 if (o.style.backgroundColor == "yellow")
 { o.style.backgroundColor = "white" } else { o.style.backgroundColor = "yellow" }

setTimeout("FlashField("+x+",o)",500)
 }
}




function CloseSpellBox() { ST.style.display = "none" }


var sWidth, sHeight, left_point, top_point

if (window.screen) {
sWidth = window.screen.availWidth
sHeight = window.screen.availHeight
 } else {
sWidth = 800; sHeight = 600
 }


var LastLinkObj, LastLink, LastKeyPress
function RestoreLink() { LastLinkObj.href = LastLink }


var wFeatures="toolbar=no,location=no,scrollbars=yes,channelmode=no,"+
"directories=no,status=no,resizable=yes,menubar=no"


function LoadTrailers(o,e) { if (!o) return false

LastLinkObj = o; LastLink = o.href
o.href = "javascript:RestoreLink()"
var Xpath = LastLink.replace("Ts.asp","Ts_JS.asp")
var pW = 180, pH = 200
document.Winf.jbCaption.value = "View all trailers..."

LoadIwin(e,Xpath,pW,pH)
}



function LoadEmailResults(o,e) { if (!o) return false

LastLinkObj = o; LastLink = o.href
o.href = "javascript:RestoreLink()"
var Xpath = LastLink.replace(".asp","_JS.asp")
var pW = 300, pH = 250
document.Winf.jbCaption.value = "Email these results..."

LoadIwin(e,Xpath,pW,pH)
}


function LoadIwin(e,Xpath,pW,pH) { if (!Xpath) return false

if (typeof(frames["frmDoc"]) == "object" && frmObj) {

frmObj.width = pW
frmObj.height = pH

showMenu(e,TRLwin)
frmObj.style.visibility = "hidden"
frames["frmDoc"].window.location = Xpath

	} else { // Iframe pp failed resort to Win Popup:

pW = pW + 50
pH = pH + 50

left_point = parseInt(sWidth/2) - parseInt(pW/2)
top_point = parseInt(sHeight/2) - parseInt(pH/2)

var WF = wFeatures + "top="+top_point+",left="+left_point+",width="+pW+",height="+pH
window.open(Xpath,"TrailerWin",WF)
	}
}

function CloseTRL() { TRLwin.style.display = "none"; IEfrm.style.display = "none" }



function LinkLoader() {

for (x=0 ; x < document.links.length ; x++) {

if (document.links[x].name == "BackPage") { 
document.links[x].href = "javascript:history.back()" }

CurLink = document.links[x].href.toLowerCase()

if (TestedBrowsers && CurLink.indexOf("searchagain.asp") != -1) { 
document.links[x].href = "javascript:ShowSpellBox()" }

if (document.links[x].className == "Menu" && CurLink.indexOf(".") != -1) {
pCurLink = CurLink.substring(CurLink.lastIndexOf("/"),CurLink.lastIndexOf("."))
  if (CurLocation.indexOf(pCurLink) != -1) { document.links[x].style.color = "#E77817" }
  }
 }

ST = (document.all)?document.getElementById("SpellBox"):false
if (!ST) ST = (document.getElementById)?document.getElementById("SpellBox"):false

IEfrm = (document.all)?document.getElementById("IEfrm"):false
if (!IEfrm) IEfrm = (document.getElementById)?document.getElementById("IEfrm"):false
}



function PhoneSpell_loader(o) { o.focus(); o.select() }


var TRLwin, frmObj

function PhoneSpellResults_loader() {

TRLwin = (document.all)?document.getElementById("TRLwin"):false
if (!TRLwin) TRLwin = (document.getElementById)?document.getElementById("TRLwin"):false

frmObj = (document.all)?document.getElementById("frmObj"):false
if (!frmObj) frmObj = (document.getElementById)?document.getElementById("frmObj"):false


for (x=0 ; x < document.links.length ; x++) { CurLink = document.links[x].href

if (CurLink.indexOf("sell.asp") != -1) {
document.links[x].href = "javascript:LoadFromCache()"

if (CurLink.indexOf("sell.asp?") != -1) SellLink = CurLink
	}
 }

LinkLoader()
}



var SellLink

function LoadFromCache() {
setTimeout("location = SellLink",600)
history.go(SellLink)
}


function ClearAll() {
document.f.n_Phone1.value = ""
document.f.n_Phone2.value = ""
document.f.word.value = ""
}


function PhoneNum(o,JustReturnValue,NumDigits) { if (o) {

if (!NumDigits) NumDigits = 8

o = o.toLowerCase(); var strNum = ""
for (x=0; x < o.length; x++) { l = o.substring(x,x+1)

if ("0123456789".indexOf(l) != -1) strNum = strNum + l;
if ("aáàäâãbcç".indexOf(l) != -1) strNum = strNum + "2";
if ("deéèëêf".indexOf(l) != -1) strNum = strNum + "3";
if ("ghiíìïî".indexOf(l) != -1) strNum = strNum + "4";
if ("jkl".indexOf(l) != -1) strNum = strNum + "5";
if ("mnñoóòöôõ".indexOf(l) != -1) strNum = strNum + "6";
if ("pqrs".indexOf(l) != -1) strNum = strNum + "7";
if ("tuúùüûv".indexOf(l) != -1) strNum = strNum + "8";
if ("wxyýÿz".indexOf(l) != -1) strNum = strNum + "9";


if (strNum.length == 3) strNum = strNum + "-"
if (strNum.length == 7 && NumDigits == 12) strNum = strNum + "-"
if (strNum.length == NumDigits) x = o.length
 }

if (JustReturnValue == 1) { return strNum } else {

if (strNum.indexOf("-") != -1) {
aStrNum = strNum.split("-")
document.f.n_Phone1.value = aStrNum[0]
document.f.n_Phone2.value = aStrNum[1]
  } else {
document.f.n_Phone1.value = strNum
document.f.n_Phone2.value = ""
  }
 }
}
}


function NumVal(f) {
p1 = f.n_Phone1.value
p2 = f.n_Phone2.value
phone = p1 + "" + p2

StartMsg = p1 + "-" + p2 + " is not a valid phone number.\n\nReason: "

if (isNaN(phone)) { alert(StartMsg + "It's not numeric"); return false }
if (phone.length < 7) { alert(StartMsg + "It's less than 7 digits"); return false }

FirstChar = phone.substring(0,1)
if (FirstChar == 1 || FirstChar == 0) { alert(StartMsg + 
"It begins with "+ FirstChar); return false }
}



// Gets next field Index used in OnlyNumbers() below
// royalty free func. from: javascriptsource.com (needs further analisys if best method).
function getIndex(input) {
var index = -1, i = 0, found = false;
while (i < input.form.length && index == -1)
if (input.form[i] == input)index = i;
else i++;
return index;
}

function OnlyNumbers(obj,MaxL,CanBeZero,CanBeDec) { 

var qty = parseFloat(obj.value)
if (qty < 1 && CanBeZero != 0) { obj.value = "" }
if (isNaN(qty)) { obj.value = "" }
if (isNaN(obj.value)) { obj.value = qty }

xDec = obj.value.indexOf(".")
if (xDec != -1 && CanBeDec != ".") { obj.value = obj.value.slice(0, xDec) }

GoNext(obj,MaxL)
}

function GoNext(obj,MaxL,UCase,SpecObj) {
if (obj.maxLength > 0) { MaxL = obj.maxLength }

var StayKeys = false
if (IEver > 4) { k = event.keyCode;
if (k==9||k==35||k==36||k==37||k==39||k==16||k==46||k==8||event.shiftKey) { StayKeys = true 
  } else {
if (UCase == "U") { strVal = obj.value; strVal = strVal.toUpperCase(); obj.value = strVal }
  }
 }

if(obj.value.length >= MaxL && !StayKeys) {
xIndex = (getIndex(obj)+1) % obj.form.length

obj.form[xIndex].focus()
if (obj.form[xIndex].type == "text") { obj.form[xIndex].select() }
 }
}


function STATEtoCOUNTRY(Obj,xField) {
n = Obj.selectedIndex

if (xField == 2) { cObj = document.iForm.UserCountry } else {
cObj = document.iForm.Country }


if (n > 51) { cObj.selectedIndex = 1 } else { cObj.selectedIndex = 0 }
}


function ChangeTimeZone(o) { var SI
o = o.options[o.selectedIndex].value

HawaiiT = "HI"
AlaskaT = "AK"
PacificT = "BC,YT,CA,WA,OR,NV"
MountainT = "AB,NT,SK,MT,ID,WY,UT,CO,AZ,NM"
CentralT = "MB,NU,ND,SD,MN,WI,NE,IA,IL,IN,KS,MO,TN,OK,AR,MS,AL,TX,LA"
EasternT = "ON,PQ MI,OH,KY,GA,FL,WV,VA,NC,SC,PA,NY,NJ,VT,NH,ME,MA,CT,DE,MD,DC"
AtlanticT = "NB,NS,NF,PE"

if (HawaiiT.indexOf(o) != -1) SI = 0
if (AlaskaT.indexOf(o) != -1) SI = 1
if (PacificT.indexOf(o) != -1) SI = 2
if (MountainT.indexOf(o) != -1) SI = 3
if (CentralT.indexOf(o) != -1) SI = 4
if (EasternT.indexOf(o) != -1) SI = 5
if (AtlanticT.indexOf(o) != -1) SI = 6

document.iForm.TimeZone.selectedIndex = SI
}




function DoFocus(xEvent) { if (IEver >= 4) { var x, xLabel = xEvent.parentElement
if (xLabel.className == "xMain") {
xLabel.style.backgroundColor = "black"; xLabel.style.color = "beige"

 for (x=0 ; x < 6 ; x++) { xLabel = xLabel.parentElement
 if (xLabel.className == "xOuter") {
xLabel.children["MainQ"].style.backgroundColor = "black"
xLabel.children["MainQ"].style.color = "beige"
break }}}}
}


function DeFocus(xEvent) { if (IEver >= 4) { var x, xLabel = xEvent.parentElement
if (xLabel.className == "xMain") {
xLabel.style.backgroundColor = "beige"; xLabel.style.color = "black"

 for (x=0 ; x < 6 ; x++) { xLabel = xLabel.parentElement
 if (xLabel.className == "xOuter") {
xLabel.children["MainQ"].style.backgroundColor = "beige"
xLabel.children["MainQ"].style.color = "black"
break }}}}
}

var LastCoordW, LastCoordH

function showMenu(e,DisplayObj,WW,HH,eW,eH) { if (!DisplayObj) return false

var HorPos, VerPos, WinWidth, WinHeight, pxWidth, pxHeight

 if (document.body.clientWidth) {
WinWidth = document.body.clientWidth; WinHeight = document.body.clientHeight
 } else { WinWidth = window.innerWidth; WinHeight = window.innerHeight }

if (isNaN(WinWidth)) return false

  if (typeof(window.pageXOffset) != "undefined")
{ x = window.pageXOffset; y = window.pageYOffset }

  else if ((!document.compatMode || document.compatMode == "BackCompat") && 
document.body && typeof(document.body.scrollLeft) != "undefined")
{ x = document.body.scrollLeft; y = document.body.scrollTop }

  else if (document.compatMode == "CSS1Compat" && document.documentElement &&
typeof(document.documentElement.scrollLeft) != "undefined")
{ x = document.documentElement.scrollLeft; y = document.documentElement.scrollTop }

 else { x = 0; y = 0 }


if (eW && !isNaN(eW)) { HorPos = eW; VerPos = eH }
else if (e.clientX) { HorPos = e.clientX; VerPos = e.clientY }
else if (e.pageX) { HorPos = e.pageX; VerPos = e.pageY }

LastCoordW = HorPos
LastCoordH = VerPos


DisplayObj.style.display = "block"

 if (DisplayObj.offsetHeight) 
 { pxWidth = DisplayObj.offsetWidth; pxHeight = DisplayObj.offsetHeight }
 else if (HH) { pxWidth = WW; pxHeight = HH }
 else if (DisplayObj.height) { pxWidth = DisplayObj.width; pxHeight = DisplayObj.height }
 else { pxWidth = 350; pxHeight = 200 }


if (isNaN(HorPos) || LastKeyPress == 13) { LastKeyPress = 0
// display in middle of actual Webpage (not screen):

DisplayObj.style.left = parseInt(WinWidth/2) - parseInt(pxWidth/2) + x
DisplayObj.style.top = parseInt(WinHeight/2) - parseInt(pxHeight/2) + y

 	} else { // display next to mouse cursor Context-Menu fashion:

availRight = WinWidth-HorPos; availBottom = WinHeight-VerPos
availLeft = HorPos; availTop = VerPos
HorPos = HorPos + x; VerPos = VerPos + y

 if (availRight < pxWidth && availLeft >= pxWidth) 
 { DisplayObj.style.left = HorPos-pxWidth } else { DisplayObj.style.left = HorPos }

 if (availBottom < pxHeight && availTop >= pxHeight)
 { DisplayObj.style.top = VerPos-pxHeight } else { DisplayObj.style.top = VerPos }

	}

 if (typeof(IEfrm) != "undefined" && document.all && !IEmac) {
// display BG Iframe for IE based browsers (exept Mac) to cover <select> fields:
IEfrm.width = pxWidth; IEfrm.height = pxHeight
IEfrm.style.top = DisplayObj.style.top
IEfrm.style.left = DisplayObj.style.left
IEfrm.style.display = "block"
  }

// reply that it "worked", but not true incase we wanna cancel an event such as onConext
return "worked"
}








// Function to prevent SpamBots from picking up address from webpage: 

function OpenMail2(ea_name) { if (!ea_name) return false

tdl = "WhatDoesYourNumberSpell.com"
tdlext = ".com"

e_address = ea_name + "@" + tdl + tdlext

location = "mailto:" + e_address + "?subject=Contact via WhatDoesYourNumberSpell.com..."

}


// -->