
(function($) {
 
$(function() {
		 var imgPath = '/img/motels/';
		 var buttons = [
			"search-button"
			,"signup-button"
		 ];
		 for(i=0;i<buttons.length;i++){
				if($('#'+buttons[i])){
					$('#'+buttons[i]).hover(function() {
						 $(this).attr('src', imgPath+$(this).attr('id')+'-over.png');
						 }, function() {
						 $(this).attr('src', imgPath+$(this).attr('id')+'.png');
						 });
				};
		 };
});
/*-------------------------------------------------------------------------*/
function wipe(el) {
	if($(el).attr('value') == $(el).attr('title')) $(el).attr('value','');
}})(jQuery);
/*-------------------------------------------------------------------------*/
function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") &&
       anchor.getAttribute("rel") == "external")
     anchor.target = "_blank";
 }
}
/*-------------------------------------------------------------------------*/
function generateEmailLink(n,d) {
	var username = n;
	var hostname = d;
	var linktext = n+"@"+d;
	document.write("<a hr"+"ef=" + "mai"+"l" + "to:" + username +
	"@" + hostname + ">" + linktext + "</"+"a>")
}