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:197px; dialogHeight:210px; 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:197px; dialogHeight:210px; 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");
}

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");
}
