function showPIC(galimg) {
someHtml = '<center><div style="border:5px solid #B5D6E3;" align="center" onClick="hidePIC();" id="closePIC" name="closePIC"><table cellpadding="0" cellspacing="0" border="0" bgcolor="#B5D6E3"><tr><td bgcolor="#B5D6E3"><div align="right"><img src="images/close.gif" width="46" height="12"></div></td></tr><tr><td><img src="images/'+galimg+'"></td></tr></table></div></center>';
oldDiv = document.getElementById('galleryPOP');

if (oldDiv.firstChild) {
	oldDiv.removeChild(oldDiv.firstChild);
}
newDiv = document.createElement('div');
//if (newDiv.firstChild) {
//	newDiv.removeChild(newDiv.firstChild);
//}
oldDiv.innerHTML = '';
newDiv.innerHTML = '';
newDiv.id = 'galleryPOP';
newDiv.style.border = '1px solid #000000';
newDiv.innerHTML = someHtml;
newDiv.style.display = "block";
newDiv.style.position = "absolute";
newDiv.style.left = "200px";
newDiv.style.zIndex = "100";
newDiv.style.top = "120px";
//oldDiv.style.position = "absolute";
//oldDiv.style.zIndex = "100";
//oldDiv.style.top = "120px";

//oldDiv.style.display = "none";


/////// if (oldDiv.hasChildNodes())
///////  // So, first we check if the object is not empty, if the object has child nodes
/////// {
///////	var ndnm = 'Names';
///////   var children = oldDiv.childNodes;
///////   for (var i = 0; i < children.length; i++) 
///////   {
///////   // do something with each child as children[i]
///////	ndnm = ndnm + children[i].nodeName;
///////   // NOTE: List is live, Adding or removing children will change the list
///////   };
/////// alert(ndnm);
/////// };

//alert (oldDiv.parentNode.nodeName);





//if ( oldDiv.innerHTML == '' ) {
////var myNEWDIV = oldDiv.parentNode.replaceChild(newDiv, oldDiv);
//document.writeIn(myNEWDIV);
////myNEWDIV.style.display = "block";



oldDiv.parentNode.replaceChild(newDiv, oldDiv);

//}
//document.getElementById('closePIC').focus();

document.getElementById('galleryPOP').style.left = "200px";
document.getElementById('galleryPOP').style.top = "120px";
document.getElementById('galleryPOP').style.zIndex = "110";

//alert (document.getElementById('galleryPOP').style.zIndex);
//if (oldDiv.parentNode.Child) {
//alert(oldDiv.parentNode.Child);
//}
//alert (document.getElementById('galleryPOP').innerHTML);

//if (oldDiv.firstChild) {
//	oldDiv.removeChild(oldDiv.firstChild);
//}





//newDiv.style.display = "block";
//////alert(oldDiv.firstChild.nodeName);
//alert (oldDiv.innerHTML+'   '+oldDiv.id+'   '+oldDiv.style.display+'   '+newDiv.id+'   '+newDiv.style.display+' NEWDIV HTML='+newDiv.innerHTML);
}
function hidePIC() {
MyPopDiv1 = document.getElementById('galleryPOP');
if (MyPopDiv1.firstChild) {
	MyPopDiv1.removeChild(MyPopDiv1.firstChild);
}
MyPopDiv1.innerHTML = '';
MyPopDiv1.style.display = 'none';
}