//EMAIL VALIDATOR STARTS HERE!!!!!!!!!!!!!!!!!
function validEmail2(emaila) {
invalidChars2 = " /:,;"
if (emaila == "") {
return false
}
for (i=0; i<invalidChars2.length;
i++) {
badChar2 = invalidChars2.charAt(i)
if (emaila.indexOf(badChar2,0) > -1) {
return false
}
}
atPos2 = emaila.indexOf("@",1)
if (atPos2 == -1) {
return false
}
if (emaila.indexOf("@",atPos2+1) > -1) {
return false
}
periodPos2 = emaila.indexOf(".",atPos2)
if (periodPos2 == -1) {
return false
}
if (periodPos2+3 > emaila.length) {
return false
}
return true
}

function submitComments(hform) {
if (!validEmail2(hform.comments_email.value)) {
alert ("Please enter a valid email address")
hform.comments_email.focus()
hform.comments_email.select()
return false
}
return true
}

function submitIt(hform) {
if (!validEmail2(hform.email.value)) {
alert ("Please enter a valid email address.")
hform.email.focus()
hform.email.select()
return false
}
return true
}
//EMAIL VALIDATOR ENDS HERE!!!!!!!!!!!!!!!!!


//NETSCAPE FORWARDING FUNCTION STARTS HERE
function MM_checkBrowser(NSvers,NSpass,NSnoPass,IEvers,IEpass,IEnoPass,OBpass,URL,altURL) { //v4.0
  var newURL='', verStr=navigator.appVersion, app=navigator.appName, version = parseFloat(verStr);
  if (app.indexOf('Netscape') != -1) {
    if (version >= NSvers) {if (NSpass>0) newURL=(NSpass==1)?URL:altURL;}
    else {if (NSnoPass>0) newURL=(NSnoPass==1)?URL:altURL;}
  } else if (app.indexOf('Microsoft') != -1) {
    if (version >= IEvers || verStr.indexOf(IEvers) != -1)
     {if (IEpass>0) newURL=(IEpass==1)?URL:altURL;}
    else {if (IEnoPass>0) newURL=(IEnoPass==1)?URL:altURL;}
  } else if (OBpass>0) newURL=(OBpass==1)?URL:altURL;
  if (newURL) { window.location=unescape(newURL); document.MM_returnValue=false; }
}
//NETSCAPE FORWARDING FUNCTION ENDS HERE



//THE ROLLOVER CODE STARTS HERE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
if (document.images) {
//THE NAVIGATION ROLLOVERS START HERE
about_off = new Image
about_on = new Image
clients_off = new Image
clients_on = new Image
services_off = new Image
services_on = new Image
contact_off = new Image
contact_on = new Image
csd_off = new Image
csd_on = new Image
//THE NAVIGATION ROLLOVERS END HERE


//THE NAVIGATION ROLLOVER .SRC CODES START HERE
about_off.src = "http://www.tepperware.net/pix/about.gif"
about_on.src = "http://www.tepperware.net/pix/about_over.gif"
clients_off.src = "http://www.tepperware.net/pix/clients.gif"
clients_on.src = "http://www.tepperware.net/pix/clients_over.gif"
services_off.src = "http://www.tepperware.net/pix/services.gif"
services_on.src = "http://www.tepperware.net/pix/services_over.gif"
contact_off.src = "http://www.tepperware.net/pix/contact.gif"
contact_on.src = "http://www.tepperware.net/pix/contact_over.gif"
csd_off.src = "http://www.tepperware.net/homehtml/services/pix/csd_off.gif"
csd_on.src = "http://www.tepperware.net/homehtml/services/pix/csd_on.gif"
//THE NAVIGATION ROLLOVER .SRC CODES END HERE
}


//THE ROLLOVER FUNCTIONS START HERE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
function chgImg (imgField,newImg) {
if (document.images) {
document[imgField].src=eval(newImg 
+ ".src")
}
}
//THE ROLLOVER CODE ENDS HERE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!



// The Central Randomizer 1.3 (C) 1997 by Paul Houle (houle@msc.cornell.edu)
// See:  http://www.msc.cornell.edu/~houle/JavaScript/randomizer.html

rnd.today=new Date();
rnd.seed=rnd.today.getTime();

function rnd() {
        rnd.seed = (rnd.seed*9301+49297) % 233280;
        return rnd.seed/(233280.0);
};

function rand(number) {
        return Math.ceil(rnd()*number);
};

// end central randomizer. -->



function joinMailingList() {
   
   var params;

   myHttpRequest = new AW.HTTP.Request();
   myHttpRequest.parent = this;
   
   myHttpRequest.setURL("AJAXServer.php");
   myHttpRequest.setRequestMethod("POST");
   
   myHttpRequest.setAsync(true);
   myHttpRequest.setParameter("screen", 'general');
   myHttpRequest.setParameter("request", 'joinMailingList');
   myHttpRequest.setParameter("email", document.getElementById('mListEmail').value);   

   
   myHttpRequest.response = function(xml){
   
      if (typeof(xml) != 'object') { 
         return;
      }
      
      var messageNode = xml.selectNodes('//response/message'); 
      if (messageNode && messageNode[0].text) { 
         alert(messageNode[0].text);
      }
      
      var rcNode = xml.selectNodes('//response/rc'); 
      if (rcNode && rcNode[0].text==1) { 
         document.getElementById('mListEmail').value='Join our mailing list!';
      }
      
      
   }

   myHttpRequest.request();
   
   return;


}