
//search bar
var lastCurrent="s0"
function ChangeSearch(elem,btnText,baseUrl){
	try{
		document.getElementById(lastCurrent).className="";
		var searchButton=document.getElementById("Search_Button");
		var searchUrl=document.getElementById("Search_Url");
		searchButton.value=btnText;
		searchUrl.value=baseUrl;
		elem.className="current";
		lastCurrent=elem.id;
		document.getElementById("Search_Input").focus();
	}
	catch(e){}
}
function btnSearchEnter(evt){
	evt = (evt) ? evt : event;
	var charCode = (evt.which) ? evt.which : evt.keyCode;
	if(charCode==13) btnSearch();	
}
function btnSearch(){
	var searchButton=document.getElementById("Search_Button")
	var searchUrl=document.getElementById("Search_Url");
	var baseUrl=searchUrl.value
	var searchTerm=document.getElementById("Search_Input").value;
	searchTerm =(baseUrl+searchTerm);
	location.href = searchTerm
}
function btnSearchRestEnter(evt,defaultValue){
	evt = (evt) ? evt : event;
	var charCode = (evt.which) ? evt.which : evt.keyCode;
	if(charCode==13) btnSearchRest(defaultValue);	
}
function btnSearchRest(defaultValue){
	try{
		var searchInput=document.getElementById("search_rest");
		var baseUrl=document.getElementById("search_rest_baseUrl").value;
		if(searchInput.value!=defaultValue && searchInput.value!=""){
			var searchTerm=baseUrl+searchInput.value;
			location.href = searchTerm;
		}
	}
	catch(e){}
}
function SearchRestFocus(elem,defaultValue){ if(elem.value==defaultValue){elem.value="";} }
function sb_change_mode_mode(e){
	var elemMore,elemMoreBtn,elemImg,imgSrc,imgMarginBottom,class_Name,display_Type,doc_onclick;
	var evt = e || window.event;
	var imgUp="http://iscWBE.walla.co.il/w9/h/more-search-close.gif";
	var imgDown="http://iscWBE.walla.co.il/w9/h/more-search.gif";
	elemMoreBtn = document.getElementById("sb_more");
	elemMore = document.getElementById("sb_more_menu");
	elemImg= document.getElementById("sb_more_img");
	imgSrc=imgUp;
	imgMarginBottom="3px";
	class_Name="type2";
	display_Type="block";
	doc_onclick=function(e){sb_change_mode_mode(e);}
	if(elemMore.style.display==display_Type){
		doc_onclick=null;
		display_Type="none";
		class_Name="type2_2";
		imgSrc=imgDown;
		imgMarginBottom="1px";
	}
	document.onclick=doc_onclick;
	elemMoreBtn.className=class_Name;
	elemMore.style.display=display_Type;
	elemImg.src=imgSrc;
	elemImg.style.marginBottom=imgMarginBottom;
	if (evt.stopPropagation) evt.stopPropagation(); else evt.cancelBubble = true;
}
function dd_change_mode_mode(e,dd_btn,dd_list,btn_style1,brn_style2){
	var elemBtn,elemList,class_Name,display_Type,doc_onclick;
	var evt = e || window.event;
	elemBtn = document.getElementById(dd_btn);
	elemList = document.getElementById(dd_list);
	class_Name=btn_style1;
	display_Type="block";
	doc_onclick=function(e){dd_change_mode_mode(e,dd_btn,dd_list,btn_style1,brn_style2);}
	if(elemList.style.display==display_Type){
		doc_onclick=null;
		display_Type="none";
		class_Name=brn_style2;
	}
	document.onclick=doc_onclick;
	elemBtn.className=class_Name;
	elemList.style.display=display_Type;
	if (evt.stopPropagation) evt.stopPropagation(); else evt.cancelBubble = true;
}
function changeClass(el,class_Name){ el.className=class_Name; }
function promoMouseOver(elemPromo){
	elemPromo.style.backgroundImage="url(http://iscWBE.walla.co.il/w9/h/item-promo11-1.gif)";
	var aTags = elemPromo.getElementsByTagName("a");
	for(var i=0;i<aTags.length;i++){ aTags[i].style.color="white"; }
}
function promoMouseOut(elemPromo){
	elemPromo.style.backgroundImage="url(http://iscWBE.walla.co.il/w9/h/item-promo0.gif)";
	var aTags = elemPromo.getElementsByTagName("a");
	for(var i=0;i<aTags.length;i++){ aTags[i].style.color="#454545"; }
}
function topLinksMouseOver(elemX){
	elemX.style.backgroundColor="#476aa5";
	var aTags = elemX.getElementsByTagName("a");
	for(var i=0;i<aTags.length;i++){ aTags[i].style.color="white"; }
	elemX.style.color="white";
}
function topLinksMouseOut(elemX){
	elemX.style.backgroundColor="#e7e7e7";
	if(elemX.className=="btn2"){elemX.style.backgroundColor="#f7f3f7";}
	var aTags = elemX.getElementsByTagName("a");
	for(var i=0;i<aTags.length;i++){ aTags[i].style.color="#424542"; }
	elemX.style.color="#424542"
}
var vidPageNum;
function vidPages(move,side,maxPages){
	if(!vidPageNum) vidPageNum=1;
	var baseId="vpage";
	if(move==true){
		document.getElementById(baseId+vidPageNum).src="http://iscWBE.walla.co.il/w9/h/vid-10.gif";
		if(side=="left"){
			if(vidPageNum==1) vidPageNum=maxPages; //1;//
			else vidPageNum--;
		}
		else{
			if(vidPageNum==maxPages) vidPageNum=1; //maxPages;//
			else vidPageNum++;
		}
		document.getElementById(baseId+vidPageNum).src="http://iscWBE.walla.co.il/w9/h/vid-11.gif";
	}
}
function removeTextElems(elemid){
	try{
		elem = document.getElementById(elemid);
		var i=elem.childNodes.length;
		while(i>0){
			if(elem.childNodes[i-1].nodeType==3) elem.removeChild(elem.childNodes[i-1]);
			i--;
		}
	}
	catch(e){}
}
function RemoveBrokenImage(imagex){
	if (!imagex.complete) imagex.src="http://iscWBE.walla.co.il/spc.gif"; //ie
	if (typeof imagex.naturalWidth!="undefined" && imagex.naturalWidth==0) imagex.src="http://iscWBE.walla.co.il/spc.gif";//firefox
}
function fixBorders(){
	var maxHeight,lHeight,cHeight,rHeight;
	try{
		var lElem=document.getElementById("lb");
		var cElem;
		try{
			cElem=document.getElementById("ctl_bottom_ad");
			if(!cElem){cElem=document.getElementById("text_ads");}
		}
		catch(e){ cElem=document.getElementById("text_ads"); }
		var cElemTarget=document.getElementById("text_ads");
		var rElem=document.getElementById("tours_float");
		var lInner=document.getElementById("katavot_ads_inner");
		var cInner=document.getElementById("text_ads_inner");
		for(i=0;i<rElem.childNodes.length;i++){ if (rElem.childNodes[i].className=="inborder") break; }
		if(i<rElem.childNodes.length) rInner=rElem.childNodes[i];
		lElem.style.borderBottom="0px";
		cElem.style.borderBottom="0px";
		rElem.style.borderBottom="0px";
		var ie_fix_top=document.getElementById("cb").offsetTop;
		var lFixFirefox=1;
		if(!document.all){ie_fix_top=0;lFixFirefox=1}
		lHeight=lElem.offsetHeight+lElem.offsetTop;
		cHeight=cElem.offsetHeight+cElem.offsetTop+ie_fix_top;
		rHeight=rElem.offsetHeight+rElem.offsetTop+ie_fix_top;
		maxHeight=Math.max(lHeight,cHeight);
		maxHeight=Math.max(maxHeight,rHeight);
		if(maxHeight-lHeight>0)lElem.style.height=lElem.offsetHeight+maxHeight-lHeight+"px";
		if(maxHeight-cHeight>0)cElemTarget.style.height=cElemTarget.offsetHeight-lFixFirefox+maxHeight-cHeight+"px";
		if(maxHeight-rHeight>0)rElem.style.height=rElem.offsetHeight+maxHeight-rHeight+"px";
		if(maxHeight-lHeight>0){lInner.style.height=lElem.offsetHeight-23+"px";}
		if(maxHeight-cHeight>0){cInner.style.height=cElemTarget.offsetHeight-23+"px";}
		if(maxHeight-rHeight>0){if(rInner)rInner.style.height=rElem.offsetHeight-23+"px";}
	}
	catch(e){}
}
function addEvent(obj,type,fn){
	if (obj.addEventListener) obj.addEventListener( type, fn, false );
	else if (obj.attachEvent){
		obj["e"+type+fn] = fn;
		obj[type+fn] = function() { obj["e"+type+fn]( window.event ); }
		obj.attachEvent( "on"+type, obj[type+fn] );
	}
}
function removeEvent(obj,type,fn){
	if (obj.removeEventListener) obj.removeEventListener( type, fn, false );
	else if (obj.detachEvent){
		obj.detachEvent( "on"+type, obj[type+fn] );
		obj[type+fn] = null;
		obj["e"+type+fn] = null;
	}
}

