// JavaScript Document

var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=yes,menubar=no,toolbar=no,resizable=yes';
win=window.open(mypage,myname,settings);}

function PhoneNumber (s) {this.number = s.replace(/^[01]/, '').replace (/([a-pr-y])/gi, function () {return {a:2, b:2, c:2, d:3, e:3, f:3, g:4, h:4, i:4, j:5, k:5, l:5, m:6, n:6, o:6, p:7, r:7, s:7, t:8, u:8, v:8, w:9, x:9, y:9}[arguments[1].toLowerCase()]}).match(/\d/g)}

PhoneNumber.prototype.toString = function () {return [this.number[0], this.number[1], this.number[2], '-', this.number[3], this.number[4], this.number[5], '-', this.number[6], this.number[7], this.number[8], this.number[9]].join('')}

String.prototype.isPhoneNumber = function () {return /\d{3}-\d{3}-\d{4}/.test(this)}
