// JavaScripts for MicFac Website
// SCKuo 2008_1119, v1

function MF_confirmDelete(IDlabel, prompt2) {
	//if (!prompt2) prompt2=true; //default to prompt user twice when IDlabel specified
	var retval=true;
	
	if (IDlabel)
		retval=confirm("Are you sure you want to delete '" + IDlabel + "'?");
	else prompt2=true;
	if (prompt2 && retval &&
			!(confirm("Are you really sure?  Deleting is irrevocable.")) )
		retval=false;
	return retval;
	}

function MF_contactLink(domain, user, linkText, classType) { //for hiding email addresses
	// linkText and classType are optional parameters
	var str=user + "@"  + domain;
	var retval="";
	if (domain.search(/\./) < 0) str += ".edu";
	if (!linkText || linkText.length <= 0) linkText=str; //str.replace("@","_AT_");
	retval = '<a href="mailto:' + str + '"';
	if (classType && classType.length > 0) retval += ' class="' + classType + '"';
	retval += '>' + linkText + '</a>';
    document.write(retval);
	return retval;
	}

function MF_hideStr(str) { //for hiding email addresses, support function; Not really needed for JavaScript version
	var retval="";
	var rv=0;
	for (i=0; i<str.length; i++) {
		rv=Math.random();
		if (rv > 0.67) retval += str.charAt(i);
		else if (rv > 0.33) retval += "&#x" + str.charCodeAt(i).toString(16);
		else retval += "&#" + str.charCodeAt(i).toString(10);
		}
	return retval;
	}

function MF_calDuration(name, start, end) {
	}

function MF_calTimeList(name, target, start, end) {
	}


