document.cookie = 'userScreenWidth=' + screen.width;

var StartLeft = parseInt((screen.width/2) - 275);
var StartTop = parseInt((screen.height/2)- 188.5);

 function NewWindows(url)
{
    var jumpToHere;
    var winOptions;
    var popUpWindow;
    var swidth;
    var sheight

    swidth = screen.availWidth;
    sheight = screen.availHeight;
    jumpToHere = url ;
    winOptions = 'outerHeight=' + sheight + ', outerWidth=' + swidth +',scrollbars=yes,resizable=yes';
    popUpWindow = open(jumpToHere, "NewWindow", winOptions);
 }

function setinnerHeight(hdr)
{
var intSubtract

if(hdr == "HdrOut")
    {
    intSubtract = 680
    }
else
    {
    intSubtract = 260
    }
if (window.innerHeight) 
    {
    theHeight=window.innerHeight;
    }
else if (document.documentElement && document.documentElement.clientHeight) 
    {
    theHeight=document.documentElement.clientHeight;
    }
else if (document.body) 
    {
    theHeight=document.body.clientHeight;
    }
    
if(parseInt(theHeight) < parseInt(document.body.scrollHeight))
    {
    theHeight=document.body.scrollHeight + 5;
    }    

document.getElementById("LeftBar").style.height=(theHeight-intSubtract) +'px';
}

function valsearchfrm()
{
if(document.membersearch.State.value=='')
    {
    alert('Please select a State');
    return false;
    }
if(document.membersearch.ZipCode.value=='')
    {
    alert('Please enter your Zip Code');
    document.membersearch.ZipCode.focus()
    return false;
    }
if(document.membersearch.ZipCode.value.length !=5)
    {
    alert('Please enter a valid 5 digit Zip Code');
    document.membersearch.ZipCode.select()
    return false;
    }
return true;   
}

function valOption2()
{
if(document.newmemberoption3.Domain.value=='')
    {
    alert('Please enter a valid website url');
    document.newmemberoption3.Domain.select();
    return false;
    }
if(document.newmemberoption3.Company.value=='')
    {
    alert('Company is required');
    document.newmemberoption3.Company.select();
    return false;
    }
    
if(document.newmemberoption3.Contact.value=='')
    {
    alert('Contact is required');
    document.newmemberoption3.Contact.select();
    return false;
    }
    
if(document.newmemberoption3.Street.value=='')
    {
    alert('Street is required');
    document.newmemberoption3.Street.select();
    return false;
    }
if(document.newmemberoption3.City.value=='')
    {
    alert('City is required');
    document.newmemberoption3.City.select();
    return false;
    }
if(document.newmemberoption3.State.value=='')
    {
    alert('Please select your State');
    document.newmemberoption3.State.focus();
    return false;
    }
if(document.newmemberoption3.ZipCode.value=='')
    {
    alert('Please enter your Zip Code');
    document.newmemberoption3.ZipCode.focus()
    return false;
    }
if(document.newmemberoption3.ZipCode.value.length !=5)
    {
    alert('Please enter a valid 5 digit Zip Code');
    document.newmemberoption3.ZipCode.select()
    return false;
    }
if(document.newmemberoption3.Email.value=='')
    {
    alert('Email is required');
    document.newmemberoption3.Email.select();
    return false;
    }    
if(document.newmemberoption3.Password.value=='')
    {
    alert('Password is required');
    document.newmemberoption3.Password.select();
    return false;
    }    
if(document.newmemberoption3.Phone.value=='')
    {
    alert('Phone is required');
    document.newmemberoption3.Phone.select();
    return false;
    }    
if(document.newmemberoption3.Comments.value=='')
    {
    alert('The consumer needs to know a little about your company');
    document.newmemberoption3.Comments.select();
    return false;
    }    
if(document.newmemberoption3.KeyWords.value=='')
    {
    alert('You should enter some search words to help the consumer better locate your company');
    document.newmemberoption3.KeyWords.select();
    return false;
    }    

if(confirm('You are about to submit your NRN listing.\nIf all information is correct click OK\nIf you would like to make a change click Cancel'))
    {
    return true;
    }
else
    {
    return false;
    }   
}


