var popUp; 

function OpenCalendar(idname, postBack)
{
	popUp = window.open('/isas/userinterface/Calendar.aspx?formname=' + document.forms[0].name + 
		'&id=' + idname + '&selected=' + document.forms[0].elements[idname].value + '&postBack=' + postBack, 
		'popupcal', 
		'width=195,height=310,left=200,top=250,scrollbars=yes');
}

function SetDate(formName, id, newDate, postBack)
{
	
	eval('var theform = document.' + formName + ';');
	popUp.close();
	theform.elements[id].value = newDate;
	if (postBack)
	__doPostBack(id,'');
}	

function OpenCompetencies(id)
{
	popUp = window.showModalDialog('/ISAS/UserInterface/Admin/Competencies.aspx?guid=newguid()&id='+id, 
		'popupcomp',
		'dialogWidth:'+screen.availwidth+';dialogHeight:'+screen.availheight+';dialogLeft:0;dialogTop:0;status:no;');
		window.focus();         
}

function OpenModifyCompetencies(id)
{
	popUp = window.showModalDialog('/ISAS/UserInterface/RoutineMaintainence/ModifyCompetencies.aspx?id='+id, 
		'popupcomp',
		'dialogWidth:500;dialogHeight:600;dialogLeft:70;dialogTop:40;status:no;');
		window.focus();         
}

function OpenResource(id)
{
   popUp = window.showModalDialog('ResourceSelect.aspx?courseid='+id,
       'popupResource');
   window.focus();
         
}

function OpenCourseResource()
{
   popUp = window.showModalDialog('CourseResource.aspx',
       'popupCourseResource');
   window.focus();
         
}

function OpenFirm(idname, postBack)
{
	popUp = window.open('/isas/userinterface/FirmFilter.aspx?formname=' + document.forms[0].name + 
		'&id=' + idname + '&postBack=' + postBack, 
		'popupcal', 
		'width=500,height=600,left=200,top=150,scrollbars=yes');
}

function SetFirm(formName, id, SelectedFirm, postBack)
{
	
	eval('var theform = document.' + formName + ';');
	popUp.close();
	theform.elements[id].value = SelectedFirm;	
	if (postBack)
		__doPostBack(id,'');
}	


