if($.cookie("css")) {
   $("link").attr("href", $.cookie("css"));
}

$(function () {
   $("#cssMenu a").click(function() {
      $("link").attr("href", $(this).attr('rel'));
      $.cookie("css", $(this).attr('rel'), {expires: 0, path: '/'});
      return false;
   });

   $("a#cssMenu").click(function() {
      $("link").attr("href", $(this).attr('rel'));
      $.cookie("css", $(this).attr('rel'), {expires: 0, path: '/'});
      return false;
   });

   if ($(window).width()<770 ||
       navigator.userAgent.match(/Android/i) ||
       navigator.userAgent.match(/webOS/i) ||
       navigator.userAgent.match(/iPhone/i) ||
       navigator.userAgent.match(/iPod/i)
   ){
     $("#dinky").html("<h1>Mobile button here</h1>");
   }
/*
   $("#fred").html( $(window).width() );

   if ($(window).width()<770 ||
       navigator.userAgent.match(/Android/i) ||
       navigator.userAgent.match(/webOS/i) ||
       navigator.userAgent.match(/iPhone/i) ||
       navigator.userAgent.match(/iPod/i)
   ){
       document.location.href = 'mob.html';
   } else {
       document.location.href = 'index.shtml';
   }
*/

   $(".pagetab").click( function() {
      var tmp = $(this).attr("ref");
      /*alert("-"+tmp+"-");*/
      $("div.subpage").hide();
      $("div#"+tmp).show();

/* ====== set the tab to look unselected ======== */

      $("a.selected").toggleClass("selected");

/* ====== set the tab to look selected ==== */

      $(this).toggleClass("selected");

      return false;
   });
});

