function pop_win(page, height, width, win, scrollbars, resizable, toolbar, menubar)
{
	if (!height)
		height = 400;
	if (!width)
		width = 560;
	if (!win)
		win = "_new"
	var h, w, scrol, siz;
	w = "WIDTH=" + width.toString();
	h = "HEIGHT=" + height.toString();
	scrol = ",scrollbars=" + ( (scrollbars) ? "yes" : "no" );
	siz = ",resizable=" + ( (resizable) ? "yes" : "no" );
	tool = ",toolbar=" + ( (toolbar) ? "yes" : "no" );
	menu = ",menubar=" + ( (menubar) ? "yes" : "no" );
	attr = w + "," + h + scrol + siz + tool + menu;
	popupWin = window.open(page,win,attr);
	try {
		popupWin.focus();
	} catch(err) {
		//do nothing
	}
}

function navRolls() {
  var myImagePath = basePath + 'nav/';
  xImgRollSetup(myImagePath,'-on','.gif','home');
  xImgRollSetup(myImagePath,'-on','.gif','whats-new');
  xImgRollSetup(myImagePath,'-on','.gif','products');
  xImgRollSetup(myImagePath,'-on','.gif','about-us');
  xImgRollSetup(myImagePath,'-on','.gif','where-to-buy');
  xImgRollSetup(myImagePath,'-on','.gif','contact-us');

}

function prodRolls() {
	var myImagePath = basePath + 'pnav/';
	xImgRollSetup(myImagePath,'-on','.gif','ok-wire-wrapping-tools');
	xImgRollSetup(myImagePath,'-on','.gif','pliers');
	xImgRollSetup(myImagePath,'-on','.gif','fiber-optic-tools');
	xImgRollSetup(myImagePath,'-on','.gif','fume-absorbers');
	xImgRollSetup(myImagePath,'-on','.gif','wire');
	xImgRollSetup(myImagePath,'-on','.gif','wire-strippers');
	xImgRollSetup(myImagePath,'-on','.gif','wrenches');
	xImgRollSetup(myImagePath,'-on','.gif','desoldering-pumps');
	xImgRollSetup(myImagePath,'-on','.gif','ic-insertion-extraction');
	xImgRollSetup(myImagePath,'-on','.gif','cable-tools');
	xImgRollSetup(myImagePath,'-on','.gif','telecommunication-tools');
	xImgRollSetup(myImagePath,'-on','.gif','connector-tools');
	xImgRollSetup(myImagePath,'-on','.gif','force-gauges');
	xImgRollSetup(myImagePath,'-on','.gif','burnishers');
	xImgRollSetup(myImagePath,'-on','.gif','alignment-tools');
	xImgRollSetup(myImagePath,'-on','.gif','socket-wrap-id-tags');
	xImgRollSetup(myImagePath,'-on','.gif','punchdown-tools');
	xImgRollSetup(myImagePath,'-on','.gif','wire-wrapping-tools');
	xImgRollSetup(myImagePath,'-on','.gif','new-products');
	xImgRollSetup(myImagePath,'-on','.gif','product-index');
	xImgRollSetup(myImagePath,'-on','.gif','download-catalog');
	
}

function aboutRolls() {
	var myImagePath = basePath + 'anav/';
	xImgRollSetup(myImagePath,'-on','.gif','about-us-2');
	xImgRollSetup(myImagePath,'-on','.gif','careers');
	xImgRollSetup(myImagePath,'-on','.gif','download-catalog');	
	xImgRollSetup(myImagePath,'-on','.gif','videos');	
}

function matchRelatedHeights() {
	myDivs = xGetElementsByClassName('related-txt',null,'DIV');
	matchHeights(myDivs);
}

function matchTabHeights() {
	myDivs = xGetElementsByClassName('tab-table',null,'DIV');
	matchHeights(myDivs);
}

function matchHeights(myDivs) {

	topHeight = 0;
	
	for(i=0; i<myDivs.length; i++) {
		myDiv = myDivs[i];
		curHeight = xHeight(myDiv);
		if (curHeight > topHeight) {
			topHeight = curHeight;
		}
	}
	for(i=0; i<myDivs.length; i++) {
		myDiv = myDivs[i];
		xHeight(myDiv,topHeight);
	}
}

function showInches () {
	xDisplay('metric','none');
	xDisplay('inches','block');
	inchImg = xGetElementById('tab-inches');
	metricImg = xGetElementById('tab-metric');
	
	if (inchImg && metricImg) {
		inchImg.src = basePath + 'inches-on.gif';
		metricImg.src = basePath + 'metric-off.gif';
	}
}

function showMetric() {
	xDisplay('metric','block');
	xDisplay('inches','none');
	inchImg = xGetElementById('tab-inches');
	metricImg = xGetElementById('tab-metric');
	
	if (inchImg && metricImg) {
		inchImg.src = basePath + 'inches-off.gif';
		metricImg.src = basePath + 'metric-on.gif';
	}
}

function alternateColors() {
	myTables = xGetElementsByClassName('alternate',null,'TABLE');
	for(i=0; i<myTables.length; i++) {
		myRows = xGetElementsByTagName('TR',myTables[i]);
		for(j=0; j<myRows.length; j++) {
			if(j % 2 == 0 && j != 0){
				myRows[j].className="alt";
			}
		}
	}
}