<!--

// HANDLES FSCOMMAND CALL FOR INTERNET EXPLORER

if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {

document.write('<SCRIPT LANGUAGE=VBScript\> \n');

document.write('on error resume next \n');

document.write('Sub navbar_FSCommand(ByVal command, ByVal args)\n');

document.write(' call navbar_DoFSCommand(command, args)\n');

document.write('end sub\n');

document.write('</SCRIPT\> \n');

}

//-->


function build_flash(height,width,subFlashPath,subRedirectPath){
	var swf_click = "http://dclk.themarker.com/event.ng/Type=click&FlightID=$FlightID$&AdID=$AdID$&TargetID=$TargetID$&Segments=$Segments$&Targets=$Targets$&Values=$Values$&RawValues=$RawValues$&Redirect="+subRedirectPath;
var dcswf_click = escape(swf_click);

/*document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
document.write(' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"');
document.write(' ID=flashad WIDTH=760 HEIGHT=120>');
document.write(' <PARAM NAME=movie VALUE="http://www.themarker.com/ads/2005/test/psagot/psagot_game_760x120_theMarker.swf?clickThru='+dcswf_click+'"> '); 
document.write(' <PARAM NAME=quality VALUE=autohigh> ');
document.write(' <PARAM NAME=wmode  VALUE=opaque> ');
document.write(' <EMBED SRC="http://www.themarker.com/ads/2005/test/psagot/psagot_game_760x120_theMarker.swf?clickThru='+dcswf_click+'" QUALITY=autohigh '); 
document.write(' NAME=flashad swLiveConnect=TRUE WIDTH=760 HEIGHT=120');
document.write(' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">');
document.write('</EMBED>');
document.write('</OBJECT>');*/
document.write('<OBJECT id="navbar" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0" width="'+width+'" height="'+height+'">');
document.write('<PARAM NAME="movie" VALUE="'+subFlashPath+'?clickThru='+dcswf_click+'">');
document.write('<PARAM NAME="quality" VALUE="high">');
document.write('<PARAM NAME="wmode" VALUE="opaque">');
document.write('<PARAM NAME="menu" VALUE="true">');
document.write('<EMBED src="'+subFlashPath+'?clickThru='+dcswf_click+'" quality="high" menu="true" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="'+width+'" height="'+height+'" swLiveConnect="true" NAME="navbar"> </EMBED>');
document.write('</OBJECT>');


// href = http://dclk.themarker.com/event.ng/Type=click&FlightID=$FlightID$&AdID=$AdID$&TargetID=$TargetID$&Segments=$Segments$&Targets=$Targets$&Values=$Values$&RawValues=$RawValues$&Redirect=;
// target = _blank;
// src = http://www.themarker.com/tmc/i/0.gif;
// width = 760;
// height = 120;

}

function navbar_DoFSCommand(command,args){
	if(command=="closebanner"){closebanner();}
}





