<!--

function emailAddress(a,symbol) {
	for (i = 0; i < a.length; i++) {
		document.write(a[i]);
		if (i == 0) {
			document.write(symbol);
		} else if (i+1 < a.length) {
			document.write('.');
		}
	}
}

function emailLink(a) {
	document.write("<nobr><a href=\"mailto:");
	emailAddress(a,'@');
	document.write("\">");
	emailAddress(a,'@');
	document.write("</a></nobr>");
}

// function to prevent submitting form data twice
var submitcount=0;
function checkSubmit(spanName,string) {
	if (submitcount == 0) {
		submitcount++;
		// show text
		if(spanName)
			document.getElementById(spanName).innerHTML = string;
		
		return true;
	} else {
		return false;
	}
}

function RemoveHTMLTags(strText, strFormFieldName) {
	/*var regEx = new RegExp("<|%3C|>|%22|%3E|%2F|%3c|%3e|%2f/","g");
	var m = regEx.exec(strText.value);
	if (m == null) {
		//alert("No match"); do nothing
	} else	{
		alert("\r\nPotentially dangerous characters were removed from the " + strFormFieldName + "\r\n Characters like {<>/} are not allowed\r\n");
	}
	strText.value = strText.value.replace(regEx, "");*/
}

function profileTextCounter(txtArea,maxChars,spanName){
	var strTemp = "";
	if (txtArea.value.length > maxChars){
		alert("Oops!  Please shorten your answer.\r\nYour answer can contain up to " + maxChars + " characters, including letters, numbers and underscores.  Watch the counter to tell how many characters you have remaining.");
		strTemp = txtArea.value.substring(0, maxChars);
		txtArea.value = strTemp;
	}
document.getElementById(spanName).innerHTML = maxChars - txtArea.value.length;
}



function new_cap()
	{
		// loads new Cap image
		if(document.getElementById)
		{
			// extract image name from image source (i.e. cut off ?randomness)
			thesrc = document.getElementById("cap").src;
			thesrc = thesrc.substring(0,thesrc.lastIndexOf(".")+4);
			// add ?(random) to prevent browser/isp caching
			document.getElementById("cap").src = thesrc+"?"+Math.round(Math.random()*100000);
		} else {
			alert("Sorry, cannot autoreload Cap image\nSubmit the form and a new image will be loaded");
		}
	}



//-->