function valOption3()
{
if(document.newmemberoption3.Company.value=='')
    {
    alert('Company is required');
    document.newmemberoption3.Company.select();
    return false;
    }
    
if(document.newmemberoption3.Contact.value=='')
    {
    alert('Contact is required');
    document.newmemberoption3.Contact.select();
    return false;
    }
    
if(document.newmemberoption3.Street.value=='')
    {
    alert('Street is required');
    document.newmemberoption3.Street.select();
    return false;
    }
if(document.newmemberoption3.City.value=='')
    {
    alert('City is required');
    document.newmemberoption3.City.select();
    return false;
    }
if(document.newmemberoption3.State.value=='')
    {
    alert('Please select your State');
    document.newmemberoption3.State.focus();
    return false;
    }
if(document.newmemberoption3.ZipCode.value=='')
    {
    alert('Please enter your Zip Code');
    document.newmemberoption3.ZipCode.focus()
    return false;
    }
if(document.newmemberoption3.ZipCode.value.length !=5)
    {
    alert('Please enter a valid 5 digit Zip Code');
    document.newmemberoption3.ZipCode.select()
    return false;
    }
if(document.newmemberoption3.Email.value=='')
    {
    alert('Email is required');
    document.newmemberoption3.Email.select();
    return false;
    }    
if(document.newmemberoption3.Password.value=='')
    {
    alert('Password is required');
    document.newmemberoption3.Password.select();
    return false;
    }    
if(document.newmemberoption3.Phone.value=='')
    {
    alert('Phone is required');
    document.newmemberoption3.Phone.select();
    return false;
    }    
if(document.newmemberoption3.Comments.value=='')
    {
    alert('The consumer needs to know a little about your company');
    document.newmemberoption3.Comments.select();
    return false;
    }    
if(document.newmemberoption3.KeyWords.value=='')
    {
    alert('You should enter some search words to help the consumer better locate your company');
    document.newmemberoption3.KeyWords.select();
    return false;
    }    

if(confirm('You are about to submit your NRN listing.\nIf all information is correct click OK\nIf you would like to make a change click Cancel'))
    {
    return true;
    }
else
    {
    return false;
    }   
}

function getweather()
  {
    var jumpToHere;
    var winOptions;
    var popUpWindow;
    var swidth;
    var sheight
 
    swidth = screen.availWidth
    sheight = screen.availHeight
 
    jumpToHere = 'http://www.weather.com/weather/local/' + document.weather.local.value + '?from=tabset';;
    winOptions = "outerWidth=" + swidth + ", outerheight=" + sheight + ",scrollbars=yes,resizable=yes";
    //document.location.href='http://www.weather.com/weather/local/' + document.weather.local.value + '?from=tabset';
    popUpWindow = open(jumpToHere, "MyWindow", winOptions);
}

function valOption1()
{
if(document.option1frm.Template(0).checked == false && document.option1frm.Template(1).checked == false && document.option1frm.Template(2).checked == false && document.option1frm.Template(3).checked == false && document.option1frm.Template(4).checked == false && document.option1frm.Template(5).checked == false)
    {
    alert('You have not selected a website template')
    return false;
    }
if(document.option1frm.CurrentEmail.value=='')
    {
    alert('Current Email is Required')
    return false;
    }
if(document.option1frm.SubDomain.value=='')
    {
    alert('Please enter a Company Name for your website')
    return false;
    }
     
if(confirm('You are about to create your new member website,\nonce the setup is done you will be taken to your website\nand you can start adding your content.\nTo continue click OK, To stop now click Cancel'))
    {
    return true;
    }
else
    {
    return false;
    }
}

function MyRollover(x,y)
{
alert(x + ' - ' + y);
if (document.images)
        document.images[x].src ='./images/' + y;
}

function HideDiv(divObj)
{
var CurDiv = document.getElementById(divObj)

CurDiv.style.display = "none"
}

function ShowDiv(divObj,e)
{
divName ='spanContent';
var CurDiv = document.getElementById(divObj);
if(CurDiv)
    {
    if (document.all)
        { //IS IE 4 or 5 (or 6 beta)
        //document.getElementById(divName).style.width = document.getElementById('divMap').style.width
        document.getElementById(divName).style.display = 'block';
        document.getElementById(divName).innerHTML  = document.getElementById(divObj).innerHTML;
        document.getElementById(divName).style.left = e.x + 'px'; 
        document.getElementById(divName).style.top  = e.y + 'px';
        }
    if (document.layers)
        { //IS NETSCAPE 4 or below
        document.layers[divName].style.display = 'block';
        document.layers[divName].innerHTML  = document.layers[divObj].innerHTML;
        document.layers[divName].style.left = event.x + 'px'; 
        document.layers[divName].style.top  = event.y + 'px';
        }
    if (document.getElementById &&!document.all)
        {
        document.getElementById(divName).style.display = 'block';
        document.getElementById(divName).innerHTML  =  document.getElementById(divObj).innerHTML;
        document.getElementById(divName).style.left = e.pageX + 'px'; 
        document.getElementById(divName).style.top  = e.pageY + 'px'; 
        }
    }
}

