function getURL(pageName) {window.location = pageName;}
function getConfirmation(pageName, confirmation) {if(confirm(confirmation)) {getURL(pageName);}return false;}
function setAction(formname, filename, confirmation){ if(confirmation == undefined) {document[formname]["action"]=filename;document[formname]["submit"]();}else {if(confirm(confirmation)) {document[formname]["action"]=filename;document[formname]["submit"]();}return false}} 
function validateSelection(formname,fieldname,errorMssg,filename,confirmation) {
var multiCheckbox = false;if (document[formname][fieldname]["length"] == undefined) {if (document[formname][fieldname]["checked"]) {multiCheckbox = true;}}else {for (i = 0; i < document[formname][fieldname]["length"]; i++) {if (document[formname][fieldname][i]["checked"])multiCheckbox = true; }}
if(!multiCheckbox) {alert(errorMssg);}else {setAction(formname, filename, confirmation)}}
function checkUncheckAll(nTrigger, nForm, nTarget) {var theForm = document[nForm][nTarget], n = 0;for(n=0; n<theForm.length;n++){if(theForm[n].disabled == false) {theForm[n].checked = nTrigger.checked;}}}
function browseDirectory(url) {url= '../dsp_moveFile.cfm';id = 'Directory';width = 600; height = 400;browseWin = window.open( url, id, 'toolbar=no,scrollbars=no,location=no,statusbar=no,menubar=no,resizable=yes,width=' + width + ',height=' + height + '' );browseWin.focus();return false;}
function setValue(element, value) {document.getElementById(element).value = value;}
function helpWin(url) {id = 'helpwindow';width = 800; height = 600; popup = window.open( url, id, 'toolbar=no,scrollbars=no,location=no,statusbar=no,menubar=no,resizable=yes,top=0,left=0,width=' + width + ',height=' + height + '' );popup.focus();return false;}
Date.prototype.getDateString = function(str){
var dnames = ['Sunday', 'Monday', 'Tuesday', 'Wednesday','Thursday', 'Friday', 'Saturday', 'Sunday'];
var mnames = ['January', 'February', 'March', 'April','May', 'June', 'July', 'August', 'September','October', 'November', 'December'];
str = str.replace('%day', dnames[this.getDay()]);
str = str.replace('%date', this.getDate());
str = str.replace('%month', mnames[this.getMonth()]);
str = str.replace('%year', this.getFullYear());
return str;
};
function getFormattedDate() {
var today = new Date();
var sentence = today.getDateString('%day,  %month %date, %year');
return sentence;
}

//This function sets alternate background color for all tableDetail tables

function tableruler()
{
 if (document.getElementById && document.createTextNode) {
	 
	var tables=document.getElementsByTagName('table');
	
	for (var i=0;i<tables.length;i++) {
		
		if(tables[i].className=='table-user') { 
	
			var trs=tables[i].getElementsByTagName('tr');
			
			for(var ii=1; ii < trs.length; ii++) {
				if(ii % 2 == 0) {
					for(n = 0; n < trs[ii].cells.length; n++) {
						trs[ii].cells[n].className = trs[ii].cells[n].className + " alt";
					}
				}else {
					
				}
			}
   }
  }
 }
}