
if(!q){
	q="(search)";
}

function maskMail(nom,dom){
	if(!dom){
		dom="keenechamber.com";
		document.write("<A HREF=\"mailto:"+nom+"@"+dom+"\">"+nom+"@"+dom+"</A>");
	}
}

function openWin(url,theWidth,theHeight){
	eval("window.open(url,'_blank','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=" + theWidth + ",height=" + theHeight + "')");
}

function wipeSearch(){
	if(document.search.q.value=="(search)"){
		document.search.q.value='';
	}
}


var menulist=new Array("abo","biz","cal","res","reg","out","mkt","con","mem");
var timer;
function show(menu){
	clearTimeout(timer);
	for(i=0;i<menulist.length;i++){
		if(menu == menulist[i]){
			document.getElementById("tab_"+menulist[i]).style.color="#336600";
			if(document.getElementById("menu_"+menulist[i])){
				document.getElementById("menu_"+menulist[i]).style.visibility='visible';
			}
		}else{
			document.getElementById("tab_"+menulist[i]).style.color="#000000";
			if(document.getElementById("menu_"+menulist[i])){
				document.getElementById("menu_"+menulist[i]).style.visibility='hidden';
			}
		}
	}
}

function hide(menu){
	m=menu;
	timer=setTimeout("wipe(m)",400);
}
function wipe(menu){
	document.getElementById("tab_"+menu).style.color="#000000";
	if(document.getElementById("menu_"+menu)){
		document.getElementById("menu_"+menu).style.visibility='hidden';
	}
}

function cellOn(menu,cell){
	show(menu);
	document.getElementById(menu+"_"+cell).style.backgroundColor='#ffff33';
}
function cellOff(menu,cell){
	document.getElementById(menu+"_"+cell).style.backgroundColor='#ffffcc';
	hide(menu);
}


function build_nav(banners){
	document.write("\
		<TABLE CELLPADDING=\"5\" CELLSPACING=\"1\" BORDER=\"0\" WIDTH=\"114\" CLASS=\"dk_bars\">\
			<TR>\
				<FORM ACTION=/search.html METHOD=GET name=search>\
				<TD id=\"search\" bgcolor=\"#f7ef74;\" ALIGN=\"CENTER\"><TABLE CELLPADDING=\"2\" CELLSPACING=\"0\" BORDER=\"0\"><TR><TD align=\"CENTER\"><INPUT TYPE=\"TEXT\" NAME=\"q\" STYLE=\"width:72px;\" MAXLENGTH=\"25\" value=\""+q+"\" onClick='wipeSearch();'></TD><TD><A HREF='javascript:document.search.submit();' onmouseover=\"changeImages('go','images/go-over.gif');\" onmouseout=\"changeImages('go','images/go.gif');\"><IMG name='go' SRC=\"/images/go.gif\" BORDER=\"0\"></A></TD></TR></TABLE></TD>\
				</FORM>\
			</TR>\
			<TR>\
				<TD id=\"tab_abo\" class=\"tab\" onmouseover=\"show('abo');\" onmouseout=\"hide('abo');\" onClick=\"document.location='http://www.keenechamber.com/about.html'\">About the GKCC</TD>\
			</TR>\
			<TR>\
				<TD id=\"tab_biz\" class=\"tab\" onmouseover=\"show('biz');\" onmouseout=\"hide('biz');\" onClick=\"document.location='http://www.keenechamber.com/business_directory.html'\">Find A Business</TD>\
			</TR>\
			<TR>\
				<TD id=\"tab_res\" class=\"tab\" onmouseover=\"show('res');\" onmouseout=\"hide('res');\" onClick=\"document.location='http://www.keenechamber.com/links.html'\">Business Resources</TD>\
			</TR>\
			<TR>\
				<TD id=\"tab_cal\" class=\"tab\" onmouseover=\"show('cal');\" onmouseout=\"hide('cal');\" onClick=\"document.location='http://www.keenechamber.com/events.html'\">Events Calendar</TD>\
			</TR>\
			<TR>\
				<TD id=\"tab_reg\" class=\"tab\" onmouseover=\"show('reg');\" onmouseout=\"hide('reg');\" onClick=\"document.location='http://www.keenechamber.com/region.html'\">Regional Info</TD>\
			</TR>\
			<TR>\
				<TD id=\"tab_out\" class=\"tab\" onmouseover=\"show('out');\" onmouseout=\"hide('out');\" onClick=\"document.location='http://www.keenechamber.com/outlook.html'\">Outlook Newsletter</TD>\
			</TR>\
			<TR>\
				<TD id=\"tab_mkt\" class=\"tab\" onmouseover=\"show('mkt');\" onmouseout=\"hide('mkt');\" onClick=\"document.location='http://www.keenechamber.com/marketplace.html'\">Marketplace</TD>\
			</TR>\
			<TR>\
				<TD id=\"tab_con\" class=\"tab\" onmouseover=\"show('con');\" onmouseout=\"hide('con');\" onClick=\"document.location='http://www.keenechamber.com/contact.html'\">Contact GKCC</TD>\
			</TR>\
			<TR>\
				<TD id=\"tab_mem\" class=\"tab\" onmouseover=\"show('mem');\" onmouseout=\"hide('mem');\" onClick=\"document.location='http://www.keenechamber.com/login.html'\">Members Only</TD>\
			</TR>\
		</TABLE>\
	");
	if(banners){
		document.write("\
			"+weather+"\
			<BR />\
			<IMG SRC=\"/images/spacer.gif\" width=\"114\" HEIGHT=\"5\" /><BR />\
			<A HREF=\"http://www.keenechamber.com/join.html\"><IMG SRC=\"/images/join.gif\" border=\"0\"></A><BR />\
			<A HREF=\"http://www.keenechamber.com/video.html\"><IMG SRC=\"/images/video.gif\" border=\"0\"></A><BR />\
			<IMG SRC=\"/images/spacer.gif\" width=\"114\" HEIGHT=\"10\" />\
		");

	}else{
		document.write("\
			<BR />\
			<IMG SRC=\"/images/flag.jpg\" />\
		");
	}
}


function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		help_over = newImage("images/help-over.gif");
		go_over = newImage("images/go-over.gif");
		preloadFlag = true;
	}
}

preloadImages();



function getListed(y){
	document.write('<P align=center><A HREF="javascript:openWin(\'https://secure.keenechamber.com/getlisted.html?x='+y+'\',540,600)">Add Your Company<\/A>&nbsp;&#149;&nbsp;<A HREF="http://www.keenechamber.com/login.html?x='+y+'">Modify Your Listing<\/A>');
}