// JavaScript Document
var emailAddress = new Array();
emailAddress[0] = "sendemail,email,newtrendmktg,aol,com"; 
function isDefined(property) {
  return (typeof property != 'undefined');
}
function escramble() {
	//ensure user agent can do DOM
    var linkText;
	if ((isDefined(document.getElementById)) && (isDefined(document.createElement)))
	{
	//loop through email addresses
	  try {
   	    for (var i=0;i<emailAddress.length;i++) {
			//put data in array
	  	  var x = emailAddress[i].split(',');
		//grab the email span element
		  var element = document.getElementById(x[0]);
		 
		//create the actual link
		  var theLink = "mailto:" + x[2] + "@" + x[3] + "." + x[4];
		
		//build node for email link
		  emailLink = document.createElement("a");
		  emailLink.href = theLink;
		  
		 //use span so IE 6 doesn't show mailto
		  var linkSpan = emailLink.appendChild(document.createElement("span"));
		  linkText = x[1];
		  if (x[1] == "email")
		  {
			 linkText = x[2] + "@" + x[3] + "." + x[4];
		  }
		  linkSpan.appendChild(document.createTextNode(linkText));
       
		//replace it!
		  element.parentNode.replaceChild(emailLink, element)
		 

	    }
	  }
		catch(err) {
			
		}
	}
}

function handleRecipes() {
  $(".recipes").click(function () {
	$(".recipes").removeClass("boldlabel");
	$(this).addClass("boldlabel");
    $(".recipediv").hide();
	var myDiv = "#" + $(this).attr("rel");
	$(myDiv).show();
	if ($(this).attr("rel") == "dessertcoffee") {
		$("#sidebar").css("paddingBottom","250px");
		$("#content2").css("paddingBottom","250px");
	}
	else if ($(this).attr("rel") == "icedcoffee") {
		$("#sidebar").css("paddingBottom","100px");
		$("#content2").css("paddingBottom","100px");
	}
	else {
	    $("#sidebar").css("paddingBottom","20px");
		$("#content2").css("paddingBottom","20px");
	}
  });
}
function handleLocations() {
	$(".storesel a").click(function () {
			$(".storesel a").removeClass('boldlabel');
			$(this).addClass('boldlabel');
			var curState = $(this).attr("rel");
			$(".stores").load("loadStores.php", {state: curState});		
			return false;
    }); 
	
	
	
}
function hoverButton(){
	jQuery(".hoverbutton").hover(			   
      function () {
	   jQuery(this).attr({				 
		src: "images/" + this.id + "-on.gif"
		});

      }, 
      function () {
        jQuery(this).attr({ 
		src: "images/" + this.id + "-off.gif"
		});
      }
    );
}