<!-- Begin
// Preload images
				
var haveerrors = 0;

function showImage(imagename, imageurl, errors) {
	document[imagename].src = imageurl;
	if (!haveerrors && errors) haveerrors = errors;
}
				

function validateForm(f) {
	
	haveerrors = 0;
	var empty = new Image(); empty.src = "http://works.workopolis.com/images/cw_form_error_fieldempty.gif";
	var email = new Image(); email.src = "http://works.workopolis.com/images/cw_form_error_email.gif";
				
	(document.getElementById("firstname").value.length < 1) // validate first name length
		? showImage("firstnameerror", "http://works.workopolis.com/images/cw_form_error_fieldempty.gif", true)   // no semi-colon after this line!
		: showImage("firstnameerror", "http://works.workopolis.com/images/cw_form_error_blankimage.gif", false); // true = errors, false = no errors
	
	(document.getElementById("lastname").value.length < 1) // validate last name length
		? showImage("lastnameerror", "http://works.workopolis.com/images/cw_form_error_fieldempty.gif", true)
		: showImage("lastnameerror", "http://works.workopolis.com/images/cw_form_error_blankimage.gif", false);
			
	(document.getElementById("comment").value.length < 1) // validate Comments Box
		? showImage("Commenterror", "http://works.workopolis.com/images/cw_form_error_fieldempty.gif", true)
		: showImage("Commenterror", "http://works.workopolis.com/images/cw_form_error_blankimage.gif", false);
				
	//(f.Email.value.search(/^(\w+(?:\.\w+)*)@((?:\w+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i) == -1) // validate email
	(document.getElementById("email").value.search(/^(.+)@(.+)$/) == -1) // validate email
		? showImage("Emailerror", "http://works.workopolis.com/images/cw_form_error_email.gif", true)
		: showImage("Emailerror", "http://works.workopolis.com//images/cw_form_error_blankimage.gif", false);
			
	(document.getElementById("browser").value == 'un_selected')
		? showImage("Browsererror", "http://works.workopolis.com/images/cw_form_error_fieldempty.gif", true)
		: showImage("Browsererror", "http://works.workopolis.com/images/cw_form_error_blankimage.gif", false);
				
	(document.getElementById("os").value == 'un_selected')
		? showImage("OpSyserror", "http://works.workopolis.com/images/cw_form_error_fieldempty.gif", true)
		: showImage("OpSyserror", "http://works.workopolis.com/images/cw_form_error_blankimage.gif", false);
				
	return (!haveerrors);
}
	
function validateFormFR(f) {
	
	haveerrors = 0;
	var empty = new Image(); empty.src = "http://works.workopolis.com/images/cw_form_error_fieldempty_f.gif";
	var email = new Image(); email.src = "http://works.workopolis.com/images/cw_form_error_email_f.gif";

	(document.getElementById("firstname").value.length < 1) // validate first name length
		? showImage("firstnameerror", "http://works.workopolis.com/images/cw_form_error_fieldempty_f.gif", true)   // no semi-colon after this line!
		: showImage("firstnameerror", "http://works.workopolis.com/images/cw_form_error_blankimage_f.gif", false); // true = errors, false = no errors
	
	(document.getElementById("lastname").value.length < 1) // validate last name length
		? showImage("lastnameerror", "http://works.workopolis.com/images/cw_form_error_fieldempty_f.gif", true)
		: showImage("lastnameerror", "http://works.workopolis.com/images/cw_form_error_blankimage_f.gif", false);
			
	(document.getElementById("comment").value.length < 1) // validate Comments Box
		? showImage("Commenterror", "http://works.workopolis.com/images/cw_form_error_fieldempty_f.gif", true)
		: showImage("Commenterror", "http://works.workopolis.com/images/cw_form_error_blankimage_f.gif", false);
				
	//(f.Email.value.search(/^(\w+(?:\.\w+)*)@((?:\w+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i) == -1) // validate email
	(document.getElementById("email").value.search(/^(.+)@(.+)$/) == -1) // validate email
		? showImage("Emailerror", "http://works.workopolis.com/images/cw_form_error_email_f.gif", true)
		: showImage("Emailerror", "http://works.workopolis.com//images/cw_form_error_blankimage_f.gif", false);
			
	(document.getElementById("browser").value == 'un_selected')
		? showImage("Browsererror", "http://works.workopolis.com/images/cw_form_error_fieldempty_f.gif", true)
		: showImage("Browsererror", "http://works.workopolis.com/images/cw_form_error_blankimage_f.gif", false);
				
	(document.getElementById("os").value == 'un_selected')
		? showImage("OpSyserror", "http://works.workopolis.com/images/cw_form_error_fieldempty_f.gif", true)
		: showImage("OpSyserror", "http://works.workopolis.com/images/cw_form_error_blankimage_f.gif", false);
				
	return (!haveerrors);
}