var site = "";
function dayForm()
{
var d = new Date();
var day;
var month;
var year;
// check if Day smaller then 10
if (d.getDate()<10)
day ="0" + d.getDate();
else
// asaf change this - 29 not in month feb	
//day =d.getDate()+1;	
day =d.getDate();	
document.arc_form.recToDD.value  =day;
// check if Month smaller then 10
if (d.getMonth()<9)
month ="0" +(d.getMonth()+1);		
else
month =d.getMonth()+1;	
document.arc_form.recToMM.value =month;
year =d.getFullYear();
document.arc_form.recToYY.value =year;
// change to 1 month before
var timeInSec = d.getTime();
// timeInSec = timeInSec - 2678400000  ;
//-5356800000,13046400000
timeInSec = timeInSec -7948800000;
d.setTime(timeInSec);
// check if Day smaller then 10
if (d.getDate()<10)
day ="0" + d.getDate();
else
month =d.getDate()+1;	
document.arc_form.recFromDD.value =day;	
if (day > 26)
document.arc_form.recFromDD.value =day-4;	
else
document.arc_form.recFromDD.value =day;		
// check if Month smaller then 10
if (d.getMonth()<9)
month ="0" +(d.getMonth()+1);	
else
month =d.getMonth()+1;	
document.arc_form.recFromMM.value =month;
year =d.getFullYear();
document.arc_form.recFromYY.value =year;
}
function checkChar(obj)
{
var str = ":;)(*&^%$#@!?<>||~{}[]\\/"
var userStr = obj.value;
var c ;
for (i=0 ; i < userStr.length ; )
{
c = userStr.charAt(i);
if (str.indexOf(c) > -1)
userStr = clearStr(userStr,i);
else
i++;
}
userStr = clearSpace(userStr);	
obj.value = userStr;
}
function clearSpace(userStr)
{
while(userStr.indexOf(" + ")>-1)
userStr =userStr.replace(" + ","+");
while(userStr.indexOf(" , ")>-1)
userStr =userStr.replace(" , ",",");
while(userStr.indexOf("+ ")>-1)
userStr =userStr.replace("+ ","+");
while(userStr.indexOf(" +")>-1)
userStr =userStr.replace(" +","+");
while(userStr.indexOf(", ")>-1)
userStr =userStr.replace(", ",",");
while(userStr.indexOf(" ,")>-1)
userStr =userStr.replace(" ,",",");
while(userStr.indexOf(" - ")>-1)
userStr =userStr.replace(" - ","-");
while(userStr.indexOf("- ")>-1)
userStr =userStr.replace("- ","-");
while(userStr.indexOf(" -")>-1)
userStr =userStr.replace(" -","-");
while(userStr.indexOf("  ")>-1)
userStr = userStr.replace("  "," ");
while(userStr.indexOf("++")>-1)
userStr = userStr.replace("++","+");
while(userStr.indexOf(",,")>-1)
userStr = userStr.replace(",,",",");
while(userStr.indexOf("--")>-1)
userStr = userStr.replace("--","-");
return userStr;
}
function  clearStr(str,index)	
{
str = str.substring(0,index) + str.substring(index+1,str.length);
return str;
}
function FindSubmitDay()
{	
dayForm();


var stringToSplit=document.getElementById("text2").value;
var separator=" ";  
arrayOfStrings = stringToSplit.split(separator)
var output="";
for (var i=0; i < arrayOfStrings.length-1; i++) 
{ 
	output=output+arrayOfStrings[i]+"+";
}
output=output+arrayOfStrings[i];
document.getElementById("text").value=output;
checkChar(document.arc_form.text);
var found=document.arc_form.text.value
var howmany=found.split('"')
var howmany1=found.length
var s=howmany.length-1
if (howmany1==1 )
{
NewVin = open("/ibo/archive/tooShort.html","displayWindow","width=560,height=270,top=150,left=150,screenX=150,screenY=150,status=no,toolbar=no,menubar=no, resizable=no,scrolling=no");
NewVin.focus();
document.arc_form.text.value="";
return false;
}
if (s >= 1 )
{
NewVin = open("/ibo/archive/wrong.html","displayWindow","width=560,height=285,top=150,left=150,screenX=150,screenY=150,status=no,toolbar=no,menubar=no, resizable=no,scrolling=no");
NewVin.focus();
return false;
}
}	
function bannerNew(noPosition,l1,l2,l3,l4,posSrcs,positionStr)
{
var params = document.location.search.split("&");
var pos = 0,sectionLayer="",check=false;
for(var i=0;i<params.length;i++){
	if(params[i].split("=")[0] == "layer" || params[i].split("=")[0] == "?layer"){
		pos = i;
		check=true;
		break;
	}
}
if(check)
	sectionLayer = params[pos].split("=")[1];
else
	sectionLayer = "hp";
var cookieContent = new String(document.cookie);
var site = "themarker";
var now = new Date();
var RND = now.getSeconds();
var frameUrl = "http://dclk"
var domainName = new String(self.location);
frameUrl += ".themarker.com/html.ng/site=" + site + "&sectionLayer=" + sectionLayer + "&adsize=" + posSrcs + "&" + (l1=="none"?"":"layer="+l1+"&") + (l2=="none"?"":"layer2="+l2+"&") + (l3=="none"?"":"layer3="+l3+"&") + (l4=="none"?"":"layer4="+l4+"&") + "adtype=hp&page_position=" + noPosition + "&Rnd=" + RND;
//frameUrl = "";  //problem in dclk
dw("<IFRAME " + positionStr + " MARGINWIDTH=0 MARGINHEIGHT=0 HSPACE=0 VSPACE=0 FRAMEBORDER=0 SCROLLING=no BORDERCOLOR=000000 SRC=\"" + frameUrl + "\"></IFRAME>");
dw('</div>');	
}
function bannerJS(pagePosition,site,layer,width,height)
{
	if (pagePosition != null)
		dw("<script src='http://dclk.themarker.com/js.ng/page_position="+pagePosition+"&site="+site+"&adsize="+width+"x"+height+"&layer="+layer+"'></script>");
	else
		dw("<script src='http://dclk.themarker.com/js.ng/site="+site+"&adsize="+width+"x"+height+"&layer="+layer+"'></script>");
}

