function deletetemplate() { 
if (confirm("Are you sure you want to remove this item?")) 
return true; 
else 
return false; 
}

function showquery(off){
	owstring="qview.php?q="+off;
    sheight = screen.height - 80;
    if (sheight > 900)
	sheight = 900;

    swidth = screen.width - 80;
    if (swidth > 620)
	swidth = 620;
    window.open(owstring, "_blank", "toolbar=no,status=no,scrollbars=yes,width="+swidth+",height="+sheight+",left=10,top=5", false);
    return false;
}

function goodpass(checkStr, minlength, maxlength)
{
	var checkOK = "0123456789abcdefghijklmnopqrstuvwzyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
	var foundit = true;
	if (checkStr.length < minlength)
		return false;
	else if (checkStr.length > maxlength)
		return false;
	for (i = 0;  i < checkStr.length;  i++)
	{
		ch = checkStr.charAt(i);
		foundit = false;
		for (j = 0;  j < checkOK.length;  j++)
		{
			if (ch == checkOK.charAt(j))
			{
				foundit = true;
				break;
			}
		}	
			
		if (!foundit)
			return false
	}
	return true;
}

function showpic(picname, title, wide, high){

		scrollit=-"no";
		ostring = "showpic.php?image=" + picname + "&title=" + title + "&width=" + wide + "&height="+high + "&close=1";
		if (high > screen.height - 100)
		{
			sheight = screen.height - 100;
			scrollit="yes";
		}
		else
		{
			sheight=high+50;
		}
		if (wide > screen.width - 80)
		{
			swidth= screen.width-80;
			scrollit="yes";
		}
		else
		{
			swidth=wide+30;
		}
		window.open(ostring, "_blank", "toolbar=no,status=no,scrollbars=" + scrollit + ",width="+swidth+",height="+sheight+",left=10,top=5", false);
    		return false;

}

function pointmap(event){
    pos_x = event.offsetX?(event.offsetX):event.pageX-document.getElementById("worldmapb").offsetLeft;
    pos_y = event.offsetY?(event.offsetY):event.pageY-document.getElementById("worldmapb").offsetTop;
    document.getElementById("locpointer").style.left = (pos_x) ;
    document.getElementById("locpointer").style.top = (pos_y) ;
    document.getElementById("eddleft").value = pos_x;
    document.getElementById("eddtop").value = pos_y;
}
