﻿///<reference path="source/Jquery.IntelliSense.js" />
/// <reference path="~/static/scripts/Dates.js" />
sStaticURL=window.sStaticURL;var CKEDITOR_BASEPATH = window.sStaticURL+'scripts/ckeditor/';sLinkData="";
var sBrowserClass = $.browser.webkit?(navigator.userAgent.indexOf("iP")>-1||navigator.userAgent.indexOf("Android")>-1||navigator.userAgent.indexOf("Bada")>-1||navigator.userAgent.indexOf("MIDP")>-1?'Mobile':"Webkit"):	$.browser.msie?"IE"+(document.documentMode?document.documentMode:$.browser.version*1):($.browser.mozilla?(navigator.userAgent.indexOf("Fennec")>-1?"Mobile Firefox":"Firefox"):navigator.userAgent.indexOf("Opera M")>-1?"Mobile": "");
O= {
Video: function(id,title,url,date,desc,image,credit,rank,type) {this.id = id; this.title=title;this.desc=desc;this.url=url;this.image=image*1;this.author=credit;this.rank=rank;this.type=type},
Flash: function(id,title,date,red) {this.id=id;this.title=title;this.red=red;this.date=date},
News: function(id,title,date,image,author,replies,icons) {this.icons=icons;this.id=id;this.date=date;this.image=image;this.title=title;this.replies=replies;this.author=author},
User: function (id,name,online,image,org,sign,status) {this.id=id;this.name=name;this.online=online?[online.substring(0,1)*1,online.substring(1,2)*1,online.substring(2,3)*1]:[0,0,0]; this.sign=sign?sign:"";this.image=image;this.status=status;},
Picture: function(id,title,credit,date) {this.id=id;this.title=title;this.credit=credit;this.date=date}}
function DoNothing() {}
function GetImage(id,w,h) {var sStaticURL= window.sStaticURL; if(sStaticURL=="http://a7"+".org/") sStaticURL="http://n2.a7.org/"; if (w) return sStaticURL+"Resizer.ashx?source=news&image="+id+"&a="+w+"&b="+h; return sStaticURL+"pictures/"+Math.floor(id/1000)+"/"+id+".jpg"}

Array.prototype.write = function() {document.write(this.join(""))}
Array.prototype.string = function() {return this.join("")}
Array.prototype.remove = function(from, to) {var rest = this.slice((to || from) + 1 || this.length);
  this.length = from < 0 ? this.length + from : from;
  return this.push.apply(this, rest);
};

