﻿function displayCurrList(idImgOpen, idImgClose, currDesc,imgSeparator,webID,id) {
       try {
       //debugger
           var imgOpen = document.getElementById(idImgOpen);
           var imgClose = document.getElementById(idImgClose);
           var divMore = document.getElementsByName(currDesc);
           if (imgOpen.style.display == '' ||imgOpen.style.display == 'block' ) 
           {
               imgOpen.style.display = 'none';
               imgClose.style.display = '';
               var i=0;
               for(;i<divMore.length;i++)
                 divMore[i].style.display = '';
               var imgSep = document.getElementById(imgSeparator+webID+(parseInt(i)+parseInt(id)));
               if(imgSep!=null)
                   imgSep.style.display = '';
           }
           else {
               imgOpen.style.display = '';
               imgClose.style.display = 'none';
               for(i=0;i<divMore.length;i++)
               divMore[i].style.display = 'none';
               var imgSep = document.getElementById(imgSeparator+webID+(parseInt(i)+parseInt(id)));
               if(imgSep!=null)
                 imgSep.style.display = 'none';
           }
       }
       catch (err) {
           txt = "There was an error on this page.\n\n";
           txt += "Error description: " + err.description + "\n\n";
           txt += "Click OK to continue.\n\n";
           alert(txt);
       }
   }


function CountWord(content)
{//debugger
var content= document.getElementById(content) ;    
var Word=content.innerText;
var num=content.innerText.length;
var countword=content.innerText.length-content.innerText.replace(/\s/g, '').length + 1;
if(countword>45)
{
   for(i=0;i<45;i++)
   {
        if(i==0)
        {
           num=Word.indexOf(' ');
           }
         else
         {
            num=Word.indexOf(' ',num+1); 
            }
    }
  }
document.write(Word.substring(0,num));
if(countword>45)
{
var str=("המשך");
document.write("<div height='30px' style='padding-top: 10px;padding-bottom: 10px' class='LinkText'><img src='/Style%20Library/Images/blogs/shonot/orange-arrow.gif'></img><img src='/Style%20Library/Images/blogs/shonot/orange-arrow.gif'></img><a href='google.com' style='cursor:pointer'>"+str+"</a></div>");
}
}

//function GetHistoryUrl()
// {
//var url=parent.top.document.referrer;
//if(url!="")
//    window.open(url,'_parent');
//}


function GetHistoryUrl()
{
var url = new String(parent.location);
url = url.substring(0, url.indexOf('Pages'));
if (url != "")
     window.open(url, '_parent');
}

function rating(countRating)
{//debugger
var rating= countRating.split('&nbsp;');
countRating =rating[0]; 
if(countRating != '')
    {
        if(countRating==0 || (countRating > 0.00000000000000 && countRating < 1.00000000000000))
            {
            document.write("<img src='/Style%20Library/Images/blogs/shonot/EmptyStar.png' ></img><img src='/Style%20Library/Images/blogs/shonot/EmptyStar.png' ></img><img src='/Style%20Library/Images/blogs/shonot/EmptyStar.png' ></img><img src='/Style%20Library/Images/blogs/shonot/EmptyStar.png' ></img><img src='/Style%20Library/Images/blogs/shonot/EmptyStar.png' ></img>");
            return ;
            }
        if(countRating==1.00000000000000 || (countRating > 1.00000000000000 && countRating < 2.00000000000000))
            {
            document.write("<img src='/Style%20Library/Images/blogs/shonot//fullstar.png' ></img><img src='/Style%20Library/Images/blogs/shonot/EmptyStar.png' ></img><img src='/Style%20Library/Images/blogs/shonot/EmptyStar.png' ></img><img src='/Style%20Library/Images/blogs/shonot/EmptyStar.png' ></img><img src='/Style%20Library/Images/blogs/shonot/EmptyStar.png' ></img>");
            return ;
            }
        if(countRating==2.00000000000000 || (countRating > 2.00000000000000 && countRating < 3.00000000000000))
            {
            document.write("<img src='/Style%20Library/Images/blogs/shonot//fullstar.png' ></img><img src='/Style%20Library/Images/blogs/shonot//fullstar.png' ></img><img src='/Style%20Library/Images/blogs/shonot/EmptyStar.png' ></img><img src='/Style%20Library/Images/blogs/shonot/EmptyStar.png' ></img><img src='/Style%20Library/Images/blogs/shonot/EmptyStar.png' ></img>");
            return ;
            }
        if(countRating==3.00000000000000 || (countRating > 3.00000000000000 && countRating < 4.00000000000000))
          {
            document.write("<img src='/Style%20Library/Images/blogs/shonot//fullstar.png' ></img><img src='/Style%20Library/Images/blogs/shonot//fullstar.png' ></img><img src='/Style%20Library/Images/blogs/shonot//fullstar.png' ></img><img src='/Style%20Library/Images/blogs/shonot/EmptyStar.png' ></img><img src='/Style%20Library/Images/blogs/shonot/EmptyStar.png' ></img>");
            return ;
            }
        if(countRating==4.00000000000000 || (countRating > 4.00000000000000 && countRating < 5.00000000000000))
           {
            document.write("<img src='/Style%20Library/Images/blogs/shonot//fullstar.png' ></img><img src='/Style%20Library/Images/blogs/shonot//fullstar.png' ></img><img src='/Style%20Library/Images/blogs/shonot//fullstar.png' ></img><img src='/Style%20Library/Images/blogs/shonot//fullstar.png' ></img><img src='/Style%20Library/Images/blogs/shonot/EmptyStar.png' ></img>");
            return ;
            }
        if(countRating==5.00000000000000 || countRating > 5.00000000000000 )
            {
            document.write("<img src='/Style%20Library/Images/blogs/shonot//fullstar.png' ></img><img src='/Style%20Library/Images/blogs/shonot//fullstar.png' ></img><img src='/Style%20Library/Images/blogs/shonot//fullstar.png' ></img><img src='/Style%20Library/Images/blogs/shonot//fullstar.png' ></img><img src='/Style%20Library/Images/blogs/shonot//fullstar.png' ></img>");
            return ;
            } 
    }
else
    document.write("אין דירוג");
}


