function load_topics(topic_id) { var message = [{topic_id:1,topic_value:''}, {topic_id:2,topic_value:''}, {topic_id:7,topic_value:''}, {topic_id:8,topic_value:''}, {topic_id:9,topic_value:''}, {topic_id:10,topic_value:''}, {topic_id:13,topic_value:''}, {topic_id:14,topic_value:''}, {topic_id:15,topic_value:''}, {topic_id:16,topic_value:''}]; for (i = 0; i < message.length; i++) { topic_tag = "topics_data" + message[i].topic_id; if(document.all){ if (document.all(topic_tag)) { document.all(topic_tag).innerHTML = message[i].topic_value; } }else if(document.layers) { if (document.layers[topic_tag]) { document.layers[topic_tag].document.open(); document.layers[topic_tag].document.write(message[i].topic_value); document.layers[topic_tag].document.close(); } }else if(document.getElementById) { if (document.getElementById(topic_tag)) { document.getElementById(topic_tag).innerHTML = message[i].topic_value; } } } }