function doNavigate(url)
{	
	window.location=url;
	//event.returnValue = false;
	return false;
}
function doNavigate1(url)
{	
	top.window.location=url;
	//event.returnValue = false;
	return false;
}
function pausecomp(millis) 
{
date = new Date();
var curDate = null;

do { var curDate = new Date(); } 
while(curDate-date < millis);
} 
//This function is used to open a new window based on the URL passed to it.
//Expects 3 parameters: 
//url - URl string of the new window
//wname - window name
//wfeatures - window features that can include height and width.

function doC(url,name)
{	
	window_opener = window.open(url, 'Course','width=788,height=525,toolbar=no,scrollbars=yes,resizable=yes,menubar=no,status=no,directories=no,location=no');
	pausecomp(1500);
	try {
		if (window_opener != null) { 
			window_opener.focus();
		}
		else {
			window.location = 'popupdetected.php';
		}
	}
	catch (e) {
		window.location = 'popupdetected.php';
	}
	event.returnValue = false;
	
}
function doCPMenu(url,name)
{	
	window_opener = window.open(url, 'Course','width=788,height=525,toolbar=yes,scrollbars=no,resizable=yes,menubar=yes,status=no,directories=no,location=no');
	window_opener.focus();
	event.returnValue = false;
	
}

function doFullReport(url)
{	
	window_opener = window.open(url, 'Window','width=800,height=600,toolbar=no,scrollbars=yes,resizable=yes,menubar=yes,status=no,directories=no,location=no');
	window_opener.focus();
	event.returnValue = false;
	
}

function do1024(url,name)
{	
	window_opener = window.open(url, name,'width=1024,height=768,toolbar=no,scrollbars=yes,resizable=yes,menubar=yes,status=no,directories=no,location=no');
	window_opener.focus();
	event.returnValue = false;
	
}

function doDescription(url)
{	

	window_opener = window.open(url, 'Description','width=480,height=320,scrollbars=yes,resizable=yes');
	window_opener.focus();
	event.returnValue = false;
	
}

function doWizard(url,name)
{	
	window_opener = window.open(url, name,'width=640,height=480');
	window_opener.focus();
	event.returnValue = false;
	
}
//This function is used to open a new window based on the URL passed to it.
//Expects 3 parameters: 
//url - URl string of the new window
//wname - window name
//wfeatures - window features that can include height and width.

function doConfirmOpen(text, url, wname, wfeatures)
{	
	if (confirm(text))
	{
		window.open(url, wname, wfeatures);
		event.returnValue = false;
	}
	
}

function doConfirmDialog(text, url)
{
	if (confirm(text))
	{
		doNavigate(url);
	}
}

// Need user to confirm logout if there are any QuickCreates still open
function doConfirmLogoutDialog(text, url)
{
    if (confirm(text))
    {
        closeQuickCreates ();
        doNavigate(url);
    }
}

function doSubmit(formId, ocMethod) 
{
	var oForm;
	oForm = document.getElementById(formId);
	oForm.action = ocMethod
	oForm.submit();
}

function doConfirmSubmit(formId, text, URL)
{
	if (confirm(text))
	{
		doSubmit(formId, URL);
	}
}

function bookmark(url,title){
  if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) {
  window.external.AddFavorite(url,title);
  } else if (navigator.appName == "Netscape") {
    window.sidebar.addPanel(title,url,"");
  } else {
    alert("Press CTRL-D (Netscape) or CTRL-T (Opera) to bookmark");
  }
}