function isEmail()   {
   emailAddress=document.submit.mailaddress.value;
      // Return false if e-mail field does not contain a '@' and a '.' or is blank.
   if (document.submit.mailaddress.value == "" || document.submit.mailaddress.value.indexOf ('@',0) == -1 || document.submit.mailaddress.value.indexOf ('.',0) == -1)
      {      alert("Are you sure you entered your email address correctly?")
      document.submit.mailaddress.select();
      document.submit.mailaddress.focus();
      return false;
   }
   else
     {
      return true;
      }
   }

// is this being used anywhere? (Was NOT used in Darrow cover 04-07-06.)
function newWindow() {
	var theWindow = window.open("","darrow","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=600,height=300");
	theWindow.focus();
	return theWindow;
}


RandomCPNumber = Math.round(Math.random() * 20000);

function writeAd(slot) {
	them = 'http://ad.doubleclick.net/';
	us = '/main.washingtoncitypaper/';
	if (slot == 1) {
		w = '728';
		h = '90';
		type = 'leaderboard';
	}
	if (slot == 2) {
		w = '120';
		h = '90';
		type = 'button';
	}
	if (slot == 3) {
		w = '160';
		h = '600';
		type = 'skyscraper';
	}
//	if (slot == 3) {
//		if 	(zoneKW == 'restaurants') {
//			w = '120';
//			h = '90';
//			type = 'button';
//		} else {
//			w = '160';
//			h = '600';
//			type = 'skyscraper';
//		}
//	}
	if (slot == 4) {
		w = '300';
		h = '250';
		type = 'rectangle';
	}
//	if (slot == 4) {
//		if 	(zoneKW == 'restaurants') {
//			w = '120';
//			h = '90';
//			type = 'button';
//		} else {
//			w = '300';
//			h = '250';
//			type = 'rectangle';
//		}
//	}
// The restaurant pages are the only ones with a slot 5.
	if (slot == 5) {
			w = '300';
			h = '250';
			type = 'rectangle';
	}
	if (slot == 6) {
		w = '120';
		h = '90';
		type = 'button';
	}
	sz = 'sz=' + w + 'x' + h + ';';
	tile = 'tile=' + slot + ';';
	if (pageKW == '') {
		var key = '';
	}
	else {
		var key = 'pg=' + pageKW + ';';
	}
	var zone = zoneKW + ';';
	path = us + zone + key + sz + tile + 'ord=' + RandomCPNumber + '?';
	iframe = '<iframe src="' + them + 'adi' + path + '" width="' + w + '" height="' + h + '" class="' + type + '" scrolling="no" frameborder="0">';
	href = '<a href="' + them + 'jump' + path + '">';
	img = '<img src="' + them + 'ad' + path + '" width="' + w + '" height="' + h + '" alt="">';
//	alert(type);
	if (slot == 1) {
		document.write('<div id="topAdvert">');
		document.write('<div class="advertCaption">advertisement</div>');
	}
	document.write(iframe);
	document.write(href);
	document.write(img);
	document.write('</a>');
	document.write('</iframe>');
	if (slot == 1) {
		document.write('</div>');
	}
}

//window.onload = function() {
//	alert(str);
//}



