﻿
var l_intWithPopup = 1;
var l_intHeightPopup = 1;
var l_maxWidth = 600;
var l_maxHeight = 500;
var l_offsetWidth = 15;
var l_offsetHeight = 0;


function openPopup( bolOpen, key) {

	if (bolOpen) {
	
	    var objDiv = document.getElementById("divPopup")
    	var objFrame = document.getElementById("iframeBlogComment");
    	
    	objFrame.src="/Pages/Blogs/BlogCommentVisu.aspx?key=" + key;
	
		l_intWithPopup=1;
		l_intHeightPopup=1;
		
		
        if (document.all) {
            objDiv.style.top = document.documentElement.scrollTop + 10 ;
        }
        else {
            objDiv.style.top = eval(window.pageYOffset + 10) + "px" ;
        }
        
        objDiv.style.left = "200px";
        objDiv.style.width = 0;
        objDiv.style.height = 0;
        
		l_offsetHeight = (l_offsetWidth * l_maxHeight) / l_maxWidth;

		
        objDiv.style.display="";
		
		window.setTimeout("AggrandiPopup()", 1)
	}
	else {
		l_intWithPopup=l_maxWidth;
	}
}

function AggrandiPopup() {

	if (l_intWithPopup<l_maxWidth) {
	
	    var objDiv = document.getElementById("divPopup")
    	
	    if (l_intWithPopup+l_offsetWidth<=l_maxWidth) {
	        l_intWithPopup += l_offsetWidth ;
	        l_intHeightPopup += l_offsetHeight;
	    	objDiv.style.width = l_intWithPopup + "px";
	        objDiv.style.height = l_intHeightPopup + "px";
        }
	    else {
	    
	        l_intWithPopup = l_maxWidth;
	        l_intHeightPopup = l_maxHeight;
	        objDiv.style.width = l_maxWidth  + "px";
	        objDiv.style.height = l_maxHeight + "px";
	    }
    	    	
		window.setTimeout("AggrandiPopup()", 1)  
	}
	
	
}

function closePopup() {

    document.getElementById("divPopup").style.display="none";
    document.getElementById("iframeBlogComment").src="";
}
