function set_select_input(ddlID, value, change){ var ddl = document.getElementById(ddlID); for (var i = 0; i < ddl.options.length; i++) { if (ddl.options[i].value == value) { if (ddl.selectedIndex != i) { ddl.selectedIndex = i; if (change){ddl.onchange();} } break; } } } //loads into element external content function get_external_content(url, div, code){ var hostname = window.location.hostname; if(location.href.indexOf("www.") != -1){ url = 'http://'+ hostname + url; }else{ url = 'http://'+ hostname + url; } if (window.XMLHttpRequest) { req = new XMLHttpRequest(); } else if (window.ActiveXObject) { req = new ActiveXObject("Microsoft.XMLHTTP"); } return read_content_FromFile(url, req, div, code); } function read_content_FromFile(filename, req, div, code) { nocache = Math.random(); if(filename.indexOf("?") != -1){ req.open('GET', filename + "&nocache="+nocache); }else{ req.open('GET', filename + "?nocache="+nocache); } req.onreadystatechange = function() { if (req.readyState == 4) { content = req.responseText; blank = "n"; //external use variables precontent = "No Information Available.";//external use variables if(content == ""){content = "No Information Available"; blank = "y";} if(document.getElementById(div) != null){ document.getElementById(div).innerHTML = content; if(code != null){setTimeout(code,1);} } } } req.send(""); } function contains(full, search_str){ var found = false; if(full.indexOf(search_str) != -1){found = true;} return found; } function show_hide(id, type){ element = document.getElementById(id); if(element.style.display == "none"){ element.style.display = type; }else{ element.style.display = "none"; } } function clean_form(fname){ var elem = document.getElementById(fname).elements; var str = ""; for(var i = 0; i < elem.length; i++){ if(elem[i].type == "text"){ elem[i].value = ""; }else if(elem[i].type == "select-one"){ elem[i].value = "-1"; } } } //Example: onfocus="reverse_msg(this,'Write your name');" function revert_value(txt_box, msg, is_pass){ if(txt_box.value == msg){ txt_box.value = ""; if(is_pass){txt_box.type = 'password';} }else if(txt_box.value == "" || txt_box.value == " "){ txt_box.value = msg; if(is_pass){txt_box.type = 'text';} } } function pop_shadow(url, title, width, heigth){ Shadowbox.init({ players: [ 'iframe'] }); Shadowbox.open({ player: 'iframe', title: title, content: url, height: heigth, width: width }); } function IsNumeric(sText) { var ValidChars = "0123456789"; var IsNumber=true; var Char; if(sText){ for (i = 0; i < sText.length && IsNumber == true; i++) { Char = sText.charAt(i); if (ValidChars.indexOf(Char) == -1) { IsNumber = false; } } }else{ IsNumber = false; } return IsNumber; } function reverse_msg(txt_box, msg){ if(txt_box.value == msg){ txt_box.value = ""; } else if(txt_box.value == "" || txt_box.value == " "){ txt_box.value = msg; } } /*Twitter Functions:*/ function display_search(){ var input_text = document.getElementById("search_text"); if(input_text.value != "" && input_text.value != " "){ document.getElementById("tweets_content").style.display = "none"; document.getElementById("search_content").innerHTML = "Searching..."; clearInterval(interval); var params = "?p=" + input_text.value; var url = "utilities/process/tweets/search.php" + params; get_external_content(url, "search_content"); }else{ input_text.focus(); } } function suggest(){ var input_text = document.getElementById("sug_text"); req.open('GET', "https://www.sportsbettingonline.ag/utilities/centralize/pph/utilities/process/tweets/suggest.php?s=" + input_text.value); if(input_text.value != "" && input_text.value != " "){ req.onreadystatechange = function() { if (req.readyState == 4) { //alert(req.responseText); } } req.send(""); alert("Suggestion Sended"); input_text.value = ""; }else{ input_text.focus(); } } function search_by_enter(e){ if (window.event) { e = window.event; } if (e.keyCode == 13) { display_search(); } } function get_current_index(){ return current_index; } var per_page = 25; var current_index = 0; function display_next(initial){ current_index = initial; var lines = 0; arr = document.getElementsByTagName("div"); var results = 1; for(var i=0; i < arr.length; i++) { if(arr[i].id.indexOf("line_") != -1){ if(results <= (initial + per_page) && results > initial){ arr[i].style.display = "block"; }else{ arr[i].style.display = "none"; } results ++; } } if(initial > 0){document.getElementById("btn_prev").style.display = "inline"; }else if(document.getElementById("btn_prev") != null){ document.getElementById("btn_prev").style.display = "none"; } if(initial + per_page < (results - 1)){document.getElementById("btn_next").style.display = "inline"; }else if(document.getElementById("btn_next") != null){ document.getElementById("btn_next").style.display = "none"; } } function str_contains(search_str,full){ var found = false; if(full.indexOf(search_str) != -1){found = true;} return found; } //tabs function start_tabs(settings, set_onclik){ var tab_id = 1; var main_div = document.getElementById(settings.id); var elements = main_div.getElementsByTagName('div'); for(var e = 0; e < elements.length ;e++){ if(str_contains(settings.id + "_tab",elements[e].id)){ set_as_tab(settings,tab_id, set_onclik); tab_id++; } } } function set_as_tab(settings,id,set_onclik){ var tab = document.getElementById(settings.id+"_tab"+id); tab.className = settings.class_off; if(settings.change && set_onclik){ tab.onclick = function(){ change_tab(settings,id); } } tab.onmouseover = function(){ this.className = settings.class_on; } tab.onmouseout = function(){ this.className = settings.class_off; } } function change_tab(settings,id){ var total_tabs = 0; var main_div = document.getElementById(settings.id); var elements = main_div.getElementsByTagName('div'); for(var e = 0; e < elements.length ;e++){ if(str_contains(settings.id + "_tab",elements[e].id)){total_tabs++;} } for(var i = 1; i <= total_tabs; i++){ tab = document.getElementById(settings.id+"_tab"+i); if(i == id){ style_tab = settings.class_on; style_content = "block"; tab.onmouseover = function(){} tab.onmouseout = function(){} }else{ style_tab = settings.class_off; style_content = "none"; tab.onmouseover = function(){this.className = settings.class_on;} tab.onmouseout = function(){this.className = settings.class_off;} } tab.className = style_tab; if(settings.change){ document.getElementById(settings.id+"_content"+i).style.display = style_content; } } } //end tabs //headlines function change_headline(hid, image, url, channel){ var path = "https://www.sportsbettingonline.ag/utilities/centralize/pph/utilities/images/headlines/"; var image_div = document.getElementById("headline_image_loader"); image_div.style.background = "url("+path + image+")"; document.getElementById("cliker_div").onclick = function(){location.href = url;} turn_off_thumbs() document.getElementById("thumb_"+hid).className = "thumb_on_"+channel; } function turn_off_thumbs(){ for(var i =1; i<4; i++){ var div = document.getElementById("thumb_"+i); if(div != null){ div.className = "thumb_off"; } } } // end headline //For tabs order var changing_list = -1; function set_changing_list(list){ changing_list = document.getElementById(list).selectedIndex; } function change_order(form, list){ value_list = document.getElementById(list).value; for (i=0;i