$(document).ready( function() { 

  // apply to all png images 
  $('img#logo').ifixpng(); 
  $('div#intro').ifixpng(); 
  $('div.entrance h2').ifixpng(); 


  // open external links in new windows
  jQuery("a[href^='http:']").not("[href*='www.listentotheworld.se']").attr({
    target: "_blank", 
    title: "Opens in a new window"
  });
  

  // opens all links with class="external" in new window
  $('a.external').click( function() { 
    window.open(this.href);  
    return false; 
  }); 
  

  // hide subscription form on page load
  $('#subscribeform').hide();


  // show/hide subscription form on click
  $('#subscribe').click( function() { 
      $('#subscribeform').fadeIn(1000);
  }); 
  $('#subscribeclose').click( function() { 
      $('#subscribeform').fadeOut(500);
      return false;
  }); 


  // change city on news page 
  if ($("#city")) {
    $("#city").change(function() {
       document.location.href = $("#city").val();
    });
  }                       


  // hover effects on start page
  $(".city").mouseover(function() {
    $(this).children("*").children("a").css("color", "#C4D532");
  });
  $(".city").mouseout(function() {
    $(this).children("h1").children("a").css("color", "#fff");
    $(this).children("p").children("a").css("color", "#fff");
  });

  $(".entrance").mouseover(function() {
    $(this).children("*").children("a").css("color", "#C4D532");
  });
  $(".entrance").mouseout(function() {
    $(this).children("h2").children("a").css("color", "#fff");
  });

  $("#home #text li").mouseover(function() {
    $(this).children("*").children("a").css("color", "#C4D532");
  });
  $("#home #text li").mouseout(function() {
    $(this).children("h3").children("a").css("color", "#fff");
    $(this).children("p").children("a").css("color", "#fff");
  });
  

  // hover effetcs on city pages
  $(".item").mouseover(function() {
    $(this).children("*").children("a").css("color", "#C4D532");
  });
  $(".item").mouseout(function() {
    $(this).children("h3").children("a").css("color", "#fff");
    $(this).children("p").children("a").css("color", "#fff");
  });

}); 