
//AddThis variables need to be set globally
var addthis_pub="jbartonastm";
var addthis_brand = "ASTM";
var addthis_disable_flash = true;

//Search Functions
function FixSearch() {
  var Standards="AaBbCcDdEeFfGgPSpsWKwk";
  var Numbers="0123456789";
  var SearchQuery=document.gs.q.value;
  var SpacesSearch=new Array();
  SpacesSearch=SearchQuery.split(" ");
  var SearchQuery2="";
  for(i=0;i<SpacesSearch.length;i++){
    if ((Standards.indexOf(SpacesSearch[i]) > -1) && (Numbers.indexOf(SpacesSearch[i+1].substring(0,1)) > -1)) {
      SearchQuery2 += SpacesSearch[i];
    } 
    else {
      SearchQuery2 += SpacesSearch[i] + " ";
    }
  }
  var DashesSearch=new Array();
  DashesSearch=SearchQuery2.split("-");
  var SearchQuery3="";
  for(j=0;j<DashesSearch.length;j++){
    if ((Standards.indexOf(DashesSearch[j].substring(DashesSearch[j].length-1)) > -1) && (Numbers.indexOf(DashesSearch[j+1].substring(0,1)) > -1) && (j==0||(DashesSearch[j].substring(DashesSearch[j].length-2,DashesSearch[j].length-1) == " "))) {
      SearchQuery3 += DashesSearch[j];
    }
    else {
      SearchQuery3 += DashesSearch[j] + "-";
    }
  }
  SearchQuery=SearchQuery3.substring(0,SearchQuery3.length-2);
  document.gs.q.value=SearchQuery;
}

function SearchFocus(){
        document.gs.q.focus();
}


