/*!
 * Vulpine Library v0.1.5
 * http://vulpine.mobi/
 *
 * Copyright (c) 2009 Tom Rush 
 *
 * Date: 2008-04-09 21:45:13 -0500 (Wed, 09 Apr 2008)
 * Revision: 4
 */

var w3c = false, isIe = false, isIe6 = false, isIe7 = false, isIe8 = false, isMobile = false, xd9 = "", d = document, w = window, wd = 0;

// Retrieve screen width including mobile phones.
wd = parseInt(( screen.availWidth ) ? screen.availWidth : (( screen.width
 ) ? screen.width : 0 ));

// Identify W3C browsers
w3c = ( w.addEventListener ) ? true : false;

// Disable any No JavaScript messages
//clearNoscript();

// Define desktop client browser specifics.
if ( d.getElementsByTagName && wd > 799 ) {
 var isXhr = ( typeof window.XMLHttpRequest == "undefined" ) ? false : true;
 if (!w3c) {
  isIe = true;
  isIe6 = ( w.external && !isXhr ) ? true : false;
  isIe7 = ( isXhr && (typeof HTMLDocument == "undefined" )) ? true : false;
  isIe8 = ( isXhr && (typeof HTMLDocument != "undefined" )) ? true : false;
  //$importJS('/js/script2009.js');
  //if(isIe6) { $importJS('http://www.letterland.jp/js/javascriptIE6.js'); }
  if(isIe6){
    $importCSS('http://www.letterland.jp/css/letterlandIE6.css');
  }
  if(isIe7) { $importCSS('/css/letterlandIE7.css'); }
  if(isIe8) { $importCSS('/css/letterlandIE8.css'); }
 }
 //else{$importCSS('/css/letterlandCSS3.css');}

 // Define HTML5 for those that don't have it.
 if(!!document.createElement('canvas').getContext==false){html5();}
}

// Load Dynamic JavaScript
function $importJS(src) {
 var sem = d.createElement('script');
 sem.setAttribute('src', src);
 sem.setAttribute('type', 'text/javascript');
 d.getElementsByTagName('head')[0].appendChild(sem);
}

// Load dynamic CSS
function $importCSS(src) {
 var cem = d.createElement('link');
 cem.setAttribute('href', src);
 cem.setAttribute('type', 'text/css');
 cem.setAttribute('rel', 'stylesheet');
 d.getElementsByTagName('head')[0].appendChild(cem);
}

// Wait for page load before initiating 
function addLoadEvent(func) { 
  var oldonload = w.onload; 
  if (typeof w.onload != 'function') { 
    w.onload = func; 
  } else { 
    w.onload = function() {
      oldonload(); 
      func(); 
    } 
  } 
} 

// Remove and hide any No JavaScript messages.
function clearNoscript() {
  addLoadEvent(function() { 
    var ns = d.getElementById('noscript');
    if (ns != null&&ns) {
      ns.style.visible = "hidden";
      ns.style.display = "none";
    }
  });
}

function supportsValidity(){
  var i = document.createElement('input');
  return typeof i.email === 'object'
}

function html5(){
// For discussion and comments, see: http://remysharp.com/2009/01/07/html5-enabling-script/
(function(){if(!/*@cc_on!@*/0)return;var e = "abbr,article,aside,audio,canvas,datalist,details,eventsource,figure,footer,header,hgroup,mark,menu,meter,nav,output,progress,section,time,video".split(','),i=e.length;while(i--){document.createElement(e[i])}})()
}
