var site = "";
if(document.cookie.indexOf("brand=msn")!=-1||location.search.indexOf("?brand=msn")!=-1)
site="themarker_msn";

var nameMonth = new Array(10);
nameMonth[0]=""
nameMonth[1]=""
nameMonth[2] = "פברואר"
nameMonth[3]=""
nameMonth[4] = "אפריל"
nameMonth[5]=""
nameMonth[6] = "יוני"
nameMonth[8]=""
nameMonth[7]=""
nameMonth[9] = "ספטמבר"

var loadingGraphInterval;//interval for loading
var loadingGraphDelay = 1000;//delay for loading
var timerHideBox;

	var prod;
		function displayDiv(obj)
		{
			if(obj.style.display == "inline")
				obj.style.display = "none";
			else
				obj.style.display = "inline";
		}
		
		function chkPassword(obj)
		{
			if(obj.email.value == "")
			{
				alert("יש למלא כתובת מייל");
				obj.email.focus();
				return false;
			}
			if(obj.firstName.value == "")
			{
				alert("יש למלא שדה שם פרטי");
				obj.firstName.focus();
				return false;
			}
			if(obj.lastName.value == "")
			{
				alert("יש למלא שדה שם משפחה");
				obj.lastName.focus();
				return false;
			}
			if(obj.choseEdition.value == "yes")
			{
				editionChose = false;
				for(i=0;i<obj.edition.length;i++)
				{
					if(obj.edition[i].checked)
						editionChose = true;
				}
				if(!editionChose)
				{
					if((prod!=15) && (prod!=16))
					{				
						alert("יש לסמן את מהדורות המייל אותן תרצה לקבל");					
						return false;
					}
					else
						editionChose = true;
					
				}
			}
			obj.muEmailPublic.value = obj.email.value;
			obj.muEmail.value = obj.email.value;
		}
		
		function resetFrm()
		{
			obj = document.frmRegister;
			obj.firstName.value = "";
			obj.lastName.value = "";			
			if(obj.choseEdition.value == "yes")
			{
				if((prod!=15)||(prod!=16))
				{
					for(i=0;i<obj.edition.length;i++)
					{
						obj.edition[i].checked = false;					
					}
				}
			}			
		}

function act(i,image) 
{
	if (navigator.appVersion.indexOf("4")!=-1)
	{
    	if (document.images)
		{
			document.images[i].src = image;
		}
	}
}         

function go(form) 
{
	location=form.selectmenu.value
}

function surfto(form) {
	var myindex=form.select1.selectedIndex
	if (form.select1.options[myindex].value != 0) 
	{
    	url=form.select1.options[myindex].value;
		popupWin=window.document.open (url,'menu','height=450,width=190,scrollbars=yes,resizable=yes');
	    popupWin.focus();
	}	 
}
function openWinHelp(url)
{
	
	var self=window.open (url,'help','height=510,width=510,scrollbars=yes,resizable=no,top=0,left=0');
	//self.moveTo(0,0);
}

function sub()
{
	document.form1.submit();
}

function createArray (size)
{
	this.length = size;
	for (var i = 0; i <= size; i++)
	{
		this[i] = null
	}
}

function send()
{
	num  = document.kelim.stam.selectedIndex;
	var sites = new createArray(13);
	sites[0] = "/ibo/tools/event.jhtml?application=8";
	sites[1] = "/ibo/tools/event.jhtml?application=1";
	sites[2] = "/ibo/shenhav/graphWindow.jhtml?chosen=5002&market=ny&chT=intraday&types=index&whichGraph=יומי&graphTitle=נאסד&quot;ק";
	sites[3] = "/ibo/shenhav/graphWindow.jhtml?chosen=5001&market=ny&chT=intraday&types=index&whichGraph=יומי&graphTitle=דאו";
	sites[4] = "/ibo/shenhav/graphWindow.jhtml?chosen=1230&market=ta&chT=intraday&types=index&whichGraph=יומי&graphTitle=ת&quot;א 100";
	sites[5] = "/ibo/shenhav/graphWindow.jhtml?chosen=1065&market=ta&chT=intraday&types=index&whichGraph=יומי&graphTitle=מעו&quot;ף";
	sites[6] = "/ibo/tools/allFinanceFrame.jhtml?application=11";
	sites[7] = "/ibo/tools/allFinanceFrame.jhtml?application=21";
	sites[8] = "/ibo/idex/graphIdex.jhtml";		
	sites[9] = "/ibo/tools/event.jhtml?application=2&gif=finance";	
	sites[10] = "/ibo/tools/ta25.jhtml";
	sites[11] = "/ibo/game/TheMarkerGame.jhtml";						
	sites[12] =	 "/ibo/tools/clal/ShowAllReturns.jhtml";
	url= sites[num];
	if (document.kelim.stam.selectedIndex ==0 || document.kelim.stam.selectedIndex ==1 ||  document.kelim.stam.selectedIndex ==6 || document.kelim.stam.selectedIndex ==7 || document.kelim.stam.selectedIndex==8 || document.kelim.stam.selectedIndex==9 || document.kelim.stam.selectedIndex==10 || document.kelim.stam.selectedIndex==11|| document.kelim.stam.selectedIndex==12)
		location.href = sites[num];
	else
	{
		 popupWin=window.document.open ( url,'menu','height=394,width=452,top=0,left=0,status=no,toolbar=no,menubar=no,resizable=no,scrolling=no');
	     popupWin.focus();
	}
}

function openTalkBabk(Pname) 
{
	NewVin = open(Pname,"displayWindow","width=350,height=375,top=150,left=150,screenX=150,screenY=150,status=no,toolbar=no,menubar=no, resizable=no,scrollbars=no");
	NewVin.focus();
}

function openNetking() 
{
	var a;
	a=window.open("http://radio.netking.com/radiothemarker.asp","radio","height=410,width=430,scrollbar=0,toolbar=0,status=0,resizable=0,menubar=0");
}
	
function openRadioTMC() 
{	
	var a;								
	a=window.open("/ibo/RadioTMC.html","radio","width=431,height=370,scrollbar=0,toolbar=0,status=0,resizable=0,menubar=0,top=100,left=150");
}

function pressEnter()
{
	if(window.event.keyCode==13)
	{
		return FindSubmit();
	}
}
	
function OpenHelp()	
{
   	NewVin = open("/ibo/archive/help.html","displayWindow","width=580,height=300,top=150,left=150,screenX=150,screenY=150,scrollbars=yes,status=no,toolbar=no,menubar=no, resizable=no");
    NewVin.focus();
}

function jumpout(layer,rnd,start,stop) 
{
	if ((rnd >= start) && (rnd <= stop) && (layer != "walls") && (layer != "market"))
		return true;
	else
		return false;
}

