var gcToggle = "#ffff00";
var gcBG = "#CCCCFF";

function IOFFICE_GetSelected(aCell)
{

  		window.returnValue = aCell.innerText;
		window.close();
  
}


function fPopUpDlg(dialogType,ctl,WINname,WINwidth,WINheight)
{

	var endtarget;
	if(dialogType == "POPUPLIST_Depart"){
        	endtarget = "Depart_Popup.asp";
	}else if(dialogType == "POPUPLIST_Office"){
        	endtarget = "Office_Popup.asp";
	}
	showx = event.screenX - event.offsetX - 4 - WINwidth ; // + deltaX;
	showy = event.screenY - event.offsetY + 18; // + deltaY;

	if (dialogType == "POPUPLIST_CONTRACTSTOP")
	{
	    showx = event.screenX - event.offsetX - WINwidth + 150; 
  	    showy = event.screenY - event.offsetY + 20; 
	} 

	newWINwidth = WINwidth + 4 + 18;
	var features =
		'dialogWidth:'  + newWINwidth  + 'px;' +
		'dialogHeight:' + WINheight + 'px;' +
		'dialogLeft:'   + showx     + 'px;' +
		'dialogTop:'    + showy     + 'px;' +
		'directories:no; localtion:no; menubar:yes; status=no; toolbar=no;scrollbars:no;Resizeable=no';

	retral = window.showModalDialog(endtarget, "", features );
	if(retral!=null)
	{	ctl.value=retral;
	 }
	else {}
}

function fPopUpCalendarDlg()
{
	showx = event.screenX - event.offsetX - 4 - 210 ; // + deltaX;
	showy = event.screenY - event.offsetY + 18; // + deltaY;
	newWINwidth = 210 + 4 + 18;

	window.showModalDialog("CalendarDlg.htm", "", "dialogWidth:230px; dialogHeight:210px; dialogLeft:"+showx+"px; dialogTop:"+showy+"px; status:no; directories:yes;scrollbars:no;Resizable=no; "  );
}

function fPopUpDateDlg(ctrlobj)
{
	showx = event.screenX - event.offsetX - 4 - 210 ; // + deltaX;
	showy = event.screenY - event.offsetY + 18; // + deltaY;
	newWINwidth = 210 + 4 + 18;

	retval = window.showModalDialog("DateDlg.htm", "", "dialogWidth:230px; dialogHeight:210px; dialogLeft:"+showx+"px; dialogTop:"+showy+"px; status:no; directories:yes;scrollbars:no;Resizable=no; "  );
		
	if( retval != null ){
		ctrlobj.value = retval;
	}else{
	}
}

function fPopUpColorDlg(ctrlobj)
{
	showx = event.screenX - event.offsetX - 4 - 210 ; // + deltaX;
	showy = event.screenY - event.offsetY + 18; // + deltaY;
	newWINwidth = 380 + 4 + 18;

	retval = window.showModalDialog("palette.htm", "", "dialogWidth:242px; dialogHeight:333px; dialogLeft:"+showx+"px; dialogTop:"+showy+"px; status:no; directories:yes;scrollbars:no;Resizable=no; "  );
	if( retval != null ){
		ctrlobj.value = retval;
	}else{
	}
}

function fPopUpChart(dialogType,WINwidth,WINheight, para1,para2)
{
	showx = event.screenX / 3 ; // + deltaX;
	showy = event.screenY / 3 ; // + deltaY;

	var features =
		'dialogWidth:'  + WINwidth  + 'px;' +
		'dialogHeight:' + WINheight + 'px;' +
		'dialogLeft:'   + showx     + 'px;' +
		'dialogTop:'    + showy     + 'px;' +
		'directories:no; localtion:no; menubar:no; status=no; toolbar=no;scrollbars:no;Resizeable=no';

	if(dialogType == "POPUP_VOTECHART"){
		endtarget = "../vote/vote-chart.do?action=Init&serialId=" + para1;
	}
	var retval = window.showModalDialog(endtarget, " ", features );
}