function ShowHideDiv(divObj)
{

var CurDiv = document.getElementById(divObj)
if(CurDiv.style.display == "block")
    {
    CurDiv.style.display = "none"
    }
else
    {
    var divs = document.getElementsByTagName('div') 
    for (var i=0;i<divs.length;i++)
    { 
    if (divs[i].style.display =='block')
        {
        divs[i].style.display ='none'
        }
    }
    
    hza = document.getElementById(divObj);
    hza.style.display = "block" ;
    }
}

function alertSize() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }

if(document.getElementById('divMap').style.width == "552px" )
    {
    var imgHalf = 275
    }
else
    {
    var imgHalf = 225
    }
        
  StartLeft = parseInt((myWidth/2) - parseInt(imgHalf))
  StartTop = myHeight/2
  //window.alert( 'Width = ' + myWidth + ', ' + parseInt((myWidth/2) - parseInt(imgHalf)) );
  //window.alert( 'Height = ' + myHeight );
}
function centerMap()
{
if (document.all)
    { //IS IE 4 or 5 (or 6 beta)
    document.getElementById('divMap').style.left = StartLeft + 'px';
    document.getElementById('divMap').style.display='block'; 
    }
if (document.layers)
    { //IS NETSCAPE 4 or below
    document.layers['divMap'].style.left = StartLeft + 'px';
    document.layers['divMap'].style.display='block'; 
    }
if (document.getElementById &&!document.all)
    {
    document.getElementById('divMap').style.left = StartLeft + 'px';
    document.getElementById('divMap').style.display='block';  
    }
}


function mouseX(evt) {
if (evt.pageX) alert('pageX' + evt.pageX);
else if (evt.clientX)
   alert( 'clientX' +  evt.clientX + (document.documentElement.scrollLeft ?
   document.documentElement.scrollLeft :
   document.body.scrollLeft));
else alert('none');
}
function mouseY(evt) {
if (evt.pageY) return evt.pageY;
else if (evt.clientY)
   return evt.clientY + (document.documentElement.scrollTop ?
   document.documentElement.scrollTop :
   document.body.scrollTop);
else return null;
}

function valnewpage()
{

if(document.newpage.pagename.value =='' || document.newpage.pagename.value =='enter page name')
    {
    alert('No page name entered');
    document.newpage.pagename.value='';
    document.newpage.pagename.focus();
    return false;
    }
else
    {
    if(confirm('The page you are about to create will be copied from the template.asp page.\nTo continue click OK, To stop now click Cancel.'))
        {
        return true;
        }
    else
        {
        return false;
        }
    }
}

 function NewWindows(url,intWidth)
{
    var jumpToHere;
    var winOptions;
    var popUpWindow;
    var swidth;
    var sheight

    swidth = intWidth + 'px';//screen.availWidth
    sheight = '400px';
    jumpToHere = url ;
    winOptions = 'Height=' + sheight + ', Width=' + swidth +',left=0,top=0,scrollbars=yes,resizable=yes';
    popUpWindow = open(jumpToHere, "NewWindow", winOptions);
 }

function ShowDiv2(divObj)
{
var CurDiv = document.getElementById(divObj)
if(CurDiv.style.display == "block")
    {
    CurDiv.style.display = "none"
    }
else
    {
    var divs = document.getElementsByTagName('div') 
    for (var i=0;i<divs.length;i++)
    { 
    if (divs[i].style.display =='block')
        {
        divs[i].style.display ='none'
        }
    }
    
    hza = document.getElementById(divObj);
    hza.style.display = "block" ;
    }
}

function GeneratePassword() {
 
    if (parseInt(navigator.appVersion) <= 3) {
        alert("Sorry this only works in 4.0 browsers");
        return true;
    }
 
    var length=8;
    var sPassword = "";
 
    var noPunction = true //(document.register.punc.checked);
    var randomLength = false // (document.register.rLen.checked);
 
    if (randomLength) {
        length = Math.random();
 
        length = parseInt(length * 100);
        length = (length % 7) + 6
    }
 
 
    for (i=0; i < length; i++) {
 
        numI = getRandomNum();
        if (noPunction) { while (checkPunc(numI)) { numI = getRandomNum(); } }
 
        sPassword = sPassword + String.fromCharCode(numI);
    }
 
    document.register.ValidationCode.value = sPassword
 
    return true;
}
 
function getRandomNum() {
 
    // between 0 - 1
    var rndNum = Math.random()
 
    // rndNum from 0 - 1000
    rndNum = parseInt(rndNum * 1000);
 
    // rndNum from 33 - 127
    rndNum = (rndNum % 94) + 33;
 
    return rndNum;
}
 
