function lastname() {
	var filepath = document.getElementById("upload").value;
	var re = /(\\+)/g;
	var filename = filepath.replace(re, "#");
	var one = filename.split("#");
	var two = one[one.length - 1];
	var three = two.split(".");
	var last = three[three.length - 1];
	var tp = "doc,pdf";
	var rs = tp.indexOf(last);
	if (rs >= 0) {
		return true;
	} else {
		alert("The file extension does not match the format.Only *.pdf and *.doc files will be acceptted");
		return false;
	}
}

String.prototype.replaceAll  = function(s1,s2){   
	return this.replace(new RegExp(s1,"gm"),s2);   
};

function showOrHide(obj) {
	$(obj +" .divnone").each(
			function() {
				if($(this).css("display") =="none") {
					$(this).css("display","");
				}
				else {
					$(this).css("display","none");
				}
			}
	);
	
	$(obj +" .plusminus").each(
			function() {
				if($(this).attr("src") =="images/plus.gif") {
					$(this).attr("src","images/minus.gif");
				}
				else {
					$(this).attr("src","images/plus.gif");
				}
			}
	);

}

function showModal(id) {	
	$(id).modal();	
}