function extlinks() { 
	if (!document.getElementsByTagName) return;
	var lynkz = document.getElementsByTagName("a");
	for (a=0; a<lynkz.length; a++) {
		var lynk = lynkz[a];
		if (lynk.getAttribute("href") && lynk.getAttribute("rel") == "new") lynk.target = "_blank";
	}
}
function validatemail(address) {	
	check = address.match(/^[\w-]+(\.[\w-]+)*@([\w-]+\.)+[a-zA-Z]{2,7}$/);
	if (check == null) {
		return "no";
	}
	else {
		return "ok";
	}
}
/* Additional Functionality using Cookie */
function SetCookie(cookieName,cookieValue,nDays) {
 var today = new Date();
 var expire = new Date();
 if (nDays==null || nDays==0) nDays=1;
 expire.setTime(today.getTime() + 3600000*24*nDays);
 document.cookie = cookieName+"="+escape(cookieValue)
                 + ";expires="+expire.toGMTString();
}
function ReadCookie(cookieName) {
 var theCookie=""+document.cookie;
 var ind=theCookie.indexOf(cookieName);
 if (ind==-1 || cookieName=="") return ""; 
 var ind1=theCookie.indexOf(';',ind);
 if (ind1==-1) ind1=theCookie.length; 
 return unescape(theCookie.substring(ind+cookieName.length+1,ind1));
}
function vmailc(address) {
	
	check = address.match(/^[\w-]+(\.[\w-]+)*@([\w-]+\.)+[a-zA-Z]{2,7}$/);
	

	if (check == null) {
		return "no";
	}
	else {
		return "ok";
	}
}
function firstletter() { //modified
	if (FIRSTletter == "yes") {
	insize = this.value.length;
	currr = this.value.substring(insize-1);
	backtwo = this.value.substring(insize-3,insize-1);
	if (insize == 1) this.value = this.value.toUpperCase();
	else if (backtwo == ". " || backtwo == "! " || backtwo == "? ") { this.value = this.value.substring(0,insize-1) + this.value.substring(insize-1).toUpperCase(); }
	else if (currr == "\n") {
		this.value = this.value + ">";
	}
	else if (this.value.substring(insize-1,insize-2) == ">") {
		this.value = this.value.substring(0,insize-1) + this.value.substring(insize,insize-1).toUpperCase();
		this.value = this.value.replace(">","");
	}
	this.value = this.value.replace(" i "," I ");
	this.value = this.value.replace("  "," ");
	this.value = this.value.replace(" i'll "," I'll ");
	this.value = this.value.replace(". .","..");
	this.value = this.value.replace(" i'd "," I'd ");
	this.value = this.value.replace(" i've "," I've ");
	this.value = this.value.replace(" i'm "," I'm ");
	}
	
}
function capitalizeMe(obj) {
        val = obj.value;
        newVal = '';
        val = val.split(' ');
        for(var c=0; c < val.length; c++) {
                newVal += val[c].substring(0,1).toUpperCase() +
val[c].substring(1,val[c].length) + ' ';
        }
        obj.value = stripSpaces(newVal);
}
function stripSpaces(data) {
    xxx = data;
    while (xxx.substring(0,1) == ' ') xxx = xxx.substring(1);
    while (xxx.substring(xxx.length-1,xxx.length) == ' ') xxx = xxx.substring(0,xxx.length-1);
    return xxx;
}
