 //This is for the popups.
 var win=null;
 function NewWindow(mypage,myname,w,h,pos,infocus){
 if(pos=="random"){myleft=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;mytop=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
 if(pos=="center"){myleft=(screen.width)?(screen.width-w)/2:100;mytop=(screen.height)?(screen.height-h)/2:100;}
 else if((pos!='center' && pos!="random") || pos==null){myleft=0;mytop=20}
 settings="width=" + w + ",height=" + h + ",top=" + mytop + ",left=" + myleft + ",scrollbars=yes,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no";win=window.open(mypage,myname,settings);
 win.focus();}
//End of popups
 //This function is being used to automatically tab in the phone number fields.  
var phone_field_length=0;
function TabNext(obj,event,len,next_field)
{

 if (event == "down")
 {
 phone_field_length=obj.value.length;
 }
 else if (event == "up")
 {
 if (obj.value.length != phone_field_length)
 {
 phone_field_length=obj.value.length;
 if (phone_field_length == len)
 {
 next_field.focus();
 }
 }
 }
}
//  end of automatically tabbing 

// displays alerts
 function disp_alert()
 {
 alert ('This page is currently undergoing maintenance. Please check back!')
 }
//This is for W3C Popups
var win=null;
function NewWindow(mypage,myname,w,h,pos,infocus){
if(pos=="random"){myleft=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;mytop=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){myleft=(screen.width)?(screen.width-w)/2:100;mytop=(screen.height)?(screen.height-h)/2:100;}
else if((pos!='center' && pos!="random") || pos==null){myleft=0;mytop=20}
settings="width=" + w + ",height=" + h + ",top=" + mytop + ",left=" + myleft + ",scrollbars=yes,location=yes,directories=yes,status=yes,menubar=yes,toolbar=yes,resizable=yes";win=window.open(mypage,myname,settings);
win.focus();}
//for emails
function UnCryptMailto( s )
    {
        var n = 0;
        var r = "";
        for( var i = 0; i < s.length; i++)
        {
            n = s.charCodeAt( i );
            if( n >= 8364 )
            {
                n = 128;
            }
            r += String.fromCharCode( n - 1 );
        }
        return r;
    }

    function linkTo_UnCryptMailto( s )
    {
        location.href=UnCryptMailto( s );
    }
    // end of W3C Popups script
    
    //creates cookie
      createCookie('elitewebsolutions','splashcookie',365)
      function createCookie(name,value,days)
      {
      if (days)
       {
      var date = new Date();
      date.setTime(date.getTime()+(days*24*60*60*1000));
      var expires = "; expires="+date.toGMTString();
       }
      else var expires = "";
      document.cookie = name+"="+value+expires+"; path=/";
 }