	function search(f) {
		var content = f.content.options[f.content.selectedIndex].value;
		
		if (content == 'Articles') {
			f.action = 'article.php';
		}
		if (content == 'Streets') {
			f.action = 'street.php';
		}
		if (content == 'Promos') {
			f.action = 'promo.php';
		}
		if (content == 'Classifieds') {
			f.action = 'classifieds.php';
		}
		if (content == 'Business') {
			f.action = 'business.php';
		}
		if (content == 'People') {
			f.action = 'people.php';
		}
		if (content == 'Web Sites') {
			f.action = 'resource.php';
		}
		f.submit();
	}
	

	function artCatLoad(cat,f) {		
		f.a_category.options[f.a_category.selectedIndex].value = cat;		
		f.submit();
	}
	
	function textCounter(field, countfield, maxlimit) {
		if (field.value.length > maxlimit) // if too long...trim it!
			field.value = field.value.substring(0, maxlimit);
		// otherwise, update 'characters left' counter
		else 
			countfield.value = maxlimit - field.value.length;
	}
	
	function txtAreaLimit(field, maxlimit) {
		if (field.value.length > maxlimit) {	
			field.value = field.value.substring(0, maxlimit);
		}
	}

//checks all checkboxes in a record list
//sets value to the checkedboxes hidden field
	function checkAll(n) {
		var f = document.siteForm;
		var c = f.toggle.value;
    
		for (i=1;i<=n;i++) {
			box = eval('f.id'+i);
			if (c == 1) {
        box.checked = true;
      } else {
        box.checked = false;
      }  
		}

		if (c == 1) {
			f.checkedboxes.value = n;
			f.toggle.value = '0';
		} else {
			f.checkedboxes.value = 0;
			f.toggle.value = '1';
		}
	}

//sets value to the checkedboxes hidden field
	function isChecked(isitchecked){
		var f = document.siteForm;

		if (isitchecked == true){
			f.checkedboxes.value++;
		} else {
			f.checkedboxes.value--;
		}
	}


            function toggleCategory(val) {
              var catBlock = document.getElementById("catBlock");
              var bizBlock = document.getElementById("bizBlock");
              var empBlock = document.getElementById("empBlock");              
                 
              if (val == "Articles") {
	              self.location='article.php';
              } else {
              
              if (val == "Business" || val == "Promos") {
              	catBlock.style.display = "none";
              	empBlock.style.display = "none";              	
                bizBlock.style.display = "inline";        
              }
              if (val == "Classifieds") {
                bizBlock.style.display = "none";
                empBlock.style.display = "none";                
                catBlock.style.display = "inline";                
              }
              if (val != "Classifieds" && val != "Promos" && val != "Business") {
                bizBlock.style.display = "none";
                catBlock.style.display = "none";
                empBlock.style.display = "inline"; 
              }  
              
          	  }            
              return false;
            }
          

function SetCookie(cookieName,cookieValue,nDays) {
 var today = new Date();
 var expire = new Date();
 if (nDays==null || nDays==0) nDays=1;
 expire.setTime(today.getTime() + 3600000*24*nDays);
 document.cookie = cookieName+"="+escape(cookieValue)+";expires="+expire.toGMTString();
}


function ReadCookie(cookieName) {
 var theCookie=""+document.cookie;
 var ind=theCookie.indexOf(cookieName);
 if (ind==-1 || cookieName=="") return ""; 
 var ind1=theCookie.indexOf(';',ind);
 if (ind1==-1) ind1=theCookie.length; 
 return unescape(theCookie.substring(ind+cookieName.length+1,ind1));
}

function deleteCookie(cookieName, path, domain) {
    if (getCookie(cookieName)) {
        document.cookie = cookieName + "=" +
            ((path) ? "; path=" + path : "") +
            ((domain) ? "; domain=" + domain : "") +
            "; expires=Thu, 01-Jan-01 00:00:01 GMT";
    }
}

function shToggle(content) {
if (document.getElementById(content).style.display == 'none') {
  document.getElementById(content).style.display = 'block';
} else {
  document.getElementById(content).style.display = 'none';
}
}

function toggleLayer(whichLayer) {
	if (document.getElementById) {
		// this is the way the standards work
		var style2 = document.getElementById(whichLayer).style;
		style2.display = style2.display? "":"block";
	} else if (document.all) {
		// this is the way old msie versions work
		var style2 = document.all[whichLayer].style;
		style2.display = style2.display? "":"block";
	} else if (document.layers) {
		// this is the way nn4 works
		var style2 = document.layers[whichLayer].style;
		style2.display = style2.display? "":"block";
	}
}

function resizeImage(image, maxwidth, maxheight)
{
    if (image.className == "Thumbnail")
    {
        w = image.width;
        h = image.height;
                
        if( w == 0 || h == 0 )
        {
            image.width = maxwidth;
            image.height = maxheight;
        }
        else if (w > h)
        {
            if (w > maxwidth) image.width = maxwidth;
        }
        else
        {
            if (h > maxheight) image.height = maxheight;
        }
                
        image.className = "ScaledThumbnail";
    }
}