// Opens a link in a new window when rel = external
function doLinks() {
if (!document.getElementsByTagName) return false;
var links = document.getElementsByTagName("a");
for (var i=0; i < links.length; i++) {
//New Windows
	if (links[i].rel.match("external") || links[i].rel.match("extNoIcon")) {
		if (links[i].rel.match("external")){links[i].className = links[i].className + " newWin";}
	if (links[i].title == "") {
	links[i].title = "(new window)";
	}
	else {
	links[i].title = links[i].title + " (new window)";
	}
	links[i].onclick = function(e) {
	if(!e)e=window.event;
	if(e.shiftKey || e.ctrlKey || e.altKey) return;
	window.open(this.href);
	return false;
	}
	}

//PDF
	if (links[i].href.indexOf('.pdf') != -1) {
	links[i].className = links[i].className + " pdf";
	if (links[i].title == "") {
	links[i].title = "(PDF Document)";
	}
	else {
	links[i].title = links[i].title + " (PDF Document)";
	}
	links[i].onclick = function(e) {
	if(!e)e=window.event;
	if(e.shiftKey || e.ctrlKey || e.altKey) return;
	window.open(this.href);
	return false;
	}
	}

}
}

function addResume(){
	if($a==1){
			$a=2;
			$('file').style.display='block';
			$('subButton').disabled=true;
			$('subButton').value='Please select a Word document';
		}else{
			$a=1;
			$('file').style.display='none';
			$('subButton').disabled=false;
			$('subButton').value='Submit';
		}
}
function checkExt(field){
	$len=field.value.length;
	$st=$len-3;
	$ext=field.value.substr($st,3);
	if($ext != 'doc'){
		$('subButton').disabled = true;
		$('subButton').value = 'Please select a Word document';
	}else{
		$('subButton').disabled = false;
		$('subButton').value = 'Submit';
		return false;
	}
}


// execute on page load
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}


addLoadEvent(function() {
    doLinks();
})