function checkday()
{
if(document.arc_form)
{
var d = new Date()
document.arc_form.recToDD.selectedIndex  =d.getDate();
document.arc_form.recToMM.selectedIndex =d.getMonth()+1;
year =d.getFullYear()-2000;
switch (year) 
{
case -1 :
year = 5;
break;
case 0 :
year = 4;
break;
case 1 :
year = 3;
break;
case 2 :
year = 2;
break;
case 3 :
year = 1;
break;
} 
document.arc_form.recToYY.selectedIndex =year;
var timeInSec = d.getTime();
//-5356800000,-13046400000
timeInSec = timeInSec -5356800000  ;
d.setTime(timeInSec);
document.arc_form.recFromDD.selectedIndex =d.getDate();		
document.arc_form.recFromMM.selectedIndex =d.getMonth()+1;
year =d.getFullYear()-2000;
switch (year) 
{
case -1 :
year = 5;
break;
case 0 :
year = 4;
break;
case 1 :
year = 3;
break;
case 2 :
year = 2;
break;
case 3 :
year = 1;
break;
} 
document.arc_form.recFromYY.selectedIndex =year;
}
}
//	function checkValDay(dd,mm,yyyy)
function checkValDay(dd,mm,yyyy)
{
///	alert("in checkDay" + dd + mm + yyyy);
if (dd > 27)
{
//		alert("in checkDay");
if (((mm== 4) || (mm== 6) || (mm== 9) || (mm== 11)) && (dd == 31))
{
alert("בחודש " + mm + " אין " + dd + " יום");
return "0";
}	
if (mm == 2)
{
if (dd > 29)
{
alert("בחודש פברואר אין " + dd + " יום");
return "0";
}
if (dd == 29 && ((yyyy/4)!=parseInt(yyyy/4)))
{
//	alert(dd/4)
//	alert(parseInt(dd/4))
alert("בשנה זו בחודש פברואר אין " + dd + " יום");
return "0";
}
}
}
return "1";
}	
function FindSubmit()
{	
check = checkValDay(arc_form.recFromDD.value,arc_form.recFromMM.value,arc_form.recFromYY.value);
if (check == "0")
return false;
check = checkValDay(arc_form.recToDD.value,arc_form.recToMM.value,arc_form.recToYY.value);
if (check == "0")
return false;					
checkChar(document.arc_form.text);
checkChar(document.arc_form.quote);
var found=document.arc_form.text.value
var quote=document.arc_form.quote.value
var howmany=found.split('"')
var howmany1=found.length
var s=howmany.length-1
if ( (howmany1==1) && (quote==""))
{
NewVin = open("/ibo/archive/too_short.html","displayWindow","width=560,height=270,top=150,left=150,screenX=150,screenY=150,status=no,toolbar=no,menubar=no, resizable=no,scrolling=no");
NewVin.focus();
document.arc_form.text.value="";
return false;
}
if ( (howmany1==1) && (quote !=""))
{
document.arc_form.text.value="";
}
if (s >= 1 )
{
NewVin = open("/ibo/archive/wrong.html","displayWindow","width=560,height=285,top=150,left=150,screenX=150,screenY=150,status=no,toolbar=no,menubar=no, resizable=no,scrolling=no");
NewVin.focus();
return false;
}
document.arc_form.submit();		
}	
function headline()
{
dw("<IFRAME src='/ibo/droplet/main/headline.html' name='headframe' width='100%' height='30' scrolling='no' frameborder='0'></IFRAME>");
}
function checkMsn()
{
if(location.hostname=="themarker.msn.co.il"||location.search.indexOf("brand=msn")!=-1||document.cookie.indexOf("brand=msn")!=-1)
return 1;
return 0;
}

function checkThemarkerComDomain()
{
	if( location.hostname.indexOf("themarker.com") !=-1 )
		return 1;
	return 0;
}

function openGraphWin(Pname,width,height)
{
NewVin = open(Pname,"GraphWindow","width=" + width + ",height=" + height + ",top=0,left=0,screenX=150,screenY=150,status=no,toolbar=no,menubar=no,resizable=no,scrolling=no");
NewVin.focus();
}

