function replaceSearchImage() {
    var tags = document.getElementsByTagName("IMG");
    for (var i = 0; i < tags.length; i++) {
        var theImage = tags[i];
        var imgsrc = theImage.getAttribute('SRC');
        if (imgsrc != null && imgsrc.indexOf("gosearch") != -1) {
            theImage.src = "/_layouts/images/lombard/magnifier.gif";
            theImage.onmouseover = "this.src='/_layouts/images/lombard/magnifier.gif'";
            theImage.onmouseout = "this.src='/_layouts/images/lombard/magnifier.gif'";
        }
    }
}

function video() {
    if (window.showModalDialog) {
        window.showModalDialog("../../html documents/en/video.html", "Lombard", "dialogWidth:500px;addressbar:no;dialogHeight:280px;location:no;center:yes");
    }
    else {
        window.open('../../html documents/en/video.html', 'Lombard', 'height=300,width=520,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,location=no,addressbar=no,center=yes,modal=yes');
    }
}

function openvideo(url, width, height) {
    if (window.showModalDialog) {
        window.showModalDialog(url, "Lombard International Assurance S.A.", "dialogWidth:" + width + "px;dialogHeight:" + height + "px;center:yes;status:no;");
    }
    else {
        window.open(url, 'Lombard International Assurance S.A.', 'height=' + height + ',width=' + width + ',toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,location=no,addressbar=no,center=yes,modal=yes');
    }
}

function videoLinks() {
    var link = $("li.video > a");
    link.click(function () { video() });
    link.attr('href', '#');
    link.removeAttr('target');
}
_spBodyOnLoadFunctionNames.push('videoLinks');


function popup_eLombard(url, windowName) {
    params = 'width=' + screen.width;
    params += ', height=' + screen.height;
    params += ', top=0, left=0';
    params += ', location=no';
    params += ', menubar=yes';
    params += ', resizable=yes';
    params += ', scrollbars=no';
    params += ', status=yes';
    params += ', toolbar=no';

    newwin = window.open(url, windowName, params);
    if (window.focus) {
        newwin.focus();
    }
    return false;
}


function setDocumentsOffline(){
  $('div.links').find('a').each(function(i){
    if ($(this).attr('href').indexOf('Lombard_company_profile.pdf') > 0
        ||
        $(this).attr('href').indexOf('Profil_Lombard.pdf') > 0
        ||
        $(this).attr('href').indexOf('Firmenprofil.pdf') > 0 
        ||
        $(this).attr('href').indexOf('Lombard_bedrijfsprofiel.pdf') > 0 
     
       )
    {
      $(this).parent().hide();
    }
  });
}

_spBodyOnLoadFunctionNames.push('setDocumentsOffline');