//Draw the left navigation bar
//Takes one argument, which can be used to customize navigation for different pages
function DrawNavBar(special) {

	document.write("<a href=\"/index.shtml\"><img border=\"0\" src=\"/IMAGES03/astm_logo_home.gif\"></a>");
	
	document.write("<ul id=\"leftnav\">" +
		"<li><a href=\"/Standard/index.shtml\" class=\"dkblue\"><span style=\"font-size:13px; color:#dc1015;\">Standards</span></a></li>");
	if(special == 'standards') {
		document.write("<li class=\"submenu\"><a href=\"/Standard/index.shtml\" class=\"white\">Search Standards</a></li>" +
		"<li class=\"submenu\"><a href=\"/BOOKSTORE/BOS/index.html\" class=\"white\">Annual Book of Standards</a></li>" +
		"<li class=\"submenu\"><a href=\"/DEMO/index.shtml\" class=\"white\">Online Subscriptions</a></li>" +
		"<li class=\"submenu\"><a href=\"/DEMO/collections.htm\" class=\"white\">Collections on DVD</a></li>" +
		"<li class=\"submenu\"><a href=\"/BOOKSTORE/COMPS/compsbycategory.htm\" class=\"white\">Compilations</a></li>" +
		"<li class=\"submenu\"><a href=\"/Standards/category_index.html\" class=\"white\">By Category</a></li>" +
		"<li class=\"submenu\"><a href=\"/STORE/alert.html\" class=\"white\">Track Standards</a></li>" +
		"<li class=\"submenu\"><a href=\"/COPYRIGHT/\" class=\"white\">Copyright/Permissions</a></li>" +
		"<li class=\"submenu\"><a href=\"http://www.astmproducts.com/custom_collection.html\" class=\"white\">Corporate Portals</a></li>" +
		"<li class=\"submenu\"><a href=\"/IMAGES03/corr_list.doc\" class=\"white\">Corrections</a></li>");
	}
	document.write("<li><a href=\"/DIGITAL_LIBRARY/index.shtml\" class=\"dkblue\">Standards and Engineering Digital Library</a></li>" +
		"<li><a href=\"/Standard/books_journals.shtml\" class=\"dkblue\">Books and Journals</a></li>" +
		"<li><a href=\"/COMMIT/newcommit.html\" class=\"ltblue\">Technical Committees</a></li>" +
		"<li><a href=\"/MEMBERSHIP/index.html\" class=\"ltblue\">Membership</a></li>" + 
		"<li><a href=\"/MEETINGS/index.html\" class=\"ltblue\">Meetings</a></li>");
	if(special == 'meeting') {
		document.write("<li class=\"submenu\"><a href=\"/MEETINGS/directions.htm\" class=\"white\">Directions to ASTM</a></li>" +
		"<li class=\"submenu\"><a href=\"/MEETINGS/hotels.htm\" class=\"white\">Hotels near ASTM</a></li>");	
	}
	document.write("<li><a href=\"/SYMPOSIA/index.html\" class=\"ltblue\">Symposia & Workshops</a></li>" +
		"<li><a href=\"/TRAIN/index.html\" class=\"ltblue\">Training Courses</a></li>");
	
	if(special == 'train') {
		document.write("<li class=\"submenu\"><a href=\"/TRAIN/courses.html\" class=\"white\">Course Listing</a></li>" +
		"<li class=\"submenu\"><a href=\"/TRAIN/onsite.html\" class=\"white\">On Site Training</a></li>" +
		"<li class=\"submenu\"><a href=\"/TRAIN/international.html\" class=\"white\">International Training</a></li>" +
		"<li class=\"submenu\"><a href=\"/TRAIN/pecontinuing.html\" class=\"white\">PE Continuing Education</a></li>");
	}
	
		document.write("<li><a href=\"/STATQA/index.html\" class=\"ltblue\">Proficiency Testing</a></li>" +
		"<li><a href=\"/STATQA/index_cert.html\" class=\"ltblue\">Certification Programs</a></li>" +
		"<li><a href=\"/EQUIPMENT/index.html\" class=\"orange\">Equipment Directory</a></li>" +
		"<li><a href=\"/LABS/index.html\" class=\"orange\">Lab Directory</a></li>" +
		"<li><a href=\"/CONSULTANTS/index.html\" class=\"orange\">Consultants Directory</a></li>" +
		"<li><a href=\"/ABOUT/aboutASTM.html\" class=\"yellow\">About ASTM International</a></li>");
	
	if(special == 'about') {
		document.write("<li class=\"submenu\"><a href=\"/ABOUT/index.html\" class=\"white\">Overview</a></li>" +
		"<li class=\"submenu\"><a href=\"/NEWS/Mission2.html\" class=\"white\">Mission Statement</a></li>" +
		"<li class=\"submenu\"><a href=\"/FAQ/\" class=\"white\">FAQ's</a></li>" +
		"<li class=\"submenu\"><a href=\"/ABOUT/images/annrep08_web.pdf\" class=\"white\">Annual Report</a></li>" +
		"<li class=\"submenu\"><a href=\"/PRESIDENT/lead_index.html\" class=\"white\">President's Column</a></li>" +
		"<li class=\"submenu\"><a href=\"/HISTORY/index.html\" class=\"white\">History</a></li>" +
		"<li class=\"submenu\"><a href=\"/HISTORY/milestones.html\" class=\"white\">Milestones</a></li>");
	}
	
	
	document.write("<li><a href=\"/MAGS_NEWSLETTERS/index.html\" class=\"yellow\">Magazines & Newsletters</a></li>" +
		"<li><a rel=\"nofollow\" href=\"http://astmnewsroom.org/newsrelease.aspx\" class=\"yellow\">News Releases</a></li>" +
		"<li><a href=\"/studentmember/index.html\" class=\"yellow\">Students & Professors</a></li>" +
		"<li><a href=\"/GLOBAL/index.html\" class=\"yellow\">Global Cooperation</a></li>" +
		"</ul>");

	document.write("<div id=\"prod_info\">" +
		"<div id=\"prod_info_hdr\">Product Information</div>" +
		"<a class=\"bluelinkline_smaller\" href=\"/marketing_mail/index.html\">Get Product Updates</a>" +
		"<a class=\"bluelinkline_smaller\" href=\"/CATALOG_REQUEST/index.html\">Request A Free Catalog</a>" +
		"<a class=\"bluelinkline_smaller\" href=\"/catalog.html\">View Catalog</a>" +
		"</div>");

	if(special == 'publish') {
		document.write("<div id=\"publish\"><b class=\"boldblack\"><a href=\"/PUBLISH/index.html\">Publish With ASTM</a></b></div>");
	}

	if(special == 'digiLib') {
		document.write("<div id=\"dlPublish\">" +
			"<div id=\"dlPublish_hdr\">Publish With ASTM</div>" +
			"<a class=\"bluelinkline_smaller\" href=\"/author/index.html\">Book Guide</a>" +
			"<a class=\"bluelinkline_smaller\" href=\"/DIGITAL_LIBRARY/JOURNALS/jrnls.htm\">Journals</a>" +
			"</div>");
	}
	if(special == 'snews') {
		document.write("<img src=\"/IMAGES03/SN_3lang.gif\" height=\"110\" width=\"140\" border=0 USEMAP=#TRILANG><MAP NAME=TRILANG><AREA SHAPE=rect HREF=/SNEWS/index.html COORDS=\"9,39 123,57\"><AREA SHAPE=rect HREF=/SNEWS/SPANISH/index.html COORDS=\"3,59 140,91\"><AREA SHAPE=rect HREF=/SNEWS/CHINESE/index.html COORDS=\"0,92 147,116\"></MAP>");

		//document.write ("<form name=\"gs\" method=\"GET\" action=\"http://search2.micronexx.com/search\" OnSubmit=\"return FixSearch();GetStoreName();\">" +
		document.write ("<form name=\"gs\" method=\"GET\" action=\"http://www.astm.org/SITESEARCH/search2.cgi\" OnSubmit=\"return FixSearch();GetStoreName();\">" +
		"<input type=\"hidden\" name=\"ie\" value=\"\">" +
		"<input type=\"hidden\" name=\"site\" value=\"SNEWS\">" +
		"<input type=\"hidden\" name=\"output\" value=\"xml_no_dtd\">" +
		"<input type=\"hidden\" name=\"lr\" value=\"\">" +
		"<input type=\"hidden\" name=\"proxystylesheet\" value=\"SNEWS\">" +
		"<input type=\"hidden\" name=\"oe\" value=\"\">" +
		"<input type=\"hidden\" name=\"cartname\" value=\"mystore\">" +
		"<input type=\"hidden\" name=\"client\" value=\"STANDARDS\">" +
		"<table width=\"140\">" +
		"<tr><td><span style=\"font-size: 0.8em\">Standardization News Search</span></td></tr>" +
		"<tr>" +
		"<td width=\"140\"><table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">" +
		"<td width=\"140\"> <input type=\"test\" name=\"q\" maxlength=\"100\" size=\"12\" > " +
		"</td>" +
		"<td> <div align=\"right\"><input type=\"image\" value=\"Submit\" src=\"/IMAGES03/go.gif\" border=\"0\" width=\"26\" height=\"16\" alt=\"GO\" title=\"GO\"></div></td></tr>" +
		"</form>" +
		"</table><br />" +
		"</table>");

	}
	document.write("<a href=\"/RSS/index.html\"><img src=\"/IMAGES03/rss.jpg\" border=\"0\"></a>" +
		"<br /><img src=\"/IMAGES03/verisign.jpg\">");
}


