$(document).ready(function(){ //Email address obfuscation $("a.email").each(function(){ e = this.rel.replace("/","@"); this.href = "mailto:"+e; $(this).text(e); }); //Open link in new window $("a.external").click(function(){ window.open(this.href); return false; }); //Image rollovers $(".rollover").hover( function(){ if($(this).attr("src").indexOf("-over")==-1) { var newSrc = $(this).attr("src").replace(".gif","-over.gif"); newSrc = newSrc.replace(".png","-over.png"); $(this).attr("src",newSrc); } }, function(){ if($(this).attr("src").indexOf("-over")!=-1) { var oldSrc = $(this).attr("src").replace("-over.gif",".gif"); oldSrc = oldSrc.replace("-over.png",".png"); $(this).attr("src",oldSrc); } } ); //Define default text for each text field $(".input-text").each ( function() { this.rel=this.value; } ); $(".input-text").focus(function() { if (this.value==this.rel) { this.value=''; } }); $(".input-text").blur(function() { if (this.value=='') { this.value=this.rel; } }); //Table zebra striping $("#details-left table tr:odd, #details table tr:odd, #listings table tr:odd, #equipment table tr:odd, #service-info table tr:odd").addClass("alt"); $("#details-left table tbody tr, #details table tbody tr, #listings table tbody tr").each( //Define default row class function() { $(this).attr("rel",$(this).attr("class")); } ); $("#listings table tbody tr, #details table tbody tr").hover( //Table row mouseover function(){ $(this).attr("class","high"); }, function(){ $(this).attr("class",$(this).attr("rel")); } ); $("#listings table tbody tr, , #details table tbody tr").click( //Table row click event function(){ var $link=$("a:first",this).attr("href"); window.location.href=$link; } ); //Gallery images $("#gallery ul li a img").click( function() { var imagePath=($(this).attr("rel")); var imageAlt=($(this).attr("alt")); var imageId=imageAlt.charAt(imageAlt.length - 1); document.getElementById('main_image_id').value = imageId; $("#gallery img#large").attr("src",imagePath); var targetPhoto = ($(this).parent().attr("href")); if ($(this).parent().attr('rel')=='large') { $("#large-link").attr("rel", 'large'); $("#large-link").attr("href", targetPhoto); } else { $("#large-link").attr("rel", ''); $("#large-link").attr("href", '#'); } return false; } ); //Override back buttons $("#details-top ul li.back a.jsback").click( function() { history.back(); return false; } ); //Load rollover buttons jQuery.preLoadImages("/images/buttons/292-red-over.gif","/images/buttons/235-red-greybg-over.gif","/images/buttons/235-red-darkgreybg-over.gif","/images/buttons/244-red-greybg-over.gif","/images/buttons/183-red-greybg-over.gif","/images/buttons/175-red-over.gif","/images/buttons/305-red-over.gif","/images/buttons/115-red-over.gif","/images/buttons/144-red-over.gif","/images/buttons/235-red-over.gif","/images/buttons/209-red-over.gif"); }); (function($) { var cache = []; // Arguments are image paths relative to the current page. $.preLoadImages = function() { var args_len = arguments.length; for (var i = args_len; i--;) { var cacheImage = document.createElement('img'); cacheImage.src = arguments[i]; cache.push(cacheImage); } } })(jQuery) function e(s){s.options.length=0};function gv(f){v=null;if(f.options){if(f.selectedIndex>-1)value=f.options[f.selectedIndex].value}else{if(f.length){for(var b=0;b