var FILE_INFO = "@(#) [file] [version] [environment] [state] [crtime]";
var bExplorer = false;
var bNavigator = false;
var bGecko = false;
var bOpera = false;
var bOperaIdentifyAsAnotherBrowser = false;
getBrowsertype();
function getBrowsertype( withReturn )
{
var GECKO = "gecko";
var MICROSOFT = "microsoft";
var MICROSOFT4 = "msie 4";
var MICROSOFT5 = "msie 5.0";
var MICROSOFT55 = "msie 5.5";
var NETSCAPE = "netscape";
var OPERA = "opera";
var fExplorerVersionOK = 4.0;
var fNavigatorVersionOK = 4.61;
var fGeckoVersionOK = 5.0;
var fOperaVersionOK = 5.02;
var fAppVersion = parseFloat( navigator.appVersion );
var sUserAgent = navigator.userAgent.toLowerCase();
var sAppName = navigator.appName.toLowerCase();
if( sAppName.indexOf( OPERA ) > -1 )
{
if ( fAppVersion >= fOperaVersionOK )
{
bOpera = true;
}
}
else if( sUserAgent.indexOf( GECKO ) > -1 || ( sAppName.indexOf( NETSCAPE ) > -1 && fAppVersion >= 5.0 ) )
{
if ( fAppVersion >= fGeckoVersionOK )
{
bGecko = true;
}
}
else if( sAppName.indexOf( NETSCAPE ) > -1 && sUserAgent.indexOf( GECKO ) < 0 )
{
if ( fAppVersion >= fNavigatorVersionOK && fAppVersion < 5.0 )
{
bNavigator = true;
}
}
else if( sAppName.indexOf( MICROSOFT ) > -1 )
{
fAppVersion = 0.0;
if( sUserAgent.indexOf( MICROSOFT4 ) > -1 )
{
fAppVersion = 4.0;
}
else if( sUserAgent.indexOf( MICROSOFT5 ) > -1 )
{
fAppVersion = 5.0;
}
else if( sUserAgent.indexOf( MICROSOFT55 ) > -1 )
{
fAppVersion = 5.5;
}
if ( fAppVersion >= fExplorerVersionOK )
{
bExplorer = true;
}
}
if( sUserAgent.indexOf( OPERA ) > -1 && bOpera == false )
{
bOperaIdentifyAsAnotherBrowser = true;
}
bOpera = false;
bGecko = false;
if (bOperaIdentifyAsAnotherBrowser)
{
bExplorer = false;
bNavigator = false;
bOpera = true;
}
if (!bNavigator && !bExplorer && !bOpera && !bGecko)
{
bExplorer = true;
}
if ( withReturn && ( bExplorer || bGecko || bNavigator || bOpera ) )
{
return true;
}
}
function doStatus( sLayer )
{
if ( bNavigator && sLayer != null && !bGecko)
{
for (i=0; i<eval('document.'+sLayer+'.document.links.length'); i++)
{
eval('document.'+sLayer+'.document.links[' + i + '].onmouseover = showStatusOver');
eval('document.'+sLayer+'.document.links[' + i + '].onmouseout= showStatusOut');
eval('document.'+sLayer+'.document.links[' + i + '].onfocus= showStatusOver');
}
}
else if ( (bNavigator && sLayer == null ) || bExplorer || bGecko || bOpera)
{
for (i=0; i<document.links.length; i++)
{
document.links[i].onmouseover = showStatusOver;
document.links[i].onmouseout= showStatusOut;
document.links[i].onfocus= showStatusOver;
}
}
}
function showStatusOver()
{
window.status="";
return true;
}
function showStatusOut()
{
window.status="";
return true;
}
function clearFieldValue(oField) {
oField.value="";
}
function removeFocus(oField, oButtonGroup, iValue)
{
if ( iValue != null)
{
if ( oButtonGroup.length != null )
{
if ( !oButtonGroup[iValue].checked )
{
oField.blur();
}
}
}
else
{
oField.blur();
}
}
function setInitialFocus(oField)
{
self.focus();
oField.focus();
}
function printFrame() {
if (window.print)
window.print();
}
function goHelp(helpLink) {
aWindow=window.open(helpLink,
'width',
'toolbar=no,width=460,height=580,status=no,scrollbars=no,resizable=no,menubar=no');
aWindow.focus();
}
function openFaq(faqLink, width, height, posX, posY)
{
if (width == null) width = '630';
if (height == null) height = '400';
var options = 'resizable=yes,scrollbars=yes,width=' + width + ',height=' + height;
if (posX != null) options = options + ',screenX=' + posX + ',left=' + posX;
if (posY != null) options = options + ',screenY=' + posY + ',top=' + posY;
awindow = window.open(faqLink,'wib',options);
awindow.focus();
}
function openWindow(sURL, sWindow, iType)
{
var sType="";
switch(iType)
{
case 1:
var sType="resizable=1,scrollbars=0,status=0,width=400,height=300,leftmargin=0,topmargin=0";
break;
default:
var sType="menubar=0,resizable=0,scrollbars=0,status=0,toolbar=0,width=460,height=580";
break;
}
oWindow = window.open(sURL, sWindow, sType);
oWindow.focus();
}
function reloadNavigation()
{
top.nav_top.location.href = top.nav_top.location.href;
top.comhome.navleft.location.href = top.comhome.navleft.location.href;
}
function offerBookmark() {
if (bExplorer)
{
document.write('You can bookmark this page. Click ');
document.write('<A class=uLine HREF="javascript:window.external.AddFavorite(sBookmarkURL,sBookmarkTitle)">here</a>');
document.write(' to add this to your favourites list.');
} else {
var msg = "You can bookmark this page. Please add this page to your bookmarks.";
if(bNavigator) msg += " Press (CTRL-D)";
document.write(msg);
}
}
function switchCheckBoxes(targets, source)
{
if (targets.length == null)
{
targets.checked = source.checked;
}
else
{
for (i=0; i<targets.length; i++)
{
targets[i].checked = source.checked;
}
}
}
function setLayerContent(layerName, parentLayerName, content)
{
if (document.layers)
{
layerString = getLayerString(layerName, parentLayerName);
eval(layerString + ".document.write('" + content + "')");
eval(layerString + ".document.close()");
}
else
{
layer = getLayer(layerName, parentLayerName);
layer.innerHTML = content;
}
}
function activateLayer(layerName, parentLayerName)
{
switchLayerVisibility(layerName, parentLayerName, "visible");
}
function deactivateLayer(layerName, parentLayerName)
{
switchLayerVisibility(layerName, parentLayerName, "hidden");
}
function switchLayerVisibility(layerName, parentLayerName, visibility)
{
if (document.layers)
{
evalString = getLayerString(layerName, parentLayerName) + ".visibility = '" + visibility + "'";
eval(evalString);
}
else
{
layer = getLayer(layerName, parentLayerName);
layer.style.visibility = visibility;
}
}
function getLayer(layerName, parentLayerName)
{
var layer;
if (document.layers)
{
}
else if (document.all)
{
layer = document.all[layerName];
}
else if (document.getElementById)
{
layer = document.getElementById(layerName);
}
return layer;
}
function getLayerString(layerName, parentLayerName)
{
if (document.layers)
{
layerString = "document.layers.";
if (parentLayerName)
{
layerString = layerString + parentLayerName + ".layers.";
}
layerString = layerString + layerName;
return layerString;
}
else
{
return;
}
}
function replace(string,text,by)
{
var strLength = string.length,
txtLength = text.length;
if ((strLength == 0) || (txtLength == 0)) return string;
var i = string.indexOf(text);
if ((!i) && (text != string.substring(0,txtLength)))
{
return string;
}
if (i == -1)
{
return string;
}
var newstr = string.substring(0,i) + by;
if (i+txtLength < strLength)
{
newstr += replace(string.substring(i+txtLength,strLength),text,by);
}
return newstr;
}

function today(){
rightnow= new Date();
themonth= rightnow.getMonth();
thedate= rightnow.getDate();
theyear= rightnow.getYear();
thehours= rightnow.getHours();
themins= rightnow.getMinutes();
theseconds= rightnow.getSeconds();

//themonth+=1;
somemonth= new Array (12)
somemonth[0]="Jan";
somemonth[1]="Feb";
somemonth[2]="Mar";
somemonth[3]="Apr";
somemonth[4]="May";
somemonth[5]="Jun";
somemonth[6]="Jul";
somemonth[7]="Aug";
somemonth[8]="Sep";
somemonth[9]="Oct";
somemonth[10]="Nov";
somemonth[11]="Dec";


if (theyear<2000)
theyear+=1900;

if (thehours == 12) {
   ampm = "PM";
  } else if (thehours > 12) {
  thehours-=12;
  ampm = "PM";
  } else {
  ampm = "AM";
  }
if (thehours == 0)
  thehours = 12;

if (themins<10)
themins="0"+themins;
if (theseconds<10)
theseconds="0"+theseconds;

nowmonth = themonth +1;
if (nowmonth<10)
nowmonth="0"+nowmonth;

if (thedate<10)
nowdate="0"+thedate;

}


