function imgpopup(myHREF) {
	//alert(myHREF)	
	myHREF = "/inc/pic.asp?img=" + myHREF
	window.open(myHREF, 'imgpopup', 'width=640,height=480')
}

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";
		} else if ((anchor.getAttribute("href") && anchor.getAttribute("rel") == "imgpopup")) {
			myHREF = anchor.getAttribute("href")
			anchor.href = "javascript:imgpopup('" + myHREF + "')";
		}
	}
}
window.onload = externalLinks;

function isnumeric(strString)
// check for valid numeric strings
{
var strValidChars = "0123456789";
var strChar;
var blnResult = true;

if (strString.length == 0) return false;

// test strString consists of valid characters listed above
for (i = 0; i < strString.length && blnResult == true; i++)
{
strChar = strString.charAt(i);
if (strValidChars.indexOf(strChar) == -1)
{
blnResult = false;
}
}
return blnResult;
}

function selectimg(strPhotoID, galleryID) {
    var thumbs = document.getElementById("gallerythumbs").getElementsByTagName("a")
    for (i=0;i<thumbs.length;i++) {
        thumbs[i].className = "unselected";
    }
    document.getElementById('gallerypreviewphoto').src= '/i/gallery/' + galleryID + '/preview/' + strPhotoID + '.jpg';
    document.getElementById('thumb' + strPhotoID).className = "selected";
    document.getElementById('gallerypreviewphototext').innerHTML = document.getElementById('thumb' + strPhotoID).title;
}
