var at = "@";
var h = "";
var year="2010";
function p(line) { document.write(line+"\n"); }
function p0(line) { document.write(line); }
function swapyear() {
location.href = location.href.replace("/2010/","/2008/").replace("program.html","confex.pl?MEETING.HTM") }

////////////////////////////////////{
function boilerplate_top(h) {
if(!h) h="";
//p0('<name="_top"></name><table><tr><td height=4></td></tr></table x=halfspace>');
p0('<name="_top"></name><a href="JavaScript:void(0)" onclick="swapyear()"><img src="/'+year+'/graf/nil.gif" height=10 width=10 alt="" title="" border=0>');
p('<table cellpadding=0 cellspacing=0 border=0 width="100%"><tr><td>\n');
p('<table width="100%" border=0 cellspacing=0 cellpadding=0 bgcolor="#FFF000" Xbackground="graf/greypin.jpg">');
p('  <tr>');
p('    <td width="208" valign=top>');
p('    <a href="/'+year+'/index.html"><img src="graf/marm2010_logo3.gif"');
p('	width="220" height="175" hspace=15 vspace=15 border=0');
p('	title="MARM 2010 - Chemistry in the First State"');
p('	alt="MARM 2010 - Chemistry in the First State"');
p('    ><img src="graf/nil.gif" width=1 height=1 border=0></a></td>');
p('    <td align="center" valign="top">');
p('    <div align="center">');

p('    <img src="graf/nil.gif" width=1 height=1 border=0><img src="graf/MARM2010-banner3.jpg" alt="MARM 2010" width=538 height=139 vspace=12 alt="ACS Mid-Atlantic Regional Meeting, Wilmington, DE" title="ACS Mid-Atlantic Regional Meeting, Wilmington, DE" ><img src="graf/nil.gif" width=1 height=1 border=0>');

p('    <!--<table><tr><td height=3></td></tr></table x=halfspace>-->');

toc_bgn("","none");

p('<tr>');
toc_item(h,"Home","index.html","","",1,"width=120");
p('<td width=10>&nbsp;</td>');
toc_item(h,"Committee","committee.html","","",1,"width=120");
p('<td width=10>&nbsp;</td>');
toc_item(h,"Delaware Section","http://delacs.sites.acs.org","","",1,"width=120","target=_blank");
p('</tr>');

toc_end();

p('    <table cellpadding=0 cellspacing=0><tr><td height=3></td></tr></table x=halfspace>');

/*{
p('    <a href="/'+year+'/index.html" onMouseOver="MM_swapImage(\'Image12\',\'\',\'graf/b2_home.gif\',1)" onMouseOut="MM_swapImgRestore()"><img src="graf/b1_home.gif" name="Image12" width="150" height="20" border="0" id="Image12"></a>&nbsp;	<!-- ');
p('    <a href="/'+year+'/welcome.html" onMouseOver="MM_swapImage(\'Image13\',\'\',\'graf/b2_welcome.gif\',1)" onMouseOut="MM_swapImgRestore()"><img src="graf/b1_welcome.gif" name="Image13" width="150" height="20" border="0" id="Image13"></a>&nbsp;&nbsp;	 -->');
p('    <a href="committee.html" onMouseOver="MM_swapImage(\'Image14\',\'\',\'graf/b2_committee.gif\',1)" onMouseOut="MM_swapImgRestore()"><img src="/'+year+'/graf/b1_committee.gif" name="Image14" width="150" height="20" border="0" id="Image14"></a>&nbsp; 	');
p('    <a href="http://membership.acs.org/p/philadelphia/" onMouseOver="MM_swapImage(\'Image15\',\'\',\'graf/b2_philyacs.gif\',1)" onMouseOut="MM_swapImgRestore()"><img src="graf/b1_philyacs.gif" name="Image15" width="150" height="20" border="0" id="Image15"></a>&nbsp;&nbsp;');
}*/

p('    </div></td>');

p('    <td width="158" align="center" valign="top">');
p('      <table cellpadding=0 border=0>');
var s='	<tr><td valign=top style="padding:20px 20px 0px 4px"><a href="http://www.acs.org" target=_blank><img src="graf/acs-logo.jpg" width=200 height=78 Xhspace=20 title="American Chemical Society" border=0 vspace=0><img src="graf/nil.gif" width=1 height=1 border=0></a></td></tr>';
p(s);
//p('	<tr><td height=6></td></tr>'); p(s);
//p('	<tr><td height=6></td></tr>'); p(s);
p('      </table>');
p('    </td>');
p('  </tr>');
p('</table>');
p('<!--<table><tr><td height=5></td></tr></table x=halfspace>-->');

}
////////////////////////////////////}


