function showGenderBox(boxID,id){
	/*document.getElementById(boxID).innerHTML = 
		'<br><b>Gender:</b><input type=\'radio\' name=\'gender'+id+'\' id=\'gender\' value=\'M\' checked>'+
		'<img height=\'30\' width=\'16\' src=\'images/finder/male.gif\'>&nbsp;&nbsp;&nbsp;'+
		'<input type=\'radio\' id=\'gender\' name=\'gender'+id+'\' value=\'F\'><img height=\'30\' width=\'16\' src=\'images/finder/female.gif\'>';*/
	document.getElementById(boxID).style.display = '';	
}

function emptyGenderBox(boxID,id){
	document.getElementById(boxID).style.display = 'none';
}

function buildCompareProduct(val, chkbox){
	
	var f = document.getElementById('compareProductButtonForm');
	if (!f)
		return '';	
	f.prod.value = buildWordsHelper(f.prod.value,val,chkbox);
}

	function buildAttribute(form, val, input){
		form.attr.value = buildWordsHelper(form.attr.value,val,input);
	}
	
	function buildWordsHelper(list,val,chkbox){
		if (!chkbox.checked){
			//unchecked
			if (list.match(val+'-') != null){				
				list = list.replace(val+'-','');
			}
			else if (list.match('-'+val) != null){
				list = list.replace('-'+val,'');
			}
			else
				list = list.replace(val,'');
			//alert(attributeList);
		}
		else{//checked
			if (list.match(val) != null){
				//found
			}
			else{//not found
				if (list == '')
					list += val;
				else
					list += '-'+val;
			}
		}
		return list;
	}
	
	function removeAttribute(){
	}
	
	function toggle(id,e,downImg, upImg)
	{ 
		el = document.getElementById(id);
		var display = el.style.display ? '' : 'none';
		var displayClass = el.style.display?'divOpen': 'divHide';
		if (e.value=='+')
			e.value = '-';
		else
			e.value = '+';
		var pic1 = new Image();
		if (display == '')
			pic1.src = 'images/'+upImg;
		else
			pic1.src = 'images/'+downImg;
		e.src = pic1.src;
		el.style.display = display;
		el.className = displayClass;
		//alert(el.className);
	}
	
	function isZip(s) 
	{
	 
	     // Check for correct zip code
	     reZip = new RegExp(/(^\d{5}$)|(^\d{5}-\d{4}$)/);
	 
	     if (!reZip.test(s)) {
	          alert("The Zip Code Entered Is Not Valid");
	          return false;
	     }
	 
	return true;
	}
	
	function switchBox(showDiv,hideDiv){
		document.getElementById(hideDiv).style.display = 'none';
		document.getElementById(showDiv).style.display = '';
	}
	
	function goSite(site){
		var obj = window.open(site,'_blank');
		obj.focus();
	}
	
	function bookmarkPage(theUrl,theName){
		if (window.sidebar) { // firefox
              window.sidebar.addPanel(theName, theUrl,"");
        } else if( document.all ) { //MSIE
                window.external.AddFavorite( theUrl, theName);
        } else {
               alert("Sorry, your browser doesn't support this");
        }

	}
