/* Site Configurations */
var branding = {
	alertsLink : "/category/208628/weatheralerts",
	closingsLink : "/category/210164/school-closings",
	logoLink : "/weather"
}

/* COMMON WEATHER */
var wxCache = {};
function fetchWxFeed(i, callback) {
  if (wxCache[i] !== undefined) {
    callback(wxCache[i], i);
    return;
  }

  var wxBase = 'http://data.wp.myweather.net/eWxII/?data=*{STATION}';
  var url = wxBase.replace('{STATION}', wxLocations[i].zipCode);
  WNHttpRequestManager.makeRequest(url, {
    onSuccess: function() {
      wxCache[i] = this.response.responseXML;
      callback(this.response.responseXML, i);
    },
    onError: function() {}
  });
}

var wxLocations = [
  {name: 'Portland',   zipCode: '97201'},
  {name: 'Kelso',      zipCode: '98626'},
  {name: 'Hillsboro',  zipCode: '97123'},
  {name: 'Troutdale',  zipCode: '97060'},
  {name: 'Salem',      zipCode: '97303'}
];

// Old station list, for backwards compatibility
var wxStations = new Array();
wxStations[0] = new Array("http://data.wp.myweather.net/eWxII/?data=*97201", "Portland");
wxStations[1] = new Array("http://data.wp.myweather.net/eWxII/?data=*98626", "Kelso");
wxStations[2] = new Array("http://data.wp.myweather.net/eWxII/?data=*97123", "Hillsboro");
wxStations[3] = new Array("http://data.wp.myweather.net/eWxII/?data=*97060", "Troutdale");
wxStations[4] = new Array("http://data.wp.myweather.net/eWxII/?data=*97303", "Salem");

/* Vibrant Ad Tags */
if(wng_pageInfo.containerType === 'S'){
	var vibSrc = "";
	if(wng_pageInfo.contentClassification === 'Auto'){
		vibSrc = "http://meredithtv.us.intellitxt.com/intellitxt/front.asp?ipid=7001";
	}
	else if((wng_pageInfo.contentClassification === 'Community') || (wng_pageInfo.contentClassification === 'Community - Calendar') || (wng_pageInfo.contentClassification === 'Community - Events') || (wng_pageInfo.contentClassification === 'Education')){
		vibSrc = "http://meredithtv.us.intellitxt.com/intellitxt/front.asp?ipid=7021";
	}
	else if((wng_pageInfo.contentClassification === 'Entertainment') || (wng_pageInfo.contentClassification === 'Entertainment - Interview') || (wng_pageInfo.contentClassification === 'Entertainment - Music')){
		vibSrc = "http://meredithtv.us.intellitxt.com/intellitxt/front.asp?ipid=7003";
	}
	else if((wng_pageInfo.contentClassification === 'Food Recipe')){
		vibSrc = "http://meredithtv.us.intellitxt.com/intellitxt/front.asp?ipid=7014";
	}
	else if((wng_pageInfo.contentClassification === 'Health')){
		vibSrc = "http://meredithtv.us.intellitxt.com/intellitxt/front.asp?ipid=7016";
	}
	else if((wng_pageInfo.contentClassification === 'Sales - Home and Garden') || (wng_pageInfo.contentClassification === 'Sales - Home Garden-New Home') || (wng_pageInfo.contentClassification === 'Sales - Home Garden-Plumbing') || (wng_pageInfo.contentClassification === 'Sales - Home Garden-Real Estate') || (wng_pageInfo.contentClassification === 'Sales - Home Garden-Remodeling') || (wng_pageInfo.contentClassification === 'Sales - Home Garden-Roofing') || (wng_pageInfo.contentClassification === 'Sales - Home Garden-Security') || (wng_pageInfo.contentClassification === 'Sales - Home Garden-Windows')){
		vibSrc = "http://meredithtv.us.intellitxt.com/intellitxt/front.asp?ipid=7017";
	}
	else if((wng_pageInfo.contentClassification === 'Sales - Finance')){
		vibSrc = "http://meredithtv.us.intellitxt.com/intellitxt/front.asp?ipid=7015";
	}
	else if((wng_pageInfo.contentClassification.indexOf('News') != -1) || (wng_pageInfo.contentClassification.indexOf('Political') != -1) || (wng_pageInfo.contentClassification.indexOf('Station') != -1) || (wng_pageInfo.contentClassification.indexOf('Weather') != -1)){
		vibSrc = "http://meredithtv.us.intellitxt.com/intellitxt/front.asp?ipid=7000";
	}
	else if((wng_pageInfo.contentClassification.indexOf('Sport') != -1)){
		vibSrc = "http://meredithtv.us.intellitxt.com/intellitxt/front.asp?ipid=7018";
	}
	else if((wng_pageInfo.contentClassification === 'Technology')){
		vibSrc = "http://meredithtv.us.intellitxt.com/intellitxt/front.asp?ipid=7019";
	}
	else if((wng_pageInfo.contentClassification.indexOf('Traffic') != -1) || (wng_pageInfo.contentClassification.indexOf('Travel') != -1)){
		vibSrc = "http://meredithtv.us.intellitxt.com/intellitxt/front.asp?ipid=7020";
	}
}

/* Meredith Shared Code */
document.write('<scr' + 'ipt type="text/javascript" src="http://ftpcontent.worldnow.com/meredith/custom/custom-master.js"><\/scr' + 'ipt>');
