
function upper(word){
	  return word.substr(0,1).toUpperCase() + word.substr(1);
}


var WImages =  {"clear":0,
				"cloudy":1,
				"fog":2,
				"haze":3,
				"most_cloudy":4,
				"na":5,
				"rain":6,
				"snow":7,
				"sprinkles":8,
				"sunny":9,
				"storm":10
				};

// Madang 			http://rss.accuweather.com/rss/liveweather_rss.asp?metric=1&locCode=OCN|PG|PP009|MADANG
  $.jGFeed(escape('http://rss.accuweather.com/rss/liveweather_rss.asp?metric=1&locCode=OCN|PG|PP009|MADANG'),		 
  function(feeds){
    // Check for errors
    if(!feeds){
      // there was an error
      return false;
    }
      var entry = feeds.entries[0].title;
	  
	  var icono;
	  for (var texto in WImages){
		var posicion = entry.indexOf(upper(texto));
		if (posicion != -1){
			icono = texto;
		}
	  }
	  if (icono == ""){
		  icono = "na";
	  }
	  var imagen = "<img src='images/weather/"+icono+".gif' alt='"+icono+"' />"
	  $("#IMadang").html(imagen);

	  $("#madang").html(entry.substr(entry.lastIndexOf(':')+1,3)+"&deg;");
//  }
  }, 1);
// Port Moresby 	http://rss.accuweather.com/rss/liveweather_rss.asp?metric=0&locCode=OCN|PG|PP013|PORT MORESBY		   
  $.jGFeed(escape('http://rss.accuweather.com/rss/liveweather_rss.asp?metric=1&locCode=OCN|PG|PP013|PORT MORESBY'),		 
  function(feeds){
    // Check for errors
    if(!feeds){
      // there was an error
      return false;
    }
      var entry = feeds.entries[0].title;
	  
	  var icono;
	  for (var texto in WImages){
		var posicion = entry.indexOf(upper(texto));
		if (posicion != -1){
			icono = texto;
		}
	  }
	  if (icono == ""){
		  icono = "na";
	  }
	  
	  var imagen = "<img src='images/weather/"+icono+".gif' alt='"+icono+"' />"
	  $("#IMoresby").html(imagen);


	  $("#moresby").html(entry.substr(entry.lastIndexOf(':')+1,3)+"&deg;");
  //  }
  }, 1);
// Lae 				http://rss.accuweather.com/rss/liveweather_rss.asp?metric=1&locCode=OCN|PG|PP012|LAE
  $.jGFeed(escape('http://rss.accuweather.com/rss/liveweather_rss.asp?metric=1&locCode=OCN|PG|PP012|LAE'),		 
  function(feeds){
    // Check for errors
    if(!feeds){
      // there was an error
      return false;
    }
      var entry = feeds.entries[0].title;

	  var icono;
	  for (var texto in WImages){
		var posicion = entry.indexOf(upper(texto));
		if (posicion != -1){
			icono = texto;
		}
	  }
	  if (icono == ""){
		  icono = "na";
	  }
	  
	  var imagen = "<img src='images/weather/"+icono+".gif' alt='"+icono+"' />"
	  $("#ILae").html(imagen);

	  
	  $("#lae").html(entry.substr(entry.lastIndexOf(':')+1,3)+"&deg;");
  //  }
  }, 1);
// Mt Hagen 		http://rss.accuweather.com/rss/liveweather_rss.asp?metric=1&locCode=OCN|PG|PP020|MOUNT HAGEN
  $.jGFeed(escape('http://rss.accuweather.com/rss/liveweather_rss.asp?metric=1&locCode=OCN|PG|PP020|MOUNT HAGEN'),		 
  function(feeds){
    // Check for errors
    if(!feeds){
      // there was an error
      return false;
    }
      var entry = feeds.entries[0].title;

	  var icono;
	  for (var texto in WImages){
		var posicion = entry.indexOf(upper(texto));
		if (posicion != -1){
			icono = texto;
		}
	  }
	  if (icono == ""){
		  icono = "na";
	  }
	  
	  var imagen = "<img src='images/weather/"+icono+".gif' alt='"+icono+"' />"
	  $("#IHagen").html(imagen);

	  
	  $("#hagen").html(entry.substr(entry.lastIndexOf(':')+1,3)+"&deg;");
  //  }
  }, 1);

