﻿// JScript File

// Global
var m_EOLifeCookieExpiredays = 365;
function SetAsHomePage(oObj)
{
    if(IsMicrosoft()){
        oObj.style.behavior="url(#default#homepage)";
        oObj.setHomePage(window.location.host);
    }else{
        alert('Go to Preferences in the Edit Menu\n Choose Navigator from the list on the left\n Click on the "Use Current Page" button')
    }
}
function runCmdClick(oCmd){
    if (IsMicrosoft())
    {
	    // IE
	    oCmd.click();
    }
    else
    {
	    // FireFox
	    var e = document.createEvent("MouseEvents");
	    e.initEvent("click", true, true);
	    oCmd.dispatchEvent(e);
    }
}
function getMyFolderElementName()
{
    var sName = '';
    if(document.getElementById('MyFolderCommandID'))
    {
        sName = document.getElementById('MyFolderCommandID').value;
    }
    return sName;
}

function getEOLifeCookie(c_name)
{
if (document.cookie.length>0)
  {
  c_start = document.cookie.indexOf(c_name + "=")
  if (c_start!=-1)
    { 
    c_start=c_start + c_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 setEOLifeCookie(c_name,value)
{
    var expiredays = m_EOLifeCookieExpiredays;
    var exdate=new Date();
    exdate.setDate(exdate.getDate()+expiredays);
    document.cookie=c_name+ "=" +escape(value)+
        ((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}

function IsMicrosoft() {
    if (navigator.appName.indexOf("Microsoft") !=-1) {
        return true;
    } else {
        return false;
    }
}
function doUpdateMemoAdd(sAct,sArg)
{
    if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
       
        var oInputs = document.getElementsByTagName("input");
        var oCmd;
        for(var i=0;i<oInputs.length;i++){
            if(oInputs[i].id.indexOf("cmdDoPostBackMemoAdd")>0){
                oCmd = oInputs[i];
            }
        }
        if( oCmd != null){ 
            theForm.__EVENTTARGET.value = sAct;
            theForm.__EVENTARGUMENT.value = sArg;
            runCmdClick(oCmd)
        }
    }
}
function doUpdate(sAct,sArg)
{
    if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
       
        var oInputs = document.getElementsByTagName("input");
        var oCmd;
        for(var i=0;i<oInputs.length;i++){
            if(oInputs[i].id.indexOf("cmdDoPostBack")>0){
                oCmd = oInputs[i];
            }
        }
        if( oCmd != null){ 
            theForm.__EVENTTARGET.value = sAct;
            theForm.__EVENTARGUMENT.value = sArg;
            runCmdClick(oCmd)
        }
    }
}
function doCmdUpdate(sCmd,sAct,sArg)
{
    if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
        var oCmd = document.getElementById(sCmd);
        if( oCmd != null){ 
            theForm.__EVENTTARGET.value = sAct;
            theForm.__EVENTARGUMENT.value = sArg;
            runCmdClick(oCmd)
        }
    }
}
function DocumentWrite(sHtml)
{
    //alert(sHtml);
	document.writeln(sHtml);
}

function WriteFlashObj(sSrc,sWidth,sHeight,bTrans,sFlashVars,sID)
{
    var sObj = "";
	var sWMode = "";
	var sObjID = sSrc.replace(".swf","");
	var sVars = "";
	var sPrfx = "?";
	if(sFlashVars){
	    sVars = sFlashVars;
	}
	if(sID){
	    sObjID = sID;
	}else{
	    sObjID = sSrc.replace(".swf","");
	}
	sObj = sObj+"<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab' width='"+sWidth+"' height='"+sHeight+"' id='"+sObjID+"' align='middle' VIEWASTEXT>";
	sObj = sObj+"<param name='allowScriptAccess' value='sameDomain' />";
	sObj = sObj+"<param name='movie' value='"+sSrc+"' />";
	sObj = sObj+"<param name='quality' value='high' />";
	sObj = sObj+"<param name='bgcolor' value='#ffffff' />";
	sObj = sObj+"<param name='flashvars' value='"+sVars+"' />";
	if(bTrans == true){
		sObj = sObj+"<PARAM NAME='WMode' VALUE='Transparent'>";
		sWMode = "wmode='transparent'";
	}
	sObj = sObj+"<embed src='"+sSrc+"' flashvars='"+sVars+"' quality='high' bgcolor='#ffffff' "+sWMode+" width='"+sWidth+"' height='"+sHeight+"' ID='"+sObjID+"' NAME='bg' align='middle' allowScriptAccess='sameDomain' swLiveConnect=true ID='bg' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />";
	sObj = sObj+"</object>";
	
	DocumentWrite(sObj);
}
function SetPopUp()
{
	document.write ("<div dir='ltr' class='PopUpWin' name='PopUpWin' id='PopUpWin' Style='position:absolute; z-index: 99999; background-color:#ED1B2D; display: none;'>")
	document.write ("<div style='height:20px'><img src='/images/x_closing.gif' onclick='HidePopUp()' style='cursor:pointer;float:left; padding-top:7px; padding-left:5px;' /></div>");
	document.write ("<input type='hidden' id='PopUpParent'> ");
	document.write ("<span class='PopUpCaption' id='PopUpCaption' ></span>");
	document.write ("<iFrame id='PopUpFrame' src='' Width='100%' Height='100%' frameBorder='no'></iframe>");
	document.write ("</div>");
}
function ShowPopUp(sUrl, sLeft, sWidth, sHeight, sParent)
{
	//hideDropDownLists();
	var oPopUpWin = document.getElementById('PopUpWin');
	var oPopUpFarme = document.getElementById('PopUpFrame');
	var oPopUpParent = document.getElementById('PopUpParent');
	
	oPopUpWin.style.display = "block";
	oPopUpWin.style.width = sWidth;
	oPopUpWin.style.height = sHeight;
	oPopUpWin.style.left = sLeft;
	
	oPopUpFarme.src = sUrl;
	oPopUpParent.value = sParent;
	
	var vTopY = 0;
    if (document.documentElement != null) {
        vTopY = document.documentElement.scrollTop;
    }else{
        vTopY = window.scrollY;
    }
    if(IsMicrosoft()){
        vTopY = event.clientY+vTopY;
        vTopY = vTopY-parseInt(sHeight);
    }
    
    oPopUpWin.style.top = vTopY+"px";
    
    if(IsMicrosoft()){
        oPopUpFarme.window.close = HidePopUp;
    }else{
        oPopUpFarme.contentWindow.close = HidePopUp;
    }
}

function HidePopUp()
{
	var oPopUpWin = document.getElementById('PopUpWin');
	var oPopUpFarme = document.getElementById('PopUpFrame');
	oPopUpWin.style.display = "none";
	oPopUpFarme.src ="";
}

function SearchOnKey()
{
    var iEnter = 13;
    if(IsMicrosoft()){
        switch(event.keyCode){
	        case iEnter: doUpdate("Search",""); break;
        }
    }
}

function ResizeBack(iNewHeight){
    var oMainBg = document.getElementById("MainBg");
    var oInnerBg = document.getElementById("InnerBg");
    var iMinHeight = 700;
    
    if(iNewHeight){
        iMinHeight = iNewHeight+100;
    }
    if(oInnerBg != null){
        if(parseInt(oInnerBg.offsetHeight)<iMinHeight){
            oInnerBg.style.height = iMinHeight+"px"
        }
    }
    if(oMainBg != null){
        var iHeight = 0;
        var iMainHeight = parseInt(oMainBg.offsetHeight);
        setTimeout("ResizeBackDelay("+iMainHeight+");",100);
    }
}
function ResizeBackDelay(MainHeight){
    var oSwf_obj = document.getElementById("bg_swf_obj");
    var oSwf = document.getElementById("bg_swf");
    if(oSwf && oSwf_obj)
    {
        var iOfset = 0;
        if(IsMicrosoft()){
            iOfset = 0;
        }else{
            iOfset = 0;
        }
        oSwf_obj.style.height = (MainHeight+iOfset)+"px";
        oSwf.style.height = oSwf_obj.style.height;    
    }
}
function _ResizeBack(NewHeight){
            
    var obg_main = document.getElementById("bg_main");
    if(obg_main != null){
        var iHeight = 0;
        var iMainHeight = parseInt(obg_main.offsetHeight);
        var iBodyHeight = 700;
        var cDrgOfset = 160;
        
        if(iMainHeight < iBodyHeight){
            iMainHeight = iBodyHeight;
        }
        if(NewHeight){
            iHeight = NewHeight+cDrgOfset;
        }else{
            iHeight = iMainHeight;
        }
        /*
        if (document.documentElement)
            iHeight = parseInt(document.documentElement.scrollHeight);
        else if (document.body)
            iHeight = parseInt(document.body.scrollHeight);
        
        if (oFooter != null){
            oFooter.style.top = (iHeight+25)+"px";
        }
       */
       //alert(iHeight)
       setTimeout("ResizeBackDelay("+iHeight+","+iMainHeight+");",100);
    }
}
function _ResizeBackDelay(NewHeight,MainHeight){
    var oObj = document.getElementById("bg_swf");
    var oFooter = document.getElementById("BotFooter");
    var iHeight = NewHeight;
    var iMainHeight = MainHeight;
    var iFHeight = iHeight-iMainHeight;
    oObj.style.height = (iHeight+100)+"px";
    if (oFooter != null && iFHeight > 0){
        oFooter.style.top = (iFHeight- 0)+"px";
    }
}
function EOLifeResizeSwf(sSwfName,sMainName){
    setTimeout("EOLifeResizeSwfDelay('"+sSwfName+"','"+sMainName+"');",50);
}
function EOLifeResizeSwfDelay(sSwfName,sMainName){
    var oSwfName = document.getElementById(sSwfName);
    var oMainName = document.getElementById(sMainName);
    if(oSwfName != null && oMainName != null){
    
        oSwfName.style.height = oMainName.offsetHeight + "px";
    }
}

function ShowComment(sHiddId,sShowId)
{
	var oToHidd = document.getElementById(sHiddId);
	var oToShow = document.getElementById(sShowId);
	
	oToHidd.style.display = 'none';
	oToShow.style.display = '';
	
	ResizeBack();
}

function ValidateEmail(strValue) 
{
    //var objRegExp = /(^[a-z]([a-z_\.]*)@([a-z_\.]*)([.][a-z]{3})$)|(^[a-z]([a-z_\.]*)@([a-z_\.]*)(\.[a-z]{2})(\.[a-z]{2})*$)/;
    var objRegExp = /^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$/;
	var bRet = true;
    //check for valid email
    if(strValue != "") {
        bRet = objRegExp.test(strValue);
    }
	    
    return bRet;
}

function EOLifePrintItem(sBodyID){
    
    var oBody = document.getElementById(sBodyID);
    if(oBody)
    {
        var sHtml = ''
        sHtml = oBody.outerHTML;
        sHtml = sHtml.replace('/images/Promo/Promo1.png', '');
        sHtml = sHtml.replace('/images/Promo/Promo2.png', '');
        sHtml = sHtml.replace('/images/Promo/Promo3.png', '');
        var oWin = window.open('/PrintItem.htm?bodyID='+sBodyID, 'Print', 'scrollbars=yes,resizable=yes,menubar=no,toolbar=no,status=yes,width=800,height=650,top=0,right=0' );  				
        //var sHtml = "<div style='width:100%; text-align:center'><div dir='rtl' style='width:702px; margin:auto; text-align:right; font-family:Arial; font-size:12px'>"+sHtml+"</div></div>";
        //oWin.document.write(sHtml);
        oWin.focus();
        //oWin.print();
    }
}

function setEnterSearch(e, sTargetID)
{
    var oTarget = document.getElementById(sTargetID);
    var iEnter = 13;
    if(oTarget != null)
    {
        if(e.keyCode == iEnter)
        {
            doClientSearch(sTargetID);
        }
    }
    return false;
}

function SetEnter(e,sTargetID)
{
    var oTarget = document.getElementById(sTargetID);
    var iEnter = 13;
    if(oTarget != null){
        switch(e.keyCode){
	        case iEnter: 
	            if(oTarget.name == ""){
	                __doPostBack(oTarget.id.replace(/_/g,"$"), "");
	            }else{
	                runCmdClick(oTarget);
	            }
	            break;
        }
    }
}

function TextMaxLength(oObj,iMax) {
    if ( oObj.value.length > iMax )
    {
        oObj.value = oObj.value.substring( 0, iMax );
        return false;
    }
}

ModalPopup = function (elem,options) {
	options = options || {};
	var HasBackground = (options.HasBackground!=null)?options.HasBackground:true;
	var BackgroundColor = options.BackgroundColor || '#000000';
	var BackgroundOpacity = options.BackgroundOpacity || 60; // 1-100
	BackgroundOpacity = (BackgroundOpacity > 0) ? BackgroundOpacity : 1;
	var BackgroundOnClick = options.BackgroundOnClick || function(){};
	var BackgroundCursorStyle = options.BackgroundCursorStyle || "default";
	var Zindex = options.Zindex || 90000;
	var AddLeft = options.AddLeft || 0; //in px
	var AddTop = options.AddTop || 0; //in px

	function _Convert(val) {
		if (!val) {return;}
		val = val.replace("px","");
		if (isNaN(val)) {return 0;}
		return parseInt(val);
	}
	var popup = document.getElementById(elem);
	if (!popup) {return;}
	var winW = (document.layers||(document.getElementById&&!document.all)) ? window.outerWidth : (document.all ? document.body.clientWidth : 0);
	var winH = window.innerHeight ? window.innerHeight :(document.getBoxObjectFor ? Math.min(document.documentElement.clientHeight, document.body.clientHeight) : ((document.documentElement.clientHeight != 0) ? document.documentElement.clientHeight : (document.body ? document.body.clientHeight : 0)));
	popup.style.display = "block";
	popup.style.visibility = "visible";
	var currentStyle;
	if (popup.currentStyle)	{ 
		currentStyle = popup.currentStyle; 
	}
	else if (window.getComputedStyle) {
		currentStyle = document.defaultView.getComputedStyle(popup, null);
	} else {
		currentStyle = popup.style;
	}

	var elemW = popup.offsetWidth -
		_Convert(currentStyle.marginLeft) -
		_Convert(currentStyle.marginRight) -
		_Convert(currentStyle.borderLeftWidth) -
		_Convert(currentStyle.borderRightWidth);

	var elemH = popup.offsetHeight -
		_Convert(currentStyle.marginTop) -
		_Convert(currentStyle.marginBottom) -
		_Convert(currentStyle.borderTopWidth) -
		_Convert(currentStyle.borderBottomWidth);

	if(isIe6())
	{
	    popup.style.position = "absolute";
	}else{
	    popup.style.position = "fixed";
	}
	popup.style.left = (winW/2 - elemW/2 + AddLeft) + "px";
	
	if(isIe6())
	{
	    popup.style.top = Number(getScrollTopPosition()) + 150 + 'px';
	}else{
	    popup.style.top = (winH/2 - elemH/2 + AddTop - 10) + "px";
	}
	
	popup.style.zIndex = Zindex + 1;
	
	if (HasBackground) {		
		if (!ModalPopup._BackgroundDiv) {
			ModalPopup._BackgroundDiv = document.createElement('div');
			ModalPopup._BackgroundDiv.style.display = "none";
			ModalPopup._BackgroundDiv.style.width = "100%";
			ModalPopup._BackgroundDiv.style.position = "absolute";
			ModalPopup._BackgroundDiv.style.top = "0px";
			ModalPopup._BackgroundDiv.style.left = "0px";
			document.body.appendChild(ModalPopup._BackgroundDiv);
		}
		ModalPopup._BackgroundDiv.onclick =  BackgroundOnClick;
		ModalPopup._BackgroundDiv.style.background = BackgroundColor;	
		ModalPopup._BackgroundDiv.style.height = document.all ? Math.max(Math.max(document.documentElement.offsetHeight, document.documentElement.scrollHeight), Math.max(document.body.offsetHeight, document.body.scrollHeight)) : (document.body ? document.body.scrollHeight : ((document.documentElement.scrollHeight != 0) ? document.documentElement.scrollHeight : 0)) + "px";
		ModalPopup._BackgroundDiv.style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity=" + BackgroundOpacity +")";
		ModalPopup._BackgroundDiv.style.MozOpacity = BackgroundOpacity / 100;
		ModalPopup._BackgroundDiv.style.opacity = BackgroundOpacity / 100;
		ModalPopup._BackgroundDiv.style.zIndex = Zindex;
		ModalPopup._BackgroundDiv.style.cursor = BackgroundCursorStyle;

		ModalPopup._BackgroundDiv.style.display = "";
	}

}

ModalPopup.Close = function(id) {
	showSelectElements(true);
	if (id) {
		document.getElementById(id).style.display = "none";
		document.getElementById(id).style.visibility = "hidden";
	} 
	if  (ModalPopup._BackgroundDiv) {
		ModalPopup._BackgroundDiv.style.display = "none";
	}
}

function isIe6()
{
    var bIe6 = false;
    var version = 999; // we assume a sane browser    
    if (navigator.appVersion.indexOf("MSIE") != -1)
    {
        version = parseFloat(navigator.appVersion.split("MSIE")[1]);    
        if(version < 7)
        {
           bIe6 = true;
        }
    }
    return bIe6
}

function showModal(sModalName)
{
    ModalPopup(sModalName);
}
function PopupOpenNewsletter(nID)
{ 	
    NewsletterP = window.open('/NewsLetterPrev.aspx?ID=' + nID, 'Newsletter', 'scrollbars=yes,resizable=yes,menubar=no,toolbar=no,status=yes,width=1024,height=768,top=0,left=0' );
    NewsletterP.focus();
    return;	
}
function getScrollTopPosition()
{
var ScrollTop = document.body.scrollTop;
    if (ScrollTop == 0)
    {
        if (window.pageYOffset)
            ScrollTop = window.pageYOffset;
        else
            ScrollTop = (document.body.parentElement) ? document.body.parentElement.scrollTop : 0;
    }
    return ScrollTop;
}
function showSelectElements(bShow)
{
    if(isIe6())
    {
        var items = document.getElementsByTagName('select');
        for(var i=0; i<items.length; i++)
        {
            var oObj = document.getElementById(items[i].id);
            if(oObj)
            {
                if(bShow)
                {
                    oObj.style.display='';
                }else{
                    oObj.style.display='none';
                }
            }
        }        
    }
}





    function open_player(){
        //pageTracker._trackEvent('Home Page/Radio Box', 'UI-Button', 'Play');
        window.open ("http://radio.eol.co.il/Radio.aspx", "mywindow","width=750,height=550,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no,resizable=no");
		//window.open ("http://radio.eol.co.il/player/radio-player.html", "mywindow","width=447,height=485,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no,resizable=no");
	}   
    
    function open_sadna(){
        window.open ("http://people.eol.co.il/files/sadnaot/sadna.jpg", "mywindow","width=960,height=541,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no,resizable=no");
    }   
    
    var iTimeout;
    var iInterval;
    var iTime = 6000;
    var prevTabIndex = '1';
    
    function AutoMoveItems(){
    
        iInterval = setInterval("MainImageChange('" + null + "', " + null + ")",iTime);
    }
  
    function MainImageChange(oCtrl,tabIndex){
            if(tabIndex == null || tabIndex == 'null'){
                tabIndex = Math.floor(Math.random()*3) +1; 
                if(prevTabIndex == tabIndex){
                    tabIndex = Math.floor(Math.random()*3) +1; 
                }   
            }
            if(prevTabIndex != tabIndex){
                var oContainerImage = document.getElementById('divMainImage');
                var oTabImg = document.getElementById('imgTab' + prevTabIndex);
                var oImageLink = document.getElementById('link' + prevTabIndex);
                
                if(oContainerImage != null && typeof(oContainerImage) != 'undefined')
                {
                    oTabImg.className = oTabImg.className.replace('_selected','');
                    oImageLink.className = "MainItemDisplayNone";
                }
                oTabImg = document.getElementById('imgTab' + tabIndex);
                oImageLink = document.getElementById('link' + tabIndex);
                if(oContainerImage != null && typeof(oContainerImage) != 'undefined')
                {
                    oImageLink.className = "MainItemImageLink";
                    oTabImg.className = oTabImg.className + '_selected';
                    oContainerImage.className = "MainItemLeft MainItemLeftImage" + tabIndex;
                }
                prevTabIndex = tabIndex;
            }
            if(oCtrl != 'null' && oCtrl != null ){
                    
                clearInterval(iInterval);
            }
        }
        function ButtonSubmitMouseOver(bOver,oButt){
            if(bOver){
                oButt.src = oButt.src.replace('but_send.gif','but_send_over.gif');
                oButt.style.cursor = 'pointer';
            }
            else{
                oButt.src = oButt.src.replace('_over','');
                oButt.style.cursor = 'default';
            }
        }
        function CheckInputValue(oCtrl){
            if(oCtrl.value == "דואר אלקטרוני"){
                oCtrl.value = "";
            }
        }
        function RadioMouseOver(oCtrl,bOver){
            if(bOver){
                oCtrl.src = oCtrl.src.replace('but_radio.gif','but_radio_over.gif');
            }
            else{
                oCtrl.src = oCtrl.src.replace('_over','');
            }
        }
        function OnMouseOverVideo(oCtrl, iVideo){
            switch(iVideo){
                case 1:
                
                    document.getElementById('aVideo').href = "http://people.eol.co.il/כתבות/השראה_יצירתית/דן_תורן_ברדיו_מהות_החיים.aspx";
                    document.getElementById('aVideo').onclick="pageTracker._trackEvent('Home Page/Video', 'UI-Button', '1');"
                    document.getElementById("imgVideo").className = "Vidao3Img";
                    document.getElementById("VideoTitle").innerHTML = "וידאו";
                    
                    break;
                case 2:
                    document.getElementById('aVideo').href = "http://people.eol.co.il/כתבות/קיימות/קיימות_בעסקים.aspx";
                    document.getElementById('aVideo').onclick="pageTracker._trackEvent('Home Page/Video', 'UI-Button', '2');"
                    document.getElementById("imgVideo").className = "Vidao2Img";
                    document.getElementById("VideoTitle").innerHTML = "וידאו";
                    break;
                case 3:
                    document.getElementById('aVideo').href = "http://people.eol.co.il/כתבות/תרבות_ואמנות/שעת_קסם.aspx";
                    document.getElementById('aVideo').onclick="pageTracker._trackEvent('Home Page/Video', 'UI-Button', '3');"
                    document.getElementById("imgVideo").className = "Vidao1Img";
                    document.getElementById("VideoTitle").innerHTML = "וידאו";
                    break;
            } 
            if(oCtrl.className == "VidaoButTreeImg"){
                oCtrl.className = "VidaoButTreeOverImg";
            }
            if(oCtrl.className == "VidaoButHoursesImg"){
                oCtrl.className = "VidaoButHoursesOverImg";
            }
            if(oCtrl.className == "VidaoButSoundImg"){
                oCtrl.className = "VidaoButSoundOverImg";
            }
        }
        function OnMouseOut(oCtrl){
            if(oCtrl.className == "VidaoButTreeOverImg"){
                oCtrl.className = "VidaoButTreeImg";
            }
            if(oCtrl.className == "VidaoButHoursesOverImg"){
                oCtrl.className = "VidaoButHoursesImg";
            }
            if(oCtrl.className == "VidaoButSoundOverImg"){
                oCtrl.className = "VidaoButSoundImg";
            }            
        }
        function RollerOnMouseOut(oImg)
        {
            if(oImg!=null)
            {
                if(oImg.id == "imgRollerNext")
                {
                    oImg.src=oImg.src.replace("article_but_next_over", "article_but_next");
                }
                else if(oImg.id == "imgRollerBack")
                {
                    oImg.src=oImg.src.replace("article_but_back_over", "article_but_back");
                }
            }
        }
        function RollerOnMouseOver(oImg)
        {
            if(oImg!=null)
            {
                if(oImg.id == "imgRollerNext")
                {
                    oImg.src=oImg.src.replace("article_but_next", "article_but_next_over");
                }
                else if(oImg.id == "imgRollerBack")
                {
                    oImg.src=oImg.src.replace("article_but_back", "article_but_back_over");
                }
            }
        }
        
        var sLastAction="PositionBullet1";
        var iIndex=1; //3
        function RollerMoveNext(sAction, oImg)
        {
            if(sAction=="next")
            {
                MoveLeft();
                SelectBullet(-1);
                
            }
            if(sAction=="prev")
            {
                MoveRight();
                SelectBullet(1);
            }
        }
        function SelectBullet(iCount)
        {
        document.getElementById("PositionBullet1").src="images/article_dot.gif";
        document.getElementById("PositionBullet2").src="images/article_dot.gif";
        document.getElementById("PositionBullet3").src="images/article_dot.gif";
            iIndex=iCount+iIndex;
            if(iIndex==4){
                iIndex=1;
                }
                else if(iIndex==0){
                iIndex=3;
                }
            document.getElementById("PositionBullet"+iIndex).src="images/article_dot_selected.gif";
            
            
//            if(iIndex==3){
//                iIndex=1;
//                }
//            else if(iIndex==0){
//                iIndex=3;
//                }
//            else {
//            iIndex=iCount+iIndex;
//            }
//            alert(iIndex);
//            var oImg=document.getElementById(sLastAction);
//            if(oImg!=null)
//                oImg.src=oImg.src.replace("_selected","");
//            sLastAction="PositionBullet"+iIndex;
        }
    // Copyright 2006-2007 javascript-array.com

var timeout	= 100;//500
var closetimer	= 0;
var ddmenuitem	= 0;

// open hidden layer
function mopen(id)
{	
	// cancel close timer
	mcancelclosetime();

	// close old layer
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';

	// get new layer and show it
	ddmenuitem = document.getElementById(id);
	ddmenuitem.style.visibility = 'visible';

}
// close showed layer
function mclose()
{
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
}
// go close timer
function mclosetime()
{
	closetimer = window.setTimeout(mclose, timeout);
}
// cancel close timer
function mcancelclosetime()
{
	if(closetimer)
	{
		window.clearTimeout(closetimer);
		closetimer = null;
	}
}
// close layer when click-out
document.onclick = mclose;      

//--------------------------------------------  
//var interval = 7; // delay between rotating images (in seconds)
//interval *= 1000;
//var picturetodisplay=1;

//function getNextImage() {
//   if (picturetodisplay==3) {
//      picturetodisplay=1;
// }
//   else {
//        picturetodisplay +=1;
//    }
//    return (picturetodisplay);
//}   
  
//function rotateImage(place) {
//    var new_image = getNextImage();
//    MainImageChange(this,new_image);
//    var recur_call = "rotateImage('"+new_image+"')";
//    setTimeout(recur_call, interval);
//}        
        
     function clockon() {
     thistime= new Date();
     var hours=thistime.getHours();
     var minutes=thistime.getMinutes();
     var seconds=thistime.getSeconds();
     if (eval(hours) <10) {hours="0"+hours};
     if (eval(minutes) < 10) {minutes="0"+minutes};
     if (seconds < 10) {seconds="0"+seconds};
     thistime = hours+":"+minutes+":"+seconds;
     bgclocknoshade.innerHTML=thistime;
     var timer=setTimeout("clockon()",200);
}

    function taarih(){
        var date = new Date();
        var d  = date.getDate();
        var day = (d < 10) ? '0' + d : d;
        var m = date.getMonth() + 1;
        var month = (m < 10) ? '0' + m : m;
        var yy = date.getYear();
        var year = (yy < 1000) ? yy + 1900 : yy;
        
        var weekday=new Array(7);
        weekday[0]="יום ראשון";
        weekday[1]="יום שני";
        weekday[2]="יום שלישי";
        weekday[3]="יום רביעי";
        weekday[4]="יום חמישי";
        weekday[5]="יום שישי";
        weekday[6]="יום שבת";
        
        var yom=weekday[date.getDay()];
        
        taarich.innerHTML=day + "/" + month + "/" + year + " " + yom ;
}  

