var at = "@";
var h = "";
var xmp = "";
function p(line) { document.write(line+"\n"); }
function p0(line) { document.write(line); }
function xmp(s) { p("<xmp>");p(s);p("</xmp>"); }

function top_btn() {
p('<center><a href="#_top" OnClick="cc()" ><img src="graf/ptr-up.gif" width=16 height=9 border=0 alt="Top" title="Top"></a></center>');
}

function boilerplate_top(h) {
if(!h) h="";
p0('<a name="_top"></a><table cellpadding=0 cellspacing=0 border=0 ><tr><td height=8></td></tr></table>');

p('<table border="0" cellspacing=0 cellpadding=0 width="100%"><tr><td>');
p('<table width="100%" border="0" bgcolor="#CfCfCf" background="graf/greypin.jpg" background="graf/greypin.jpg"  >');
p('  <tr>');
p('    <td width="140">');
p('    <a href="index.html">');
p('    <img src="graf/wrm-boat.jpg" alt="WRM 2007" width=140 height=105 border=0 hspace=5></a>');
p('    </td><td>&nbsp;&nbsp;</td>');
p('    <td>');
p('      <div align="center">');
p('      <p class="header" >');
p('	American Chemical Society <br>');
p('        Western Regional Meeting 2007<br>');
p('        <span style="color:#3388EE;font-size:1.07em">');
p('	<nobr>Frontiers in Chemistry,</nobr>');
p('	<nobr>Biopharmaceuticals &amp; Biotechnology</nobr>');
p('	</span><br>');
p('	October 9-13, 2007');
p('	</p>');
p('      </div>');
p('    </td><td>&nbsp;&nbsp;</td>');
p('    <td width="140" align=right>');
p('      <a href="http://acs.org">');
p('      <img src="graf/acsdia1.gif" width=102 height=102 border="0" hspace=5 alt="ACS" title="ACS"></a>');
p('    </td>');
p('  </tr>');
p('</table><table');
p('    cellpadding=0 cellspacing=0 border=0 >');
p('    <tr><td height=10></td></tr>');
p('  </table><table');
p('    width="100%" border="0" bgcolor="#CfCfCf" >');
p('  <tr>');
p('    <td align="center" >');
p('	<p style="margin-top:3pt;margin-bottom:0pt">');
p('	<a href="index.html" onMouseOver="MM_swapImage(\'Image15\',\'\',\'graf/b2_home.gif\',1)" onMouseOut="MM_swapImgRestore()"><img src="graf/b1_home.gif" name="Image15" width="150" height="20" border="0" id="Image15"></a> &nbsp;&nbsp;&nbsp;<a href="welcome.html" onMouseOver="MM_swapImage(\'Image19\',\'\',\'graf/b2_welcome.gif\',1)" onMouseOut="MM_swapImgRestore()"><img src="graf/b1_welcome.gif" name="Image19" width="150" height="20" border="0" id="Image19"></a>&nbsp;&nbsp;&nbsp; <a href="committee.html" onMouseOver="MM_swapImage(\'Image20\',\'\',\'graf/b2_committee.gif\',1)" onMouseOut="MM_swapImgRestore()"><img src="graf/b1_committee.gif" name="Image20" width="150" height="20" border="0" id="Image20"></a>&nbsp;&nbsp;&nbsp;<a href="adv_board.html" onMouseOver="MM_swapImage(\'Image12\',\'\',\'graf/b2_adv_board.gif\',1)" onMouseOut="MM_swapImgRestore()"><img src="graf/b1_adv_board.gif" name="Image12" width="150" height="20" border="0" id="Image12"></a></p>');
p('    </td>');
p('  </tr>');

p('    </table><table');
p('	cellpadding=0 cellspacing=0 border=0 ><tr><td height=10></td></tr>');
p('</table>');
}

function boilerplate_bottom(h) {
if(!h) h="";
p('<tr> ');
p('<td bgcolor="#F7F7F7" valign=bottom colspan=3>');
p('<table cellpadding=0 cellspacing=0 border=0 width="100%" ><tr><td width="33%">');
p('<div><span class=fineprint><script>TimeStamp("<nobr>Last modified:</nobr>")</script></span></div>');
p('</td><td align=center nowrap width="34%"><span class="fineprint">');
var nb='&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
p(nb+nb+nb+nb+nb+nb+nb+nb+'&nbsp;&nbsp;&nbsp;');
p('[ <i><a href="'+h+'private" class=gray style="font-weight:normal" title="password required">login</a></i> ');
<!--p('| <i><a href="old" class=gray style="font-weight:normal">old</a></i> ');-->
<!--p('| <i><a href="alt" class=gray style="font-weight:normal">alt</a></i> ');-->
p(']</span></td>');
p('<td align=right nowrap valign=top width="33%">');
p('<p class=m0><a href="mailto:webmaster'+at+'wrmacs.org?subject=WRM 2007">webmaster email</a>&nbsp;&nbsp;</p></td></tr></table>');
p('  </td>');
p('</tr>');
p('</table></td></tr>');
}

