function openNewWin(win_nm,w,h,nm)
{
	var myfeatures='directories=no,location=no,menubar=no,status=yes,titlebar=no,toolbar=no,resizable=no,scrollbars=yes,width='+w+',height='+h+',left=0,top=0';

	if(nm == '')
		nm='new';

	var newImg=window.open(win_nm,nm,myfeatures);
	newImg.focus();
}

var popbackground="#ffffff" //specify backcolor or background image for pop window
var windowtitle="ASPL Templates"  //pop window title

function detectexist(obj)
{
	return (typeof obj !="undefined")
}

function popimage(imgpath, popwidth, popheight)
{
	textdescription='<div style="border-top:3px solid #ececec; padding:10px; text-align:center;"><input type="image" src="siteimage/but_close.gif" value="close" onclick="window.close()"></div>';
	function getpos()
	{
		leftpos=(detectexist(window.screenLeft))? screenLeft+document.body.clientWidth/2-popwidth/2 : detectexist(window.screenX)? screenX+innerWidth/2-popwidth/2 : 0	
		toppos=(detectexist(window.screenTop))? screenTop+document.body.clientHeight/2-popheight/2 : detectexist(window.screenY)? screenY+innerHeight/2-popheight/2 : 0
		
		if (window.opera)
		{
			leftpos-=screenLeft
			toppos-=screenTop
		}
	}
	getpos()
	var winattributes='width='+popwidth+',height='+popheight+',scrollbars=yes,resizable=auto,left='+leftpos+',top='+toppos
	var bodyattribute=(popbackground.indexOf(".")!=-1)? 'background="'+popbackground+'"' : 'bgcolor="'+popbackground+'"'
	
	if (typeof popwindow=="undefined" || popwindow.closed)
		popwindow=window.open("","",winattributes)
	else
		popwindow.resizeTo(popwidth, popheight+30)

	popwindow.document.open()
	popwindow.document.write('<html><title>'+windowtitle+'</title><body '+bodyattribute+' style="margin:0px; padding:10px;"><img src="'+imgpath+'" alt="" style="margin-bottom: 5px"><br />'+textdescription+'</body></html>')
	popwindow.document.close()
	popwindow.focus()
}
self.name="aspl";