String.prototype.trim = function()
{
    return this.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
}
String.prototype.endsWith = function(str)
{
    return (this.match(str + "$") == str)
}
String.prototype.startsWith = function(str)
{
    return (this.match("^" + str) == str)
}


function getStyleObject(objectId) {
    // checkW3C DOM, then MSIE 4, then NN 4.
    if(document.getElementById && document.getElementById(objectId))
        return document.getElementById(objectId).style;
    else if (document.all && document.all(objectId))
        return document.all(objectId).style;
    else if (document.layers && document.layers[objectId])
        return document.layers[objectId];
    else
        return false;
}
function changeVisibility(objectId, newVisibility) {
    var styleObject = getStyleObject(objectId);
    if (styleObject)
        styleObject.visibility = newVisibility;
}
function changeDisplay(objectId, newDisplay)
{
    var styleObject = getStyleObject(objectId);
    if (styleObject)
        styleObject.display = newDisplay;
}







function changeTab(tabNum)
{
    if (document.getElementById)
    {
        hideTab(1);
        hideTab(2);
        hideTab(3);
        hideTab(4);
        
        showTab(tabNum);
    }
}
function showTab(tabNum)
{
    document.getElementById('tab' + tabNum).className = 'selected';
    document.getElementById('tab' + tabNum + 'def').className = '';
    document.getElementById('tab' + tabNum + 'content').className = 'content';
}
function hideTab(tabNum)
{
    document.getElementById('tab' + tabNum).className = '';
    document.getElementById('tab' + tabNum + 'def').className = 'hide';
    document.getElementById('tab' + tabNum + 'content').className = 'hide';
}


function PrintContent()
{
    var DocumentContainer = document.getElementById('mainContentBox');
	var footerContainer = document.getElementById('footer');
var WindowObject = window.open("", "PrintWindow","width=750,height=650,top=50,left=50,toolbar=no,menubar=no,scrollbars=yes,status=no,resizable=yes");
WindowObject.document.writeln("<html><head><title>"+ document.title +"</title><link href=\"" + blogtemplateurl + "/beprint.css\" rel=\"stylesheet\" type=\"text/css\" /></head><body><div id=\"header\">&nbsp;</div><div class=\"mainContentBox\">");

//WindowObject.document.writeln("<html><head><title>"+ document.title +"</title><link href=\"" + blogtemplateurl.value + "/beprint.css\" rel=\"stylesheet\" type=\"text/css\" /></head><body><div id=\"header\">&nbsp;</div><div class=\"mainContentBox\">");

WindowObject.document.writeln(DocumentContainer.innerHTML);
WindowObject.document.writeln("</div><div id=\"footer\">" + footerContainer.innerHTML + "</div></body></html>");
WindowObject.document.close();
WindowObject.focus();
WindowObject.print();
WindowObject.close();
}

