﻿function comp(data){try{setcomp(data);chancomp();}catch(ex){}}function setcomp(data){$get("vcbsdata").innerHTML = data;}function chancomp(){var tid = "data";var pid = "vcbsquotes";chan164200(tid, pid);}function vcbsfstock(n, nid, d){if(flist.indexOf(nid)!=-1){var cb = $get("cb"+nid);cb.checked=true;vcbsfstock_style(n);}}function vcbsfstock_style(n){n.style.backgroundColor = "#171717";}function vcbsfstock_style_reset(){var pid = "vcbsquotes";var p = $get(pid);var k=0;for(j=2; j<p.rows.length; j++){r = p.rows[j];if(flist.indexOf(r.cells[1].innerHTML)==-1){if(k%2==0){r.style.backgroundColor = "#131313";}else{r.style.backgroundColor = "#000000";}k++;}}}function clear164400(pid){setTimeout('clear164500("'+pid+'")', 5000);}function clear164500(pid){var d = $get('r'+pid);try{clear164600(d);}catch(ex){}}function clear164600(d){for(k=6; k<d.cells.length;k++){var str = d.cells[k].className;var ins = str.lastIndexOf("_");var ins_1 = str.lastIndexOf("_1");if(ins == 3){d.cells[k].className = str.slice(0, ins);}else if(ins == 1 && ins_1==-1){d.cells[k].className = str.slice(0, ins);}}}function getCookie(c_name){if (document.cookie.length>0){c_start=document.cookie.indexOf(c_name + "=");if (c_start!=-1){c_start=c_start + c_name.length+1;c_end=document.cookie.indexOf(";",c_start);if (c_end==-1) c_end=document.cookie.length;return unescape(document.cookie.substring(c_start,c_end));}}return "";}function setCookie(c_name,value,expiredays){var exdate=new Date();exdate.setDate(exdate.getDate()+expiredays);document.cookie=c_name+ "=" +escape(value)+((expiredays==null) ? "" : "; expires="+exdate.toGMTString());}function deleteCookie(name){var exp = new Date();exp.setTime (exp.getTime() - 1);var cval = getCookie (name);document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();}function mover_(obj, r){obj.style.backgroundColor = baco_hi;}function mout_(obj, r){var cell = starrow(obj);if(flist.indexOf(cell)!=-1){vcbsfstock_style(obj);setcel(obj, baco_fl);}else{if(r==0){obj.style.backgroundColor = baco_black;}else{obj.style.backgroundColor = baco_alt;}}}function setcelclss(obj, val){obj.cells[3].className = val;obj.cells[4].className = val;obj.cells[5].className = val;obj.cells[18].className = val;obj.cells[20].className = val;}function ShowHide(obj, val){var Show = $get(obj);if (val == 1){Show.className = "show";}else{Show.className = "hide";}}function check(){var totalck = 0;totalck = $get('CKK').name;var i, checkid;for (i=0; i<totalck; i++){checkid = "CK"+i;$get(checkid).checked=true}}function uncheck(){var totalck = 0;totalck = $get('CKK').name;var i, checkid;for (i=0; i<totalck; i++){checkid = "CK"+i;$get(checkid).checked=false;}}function okclose(e){var totalck = 0;totalck = $get('CKK').name;var i, checkid;var s="";var k=0;for (i=0; i<totalck; i++){checkid = "CK"+i;if($get(checkid).checked == true){s = s+","+$get(checkid).name;k++;}}s = s.slice(1,s.length);if(s.length>1){if(parseFloat(totalck) == k){s="";}setStockList(s, e);reloadPage();}ShowHide('stashow', 0);}function setStockList(s, e){if(e==0){setCookie('vcbsstocklist',s,365);}else if(e==1){setCookie('vcbsstocklist_',s,365);}else if(e==2){setCookie('vcbsstocklist__',s,365);}}function reloadPage(){window.location.reload();}function settimeout(){t = setTimeout('ConstantCall()', tim);}function cleartimeout(){clearTimeout(t);}function fstockun(oid){var r;var s = $get("vcbsquotes");var fr;var rr = $get('r'+oid);var row;for (i = 2;i < s.rows.length;i++){row = s.rows[i];var cell = starrow(row);var cell_;var cb = $get("cb"+cell);if(cb.checked || oid == cell || oid.length != cell.length)continue;if(i < s.rows.length-1){cell_ = starrow(s.rows[i+1]);if(oid.length==3){if(oid > cell){if(oid < cell_ || cell_.length>3){break;}}if(oid < cell && oid < cell_){try{row = s.rows[i-1];}catch(e){}break;}}else if(oid.length==6 && cell.length!=3){if(oid > cell){if(oid < cell_){break;}}if(oid < cell && oid < cell_){try{row = s.rows[i-1];}catch(e){}break;}}}else{if(oid < cell){try{row = s.rows[i-1];}catch(e){}}}}row.parentNode.insertBefore(rr,row.nextSibling);mout(rr, 1);}function fstockclear(){var pid = "vcbsquotes";var p = $get(pid);for(j=2; j<p.rows.length; j++){r = p.rows[j];clear164600(r);}}function sover(obj){obj.style.color = baco_sover;obj.style.cursor = "pointer";stit(obj);}function sout(obj){obj.style.color = baco_sout;}function MM_openBrWindow(theURL,winName,features){window.open(theURL,winName,features);}function star(cell){var cell = cell.innerHTML;var fi = cell.lastIndexOf('*');if(fi!=-1){if(cell.length < 11){cell = cell.substring(cell.length-3, cell.length);}else{cell = cell.substring(cell.length-6, cell.length);}}return cell;}function star_cut_r(n){var r = n.substring(1, n.length);return r}function stit(obj){var s = star(obj);var s_ = document.getElementsByName(s);obj.title = s_.item(0).value;}function starrow(obj){var cell = star(obj.cells[1]);return cell;}var iScroll = 0;var tScroll = 0;function vcbsscr(){Scr();tScroll = setTimeout('vcbsscr()', 5000);}function Scr(){if(iScroll == 0){window.scroll(0, 0);iScroll = iScroll + 1;}else if(iScroll < 2){window.scroll(0, 70);iScroll = iScroll + 1;}else if(iScroll<4){window.scroll(0, 750);iScroll = iScroll + 1;}else if(iScroll<6){window.scroll(0, 1430);iScroll = iScroll + 1;}else if(iScroll<8){window.scroll(0, 2110);iScroll = iScroll + 1;}else if(iScroll<10){window.scroll(0, 2790);iScroll = iScroll + 1;}else if(iScroll<12){window.scroll(0, 3470);iScroll = iScroll + 1;}else{window.scroll(0, 4150);iScroll = iScroll + 1;if(iScroll == 14) iScroll = 0;}}function MM_openBrWindow_(theURL){window.location = theURL;}function switchoption(){try{var l_ = "";var e_ = "";var l = document.getElementsByName("l");var e = document.getElementsByName("e");for(i=0;i<l.length;i++){if(l.item(i).checked == true){l_ = l.item(i).value;}}for(i=0;i<e.length;i++){if(e.item(i).checked == true){e_ = e.item(i).value;}}try{var x = document.getElementById("industries");if (x.value == '0'){myURL = "?e="+e_+"&l="+l_;}else{myURL = "?e="+e_+"&l="+l_+"&sector="+x.value;}}catch(e){myURL = "?e="+e_+"&l="+l_;}MM_openBrWindow_(myURL,'','')}catch(e){}}function deta(e, o){if (e.keyCode == 13){d619();}}function d619(){stdeta();ShowHide('stdet', 1);}function d620(){clearTimeout(t10);}function indus(){try{var l_ = "";var e_ = "";var l = document.getElementsByName("l");var e = document.getElementsByName("e");for(i=0; i<l.length; i++){if(l.item(i).checked == true){l_ = l.item(i).value;}}for(i=0; i<e.length; i++){if(e.item(i).checked == true){e_ = e.item(i).value;}}var x = document.getElementById("industries");var url = "?e="+e_+"&l="+l_+"&sector="+x.value;MM_openBrWindow_(url);}catch(e){}}