//Draw header
//Also takes one argument for customization
function DrawHeader(special) {

	document.write("<table cellpadding=0 cellspacing=0 border=0 width=582 id=\"headNav\"><tr>");
	

	//if(special == 'logout' || GetCookie('MyApache2::AuthCookieHandler_MyASTM') != null document.write("<td id=\"login\" align=\"center\"><a id=\"login_link\" href=\"http://myastm.astm.org/CUSTOMERS/logout.cgi\">Logout</A></td>");

	if(special == 'logout') document.write("<td id=\"login\" align=\"center\"><a id=\"login_link\" href=\"http://myastm.astm.org/CUSTOMERS/logout.cgi\">Logout</A></td>");
	else document.write("<td id=\"login\" align=\"center\"><a id=\"login_link\" href=\"http://myastm.astm.org/CUSTOMERS/checkpassword_landing_page.cgi\">Login</a></td>");


	document.write("<td class=\"headerNav\" align=\"right\"><a class=\"hvLink\" href=\"/\">Home</a>" +
		"<a class=\"hvLink\" href=\"/SITEMAP/index.html\">Site Map</a>" +
		"<a class=\"hvLink\" href=\"/SUPPORT/index.html\">Online Support</a>" +
		"<a class=\"hvLink\" href=\"/CONTACT/index.html\">Contact</a>" +
		"<a class=\"hvLink\" href=\"/prpolicy.html\">Web/IP Policies</a>" +
		"<a class=\"hvLink\" href=\"/COPYRIGHT/\">Copyright/Permissions</a>" +
		"</tr></table>");

	document.write("<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"582\"><tr><td id=\"search\">" +
		"<table border=0 cellspacing=5><tr>" +
		//"<td><form name=\"gs\" method=\"GET\" action=\"http://search.micronexx.com/search\" OnSubmit=\"return FixSearch();\">" +
		"<td><form name=\"gs\" method=\"GET\" action=\"http://www.astm.org/SITESEARCH/search.cgi\" OnSubmit=\"return FixSearch();\">" +
		"<input type=\"hidden\" name=\"ie\" value=\"UTF-8\">" +
		"<input type=\"hidden\" name=\"site\" value=\"STANDARDS\">" +
		"<input type=\"hidden\" name=\"output\" value=\"xml_no_dtd\">" +
		"<input type=\"hidden\" name=\"lr\" value=\"\">" +
		"<input type=\"hidden\" name=\"proxystylesheet\" value=\"STANDARDS\">" +
		"<input type=\"hidden\" name=\"oe\" value=\"UTF-8\">" +
		"<input type=\"hidden\" name=\"cartname\" value=\"mystore\">" +
		"<input type=\"hidden\" name=\"client\" value=\"STANDARDS\">" +
		"<input type=\"test\" name=\"q\" maxlength=\"100\" size=\"12\" ></td>" +
		"<td><input type=\"submit\" value=\"Search\">" +
		"</form></td>");

	document.write("<td align=\"right\" id=\"addThisCell\" width=\"100%\"><a href=\"http://www.addthis.com/bookmark.php?v=250\" onmouseover=\"return addthis_open(this, '', '[URL]', '[TITLE]')\" onmouseout=\"addthis_close()\" onclick=\"return addthis_sendto()\"><img src=\"http://s7.addthis.com/static/btn/sm-share-en.gif\" width=\"83\" height=\"16\" alt=\"Bookmark and Share\" style=\"border:0\"/></a></td>");


	document.write("</tr></table></td><td id=\"cart\">" +
		"<a href=\"/STORE/showcart.html\"><img src=\"/IMAGES03/view_cart.gif\" border=\"0\" alt=\"View Shopping Cart\" title=\"View Shopping Cart\"></a>" +
		"</td></tr></table>");
}