function Abstract(ses) {
//    alert("Abstract for session "+ses); // DEBUG
    NewWin('abstract.pl?'+ses,ses,800,500);
}

//////////////////////////////////////////

function toc_bgn(width) {
if(!width) var width ="";
p('<table '+width+' \
style="border-width:0px;border-spacing:0px;border-style:none;\
border-color:#0066CC;border-collapse:collapse;background-color:#216CAF"');
}
function toc_end() {
p('</table>');
}
var count=0;
function toc_item(h,name,link,fontclass,fontstyle) {
if(!h) h = "";
if(!fontclass) fontclass = "toc";
if(!fontstyle) fontstyle = "";
if(fontstyle ) fontstyle=" style='"+fontstyle+"'";
// if(++count < 3) alert("class=("+fontclass+")  style=("+fontstyle+")");
var a = "a";
if(link == "") a = "span";
p('<tr><td align=center \
style="border-width:thick;padding:3px;border-style:groove;border-color:#0066CC;\
background-color:#216CAF"><'+a+' href="'+h+link+'" class='+fontclass+fontstyle+'>'+name+'</'+a+'></td></tr>');
}
function boilerplate_left(h) {
  if(!h) var h = "";
  toc_bgn("width=164");
  if(xmp) p0("<xmp>");
  toc_item(h,"WRM 2007","index.html","gold","font-family:Comic Sans MS;font-style:normal;");
  toc_item(h,"Breaking News","news.html","","color:#FF4444");
  toc_item(h,"General Meeting Information","meetings.html");
  toc_item(h,"Program Overview","confex.pl?AAG.HTM");
  toc_item(h,"Technical Program","confex.pl?MEETING.HTM");
  toc_item(h,"Poster Sessions","poster.html");
  toc_item(h,"Kick &ndash; Off Lecture","kickoff.html");
  toc_item(h,"U.S.S. Midway Extravaganza","midway.html");
  toc_item(h,"Registration","registration.html");
  toc_item(h,"Housing &amp; Travel","hotels.html");
  toc_item(h,"Exposition","exposition.html");
  toc_item(h,"For Vendors","exhibitors.html");
  toc_item(h,"Vendor Workshops","workshops.html");
  toc_item(h,"Sponsorships","spnsrships.html");
  toc_item(h,"Awards","awards.html");
  toc_item(h,"Career Services","careers.html");
  toc_item(h,"Employment Clearinghouse","employment.html");
  toc_item(h,"Local Sights","local.html")
  toc_item(h,"Meeting Flyers","flyers.html");
//  toc_item(h,"&nbsp;","");

  if(xmp) p0("</xmp>");
  toc_end()
  MM_preloadImages();
}

function MM_validateFormY(args0) { //v4.0
  var i,p,q,id,nm,nm1,val,rule,def,num,min,fld,max;
  var errors = '';
  var args=MM_validateFormY.arguments;
//  alert("MM_ValidateFormY:  argcount ="+args.length); //DEBUG
  for (i=0; i<(args.length-2); i+=3) {
    id   = args[i];
//    fld  = MM_findObj(args[i]);
    fld  = Obj(args[i]);   // Works much better!!
    def  = args[i+1];
    rule = args[i+2];
//    alert("id=("+id+")  rule=("+rule+")  fld=("+fld+")");
    if (fld) {
      nm  = fld.name+"";
      // Why doesn't the above pick up the name???  It used to work!
      //if(!nm || nm==null || nm==undefined || nm=='' || !nm.match(/[a-z]/i))
	  nm = id.replace(/_[0-9]*$/,"");
//      alert("A. MM_validateFormY: id=("+id+") name=("+nm+")  rule=("+rule+")"); //DEBUG
      nm1 = '\n'+nm.replace(/^[0-9 ]*/,"");
      val = fld.value+"";
      if (val!="") {
	if (rule.indexOf('isEmail')>-1) {
	  p = val.indexOf('@');
	  if (p<1 || p==(val.length-1))
	    errors += nm1+' must contain an e-mail address.\n';
	} else
	if (rule.indexOf('Num')>-1) {
	  if (isNaN(val)) {
	    errors += nm1+' must contain a number.\n';
	  } else
	  if (rule.indexOf('inRange') != -1) {
	    p=rule.indexOf(':');
	    min=rule.substring(8,p); max=rule.substring(p+1);
	    if (val<min || max<val)
	      errors += nm1+' must contain a number between '+min+' and '+max+'.\n';
	  }
	}
      } else
	if (rule.charAt(0) == 'R')
	  errors += nm1+' is required.\n';
    }
  }
  if (errors) {
    alert('The following error(s) occurred:\n'+errors);
    return false;
  }
  else {
    for (i=0; i<(args.length-2); i+=3) {
      fld  = MM_findObj(args[i]);
      def  = args[i+1];
      if(fld) {
	if(fld.value+'' == '' && def != null)
	    fld.value = def;
      }
    }
    return true;
  }
}

