﻿var hrefPrefix = 'http://www.';
var https_prefix = 'https://';

// top level domains
var tld = new Array();
tld[0] = '.org';
tld[1] = '.com';			
tld[2] = '.ca';			
tld[3] = '.on' + tld[2];
tld[4] = '.net';
tld[5] = '.gov' + tld[3];

// array that contains a list of link hrefs
var links = new Array();
links[0] = hrefPrefix + 'bbb' + tld[0];											// better business bureau
links[1] = hrefPrefix + 'camhydro' + tld[1];									// cambridge & north dumfires hydro
links[2] = hrefPrefix + 'city.kitchener' + tld[3];								// city of kitchener
links[3] = hrefPrefix + 'eda-on' + tld[2];										// electricity distributors association
links[4] = hrefPrefix + 'esainspection' + tld[4];								// electrical safety authority
links[5] = https_prefix + 'utilismartcorp.utilismart' + tld[1];					// interval data (utilismart)
links[6] = hrefPrefix + 'atrianetworks' + tld[1];								// Atria Networks
links[7] = hrefPrefix + 'greaterkwchamber' + tld[1];							// greater kitchener-waterloo chamber of commerce
links[8] = hrefPrefix + 'theimo' + tld[1];										// independent electricity market operator
links[9] = hrefPrefix + 'mei' + tld[5];		                            		// ontario ministry of energy
links[10] = hrefPrefix + 'ontarioenergyboard' + tld[2];										// ontario energy board
links[11] = hrefPrefix + 'region.waterloo' + tld[3];							// regional municipality of waterloo
links[12] = hrefPrefix + 'wilmot' + tld[2];										// township of wilmot
links[13] = hrefPrefix + 'wnhydro' + tld[1];									// waterloo north hydro
links[14] = hrefPrefix + 'thechildrensmuseum' + tld[2];							// waterloo regional children's museum
links[15] = hrefPrefix + 'energyshop' + tld[1];									// energyshop
links[16] = hrefPrefix + 'cleanairfoundation' + tld[0];							// clean air foundation
links[17] = hrefPrefix + 'powerauthority' + tld[3];								// ontario power authority

function GoToLink(id, target) {
	// make sure we have a valid id number
	if ((id > -1) && (id < 18)) {
		// if the user didnt pass a target then we assume its _self
		if (target == '') {
			top.location.href = links[id];
		} else if (target == '_blank') {
			oWin.open(links[id]);
		} else {
			target.location.href = links[id];
		}
	}
}


