<!-- this is an HTML comment -->
// this is a JS comment
/* this is a JS/CSS comment */

<!-- used in "Contacts" link (did not work in IE if links are in "MainWindow" frame) -->

function LocalPrint()
{ javascript:self.print(); }

function Contacts()
{
<!-- loads 'Contacts.htm' in new window called 'ContactsWindow' -->
//   var ContactsPopup = window.open("Contacts.htm", "ContactsWindow", "height=320, width=420, resizable=yes, toolbar=1, menubar=yes, status=yes, location=0, directories=0, scrollbars=1");

<!-- loads 'Contacts.htm' in main window called 'MainWindow' -->
   var ContactsPopup = open("Contacts.htm", "MainWindow");
}

<!-- gives local computer time -->
function LocalDate()
{
//    document.write( new Date() );
    document.write( Date() );
    setTimeout('javascript:location.reload()',15000);
//    StatusDate();  <!-- runs another function -->
}

function StatusDate()
{
<!-- displays date and time on status display -->
   status = new Date();
   theTime = window.setTimeout("StatusDate()", 1000);
}

<!-- text for 'scroll() function' textbox -->
var ScrollText="                                                     Welcome to Webber EMI. " + " The Leader in emissions testing equipment since 1975 " +
"  *  SHEDs  *  Fuel Handling Equipment  *  Proportional Speed Fans  *  Sample Handling Equipment  *  Stainless Steel Fabrication  *  Custom Manufacturing";
function Scroll()
{
   document.TextForm.TextWindow.value = ScrollText;
   ScrollText = ScrollText.substring(1, ScrollText.length) + ScrollText.charAt(0);
   window.setTimeout("Scroll()",150);
}

<!-- drop-down menu -->
function GotoSite(input) {
//var dm=document.getElementById(input);alert(dm);
	window.open(input.options[input.selectedIndex].value,"MainWindow");
//	setTimeout("input.options[0].selected = true",1000);	//can't get this to work with passed parameter
	setTimeout("ProductMenu.ProductSelection.options[0].selected = true",1000);	//can't get passed parameter to work
//	setTimeout("GotoSiteReset('" + input + "')",1000);	//keep for syntax
}
function GotoSiteReset(input) {
//	setTimeout("input.options[0].selected = true",1000);	//can't get this to work with passed parameter
	setTimeout("ProductMenu.ProductSelection.options[0].selected = true",1000);	//can't get passed parameter to work
}

<!-- used for Christmas to bring up HappyHolidays.htm page -->
function Holidays()
{ var HolidayPopup = window.open("HappyHolidays.htm", "HolidayWindow", "resizable=yes, toolbar=1, menubar=yes, status=yes, location=0, directories=0, scrollbars=1");
}

function Footer()
{
document.write("<hr size='5' width='90%' align='center'>") +
document.write("<div align='center'><table width='450' border='1' cellspacing='0' cellpadding='0' bordercolorlight='#333300'>") +
document.write("<tr><td bgcolor='#6C8CC7' width='80'><div align='center'><a href='WebberEMI.htm' target='_top' style='display:block' alt='Webber EMI Home Page' title='Webber EMI manufactures specialized emission testing equipment for the automotive industry, including variable volume, variable temperature, micro, mini and vehicle SHEDs; ORVR and Running Loss SHEDs; fuel drain & conditioning carts; sample conditioning baths and chillers; fixed & proportional speed fans; stainless steel ducting & dilution tunnels, and; various other emission cell apparatus'>Home</a></div></td>") +
document.write("<td bgcolor='#6C8CC7' width='80'><div align='center'><a href='History.htm' target='MainWindow' style='display:block' alt='History' title='Background and History'>History</a></div></td>" +
"<td bgcolor='#6C8CC7' width='80'><div align='center'><a href='Products.htm' target='MainWindow' style='display:block' alt='Products' title='SHEDs, Fuel Carts, Proportional Speed Fans, Canister Conditioning Benches, Dilution Equipment, Portable Utility Blowers, Stainless Steel Components, Custom Manufacturing'>Products</a></div></td>" +
"<td bgcolor='#6C8CC7' width='80'><div align='center'><a href='Links.htm' target='MainWindow' style='display:block' alt='Links' title='Links to Other Emission Test Agencies and Companies'>Links</a></div></td>" +
"<td bgcolor='#6C8CC7' width='80'><div align='center'><a href='Contacts.htm' target='MainWindow' style='display:block' alt='Contacts' title='Location, Directions, Contacts, Phone Numbers and E-mail'>Contacts</a></div></td></tr>" +
"</table></div>");
}

