﻿/// <reference name="MicrosoftAjax.js" />
function updateImgPaths(jColl){
  jColl.each(function(ind){
     var ind = this.src.indexOf('http://');
     ind = ind>0 ? 1 : ind+7; 
     this.src = 'http://www.karev.org.il' + this.src.substr(this.src.indexOf('/', ind));  
  });
}

function updateLinksPaths(jColl){
  jColl.each(function(ind){
    try {
     var ind = this.href.indexOf('http://minisite.karev.org');
     var ind1 = this.innerHTML.toLowerCase().indexOf('img');
     if(ind == 0 && ind1 != -1)
     {
        ind = 7;
        this.href = 'http://www.karev.org.il' + this.href.substr(this.href.indexOf('/', ind));  
     }
    } 
    catch(ex){} 
  });
}

function topMenuButtonSelect(sel){
   try { 
     $(sel).closest('table').removeClass('MenuTopButton2').addClass('MenuTopButton3');
   } 
   catch(ex){} 
}

function rightMenuButtonSelect(itemIDstr){
  if(itemIDstr!='-1'){
    var sel = "[id*='Accordion1'] a[href*='TypeMain=ContentItemRegion&CID=" + itemIDstr + "']";
    $(sel).removeClass('ItemText').addClass('ItemTextSelected');
  }  
}
var servPath = 'http://' + window.location.hostname + '/WebService1.asmx';
var imgs; 
function eraseEmptyLinks(doc){
   imgs = $('img', doc);
   imgs.each(function(){
      Sys.Net.WebServiceProxy.invoke(servPath, 'isImgExists', false, {path:this.src}, isImgExistsSucc, null, this);          
   }); 
}

function isImgExistsSucc(r, img){
   var dispValue = r==true ? 'block' : 'none';
   $(img).css('display', dispValue);
}



 
