var p,cids = [],a = "5091,0012111141112352112323121122111122121231111311124133111432314121212242122121421312311111151223181231111121244225321111513122221126115313131312111212331111414111111231111113122111112151133611121313424114113312112411111211111111111114312311122211612231351121212131111211111225111121223114112112111223231212313312323411111141611112111331112111122132213243238111115111172331123123312222111211322118215111132111112111312311111241111121121157142131113131313222215412317221111112143211113322121121121112113312221314121371211131,6085,0,6108,03632111112113161311621222111221541113,6213,06,6331,01111111121111112132112112312111111122".split(",") for(var i=0; i < a.length ;i+=2) { p = a[i] for(var j=0; j < a[i+1].length ;j++) { p = parseInt(p) + a[i+1].charCodeAt(j) - 48 cids[cids.length] = p } } function dunser(id,f,l) { if (f > l) {return false} var m = Math.floor((f + l) / 2) if (id > cids[m]) {return dunser(id,m+1,l)} if (id < cids[m]) {return dunser(id,f,m-1)} return true } function doc_id_from_url() { try {return location.href.replace(/\?/,'&').match(/&did=\d+/).toString().substring(5) } catch(ex) {return ''} } function description(ex) { if (window.ActiveXObject) { return ex.description } else {return ex.toString()} } function em(m,ex) {return m + "\n" + description(ex)} function fail(m,ex) { if (arguments.length > 1) {m = em(m,ex)} if (window.ActiveXObject) {throw new Error(0,m) } else {throw m} } function child_node(parent_node,child_name) { try { var a = parent_node.childNodes if (child_name.match(/^@/)) { a = parent_node.attributes child_name = child_name.substring(1) } for(var i=0; i < a.length ;i++) { if (child_name == a[i].nodeName) {return a[i]} } return null } catch(ex) {fail("child_node(" + child_name + ")",ex)} } function child_text(parent_node,child_name) { try { var node = child_node(parent_node,child_name) if (node == null) {return ""} return child_name.match(/^@/) ? node.nodeValue : node.firstChild.data } catch(ex) {if (false) {fail("child_text(" + child_name + ")",ex)}} return '' } function mpad(m,x) {return (m > 1) ? (m + (x % m)).toString().replace(/^1/,'') : x} function hm(dt,s) {return mpad(100,dt.getHours()) + s + mpad(100,dt.getMinutes())} function dmy(dt,s) {return dt.getDate() + s + (dt.getMonth() + 1) + s + mpad(100,dt.getYear())} function dm(dt) {return dt.getDate() + '/' + (mpad(100,dt.getMonth() + 1))} function view_instrument(feeder,instrument_id,mode) { var url = 'http://www.globes.co.il/portal/instrument.aspx' + '?instrumentid=' + instrument_id + (feeder > 0 ? '&feeder=' + feeder : '') + (mode.length > 0 ? '&mode=' + mode : '') window.open(url,'instrument') } function c_doc_instrument(a) { var i = 0 this.company_duns = 0 this.symbol = a[i++] this.id = parseInt(a[i++]) this.other_id = parseInt(a[i++]) this.feeder = this.other_id > 0 ? 1 : 0 this.company_id = parseInt(a[i++]) this.company_number = a[i++] this.exchange = (i < a.length) ? a[i++] : 'unknown' } c_doc_instrument.prototype.view = function(mode) { var instrument_id = this.other_id > 0 ? this.other_id : this.id view_instrument(this.feeder,instrument_id,mode) } function trade_instrument(doc_id,instrumentId,instrumentName,symbol) { window.open("http://www.globes.co.il/portal/ContentManager.aspx?" + "&Instrument_ID=" + instrumentId + "&popup_id=bank" + "&nameheb=" + escape(instrumentName) + "&symbol=" + escape(symbol) + "&feeder=0" ,"trade" ,"location=no,toolbar=no,menubar=no,status=yes,width=540,height=570,scrollbars=no,resizable=yes" ) } function colored_number(n) { if (('' + n).indexOf('+') > -1) {return '
' + n + '
'} if (('' + n).indexOf('-') > -1) {return '
' + n + '
'} return n } function formated_number(n,s,decimalpoints,a) { function _with_comma(n,r) {return (n >= r) ? _with_comma(Math.floor(n / r),r) + "," + (r + (n % r)).toString().replace(/^1/,'') : n} try { var n = parseFloat(('' + n).replace(/,/g,"")) if (isNaN(n) || n == 0) {return "---"} var sign = n < 0 ? '-' : s var p = 1 for(var i=0; i < decimalpoints ;i++) {p *= 10} var sn = Math.abs(new String(Math.round(n * p))).toString() while(sn.length < decimalpoints + 1) {sn = "0" + sn} return sign + _with_comma(parseInt(sn.substring(0,sn.length - 2)),1000) + "." + sn.substring(sn.length - 2) + a } catch(ex) {fail("formated_number",ex)} } function with_comma(s) { var a = ('' + s).split('.') if (a.length > 2) {return s} if (a.length > 1) {return with_comma(a[0]) + '.' + a[1]} var v = parseInt(a[0]) return v > 1000 ? with_comma(Math.floor(v / 1000)) + ',' + (1000 + (v % 1000)).toString().substring(1) : a[0] } function show_referenced_instruments() { var colspan = 22 var webservice = "http://www.globes.co.il/cooperations/all/financial.asmx" function c2jss(s) { try { return s.replace(/\\/g,"\\\\") .replace(/\'/g,"\\\'") .replace(/\"/g,"\\\"") .replace(/\r/g,"\\r") .replace(/\n/g,"\\n") } catch(e) {return ""} } function type_name(i) { var s = child_text(i,"@xsi:type") var e = child_text(i,"exchange") var type_id = child_text(i,"type_id") if (s.match(/stock/i)) { if (type_id == 13) {return "ישראליות
בניו-יורק "} return "מניה" } return " " } function c2timestamp(instrument) { var tradestage = child_text(instrument,"tradeStage") var timestamp = child_text(instrument,"timestamp") var dt = new Date(timestamp.replace(/[A|P]M/,"")) if (timestamp.match(/pm/i) && dt.getHours() != 12) {dt.setTime(dt.getTime() + 12 * 60 * 60 * 1000)} if (timestamp.match(/am/i) && dt.getHours() == 12) {dt.setTime(dt.getTime() - 12 * 60 * 60 * 1000)} return dt } function symbols(e) { var s = '' for(var i=0; i < doc_instruments.length ;i++) { var instrument = doc_instruments[i] if (instrument.exchange != e) {continue} s += ',' + instrument.symbol } return s.substring(1) } function xml_object() { try { if (window.ActiveXObject) {return new ActiveXObject("Microsoft.XMLHTTP")} var x = new XMLHttpRequest() x.onerror = function() {fail("XMLHttpRequest failed")} return x } catch(ex) {fail("xml_object",ex)} } function xml(url) { try { var x = xml_object() url += (url.indexOf("?") > -1 ? "&" : "?") + "t=" + (new Date()).getTime() // window.open(url) x.open("GET", url , false) x.send(null) return x.responseXML } catch(ex) {fail("xml",ex)} } function nodelist(e) { var list = new Array(); try { var url = webservice + "/listBySymbol?exchange=" + e + "&symbols=" + symbols(e) if (url.match(/&symbols=$/)) {return list} var root = child_node(xml(url),"ArrayOfAnyType") for(var i = 0; i < root.childNodes.length ;i++) { var instrument = root.childNodes[i] if (instrument.nodeName == "anyType") {list[list.length] = instrument} } } catch(ex) {/* fail("nodelist",ex) */ } return list } function prefix() { return '' + '' + '' + '' + '' + '' + '' + '' + '
' + 'הנתונים בהשהייה של 20 דקות' + '
' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' } function suffix() { return '' + '' + '
' + 'ניירות הערך שהוזכרו בכתבה זו בהשהייה של 20 דקות.' + '    ' + 'מעודכן ל 22/11/2017' + '
שם
נייר ערך
סוג
נייר ערך
שעת עדכון
אחרון
שער
אחרון
שינוישינוי
באחוזים
נפח מסחר
באלפי ש"ח/$
יומי
גבוה
יומי
נמוך
שער
קניה
שער
מכירה
' + '
' } function c_exchange(name) { this.name = name this.instruments = nodelist(name) this.instrument_id = function(exchange,symbol) { for(var i=0; i < doc_instruments.length ;i++) { if (doc_instruments[i].exchange == exchange && doc_instruments[i].symbol == symbol) { return doc_instruments[i].id } } return 0 } this.trade = function(i) { var exchange = child_text(i,'exchange') if (exchange != 'tase') {return ''} var symbol = child_text(i,"symbol") return '' + '' + 'קניה ומכירה של ני"ע online' + '' } this.realtime = function(i) { var exchange = child_text(i,'exchange') var instrument_type = child_text(i,'type') if (exchange != 'tase') {return ''} if (instrument_type == 'index') {return ''} if (instrument_type == 'fund') {return ''} //return '' return 'נתוני זמן אמת ' } this.minutes_to_close = function(_now,_open,_close) { if (_now.getTime() >= _close.getTime()) {return 0} if (_close.getTime() < _open.getTime() || _now.getTime() > _open.getTime()) { return Math.ceil((_close.getTime() - _now.getTime()) / 60000) } return 0 } this.date_of_close = function() { var max_date = new Date(1900,1,1) for (var i=0; i < this.instruments.length ;i++) { var ti = c2timestamp(this.instruments[i]) if (max_date.getTime() < ti.getTime()) {max_date = ti} } max_date.setTime(max_date.getTime() - 10 * 60 * 60 * 1000) return max_date } this.tr_exchange = function(openstate) { function hebrew(exchange) { if (exchange.match(/tase/i)) {return "הבורסה בתל אביב"} if (exchange.match(/nyse/i)) {return "הבורסה בניו יורק"} return "בורסת " + exchange.toUpperCase() } function c2datetime(dt) {return new Date(dt.replace(/T/," ").replace(/-/g,"/").replace(/\..*$/,""))} try { var root = child_node(openstate,"ArrayOfAnyType") for(var i = 0; i < root.childNodes.length ;i++) { if (root.childNodes[i].nodeName != "anyType") {continue} if (child_text(root.childNodes[i],"exchange") != this.name) {continue} var _now = c2datetime(child_text(root.childNodes[i],"now")) var _open = c2datetime(child_text(root.childNodes[i],"open")) var _close = c2datetime(child_text(root.childNodes[i],"close")) var minutes_to_close = this.minutes_to_close(_now,_open,_close) break } return '' + '' + (minutes_to_close > 0 ? hebrew(this.name) + " פתוחה. המסחר יסתיים בעוד " + Math.floor(minutes_to_close / 60) + ":" + mpad(100,minutes_to_close % 60) + " שעות" : hebrew(this.name) + " סגורה. נתוני סגירה מתאריך " + dmy(this.date_of_close(),"/") ) + '' + '' } catch(ex) {fail(".tr_exchange",ex)} } this.tr_instrument = function(i) { try { // return '' var timestamp = c2timestamp(i) var s = '' + '' + '' + '' + '' + '' + '' + '' + '
' + this.realtime(i) + this.trade(i) + '' + child_text(i,"name_he") + '
' + '' + '' + '' + type_name(i) + '' + '' + '' + (child_text(i,"tradeStage").replace(/\s/g,"").match(/endofday/i) ? "סגירה" : hm(timestamp,":")) + '' + '' + '' + formated_number(child_text(i,"last"),"",2,"") + '' + '' + '' + formated_number(child_text(i,"change"),"+",2,"") + '' + '' + '' + colored_number(formated_number(child_text(i,"percentageChange"),"+",2,"%")) + '' + '' + '' + formated_number(child_text(i,"totVolMoney"),"",2,"") + '' + '' + '' + formated_number(child_text(i,"high"),"",2,"") + '' + '' + '' + formated_number(child_text(i,"low"),"",2,"") + '' + '' + '' + formated_number(child_text(i,"Ask1"),"",2,"") + '' + '' + '' + formated_number(child_text(i,"Bid1"),"",2,"") + '' + '' return s } catch(ex) {fail(".tr_instrument",ex)} } this.html = function(openstate) { try { if (this.instruments.length == 0) {return ''} var s = this.tr_exchange(openstate) for(var i=0; i < this.instruments.length ;i++) { s += (i == 0 ? '' : '') + this.tr_instrument(this.instruments[i]) } return s } catch(ex) {fail(".html",ex)} } } function html(a,openstate) { try { var s = '' for(var i=0; i < a.length ;i++) {s += a[i].html(openstate)} return s } catch(ex) {fail("html",ex)} } try { var a = new Array() var elist = ['tase','nyse'] for(var i=0; i < elist.length ;i++) {a[a.length] = new c_exchange(elist[i])} var number_of_instruments = 0 for(var i=0; i < a.length ;i++) {number_of_instruments += a[i].instruments.length} if (number_of_instruments > 0) { var openstate = xml(webservice + "/OpenState") return prefix() + html(a,openstate) + suffix() } } catch(ex) {alert(em("show_referenced_instruments",ex))} return '' } // ************* var tase_symbols = new Array() var nyse_symbols = new Array() querystring = "" function instrument_td_clicked(caller) { var td = caller.innerHTML.replace(/<.*?>/g,"").replace(/ /g,"") var d = get_expanded_instrument_div(false) close_expanded_instrument_div(d,true) var instrument = d.di switch(td.toLowerCase()) { case 'ציטוט' : instrument.view('') break case 'גרפים' : instrument.view('graph') break case 'חדשות' : instrument.view('news') break case 'הוספה לתיק' : //window.open('about:blank','AddInstrument','menubar=no') //var f = document.createElement('form') //f.action = "http://www.globes.co.il/Finance/Portfolio/AddInstrumentOutside.asp?close=3&Feeder=" + instrument.feeder //f.method="POST" //f.target="AddInstrument" //f.appendChild(create_input("InstrumentID",instrument.other_id > 0 ? instrument.other_id : instrument.id)) //f.appendChild(create_input("Name",instrument.name)) //f.appendChild(create_input("Last",instrument.last)) //f.appendChild(create_input("Ticker",instrument.symbol)) //document.body.appendChild(f) //f.submit() var instrumentid = (instrument.other_id > 0 ? instrument.other_id : instrument.id) addInstrument_portal(instrumentid,instrument.feeder) case 'דף תגית' : var tagit_id = instrument.tagit_id_and_simplified.match(/^\d+/) // alert('http://www.globes.co.il/news/article.aspx?did=' + tagit_id) // window.open('http://www.globes.co.il/news/article.aspx?did=' + tagit_id,'tag') // var simplified = instrument.tagit_id_and_simplified.replace(/^\d+\-/,'') // window.open('http://www.globes.co.il/news/' + simplified + '.tag','tag') break case 'התראות sms' : window.open('http://www.globes.co.il/serve/smsalerts/smsreport.asp','smsalerts') break case 'newstracker' : window.open('http://www.globes.co.il/serve/newstracker/form.asp?add=' + instrument.company_id + '&from=' + doc_id_from_url() + '&instrumentID=' + instrument.id,'newstracker') break case 'למסחר' : trade_instrument(doc_id_from_url(),instrument.id,instrument.name,instrument.symbol) break case 'מידע עסקי' : if (instrument.company_duns == 0) {instrument.company_duns = get_company_duns(instrument.company_id)} window.open('http://dbrisk.dundb.co.il/ns/ns_frames.asp?origin=3&openDuns=' + instrument.company_duns,'dnb') break default : alert("don't know what to to with: " + td) } } function display_inline_value() {return window.ActiveXObject ? 'inline' : 'inline-block'} c_doc_instrument.prototype.collapsed = function(background_color,with_parentheses_and_expandable) { var float_percentageChange = parseFloat(this.percentageChange) this.color = 'black' this.arrow = 'http://images.globes.co.il/images/site/pixel.gif' if (float_percentageChange > 0) {this.color = 'green'; this.arrow = 'http://images.globes.co.il/images/arrow_green.gif'} if (float_percentageChange < 0) {this.color = 'red'; this.arrow = 'http://images.globes.co.il/images/arrow_red.gif'} return '' + '' + (with_parentheses_and_expandable ? '' : '') + '' + (this.color != 'black' ? '' + '' + '' + '' : '' ) + (with_parentheses_and_expandable ? '' : '') + '' + '
(' + with_comma(this.last) + '  ' + formated_number(this.percentageChange,'+',2,'%') + ')
' } c_doc_instrument.prototype.expanded = function() { return '' + '' + '' + '' + '
' + '' + (this.color == 'black' ? '' : '' + formated_number(this.percentageChange,'+',2,'%') + '') + ' ' + '' + ' ' + with_comma(this.last) + '
' } c_doc_instrument.prototype.menu = function() { //return '' var tc = this.exchange == 'tase' && this.company_id > 0 var a = ["ציטוט","גרפים","חדשות","הוספה לתיק"] if (tc) {a.push("התראות SMS")} if (this.company_id > 0) {a.push("Newstracker")} if (tc) {a.push("למסחר")} var tagit_id = this.tagit_id_and_simplified.match(/^\d+/) // var simplified = this.tagit_id_and_simplified.replace(/^\d+\-/,'') // alert(this.tagit_id_and_simplified + '\n' + tagit_id + '\n' + simplified) if (tagit_id > 0) {a.push('דף תגית')} var r = [] for(var i=0; i < a.length ;i++) { r.push('' + a[i] + '') } return '
' + '' + r.join('') // + '' + '

' } function t_to_exchange(t) { if (t == 3) {return 'tase'} if (t == 2) {return 'nyse'} return '' } function get_doc_instrument(symbol,exchange) { for(var i=0; i < doc_instruments.length ;i++) { if (doc_instruments[i].symbol != symbol) {continue} if (doc_instruments[i].exchange != exchange) {continue} return doc_instruments[i] } return null } function get_expanded_instrument_div(create_div) { var div_id = "expanded_instrument.div" var e = document.getElementById(div_id) if (e != null || create_div != true) {return e} e = document.createElement("div") e.id = div_id e.style.position = "fixed" // "absolute" document.body.appendChild(e) return e } function hide_orphan_doc_instrument_link(caller,feeder,instrumentid) { try {// alert('hide_orphan_doc_instrument_link(' + feeder + ',' + instrumentid + ')') var father = caller.parentNode child_by_tagname(father,'img').style.display = 'none' var t = child_text(father,"@t") var symbol = child_text(father,"@symbol").replace(/&/,"&").split(',')[0] var di = get_doc_instrument(symbol,t_to_exchange(t)) if (di == null) {/* alert('di == null' + feeder + ':' + instrumentid); */ return} // alert(feeder + ':' + instrumentid) if (tase_symbols.length == 0 && nyse_symbols.length == 0) {setTimeout('streamer()',1500)} var l if (t == 3) {l = tase_symbols.length; tase_symbols[tase_symbols.length] = symbol} if (t == 2) {l = nyse_symbols.length; nyse_symbols[nyse_symbols.length] = symbol} var data_area = document.createElement("span") data_area.id = 'instrument_' + t + "_" + l data_area.di = di // doc_instrument data_area.style.direction = "ltr" father.insertBefore(data_area,caller) } catch(ex) {/* alert('hide_orphan_doc_instrument_link(' + feeder + ',' + instrumentid + ')\n' + description(ex)) */} } function joined(a,p) { var s = '' for(var i=0; i < a ;i++) {s += p + a[i]} return s } var last_instrument_update = new Date() var in_2000 = new Date("jan 1 2000").getTime() function c2datetime(m) {return new Date(m * 60000 + in_2000)} function child_by_tagname(n,tagname) { for(var i = n.childNodes.length; i > 0 ;i--) { if (n.childNodes[i-1].nodeName.toLowerCase() == tagname) {return n.childNodes[i-1]} } return null } function dmy(dt) {return dt.getDate() + '/' + (dt.getMonth() + 1) + '/' + mpad(100,dt.getYear())} function hm(dt) {return dt.getHours() + ':' + mpad(100,dt.getMinutes())} function _c_coordinates(node,s) {this.bcr = node.getBoundingClientRect()} // https://developer.mozilla.org/En/DOM:element.getBoundingClientRect function is_inside(e,c,cc) { if (c.clientWidth == 0) {return false} if (arguments.length < 3) {cc = new _c_coordinates(c,'')} var r = e.clientX >= cc.bcr.left && e.clientX <= (cc.bcr.left + c.clientWidth) && e.clientY >= cc.bcr.top && e.clientY <= (cc.bcr.top + c.clientHeight) if (false && !r) { alert('id=' + c.id + ',l=' + cc.bcr.left + ',t=' + cc.bcr.top + ',w=' + c.clientWidth + ',h=' + c.clientHeight + ',x=' + e.clientX + ',y=' + e.clientY + ',r=' + r + '\n,e.clientX(' + e.clientX + ') >= cc.bcr.left(' + cc.bcr.left + ') = ' + (e.clientX >= cc.bcr.left) + '\n,e.clientX <= cc.bcr.left + c.clientWidth = ' + (e.clientX <= cc.bcr.left + c.clientWidth) ) } return r } function close_expanded_instrument_div(d,unconditionally) { if (arguments.length < 1) {d = get_expanded_instrument_div(false)} if (!unconditionally && new Date().getTime() - d.opened_at < 400) {return} d.innerHTML = '' document.body.onmousemove = null set_banner_visibility('visible') } function set_banner_visibility(v) { var bannerim = document.getElementsByName("banner_ad") for(var i=0; i < bannerim.length ;i++) {if (bannerim[i].id.match(/^aad_99_/)) {bannerim[i].style.visibility = v}} } function remover(e) { if (arguments.length == 0) {e = window.event} var d = get_expanded_instrument_div(false) // if (new Date().getTime() - d.opened_at < 400) {return} if (!is_inside(e,d)) {close_expanded_instrument_div(d,false)} } function expand_instrument(e,caller) { try { var dtt = new Date().getTime() function exchange_2_he(exchange) { var a = [["alberta","NAGOYA"],["amsterdam","יורונקסט-אמסטרדם"],["athens","יוון"],["australia","אוסטרליה"],["bombay","מומבי"] ,["bovespa","ברזיל"],["brussels","יורו אן.אם -בריסל"],["budapest","בודפשט"],["caracas","קראקס"],["china","סין"] ,["colombia","קולומביה"],["com","סחורות"],["copenhagen","קופנהגן"],["dublin","אירלנד"],["easdaq",'איסד"ק'] ,["euronext","יורונקסט-פריס"],["frankfurt","פרנקפורט"],["futures","חוזים עתידיים"],["helsinki","הלסינקי-OMX"] ,["hongkong","הונג קונג"],["icex","איסלנד-OMX"],["indices","מדדים"],["istanbul","איסטנבול"],["jakarta","גקרטה"] ,["johannesbu","יוהנסבורג"],["krx","קוריאה"],["kse","פקיסטאן"],["kualalump","קואלה לומפור"],["lima","לימה"] ,["lisbon","יורונקסט-ליסבון"],["lse","לונדון"],["madrid","מדריד"],["manila","מנילה"],["mexico","מקסיקו"],["milan","מילאנו"] ,["montreal","מונטריאול"],["nasdaq","נאסד'ק"],["nse","הודו-נשיונל"],["nyse","ניו-יורק"],["nzx","ניו-זילנד"],["omx","שבדיה"] ,["osaka","אוסקה"],["oslo","אוסלו-OMX"],["phlx","פילדלפיה"],["plus","PLUS Market"],["rts","רוסיה"],["shanghai","שנחאי"] ,["shenzhen","שנזאן"],["singapore","סינגפור"],["sse","סנטיאגו"],["stockholm","סטוקהולם-OMX"],["tase","תל אביב"] ,["toronto","טורונטו"],["tse","טוקיו"],["tsec","טייוואן"],["vancouver","וונקובר"],["wse","פולין"],["xbue","בואנוס איירס"],["zurich","ציריך"] ] for(var i=0; i < a.length ;i++) {if (a[i][0] == exchange) {return a[i][1]}} return exchange } if (window.event) {e = window.event;caller = e.srcElement } else {caller = e.target} var ccaller = new _c_coordinates(caller,'alert') while(!caller.nodeName.match(/span/i) || !('' + caller.getAttribute('name')).match(/\d+\.instrument\.\d+\.\d+/)) { caller = caller.parentNode if (caller == null) {return} } var d = get_expanded_instrument_div(true) if (is_inside(e,d)) {return} if (d.innerHTML) {d.opened_at = dtt; return} var windowHeight = window.innerHeight ? window.innerHeight : document.body.clientHeight d.style.border = '0px solid red' if (windowHeight - ccaller.bcr.top > 230) { d.style.top = ccaller.bcr.top + 'px' } else { d.style.top = (ccaller.bcr.top - 233) + 'px' } d.style.left = (e.clientX - 200) + 'px' if (dtt - last_instrument_update.getTime() > 1 * 60 * 1000) {streamer()} var a = caller.getAttribute('name').split('.') // did.instrument.feeder.instrument_id for(var i=0; i < di_handler.instruments.length ;i++) { if (di_handler.instruments[i].feeder == a[2] && di_handler.instruments[i].id == a[3]) { d.di = di_handler.instruments[i] break } } if (d.di == null) {return} if (!d.di.name) { try { var r = caller.parentNode var t = child_by_tagname(r,'b') if (t == null) { r = child_by_tagname(r,'a') t = child_by_tagname(r,'b') } d.di.name = t.innerHTML } catch(ex) {/* alert(description(ex)); */ return} } set_banner_visibility('hidden') var dt = di_handler.c2datetime(d.di.timestamp) e_counter.count('--expand_instrument','article') d.style.padding = '14px 12px 12px 12px' d.innerHTML = '
' + '' + '' + '' + '' + '' + '' + '' + '' // + '' + '' + '' + '' + '' + '
' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '
' + d.di.name + '   (' + d.di.symbol + ')  - ' + exchange_2_he(d.di.exchange) + ' 
' + '
' + d.di.expanded() + '' + d.di.menu() + '
' + '' + (d.di.exchange == 'tase' && d.di.type != 'index' && d.di.type != 'fund' && d.di.trade_stage != '-eod' ? ' עיכוב 20 דקות' : '') + '' // + '' + (d.di.exchange == 'tase' && d.di.type != 'index' && d.di.type != 'fund' && d.di.trade_stage != '-eod' ? ' עיכוב 20 דקות' : ' זמן אמת') + '' + '    עדכון אחרון: ' + dm(dt) + ' ' + hm(dt) + '  ' + '
' d.opened_at = dtt document.body.onmousemove = remover try {dcTxtlinkgraph()} catch(ex) {} } catch(ex) { alert(description(ex)) } } function update(s) { try { var t,symbol var a = s.split(',') var i = parseInt(a[0]) - 1 if (i < tase_symbols.length) { t = 3 symbol = tase_symbols[i] } else { i -= tase_symbols.length + 1 t = 2 symbol = nyse_symbols[i] } var instrument_t_i = document.getElementById('instrument_' + t + "_" + i) instrument_t_i.di.timestamp = a[1] instrument_t_i.di.percentageChange = formated_number(a[2],'+',2,'%').replace(/---/,'') instrument_t_i.di.last = a[3] instrument_t_i.di.type = a[4] instrument_t_i.di.trade_stage = a[5] var d = get_expanded_instrument_div(false) if (d != null && d.di === instrument_t_i.di && d.innerHTML) {document.getElementById("expanded_instrument_data").innerHTML = d.di.expanded()} instrument_t_i.innerHTML = instrument_t_i.di.collapsed('white',true) last_instrument_update = new Date() } catch(ex) {/* alert('update(' + s + ')\n' + description(ex)) */} } function streamer(instrument_t_l) { if (tase_symbols.length == 0 && nyse_symbols.length == 0) {return} var url = 'http://www.globes.co.il/cooperations/all/streamer.aspx?symbols=tase' + joined(tase_symbols,',') + ',nyse' + joined(nyse_symbols,',').replace(/s&p-500/i,'spx.x') + '&handler=parent.update' if (arguments.length > 0) { var a = instrument_t_l.split('_') if (a[1] == 3) {url += '&expanded=' + (parseInt(a[2]) + 1)} if (a[1] == 2) {url += '&expanded=' + (parseInt(a[2]) + 1 + tase_symbols.length + 1)} } setTimeout("document.getElementById('streamer').src = '" + url + "'",100) } // 20e8 function in_list(item,list) {for(var i=0; i < list.length ;i++) {if (item == list[i]) {return i}} return -1} function bin_list(item,list) {return in_list(item,list) > -1} var di_handler = new function() { this.instruments = [] this.xmlobject = window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest() this.show_doc_instruments = function() { // alert(this.show_doc_instruments) var qs = location.search.replace(/^\?/,'&') + '&' this.did = qs.match(/&did=\d+&/) == null ? 0 : qs.match(/&did=\d+&/).toString().replace(/&/g,'').substring(4) if (this.did == 0) {return} this.zone_list = [] this.zone_counter = 0 var a = document.getElementsByTagName('DIV') // :tss: for(var i=0; i < a.length ;i++) { if (a[i].innerHTML.replace(/ /ig,'').match(/[^\s]/)) {continue} var name = '' + a[i].getAttribute('name') if (name.match(/^\d+\.tss:.+:.*$/i)) { var r = name.toLowerCase().split(':') if (r[0] != this.did + '.tss') {continue} if (!bin_list(r[1],this.zone_list)) {this.zone_list.push(r[1])} var r2 = r[2].split(',') // var sb = [] var data_tr = [''] var graphim_tr = [''] for(var j=0; j < r2.length ;j++) { var align = 'center' if (j == 0) {align = 'right'} if (j == r2.length - 1) {align = 'left'} data_tr.push('') graphim_tr.push('') // sb.push('') } // data_tr.push('') // graphim_tr.push('') a[i].style.fontSize = '12px' a[i].innerHTML = '
' // for the word מדדים + '' + '' + data_tr.join('') + graphim_tr.join('') // + sb.join('
') + '
' + '' + '' + '' + '' + '' + '' + '' + '
' + '' this.zone_counter++ } } var a = document.getElementsByTagName('SPAN') // .instrument. // alert('a.length = ' + a.length) var current_feeder = '' this.instrument_ids = [] this.span_ids = [] var instrument_list = [] for(var i=0; i < a.length ;i++) { var name = '' + a[i].getAttribute('name') // if (name.match(/instrument/)) {alert(name)} if (name.match(/^\d+\.instrument\.\d+\.\d+$/)) { var r = name.split('.') if (r[0] != this.did) {continue} if (!bin_list(name,instrument_list)) { // alert(name) instrument_list.push(name) var feeder = r[2] if (current_feeder != feeder) { this.instrument_ids.push("*" + feeder) current_feeder = feeder } this.instrument_ids.push(r[3]) // instrument_id } a[i].id = name + '.' + i this.span_ids.push(a[i].id) } } if (this.instrument_ids.length > 0) {this.ajax(this.instrument_ids.join(','),'long',this.zone_list.join(','))} } this.ajax = function(ids,dataformat,zonelist) { this.xmlobject.abort() var url = "/data/webservices/doc_instruments.ashx?ids=" + ids + '&format=' + dataformat + '&zonelist=' + zonelist // if (dataformat == 'long') {alert(url)} this.xmlobject.open("GET",url,true) this.xmlobject.onreadystatechange = function() {if (di_handler.xmlobject.readyState == 4 && di_handler.xmlobject.status == 200) {di_handler.update(di_handler.xmlobject.responseText.split('\n'),dataformat)}} this.xmlobject.send(null) } var inner_tabel_id=0; this.c2datetime = function(t) { return new Date(t.substring(0,4) // yyyy ,t.substring(4,6).replace(/^0/,'') - 1 // m ,t.substring(6,8).replace(/^0/,'') // d ,t.substring(8,10).replace(/^0/,'') // h ,t.substring(10,12).replace(/^0/,'') // h ,t.substring(12,14).replace(/^0/,'') // m ) } this.update_zonetable = function(a) { inner_tabel_id++; var s = a.split(',') if (s.length < 4) {return} var sb = [] var title,prev var feeder = s[0].toLowerCase() == 'ta' ? 0 : 1 switch (s[1]) { case 'active' : title = 'פעילות' break case 'up' : title = 'עולות' prev = 'active' break case 'down' : title = 'יורדות' prev = 'up' break case 'israelies' : title = 'ישראליות' prev = 'down' break default : return } sb.push('') sb.push('') var counter = 0 for(var i=2; i < s.length ;i++) { var si = new function() { var a = s[i].split(':') if (a.length == 3) { this.id = a[0] this.percentage_change = parseFloat(a[1]) this.name = this.id > 0 ? unescape(a[2]) : null } } if (!si.name) {continue} var src = 'black' var alt = 'ללא שינוי' var color = 'black' var sign = '' if (si.percentage_change > 0) {counter++; color = 'green'; sign='+'; src='http://images.globes.co.il/images/arrow_green.gif'; alt='עולה'} if (si.percentage_change < 0) {counter++; color = 'red'; src='http://images.globes.co.il/images/arrow_red.gif'; alt='יורד'} sb.push('') sb.push('') sb.push('') sb.push('') sb.push('') sb.push('') sb.push('') } if (counter == 0) {return} sb.push('
' + title + '
' + si.name + ' ' + alt + ' ' + formated_number(si.percentage_change,'+',2,'%') + '
') for(var i=0; i < this.zone_counter ;i++) { var td = document.getElementById(this.did + '.tss.' + s[0] + '.' + s[1] + '.' + i) if (td) { td.innerHTML = sb.join('') if (s[1] != 'active') { td.style.paddingRight = '8px' document.getElementById(this.did + '.tss.' + s[0] + '.' + prev + '.' + i).style.paddingLeft = '8px' } } } if (inner_tabel_id == 4) { for(var i=1; i <= 4 ; i++) { var it = document.getElementById("innerTables_" + i) if (it != null) {it.style.width = "100px";} } } } this.update = function(a,dataformat) { if (dataformat == 'long') {this.first_time(a); return} for(var i=0; i < a.length ;i++) { if (('' + a[i]).match(/^@/)) {this.update_zonetable(a[i].substring(1)); continue} var ai = (a[i] + ',f,id,t,t,l,p').split(',') for(var j=0; j < this.instruments.length ;j++) { var dij = this.instruments[j] if (dij.feeder == ai[0] && dij.id == ai[1] && dij.source != a[i]) { dij.source = a[i] var k = 2 dij.tradestage = ai[k++] dij.timestamp = ai[k++] dij.last = ai[k++] dij.percentageChange = ai[k++] this.update_doc_instrument_spanim(dij,false,"#ffe9d1") setTimeout('di_handler.update_doc_instrument_spanim(di_handler.instruments[' + j + '],false,"white")',4000) var d = get_expanded_instrument_div(false) if (d != null && d.di === dij && d.innerHTML) {document.getElementById("expanded_instrument_data").innerHTML = dij.expanded()} } } } } this.first_time = function(a) { for(var i=0; i < a.length ;i++) { if (('' + a[i]).match(/^@/)) {this.update_zonetable(a[i].substring(1)); continue} var ai = (a[i] + ',f,id,t,t,l,p,e,s,t,c,c,n').split(',') var instrument = new c_doc_instrument(',,,,,,,,,,,,,'.split(',')) var j = 0 instrument.feeder = ai[j++] instrument.id = ai[j++] instrument.tradestage = ai[j++] if (bin_list(instrument.tradestage,['up','down','active'])) { // alert(ai) for(var k=0; k < this.instrument_ids.length ;k++) { if (this.instrument_ids[k] == instrument.id) {this.instrument_ids[k] = 0} } // alert(this.instrument_ids) } instrument.timestamp = ai[j++] instrument.last = ai[j++] instrument.percentageChange = ai[j++] instrument.source = instrument.feeder + ',' + instrument.id + ',' + instrument.tradestage + ',' + instrument.timestamp + ',' + instrument.last + ',' + instrument.percentageChange instrument.exchange = ai[j++] instrument.symbol = ai[j++] instrument.type = ai[j++] instrument.company_id = ai[j++] instrument.company_number = ai[j++] instrument.name = unescape(ai[j++]) instrument.tagit_id_and_simplified = '' // '1000669857-נסיון_קיציס' // unescape(ai[j++]) if (!instrument.name) {instrument.name = instrument.symbol} var span_name = this.did + '.instrument.' + instrument.feeder + '.' + instrument.id var graph_td = document.getElementById(span_name + '.graph_td') if (graph_td != null) { graph_td.parentNode.parentNode.parentNode.style.margin = '10px 0 10px 0' // td-tr-tbody-table graph_td.innerHTML = '' // + '' + instrument.name + '' // + '
' + instrument.last + ' ' + instrument.percentageChange + '
' + '' } // alert(span_name + '\n***\n' + this.spanids.join('\n')) instrument.span_ids = [] for(var j=0; j < this.span_ids.length ;j++) {if (this.span_ids[j].replace(/\d+$/,'') == span_name + '.') {instrument.span_ids.push(this.span_ids[j])}} // alert(instrument.spanids.join('')) if (instrument.span_ids.length == 0) {continue} this.instruments.push(instrument) this.update_doc_instrument_spanim(instrument,true,"white") } setInterval('di_handler.refresh()',30000) } this.update_doc_instrument_spanim = function(instrument,first_time,background_color) { // alert(instrument.span_ids.length) for(var i=0; i < instrument.span_ids.length ;i++) { var si = document.getElementById(instrument.span_ids[i]) var is_graph_header = si.parentNode && /* td */ si.parentNode.parentNode && /* tr */ si.parentNode.parentNode.parentNode && /* tbody */ si.parentNode.parentNode.parentNode.parentNode && /* table */ si.parentNode.parentNode.parentNode.parentNode.parentNode && /* div */ si.parentNode.parentNode.parentNode.parentNode.parentNode.getAttribute('name') && si.parentNode.parentNode.parentNode.parentNode.parentNode.getAttribute('name').match(/^\d+\.tss:/) // alert("i=" + i + '\nname=' + instrument.name + '\ninnerHTML=' + si.innerHTML + '\npnn=' + si.parentNode.getAttribute('name')) // alert("si.id=" + si.id) if (first_time) { // alert(instrument.name) // if (si.innerHTML == '') { if (si.parentNode && si.parentNode.getAttribute('name') && si.parentNode.getAttribute('name').match(/^\d+\.tss:/)) { // alert('') si.innerHTML = instrument.name + ' ' // alert(si.parentNode.childNodes[0].innerHTML) si.parentNode.childNodes[0].innerHTML = 'מדדים' si.parentNode.childNodes[1].style.margin = '10px 0 10px 0' si.parentNode.style.margin = '10px 0 10px 0' } // si.instrument = instrument if (si.innerHTML) { } else { si.innerHTML = instrument.name } si.innerHTML = (is_graph_header ? '' + si.innerHTML + '
' : '') + '
' + instrument.collapsed(background_color,!is_graph_header) // alert(i + '\n' + si.getAttribute('name') + '\n' + si.innerHTML) } else { si.removeChild(si.childNodes[si.childNodes.length - 1]) si.innerHTML = si.innerHTML + instrument.collapsed(background_color,!is_graph_header) } } } this.refresh = function () {this.ajax(this.instrument_ids.join(','),'',this.zone_list.join(','))} } try {g.endofbody.add(function() {di_handler.show_doc_instruments()})} catch(ex) {alert(ex.description)} function addInstrument_portal(instrumentID, feeder) { addPortfolioInstrumentByWizard(instrumentID, feeder, "580", "500"); } function addPortfolioInstrumentByWizard(instrumentID, feeder, w, h) { var url = "/portal/contentmanager.aspx?" + "Instrument_ID=" + instrumentID + "&popup_id=buysale" + "&feeder=" + feeder + "&mode=wizard&outside=true"; ; SignWizard_Show( url , 'wizard', 'get', w ,h ) } function loginAndAddInstrumentByWizard(instrumentID, feeder,w, h) { var url = "/portal/contentmanager.aspx?" + "Instrument_ID=" + instrumentID + "&popup_id=buysale" + "&feeder=" + feeder + "&t=" + (new Date()).getTime() + "&mode=wizard&outside=true"; SignWizard_Show('/pay/login.asp?mode=wizard&p_backTo=' + escape(url), 'wizard', 'get', w, h) }