﻿var ns6=document.getElementById&&!document.all?1:0

var head="display:''"
var folder=''

var disappeardelay=250  //menu disappear speed onMouseout (in miliseconds)
var enableanchorlink=0 //Enable or disable the anchor link when clicked on? (1=e, 0=d)
var hidemenu_onclick=1 //hide menu when user clicks within menu? (1=yes, 0=no)

/////No further editting needed

var ie5=document.all
var ns6=document.getElementById&&!document.all

function preloadMenu()
{
	if(document.images())
	{
		var temp = new Image();
		temp.src = "scripts/submenus.js";
	}
}
	
function getposOffset(what, offsettype)
{
	var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
	var parentEl=what.offsetParent;
	while (parentEl!=null)
	{
		totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
		parentEl=parentEl.offsetParent;
	}
return totaloffset;
}

function showhide(obj, e, visible, hidden){
if (ie5||ns6)
	dropmenuobj.style.left=dropmenuobj.style.top=-500
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
 
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie5 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var topedge=ie5 && !window.opera? iecompattest().scrollTop : window.pageYOffset
var windowedge=ie5 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move up?
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?
edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge
}
}
return edgeoffset
}

function dropdownmenu(obj, e, dropmenuID){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()

if (typeof dropmenuobj!="undefined") //hide previous menu
dropmenuobj.style.visibility="hidden"
clearhidemenu()

if (ie5||ns6){
obj.onmouseout=delayhidemenu
dropmenuobj=document.getElementById(dropmenuID)
if (hidemenu_onclick) dropmenuobj.onclick=function(){dropmenuobj.style.visibility='hidden'}
dropmenuobj.onmouseover=clearhidemenu
dropmenuobj.onmouseout=ie5? function(){ dynamichide(event)} : function(event){ dynamichide(event)}
showhide(dropmenuobj.style, e, "visible", "hidden")


dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x+obj.offsetWidth-3+"px"
dropmenuobj.style.top=dropmenuobj.y+obj.offsetHeight-23+"px"
}
return clickreturnvalue()
}

