﻿// JScript File

function bookmark() {
    window.external.AddFavorite("http://www.lab-lodurs.com","www.lab-lodurs.com");
}

function openLogOn(e){
    var bObj = document.getElementById('shell');
    var icObj = document.getElementById('logdiv');
    
    bObj.style.height = document.body.scrollHeight + "px";
    icObj.style.top = (document.body.clientHeight/2) - 75 + "px";//(findY(e) - 300) + "px";
    //icObj.style.top = (document.body.scrollTop) + "px";
    icObj.style.left = (document.body.clientWidth/2) - 175 + "px";
    //alert(findY(event));
    logframe.location.href = "/sysedit/ifrlogon.aspx";
    //alert(bObj.style.height);
    bObj.style.display = 'block';
    icObj.style.display = 'block';
}

function openImageCenter(strimg, e){
    //alert("y: " + gPosY);
    var bObj = document.getElementById('shell');
    var icObj = document.getElementById('imgcntr');
    
    bObj.style.height = document.body.scrollHeight + "px";
    icObj.style.top = (document.body.clientHeight/2) - 325 + "px";//(findY(e) - 300) + "px";
    //icObj.style.top = (document.body.scrollTop) + "px";
    icObj.style.left = (document.body.clientWidth/2) - 456 + "px";
    //alert(findY(event));
    icframe.location.href = "/system/imggalleryviewer.aspx?gid=" + strimg;
    //alert(bObj.style.height);
    bObj.style.display = 'block';
    icObj.style.display = 'block';
}

function findY(e){
    var tmpY = 0;
    if(e.pageY){
        
        tmpY = e.pageY;
        
    }else if(e.clientY){
        if(document.documentElement.scrollTop){
            
            tmpY =  e.clientY + document.documentElement.scrollTop;
        }else{
            
            tmpY = e.clientY + document.body.scrollTop;
        }
    }
    //alert("tmpY: " + tmpY);
    if(tmpY <= 300){
            tmpY = 320;
    }
    //alert(tmpY);
    return tmpY;
}

function closeImgCntr(){
        icframe.location.href = "/system/blank.htm";
        var bObj = document.getElementById('shell');
        var icObj = document.getElementById('imgcntr');
        icObj.style.display = 'none';
        bObj.style.display = 'none';
    }

