<!--

//restore yellow form fields to white
if(window.attachEvent)
    window.attachEvent("onload",restoreStyles);

  function restoreStyles(){
    inputList = document.getElementsByTagName("INPUT");
    for(i=0;i<inputList.length;i++)
      inputList[i].style.backgroundColor = "";
    selectList = document.getElementsByTagName("SELECT");
    for(i=0;i<selectList.length;i++)
      selectList[i].style.backgroundColor = "";
  }
  
function clearText(thefield){
if (thefield.defaultValue==thefield.value)
thefield.value = ""
} 

//Calendar scripts
function popup(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
window.open(href, windowname, 'width=600, height=700, location=no, menubar=no, status=no, toolbar=no, scrollbars=yes, resizable=yes');

return false;
}

function competitionPopup(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
window.open(href, windowname, 'width=450, height=600, location=no, menubar=no, status=no, toolbar=no, scrollbars=yes, resizable=yes');

return false;
}

function dynamicPopup(mylink, windowname, openWidth, openHeight)
{
if (! window.focus)return true;
var href;
var details; 
details = "width="+openWidth+", height="+openHeight+", location=no, menubar=yes, status=no, toolbar=no, scrollbars=yes, resizable=yes";
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;

window.open(href, windowname, details);

return false;
} 

function fAddListItem(strDate) {
	var dl=document.testForm.dateList;
	dl.options[dl.options.length]=new Option(strDate,strDate);
}
function fRemoveListItem(strDate) {
	var dl=document.testForm.dateList;
	for (var i=0;i<dl.options.length;i++)
		if (strDate==dl.options[i].value) break;
	dl.options[i]=null;
}
// The above 2 functions are called from within the plugins1.js when adding dates into the selected ranges. We use them to add dates explicitly to the <select> list.
// These 2 have to be defined in the same page with the <select> tag, otherwise a bug of IE5.0 will prevent the list from getting new options. IE5.5+ doesn't have this bug.
// param strDate has a format of yyyy/mm/dd, you may modify this format in function fDateString in the plugins1.js

function submitByDates(fm) {	// construct the selected dates in the hidden form field allSelected
	fm.allSelected.value="";
	for (var i=0; i<fm.dateList.length; i++) {
		if (i>0) fm.allSelected.value+=",";
		fm.allSelected.value+=fm.dateList.options[i].value;
	}
	fm.action="index.php?page=fairAddTime";
	fm.submit(fm.allSelected.value); //alert(fm.allSelected.value); in your app you should call fm.submit() instead so that the allSelected.value can be submitted.
}

function submitByRanges(fm) {	// construct the selected date ranges in the hidden form field allSelected
	fm.allSelected.value="";
	for (var i=0; i<gfFlat._pds.length; i++) {
		var d0=new Date(gfFlat._pds[i][0]);
		var d1=new Date(gfFlat._pds[i][1]);
		fm.allSelected.value+="["+d0.getUTCFullYear()+"/"+(d0.getUTCMonth()+1)+"/"+d0.getUTCDate()
			+","
			+d1.getUTCFullYear()+"/"+(d1.getUTCMonth()+1)+"/"+d1.getUTCDate()+"]";
	}
	// fm.action="ByRange.php";
	alert(fm.allSelected.value); // in your app you should call fm.submit() instead so that the allSelected.value can be submitted.
	gfFlat.fClearAll();
	gfFlat.fRepaint();//return false;
}

function popWindow(url)
{
	newwindow=window.open(url,'name','height=300,width=450,left=200,top=150,resizable=yes,scrollbars=yes,toolbar=no,status=no');
 if (window.focus) {newwindow.focus()}
}
-->
