var popWin;
function closeWin() {
	self.close();
}
function checkWin() {
	if (popWin) {
		popWin.close();
		delete popWin;
	}
}
function openWin(page, file, w, h, txt) {
	checkWin();
	if (!w) {
		w = 620;
	}
	if (!h) {
		h = 600;
	}
	if (txt) {
		h = parseInt(h)+72;
	}
	popWin = window.open('popup.asp?c='+page+'&f='+file, 'popup', 'width='+w+',height='+h+',resizable=0,scrollbars=0,toolbar=0,menubar=1,location=0,status=0,directories=0');
	if (window.focus) {
		popWin.focus();
	}
}

function popitup(page,l,t,w,h)
	{
      window.open (page,"_blank","height="+h+",width="+w+",left="+l+",top="+t+", status=no,scrollbars=no,toolbar=no,menubar=no,location=no,resizable=no")
	}

function openSlide(id) {
	checkWin();
	popWin = window.open('slideshow.html?c='+id, 'popup', 'width=600,height=600,resizable=0,scrollbars=0,toolbar=0,menubar=0,location=0,status=0,directories=0');
	if (window.focus) {
		popWin.focus();
	}
}
function openSlide2(id) {
	checkWin();
	popWin = window.open('slideshow_ni.html?c='+id, 'popup', 'width=600,height=700,resizable=0,scrollbars=0,toolbar=0,menubar=0,location=0,status=0,directories=0');
	if (window.focus) {
		popWin.focus();
	}
}
function setGnome() {
	var head = getElement('headImg');
	var border = getElement('borderPg');
	head.style.width = border.offsetWidth+'px';
}
function getElement(id) {
	var elem;
	if (document.getElementById) {
		elem = document.getElementById(id);
	} else if (document.all) {
		elem = document.all[id];
	} else if (document.layers) {
		elem = document.layers[id];
	}
	return elem;
}
