// Anti-spam
// To use this, use an image link with the link as:
// <A HREF="javascript:mail_it()">

function mail_it()
{
parent.location="mailto:"+"Commander"+"@"+"SpaceshipsOfEzekiel.com"
}


// This preloads images used for swaps on mouseover
// I question whether this is useful. Swaps work without it.
// On a given page it is unlikely the reader will click a tab.

function preloads(color)
{ 
if (color == ""){
    return;
  }

if (color == "sky"){
  preload_img(false,
    "../images/t_home-sky.gif",
    "../images/t_index-sky.gif",
    "../images/t_intro-sky.gif",
    "../images/t_bible-sky.gif",
    "../images/t_faq-sky.gif",
    "../images/t_email-sky.gif",
    "../images/t_site_map-sky.gif");
    return;
  }

if (color == "yel"){
  preload_img(false,
    "../images/t_home-yel.gif",
    "../images/t_index-yel.gif",
    "../images/t_intro-yel.gif",
    "../images/t_bible-yel.gif",
    "../images/t_faq-yel.gif",
    "../images/t_email-yel.gif",
    "../images/t_site_map-yel.gif");
    return;
  }

if (color == "com"){
  preload_img(false,
    "../images/t_home-blu.gif",
    "../images/t_index-blu.gif",
    "../images/t_intro-blu.gif",
    "../images/t_bible-blu.gif",
    "../images/t_faq-blu.gif",
    "../images/t_email-blu.gif",
    "../images/t_site_map-blu.gif");
    return;
  }
}

function hue(num)
{
return "#cc00cc" ;
}


// This prloads images for faster swaps on mouseover
function preload_img()
{ 
  var img_list = preload_img.arguments;
  if (document.preloadlist == null) 
    document.preloadlist = new Array();
  var top = document.preloadlist.length;
  for (var i=0; i < img_list.length; i++) {
    document.preloadlist[top+i] = new Image;
    document.preloadlist[top+i].src = img_list[i+1];
  } 
}

function change_img_src(name, nsdoc, rpath, preload)
{ 
  var img = eval((navigator.appName.indexOf('Netscape', 0) != -1) ? nsdoc+'.'+name : 'document.all.'+name);
  if (name == '')
    return;
  if (img) {
    img.altsrc = img.src;
    img.src    = rpath;
  } 
}

function restore_img_src(name, nsdoc)
{
  var img = eval((navigator.appName.indexOf('Netscape', 0) != -1) ? nsdoc+'.'+name : 'document.all.'+name);
  if (name == '')
    return;
  if (img && img.altsrc) {
    img.src    = img.altsrc;
    img.altsrc = null;
  } 
}


// Opens URL in a new window

function open_window(name, url, left, top, width, height, toolbar, menubar, statusbar, scrollbar, resizable)
{
  toolbar_str = toolbar ? 'yes' : 'no';
  menubar_str = menubar ? 'yes' : 'no';
  statusbar_str = statusbar ? 'yes' : 'no';
  scrollbar_str = scrollbar ? 'yes' : 'no';
  resizable_str = resizable ? 'yes' : 'no';

  cookie_str = document.cookie;
  cookie_str.toString();

  pos_start  = cookie_str.indexOf(name);
  pos_end    = cookie_str.indexOf('=', pos_start);

  cookie_name = cookie_str.substring(pos_start, pos_end);

  pos_start  = cookie_str.indexOf(name);
  pos_start  = cookie_str.indexOf('=', pos_start);
  pos_end    = cookie_str.indexOf(';', pos_start);
  
  if (pos_end <= 0) pos_end = cookie_str.length;
  cookie_val = cookie_str.substring(pos_start + 1, pos_end);
  if (cookie_name == name && cookie_val  == "done")
    return;

  window.open(url, name, 'left='+left+',top='+top+',width='+width+',height='+height+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str);
}

function googleTranslateElementInit()
 {
  new google.translate.TranslateElement({pageLanguage: 'en',
    layout: google.translate.TranslateElement.InlineLayout.SIMPLE},
	'google_translate_element');
}
