function dw(s) {document.write(s)}
function maximaze() {window.open ("http://www.globes.co.il/serve/inc/sleep.htm",null,"scrollbars=no,fullscreen=yes")}

function pnew_window(url,winName,percent)
{
	var ttw = 430, zzh = 400;//default sizes
	if (window.screen) {
		ttw = window.screen.availWidth * percent / 100;
		zzh = window.screen.availHeight * percent / 100;
	}
	newwindow = window.open(url,winName) // ,'width='+ttw+',height='+zzh+',toolbar=yes,directories=yes,status=yes,menubar=yes,scrollbars=auto,resizable=yes');
	newwindow.focus();
	return;
}

function OpenWin1() {window.open("http://www.globes.co.il/serve/globes/terms.new.html","terms","width=380,height=280,left=100,top=100,scrollbars=yes,resizable=no");}

function us(s) {
var us = ''
	for(i = 0; i < s.length ;i++) {
		var ch = s.charCodeAt(i);
		if (ch >= 224 && ch <= 250) {us += ('&#' + (ch - 224 + 1488) + ';')}
		else {us += s.substring(i,i+1)}
    } return us;
}

sp500	 = "S&P 500"
dj       = us("דאו ג'ונס")
tltk     = us("תל טק")
tltk15   = us("תל טק 15")
nsdk     = us("נאסד'ק")
ta25     = us('ת"א 25')
ta100    = us('ת"א 100')

dollarbb = us("דולר") // רציף")
euro	 = us("אירו")
euro_dollar = us("אירו/דולר")

ci = (screen.width > 800) ? 0 : 1;
colors = [ "eeeeee" , "ffffff" ] // colors = [ "FFDFAF" , "FFCD9B" ]

function close_frame(){if (top != this) {try{parent.close_frame()}catch(e){}}}

function reload()
{
	var i = new Image()
	i.src = '/serve/images/pixel.gif?' + (new Date()).getTime()
	i.onload = function(){location.reload()}
}
setTimeout('reload()',5 * 60 * 1000)

function disclaimer(language) {
	ww  = 420
	wl  = screen.width - ww - 30
	url = "../globes/disclaimer.html"
	window.open(url,"the_win","width=" + ww + ",height=320,left=" + wl + ",top=2,menubars=no,toolbar=no,scrollbars=auto,resizable=yes")
}
var dcelled = false

function in_list(item,list) {for(var i in list) {if (list[i] == item) {return i}} return -1}

function bin_list(item,list) {return in_list(item,list) > -1}

