
var CalendarInited=false;
		
function loadCalendar() {
   cal = document.createElement("iframe");
   cal.id="gToday:datetime:agenda.js:ncDateTimeCal:plugins_NoTime.js";
   cal.name="gToday:datetime:agenda.js:ncDateTimeCal:plugins_NoTime.js";
   cal.width=188;
   cal.height=166;
   cal.scrolling="no"; 
   cal.frameBorder=0;
   cal.style.zIndex="999";
   cal.style.left="-550px"; 
   cal.style.visibility="visible"; 
   cal.style.position="absolute"; 
   cal.style.top="0px";
   document.getElementsByTagName("body")[0].appendChild(cal);
   cal.src= basePath+"Lib/jscript/ncCalendar/DateTime/ipopeng.htm" ;
}

function appendCalendar( id, CalHolder ){
   cal = document.createElement("iframe");
   cal.id="gToday:datetime:agenda.js:"+id+":plugins_embed.js";
   cal.name="gToday:datetime:agenda.js:"+id+":plugins_embed.js";
   cal.width=188;
   cal.height=166;
   cal.title="This frame pops up a window that contains a calendar for the user to select certain dates for the from and to date fields in the form";
   cal.description="This frame pops up a window that contains a calendar for the user to select certain dates for the from and to date fields in the form";
   cal.scrolling="no"; 
   cal.frameBorder=0;
   cal.style.zIndex="999";
   cal.style.visibility="visible"; 
   document.getElementById(CalHolder).appendChild(cal);
   cal.src= basePath+"Lib/jscript/ncCalendar/DateTime/iembed.htm" ;

   //setTimeout(id+'.fPopCalendar(document.getElementById("'+id+'"))', 1000);
}

function initCalendar(){
	var oldonload = window.onload;

	if (CalendarInited) return;
	if (typeof window.onload != "function") {
		window.onload = loadCalendar;
	} else {
		window.onload = function() {
			oldonload();
			loadCalendar();
		}
	}
	CalendarInited=true;	
}
