
	var newwin = true;
	var appwin = false;
	var fsize;
	
	function  start(app, resid,index){
	
	if (newwin) {
		fsize = screen.height - 160 
	} else {
		fsize = screen.availHeight - 100
	}

		windopts="resizable=1,fullscreen=0,top=0,left=0,width=" + (screen.width - 10) + ",height=   " + (screen.height -75)+",status=1,maximised=1,toolbar=0,location=0"
		if (arguments.length > 1) {
			var res = arguments[1];
			if (newwin) {
				if (appwin) {
					if (!appwin.closed)	{appwin.close()}
				}
				appwin = window.open("..//start.aspx?newwin=true&framesize=" + fsize + "&app=" + app + "&GuideResId=" + resid + "&GuideIndex=" + index + "&startres=" + res + "?ovli=" + index, "appwin", windopts, true)
				appwin.focus()
			} else {
				top.document.location = "..//start.aspx?newwin=false&framesize=" + fsize + "&app=" + app + "&GuideResId=" + resid + "&GuideIndex=" + index  + "&startres=" + res + "?ovli=" + index
			}
		} else {
			if (newwin) {
				if (appwin) {
					if (!appwin.closed)	{appwin.close()}
				}
				appwin = window.open("..//start.aspx?newwin=true&framesize=" + fsize + "&app=" + app + "&GuideResId=" + resid + "&GuideIndex=" + index , "appwin", windopts, true)
				appwin.focus()
			} else {
				top.document.location = "..//start.aspx?newwin=false&framesize=" + fsize + "&app=" + app + "&GuideResId=" + resid + "&GuideIndex=" + index 
			}
		}
	}	
	
	function fnGotoTest(pstrLink,pnType)
	{
		var windopts="resizable=1,fullscreen=0,top=0,left=0,width=" + (screen.width - 10) + ",height=   " + (screen.height -75)+",status=1,maximised=1,toolbar=0,location=0";
		winTest = window.open('../TMS/SetObjectSG.aspx?TestLink=' + pstrLink + '&type=' + pnType,"winTest",windopts)
	
	
	}

