function OpenPhotoSeries(cPicture,gotopage,folderid,recordid,nWidth,nHeight)
{
	showphoto = new Image();
	showphoto.src = cPicture;
	if (!window.NewWindow || NewWindow.closed) 
	NewWindow=window.open(gotopage+"&folderid="+folderid+"&recordid="+recordid,"PhotoSeries","HEIGHT="+(showphoto.height+100)<100?100:(showphoto.height+100)+" WIDTH="+(showphoto.width+10)<100?100:(showphoto.width+10)+" scrollbars=yes resizable=yes top=5 left=5");
	else NewWindow.location = gotopage+"&folderid="+folderid+"&recordid="+recordid;
}

function OpenSinglePhoto(cPicture)
{
	showphoto = new Image();
	showphoto.src = cPicture;
	if (!window.NewWindow || NewWindow.closed) 
	NewWindow=window.open("","SinglePhoto","HEIGHT="+(showphoto.height+100)<100?100:(showphoto.height+100)+" WIDTH="+(showphoto.width+10)<100?100:(showphoto.width+10)+" scrollbars=yes resizable=yes top=5 left=5");
	else NewWindow.location = "";
	
	NewWindow.document.write("<img name=singephoto src='"+showphoto.src+"' >");
}

function OpenDesc(mypage,content) 
{
if (!window.win || win.closed) 
win = window.open(mypage, "NewWin",'height=100,width=250,scrollbars=yes,resizable=yes,toolbar=no, status=no');
else win.location = "NewWin";
win.document.write("<table><tr><td width=250 style='TABLE-LAYOUT:fixed;word-break:break-all;'>");
win.document.write(content);
win.document.write("<td></tr></table>");
}

function OpenFunction(mypage, myname, w, h, scroll) {
var winl = 0;
var wint = 0;
if (screen.width > w)	
	winl = ((screen.width-w)/2);
if (screen.height >h)
	wint = ((screen.height-h)/2);

// resizable 是否許可設定視窗尺寸 yes 或 no
// toolbar 是否展示工具列 yes 或 no
// status 是否顯示狀態列 yes 或 no

winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+', scrollbars='+scroll+',resizable=yes,toolbar=no, status=no'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}


function OpenFunctionWithMenu(mypage, myname, w, h, scroll) {
var winl = 0;
var wint = 0;
if (screen.width > w)	
	winl = ((screen.width-w)/2);
if (screen.height >h)
	wint = ((screen.height-h)/2);

// resizable 是否許可設定視窗尺寸 yes 或 no
// toolbar 是否展示工具列 yes 或 no
// status 是否顯示狀態列 yes 或 no

winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+', scrollbars='+scroll+',resizable=yes,location=yes,menubar=yes, status=yes'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}


function OpenFunctionWithParam(mypage, myname,myparameter, w, h, scroll) {
var winl = 0;
var wint = 0;
if (screen.width > w)	
	winl = ((screen.width-w)/2);
if (screen.height >h)
	wint = ((screen.height-h)/2);

// resizable 是否許可設定視窗尺寸 yes 或 no
// toolbar 是否展示工具列 yes 或 no
// status 是否顯示狀態列 yes 或 no

winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+', scrollbars='+scroll+',resizable=yes,toolbar=no, status=no'
win = window.open(mypage+'&'+myparameter, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function RefreshOrgAndClose(urllink,recordid)
{
	window.opener.location = urllink
	window.close()
}