String.prototype.write=function() {document.write(this)}
String.prototype.toNick=function() { return this.replaceStr("&","&amp;").replaceStr("<","&lt;").replaceStr(">","&gt;");};String.prototype.toHTML=function(str) {var str=this; if(!str) return ""; str+="";  return this.toNick().replaceStr('"',"&quot;").replaceStr("'","&#39;")};String.prototype.toJS=function (str) {var str=this; if(!str) return ""; str+=""; return str.replaceStr('"','\\"').replaceStr("'",'\\\'').replaceStr("\n","\\n");}
String.prototype.replaceStr = function (oldValue,newValue) { return this.split(oldValue).join(newValue);};String.prototype.removeStr = function(oldValue) { return this.replaceStr(oldValue,"")}
String.prototype.Short = function(num){var str=this; if (!str) return ""; return  str.replace(new RegExp("(.{" +num+ "}\S{0,})(?:.*)","gi"),"$1"); }
String.prototype.toHTMLS = function ()
{	sString = this;if (!sString) return "";
	if (sString.indexOf("youtube")>-1) sString = sString.replace(/<a href=.*?youtube\.com\/watch\?v=([A-Za-z_\d\-]*).*?<\/a>/gi, '<div><embed src="http://www.youtube-nocookie.com/v/$1?fs=1&amp;hl=iw_IL" type="application/x-shockwave-flash" width="425" height="349" allowscriptaccess="never" allowfullscreen="true"></embed><div><a href="http://www.youtube.com/watch?v=$1">לצפיה ב-YouTube</a></div></div>');
	function rxescape (str) {return str.replace(/[-[\]{}()*+?.\\^$|,#\s]/g, "\\$&");} 
	sString = sString.replace(/target=_top/g,"").replace(/(<A |<a)/g,"<A target=_blank ").replace(/<\/?\w+:[^>]*>/gi, "");

	var a = [[":-)","smile"],[":-D","vhappy"],[";-(","boche"],[":-(","sad"],[":-P","tongue"],[";-)","wink"],["(ישן)","k"],["(מחשב)","computer"],["(כוכב)","star"],["(בלון)","balon"],["(דוס)","dos"],["(חופר)","digg"],["(שורק)","shorek"],["(נשיקה)","remybussi"],["(נפנוף)","nifnuf"],["(מרחף)","h"],["(טלפון)","telphone"]];

	for (var i=0;i<a.length;i++){
	var sSmile=rxescape(a[i][0]); sString = sString.replace(new RegExp("("+sSmile+(sSmile.indexOf(";")==-1?"|"+sSmile.replace("\\-",""):"")+")","gi"),"<img src=\""+sStaticURL+"images/forum/smilies/"+a[i][1]+".gif\">")}

	sString =sString.replace(/<IMG.{0,50}src=\"http:\/\/forumpics\.a7\.org\/\?file=([0-9.jpg]*)\"[^>]*>/gi, " <a href=http://a7.org/?file=$1 target=_blank><IMG src=\"http://n2.a7.org/Resizer.ashx?image=$1&forum=1&a=500&save=1\"></a> ")
	return sString;
}

var Info = { aIDs: [], aNoAds: [], aOne: [], Vars: {}, View: { a: [] }, BeforeLog: DoNothing, Add: function (zone, id, opts) { Info.aIDs.push({ id: id, zone: zone, opts: opts ? opts : [] }); return Info }, Remove: function (id) { for (var i = 0; i < Info.aIDs.length; i++) if (Info.aIDs[i].id == id) { Info.aIDs.remove(i); } },
	HTML: function (o) {
		var b=o.banner;
		if (!o.opts) o.opts = {};
		var fileurl = sOXURL + "images/" + encodeURIComponent(b.file);
		var clickurl = sOXURL + "delivery/ck.php?oaparams=2__b=" + b.b + "__z=" + b.z;
		var code = "";
		switch (b.type) {
			case "jpeg": case "png": case "gif":
				fileurl = "http://a7.org/MailAttach.aspx?act=info&image=" + encodeURIComponent(b.file) + "&w=" + b.width + "&h=" + b.height;
				code = "<a rel=nofollow href=" + clickurl + " target=_blank>" + (b.width > 1 && !o.opts.text ? "<img width=" + b.width + " height=" + b.height + " src=" + fileurl + ">" : "") + (o.opts.text ? b.append + b.alt : "") + "</a>";
				break;
			case "swf":
				var v = "";
				var escu = escape(clickurl) + "&atar1=_blank"; //.replaceStr("{zoneid}",b.zone).replaceStr("{ban"+"nerid}",b.bid)
				if (b.zone % 100 == 80 || window.mit) v = "<PARAM NAME=WMode VALUE=Transparent>";
				code = "<OBJECT codeBase=http://fpdownload.adobe.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0 height=" + b.height + " width=" + b.width + " classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000>" + v + "<param name=\"flashvars\" value=\"alink1=" + escu + "&atar1=_blank&clickTAG=" + escu + "&clickTARGET=_blank\" /><PARAM NAME=Movie VALUE='" + fileurl + "'><PARAM NAME=Src VALUE='" + fileurl + "'><PARAM NAME=Menu VALUE=-1><PARAM NAME=AllowScriptAccess VALUE=never><PARAM NAME=AllowFullScreen VALUE=false><embed src='" + fileurl + "' quality=high wmode='opaque' width='" + b.width + "' height='" + b.height + "' type='application/x-shockwave-flash' pluginspace='http://www.adobe.com/go/getflashplayer' allowScriptAccess='never' FlashVars=\"alink1=" + escu + "&clickTAG=" + escu + "\"></embed></OBJECT>"; break;
			case "html":
				code = b.file.replaceStr("{target}", "_blank").replaceStr("{source}", "").replaceStr("{zoneid}", b.zone).replaceStr("{ban" + "nerid}", b.bid).replaceStr("{url_prefix}", clickurl.split("/c.php")[0]);
		}
		return code;
	},
	Object: function (bid, cid, zone, type, url, file, ver, height, width, append, alt, block_ad, cap_ad, session_cap_ad, block_campaign, cap_campaign, session_cap_campaign, block_zone, cap_zone, session_cap_zone, last_view, last_click) { return { b: bid, c: cid, z: zone, type: type, url: url, file: file, width: width, height: height, append: append, alt: alt }; },
	Insert: function (arr) {
		Info.InsertInternal(arr,Info.aIDs)
	},
	InsertInternal: function (arr,sourceArr) {
		for (var i=0;i<arr.length;i++) 
		{
			var b=arr[i];
			if (b) {
				sourceArr[i].banner = b;
				if(!sourceArr[i].opts) sourceArr[i].opts = {};
				if (!sourceArr[i].opts.func) sourceArr[i].opts.func = Info.InsertDo;
				sourceArr[i].opts.func(sourceArr[i]);}
		}
		Info.Log(sourceArr)
	},
	InsertDo: function (obj) {
		obj.count = 1;
		var v = Info.View, id = obj.id, b=obj.banner;
		var d = $((id.indexOf(".") > -1 || id.indexOf('#') > -1 ? "" : "#") + id);
		var code = Info.HTML(obj);
		if (obj.clear) { d.html(code); obj.opts.clear = ""; } else d.append(code);
	},
	Reload: function () {
		for (var i = 0; i < Info.aIDs.length; i++) Info.aIDs[i].clear = true;
		Info.Final(); Info.View = { a: [] };
	},
	Log: function (a) {
		this.BeforeLog(); var s = [], arr = "b,z,c,OABLOCK,OACAP,OASCAP,OACBLOCK,OACCAP,OASCCAP,OAZBLOCK,OAZCAP,OASZCAP,OXLIA,OXLCA".split(",");
		for (var i = 0; i < arr.length; i++) {
			s.push("&" + arr[i] + "=");
			for (var i2 = 0; i2 < a.length; i2++) 	if (a[i2].count)  s.push((i2 > 0 ? ',' : '') + (a[i2].banner[arr[i]] ? a[i2].banner[arr[i]] : 0))
		}
		ExecuteUrl(sOXURL + "delivery/lg2.php?" + s.string().substring(1) + "&" + new Date().getTime());
	},
	Warn: function (z) { if (window.console) console.warn(z); },
	LoadOne: function (zone, id, opts) { var a= [{ id: id, zone: zone, opts: opts ? opts : {} }]; Info.aOne = a; this.LoadByArr(a,false,"Info.LoadOne2") },
	LoadOne2: function(arr)	{  Info.InsertInternal(arr,Info.aOne)},
	LogOne: function (b) { ExecuteUrl(sOXURL + "delivery/lg2.php?b=" + b.b + "&z=" + b.z + '&c=' + b.c + '&' + new Date().getTime()); },
	One: function (id, b) {
		if (Info.aOne[id].opts.func) { Info.aOne[id].opts.func(b, id); }
		else Info.OneInsertDo(b, id);
	},
	ReloadTO: function (timeout) { window.setTimeout(this.Reload, timeout) },
	Final: function (write) {
		this.LoadByArr(Info.aIDs, write,"Info.Insert");
	},
	LoadByArr: function (Arr, write, funcName) {
		var z = "", y = ""; for (i = 0; i < Arr.length; i++) z += "," + Arr[i].zone;
		for (x in Info.Vars) { y += "&" + x + "=" + Info.Vars[x] }
		if (z) { var url = (sOXURL + "a7delivery_arr.php?func="+funcName+"&z=" + z.substring(1) + y + "&d=" + new Date().getSeconds()); if (!write) ExecuteJS(url, "", "utf-8"); else ("<script src=" + url + " charset=utf-8></script>").write(); } 
	},
	LogC: function (type, cat, item, place) { if (this.LogC.last == type + item) return; this.LogC.last = type + item; if (type.length == 4) { cat = type[1]; item = type[2]; place = type[3]; type = type[0]; } ExecuteUrl("/Controls/HPJS.ashx?act=log&type=" + type + "&cat=" + cat + "&place=" + place + "&item=" + item + "&_" + new Date().getTime()); },
	MadInf: function (name) {
		var s = name + 'Mad1';
		if ((INNData.CheckDate(s, 120) || location.href.indexOf("b114") > -1) && !View.MadV) { Info.Add(114, 'divMAD3', { func: function (b, i) { Info.InsertDo(b, i); $("#divMAD3").parent().show(); INNData.SaveDate(s); Info.MadV = 1; } }) }
		var s2 = name + 'Mad2';
		if ((INNData.CheckDate(s2, 60) || location.href.indexOf("b110") > -1) && !Info.MadV && !View.MadV) { Info.Add(110, 'divMAD3', { func: function (b, i) { if (!Info.MadV) { INNData.SaveDate(s2); Info.InsertDo(b, i); Info.DisableSekindo = 1; $(".divMAD2").css("height", 165); $("#divMAD3").parent().show() } } }); }
	}
}

getE= function (name){return document.getElementById(name)}
_=getE;
if(!window.jQuery) jQuery = {};
jQuery.findPos = function(obj) {
		var curleft = curtop = 0;
		if (obj.offsetParent) {
			curleft = obj.offsetLeft;
			curtop = obj.offsetTop;
			while (obj = obj.offsetParent) {
				var origcurleft = curleft;
				curleft += obj.offsetLeft;
				if (curleft < 0) { 
					curleft = origcurleft;
				}
				curtop += obj.offsetTop;
			}
		}
		return {x:curleft,y:curtop};
	}
jQuery.getMouseCoordsWithinEvent= function(event)
{
	var coords = {x: 0, y: 0};
	if(!event)
	{	event = window.event;
		coords.x = event.offsetX;
		coords.y = event.offsetY;	}
	else
	{
		var e = jQuery.findPos(event.target)
		coords.x = event.pageX - e.x;
		coords.y = event.pageY - e.y;	}
	 return coords;
}

function ExecuteJS(url,func,encoding) {
var scriptElem = document.createElement('script'); scriptElem.setAttribute('src',url+(func?"&func="+func:"")); if(encoding) scriptElem.setAttribute("charset",encoding); window.document.getElementsByTagName('head')[0].appendChild(scriptElem);}
function ExecuteUrl(url) {var i = document.createElement("img"); i.src = url+"&_"+new Date().getTime(); i.style.display="none"; _("divMain").appendChild(i);}
window.ExecuteJS = ExecuteJS; window.ExectueUrl=ExecuteUrl;

INNData = {UDObject:null,UseUD:!window.localStorage,
	Save: function(name,data){var done=0;
		if (!this.UseUD)  {try {var loc=window.localStorage; if (loc.remainingSpace<500)loc.removeKey; loc["IData-"+name]=data;done=1}catch(e){}}
		else {try {this.UDObject.setAttribute(name,data);  this.UDObject.save("IData");} catch(e) {}}},
	Load: function (name){var s,done; 
		if (!this.UseUD){try {s= window.localStorage["IData-"+name]; } catch(e) {alert(e); done=0};}
		else  {try {this.UDObject.load("IData"); s = this.UDObject.getAttribute(name);} catch(e) {}}  if (s) return s; else return "";},
	CheckDate: function(name,minutes)
	{
		var d =  INNData.Load("CDate"+name); d2=new Date().getTime();
		return d==""|| d < d2-60000*minutes;
	},
	SaveDate: function(name) {INNData.Save("CDate"+name,new Date().getTime()); }
}

Windows = {
Login: function(ref, msg) {
		$(".loggedimg, .loggedin, .LoginHideThis").remove();
		if (!ref) ref = location.pathname;
		if(!msg) msg = "";
		var pos = { left: $(window).width() / 2 - 190, top: $(window).scrollTop() + 190 };
		var div = document.createElement("div");
		div.innerHTML = ("<div align=center style=margin:15px><img src=" + sStaticURL + "images/forum/logologin.jpg></div><div style=color:red;text-align:center id=divLoginErr>" + msg + "</div><form action='javascript:void(0)' onsubmit='Windows.Login.Send(); return true' class=Login><span>שם:</span><INPUT class=t name=username id=txtLoginUsername><br/><span>סיסמא:</span><INPUT type=password class=t name=password id=txtLoginPassword><div style='float:left;margin:6px 0px 6px 40px;width:71px' class=ReplyButton  onClick=''><span class=Icon style=font-size:10pt;float:left><span class=Arrow></span></span><input style=text-align:left;float:left;width:50px class=Button type=submit value=התחבר></div><br/><div align=center style=margin:10px;clear:both;font-size:12pt>משתמש חדש? <a style=color:#c00 href=/Register.aspx>הירשם כאן!</a><br /> <a style=color:#c00 href=/My/ForgotPassword.aspx>שכחתי סיסמא</a></form></div>")
		//$(div).keyup(function(e){if(e.keyCode==13) Windows.Login.Send()});
		$("<img class=loggedimg src=" + sStaticURL + "images/forum/logbg.png style=position:absolute;>").css("left", pos.left - 43).css("top", pos.top - 33).appendTo(document.body)
		$(Windows.Generic("&nbsp;", div, pos, 265, "$('.loggedimg').hide()")).addClass('loggedin');
		Windows.Login.Send = function() { var u= _("txtLoginUsername").value,p=_("txtLoginPassword").value; if (!u||!p) {_("divLoginErr").innerHTML="עליך למלא שם משתמש וסיסמא"; return false}; _("divLoginErr").innerHTML="אנא המתן..."; $.ajax({type:"POST",url:"/Controls/AjaxForm.ashx?action=login&act=js",data:{username:u,password:p},success:function(data){ if(data=="OK") location.href=ref; else if(data=="MAIL") location.href='/My/Mail/'; else _("divLoginErr").innerHTML=data;},error:function(){_("divLoginErr").innerHTML='אירעה שגיאה בעת הנסיון להתחבר';}} ) }
	}, Audio: function (append) {if(!append) append="";	open("/Radio/Player.htm"+append,"INNAudio","width=378,height=580,status=1,resizable=0",true);},
Generic: function(title,content,pos,width,closefunc) {
	if(pos.x) {pos.left=pos.x; pos.top=pos.y;}
	if (pos.left<0)pos.left=10;
	var d = document.createElement("div"); d.className="GenericWindow"; if(!closefunc) closefunc=' ';
	d.innerHTML = "<span class=X onclick=\"$(this.parentNode).remove();"+closefunc.toHTML()+"\"></span><div class=Ttl>"+title+"</div>";
	$(d).append(content);
	$(d).css("width",width).css("top",pos.top).css("left",pos.left);$(document.body).append(d);
	return d;
},
CenterGen: function(title,content,width,closef) {
	var pos={left:$(window).width()/2-width/2,top:$(window).scrollTop()+200};
	return this.Generic(title,content,pos,width,closef);
}, Upload: function(position,opts) {if(window.UploadWin) UploadWin.Load(opts); else {Windows.UploadOpts=opts;  ExecuteJS(sStaticURL+"Combine.ashx?js=swfUpload.js,UploadWin.js&v=2")};}
}


User = {ActiveUsers:[],Emails:[],Audio:[],Cal:[],CalItems:[],ID:0,Name:"",Email:"",Level:0,ForumLevel:0,Forums:[[1,"מחשבים וטכנולוגיה"],[124,"איפור וטיפוח"],[11,"בראש צעיר"],[17,"יצירה לאומית"]],
 UMethod: function (id,method) {$.post("/My/IM/JS.ashx?act="+method,{user:id}); INNData.Save("UserLastCheckedScript","");},
 Add: function (id) {this.UMethod(id,"add");},
 DelBlockUser: function(id){this.UMethod(id,"removeblock&status=1");},
 IgnoreUser: function(id){this.UMethod(id,"ignore");},
 OpenIMIn: function(append) {PopLeft.Audio.im=false;INNData.Save("popleft_lastIMSound",0); window.open("/My/IM/lmf_.aspx"+append,"INNIM","height=570,width=730,location=no,status=0,resizable=1")},
 OpenIMSession: function(sid){this.OpenIMIn("#s#"+sid);},
 OpenIM: function(name){if(!name) name="";else name="#"+escape(name); this.OpenIMIn(name)},
 RemoveCalAlert: function (id) {ExecuteUrl("/My/Calendar/DateData.aspx?act=remove&id="+id)},
 UserMHTML: function(User) { return "<div onclick=\"User.OpenIM('"+User.name.toJS().toHTML()+"');\" class=out><div "+ this.UserDivStyle(User) +">"+User.name+"</div></div>";},
 UserDivStyle: function(User) {var o=User.online; return " style=color:"+(o[2]>0?'green':o[0]==0?'gray':'black')+" class='in c"+o[0]+o[1]+"'"},
 SortUsersFunction: function(a,b) { return (b.online[0]-a.online[0])*1000 +  ( b.online[2]-a.online[2])*10000 + ( b.online[1]-a.online[1]) * 100 + (a.name<b.name?-1:a.name>b.name?1:0)*10},
 SortUsers: function(users) {users.sort(User.SortUsersFunction) },
 inCal :location.href.toLowerCase().indexOf("calendar")>0
}

PopLeft = {Checked:false,Audio:{im:false,dLastTuched:null,mail:false,Names:["","נבל קלאסי","נגיעה","נודניק דיגיטלי","נגיעה דיגיטלית","קלידי פסנתר"]},
	Show: function (div){div.style.float="left";_("divMsgSource").childNodes[0].appendChild(div); $(div).css("display","none").slideDown(1200);},
	ShowMsg: function (click,close,ttl,msg,btns,user,uname,img)
	{	var onc="",cclen=click.length, closeF="$(\".InfoWin"+cclen+"\").slideUp();"; if (click) {onc=";cursor:pointer";click+=closeF}
		div = document.createElement("div"); div.className='InfoWin InfoWin'+cclen;
		div.innerHTML="<div class=Inner><span class=X onclick='"+closeF+close+"'></span><div class=Top "+click+" style='"+onc+"'><div class=Ttl>"+ttl+"</div><div style=width:180px><b>"+ (!click?("<a href=/Forum/lmf_Profile.aspx/"+user+" style=color:#354564;text-decoration:none>"+uname.toHTML()+"</a>"):uname.toHTML())+"</b> "+msg+"</div></div><div "+click+" style='"+onc+"' class=White align=center>"+btns+"</div></div>";
		if (img) image = sStaticURL +"/Resizer.ashx?source=user&a=54&b=54&f="+user+"&image="+img; else image = sStaticURL+"images/im/imw.png";
		div.style.backgroundImage="url("+image+")";
		return div},
	Play: function(iSound)
		{
		if(!PopLeft.Player) {
			var audioTag = document.createElement("audio");
			var bFlash = (!(!!(audioTag.canPlayType) && ("no" != audioTag.canPlayType("audio/mpeg")) && ("" != audioTag.canPlayType("audio/mpeg"))));

			if (!bFlash) {
				PopLeft.Player = {o: audioTag, url:"", Play: function(file) { if(!file) file=1; var url="/static/audio/msg"+file+".mp3"; if(this.url!=url) this.o.src=url;this.url=url; this.o.play();}}
				PopLeft.Player.Play(iSound);
			}
			else {
			$("#divMain").append('<object id="FlashPlayer" type="application/x-shockwave-flash" data="/static/cab/mp3_js.swf" width="1" height="1"><param name="movie" value="/static/cab/mp3_js.swf" />  <param name="AllowScriptAccess" value="always" /><param name="FlashVars" value="listener=PopLeft.Player&amp;interval=1500" /></object>');
			PopLeft.Player = {o:null,url:"", onUpdate: DoNothing,onInit: DoNothing,
				Play: function(file) {if(!file) file=1; var url="/static/audio/msg"+file+".mp3"; this.o=_("FlashPlayer");if(this.url!=url) this.o.SetVariable("method:setUrl", url);this.url=url;	this.o.SetVariable("method:play", "");this.o.SetVariable("enabled", "true");}};
			var f= function() { if(!PopLeft.Played)PopLeft.Player.Play(iSound); PopLeft.Played= true;};
			setTimeout(f,500);setTimeout(f,1000);setTimeout(f,3000);setTimeout(f,5000);setTimeout(f,10000);} }
		else this.Player.Play(iSound);
		},
	
	AddUser: function(name,id,img)
		{	div = PopLeft.ShowMsg("","IgnoreUser("+id+")","הוספת חבר"," ביקש לצרף אותך כחבר","<span class=Link onclick=$(this.parentNode.parentNode.parentNode).slideUp();User.Add("+id+")>הוסף</span> | <span class=Link onclick=User.IgnoreUser("+id+");$(this.parentNode.parentNode.parentNode).slideUp();>התעלם</span> | <span class=Link onclick=$(this.parentNode.parentNode.parentNode).slideUp();User.DelBlockUser("+id+")>חסום</span>",id,name,img);
		div.id="AddUser";PopLeft.Show(div);},
	ShowPB: function(sUser,id,img,msg,topic) {PopLeft.Show(PopLeft.ShowMsg("onclick=location.href='/My/PrivateBox/lmb_Folder.aspx?folder=1&id="+topic+"';","PopLeft.ReadPB("+topic+");","מסר חדש","כותב/ת לך",msg.substring(0,38),id,sUser,img));},
	ReadIM :function (id) {User.UMethod(id,"unnew")},
	ReadPB :function (id) {User.UMethod(id,"pbunnew")},
	ShowIM: function(session, sUser,id,img,msg,msgid,sound) {PopLeft.Show(PopLeft.ShowMsg("onclick=User.OpenIM();","PopLeft.ReadIM("+session+");", "שיחה חדשה","כותב/ת לך",msg.replace(/\[file:.*?\]/g,"קובץ מצורף").substring(0,68)+(msg.length>68?"...":""),id,sUser,img)); if(sound&&!this.Audio.im&&INNData.Load("popleft_lastIMSound")!=msgid){PopLeft.Play(sound);this.Audio.im=true; INNData.Save("popleft_lastIMSound",msgid); }},
	ShowMail: function(number,sound) {
		if(sound==1) if(location.href.toLowerCase().indexOf("/my/mail")==-1) if(sound) opLeft.Show(PopLeft.ShowMsg("onclick=location.href='/My/Mail';","","הודעה חדשה","יש לך דואר אלקטרוני חדש","",0,"",0))
		d=_("divMailMsgs"); if(d) d.innerHTML = number +" הודעות חדשות"
	},
	RemoveCalAlert: function (id) {
		User.RemoveCalAlert(id); if (User.inCal) {ChangeView(ActiveView,true);LoadToday()}
		if (PopLeft.iActiveCalPopup<PopLeft.aCalItems.length) {PopLeft.ShowCalAlert(PopLeft.aCalItems[PopLeft.iActiveCalPopup][0],PopLeft.aCalItems[PopLeft.iActiveCalPopup][1]); PopLeft.iActiveCalPopup++}
		else PopLeft.iActiveCalPopup--},
	OpenCalItem: function (id) {if(User.inCal){if(Dates.Item.Edited[1]&&Dates.Item.Edited[1].id==id) openEditItem(Dates.Item.Edited[1]); else  GetItem(id);} else location.href="/My/Calendar/?item="+id;},
	iActiveCalPopup:0,aCalItems:[],
	ShowCal: function (arr)
	{	PopLeft.aCalItems =arr;
		if (PopLeft.iActiveCalPopup<arr.length) {PopLeft.ShowCalAlert(arr[PopLeft.iActiveCalPopup][0],arr[PopLeft.iActiveCalPopup][1],arr[PopLeft.iActiveCalPopup][2]); PopLeft.iActiveCalPopup++}
	},
	ShowCalAlert: function (id,title,repeat) {
		var onc="",closeF="PopLeft.RemoveCalAlert("+id+")";
		div = document.createElement("div"); div.className='InfoWin'
		div.innerHTML="<div class=Inner><span class=X onclick='$(this.parentNode.parentNode).slideUp();"+closeF+"'></span><div class=Top ><div class=Ttl>יומן ערוץ 7 - <font color=red>תזכורת</font></div><div style=width:180px>"+title.substring(0,40).toHTML()+"</div></div><div class=White align=center><span class=Link onclick=PopLeft.OpenCalItem("+id+")>פתח</span> | <span class=Link onclick='$(this.parentNode.parentNode.parentNode).slideUp();"+closeF+"'>בטל</span></div></div>";
		div.style.backgroundImage="url("+sStaticURL+"images/forum/cal.png)"
		PopLeft.Show(div)},
	CalculateAway: function() {var llt=INNData.Load("LastTuched"); if(llt>PopLeft.dLastTuched) PopLeft.dLastTuched=llt; return (new Date() - PopLeft.dLastTuched) / 1000  > 10*60  } ,
	Check: function() {
		var away=(PopLeft.CalculateAway()*1), timeout=away?210000:90000, ld=INNData.Load("UserLastChecked"), ls=INNData.Load("UserLastCheckedScript"); 
		setTimeout( function(){PopLeft.Check()},timeout/($.browser.version==6?1:10));
		if(ls && ld > new Date()-timeout) { PopLeft.FinalCheck(ls,1);  return;} /* חלון אחר בדק עבר, נשתמש במה שהוא הוריד */
		ExecuteJS("/My/Checker.ashx?away="+ away+"&page="+ escape(location.pathname));},
	FinalCheck: function (script,cached) {
		if (this.lastScript==script) return;
		_('divMsgSource').childNodes[0].innerHTML=''; 
		 /* שמרנו מתי נבדק לאחרונה, אם חלון אחר יבקש, הוא יקבל את זה ונחסוך בקשה לשרת */
		if (!cached) { INNData.Save("UserLastChecked",new Date().getTime());INNData.Save("UserLastCheckedScript",script);}
		 this.lastScript=script; eval(script);
	}
};

if (!window.bDisablePopLeft) document.write("<div id=divMsgSource style=z-index:1;position:fixed;_position:absolute;width:310px;left:1px;bottom:2px;><div style=position:absolute;bottom:2px;left:1px></div><div style=visibility:hidden></div></div>");

function UseTLink()
{
	var a=$(".TLink");
	for (i=0;i<a.length;i++)
	{	
		var p=a[i].parentNode;
		$(p.childNodes).filter("*:not(a)").appendTo(a[i]);
		$(a[i]).removeClass("TLink").appendTo(p.parentNode);
		$(p).remove();
	}
}

iAutoNum=0;

$(document).ready(function() { $(document.body).addClass(sBrowserClass);  UseTLink()  
if (User.ID&&User.Name) { // in email: Name = "" 
	var lastt=INNData.Load("LastTuched"), fn = function(){ var d=new Date();  if (d-PopLeft.dLastTuched < 20000) return; PopLeft.dLastTuched=d; INNData.Save("LastTuched",d); }
	$(document.body).mousemove(fn).keydown(fn);  PopLeft.dLastTuched= lastt?lastt: new Date() ;
	 setTimeout(PopLeft.Check,20000);} });


function Tabs (divTabs, divContent,enableX){this.divTabs=divTabs;this.Tabs=[];this.Active=-1; this.divContent=divContent; $(divTabs).addClass("CTabs"); $(divContent).addClass("TabsContent"); this.enableX=enableX;}
var iAutoNum=0;
Tabs.prototype = {
	Add: function (title,image)
	{
	var div = document.createElement("div"); 
	div.className="TabContent";
	var tab = this.Tabs.length;
	this.Tabs[tab] = {id:++iAutoNum,title:title}
	var oTab=this.Tabs[tab]; this.divContent.appendChild(div); oTab.div = div;
	var th = this;
	div = document.createElement("span"); div.id='tab'; div.className='tab'+tab; div.innerHTML = "<span class=tab01></span><span class=tabcontent>"+(image?"<img src="+sStaticURL+image+">":"")+"<span>"+title+"</span>" +(this.enableX?"<span class=X onclick=RemoveTab(GetTabById("+Tabs[tab].id+"))></span>":"")+"</span><span class=tab02></span>";
	div.onclick= function(d) {return function() {var c=th.GetTabById(d); if(th.Active!=c) th.SetActive(c)};}(oTab.id)
	div.onmouseover = function() {this.active=1; setTimeout(function(){if(div.active)div.onclick()},200);}
	div.onmouseout = function() {this.active=0;}
	oTab.divTab = div; this.divTabs.appendChild(div);
	return oTab;
	},

	Remove : function(id)
	{
	var tab = this.Tabs[id]
	tab.div.parentNode.removeChild(tab.div); tab.divTab.parentNode.removeChild(tab.divTab);	Tabs.Tabs.remove(id);
	if (this.Tabs.length>1) this.SetActive(id);
	if(id>0&&this.Active==id)id--;
	},
	SetActive: function(tab,notfade)
	{	 var t=this,d=$("#"+this.divContent.id+" > *");
	d.stop(true,true);
	if (notfade) d.hide(); else d.fadeOut(300);
	$("#"+this.divTabs.id+" > *").removeClass("selected");
	
	this.Active=tab;
	if (this.Tabs[tab]) {this.Tabs[tab].flash=0; $(this.Tabs[tab].divTab).addClass("selected"); var d=$(t.Tabs[tab].div); d.stop(true,true); if(notfade) d.show(); else setTimeout(function() { d.fadeIn(function(){if($.browser.msie)d[0].style.removeAttribute('filter')})},200)}
	},
	GetTabById: function(id) { for (i=0;i<this.Tabs.length;i++) if (this.Tabs[i].id==id) return i; return -1}
}
Tabs.CreateTwoTabs= function (classes)
	{
	var iN=++iAutoNum; ("<div class='div2Tabs "+classes[0]+"' id=divTabs"+iN+"></div><div class='"+classes[1]+"' id=divContent"+iN+"></div>").write()

	var tb1 = new Tabs(_("divTabs"+iN),_("divContent"+iN),false);
	for (var i=1;i<arguments.length;i++) {
		var oTab = tb1.Add(arguments[i][0]); oTab.div.innerHTML = arguments[i][1]}
	tb1.SetActive(0,1);
	return tb1;
}


View = {LastToolbar:-1,InfStart:0,ActiveLink:location.pathname,ActiveToolbar:0,bF1000:false,bIsMobile:sBrowserClass.indexOf("Mobile")>-1, Toolbar:  [
		["ראשי","/",[["דף הבית","/"],["דעות","/Articles/"],["יהדות","/Articles/Yahadut.aspx"],["מזג האוויר","/Forecast.aspx"],["תכל'ס","/Economy"],["מודעות אבל","/More/Dead.aspx"],["שימושי","/More/ActivePage.aspx/Useful"],["קריקטורה","/More/Cart.aspx"],["דואר","/My/Mail/"],["יומן","/My/Calendar/"]]],
		["כל החדשות","/News/",[["<b>האימייל האדום</b>","/More/ActivePage.aspx/AreaEmail"],["מבזקים","/News/AllFlashes.aspx"],["ביטחון","/News/Section.aspx/3"],["מדיניות ופוליטיקה","/News/Section.aspx/8"],["בארץ","/News/Section.aspx/2"],["משפט ופלילים","/News/Section.aspx/4"],["כלכלה","/Economy/"]]],
		["מוספים","/News/Plus.aspx",[["חינוך","/News/Section.aspx/5"],["רפואה ומדע","/News/Section.aspx/6"],["בעולם","/News/Section.aspx/7"],["מחשבים","/News/Section.aspx/35"],["מוסיקה","/News/Section.aspx/25"],["תיירות","/Special/Content/Tours.aspx"],["נשים","/News/Section.aspx/47"]]],
		["פנאי","#",[["יצירה - פסיפס","/Mosaic/"],["בלוגים","/Blogs/"],["בחצר שלנו","/More/Garden.aspx"],["אוכל","/Special/Content/Recipe.aspx"]]],
		["רדיו","/Radio/",[["שידור חי","#' onclick='Windows.Audio()"],["תוכניות רדיו","/Radio/Programs.aspx"],["תיבת נגינה","/Radio/"],["מצעד חסידי","/Radio/Parade.aspx"]]],
		["טלוויזיה","/TV/",[["ראשי","/TV/"],["חדשות","/TV/Cat.ashx/-1"],["תרבות","/TV/Cat.ashx/-2"],['מיוחדים','/TV/Cat.ashx/-3'],['יהדות','/TV/Cat.ashx/-4'],['ילדים','/TV/Cat.ashx/-5'],['טיולים','/TV/Cat.ashx/-9'],['הטוב הרע והמרקע','/TV/Cat.ashx/-20']]],
		["בשבע","/Besheva/",[["גליון אחרון","/Besheva/"],["לוח פי 7","http://www.pi7.co.il\' target=_blank rel='nofollow"],["הפצה","/Besheva/Distibute.aspx"],["מגזינים","/Besheva/Magazines.aspx"]]],
		["פורומים","/Forum/",[["ראשי","/Forum/"],["במועדפים","/Forum/lmf_Active.aspx"],["מסרים","/My/"],["שיחה אישית","/My/IM/History.aspx"]]],
		["<span class=Children></span>","/Children/",[["משחקים","/Children/G.aspx"],["סיפורים ושירים","/Children/Media.aspx"],["ציורים לצביעה","/Children/Album.aspx/draw"],["תשבצים תשחצים","/More/CrossList.aspx"],["קומיקס","/Children/Album.aspx/comix"],["בדיחות","/Children/Jokes.aspx"],["פורום","/Forum/Forum.aspx/f6"]]]
		],
	CenteralWidth: function(w){ return (w<800?'780px':w<976&&!View.bF1000?'820px;':View.b1000&&w>1200?'1200px':'1000px')},
	MainWidth: function(w){ return this.b1000&&w>981||View.bF1000?"divMain1000":""},
Top: function(iLogo) {
	var l=location.pathname.toLowerCase(), w =$(window).width(),sTopAd=">",bIsMobile=View.bIsMobile;
	this.b1000 = l.indexOf("/forum/forum")==0&&!bIsMobile||View.bF1000;
	this.bCloseCookie=document.cookie.indexOf("tur=0")>-1;
	this.WinWidth = w;
	var iStart = 0,url=location.pathname.toLowerCase();
	if(View.InfStart==0) {
		iStart=800;
		if(url=="/") iStart=100;
		if(url.indexOf("/news")==0) iStart=200;
		if(url.indexOf("/articles")==0) iStart=300;
		if(url.indexOf("/radio")==0||url.indexOf("/tv")==0||url.indexOf("/besheva")==0) iStart=900;
		if(url.indexOf("/forum")==0||url.indexOf("/my")==0||url.indexOf("/blogs")==0) iStart=500;
		if(url.indexOf("/children")==0)iStart=1100;}
	else iStart=View.InfStart;

	if (bIsMobile) { $.fx.off=true; $("head").append('<meta name="viewport" content="width='+(this.b1000?1024:823)+'" />'); w= $(window).width() }
	
	/*if (iStart!=100&&Math.random()<=0.25) {sTopAd=" style=height:60px;><span id=divTopAd1></span><span id=divTopAd2></span>"; for(i=1;i<3;i++) Info.Add(100+i,"divTopAd"+i);}
	else*/  Info.Add(iStart,"divTopAd");
	/*	var d=INNData.Load("HPOrbitInf"),d2=new Date().getTime(); 
	if(iStart==100&&(d==""||d< d2-3600*24000)) {View.MadV=1;INNData.Save("HPOrbitInf",d2);  sTopAd=" style=height:230px;position:relative;padding-left:10px><span class=divMadX style=position:absolute;left:6px;bottom:1px onclick=View.CloseOrbit();$(this).hide()></span><div id=divTopAd1 style=display:none></div><div id=divTopAdO></div>";Info.Add(10462,"divTopAdO");
		View.CloseOrbit= function() {$("#divTopAdO").slideUp(); Info.LoadOne(iStart,"divTopAd1"); $("#divTopAd").height(90); $("#divTopAd1").slideDown() }}*/
	Info.Add(iStart+80,"LeftColInf").Add(181,"divLeftInf2");

	$(document.body).addClass(w>820?'Up800':'780'); //<a class="lng2" onmousedown="Info.LogC([401,0,2,205])" href="http://www.israel7.com/" title="ערוץ 7 בצרפתית"><b></b>Fr</a>
	 var lang ='<span class="spnBar spnLanguages"><a class="lng4" onmousedown="Info.LogC([401,0,4,205])" href="http://www.israelnationalnews.com/" title="ערוץ 7 באנגלית"><b></b>En</a>        <a class="lng3" onmousedown="Info.LogC([401,0,3,205])" href="http://www.israel7.ru/"  title="ערוץ 7 ברוסית"><b></b>Ru</a></span>';
var s=["<div align=center><div id=divMainCenteral style='text-align:right;width:"+View.CenteralWidth(w)+"'><div id=Left><div style=margin-left:5px; id=divLeftInf2></div><div id=LeftColInf></div></div><div id=divMain class='"+View.MainWidth(w)+"'><div id=TopBar class=TopBlueLine>"+ lang+"<span class='spnBar' style=float:left><span class=BOpen onclick='if (View.WinUsersOpened) {View.WinUsersOpened=false; var w=$(\"#divUsersWin\");w.slideUp(500, function() {w.remove();$(\"#divTopAd\").css(\"visibility\",\"\");}); _(\"spnFriendsArrow\").innerHTML =\"&#9660;\"; return;}; View.ReloadTopLine(View.Users);' id=spnFriends></span> <a href='/My/Mail/' class=BOpen onclick=Left.Show()>דואר <span id=spnNewMail></span></a></span></span><span class='spnBar Logged'>"]
	if (User.ID) s.push("<b>" +(dDate.hour<5?"לילה טוב":dDate.hour<11?"בוקר טוב":dDate.hour<19?"צהריים טובים":"ערב טוב")+" "+User.Name+"</b> (<a class=Logout href=/Login.aspx?action=Logout>התנתק</a>)");
	else s.push("<b>שלום אורח</b> <span class=Link onclick=Windows.Login()>התחבר</span> / <a href=/Register.aspx>הרשם</a>");
	s.push("</span><span class=spnBar style='margin-right:7px'><a title='לחץ לכניסה ליומן' href=/My/Calendar/ style=width:144px;display:inline-block>"+dDate.hebDate()+", <span style=font-size:7pt>"+ dDate.dates[1].day+"</span> "+ Dates.GetMonthName(dDate,1,1)+" <span style=font-size:7pt>"+(dDate.dates[1].year-2000)+"</span></a></span> <span onclick=_('MakeHP').onclick() class='spnBar hpbtn Link'>הפוך את ערוץ 7 לדף הבית</span></span><div style=clear:both;></div></div><div id=divTopAd "+sTopAd+"</div>");
	s.write();
	if (sBrowserClass=="Mobile") View.Resize();
	 View.UpdateTopLine();
	$(window).ready(function() {View.Resize(1);}).load(function () { View.Resize(); $(window).resize( function () { if (this.t) return false; this.t = 1; var t = this; setTimeout('if(this.t) View.Resize();this.t=0', 620); }); }); 
	INNData.UDObject = _("divMainCenteral");},
Top2: function() {
	var s=[];
	s.push("<div id=divToolbar>");
	for (var i=0;i<View.Toolbar.length;i++)
		s.push("<a class=T id=lnkToolbar"+i+" onmousemove='this.active=1;var t=this;setTimeout(function(){if(t.active) View.MoveToolbar("+i+")},160)' onmouseout=this.active=0 href="+View.Toolbar[i][1]+">"+View.Toolbar[i][0]+"</a><span class=Border></span>");
	s.push("</div><div id=divToolbar2out class='TopBlueLine'>"+(window.sLinkData?"<a class=admin href=/"+sLinkData.split("/")[1]+"/ >ניהול</a>":"")+"<div id=divToolbar2></div>");
	var t =_("MainToolbar");
	
	t.onmousemove=function(){this.active=1;if(this.t)clearTimeout(this.t)}; t.onmouseout=function(){this.active=0;this.t=setTimeout(function(){if(!this.active)View.MoveToolbar(View.DefaultToolbar);this.t=0},5000);}
	t.innerHTML=s.string();
	View.MoveToolbar(View.ActiveToolbar); View.DefaultToolbar = View.ActiveToolbar;},
MoveToolbar: function(id) {var t = View.Toolbar[id][2]; var s=[""];
	for (var i=0;i<t.length;i++) s.push("<a href='"+t[i][1]+"'>"+t[i][0]+"</a>");
	var o= $("#divToolbar2");
	if(View.LastToolbar!=id){$("#divToolbar a").removeClass("selected");_("lnkToolbar"+id).className="selected"; _("divToolbar2").innerHTML = s.string();View.SetActiveLink(); View.LastToolbar=id}},
SetActiveLink: function(url) {if(url) View.ActiveLink=url; $("a[href='"+($.browser.msie?"http://"+location.host:"")+View.ActiveLink+"']",_("#divToolbar2")).addClass("sel");},
Bottom: function() {var s=["<table id=Footer><tr><td class=c><img alt='חדשות ותוכן יהודי' src=http://a7.org/images/logo.gif /></td><td class=d><a href=http://www.cotendo.com class='CDN' rel='nofollow'></a>&copy; כל הזכויות שמורות לישראל נשיונל ניוז בע&quot;מ <div class=Links><a href=/More/ActivePage.aspx/Contact>צור קשר</a> | <a href=/More/ActivePage.aspx/Info>פרסמו אצלנו</a> | <a href='/More/ActivePage.aspx/Takanon'>תנאי שימוש</a> | <span onClick=this.setHomePage('http://www.inn.co.il') id=MakeHP  class=Link >הפוך לדף הבית</span> | <a href='http://www.israelnationalnews.com'>Israel News</a> | <a style=display:inline-block;font-size:8pt href='http://www.israel7.ru'>&#1053;&#1054;&#1042;&#1054;&#1057;&#1058;&#1048; &#1048;&#1047;&#1056;&#1040;&#1048;&#1051;&#1068;</a></div></td></tr></table>"]//<table id=FooterL><tr>"];
	/*for(var i=0;i<View.Toolbar.length;i++) {
		if (i!=7) s.push("<td>");
		s.push("<h4>"+View.Toolbar[i][0]+"</h4>");
		for (var i2=0;i2<View.Toolbar[i][2].length;i2++) s.push("<a href='"+View.Toolbar[i][2][i2][1]+"'>"+View.Toolbar[i][2][i2][0]+"</a>");
		if (i==2) s.push("<br/><a href=http://www.yeshiva.org.il/>יהדות</a>");
		if (i==4) s.push("<h4>עוד ברשת</h4><a target=_blank href=http://www.homeless.co.il/private/ >לוח רכב</a><a href=http://www.bombajob.co.il>עבודה בחו\"ל</a><a href=http://www.ics4u.com/>בניית אתרים</a><a href=http://www.a-designer.co.il>עיצוב הבית</a></div>"+(location.pathname=="/"?'<a href=http://tbk.mako.co.il>חדשות</a>':''))
		if (i!=6) s.push("</td>");
	}
	s.push("</tr></table><div class='SEOLinks c'>קידום אתרים ע\"י אלקטרו - <a href=\"http://www.elektro.co.il\" title=\"קידום אתרים אלקטרו\" target=_blank>קידום אתרים</a></div><div>חדשות</div>");*/
	return s.string();
},
	UpdateTopLine: function() {var z=_("spnNewMail"); if (z) z.innerHTML=(User.EmailCount>0?'('+User.EmailCount+')':''); z=_("spnFriends"); if(z)z.innerHTML=User.HasUsers>0?'חברים ('+User.UsersOnline+') <span id=spnFriendsArrow>&#9660;</span>':''; if (this.LastUsers!=User.UsersOnline&&View.WinUsersOpened) View.ReloadTopLine(View.Users); this.LastUsers=User.UsersOnline;  },
	Resize: function(fource) { var w=$(window).width(); if( Math.floor(this.WinWidth/10)==Math.floor(w/10)&&!fource) return false; $("#divMainCenteral").width(View.CenteralWidth(w)); $(document.body).removeClass("Up800 780"); $(document.body).addClass(w>820||View.bF1000?'Up800':'780');_("divMain").className=View.MainWidth(w);if(w>972&&!this.b1000||this.b1000&&w>1200) $("#Left").show(); else $("#Left").hide();  },
	ReloadTopLine: function(func) {$.post("/Controls/AjaxForm.ashx?action=leftcol", {}, function(z){eval(z); if(func) func();}) },
	Users: function() {
		var z=$(".LoginHideThis, #divUsersWin"); z.slideUp( 200, function(){z.remove()} );		$("#divTopAd").css("visibility","hidden");
		var arrow=_("spnFriendsArrow"),pos = $(arrow).position();
		arrow.innerHTML ="&#9650;"; View.WinUsersOpened=true;

		s=[];
		User.SortUsers(User.ActiveUsers);
		for (var i=0;i<User.ActiveUsers.length;i++) s.push(User.UserMHTML(User.ActiveUsers[i]));
		$("<div id=divUsersWin class=Users style='display:none;position:absolute;overflow:hidden;overflow-y:auto;left:"+(pos.left-5)+"px;top:"+(pos.top+16)+"px;width:160px;height:130px; border: solid 1px silver; background-color:white;padding:5px;'>" + s.string() + "</div>").appendTo("body").slideDown();
	},


	WriteFlashes: function(arr) {var s="<marquee class=Flashes direction=up scrollamount=1 scrolldelay=6"+"0 onmouseover=this.stop() onmouseout=this.start();><ul class='RightList'>";
	for(var i=0;i<arr.length;i++) s+="<li><a href=/News/Flash.aspx/"+arr[i].id+"><span>"+arr[i].date+"</span> "+arr[i].title+"</a></li>";return s+"</ul></marquee><div class='More MoreFlashes'><a href=/News/AllFlashes.aspx>עוד מבזקים <b>&#9668;</b></a></div>";},
	AddZero: function(time) { if (time*1>9) return ""+time; else return "0"+time},
	PaseTime: function(time){return Math.floor(View.AddZero(time/60)) + ":" + View.AddZero(Math.floor(time-(Math.floor(time/60))*60))},
	EmailName: function(from) {if (from.indexOf("<")>-1&& from.split("<")[0].replace(/ /g,"")!="") return from.split("<")[0]; else return from.replace("<","").replace(">","");},
	SelectFromArr: function(arr,selected) {var s=""; for (var i=0;i<arr.length;i++) s+= "<option value="+i+(i==selected?' selected':'')+">"+arr[i]+"</option>"; return s;}
}

function AutoReload(minutes)
{ setTimeout('AutoReload.Check('+minutes+', function(z){ var f = function(z){  window.location.href=window.location.href; setTimeout("location.reload()",'+1000*60+'); }; f(); setTimeout(f,'+1000*60+'); })',minutes*60*1000);}
AutoReload.Check = function(time,f) { $.ajax({url:location.pathname,timeout:60000, success:f,error: function(){ setTimeout( function(){ AutoReload.Check(time,f);},time/4)}} );}

function Spriter() {
$.extend(this,  {images:[],y:0,
	Add: function(id,w,h) {this.images.push([id,w,h]);this.y+=h; return "spriterImg;background-position: 0px -"+(this.y-h)+"px"},
	URL: function() { var s=[],a=this.images; for (var i=0;i<a.length;i++) s.push(";"+(a[i].length?a[i].toString():a[i])); return sStaticURL.replaceStr("/a7.org","/n2.a7.org")+"Resizer.ashx?source=newssprite&f="+s.string().substring(1); },
	Replace:function(s) {return s.replaceStr("spriterImg",";background-image:url("+this.URL()+");")}
})
}

if(location.pathname=="/") AutoReload(10);
