function swapImage(image,description,height,width) { newimage = image; new Effect.Fade('mainimage', { duration: 0.5, afterFinish: function() { new Effect.Morph('mainimagecontainer', { duration: 0.5, style: 'height: ' + height + 'px; width: ' + width + 'px;', afterFinish: function() { $('mainimage').src = newimage; wait = setTimeout("new Effect.Appear('mainimage', { duration: 0.5 });",1500); $('mainimage').setAttribute("width",width); $('mainimage').setAttribute("height",height); } }); new Effect.Morph('maindescription', { duration: 0.5, style: 'width: ' + (width - 10) + 'px;' }); } }); $('maindescription').innerHTML = description; } function swapSoldImage(image,description,height,width) { newimage = image; new Effect.Parallel([ new Effect.Fade('mainimage'), new Effect.Fade('soldflag')], { duration: 0.5, afterFinish: function() { new Effect.Morph('mainimagecontainer', { duration: 0.5, style: 'height: ' + height + 'px; width: ' + width + 'px;', afterFinish: function() { $('mainimage').src = newimage; $('mainimage').setAttribute("width",width); $('mainimage').setAttribute("height",height); wait = setTimeout("new Effect.Appear('mainimage', { duration: 0.5 }); new Effect.Appear('soldflag', { duration: 0.5 });",500); } }); new Effect.Morph('maindescription', { duration: 0.5, style: 'width: ' + (width - 10) + 'px;' }); } }); $('maindescription').innerHTML = description; } $$(".email_forward").each(function(el) { Event.observe(el,"click",emailIt); }); function emailIt() { el = $("emailLink"); offset = el.cumulativeOffset(); new Ajax.Request("http://realestate.alexcooper.com/ajax/forward_to_friend.php?left=" + offset[0] + "&top=" + offset[1] + "&id=" + el.name, { evalScripts: true }); } function emailForward(id) { var name = $("ftf_name").value; if (name == "") { alert("You must enter your name."); return false; } var email = $("ftf_email").value; if (email == "") { alert("You must enter your email address."); return false; } var fname = $("ftf_fname").value; if (fname == "") { alert("You must enter your friend's name."); return false; } var femail = $("ftf_femail").value; if (femail == "") { alert("You must enter your friend's email address."); return false; } var fnotes = $("ftf_notes").value; if (fnotes == "") { alert("You must enter a note for your friend."); return false; } new Ajax.Request("http://realestate.alexcooper.com/ajax/forward_to_friend.php?id=" + id + "&email=" + escape(email) + "&femail=" + escape(femail) + "&name=" + escape(name) + "&fname=" + escape(fname) + "¬es=" + escape(fnotes), { evalScripts: true }); return false; }