/***********************************************
* Controls mouse over for Provincial map
***********************************************/

if (document.images) {
	canada = new Image(355,312);
	canada.src = "images/map/map.jpg";
	ab = new Image(355,312);
	ab.src = "images/map/map_ab.jpg";
	bc = new Image(355,312);
	bc.src = "images/map/map_bc.jpg";
	mb = new Image(355,312);
	mb.src = "images/map/skmbon_map.jpg";
	nb = new Image(355,312);
	nb.src = "images/map/map_nb.jpg";
	nf = new Image(355,312);
	nf.src = "images/map/map_nf.jpg";
	ns = new Image(355,312);
	ns.src = "images/map/map_ns.jpg";
	nt = new Image(355,312);
	nt.src = "images/map/map_nt.jpg";
	nu = new Image(355,312);
	nu.src = "images/map/map_nu.jpg";
	on = new Image(355,312);
	on.src = "images/map/map_on.jpg";
	pe = new Image(355,312);
	pe.src = "images/map/map_pe.jpg";
	qc = new Image(355,312);
	qc.src = "images/map/map_qc.jpg";
	sk = new Image(355,312);
	sk.src = "images/map/skmbon_map.jpg";
	na = new Image(355,312);
	na.src = "images/map/map_na.gif";
}

function changeImage(picture,linkid) {
	//alert(linkid);
	if (linkid != "") {
		document.getElementById(linkid).className='selectedprov';	
	}	
	document.canadamap.src = picture.src; return true;
}
function clearImage(linkid) {
	//alert(linkid);
	if (linkid != "") {
		document.getElementById(linkid).className='';	
	}
	document.canadamap.src = canada.src; return true;
}
function changeRowColour(rowid) {
	document.getElementById(rowid).className='hc';
}
function clearRowColour(rowid,cname) {
	document.getElementById(rowid).className=cname;
}

// ADVANCED SEARCH FEATURES

function basicURL()
{
	var url;
	
	// build the redirection URL
	url = "redir=true";
	url = url + "&cname=" + frmSearch.elements("CompanyName").value;
	url = url + "&cty=" + frmSearch.elements("City").value;
	url = url + "&prov=" + frmSearch.elements("province").options[frmSearch.elements("province").selectedIndex].value;
	url = url + "&region=" + frmSearch.elements("RegionID").options[frmSearch.elements("RegionID").selectedIndex].value;
	url = url + "&country=" + frmSearch.elements("CountryID").options[frmSearch.elements("CountryID").selectedIndex].value;
	url = url + "&industry=" + frmSearch.elements("ServiceID").options[frmSearch.elements("ServiceID").selectedIndex].value;
	url = url + "&service=" + frmSearch.elements("service_perindustry").options[frmSearch.elements("service_perindustry").selectedIndex].value;
	
	return url;
}

function refresh()
{
	var url;
	url = basicURL();
	
	window.location = "index.asp?" + url;
}