//Top Nav
$(document).ready(function(){
closetimer = 0;
	if($("#nav")) {
		$("#nav b").mouseover(function() {
		clearTimeout(closetimer);
			if(this.className.indexOf("clicked") != -1) {
				$(this).parent().next().slideUp(500);
				$(this).removeClass("clicked");
			}
			else {
				$("#nav b").removeClass();
				$(this).addClass("clicked");
				$("#nav ul:visible").slideUp(500);
				$(this).parent().next().slideDown(500);
			}
			return false;
		});
		$("#nav").mouseover(function() {
		clearTimeout(closetimer);
		});
		$("#nav").mouseout(function() {
			closetimer = window.setTimeout(function(){
			$("#nav ul:visible").slideUp(500);
			$("#nav b").removeClass("clicked");
			}, 2000);
		}); 
	}
	closetimer = 0;
	if($("#nav2")) {
		$("#nav2 b").mouseover(function() {
		clearTimeout(closetimer);
			if(this.className.indexOf("clicked") != -1) {
				$(this).parent().next().slideUp(500);
				$(this).removeClass("clicked");
			}
			else {
				$("#nav2 b").removeClass();
				$(this).addClass("clicked");
				$("#nav2 ul:visible").slideUp(500);
				$(this).parent().next().slideDown(500);
			}
			return false;
		});
		$("#nav2").mouseover(function() {
		clearTimeout(closetimer);
		});
		$("#nav").mouseout(function() {
			closetimer = window.setTimeout(function(){
			$("#nav ul:visible").slideUp(500);
			$("#nav b").removeClass("clicked");
			}, 2000);
		}); 
	}		
// Bottom Ad Rotator
	// Random Ads - LEFT
	var adSrc = new Array()
	// Add ad images and html here
	adSrc[0] = '<h3 class="hidden">Yip Yap little treats from CHOMP are absolutely irrisistible.</h3><p class="hidden">Find out more about natural treats for cats and dogs.</p><a href="http://www.sergeants.com/NWF/index.html" target="_blank"><img src="images/ads/protect-collect.jpg" alt="Protect and Collect" border="0" /></a>'
	adSrc[1] = '<h3 class="hidden">Protect and Collect</h3><p class="hidden">Register your Protected Wildlife dog toy series number, learn fun facts and more...</p><a href="http://www.yahoo.com" target="_blank"><img src="images/ads/yip_yap.jpg" alt="Natural Treats for Dogs and Cats!" border="0" /></a>'

	var j = 0
	var p = adSrc.length;
		
	var preBuffer = new Array()
	for (i = 0; i < p; i++){
		 preBuffer[i] = new Image()
		 preBuffer[i].src = adSrc[i]
	}
		
	var whichAd = Math.round(Math.random()*(p-1));
	
	function showAd(){
		document.write(adSrc[whichAd]);
	}
// eof Random Ads - LEFT
	// Urchin Tracking Code
	_userv=0;
	urchinTracker();
});