function clickreturnvalue(){
if ((ie5||ns6) && !enableanchorlink) return false
else return true
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function dynamichide(e)
{
	if (ie5&&!dropmenuobj.contains(e.toElement))
		delayhidemenu()
	else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
		delayhidemenu()
}

function delayhidemenu()
{
	delayhide=setTimeout("dropmenuobj.style.visibility='hidden'",disappeardelay)
}

function clearhidemenu()
{
	if (typeof delayhide!="undefined")
	clearTimeout(delayhide)
}
function getLeftSpacing() {
	var myWidth = 0, myHeight = 0;
	if( typeof( window.innerWidth ) == 'number' ) {
		myWidth = window.innerWidth; myHeight = window.innerHeight;
	} else if( document.documentElement && ( document.documentElement.clientWidth ||document.documentElement.clientHeight ) ) {
		myWidth = document.documentElement.clientWidth; myHeight = document.documentElement.clientHeight;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		myWidth = document.body.clientWidth; myHeight = document.body.clientHeight;
	}
	spacing = myWidth-798;
	spacing = spacing/2;
	return spacing;
}
onerror = handleErrors
   
   var msg = null
   function handleErrors(errorMessage, url, line)
   {

   msg += "Click OK to continue.\n\n";
   return true
   }
   
   
<!--
// Section Expansion
<!--

function expandit(curobj){
folder=ns6?curobj.nextSibling.nextSibling.style:document.all[curobj.sourceIndex+1].style
if (folder.display=="none")
folder.display=""
else
folder.display="none"
}

function bannerA() { //For catalog & download-related ads
	number = 0;
	// bannerArray
	bannerA[number++] = "<a href='http://www.thecompliancecenter.com/web_forms/catalogs.php?id=ad'><img src='http://www.thecompliancecenter.com/img/ads/ad_newtrainingcat.gif' border='0' alt='New Training Catalog'></a>"
	bannerA[number++] = "<a href='http://www.thecompliancecenter.com/web_forms/catalogs.php?id=ad'><img src='http://www.thecompliancecenter.com/img/ads/ad_fulllinecat.gif' border='0' alt='Full-Line Catalog now available!'></a>"
	bannerA[number++] = "<a href='http://www.thecompliancecenter.com/web_forms/catalogs.php?id=ad'><img src='http://www.thecompliancecenter.com/img/ads/ad_free_downloads.gif' border='0' alt='Free PDF downloads available!'></a>"
	bannerA[number++] = "<a href='http://www.thecompliancecenter.com/web_forms/ghs_booklet.php?id=ad'><img src='http://www.thecompliancecenter.com/img/ads/ad_ghsbooklet.gif' border='0' alt='Free GHS Awareness booklet'></a>"
	bannerA[number++] = "<a href='http://www.thecompliancecenter.com/forms/formtool.htm?id=ad'><img src='http://www.thecompliancecenter.com/img/ads/ad_formtool.gif' border='0' alt='Free FormTool Info'></a>"
	bannerA[number++] = "<a href='http://www.thecompliancecenter.com/publications/tdgcl.htm?id=ad'><img src='http://www.thecompliancecenter.com/img/ads/ad_amendment6.gif' border='0' alt='Reserve your copy today!'></a>"
	bannerA[number++] = "<a href='http://www.thecompliancecenter.com/web_forms/whmis_nutshell.php?id=ad'><img src='http://www.thecompliancecenter.com/img/ads/ad_whmisnutshell.gif' border='0' alt='Free WHMIS in a Nutshell booklet'></a>"
	
	increment = Math.floor(Math.random() * number);

	document.write(bannerA[increment]);
}

function bannerB() { //For product-related ads
	number = 0;
	// bannerArray
	bannerB[number++] = "<a href='http://www.thecompliancecenter.com/packaging/lithium_battery_shippers.htm?id=ad'><img src='http://www.thecompliancecenter.com/img/ads/ad_lith_bat_shippers.gif' border='0' alt='Lithium Battery Shippers'></a>"
	bannerB[number++] = "<a href='http://www.thecompliancecenter.com/training/courses/e-learning/webinars.htm?id=ad'><img src='http://www.thecompliancecenter.com/img/ads/ad_webinars.gif' border='0' alt='New e-Learning Webinars'></a>"
	bannerB[number++] = "<a href='http://www.thecompliancecenter.com/on-demand/?id=ad'><img src='http://www.thecompliancecenter.com/img/ads/ad_ondemand_1.gif' border='0' alt='On Demand Printing'></a>"
	bannerB[number++] = "<a href='http://www.thecompliancecenter.com/on-demand/?id=ad'><img src='http://www.thecompliancecenter.com/img/ads/ad_ondemand_2.gif' border='0' alt='Print Your Own'></a>"
	
	increment = Math.floor(Math.random() * number);

	document.write(bannerB[increment]);
}

function transportationModes() {
	number = 0;
	// bannerArray
	banner[number++] = "<a href='training/courses/air.htm'><img src='images/mode_plane.jpg' border='0' alt='See shipping by bir training courses' style='position:relative;left:7px;top:-4px;' id='modesOfTransport' align='left'></a>"
	banner[number++] = "<a href='training/courses/hmt.htm'><img src='images/mode_truck.jpg' border='0' alt='See 49 CFR training courses'  style='position:relative;left:7px;top:-4px;' id='modesOfTransport' align='left'></a>"
	banner[number++] = "<a href='training/courses/imo.htm'><img src='images/mode_ship.jpg' border='0' alt='See shipping by sea training courses'  style='position:relative;left:7px;top:-4px;' id='modesOfTransport' align='left'></a>"
	banner[number++] = "<a href='training/courses/clr.htm'><img src='images/mode_train.jpg' border='0' alt='See TDG Regulations training courses' style='position:relative;left:7px;top:-4px;' id='modesOfTransport' align='left'></a>"
	
	increment = Math.floor(Math.random() * number);

	document.write(banner[increment]);
}

function crazyegg(){
document.write('<script type="text/javascript" src="http://cetrk.com/pages/scripts/0003/1149.js"> </script>')
	
}

function checkform ( form )
{

  if (form.fname.value == "") {
    alert( "Your first name is required." );
    form.fname.focus();
    return false ;
  }

  if (form.lname.value == "") {
    alert( "Your last name is required." );
    form.lname.focus();
    return false ;
  }

  if (form.address.value == "") {
    alert( "Your address is required." );
    form.address.focus();
    return false ;
  }
  
   if (form.city.value == "") {
    alert( "You must enter the city." );
    form.city.focus();
    return false ;
  }
  
  if (form.stateprov.value == "") {
    alert( "You must enter the State or Province." );
    form.stateprov.focus();
    return false ;
  }
  
  if (form.pcode.value == "") {
    alert( "You must enter the Zip or Postal Code." );
    form.pcode.focus();
    return false ;
  }
  
  if (form.email.value == "") {
    alert( "You must enter your email." );
    form.email.focus();
    return false ;
  }
  
  if(form.email.value.match("@") && form.email.value.match("."))
	{		
		
	}
  else{
	alert( "You must enter a valid email." );
    form.email.focus();
	return false;
  }
  
  if (form.phone.value == "") {
	alert( "You must enter your phone number." );
	form.phone.focus();
	return false ;
  }
  
  if(form.country.value == "None"){
	alert("You must select a country.");
	return false;
  }

 if(form.requestType.value == "catalog")
  {
	for(var i=0; i < form.catsel.length; i++)
	{
		if(form.catsel[i].checked){			
			return true;
		}
	}		
	alert("You must select at least one catalog.");
	return false;	
  }
  return true ;
}

function printPageLink() 
{
     if(window.print)
     {
          document.write("<input type=\"button\" value=\"Print this page\" onclick=\"if(window.print)window.print();\">")
     }
     else
     {
        //Sorry, this function is not supported on your browser.  
		document.write("<input type=\"button\" value=\"Print this page\" onclick=\"alert('To print this page, please select Print from your file menu.');\">")
     }
}
function get_cookie(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=")
  if (c_start!=-1)
    { 
    c_start=c_start + c_name.length+1 
    c_end=document.cookie.indexOf(";",c_start)
    if (c_end==-1) c_end=document.cookie.length
    return unescape(document.cookie.substring(c_start,c_end))
    } 
  }
return ""
}

