function virtualPopupInit(el, zIndex){
	//$(el).parent().attr("onclick", "openVirtualPopup('"+el+"')");
	$(el).parent().css('position', 'relative');
	$(el).parent().css('cursor', 'pointer');
	$(el).parent().css('z-index', zIndex);
	//$(el).draggable();
}

function openVirtualPopup(el){
	//$(el).css('display','block');
        window.scrollTo(0,0);
        var maskHeight = $(document).height();
        var maskWidth = $(window).width();

        $('div.mask').css({'width':maskWidth,'height':maskHeight});

        $('div.mask').fadeIn(1);
        var winH = $(window).height();
        var winW = $(window).width();

        $(el).css('top',  winH/2-$(el).height()/2);
        $(el).css('left', winW/2-$(el).width()/2);
        $(el).fadeIn(1);
        //$(el).draggable();
}

function closeVirtualPopup(el){
	$('div.mask').hide();
	$(el).hide();
	//$(el).css('display','none');
	//hack to close popup again because the onclick on parent tag opens the popup
	//setTimeout( function(){$(el).css('display','none');}, 100);
}