function sky_ad_newSite(sky_layer)
{
	var sWidth = document.body.clientWidth;
	var x = 0;
	dw("<div id=\"bigAdd\" style=\"display:none;position: absolute; height: 450; width: 100; left: " + x + "; top: 45;\">");
	bannerNew(61,sky_layer,'none','none','none','100x450','WIDTH=100 HEIGHT=450');
	dw("</div>");
	if (sWidth >= 1020) 
		document.getElementById("bigAdd").style.display="inline";
}
function sky_ad_on_avenue()
{
	var sWidth = screen.width;
	if (sWidth >= 1024) 
	{
	var x = 762 + ((sWidth - 1024) / 2);
	dw("<div name=\"bigAdd\" style=\"position: absolute; height: 778; width: 120; left: " + x + "; top: 228;\">");
	dw("<iframe src=\"http://dclk.themarker.com/html.ng/site=themarker&page_position=137&adsize=120x600&layer=none\" height=\"778\" width=\"120\" scrolling=\"No\" marginheight=\"0\" marginwidth=\"0\" frameborder=\"0\"></iframe>");
	dw("</div>");
	}
}
function sessionCookie(){
//Get cookie routine 
var search = "enum=";
var returnvalue = "";
if (document.cookie.length > 0){
offset = document.cookie.indexOf(search);
// if cookie exists
if (offset != -1){ 
offset += search.length;
// set index of beginning of value
end = document.cookie.indexOf(";", offset);
// set index of end of cookie value
if ( end == -1 ) end = document.cookie.length;
returnvalue = unescape(document.cookie.substring(offset, end));
if ( parseInt(returnvalue) % 6 == 0){
document.cookie = "enum=1";
sky_ad_on_avenue();
}
else{
var newVal = parseInt(returnvalue)+1;
document.cookie = "enum="+newVal;
}
}//end offset if
else
document.cookie = "enum=2";
}//end document.cookie.length if
}//end function
function openWinDetails(url,viewData)
{
if(viewData != "")	
window.open(url,"win",viewData);
else
window.open(url,"win");
}
function showAdd() 
{
if (newsAdd) 
{
if (newsAdd.style.display == 'none')
newsAdd.style.display = 'block';
else
newsAdd.style.display = 'none';
}
}
function goToUrl()
{
var finIndex=document.getElementById("financeSelect").selectedIndex;
var finVal=document.getElementById("financeSelect");
if (finVal.options[finIndex].value != "")
{ 
window.location.href=finVal.options[finIndex].value;
}
}
function dw(str){
document.write(str);
}
function dwl(str){
document.writeln(str);
}
function openwin(address)
{
win=open(address,"","width=790,height=400,top=0,left=0,resizable,scrollbars,menubar,toolbar");
}
function openWinRegister(address)
{
var sWidth = screen.width;
var sHeight = screen.height;	
if(sWidth==800)
{
x = 240;			
y = 190;

}
else
{
x = 350;			
y = 300;
}	
win=open(address,"","width=350,height=100,top="+x+",left="+y+",status=no,toolbar=no,menubar=no, resizable=no,scrolling=no");
}
function openWinStock(address)
{
win=open(address,"","width=460,height=384,top=50,left=50,status=no,toolbar=no,menubar=no, resizable=no,scrolling=no");
}
function pressEnter()
{
if(window.event.keyCode==13)
{
SelSearch();
}
}
function noneFunc()
{
return false;
}
function SelSearch()
{	
a = document.goToChooseFund.val.value;
b = a.split("'");
str = "";
for(i=0;i<b.length;i++)
{
if ((b[i] != "") && (b[i] != null))
{			
str = str.concat(b[i]);			
}		
}
document.goToChooseFund.val.value = str;		
}
function openDetails(img,tbl,status){
var source = document.getElementById(img).src;
if (source.indexOf("chetz_down") != -1){
document.getElementById(tbl).style.display = "inline";
document.getElementById(img).src = "/tmc/i/conf/chetz_up.gif";
document.getElementById(status).innerHTML = "סגור";
}
else{
document.getElementById(tbl).style.display = "none";
document.getElementById(img).src = "/tmc/i/conf/chetz_down.gif";
document.getElementById(status).innerHTML = "פתח";
}
}
function openWin(Pname,Wname) 
{
    NewVin = open(Pname,"displayWindow","width=350,height=85,top=150,left=150,screenX=150,screenY=150,status=no,toolbar=no,menubar=no, resizable=no,scrolling=no");
    NewVin.focus();
}
function chkSubmit()
{
	if (!confirm("?פעולה זו הינה בלתי הפיכה, האם אתה בטוח"))
		return false;			
}
function refresh()
{
	opener.location.reload(true);
	window.close();
}
	