function set_cookie(c_name,value,expiredays)
{
	var exdate=new Date()
	exdate.setDate(exdate.getDate()+expiredays)
	document.cookie=c_name+ "=" +escape(value)+
	((expiredays==null) ? "" : ";expires="+exdate.toGMTString()) +";path=/"
}

/*function cartForm(pCode, storeCode)
{
	document.write("<form action=\'http://commerce.iccshop.com/merchant.mvc?\' method=\'post\' name=\'FORM\' class=\'formSpace\'>")
	document.write("<input type='hidden' name='Action' value='ADPR' />")
    document.write("<input type='hidden' name='Screen' value='BASK' />")
    document.write("<input type='hidden' name='Store_Code' value=\'"+ storeCode + "\' />")
    document.write("<input type='hidden' name='Product_Code' value=\'"+pCode+"\' />")
    document.write("<input type='hidden' name='Quantity' value='1'>")
	if(storeCode == 'I')
	{
		document.write("<img src=\"http://www.thecompliancecenter.com/img/usflag.gif\" alt=\"ICCshop US\" width=\"54\" height=\"11\" border=\"0\" class=\"flagSpace\" onclick=\"set_cookie(\'storeType\',\'I\',1);submit();\" onmouseover=\"this.style.cursor=\'pointer\'\"/>")

	}
	if(storeCode == 'J')
	{
		document.write("<img src=\"http://www.thecompliancecenter.com/img/caflag.gif\" alt=\"ICCshop Canada\" width=\"54\" height=\"11\" border=\"0\" class=\"flagSpace\" onclick=\"set_cookie(\'storeType\',\'J\',1);submit();\" onmouseover=\"this.style.cursor=\'pointer\'\"/>")
	}
	if(storeCode == 'K')
	{
		document.write("<img src=\"http://www.thecompliancecenter.com/img/frflag.gif\" alt=\"ICCshop francais\" width=\"54\" height=\"11\" border=\"0\" class=\"flagSpace\" onclick=\"set_cookie(\'storeType\',\'K\',1);submit();\" onmouseover=\"this.style.cursor=\'pointer\'\"/>")
	}
	document.write("</form>")
}*/

