IBSYS.using('widgets');

IBSYS.widgets.election08 = {
	init: function(el, config) {
		IBSYS.ad.AdManager.setEventMapping('automatedElectionRefresh', {
			mapping: [
			{
				Strategy: {
					Name: "Dart"
				},
				Rules: [{
					expect: "DOM",
					check: {position: "type"},
					Type: "CheckValue"
				},{
					Type: 'adPositionSizeIn',
					sizes: '300x250,160x600,728x90'
				}]
			}]
		});
		
		IBSYS.ad.AdManager.setEventMapping('electionDropDownChanged', {
			mapping: [
			{
				Strategy: {
					Name: "Dart"
				},
				Rules: [{
					expect: "DOM",
					check: {position: "type"},
					Type: "CheckValue"
				},{
					Type: 'adPositionSizeIn',
					sizes: '300x250,160x600,728x90'
				}]
			}]
		});
		IBSYS.application.Application.addEventListener(this.onIBEvent, this);
		IBSYS.media.genericFlash2.init(el, config);
	},
	
	onIBEvent: function(e) {
		switch(e.getName()) {
			case 'automatedElectionRefresh':
				dcsMultiTrack('DCSext.ib_event_name', 'refresh');
			break;
			case 'electionDropDownChanged':
				dcsMultiTrack('DCSext.ib_event_name', 'pulldown');
			break;
		}
	}
};
