function checkSearch() {
  if (document.getElementById && document.getElementById('mainsearch').value=="") {
    alert("First enter some words to search for, yo.");
    document.getElementById('mainsearch').focus();
    return false;
  } else {
    return true;
  }
}

function faves() {
  if (document.all && navigator.userAgent.indexOf("Opera")==-1) {
  document.write("<a href=\"javascript:window.external.addfavorite('http://www.yourhtmlsource.com','HTMLSource: HTML Tutorials');\" class=\"nav\">Add HTMLSource to your favorites!</a><br />");
  } else {
      if (navigator.appVersion.toLowerCase().indexOf("mac") != -1) {    
          document.write("Press &#8984;D to add HTMLSource to your bookmarks!");
    } else {
        document.write("Press Ctrl+D to add HTMLSource to your bookmarks!");
    }
  }
}

function createCookie(name,value,days) {
  if (days) {
    var date = new Date();
    date.setTime(date.getTime()+(days*24*60*60*1000));
    var expires = "; expires="+date.toGMTString();
  }
  else expires = "";
  document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
  var nameEQ = name + "=";
  var ca = document.cookie.split(';');
  for(var i=0;i < ca.length;i++) {
    var c = ca[i];
    while (c.charAt(0)==' ') c = c.substring(1,c.length);
    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
  }
  return null;
}

/**
 * Move the AdSense skyscraper ad into the right gutter, between the wrapper
 * edge and the scrollbar.
 
position_adsense_skyscraper = function() {
  var viewportwidth = YAHOO.util.Dom.getViewportWidth();
  var usefulwidth = Math.ceil((viewportwidth - 780) / 15) - 8;
  var adblock = YAHOO.util.Dom.get('adsense-side');

  // Only move the ad into the side gutter if we have space. 
  if (viewportwidth > 1160) {
    YAHOO.util.Dom.setStyle(adblock, 'position', 'fixed');
    YAHOO.util.Dom.setStyle(adblock, 'top', '90px');
    YAHOO.util.Dom.setStyle(adblock, 'right', usefulwidth + 'px');
  } else {
    YAHOO.util.Dom.setStyle(adblock, 'position', 'static');
  }
}

YAHOO.util.Event.on(window, 'load', position_adsense_skyscraper, null, false);
YAHOO.util.Event.on(window, 'resize', position_adsense_skyscraper, null, false);

*/
window.onload = function() {
  window.defaultStatus="HTMLSource: HTML Tutorials, just for you.";
}
