function loadPostCard(pc_id) {
	var numberRE = /^\d+$/;
	if (numberRE.test(pc_id)) {
	  document.location.href = '/postcard.asp?id='+pc_id;
	  //var pcWin = window.open('/postcard_view.asp?postcard_id='+pc_id, 'postcard', 'scrollbars,resizable,width=640,height=480');
	  //pcWin.focus();
	}
}

function openSSHelp() {
	var ssHelp = window.open('/member/help.asp', 'ssHelp', 'toolbar=no,status=yes,scrollbars=yes,resizable=yes,location=no,directories=no,menubar=no,width=416,height=400');
	ssHelp.focus();
}

function xe(amount, from) {
	CurrencyWindow = window.open ('', 'CurrencyWindow', 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,height=150,width=575')
	CurrencyWindow.focus()
	CurrencyWindow.location.href = 'http://www.xe.com/pca/input.cgi?AmountSet=' + amount + '&FromSelect=' + from
}

function openViewer(artId) {
	var aviewer = window.open('/artviewer.asp?art_id='+artId, 'aviewer', 'toolbar=no,status=yes,scrollbars=no,resizable=no,location=no,directories=no,menubar=no,width=550,height=300');
	aviewer.focus();
}

function setAllImagesMinDimension(id, maxsize){    
	var images = document.getElementById(id).getElementsByTagName("img");    
	for (var i = 0; i < images.length; ++i) {
		setImageMinDimension(images[i], maxsize);
	}
}

function setImageMinDimension(imageObj, maxsize) {
	if (imageObj.clientWidth == imageObj.clientHeight) {            
		imageObj.style.width = maxsize + "px";
	} else {
		if (imageObj.clientWidth < imageObj.clientHeight) {
			imageObj.style.width = maxsize + "px";
			imageObj.style.top = (maxsize - imageObj.clientHeight)/2;
		} else {
			imageObj.style.height = maxsize + "px";
			imageObj.style.left = (maxsize - imageObj.clientWidth)/2;
		}
	}
}

function imageBoxMouseOver(inObj) {
	var divObj = inObj.parentNode;
	var imgObj = inObj.firstChild;
	divObj.style.zIndex = 999;
	divObj.style.overflow = 'visible';
	imgObj.style.border = '4px solid #fff';
}

function imageBoxMouseOut(inObj) {
	var divObj = inObj.parentNode;
	var imgObj = inObj.firstChild;
	divObj.style.overflow = 'hidden';
	divObj.style.zIndex = 1;
	imgObj.style.border = '0px solid #fff';
}
