﻿var m_names = new Array("January", "February", "March",
	"April", "May", "June", "July", "August", "September",
	"October", "November", "December");

var d = new Date();
var currentDate = d.getDate();
var currentMonth = d.getMonth();
var currentMonthName = m_names[currentMonth];
var currentYear = d.getFullYear();

var theWidth, theHeight, minHeight;

/*
$(document).ready(function()
{

	//If the User resizes the window, adjust the #container height
	$(window).bind("resize", resizeWindow);
	function resizeWindow(e)
	{
		var newWindowHeight = $(window).height();
		$(".bodycontent").css("min-height", newWindowHeight);
		//resizeWin();
	}

});
*/

function setFooterCopyrightYear(objID)
{
	var obj = document.getElementById(objID);
	obj.innerHTML = "Copyright © " + currentYear + " Billhighway. All Rights Reserved.";
}

function getWindowDimensions()
{
	// Window dimensions: 
	if (window.innerWidth)
	{
		theWidth = window.innerWidth - 20;
	}
	else if (document.documentElement && document.documentElement.clientWidth)
	{
		theWidth = document.documentElement.clientWidth - 20;
	}
	else if (document.body)
	{
		theWidth = document.body.clientWidth - 20;
	}
	if (window.innerHeight)
	{
		theHeight = window.innerHeight;
	}
	else if (document.documentElement && document.documentElement.clientHeight)
	{
		theHeight = document.documentElement.clientHeight;
	}
	else if (document.body)
	{
		theHeight = document.body.clientHeight;
	}

	var path = document.location.href;
	var header;
	if (path.indexOf("?s=home") >= 0 || path.indexOf("?s=") < 0)
	{
		header = parseInt(315 + 109);
	}
	else
	{
		header = parseInt(229);
	}

	minHeight = theHeight - (68 + header + 148 + 100);
	
	//alert(minHeight + "\r\r" + theHeight + "\r\r" + removePixels);
}

function toggleTab(divName)
{
	obj = document.getElementById(divName);

	if (obj.className == "hidden")
	{
		obj.className = "visible";
	}
	else
	{
		obj.className = "hidden";
	}
}

function hideTab(divName)
{
	obj = document.getElementById(divName);
	obj.className = "hidden";
}

function displayWindow(theURL, winName, width, height, features) { //v3.1
	var window_width = width;
	var window_height = height;
	var newfeatures = features;
	var window_top = (screen.height - window_height) / 2;
	var window_left = (screen.width - window_width) / 2;
	newWindow = window.open('' + theURL + '', '' + winName + '', 'width=' + window_width + ',height=' + window_height + ',top=' + window_top + ',left=' + window_left + ',features=' + newfeatures + '');
	newWindow.focus();
}

function disableEnterKey(e)
{
    var key;

    if (window.event)
        key = window.event.keyCode;     //IE
    else
        key = e.which;     //firefox

    if (key == 13)
        return false;
    else
        return true;
}