function hideDiv(e, prop)
{
    $(e).parents(prop).css({"top":"0","left":"-9999px"}); return false;
}

function Close(e, container)
{
    $(container).hide(); return false;
}

function addTitleAndRealClose(prop, titleText, closeText)
{
     addTitleAndCloseProto(prop, titleText, closeText, true);
}


function addTitleAndCloseProto(prop, titleText, closeText, isRealClose)
{
    $(prop).prepend("<table width='100%' border='0' cellpadding='0' cellspacing='0' class='titleRow'><tr><td align='left'><strong>" + titleText + 
            "</strong></td><td align='right' valign='top' style='padding:0px'><a title='" + closeText + "' href='javascript:void(0);' onclick="+(isRealClose?"Close":"hideDiv")+"(this,'" + prop + "');><img src='/i/close.gif' border='0' width='15px' height='15px' /></a></td></tr></table>");
}

function addTitleAndClose(prop, titleText, closeText)
{
    addTitleAndCloseProto(prop, titleText, closeText, false);
}

function assign_confirm(prop){
    $(prop).each(function(i){
    var evnt = $(this).attr("href");
	evnt = escape(evnt.replace(/\"/g, "'"));
    $(this).attr("href",'javascript:confirmation('+this.id+', "'+evnt+'");');
 });
}

function confirmation(e, action)
{
     var offset = $('#'+e.id).offset();
     if (offset != null){
         $('#divConfirmation').css({"top":(offset.top + 10),"left":(offset.left - 150)});
     }
     $('#divConfirmationText').text($('#'+e.id).attr("ConfirmationText"));
     $('#btnConfirmationSubmit').attr("href", unescape(action));
	 $('#btnConfirmationSubmit').text($('#'+e.id).text());
}