function wait()
{
	window.setInterval("load()", 360000);
}
function load()
{
		document.location.reload();
}

var ExpDate;

function daily_banner_change(position,length)
{
	var name = "dailyBanner";
	returnvalue = "";
	
	if(name != "null" && hours != "null")
	{	
		var cookie = document.cookie;
		if (cookie.indexOf(name) == -1)
		{
			var currentDate = new Date();
			var hours = 12;
			if(position=='26'){
				currentDate.setHours(currentDate.getHours() + hours); 
		 		ExpDate = currentDate.toGMTString();
				document.cookie = name+"=1;expires=" + ExpDate + ";path=/";
				document.cookie = "expiration="+ExpDate+";expires="+ExpDate+";path=/";
			}
			return true;
		}
		else{
			if(getCookieParameter(name,cookie)*1<length&& position=='26'){
				num=getCookieParameter(name,cookie)*1+1;
				document.cookie = name+"="+num+";expires=" + getCookieParameter("expiration",cookie) + ";path=/";
				return true;
			}
			else return false;
		}
	}
}

function getCookieParameter(param,cookie){
	if(cookie.indexOf(param)==-1)return null;
	var cookieStr= cookie.substring(cookie.indexOf(param)+param.length+1,cookie.length)+";";
	//alert(cookieStr);
	return (cookieStr.substring(0,cookieStr.indexOf(';')));
}

function checkString(str)
{
	str = str.replace(new RegExp('[~]','g'), "&quot;"); 
	str = str.replace(new RegExp('[*]','g'), "&rsquo;"); 
	str = str.replace(new RegExp('[#]','g'), "&#32;"); 
	return str;
}

	function FixFormat(num,decimalPlace){
		if (decimalPlace ==1)
			divNum = 10;
		if (decimalPlace ==2)
			divNum = 100;
		if (decimalPlace ==3)
			divNum = 1000;
		StringNum = num.toString();
		SplitNum = StringNum.split(".");
		if (SplitNum[1]){
		//----------------------------------------
			lenNum = SplitNum[1].length;
			DecimalNum = SplitNum[1].substr(0,decimalPlace);
			if (decimalPlace == 0) {
				if (decimalPlace < lenNum)
				{
					spl1 = SplitNum[1].substr(SplitNum[1].length-1,SplitNum[1].length);
					chkNum = "0."+spl1;
					chkNum = chkNum*1;
					if (chkNum>=0.5)
					{
						fn = SplitNum[0]+""+DecimalNum;
						fn = fn*1+1;
						StringNum1 = fn.toString();						
						SplitNum = StringNum1.split(".");
						if(StringNum1.indexOf(".")==-1)
							DecimalNum = 0;
						else
							DecimalNum = SplitNum[1];
					}
				}
				//---------------------------------------
				OutPutNum = prefix(SplitNum[0]);
			}else{
				if (decimalPlace < lenNum)
				{
					spl1 = SplitNum[1].substr(SplitNum[1].length-1,SplitNum[1].length);
					chkNum = "0."+spl1;
					chkNum = chkNum*1;
					if (chkNum>=0.5)
					{
						fn = SplitNum[0]+""+DecimalNum;
						fn = fn*1+1;
						fn = fn/divNum;
						StringNum1 = fn.toString();						
						SplitNum = StringNum1.split(".");
						if(StringNum1.indexOf(".")==-1)
							DecimalNum = 0;
						else
							DecimalNum = SplitNum[1];
					}
				}
				OutPutNum = prefix(SplitNum[0]) + "." + DecimalNum;
				if (decimalPlace == 2){
					DecimalNum = DecimalNum.toString();
					if(DecimalNum.length == 1){
						OutPutNum = OutPutNum + "0";
					} 
				}
			}
			num = OutPutNum; 
		}
		else{
			
			if (decimalPlace == 1){
				num = num + ".0"
			}
			if (decimalPlace == 2){
				num = num + ".00"
			}
			num = prefix(num);
		}		
		if (num =="0.0" || num ==".0" || num =="0" || num =="0.00" || num ==".00" ||num =="-9,999" || num =="-9,999.0" || num =="-9,999.00" || num =="9,999" || num =="9,999.0" || num =="9,999.00"){
			num = "-";
		}
		if (num.indexOf("-.") != -1)
		{
			num = "-";
		}		
		return num;
	}
	
	function prefix(num){
	Newnum = "0";
	mark = "";
	StringNum = num.toString();
	SplitNum = StringNum.split(".");
	if (SplitNum[1]){
	 	num = SplitNum[0];
		decimalPart = "." + SplitNum[1];
	}else{
		decimalPart = "";
	}
	num = num.toString();
	if (num.substr(0,1) == "-"){
		mark = "-"
		if (num.length == 1){
			num = "";
		}else{
			num = num.substr(1);
		}
	}
	leng = num.length;
	numOfPrefix = Math.floor(leng / 3);
	if ((leng % 3) == 0){
		numOfPrefix = numOfPrefix - 1;
	}
	arrayObj = new Array();
	first = leng-3;
	len = 3;  
	for (i=0;i<numOfPrefix+1;i++){
		if (first < 0){
			len = 3+first;
			first = 0;
		}
		arrayObj[i] = num.substr(first,len);
		first = first - len;
	}
	num = "";
	for (i=numOfPrefix;i>=0;i--){
		if (i == 0){
			num = num + arrayObj[i];
		}else{
			num = num + arrayObj[i] + ",";
		}
	}
	num = mark + num + decimalPart;
	return num;
}

	function updateDivContent(txt,divID){
		document.getElementById(divID).innerHTML = txt;
	}
