function sendMessage(form){url='/actions/sendMessage.php';var jokeAjax=new Ajax.Updater('emailform',url,{asynchronous:true,evalScripts:true,parameters:Form.serialize(form)});return false;}
function showBookInfo(amazonid)
{}
function old()
{url="/actions/getAmazonInfo.php";pars="&id="+amazonid;var rateUpAjax=new Ajax.Updater('bookinfo',url,{method:'post',onComplete:function(request){new Tooltip('amazon-'+amazonid,'bookinfo')},parameters:pars});}
var b=window,c=document,f=false;function _click(d)
{var a="status=0,scrollbars=0,menubar=0,statusbar=0,resizable=1, width=300,height=500,location="+
(h()?"1":"0");b.open(d,"",a)}
function h(){if(b.ActiveXObject&&b.XMLHttpRequest){return false}return true};function launchChat(link){$('<div id="chat-frame-wrapper"><a class="close" title="close"></a><iframe id="chat-frame"></iframe></div>').appendTo('body');$('#chat-frame').attr('src',$(link).attr('href'));$('#chat-frame-wrapper .close').bind('click',function(){$('#chat-frame-wrapper').remove();});}
$(document).ready(function(){$('#chat-link').bind('click',function(){launchChat(this);return false;});$('#chat-link2').bind('click',function(){launchChat(this);return false;});$("#contact_submit").click(function(){$(".error").hide();var hasError=false;var emailReg=/^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;var emailFromVal=$("#emailFrom").val();if(emailFromVal==''){$("#emailFrom").after('<span class="error">You forgot to enter the email address to send from.</span>');hasError=true;}else if(!emailReg.test(emailFromVal)){$("#emailFrom").after('<span class="error">Enter a valid email address to send from.</span>');hasError=true;}
var messageVal=$("#message").val();if(messageVal==''){$("#message").after('<span class="error">You forgot to enter the message.</span>');hasError=true;}
if(hasError==false){$(this).hide();$("#sendEmail").html('<img src="/imgs/loading.gif" alt="Loading" id="loading" />');$.post("/actions/sendMessage.php",{email:emailFromVal,message:messageVal},function(data){$("#sendEmail").slideUp("normal",function(){$("#sendEmail").before('<h1>Thanks for the message.</h1>');});});}
return false;});var use_keys=true;if(typeof colorbox!='undefined'){$(".flickr_images").colorbox({rel:'flickr_images',transition:"none",onOpen:function(){use_keys=false;},onClosed:function(){use_keys=true;}});}
if(typeof keyboard_nav=='undefined'){keyboard_nav=false;}
if(keyboard_nav){var k=new Kibo();k.down(['left'],function(){if(use_keys){if(typeof prev_location!='undefined'){window.location=prev_location;}}}).up('right',function(){if(use_keys){if(typeof next_location!='undefined'){window.location=next_location;}}});}});var showing=0;$("#headerimg").mouseenter(function(){if(showing==0){showing=1;$("#headerimg_attr").show("blind",function(){showing=0;},500);}});$("#headerimg").mouseleave(function(){if(showing==0){showing=1;$("#headerimg_attr").hide("blind",function(){showing=0;},1500);}});
