
function tabbing_skin_85141(super_cat_ids,super_titles,onclickcode)
{
	var defaultCity = "Auckland";		// ** the DEFAULT city ***
	var cities = new Array();			// set up a multi-dimensional array
	
	// remove trailing spaces
	for(var i=0; i<super_titles.length;i++)
	{
		super_titles[i] = super_titles[i].trim();
	}
	
	for(var i=0; i < super_cat_ids.length; i++)
	{
		cities[i] = {name: super_titles[i]}; //, id:super_cat_ids[i]};
	}
	cities.sort(function(a,b)
	{ 
		var x = a.name.toLowerCase();
		var y = b.name.toLowerCase();
		return ((x < y) ? -1 : ((x > y) ? 1 : 0));
	}
	);
	var dropdown;
	dropdown = "<select id=\"cat_hl_85141_ddl\" onchange=\"this.id=this.options[this.selectedIndex].value;" + onclickcode + ";\">";
	if (super_cat_ids) 
	{
		for (var i=0;i<cities.length;i++) 
		{
			var id;
			var index;
			for(var j=0;j<super_titles.length;j++) 
			{
				if(super_titles[j] == cities[i].name) 
				{
					id = super_cat_ids[j];
					index = j;
				}
			}
			dropdown += "<option value=\"" + "link_" + index + "_" + id + "\" " + 
						(cities[i].name == defaultCity ? "selected=\"selected\"" : "") + ">" + 
						cities[i].name + 
						"</option>";
		}
	}
	dropdown += "</select>";
	return dropdown; 
}

String.prototype.trim = function() 
{
	return this.replace(/^\s+|\s+$/g,"");
};
String.prototype.ltrim = function() 
{
	return this.replace(/^\s+/,"");
};
String.prototype.rtrim = function() 
{
	return this.replace(/\s+$/,"");
};


function getOuterHTML(el)
{
	if(whichBrs() == "Internet Explorer")
	{
		return el.outerHTML;
	}
	else
	{
	    var span = document.createElement("span"); 
		span.appendChild(el.cloneNode(true));
	    return span.innerHTML;
	}
}

function setOuterHTML(el, html)
{
	if(whichBrs() == "Internet Explorer")
	{
		el.outerHTML = html;
	}
	else
	{
	    var range = document.createRange();
	    el.innerHTML = html;
	    range.selectNodeContents(el);
	    var frag = range.extractContents();
	    el.parentNode.insertBefore(frag, el);
	    el.parentNode.removeChild(el);
	}
}

/*
HTMLElement.prototype.__defineGetter__("outerHTML", function() 
{
    var span = document.createElement("span"); 
	span.appendChild(this.cloneNode(true));
    return span.innerHTML;
});

HTMLElement.prototype.__defineSetter__("outerHTML", function(html) 
{
    var range = document.createRange();
    this.innerHTML = html;
    range.selectNodeContents(this);
    var frag = range.extractContents();
    this.parentNode.insertBefore(frag, this);
    this.parentNode.removeChild(this);
});
*/

function tabbing_skin_86270(super_cat_ids, super_titles, onclickcode)
{
	// loop through each record in "weathercoords"
	for(var i = 0; i < weatherCoords.length; i++) 
	{
		var el = document.getElementById("weather_map_image_" + weatherCoords[i][0]);
		if(el != null) 
		{
			var super_cat_id;
			var super_cat_index;
			for(var j=0; j<super_cat_ids.length; j++) 
			{
				if(super_titles[j] == weatherCoords[i][0]) 
				{
					super_cat_id = super_cat_ids[j];
					super_cat_index = j;
				}
			}
			setOuterHTML(el, getOuterHTML(el).replace("onmouseover=\"\"", 
												"onmouseover=\"this.id='link_" + super_cat_index + "_" + super_cat_id + "'; " + 
												"showPleaseWait(); " +
												onclickcode + "; \""));

			/*el.outerHTML = el.outerHTML.replace("onmouseover=\"\"", 
												"onmousemove=\"this.id='link_" + super_cat_index + "_" + super_cat_id + "'; " + 
												"showPleaseWait(); " +
												onclickcode + "; \"");*/
		}
	}
	return "";
}

// this function executes after the supergrouping has finished
function tabbing_skin_loaded_86270(id)
{
	var catid=id.split("_")[2];
	if(catid != null)
	{
		populateForecastBox(catid);
	}
}

