//Write current year
function Year()
{
	var today = new Date();
	document.write(today.getFullYear());
}

// Initialize
function Initialize()
{   
	var strURL = new String(window.location);
	var strFile = strURL.substr(strURL.lastIndexOf("/") + 1);
	if (strFile.indexOf("#")!=-1) strFile = strFile.substr(0, strFile.indexOf("#"));
	if(!strFile) strFile = "index.htm"; 
    var strSite = "http://www.dbmailserver.com/";
	var link = document.getElementById("idlink");
	if (link) link.href = strSite + strFile;

	if (strURL.indexOf("#")!=-1) strURL = strURL.substr(0, strURL.indexOf("#"));	
	var strFileName = strURL.substr(strURL.lastIndexOf("/") + 1);

	if(!strFileName) strFileName = "index.htm";
	var top = document.getElementById("top_" + strFileName);
	if (top) top.style.color="yellow";
	var top = document.getElementById("left_" + strFileName);
	if (top) top.style.color="red";
}

function WriteVersion(objName) 
{  
    var obj = document.getElementById(objName);
    if (obj) obj.innerText = strDBMailVersion;
}

function WriteRelease(objName) 
{
    var obj = document.getElementById(objName);  
    if (obj) obj.innerText = strDBMailRelease; 
}

// H2Title
function H2Title(idObject, idImage, nWidth, nTopMargin, nBottomMargin)
{
    var obj = document.getElementById(idObject);
    var img = document.getElementById(idImage);
    if (!obj) return;
    var strText = img.innerHTML;//obj.innerHTML;
    
    if (nWidth==-1) nWidth=250;
    if (nTopMargin==-1) nTopMargin=10;
    if (nBottomMargin==-1) nBottomMargin = 8;
    
    var strHtml = "";
    strHtml += ("<table width=" + nWidth + " border=0 cellspacing=0 cellpadding=0>");
    strHtml += ("<tr><td width=2 height=" + nTopMargin + ">");
  	strHtml += ("<tr><td><td>"); 
    strHtml += ("  <table width=100%% border=0 cellpadding=0 cellspacing=1>");
    strHtml += ("  <tr><td valign='bottom'>" + strText);
    strHtml += ("  <tr><td height=3>");
    strHtml += ("  </table>");
    strHtml += ("  <tr><td><td>"); 
    strHtml += ("    <table width=100% border=0 cellspacing=0 cellpadding=0>");
    strHtml += ("    <tr><td width=120>");
    strHtml += ("              <table width=100%% border=0 cellpadding=0 cellspacing=0>");
    strHtml += ("              <tr>"); 
    strHtml += ("                  <td width=27><img src='styles/tit_img1.gif' width=27 height=3></td>");
    strHtml += ("                  <td bgcolor=#0496D2><img src='styles/tit_img3.gif'></td>");
    strHtml += ("                  <td width=67><img src='styles/tit_img2.gif' width=67 height=3></td>");
    strHtml += ("              </table>");
    strHtml += ("        <td background='styles/tit_imgbg.gif'><img src='styles/tit_imgbg.gif' width=1 height=3></td>");
    strHtml += ("    </table>");
    strHtml += ("<tr><td height=" + nBottomMargin + ">");
    strHtml += ("</table>");    
    obj.innerHTML = strHtml;
}
