var win=null

function openDep(email, name, jobtitle, jobref) {
  closeDep();  // will close if already open
  win = window.open("", "dep", "height=320,width=525,resizable,left=110,screenX=110,top=100,screenY=100");
  var doc = win.document;
  doc.open("text/html", "replace");
  doc.write("<HTML><HEAD><TITLE>Datascope: Send your CV</TITLE><link rel=\"stylesheet\" href=\"jobcover.css\" type=\"text/css\"></HEAD>");
  doc.write("<BODY>");
  doc.write("<h3>Send your CV</h3>");
  //doc.write("What we need to know when you email your CV:");
  doc.write("<ul>");
  doc.write("<li>Please be aware that by sending your CV to us you are registering with Datascope Recruitment.  Once registered we may immediately send your details to interested companies.  If you do not consent to this you need to let us know as soon as possible (ideally in the body of this email).");
  doc.write("<li>Are there any companies to whom you would not want your details to be sent?");
  doc.write("</ul>");
  doc.write("The following information would also be very useful for us:");
  doc.write("<ol>");
  doc.write("<li>Tell us where you'd ideally want to work, and which locations you'd consider");
  doc.write("<li>The salary you're on and the salary you're seeking");
  doc.write("<li>If you are <b>not</b> an EU passport holder and are looking for work in the EU and need a work permit, or if you are applying for an opportunity that is in a country outside the EU, and need a work permit, please advise us of your situation.");  
  doc.write("</ol>");
  doc.write("<p>Email: <a href='mailto:"+email+"?subject=FAO "+name+": "+jobtitle+" - job ref "+jobref+"&body=[Please attach your CV - preferably as a Word document. If you send an email for each job ref please attach your CV to one email only]'>" + email + "</a> re "+jobtitle+" - job ref "+jobref);
  doc.write("</BODY></HTML>");
  doc.close();
  win.focus();
}

function closeDep() {
  if (win && win.open && !win.closed) win.close();
}
