
function showfilter(id) {

if (document.getElementById(id).style.display=="none") {
	document.getElementById(id).style.display="block";
	document.getElementById('img' + id).src='/images/navigate/filteroff.gif';
	document.getElementById('hidefilters').disabled=false;
	} else {
	document.getElementById(id).style.display="none";
	document.getElementById('img' + id).src='/images/navigate/filteron.gif';
	checkFilters();
	}
hideotherfilters(id);
return false;
}

function hideotherfilters(id) {
if (!(id=='a1')) { document.getElementById('a1').style.display="none"; document.getElementById('imga1').src='/images/navigate/filteron.gif';}
if (!(id=='a2')) { document.getElementById('a2').style.display="none"; document.getElementById('imga2').src='/images/navigate/filteron.gif';}
if (!(id=='a3')) { document.getElementById('a3').style.display="none"; document.getElementById('imga3').src='/images/navigate/filteron.gif';}
if (!(id=='a4')) { document.getElementById('a4').style.display="none"; document.getElementById('imga4').src='/images/navigate/filteron.gif';}
if (!(id=='a5')) { document.getElementById('a5').style.display="none"; document.getElementById('imga5').src='/images/navigate/filteron.gif';}
if (!(id=='a6')) { document.getElementById('a6').style.display="none"; document.getElementById('imga6').src='/images/navigate/filteron.gif';}
if (!(id=='a7')) { document.getElementById('hidefilters').disabled=true;
document.getElementById('showallfilters').value='Show All Options';}
//window.location.href=('#doctop');
}	
	
function hidefilters(id) {
	if (!(id=='a1')) { document.getElementById('a1').style.display="none"; document.getElementById('imga1').src='/images/navigate/filteron.gif';}
	if (!(id=='a2')) { document.getElementById('a2').style.display="none"; document.getElementById('imga2').src='/images/navigate/filteron.gif';}
	if (!(id=='a3')) { document.getElementById('a3').style.display="none"; document.getElementById('imga3').src='/images/navigate/filteron.gif';}
	if (!(id=='a4')) { document.getElementById('a4').style.display="none"; document.getElementById('imga4').src='/images/navigate/filteron.gif';}
	if (!(id=='a5')) { document.getElementById('a5').style.display="none"; document.getElementById('imga5').src='/images/navigate/filteron.gif';}
	if (!(id=='a6')) { document.getElementById('a6').style.display="none"; document.getElementById('imga6').src='/images/navigate/filteron.gif';}
document.getElementById('hidefilters').disabled=true;
	//window.location.href=('#doctop');

}

function showallfilters() {
	document.getElementById('a1').style.display="block"; document.getElementById('imga1').src='/images/navigate/filteroff.gif';
	document.getElementById('a2').style.display="block"; document.getElementById('imga2').src='/images/navigate/filteroff.gif'
	document.getElementById('a3').style.display="block"; document.getElementById('imga3').src='/images/navigate/filteroff.gif';
	document.getElementById('a4').style.display="block"; document.getElementById('imga4').src='/images/navigate/filteroff.gif';
	document.getElementById('a5').style.display="block"; document.getElementById('imga5').src='/images/navigate/filteroff.gif';
	document.getElementById('a6').style.display="block"; document.getElementById('imga6').src='/images/navigate/filteroff.gif';
	document.getElementById('hidefilters').disabled=false;
}

var showsearchbutton = false;

function filterlen() {
filterlen2('Mfg');
filterlen2('MFGroup');
filterlen2('CategoryID');
filterlen2('StyleCode');
filterlen2('Widthx');
filterlen2('Heightx');
filterlen2('Pricex');
//if (showsearchbutton == true) {
//	document.getElementById('searchbutton').style.visibility="visible";
//	} else {
//	document.getElementById('searchbutton').style.visibility="hidden";
//	}
}

function filterlen2(f) {
//alert(f);
	var fres = f + 'txt';
	var ftot=0;
	var fstr = "";
	var fdesc = "";
	for(var i=0; i < document.getsearch[f].length; i++) {
	if(document.getsearch[f][i].checked) {
	if (!(document.getsearch[f][i].value=='')) {	
//	showsearchbutton = true;
	ftot +=1
	fdesc = fdesc + getdesc(document.getsearch[f][i].value) + ',';
			}
		} else { 
		//alert(document.getsearch[f][i].value + ' = NOT checked')
		}
	}
	fdesc=fdesc.substring(0,fdesc.length-1)
	if (ftot==0) {
	document.getElementById(fres).value=('None Selected');
	} else {
	if ((f=='Widthx') || (f=='Heightx')) {
	document.getElementById(fres).value=(fdesc);
	} else {
	document.getElementById(fres).value=(fdesc);
	}
	}
	if ((document.getElementById('Widthxtxt').value==('None Selected')) && (document.getElementById('Heightxtxt').value==('None Selected'))) {
	document.getElementById('Sizetxt').value=('None Selected');
	} else {
	document.getElementById('Sizetxt').value=('Width: ' + document.getElementById('Widthxtxt').value +', Height: '+ document.getElementById('Heightxtxt').value)
	}
}

