function submitIfSure(f, message) {
  if (confirm(message, false)) {
    f.submit();
  }
  else {
    return (false);
  }
}

function myGetElementById(id) {
  for (i=0; i<document.forms.length; i++) {
    f = document.forms[i];
    if (typeof(f[id]) != "undefined") {
      return (f[id]);
    }
  }
}

// doesn't work yet because password and email are often posted; reload resubmits them
function jslogout(value) {
	var today = new Date();
	var expiry = new Date(today.getTime() - 3 * 24 * 60 * 60 * 1000); // minus 3 days
  alert (value);
	alert (document.cookie);
	document.cookie='password' + "=" + escape(value) + "; expires=" + expiry.toGMTString();
	alert (document.cookie);
  alert('You have been logged out');
	document.location.reload();
}

function mailWindow (s) {
  mailWin=window.open('/send.php?subject='+s, '_blank','left=100,top=100,scrollbars=no,resizable=yes,width=550,height=400');
}

function helpWindow(e, field) {

 if (document.layers){                      // if netscape.. get mouse coords from event and set stylesheet
   x = e.screenX;
   y = e.screenY;
   style='<link rel="styleSheet" href="/include/netscapeStyle.css" type="text/css">';
 }
 else {                       // if ie.. get mouse coords and set stylesheet
     x = window.event.x;
     y = window.event.y;
     style='<link rel="styleSheet" href="/include/style.css" type="text/css">';
 }  

  helpWin=window.open('','_blank','left='+ x +',top='+ y +',scrollbars=no,resizable=yes,width=350,height=250');

  helpWin.document.writeln('<html><head><title>'+field+' not Displayed</title>'+style+'</head>');
  helpWin.document.writeln('<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" bgColor=#ffffff>');
  helpWin.document.writeln('<table width="100%" cellpadding="5" cellspacing="0" border="0">');
  helpWin.document.writeln('<tr><td class="popupQ">Why is the '+field+' field hidden? &nbsp;<img src="images/locked.gif" align="absmiddle"></td></tr>');
  helpWin.document.writeln('<tr><td class="popupA">This resumé holder has chosen to hide the field from general viewing.</td></tr>');
  helpWin.document.writeln('<tr><td class="popupQ">Can I access this information?</td></tr>');
  //helpWin.document.writeln('<tr><td class="popupA">Employers in the GIS industry may register with our site to unlock these fields. Registration also adds the ability to post jobs. To register or login, <a href="#" onclick="window.opener.location=\'/login.php\'; window.close()">click here.</a></td></tr>');
  helpWin.document.writeln('<tr><td class="popupA">Yes. Employers in the GIS industry may register with our site and purchase a browse package to unlock these fields. The cost is $50 dollars for 30 days of access to all resumes posted on this site. To register or login, <a href="#" onclick="window.opener.location=\'/login.php\'; window.close()">click here.</a></td></tr>');
  helpWin.document.writeln('<tr><td class="popupA">To learn more about privacy options on resumés, please see our  <a href="#" onclick="window.open(\'/faq.php#Privacy\'); window.close()">FAQ.</a></td></tr>');
  helpWin.document.writeln('<tr><td align="center"><a style="text-decoration:none;" href="javascript:window.close()">[ Close Window ]</a></td></tr>');
  helpWin.document.writeln('</table>');
  helpWin.document.writeln('</body></html>');
}

function rollInPurchase(imgName) {
  document[imgName].src = "/images/purchase_on.gif";
}
function rollOutPurchase(imgName) {
  document[imgName].src = "/images/purchase_off.gif";
}

function rollInContact(imgName) {
  document[imgName].src = "/images/contact_on.gif";
}
function rollOutContact(imgName) {
  document[imgName].src = "/images/contact_off.gif";
}

function footOver(ele) { ele.className = "footOver"; }
function footOff(ele) { ele.className = "footOff"; }

function navOver(ele) { ele.className = "navOver"; }
function navOff(ele) { ele.className = "navOff"; }
function go(href) { document.location = href; }