function banner(noPosition,l1,l2,l3,l4)
{
var cookieContent = new String(document.cookie);
var site = "themarker";
if(cookieContent.indexOf("brand=msn")!=-1||location.search.indexOf("?brand=msn")!=-1)
site="themarker_msn";
position = new Array("","WIDTH=468 HEIGHT=60","WIDTH=468 HEIGHT=60","WIDTH=109 HEIGHT=65","WIDTH=109 HEIGHT=65","WIDTH=124 HEIGHT=31","WIDTH=124 HEIGHT=31","WIDTH=124 HEIGHT=150","WIDTH=124 HEIGHT=150","WIDTH=80 HEIGHT=31","WIDTH=124 HEIGHT=150","WIDTH=92 HEIGHT=60","WIDTH=420 HEIGHT=108","WIDTH=420 HEIGHT=108","WIDTH=124 HEIGHT=450","","WIDTH=124 HEIGHT=31","WIDTH=124 HEIGHT=180","WIDTH=210 HEIGHT=210","","WIDTH=286 HEIGHT=210","WIDTH=115 HEIGHT=17","WIDTH=285 HEIGHT=20","WIDTH=240 HEIGHT=32","WIDTH=123 HEIGHT=48","WIDTH=740 HEIGHT=90","WIDTH=92 HEIGHT=60","WIDTH=730 HEIGHT=31","WIDTH=124 HEIGHT=50","WIDTH=124 HEIGHT=450","WIDTH=92 HEIGHT=60","WIDTH=92 HEIGHT=60","WIDTH=470 HEIGHT=39","WIDTH=250 HEIGHT=31","WIDTH=360 HEIGHT=31","WIDTH=123 HEIGHT=33","WIDTH=92 HEIGHT=60","WIDTH=124 HEIGHT=70","WIDTH=92 HEIGHT=60","WIDTH=124 HEIGHT=70","WIDTH=288 HEIGHT=176","WIDTH=92 HEIGHT=60","WIDTH=60 HEIGHT=20","WIDTH=120 HEIGHT=72");
posSrcs = new Array(" ","468x60","468x60","109x65","109x65","124x31","124x31","124x150","124x150","80x31","124x150","92x60","420x108","420x108","124x450","","124x31","124x180","210x210","","286x210","115x17","285x20","240x32","123x48","740x90","92x60","730x31","124x50","124x450","92x60","92x60","470x39","250x31","360x31","123x33","92x60","124x70","92x60","124x70","288x176","92x60","60x20","120x72");
var now = new Date();
var RND = now.getSeconds();
var frameUrl = "http://dclk"
var domainName = new String(self.location);
if (domainName.indexOf("test.themarker.com") != -1) frameUrl += "5";
frameUrl += ".themarker.com/html.ng/site=" + site + "&adsize=" + posSrcs[noPosition] + "&" + (l1=="none"?"":"layer="+l1+"&") + (l2=="none"?"":"layer2="+l2+"&") + (l3=="none"?"":"layer3="+l3+"&") + (l4=="none"?"":"layer4="+l4+"&") + "adtype=hp&page_position=" + noPosition + "&Rnd=" + RND;
if (site=="themarker_msn" && noPosition==18)
	dw("<IFRAME name='ih' src='http://ads.msn.co.il/ad.htm?site=msnthemarker&amp;size=210x210&amp;page=all&amp;rtc= RND' width='210' height='210' marginwidth='0' marginheight='0' frameborder='0' scrolling='no'></IFRAME>");
else
	dw("<IFRAME " + position[noPosition] + " MARGINWIDTH=0 MARGINHEIGHT=0 HSPACE=0 VSPACE=0 FRAMEBORDER=0 SCROLLING=no BORDERCOLOR=000000 SRC=\"" + frameUrl + "\"></IFRAME>");
dw('</div>');	
}

function bannerNoDotomi(noPosition,l1,l2,l3,l4)
{
var cookieContent = new String(document.cookie);
var site = "themarker";
if(cookieContent.indexOf("brand=msn")!=-1||location.search.indexOf("?brand=msn")!=-1)
site="themarker_msn";
position = new Array("","WIDTH=468 HEIGHT=60","WIDTH=468 HEIGHT=60","WIDTH=109 HEIGHT=65","WIDTH=109 HEIGHT=65","WIDTH=124 HEIGHT=31","WIDTH=124 HEIGHT=31","WIDTH=124 HEIGHT=150","WIDTH=124 HEIGHT=150","WIDTH=80 HEIGHT=31","WIDTH=124 HEIGHT=150","WIDTH=92 HEIGHT=60","WIDTH=420 HEIGHT=108","WIDTH=420 HEIGHT=108","WIDTH=124 HEIGHT=450","","WIDTH=124 HEIGHT=31","WIDTH=124 HEIGHT=180","WIDTH=210 HEIGHT=210","","WIDTH=286 HEIGHT=210","WIDTH=115 HEIGHT=17","WIDTH=285 HEIGHT=20","WIDTH=240 HEIGHT=32","WIDTH=123 HEIGHT=48","WIDTH=740 HEIGHT=90","WIDTH=92 HEIGHT=60","WIDTH=730 HEIGHT=31","WIDTH=124 HEIGHT=50","WIDTH=124 HEIGHT=450","WIDTH=92 HEIGHT=60","WIDTH=92 HEIGHT=60","WIDTH=470 HEIGHT=39","WIDTH=250 HEIGHT=31","WIDTH=360 HEIGHT=31","WIDTH=123 HEIGHT=33","WIDTH=92 HEIGHT=60","WIDTH=124 HEIGHT=70","WIDTH=92 HEIGHT=60","WIDTH=124 HEIGHT=70","WIDTH=288 HEIGHT=176","WIDTH=92 HEIGHT=60","WIDTH=60 HEIGHT=20","WIDTH=120 HEIGHT=72");
posSrcs = new Array(" ","468x60","468x60","109x65","109x65","124x31","124x31","124x150","124x150","80x31","124x150","92x60","420x108","420x108","124x450","","124x31","124x180","210x210","","286x210","115x17","285x20","240x32","123x48","740x90","92x60","730x31","124x50","124x450","92x60","92x60","470x39","250x31","360x31","123x33","92x60","124x70","92x60","124x70","288x176","92x60","60x20","120x72");
var now = new Date();
var RND = now.getSeconds();
var frameUrl = "http://dclk"
var domainName = new String(self.location);
if (domainName.indexOf("test.themarker.com") != -1) frameUrl += "5";
frameUrl += ".themarker.com/html.ng/site=" + site + "&adsize=" + posSrcs[noPosition] + "&" + (l1=="none"?"":"layer="+l1+"&") + (l2=="none"?"":"layer2="+l2+"&") + (l3=="none"?"":"layer3="+l3+"&") + (l4=="none"?"":"layer4="+l4+"&") + "adtype=hp&page_position=" + noPosition + "&Rnd=" + RND;
if (site=="themarker_msn" && noPosition==18)
	dw("<IFRAME name='ih' src='http://ads.msn.co.il/ad.htm?site=msnthemarker&amp;size=210x210&amp;page=all&amp;rtc= RND' width='210' height='210' marginwidth='0' marginheight='0' frameborder='0' scrolling='no'></IFRAME>");
else
	{
		dw("<IFRAME " + position[noPosition] + " MARGINWIDTH=0 MARGINHEIGHT=0 HSPACE=0 VSPACE=0 FRAMEBORDER=0 SCROLLING=no BORDERCOLOR=000000 SRC=\"" + frameUrl + "\"></IFRAME>");
	}
dw('</div>');	
}

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 sky_ad(sky_layer)
{
	if (site!="themarker_msn")
	{
	var sWidth = screen.width;
	if (sWidth >= 1024) 
		{
			var x = 875 + ((sWidth - 1024) / 2);
			dw("<div name=\"bigAdd\" style=\"position: absolute; height: 450; width: 124; left: " + x + "; top: 75;\">");
			dw("<iframe src=\"http://dclk.themarker.com/html.ng/site=themarker&page_position=14&adsize=124x450&layer=" + sky_layer + "\" height=\"450\" width=\"124\" scrolling=\"No\" marginheight=\"0\" marginwidth=\"0\" frameborder=\"0\"></iframe>");
			dw("</div>");
		}
	}
}