function getdesc(c) {

if (c=='AB') {return 'Ambience'}
if (c=='AF') {return 'American Fluorescent'}
if (c=='CL') {return 'Crystorama'}
if (c=='DF') {return 'Designers Fountain'}
if (c=='FA') {return 'Fanimation'}
if (c=='GK') {return 'George Kovacs'}
if (c=='JD') {return 'Justice Design'}
if (c=='KA') {return 'Kalco'}
if (c=='KE') {return 'Kenroy'}
if (c=='KL') {return 'Kichler'}
if (c=='MX') {return 'Maxim'}
if (c=='MP') {return 'Metropolitan'}
if (c=='MY') {return 'Meyda'}
if (c=='ML') {return 'Minka Lavery'}
if (c=='MR') {return 'Murray Feiss'}
if (c=='PG') {return 'Progress'}
if (c=='QZ') {return 'Quoizel'}
if (c=='TE') {return 'Tech'}

if (c=='Bathroom') {return c}
if (c=='Flush') {return 'Flush'}
if (c=='Chandelier') {return c}
if (c=='Island') {return c}
if (c=='Lamp') {return 'Lamp'}
if (c=='Torchiere') {return c}
if (c=='Other') {return c}
if (c=='Monorail') {return c}
if (c=='Outdoor') {return c}
if (c=='Overhead') {return c}
if (c=='Pendant') {return c}
if (c=='Potrack') {return c}
if (c=='StepLight') {return c}
if (c=='UnderCabinet') {return c}
if (c=='WallLamp') {return c}
if (c=='Sconce') {return c}

if (c=='Casual') {return c}
if (c=='Contemporary') {return c}
if (c=='Crystal') {return c}
if (c=='Eclectic') {return c}
if (c=='Elegant') {return c}
if (c=='Mission') {return c}
if (c=='Other') {return c}
if (c=='Rustic') {return c}
if (c=='Tiffany') {return c}
if (c=='Traditional') {return c}
if (c=='Tropical') {return c}

if (c=='1') {return 'Black/Gray'}
if (c=='2') {return 'Brass/Gold'}
if (c=='3') {return 'Bronze'}
if (c=='4') {return 'Copper'}
if (c=='5') {return 'Nickel/Steel'}
if (c=='6') {return 'Painted'}
if (c=='7') {return 'Pewter/Silver'}
if (c=='8') {return 'Rustic'}
if (c=='9') {return 'White'}
if (c=='10') {return 'Beige'}
if (c=='11') {return 'Wood/Natural'}
if (c=='12') {return 'Alabaster'}
if (c=='13') {return 'Crystal/Glass'}
if (c=='14') {return 'Fabric/Canvas'}
if (c=='15') {return 'Leather'}
if (c=='16') {return 'Tiffany'}
if (c=='17') {return 'Other'}
if (c=='18') {return 'Unknown'}

if (c=='w0') {return 'Width 12" or Less'}
if (c=='w1') {return 'Width 12" to 24'}
if (c=='w2') {return 'Width 24" to 36"'}
if (c=='w3') {return 'Width 36" to 48"'}
if (c=='w4') {return 'Width Over 48"'}
if (c=='h0') {return 'Height 12" or Less'}
if (c=='h1') {return 'Height 12" to 24"'}
if (c=='h2') {return 'Height 24" to 36"'}
if (c=='h3') {return 'Height 36" to 48"'}
if (c=='h4') {return 'Height Over 48"'}

if (c=='p0') {return 'Under $150'}
if (c=='p1') {return '$150 - $300'}
if (c=='p2') {return '$300 - $500'}
if (c=='p3') {return '$500 - $1000'}
if (c=='p4') {return 'Over $1000'}
}

function showDivs(hiddiv) {
hideDivs();
if (document.getElementById(hiddiv).style.visibility=="visible") {
	document.getElementById(hiddiv).style.visibility="hidden";
	document.getElementById('div2').style.visibility="visible";
	} else {
	document.getElementById(hiddiv).style.visibility="visible";
	document.getElementById('div2').style.visibility="hidden";
	}
}

function hideDivs() {
	document.getElementById('div2').style.visibility="visible";
	document.getElementById('div3').style.visibility="hidden";
	document.getElementById('div4').style.visibility="hidden";
	document.getElementById('div5').style.visibility="hidden";
	document.getElementById('div6').style.visibility="hidden";
	document.getElementById('div7').style.visibility="hidden";
	document.getElementById('div8').style.visibility="hidden";
}


// STUF FROM HOD

function goFilter(fid,fval) {
	document.getElementById(fid).value=fval;

//	document.getElementById('Page').value=('');
	document.NC.submit();
}

function theMessage(){
	mWindow = window.open("wishes.asp","mWin","menubar=no,location=no,resizable=no,scrollbars=no,status=no,width=250,height=300");
	mWindow.moveTo(0,0);
	return true
}

function checkcb() {
if ((document.NC.hfSubCat1.value=='') && (document.NC.MFGroup.value=='') && (document.NC.hfStyleCode.value=='')) {
alert('Please check at least one similarity');

} else {
document.NC.submit();
	}
}