var timer=0;
var curId = "";
var tmp ="";
var zu =0 ;

function encodeHebrewString(str)
{
	var re = new RegExp('%','g');
	str = str.replace(re, '%25');
	re = new RegExp('~','g');
	str = str.replace(re, '%22');
	re = new RegExp(' ','g');
	str = str.replace(re, '%20');
	re = new RegExp('"','g');
	str = str.replace(re, '%22');
	re = new RegExp('\'`','g');
	str = str.replace(re, '%5C');
	re = new RegExp('<','g');
	str = str.replace(re, '%3C');
	re = new RegExp('>','g');
	str = str.replace(re, '%3E');
	re = new RegExp(';','g');
	str = str.replace(re, '%3B');
	re = new RegExp(':','g');
	str = str.replace(re, '%3A');
	re = new RegExp('&','g');
	str = str.replace(re, '%26');
	re = new RegExp('#','g');
	return str.replace(re, '%27');
}


function showCallout(id,isHead)
{
	if (curId == id)
		window.clearTimeout(timer);
	else
		curId = id;
	var e = window.event.clientY;	
	if (isHead == "true"){		
		img = encodeHebrewString(document.getElementById("image"+id).innerHTML);
		call = encodeHebrewString(document.getElementById("call"+id).innerHTML);		
		document.getElementById("currentCallout").innerHTML = "<iframe id=ifrm"+id+" src=/tmc/news/articleHeadCallout.jhtml?id="+id+"&e="+e+"&img="+img+"&call="+call+" frameborder=0 scrolling=no marginheight=0 marginwidth=0 width=0 height=0></iframe>";
	}
	else
		document.getElementById("callout"+id).innerHTML = "<iframe id=ifrm"+id+" src=/tmc/news/articleCallout.jhtml?id="+id+"&e="+e+" frameborder=0 scrolling=no marginheight=0 marginwidth=0 width=0 height=0></iframe>";
}


function hideCallout(id, isHead)
{	
	if (isHead == "true"){		
		document.getElementById("currentCallout").innerHTML = "";
		timer = window.setTimeout("hideCallout2('"+id+"','true')",1); 		
	}
	else{	
		document.getElementById("callout"+id).innerHTML = "";
		timer = window.setTimeout("hideCallout2('"+id+"')",1); 		
	}	
}

function hideCallout2(id,isHead)
{	
	if (isHead == "true")
		document.getElementById("currentCallout").style.display = "none";
	else
		document.getElementById("callout"+id).style.display = "none";
		
	curId="";
}
function getContent(text,id,isHead)
{	
	if (isHead == "true"){
		document.getElementById("currentCallout").innerHTML = text;
		document.getElementById("currentCallout").style.display = "inline";
	}
	else{
		document.getElementById("callout"+id).innerHTML = text;
		document.getElementById("callout"+id).style.display = "inline";
	}
}

