<!-- hide script from old browsers

function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") &&
       anchor.getAttribute("rel") == "external")
     anchor.target = "_blank";
 }
}
function showPic(whichpic){
	var source = whichpic.getAttribute("href");
	var caption = whichpic.getAttribute("title");
	var placeholder = document.getElementById("galleryImage");
	placeholder.setAttribute('src',source);
	textholder = document.getElementById("imageCaption");
	textholder.innerHTML = caption;
}

function prepareLinks(){
	var links = document.getElementsByTagName("a");
	for (var i=0; i<links.length; i++){
		//alert ('Classname'+links[i].getAttribute("class"));
		if (links[i].getAttribute("class") == "thumb") {
			links[i].onmouseover = function() {
			showPic(this);
			return false;
			}
			links[i].onclick = function() {
			showPic(this);
			return false;
			}
		}
		if (links[i].getAttribute("class") == "new-window") {
			links[i].onclick = function() {
				var target = this.getAttribute("href");
				window.open(target,"Upload_Image","width=900,height=500,scrollbars=1,resizable=1");
			return false;
			}
		}
	}
}

function hidediv(BoxId){
	var BoxId;
	var mySplitResult = BoxId.split("#");
	if (ShowLayer = document.getElementById('div-'+mySplitResult[1])) ShowLayer.setAttribute("class","news");
	if (ShowLayerLink = document.getElementById('link-'+mySplitResult[1])) ShowLayerLink.setAttribute("class","newsLinkFocus");
	if (ShowLayerLink = document.getElementById('wrap-'+mySplitResult[1])) ShowLayerLink.setAttribute("class","newsLinkFocus");
}
function showdiv(BoxId){
	var BoxId;
	var mySplitResult = BoxId.split("#");
	if (ShowLayer = document.getElementById('div-'+mySplitResult[1])) ShowLayer.setAttribute("class","newsFocus");
	if (ShowLayerLink = document.getElementById('link-'+mySplitResult[1])) ShowLayerLink.setAttribute("class","newsLink");
	if (ShowLayerWrap = document.getElementById('wrap-'+mySplitResult[1])) ShowLayerWrap.setAttribute("class","newsLink");
}
function iniServices() {
	var dds = document.getElementsByTagName("div");
	for (var i=0; i<dds.length; i++) {
		var dd = dds[i];
		if (dd.getAttribute("class") == "newsFocus")
			dd.setAttribute("class","news");
	}
	var anchors = document.getElementsByTagName("a");
	for (var i=0; i<anchors.length; i++) {
		var anchor = anchors[i];
		if (anchor.getAttribute("class") == "dd-close"){
			anchor.onclick = function(){
				hidediv(this.getAttribute("href"));
			}
		}
		if (anchor.getAttribute("class") == "newsLinkFocus") anchor.onclick= function(){
				showdiv(this.getAttribute("href"));
			}
	}
}


window.onload = function() {
	if (!document.getElementsByTagName || !document.getElementById) return false;
	externalLinks();
	prepareLinks();
	iniServices();
}

// end hiding script from old browsers -->