function openWindow(im,w,h){
	var xphWin = window.open(im,"xphWinwin","width="+ w + ",height=" + h +",status=yes,resizable=no,scrollbars=yes");
	if(document.getElementById){
	xphWin.moveTo(200,100);
	
	xphWin.focus();

	}
}
function openGallery(im,im_title,w,h){ 
	var im_title = im_title.replace(/(')/g,'');
	im_title = im_title.replace(/(")/g,'');
	var theheight = h>(screen.availHeight-70)?screen.availHeight-70:h;
	var thewidth = w>(screen.availWidth)?screen.availWidth:w+20;
	var gallery = window.open(im,"gallerywin","width="+ thewidth + ",height=" + theheight +",left=10,top=10,status=yes,scrollbars=yes,resizable=no");
	if(document.getElementById){
	gallery.document.open();

	gallery.document.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'+
'<html xmlns="http://www.w3.org/1999/xhtml">'+
'<head><title>'+im_title+'</title>'+
'<style type="text/css">'+
'<!--'+
'body {'+
'margin:0px;padding:0px;background-color:#ffffff;'+
'}'+
'//-->'+
'</style>'+
'</head>'+
'<body onload="defaultStatus=\''+im_title+'\'">'+
'<img src="'+im+'" width="'+w+'" height="'+h+'" alt="'+im_title+'" />'+
'</body>'+
'</html>');
	gallery.document.defaultStatus = im_title;
	gallery.document.close();
	gallery.focus();
}

}
window.onerror = function(){
		return true;
}
