function nolink() {
	return;
}
function clear_selected() {
	if(document.selection != null)
		document.selection.empty();	
	else {
		var selobj=window.getSelection();
		if(selobj != null) {
			var oneRange;
			for(var i=0; i < selobj.rangeCount; i++) {
				oneRange=selobj.getRangeAt(i);
				selobj.removeRange(oneRange);
			}
		}
	}
}
<!--- refresh selections --->
function refresh()
{
	selected_thumbid=null;
	document.getElementById("fdpage").value="1";
	document.getElementById("iselect").submit();
}
function refreshform()
{
	selected_thumbid=null;
	document.getElementById("fdpage").value="1";
	document.getElementById("iselect").submit();
}
function clickchk(func)
{
  if(document.iselect.clickflag.value == 0) {
	document.getElementById("clickflag").value=1;
	document.getElementById("clickfunc").value=func;
	document.getElementById("iselect").submit();
  }
}
function viewimage(ppath, pname, pid, pcatnum) {
	if(selected_thumbid != null && document.getElementById(selected_thumbid) != null) 
		document.getElementById(selected_thumbid).className="graphiccontainer-notselected";
	selected_thumbid=pid;
	document.getElementById("imageid").value=pid;
	document.getElementById(selected_thumbid).className="graphiccontainer-selected";
	var viewer=document.getElementById("gviewer");
	if(viewer != null) {
		var container=document.getElementById("thumbcontainer");
		if(container != null) {
			container.style.display="none";
		}
		container=document.getElementById("waitcontainer");
		if(container != null) {
			container.style.display="block";
		}
		var imagename=document.getElementById("imagename");
		if(imagename != null) {
			if(pcatnum != null && pcatnum != "")
				imagename.innerHTML=(pname + "<br>STK#: " + pcatnum);
			else
				imagename.innerHTML=pname;
		}
		window.document.body.style.cursor="wait";
		viewer.src=ppath;
	}
}
function showimage() {
	var container=document.getElementById("waitcontainer");
	if(container != null) {
		container.style.display="none";
	}
	container=document.getElementById("viewercontainer");
	if(container != null) {
		container.style.display="block";
	}
	window.document.body.style.cursor="";
}
function clearimage() {
	var container=document.getElementById("viewercontainer");
	if(container != null) {
		container.style.display="none";
	}
	container=document.getElementById("thumbcontainer");
	if(container != null) {
		container.style.display="block";
	}
}
function deleteimage(pname)
{
  	if(confirm('OK to Delete File: ' + pname + '?')) {
	  	if(document.getElementById("clickflag").value == 0) {
			document.getElementById("clickflag").value=1;
			document.getElementById("clickfunc").value="Delete";
		  	document.getElementById("filed").value=pname;
			document.getElementById("iselect").submit();
	  	}
	}
}
function change_page() {
	document.getElementById("fdpage").value=document.getElementById("dpage").value;
	selected_thumbid=null;
	document.getElementById("iselect").submit();
}
function change_page2() {
	document.getElementById("fdpage").value=document.getElementById("dpage2").value;
	selected_thumbid=null;
	document.getElementById("iselect").submit();
}
function nextpage() {
	var pval=parseInt(document.getElementById("fdpage").value);
	if( pval < gmaxpages) {
		pval=pval + 1;
		document.getElementById("fdpage").value=pval.toString();
		selected_thumbid=null;
		document.getElementById("iselect").submit();
	}
}
function prevpage() {
	var pval=parseInt(document.getElementById("fdpage").value);
	if(pval > 1) {
		pval=pval - 1;
		document.getElementById("fdpage").value=pval.toString();
		selected_thumbid=null;
		document.getElementById("iselect").submit();
	}
}
function goback() {
	window.location.replace(greturnto);
}
// open pins shopping cart
function openpincart(pstock, pfilename) {
	var tagline="?stock=" + pstock + "&filename=" + pfilename;
	//OpenPopupSize("LittleAwardsCart", "pincart.cfm" + tagline, 940, 600);
	window.location.href="pincart.cfm" + tagline;
}
// open plaques shopping cart
function openplaquecart(pstock, pfilename) {
	var tagline="?stock=" + pstock + "&filename=" + pfilename;
	//OpenPopupSize("LittleAwardsCart", "plaquecart.cfm" + tagline, 940, 600);
	window.location.href="plaquecart.cfm" + tagline;
}
// open plaques shopping cart
function opencertcart(pstock, pfilename) {
	var tagline="?stock=" + pstock + "&filename=" + pfilename;
	//OpenPopupSize("LittleAwardsCart", "plaquecart.cfm" + tagline, 940, 600);
	window.location.href="certcart.cfm" + tagline;
}
var vPopupWin;
function OpenPopupSize(pTitle, pURL, pWidth, pHeight) {
	var posx = (screen.availWidth-pWidth)/2;
	var posy = (screen.availHeight-pHeight)/2;
	var pStyle = "left=" + posx.toString() + ",top=" + posy.toString() + ",width=" + pWidth.toString() + ",height=" + pHeight.toString() + ",toolbar=0,status=0,resizable=1,Scrollbars=1";
	vPopupWin = window.open(pURL, pTitle, pStyle);
}
function page_return() {
	try {
		opener.unloadwin();	
	}
	catch(e){}
}
function returnfocus() {
	window.setTimeout("focus()", 500);	
}