if(sta_can_proceed){if(sta_bookmark&&sta_bookmark_backup&&sta_NormOrRev&&sta_online){sta_wlh_all(0);}else if(sta_bookmark&&sta_bookmark_backup&&sta_TestMode=='4'&&sta_online&&sta_ls_data.length==4){sta_wlh_all(6);}else{if(!sta_opall&&sta_mac_is&&(/MSIE 4|MSIE 5\.0/i.test(navigator.userAgent))){if(confirm('You need a newer version of the Internet Explorer in order for the Socionics Type Assistant to work properly!\n\nWould you like to upgrade now?')){window.open('http://www.microsoft.com/mac/',parseInt(Math.random()*1000000,10)+'');}}sta_DrawAll(sta_Rows,parseInt(sta_TestMode,10),sta_SaveOpt);}}function sta_nb_href(tm){document.cookie='sta_referrer=true';dlp=((sta_op5)?(document.location.pathname+'').split(document.location.search)[0]:document.location.pathname)+"?";if(sta_is_written&&sta_NormOrRev){sta_CHK_all();}sta_ls_data[0]=tm;sta_ls_data[3]=(tm==4)?sta_TimeStamp()+'':'';return(tm==6)?dlp+'0:::':dlp+sta_ls_data.join(':');}function sta_CHK_all(){stm_here=parseInt(sta_TestMode,10);col='';for(i=0;i<240;i++){col+=sta_butsel[sta_sorted_about[i]]+'';}sta_ls_data[stm_here]=sta_Encoder(col);}function sta_DrawAll(r,m,s){var rnd_array=sta_Get_rnd();var doc_write='';doc_write+='<div class="sta-background" style="width:'+sta_bg.width+'px;"><a class="sta-title" href="http://www.socionics.com">Socionics&nbsp;Type&nbsp;Assistant v'+sta_version+'</a><div class="sta-nb">';for(i=0;i<7;i++){if(!(i==4&&s==0)){doc_write+=(i==m&&i!=6&&sta_tchoice.length!=4)?'<span class="sta-navbutton-selected">'+sta_but_mode[i]+'</span>':'<a href="'+sta_but_mode[i].split('&nbsp;').join(':')+':" class="sta-navbutton-default" onmousedown="try{this.href=sta_nb_href('+i+');}catch(slow){}" onmouseup="blur();" onmouseout="blur();">'+sta_but_mode[i]+'</a>';}}doc_write+='</div><div class="sta-info-window" style="width:'+sta_info.width+'px;">'+sta_info_text[m]+'&nbsp;</div>';if(m==1||m==2){if(!no_innerHTML){doc_write+='<div id="help" class="sta-about"></div>';}data_01=sta_Decoder(sta_ls_data[parseInt(sta_TestMode,10)]);doc_write+='<table cellpadding="0" cellspacing="0" class="sta-tb"><tr>';for(i=0;i<240;i++){rnd_=rnd_array[i];sta_butsel[sta_sorted_about[rnd_]]=parseInt(data_01.charAt(rnd_),10);doc_write+=((i%r==0&&i!=0)?'</tr><tr>':'')+'<td>'+sta_button.html(sta_but_class,sta_sorted_about[rnd_],((sta_butsel[sta_sorted_about[rnd_]]==1)?sta_butstate.on:sta_butstate.off))+'</td>';if(no_innerHTML){doc_write+='<div id="'+sta_sorted_about[rnd_]+'help" class="sta-about"><b>'+sta_sorted_about[rnd_]+'</b> - '+sta_adj[sta_sorted_about[rnd_]].split('.')[0].toLowerCase()+'.</div>';}}doc_write+='</tr></table>';}doc_write+=(sta_TestMode!='4'&&sta_TestMode!='5'&&sta_TestMode!='6')?'<div class="sta-c">'+sta_copy.showCopy(2003)+'</div></div>':'</div>';document.write(doc_write);sta_is_written=true;}function sta_Get_rnd(){s_ar=new Array();rz=Math.round(Math.random()*239);try{for(k=0;k<240;k++){s_ar.splice(Math.round(Math.random()*239),0,((k+rz>239)?k+rz-240:k+rz));}}catch(splice_probs){for(k=0;k<240;k++){s_ar[k]=k;}}return s_ar;}function sta_Flick(linkObj){s=sta_butsel[linkObj.id];linkObj.href=(sta_op6||sta_op5)?((s)?'#':'javascript:void(sta_Select(\''+linkObj.id+'\',1));'):'javascript:void(sta_Select(\''+linkObj.id+'\','+((s)?0:1)+'));';if((sta_op6||sta_op5)&&s){sta_Select(linkObj.id,0)}}function sta_Select(objId,act){if(!sta_op6&&!sta_op5){if(sta_mac_ie51){document.getElementById(objId).className='sta-button-'+((sta_TestMode==1)?'normal':'reversed')+((act)?'-mac':'');}else{document.getElementById(objId).outerHTML=(act)?sta_button.html(sta_but_class,objId,sta_butstate.onNow()):sta_button.html(sta_but_class,objId,sta_butstate.off);}document.getElementById(objId).href=(act)?sta_butstate.onNow():sta_butstate.off;}sta_butsel[objId]=(act==1)?1:0;document.getElementById(((no_innerHTML)?objId:'')+'help').style.visibility=(sta_butsel[objId])?"hidden":"visible";}function sta_Help(what,event,mouse){byId=(no_innerHTML)?what.id:'';doc=document.body;doc2=document.documentElement;dic=document.getElementById(byId+'help');if(mouse==0){dic.style.visibility="hidden";return false;}scroll_no=0;try{if(typeof(document.documentElement.scrollTop)=="undefined"){scroll_no=2;}}catch(whatever){scroll_no=1;}mar=15;cx=event.clientX;cy=event.clientY;xx=cx+dic.offsetWidth+mar+10;yy=cy+dic.offsetHeight+mar+10;if(event.pageX&&event.pageY){x=(xx>window.innerWidth)?event.pageX-dic.offsetWidth-mar:event.pageX+mar;y=(yy>window.innerHeight)?event.pageY-dic.offsetHeight-mar:event.pageY+mar;}else if(scroll_no==1&&cx&&cy){x=(xx>window.innerWidth+window.pageXOffset)?cx-dic.offsetWidth-mar:cx+mar;y=(yy>window.innerHeight+window.pageYOffset)?cy-dic.offsetHeight-mar:cy+mar;}else if(scroll_no==0&&cx&&cy){doc3=(document.compatMode=="CSS1Compat")?doc2:doc;x=(xx>doc3.clientWidth)?cx+doc3.scrollLeft-dic.offsetWidth-mar:cx+doc3.scrollLeft+mar;y=(yy>doc3.clientHeight)?cy+doc3.scrollTop-dic.offsetHeight-mar:cy+doc3.scrollTop+mar;}else if(scroll_no==2&&cx&&cy){dic.innerHTML="";x=(xx>doc.clientWidth)?cx+doc.scrollLeft-dic.offsetWidth-mar:cx+doc.scrollLeft+mar;y=(yy>doc.clientHeight)?cy+doc.scrollTop-dic.offsetHeight-mar:cy+doc.scrollTop+mar;}else{return false;}if(!no_innerHTML){dic.innerHTML='<b>'+what.id+'</b> - '+sta_adj[what.id].split('.')[0].toLowerCase()+'.';}if(!sta_butsel[what.id]){dic.style.visibility="visible";}dic.style.left=x+((sta_op5)?"":"px");dic.style.top=y+((sta_op5)?"":"px");}function sta_VerifyICode(){test_this=new Array();intercode=document.getElementById('sta_icode');i_code_val=intercode.value;while(i_code_val.indexOf(' ')>=0){i_code_val=i_code_val.replace(' ','');}ic_split=i_code_val.split(':');for(d=0;d<2;d++){test_this[d]=sta_Decoder(ic_split[d]);}if(!isNaN(test_this[0])&&test_this[0].length==240&&!isNaN(test_this[1])&&test_this[1].length==240){sta_ls_data[1]=ic_split[0];sta_ls_data[2]=ic_split[1];sta_wlh_all(6);}else{intercode.value="Intercode is INVALID!";}}
