$(document).ready(function(){
// _recognized = 1 (all the fields are prefilled)
// _recognized = 2 (some of the fields are prefilled)
// _recognized = 3 (not authorized to see data)
// _recognized = 0 (none of the fields are prefilled)
// _recognized = blank (none of the fields are prefilled)
//userinfo required for displaying the welcome message
var userinfo = {};
userinfo['first'] = $("#first").val() || $("input[name=first]").val() || '';
userinfo['email'] = $("#email").val() || $("input[name=email]").val() || '';
userinfo['title'] = $("#title").val() || $("input[name=title]").val() || '';
userinfo['company'] = $("#company").val() || $("input[name=company]").val() || '';
userinfo['dispDate'] = $("#last_request").val();
userinfo['lastTS'] = $("#lastTS").val();
userinfo['first'] = encVal(userinfo['first']);
userinfo['email'] = encVal(userinfo['email']);
userinfo['title'] = encVal(userinfo['title']);
userinfo['company'] = encVal(userinfo['company']);
userinfo['dispDate'] = encVal(userinfo['dispDate']);
userinfo['lastTS'] = encVal(userinfo['lastTS']);
var pub = $('input[name="p"]')[0].value;
var lang = $('input[name="ocpcode_lang"]').val();
if(lang == '' || typeof lang === "undefined") { lang = 'eng'; }
$("#welcome3, #welcome4").hide();
$("#welcome1").show();
disp_welcome($("input[name=_recognized]").val(), userinfo);
initTPGADimForm();
if (get_url_param("from") === 'verify') {
$("#tp_qual").show();
$("#login").hide();
//$("#usercontainer").show();commented haritha pform
showExpForm();//haritha pform
$("#userinfo,#save").show();//haritha pform
$("#updatereg,#notme").hide();//haritha pform
disp_welcome(4, userinfo);
dispCustQst();
$("#tp_qual").removeClass("defform");
}
else if ($("input[name=_recognized]").val() == 1) {
$("#usercontainer, #login").hide();
$("#userinfo").show(); //haritha pform
$("#tp_qual").show();
if( $("input[name=form_errors]").val().length <= 1) {
dispQualRec();
dispCustQst();
dispOfferSource();
}
}
else if ($("input[name=_recognized]").val() == 2) {
// _recognized = 2 (some of the fields are prefilled - but not all)
$("#tp_qual").show()
$("#userinfo").show();//haritha pform
$("#login").hide();
if( $("input[name=form_errors]").val().length <= 1) {
dispQualNoRecRepeat();
dispCustQst();
dispOfferSource();
}
$("#tp_qual").removeClass("defform").addClass('defform');
showDefForm();
}
else if ($("input[name=_recognized]").val() == 3) {
// _recognized = 2 (some of the fields are prefilled - but not all)
$("#tp_qual").show()
$("#usercontainer, #userinfo, #login").hide(); //haritha pform
$("#usernoauth").show()
if( $("input[name=form_errors]").val().length <= 1) {
dispQualNoRecRepeat();
dispCustQst();
dispOfferSource();
}
$("#tp_qual").removeClass("defform");
}
else if ($("input[name=_recognized]").val() == '') {
// _recognized = 0 (none of the fields are prefilled)
displayLogin();
$("#login").show()
$("#_submit").val("0");
$("#tp_qual").hide()
}
else {
// _recognized = 0 (none of the fields are prefilled)
displayLogin();
$("#login").show()
$("#_submit").val("0");
$("#tp_qual").hide()
}
//haritha pform savel click
$("#save").click(function(e) {
//showHidePostPredict();
populateSummary();
//showHideContainer();
if($("input[name=_recognized]").val() == 0) {
$("#userinfo,#updatereg").show();//haritha pform
} else {
$("#userinfo,#updatereg,#notme").show();//haritha pform
}
$("#usercontainer,#save").hide();//haritha pform
$("input[name=lclick]").val(0);
});
/*
$("#usercontainer").change(function(e) {
populateSummary();
});
*/
//switch views
$("#switch, #updatereg").click(function(e) {
userinfo['first'] = $("#first").val() || $("input[name=first]").val() || '';
userinfo['email'] = $("#email").val() || $("input[name=email]").val() || '';
userinfo['first'] = encVal(userinfo['first']);
userinfo['email'] = encVal(userinfo['email']);
$("#tp_qual").removeClass("defform");
disp_welcome(2, userinfo);
e.preventDefault();
$("#updatereg, #notme").hide();
$("#save").show();
$("input[name=lclick]").val(1);
$("#usercontainer").show();// commented Haritha pform
showExpForm();
splitForm();
//_gaq.push(['_trackEvent', 'button', 'click', 'updateacct']); haritha pform
});
//not me
$("#notme, #notme_noauth").click(function(e) {
e.preventDefault();
//$("#userinfo").hide(); commented haritha pform
$("#userinfo,#save").show();//haritha pform
$("#updatereg,#notme").hide();//haritha pform
$("input[name=lclick]").val(2);
//$("#usercontainer, #welcome1").show(); //haritha pform
disp_welcome('', userinfo);
$('#email').val('');
$('#first').val('');
$('#last').val('');
$('#title').val('');
$('#company').val('');//haritha pform
$('#state').val('');//haritha pform
$('#country').val('');//haritha pform
// set all the select fields the first option (index 0)
//$("#usercontainer select").each(function() { //haritha pform commented
$("#usercontainer").children(" select").each(function() { //haritha pform added
$(this).attr("selectedIndex", 0);
});
// prafulla: Set the hidden field values to blank
$('input[name=ocpcode1]').val('');
$('input[name=ocpcode2]').val('');
$('input[name=ocpcode3]').val('');
$('input[name=indcode1]').val('');
$('input[name=indcode2]').val('');
// prafulla: Set the opcode and industry field values to default
$('#ocpcode1_dt :first-child').attr('selected', true);
$('#indcode1_dt :first-child').attr('selected', true);
$('#indcode2_dt :first-child').attr('selected', true);
$('#orgemp :first-child').attr('selected', true);//haritha pform
// reset recognized for page back later - sure it should be this way?
$("input[name=_recognized]").val(0);
$("#usercontainer input[type='text'],#usercontainer textarea").each(function() {
$(this).val($(this).attr('title'));
$(this).blur();
});
// leftover prefill fields
$("input[name=fax],input[name=url],input[name=website]").val('');
//$("#ocpcode_secondary,#ocpcode_other,#indcode_secondary,#indcode_other").hide();
$("#ocpcode_other,#container_ocpcode2, #container_ocpcode3,#ocpcode_other,#container_indcode2,#indcode_secondary,#indcode_other").hide();
//Added by Haritha :handle no auth not me scenario
if($(this).attr("id") == 'notme_noauth') {
$("#usernoauth").hide();
$("#_authorized").val("1");
}
notMeCreateCookie();
//empty the coreg table
$("#tp_coreg").empty();
$("input[name=clist]").val('');
//_gaq.push(['_trackEvent', 'button', 'click', 'notme']); //haritha pform throwing error
UnsetErrorMessages();
$("#form_errors").val('');
$("#custom_form_errors").val('');
showDefForm(); //haritha pform
$("#summary_email, #summary_title, #summary_company, #summary_city, #summary_state, #summary_country, #summary_phone").html(''); //haritha pform
});
//clearInput plugin for textbox
$(".clearinput").clearInput();
//clearValue
$("#tp_submit").click(function(){
$("#tp_qual .clearinput").each(function(){
if ($(this).attr('title') == $(this).val()) { $(this).val(''); }
});
});
//modal window
$("#modal-qlogin").jqm();
$(".qualform.login").click(function() {
$("#modal-qlogin").jqm({overlayClass: "qloginOverlay", modal: true});
$("#modal-qlogin").jqmShow();
$("#email-login").blur();
return false;
});
// tp login
$("#submit-login").click(function(e) {
e.preventDefault();
var em = $("#email-login").val();
var ph = $("#phone-login").val();
if (em == '' || em == $("#email-login").attr('title') || ph == '' || ph == $("#phone-login").attr('title')) {
$("#error-login").css("display","block");
return false;
}
$.ajax({
type: "GET",
url: "/c/tplogin.mpl",
data: {email:em, phone:ph},
dataType: "json",
contentType: "application/json; charset=utf-8",
success: aj_pfill,
error: function(XMLHttpRequest, textStatus, errorThrown){
$("#error-login").css("display","block");
}
}); // end ajax
}); // end submit click
// allow the user to submit the form only once each time the page loads
var form_enabled = true;
var brand = $('input[name="brand"]')[0].value;
if(brand == 'ncc' || brand == 'ncc') {
$("#tp_submit").click(function(){
if (form_enabled) {
form_enabled = false;
return true;
}
return false;
});
}
// prafulla - Fix for linkedin login close button
// Source: http://forum.jquery.com/topic/trigger-from-iframe-to-parent-window
// Trigger from iframe to parent window
var domainvar;
domainvar = document.domain;
pathArray = (domainvar).split("\.");
pathArray.shift();
var newdomain = pathArray.join(".");
//console.log(newdomain);
//alert(newdomain);
document.domain = newdomain;
//document.domain = 'tradepub.com';
$(document).bind('myCustomTrigger', function(e) {
$(".jqmClose").click();
});
$('.required').bind ( 'keyup change', function(e) {
// pass ID if available or pass the NAME attribute to HighlightMe function
var hkey = $(this).attr('id');
if (hkey == '' || hkey == undefined) {
hkey = $(this).attr('name');
}
HighlightMe(hkey,'');
});
$('#state').change(function(e) {
HighlightMe('state','');
});
//haritha pform
$('#indcode1_dt').change(function(e){
if($("#lclick").val() == 1 || $("#lclick").val() == 2) {
splitForm();
}
});
//haritha pform
$('#container_ocpcode').change(function(e){
if($("#lclick").val() == 1 || $("#lclick").val() == 2) {
splitForm();
}
});
//Bing 6/1/21 - Prefill database upon exiting page except for NCC
if(brand == 'ncc' || brand == 'ncc-test') {
//DO NOTHING
} else {
$(window).bind('beforeunload', function(){
var brand = $('input[name="brand"]')[0].value;
var data = $('form').serialize();
//Haritha: set authorized to yes
// $('#_authorized').val('1');
// alert( "Auth : "+$('#_authorized').val());
$.ajax(
{
method: 'POST',
//url: 'http://' + brand + '.tradepub.com/c/tpprefill2.mpl',
url: '/c/tpprefill2.mpl',
data: data,
async: false,
success: function(data)
{
//console.log("success");
return true;
},
failure:function(data){console.log("failure");},
error: function (xhr, ajaxOptions, thrownError) {
console.log(xhr.status);
console.log(xhr.responseText);
},
complete: function (xhr, status) { }
});
});
}
// Infer City and State
$('#zip').change(function(e){
$.ajax({
type: "POST",
url: '/c/dynamic_query2013.mpl',
data: "zip=" + $(this).val() + "&brand=" + $('input[name="brand"]')[0].value + "&p=" + $('input[name="p"]')[0].value,
dataType: "json",
success: function(res){
if (res.city != '' && $('select[name=country]').val() == 'USA') {
$('input[name=city]').val(res.city);
}
if (res.state != '' && $('select[name=country]').val() == 'USA') {
$('select[name=state]').val(res.state);
}
}
});
});
// Infer Company, Orgsize and Industry
$('#email').change(function(e){
$.ajax({
type: "POST",
url: '/c/dynamic_query2013.mpl',
data: "email=" + $(this).val() + "&brand=" + $('input[name="brand"]')[0].value + "&p=" + $('input[name="p"]')[0].value,
dataType: "json",
success: function(res){
$('input[name=orgrevstd]').val(res.orgrevstd);
if (res.company != '') {
$('input[name=company]').val(res.company);
$('select[name=orgemp]').val(res.orgsize);
if (res.indcode2 != '') {
$('select[name=indcode1_dt]').val(res.indcode1);
$('select[name=indcode2_dt]').val(res.indcode2);
$('input[name=indcode1]').val(res.indcode1);
$('input[name=indcode2]').val(res.indcode2);
if (res.is_blank_ind2) {
$('select[name=indcode2_dt]').val('');
$('input[name=indcode2]').val('');
}
checkValInd();
//$('select[name=country]').val(res.country);
}
if ($('select[name=country]').val() != res.country && $('select[name=country]').val() != '') {
res.street = '';
res.zip = '';
res.city = '';
res.state = '';
}
if ($('select[name=country]').val() != '') {
res.country = $('select[name=country]').val();
}
else {
$('select[name=country]').val(res.country);
}
res.orgemp = res.orgsize == undefined ? '' : res.orgsize;
res.email = $('#email').val();
aj_pfill(res);
CheckFilterValues();
showHidePostPredict('e');
showGdpr($('#email').val(),$('#orgemp').val(), $('select[name=country]').val(), $('input[name="brand"]')[0].value, $('input[name="p"]')[0].value, lang);
}
}
});
//showGdpr($(this).val(),$('#orgemp').val(), $('select[name=country]').val(), $('input[name="brand"]')[0].value);
});
// Infer Occupation
$('#title').change(function(e){
$.ajax({
type: "POST",
url: '/c/dynamic_query2013.mpl',
data: "title=" + encodeURIComponent($(this).val()) + "&brand=" + $('input[name="brand"]')[0].value + "&p=" + $('input[name="p"]')[0].value,
dataType: "json",
success: function(res){
if ($('select[name=country]').val() != '') {
res.country = '';
}
if (res.ocpcode2 != '') {
$('select[name=ocpcode1_dt]').val(res.ocpcode1);
$('select[name=ocpcode2_dt]').val(res.ocpcode2);
$('input[name=ocpcode1]').val(res.ocpcode1);
$('input[name=ocpcode2]').val(res.ocpcode2);
}
else if (res.ocpcode1 != ''){
$('select[name=ocpcode1_dt]').val(res.ocpcode1);
$('input[name=ocpcode1]').val(res.ocpcode1);
$('select[name=ocpcode2_dt]').val('');
$('input[name=ocpcode2]').val('');
}
if (res.ocpcode3 != '') {
$('select[name=ocpcode3_dt]').val(res.ocpcode3);
$('input[name=ocpcode3]').val(res.ocpcode3);
}
checkValOcp(6);
aj_pfill(res);
CheckFilterValues();
showHidePostPredict(); //haritha pform
//splitForm();
}
});
});
$('#orgemp').change(function(e){
$.ajax({
type: "POST",
url: '/c/dynamic_query2013.mpl',
data: "company=" + encodeURIComponent($("#company").val()) + "&orgsize=" + $(this).val() + "&email=" + $("#email").val() + "&brand=" + $('input[name="brand"]')[0].value + "&p=" + $('input[name="p"]')[0].value,
dataType: "json",
success: function(res){
$('input[name=orgrevstd]').val(res.orgrevstd);
aj_pfill(res);
CheckFilterValues();
//showHidePostPredict(); //haritha pform
showGdpr($("#email").val(),$('#orgemp').val(),$('select[name=country]').val(), $('input[name="brand"]')[0].value, $('input[name="p"]')[0].value, lang);
}
});
});
$('#country').change(function(e){
showGdpr($("#email").val(),$('#orgemp').val(), $('select[name=country]').val(), $('input[name="brand"]')[0].value, $('input[name="p"]')[0].value, lang);
populateSummary();
});
// Infer Company information
$('#company').change(function(e){
$.ajax({
type: "POST",
url: '/c/dynamic_query2013.mpl',
data: "company=" + encodeURIComponent($(this).val()) + "&state=" + $('select[name=state]').val() + "&brand=" + $('input[name="brand"]')[0].value + "&p=" + $('input[name="p"]')[0].value,
dataType: "json",
success: function(res){
$('input[name=orgrevstd]').val(res.orgrevstd);
if ( res.company != '') {
$('select[name=orgemp]').val(res.orgsize);
if (res.indcode2 != '') {
$('select[name=indcode1_dt]').val(res.indcode1);
$('select[name=indcode2_dt]').val(res.indcode2);
$('input[name=indcode1]').val(res.indcode1);
$('input[name=indcode2]').val(res.indcode2);
if (res.is_blank_ind2) {
$('select[name=indcode2_dt]').val('');
$('input[name=indcode2]').val('');
}
checkValInd();
}
if ((res.street != '' && $('input[name=street]').val() != '') || ($('select[name=country]').val() != res.country && $('select[name=country]').val() != '')) {
res.street = '';
}
if ((res.zip != '' && $('input[name=zip]').val() != '') || ($('select[name=country]').val() != res.country && $('select[name=country]').val() != '')) {
res.zip = '';
}
if ((res.city != '' && $('input[name=city]').val() != '') || ($('select[name=country]').val() != res.country && $('select[name=country]').val() != '')) {
res.city = '';
}
if ((res.state != '' && $('select[name=state]').val() != '') || ($('select[name=country]').val() != res.country && $('select[name=country]').val() != '')) {
res.state = '';
}
if ($('select[name=country]').val() != '') {
res.country = '';
}
res.orgemp = res.orgsize == undefined ? '' : res.orgsize;
aj_pfill(res);
CheckFilterValues();
showHidePostPredict(); //haritha pform
$("#title").focus();
}
}
});
});
if($('input[name=orgrevstd]').val() == '') {
$('input[name=orgrevstd]').val('K0000');
}
$("#company").autocomplete("/c/autocomplete2013.mpl",{minChars:50,delay:80});
//If there are no custom questions, hide the div
if (($("#demoscontainer").html()).match(/\w/g) == null) {
$("#demoscontainer").hide();
}
//Show predictive form except when from verify link (update my acct)
if (get_url_param("from") != 'verify') {
var brand = $('input[name="brand"]')[0].value;
if(brand == 'ncc' || brand == 'ncc') {
showExpForm();
populateSummary();
} else {
populateSummary();
showHideContainer();
showHidePostPredict(); //haritha pform
splitForm();
}
} else {
$('#lclick').val(1);
showExpForm();
populateSummary();
}
if ($("input[name=_prstat]").val() == 'show_msg') {
$("#privpolicy").show();
} else if ($("input[name=_prstat]").val() == 'show_qst') {
$("#container_first" ).show();
$("#container_last").show();
$("#container_notice").show();
} else if ($("input[name=_prstat]").val() == 'show_both') {
$("#container_first" ).show();
$("#container_last").show();
$("#container_notice").show();
$("#privpolicy").show();
} else if ($("input[name=_prstat]").val() == 'show_msg_cust') {
$("#privpolicy_cust").show();
} else if ($("input[name=_prstat]").val() == 'show_qst_cust') {
$("#container_first" ).show();
$("#container_last").show();
$("#container_notice").show();
$("#notice").hide();
$("#notice_cust").show();
}
}); // end ready
(function($){$.InFieldLabels=function(b,c,d){var f=this;f.$label=$(b);f.label=b;f.$field=$(c);f.field=c;f.$label.data("InFieldLabels",f);f.showing=true;f.init=function(){f.options=$.extend({},$.InFieldLabels.defaultOptions,d);if(f.$field.val()!=""){f.$label.hide();f.showing=false};f.$field.focus(function(){f.fadeOnFocus()}).blur(function(){f.checkForEmpty(true)}).bind('keydown.infieldlabel',function(e){f.hideOnChange(e)}).change(function(e){f.checkForEmpty()}).bind('onPropertyChange',function(){f.checkForEmpty()})};f.fadeOnFocus=function(){if(f.showing){f.setOpacity(f.options.fadeOpacity)}};f.setOpacity=function(a){f.$label.stop().animate({opacity:a},f.options.fadeDuration);f.showing=(a>0.0)};f.checkForEmpty=function(a){if(f.$field.val()==""){f.prepForShow();f.setOpacity(a?1.0:f.options.fadeOpacity)}else{f.setOpacity(0.0)}};f.prepForShow=function(e){if(!f.showing){f.$label.css({opacity:0.0}).show();f.$field.bind('keydown.infieldlabel',function(e){f.hideOnChange(e)})}};f.hideOnChange=function(e){if((e.keyCode==16)||(e.keyCode==9))return;if(f.showing){f.$label.hide();f.showing=false};f.$field.unbind('keydown.infieldlabel')};f.init()};$.InFieldLabels.defaultOptions={fadeOpacity:0.5,fadeDuration:300};$.fn.inFieldLabels=function(c){return this.each(function(){var a=$(this).attr('for');if(!a)return;var b=$("input#"+a+"[type='text'],"+"input#"+a+"[type='password'],"+"textarea#"+a);if(b.length==0)return;(new $.InFieldLabels(this,b[0],c))})}})(jQuery);
// On ready: toggle highlight class based on the field value
// Set a 'required' class for all the required fields
function ToggleHighlightClass () {
noFillFields = new Array ('city','company','country','email','first','last','notice','notice2','orgemp','phone','street','title','zip','ocpcode_other_text','indcode_other_text');
for (var i in noFillFields) {
HighlightMe(noFillFields[i],'r');
}
}
// On Event: toggle highlight class based on the field value
function HighlightMe (noFillField,req) {
//alert ("field ids = " + noFillField);
if ( req == 'r') {
$('#'+ noFillField).addClass('required');
}
// highlight state if it's blank when the country is US, CA or MX
if ( noFillField == 'country' ) {
var ctryVal = $('#country').val();
if ( ($('#state').val() == '') && (ctryVal == 'USA' || ctryVal == 'CANADA' || ctryVal == 'MEXICO')) {
$('#state').addClass('highlight');
}
else {
$('#state').removeClass('highlight');
}
}
// highlight state if it's blank when the country is US, CA or MX
if ( noFillField == 'state') {
ctryVal = $('#country').val();
if ( ($('#state').val() == '') && (ctryVal == 'USA' || ctryVal == 'CANADA' || ctryVal == 'MEXICO')) {
$('#state').addClass('highlight');
} else {
$('#state').removeClass('highlight');
}
}
else if ( (noFillField).match(/notice/gi)) {
if ( req == 'r') {
$("input[name=" + noFillField + "]").addClass('required');
}
if ($("input[name=" + noFillField + "]:checked").length <= 0 ) {
$('#'+ noFillField).addClass('highlight');
} else {
$('#'+ noFillField).removeClass('highlight');
}
}
else if ( $('#'+ noFillField).val() == '') {
$('#'+ noFillField).addClass('highlight');
} else {
$('#'+ noFillField).removeClass('highlight');
}
}
// ajax prefill
var aj_pfill = function(data) {
var items = [];
var fields = [];
$.each(data, function(key, val) {
var code = /ocpcode|indcode/; //industry+occupation code need to be sorted
if (key.match(code) && val != '') {
//no sort by key, so set value to key=val, then sort on value
items.push(key+'='+val);
}
if (val!='') {
if ($("input[name=" + key + "]:radio").length > 0) {
$("input[name=" + key + "]:radio[value=" + val +"]").attr("checked", true);
}
else if ($("input[name=" + key + "]").length > 0) {
$("input[name=" + key + "]").val(val);
unsetError($('input[name=' + key + ']'));
}
else if ($("select[name=" + key + "]").length > 0) {
$("select[name=" + key + "]").val(val);
unsetError($('select[name=' + key + ']'));
}
}
/* //Haritha - pform
var elem = key;
var h = 1;
if(key.includes('indcode')) {
if($("input[name=indcode1]").val().length == 0 || $("input[name=indcode2]").val().length == 0) {
h = 0;
}
elem = 'indcode';
}
if(key.includes('ocpcode')) {
if($("input[name=ocpcode1]").val().length == 0 || $("input[name=ocpcode2]").val().length == 0 || $("input[name=ocpcode3]").val().length == 0) {
h = 0;
}
elem = 'ocpcode';
}
if(h==1) {
$('#container_'+elem).hide();
} else {
$('#container_'+elem).show();
}
$('#summary_'+key).html(val);
} else {
// if($("input]").val() != 0) {
//Haritha - pform added all of else
var s = 1;
var elem = key;
if(key.includes('indcode')) {
if($("input[name=company]").val().length == 0) {
s = 0;
}
elem = 'indcode';
}
if(key.includes('orgemp')) {
if($("input[name=company]").val().length == 0) {
s = 0;
}
}
if(key.includes('ocpcode')) {
// console.log($("input[name=title]").val());
// console.log($("input[name=title]").val().length);
if($("input[name=title]").val().length == 0) {
s = 0;
}
elem = 'ocpcode';
}
if( s == 1) {
$('#container_'+elem).show();
} else {
$('#container_'+elem).hide();
}
}
*/
fields[key] = val;
});
//sort array so questions are in order
var items2 = items.sort();
//loop through sorted ocp/ind array.
for (i=0; i< items2.length; i++){
//split on '=' and set the dropdown values.
//s[0] is key, s[1] is value
var s = items2[i].split("=");
$("select[name=" + s[0] + "_dt]").val(s[1]);
$("input[name=" + s[0] + "]").val(s[1]);
$('#summary_'+s[0]).html(s[1]);
if (s[0] == 'indcode1') { checkValInd(); }
else if (s[0] == 'ocpcode1') { checkValOcp(7); }
}
if (fields._recognized == 1) {
for (var i in fields) {
if (i == "orgemp_display") { $("#orgemp_display").html(fields[i]); }
else if ($("#pf_" + i)) { $("#pf_" +i).html(fields[i]); }
else if ($("#summary_" + i)) { $("#summary_" +i).html(fields[i]); }
}
$("#usercontainer").hide();
$("#userinfo").show();
disp_welcome(1, data);
} else if (fields._recognized == 2) {
disp_welcome(2, data);
} else if (fields._recognized == 0) {
disp_welcome(2, data);
}
populateSummary();
$("#modal-qlogin").jqmHide();
$("#_submit").val("1");
} // end aj_pfill;
//Function to determine what welcome message to display
//var data should have first, email, dispDate, lastTS
var disp_welcome = function(recognized, data) {
//Figure out the delta days between today and lastTS
var delta_days = 0;
if (data.lastTS) {
var lastTS = data.lastTS;
var date_time = lastTS.split(' ');
var lastTS_date = date_time[0].split('-');
var lastTS = new Date(lastTS_date[0], (lastTS_date[1]-1), lastTS_date[2]);
var today = new Date();
delta_days = (today - lastTS) / 86400000;
}
var delta_days_whole = Math.round(delta_days);
if (data.first == "undefined" || data.first == undefined) { data.first = ''; }
if (data.email == "undefined" || data.email == undefined) { data.email = ''; }
var msg = welcome_msg(data.first,delta_days_whole,delta_days);
if (recognized == 1) {
if (delta_days > 90) {
$("#welcome1").html(msg['a']);
} else {
$("#welcome1").html(msg['b']);
}
} else if (recognized == 2) {
$("#welcome1").html(msg['e']);
} else if (recognized == 3) {
if (delta_days > 90) {
$("#welcome1").html(msg['a']);
} else {
$("#welcome1").html(msg['b']);
}
} else if (recognized == 4) {
$("#welcome1").html(msg['d']);
} else {
$("#welcome1").html(msg['e']);
}
if (data.email) {$("#verifyemail").html(data.email);}
};
var get_url_param = function(name){
var results = new RegExp('[?|&]' + name + '=([^&?#]*)').exec(window.location.href) || 0;
return results[1] || 0;
};
//User - Non Rec - New
function dispQualNoRecNew () {
window['optimizely'] = window['optimizely'] || [];
window.optimizely.push(["trackEvent", "dispQualNoRecNew"]);
}
//User - Recognized
function dispQualRec () {
window['optimizely'] = window['optimizely'] || [];
window.optimizely.push(["trackEvent", "dispQualRec"]);
}
//User - Non Rec Repeat
function dispQualNoRecRepeat() {
window['optimizely'] = window['optimizely'] || [];
window.optimizely.push(["trackEvent", "dispQualNoRecRepeat"]);
}
//Login-Email
function dispLogin () {
if($('#welcome_login').is(':visible')) {
window['optimizely'] = window['optimizely'] || [];
window.optimizely.push(["trackEvent", "dispLogin"]);
}
}
//Login Form - Views
function displayLogin() {
window['optimizely'] = window['optimizely'] || [];
window.optimizely.push(["trackEvent", "displayLogin"]);
}
//Login-linkedin
function dispLoginLinkedin () {
if($('#welcome_login').is(':visible')) {
window['optimizely'] = window['optimizely'] || [];
window.optimizely.push(["trackEvent", "dispLoginLinkedin"]);
}
}
//Form - Custom Question
function dispCustQst () {
var ct = $('#demoscontainer').html();
var ignore = '';
var rem = ct.replace(ignore,'');
if( !$('#demoscontainer').is(':empty') && rem.length > 2) {
window['optimizely'] = window['optimizely'] || [];
window.optimizely.push(["trackEvent", "dispCustQst"]);
} else {
//console.log('no cust qst');
}
}
//Form - Error
function dispFormErr() {
// if( $('#erroralert').css('display') == 'block') {
window['optimizely'] = window['optimizely'] || [];
window.optimizely.push(["trackEvent", "dispFormErr"]);
// } else {
// console.log('no error');
// }
}
//Login - Error
function dispLoginErr() {
window['optimizely'] = window['optimizely'] || [];
window.optimizely.push(["trackEvent", "dispLoginErr"]);
}
//LeadSource/ss Offer
function dispOfferSource() {
if($("input[name=p]").val().indexOf('_') > -1) {
window['optimizely'] = window['optimizely'] || [];
window.optimizely.push(["trackEvent", "dispNonSubSource"]);
} else {
window['optimizely'] = window['optimizely'] || [];
window.optimizely.push(["trackEvent", "dispSubSource"]);
}
}
//populate summary box with info
function populateSummary() {
//console.log('populateSummary called');
var fields_inp = ['email','title','city','company'];
var fields_sel = ['state','country'];
var c =0;
var s = 0;
fields_inp.forEach(function(e) {
//if($('input[name=_authorized').val() != 1 && e != 'email' && e != 'country') { return;}
if($('input[name=_authorized').val() != 1 && e != 'email') { return;}
var val = $("input[name=" + e + "]").val();
if(val.length && e == 'city') { c= 1;}
val = encVal(val);
$('#summary_'+e).html(val);
});
fields_sel.forEach(function(e) {
if($('input[name=_authorized').val() != 1 && e != 'email') { return;}
var val = $("select[name=" + e + "]").val();
if(typeof val == 'undefined') { return;}
if(val.length && e == 'state') { s= 1;}
if(c == 1 && s == 1) {
val = ', '+val;
c = 0; s = 0;
}
val = encVal(val);
$('#summary_'+e).html(val);
});
return true;
}
//show hide fields on initial display
function showHideContainer() {
//console.log('showHideContainer called');
var fields_inp = ['email','first','last','title','phone','city','company','street','zip'];
//var fields_inp = ['email','title','phone','city','company','street','zip'];
var fields_sel = ['state','country'];
var allhide = 1;
fields_inp.forEach(function(e) {
var val = $("input[name=" + e + "]").val();
if($("#form_errors").val().match(e)) {
$("#container_"+e).show();
if(e == 'phone') {//for phone if error show
$("#container_phone, #container_street, #container_dept_div, #container_city, #container_zip, #container_state, #container_country").show();
}
if(e == 'street' ||e == 'zip' ||e == 'city' || e == 'state' || e == 'country') {
$("#container_street, #container_dept_div, #container_city, #container_zip, #container_state, #container_country").show();
}
} else {
if(val.length > 0 ) {
$("#container_" + e ).hide();
if(e == 'street') {
$("#container_dept_div" ).hide();
}
} else {
if(e == 'street' ||e == 'zip' ||e == 'city' || e == 'state' || e == 'country') {
$("#container_street, #container_dept_div, #container_city, #container_zip, #container_state, #container_country").show();
}
allhide = 0;
$("#container_" + e ).show();
$("#container_first" ).show();
$("#container_last").show();
}
}
});
fields_sel.forEach(function(e) {
var val = $("select[name=" + e + "]").val();
if(typeof val == 'undefined') { return;}
if(val.length > 0) {
$("#container_" + e ).hide();
} else {
allhide = 0;
$("#container_" + e ).show();
$("#container_first" ).show();
$("#container_last").show();
}
});
//if(allhide == 1) { $("#usercontainer").hide();}
return true;
}
/*Apply post-prediction show/hide rules
* If company is blank + orgemp, indocde, address are blank, then do not show orgemp, indocde, address as they might be predicted
* If company is not blank + orgemp/indocde/address are blank, then SHOW orgemp, indocde, address as they might be predicted
* If company is not blank + orgemp/indocde/ address are not blank, then do not orgemp, indocde, address as they might be predicted
*
* If street or city or zip or state are blank show address_block (all address except country)
* If all of address_block is filled (except for dept_div) hide address_block
*
* If jobtitle is blank + ocpcode is blank or not - do not show
* If job title is not blank - show ocp only if it is blank
*/
function showHidePostPredict(source) {
//console.log('showHidePostPredict called: '+source);
if($("input[name=lclick]").val() == 1 || $('input[name="brand"]')[0].value == 'ncc') { return true;}
var fields_all = ['email','first','last','phone','street','dept_div','city','zip','title','state','country','indcode1','indcode2','ocpcode','ocpcode2','ocpcode3','company','orgemp','notice'];
//Company prediction
if($("input[name=company]").val().length > 0) {
if(!$("#container_company").is(":visible") || source == 'e') { //hide if company is not already visible or if value is populated by email
$('#container_company').hide();
}
$('#container_orgemp').hide();
$('#container_indcode1, #container_indcode2').hide();
$('#container_street, #container_dept_div, #container_zip,#container_city,#container_state, #container_country').hide();
//show ind fields if no value in hidden
if(!$("input[name=indcode1_dt]").val() || !$("input[name=indcode2_dt]").val()) {
if($("input[name=indcode1]").val().length == 0 || $("input[name=indcode2]").val().length == 0 || $("input[name=indcode1]").val() == 'undefined' || $("input[name=indcode2]").val() == 'undefined') {
$('#container_indcode1,#container_indcode2 ').show();
}
}
if(!$("input[name=orgemp]").val()) {
if($("select[name=orgemp]").val().length == 0) {
$('#container_orgemp').show();
}
}
if((!$("select[name=state]").val() || $("select[name=state]").val() == 'undefined') && ($("select[name=country]").val() == 'USA' && $("select[name=country]").val() == 'MEXICO' && $("select[name=country]").val() == 'CANADA')) {
$('#container_street, #container_dept_div, #container_zip,#container_city,#container_state, #container_country' ).show();
}
if($("input[name=city]").val().length == 0 || $("input[name=street]").val().length == 0 || $("input[name=zip]").val().length == 0) {
$('#container_street, #container_dept_div, #container_zip,#container_city,#container_state, #container_country' ).show();
}
if(!$("select[name=country]").val() || $("select[name=country]").val() == 'undefined') {
$('#container_country').show();
}
} else {
$('#container_company').show();
if(!($("#container_orgemp").is(":visible") && $("#form_errors").val().match(/orgemp/))) { //hide job container if they are not already visible due to errors
$('#container_orgemp').hide();
}
$('#container_indcode1, #container_indcode2').hide();
$('#container_street, #container_dept_div, #container_zip,#container_city,#container_state, #container_country').hide();
}
//Job title
if(!($("#container_ocpcode").is(":visible") && $("#form_errors").val().match(/ocpcode/)) || $("input[name=title]").val().length == 0) { //hide job container if they are not already visible due to errors
$('#container_ocpcode, #ocpcode_secondary').hide();
}
if($("input[name=title]").val().length > 0) {
if(!$("#container_title").is(":visible")) {
$('#container_title').hide();
}
if(!$("input[name=ocpcode1_dt]").val() || !$("input[name=ocpcode2_dt]").val() || !$("input[name=ocpcode3_dt]").val()) {
if($("input[name=ocpcode1]").val().length == 0 || $("input[name=ocpcode2]").val().length == 0 ||$("input[name=ocpcode1]").val() == 'null' ||$("input[name=ocpcode2]").val() == 'null' || $("input[name=ocpcode2]").val() == 'undefined' || $("input[name=ocpcode3]").val().length == 0 || $("input[name=ocpcode3]").val() == 'null' || $("input[name=ocpcode3]").val() == 'undefined') {
$('#container_ocpcode, #container_ocpcode2, #container_ocpcode3, #ocpcode3_dt, #ocpcode_secondary').show();
if($("input[name=ocpcode1]").val().length == 0) { $("#ocpcode1_dt").focus();}
if($("input[name=ocpcode1]").val().length != 0 && $("input[name=ocpcode2]").val().length == 0) { $("#ocpcode2_dt").focus();}
if($("input[name=ocpcode2]").val().length != 0 && $("input[name=ocpcode2]").val() != 'undefined' && $("input[name=ocpcode3]").val().length == 0) { $("#ocpcode3_dt").focus();}
}
}
}
//Finally, apply error rules
if($("#form_errors").val().match(/phone/)) {//phone error show all
$("#container_phone, #container_street, #container_dept_div, #container_city, #container_zip, #container_state, #container_country").show();
}
//any address field error show address block
if($("#form_errors").val().match(/zip/) || $("#form_errors").val().match(/state/) || $("#form_errors").val().match(/country/) ) {
$("#container_street, #container_dept_div, #container_city, #container_zip, #container_state, #container_country").show();
}
//orgemp error only show if company is not blank and has no errors
if($("#form_errors").val().match(/orgemp/) && $("#company").val().length > 0) {
$("#container_orgemp").show();
}
//orgemp error only show if company is not blank and has no errors
if($("#form_errors").val().match(/indcode/) && $("#company").val().length > 0) {
$("#container_indcode1, #container_indcode2").show();
}
splitForm();
}
//split form into 2 col layout
function splitForm() {
//console.log('SplitForm called');
var fields_all = ['email','first','last','phone','company','title','ocpcode','ocpcode2','orgemp','indcode1','indcode2','street','dept_div','zip','city','state','country','notice'];
/* Code to figure out the total number of fields shown
* If the count is > 11, then mark 9 right fields with right class
* and 3
*/
var tc = 0;
fields_all.forEach(function(e) {
if($("#container_"+e).is(":visible")) {
tc++;
if(e == 'ocpcode2') { tc = tc+1;}
if(e == 'address') { tc = tc+4;}
}
});
if(tc>11) {
var c = 0;
$("#tp_qual").removeClass("col2qual").addClass('col2qual');
fields_all.forEach(function(e) {
var f = 'container_'+e;
if(e == 'ocpcode2') {
f = 'ocpcode_secondary';
if($('#ocpcode_level2').is(':empty') ) { return;}
if(!$('#ocpcode_level1').is(':visible') ) { return;}
}
if(e == 'indcode2') {
if($('#indcode_level2').is(':empty') ) { return;}
}
if($("#"+f).is(":visible") || $("#"+f).css('display') == 'block') {
c++;
if(e == 'address') {
c = c+4;
}
if(e == 'ocpcode2') {
if($("#ocpcode3_dt").is(":visible")) { c = c+1;}
if(!$("#ocpcode2_dt").is(":visible")) { c = c-1;}
}
//console.log('Processing: '+e + ' - '+c);
if(c <= 9) {
$("#"+f).removeClass("leftcon rightcon").addClass('leftcon');
//console.log('left: '+e);
} else {
$("#"+f).removeClass("leftcon rightcon").addClass('rightcon');
//console.log('right: '+e);
}
}
});
}
}
//show default form
function showDefForm() {
$('#usercontainer').show();
$('#container_first,#container_last, #container_phone,#container_email, #container_company,#container_title').show();
$('#container_first,#container_last, #container_phone,#container_email, #container_company,#container_title').removeClass("leftcon rightcon");
$('#container_street,#container_dept_div, #container_zip,#container_city, #container_state,#container_country').hide();
$('#container_street,#container_dept_div, #container_zip,#container_city, #container_state,#container_country').removeClass("leftcon rightcon");
$('#container_orgemp, #container_indcode1,#container_indcode2,#container_ocpcode,#ocpcode_secondary,#container_ocpcode3').hide();
$('#container_orgemp, #container_indcode1,#container_indcode2,#container_ocpcode,#ocpcode_secondary,#container_ocpcode3').removeClass("leftcon rightcon");
}
//show complete form - 2 col layout
function showExpForm() {
//console.log('ShowExpForm called');
$('#usercontainer').show();
$('#container_first,#container_last, #container_phone,#container_email, #container_company,#container_title').show();
$('#container_street,#container_dept_div, #container_zip,#container_city, #container_state,#container_country').show();
$('#container_orgemp, #container_indcode1,#container_indcode2,#container_ocpcode,#ocpcode_secondary,#container_ocpcode3, #container_title').show();
splitForm();
}
function showGdpr(e,o,c,b,p,l) {
$.ajax({
type: "POST",
url: '/c/tpPrivacyRules.mpl',
data: "country=" + c + "&orgemp=" + o + "&email=" + e + "&brand=" + b + "&p=" + p + "&lang=" + l,
dataType: "json",
success: function(res){
if(res) {
if (res.status == 'show_msg') {
$("#privpolicy").show();
$("#container_notice").css("cssText", "display:none!important;");
} else if (res.status == 'show_qst') {
$("#container_notice").show();
$("#privpolicy").css("cssText","display:none!important;");
splitForm();
} else if (res.status == 'show_both') {
$("#container_notice").show();
$("#privpolicy").show();
splitForm();
} else if (res.status == 'show_msg_cust') {
$("#privpolicy_cust").html(res.privacy_msg);
$("#privpolicy_cust").show();
$("#privpolicy").css("cssText","display:none!important;");
$("#container_notice").css("cssText", "display:none!important;");
} else if (res.status == 'show_qst_cust') {
$("#notice").hide();
$("#notice_cust").html(res.privacy_msg);
$("#notice_cust").show();
$("#container_notice").show();
$("#privpolicy").css("cssText","display:none!important;");
$("#privpolicy_cust").css("cssText","display:none!important;");
splitForm();
} else {
//$("#privpolicy").css("display","none");
//$("#container_notice").css("display","none");
$("#privpolicy").css("cssText","display:none!important;");
$("#container_notice").css("cssText", "display:none!important;");
$("#privpolicy_cust").css("cssText","display:none!important;");
}
return (1,res);
} else {
$("#privpolicy").css("display","none");
$("#container_notice").css("display","none");
}
}
});
return (0,'');
}
var welcome_msg = function(first, delta_days_whole,delta_days) {
var lang = $("input[name=ocpcode_lang]").val();
var msg = [];
if(lang == '' || typeof lang === "undefined") {
var msgEng= [];
msgEng['a'] = "Welcome Back, "+first+".
"+
"It has been "+delta_days_whole+" days since your last request. If your work profile has changed, please edit your summary and submit your request.";
msgEng['b'] = "Welcome Back, "+first+".
"+ "Please submit your request below.";
msgEng['c'] = "Welcome "+first+".
"+"Please complete your work profile to submit your request.";
msgEng['d'] = "Thank you!
Your email address has been verified. If your work profile has changed, please edit your summary and submit your request."
msgEng['e'] = "Welcome.
Please complete your work profile to submit your request";
msg = msgEng;
// Substitute new text in green h4 tag
document.getElementById('welcome_login').getElementsByTagName("h4")[0].innerText = "Connect or Login with Email";
} else if (lang == 'fra') {
var msgFra = [];
msgFra['a'] = "Bienvenue, "+first+".
"+
"Votre dernière demande remonte à "+delta_days_whole+" jours. Si votre profil professionnel a changé, veuillez modifier votre récapitulatif et envoyer votre demande.";
msgFra['b'] = "Bienvenue, "+first+".
"+ "Veuillez envoyer votre demande ci-dessous.";
msgFra['c'] = "Bienvenue "+first+".
"+
"Veuillez compléter votre profil professionnel pour envoyer votre demande.";
msgFra['d'] = "Merci !
Votre adresse électronique a été vérifiée. Si votre profil professionnel a changé, veuillez modifier votre récapitulatif et envoyer votre demande.";
msgFra['e'] = "Bienvenue.
Veuillez compléter votre profil professionnel pour envoyer votre demande.";
msg = msgFra;
document.getElementById('welcome_login').getElementsByTagName("h4")[0].innerText = "Se connecter ou se connecter avec un e-mail";
} else if (lang == 'spa') {
var msgSpa = [];
msgSpa['a'] = "Bienvenido(a), "+first+".
"+
" Han transcurrido "+delta_days_whole+"días desde su última solicitud. Si su perfil de trabajo cambió, modifique su resumen y envíe la solicitud.";
msgSpa['b'] = "Bienvenido(a), "+first+".
"+ "Envíe su solicitud a continuación.";
msgSpa['c'] = "Bienvenido(a)"+first+".
"+
"Complete su perfil de trabajo para enviar la solicitud.";
msgSpa['d'] = "¡Gracias!
Su dirección de correo electrónico se ha verificado. Si su perfil de trabajo cambió, modifique su resumen y envíe la solicitud.";
msgSpa['e'] = "Bienvenido(a).
Complete su perfil de trabajo para enviar la solicitud";
msg = msgSpa;
document.getElementById('welcome_login').getElementsByTagName("h4")[0].innerText = "Conéctese o inicie sesión con el correo electrónico";
} else if (lang == 'dut') {
var msgDut = [];
msgDut['a'] = "Welkom terug, "+first+".
"+
" Han transcurrido "+delta_days_whole+" dagen geleden uw laatste aanvraag ingediend. Als uw werkprofiel is gewijzigd, dient u uw overzicht te bewerken en uw aanvraag in te dienen.";
msgDut['b'] = "Welkom terug , "+first+".
"+ "Dien uw aanvraag hieronder in.";
msgDut['c'] = "Welkom "+first+".
"+
"Maak uw werkprofiel compleet om uw aanvraag in te dienen.";
msgDut['d'] = "Hartelijk dank!
Uw e-mail adres is geverifieerd. Als uw werkprofiel is gewijzigd, dient u uw overzicht te bewerken en uw aanvraag in te dienen.";
msgDut['e'] = "Welkom.
Maak uw werkprofiel compleet om uw aanvraag in te dienen.";
msg = msgDut;
document.getElementById('welcome_login').getElementsByTagName("h4")[0].innerText = "Verbinding maken of inloggen met e-mail";
} else if (lang == 'deu') {
var msgDeu = [];
msgDeu['a'] = " Willkommen zurück,"+first+".
"+
" Ihre letzte Anfrage war vor "+delta_days_whole+" Tag(en). Wenn sich Ihr Arbeitsprofil geändert hat, bearbeiten Sie Ihre Übersicht und übermitteln Sie Ihre Anfrage.";
msgDeu['b'] = "Willkommen zurück, "+first+".
"+ "Bitte senden Sie Ihre Anfrage unten.";
msgDeu['c'] = "Willkommen,"+first+".
"+
"Bitte vervollständigen Sie Ihr Arbeitsprofil, um Ihre Anfrage zu senden.";
msgDeu['d'] = "Vielen Dank!
Ihre E-Mail-Adresse wurde überprüft. Wenn sich Ihr Arbeitsprofil geändert hat, bearbeiten Sie Ihre Übersicht und übermitteln Sie Ihre Anfrage.";
msgDeu['e'] = "Willkommen.
Bitte vervollständigen Sie Ihr Arbeitsprofil, um Ihre Anfrage zu senden";
msg = msgDeu;
document.getElementById('welcome_login').getElementsByTagName("h4")[0].innerText = "Mit E-Mail verbinden oder einloggen";
} else if (lang == 'por') {
var msgPor = [];
msgPor['a'] = "Bem-vindo de volta, "+first+".
"+
"Já se passaram "+delta_days_whole+" dias desde sua última solicitação. Se seu perfil de trabalho mudou, edite o resumo e envie a solicitação.";
msgPor['b'] = "Bem-vindo de volta "+first+".
"+ "Envie sua solicitação abaixo.";
msgPor['c'] = "Seja bem-vindo "+first+".
"+
"Preencha seu perfil de trabalho para enviar a solicitação.";
msgPor['d'] = "Obrigado!
Seu endereço de e-mail foi verificado. Se seu perfil de trabalho mudou, edite o resumo e envie a solicitação.";
msgPor['e'] = "Seja bem-vindo.
Preencha seu perfil de trabalho para enviar a solicitação";
msg = msgPor;
document.getElementById('welcome_login').getElementsByTagName("h4")[0].innerText = "Conecte-se ou faça login com e-mail";
} else if (lang == 'zho') {
var msgZho = [];
msgZho['a'] = ""+first+".
"+
",欢迎您回来。距您的上一次请求已过去 "+delta_days_whole+" 天。如工作档案有变,请编辑摘要并提交请求。";
msgZho['b'] = "" + first+".
"+ ",欢迎您回来。请提交下方的请求。";
msgZho['c'] = ""+first+".
"+" ,欢迎您。请填写工作档案,并提交请求。";
msgZho['d'] = "非常感谢!您的电子邮件地址已完成验证。如工作档案有变,请编辑摘要并提交请求。";
msgZho['e'] = "欢迎您。请填写工作档案,并提交请求";
msg = msgZho;
document.getElementById('welcome_login').getElementsByTagName("h4")[0].innerText = "Connect or Login with Email";
} else if (lang == 'ita') {
var msgIta = [];
msgIta['a'] = "Bentornato/a , "+first+".
"+
"Sono passati "+delta_days_whole+" giorni dalla tua ultima richiesta. Se il tuo profilo professionale \303\250 cambiato, modifica il riepilogo e invia la tua richiesta.";
msgIta['b'] = "Bentornato/a, "+first+".
"+ "Invia la richiesta di seguito.";
msgIta['c'] = "Benvenuto/a"+first+".
"+
"Completa il tuo profilo professionale per inviare la richiesta.";
msgIta['d'] = "Grazie!
Il tuo indirizzo e-mail è stato verificato. Se il tuo profilo professionale è cambiato, modifica il tuo riepilogo e invia la tua richiesta."
msgIta['e'] = "Benvenuto/a.
Completa il tuo profilo professionale per inviare la richiesta";
msg = msgIta;
document.getElementById('welcome_login').getElementsByTagName("h4")[0].innerText = "Connettiti o accedi con e-mail";
}
return msg;
}
function encVal(str) {
return String(str).replace(//g, '>').replace(/"/g, '"');
}