1/* $Id: index.js 15469 2008-12-19 06:34:44Z testyang $ */ 2var best_str = new Object(); 3var new_str = new Object(); 4var hot_str = new Object(); 5 6function init_rec_data() 7{ 8 best_str[0] = document.getElementById("show_best_area") == null ? '' : document.getElementById("show_best_area").innerHTML; 9 new_str[0] = document.getElementById("show_new_area") == null ? '' : document.getElementById("show_new_area").innerHTML; 10 hot_str[0] = document.getElementById("show_hot_area") == null ? '' : document.getElementById("show_hot_area").innerHTML; 11} 12 13function get_cat_recommend(rec_type, cat_id) 14{ 15 if (rec_type == 1) 16 { 17 if (typeof(best_str[cat_id]) == "string") 18 { 19 document.getElementById("show_best_area").innerHTML = best_str[cat_id]; 20 return; 21 } 22 } 23 else if (rec_type == 2) 24 { 25 if (typeof(new_str[cat_id]) == "string") 26 { 27 document.getElementById("show_new_area").innerHTML = new_str[cat_id]; 28 return; 29 } 30 } 31 else 32 { 33 if (typeof(hot_str[cat_id]) == "string") 34 { 35 document.getElementById("show_hot_area").innerHTML = hot_str[cat_id]; 36 return; 37 } 38 } 39 Ajax.call('index.php?act=cat_rec', 'rec_type=' + rec_type + '&cid=' + cat_id, cat_rec_response, "POST", "TEXT"); 40} 41 42function cat_rec_response(result) 43{ 44 var res = result.parseJSON(); 45 if (res.type == 1) 46 { 47 var ele = document.getElementById("show_best_area"); 48 best_str[res.cat_id] = res.content; 49 } 50 else if (res.type == 2) 51 { 52 var ele = document.getElementById("show_new_area"); 53 new_str[res.cat_id] = res.content; 54 } 55 else 56 { 57 var ele = document.getElementById("show_hot_area"); 58 hot_str[res.cat_id] = res.content; 59 } 60 ele.innerHTML = res.content; 61} 62 63if (document.all) 64{ 65 window.attachEvent("onload", init_rec_data); 66} 67else 68{ 69 window.addEventListener("load", init_rec_data, false); 70} 71 72function change_tab_style(item, elem, obj) 73{ 74 elem = elem.toUpperCase(); 75 var itemObj = document.getElementById(item); 76 var elems = itemObj.getElementsByTagName(elem); 77 var _o = obj.parentNode; 78 while(_o.nodeName != elem) 79 { 80 _o = _o.parentNode; 81 } 82 for (var i=0,l=elems.length; i<l; i++) 83 { 84 elems[i].className = 'h2bg'; 85 } 86 _o.className = ''; 87}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.