// JavaScript Document
function tactive(tabid) {
if (document.getElementById()){
	var el = document.getElementById(tabid);
	el.className = 'activetab';
	}
}

function popUphelp(page){
var windowprops = "height=420,width=540,scrollbars,left=240,top=100";
var newwin = window.open(page, "Help", windowprops);
}

function bvalid() {
if (document.bizname.as_business_name.value == ""){
alert("Please enter at least 1 character for Business Name.");
document.bizname.as_business_name.focus();
return false;
}else{
return true;
}
}

function f_opt_index(city){
var thecities = document.bizname.as_city.options;
for (var i=0; i < thecities.length; i++){
		if (thecities[i].value == city){
		document.bizname.as_city.selectedIndex = i;
		}
	}
}

function setlink(myhref) {
var mylink = document.getElementById('2');
mylink.href = myhref;
}

function tform(mytitle){
//if IE 4+
if (document.all){
	document.all.formtitle.innerHTML=mytitle;
	}
//else if NS 4
	else if (document.layers){
			document.formtitle2.document.formtitle3.
			document.write(mytitle);
			document.formtitle2.document.formtitle3.
			document.close();
	}
//else if NS 6 (supports new DOM)
	else if (document.getElementById()){
		rng = document.createRange();
		el = document.getElementById('formtitle');
		rng.setStartBefore(el);
		htmlFrag = rng.createContextualFragment(mytitle);
		while (el.hasChildNodes())
		el.removeChild(el.lastChild);
		el.appendChild(htmlFrag);
	}
}

function cvalid() {
if (document.f2.category_0.value == "" && document.f2.city_0.value == ""){
	alert("Please choose at least 2 search criteria for this report.");
	document.f2.category_0.focus();
	return false;	
}else{
	if (document.f2.category_0.value == "" && document.f2.date1_0.value == ""){
	alert("Please choose at least 2 search criteria for this report.");
	document.f2.category_0.focus();
	return false;
	}else{
		if (document.f2.city_0.value == "" && document.f2.date1_0.value == ""){
		alert("Please choose at least 2 search criteria for this report.");
		document.f2.city_0.focus();
		return false;
		}else{
			if (document.f2.date_op_0.value == "BETWEEN" && document.f2.date2_0.value == ""){
			alert("Please enter an end date.");
			document.f2.date2_0.focus();
			return false;
			}else{
				if (document.f2.date_op_0.value == "BETWEEN" && document.f2.date1_0.value == ""){
				alert("Please enter a start date.");
				document.f2.date1_0.focus();
				return false;
				}else{
					return true;
				}
			}
		}
	}
}
}
function showElement() {
var myindex=document.f2.date_op_0.selectedIndex;
	if (myindex==5){	
		if (document.all){
			document.all.betw.style.visibility = 'visible';
		}else{
			 if (document.layers){
			document.betw.visibility = 'visible';
			}else{
				 if (document.getElementById()){
				document.getElementById('betw').style.visibility = 'visible';
				}
			}
		}
	}else{
		if (document.all){
			document.all.betw.style.visibility = 'hidden';
		}else{
			 if (document.layers){
				document.betw.visibility = 'hidden';
			}else{
				if (document.getElementById()){
				document.getElementById('betw').style.visibility = 'hidden';
				}
			}
		}
	}
}
function popsurvey(){
var pageurl="Forms/custsurv2.asp";
var windowprops = "height=400,width=500,scrollbars=yes,menubars=yes,toolbars=no";
window.open(pageurl,"Survey", windowprops);
}

