function help(ref,menu) {
	if (menu==1) {
		hwin=window.open("index.php?page=help&pop=1&callpage=<?print $page;?>&id="+ref+"&menu="+menu,"hwin","height=300,width=400,menubar=no,location=no,toolbar=no,scrollbars=yes,directories=no");
	} else {
		hwin=window.open("index.php?page=help&pop=1&closeonblur=1&callpage=<?print $page;?>&id="+ref+"&menu="+menu,"hwin","height=300,width=400,menubar=no,location=no,toolbar=no,scrollbars=yes,directories=no");
	}
}


function hideShow(a) {
	if(document.getElementById) {
		obj=document.getElementById(a);
		if(obj.style.display == 'none') {
			obj.style.display = 'block';
		}
		else {
			obj.style.display='none';
		}
	}
	else alert('Non-standards compliant Javascript Browser. Try Firefox or Safari.');
}

function popitup(url) {
	newwindow=window.open(url,'name','height=500,width=450');
	if (window.focus) {newwindow.focus()}
	return false;
}

function to_old_win(url)
{
	opener.location.href = url;
}

function change_defaults(n){
//	function to change buttons to all private or all public, based on request.
	if(n=='quick') {
		for(i=0; i<document.forms.length;i++) {
			if(document.forms[i].quicktab) {
				document.forms[i].quicktab.value = (document.choosereport.quicktab.checked) ? 1 : 0;
			}
		}		
	}
	else {
		var fm = document.report_marketprice;
		var df = eval('document.choosereport.' + n);
		var ind = df.selectedIndex;
		alert('n = ' + n+ '\nfm = ' + fm+ '\ndf = ' + df + '\nind = '+ind);
		for(i=0; i<fm.length;i++) {
			if(((fm[i].name.split("_"))[1]==n)) {
				fm[i].selectedIndex = ind;//(fm[i].value==newvalue) ? true : false;
			}
		}
	}
}