function writeLivepersonFormUno(eng){
	
	if (eng != true) {
	//this is french
	
		document.write("<h3>Aide</h3>Veuillez utiliser le formulaire ci-dessous pour contacter notre Service à la clientèle.<br>");	
		document.write("<p><font face='arial' size='1' color='red'>Les champs marqués d'un * sont requis.</font></p> ");
		document.write("<form method='POST' name='message' action='http://server.iad.liveperson.net/hc/s-88991850/web/ticketpub/msgController.jsp'  ENCTYPE='multipart/form-data' onSubmit='return validateFormFR(this)'>");
		document.write("<input type='hidden' name='cmd' value='submitNonSecureMsg'>");
		document.write("<input type='hidden' name='surveyname' value='JS Support CorpWorks FR'>");
		document.write("<input type='hidden' name='udename!tkt_skill' value='Aide'>");

	}

	else {
	//this is english	
	
		document.write("<h3>Help</h3>If you need help in applying for a job or have questions about how to use the online application system, please use the form below to contact Workopolis e-mail support.<br>");	
		document.write("<p><font face='arial' size='1' color='red'>Required items indicated with *.</font></p> ");
		document.write("<form method='POST' name='message' action='http://server.iad.liveperson.net/hc/s-88991850/web/ticketpub/msgController.jsp'  ENCTYPE='multipart/form-data' onSubmit='return validateForm(this)'>");
		document.write("<input type='hidden' name='cmd' value='submitNonSecureMsg'>");
		document.write("<input type='hidden' name='surveyname' value='JS Support CorpWorks EN'>");
		document.write("<input type='hidden' name='udename!tkt_skill' value='Job Seeker email'>");
	
	}
	
}
	

