function pop()
{
var myAs = document.getElementsByTagName('a');
for (var a = 0; a < myAs.length; ++a) {

if (myAs[a].className == 'pop') {

var pop = document.getElementById(myAs[a].href.substring(myAs[a].href.lastIndexOf('#') + 1));

if (pop) {       
pop.style.display = 'none';
myAs[a].onclick = function() {
thisPopup = document.getElementById(this.href.substring(this.href.lastIndexOf('#') + 1))
thisPopup.style.display = (thisPopup.style.display == 'none') ? 'block' : 'none';
return false;
};

pop.onclick = function()
{
this.style.display = 'none';
};
}
}
}
}

window.onload = pop;