// All Javascript
<!--
function popWindow(url,width,height,name) {
  popupWin = window.open(url,name,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=' + width + ',height=' + height);
}
function openWindow(url, name) {
  popupWin = window.open(url,name,'width=430,height=400,scrollbars=yes')
}

function popWindowScroll(url,width,height,name) {
  popupWin = window.open(url,name,'toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=' + width + ',height=' + height);
}

function popWindowLocation(url,width,height,name) {
  popupWin = window.open(url,name,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=' + width + ',height=' + height);
}

function popWindowNoResize(url,width,height,name) {
  popupWin = window.open(url,name,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=' + width + ',height=' + height);
}

function getHideElement(strElement,hideFlag){
	var a ;
	a = "document.all." + strElement.replace(/\,/g,".style.visibility = '" + hideFlag + "';document.all.") + ".style.visibility = '" + hideFlag + "'";	
	return a;	
}

function gotourl(strURL){
		window.location=strURL;
}

function ChangeStatusBar(strText){
		window.status=strText;
}

/* ----------------------------------------------- for events quick search ------------------------------------------------------- */
function setWeekDate( inpDay ) {
	var today, thisDay, nextWeek;
	today = new Date();
	thisDay = today.getDay();
		
	if( thisDay == inpDay ) {
		document.e_search.week_date.value = (today.getMonth() + 1) + "/" + today.getDate() + "/" + today.getYear();
	} else if( thisDay < inpDay ) {
		nextWeek = DateAdd( today, (inpDay - thisDay), 1, 0 );
		document.e_search.week_date.value = nextWeek.getMonth() + "/" + nextWeek.getDate() + "/" + nextWeek.getYear();
	} else {
		nextWeek = DateAdd( today, (7 - Math.abs((inpDay - thisDay))), 1, 0 );
		document.e_search.week_date.value = nextWeek.getMonth() + "/" + nextWeek.getDate() + "/" + nextWeek.getYear();
	}
	document.e_search.submit();
}
	
function DateAdd(startDate, numDays, numMonths, numYears)
{
	var returnDate = new Date(startDate.getTime());
	var yearsToAdd = numYears;
		
	var month = returnDate.getMonth()	+ numMonths;
	if (month > 11)
	{
		yearsToAdd = Math.floor((month+1)/12);
		month -= 12*yearsToAdd;
		yearsToAdd += numYears;
	}
	returnDate.setMonth(month);
	returnDate.setFullYear(returnDate.getFullYear()	+ yearsToAdd);
		
	returnDate.setTime(returnDate.getTime()+60000*60*24*numDays);
		
	return returnDate;	
}
	
function YearAdd(startDate, numYears)
{
		return DateAdd(startDate,0,0,numYears);
}
	
function MonthAdd(startDate, numMonths)
{
		return DateAdd(startDate,0,numMonths,0);
}
	
function DayAdd(startDate, numDays)
{
		return DateAdd(startDate,numDays,0,0);
}
/* ----------------------------------------------- end events quick search ------------------------------------------------------- */
//-->
