// JavaScript Document
function writit(text,id) {
	if (document.getElementById)
	{
		x = document.getElementById(id);
		x.innerHTML = '';
		x.innerHTML = text;
	}
	else if (document.all)
	{
		x = document.all[id];
		x.innerHTML = text;
	}
}

function getObj(objectId)
{
// cross-browser function to get an object's style object given its id
    if(document.getElementById && document.getElementById(objectId)) {
	// W3C DOM
	this.obj = document.getElementById(objectId);
	this.style = document.getElementById(objectId).style;
    } else if (document.all && document.all(objectId)) {
	// MSIE 4 DOM
	this.obj = document.all(objectId);
	this.style = document.all(objectId).style;
    } else if (document.layers && document.layers[objectId]) {
	// NN 4 DOM.. note: this won't find nested layers
	this.obj = document.layers[objectId];
	this.style = document.layers[objectId];
    } else {
	return false;
    }
}

/*function zoomImg(wID){
	myWindow=window.open('../popup_img5445.html?id='+wID+'','','status=yes,width=80,height=80,scrollbars=1');
	myWindow.focus();
}

function zoomItmImg(wID, wItemId){
	myWindow=window.open('../popup_itm_img5445.html?id='+wID+'&iid='+wItemId,'','status=yes,width=80,height=80,scrollbars=1');
	myWindow.focus();
}

function zoomCatImg(wID, wCatId){
	myWindow=window.open('../popup_cat_img5445.html?id='+wID+'&cid='+wCatId,'','status=yes,width=80,height=80,scrollbars=1');
	myWindow.focus();
}

function zoomShpImg(wID, wShpId){
	myWindow=window.open('../popup_shp_img5445.html?id='+wID+'&sid='+wShpId,'','status=yes,width=80,height=80,scrollbars=1');
	myWindow.focus();
}

function zoomShpCatImg(wID){
	myWindow=window.open('../popup_shp_cat5445.html?id='+wID,'','status=yes,width=80,height=80,scrollbars=1');
	myWindow.focus();
}

*/
function roundImgCorners() {
	if (imgs = document.getElementById("inner").getElementsByTagName('img')) {
			
		//var divs = document.getElementsByTagName('img');
		var imgs_to_round = [];
		// First locate all divs with 'rounded' in their class attribute
		for (var i = 0; i < imgs.length; i++) {
			if (imgs[i].className == '' && imgs[i].src.indexOf('_tn.html') > -1) {
				imgs_to_round.push(imgs[i]);
			}
		}
		// Now add additional divs to each of the divs we have found */
		for (var i = 0; i < imgs_to_round.length; i++) {
			var original = imgs_to_round[i];
			original.className = 'nF';
			/* Make it the inner div of the four */
			//original.className = original.className.replace('rounded', '');
			/* Now create the outer-most div */
			var tr = document.createElement('div');
			tr.className = 'imgF';
			/* Swap out the original (we'll put it back later) */
			original.parentNode.replaceChild(tr, original);
			/* Create the two other inner nodes */
			var tl = document.createElement('div');
			tl.className = 'aboveTnImg';
			var br = document.createElement('img');
			/* Now glue the nodes back in to the document */
			tr.appendChild(tl);
			tr.appendChild(br);
			//br.appendChild(original);
			br.parentNode.replaceChild(original, br);
		}
		
	}
} 