var gcToggle = "#ffff00";
var gcBG = "#CCCCFF";

function popupCalendarDlg(e,sPath,ctrlobj){
	showx = e.screenX - e.offsetX + 8 - 184;
	showy = e.screenY - e.offsetY + 24; // + deltaY;
	newWINwidth = 210 + 4 + 18;
	
	//window.alert (sPath+"/calendardlg.html");
	//window.alert (ctrlobj.value);

	retval = window.showModalDialog(sPath+"/calendardlg.html", "", "dialogWidth:192px; dialogHeight:240px; dialogLeft:"+showx+"px; dialogTop:"+showy+"px; status:no; directories:yes;scrollbars:no;Resizable=no;");
	//retval = window.showModalDialog("bb.htm", "", "dialogWidth:197px; dialogHeight:210px; dialogLeft:"+showx+"px; dialogTop:"+showy+"px; status:no; directories:yes;scrollbars:no;Resizable=no;");

	if( retval != null ){
		//alert("已返回值！!!！");
		ctrlobj.value = retval;
	}
	else{
	       	//alert("canceled");
	}
}

function popupCalendarDlg2(e,sPath,ctrlobj){
	showx = e.screenX - e.offsetX + 8 - 184;
	showy = e.screenY - e.offsetY + 24; // + deltaY;
	newWINwidth = 210 + 4 + 18;

	retval = window.showModalDialog(sPath+"/calendardlg.html", "", "dialogWidth:192px; dialogHeight:240px; dialogLeft:"+showx+"px; dialogTop:"+showy+"px; status:no; directories:yes;scrollbars:no;Resizable=no; "  );
	//retval = window.showModalDialog("bb.htm", "", "dialogWidth:197px; dialogHeight:210px; dialogLeft:"+showx+"px; dialogTop:"+showy+"px; status:no; directories:yes;scrollbars:no;Resizable=no; "  );

	if( retval != null ){
		//alert("已返回值！!!！");
		if (ctrlobj.value == "") {
			ctrlobj.value = retval + " 00:00:00";
		}
		else {
			ctrlobj.value = retval + ctrlobj.value.substring(10,19);
		}
	}
	else{
	       	//alert("canceled");
	}
}

function popuptoSession (sPath,sWinHandle) {
	window.open(sPath,sWinHandle,'menubar=no,toolbar=no,scrollbars=yes,resizable=yes,location=no,status=no');
}

function popuptoSessionPullDown (e,sPath,sWinHandle) {//#20040605,Samuel,E
	var showx;
	var showy;
	if (document.all){
		showx = e.screenX - e.offsetX + 8 - 184;
		showy = e.screenY - e.offsetY + 24; // + deltaY;
	}
	else {
		showx = e.screenX - 184;
		showy = e.screenY; // + deltaY;
	}
	newWINwidth = 210 + 4 + 18;

	window.open(sPath,sWinHandle,"width=197px,height=270px,left="+showx+"px,top="+showy+"px,menubar=no,toolbar=no,scrollbars=yes,resizable=yes,location=no,status=no");
}

function popuptoSessionToPrint (e,sPath,sWinHandle) {//#20040605,Samuel,E
	var showx;
	var showy;
	if (document.all){
		showx = e.screenX - e.offsetX + 8 - 300;
		showy = e.screenY - e.offsetY + 24; // + deltaY;
	}
	else {
		showx = e.screenX - 300;
		showy = e.screenY; // + deltaY;
	}

	newWINwidth = 210 + 4 + 18;

	window.open(sPath,sWinHandle,"width=320px,height=170px,left="+showx+"px,top="+showy+"px,menubar=no,toolbar=no,scrollbars=yes,resizable=yes,location=no,status=no");
}

//#20051009 Jim, Add "width" parameter.
//#20060301,Samuel,E, change e
function popuptoSessionPullDown2 (e,sPath,sWinHandle, width) {//#20040605,Samuel,E
	var offx = 0;
	var offy = 0;
	if (document.all){
		offx = e.offsetX;
		offy = e.offsetY;
	}
	var showx = e.screenX - offx + 8 - 184;
	var showy = e.screenY - offy + 24; // + deltaY;
	var newWINwidth = 210 + 4 + 18;
	window.open(sPath,sWinHandle,"width=" + width +"px,height=270px,left="+showx+"px,top="+showy+"px,menubar=no,toolbar=no,scrollbars=yes,resizable=yes,location=no,status=no");
}

function popuptoSessionToFile (e,sPath,sWinHandle,ctrlobj) {//#20040605,Samuel,E
	var showx;
	var showy;
	if (document.all){
		showx = e.screenX - e.offsetX + 8 - 400;
		showy = e.screenY - e.offsetY + 24; // + deltaY;
	}
	else {
		showx = e.screenX - 400;
		showy = e.screenY; // + deltaY;
	}

	newWINwidth = 210 + 4 + 18;

	window.open(sPath,sWinHandle,"width=420px,height=320px,left="+showx+"px,top="+showy+"px,menubar=no,toolbar=no,scrollbars=yes,resizable=yes,location=no,status=no");
}