function checkPunc(num) {
 
    if ((num >=33) && (num <=47)) { return true; }
    if ((num >=58) && (num <=64)) { return true; }
    if ((num >=91) && (num <=96)) { return true; }
    if ((num >=123) && (num <=126)) { return true; }
 
    return false;
}

function valregister()
{
    if(document.register.sitename.value=='')
        {
        alert('Site Name is required');
        return false;
        }

    if(document.register.SiteTitle.value=='')
        {
        alert('Site Title is required');
        return false;
        }

     if(document.register.typeid.value=='')
        {
        alert('Site Type is required');
        return false;
        }


    if(document.register.contact.value=='')
        {
        alert('Contact is required'); 
        return false;
        }

   if(document.register.street.value=='')
        {
        alert('Street is required'); 
        return false;
        }

   if(document.register.city.value=='')
        {
        alert('City is required'); 
        return false;
        }

   if(document.register.state.value=='')
        {
        alert('State is required'); 
        return false;
        }

   if(document.register.zip.value=='')
        {
        alert('Postal Code is required'); 
        return false;
        }

   if(document.register.phone.value=='')
        {
        alert('Phone is required'); 
        return false;
        }

   if(document.register.email.value=='')
        {
        alert('Email is required'); 
        return false;
        }

   if(document.register.password.value=='')
        {
        alert('Password is required'); 
        return false;
        }
   if(document.register.verifypassword.value=='')
        {
        alert('Verify Password is required'); 
        return false;
        }

if(document.register.verifypassword.value!= document.register.password.value)
        {
        alert('Password validation failed, check your verify password field and try again'); 
        return false;
        }

if(confirm('You are about to complete step one of the registration process.\n\nYou will be emailed a validation code to complete step two, once you submit the code you will be allowed to pick your website template.\n\nTo continue click OK, To stop now click Cancel.'))
    {return true;}
else
    {return false;}

}

function valthecode()
{
if(document.thecode.ValidationCode.value== document.thecode.validatecode.value)
{
ShowDiv2('webtemplates')
}
else
{alert('Invalid Code re-enter the validation code and try again.')}
}

function gobanner(x,y)
{
   var jumpToHere;
    var winOptions;
    var popUpWindow;
    var swidth;
    var sheight;

    swidth = screen.availWidth;
    sheight = screen.availHeight;
    jumpToHere = './clickthru.asp?id=' + x + '&traclog=1&url=' + y;
    winOptions = 'Height=' + sheight + ', Width=' + swidth +',scrollbars=yes,resizable=yes';
    popUpWindow = open(jumpToHere, "NewWindow", winOptions);
 }


function ShowDiv(divObj)
{

var CurDiv = document.getElementById(divObj)
if(CurDiv.style.display == "block")
    {
    CurDiv.style.display = "none"
    }
else
    {
    var divs = document.getElementsByTagName('div') 
    for (var i=0;i<divs.length;i++)
    { 
     if(divs[i].id!='nohide')
    {
    if (divs[i].style.display =='block')
        {
         divs[i].style.display ='none'
        }
    }
    }
    
    hza = document.getElementById(divObj);
    hza.style.display = "block" ;
    }
}

function ValAddClass()
{
if(document.addClass.Contact.value=='')
   {
   alert('Contact is required');
   return false;
   }

if(document.addClass.City.value=='')
   {
   alert('City is required');
   return false;
   }

if(document.addClass.State.value=='')
   {
   alert('State is required');
   return false;
   }

if(document.addClass.DayPhone.value=='')
   {
   alert('Day Phone is required');
   return false;
   }

if(document.addClass.NightPhone.value=='')
   {
   alert('Night Phone is required');
   return false;
   }

if(document.addClass.Email.value=='')
   {
   alert('Email is required');
   return false;
   }

if(document.addClass.CatID.value=='')
   {
   alert('Category is required');
   return false;
   }

if(document.addClass.Caption.value=='')
   {
   alert('Caption is required');
   return false;
   }

if(document.addClass.ClassContent.value=='')
   {
   alert('Content is required');
   return false;
   }

if(confirm('You are about to submit your Classified Ad.\nTo continue click OK, To stop now click Cancel.'))
   {
    return true;
   }
else
   {
    return false;
   }

}

function myVoid()
{;}

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-19155593-1']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();




function init() 
{
  if (window.Event) 
{
    document.captureEvents(Event.MOUSEMOVE);
}
  document.onmousemove = getXY;
}

function getXY(e) 
{
  x = (window.Event) ? e.pageX : event.clientX;
  y = (window.Event) ? e.pageY : event.clientY;

  alert(x+":"+y);
}