/* Ajax Engine Start*/
function GetXmlHttpObject(){
	var xmlHttp;
	try{	//Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();
  	}
	catch (e){  // Internet Explorer
		try{ xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); }
		catch (e){
    		try{ xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); }
    		catch (e){ return false; }
	    }
	}
	return xmlHttp;
}
function stateChanged(xmlHttp,deleg,var1,var2,var3,var4){
	if(xmlHttp.readyState==4){
		response=xmlHttp.responseText;
		deleg(response,var1,var2,var3,var4);
	}
}
function statePassive(){}
function ajaxRequest(url,parameters,deleg,var1,var2,var3,var4){
	var xmlHttp=GetXmlHttpObject();
	xmlHttp.open("GET", url+'?'+parameters, true);
	xmlHttp.onreadystatechange = function(){stateChanged(xmlHttp,deleg,var1,var2,var3,var4);}
	xmlHttp.send(null);
}
function countRequest(url){
	var xmlHttp=GetXmlHttpObject();
	xmlHttp.open("GET",url,true);
	xmlHttp.onreadystatechange = statePassive;
	xmlHttp.send(null);
}
/* Ajax Engine end*/
function Evt(elemEvt,e,fatherDiv,linkIndex){
	try{
		var evtType="1";
		var evtBaseUrl="http://a.walla.co.il/events.asp"
		var evtImg=document.getElementById("counterImg");
		evtImg.src=evtBaseUrl+"?unique_slot=4&un=&l=walla.homepage.&c=whp.&cp=3&event_type="+evtType+"&DivName="+fatherDiv+"&page_location="+linkIndex+"&geo=IL&url="+elemEvt.href;
	}
	catch(ex){}

	if(elemEvt=="http://maps.walla.co.il/") maavaronMapsTakeover(elemEvt.href,e,fatherDiv); 
		var maav_deny_link= new Array();
		maav_deny_link[0]="http://www.wallashops.co.il/ws/main.aspx|";
		maav_deny_link[1]="http://www.wallashops.co.il/ws/Top15.aspx|";
		maav_deny_link[2]="http://www.wallashopsphoto.co.il/|";
		maav_deny_link[3]="http://www.wallatours.co.il/heb/index.asp|";
		maav_deny_link[4]="http://www.wallabuy.co.il/|";
		maav_deny_link[5]="http://www.wallajobs.co.il/index.aspx?AffiliateID=100&SourceId=200|";
		maav_deny_link[6]="http://www.orange.co.il/time/gamestemp/|";
		maav_deny_link[7]="http://www.jdate.co.il/Applications/MemberProfile/RegistrationStep1.aspx?prm=60515|";
		maav_deny_link[8]="http://yoram.walla.co.il/ts.cgi?tsscript=st/index|";
		maav_deny_link[9]="http://www.b144.co.il/|";
		maav_deny_link[10]="http://www.manpower.co.il/|";
		maav_deny_link[11]="http://www.iforex.com/emerp/landing/masterLP/testRegLP.aspx?lang=Hebrew&content=wallaConvertor&top=yes&SID=90847|";
		maav_deny_link[12]="http://movies.walla.co.il/|";
		maav_deny_link[13]="http://health.walla.co.il/?w=/5107|";
		maav_deny_link[14]="http://coffee.walla.co.il/|";
		maav_deny_link[15]="http://bezeqint.walla.co.il/|";
		maav_deny_link[16]="http://animals.walla.co.il/|";
		maav_deny_link[17]="http://manachama.walla.co.il/|";
		maav_deny_link[18]="http://sports.walla.co.il/?w=/@liveGames|";
		maav_deny_link[19]="http://sports.walla.co.il/?w=/3769|";
		maav_deny_link[20]="http://gemel.walla.co.il/|";
		maav_deny_link[21]="http://www.walla.co.il/ts.cgi?w=http://www.6382020.co.il|";
		maav_deny_link[22]='javascript:other_radio("http://radio.eol.co.il/RadioWalla.aspx");|';
		maav_deny_link[23]="http://yoram.walla.co.il/|";
		maav_deny_link[24]="http://www.wallajobs.co.il/|";
		maav_deny_link[25]="http://www.layla.co.il/|";
		maav_deny_link[26]="http://maps.walla.co.il/|";
		maav_deny_link[27]="http://hugim.walla.co.il/|";
		maav_deny_link[28]="http://www.wallatours.co.il/|";
		maav_deny_link[29]="http://zone.walla.co.il/?w=/2762|";
		maav_deny_link[30]="http://www.yad2.co.il/|";
		maav_deny_link[31]="http://www.wallashopsphoto.co.il/yoman.aspx|";
		maav_deny_link[32]="http://www.orange.co.il/music|";
		maav_deny_link[33]="http://tickets.wallashops.co.il|";
		maav_deny_link[34]="http://he.iforex.com/SID135442/currency-exchange|";
		maav_deny_link[35]="http://walla.iforex.com/|";
		maav_deny_link[36]="http://he.iforex.com/SID138087/currency-exchange|";
		
		
		var maav_array_div= new Array();
		maav_array_div[0] = "lgn";
		maav_array_div[1] = "promos";
		maav_array_div[2] = "Walla_Sites51";
		maav_array_div[3] = "walla_jobs60";
		maav_array_div[4] = "yoram12";
		maav_array_div[5] = "ct_shops";
		maav_array_div[6] = "movies29";
		maav_array_div[7] = "cellular38";
		maav_array_div[8] = "search_bar";
		maav_array_div[9] = "specials";
		maav_array_div[10] = "walla_yad2199";
		maav_array_div[11] = "tours_float";
		
		if(maav_deny_link.length>0 || maav_array_div.length>0){
			var maav_deny_string= maav_deny_link.toString();
			var maav_array_string= maav_array_div.toString();
			if(maav_deny_string.indexOf(elemEvt+"|")==-1 && maav_array_string.indexOf(fatherDiv)==-1){
				maavaronTakeover(elemEvt.href,e,fatherDiv);	
			}
		}
	
}
function EvtAds(e,elem,banner){
	var evt = e || window.event;
	if(evt.preventDefault){evt.preventDefault();} else {evt.returnValue=false;}
	var da = new Date();
	var ta = da.getTime();
	evtBaseURL="http://clicks.walla.co.il/hp_c.asp?tt="+ta+"&banner="+banner+"&location=walla.homepage.&href="+elem.href;
	ImageCollection.addImage(evtBaseURL,"counterImg");
	ImageCollection.loadImages(window.location.href=elem.href);		
}
function EvtAdsOrng(elemEvt,bannerId,BannerClickInfo){
	var evtBaseURL="http://a.walla.co.il/hp_c.asp";
	var evtImg=document.getElementById("counterImg");
	evtBaseURL=evtBaseURL+"?banner="+bannerId+"&location=walla.homepage.&BannerClickInfo="+BannerClickInfo;
	evtImg.src=evtBaseURL;
}