function openWin(Pname,width,height) 
{
	NewVin = open(Pname,"displayWindow","width=455,height=340,top=0,left=0,screenX=150,screenY=150,status=no,toolbar=no,menubar=no, resizable=no,scrolling=no");
	NewVin.focus();
}

function bannerHandler(noPosition,l1,l2,l3,l4,posSrcs,positionStr,site,trace)
{
var bannerURI = "";
var frameStr  = "";
var now = new Date();
var RND = now.getSeconds();
var frameUrl = "http://dclk"
var domainName = new String(self.location);
if (domainName.indexOf("test.themarker.com") != -1) frameUrl += "5";
frameUrl += ".themarker.com/html.ng/site=" + site + "&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;
if (trace == "true")
{
	frameUrl+="&amp;"+"params.styles=trace";
}
if (site=="themarker_msn" && noPosition==18)
	frameStr  = "<IFRAME name='ih' src='http://ads.msn.co.il/ad.htm?site=msnthemarker&amp;size=210x210&amp;page=all&amp;rtc= RND' width='210' height='210' marginwidth='0' marginheight='0' frameborder='0' BORDERCOLOR=#000000 scrolling='no'></IFRAME>";
else
	{
		if (site=="dotomi" && noPosition==1)
		{
			var dotomiSrc = "http://dmm.dotomi.com/dmm/servlet/dmm?rurl=" + escape(frameUrl).replace(new RegExp('\\+','g'),'%2B') + "&pid=400&mtg=0&ms=1&btg=1&mp=1";
	        frameStr  = "<scr"+"ipt src=\"" + dotomiSrc + "\" language=\"javaScript\"></scr"+"ipt>";
	    }
		else
		{ 
			bannerURI  = frameUrl;
			frameStr   = "<IFRAME name='ih'" + positionStr + " MARGINWIDTH=0 MARGINHEIGHT=0 HSPACE=0 VSPACE=0 FRAMEBORDER=0 SCROLLING=no BORDERCOLOR=#000000 SRC=\"" + frameUrl + "\"></IFRAME>";
		}
	}
	return frameStr+"@@@"+bannerURI ;
}

function dw(str){
	document.write(str);
}

function dwl(str){
	document.writeln(str);
}


function showDiv2(num)
{
	var sWidth = screen.width;
	plusDiv.style.display='inline';	
	if(document.getElementById("tmcContent")== null)
		plusDiv.style.top = event.clientY + window.document.body.scrollTop+10;
	else
		plusDiv.style.top = event.clientY + document.getElementById("tmcContent").scrollTop+10;
	plusDiv.style.left = event.clientX;
	
}

function hideDiv2(num)
{
	var sWidth = screen.width;
	plusDiv.style.display='none';
}

function openNewWinKeepParant(newWinAddress,name,width,height,top,left,status,toolbar,menubar,resizable,scrollbars){
 	window.open(newWinAddress,name,'width='+width+',height='+height+',top='+top+',left='+left+',status='+status+',toolbar='+toolbar+',menubar='+menubar+',resizable='+resizable+',scrollbars='+scrollbars);
	return false;
}

function popUpHref(newWinAddress,name,width,height){
 	var hwnd=window.open(newWinAddress,name,'width='+width+',height='+height+',top=10,left=10,status=no,toolbar=no,menubar=no,resizable=no,scrollbars=no');
}

function openWinHref(newWinAddress,name,width,height,properties)
{
	var hwnd=window.open(newWinAddress,name,'width='+width+',height='+height+','+properties);
}

function trimString(str) {
  str = this != window? this : str;
  return str.replace(/^\s+/g, '').replace(/\s+$/g, '');
}

idTemp = null;
var paramAct="";
var paramType="";
var paramName="";
var objstockhttp=null;
var clientY,clientX;

function showStockBox()
{		
	var fromHour,untilHour;
	if ((objstockhttp.readyState==4) && (objstockhttp.status == 200))
	{			
		var respText = objstockhttp.responseText;//get response text			
		if(respText != "")//if there is response text
		{			
			respText=trimString(respText);		
			var ar=respText.split("@@@");			
			
			if(paramName.indexOf("&nbsp;")!=-1)			
				paramName=paramName.replace("&nbsp;"," ");
						
			document.getElementById("dropDown").style.display="inline";
			
			if(clientY < 190)			
				document.getElementById("dropDown").style.top = clientY + window.document.body.scrollTop+10;						
			else 
				document.getElementById("dropDown").style.top = clientY + window.document.body.scrollTop-180;
						

			if (clientX < 340)			
				document.getElementById("dropDown").style.left = window.document.body.scrollLeft+10;		
			else 
				document.getElementById("dropDown").style.left = clientX + window.document.body.scrollLeft-330;		
			
			document.getElementById("premumTitle").innerHTML="<img src='/ibo/images/0.gif' width='10'>"+paramName;			
			if(paramType == "ta"){
				fromHour = "09:45";
				untilHour = "17:30";
			}
			else if(paramType == "ny"){
				fromHour = "15:30";
				untilHour = "23:30";
			}
			else if(paramType == "euro"){
				fromHour = "09:00";
				untilHour = "19:00";
			}

			document.getElementById("graphImg").innerHTML="<img border='0' src='"+ar[0]+"/feature/servlet/chartApp.droplet.ChartDroplet?tickers="+paramAct+"&chT=intraday&types=intraday&since="+fromHour+"&till="+untilHour+"&wdt=175&hgt=135&legend=false' width='175' height='135'>";
			document.getElementById("techAnalysisLink").href = "http://finance.themarker.com/f/techAnalysis.jhtml?from=tags&secCode=" + paramAct + "&sType=" + paramType;					
			document.getElementById("stockLastDailyRate").innerHTML=ar[1];
			document.getElementById("stockDiffRate").innerHTML=ar[2]+"%";			
			if ((ar[2] != "") && (ar[2].indexOf("-") != -1)){//down
				document.getElementById("stockArrow").innerHTML = "<img src='/tmc/i/article/arrowDown.gif' border=0>";
				document.getElementById("stockLastDailyRate").className='dropDownRedBold';
				document.getElementById("stockArrow").className='dropDownRedBold';
				document.getElementById("stockDiffRate").className='dropDownRedBold';
			}
			else{
				document.getElementById("stockArrow").innerHTML = "<img src='/tmc/i/article/arrowUp.gif' border=0>";
				document.getElementById("stockLastDailyRate").className='dropDownDarkGreenBold';
				document.getElementById("stockArrow").className='dropDownDarkGreenBold';
				document.getElementById("stockDiffRate").className='dropDownDarkGreenBold';
			}			
		}
	}
}

