function popup(e, id, L, T ) { 
	var cursor = getPosition(e)
	var obj =  document.getElementById(id);
	var px_top= "";
	var px_left= "";	
	//alert('x:'+cursor.x+'y:'+cursor.y);
		obj.style.display = "block";
		obj.style.position = "absolute";
		px_left = eval(L+(cursor.x));
		px_top = eval(T+(cursor.y));		
		obj.style.left = px_left+"px";
		obj.style.top = px_top+"px";

}

function unpop( id ) { 
	var obj =  document.getElementById(id);
	obj.style.display = "none"; 
}

function getPosition(e) {
    e = e || window.event;
    var cursor = {x:0, y:0};
    if (e.pageX || e.pageY) {
        cursor.x = e.pageX;
        cursor.y = e.pageY;
    } 
    else {
        var de = document.documentElement;
        var b = document.body;
        cursor.x = e.clientX + 
            (de.scrollLeft || b.scrollLeft) - (de.clientLeft || 0);
        cursor.y = e.clientY + 
            (de.scrollTop || b.scrollTop) - (de.clientTop || 0);
    }
    return cursor;
}

function change_source(src_id, new_src,width,height) { 
	var obj =  document.getElementById(src_id);
	/*
	var wielkosc_pozostala = eval(width-20-190+20);
	var wieksze = Math.ceil(eval(wielkosc_pozostala*0.7));	
	var mniejsze = eval(wielkosc_pozostala-wieksze);
	var cointainer = eval(width+20);
	//alert(new_src);
	//obliczone z php
	document.getElementById('b_main').style.width=width+"px";
	document.getElementById('t_spacel').style.width=wieksze+"px";
	document.getElementById('t_space2').style.width=mniejsze+"px";
	document.getElementById('left_side').style.height=height+"px";
	document.getElementById('right_side').style.height=height+"px";	
	document.getElementById('img_cointainer').style.width=cointainer+"px";			
	*/
	obj.src=new_src;	
}