var maavaronUrl;
function maavaronTakeover(url,e,fatherDiv){
	
			var now=new Date();
			var d = new Date(now.getFullYear(),now.getMonth(),now.getDate()+1);
			var curCookie = "maav1720013=20013; expires=" + d.toGMTString() + "; domain=" + document.domain;
			document.cookie = curCookie;
			var curCookie1 = "maav=809; expires=" + d.toGMTString() + "; domain=" + document.domain;
			document.cookie = curCookie1;
			
	try{Views("173690,"+cid);}catch(e){}
	if (url.indexOf("?")>-1){
		maavaronUrl=url+"||m=1||mid=75220";
	}
	else{
		maavaronUrl=url+"?m=1||mid=75220";
	}
	if(!url) return;
	try{
		var mainElem = document.getElementById("w");
		var maavaronElem = document.getElementById("maavaron");
		var maavaronLink = document.getElementById("maavaron_link");
		var maavaronLink2 = document.getElementById("maavaron_link2");
		
		var my_mav = document.getElementById("maavaron_ad");
		
		var evt = e || window.event;
		if(evt.preventDefault){evt.preventDefault();} else {evt.returnValue=false;}
		
		mainElem.style.display="none";
		try{document.getElementById("ads_mega").style.display="none";} catch(e){}
		maavaronElem.style.display="block";
		maavaronLink.href="http://clicks.walla.co.il/hp_c.asp?banner=173690&location=walla.homepage.&BannerClickInfo=SkipMaav&href="+maavaronUrl;
		maavaronLink2.href="http://clicks.walla.co.il/hp_c.asp?banner=173690&location=walla.homepage.&BannerClickInfo=SkipMaav&href="+maavaronUrl;
		
		my_mav.style.display="inline";
		
		setTimeout(function(){location.href=url},6000);
	}
	catch(e){location.href=url;}
}

