var gcToggle = "#ffff00";
var gcBG = "#CCCCFF";

//var sPath;

//function popupCalendarDlg(ctrlobj){
//	popupCanlendarDlg("../common",ctrlobj);
//}

function popupCalendarDlg(sPath,ctrlobj){
	//showx = event.screenX - event.offsetX + 8; //- 210 ; // + deltaX;
	showx = event.screenX - event.offsetX + 8 - 184;
	showy = event.screenY - event.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 ){
		ctrlobj.value = retval;
	}else{
	       	//alert("canceled");
	}
}

function popupCalendarDlg2(sPath,ctrlobj){
	//showx = event.screenX - event.offsetX + 8; //- 210 ; // + deltaX;
	showx = event.screenX - event.offsetX + 8 - 184;
	showy = event.screenY - event.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.event.returnValue=false;
	window.open(sPath,sWinHandle,'menubar=no,toolbar=no,scrollbars=yes,resizable=yes,location=no,status=no');
}

function popuptoSessionPullDown (sPath,sWinHandle) {
	showx = event.screenX - event.offsetX + 8 - 184;
	showy = event.screenY - event.offsetY + 24; // + deltaY;
	newWINwidth = 210 + 4 + 18;

	window.event.returnValue=false;
	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 popuptoSessionPullDown2 (sPath,sWinHandle, width) {
	showx = event.screenX - event.offsetX + 8 - 184;
	showy = event.screenY - event.offsetY + 24; // + deltaY;
	newWINwidth = 210 + 4 + 18;

	window.event.returnValue=false;
	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 popupDialog (sPath,sWinHandle, objHandle, winAdjustLeft, winAdjustTop, winWidth, winHeight) {
	showx = objHandle.left + winAdjustLeft;
	showy = objHandle.top + winAdjustTop;
	newWINwidth = 210 + 4 + 18;

	//window.event.returnValue=false;
	//window.open(sPath,sWinHandle,"width=" + winWidth + "px,height=" + winHeight + "px,left="+showx+"px,top="+showy+"px,menubar=no,toolbar=no,scrollbars=yes,resizable=yes,location=no,status=no");
	return window.showModalDialog(sPath, "", "dialogWidth:" + winWidth + "px; dialogHeight:" + winHeight + "px; dialogLeft:"+showx+"px; dialogTop:"+showy+"px; status:no; directories:yes;scrollbars:no;Resizable=no; "  );
}

function popuptoSessionToPrint (sPath,sWinHandle) {
	showx = event.screenX - event.offsetX + 8 - 300;
	showy = event.screenY - event.offsetY + 24; // + deltaY;
	newWINwidth = 210 + 4 + 18;

	window.event.returnValue=false;
	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 (sPath,sWinHandle,ctrlobj) {
	showx = event.screenX - event.offsetX + 8 - 400;
	showy = event.screenY - event.offsetY + 24; // + deltaY;
	newWINwidth = 210 + 4 + 18;

	window.event.returnValue=false;
	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");
}
