
function mapWindow(title, img, wid, ht) {
  day = new Date();
  id = day.getTime();
  var winWidth = wid + 50;
  var winHeight = ht + 125;
  var params = 'width=' + winWidth + ',height=' + winHeight + ',resizable,scrollbars';
  var newWindow = open ('',id, params);
  var output = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">\n'+
               '<html><head><title>' + title + '<\/title>\n'+
			   '<style type="text/css">\n'+
			   ' body,html { font-family: arial,helvetica,sans-serif; text-align: center; }\n'+
			   '<\/style><\/head><body>\n'+
               '<h3>' + title + '<\/h3>\n'+
			   '<a href="#" onClick="window.close();"><img src="images\/' + img + '" width="' + wid + '"height="' + ht + '"border="0"><\/a>\n'+
               '<form action=""><input type="button" onClick="window.close();" value="Close Window" onBlur="this.focus();">\n'+
               '<\/form><\/body><\/html>\n\n';
  newWindow.document.write(output);
  newWindow.document.close();
  return false;
}

function clickalert() {
  var alertmsg = 'Please click on one of the red\n' +
                 'dots or select a link from the list\n' +
                 'at the left to find a Byrnes Oil Pacific\n' +
                 'Pride franchise. For other Pacific Pride\n' +
                 'locations, click the Pacific Pride logo above.';
  alert(alertmsg);
  return false;
}


function checkForm(form) {

   var requireds = new Array('Owner_Name', 'Email');
   var msg = '';

   if (document.getElementById) {
      for (i=0; i<requireds.length; i++) {
         if (document.getElementById(requireds[i]).value=='') {
            msg = 'Please provide your ' + requireds[i] + ' before submitting this form.';
            break;
		 }
      }
      if ((msg == '') && (form.Email.value != '')) {
         var found = false;
         var emailString = document.getElementById('Email').value;
         for (j=0; j < emailString.length; j++) {
           if (emailString.charAt(j) == "@") { found = true; }
		 }
         if (found == false) {
           msg = 'Is that your true email address?\n' +
                 'Please enter your correct email address.\n' +
                 'We will not place you on any mailing lists!\n';
         }
      }

      if (msg !='') {  alert(msg);  }
      else { form.submit(); }
   }
   return false;
}