var maavaronUrl;
function maavaronMapsTakeover(url,e,fatherDiv){	
	
			var now=new Date();
			var d = new Date(now.getFullYear(),now.getMonth(),now.getDate()+7);
			var curCookie = "maav99999=999; expires=" + d.toGMTString() + "; domain=" + document.domain;
			document.cookie = curCookie;
			var curCookie1 = "maav=809; expires=" + d.toGMTString() + "; domain=" + document.domain;
			document.cookie = curCookie1;
			
	try{Views("137072,"+cid);}catch(e){}
	maavaronUrl="http://maps.walla.co.il/?m=1||mid=137072";
	try{
		var mainElem = document.getElementById("w");
		var maavaronElem = document.getElementById("maavaron");
		var maavaronLink = document.getElementById("maavaron_link");
		var maavaronLink2 = document.getElementById("maavaron_link2");
		
		var my_mav = document.getElementById("maavaron_ad_maps");
			
		var evt = e || window.event;
		if(evt.preventDefault){evt.preventDefault();} else {evt.returnValue=false;}
		
		mainElem.style.display="none";
		try{document.getElementById("ads_mega").style.display="none";} catch(e){}
		maavaronElem.style.display="block";
		maavaronLink.href="http://clicks.walla.co.il/hp_c.asp?banner=137072&location=walla.homepage.&BannerClickInfo=SkipMaav&href="+maavaronUrl;
		maavaronLink2.href="http://clicks.walla.co.il/hp_c.asp?banner=137072&location=walla.homepage.&BannerClickInfo=SkipMaav&href="+maavaronUrl;
		
		my_mav.style.display="inline";
		
		setTimeout(function(){location.href=maavaronUrl},6000);
	}
	catch(e){location.href=url;}
}
//count banner views
function Views(bans){
	var evtBaseURL="http://a.walla.co.il/hp_e.asp";
	var evtImg=document.getElementById("counterImg");
	evtBaseURL=evtBaseURL+"?location=walla.homepage.&banner="+bans+"&geo=IL";
	evtImg.src=evtBaseURL;
}
var intRequests;
function do_requests(url){
	var parameters = "tsscript=finance.ajax";
	parameters += "&REQUEST=GET_FINANCES";
	ajaxRequest(url,parameters,do_responses);
	return false;
}
function do_responses(response){
	try{
		var elem=document.getElementById("content_currency");
		elem.innerHTML=response;
		FinanceScroll="";
		financeScrollerInit();
	}
	catch(e){}
}
function pnayMoviesClick(movieId){
	var baseurl1="http://movies.walla.co.il/?w=/"
	var baseurl2="/@movies"
	var fullUrl = baseurl1+movieId+baseurl2;
	location.href=fullUrl;
}
var baseURL="http://www.walla.co.il/ts.cgi";
var hp_once=0,cid="";
var ref_load;
function pageLoadInit(){
	try{RemoveBrokenImage(document.getElementById("promo_shops_image"))}catch(e){}
	try{fixBorders();}catch(e){}
	try{setTimeout("newsScrollerInit()",2000);}catch(e){}
	try{do_requests(baseURL);}catch(e){}
	try{intRequests = setInterval(function(){do_requests(baseURL);},300000);}catch(e){}
	try{ImageCollection.loadImages(loadFlash);}catch(e){};
	try{VideoScrollerInit();}catch(e){}
	try{addEvent(window,"resize",checkRes);}catch(e){}
	try{checkRes();}catch(e){}
	try{Views("173068,173152,173311,173613,173348,173968,172148,173759,173554,173320,"+cid);hp_once=1;}catch(e){}
	
}