function stopLoadingGraph()
{	
	var elm = document.getElementById("graphLoading");
	if (elm)
		elm.style.display = 'none';	
	elm = document.getElementById("graphImg");
	if (elm)
		elm.style.display = 'block';	
	window.clearInterval(loadingGraphInterval);
	loadingGraphInterval = "";	
}

function startLoadingGraph()
{	
	stopLoadingGraph();	
	var elm = document.getElementById("graphLoading");
	if (elm)
		elm.style.display = 'block';
	elm = document.getElementById("graphImg");
	if (elm)
		elm.style.display = 'none';
	loadingGraphInterval = setInterval('stopLoadingGraph()', loadingGraphDelay);
}

/* Client-side access to querystring name=value pairs
	Version 1.3
	28 May 2008
	
	License (Simplified BSD):
	http://adamv.com/dev/javascript/qslicense.txt
*/
function Querystring(qs) { // optionally pass a querystring to parse
	this.params = {};
	
	if (qs == null) qs = location.search.substring(1, location.search.length);
	if (qs.length == 0) return;

// Turn <plus> back to <space>
// See: http://www.w3.org/TR/REC-html40/interact/forms.html#h-17.13.4.1
	qs = qs.replace(/\+/g, ' ');
	var args = qs.split('&'); // parse out name/value pairs separated via &
	
// split out each name=value pair
	for (var i = 0; i < args.length; i++) {
		var pair = args[i].split('=');
		var name = decodeURIComponent(pair[0]);
		
		var value = (pair.length==2)
			? decodeURIComponent(pair[1])
			: name;
		
		this.params[name] = value;
	}
}

Querystring.prototype.get = function(key, default_) {
	var value = this.params[key];
	return (value != null) ? value : default_;
}

Querystring.prototype.contains = function(key) {
	var value = this.params[key];
	return (value != null);
}

function showBox(pType,pAct,madadName,e)
{
        X_POPUP_LOCATION = 50;
        Y_POPUP_LOCATION = 50;
        hideDropDown();//hide previous immediately
	idTemp='';
	paramAct = pAct;
	paramType = pType;
	paramName = madadName
        if (!window.ActiveXObject && !e) 
        {
            clientY = Y_POPUP_LOCATION;
            clientX = X_POPUP_LOCATION;
        } 
        else 
        {
          	if (!e) {
            	e = event;
          	}  
	  		clientY = e.clientY;
	  		clientX = e.clientX;
        }
		
	var qs = new Querystring();
	
	var dclkIframeStockUrl = '/tmc/banners/dclkAjaxFraud.jhtml';
	dclkIframeStockUrl +=    '?dcDivId=dclk_objects_stock&dcDivName=234x60&dclkArticleId=' + dclkArticleId;
	dclkIframeStockUrl +=    '&dclkSection=' + dclkSection +"&dclkChannel=" + paramAct;
	
	document.getElementById("dclk_iframe_stock").src = dclkIframeStockUrl;
		
	startLoadingGraph();

	if(window.XMLHttpRequest && !(window.ActiveXObject)) {
    	try {
			objstockhttp = new XMLHttpRequest();
           } catch(e) {
			objstockhttp = false;
          }
    // branch for IE/Windows ActiveX version
         } else if(window.ActiveXObject) {
         	try {
        	   objstockhttp = new ActiveXObject("Msxml2.XMLHTTP");
        	} catch(e) {
        	try {
          		objstockhttp = new ActiveXObject("Microsoft.XMLHTTP");
        	} catch(e) {
          		objstockhttp = false;
        	}
		}
        }
	if(objstockhttp) {
                 objstockhttp.open ("POST", "/tmc/article/getStockDetails.jhtml", true);
        	 objstockhttp.onreadystatechange=showStockBox;
        	 objstockhttp.setRequestHeader ("Content-Type", "application/x-www-form-urlencoded;");
        	 objstockhttp.send("secCode="+pAct+"&tp="+pType);
        }
}

function hideBox()
{
	timerHideBox = setInterval("hideDropDown()", 1000); 
}

function hideDropDown()
{
	window.clearInterval(loadingGraphInterval);
	loadingGraphInterval = "";	
	window.clearInterval(timerHideBox);
	timerHideBox = "";	
	if(idTemp == "")
	document.getElementById("dropDown").style.display= "none";
}


function hideDrop()
{
	document.getElementById("dropDown").style.display= "none";
}

function showDropPremiumDiv()
{
	document.getElementById("dropDown").style.display="inline";
	idTemp='1';	
}


function changeDropPremiumBgcolor(idName)
{
var cdName= idName+"7";
	if(idName=='manay')
	{
		document.getElementById("manayLink").href="/klal.jhtml?stockid="+paramAct;
		document.getElementById("manay8").href="/klal.jhtml?stockid="+paramAct;
	}
	
	if(idName=='news')
	{
		if(paramType == "ta")
		{
			document.getElementById("newsLink").href="http://finance.themarker.com/f/quote.jhtml?secCode="+paramAct+"&sType="+paramType+"&navBar=comp";
			document.getElementById("news8").href="http://finance.themarker.com/f/quote.jhtml?secCode="+paramAct+"&sType="+paramType+"&navBar=comp";
		}
		else if(paramType == "ny")
		{
			document.getElementById("newsLink").href="http://finance.themarker.com/f/quote.jhtml?secCode="+paramAct+"&sType="+paramType+"&navBar=ws";
			document.getElementById("news8").href="http://finance.themarker.com/f/quote.jhtml?secCode="+paramAct+"&sType="+paramType+"&navBar=ws";
		}
		else
		{
			document.getElementById("newsLink").href="http://finance.themarker.com/f/quote.jhtml?secCode="+paramAct+"&sType="+paramType;
			document.getElementById("news8").href="http://finance.themarker.com/f/quote.jhtml?secCode="+paramAct+"&sType="+paramType;
		}
	}
	if(idName=='analize')
	{
	document.getElementById("Analyst").href="http://finance.themarker.com/f/analyst.jhtml?secCode="+paramAct;
	}
	document.getElementById(idName).className = "dropDownGrey graphBoxUnderLine";
	document.getElementById(cdName).className = "dropDownGrey graphBoxUnderLine";	
}

function hideDropPremiumBgcolor(idName)
{
	var cdName= idName+"7";
	document.getElementById(idName).className = "dropDownGreen graphBoxUnderLine";
	document.getElementById(cdName).className = "dropDownGreen graphBoxUnderLine";
}

