var SB_Pop_Cookies = "";
function Func_SB_setCookie(name,value,secTimeout)
{
	var domain = document.domain;
	domain = domain.replace("www.",".");
			
	if (secTimeout == -1)
		secTimeout = 60*60*24*365;
				
	var exdate=new Date();
	exdate.setTime(exdate.getTime()+(secTimeout*1000));
			
	var cookie = name + "=" + escape(value) + ";expires="+exdate.toGMTString() + ";path=/";
	if (domain != "")
	cookie += ";domain=" + domain;
	document.cookie = cookie; 
}

function Func_SB_getCookie(name)
{
	if (document.cookie.length>0)
	{
		c_start=document.cookie.indexOf(name + "=");
		if (c_start!=-1)
		{
		    c_start=c_start + name.length+1;
		    c_end=document.cookie.indexOf(";",c_start);
		    if (c_end==-1)
		    	c_end=document.cookie.length;
			return unescape(document.cookie.substring(c_start,c_end));
		    }
	}
	return "";
}

function Func_SB_Popup(url, isOnClick) 
{
	if (SB_Pop_Cookies!="")
	{
		return(0);
	}
	var is_popup = Func_SB_getCookie('SB_Is_PopUP');
	if (is_popup != "")
	{
		return(0);
	}
	
	Func_SB_setCookie('SB_Is_PopUP','yes',360);
	TheNewWin=window.open(url,'sb_showmustgoon','toolbar=0,scrollbars=0,location=1,statusbar=0,menubar=0,resizable=1,top=0,left=0,width=800,height=550');
	if (TheNewWin)
	{
		if (!isOnClick)
		{
			SB_Pop_Cookies = 'yes';
		}
		TheNewWin.blur();
		window.focus();
	}
	SB_Pop_Cookies = '1';
}

function Func_SB_addEvent(element, event, listener)
{
	if (element)
	{
		if(element.addEventListener)
		{
			element.addEventListener(event, listener, false);
			return 0;
		}
		else if (this.attachEvent)
		{
			element.attachEvent("on" + event, listener);
			return 0;
		}
	}
	return -1;
}



///**********  browser width *********//
function FuncGetBrowserWidth() {
  if (document.all)
    {return(document.body.clientWidth);}
  else
    {return(window.innerWidth);}
}
function SubCheckWindowWidth() {
    SubCheckWindowWidth_Right();
    SubCheckWindowWidth_Left();
}
function SubCheckWindowWidth_Right() {
    var w = FuncGetBrowserWidth();
    if (w < 1040) {
        document.getElementById('advtizer_R').style.display = 'none';
    }
    else {
        document.getElementById('advtizer_R').style.display = '';
    }
}
function SubCheckWindowWidth_Left() {
    var w = FuncGetBrowserWidth();
    if (w < 1040) {
        document.getElementById('advtizer').style.display = 'none';
    }
    else {
        document.getElementById('advtizer').style.display = '';
    }
}

window.onresize = SubCheckWindowWidth;

///**********  browser width *********//



function load()
{
	Func_SB_addEvent(document.body,"click", function() { Func_SB_Popup('http://web.2all.co.il/PAGE26.asp',true); SubCheckWindowWidth(); });
}

Func_SB_addEvent(this,"load",function() { load(); });




		
		