function writeLivepersonFormDos(eng){
	
	if (eng != true) {
		//alert("this is french");

		document.write("<table cellSpacing='5' cellPadding='0' border='0'>");
		document.write("<tr><td valign='top'>Prénom:<font face='arial' size='2' color='red'>*</font></td>");
		document.write("	<td><input type=text name='udename!survey2652071' id='firstname' size=24  value='' maxlength=1000 ><br>");
		document.write("	<img name='firstnameerror' src='http://works.workopolis.com/images/cw_form_error_blankimage.gif' width='358' height='12' border='0'></td>");
		document.write("</tr>");

		document.write("<tr><td valign='top'>Nom:<font face='arial' size='2' color='red'>*</font></td>");
		document.write("	<td><input type=text name='udename!survey2652072' id='lastname' size=24  value='' maxlength=1000 ><br>");
		document.write("	<img name='lastnameerror' src='http://works.workopolis.com/images/cw_form_error_blankimage.gif' width='358' height='12' border='0'></td></tr>");

    	document.write("<tr><td valign='top'>Courriel:<font face='arial' size='2' color='red'>*</font></td>");
		document.write("	<td><input type=text name='udename!tkt_email' id='email' size=24  value='' maxlength=1000 >  <br>");
		document.write("    <img name='Emailerror' src='http://works.workopolis.com/images/cw_form_error_blankimage.gif' width='358' height='12' border='0'></td></tr>");

    	document.write("<tr><td valign='top'>Votre navigateur:<font face='arial' size='2' color='red'>*</font></td>");
		document.write("	<td><select name='udename!survey2652073' id='browser' size=1><option value='un_selected' >Sélectionner<option value='Microsoft Internet Explorer 7.0' > Microsoft Internet Explorer 7.0<option value='Microsoft Internet Explorer 6.x' > Microsoft Internet Explorer 6.x<option value='Mozilla Firefox 2.0' > Mozilla Firefox 2.0<option value='Mozilla Firefox 1.x' > Mozilla Firefox 1.x<option value='Safari 2.x' > Safari 2.x<option value='Safari 1.x' > Safari 1.x<option value='Netscape Navigator 8.x' > Netscape Navigator 8.x<option value='Other' > Other</select><br>");
    	document.write("    <img name='Browsererror' src='http://works.workopolis.com/images/cw_form_error_blankimage.gif' width='358' height='12' border='0'></td></tr>");

    	document.write("<tr><td valign='top'>Votre système:<font face='arial' size='2' color='red'>*</font></td>");
		document.write("	<td><select name='udename!survey2652074' id='os' size=1><option value='un_selected' >Sélectionner<option value='Windows Vista' > Windows Vista<option value='Windows XP' > Windows XP<option value='Media Center' > Media Center<option value='Windows Server' > Windows Server<option value='Windows 2000' > Windows 2000<option value='Windows 98' > Windows 98<option value='Windows 95' > Windows 95<option value='Windows 3.x' > Windows 3.x<option value='Macintosh (IPhone)' > Macintosh (IPhone)<option value='Macintosh OSX' > Macintosh OSX<option value='Macintosh 9.x' > Macintosh 9.x<option value='Linux' > Linux<option value='Other' > Other</select><br>");
    	document.write("    <img name='OpSyserror' src='http://works.workopolis.com/images/cw_form_error_blankimage.gif' width='358' height='12' border='0'></td></tr>");

    	document.write("<tr><td valign='top'>Question ou commentaire:<font face='arial' size='2' color='red'>*</font></td>");
		document.write("	<td><textarea cols='35' rows='6' name='udename!tkt_message' id='comment'></textarea><br>");
    	document.write("    <img name='Commenterror' src='http://works.workopolis.com/images/cw_form_error_blankimage.gif' width='358' height='12' border='0'></td></tr>");
    
    	document.write("<tr><td valign='top'>Joindre:</td>");
    	document.write("    <td><input type='file' name='attfile1'></td></tr>");
    
    	document.write("<tr><td>&nbsp;</td>");
    	document.write("    <td><input type='file' name='attfile2'></td></tr>");

		document.write("<tr><td>&nbsp;</td>");
		document.write('	<td><input class="button" type="submit" value="Envoyer" name="update" onclick=this.value="Send";></td></tr>'); // onclick='this.value='Send';this.form.submit();'
		  
		document.write("	</table></form>");

	}

	else {
	//this is english	
		document.write("<table cellSpacing='5' cellPadding='0' border='0'>");
		document.write("<tr><td valign='top'>First Name:<font face='arial' size='2' color='red'>*</font></td>");
		document.write("	<td><input type=text name='udename!survey3627071' id='firstname' size=24  value='' maxlength=1000 ><br>");
		document.write("	<img name='firstnameerror' src='http://works.workopolis.com/images/cw_form_error_blankimage.gif' width='358' height='12' border='0'></td>");
		document.write("</tr>");

		document.write("<tr><td valign='top'>Last Name:<font face='arial' size='2' color='red'>*</font></td>");
		document.write("	<td><input type=text name='udename!survey3627072' id='lastname' size=24  value='' maxlength=1000 ><br>");
		document.write("	<img name='lastnameerror' src='http://works.workopolis.com/images/cw_form_error_blankimage.gif' width='358' height='12' border='0'></td></tr>");

    	document.write("<tr><td valign='top'>EMail Address:<font face='arial' size='2' color='red'>*</font></td>");
		document.write("	<td><input type=text name='udename!tkt_email' id='email' size=24  value='' maxlength=1000 >  <br>");
		document.write("    <img name='Emailerror' src='http://works.workopolis.com/images/cw_form_error_blankimage.gif' width='358' height='12' border='0'></td></tr>");

    	document.write("<tr><td valign='top'>Your Browser:<font face='arial' size='2' color='red'>*</font></td>");
		document.write("	<td><select name='udename!survey3627073' id='browser' size=1><option value='un_selected' >Select One<option value='Microsoft Internet Explorer 7.0' > Microsoft Internet Explorer 7.0<option value='Microsoft Internet Explorer 6.x' > Microsoft Internet Explorer 6.x<option value='Mozilla Firefox 2.0' > Mozilla Firefox 2.0<option value='Mozilla Firefox 1.x' > Mozilla Firefox 1.x<option value='Safari 2.x' > Safari 2.x<option value='Safari 1.x' > Safari 1.x<option value='Netscape Navigator 8.x' > Netscape Navigator 8.x<option value='Other' > Other</select><br>");
    	document.write("    <img name='Browsererror' src='http://works.workopolis.com/images/cw_form_error_blankimage.gif' width='358' height='12' border='0'></td></tr>");

    	document.write("<tr><td valign='top'>Your Operating System:<font face='arial' size='2' color='red'>*</font></td>");
		document.write("	<td><select name='udename!survey3627074' id='os' size=1><option value='un_selected' >Select One<option value='Windows Vista' > Windows Vista<option value='Windows XP' > Windows XP<option value='Media Center' > Media Center<option value='Windows Server' > Windows Server<option value='Windows 2000' > Windows 2000<option value='Windows 98' > Windows 98<option value='Windows 95' > Windows 95<option value='Windows 3.x' > Windows 3.x<option value='Macintosh (IPhone)' > Macintosh (IPhone)<option value='Macintosh OSX' > Macintosh OSX<option value='Macintosh 9.x' > Macintosh 9.x<option value='Linux' > Linux<option value='Other' > Other</select><br>");
    	document.write("    <img name='OpSyserror' src='http://works.workopolis.com/images/cw_form_error_blankimage.gif' width='358' height='12' border='0'></td></tr>");

    	document.write("<tr><td valign='top'>Questions or Comments:<font face='arial' size='2' color='red'>*</font></td>");
		document.write("	<td><textarea cols='35' rows='6' name='udename!tkt_message' id='comment'></textarea><br>");
    	document.write("    <img name='Commenterror' src='http://works.workopolis.com/images/cw_form_error_blankimage.gif' width='358' height='12' border='0'></td></tr>");
    
    	document.write("<tr><td valign='top'>Attach Files:</td>");
    	document.write("    <td><input type='file' name='attfile1'></td></tr>");
    
    	document.write("<tr><td>&nbsp;</td>");
    	document.write("    <td><input type='file' name='attfile2'></td></tr>");

		document.write("<tr><td>&nbsp;</td>");
		document.write("	<td><input class='button' type='submit' value='Send' name='update'></td></tr>");
		  
		document.write("	</table></form>");
	
	}
	
}

function getURLParam(strParamName){
    var strReturn = "";
    var strHref = window.location.href;
    if ( strHref.indexOf("?") > -1 ){
        var strQueryString = strHref.substr(strHref.indexOf("?"));
        var aQueryString = strQueryString.split("&");
        for ( var iParam = 0; iParam < aQueryString.length; iParam++ ){
            if (
    aQueryString[iParam].indexOf(strParamName + "=") > -1 ){
                var aParam = aQueryString[iParam].split("=");
                strReturn = aParam[1];
                break;
            }
        }
    }
    return strReturn;
}

function writeThanks(eng){
	
	if (eng != true) {
		document.write("<h3>Merci.</h3>");
		document.write("<p>Vos commentaires ont été envoyés. Nous vous répondrons dans les plus brefs délais.</p>");
		document.writeln('Votre formulaire a été soumis avec succès. Votre numéro d’identification est : '+getURLParam("ticketid"));
	}
	else {
		document.write("<h3>Thank you.</h3>");
		document.write("<p>Your comments have been sent. We will address any concerns you may have. You should expect a reply in the next few days.</p>");
		document.writeln('<p>Your form was successfully submitted. Your ticket ID is: <b>'+getURLParam("ticketid") + '</b></p>');
	}
}

//  End -->