document.write("<div id='dropDown' onmouseover='showDropPremiumDiv()' onmouseout='hideDrop()' style='display:none;position:absolute;'>");
document.write("<table cellpadding='0' cellspacing='0' width='322' height='169' dir='ltr' border='0'>");
document.write("<tr>");
document.write("	<td colspan='4'>");
document.write("		<table cellpadding='0' cellspacing='0' width='322' dir='rtl' style='border-left-color: #738A90; border-left-style: solid; border-left-width: 1px;' border=0>");
document.write("		<tr>");	
document.write("			<td height='3' width='3' rowspan=2><table cellpadding='0' cellspacing='0' border='0'><tr><td width='3'><img src='/tmc/i/c/no_color.gif'></td></tr><tr><td width='2' class='graphGreyColor' height='22'></td></tr></table></td>");
document.write("			<td>");
document.write("				<table cellpadding='0' cellspacing='0' width='100%' dir='rtl' border='0'>");
document.write("				<tr>");		
document.write("					<td height='1' bgcolor='#738A90' colspan=6></td>");
document.write("				</tr>");
document.write("				<tr>");
document.write("					<td height='3' width='1' bgcolor='#738A90'></td>");
document.write("					<td id='premumTitle' height='16' width='171' class='dropDownTitle' align=right dir='rtl' style='line-height:1;'></td>");
document.write("					<td id='stockLastDailyRate' height='16' width='52' align=left style='line-height:1;'></td>");
document.write("					<td id='stockArrow' class='dropDownRed' height='16' width='33'></td>");
document.write("					<td id='stockDiffRate' dir='ltr' height='16' width='50' align=right style='line-height:1;'></td>");
document.write("					<td bgColor='84C41C' align=left id='titPic' width='11'></td>");
document.write("				</tr>");
document.write("				<tr>");
document.write("					<td height='3' width='1' bgcolor='#738A90'></td>");
document.write("					<td colspan='5' height='8' class='dropDownGreen'></td></tr>");
document.write("				</table>");
document.write("			</td>");
document.write("		</tr>");
document.write("		</table>");
document.write("	</td>");
document.write("</tr>");
document.write("<tr>");
document.write("	<td width='1' class='graphBoxBorder'></td>");
document.write("	<td width='5' class='dropDownGreen'></td>");
document.write("	<td width='195' class='dropDownGreen'>");
document.write("		<div class='graphDiv' id='graphImg'></div><div id='graphLoading' class='graphLoading'></div>");
document.write("		<div class='techAnalysisLink'><a href=''  id='techAnalysisLink' target='_blank'>לגרף ניתוח טכני</a></div>");
document.write("	</td>");
document.write("	<td width='121' valign='top'>");
document.write("		<table cellpadding='0' cellspacing='0' width='130' dir='rtl' border='0'>");
document.write("		<tr>");
document.write("			<td height='3' width='3' class='graphGreyColor'></td>");
document.write("			<td height='3' width='1' class='graphBoxBorder'></td>");
document.write("			<td id='manay' class='dropDownGreen graphBoxUnderLine' onmouseover=changeDropPremiumBgcolor('manay') onmouseout=hideDropPremiumBgcolor('manay') nowrap>&nbsp;</td>");
document.write("			<td class='dropDownGreen graphBoxUnderLine' onmouseover=changeDropPremiumBgcolor('manay') onmouseout=hideDropPremiumBgcolor('manay') id='manay7'></td>");
document.write("		</tr>");
document.write("		<tr>");
document.write("			<td height='3' width='3' class='graphGreyColor'></td>");
document.write("			<td height='3' width='1' bgcolor='#738A90' ></td>");
document.write("			<td id='news' class='dropDownGreen graphBoxUnderLine' onmouseover=changeDropPremiumBgcolor('news') onmouseout=hideDropPremiumBgcolor('news')><a class='graphBoxLineTitle' href='' id='newsLink'><img src='/tmc/i/article/arrowBlack.gif' border='0'> נתוני מסחר </a></td>");
document.write("			<td class='dropDownGreen graphBoxUnderLine' onmouseover=changeDropPremiumBgcolor('news') onmouseout=hideDropPremiumBgcolor('news') id='news7'><a href='' target=_blank style='cursor:hand;' id='news8'><img src='/ibo/images/0.gif' border=0 width='15'></a></td>");
document.write("		</tr>");
document.write("		<tr>");
document.write("			<td height='3' width='3' class='graphGreyColor'></td>");
document.write("			<td height='3' width='1' bgcolor='#738A90' ></td>");
document.write("			<td id='analize' class='dropDownGreen graphBoxUnderLine' onmouseover=changeDropPremiumBgcolor('analize') onmouseout=hideDropPremiumBgcolor('analize')><a href='' class='graphBoxLineTitle' id='Analyst'><img src='/tmc/i/article/arrowBlack.gif' border=0> המלצות אנליסטים</a></td>");
document.write("			<td id=analize7 class='dropDownGreen graphBoxUnderLine' onmouseover=changeDropPremiumBgcolor('analize') onmouseout=hideDropPremiumBgcolor('analize')>&nbsp;</td>");
document.write("		</tr>");
document.write("		<tr>");
document.write("			<td height='3' width='3' class='graphGreyColor'></td>");
document.write("			<td height='3' width='1' bgcolor='#738A90' ></td>");
document.write("			<td id='mail' class='dropDownGreen graphBoxUnderLine' onmouseover=changeDropPremiumBgcolor('mail') onmouseout=hideDropPremiumBgcolor('mail') nowrap><a class='graphBoxLineTitle' href='http://www.themarker.com/alerts'><img src='/tmc/i/article/arrowBlack.gif' border='0'> התראות במייל</a></td>");
document.write("			<td class='dropDownGreen graphBoxUnderLine' onmouseover=changeDropPremiumBgcolor('mail') onmouseout=hideDropPremiumBgcolor('mail') id='mail7'><a href='http://www.themarker.com/alerts' style='cursor:hand;'><img src='/ibo/images/0.gif' border=0 width='15'></a></td>");
document.write("		</tr>");
document.write("		<tr>");
document.write("			<td height='3' width='3' class='graphGreyColor'></td>");
document.write("			<td height='3' width='1' bgcolor='#738A90' ></td>");
document.write("			<td id='sms' class='dropDownGreen graphBoxUnderLine' onmouseover=changeDropPremiumBgcolor('sms') onmouseout=hideDropPremiumBgcolor('sms')><a class='graphBoxLineTitle' href='http://finance.themarker.com/sms'><img src='/tmc/i/article/arrowBlack.gif' border='0'> התראות SMS</a></td>");
document.write("			<td class='dropDownGreen graphBoxUnderLine' onmouseover=changeDropPremiumBgcolor('sms') onmouseout=hideDropPremiumBgcolor('sms') id='sms7'><a href='http://finance.themarker.com/sms' style='cursor:hand;'><img src='/ibo/images/0.gif' border=0 width='15'></a></td>");
document.write("		</tr>");
document.write("		<tr>");
document.write("			<td height='3' width='3' class='graphGreyColor'></td>");
document.write("			<td height='3' width='1' bgcolor='#738A90' ></td>");
document.write("			<td id='trade' class='dropDownGreen graphBoxUnderLine' onmouseover=changeDropPremiumBgcolor('trade') onmouseout=hideDropPremiumBgcolor('trade') nowrap><a class='graphBoxLineTitleG' href='http://www.themarket-online.co.il/tol/index.html'><img src='/tmc/i/article/arrowGreen.gif' border='0'> TheMarket</a></td>");
document.write("			<td class='dropDownGreen graphBoxUnderLine' onmouseover=changeDropPremiumBgcolor('trade') onmouseout=hideDropPremiumBgcolor('trade') id='trade7'><a href='http://www.themarket-online.co.il/tol/index.html' style='text-decoration : none;cursor:hand;'><img src='/ibo/images/0.gif' border=0 width='15'></a></td>");
document.write("		</tr>");
document.write("		<tr>");
document.write("			<td height='3' width='3' class='graphGreyColor'></td>");
document.write("			<td height='3' width='1' bgcolor='#738A90'></td>");
document.write("			<td id='newsletter' class='dropDownGreen graphBoxUnderLine' onmouseover=changeDropPremiumBgcolor('newsletter') onmouseout=hideDropPremiumBgcolor('newsletter')><a class='graphBoxLineTitleG' href='http://www.themarker.com/newsletter'><img src='/tmc/i/article/arrowGreen.gif' border='0'> ניוזלטרים</a></td>");
document.write("			<td class='dropDownGreen graphBoxUnderLine' onmouseover=changeDropPremiumBgcolor('newsletter') onmouseout=hideDropPremiumBgcolor('newsletter') id='newsletter7'><a href='http://www.themarker.com/newsletter' style='cursor:hand;'><img src='/ibo/images/0.gif' border=0 width='15'></a></td>");
document.write("		</tr>");
document.write("		<tr>");
document.write("			<td height='3' width='3' class='graphGreyColor'></td>");
document.write("			<td height='3' width='1' bgcolor='#738A90' ></td>");
document.write("			<td id='newsmap' class='dropDownGreen graphBoxUnderLine' onmouseover=changeDropPremiumBgcolor('newsmap') onmouseout=hideDropPremiumBgcolor('newsmap')><a class='graphBoxLineTitleG' href='/newsmap/'><img src='/tmc/i/article/arrowGreen.gif' border='0'> newsmap</a></td>");
document.write("			<td class='dropDownGreen graphBoxUnderLine' onmouseover=changeDropPremiumBgcolor('newsmap') onmouseout=hideDropPremiumBgcolor('newsmap') id='newsmap7'><a href='/newsmap/' style='cursor:hand;' ><img src='/ibo/images/0.gif' border=0 width='15'></a></td>");
document.write("		</tr>");
document.write("		<tr>");
document.write("			<td height='3' width='3' class='graphGreyColor'></td>");
document.write("			<td height='3' width='1' bgcolor='#738A90' ></td>");
document.write("			<td id='mishar' class='dropDownGreen graphBoxUnderLine' onmouseover=changeDropPremiumBgcolor('mishar') onmouseout=hideDropPremiumBgcolor('mishar')><a class='graphBoxLineTitle' href='http://www.yih.co.il/themarkeralerts.htm' id='misharLink'><img src='/tmc/i/article/arrowBlack.gif' border='0'> למסחר במניה </a></td>");
document.write("			<td class='dropDownGreen graphBoxUnderLine' onmouseover=changeDropPremiumBgcolor('mishar') onmouseout=hideDropPremiumBgcolor('mishar') id='mishar7'><a href='http://www.yih.co.il/themarkeralerts.htm' target=_blank style='cursor:hand;' id='mishar8'><img src='/ibo/images/0.gif' border=0 width='15'></a></td>");
document.write("		</tr>");
document.write("		<tr>");
document.write("			<td height='3' width='3' class='graphGreyColor'></td>");
document.write("			<td height='3' width='1' bgcolor='#738A90' ></td>");
document.write("			<td colspan='2' height='3' class='dropDownGreen'></td>");
document.write("		</tr>");
document.write("		</table>");
document.write("	</td>");
document.write("</tr>");
document.write("<tr>");
document.write("	<td width='100%' colspan='4'>");
document.write("		<table cellpadding='0' cellspacing='0' border='0' width='100%' style='border-left: #738A90 solid 1px;' dir='rtl'>");
document.write("		<tr>");
document.write("			<td  width='3' height='1' class='graphGreyColor'></td>");
document.write("			<td  width='1' height='1' bgcolor='#738A90' ></td>");
document.write("			<td  bgcolor='#738A90' height='1'></td>"); 
document.write("		</tr>");
document.write("		<tr>");
document.write("			<td  width='3' class='graphGreyColor'></td>");
document.write("			<td  width='1' bgcolor='#738A90' ></td>");
document.write("			<td class='dropDownGreen'  height='7'></td>"); 
document.write("		</tr>");
document.write("		<tr>");
document.write("			<td  width='3' class='graphGreyColor'></td>");
document.write("			<td  width='1' bgcolor='#738A90' ></td>");
document.write("			<td height='72' align='center' class='dropDownGreen'>");
document.write("				<iframe id='dclk_iframe_stock' marginWidth='0' marginHeight='0' frameBorder='0' width='234' scrolling='no' height='60' BORDERCOLOR='000000'></iframe></td>");
document.write("		</tr> ") ;
document.write("		<tr>");
document.write("			<td  width='3' class='graphGreyColor'></td>");
document.write("			<td  width='1' bgcolor='#738A90' ></td>");
document.write("			<td class='dropDownGreen' height='5'></td>");
document.write("		</tr>");
document.write("		</table>");
document.write("	</td>");
document.write("</tr>");
document.write("<tr>");
document.write("	<td width='100%' colspan='4'>");
document.write("		<table cellpadding='0' cellspacing='0' border='0' width='100%' dir='rtl'>");
document.write("		<tr><td width='3' height='1' class='graphGreyColor'></td><td width='319' height='1' bgcolor='#738A90'></td></tr>");
document.write("		</table>");
document.write("	</td>");
document.write("</tr>");
document.write("<tr>");
document.write("	<td colspan='4'>");
document.write("		<table cellpadding='0' cellspacing='0' width='322' border='0' dir='rtl'>");
document.write("			<tr>");
document.write("				<td width='318' height='3' align=right class='graphGreyColor'><img src='/tmc/i/c/no_color.gif' width='3'></td>");
document.write("				<td height='3'><img src='/ibo/images/0.gif'></td>");
document.write("			</tr>");
document.write("		</table>");
document.write("	</td>");
document.write("</tr>");
document.write("</table>");
document.write("</div>");