function ratingMFA(countRating) {//debugger
    var rating = countRating.split('&nbsp;');
    countRating = rating[0];
    if (countRating != '') {
        if (countRating == 0 || (countRating > 0.00000000000000 && countRating < 1.00000000000000)) {
            document.write("");
            return;
        }
        if (countRating == 1.00000000000000 || (countRating > 1.00000000000000 && countRating < 2.00000000000000)) {
            document.write("<img src='/Style%20Library/Images/blogs/shonot//fullstar.png' ></img>");
            return;
        }
        if (countRating == 2.00000000000000 || (countRating > 2.00000000000000 && countRating < 3.00000000000000)) {
            document.write("<img src='/Style%20Library/Images/blogs/shonot//fullstar.png' ></img><img src='/Style%20Library/Images/blogs/shonot//fullstar.png' ></img>");
            return;
        }
        if (countRating == 3.00000000000000 || (countRating > 3.00000000000000 && countRating < 4.00000000000000)) {
            document.write("<img src='/Style%20Library/Images/blogs/shonot//fullstar.png' ></img><img src='/Style%20Library/Images/blogs/shonot//fullstar.png' ></img><img src='/Style%20Library/Images/blogs/shonot//fullstar.png' ></img>");
            return;
        }
        if (countRating == 4.00000000000000 || (countRating > 4.00000000000000 && countRating < 5.00000000000000)) {
            document.write("<img src='/Style%20Library/Images/blogs/shonot//fullstar.png' ></img><img src='/Style%20Library/Images/blogs/shonot//fullstar.png' ></img><img src='/Style%20Library/Images/blogs/shonot//fullstar.png' ></img><img src='/Style%20Library/Images/blogs/shonot//fullstar.png' ></img>");
            return;
        }
        if (countRating == 5.00000000000000 || countRating > 5.00000000000000) {
            document.write("<img src='/Style%20Library/Images/blogs/shonot//fullstar.png' ></img><img src='/Style%20Library/Images/blogs/shonot//fullstar.png' ></img><img src='/Style%20Library/Images/blogs/shonot//fullstar.png' ></img><img src='/Style%20Library/Images/blogs/shonot//fullstar.png' ></img><img src='/Style%20Library/Images/blogs/shonot//fullstar.png' ></img>");
            return;
        }
    }
    else
        document.write("no rating");
}

function GetDateWithoutTime(datePage)
{//debugger
if(datePage !='')
    {
    var date1=datePage.split(' ');
    document.write(' '+date1[0]);
    }
}

Lecturers = new Array();
function BuildArrayLecturers(LactureName)
{
  var i;
  for(i=0;i<Lecturers.length;i++)
  {
  if (Lecturers[i]==LactureName)
  {return;}
  }
  if (i==Lecturers.length)
  Lecturers[Lecturers.length]= LactureName;
}

function SearchLecturer(LecturerSearch)
{
 /*ArrLecturers = Lecturers.split(',');*/
 for(i=0;i<Lecturers.length;i++)
 {
  if (Lecturers[i]==LecturerSearch)
   return true;
 }
 return false;
}

function DisplayDiv(_id) {
    var idDiv = document.getElementById(_id);
    if (idDiv != null) {
        if (idDiv.style.display == 'none') {
            idDiv.style.display = 'inline';
        }
        else {
            idDiv.style.display = 'none';
        }
}
}