var sta_res_var_nrc='';var sta_all_adj_n='';var sta_all_adj_r='';var sta_glob_cnt='';var sta_norm_cnt='';var sta_rev_cnt='';var sta_res_var_n='';var sta_res_var_r='';var sta_res_var_c='';var sta_res_var_all='';var sta_is_match=0;var sta_is_many=0;var sta_combined_off=0;var sta_rec_min=60;var sta_rec_max=90;var sta_rvn_tmp='';var sta_sc_fn=0;var sta_sc_fr=0;var sta_sc_fc=0;if(sta_TestMode=='3'){sta_display();}function sta_display(){if(sta_respond==1){sta_header_comment=(sta_demo==1)?sta_EvalEmAll(sta_comment['demo_mode']):'';sta_AdjSel();res_var=sta_result.split('');min_sel_n=parseInt(res_var[11]+''+res_var[12]+''+res_var[13],10);max_sel_n=240-min_sel_n;min_sel_r=parseInt(res_var[14]+''+res_var[15]+''+res_var[16],10);max_sel_r=240-min_sel_r;sta_sc_fn=(parseInt(res_var[17])!=1)?parseInt(res_var[17]+res_var[18],10):100;sta_sc_fr=(parseInt(res_var[19])!=1)?parseInt(res_var[19]+res_var[20],10):100;sta_sc_fc=Math.round((sta_sc_fn+sta_sc_fr)/2);res_var_01=CompPr(res_var[0],res_var[1]);res_var_23=CompPr(res_var[2],res_var[3]);res_var_45=CompPr(res_var[4],res_var[5]);res_var_68=CompPr(res_var[6],res_var[8]);res_var_79=CompPr(res_var[7],res_var[9]);res_var_1011=CompPr(res_var_68,res_var_79);sta_res_var_n=res_var[0]+res_var[2]+res_var[4]+CompPr(res_var[6],res_var[7]);sta_res_var_r=res_var[1]+res_var[3]+res_var[5]+CompPr(res_var[8],res_var[9]);sta_res_var_c=res_var_01+res_var_23+res_var_45+res_var_1011;adj_n_sl=(sta_all_adj_n=='')?0:sta_all_adj_n.split(',').length;adj_r_sl=(sta_all_adj_r=='')?0:sta_all_adj_r.split(',').length;sta_all_adj_n+=' ['+adj_n_sl+'].';sta_all_adj_r+=' ['+adj_r_sl+'].';ChkSel(adj_n_sl,adj_r_sl);var cmt=function(sg_,jp_,mm_){return "Further analysis of the results "+sg_+" that your type could be a "+(((jp_=='P'&&mm_==1)||(jp_=='J'&&mm_==0))?"<b>P</b>erceiving":"<b>J</b>udging")+" type. ";};var sc_r=new Array();var f_an="";var comp123="";j_p_c=res_var_1011;if(sta_combined_off!=1){comp123=res_var[9]+res_var_1011+res_var[10];sc_r['J']=0;sc_r['P']=0;sc_r['x']=0;for(st_p=0;st_p<3;st_p++){sc_r[comp123.charAt(st_p)]++;}if(sc_r['J']>1){j_p_c='J';}else if(sc_r['P']>1){j_p_c='P';}else{j_p_c='x';}if(res_var[10]=='X'){res_var[10]='x';j_p_c='x';}if(res_var_1011=='x'&&j_p_c!='x'){f_an=cmt('indicates',j_p_c,1);}if(res_var_1011!='x'&&j_p_c=='x'){f_an=cmt('shows a possibility',res_var_1011,0);}if(res_var_1011!=j_p_c&&res_var_1011!='x'&&j_p_c!='x'){f_an=cmt('strongly indicates',j_p_c,1);}if(j_p_c!='x'&&j_p_c!=res_var[10]&&res_var[10]!='x'){j_p_c='x';f_an=cmt('shows',res_var[10],1);}}sta_res_var_nrc=res_var_01+res_var_23+res_var_45+j_p_c;all_types=sta_types_are.split(',');is_more=0;for(i=0;i<16;i++){sta_is_match=0;for(k=0;k<4;k++){if(all_types[i].charAt(k+3)==sta_res_var_nrc.charAt(k)){sta_is_match++;}if(sta_res_var_nrc.charAt(k)=="x"){sta_is_match++;sta_is_many=1;}}if(sta_is_match==4){sta_res_var_all+=((is_more)?',':'')+'<br>'+all_types[i];last_type=all_types[i];is_more=1;}if(all_types[i].substring(3,7)==sta_tchoice){sta_rvn_tmp=all_types[i];}}if(sta_rvn_tmp!=''){sta_res_var_nrc=sta_tchoice;}conf_disp_not=0;cmt7=(adj_n_sl<sta_rec_min||adj_r_sl<sta_rec_min||adj_n_sl>sta_rec_max||adj_r_sl>sta_rec_max)?"The recommended number of selections for each mode is "+sta_rec_min+"-"+sta_rec_max+".":"";conf_disp_not=(sta_norm_cnt==''&&sta_rev_cnt==''&&sta_glob_cnt=='')?1:conf_disp_not;cmt1="This summarises your type as";cmt2=" one of the following (in alphabetical order)";cmt3=":<br>";cmt45="<br><br>This result is inconclusive."+((sta_combined_off==1)?" Completing the test in both modes":((cmt7!='')?" Following the recommended number of selections":" Revising your selections"))+" may produce a conclusive result.";cmt4=(sta_rvn_tmp=='')?cmt45:"<br><br>Although the test results show that your type could be either of the above, you think it is:<br><br>"+sta_rvn_tmp+".";cmt5=(sta_combined_off==1)?"<br><br>This may or may not be your true psychological type. You will need to complete the test in both modes in order to confirm this result.":"<br><br>Assuming you have fully understood and were following the suggested guidelines to operate the test, this result may indeed indicate your type. However, it is your own responsibility to verify the accuracy of this result.";cmt6="The presence of this section indicates that you may be doing something wrong. Please refer to the guidelines.";cmt_sf=(sta_sc_fn!=0||sta_sc_fr!=0)?"The Scoring factor shows how much you are aware of your type and/or the testing procedure. Anything close to and above 0.8 is considered high and could interfere with authenticity of the test outcome.":"";sta_res_var_all+='.';sta_res_var_all=cmt1+((sta_is_many)?cmt2:"")+cmt3+sta_res_var_all+((sta_is_many)?cmt4:cmt5);sta_info_text[3]=sta_header_comment+'<br>'+MK_Tab(2,"<b><u>Self-description</u><b>",sta_all_adj_n,sta_all_adj_r,"",0,cmt7,"","","")+'<br>'+((conf_disp_not)?'':MK_Tab(3,"<b><u>Conflicting selections</u></b>",sta_norm_cnt,sta_rev_cnt,sta_glob_cnt,0,cmt6,"","","")+'<br>')+MK_Tab(3,"<b><u>E/I choice</u></b> (<b>E</b> - Extraversion, <b>I</b> - Introversion, <b>x</b> - Undefined)",res_var[0],res_var[1],res_var_01,1,"","","","")+'<br>'+MK_Tab(3,"<b><u>S/N choice</u></b> (<b>S</b> - Sensation, <b>N</b> - Intuition, <b>x</b> - Undefined)",res_var[2],res_var[3],CompPr(res_var[2],res_var[3]),1,"","","","")+'<br>'+MK_Tab(3,"<b><u>F/T choice</u></b> (<b>F</b> - Feeling, <b>T</b> - Thinking, <b>x</b> - Undefined)",res_var[4],res_var[5],CompPr(res_var[4],res_var[5]),1,"","","","")+'<br>'+JPtab("<b><u>J/P choice</u></b> (<b>J</b> - Judgement, <b>P</b> - Perception, <b>x</b> - Undefined)",res_var[6],res_var[7],res_var[8],res_var[9],res_var_68,res_var_79,"","","")+'<br>'+MK_Tab(3,"<b><u>Scoring factor</u></b>",(sta_sc_fn==0)?"x":sta_sc_fn/100,(sta_sc_fr==0)?"x":sta_sc_fr/100,(sta_combined_off)?"x":sta_sc_fc/100,1,cmt_sf,"","","")+'<br>'+MK_Tab(3,"<b><u>Summary</u></b>",sta_res_var_n,sta_res_var_r,(sta_combined_off)?"xxxx":sta_res_var_c,1,f_an+sta_res_var_all,"","","")+'<br>';}else{sta_respond=2;sta_can_proceed=0;if(confirm(sta_EvalEmAll(sta_comment['server_no_response']))){sta_ls_data[3]=(sta_SaveOpt==1)?sta_TimeStamp()+'':'';sta_wlh_all((sta_SaveOpt==1)?4:5);}else{sta_wlh_all(3);}}}function sta_AdjSel(){norm_contr=new Array();rev_contr=new Array();add_br_g='';add_br_n='';add_br_r='';add_adj_n='';add_adj_r='';dnd=sta_Decoder(sta_ls_data[1]);drd=sta_Decoder(sta_ls_data[2]);for(k=0;k<dnd.length;k++){c_adj_n=eval(sta_adj[sta_sorted_about[k]].split('.')[1]);if(dnd.charAt(k)=="1"&&drd.charAt(k)=="1"){add_adj_n=sta_sorted_about[k];add_adj_r='NOT '+sta_sorted_about[k];sta_all_adj_n+=(sta_all_adj_n=='')?add_adj_n:(add_adj_n!='')?', '+add_adj_n:'';sta_all_adj_r+=(sta_all_adj_r=='')?add_adj_r:(add_adj_r!='')?', '+add_adj_r:'';sta_glob_cnt+=add_br_g+sta_sorted_about[k]+'<br>NOT&nbsp;'+sta_sorted_about[k];add_br_g='<br><br>';}else if(dnd.charAt(k)=="1"&&drd.charAt(k)=="0"){add_adj_n=sta_sorted_about[k];sta_all_adj_n+=(sta_all_adj_n=='')?add_adj_n:(add_adj_n!='')?', '+add_adj_n:'';}else if(dnd.charAt(k)=="0"&&drd.charAt(k)=="1"){add_adj_r='NOT '+sta_sorted_about[k];sta_all_adj_r+=(sta_all_adj_r=='')?add_adj_r:(add_adj_r!='')?', '+add_adj_r:'';}else{add_adj_n='';add_adj_r='';}try{cond2=(typeof(c_adj_n)!='undefined')}catch(kon){cond2=false;}if(cond2){if(dnd.charAt(k)=="1"){try{cond3=(typeof(norm_contr[c_adj_n])=='undefined')}catch(kon){cond3=true;}if(cond3){norm_contr[c_adj_n]=sta_sorted_about[k];}else{sta_norm_cnt+=add_br_n+norm_contr[c_adj_n]+'<br>'+sta_sorted_about[k];add_br_n='<br><br>';}}if(drd.charAt(k)=="1"){try{cond4=(typeof(rev_contr[c_adj_n])=='undefined')}catch(kon){cond4=true;}if(cond4){rev_contr[c_adj_n]='NOT&nbsp;'+sta_sorted_about[k];}else{sta_rev_cnt+=add_br_r+rev_contr[c_adj_n]+'<br>NOT&nbsp;'+sta_sorted_about[k];add_br_r='<br><br>';}}}}}function CompPr(left,right){return(left==right)?left:(left=="x")?right:(right=="x")?left:"x";}function MK_Tab(t_cols,t_title,vr_n,vr_r,vr_b,mid,_coms,n_f,r_f,c_f){vr_b=(sta_combined_off&&vr_b!="xxxx"&&vr_b!="")?"x":vr_b;col_pt=(t_cols==3)?"33%":"50%";row1='<td class="sta-tcell" style="height:22px;';row2='<td valign="top" class="sta-tcell" style="'+((mid)?'vertical-align:middle; font-weight:bold;':'text-align:left;')+' padding:10px;';border_left=' border-left-width:1px;';if(t_cols!=1){return '<center><table class="sta-restable" cellpadding="0" cellspacing="0" style="width:'+sta_restable.width+'px;"><tr><td colspan="'+t_cols+'" class="sta-headcell">'+t_title+'</td></tr><tr>'+row1+border_left+'" width="'+col_pt+'">'+((n_f=="")?'Normal mode':n_f)+'</td>'+row1+'" width="'+col_pt+'">'+((r_f=="")?'Reversed mode':r_f)+'</td>'+((t_cols==3)?row1+'" width="34%">'+((c_f=="")?'Combined mode':c_f)+'</td>':'')+'</tr><tr>'+row2+border_left+'">'+vr_n+'&nbsp;</td>'+row2+'">'+vr_r+'&nbsp;</td>'+((t_cols==3)?row2+'">'+vr_b+'&nbsp;</td>':'')+'</tr>'+((_coms==""||(vr_n=="xxxx"&&vr_r=="xxxx"))?'</table></center>':'<tr><td class="sta-tcell" colspan="'+t_cols+'" style="text-align:left; padding:10px;'+border_left+'">'+_coms+'</td></tr></table></center>');}else{return '<center><table class="sta-restable" cellpadding="0" cellspacing="0" style="width:'+sta_restable.width+'px;"><tr><td class="sta-headcell">'+t_title+'</td></tr><tr><td class="sta-tcell" style="text-align:left; padding:10px;'+border_left+'" width="100%">'+_coms+'</td></tr></table></center>';}}function JPtab(t_title,vr_nc,vr_nu,vr_rc,vr_ru,vr_bc,vr_bu){if(sta_combined_off){vr_bc="x";vr_bu="x";}row1='<td colspan="2" class="sta-tcell" style="height:22px;';row2='<td class="sta-tcell" style="height:18px;';row3='<td valign="top" class="sta-tcell" style="padding:10px; font-weight:bold;';border_left=' border-left-width:1px;';return '<center><table class="sta-restable" cellpadding="0" cellspacing="0" style="width:'+sta_restable.width+'px;"><tr><td colspan="6" class="sta-headcell">'+t_title+'</td></tr><tr>'+row1+border_left+'" width="33%">Normal mode</td>'+row1+'" width="33%">Reversed mode</td>'+row1+'" width="34%">Combined mode</td></tr><tr>'+row2+border_left+'" width="16%">conscious</td>'+row2+'" width="17%">unconscious</td>'+row2+'" width="16%">conscious</td>'+row2+'" width="17%">unconscious</td>'+row2+'" width="17%">conscious</td>'+row2+'" width="17%">unconscious</td></tr><tr>'+row3+border_left+'">'+vr_nc+'&nbsp;</td>'+row3+'">'+vr_nu+'&nbsp;</td>'+row3+'">'+vr_rc+'&nbsp;</td>'+row3+'">'+vr_ru+'&nbsp;</td>'+row3+'">'+vr_bc+'&nbsp;</td>'+row3+'">'+vr_bu+'&nbsp;</td></tr></table></center>';}function ChkSel(adj_n_s,adj_r_s){more_sel="<b>Please make MORE selections...</b>";less_sel="<b>Please make LESS selections...</b>";sta_all_adj_n=(adj_n_s<min_sel_n)?more_sel:(adj_n_s>max_sel_n)?less_sel:sta_all_adj_n;sta_all_adj_r=(adj_r_s<min_sel_r)?more_sel:(adj_r_s>max_sel_r)?less_sel:sta_all_adj_r;if(sta_all_adj_n==more_sel||sta_all_adj_n==less_sel){sta_glob_cnt="";sta_norm_cnt="";sta_combined_off=1;}if(sta_all_adj_r==more_sel||sta_all_adj_r==less_sel){sta_glob_cnt="";sta_rev_cnt="";sta_combined_off=1;}}
