var nofix = false;
if (document.location.hash == '#print'){
    nofix = true;
}
function setPrintCSS(isPrint)
{
    if (document.all && jQuery.browser.version == '6.0'){
        window.location.href = window.location.href + '#print';
        window.location.reload();
        return false;
    }
    toPrint(isPrint);
}

function backToDesignMode()
{
    if (document.all)
        window.location.href = window.location.href.replace('#print','');
    else
        setPrintCSS(false);

    return false;
}

$(document).ready(function() {
   if (document.location.hash == '#print')
    toPrint(true);
});

function toPrint(isPrint){
    var link = $("link#print_css");
    if(isPrint){
        link.attr({
            disabled: false,
            rel: "stylesheet"
        });
        $.each($('A'), function() {
             $(this).data('st', $(this).attr('style'));
             $(this).attr('style', 'color: #2A9CCF !important;text-decoration:underline;');
        });
    } else {
        $.each($('A'), function() {
             $(this).attr('style', ' ');
             $(this).attr('style', $(this).data('st'));
        });
        
        link.attr({
            disabled: true,
            rel: "alternate stylesheet"
        });
    }
}