function log(pageType,id)
{
	var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	xmlhttp.open ("POST", "/tmc/script/logger.jhtml", false);
	xmlhttp.setRequestHeader ("Content-Type", "application/x-www-form-urlencoded");
	xmlhttp.send ("id="+id+"&pageType="+pageType); 
}


function checkCookieStatus(cookieName,expiredHours,showNo)
{
	var currentDate = new Date();
	var hours = expiredHours;
	var name = cookieName;
	var returnvalue = "";
	if(name != "null" && hours != "null")
	{	
		var cookie = document.cookie;
		currentDate.setHours(currentDate.getHours() + hours); 
		ExpDate = currentDate.toGMTString();
		if (cookie.indexOf(name) == -1)
		{
			document.cookie = name+"=1;expires=" + ExpDate + ";path=/";
			return true;
		}
		else
		{
			var freq = showNo*1;
			if(freq != 1)
			{
				search = name+"=";
				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))*1;
					if(returnvalue<freq)
					{
						document.cookie =search+(returnvalue+1)+";expires=" + ExpDate + ";path=/";					
						return true;
					}
				}
			}
			return false;
		}
	}
}

function setClosePos(){
	var closePicX;
	if(document.body.clientWidth >= 1020)
	{
		closePicX = 0;
		document.getElementById("closeGif").style.left = "inline";
	}
	else
		document.getElementById("bigAdd").style.display = "none";
}