function loadFlash(){
AC_FL(
				"footer_1_",
				"codebase", "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0",
				"width", "369",
				"height", "55",
				"src", "http://xban.walla.co.il/banners/1/7/173068.swf",
				"flashvars","banner_id=173068&div_id=footer_1_&url=http://clicks.walla.co.il/hp_c.asp?banner=173068&location=walla.homepage.&href=http://www.caw.co.il/",
				"pluginspage", "http://www.macromedia.com/go/getflashplayer",
				"align", "middle","play", "true","loop", "true","scale", "showall",
				"wmode", "opaque",
				"quality", "high","devicefont", "false","bgcolor", "#ffffff",
				"id", "footer_1__swf",				
				"name", "footer_1__swf",
				"menu", "true",	"allowFullScreen", "false","allowScriptAccess","always",
				"movie", "http://xban.walla.co.il/banners/1/7/173068.swf"
				);AC_FL(
				"optimos_1_",
				"codebase", "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0",
				"width", "748",
				"height", "180",
				"src", "http://xban.walla.co.il/banners/1/7/173311.swf",
				"flashvars","banner_id=173311&div_id=optimos_1_&url=http://clicks.walla.co.il/hp_c.asp?banner=173311&location=walla.homepage.&href=http://hot.ynet.co.il/home/0,7340,L-7638,00.html",
				"pluginspage", "http://www.macromedia.com/go/getflashplayer",
				"align", "middle","play", "true","loop", "true","scale", "showall",
				"wmode", "opaque",
				"quality", "high","devicefont", "false","bgcolor", "#ffffff",
				"id", "optimos_1__swf",				
				"name", "optimos_1__swf",
				"menu", "true",	"allowFullScreen", "false","allowScriptAccess","always",
				"movie", "http://xban.walla.co.il/banners/1/7/173311.swf"
				);AC_FL(
				"maavron_1_",
				"codebase", "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0",
				"width", "720",
				"height", "300",
				"src", "http://xban.walla.co.il/banners/1/7/173690.swf",
				"flashvars","banner_id=173690&div_id=maavron_1_&url=http://clicks.walla.co.il/hp_c.asp?banner=173690&location=walla.homepage.&href=http://media.gorni.co.il/Site/HOT/chamizer/",
				"pluginspage", "http://www.macromedia.com/go/getflashplayer",
				"align", "middle","play", "true","loop", "true","scale", "showall",
				"wmode", "opaque",
				"quality", "high","devicefont", "false","bgcolor", "#ffffff",
				"id", "maavron_1__swf",				
				"name", "maavron_1__swf",
				"menu", "true",	"allowFullScreen", "false","allowScriptAccess","always",
				"movie", "http://xban.walla.co.il/banners/1/7/173690.swf"
				);AC_FL(
				"maavron_maps_1_",
				"codebase", "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0",
				"width", "720",
				"height", "300",
				"src", "http://xban.walla.co.il/banners/1/6/164406.swf",
				"flashvars","banner_id=137072&div_id=maavron_maps_1_&url=http://clicks.walla.co.il/hp_c.asp?banner=137072&location=walla.homepage.&href=http://www.hye.co.il/download/flash/que/index.html",
				"pluginspage", "http://www.macromedia.com/go/getflashplayer",
				"align", "middle","play", "true","loop", "true","scale", "showall",
				"wmode", "opaque",
				"quality", "high","devicefont", "false","bgcolor", "#ffffff",
				"id", "maavron_maps_1__swf",				
				"name", "maavron_maps_1__swf",
				"menu", "true",	"allowFullScreen", "false","allowScriptAccess","always",
				"movie", "http://xban.walla.co.il/banners/1/6/164406.swf"
				);;
}
function containsDOM (container, containee) {
  var isParent = false;
  do{
    if ((isParent = container == containee)) break;
    containee = containee.parentNode;
  }
  while (containee != null);
  return isParent;
}

