function newwindowpdf() {
	if (!document.getElementsByTagName) return;
  if (!document.getElementById) return;
  var links = document.getElementsByTagName("a");
  for ( var i=0; i < links.length; i++) {
		href = links[i].getAttribute("href");
		if(href) {
			if(href.indexOf(".pdf") != -1 || href.indexOf(".PDF") != -1) {
				links[i].onclick = function() {
					window.open(this.getAttribute("href"),'refwin');
					return false;
				};
			}
		}
  };
};

function makeImageGallery(){
	if(!document.getElementsByTagName||!document.getElementById)return false;
	if(!dg("s-dtimglist"))return false;
	var g=dg("s-dtimglist").getElementsByTagName("a");
	for ( var l=0; l < g.length; l++){g[l].onclick=function(){
	dg("mainimage").setAttribute("src",this.getAttribute("href"));return false;}};
}

addLoadEvent(makeImageGallery);
addLoadEvent(newwindowpdf);