function getAbsolutePos(oNode){
		var k = new Array(2);
 	 	var oCurrentNode=oNode;
		xpos = 0;
		ypos=0;
		while(oCurrentNode.tagName!="BODY"){
    		xpos+=oCurrentNode.offsetLeft;
			ypos+=oCurrentNode.offsetTop;
    		oCurrentNode=oCurrentNode.offsetParent;
   		}
		k[0] = xpos;
		k[1] = ypos;			
  		return k;
}

function placeCallout(e,id,isHead)
{
	var y = getAbsolutePos(document.getElementById("bottomCallout"+id))[1] - getAbsolutePos(document.getElementById("topCallout"+id))[1];
	var sWidth = screen.width;

	if (isHead == "true")
		parent.document.getElementById("currentCallout").style.left = getAbsolutePos(parent.document.getElementById("titlesDiv"))[0]+37;

	if (sWidth >=1024){
		if (e > (500-y)){
			if (isHead == "true")
				parent.document.getElementById("currentCallout").style.top = e+parent.window.document.body.scrollTop-y-50;
			else
				parent.document.getElementById("callout"+id).style.top = e+parent.window.document.body.scrollTop-y-50;
		}
		else{
			if (isHead == "true")
				parent.document.getElementById("currentCallout").style.top = e+parent.window.document.body.scrollTop+10;
			else
				parent.document.getElementById("callout"+id).style.top = e+parent.window.document.body.scrollTop+10;			
		}
	}
	else{
		if (e > (395-y)){
			if (isHead == "true")
				parent.document.getElementById("currentCallout").style.top = e+parent.window.document.body.scrollTop-y-125;
			else
				parent.document.getElementById("callout" + id).style.top = e+parent.window.document.body.scrollTop-y-125;
		}
		else{
			if (isHead == "true")
				parent.document.getElementById("currentCallout").style.top = e+parent.window.document.body.scrollTop+10;
			else
				parent.document.getElementById("callout"+id).style.top = e+parent.window.document.body.scrollTop+10;
		}
	}
}

function ResizeWindow(){
	performResize();
}
function gogo(){
	window.onresize = onResizeManager;
	checkRez();
}
function checkRez()
{
	var sWidth=screen.width;
	var sHeight=screen.height;
	 if(sHeight>=864)
	{
		 if ((navigator.userAgent.indexOf("MSIE") > -1))
		 {
			var contentHeight=document.body.offsetHeight-44+"px";
			//var contentWidth=document.body.offsetWidth+"px";
			document.getElementById("content").style.height=contentHeight;
			//document.getElementById("content").style.width=contentWidth;
			//document.getElementById("content").style.overflowX='auto';
			document.getElementById("content").style.overflowY='scroll';
		}
		else
		{
			var contentHeight=document.body.offsetHeight-40+"px";
			document.getElementById("content").style.height=contentHeight;
			document.getElementById("content").style.overflowY='scroll';
		}
	}
	if(sWidth <=800)
	{
		if ((navigator.userAgent.indexOf("MSIE") > -1))
		{
			var contentHeight=document.body.offsetHeight-44+"px";
			var contentWidth=document.body.offsetWidth+"px";
			document.getElementById("content").style.height=contentHeight;
			document.getElementById("content").style.width=contentWidth;
			document.getElementById("content").style.overflowX='auto';
			document.getElementById("content").style.overflowY='scroll';
		}
	}
}
function onResizeManager(){
	fixScroll();
	positionAd();
	setBigPicPos();
	positionMonopol();
}
function fixScroll()
{
	 if ((navigator.userAgent.indexOf("MSIE") > -1))
	{
		var contentHeight=document.body.offsetHeight-44+"px";
		var contentWidth=document.body.offsetWidth+"px";
		document.getElementById("content").style.height=contentHeight;
		document.getElementById("content").style.width=contentWidth;
		document.getElementById("content").style.overflowX='auto';
		document.getElementById("content").style.overflowY='scroll';
	}
	else
	{
		var contentHeight=document.body.offsetHeight-40+"px";
		document.getElementById("content").style.height=contentHeight;
		document.getElementById("content").style.overflow='auto';
	}
}
function setBigPicPos(){
	var serverX;
	var aboutPosX
	if(document.body.clientWidth >= 1020)
	{
		var sWidth = document.body.clientWidth;
		var serverX = 883 + ((sWidth - 1020) / 2);
		document.getElementById("serverName").style.left = serverX;
		document.getElementById("serverName").style.display = "inline";
	}
	else
	{
		document.getElementById("serverName").style.display = "none";
	}
}