function getAbsolutePosition(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;
}

//front page article technology
function closeAd(){
	big.style.display = "none"
	small.style.display = "inline"
}

//registration editions (oren)
function eraseValue()
{
  document.getElementById("myEmail").value="";	
  document.getElementById("myEmail").dir="ltr";
}

function nadlannews()
{
if (document.getElementById("nadlanNews").checked==false)
{
 document.getElementById("allNews").checked=false;
}

}

function mainstories()
{
if (document.getElementById("mainStories").checked==false)
{
 document.getElementById("allNews").checked=false;
}

}


function itedtion()
{
if (document.getElementById("itEdtion").checked==false)
{
 document.getElementById("allNews").checked=false;
}

}


function todaysummery()
{
if (document.getElementById("todaySummery").checked==false)
{
 document.getElementById("allNews").checked=false;
}

}
function bigten()
{
if (document.getElementById("bigTens").checked==false)
{
 document.getElementById("allNews").checked=false;
}

}



function allnews()
{

 if (document.getElementById("allNews").checked==true)
 {
  document.getElementById("mainStories").checked=true;
  document.getElementById("nadlanNews").checked=true;
  document.getElementById("today").checked=true;
  document.getElementById("itNEWS").checked=true;
  document.getElementById("bigTen").checked=true;
 }
 else
 {
document.getElementById("mainStories").checked=false;
document.getElementById("nadlanNews").checked=false;
document.getElementById("today").checked=false;
document.getElementById("itNEWS").checked=false;
document.getElementById("bigTen").checked=false;
 }
 
 
}


function checkEdition()
{
 var i;
 var e=document.getElementById("myEmail").value;
 if ((document.getElementById("allNews").checked==false) && 
     (document.getElementById("nadlanNews").checked==false)&&
     (document.getElementById("mainStories").checked==false) && 
     (document.getElementById("today").checked==false) && 
     (document.getElementById("itNEWS").checked==false)&&
	 (document.getElementById("bigTen").checked==false))
   {
      
      alert("YOU HAVE TO FILL ONE OR MORE CATEGORY");
	  return false;
   }
   
   
  
   
   
   
  
  
  if ((document.getElementById("allNews").checked==true) && 
     (document.getElementById("nadlanNews").checked==true)&&
     (document.getElementById("mainStories").checked==true) && 
     (document.getElementById("today").checked==true) && 
     (document.getElementById("itNEWS").checked==true)&&
	 (document.getElementById("bigTen").checked==true))
   {
  
      document.getElementById("nadlanNews").value="1";
	  document.getElementById("mainStories").value="1";
      document.getElementById("today").value="1";
      document.getElementById("itNEWS").value="1";
	  document.getElementById("bigTen").value="1";
   }
  
  if (document.getElementById("nadlanNews").checked==true)
     document.getElementById("nadlanNews").value="1";  
  
  if (document.getElementById("mainStories").checked==true)
     document.getElementById("mainStories").value="1";  
  
  
  
  if (document.getElementById("today").checked==true)
     document.getElementById("today").value="1";  
  
  
  if (document.getElementById("itNEWS").checked==true)
     document.getElementById("itNEWS").value="1";  
 
  if (document.getElementById("bigTen").checked==true)
     document.getElementById("bigTen").value="1";  
  
  
  
  
   
 
 if (document.getElementById("myEmail").value=='')
   { 
    alert("You have not filled in the Email field");
    return false;
   }
    ok = "1234567890qwertyuiop[]asdfghjklzxcvbnm.@-_QWERTYUIOPASDFGHJKLZXCVBNM";
	for(i=0; i < e.length ;i++)
	{
		if(ok.indexOf(e.charAt(i))<0) 
		{ 

			alert("The email address is not valid.");
			return false;
		}	
	} 
if (document.getElementById("myEmail").value.indexOf("@") == -1)
 {
    
    alert("The email address is not valid.");
    return false;
   }
 if (document.getElementById("myEmail").value.indexOf(".") == -1)
 {
    
    alert("The email address is not valid.");
    return false;
   }   
     

}
/*walla*/
function homePage()
{	
	document.getElementById("home").style.behavior='url(#default#homepage)';
	document.getElementById("home").setHomePage('http://www.themarker.com');
}
function writeState()
{	
	document.getElementById("q").style.background='#FFFFFF';	
}


/*talkbacks function*/

var pL;
var pT;
var left;
var reversedCount = 0;
var count6;
function openWinDetailstalkBacks(url,viewData)
{
var top;
//if(viewData != "")	
//window.open(url,"_blank","top=120,left=268,width=300,height=260");
//else
window.open(url,"_blank","top=120,left=500,width=550,height=250");
}
function getHeaderOffsettalkBacks(){
		var obj=document.getElementById("imgClick");
		return obj.offsetLeft;
	}
function displaySearchTypestalkBacks(elm){
		pL = 0;
		pT = 0;		
		if(searchTypes.style.display == "none"){
				while(elm){
					pL+=elm.offsetLeft;
					pT+=elm.offsetTop;
					elm=elm.offsetParent;
				}
				pL+=getHeaderOffsettalkBacks()*1+17;
				if (pT < 500){
					searchTypes.style.top = pT+20+"px"; 
				}
				else {
					searchTypes.style.top = pT+116-216+"px";
				}
		
				searchTypes.style.left = pL+"px";
		
				
				searchTypes.style.display = "block";
		}
		else{	
			searchTypes.style.display = "none";
		}			
	}
	function displaySearchTypestalkBacks1(elm){
		pL = 0;
		pT = 0;		
		if(searchTypes.style.display == "none"){
				while(elm){
					pL+=elm.offsetLeft;
					pT+=elm.offsetTop;
					elm=elm.offsetParent;
				}
				pL+=getHeaderOffsettalkBacks()*1+0;
				if (pT < 500){
					searchTypes.style.top = pT+20+"px"; 
				}
				else {
					searchTypes.style.top = pT+116-216+"px";
				}
		
				searchTypes.style.left = pL+"px";
		
				
				searchTypes.style.display = "block";
		}
		else{	
			searchTypes.style.display = "none";
		}			
	}
	
	function SelectSearchTypetalkBacks(num,ElementId,msgcount5,layer){
    document.location.href="/tmc/news/allTalkbacks.jhtml?howMany="+num+"&layer="+layer+"&ElementId="+ElementId+"&countlevel0="+msgcount5;
}