function ShowLayerText( WhichLayer ) {
   document.top.document.HistoryText.visibility = "SHOW";
}
function HideLayerText( WhichLayer ) {
   document.top.document.WhichLayer.visibility = "HIDE";
}

//  hilight colors for table rows
var RowHilight = '#6C8CC7';
var RowNoHilight = '';

function ChangeCursor()
{
  //document.body.style.cursor="crosshair";
  //style="cursor:crosshair";			//for Firefox, but doesn't work from .js
}
function ResetCursor()
{
  //document.body.style.cursor="auto";
  //style="cursor:auto";			//for Firefox, but doesn't work from .js
}

function CheckFrames(myURL1,myURL2) {//function begin
var SrchStr1;var TopWindow1;var hrefStr;
//SrchStr1 = window.top.location.search;//get link after and including the ?
SrchStr1 = window.top.location.href;//get complete link

	if(SrchStr1.indexOf('WebberEMI.htm') == -1) {
		TopWindow1 = '';//nothing to search
	}
	else {
		TopWindow1 = SrchStr1.substring(SrchStr1.indexOf('WebberEMI.htm'), SrchStr1.indexOf('?'));//check if 'WebberEMI.htm' exists
	}//end search

	if(parent.frames.length == 0 && TopWindow1 != 'WebberEMI.htm') {
		if(typeof(myURL1) != 'undefined' && typeof(myURL2) != 'undefined') {
			hrefStr = 'WebberEMI.htm?MainWindow=' + myURL1 + '&SubWindow=' + myURL2;
			window.top.location.href = hrefStr;
		}
		else if(typeof(myURL1) != 'undefined') {
		  hrefStr = 'WebberEMI.htm?MainWindow=' + myURL1;
			window.top.location.href = hrefStr;
		}//end typeof

  }
	else if(parent.frames.length > 0 && TopWindow1 != 'WebberEMI.htm') {
		if(typeof(myURL1) != 'undefined' && typeof(myURL2) != 'undefined') {
			hrefStr = 'WebberEMI.htm?MainWindow=' + myURL1 + '&SubWindow=' + myURL2;
			window.top.location.href = hrefStr;
    }//end typeof

  }
//function end
}

function Delineate() {//function begin
//SrchStr2 = window.top.location.search;//get link after and including the ?
SrchStr2 = window.top.location.href;//get complete link

	if(SrchStr2.indexOf('&') == -1) {
		MainWindow2 = SrchStr2.substring(SrchStr2.indexOf('Main') + 11, SrchStr2.length);//alert(MainWindow2);
	}
	else {
		MainWindow2 = SrchStr2.substring(SrchStr2.indexOf('Main') + 11, SrchStr2.indexOf('&'));//alert(MainWindow2);
	}//end substring

	if(SrchStr2.indexOf('Sub') == -1) {
		SubWindow2 = '';//nothing to search
	}
	else {
		SubWindow2 = SrchStr2.substring(SrchStr2.indexOf('Sub') + 10, SrchStr2.length);//alert(SubWindow2);
	}//end substring

	if(SrchStr2.search('Main') > -1) {//alert('Main Exists');
		//window.top.frames['MainWindow'].window.location.href = MainWindow2;
		//window.top.MainWindow.window.location.replace(MainWindow2);
		window.top.frames[0].window.location.href = MainWindow2;
	}//end search

	if(SrchStr2.search('Sub') > -1) {//alert('Sub Exists');
		//window.top.frames['MainWindow'].frames['PRFrame'].window.location.href = SubWindow2;
		//window.top.MainWindow.PRFrame.window.location.replace(SubWindow2);
		//window.top.frames[0].frames[0].window.location.href = SubWindow2;
		setTimeout('window.top.frames[0].frames[0].window.location.href = SubWindow2', 500);
	}//end search

//function end
}

function getFilename() {//CheckFrames(getFilename(),getSubFrameFilename())
var tr = window.location.pathname;
len = tr.length;
rs = 0
  for (i = len; i > 0; i--) {
    vb = tr.substring(i,i+1);
    if (vb == "/" && rs == 0) {//stop when '/' is found
      //alert(tr.substring(i+1,len));
      rs = 1

    }
  }
}