function cartForm(pCode, storeCode, attributes)
{
	if(attributes == 'Y')
	{
		document.write("<a href=\"http://commerce.iccshop.com/merchant.mvc?Screen=PROD&Product_Code="+pCode+"&Category_Code=&Store_Code="+storeCode+"\">")
	}
	else
	{
		document.write("<form action=\'http://commerce.iccshop.com/merchant.mvc?\' method=\'post\' name=\'FORM\' class=\'formSpace\'>")
		document.write("<input type='hidden' name='Action' value='ADPR' />")
		document.write("<input type='hidden' name='Screen' value='BASK' />")
		document.write("<input type='hidden' name='Store_Code' value=\'"+ storeCode + "\' />")
		document.write("<input type='hidden' name='Product_Code' value=\'"+pCode+"\' />")
		document.write("<input type='hidden' name='Quantity' value='1'>")
	}
	if(storeCode == 'I')
	{
		document.write("<img src=\"http://www.thecompliancecenter.com/img/usflag.gif\" alt=\"ICCshop US\" width=\"54\" height=\"11\" class=\"flagSpace\" onclick=\"set_cookie(\'storeType\',\'I\',1);submit();\" onmouseover=\"this.style.cursor=\'pointer\'\"/>")

	}
	if(storeCode == 'J')
	{
		document.write("<img src=\"http://www.thecompliancecenter.com/img/caflag.gif\" alt=\"ICCshop Canada\" width=\"54\" height=\"11\" class=\"flagSpace\" onclick=\"set_cookie(\'storeType\',\'J\',1);submit();\" onmouseover=\"this.style.cursor=\'pointer\'\"/>")
	}
	if(storeCode == 'K')
	{
		document.write("<img src=\"http://www.thecompliancecenter.com/img/frflag.gif\" alt=\"ICCshop francais\" width=\"54\" height=\"11\"  class=\"flagSpace\" onclick=\"set_cookie(\'storeType\',\'K\',1);submit();\" onmouseover=\"this.style.cursor=\'pointer\'\"/>")
	}
	if(attributes == 'Y')
	{
		document.write("</a>")
	}
	else
	{
		document.write("</form>")
	}
}
function showCart()
{
	if(get_cookie('storeType') != "")
	{
		var custcart = 'http://commerce.iccshop.com/merchant.mvc?Screen=CTGY&amp;Store_Code=' + get_cookie('storeType')+'&amp;Category_Code=icc-custcart'
		document.write("<iframe src=\'" + custcart + "\' frameborder=\"0\" scrolling=\"no\" style=\"position:relative;top:5px;right:5px;width:138px;height:61px;\"></iframe>")
	}
}

function showCartOrNews()
{
	if(get_cookie('storeType') != "")
	{
		var custcart = 'http://commerce.iccshop.com/merchant.mvc?Screen=CTGY&amp;Store_Code=' + get_cookie('storeType')+'&amp;Category_Code=icc-custcart'
		document.write("<iframe src=\'" + custcart + "\' frameborder=\"0\" scrolling=\"no\" style=\"position:relative;top:5px;right:5px;width:138px;height:61px;\"></iframe>")
	}
	else
	{
		document.write("<table style=\"margin-top:5px;border:none\" cellspacing=\"0\" cellpadding=\"2\" width=\"325\"  align=\"right\" class=\"newsBox\" summary=\"dangerous goods industry news\"><tr><td align=\"left\" valign=\"top\" bgcolor=\"#F8F8E6\"><h3>Industry News</h3>")
    	document.write("<iframe src=\"news/indexnewsbox.asp\" frameborder=\"0\" scrolling=\"no\" style=\"width:95%;height:38px;margin:0px;position:relative;top:0px;background-color:#F8F8E6;\"></iframe>")
		document.write("<a href=\"http://feeds.feedburner.com/hazmat?format=html\" style=\"color: #00427A; font-size: 10px; font-weight: bold;\"><br />View RSS&nbsp;&raquo;</a></td></table>")
	}
}

function showNews()
{
	document.write("<table style=\"border:none;\" cellspacing=\"0\" cellpadding=\"2\" width=\"98%\"><tr><td align=\"left\" valign=\"top\" bgcolor=\"#F8F8E6\"><h2 style=\"margin-bottom: 0;padding-bottom:0;\"><a href=\"http://feeds.feedburner.com/hazmat?format=html\"><img src=\"../images/feed_icon_14x14.png\" style=\"margin-right: 2px;\" alt=\"ICC - Hazmat Industry News\" border=\"0\" /></a> <a href=\"http://feeds.feedburner.com/hazmat?format=html\" style=\"color: #287dc3;\">Industry News</a></h2>")
    document.write("<iframe src=\"http://www.thecompliancecenter.com/news/indexnewsbox.asp\" frameborder=\"0\" scrolling=\"yes\" style=\"width:220px;height:60px;margin:0 0 10px 0;padding:0;\"></iframe>")
	document.write("<a href=\"http://feeds.feedburner.com/hazmat?format=html\" style=\"color: #287dc3; font-size: 10px; font-weight: bold;\"><br />More News&nbsp;&raquo;</a></td></tr></table>")

}

function popup(linkpath)
{
	window.open(linkpath, 'winname', 'width=600,height=200,scrollbars=yes,menubar=no,location=no,status=yes,resizable=yes,toolbars=no')	
}

function packCatPage(pageNum)
{
	document.write("This product can be found on page " + pageNum + " of our ")	
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}