function loadPage()
{
	parent.document.location.href="/?from=hasot";
}

function reloadPage()
{
	parent.document.location.href="/?from=hasot";
}

function checkCssCookie()
{
	if(checkCookieStatus("orangeTakeover",12,1))
		top.document.location.href = "/?from=hasut&adver=true";
}

function positionAd()
{
	if (document.getElementById("FlashDiv") != null && showArticleAd)
	{			
		var pos=getAbsolutePos(document.getElementById("mainArc"));
		document.getElementById("FlashDiv").style.top = pos[1];
		document.getElementById("FlashDiv").style.left = pos[0];
		document.all.FlashDiv.style.visibility = 'visible';
	}
}

function positionMonopol()
{
	if(document.getElementById("monopolDiv")!= undefined)
	{
		if(document.body.clientWidth >= 1020)
		{
			document.getElementById("monopolDiv").style.top = 49;
			document.getElementById("monopolDiv").style.left = document.body.clientWidth-425-15;
			if (document.getElementById("monopolDiv").style.display == 'none')
				document.getElementById("monopolDiv").style.display = 'inline';
		}
		else if (document.getElementById("monopolDiv").style.display == 'inline')
			document.getElementById("monopolDiv").style.display = 'none';
	}
}

//variableName: name of global variable that represents current tab(for using the same object in the same page)
function changeFrequentArticlesTables (tableName,iframeName,url,variableName)
{
	if(eval(variableName !=null))
		document.getElementById(eval(variableName)).style.display='none';
	document.getElementById(tableName).style.display='inline';
	eval(variableName+"=tableName;")
	if(iframeName != "0")
		document.getElementById(iframeName).src=url;
}

function checkIfProduction()
{
	if( location.hostname.indexOf("dev") ==-1 )
		return 1;
	return 0;
}

function disableEnter (field, event)
{
	var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
	if (keyCode == 13)
		return false;
} 

/**************************************/
/*script for encoding string to utf-8*/
function utf8(wide) {
  var c, s;
  var enc = "";
  var i = 0;
  while(i<wide.length) {
    c= wide.charCodeAt(i++);
    // handle UTF-16 surrogates
    if (c>=0xDC00 && c<0xE000) continue;
    if (c>=0xD800 && c<0xDC00) {
      if (i>=wide.length) continue;
      s= wide.charCodeAt(i++);
      if (s<0xDC00 || c>=0xDE00) continue;
      c= ((c-0xD800)<<10)+(s-0xDC00)+0x10000;
    }
    // output value
    if (c<0x80) enc += String.fromCharCode(c);
    else if (c<0x800) enc += String.fromCharCode(0xC0+(c>>6),0x80+(c&0x3F));
    else if (c<0x10000) enc += String.fromCharCode(0xE0+(c>>12),0x80+(c>>6&0x3F),0x80+(c&0x3F));
    else enc += String.fromCharCode(0xF0+(c>>18),0x80+(c>>12&0x3F),0x80+(c>>6&0x3F),0x80+(c&0x3F));
  }
  return enc;
}

var hexchars = "0123456789ABCDEF";

function toHex(n) {
  return hexchars.charAt(n>>4)+hexchars.charAt(n & 0xF);
}

var okURIchars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-";

function encodeURIComponentNew(s) {
  var s = utf8(s);
  var c;
  var enc = "";
  for (var i= 0; i<s.length; i++) {
    if (okURIchars.indexOf(s.charAt(i))==-1)
      enc += "%"+toHex(s.charCodeAt(i));
    else
      enc += s.charAt(i);
  }  
  return enc;
}

function buildURLNew(fld)
{
	if (fld == "") return false;
	var encodedField = "";
	var s = fld;
	if (typeof encodeURIComponent == "function")
	{
		// Use JavaScript built-in function
		// IE 5.5+ and Netscape 6+ and Mozilla
		encodedField = encodeURIComponent(s);
	}
	else 
	{
		// Need to mimic the JavaScript version
		// Netscape 4 and IE 4 and IE 5.0
		encodedField = encodeURIComponentNew(s);
	}	
	return encodedField;
}
