function validate(filename) {
     var ext = getExt(filename);
	 if (ext != "") {
     	if(ext == "pdf") {
	         return true;
		 }
		 if(ext == "doc") {
    	     return true;
		 }
		 if(ext == "docx") {
        	 return true;
		 }
    	 alert("Please upload PDF, Doc, or Docx files only.");
	     return false;
	} else {
    	var answer = confirm("Are you sure you wish to submit without a file?")
	    if (answer) {
	        document.getElementById("careers").submit();
    	} else {
			return false;
		}
	}
}

function getExt(filename) {
     var dot_pos = filename.lastIndexOf(".");
     if(dot_pos == -1)
         return "";
     return filename.substr(dot_pos+1).toLowerCase();
}
$(function(){
	$("a[href*='/careers/']").attr("target","_blank");
	$("a[rel*=close]").click(function(){ window.close(); return false(); });
	
	//Careers
	$("#col2 img").each(function(i){ $(this).delay(i*1000).fadeIn(1000); });
	
	$("#careers").submit(function(){
		return validate($("#resume").val());
	});
	if(document.location.hash=="#contact") {
		$.fn.colorbox({href:"#contact", innerWidth:"700px",innerHeight:"200px", opacity:0.5, scrolling:false, inline:true, open:true});
	}
});
























