
dateString	= "";
var thisTab = "";
var alphaNumeric	= "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
var letters		= "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
var numbers		= "1234567890";


function getDateString() {
	dateString = "";
	var d=new Date();
	var weekday=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
	var monthname=new Array("January","February","March","April","May","June","July","August","September","October","November","December");
	dateString = dateString + weekday[d.getDay()] + " ";
	dateString = dateString + monthname[d.getMonth()] + " ";
	dateString = dateString + d.getDate() + ", ";
	dateString = dateString + d.getFullYear();
	var AMPM = "AM";
	var h = d.getHours();
	var m = d.getMinutes();
	var s = d.getSeconds();
	if (h > 12) {
		h = h - 12;
		AMPM = "PM";
	}
	if (h < 10)
		h = "0" + h;
	if (m < 10)
		m = "0" + m;
	if (s < 10)
		s = "0" + s;
	dateString = dateString + ". " + h + ":" + m + ":" + s + " " + AMPM;
	return dateString;
}

function mouseOver00(obj) {
	obj.style.color	= '#3f4a9c';
	obj.style.cursor= 'hand';
	obj.style.textDecoration = 'underline';
	obj.style.backgroundImage	= 'url(_images/top_button_on.jpg)';
}

function mouseOut00(obj) {
	obj.style.color	= '#3f4a9c';
	obj.style.textDecoration = 'none';
	obj.style.backgroundImage	= 'url(_images/top_button_off.jpg)';
}
function mouseOver00_orig(obj) {
	obj.bgColor		= 'green';
	obj.style.color	= 'white';
	if(obj != thisTab) {
		obj.style.color	= 'black';
		obj.style.cursor= 'hand';
	}
}

function mouseOut00_orig(obj) {
	if(obj != thisTab) {
		obj.bgColor		= '#60609B';
		obj.style.color	= 'white';
	}
}

function goTab00(obj) {
	if(thisTab == obj) {
		return false;
	} else {
		if(obj == tab001)
			goTaxHome();
		if(obj == tab002)
			location.href = "secureSearch.jsp";
		if(obj == tab003)
			location.href = "unSecSearch.jsp";
		if(obj == tab004)
			location.href = "queries.jsp";
		if(obj == tab005)
			location.href = "#";
		if(obj == tab006)
			location.href = "login.jsp";
	}
}
function mouseOver01(obj) {
	obj.bgColor		= '#60609B';
	obj.style.color	= '#d8d8e7';
	if(obj != thisTab) {
		obj.style.color	= 'white';
		obj.style.cursor= 'hand';
	}
}

function mouseOut01(obj) {
	if(obj != thisTab) {
		obj.bgColor		= '#d8d8e7';
		obj.style.color	= '#60609b';
	}
}

function goTab01(obj) {
	if(thisTab == obj) {
		return false;
	} else {
		if(obj == tab011)
			location.href = "#";
		if(obj == tab012)
			location.href = "#";
		if(obj == tab013)
			location.href = "#";
	}
}

function openPrintable(pageName) {
	var url = "pr_" + pageName;
	helpWindow=window.open(url,"WindowName","width=700,height=650,top=10,left=10,resizable=yes,scrollbars=yes,menubar=yes,toolbar=no,status=no,location=no")
}

function showSample(img) {
	var url = "sample.html#" + img;
	//helpWindow=window.open(url,"WindowName","width=500,height=250,top=10,left=10,resizable=yes,scrollbars=yes,menubar=no,toolbar=no,status=no,location=no")
	window.showModalDialog(url, "", ';dialogHeight=200px;dialogWidth=500px;edge:raised;status:no;help:no');
}

function alertXXX(msg) {
	msg = msg.replace(/\n/g, "<LI>");
	msg = "<OL><LI>" + msg;
	msg = msg + "ASDF"
	msg = msg.replace(/<LI>ASDF/g, "");
	msg = msg + "</OL>";
	window.showModalDialog('errMsg.html', msg, ';dialogHeight=300px;dialogWidth=600px;edge:raised;status:no;help:no');
}

//if (document.layers) {
	//document.captureEvents(Event.KEYPRESS);
//}
//document.onkeypress = getKey;

function getKey(keyStroke) {
	var keyCode = (document.layers) ? keyStroke.which : event.keyCode;
	var keyString = String.fromCharCode(keyCode).toLowerCase();
}

// Custom Alert box//

	// Padma's Change 
var browserName=navigator.appName; 

// constants to define the title of the alert and button text.
var ALERT_TITLE = "Oops!";
var ALERT_BUTTON_TEXT = "Ok";

// over-ride the alert method only if this a newer browser.
// Older browser will see standard alerts
if(document.getElementById) {
//	window.alert = function(txt) {
//		createCustomAlert(txt);
//	}
}

function createCustomAlert(txt) {
	// shortcut reference to the document object
	d = document;
	// if the modalContainer object already exists in the DOM, bail out.
	if(d.getElementById("modalContainer")) return;

	// create the modalContainer div as a child of the BODY element
	mObj = d.getElementsByTagName("body")[0].appendChild(d.createElement("div"));
	mObj.id = "modalContainer";
	 // make sure its as tall as it needs to be to overlay all the content on the page
	mObj.style.height = document.documentElement.scrollHeight + "px";

	// create the DIV that will be the alert 
	alertObj = mObj.appendChild(d.createElement("div"));
	alertObj.id = "alertBox";
	// MSIE doesnt treat position:fixed correctly, so this compensates for positioning the alert
	if(d.all && !window.opera) alertObj.style.top = document.documentElement.scrollTop + "px";
	// center the alert box
	alertObj.style.left = (d.documentElement.scrollWidth - alertObj.offsetWidth)/2 + "px";
	alertObj.style.borderWidth = "1px";
	alertObj.style.borderColor = "gray";
	// create an H1 element as the title bar
	h1 = alertObj.appendChild(d.createElement("h1"));
	h1.appendChild(d.createTextNode(ALERT_TITLE));
	h1.style.color= 'black';
	h1.style.backgroundColor = "silver";
	// create a paragraph element to contain the txt argument
	msg = alertObj.appendChild(d.createElement("p"));
	msg.innerHTML = "<font color=black size=2>" +  txt.split('\n').join('<br>') + "</font>";
	
	// create an anchor element to use as the confirmation button.
	btn = alertObj.appendChild(d.createElement("a"));
	btn.id = "closeBtn";
	btn.appendChild(d.createTextNode(ALERT_BUTTON_TEXT));
	btn.href = "#";
	btn.style.color= 'black';
	btn.style.backgroundColor = "gray";
	if (browserName=="Microsoft Internet Explorer")
 	{
		btn.style.left = "230px";
	}
	// set up the onclick event to remove the alert when the anchor is clicked
	btn.onclick = function() { removeCustomAlert();return false; }

	
}

// removes the custom alert from the DOM
function removeCustomAlert() {
	document.getElementsByTagName("body")[0].removeChild(document.getElementById("modalContainer"));
}
	
