var popat="@";
var popend="songlakebooks.com";
var poptail="?subject="+escape("Message from the SongLake Books web");

function gopostal(boxnum) {

var popto="mailto:";
if (boxnum=="web") popto=popto+"Carol"+popat+popend+poptail;
else return;

window.location=popto;
return;
}


/*  book cover code  follows */
  

function sho(image, high)  {
document.getElementById(image).style.display = "block";
document.getElementById(image).style.height = high + "px";
document.getElementById(image).style.top = ("-1.1" * high)+"px";
return;
}

function hid(image) {
document.getElementById(image).style.display = "none";
return;
}




  
/*  kindle stuff follows */


var device = navigator.userAgent.toLowerCase();
// document.writeln(device);
// alert(device);

var kindleAgent = "Mozilla/4.0 (compatible; Linux 2.6.10) NetFront/3.3 Kindle/1.0 (screen 600x800)";
// device = kindleAgent.toLowerCase();

var isKindle = ( ((device.indexOf("kindle")) != -1) || ((device.indexOf("netfront")) != -1) ) ;
// alert(isKindle);

if (isKindle) {
// alert(device);
document.writeln('<link rel="StyleSheet" href="http://www.songlakebooks.com/css/kindle.css" type="text/css">');
}

// alert(isKindle);

/// if (!(isKindle)) {
// alert(device);
// document.writeln('<link rel="StyleSheet" href="http://www.songlakebooks.com/css/notkindle.css" type="text/css">');
// }

  
/* end of kindle stuff */

  
// google analytics stuff  

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-1894174-2']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

// end of google analtics stuff


// external links


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";
 }
}
window.onload = externalLinks;