function boilerplate_bottom(h) {
if(!h) h="";
p('<tr> ');
p('  <td bgcolor="#F7F7F7" background="graf/greypin.gif" valign=bottom colspan=3>');
p('    <table cellpadding=0 cellspacing=0 border=0 width="100%" ><tr>');
p('      <td width="40%" nowrap>');
p('        <div><span class=fineprint><script>TimeStamp("<nobr>Last modified:</nobr>")</script></span></div>');
p('      </td>');
p('      <td align="center" width="20%" nowrap>');
p('         <span class="fineprint">[ <i><a href="private" class=gray style="font-weight:normal" title="password required">login</a></i> ]</span>');
p('      </td>');
p('      <td align=right width="40%" nowrap>');
p('         <p class=p0><a href="mailto:webmaster22'+at+'marmacs.org?subject=Marm '+year+'">WebMaster E-Mail</a>&nbsp;&nbsp;</p>');
p('      </td></tr>');
p('    </table>');
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,bkg) {
if(!width) var width ="";
var background = "";
if(bkg == "") background = "#216CAF";
else if(bkg != "none") background = bkg;
if(background != "") background= ";background-color:"+background;
p('<table '+width+' \
style="border-width:0px;border-spacing:0px;border-style:none;\
border-color:#09347A;border-collapse:collapse'+background+'"');
}
function toc_end() {
p('</table>');
}
var count=0;

function toc_item(h,name,link,fontclass,fontstyle,no_tr,td_style,href_opt) {
if(!h) var h = "";
var td_opt = "";
if(!name) name="&nbsp;";
if(name == "&nbsp;") name="<span style='font-size:.3em'>&nbsp;</span>";
if(!link.match(/http|^\//)) h = "/"+year+"/";
if(!td_style) td_style = "";
if(!href_opt) href_opt = "";
if(td_style.match(/=/)) {
    td_opt = td_style;
    td_style = "";
}
if(td_style != "" && !td_style.match(/;$/)) td_style += ";";
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";
if(!no_tr) p('<tr>');
p('<td align=center class=btn Xvalign=top '+td_opt+' \
style="'+td_style+'border-width:medium;padding:3px;border-style:groove;border-color:#09347A;\
/*background-color:#216CAF;*/text-align:center;'+td_style+'"><'+a+' href="'+h+link+'" class='+fontclass+fontstyle+' '+href_opt+'>'+name+'</'+a+'></td>');
if(!no_tr) p('</tr>');
}

function boilerplate_left(h) {
  if(!h) var h = "";
  var gray="gray";
  var gold="gold";
  var vpadding = "padding:12px 3px 12px 3px;";
//  gold=gray;
//  gray="";
  toc_bgn("width=150");
//  toc_bgn("");
//  p("<tr bgcolor='#CfCfCf'><td><img src='graf/nil.gif' width=144 height=1 border=0></td></tr>");
//  toc_item(h,"<img src='graf/nil.gif' width=144 height=1 border=0><br>MARM 2010","index.html","gold","font-family:Comic Sans MS;font-style:normal;");
  toc_item(h,"MARM 2010","index.html","gold","font-family:Comic Sans MS;font-style:normal;");
  toc_item(h,"General Information","general.html");
  toc_item(h,"Technical Program","program.html"); //("confex.pl?MEETING.HTM");
  toc_item(h,"Program Book","programbook.html");
  toc_item(h,"Workshops &amp; Events","events.html");
  toc_item(h,"Awards","awards.html");
  toc_item(h,"Students &amp; Educators","academia.html");
  toc_item(h,"High School Events","precollege.html");
  toc_item(h,"ACS Careers","careers.html");
  toc_item(h,"Sponsors at MARM","spnsrs.html");
  toc_item(h,"Exhibitors at MARM","exhibitors.html");
  toc_item(h,"Advertising in the <nobr>Program Book</nobr>","advrtse.html");
  toc_item(h,"Call for Papers","submit.html"); /*(,gold,"","",vpadding);*/
  toc_item(h,"HOTEL ROOM","housing.html",gold,"","",vpadding);
  toc_item(h,"REGISTRATION","register.html",gold,"","",vpadding);
  toc_item(h,"Meals &amp; Refreshments","restaurants.html");
  toc_item(h,"Directions","http://dupont3-px.rtrk.com/map-directions/index.cfm","","","","","target=_blank");
//  toc_item(h,"Public Transport","publictransport.html",gray);	/*000000*/
//  toc_item(h,"FREE SHUTTLE BUS","shuttlebus.html");
  toc_item(h,"Local Attractions","attractions.html");
  toc_item(h,"Flyers","flyers.html");
  toc_item(h,"Instructions for Presenters and <nobr>Session Chairs</nobr>","presenters.html");

//  toc_item(h,"Supporting Divs &amp; Socs","societies.html");
//  toc_item(h,"&nbsp;","");
  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;
  }
}