/*tags functions*/

var timerHideTagDiv;	
var isShow = false;

function replaceSpecialChars(str)
{		
	while (str.indexOf("&quot;")!=-1)
		str = str.replace("&quot;",'~');
	
	while (str.indexOf("'")!=-1)
		str = str.replace("'",'*');	
		
	while (str.indexOf("&amp;")!=-1)
		str = str.replace("&amp;",'^');	
		
	while (str.indexOf("&")!=-1)
		str = str.replace("&",'^');	
			
	return str;
}

function replaceSpecialCharsBack(str)
{	
	while (str.indexOf('~')!=-1)
		str = str.replace('~',"&quot;");
	
	while (str.indexOf('*')!=-1)
		str = str.replace('*',"'");	
		
	while (str.indexOf('^')!=-1)
		str = str.replace('^',"&");	
		
	return str;
}

function replaceSpace(str)
{	
	re = new RegExp(' ','g');
	return str.replace(re, '%20');	
}

function showTagsDiv(x, slug, startPlace)
{	
	var val,obj;		
	hideTagsDivNow();
	
	if (startPlace == null)
		startPlace = 1;
	
	var countTags = 0;
	var tableInDiv = '<table style="width:83px;" cellpadding="0" cellspacing="0" border="0" width="100%" dir="rtl">';
				
	for (var cnt = startPlace; cnt < 4; cnt++){
		eval("val = valArr"+slug+"["+cnt+"]");			
		if (val != ""){
			countTags = countTags + 1;		
			tableInDiv = tableInDiv + "<tr><td nowrap id=tag"+cnt+" style='padding-right:7px;padding-left:7px; height:17px;' onmouseover=onmouseOverTagLine(true,"+cnt+"); onmouseout=onmouseOverTagLine(false,"+cnt+");><a target='_top' id=tagText"+cnt+" class=tagLineTxt href='/web2/tags.jhtml?tag="+replaceSpace(val)+"'>"+replaceSpecialCharsBack(val)+"</a></td></tr>";		
		}
	}	
	tableInDiv = tableInDiv + "</table>";
	
	obj = document.getElementById("tagsDiv");	
	if (obj){				
		obj.innerHTML = tableInDiv;		
		obj.style.height = countTags*17+2;		
		
		obj.style.left = getAbsolute(x)[0]-80;
		
		if (event.clientY < 400)			
		 	obj.style.top = getAbsolute(x)[1]-20;
		else
		 	obj.style.top = getAbsolute(x)[1]-62+(3-countTags)*17;
		
		obj.style.display = 'block';
	}		
}
	
function keepShowingTagsDiv()
{		
	isShow = true;
	var obj = document.getElementById("tagsDiv");
	if (obj)
		obj.style.display = 'block';
}
	
function hideTagsDivNow()
{	
	isShow = true;
	var obj = document.getElementById("tagsDiv");
	if (obj)
		obj.style.display = 'none';
}

function hideTagsDiv()
{
	window.clearInterval(timerHideTagDiv);
	timerHideTagDiv = "";		
	isShow = false;
	timerHideTagDiv = setTimeout("hideTagsDivAfterWaiting()", 2000); 
}

function hideTagsDivAfterWaiting()
{		
	if (isShow == false)
	{
		window.clearInterval(timerHideTagDiv);
		timerHideTagDiv = "";			
		hideTagsDivNow();		
	}
}
	
function onmouseOverTagLine(isIn,cnt)
{	
	var obj = document.getElementById("tag"+cnt);
	var objA = document.getElementById("tagText"+cnt);
	if (obj)	
	{
		if (isIn == true)//in
			obj.className = 'tagBack';
		else//out
			obj.className='';
	}
	if (objA)	
	{
		if (isIn == true)//in
			objA.className = 'tagLineTxtOver';
		else//out
			objA.className = 'tagLineTxt';
	}
}

function onmouseOverTag(isIn,elm)
{
	if (isIn == true)//in
		elm.className='tagBack';					
	else//out
		elm.className='';		
}

function onmouseOverTagText(isIn,elm)
{
	if (isIn == true)//in
		elm.className='tagsTextOver';					
	else//out
		elm.className='tagsText';			
}	

function onmouseOverTagInComments(isIn,elm)
{
	if (isIn == true)//in
		elm.className='tagBack tagsTextOver';					
	else//out
		elm.className='tagsText';			
}

function onMouseOverSendEmailImgInArticle(isIn,objName)
{	
	var obj = document.getElementById(objName+"Img");
	var imgName;
	if (obj)
	{
		if (isIn == true)
			imgName = "/tmc/i/article/"+objName+"_on.gif";			
		else
			imgName = "/tmc/i/article/"+objName+"_off.gif";
		obj.src = imgName;
	}
}

function onMouseOverPrintImgInArticle(isIn,objName)
{
	if (isIn == true)
		document.getElementById(objName).src="/tmc/i/article/print_on.gif";
	else
		document.getElementById(objName).src="/tmc/i/article/print_off.gif";
}

function onmouseOverTagTextGen(isIn,elm,className)
{
	
	if (isIn == true){//in
		elm.className='tagsTextOverBlack';
	}				
	else{//out
		if (className){
			elm.className = className + ' noTextDecoration';
		}
	}			
}	
/*article - hagesh form*/
function replaceCharsBack(str)
{
	str = str.replace(new RegExp('[~]','g'), "&quot;"); 
	str = str.replace(new RegExp('[*]','g'), "&rsquo;"); 	
	return str;
}
	
function submitHageshForm()
{	
	document.hageshForm.url.value = window.location;
	document.hageshForm.link_title.value = headline;
	document.hageshForm.link_content.value = callout;
	document.hageshForm.submit();
}


function showForum(id)
{
	 if(id==1 || id==2)
	 	j = 1 ;
	else	
	 	j = 3 ;
		
	 for(i=j;i<=j+1;i++)
	 {
		  if(i==id) 
		  {
			document.getElementById("table"+id).style.display ='';
			document.getElementById("rightborder"+i).src="/tmc/i/cafe/light_tik_right.jpg" ;
			document.getElementById("leftborder"+i).src="/tmc/i/cafe/light_tik_left.jpg" ;
			document.getElementById("td"+i).style.backgroundImage="url('/tmc/i/cafe/light_tik_midlle.jpg')" ;
		  }	
		  else	
		  {
			document.getElementById("table"+i).style.display ='none';
			document.getElementById("rightborder"+i).src="/tmc/i/cafe/dark_tik_right.jpg" ;
			document.getElementById("leftborder"+i).src="/tmc/i/cafe/dark_tik_left.jpg" ;
			document.getElementById("td"+i).style.backgroundImage="url('/tmc/i/cafe/dark_tik_midlle.jpg')" ;
		  }
	 }

}
