1 function toggleFingerprints() { 2 var formSelect=document.forms[0].elements[0]; 3 var type=formSelect.selectedIndex; 4 var idx=document.URL.indexOf("php?"); 5 if (idx==-1) { 6 window.open(document.URL+"?fp_type="+type, "_self"); 7 } else { 8 window.open(document.URL.substring(0,idx)+"php?fp_type="+type, "_self"); 9 } 10 } 11 12 function setFingerprintsType() { 13 var idx=document.URL.indexOf("?"); 14 var type=0; 15 if (idx != -1) { 16 var typeStr=document.URL.substring(idx+1, document.URL.length); 17 idx=typeStr.indexOf("="); 18 if (idx != -1) { 19 var ch=typeStr.substring(idx+1, idx+2) 20 switch (ch) { 21 case '1': 22 type=1; 23 break; 24 case '2': 25 type=2; 26 break; 27 } 28 } 29 } 30 var formSelect=document.forms[0].elements[0]; 31 formSelect.selectedIndex=type; 32 } 33