$(document).ready(function() {

  // main nav: background animation
  $('#mainnav a.link').css({backgroundPosition: "0 0"})
    .mouseover(function(){
      $(this).stop().animate( {backgroundPosition:"(0 54px)"}, {duration:300}) })
    .mouseout(function(){
      $(this).stop().animate( {backgroundPosition:"(0 0)"}, {duration:300}) })
			
  // topic boxes: expand/contract
  $('ul#topics').kwicks({ max:250, duration:400, spacing:15 }); 
	
  // topic boxes: background animation
  $('ul#topics a').css({backgroundPosition: "0 200px"})
    .mouseover(function(){
      $(this).stop().animate( {backgroundPosition:"(0 0)"}, {duration:300}) })
    .mouseout(function(){
      $(this).stop().animate( {backgroundPosition:"(0 200px)"}, {duration:300}) })
	
  /*
  // Contact ad -- load only once per browser session? (0=no, 1=yes)
  var once_per_session=1;

  function get_cookie(Name) {
    var search = Name + "="
    var returnvalue = "";
    if (document.cookie.length > 0) {
      offset = document.cookie.indexOf(search)
      if (offset != -1) { // if cookie exists
        offset += search.length
        // set index of beginning of value
        end = document.cookie.indexOf(";", offset);
        // set index of end of cookie value
        if (end == -1)
           end = document.cookie.length;
        returnvalue=unescape(document.cookie.substring(offset, end))
        }
     }
    return returnvalue;
  }
  function loadornot(){
    if (get_cookie('contactad')==''){
      loadcontactad()
      document.cookie="contactad=yes"
    }
  }
  function loadcontactad(){
    $("#contact_popup").fadeIn();
    $("#trans_overlay").fadeIn();
  }
  if (once_per_session==0)
  loadpopunder()
  else
  loadornot()
  */
	
});
