function main(){
	$(".ceebox").ceebox();
	$('a[rel="lightbox"]').ceebox();
	$("#redirect").val(''+document.location);
}
$(document).ready(main);
function getRealLeft(el) {
	if (arguments.length==0) el = this;
	xPos = el.offsetLeft;
	tempEl = el.offsetParent;
	while (tempEl != null) {
		xPos += tempEl.offsetLeft;
		tempEl = tempEl.offsetParent;
	}
	return xPos;
}

function getRealTop(el) {
	if (arguments.length==0) el = this;
	yPos = el.offsetTop;
	tempEl = el.offsetParent;
	while (tempEl != null) {
		yPos += tempEl.offsetTop;
		tempEl = tempEl.offsetParent;
	}
	return yPos;
}

var detailsState = "closed";
function showDetails(){
    if(detailsState=='open')return closeDetails();
    $("#details").css('left',getRealLeft(document.getElementById("detailsLink"))-180);
    $("#details").css('border-style','solid');
    $("#details").css('border-width','medium');

            $("#details").animate(
            {
                    height: 300,
                    top:getRealTop(document.getElementById("detailsLink"))+40
            }, 300, "swing", function()
                    {
                        detailsState='open';

                    });

}
function closeDetails(){
	if(document.getElementById("detailsLink"))
    		$("#details").animate(
		    {
			    height: 0,
			    top:getRealTop(document.getElementById("detailsLink"))-40
		    }, 300, "swing", function()
			    {
				$("#details").css('border-style','none');
				$("#details").css('border-width','0');
				detailsState='closed';
                    });
}