function dcell(n,d,t,c,v,a)
{
//	if (!bin_list(n,[ta25,tltk15,nsdk,sp500,euro_dollar,euro,dollarbb])) return
	if (!bin_list(n,[nsdk,sp500,ta100,ta25,euro_dollar,euro,dollarbb])) return
//	if ((n == euro_dollar || n == tltk15 ) && screen.width <= 800) {return}
	if ((n == euro_dollar || n == ta100 ) && screen.width <= 800) {return}
	
	var fc = ""
	dcelled = true
	
	switch(a)
	{
		case '+' :
		a = 'tri_green.gif'
		fc = 'color: green;'
		break
	
		case '-' :
		a = 'tri_red.gif'
		fc = 'color:red;'
		break
		
		default  :
		a = '/images/pixel.gif'
		fc = ''
	}
	
	var month =  d
	var day   = ''
	var i = d.indexOf(' ')
	var wst = ''
	
	if (i > 0)
	{
		day = d.substring(0,i)
		month = d.substring(i)
		
		.replace("ינואר",1)
		.replace("פברואר",2)
		.replace("מרץ",3)
		.replace("אפריל",4)
		.replace("מאי",5)
		.replace("יוני",6)
		.replace("יולי",7)
		.replace("אוגוסט",8)
		.replace("ספטמבר",9)
		.replace("אוקטובר",10)
		.replace("נובמבר",11)
		.replace("דצמבר","12")
	}

	if (n == nsdk){
		wst = "border-left:1px solid #CCCCCC;border-right:1px solid #CCCCCC;"
	}
	else
	{
		wst = "border-right:1px solid #CCCCCC;"
	}
	
	
	if (n == euro)
	{
	//	dw('<td bgcolor="#' + colors[ci % 2] + '" align=center valign=top style="cursor:hand;"><img style="position:relative;top:7;left:1;cursor:hand" onclick="window.open(\'http://www.easy-forex.com/Getaway.aspx?gid=27\')" src="EasyLogo-small.gif" border=0></td>')
	
	dw('<td bgcolor="#' + colors[ci % 2] + '" valign=middle style="cursor:hand;"><img src="easy_forex.gif" onclick="window.open(\'http://www.easy-forex.com/Getaway.aspx?gid=27\')" border=0 width=36 height=21 style="margin:0 0 0 7px;"></td>')
	}
	
	dw('<td bgcolor="#' + colors[ci++ % 2] + '" align=center style="'+wst+'">')
	dw(	'<table style="font:' + ((window.screen.width > 1023) ? 12 : 11) + 'px arial;cursor:hand;" border=0 width="100%" cellpadding=0 cellspacing=0 class="bottomframe" onclick="javascript:pnew_window(\'/Finance/')
	
	//onclick="javascript:top.location = \'/Finance/') 
		
	if ((n==dollarbb)||(n==euro)||(n==euro_dollar))//1
	{
		dw( 'Currency/Currency.asp')
	}
	if (n==ta25)//4
	{
		dw( 'Shared/SearchResults.asp?Feeder=0&SearchIdxInst=1&Lang=HE&WhatType=3&TypeID=3&IdxInstrumentID=979')
	}
	if (n==ta100)//5
	{
		dw( 'Shared/SearchResults.asp?Feeder=0&SearchIdxInst=1&Lang=HE&WhatType=3&TypeID=4&IdxInstrumentID=980')
	}
	if (n==sp500)//6
	{
		dw( 'Instrument/Instrument.asp?InstrumentID=373853&Feeder=1&Lang=HE&Tab=1')
	}
	if (n==nsdk)//7
	{
		dw( 'Shared/SearchResults.asp?Feeder=1&SearchIdxInst=1&Lang=HE&WhatType=3&TypeID=12&IdxInstrumentID')
	}
	
	dw(	'\',\'about\',\'80\');">')

	dw(	'<tr>')
	dw(		'<td valign=top align=center><span style="font:' + ((window.screen.width > 1023) ? 11 : 10) + 'px arial">' + t + ' ,' + day + '/' + us(month) + '</span> ,<span dir=rtl><b>' + n + '</b></span></td>')
	dw(	'</tr>')
	dw(	'<tr>')
	dw(	'<td align="center" valign=middle nowrap><img src="' + a + '" border="0"> <span style="' + fc + '; font:' + ((window.screen.width > 1023) ? 11 : 10) + 'px arial;">' + c + ' ' + v + '</span>')
	dw(		'</td>')
	dw(	'</tr>')
	dw(	'</table>')
	dw('</td>')
}
function bot() {
	dw('	<table width="100%" border="0" cellpadding="0" cellspacing="0" style="border-top:2px solid #CC0000;">')
	dw('    <tr>')
	//dw('		<td valign="top" align="center" bgcolor="#CC0000" title="Close Frame" width="18"><a href="javascript:close_frame()"><img alt="Close Frame" src="sgor.gif" border="0" style="margin-top:1px"></a></td>')
}
function eot() {
/*
	dw('<td width=70 align="center" valign="top" bgcolor="#fe0000">')
	dw('<a href="http://ads.globes.co.il/bar.asp?language=he&link=url" target="_new">')
	dw('<img src="http://ads.globes.co.il/bar.asp?language=he&link=img" onmouseover="top.status=' + "'" + '' + "'" + '; return true;" WIDTH=70 HEIGHT=33 BORDER=0 ALT="">')
	dw('</a>')
	dw('</td>')
*/
/*	tou = us('תנאי<br>שימוש')
	dw('<td align="center" valign="top" bgcolor="#fe0000" width="40" dir="rtl">')
	dw('	<a href="javascript:OpenWin1();"><font color="white"><b>' + tou + '</b></font></a>')
	dw('</td>')

*/
	dw('</tr>')
	dw('</table>')
	if (dcelled == false) setTimeout('location.reload()',2000)
}