//Draw digital library head/tabs
function DrawDigiLib_Old(special) {
	document.write("<div><img src=\"/IMAGES03/dl_banner.jpg\" /></div>");
	document.write("<div id=\"dl_tabs\" class=\"dl_hl_" + special +"\">");

	document.write("<div class=\"dl_wrap\" id=\"dl_wrap_home\"><a id=\"dl_tab_home\" href=\"/DIGITAL_LIBRARY/index.shtml\"></a></div>");
	document.write("<div class=\"dl_wrap\" id=\"dl_wrap_journals\"><a id=\"dl_tab_journals\" href=\"/DIGITAL_LIBRARY/JOURNALS/index.htm\"></a></div>");
	document.write("<div class=\"dl_wrap\" id=\"dl_wrap_stps\"><a id=\"dl_tab_stps\" href=\"/DIGITAL_LIBRARY/STP/stp_toclist.htm\"></a></div>");
	document.write("<div class=\"dl_wrap\" id=\"dl_wrap_mnls\"><a id=\"dl_tab_mnls\" href=\"/DIGITAL_LIBRARY/MNL/mnl_toclist.htm\"></a></div>");
	document.write("<div class=\"dl_wrap\" id=\"dl_wrap_topics\"><a id=\"dl_tab_topics\" href=\"/DIGITAL_LIBRARY/TOPICS/topics_toclist.htm\"></a></div>");
	document.write("<div class=\"dl_wrap\" id=\"dl_wrap_subs\"><a id=\"dl_tab_subs\" href=\"/DIGITAL_LIBRARY/SUBSCRIPTIONS/index.html\"></a></div>");


	document.write("<div id=\"end_shadow\"></div><div style=\"clear:both;\"></div></div>");

}


function DrawDigiLib(special) {
	document.write("<div><img src=\"/IMAGES03/dl_tech_banner.jpg\" /></div>");
	document.write("<div id=\"dl_tabs\" class=\"dl_hl_" + special +"\">");

	document.write("<div class=\"dl_wrap\" id=\"dl_wrap_home\"><a id=\"dl_tab_home\" href=\"/DIGITAL_LIBRARY/index.shtml\"></a></div>");
	document.write("<div class=\"dl_wrap\" id=\"dl_wrap_mystan\"><a id=\"dl_tab_mystan\" href=\"/Standard/index.shtml?complete\"></a></div>");
	document.write("<div class=\"dl_wrap\" id=\"dl_wrap_journals\"><a id=\"dl_tab_journals\" href=\"/DIGITAL_LIBRARY/JOURNALS/index.htm\"></a></div>");
	document.write("<div class=\"dl_wrap\" id=\"dl_wrap_stps\"><a id=\"dl_tab_stps\" href=\"/DIGITAL_LIBRARY/STP/stp_toclist.htm\"></a></div>");
	document.write("<div class=\"dl_wrap\" id=\"dl_wrap_mnls\"><a id=\"dl_tab_mnls\" href=\"/DIGITAL_LIBRARY/MNL/mnl_toclist.htm\"></a></div>");
	document.write("<div class=\"dl_wrap\" id=\"dl_wrap_subs\"><a id=\"dl_tab_subs\" href=\"/DIGITAL_LIBRARY/SUBSCRIPTIONS/index.html\"></a></div>");


	document.write("<div id=\"end_shadow\"></div><div style=\"clear:both;\"></div></div>");

}

