function fitWindowForPicture() {
	arrTemp=self.location.href.split("?"); 
	picUrl = (arrTemp.length>0)?arrTemp[1]:""; 
	NS = (navigator.appName=="Netscape")?true:false; 
	iWidth = (NS)?window.innerWidth:document.body.clientWidth; 
	iHeight = (NS)?window.innerHeight:document.body.clientHeight; 
	iWidth = document.images[0].width - iWidth + 20; 
	iHeight = document.images[0].height - iHeight + 20; 
	window.resizeBy(iWidth, iHeight);
	var winl = (screen.width - iWidth) / 2;
	var wint = (screen.height - iHeight) / 2;
	window.moveTo(winl, wint);
	self.focus(); 
}

function openWindow(url, width, height, noScrollbars)
{
	var winl = (screen.width - width) / 2;
	var wint = (screen.height - height) / 2;
	scrollbartext = 'yes';

	if (noScrollbars) {
		scrollbartext = 'no';
	}
	windowprops = 'height=' + height + ', width=' + width + ',top=' + wint + ',left= ' + winl + ',scrollbars=' + scrollbartext + ',resizable, status=no,toolbar=no,menubar=no,location=no';
	var myWin = window.open(url, 'myWin', windowprops);
	myWin.focus();
}

function openDialogWindow(url, width, height)
{
	window.showModalDialog(url, window,'status:no;dialogWidth:'+width+'px;dialogHeight:'+height+'px;dialogHide:true;help:no;scroll:auto'); 
}

function processTabs(parentId, currentId, activateTab) {
	var elements = document.getElementById(parentId).childNodes;

	for (i = 0; i < elements.length; i++) {
		var element = elements[i];

		if (element.id == null) {
			continue;
		}

		if (currentId == element.id) {
			if (element.style.visibility == 'hidden') {
				element.style.visibility='visible';
				element.style.position='relative';
				element.style.width = '100%';
				element.setAttribute('style', 'visibility:visible;position:relative;width:100%;');
				var classStr = activateTab.getAttribute('class');

				if (classStr == null) {
					classStr = activateTab.getAttribute('className');
				}

				classStr += 'active';
				activateTab.setAttribute('class', classStr);
				activateTab.setAttribute('className', classStr);
			}
		}
		else {
			element.style.visibility='hidden';
			element.style.position='absolute';
			element.setAttribute('style', 'visibility:hidden;position:absolute;');
			var elementHeader = document.getElementById(elements[i].id + 'header');
			var classStr = elementHeader.getAttribute('class');

			if (classStr == null) {
				classStr = elementHeader.getAttribute('className');
			}

			classStr = classStr.replace('active', '');
			elementHeader.setAttribute('class', classStr);
			elementHeader.setAttribute('className', classStr);
		}
	}
}

