/* Site Configurations */
var branding = {
	alertsLink : "/category/208682/weatheralerts",
	closingsLink : "/category/211229/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: 'Saginaw',  zipCode: '48601'},
  {name: 'Midland',  zipCode: '48640'},
  {name: 'Bay City', zipCode: '48706'},
  {name: 'Flint',    zipCode: '48706'}
];

// Old station list, for backwards compatibility
var wxStations = new Array();
wxStations[0] = new Array("http://data.wp.myweather.net/eWxII/?data=*48601", "Saginaw");
wxStations[1] = new Array("http://data.wp.myweather.net/eWxII/?data=*48640", "Midland");
wxStations[2] = new Array("http://data.wp.myweather.net/eWxII/?data=*48706", "Bay City");
wxStations[3] = new Array("http://data.wp.myweather.net/eWxII/?data=*48706", "Flint");	    

/* 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=9844";
	}
	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=9853";
	}
	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=9845";
	}
	else if((wng_pageInfo.contentClassification === 'Food Recipe')){
		vibSrc = "http://meredithtv.us.intellitxt.com/intellitxt/front.asp?ipid=9846";
	}
	else if((wng_pageInfo.contentClassification === 'Health')){
		vibSrc = "http://meredithtv.us.intellitxt.com/intellitxt/front.asp?ipid=9848";
	}
	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=9849";
	}
	else if((wng_pageInfo.contentClassification === 'Sales - Finance')){
		vibSrc = "http://meredithtv.us.intellitxt.com/intellitxt/front.asp?ipid=9847";
	}
	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=9843";
	}
	else if((wng_pageInfo.contentClassification.indexOf('Sport') != -1)){
		vibSrc = "http://meredithtv.us.intellitxt.com/intellitxt/front.asp?ipid=9850";
	}
	else if((wng_pageInfo.contentClassification === 'Technology')){
		vibSrc = "http://meredithtv.us.intellitxt.com/intellitxt/front.asp?ipid=9851";
	}
	else if((wng_pageInfo.contentClassification.indexOf('Traffic') != -1) || (wng_pageInfo.contentClassification.indexOf('Travel') != -1)){
		vibSrc = "http://meredithtv.us.intellitxt.com/intellitxt/front.asp?ipid=9852";
	}
}

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