function enlarge(type,product,width,height) {
	//alert(product+';'+width+';'+height);
	if (type=='product') {
		var url='/product_popup.php?type=product&product='+product;
		}
	else if (type=='free_gift') {
		var url='/product_popup.php?type=free_gift&product='+product;
		}
	else return false;
	bs_product_popup=window.open(url,'bs_product_popup','width='+width+',height='+height+',resizable=1');
	bs_product_popup.focus();
	return false;
	}

function calculator(product) {
	//alert('product: '+product);
	var width=400;
	var height=500;
	var url='/calculator_popup.php?product='+product;
	//alert('url: '+url);
	//return false;
	bs_calculator_popup=window.open(url,'bs_calculator_popup','width='+width+',height='+height+',resizable=1');
	bs_calculator_popup.focus();
	return false;
	}

function findheight(d) {
	// determine height for <div> element
	if(d.style.height){
		//alert('style.height');
		divHeight=d.style.height;
		} // end else if
	else if(d.offsetHeight){
		//alert('offsetHeight');
		divHeight=d.offsetHeight;
		} // end if
	else if(d.style.pixelHeight){
		//alert('style.pixelHeight');
		divHeight=d.style.pixelHeight;
		} // end else if
	//alert('divHeight: '+divHeight);
	return divHeight;
	} // end function findheight

function setheight(d,height) {
	d.style.height=height+'px';
	d.style.marginLeft='0px';
	d.style.height=height+'px';
	if (d.offsetHeight > height) { // fix for the difference between height and offsetHeight in standards-compliant mode (see http://www.paulbellows.com/getsmart/balance_columns/column.js)
		d.style.height = (height - (d.offsetHeight - height)) + 'px';
		}
	}

function addListenerToEvent(obj,evtName,fnCall) {
	// can't remember where this came from
	// doesn't appear to be able to take parameters in fnCall, which seems odd
	
	evtName=evtName.toLowerCase();
	doCapture=false;
	
	if (obj.addEventListener){
		//obj.addEventListener(evtName.replace('on',''),fnCall,doCapture);
		obj.addEventListener(evtName.replace('on',''),
		function(){eval(fnCall);},false);
		}
	else if(obj.attachEvent){
		obj.attachEvent(evtName,function(){eval(fnCall);});
		//also do detachEvent later
		}
	else{
		eval(obj+"."+evtName +"="+ fnCall);
		}
	}

matchMenuAndContent=function(){
	// get the two elements of interest
	var menudiv=document.getElementById('menu');
	var contentdiv=document.getElementById('content');
	
	// get their heights
	var menuheight=findheight(menudiv);
	var contentheight=findheight(contentdiv);
	
	// is content taller?
	if (contentheight>menuheight) {
		// if so, add some margin-bottom to ul#info
		var diff=contentheight-menuheight;
		document.getElementById('info').style.marginBottom=diff+17+'px'; // 17 is its CSS-specified margin - I can't see how to get javaascript to detect this
		}
	}

// match the heights of the left and right divs on the home page
addListenerToEvent(window,'onload','matchMenuAndContent()');