var tOutNews,tOutFinance,objNews,objFinance;
function newsScrollerInit(){
	try{
	var newsDiv1=document.getElementById('NewsScroller1');
	newsDiv2=document.createElement("div");
	for(var i=0;i<3;i++){newNode=newsDiv1.childNodes[i].cloneNode(true);newsDiv2.appendChild(newNode)}
	newsDiv2.id="NewsScroller2"
	newsDiv2.style.position="relative";
	newsDiv2.style.top=newsDiv1.offsetHeight;
	var fatherElem=newsDiv1.parentNode;
	fatherElem.appendChild(newsDiv2);
	objNews=document.getElementById("NewsScrollerContainer");
	objNews.style.top=0;
	AreaHeightNews=newsDiv1.offsetHeight;
	ScrollNewsDiv();
	}catch(e){}
}
function financeScrollerInit(){
	try{
	var FinanceScroller1=document.getElementById("FinanceScroller1");
	removeTextElems("FinanceScroller1");
	var FinanceScroller2=document.createElement("div");
	for(var i=0;i<3;i++){var newNode=FinanceScroller1.childNodes[i].cloneNode(true);FinanceScroller2.appendChild(newNode);}
	FinanceScroller2.id="FinanceScroller2"
	var fatherElem=FinanceScroller1.parentNode;
	fatherElem.appendChild(FinanceScroller2);
	var calcWidth=0;
	for(var i=0;i<FinanceScroller1.childNodes.length;i++){ calcWidth+=(FinanceScroller1.childNodes[i].offsetWidth)*1+20;}
	FinanceScroller1.style.width=calcWidth;
	objFinance=document.getElementById("FinanceScrollerContainer");
	objFinance.style.right=0;
	AreaHeightFinance=calcWidth;
	ScrollFinanceDiv();
	}catch(e){}
}
function ScrollNewsDiv(){
	try{var num=parseInt(objNews.style.top)
  	objNews.style.top=num-(1);
    if(num<AreaHeightNews*(-1)){ clearTimeout(tOutNews);objNews.style.top=0 }
	tOutNews=setTimeout("ScrollNewsDiv()",70)}catch(e){}
}
function ScrollFinanceDiv(){
	var num=parseInt(objFinance.style.right);
    objFinance.style.right=num-(1);
    if(num<AreaHeightFinance*(-1)){ objFinance.style.right=0;clearTimeout(tOutFinance)}
	tOutFinance=setTimeout("ScrollFinanceDiv()",45)
}
function scrollStop(sType){	
	if(sType=="news") clearTimeout(tOutNews);
	else clearTimeout(tOutFinance);
}
function scrollResume(element,evt,sType){
	var isOut="";
	if (element.contains && evt.toElement){ isOut=(!element.contains(evt.toElement)); }
  	else if (evt.relatedTarget){ isOut=(!containsDOM(element, evt.relatedTarget)); }
	if(isOut){
		if(sType=="news") ScrollNewsDiv();
		else ScrollFinanceDiv();
	}
}
function Delegate() { }
Delegate.create = function(scope, func) {
    var args = [];
    for (var i = 2; i < arguments.length; i++) args[i - 2] = arguments[i];
    return function() {
        var argsArr = [].concat(arguments, args);
        func.apply(scope, argsArr);
    }
}
Delegate.addEventListener = function(evtType, scopeRef, funcRef) {
    if (!this.listeners) this.listeners = [];
    if (this.listeners[evtType]) { // event exists add to stack
        this.removeEventListener1(evtType, funcRef);
        this.listeners[evtType].push({ scope: scopeRef, func: funcRef });
    } else { // no event registered, create new array
        this.listeners[evtType] = new Array();
        this.listeners[evtType].push({ scope: scopeRef, func: funcRef });
    }
    this.listeners[evtType];
}
Delegate.removeEventListener = function(evtType, funcRef) {
    var removed = false;
    if (this.listeners[evtType]) { // event exists remove it
        var i = this.listeners[evtType].length;
        while (i--) {
            if (this.listeners[evtType][i].func == funcRef) {
                this.listeners[evtType].splice(i, 1);
                removed = true;
            }
        }
        if (this.listeners[evtType].length == 0) {
            var newLiList = new Array();
            for (var i in this.listeners) { // collect other listeners
                if (i != evtType) newLiList[i] = this.listeners[i];
            }
            removed = true;
        }
    }
    return removed;
}
Delegate.dispatchEvent = function(evtType, dataObj) {
    if (!this.listeners) return;
    if (this.listeners[evtType]) {
        var evtList = this.listeners[evtType]
        for (var i = 0; i < evtList.length; i++) {
            var evt = evtList[i];
            evt.func.call(evt.scope, { type: evtType, data: dataObj });
        }
    }
}
// Image Preloader class
function ImageLoader(){
	if (arguments.length ==0) return;
	this.init.apply(this,arguments)
}
ImageLoader.images = [];
ImageLoader.prototype.init = function(src){
	this.args = [];
	this.targets = [];
	for (var i = 1; i < arguments.length; i++) {
		this.args[i - 1] = arguments[i];
		try { this.targets[i-1] = document.getElementById(this.args[i-1]);} catch (e) {}
	}
	this.img = new Image();
	this.img.onload = Delegate.create(this,this.imageLoaded);
	this.img.src = src;
	ImageLoader.images.push(this.img);
}
ImageLoader.prototype.imageLoaded = function(){
	for (i=0;i<this.targets.length;i++){
		if(this.targets[i]){this.targets[i].src=this.img.src;}
		if(i==this.targets.length-1 && this.onFinished){this.onFinished();}
	}
}
// Image Collection Class
ImageCollection = {
	imageUri:[],
	targets:[],
	addImage:function(){
		this.imageUri.push(arguments[0]);
		var imageTargetId = new Array();
		var i;
		for (i=1;i<arguments.length;i++){ imageTargetId.push(arguments[i]); }
		this.targets.push(imageTargetId);
	},
	loadImages:function(deleg){
		var i;
		for (i=0;i<this.imageUri.length;i++){
			var params = new Array();
			params.push(this.imageUri[i]);	
			var j;
			for(j=0;j<this.targets[i].length;j++){ params.push(this.targets[i][j]); }
			var l = new ImageLoader();
			if(i==this.imageUri.length-1){l.onFinished=deleg;}
			l.init.apply(l,params);
		}
	}
};
function Tween(){ this.init.apply(this,arguments);}
// animating the height of a box// propertyAffected = html element (object)// startValue = starting vaue// endValue = ending value// sec = number of seconds for animation to take palce (an approximation)// evalFunc = function to execute when animation finishes
Tween.prototype.init = function(elementAffected, propertyAffected, tweenFunc, startValue, endValue, secs) {
    this.num1=this.time1=this.startingPropertyValue=this.endingPropertyValue=this.seconds= 0;
    this.pauseMode=this.animationRunning= false;
    this.interval = 30; // 25 iterations per seciond
    this.tweenFunction = tweenFunc;
    this.objectToAnimate = elementAffected;
    this.seconds = secs * 20;
    this.startingPropertyValue = startValue;
    this.endingPropertyValue = endValue-this.startingPropertyValue;
    this.propertyToAnimate = propertyAffected;
}
Tween.prototype.addEventListener = Delegate.addEventListener;
Tween.prototype.removeEventListener = Delegate.removeEventListener;
Tween.prototype.dispatchEvent = Delegate.dispatchEvent;
Tween.strongEaseOut = function(t, b, c, d) { return c * ((t = t / d - 1) * t * t * t * t + 1) + b;}
Tween.linear = function(t, b, c, d) {return c * t / d + b;}
// get position of element
Tween.prototype.getPos = function(element) {
    var x=y=0;
    while (element != null) {
        x += element.offsetLeft - element.scrollLeft;
        y += element.offsetTop - element.scrollTop;
        element = element.offsetParent;
    }
    return { x: x, y: y };
}
// animation renderer function, runs on setInterval
Tween.prototype.animateAnimationRenderer = function() {
    if (this.pauseMode) return;
    var el = this.objectToAnimate;
    var b = parseInt(el[this.propertyToAnimate]);
    //startTime,y,distance,duration
    this.pos = Math.ceil(this.tweenFunction(this.time1, this.startingPropertyValue, this.endingPropertyValue, this.seconds));
    el[this.propertyToAnimate] = this.pos;
    this.time1++;
    if (this.seconds - this.time1 <= 0) {
        this.dispatchEvent("onMotionEnd", { target: this, time: this.time1 });
        this.time1 = 0;
        this.animationRunning = false;
        return;
    }
    this.resumeAnimation();
}
Tween.prototype.resumeAnimation = function() {
    this.animationRunning = true;
    this.timeout = setTimeout(Delegate.create(this, this.animateAnimationRenderer), this.interval);
}
Tween.prototype.start = function() {
    if (this.pauseMode) {
        this.pauseMode = false;
        this.resumeAnimation();
        return;
    }
    this.resumeAnimation();
    this.objectToAnimate[this.propertyToAnimate] = this.startingPropertyValue;
    this.dispatchEvent("onMotionStart", { target: this });
}
Tween.prototype.continueTo = function(newValue) {
    if (!this.pos) this.pos = parseInt(this.objectToAnimate[this.propertyToAnimate]);
    this.startingPropertyValue = this.pos;
    this.endingPropertyValue = newValue;
    if (!this.animationRunning){ this.start(); }
}
Tween.prototype.pause = function() {
    this.pauseMode = true;
    this.dispatchEvent("onPause", { target: this });
}
Tween.prototype.stop = function() {
    this.animationRunning = false;
    this.dispatchEvent("onMotionEnd", { target: this, time: this.seconds });
    clearTimeout(this.timeout);
    this.time1 = 0;
}
var VideoScroll = {};
function VideoScrollerInit(){
	removeTextElems("VideoScroller");
	VideoScroll = document.getElementById("VideoScroller");
	VideoScroll.style.width=VideoScroll.firstChild.offsetWidth*VideoScroll.childNodes.length;
	VideoScroll.style.right="0";
	VideoScroll.motionBlock = VideoScroll.firstChild.offsetWidth;
	VideoScroll.startPos=parseInt(VideoScroll.style.right);
	VideoScroll.inMotionLeft=false;
	VideoScroll.inMotionRight=false;
	VideoScroll.tween;
	VideoScroll.pageIndex=1;
	VideoScroll.lastPress=0;
	VideoScroll.lastPageImg=document.getElementById("vpage1");
	VideoScroll.totalBlocks=VideoScroll.childNodes.length;
	VideoScroll.cameFromScroll=false;
	VideoScroll.incIndex=function incIndex(){
	    if(VideoScroll.pageIndex%VideoScroll.totalBlocks==0) VideoScroll.pageIndex=1;
	    else VideoScroll.pageIndex+=1;
		VideoScroll.setPagingStyle();
	}
	VideoScroll.decIndex=function decIndex(){
	    if(VideoScroll.pageIndex==1) VideoScroll.pageIndex=VideoScroll.totalBlocks;
	    else VideoScroll.pageIndex-=1;
		VideoScroll.setPagingStyle();
	}
	VideoScroll.setPagingStyle=function setPagingStyle(){
		var currentPageImgName='vpage'+VideoScroll.pageIndex;
		currentPageImg=document.getElementById(currentPageImgName);
		var pathString=currentPageImg.src;
		pathString=pathString.substring(0,pathString.length-5);
		VideoScroll.lastPageImg.src=pathString+"0.gif";
		currentPageImg.src=pathString+"1.gif";
		VideoScroll.lastPageImg=currentPageImg;
	}
	VideoScroll.goToPos=function goToPos(pos,imageElem){   
		if((VideoScroll.cameFromScroll || pos==VideoScroll.pageIndex) || (VideoScroll.inMotionRight || VideoScroll.inMotionLeft)) return;
	    var currentBlock=VideoScroll.firstChild.id;
	    currentBlock=parseInt(currentBlock.substring(9,10));
	    if(pos>currentBlock ){
			VideoScroll.pageIndex=pos-1;
	        VideoScroll.moveLeft((pos-currentBlock)*VideoScroll.motionBlock*-1,1);
	    }
	    if(pos<currentBlock){
			VideoScroll.pageIndex=pos+1;
	        VideoScroll.moveRight(currentBlock-pos,1)
	    }
		VideoScroll.cameFromScroll=true;
	}
	VideoScroll.moveChildToLeft=function moveChildToLeft(childrenNumber){
	    for(var i=0;i<childrenNumber;i++){
	        var lastChild = VideoScroll.lastChild;
	        VideoScroll.removeChild(lastChild);
	        VideoScroll.insertBefore(lastChild,VideoScroll.firstChild);
	    }
	    return -1*childrenNumber*VideoScroll.motionBlock;
	}
	VideoScroll.moveRight=function moveRight(howMuchToMoveLeft,comeFrom){
		if(VideoScroll.cameFromScroll) return;
	    if(VideoScroll.inMotionLeft){
	        VideoScroll.tween.stop();
			VideoScroll.inMotionLeft=false;
	    } 
	    if (VideoScroll.inMotionRight){
	        VideoScroll.tween.stop();
			VideoScroll.inMotionRight=false;
	        if(VideoScroll.lastPress!=2){
	            setStyleRight=VideoScroll.moveChildToLeft(howMuchToMoveLeft);
	            VideoScroll.style.right=setStyleRight;
				VideoScroll.decIndex();
	        }
	    }
	    else{
			if((VideoScroll.lastPress!=2) || (comeFrom==1)){
       	 		setStyleRight=VideoScroll.moveChildToLeft(howMuchToMoveLeft);
       	 		VideoScroll.style.right=setStyleRight;
			}
			VideoScroll.decIndex();
	    }
	    VideoScroll.lastPress=1;
	    var currentPos=parseInt(VideoScroll.style.right);
	    motionLeft = VideoScroll.motionBlock-(currentPos-VideoScroll.startPos);
	    VideoScroll.tween = new Tween(VideoScroll.style,'right',Tween.strongEaseOut,currentPos,0,2);  
	    VideoScroll.tween.addEventListener("onMotionStart", this, function(){ VideoScroll.inMotionRight=true; });
	    VideoScroll.tween.addEventListener("onMotionEnd", this, 
	    	function(){
	    		VideoScroll.inMotionRight=false;
			VideoScroll.cameFromScroll=false;
	    	}
	    );
		VideoScroll.cameFromScroll=true;
	    VideoScroll.tween.start();
	}
	VideoScroll.moveLeft=function moveLeft(finish,comeFrom){
		if(VideoScroll.cameFromScroll) return;
	    if (VideoScroll.inMotionRight){
	        VideoScroll.tween.stop();
			VideoScroll.inMotionRight=false;
	    } 
	    if (VideoScroll.inMotionLeft){
	        VideoScroll.tween.stop();
			VideoScroll.inMotionLeft=false;
	        //if user press on left then
	        if(VideoScroll.lastPress!=1){
	            VideoScroll.tween.stop();
	            var firstChild = VideoScroll.childNodes[0];
	            VideoScroll.removeChild(firstChild);
	            VideoScroll.appendChild(firstChild)
	            VideoScroll.style.right=0;
				VideoScroll.incIndex();
	        }
	    }
		else{ VideoScroll.incIndex(); }		
	    VideoScroll.lastPress=2;
	    var currentPos=parseInt(VideoScroll.style.right);
	    motionRight = VideoScroll.motionBlock-(VideoScroll.startPos-currentPos);
	    VideoScroll.tween = new Tween(VideoScroll.style,'right',Tween.strongEaseOut,0,finish,2);    
	    VideoScroll.tween.addEventListener("onMotionStart", this, function(){ VideoScroll.inMotionLeft=true; });
	    VideoScroll.tween.addEventListener("onMotionEnd", this, 
		function(){
	        var currentPos=parseInt(VideoScroll.style.right);
	        chldNum=Math.abs(currentPos/VideoScroll.motionBlock)
	        //reset the left divs
 			for(var i=0;i<chldNum;i++){
				var firstChild = VideoScroll.childNodes[0];
	    		VideoScroll.removeChild(firstChild);
	    		VideoScroll.appendChild(firstChild);
			}
			VideoScroll.lastPress=0;
	        VideoScroll.style.right=0
	        VideoScroll.inMotionLeft=false;
			VideoScroll.cameFromScroll=false;
	    	}	    	
	    );
		VideoScroll.cameFromScroll=true;
		VideoScroll.tween.start();
	}
}
