// TvdBerg: 2010.04.17 08:36 pm, adding a New window version of fCZU_GoToURL called fCZU_GoToURLNewWindow
// TvdBerg: 2010.04.10 03:43 am, added fCZU_searchSiteSearchSetResults
// TvdBerg: 2010.02.28 02:57 am, added fCZU_LandlineTelcheck
// TvdBerg: 2010.02.11 09:59 pm, adding fCZU_showOtheroption
// TvdBerg: 2010.01.23 01:49 am, adding fCZU_Emailcheck 
// TvdBerg: 2010.01.14 04:49 pm, adding  fCZU_CheckMSWordChars

// TvdBerg: 2010.02.11 09:59 pm, adding fCZU_showOtheroption
function fCZU_showOtheroption(aID) { 
  zThisSelectedValue=document.getElementById(aID).options[document.getElementById(aID).selectedIndex].value;
//  alert(zThisSelectedValue);
  zHasOtherOption="N";
  
  for (iOptionCount=0; iOptionCount<document.getElementById(aID).options.length; iOptionCount++){
    if (document.getElementById(aID).options[iOptionCount].value.toLowerCase()=="other") {
      zHasOtherOption=iOptionCount;
    }
  }
  zCurrStoredValue=document.getElementById(aID+"_Other").value;
  for (iOptionCount=0; iOptionCount<document.getElementById(aID).options.length; iOptionCount++){
    if (zCurrStoredValue.toLowerCase()==document.getElementById(aID).options[iOptionCount].value.toLowerCase() || zCurrStoredValue.toLowerCase()==document.getElementById(aID).options[iOptionCount].text.toLowerCase()) {
      zHasOtherOption="N";
    }
  }
//  alert(zHasOtherOption);
  if (zThisSelectedValue.toLowerCase()=="other") {
     document.getElementById("label_"+aID+"_Other").style.display="block";
     document.getElementById(aID+"_Other").style.display="block";
  }
  else {  
     if (zHasOtherOption!="N" && document.getElementById(aID+"_Other").value!="" && zThisSelectedValue=="") {
      document.getElementById(aID).selectedIndex=zHasOtherOption;
      document.getElementById("label_"+aID+"_Other").style.display="block";
      document.getElementById(aID+"_Other").style.display="block";
     }
     else {   
      document.getElementById("label_"+aID+"_Other").style.display="none";
      document.getElementById(aID+"_Other").style.display="none";
     }
  }
}
function fCZU_rawurlencode(str) {
// URL-encodes string
    str = (str+'').toString(); 
    return encodeURIComponent(str).replace(/!/g, '%21').replace(/'/g, '%27').replace(/\(/g, '%28').replace(/\)/g, '%29').replace(/\*/g, '%2A');
}

function fCZU_urldecode(str) {  
    var hash_map = {}, ret = str.toString(), unicodeStr='', hexEscStr='';
    
    var replacer = function (search, replace, str) {
        var tmp_arr = [];
        tmp_arr = str.split(search);
        return tmp_arr.join(replace);
  };
// The hash_map is identical to the one in urlencode.
    hash_map["'"]   = '%27';
    hash_map['(']   = '%28';
    hash_map[')']   = '%29';
    hash_map['*']   = '%2A';
    hash_map['~']   = '%7E';
    hash_map['!']   = '%21';
    hash_map['%20'] = '+';
    hash_map['\u00DC'] = '%DC';
    hash_map['\u00FC'] = '%FC';
    hash_map['\u00C4'] = '%D4';
    hash_map['\u00E4'] = '%E4';
    hash_map['\u00D6'] = '%D6';
    hash_map['\u00F6'] = '%F6';
    hash_map['\u00DF'] = '%DF';
    hash_map['\u20AC'] = '%80';
    hash_map['\u0081'] = '%81';
    hash_map['\u201A'] = '%82';
    hash_map['\u0192'] = '%83';
    hash_map['\u201E'] = '%84';
    hash_map['\u2026'] = '%85';
    hash_map['\u2020'] = '%86';
    hash_map['\u2021'] = '%87';
    hash_map['\u02C6'] = '%88';
    hash_map['\u2030'] = '%89';
    hash_map['\u0160'] = '%8A';
    hash_map['\u2039'] = '%8B';
    hash_map['\u0152'] = '%8C';
    hash_map['\u008D'] = '%8D';
    hash_map['\u017D'] = '%8E';
    hash_map['\u008F'] = '%8F';
    hash_map['\u0090'] = '%90';
    hash_map['\u2018'] = '%91';
    hash_map['\u2019'] = '%92';
    hash_map['\u201C'] = '%93';
    hash_map['\u201D'] = '%94';
    hash_map['\u2022'] = '%95';
    hash_map['\u2013'] = '%96';
    hash_map['\u2014'] = '%97';
    hash_map['\u02DC'] = '%98';
    hash_map['\u2122'] = '%99';
    hash_map['\u0161'] = '%9A';
    hash_map['\u203A'] = '%9B';
    hash_map['\u0153'] = '%9C';
    hash_map['\u009D'] = '%9D';
    hash_map['\u017E'] = '%9E';
    hash_map['\u0178'] = '%9F';
    hash_map['\u00C6'] = '%C3%86';
    hash_map['\u00D8'] = '%C3%98';
    hash_map['\u00C5'] = '%C3%85';

    for (unicodeStr in hash_map) {
        hexEscStr = hash_map[unicodeStr]; // Switch order when decoding
        ret = replacer(hexEscStr, unicodeStr, ret); // Custom replace. No regexing
    }
    
// End with decodeURIComponent, which most resembles PHP's encoding functions
    ret = decodeURIComponent(ret);

    return ret;
}


  function fCZU_CheckRequired(aFormObject,aValueString) {
    var zmyArr = new Array();
    
    zmyArr = aValueString.split("|"); 
    
    for(var zvaluecount=0;zvaluecount<zmyArr.length;zvaluecount++)
    {
        if (eval('aFormObject.'+zmyArr[zvaluecount]+'.value')=='') {
          zMessageLabel=document.getElementById('label_'+zmyArr[zvaluecount]).innerHTML;
          zErrorMessage='<li>'+zMessageLabel+' MUST be supplied.</li>';
          zError+=zErrorMessage;
        }
    } 

  }
// TvdBerg: 2010.01.14 04:49 pm, adding  fCZU_CheckMSWordChars

  function fCZU_CheckMSWordChars(aFormObject,aValueString) {
    var zmyArr = new Array();
    
    zmyArr = aValueString.split("|"); 
    
    for(var zvaluecount=0;zvaluecount<zmyArr.length;zvaluecount++)
    {
        if (eval('aFormObject.'+zmyArr[zvaluecount]+'.value')!='') {
          zThishaystack=eval('aFormObject.'+zmyArr[zvaluecount]+'.value');

          zThisIllegal='?xml';
          zposXML = zThishaystack.toLowerCase().indexOf(zThisIllegal.toLowerCase());
          zThisIllegal='<o:p>'; 
          zposOPOpen = zThishaystack.toLowerCase().indexOf(zThisIllegal.toLowerCase());
          zThisIllegal='</o:p>'; 
          zposOPClose = zThishaystack.toLowerCase().indexOf(zThisIllegal.toLowerCase());
          zThisIllegal='urn:schemas-microsoft-com'; 
          zposURN = zThishaystack.toLowerCase().indexOf(zThisIllegal.toLowerCase());
          zThisIllegal='/w:'; 
          zposWClose = zThishaystack.toLowerCase().indexOf(zThisIllegal.toLowerCase());


          if (zposXML==-1 && zposOPOpen==-1 && zposOPClose==-1 && zposURN==-1 && zposWClose==-1) {
          }
          else { 
            zMessageLabel=document.getElementById('label_'+zmyArr[zvaluecount]).innerHTML;
            zErrorMessage='<li>'+zMessageLabel+' Cannot contain illegal MS Word Characters, please use the Paste from Word icons in the editor to correctly re-paste content.</li>';
            zError+=zErrorMessage;
          }
        }
    }
  }

  function fCZU_ConfirmLoaderURL(aToURL,aRequest) {
    if (confirm(aRequest)) {
      if (window.frames && window.frames.LoaderFrame) {
        window.frames.LoaderFrame.location.href=aToURL;
      }
    }
  }

  function fCZU_GoToURL(aToURL) {
    document.location.href=aToURL;
  } 
// TvdBerg: 2010.04.17 08:36 pm, adding a New window version of fCZU_GoToURL called fCZU_GoToURLNewWindow
  function fCZU_GoToURLNewWindow(aToURL) {
    zNewWin = window.open(aToURL,'zNewWin','width=900,height=550,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=yes,resizable=yes');
     if(zNewWin) {
     }
     else {
        alert('We have detected that you are using popup blocking software.\nPlease try holding CTRL when clicking the link OR disable the pop-up blocker for this website.');
     }
  } 

  function fCZU_SetLoginCookies(aUsername,aPass) {
//    document.cookie="czusn="+aUsername; 
//    document.cookie="czpss="+aPass;

      var futdate = new Date();		//Get the current time and date
      var expdate = futdate.getTime();  //Get the milliseconds since Jan 1, 1970
      expdate += 18000*1000;  //expires in 5 hour(milliseconds)
      futdate.setTime(expdate);
      newLoginCookie="czusn="+aUsername+"; path=/;";	//Set the new cookie values up
      newLoginCookie += " expires=" + futdate.toGMTString();
      window.document.cookie=newLoginCookie; 

      newPassCookie="czpss="+aPass+"; path=/;";	//Set the new cookie values up
      newPassCookie += " expires=" + futdate.toGMTString();
      window.document.cookie=newPassCookie; 
  }
  function fCZU_SetFormErrors(aErrorMessage) {
          document.getElementById('ErrorMessage').innerHTML=aErrorMessage;
          document.getElementById('ErrorMessage').style.display="block";

          document.getElementById('SubmitButtonHolder').style.display = 'block';
          document.getElementById('SavingMessage').style.display = 'none';
  }

  function fCZU_SetMessagetoID(aIDMessage) {
          aIDArray=aIDMessage.split("|");
          aToID=aIDArray[0];
          aMessage=aIDArray[1];
          document.getElementById(aToID).innerHTML=aMessage;
          document.getElementById(aToID).style.display="block";

  }

  function fCZU_CheckRequiredRadio(aFormObject,aValue) {
    zLength=eval('aFormObject.'+aValue+'.length');
    zhasChecked="N";
    for (var i=0;i<zLength;i++) {
        if (eval('aFormObject.'+aValue+'['+i+'].checked')) {
          zhasChecked="Y";
        }
    }
    if (zhasChecked=="N") {
      zMessageLabel=document.getElementById('label_'+aValue).innerHTML;
      zErrorMessage='<li>'+zMessageLabel+' MUST be supplied.</li>';
      zError+=zErrorMessage;
    }
  }

  function fCZU_CheckAlphaNumeric(aFormObject,aValueString)
  {
    var zmyArr = new Array();    
    zmyArr = aValueString.split("|"); 
    
    for(var zvaluecount=0;zvaluecount<zmyArr.length;zvaluecount++)
    {
        zAlphaErrorMessage='';
      	znumaric = eval('aFormObject.'+zmyArr[zvaluecount]+'.value');
      	for(var j=0; j<znumaric.length; j++)
      	{
            zAlphaErrorMessage='';
      		  var alphaa = znumaric.charAt(j);
      		  var hh = alphaa.charCodeAt(0);
      		  if((hh > 47 && hh<58) || (hh > 64 && hh<91) || (hh > 96 && hh<123))
      		  {
      		  }
      		  else	{
              zMessageLabel=document.getElementById('label_'+zmyArr[zvaluecount]).innerHTML;
              zAlphaErrorMessage='<li>'+zMessageLabel+' MUST be letters and numbers only.</li>';
      		  }
        }
        if (zAlphaErrorMessage!='') {
          zError+=zAlphaErrorMessage; 
        }
     }
  }

  function fCZU_CheckNumeric(aFormObject,aValueString) {
      var strValidChars = "0123456789.-";       
      var zmyArr = new Array();    
      zmyArr = aValueString.split("|"); 
      
      for(var zvaluecount=0;zvaluecount<zmyArr.length;zvaluecount++)
      {
          zNumericErrorMessage='';
          strChar='';
          blnResult = true;

          strString= eval('aFormObject.'+zmyArr[zvaluecount]+'.value');
           for (i = 0; i < strString.length && blnResult == true; i++)  {
              strChar = strString.charAt(i);
                if (strValidChars.indexOf(strChar) == -1) {
                  blnResult = false;
                  zMessageLabel=document.getElementById('label_'+zmyArr[zvaluecount]).innerHTML;
                  zNumericErrorMessage='<li>'+zMessageLabel+' MUST be numbers only, no commas or spaces.</li>';
                }
           }
        if (zNumericErrorMessage!='') {
          zError+=zNumericErrorMessage; 
        }
      }
  }

// TvdBerg: 2010.01.23 01:49 am, adding fCZU_Emailcheck 

function fCZU_Emailcheck(aFormObject,aValueString) {
    var zmyArr = new Array();    
    zmyArr = aValueString.split("|"); 
    
  for(var zvaluecount=0;zvaluecount<zmyArr.length;zvaluecount++)
  {
      zEmailTestErrorMessage='';
    	str = eval('aFormObject.'+zmyArr[zvaluecount]+'.value');


		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
    zMessageLabel=document.getElementById('label_'+zmyArr[zvaluecount]).innerHTML;

		if (str.indexOf(at)==-1) {
      zEmailTestErrorMessage='<li>'+zMessageLabel+' MUST be a valid email format.</li>';
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
      zEmailTestErrorMessage='<li>'+zMessageLabel+' MUST be a valid email format.</li>';
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
      zEmailTestErrorMessage='<li>'+zMessageLabel+' MUST be a valid email format.</li>';
		}

		 if (str.indexOf(at,(lat+1))!=-1){
      zEmailTestErrorMessage='<li>'+zMessageLabel+' MUST be a valid email format.</li>';
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
      zEmailTestErrorMessage='<li>'+zMessageLabel+' MUST be a valid email format.</li>';
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
      zEmailTestErrorMessage='<li>'+zMessageLabel+' MUST be a valid email format.</li>';
		 }
		
		 if (str.indexOf(" ")!=-1){
      zEmailTestErrorMessage='<li>'+zMessageLabel+' MUST be a valid email format.</li>';
		 }

     if (zEmailTestErrorMessage!='') {
          zError+=zEmailTestErrorMessage; 
     }
  }					
}

function fCZU_LandlineTelcheck(aFormObject,aValueString) {

      var strValidChars = "0123456789 ()+";  
//       var strValidChars = "0123456789 -+";       
      var zmyArr = new Array();    
      zmyArr = aValueString.split("|"); 
      
      for(var zvaluecount=0;zvaluecount<zmyArr.length;zvaluecount++)
      {
          zNumericErrorMessage='';
          strChar='';
          blnResult = true;
          zMessageLabel=document.getElementById('label_'+zmyArr[zvaluecount]).innerHTML;
          strString= eval('aFormObject.'+zmyArr[zvaluecount]+'.value');
           for (i = 0; i < strString.length && blnResult == true; i++)  {
              strChar = strString.charAt(i);
                if (strValidChars.indexOf(strChar) == -1) {
                  blnResult = false; 
                  zNumericErrorMessage='<li>'+zMessageLabel+' must consist of only the country code (with the leading \'+\') followed directly with the (area code) and phone number (no dashes).<BR>For Example: if your country code is +27, area code is 011 and number is 555-5555, then the number you should enter is +27 (011) 555 5555.</li>';
                }
           }

          if (strString.length<11) {
            zNumericErrorMessage='<li>'+zMessageLabel+' has too few numbers, it must consist of only the country code (with the leading \'+\') followed directly with the (area code) and phone number (no dashes).<BR>For Example: if your country code is +27, area code is 011 and number is 555-5555, then the number you should enter is +27 (011) 555 5555.</li>';
          }
          if (strString.indexOf('+') == -1 || strString.indexOf('(') == -1 || strString.indexOf(')') == -1) {
            zNumericErrorMessage='<li>'+zMessageLabel+' appears to be missing either the country or area code, it must consist of only the country code (with the leading \'+\') followed directly with the (area code) and phone number (no dashes).<BR>For Example: if your country code is +27, area code is 011 and number is 555-5555, then the number you should enter is +27 (011) 555 5555.</li>';
          }
          if (zNumericErrorMessage!='') {
            zError+=zNumericErrorMessage; 
          }

      }
}

function fCZU_MobileTelcheck(aFormObject,aValueString) {

      var strValidChars = "0123456789";  
//       var strValidChars = "0123456789 -+";       
      var zmyArr = new Array();    
      zmyArr = aValueString.split("|"); 
      
      for(var zvaluecount=0;zvaluecount<zmyArr.length;zvaluecount++)
      {
          zNumericErrorMessage='';
          strChar='';
          blnResult = true;
          zMessageLabel=document.getElementById('label_'+zmyArr[zvaluecount]).innerHTML;
          strString= eval('aFormObject.'+zmyArr[zvaluecount]+'.value');
           for (i = 0; i < strString.length && blnResult == true; i++)  {
              strChar = strString.charAt(i);
                if (strValidChars.indexOf(strChar) == -1) {
                  blnResult = false; 
                  zNumericErrorMessage='<li>'+zMessageLabel+' must consist of only the country code (with no leading \'+\') followed directly with the mobile number without a leading \'0\' or any spaces.<BR>For Example: if your country code is +27 and mobile number is 082-555-5555, then the number you should enter is 27825555555.</li>';
                }
           }

          if (strString.length<11) {
            zNumericErrorMessage='<li>'+zMessageLabel+' has too few numbers, it must consist of the country code (with no leading \'+\') followed directly with the mobile number without a leading \'0\' or any spaces.<BR>For Example: if your country code is +27 and mobile number is 082-555-5555, then the number you should enter is 27825555555.</li>';
          }
          if (zNumericErrorMessage!='') {
            zError+=zNumericErrorMessage; 
          }
/*
      		var plus="+";
      		var minus="-";
      		if (strString.indexOf(plus)==-1 && strString.indexOf(minus)==-1){
            zError+='<li>'+zMessageLabel+' must be in International format.</li>';
      		}
*/
      }
}


  function fCZU_GoBack() {
    if(history.length>0) {
//      strURL = document.referrer;
//      if(strURL.indexOf(window.location.hostname) == -1) {
//        document.location.href='/';
//      }
//      else {
        if (document.location.href.indexOf("#") == -1) {
          history.go(-1); 
        }
        else {
          history.go(-2);
        }
//      }
    }
  }

function isTrue(aValue,aDefaultValue) {
  aDefaultValue = (typeof(aDefaultValue)=='undefined' ? false:aDefaultValue);
  if(typeof(aValue)=='undefined'||aValue==null) { return aDefaultValue; }
  var zVal = aValue.toString().toLowerCase();
  return ((zVal=='y'||zVal=='true'||zVal=='1') ? true:((zVal=='n'||zVal=='false'||zVal=='0') ? false:aDefaultValue));
}


function fCZU_Remove(zID) {
  zName=document.getElementById('Name_'+zID).innerHTML;
  var zquest = 'Are you sure you would like to remove "'+zName+'"?';
  if (confirm(zquest)) {
    document.getElementById('FrmRem').zSelectedID.value = zID;
    document.getElementById('FrmRem').submit();
  }
}


  function fCZU_xreplace(checkMe,toberep,repwith){
    var temp = checkMe;
    var i = temp.indexOf(toberep);
    while(i > -1) {

      temp = temp.replace(toberep, repwith);
        i = temp.indexOf(toberep, i + repwith.length + 1);
    }
    return temp;
  }


 function fCZU_PopulateList(Nav,aUpdateLength) { 
	var ua = navigator.userAgent.toLowerCase();
  if (ua.indexOf("msie") != -1) { 
	 isIE = 'Y';
  }
  else {
	 isIE = 'N';
  }  
  if (aUpdateLength=='Y'&&isIE=='N') {
   SelNameList.length=SelNameList.length+1;  
  }
  doc = eval('document.'+Nav+'FrmListForm.NavList');
   doc.length = 0;
  doc = eval('document.'+Nav+'FrmListForm.NavList');

   for (var i = 0 ; i < (eval('SelNameList.length -1')) ; i++){
    SL = doc.length;
    doc.length =  doc.length +1;

    doc.options[SL].text = eval('SelNameList[i]');
    doc.options[SL].value = eval('SelValueList[i]');
   }
   doc.selectedIndex = 0;
  }

 function fCZU_Apply(Nav) {
  doc = eval('document.'+Nav+'FrmListForm.'+Nav+'NavList');
  NewStr = '';
  for (var i = 0; i <doc.length; i++) {
   NewStr = NewStr + ',' + doc.options[i].value;
  }
  document.getElementById('FrmUpdateSort').inpUpdateString.value = NewStr;
  document.getElementById('FrmUpdateSort').inpSortCount.value = doc.length;
  document.getElementById('FrmUpdateSort').submit();
 } 


 function fCZU_submitform(FormName){
  eval('document.'+FormName+'.submit()');
 }

 function fCZU_MoveUp(Nav){
  doc = eval('document.'+Nav+'FrmListForm.'+Nav+'NavList');
  if (doc.selectedIndex == -1)
   alert('Please select an option to move.');
  else {
   NextIdx = doc.selectedIndex - 1;
   if (NextIdx > -1 ) {
    CurrIndex = doc.selectedIndex;
    CurrText = doc.options[NextIdx].text;
    CurrValue = doc.options[NextIdx].value;
    doc.options[NextIdx].text = doc.options[CurrIndex].text;
    doc.options[NextIdx].value = doc.options[CurrIndex].value;
    doc.options[CurrIndex].text = CurrText;
    doc.options[CurrIndex].value = CurrValue;
    doc.selectedIndex = NextIdx;
   }
  }
 }

 function fCZU_MoveDown(Nav){
  doc = eval('document.'+Nav+'FrmListForm.'+Nav+'NavList');
  if (doc.selectedIndex == -1)
   alert('Please select an option to move.');
  else {
   NextIdx = doc.selectedIndex + 1;
   if (NextIdx != doc.length) {
    CurrIndex = doc.selectedIndex;
    CurrText = doc.options[NextIdx].text;
    CurrValue = doc.options[NextIdx].value;
    doc.options[NextIdx].text = doc.options[CurrIndex].text;
    doc.options[NextIdx].value = doc.options[CurrIndex].value;
    doc.options[CurrIndex].text = CurrText;
    doc.options[CurrIndex].value = CurrValue;
    doc.selectedIndex = NextIdx;
   }
  }
 }

function fCZU_LoadBodyContentTo(aToID) {
  parent.document.getElementById(aToID).innerHTML=document.body.innerHTML;
}

/* CALENDAR */
var cal15 = new CalendarPopup();
cal15.setReturnFunction("setMultipleValues4");
function setMultipleValues4(y,m,d) {
	document.forms[0].date15_year.value=y;
	document.forms[0].date15_month.selectedIndex=m;
	for (var i=0; i<document.forms[0].date15_date.options.length; i++) {
		if (document.forms[0].date15_date.options[i].value==d) {
			document.forms[0].date15_date.selectedIndex=i;
			}
		}
	}
var cal16 = new CalendarPopup();
cal16.setReturnFunction("setMultipleValues5");
function setMultipleValues5(y,m,d) {
  document.forms[0].date16_year.value=y;
	document.forms[0].date16_month.selectedIndex=m;
	for (var i=0; i<document.forms[0].date16_date.options.length; i++) {
		if (document.forms[0].date16_date.options[i].value==d) {
			document.forms[0].date16_date.selectedIndex=i;
			}
		}
	}
function getDateString(y_obj,m_obj,d_obj) {
	var y = y_obj.options[y_obj.selectedIndex].value;
	var m = m_obj.options[m_obj.selectedIndex].value;
	var d = d_obj.options[d_obj.selectedIndex].value;
	if (y=="" || m=="") { return null; }
	if (d=="") { d=1; }
	return str= y+'-'+m+'-'+d;
	}


/* IMAGE GALLERY */

      var imgpickerclose =  new Image(); imgpickerclose.src = "../../czusys_images/btn_galleryclose.gif";
      var imgpickeropen =  new Image(); imgpickeropen.src = "../../czusys_images/btn_gallery.gif";
      var imgloading =  new Image(); imgloading.src = "../../czusys_images/loadingmessage.gif";

      function fCZU_ImgGallery_gallerypicker_open(aimg,aGalleryID) {
        if (document.getElementById('zgallerypickerdisplay_'+aGalleryID).style.display=='none') {
          document.getElementById('zgallerypickerdisplay_'+aGalleryID).style.display = 'block';
          document.getElementById('zmainimageholder_'+aGalleryID).style.display = 'none';
          aimg.style.backgroundImage="url("+imgpickerclose.src+")"; 
        }
        else {
          document.getElementById('zgallerypickerdisplay_'+aGalleryID).style.display = 'none';
          document.getElementById('zmainimageholder_'+aGalleryID).style.display = 'block';
//          aimg.src=imgpickeropen.src; 
          aimg.style.backgroundImage="url("+imgpickeropen.src+")"; 
        }
      }

	function fCZU_ImgGallery_fJumpTo(aIndexCount,aGalleryID) {  
    zthismainimage=eval('document.images.imgmain_'+aGalleryID);
	  zthismainimage.src=imgloading.src;

		zthisslideform=eval('document.slideForm_'+aGalleryID);
		if (zthisslideform.slide.length>0) {
			x=aIndexCount;
          		zimgid=zthisslideform.slide.options[x].value;
			zthisslideform.slide.selectedIndex=x;
			zimagesrc=zimgid;
			zimagename=zthisslideform.slide.options[x].id;

			zthismainimage.width=document.getElementById('largeimgwidth_'+aGalleryID).value;
			zthismainimage.src=zimagesrc;
			document.getElementById('zgallerypickerdisplay_'+aGalleryID).style.display = 'none';          
			document.getElementById('zmainimageholder_'+aGalleryID).style.display = 'block';	
//			document.getElementById('zpickerimg_'+aGalleryID).src=imgpickeropen.src;
      document.getElementById('zpickerimg_'+aGalleryID).style.backgroundImage="url("+imgpickeropen.src+")";
			document.getElementById('imgnamedisplay_'+aGalleryID).innerHTML = zimagename;


      zCaptionHolder = document.getElementById('zCaptionHolder_'+aGalleryID);
      var zspans = zCaptionHolder.getElementsByTagName('span');
      if (zspans.length>0) {
			   document.getElementById('imgcaptiondisplay_'+aGalleryID).innerHTML = zspans[aIndexCount].innerHTML;   
      }


		}

	}

      var x = 0;
      function fCZU_ImgGallery_rotate(num,aGalleryID){
        zthismainimage=eval('document.images.imgmain_'+aGalleryID);
	      zthismainimage.src=imgloading.src;

        zthisslideform=eval('document.slideForm_'+aGalleryID);
        if (zthisslideform.slide.length>0) {
          x=num%zthisslideform.slide.length;
          if(x<0){x=zthisslideform.slide.length-1};
          zimgid=zthisslideform.slide.options[x].value;
          zimagesrc=zimgid;
//          zthismainimage=eval('document.images.imgmain_'+aGalleryID);
          zthismainimage.width=document.getElementById('largeimgwidth_'+aGalleryID).value; 
          zimagename=zthisslideform.slide.options[x].id;
          zthismainimage.src=zimagesrc;
          document.getElementById('zmainimageholder_'+aGalleryID).style.display = 'block';
          document.getElementById('imgnamedisplay_'+aGalleryID).innerHTML = zimagename;

          zCaptionHolder = document.getElementById('zCaptionHolder_'+aGalleryID);
          var zspans = zCaptionHolder.getElementsByTagName('span');
          if (zspans.length>0) {
    			   document.getElementById('imgcaptiondisplay_'+aGalleryID).innerHTML = zspans[aIndexCount].innerHTML;   
          }

          zthisslideform.slide.selectedIndex=x;
       }

      }

      function fCZU_ImgGallery_apRotate(aGalleryID) {
        zthisslideform=eval('document.slideForm_'+aGalleryID);
        if(zthisslideform.slidebutton.value == "Stop") {
          fCZU_ImgGallery_rotate(++x);window.setTimeout("fCZU_ImgGallery_apRotate()", 2000);
        }
      }

      function fCZU_ImgGallery_image_open(aGalleryID, aJumpToIndex)
      {
        img = 'imgmain_'+aGalleryID;
        if (aJumpToIndex!="") {

            zthismainimage=eval('document.images.imgmain_'+aGalleryID);       
        		zthisslideform=eval('document.slideForm_'+aGalleryID);
        		if (zthisslideform.slide.length>0) {
        			x=aJumpToIndex;
              zimgid=zthisslideform.slide.options[x].value;
        			zthisslideform.slide.selectedIndex=x;
        			zimagesrc=zimgid;
        			zimagename=zthisslideform.slide.options[x].id;
        
        			zthismainimage.width=document.getElementById('largeimgwidth_'+aGalleryID).value;
        			zthismainimage.src=zimagesrc;   
        
        		}

        }
        image_loc = fCZU_xreplace(eval('document.images.'+img+'.src'),'/Img','/Full_Img');
        image_loc = fCZU_xreplace(image_loc,'/Full_ImgGal','/ImgGal')
        HTML = "<html><style>body{margin:0px 0px 0px 0px; background: #CCCCCC;}</style><body onBlur='top.close();' topmargin=0 bottommargin=0 leftmargin=0 rightmargin=0 marginheight=0><center><img src='"+ image_loc +"' border=0 name=load_image onLoad='window.resizeTo(document.load_image.width+10,document.load_image.height+80)'></center></body></html>";
        popupImage = window.open('','_pics','width=300px; height=300px; toolbar=no,scrollbars=no');
        popupImage.document.open();
        popupImage.document.write(HTML);
        popupImage.document.close();
      }

     top.zCZUSys_ImgGalleryplayerobject = '';




  function fCZU_searchSiteSearchSetResults(aSearchID,aIsSiteDefault) {
      zKeyword='';
      zlowercaselocation = document.location.href.toLowerCase();
      var zHasKeyword = zlowercaselocation.indexOf('zkeyword');
      if (zHasKeyword > -1) {
         zKeyword = document.location.href.substring(zHasKeyword+9);
      }
      zKeyword=fCZU_xreplace(zKeyword,'&BtnSubmit=Search','');
    if (aIsSiteDefault=="Y" && zKeyword!="") {
      if (document.getElementById("FrmSearch_SiteSearch_"+aSearchID)) {
        zForm=document.getElementById("FrmSearch_SiteSearch_"+aSearchID);
        zForm.zMess.value=fCZU_urldecode(zKeyword);
        zForm.submit();
      }

        if (document.getElementById("FrmSearch_SiteSearch")) {
          zForm=document.getElementById("FrmSearch_SiteSearch");
          zForm.zkeyword.value=fCZU_urldecode(zKeyword);
        }

    }
    else {
      document.getElementById("Search_SiteSearch_Results_"+aSearchID).innerHTML=document.getElementById("Search_SiteSearch_NoResults_"+aSearchID).innerHTML;
    }
  }


// JavaScript Document

// Script Source: Adapted from CodeLifter.com
// Copyright 2003

var popup_dragging = false;
var popup_target;
var popup_mouseX;
var popup_mouseY;
var popup_mouseposX;
var popup_mouseposY;
var popup_oldfunction;

function CheckIsIE() 
{ 
if (navigator.appName.toUpperCase() == 'MICROSOFT INTERNET EXPLORER') { return true;} 
else { return false; } 
} 

  function fpopreplace(checkMe,toberep,repwith){
    var temp = checkMe;
    var i = temp.indexOf(toberep);
    while(i > -1) {

      temp = temp.replace(toberep, repwith);
        i = temp.indexOf(toberep, i + repwith.length + 1);
    }
    return temp;
  }


function popup_mousedown(e)
{
  var ie = navigator.appName == "Microsoft Internet Explorer";

  popup_mouseposX = ie ? window.event.clientX : e.clientX;
  popup_mouseposY = ie ? window.event.clientY : e.clientY;
}

function popup_mousedown_window(e)
{
  var ie = navigator.appName == "Microsoft Internet Explorer";

  if ( ie && window.event.button != 1) return;
  if (!ie && e.button            != 0) return;

  popup_dragging = false;
  popup_target   = this['target'];
  popup_mouseX   = ie ? window.event.clientX : e.clientX;
  popup_mouseY   = ie ? window.event.clientY : e.clientY;

  if (ie)
       popup_oldfunction = document.onselectstart;
  else popup_oldfunction = document.onmousedown;

  if (ie)
       document.onselectstart = new Function("return false;");
  else document.onmousedown   = new Function("return false;");
}


function popup_mousemove(e)
{
  var ie      = navigator.appName == "Microsoft Internet Explorer";
  var element = document.getElementById(popup_target);
  var mouseX  = ie ? window.event.clientX : e.clientX;
  var mouseY  = ie ? window.event.clientY : e.clientY;

  if (!popup_dragging) return;

  element.style.left = (element.offsetLeft+mouseX-popup_mouseX)+'px';
  element.style.top  = (element.offsetTop +mouseY-popup_mouseY)+'px';

  popup_mouseX = ie ? window.event.clientX : e.clientX;
  popup_mouseY = ie ? window.event.clientY : e.clientY;
}

function popup_mouseup(e)
{
  var ie      = navigator.appName == "Microsoft Internet Explorer";
  var element = document.getElementById(popup_target);

  if (!popup_dragging) return;

  popup_dragging = false;

  if (ie)
       document.onselectstart = popup_oldfunction;
  else document.onmousedown   = popup_oldfunction;
}

function popup_exit()
{
  var ie      = navigator.appName == "Microsoft Internet Explorer";
  var element = document.getElementById('popup');
  var popcover      = document.getElementById('popcover');
  popcover.style.display='none';

//  popup_mouseup(e);
//  document.getElementById('OuterPageHolder').style.height="auto";
//  document.getElementById('OuterPageHolder').style.overflow="visible";
//  document.getElementById('NonPopMainContents').style.display="block";

  element.style.display = 'none';
}

function appendElement(node,tag,id,classname,htm) {
  var ne = document.createElement(tag);
  if(id) ne.id=id;
  if(classname) ne.className=classname;
  if(htm) ne.innerHTML = htm;
  node.appendChild(ne);
}


function popup_show(id, drag_id, exit_id, position, x, y, position_id, aframeurl)
{
  scroll(0,0);
/*
  if (document.getElementById(id)) {
    el = document.getElementById(id);
    el.innerHTML='';
    el.parentNode.removeChild(el);
  }

  if (document.getElementById('popcover')) {
    el = document.getElementById('popcover');
    el.parentNode.removeChild(el);
  }
*/

  if (document.getElementById('popcover')) {
  }
  else {  
        appendElement(document.body,'div','popcover','popcover','&nbsp;');
  }

        var popcover      = document.getElementById('popcover');
        popcover.onclick = popup_exit;
	      zBrowser=(navigator.userAgent).toUpperCase();

// hides share if its view message
      zlowercaselocation = aframeurl.toLowerCase();
  if (document.getElementById(id)) {

      if (CheckIsIE() == true) 
      { 
//        document.SubContentFrame.document.body.innerHTML='<span style="padding:30px;"> Loading...</span>'; 
      } 
      else 
      { 
//        window.frames.SubContentFrame.document.body.innerHTML='<span style="padding:30px;"> Loading...</span>'; 
      }

  }
  else {
	       if(zBrowser.indexOf('MSIE')!=-1||zBrowser.indexOf('NETSCAPE')!=-1||zBrowser.indexOf('SAFARI')!=-1||zBrowser.indexOf('FIRE')!=-1||zBrowser.indexOf('CAMINO')!=-1){

          appendElement(document.body,'div','popup','popup','<table width="890" cellpadding="0" cellspacing="0" border="0"><tr valign="bottom"><td align="right" class="PopMenu"><span class="PopCloseBtn"><a href="JavaScript:popup_exit();" alt="Close this Pop-up Window" title="Close this Pop-up Window">close</a></span></td></tr></table><table width="890" cellpadding="0" cellspacing="0" border="0"><tr valign="bottom"><td align="right" class="PopMenuFrameHolder"><IFRAME NAME="SubContentFrame" ID="SubContentFrame" WIDTH="886" HEIGHT="475" SRC="about:blank" SCROLLING=N ALIGN="CENTER" NORESIZE frameborder=0 marginheight=0 marginwidth=0></IFRAME></td></tr></table>');
	       }
	       else{
          appendElement(document.body,'div','popup','popup','<table width="890" cellpadding="0" cellspacing="0" border="0"><tr valign="bottom"><td align="right" class="PopMenu"><span class="PopCloseBtn"><a href="JavaScript:popup_exit();" alt="Close this Pop-up Window" title="Close this Pop-up Window">close</a></span></td></tr></table><table width="890" cellpadding="0" cellspacing="0" border="0"><tr valign="bottom"><td align="right" class="PopMenuFrameHolder"><LAYER ID="SubContentFrame" NAME="SubContentFrame" SRC="about:blank" WIDTH="886" HEIGHT="475" frameborder=0 marginheight=0 marginwidth=0 ALIGN="CENTER" scrolling=N></LAYER></td></tr></table>');
	       }

  }

  var element      = document.getElementById(id);
//  var drag_element = document.getElementById(drag_id);
//  var exit_element = document.getElementById(exit_id);
//  var popcover      = document.getElementById('popcover');

  var width        = window.innerWidth  ? window.innerWidth  : document.body.clientWidth;
  var height       = window.innerHeight ? window.innerHeight : document.body.clientHeight;

  popcover.style.position='absolute';
  popcover.style.display='block';
  popcover.style.top='0px';
  popcover.style.left='0px';
  popcover.style.width='100%';


  if(zBrowser.indexOf('MSIE')!=-1) {
//    popcover.style.height='100%';
//    alert(document.body.clientHeight);
//   alert(window.innerHeight);
//    alert(document.body.scrollHeight);
    popcover.style.height=document.body.scrollHeight;
  }
  else {
    popcover.style.height=document.body.scrollHeight;
  }

//    popcover.style.height="500px";


  element.style.position = "absolute";
  element.style.display  = "block";

  if (position == "element" || position == "element-right" || position == "element-bottom")
  {
    var position_element = document.getElementById(position_id);

    for (var p = position_element; p; p = p.offsetParent)
      if (p.style.position != 'absolute')
      {
        x += p.offsetLeft;
        y += p.offsetTop;
      }

    if (position == "element-right" ) x += position_element.clientWidth;
    if (position == "element-bottom") y += position_element.clientHeight;

    element.style.left = x+'px';
    element.style.top  = y+'px';
  }

  if (position == "screen-center")
  {
    x=x-8;
    element.style.left = (document.body.scrollLeft+(width -element.clientWidth )/2+x)+'px';
//    element.style.top  = (document.body.scrollTop +(height-element.clientHeight)/2+y)+'px';
//    if ((document.body.scrollTop +(height-element.clientHeight)/2+y)<0) {
//      element.style.top='0px';
//    }

    if ((document.body.scrollLeft+(width -element.clientWidth )/2+x)<0) {
      element.style.left='0px';
    }
    element.style.top='96px';
  }

//  drag_element['target']   = id;
//  drag_element.onmousedown = popup_mousedown_window;

//  exit_element.onclick     = popup_exit;

//  alert(document.body.scrollHeight);
//  document.getElementById('OuterPageHolder').style.height="100px";
//  document.getElementById('OuterPageHolder').style.overflow="hidden";
//  document.getElementById('NonPopMainContents').style.display="none";
//  alert(document.body.scrollHeight);

    var newDate = new Date;
    zUn=newDate.getTime();
  aframeurl=aframeurl+"&Un="+zUn;
  document.getElementById('SubContentFrame').src=aframeurl;


}


function fpopWindow(aurl) {
  zBrowser=(navigator.userAgent).toUpperCase();
  zPlatform=(navigator.platform).toUpperCase();
  if (zBrowser.indexOf('MSIE')!=-1 && zPlatform.indexOf('MAC')!=-1) {
      alert('Mac Internet Explorer is no longer supported. Please upgrade your browser to use Mozilla Firefox.');
//	  window.open(aurl, "_popup", "width=800,height=500,scrollbars=yes,scrollbar=yes,address=no");	
  }
  else {
    popup_show('popup', 'popup_drag', 'popup_exit', 'screen-center',0,0,'', aurl);
  }
}

function fResizeOuterPopFrame(aPopBodyHeight) {
/*
  parent.scroll(0,0);
  parent.document.getElementById('SubContentFrame').height=100+aPopBodyHeight;
  parent.document.getElementById('SubContentFrame').style.height=100+aPopBodyHeight;
  document.body.style.overflowY="hidden";
//  alert(parent.document.getElementById('SubContentFrame').style.height); 
*/ 
}
// ===================================================================
// Author: Matt Kruse <matt@mattkruse.com>
// WWW: http://www.mattkruse.com/
//
// NOTICE: You may use this code for any purpose, commercial or
// private, without any further permission from the author. You may
// remove this notice from your final code if you wish, however it is
// appreciated by the author if at least my web site address is kept.
//
// You may *NOT* re-distribute this code in any way except through its
// use. That means, you can include it in your product, or your web
// site, or any other form where the code is actually being used. You
// may not put the plain javascript up on your site for download or
// include it in your javascript libraries for download. 
// If you wish to share this code with others, please just point them
// to the URL instead.
// Please DO NOT link directly to my .js files from your site. Copy
// the files to your server and use them there. Thank you.
// ===================================================================


/* SOURCE FILE: AnchorPosition.js */

/* 
AnchorPosition.js
Author: Matt Kruse
Last modified: 10/11/02

DESCRIPTION: These functions find the position of an <A> tag in a document,
so other elements can be positioned relative to it.

COMPATABILITY: Netscape 4.x,6.x,Mozilla, IE 5.x,6.x on Windows. Some small
positioning errors - usually with Window positioning - occur on the 
Macintosh platform.

FUNCTIONS:
getAnchorPosition(anchorname)
  Returns an Object() having .x and .y properties of the pixel coordinates
  of the upper-left corner of the anchor. Position is relative to the PAGE.

getAnchorWindowPosition(anchorname)
  Returns an Object() having .x and .y properties of the pixel coordinates
  of the upper-left corner of the anchor, relative to the WHOLE SCREEN.

NOTES:

1) For popping up separate browser windows, use getAnchorWindowPosition. 
   Otherwise, use getAnchorPosition

2) Your anchor tag MUST contain both NAME and ID attributes which are the 
   same. For example:
   <A NAME="test" ID="test"> </A>

3) There must be at least a space between <A> </A> for IE5.5 to see the 
   anchor tag correctly. Do not do <A></A> with no space.
*/ 

// getAnchorPosition(anchorname)
//   This function returns an object having .x and .y properties which are the coordinates
//   of the named anchor, relative to the page.
function getAnchorPosition(anchorname) {
	// This function will return an Object with x and y properties
	var useWindow=false;
	var coordinates=new Object();
	var x=0,y=0;
	// Browser capability sniffing
	var use_gebi=false, use_css=false, use_layers=false;
	if (document.getElementById) { use_gebi=true; }
	else if (document.all) { use_css=true; }
	else if (document.layers) { use_layers=true; }
	// Logic to find position
 	if (use_gebi && document.all) {
		x=AnchorPosition_getPageOffsetLeft(document.all[anchorname]);
		y=AnchorPosition_getPageOffsetTop(document.all[anchorname]);
		}
	else if (use_gebi) {
		var o=document.getElementById(anchorname);
		x=AnchorPosition_getPageOffsetLeft(o);
		y=AnchorPosition_getPageOffsetTop(o);
		}
 	else if (use_css) {
		x=AnchorPosition_getPageOffsetLeft(document.all[anchorname]);
		y=AnchorPosition_getPageOffsetTop(document.all[anchorname]);
		}
	else if (use_layers) {
		var found=0;
		for (var i=0; i<document.anchors.length; i++) {
			if (document.anchors[i].name==anchorname) { found=1; break; }
			}
		if (found==0) {
			coordinates.x=0; coordinates.y=0; return coordinates;
			}
		x=document.anchors[i].x;
		y=document.anchors[i].y;
		}
	else {
		coordinates.x=0; coordinates.y=0; return coordinates;
		}
	coordinates.x=x;
	coordinates.y=y;
	return coordinates;
	}

// getAnchorWindowPosition(anchorname)
//   This function returns an object having .x and .y properties which are the coordinates
//   of the named anchor, relative to the window
function getAnchorWindowPosition(anchorname) {
	var coordinates=getAnchorPosition(anchorname);
	var x=0;
	var y=0;
	if (document.getElementById) {
		if (isNaN(window.screenX)) {
			x=coordinates.x-document.body.scrollLeft+window.screenLeft;
			y=coordinates.y-document.body.scrollTop+window.screenTop;
			}
		else {
			x=coordinates.x+window.screenX+(window.outerWidth-window.innerWidth)-window.pageXOffset;
			y=coordinates.y+window.screenY+(window.outerHeight-24-window.innerHeight)-window.pageYOffset;
			}
		}
	else if (document.all) {
		x=coordinates.x-document.body.scrollLeft+window.screenLeft;
		y=coordinates.y-document.body.scrollTop+window.screenTop;
		}
	else if (document.layers) {
		x=coordinates.x+window.screenX+(window.outerWidth-window.innerWidth)-window.pageXOffset;
		y=coordinates.y+window.screenY+(window.outerHeight-24-window.innerHeight)-window.pageYOffset;
		}
	coordinates.x=x;
	coordinates.y=y;
	return coordinates;
	}

// Functions for IE to get position of an object
function AnchorPosition_getPageOffsetLeft (el) {
	var ol=el.offsetLeft;
	while ((el=el.offsetParent) != null) { ol += el.offsetLeft; }
	return ol;
	}
function AnchorPosition_getWindowOffsetLeft (el) {
	return AnchorPosition_getPageOffsetLeft(el)-document.body.scrollLeft;
	}	
function AnchorPosition_getPageOffsetTop (el) {
	var ot=el.offsetTop;
	while((el=el.offsetParent) != null) { ot += el.offsetTop; }
	return ot;
	}
function AnchorPosition_getWindowOffsetTop (el) {
	return AnchorPosition_getPageOffsetTop(el)-document.body.scrollTop;
	}

/* SOURCE FILE: date.js */

// HISTORY
// ------------------------------------------------------------------
// May 17, 2003: Fixed bug in parseDate() for dates <1970
// March 11, 2003: Added parseDate() function
// March 11, 2003: Added "NNN" formatting option. Doesn't match up
//                 perfectly with SimpleDateFormat formats, but 
//                 backwards-compatability was required.

// ------------------------------------------------------------------
// These functions use the same 'format' strings as the 
// java.text.SimpleDateFormat class, with minor exceptions.
// The format string consists of the following abbreviations:
// 
// Field        | Full Form          | Short Form
// -------------+--------------------+-----------------------
// Year         | yyyy (4 digits)    | yy (2 digits), y (2 or 4 digits)
// Month        | MMM (name or abbr.)| MM (2 digits), M (1 or 2 digits)
//              | NNN (abbr.)        |
// Day of Month | dd (2 digits)      | d (1 or 2 digits)
// Day of Week  | EE (name)          | E (abbr)
// Hour (1-12)  | hh (2 digits)      | h (1 or 2 digits)
// Hour (0-23)  | HH (2 digits)      | H (1 or 2 digits)
// Hour (0-11)  | KK (2 digits)      | K (1 or 2 digits)
// Hour (1-24)  | kk (2 digits)      | k (1 or 2 digits)
// Minute       | mm (2 digits)      | m (1 or 2 digits)
// Second       | ss (2 digits)      | s (1 or 2 digits)
// AM/PM        | a                  |
//
// NOTE THE DIFFERENCE BETWEEN MM and mm! Month=MM, not mm!
// Examples:
//  "MMM d, y" matches: January 01, 2000
//                      Dec 1, 1900
//                      Nov 20, 00
//  "M/d/yy"   matches: 01/20/00
//                      9/2/00
//  "MMM dd, yyyy hh:mm:ssa" matches: "January 01, 2000 12:30:45AM"
// ------------------------------------------------------------------

var MONTH_NAMES=new Array('January','February','March','April','May','June','July','August','September','October','November','December','Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');
var DAY_NAMES=new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sun','Mon','Tue','Wed','Thu','Fri','Sat');
function LZ(x) {return(x<0||x>9?"":"0")+x}

// ------------------------------------------------------------------
// isDate ( date_string, format_string )
// Returns true if date string matches format of format string and
// is a valid date. Else returns false.
// It is recommended that you trim whitespace around the value before
// passing it to this function, as whitespace is NOT ignored!
// ------------------------------------------------------------------
function isDate(val,format) {
	var date=getDateFromFormat(val,format);
	if (date==0) { return false; }
	return true;
	}

// -------------------------------------------------------------------
// compareDates(date1,date1format,date2,date2format)
//   Compare two date strings to see which is greater.
//   Returns:
//   1 if date1 is greater than date2
//   0 if date2 is greater than date1 of if they are the same
//  -1 if either of the dates is in an invalid format
// -------------------------------------------------------------------
function compareDates(date1,dateformat1,date2,dateformat2) {
	var d1=getDateFromFormat(date1,dateformat1);
	var d2=getDateFromFormat(date2,dateformat2);
	if (d1==0 || d2==0) {
		return -1;
		}
	else if (d1 > d2) {
		return 1;
		}
	return 0;
	}

// ------------------------------------------------------------------
// formatDate (date_object, format)
// Returns a date in the output format specified.
// The format string uses the same abbreviations as in getDateFromFormat()
// ------------------------------------------------------------------
function formatDate(date,format) {
	format=format+"";
	var result="";
	var i_format=0;
	var c="";
	var token="";
	var y=date.getYear()+"";
	var M=date.getMonth()+1;
	var d=date.getDate();
	var E=date.getDay();
	var H=date.getHours();
	var m=date.getMinutes();
	var s=date.getSeconds();
	var yyyy,yy,MMM,MM,dd,hh,h,mm,ss,ampm,HH,H,KK,K,kk,k;
	// Convert real date parts into formatted versions
	var value=new Object();
	if (y.length < 4) {y=""+(y-0+1900);}
	value["y"]=""+y;
	value["yyyy"]=y;
	value["yy"]=y.substring(2,4);
	value["M"]=M;
	value["MM"]=LZ(M);
	value["MMM"]=MONTH_NAMES[M-1];
	value["NNN"]=MONTH_NAMES[M+11];
	value["d"]=d;
	value["dd"]=LZ(d);
	value["E"]=DAY_NAMES[E+7];
	value["EE"]=DAY_NAMES[E];
	value["H"]=H;
	value["HH"]=LZ(H);
	if (H==0){value["h"]=12;}
	else if (H>12){value["h"]=H-12;}
	else {value["h"]=H;}
	value["hh"]=LZ(value["h"]);
	if (H>11){value["K"]=H-12;} else {value["K"]=H;}
	value["k"]=H+1;
	value["KK"]=LZ(value["K"]);
	value["kk"]=LZ(value["k"]);
	if (H > 11) { value["a"]="PM"; }
	else { value["a"]="AM"; }
	value["m"]=m;
	value["mm"]=LZ(m);
	value["s"]=s;
	value["ss"]=LZ(s);
	while (i_format < format.length) {
		c=format.charAt(i_format);
		token="";
		while ((format.charAt(i_format)==c) && (i_format < format.length)) {
			token += format.charAt(i_format++);
			}
		if (value[token] != null) { result=result + value[token]; }
		else { result=result + token; }
		}
	return result;
	}
	
// ------------------------------------------------------------------
// Utility functions for parsing in getDateFromFormat()
// ------------------------------------------------------------------
function _isInteger(val) {
	var digits="1234567890";
	for (var i=0; i < val.length; i++) {
		if (digits.indexOf(val.charAt(i))==-1) { return false; }
		}
	return true;
	}
function _getInt(str,i,minlength,maxlength) {
	for (var x=maxlength; x>=minlength; x--) {
		var token=str.substring(i,i+x);
		if (token.length < minlength) { return null; }
		if (_isInteger(token)) { return token; }
		}
	return null;
	}
	
// ------------------------------------------------------------------
// getDateFromFormat( date_string , format_string )
//
// This function takes a date string and a format string. It matches
// If the date string matches the format string, it returns the 
// getTime() of the date. If it does not match, it returns 0.
// ------------------------------------------------------------------
function getDateFromFormat(val,format) {
	val=val+"";
	format=format+"";
	var i_val=0;
	var i_format=0;
	var c="";
	var token="";
	var token2="";
	var x,y;
	var now=new Date();
	var year=now.getYear();
	var month=now.getMonth()+1;
	var date=1;
	var hh=now.getHours();
	var mm=now.getMinutes();
	var ss=now.getSeconds();
	var ampm="";
	
	while (i_format < format.length) {
		// Get next token from format string
		c=format.charAt(i_format);
		token="";
		while ((format.charAt(i_format)==c) && (i_format < format.length)) {
			token += format.charAt(i_format++);
			}
		// Extract contents of value based on format token
		if (token=="yyyy" || token=="yy" || token=="y") {
			if (token=="yyyy") { x=4;y=4; }
			if (token=="yy")   { x=2;y=2; }
			if (token=="y")    { x=2;y=4; }
			year=_getInt(val,i_val,x,y);
			if (year==null) { return 0; }
			i_val += year.length;
			if (year.length==2) {
				if (year > 70) { year=1900+(year-0); }
				else { year=2000+(year-0); }
				}
			}
		else if (token=="MMM"||token=="NNN"){
			month=0;
			for (var i=0; i<MONTH_NAMES.length; i++) {
				var month_name=MONTH_NAMES[i];
				if (val.substring(i_val,i_val+month_name.length).toLowerCase()==month_name.toLowerCase()) {
					if (token=="MMM"||(token=="NNN"&&i>11)) {
						month=i+1;
						if (month>12) { month -= 12; }
						i_val += month_name.length;
						break;
						}
					}
				}
			if ((month < 1)||(month>12)){return 0;}
			}
		else if (token=="EE"||token=="E"){
			for (var i=0; i<DAY_NAMES.length; i++) {
				var day_name=DAY_NAMES[i];
				if (val.substring(i_val,i_val+day_name.length).toLowerCase()==day_name.toLowerCase()) {
					i_val += day_name.length;
					break;
					}
				}
			}
		else if (token=="MM"||token=="M") {
			month=_getInt(val,i_val,token.length,2);
			if(month==null||(month<1)||(month>12)){return 0;}
			i_val+=month.length;}
		else if (token=="dd"||token=="d") {
			date=_getInt(val,i_val,token.length,2);
			if(date==null||(date<1)||(date>31)){return 0;}
			i_val+=date.length;}
		else if (token=="hh"||token=="h") {
			hh=_getInt(val,i_val,token.length,2);
			if(hh==null||(hh<1)||(hh>12)){return 0;}
			i_val+=hh.length;}
		else if (token=="HH"||token=="H") {
			hh=_getInt(val,i_val,token.length,2);
			if(hh==null||(hh<0)||(hh>23)){return 0;}
			i_val+=hh.length;}
		else if (token=="KK"||token=="K") {
			hh=_getInt(val,i_val,token.length,2);
			if(hh==null||(hh<0)||(hh>11)){return 0;}
			i_val+=hh.length;}
		else if (token=="kk"||token=="k") {
			hh=_getInt(val,i_val,token.length,2);
			if(hh==null||(hh<1)||(hh>24)){return 0;}
			i_val+=hh.length;hh--;}
		else if (token=="mm"||token=="m") {
			mm=_getInt(val,i_val,token.length,2);
			if(mm==null||(mm<0)||(mm>59)){return 0;}
			i_val+=mm.length;}
		else if (token=="ss"||token=="s") {
			ss=_getInt(val,i_val,token.length,2);
			if(ss==null||(ss<0)||(ss>59)){return 0;}
			i_val+=ss.length;}
		else if (token=="a") {
			if (val.substring(i_val,i_val+2).toLowerCase()=="am") {ampm="AM";}
			else if (val.substring(i_val,i_val+2).toLowerCase()=="pm") {ampm="PM";}
			else {return 0;}
			i_val+=2;}
		else {
			if (val.substring(i_val,i_val+token.length)!=token) {return 0;}
			else {i_val+=token.length;}
			}
		}
	// If there are any trailing characters left in the value, it doesn't match
	if (i_val != val.length) { return 0; }
	// Is date valid for month?
	if (month==2) {
		// Check for leap year
		if ( ( (year%4==0)&&(year%100 != 0) ) || (year%400==0) ) { // leap year
			if (date > 29){ return 0; }
			}
		else { if (date > 28) { return 0; } }
		}
	if ((month==4)||(month==6)||(month==9)||(month==11)) {
		if (date > 30) { return 0; }
		}
	// Correct hours value
	if (hh<12 && ampm=="PM") { hh=hh-0+12; }
	else if (hh>11 && ampm=="AM") { hh-=12; }
	var newdate=new Date(year,month-1,date,hh,mm,ss);
	return newdate.getTime();
	}

// ------------------------------------------------------------------
// parseDate( date_string [, prefer_euro_format] )
//
// This function takes a date string and tries to match it to a
// number of possible date formats to get the value. It will try to
// match against the following international formats, in this order:
// y-M-d   MMM d, y   MMM d,y   y-MMM-d   d-MMM-y  MMM d
// M/d/y   M-d-y      M.d.y     MMM-d     M/d      M-d
// d/M/y   d-M-y      d.M.y     d-MMM     d/M      d-M
// A second argument may be passed to instruct the method to search
// for formats like d/M/y (european format) before M/d/y (American).
// Returns a Date object or null if no patterns match.
// ------------------------------------------------------------------
function parseDate(val) {
	var preferEuro=(arguments.length==2)?arguments[1]:false;
	generalFormats=new Array('y-M-d','MMM d, y','MMM d,y','y-MMM-d','d-MMM-y','MMM d');
	monthFirst=new Array('M/d/y','M-d-y','M.d.y','MMM-d','M/d','M-d');
	dateFirst =new Array('d/M/y','d-M-y','d.M.y','d-MMM','d/M','d-M');
	var checkList=new Array('generalFormats',preferEuro?'dateFirst':'monthFirst',preferEuro?'monthFirst':'dateFirst');
	var d=null;
	for (var i=0; i<checkList.length; i++) {
		var l=window[checkList[i]];
		for (var j=0; j<l.length; j++) {
			d=getDateFromFormat(val,l[j]);
			if (d!=0) { return new Date(d); }
			}
		}
	return null;
	}

/* SOURCE FILE: PopupWindow.js */

/* 
PopupWindow.js
Author: Matt Kruse
Last modified: 02/16/04

DESCRIPTION: This object allows you to easily and quickly popup a window
in a certain place. The window can either be a DIV or a separate browser
window.

COMPATABILITY: Works with Netscape 4.x, 6.x, IE 5.x on Windows. Some small
positioning errors - usually with Window positioning - occur on the 
Macintosh platform. Due to bugs in Netscape 4.x, populating the popup 
window with <STYLE> tags may cause errors.

USAGE:
// Create an object for a WINDOW popup
var win = new PopupWindow(); 

// Create an object for a DIV window using the DIV named 'mydiv'
var win = new PopupWindow('mydiv'); 

// Set the window to automatically hide itself when the user clicks 
// anywhere else on the page except the popup
win.autoHide(); 

// Show the window relative to the anchor name passed in
win.showPopup(anchorname);

// Hide the popup
win.hidePopup();

// Set the size of the popup window (only applies to WINDOW popups
win.setSize(width,height);

// Populate the contents of the popup window that will be shown. If you 
// change the contents while it is displayed, you will need to refresh()
win.populate(string);

// set the URL of the window, rather than populating its contents
// manually
win.setUrl("http://www.site.com/");

// Refresh the contents of the popup
win.refresh();

// Specify how many pixels to the right of the anchor the popup will appear
win.offsetX = 50;

// Specify how many pixels below the anchor the popup will appear
win.offsetY = 100;

NOTES:
1) Requires the functions in AnchorPosition.js

2) Your anchor tag MUST contain both NAME and ID attributes which are the 
   same. For example:
   <A NAME="test" ID="test"> </A>

3) There must be at least a space between <A> </A> for IE5.5 to see the 
   anchor tag correctly. Do not do <A></A> with no space.

4) When a PopupWindow object is created, a handler for 'onmouseup' is
   attached to any event handler you may have already defined. Do NOT define
   an event handler for 'onmouseup' after you define a PopupWindow object or
   the autoHide() will not work correctly.
*/ 

// Set the position of the popup window based on the anchor
function PopupWindow_getXYPosition(anchorname) {
	var coordinates;
	if (this.type == "WINDOW") {
		coordinates = getAnchorWindowPosition(anchorname);
		}
	else {
		coordinates = getAnchorPosition(anchorname);
		}
	this.x = coordinates.x;
	this.y = coordinates.y;
	}
// Set width/height of DIV/popup window
function PopupWindow_setSize(width,height) {
	this.width = width;
	this.height = height;
	}
// Fill the window with contents
function PopupWindow_populate(contents) {
	this.contents = contents;
	this.populated = false;
	}
// Set the URL to go to
function PopupWindow_setUrl(url) {
	this.url = url;
	}
// Set the window popup properties
function PopupWindow_setWindowProperties(props) {
	this.windowProperties = props;
	}
// Refresh the displayed contents of the popup
function PopupWindow_refresh() {
	if (this.divName != null) {
		// refresh the DIV object
		if (this.use_gebi) {
			document.getElementById(this.divName).innerHTML = this.contents;
			}
		else if (this.use_css) { 
			document.all[this.divName].innerHTML = this.contents;
			}
		else if (this.use_layers) { 
			var d = document.layers[this.divName]; 
			d.document.open();
			d.document.writeln(this.contents);
			d.document.close();
			}
		}
	else {
		if (this.popupWindow != null && !this.popupWindow.closed) {
			if (this.url!="") {
				this.popupWindow.location.href=this.url;
				}
			else {
				this.popupWindow.document.open();
				this.popupWindow.document.writeln(this.contents);
				this.popupWindow.document.close();
			}
			this.popupWindow.focus();
			}
		}
	}
// Position and show the popup, relative to an anchor object
function PopupWindow_showPopup(anchorname) {
	this.getXYPosition(anchorname);
	this.x += this.offsetX;
	this.y += this.offsetY;
	if (!this.populated && (this.contents != "")) {
		this.populated = true;
		this.refresh();
		}
	if (this.divName != null) {
		// Show the DIV object
		if (this.use_gebi) {
			document.getElementById(this.divName).style.left = this.x + "px";
			document.getElementById(this.divName).style.top = this.y + "px";
			document.getElementById(this.divName).style.visibility = "visible";
			}
		else if (this.use_css) {
			document.all[this.divName].style.left = this.x;
			document.all[this.divName].style.top = this.y;
			document.all[this.divName].style.visibility = "visible";
			}
		else if (this.use_layers) {
			document.layers[this.divName].left = this.x;
			document.layers[this.divName].top = this.y;
			document.layers[this.divName].visibility = "visible";
			}
		}
	else {
		if (this.popupWindow == null || this.popupWindow.closed) {
			// If the popup window will go off-screen, move it so it doesn't
			if (this.x<0) { this.x=0; }
			if (this.y<0) { this.y=0; }
			if (screen && screen.availHeight) {
				if ((this.y + this.height) > screen.availHeight) {
					this.y = screen.availHeight - this.height;
					}
				}
			if (screen && screen.availWidth) {
				if ((this.x + this.width) > screen.availWidth) {
					this.x = screen.availWidth - this.width;
					}
				}
			var avoidAboutBlank = window.opera || ( document.layers && !navigator.mimeTypes['*'] ) || navigator.vendor == 'KDE' || ( document.childNodes && !document.all && !navigator.taintEnabled );
			this.popupWindow = window.open(avoidAboutBlank?"":"about:blank","window_"+anchorname,this.windowProperties+",width="+this.width+",height="+this.height+",screenX="+this.x+",left="+this.x+",screenY="+this.y+",top="+this.y+"");
			}
		this.refresh();
		}
	}
// Hide the popup
function PopupWindow_hidePopup() {
	if (this.divName != null) {
		if (this.use_gebi) {
			document.getElementById(this.divName).style.visibility = "hidden";
			}
		else if (this.use_css) {
			document.all[this.divName].style.visibility = "hidden";
			}
		else if (this.use_layers) {
			document.layers[this.divName].visibility = "hidden";
			}
		}
	else {
		if (this.popupWindow && !this.popupWindow.closed) {
			this.popupWindow.close();
			this.popupWindow = null;
			}
		}
	}
// Pass an event and return whether or not it was the popup DIV that was clicked
function PopupWindow_isClicked(e) {
	if (this.divName != null) {
		if (this.use_layers) {
			var clickX = e.pageX;
			var clickY = e.pageY;
			var t = document.layers[this.divName];
			if ((clickX > t.left) && (clickX < t.left+t.clip.width) && (clickY > t.top) && (clickY < t.top+t.clip.height)) {
				return true;
				}
			else { return false; }
			}
		else if (document.all) { // Need to hard-code this to trap IE for error-handling
			var t = window.event.srcElement;
			while (t.parentElement != null) {
				if (t.id==this.divName) {
					return true;
					}
				t = t.parentElement;
				}
			return false;
			}
		else if (this.use_gebi && e) {
			var t = e.originalTarget;
			while (t.parentNode != null) {
				if (t.id==this.divName) {
					return true;
					}
				t = t.parentNode;
				}
			return false;
			}
		return false;
		}
	return false;
	}

// Check an onMouseDown event to see if we should hide
function PopupWindow_hideIfNotClicked(e) {
	if (this.autoHideEnabled && !this.isClicked(e)) {
		this.hidePopup();
		}
	}
// Call this to make the DIV disable automatically when mouse is clicked outside it
function PopupWindow_autoHide() {
	this.autoHideEnabled = true;
	}
// This global function checks all PopupWindow objects onmouseup to see if they should be hidden
function PopupWindow_hidePopupWindows(e) {
	for (var i=0; i<popupWindowObjects.length; i++) {
		if (popupWindowObjects[i] != null) {
			var p = popupWindowObjects[i];
			p.hideIfNotClicked(e);
			}
		}
	}
// Run this immediately to attach the event listener
function PopupWindow_attachListener() {
	if (document.layers) {
		document.captureEvents(Event.MOUSEUP);
		}
	window.popupWindowOldEventListener = document.onmouseup;
	if (window.popupWindowOldEventListener != null) {
		document.onmouseup = new Function("window.popupWindowOldEventListener(); PopupWindow_hidePopupWindows();");
		}
	else {
		document.onmouseup = PopupWindow_hidePopupWindows;
		}
	}
// CONSTRUCTOR for the PopupWindow object
// Pass it a DIV name to use a DHTML popup, otherwise will default to window popup
function PopupWindow() {
	if (!window.popupWindowIndex) { window.popupWindowIndex = 0; }
	if (!window.popupWindowObjects) { window.popupWindowObjects = new Array(); }
	if (!window.listenerAttached) {
		window.listenerAttached = true;
		PopupWindow_attachListener();
		}
	this.index = popupWindowIndex++;
	popupWindowObjects[this.index] = this;
	this.divName = null;
	this.popupWindow = null;
	this.width=0;
	this.height=0;
	this.populated = false;
	this.visible = false;
	this.autoHideEnabled = false;
	
	this.contents = "";
	this.url="";
	this.windowProperties="toolbar=no,location=no,status=no,menubar=no,scrollbars=auto,resizable,alwaysRaised,dependent,titlebar=no";
	if (arguments.length>0) {
		this.type="DIV";
		this.divName = arguments[0];
		}
	else {
		this.type="WINDOW";
		}
	this.use_gebi = false;
	this.use_css = false;
	this.use_layers = false;
	if (document.getElementById) { this.use_gebi = true; }
	else if (document.all) { this.use_css = true; }
	else if (document.layers) { this.use_layers = true; }
	else { this.type = "WINDOW"; }
	this.offsetX = 0;
	this.offsetY = 0;
	// Method mappings
	this.getXYPosition = PopupWindow_getXYPosition;
	this.populate = PopupWindow_populate;
	this.setUrl = PopupWindow_setUrl;
	this.setWindowProperties = PopupWindow_setWindowProperties;
	this.refresh = PopupWindow_refresh;
	this.showPopup = PopupWindow_showPopup;
	this.hidePopup = PopupWindow_hidePopup;
	this.setSize = PopupWindow_setSize;
	this.isClicked = PopupWindow_isClicked;
	this.autoHide = PopupWindow_autoHide;
	this.hideIfNotClicked = PopupWindow_hideIfNotClicked;
	}

/* SOURCE FILE: CalendarPopup.js */

// HISTORY
// ------------------------------------------------------------------
// Feb 7, 2005: Fixed a CSS styles to use px unit
// March 29, 2004: Added check in select() method for the form field
//      being disabled. If it is, just return and don't do anything.
// March 24, 2004: Fixed bug - when month name and abbreviations were
//      changed, date format still used original values.
// January 26, 2004: Added support for drop-down month and year
//      navigation (Thanks to Chris Reid for the idea)
// September 22, 2003: Fixed a minor problem in YEAR calendar with
//      CSS prefix.
// August 19, 2003: Renamed the function to get styles, and made it
//      work correctly without an object reference
// August 18, 2003: Changed showYearNavigation and 
//      showYearNavigationInput to optionally take an argument of
//      true or false
// July 31, 2003: Added text input option for year navigation.
//      Added a per-calendar CSS prefix option to optionally use 
//      different styles for different calendars.
// July 29, 2003: Fixed bug causing the Today link to be clickable 
//      even though today falls in a disabled date range.
//      Changed formatting to use pure CSS, allowing greater control
//      over look-and-feel options.
// June 11, 2003: Fixed bug causing the Today link to be unselectable
//      under certain cases when some days of week are disabled
// March 14, 2003: Added ability to disable individual dates or date
//      ranges, display as light gray and strike-through
// March 14, 2003: Removed dependency on graypixel.gif and instead 
///     use table border coloring
// March 12, 2003: Modified showCalendar() function to allow optional
//      start-date parameter
// March 11, 2003: Modified select() function to allow optional
//      start-date parameter
/* 
DESCRIPTION: This object implements a popup calendar to allow the user to
select a date, month, quarter, or year.

COMPATABILITY: Works with Netscape 4.x, 6.x, IE 5.x on Windows. Some small
positioning errors - usually with Window positioning - occur on the 
Macintosh platform.
The calendar can be modified to work for any location in the world by 
changing which weekday is displayed as the first column, changing the month
names, and changing the column headers for each day.

USAGE:
// Create a new CalendarPopup object of type WINDOW
var cal = new CalendarPopup(); 

// Create a new CalendarPopup object of type DIV using the DIV named 'mydiv'
var cal = new CalendarPopup('mydiv'); 

// Easy method to link the popup calendar with an input box. 
cal.select(inputObject, anchorname, dateFormat);
// Same method, but passing a default date other than the field's current value
cal.select(inputObject, anchorname, dateFormat, '01/02/2000');
// This is an example call to the popup calendar from a link to populate an 
// input box. Note that to use this, date.js must also be included!!
<A HREF="#" onClick="cal.select(document.forms[0].date,'anchorname','MM/dd/yyyy'); return false;">Select</A>

// Set the type of date select to be used. By default it is 'date'.
cal.setDisplayType(type);

// When a date, month, quarter, or year is clicked, a function is called and
// passed the details. You must write this function, and tell the calendar
// popup what the function name is.
// Function to be called for 'date' select receives y, m, d
cal.setReturnFunction(functionname);
// Function to be called for 'month' select receives y, m
cal.setReturnMonthFunction(functionname);
// Function to be called for 'quarter' select receives y, q
cal.setReturnQuarterFunction(functionname);
// Function to be called for 'year' select receives y
cal.setReturnYearFunction(functionname);

// Show the calendar relative to a given anchor
cal.showCalendar(anchorname);

// Hide the calendar. The calendar is set to autoHide automatically
cal.hideCalendar();

// Set the month names to be used. Default are English month names
cal.setMonthNames("January","February","March",...);

// Set the month abbreviations to be used. Default are English month abbreviations
cal.setMonthAbbreviations("Jan","Feb","Mar",...);

// Show navigation for changing by the year, not just one month at a time
cal.showYearNavigation();

// Show month and year dropdowns, for quicker selection of month of dates
cal.showNavigationDropdowns();

// Set the text to be used above each day column. The days start with 
// sunday regardless of the value of WeekStartDay
cal.setDayHeaders("S","M","T",...);

// Set the day for the first column in the calendar grid. By default this
// is Sunday (0) but it may be changed to fit the conventions of other
// countries.
cal.setWeekStartDay(1); // week is Monday - Sunday

// Set the weekdays which should be disabled in the 'date' select popup. You can
// then allow someone to only select week end dates, or Tuedays, for example
cal.setDisabledWeekDays(0,1); // To disable selecting the 1st or 2nd days of the week

// Selectively disable individual days or date ranges. Disabled days will not
// be clickable, and show as strike-through text on current browsers.
// Date format is any format recognized by parseDate() in date.js
// Pass a single date to disable:
cal.addDisabledDates("2003-01-01");
// Pass null as the first parameter to mean "anything up to and including" the
// passed date:
cal.addDisabledDates(null, "01/02/03");
// Pass null as the second parameter to mean "including the passed date and
// anything after it:
cal.addDisabledDates("Jan 01, 2003", null);
// Pass two dates to disable all dates inbetween and including the two
cal.addDisabledDates("January 01, 2003", "Dec 31, 2003");

// When the 'year' select is displayed, set the number of years back from the 
// current year to start listing years. Default is 2.
// This is also used for year drop-down, to decide how many years +/- to display
cal.setYearSelectStartOffset(2);

// Text for the word "Today" appearing on the calendar
cal.setTodayText("Today");

// The calendar uses CSS classes for formatting. If you want your calendar to
// have unique styles, you can set the prefix that will be added to all the
// classes in the output.
// For example, normal output may have this:
//     <SPAN CLASS="cpTodayTextDisabled">Today<SPAN>
// But if you set the prefix like this:
cal.setCssPrefix("Test");
// The output will then look like:
//     <SPAN CLASS="TestcpTodayTextDisabled">Today<SPAN>
// And you can define that style somewhere in your page.

// When using Year navigation, you can make the year be an input box, so
// the user can manually change it and jump to any year
cal.showYearNavigationInput();

// Set the calendar offset to be different than the default. By default it
// will appear just below and to the right of the anchorname. So if you have
// a text box where the date will go and and anchor immediately after the
// text box, the calendar will display immediately under the text box.
cal.offsetX = 20;
cal.offsetY = 20;

NOTES:
1) Requires the functions in AnchorPosition.js and PopupWindow.js

2) Your anchor tag MUST contain both NAME and ID attributes which are the 
   same. For example:
   <A NAME="test" ID="test"> </A>

3) There must be at least a space between <A> </A> for IE5.5 to see the 
   anchor tag correctly. Do not do <A></A> with no space.

4) When a CalendarPopup object is created, a handler for 'onmouseup' is
   attached to any event handler you may have already defined. Do NOT define
   an event handler for 'onmouseup' after you define a CalendarPopup object 
   or the autoHide() will not work correctly.
   
5) The calendar popup display uses style sheets to make it look nice.

*/ 

// CONSTRUCTOR for the CalendarPopup Object
function CalendarPopup() {
	var c;
	if (arguments.length>0) {
		c = new PopupWindow(arguments[0]);
		}
	else {
		c = new PopupWindow();
		c.setSize(150,175);
		}
	c.offsetX = -152;
	c.offsetY = 25;
	c.autoHide();
	// Calendar-specific properties
	c.monthNames = new Array("January","February","March","April","May","June","July","August","September","October","November","December");
	c.monthAbbreviations = new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
	c.dayHeaders = new Array("S","M","T","W","T","F","S");
	c.returnFunction = "CP_tmpReturnFunction";
	c.returnMonthFunction = "CP_tmpReturnMonthFunction";
	c.returnQuarterFunction = "CP_tmpReturnQuarterFunction";
	c.returnYearFunction = "CP_tmpReturnYearFunction";
	c.weekStartDay = 0;
	c.isShowYearNavigation = false;
	c.displayType = "date";
	c.disabledWeekDays = new Object();
	c.disabledDatesExpression = "";
	c.yearSelectStartOffset = 2;
	c.currentDate = null;
	c.todayText="Today";
	c.cssPrefix="";
	c.isShowNavigationDropdowns=false;
	c.isShowYearNavigationInput=false;
	window.CP_calendarObject = null;
	window.CP_targetInput = null;
	window.CP_dateFormat = "MM/dd/yyyy";
	// Method mappings
	c.copyMonthNamesToWindow = CP_copyMonthNamesToWindow;
	c.setReturnFunction = CP_setReturnFunction;
	c.setReturnMonthFunction = CP_setReturnMonthFunction;
	c.setReturnQuarterFunction = CP_setReturnQuarterFunction;
	c.setReturnYearFunction = CP_setReturnYearFunction;
	c.setMonthNames = CP_setMonthNames;
	c.setMonthAbbreviations = CP_setMonthAbbreviations;
	c.setDayHeaders = CP_setDayHeaders;
	c.setWeekStartDay = CP_setWeekStartDay;
	c.setDisplayType = CP_setDisplayType;
	c.setDisabledWeekDays = CP_setDisabledWeekDays;
	c.addDisabledDates = CP_addDisabledDates;
	c.setYearSelectStartOffset = CP_setYearSelectStartOffset;
	c.setTodayText = CP_setTodayText;
	c.showYearNavigation = CP_showYearNavigation;
	c.showCalendar = CP_showCalendar;
	c.hideCalendar = CP_hideCalendar;
	c.getStyles = getCalendarStyles;
	c.refreshCalendar = CP_refreshCalendar;
	c.getCalendar = CP_getCalendar;
	c.select = CP_select;
	c.setCssPrefix = CP_setCssPrefix;
	c.showNavigationDropdowns = CP_showNavigationDropdowns;
	c.showYearNavigationInput = CP_showYearNavigationInput;
	c.copyMonthNamesToWindow();
	// Return the object
	return c;
	}
function CP_copyMonthNamesToWindow() {
	// Copy these values over to the date.js 
	if (typeof(window.MONTH_NAMES)!="undefined" && window.MONTH_NAMES!=null) {
		window.MONTH_NAMES = new Array();
		for (var i=0; i<this.monthNames.length; i++) {
			window.MONTH_NAMES[window.MONTH_NAMES.length] = this.monthNames[i];
		}
		for (var i=0; i<this.monthAbbreviations.length; i++) {
			window.MONTH_NAMES[window.MONTH_NAMES.length] = this.monthAbbreviations[i];
		}
	}
}
// Temporary default functions to be called when items clicked, so no error is thrown
function CP_tmpReturnFunction(y,m,d) { 
	if (window.CP_targetInput!=null) {
		var dt = new Date(y,m-1,d,0,0,0);
		if (window.CP_calendarObject!=null) { window.CP_calendarObject.copyMonthNamesToWindow(); }
		window.CP_targetInput.value = formatDate(dt,window.CP_dateFormat);
		}
	else {
		alert('Use setReturnFunction() to define which function will get the clicked results!'); 
		}
	}
function CP_tmpReturnMonthFunction(y,m) { 
	alert('Use setReturnMonthFunction() to define which function will get the clicked results!\nYou clicked: year='+y+' , month='+m); 
	}
function CP_tmpReturnQuarterFunction(y,q) { 
	alert('Use setReturnQuarterFunction() to define which function will get the clicked results!\nYou clicked: year='+y+' , quarter='+q); 
	}
function CP_tmpReturnYearFunction(y) { 
	alert('Use setReturnYearFunction() to define which function will get the clicked results!\nYou clicked: year='+y); 
	}

// Set the name of the functions to call to get the clicked item
function CP_setReturnFunction(name) { this.returnFunction = name; }
function CP_setReturnMonthFunction(name) { this.returnMonthFunction = name; }
function CP_setReturnQuarterFunction(name) { this.returnQuarterFunction = name; }
function CP_setReturnYearFunction(name) { this.returnYearFunction = name; }

// Over-ride the built-in month names
function CP_setMonthNames() {
	for (var i=0; i<arguments.length; i++) { this.monthNames[i] = arguments[i]; }
	this.copyMonthNamesToWindow();
	}

// Over-ride the built-in month abbreviations
function CP_setMonthAbbreviations() {
	for (var i=0; i<arguments.length; i++) { this.monthAbbreviations[i] = arguments[i]; }
	this.copyMonthNamesToWindow();
	}

// Over-ride the built-in column headers for each day
function CP_setDayHeaders() {
	for (var i=0; i<arguments.length; i++) { this.dayHeaders[i] = arguments[i]; }
	}

// Set the day of the week (0-7) that the calendar display starts on
// This is for countries other than the US whose calendar displays start on Monday(1), for example
function CP_setWeekStartDay(day) { this.weekStartDay = day; }

// Show next/last year navigation links
function CP_showYearNavigation() { this.isShowYearNavigation = (arguments.length>0)?arguments[0]:true; }

// Which type of calendar to display
function CP_setDisplayType(type) {
	if (type!="date"&&type!="week-end"&&type!="month"&&type!="quarter"&&type!="year") { alert("Invalid display type! Must be one of: date,week-end,month,quarter,year"); return false; }
	this.displayType=type;
	}

// How many years back to start by default for year display
function CP_setYearSelectStartOffset(num) { this.yearSelectStartOffset=num; }

// Set which weekdays should not be clickable
function CP_setDisabledWeekDays() {
	this.disabledWeekDays = new Object();
	for (var i=0; i<arguments.length; i++) { this.disabledWeekDays[arguments[i]] = true; }
	}
	
// Disable individual dates or ranges
// Builds an internal logical test which is run via eval() for efficiency
function CP_addDisabledDates(start, end) {
	if (arguments.length==1) { end=start; }
	if (start==null && end==null) { return; }
	if (this.disabledDatesExpression!="") { this.disabledDatesExpression+= "||"; }
	if (start!=null) { start = parseDate(start); start=""+start.getFullYear()+LZ(start.getMonth()+1)+LZ(start.getDate());}
	if (end!=null) { end=parseDate(end); end=""+end.getFullYear()+LZ(end.getMonth()+1)+LZ(end.getDate());}
	if (start==null) { this.disabledDatesExpression+="(ds<="+end+")"; }
	else if (end  ==null) { this.disabledDatesExpression+="(ds>="+start+")"; }
	else { this.disabledDatesExpression+="(ds>="+start+"&&ds<="+end+")"; }
	}
	
// Set the text to use for the "Today" link
function CP_setTodayText(text) {
	this.todayText = text;
	}

// Set the prefix to be added to all CSS classes when writing output
function CP_setCssPrefix(val) { 
	this.cssPrefix = val; 
	}

// Show the navigation as an dropdowns that can be manually changed
function CP_showNavigationDropdowns() { this.isShowNavigationDropdowns = (arguments.length>0)?arguments[0]:true; }

// Show the year navigation as an input box that can be manually changed
function CP_showYearNavigationInput() { this.isShowYearNavigationInput = (arguments.length>0)?arguments[0]:true; }

// Hide a calendar object
function CP_hideCalendar() {
	if (arguments.length > 0) { window.popupWindowObjects[arguments[0]].hidePopup(); }
	else { this.hidePopup(); }
	}

// Refresh the contents of the calendar display
function CP_refreshCalendar(index) {
	var calObject = window.popupWindowObjects[index];
	if (arguments.length>1) { 
		calObject.populate(calObject.getCalendar(arguments[1],arguments[2],arguments[3],arguments[4],arguments[5]));
		}
	else {
		calObject.populate(calObject.getCalendar());
		}
	calObject.refresh();
	}

// Populate the calendar and display it
function CP_showCalendar(anchorname) {
	if (arguments.length>1) {
		if (arguments[1]==null||arguments[1]=="") {
			this.currentDate=new Date();
			}
		else {
			this.currentDate=new Date(parseDate(arguments[1]));
			}
		}
	this.populate(this.getCalendar());
	this.showPopup(anchorname);
	}

// Simple method to interface popup calendar with a text-entry box
function CP_select(inputobj, linkname, format) {
	var selectedDate=(arguments.length>3)?arguments[3]:null;
	if (!window.getDateFromFormat) {
		alert("calendar.select: To use this method you must also include 'date.js' for date formatting");
		return;
		}
	if (this.displayType!="date"&&this.displayType!="week-end") {
		alert("calendar.select: This function can only be used with displayType 'date' or 'week-end'");
		return;
		}
	if (inputobj.type!="text" && inputobj.type!="hidden" && inputobj.type!="textarea") { 
		alert("calendar.select: Input object passed is not a valid form input object"); 
		window.CP_targetInput=null;
		return;
		}
	if (inputobj.disabled) { return; } // Can't use calendar input on disabled form input!
	window.CP_targetInput = inputobj;
	window.CP_calendarObject = this;
	this.currentDate=null;
	var time=0;
	if (selectedDate!=null) {
		time = getDateFromFormat(selectedDate,format)
		}
	else if (inputobj.value!="") {
		time = getDateFromFormat(inputobj.value,format);
		}
	if (selectedDate!=null || inputobj.value!="") {
		if (time==0) { this.currentDate=null; }
		else { this.currentDate=new Date(time); }
		}
	window.CP_dateFormat = format;
	this.showCalendar(linkname);
	}
	
// Get style block needed to display the calendar correctly
function getCalendarStyles() {
	var result = "";
	var p = "";
	if (this!=null && typeof(this.cssPrefix)!="undefined" && this.cssPrefix!=null && this.cssPrefix!="") { p=this.cssPrefix; }
	result += "<STYLE>\n";
	result += "."+p+"cpYearNavigation,."+p+"cpMonthNavigation { background-color:#C0C0C0; text-align:center; vertical-align:center; text-decoration:none; color:#000000; font-weight:bold; }\n";
	result += "."+p+"cpDayColumnHeader, ."+p+"cpYearNavigation,."+p+"cpMonthNavigation,."+p+"cpCurrentMonthDate,."+p+"cpCurrentMonthDateDisabled,."+p+"cpOtherMonthDate,."+p+"cpOtherMonthDateDisabled,."+p+"cpCurrentDate,."+p+"cpCurrentDateDisabled,."+p+"cpTodayText,."+p+"cpTodayTextDisabled,."+p+"cpText { font-family:arial; font-size:8pt; }\n";
	result += "TD."+p+"cpDayColumnHeader { text-align:right; border:solid thin #C0C0C0;border-width:0px 0px 1px 0px; }\n";
	result += "."+p+"cpCurrentMonthDate, ."+p+"cpOtherMonthDate, ."+p+"cpCurrentDate  { text-align:right; text-decoration:none; }\n";
	result += "."+p+"cpCurrentMonthDateDisabled, ."+p+"cpOtherMonthDateDisabled, ."+p+"cpCurrentDateDisabled { color:#D0D0D0; text-align:right; text-decoration:line-through; }\n";
	result += "."+p+"cpCurrentMonthDate, .cpCurrentDate { color:#000000; }\n";
	result += "."+p+"cpOtherMonthDate { color:#808080; }\n";
	result += "TD."+p+"cpCurrentDate { color:white; background-color: #C0C0C0; border-width:1px; border:solid thin #800000; }\n";
	result += "TD."+p+"cpCurrentDateDisabled { border-width:1px; border:solid thin #FFAAAA; }\n";
	result += "TD."+p+"cpTodayText, TD."+p+"cpTodayTextDisabled { border:solid thin #C0C0C0; border-width:1px 0px 0px 0px;}\n";
	result += "A."+p+"cpTodayText, SPAN."+p+"cpTodayTextDisabled { height:20px; }\n";
	result += "A."+p+"cpTodayText { color:black; }\n";
	result += "."+p+"cpTodayTextDisabled { color:#D0D0D0; }\n";
	result += "."+p+"cpBorder { border:solid thin #808080; }\n";
	result += "</STYLE>\n";
	return result;
	}

// Return a string containing all the calendar code to be displayed
function CP_getCalendar() {
	var now = new Date();
	// Reference to window
	if (this.type == "WINDOW") { var windowref = "window.opener."; }
	else { var windowref = ""; }
	var result = "";
	// If POPUP, write entire HTML document
	if (this.type == "WINDOW") {
		result += "<HTML><HEAD><TITLE>Calendar</TITLE>"+this.getStyles()+"</HEAD><BODY MARGINWIDTH=0 MARGINHEIGHT=0 TOPMARGIN=0 RIGHTMARGIN=0 LEFTMARGIN=0>\n";
		result += '<CENTER><TABLE WIDTH=100% BORDER=0 BORDERWIDTH=0 CELLSPACING=0 CELLPADDING=0>\n';
		}
	else {
		result += '<TABLE CLASS="'+this.cssPrefix+'cpBorder" WIDTH=144 BORDER=1 BORDERWIDTH=1 CELLSPACING=0 CELLPADDING=1>\n';
		result += '<TR><TD ALIGN=CENTER>\n';
		result += '<CENTER>\n';
		}
	// Code for DATE display (default)
	// -------------------------------
	if (this.displayType=="date" || this.displayType=="week-end") {
		if (this.currentDate==null) { this.currentDate = now; }
		if (arguments.length > 0) { var month = arguments[0]; }
			else { var month = this.currentDate.getMonth()+1; }
		if (arguments.length > 1 && arguments[1]>0 && arguments[1]-0==arguments[1]) { var year = arguments[1]; }
			else { var year = this.currentDate.getFullYear(); }
		var daysinmonth= new Array(0,31,28,31,30,31,30,31,31,30,31,30,31);
		if ( ( (year%4 == 0)&&(year%100 != 0) ) || (year%400 == 0) ) {
			daysinmonth[2] = 29;
			}
		var current_month = new Date(year,month-1,1);
		var display_year = year;
		var display_month = month;
		var display_date = 1;
		var weekday= current_month.getDay();
		var offset = 0;
		
		offset = (weekday >= this.weekStartDay) ? weekday-this.weekStartDay : 7-this.weekStartDay+weekday ;
		if (offset > 0) {
			display_month--;
			if (display_month < 1) { display_month = 12; display_year--; }
			display_date = daysinmonth[display_month]-offset+1;
			}
		var next_month = month+1;
		var next_month_year = year;
		if (next_month > 12) { next_month=1; next_month_year++; }
		var last_month = month-1;
		var last_month_year = year;
		if (last_month < 1) { last_month=12; last_month_year--; }
		var date_class;
		if (this.type!="WINDOW") {
			result += "<TABLE WIDTH=144 BORDER=0 BORDERWIDTH=0 CELLSPACING=0 CELLPADDING=0>";
			}
		result += '<TR>\n';
		var refresh = windowref+'CP_refreshCalendar';
		var refreshLink = 'javascript:' + refresh;
		if (this.isShowNavigationDropdowns) {
			result += '<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="78" COLSPAN="3"><select CLASS="'+this.cssPrefix+'cpMonthNavigation" name="cpMonth" onChange="'+refresh+'('+this.index+',this.options[this.selectedIndex].value-0,'+(year-0)+');">';
			for( var monthCounter=1; monthCounter<=12; monthCounter++ ) {
				var selected = (monthCounter==month) ? 'SELECTED' : '';
				result += '<option value="'+monthCounter+'" '+selected+'>'+this.monthNames[monthCounter-1]+'</option>';
				}
			result += '</select></TD>';
			result += '<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="10">&nbsp;</TD>';

			result += '<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="56" COLSPAN="3"><select CLASS="'+this.cssPrefix+'cpYearNavigation" name="cpYear" onChange="'+refresh+'('+this.index+','+month+',this.options[this.selectedIndex].value-0);">';
			for( var yearCounter=year-this.yearSelectStartOffset; yearCounter<=year+this.yearSelectStartOffset; yearCounter++ ) {
				var selected = (yearCounter==year) ? 'SELECTED' : '';
				result += '<option value="'+yearCounter+'" '+selected+'>'+yearCounter+'</option>';
				}
			result += '</select></TD>';
			}
		else {
			if (this.isShowYearNavigation) {
				result += '<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="10"><A CLASS="'+this.cssPrefix+'cpMonthNavigation" HREF="'+refreshLink+'('+this.index+','+last_month+','+last_month_year+');">&lt;</A></TD>';
				result += '<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="58"><SPAN CLASS="'+this.cssPrefix+'cpMonthNavigation">'+this.monthNames[month-1]+'</SPAN></TD>';
				result += '<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="10"><A CLASS="'+this.cssPrefix+'cpMonthNavigation" HREF="'+refreshLink+'('+this.index+','+next_month+','+next_month_year+');">&gt;</A></TD>';
				result += '<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="10">&nbsp;</TD>';

				result += '<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="10"><A CLASS="'+this.cssPrefix+'cpYearNavigation" HREF="'+refreshLink+'('+this.index+','+month+','+(year-1)+');">&lt;</A></TD>';
				if (this.isShowYearNavigationInput) {
					result += '<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="36"><INPUT NAME="cpYear" CLASS="'+this.cssPrefix+'cpYearNavigation" SIZE="4" MAXLENGTH="4" VALUE="'+year+'" onBlur="'+refresh+'('+this.index+','+month+',this.value-0);"></TD>';
					}
				else {
					result += '<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="36"><SPAN CLASS="'+this.cssPrefix+'cpYearNavigation">'+year+'</SPAN></TD>';
					}
				result += '<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="10"><A CLASS="'+this.cssPrefix+'cpYearNavigation" HREF="'+refreshLink+'('+this.index+','+month+','+(year+1)+');">&gt;</A></TD>';
				}
			else {
				result += '<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="22"><A CLASS="'+this.cssPrefix+'cpMonthNavigation" HREF="'+refreshLink+'('+this.index+','+last_month+','+last_month_year+');">&lt;&lt;</A></TD>\n';
				result += '<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="100"><SPAN CLASS="'+this.cssPrefix+'cpMonthNavigation">'+this.monthNames[month-1]+' '+year+'</SPAN></TD>\n';
				result += '<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="22"><A CLASS="'+this.cssPrefix+'cpMonthNavigation" HREF="'+refreshLink+'('+this.index+','+next_month+','+next_month_year+');">&gt;&gt;</A></TD>\n';
				}
			}
		result += '</TR></TABLE>\n';
		result += '<TABLE WIDTH=120 BORDER=0 CELLSPACING=0 CELLPADDING=1 ALIGN=CENTER>\n';
		result += '<TR>\n';
		for (var j=0; j<7; j++) {

			result += '<TD CLASS="'+this.cssPrefix+'cpDayColumnHeader" WIDTH="14%"><SPAN CLASS="'+this.cssPrefix+'cpDayColumnHeader">'+this.dayHeaders[(this.weekStartDay+j)%7]+'</TD>\n';
			}
		result += '</TR>\n';
		for (var row=1; row<=6; row++) {
			result += '<TR>\n';
			for (var col=1; col<=7; col++) {
				var disabled=false;
				if (this.disabledDatesExpression!="") {
					var ds=""+display_year+LZ(display_month)+LZ(display_date);
					eval("disabled=("+this.disabledDatesExpression+")");
					}
				var dateClass = "";
				if ((display_month == this.currentDate.getMonth()+1) && (display_date==this.currentDate.getDate()) && (display_year==this.currentDate.getFullYear())) {
					dateClass = "cpCurrentDate";
					}
				else if (display_month == month) {
					dateClass = "cpCurrentMonthDate";
					}
				else {
					dateClass = "cpOtherMonthDate";
					}
				if (disabled || this.disabledWeekDays[col-1]) {
					result += '	<TD CLASS="'+this.cssPrefix+dateClass+'"><SPAN CLASS="'+this.cssPrefix+dateClass+'Disabled">'+display_date+'</SPAN></TD>\n';
					}
				else {
					var selected_date = display_date;
					var selected_month = display_month;
					var selected_year = display_year;
					if (this.displayType=="week-end") {
						var d = new Date(selected_year,selected_month-1,selected_date,0,0,0,0);
						d.setDate(d.getDate() + (7-col));
						selected_year = d.getYear();
						if (selected_year < 1000) { selected_year += 1900; }
						selected_month = d.getMonth()+1;
						selected_date = d.getDate();
						}
					result += '	<TD CLASS="'+this.cssPrefix+dateClass+'"><A HREF="javascript:'+windowref+this.returnFunction+'('+selected_year+','+selected_month+','+selected_date+');'+windowref+'CP_hideCalendar(\''+this.index+'\');" CLASS="'+this.cssPrefix+dateClass+'">'+display_date+'</A></TD>\n';
					}
				display_date++;
				if (display_date > daysinmonth[display_month]) {
					display_date=1;
					display_month++;
					}
				if (display_month > 12) {
					display_month=1;
					display_year++;
					}
				}
			result += '</TR>';
			}
		var current_weekday = now.getDay() - this.weekStartDay;
		if (current_weekday < 0) {
			current_weekday += 7;
			}
		result += '<TR>\n';
		result += '	<TD COLSPAN=7 ALIGN=CENTER CLASS="'+this.cssPrefix+'cpTodayText">\n';
		if (this.disabledDatesExpression!="") {
			var ds=""+now.getFullYear()+LZ(now.getMonth()+1)+LZ(now.getDate());
			eval("disabled=("+this.disabledDatesExpression+")");
			}
		if (disabled || this.disabledWeekDays[current_weekday+1]) {
			result += '		<SPAN CLASS="'+this.cssPrefix+'cpTodayTextDisabled">'+this.todayText+'</SPAN>\n';
			}
		else {
			result += '		<A CLASS="'+this.cssPrefix+'cpTodayText" HREF="javascript:'+windowref+this.returnFunction+'(\''+now.getFullYear()+'\',\''+(now.getMonth()+1)+'\',\''+now.getDate()+'\');'+windowref+'CP_hideCalendar(\''+this.index+'\');">'+this.todayText+'</A>\n';
			}
		result += '		<BR>\n';
		result += '	</TD></TR></TABLE></CENTER></TD></TR></TABLE>\n';
	}

	// Code common for MONTH, QUARTER, YEAR
	// ------------------------------------
	if (this.displayType=="month" || this.displayType=="quarter" || this.displayType=="year") {
		if (arguments.length > 0) { var year = arguments[0]; }
		else { 
			if (this.displayType=="year") {	var year = now.getFullYear()-this.yearSelectStartOffset; }
			else { var year = now.getFullYear(); }
			}
		if (this.displayType!="year" && this.isShowYearNavigation) {
			result += "<TABLE WIDTH=144 BORDER=0 BORDERWIDTH=0 CELLSPACING=0 CELLPADDING=0>";
			result += '<TR>\n';
			result += '	<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="22"><A CLASS="'+this.cssPrefix+'cpYearNavigation" HREF="javascript:'+windowref+'CP_refreshCalendar('+this.index+','+(year-1)+');">&lt;&lt;</A></TD>\n';
			result += '	<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="100">'+year+'</TD>\n';
			result += '	<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="22"><A CLASS="'+this.cssPrefix+'cpYearNavigation" HREF="javascript:'+windowref+'CP_refreshCalendar('+this.index+','+(year+1)+');">&gt;&gt;</A></TD>\n';
			result += '</TR></TABLE>\n';
			}
		}
		
	// Code for MONTH display 
	// ----------------------
	if (this.displayType=="month") {
		// If POPUP, write entire HTML document
		result += '<TABLE WIDTH=120 BORDER=0 CELLSPACING=1 CELLPADDING=0 ALIGN=CENTER>\n';
		for (var i=0; i<4; i++) {
			result += '<TR>';
			for (var j=0; j<3; j++) {
				var monthindex = ((i*3)+j);
				result += '<TD WIDTH=33% ALIGN=CENTER><A CLASS="'+this.cssPrefix+'cpText" HREF="javascript:'+windowref+this.returnMonthFunction+'('+year+','+(monthindex+1)+');'+windowref+'CP_hideCalendar(\''+this.index+'\');" CLASS="'+date_class+'">'+this.monthAbbreviations[monthindex]+'</A></TD>';
				}
			result += '</TR>';
			}
		result += '</TABLE></CENTER></TD></TR></TABLE>\n';
		}
	
	// Code for QUARTER display
	// ------------------------
	if (this.displayType=="quarter") {
		result += '<BR><TABLE WIDTH=120 BORDER=1 CELLSPACING=0 CELLPADDING=0 ALIGN=CENTER>\n';
		for (var i=0; i<2; i++) {
			result += '<TR>';
			for (var j=0; j<2; j++) {
				var quarter = ((i*2)+j+1);
				result += '<TD WIDTH=50% ALIGN=CENTER><BR><A CLASS="'+this.cssPrefix+'cpText" HREF="javascript:'+windowref+this.returnQuarterFunction+'('+year+','+quarter+');'+windowref+'CP_hideCalendar(\''+this.index+'\');" CLASS="'+date_class+'">Q'+quarter+'</A><BR><BR></TD>';
				}
			result += '</TR>';
			}
		result += '</TABLE></CENTER></TD></TR></TABLE>\n';
		}

	// Code for YEAR display
	// ---------------------
	if (this.displayType=="year") {
		var yearColumnSize = 4;
		result += "<TABLE WIDTH=144 BORDER=0 BORDERWIDTH=0 CELLSPACING=0 CELLPADDING=0>";
		result += '<TR>\n';
		result += '	<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="50%"><A CLASS="'+this.cssPrefix+'cpYearNavigation" HREF="javascript:'+windowref+'CP_refreshCalendar('+this.index+','+(year-(yearColumnSize*2))+');">&lt;&lt;</A></TD>\n';
		result += '	<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="50%"><A CLASS="'+this.cssPrefix+'cpYearNavigation" HREF="javascript:'+windowref+'CP_refreshCalendar('+this.index+','+(year+(yearColumnSize*2))+');">&gt;&gt;</A></TD>\n';
		result += '</TR></TABLE>\n';
		result += '<TABLE WIDTH=120 BORDER=0 CELLSPACING=1 CELLPADDING=0 ALIGN=CENTER>\n';
		for (var i=0; i<yearColumnSize; i++) {
			for (var j=0; j<2; j++) {
				var currentyear = year+(j*yearColumnSize)+i;
				result += '<TD WIDTH=50% ALIGN=CENTER><A CLASS="'+this.cssPrefix+'cpText" HREF="javascript:'+windowref+this.returnYearFunction+'('+currentyear+');'+windowref+'CP_hideCalendar(\''+this.index+'\');" CLASS="'+date_class+'">'+currentyear+'</A></TD>';
				}
			result += '</TR>';
			}
		result += '</TABLE></CENTER></TD></TR></TABLE>\n';
		}
	// Common
	if (this.type == "WINDOW") {
		result += "</BODY></HTML>\n";
		}
	return result;
	}
var ImageContainer = [ '../czusys_images/UpArrow.gif','../czusys_images/DownArrow.gif','../czusys_images/PlaceHolderArrow.gif' ];
var myimages = new Array();
for (var i=0; i<ImageContainer.length; i++){
  myimages[i] = new Image();
  myimages[i].src = ImageContainer[i];
}
function TLsListColumn(aColumnId, aDisplayText, aDataType, aDisplayColumn, aVisible, aSortable, aDisableCustView, aHideColumn, aValueColumn, aSelectedColumn, aActivityOptionType, aSortType, aFilterType, aPreFilterValue, aFooterFormula,aAutoDropDownSplitDelimiter, aRowFormatFunction, aFooterFormatFunction) {
  aColumnId             = unescape(aColumnId);
  aDisplayText          = unescape(aDisplayText);
  aDataType             = unescape(aDataType);
  aDisplayColumn        = unescape(aDisplayColumn);
  aVisible              = unescape(aVisible);
  aSortable             = unescape(aSortable);
  aDisableCustView      = unescape(aDisableCustView);
  aHideColumn           = unescape(aHideColumn);
  aValueColumn          = unescape(aValueColumn);
  aSelectedColumn       = unescape(aSelectedColumn);
  aActivityOptionType   = unescape(aActivityOptionType);
  aSortType             = unescape(aSortType);
  this.ColumnId         = aColumnId;
  this.DisplayText      = aDisplayText;
  this.DataType         = (aDataType) ? aDataType.toUpperCase() : 'STRING';
  this.SortType         = (aSortType) ? aSortType.toUpperCase() : this.DataType;
  this.Visible          = isTrue(aVisible,true);
  this.DisplayColumn    = (aDisplayColumn) ? aDisplayColumn : this.ColumnId;
  this.Sortable         = isTrue(aSortable,true);
  this.SortDirection    = 'ASC';
  this.DisableCustView  = isTrue(aDisableCustView);
  this.HideColumn       = isTrue(aHideColumn);
  this.ValueColumn      = aValueColumn;
  this.SelectedColumn   = aSelectedColumn;
  this.ActivityOptionType = aActivityOptionType;
  if(typeof(aFilterType)=='undefined'){
    this.FilterType       = false;
  }else{
    aFilterType           = unescape(aFilterType);
    this.FilterType       = (aFilterType==''||aFilterType.toUpperCase()=='NONE' ? false:aFilterType.toUpperCase());
  }
  this.FilterCriteria   = (aPreFilterValue ? unescape(aPreFilterValue):'');
  this.FilterMatchType   = '';
  this.FilterElementId    = false;
  this.AutoDropDownSplitDelimiter = (aAutoDropDownSplitDelimiter ? unescape(aAutoDropDownSplitDelimiter):'');
  this.DisplayFooterRow  = false;
  this.FooterFormula = aFooterFormula.toUpperCase();
  this.RowFormatFunction = (aRowFormatFunction!=''&& window[aRowFormatFunction] ? window[aRowFormatFunction]:function(s){return s;});
  this.FooterFormatFunction = (aFooterFormatFunction!='' && window[aFooterFormatFunction] ? window[aFooterFormatFunction]:function(s){return s;});
}
function TLsListItem(aItemId, aValueObject) {
  this.ItemId = aItemId;
  this.Values = aValueObject;
}
function TLsDynamicList(aListName,aRowCount,aShowViewAllButton,aSortColumn,aSortColumnDataType,aSortDirection,aShowCustomizeView,aPostDrawFunction,aDisableSorting,aActiveButtonClass,aDisplayNavigation,aNavButtonActiveClass,aNavButtonInactiveClass,aShowHeaderRow,aDisplayFilterRow,aDynListCookieName,aFilterOnChange,aDisplayFilterButtons) {
  this.Name                = aListName;
  this.ColumnList          = [];
  this.ItemList            = [];
  this.SortColumn          = aSortColumn;
  this.SortColumnDataType  = aSortColumnDataType;
  this.SortDirection       = aSortDirection;
  this.StartRow            = 0;
  this.EndRow              = aRowCount;
  this.RowCount            = aRowCount;
  this.ShowViewAllButton   = aShowViewAllButton;
  this.ViewAll             = false;
  this.UseCookies          = false;
  this.ShowHeaderRow       = isTrue(aShowHeaderRow,true);
  this.Sorted              = false;
  this.Filtered            = false;
  this.Initialized         = false;
  this.ShowCustomizeView   = isTrue(aShowCustomizeView);
  this.PostDrawFunction    = aPostDrawFunction;
  this.DisableSorting      = isTrue(aDisableSorting);
  this.UpArrowSrc          = '../czusys_images/UpArrow.gif';
  this.DownArrowSrc        = '../czusys_images/DownArrow.gif';
  this.PlaceHolderArrowSrc = '../czusys_images/PlaceHolderArrow.gif';
  this.ArrowWidth          = 11;
  this.ArrowHeight         = 6;
  this.ActiveButtonClass   = aActiveButtonClass;
  this.OriginalList        = null;
  this.DisplayNavigation   = isTrue(aDisplayNavigation);
  this.NavButtonActiveClass    = aNavButtonActiveClass;
  this.NavButtonInactiveClass  = aNavButtonInactiveClass;
  this.ShowAllButtonText       = '';
  this.DisplayFilterRow        = isTrue(aDisplayFilterRow);
  this.UseAutoRedraw     = true;
  this.RowOnClickFunction = false;
  this.CookieName    = (typeof(aDynListCookieName)=='undefined'||aDynListCookieName=='' ? false:'DL'+aDynListCookieName.toUpperCase());
  this.QuickSearchTitles  = false;
  this.QuickSearchPause   = 300;
  this.QuickSearchTimeout = false;
  this.QuickSearchCriteria = '';
  this.QuickSearchLastCriteria = '';
  this.AutoDropDownShowAllText = '';
  this.FilterOnChange          = isTrue(aFilterOnChange);
  this.DisplayFilterButtons    = isTrue(aDisplayFilterButtons);
  this.ShowAllOnLoad           = false;
  this.OnDrawFunction          = null;
}
TLsDynamicList.SetQuickSearchTimeout = function(aList,aCriteria){
  if(aList.QuickSearchLastCriteria!=aCriteria.toUpperCase()){
    aList.QuickSearchCriteria = aCriteria.toUpperCase();
    aList.QuickSearchTimeout = setTimeout(aList.Name+'.QuickSearch()',aList.QuickSearchPause);
  }
}
TLsDynamicList.ClearQuickSearchTimeout = function(aList){
  if(aList.QuickSearchTimeout){
    clearTimeout(aList.QuickSearchTimeout);
    aList.QuickSearchTimeout = false;
  }
}
TLsDynamicList.FilterColumn = function(aList,aColumnId,aText){
  aList.SetColumnFilter(aColumnId,aText);
}
TLsDynamicList.prototype.SetColumnFilter = function(aField,aCriteria){
  var zCol = this.FindColumn(aField);
  zCol.FilterCriteria = aCriteria;
  this.ApplyColumnFilters();
}
TLsDynamicList.prototype.ApplyColumnFilters = function(aRedraw){
  aRedraw = isTrue(aRedraw,true);
  var x;
  var zTempArray = new Array();
  if(!this.OriginalList){
    this.OriginalList = new Array();
    for(x=0;x<this.ItemList.length;x++){
      this.OriginalList[this.OriginalList.length] = this.ItemList[x];
    }
  }
  var zFuncBody;
  var zCondition = new Array();
  for(x=0;x<this.ColumnList.length;x++){
    if(this.ColumnList[x].FilterCriteria!=''){
      if(this.ColumnList[x].FilterMatchType=='PARTIAL'){
        zCondition[zCondition.length] = 'aItem.Values[\''+this.ColumnList[x].ColumnId+'\'].toUpperCase().indexOf(unescape(\''+escape(this.ColumnList[x].FilterCriteria.toUpperCase())+'\'))!=-1';
      }else{
        zCondition[zCondition.length] = 'aItem.Values[\''+this.ColumnList[x].ColumnId+'\'].toUpperCase()==unescape(\''+escape(this.ColumnList[x].FilterCriteria.toUpperCase())+'\')';
      }
    }
  }
  if(zCondition.length==0){ zCondition[zCondition.length] = true; }
  zFuncBody = 'return ('+ zCondition.join('&&') +');';
  this.CurrentFilterFunction = new Function('aItem',zFuncBody);
  for(x=0;x<this.OriginalList.length;x++){
    if(this.CurrentFilterFunction(this.OriginalList[x])){
      zTempArray[zTempArray.length] = this.OriginalList[x];
    }
  }
  this.ItemList = new Array();
  for(x=0;x<zTempArray.length;x++){
    this.ItemList[x] = zTempArray[x];
  }
  this.Filtered = (zTempArray.length==this.OriginalList.length ? false:true);
  this.navigateItems('First',false);
  this.ReapplySort();
  if(aRedraw){
    this.DrawTable(false);
  }
}
TLsDynamicList.prototype.AddColumn = function(aColumnId, aDisplayText, aDataType, aDisplayColumn, aVisible, aSortable, aDisableCustView, aHideColumn, aValueColumn, aSelectedColumn, aActivityOptionType, aSortType, aFilterType, aPreFilterValue, aFooterFormula,aAutoDropDownSplitDelimiter, aRowFormatFunction, aFooterFormatFunction) {
  var zColumn = new TLsListColumn(aColumnId, aDisplayText, aDataType, aDisplayColumn, aVisible, aSortable, aDisableCustView, aHideColumn, aValueColumn, aSelectedColumn, aActivityOptionType, aSortType, aFilterType, aPreFilterValue, aFooterFormula,aAutoDropDownSplitDelimiter, aRowFormatFunction, aFooterFormatFunction);
  this.ColumnList[this.ColumnList.length] = zColumn;
  return zColumn;
}
TLsDynamicList.prototype.AddItem = function(aItemId, aValueObject) {
  var zItem = new TLsListItem(aItemId, aValueObject);
  this.ItemList[this.ItemList.length] = zItem;
  return zItem;
}
TLsDynamicList.prototype.AddItemToList = function(aValueObject) {
  var zItem = {ItemId:aValueObject.ItemId,Values:aValueObject};
  this.ItemList[this.ItemList.length] = zItem;
  return zItem;
}
TLsDynamicList.prototype.FindColumn = function(aColumnId) {
  for (var zI = 0; zI < this.ColumnList.length; zI++) {
    if (this.ColumnList[zI].ColumnId == aColumnId) {
      return this.ColumnList[zI];
    }
  }
  return null;
}
TLsDynamicList.prototype.FindItem = function(aItemId) {
  for (var zI = 0; zI < this.ItemList.length; zI++) {
    if (this.ItemList[zI].ItemId == aItemId) {
      return this.ItemList[zI];
    }
  }
  return null;
}
TLsDynamicList.prototype.Alpha_Sort_ASC = function(aColumnID) {
  var tempValue,i,j;
  for (i = this.ItemList.length-1 - 1; i >= 0; i--) {
    for (j = 0; j <= i; j++) {
      if (this.ItemList[j+1].Values[aColumnID].toLowerCase() < this.ItemList[j].Values[aColumnID].toLowerCase()) {
        tempValue = this.ItemList[j];
        this.ItemList[j] = this.ItemList[j+1];
        this.ItemList[j+1] = tempValue;
      }
    }
  }
}
TLsDynamicList.prototype.Alpha_Sort_DESC = function(aColumnID) {
  var tempValue,i,j;
  for (i = this.ItemList.length-1 - 1; i >= 0; i--) {
    for (j = 0; j <= i; j++) {
      if (this.ItemList[j+1].Values[aColumnID].toLowerCase() > this.ItemList[j].Values[aColumnID].toLowerCase()) {
        tempValue = this.ItemList[j];
        this.ItemList[j] = this.ItemList[j+1];
        this.ItemList[j+1] = tempValue;
      }
    }
  }
}
TLsDynamicList.prototype.Number_Sort_ASC = function(aColumnID) {
  var tempValue,i,j;
  for (i = this.ItemList.length-1 - 1; i >= 0; i--) {
    for (j = 0; j <= i; j++) {
      if ((isNaN(parseFloat(this.ItemList[j+1].Values[aColumnID])) ? 0 :parseFloat(this.ItemList[j+1].Values[aColumnID])) < (isNaN(parseFloat(this.ItemList[j].Values[aColumnID])) ? 0 :parseFloat(this.ItemList[j].Values[aColumnID]))) {
        tempValue = this.ItemList[j];
        this.ItemList[j] = this.ItemList[j+1];
        this.ItemList[j+1] = tempValue;
      }
    }
  }
}
TLsDynamicList.prototype.Number_Sort_DESC = function(aColumnID) {
  var tempValue,i,j;
  for (i = this.ItemList.length-1 - 1; i >= 0; i--) {
    for (j = 0; j <= i; j++) {
      if ((isNaN(parseFloat(this.ItemList[j+1].Values[aColumnID])) ? 0 :parseFloat(this.ItemList[j+1].Values[aColumnID])) > (isNaN(parseFloat(this.ItemList[j].Values[aColumnID])) ? 0 :parseFloat(this.ItemList[j].Values[aColumnID]))) {
        tempValue = this.ItemList[j];
        this.ItemList[j] = this.ItemList[j+1];
        this.ItemList[j+1] = tempValue;
      }
    }
  }
}
TLsDynamicList.prototype.ApplyFilter = function(aField,aCriteria,aMatchType,aCaseSensitive,aSubFilter,aInclusiveMatch,aRedraw) {
  var x,zVal,zFilterArray,zTempEvalCode = new Array(),zEvalCode,zTempArray = new Array(),zCriteria = aCriteria.split(',');
  if(!this.OriginalList){
    this.OriginalList = new Array();
    for(x=0;x<this.ItemList.length;x++){
      this.OriginalList[this.OriginalList.length] = this.ItemList[x];
    }
  }
  if(aField==''||aCriteria==''){
    for(x=0;x<this.OriginalList.length;x++){
      zTempArray[zTempArray.length] = this.OriginalList[x];
    }
    this.Filtered = false;
  }else{
    zFilterArray = (aSubFilter ? this.ItemList:this.OriginalList);
    zEvalCode = (aInclusiveMatch ? '':'!') + '(zFilterArray[x].Values.'+aField;
    if(!aCaseSensitive){
      zEvalCode += '.toLowerCase()';
    }
    switch(aMatchType.toLowerCase()){
      case 'partial':
        zEvalCode += '.indexOf(unescape(\''+escape(zCriteria[0])+ '\')' + (!aCaseSensitive ? '.toLowerCase()':'') +')>-1)';
        break;
      case 'startswith':
        zEvalCode += '.indexOf(unescape(\''+escape(zCriteria[0])+ '\')' + (!aCaseSensitive ? '.toLowerCase()':'') +')==0)';
        break;
      case 'equalto':
        zEvalCode += '==unescape(\'' + escape(zCriteria[0])+ '\')' + (!aCaseSensitive ? '.toLowerCase()':'') + ')';
        break;
      case 'greaterthan':
        zEvalCode += '>unescape(\'' + escape(zCriteria[0])+ '\')' + (!aCaseSensitive ? '.toLowerCase()':'') + ')';
        break;
      case 'lessthan':
        zEvalCode += '<unescape(\'' + escape(zCriteria[0])+ '\')' + (!aCaseSensitive ? '.toLowerCase()':'') + ')';
        break;
      case 'greaterthanequalto':
        zEvalCode += '>=unescape(\'' + escape(zCriteria[0])+ '\')' + (!aCaseSensitive ? '.toLowerCase()':'') + ')';
        break;
      case 'lessthanequalto':
        zEvalCode += '<=unescape(\'' + escape(zCriteria[0])+ '\')' + (!aCaseSensitive ? '.toLowerCase()':'') + ')';
        break;
      case 'betweeninclusive':
        zEvalCode += '>=unescape(\'' + escape(zCriteria[0])+ '\')' + (!aCaseSensitive ? '.toLowerCase()':'') + ')' + (aInclusiveMatch ? '&&':'||') + zEvalCode +'<=unescape(\''+ escape(zCriteria[1])+ '\')' + (!aCaseSensitive ? '.toLowerCase()':'') + ')';
        break;
      case 'betweenexclusive':
        zEvalCode += '>unescape(\'' + escape(zCriteria[0])+ '\')' + (!aCaseSensitive ? '.toLowerCase()':'') + ')' + (aInclusiveMatch ? '&&':'||') + zEvalCode +'<unescape(\''+ escape(zCriteria[1])+ '\')' + (!aCaseSensitive ? '.toLowerCase()':'') + ')';
        break;
      case 'in':
        for(x=0;x<zCriteria.length;x++){
          zTempEvalCode[zTempEvalCode.length] = zEvalCode +'==unescape(\'' + escape(zCriteria[x])+ '\')' + (!aCaseSensitive ? '.toLowerCase()':'') + ')';
        }
        zEvalCode = zTempEvalCode.join((aInclusiveMatch ? '||':'&&'));
        break;
    }
    for(x=0;x<zFilterArray.length;x++){
      if(eval(zEvalCode)){
        zTempArray[zTempArray.length] = zFilterArray[x];
      }
    }
    this.Filtered = true;
  }
  this.ItemList = new Array();
  for(x=0;x<zTempArray.length;x++){
    this.ItemList[this.ItemList.length] = zTempArray[x];
  }
  if (aRedraw){
    this.ReapplySort();
    this.DrawTable(false);
  }
}
TLsDynamicList.prototype.ReapplySort = function() {
  var zCol = this.FindColumn(this.SortColumn);
  if(zCol){
    this.SortColumn = '';
    this.SortOrder(zCol.ColumnId,zCol.SortType,false);
  }
}
TLsDynamicList.prototype.SortOrder = function(aColumnID,aDataType,aDrawTable,aSortDirection) {
  var zCol = this.FindColumn(aColumnID);
  if(this.SortColumn==aColumnID){
    zCol.SortDirection = (zCol.SortDirection=='ASC' ? 'DESC':'ASC');
    this.SortDirection = zCol.SortDirection;
  }
  aSortDirection = (aSortDirection&&aSortDirection!='' ? aSortDirection.toUpperCase():zCol.SortDirection);
  switch (aDataType){
    case 'STRING':
      (aSortDirection == 'DESC') ? this.Alpha_Sort_DESC(aColumnID) : this.Alpha_Sort_ASC(aColumnID);
      break;
    case 'DATE':
      (aSortDirection == 'DESC') ? this.Number_Sort_DESC(aColumnID) : this.Number_Sort_ASC(aColumnID);
      break;
    case 'NUMBER':
      (aSortDirection == 'DESC') ? this.Number_Sort_DESC(aColumnID) : this.Number_Sort_ASC(aColumnID);
      break;
  }
  this.SortColumn = aColumnID;
  this.SortColumnDataType = aDataType;
  if(this.CookieName){
    SetCookie(this.CookieName+'SORT',aColumnID+'|'+aSortDirection,'Never');
  }
  if (aDrawTable){
    this.DrawTable(false);
  }
}
TLsDynamicList.prototype.InitializeButtons = function() {
  var zOutput = new Array();
  zOutput[zOutput.length] = '<div id="ButtonDisplay_'+ this.Name +'" class="DynListButtonDisplay" style="margin-top: 15px">';
  zOutput[zOutput.length] = '<span id="PreviousButton_A_'+ this.Name +'" class="'+ this.NavButtonActiveClass +'" style="display: none; cursor:hand;" onClick="'+ this.Name +'.navigateItems(\'Previous\')"><< Previous '+ this.RowCount +'</span>';
  zOutput[zOutput.length] = '<span id="PreviousButton_I_'+ this.Name +'" class="'+ this.NavButtonInactiveClass +'"><< Previous '+ this.RowCount +'</span>';
  zOutput[zOutput.length] = '<span id="NextButton_A_'+ this.Name +'" class="'+ this.NavButtonActiveClass +'" style="display: none; cursor:hand;" onClick="'+ this.Name +'.navigateItems(\'Next\')">Next '+ this.RowCount +' >></span>';
  zOutput[zOutput.length] = '<span id="NextButton_I_'+ this.Name +'" class="'+ this.NavButtonInactiveClass +'" style="display: none;">Next '+ this.RowCount +' >></span>';
  zOutput[zOutput.length] = '<span id="ShowAllButton_'+ this.Name +'" class="'+ this.NavButtonActiveClass +'" style="display: none; cursor:hand;" onClick="'+ this.Name +'.navigateItems(\'ViewAll\')">'+ (this.ShowAllButtonText ? this.ShowAllButtonText:'View All ('+ this.ItemList.length +')') +'</span>';
  zOutput[zOutput.length] = '<span id="FirstButton_'+ this.Name +'" class="'+ this.NavButtonActiveClass +'" style="display: none; cursor:hand;" onClick="'+ this.Name +'.navigateItems(\'First\')"><< First '+ this.RowCount +'</span>';
  zOutput[zOutput.length] = '</div>';
  if(document.getElementById('dvButtonContainer_'+this.Name)){
    document.getElementById('dvButtonContainer_'+this.Name).innerHTML = zOutput.join('\n');
  }
  if (this.ItemList.length <= this.RowCount&&document.getElementById('dvButtonContainer_'+this.Name)){
    document.getElementById('dvButtonContainer_'+this.Name).style.display = 'none';
  }
  if (this.ItemList.length > this.RowCount){
    document.getElementById('NextButton_A_'+ this.Name).style.display = 'block';
    if (this.ShowViewAllButton == 'Y'){
      document.getElementById('ShowAllButton_'+ this.Name).style.display = 'block';
    }
  }else{
    document.getElementById('PreviousButton_I_'+ this.Name).style.display = 'none';
  }
}
TLsDynamicList.prototype.QuickSearch = function() {
  this.QuickSearchLastCriteria = this.QuickSearchCriteria;
  var x,zCol;
  var zTempArray = new Array();
  if(!this.OriginalList){
    this.OriginalList = new Array();
    for(x=0;x<this.ItemList.length;x++){
      this.OriginalList[this.OriginalList.length] = this.ItemList[x];
    }
  }
  var zFuncBody;
  var zCondition = new Array();
  var zColIds = this.QuickSearchTitles.split(',');
  if(this.QuickSearchCriteria!=''){
    for(x=0;x<zColIds.length;x++){
      zCol = this.FindColumn(zColIds[x]);
      if(zCol){
        zCondition[zCondition.length] = 'aItem.Values[\''+zCol.ColumnId+'\'].toUpperCase().indexOf('+ this.Name +'.QuickSearchCriteria)!=-1';
      }
    }
  }
  if(zCondition.length==0){ zCondition[zCondition.length] = true; }
  zFuncBody = 'return ('+ zCondition.join('||') +');';
  var zFunction = new Function('aItem',zFuncBody);
  for(x=0;x<this.OriginalList.length;x++){
    if(zFunction(this.OriginalList[x])){
      zTempArray[zTempArray.length] = this.OriginalList[x];
    }
  }
  this.ItemList = new Array();
  for(x=0;x<zTempArray.length;x++){
    this.ItemList[x] = zTempArray[x];
  }
  this.Filtered = (zTempArray.length==this.OriginalList.length ? false:true);
  this.navigateItems('First');
  this.ReapplySort();
  this.DrawTable(false);
}
TLsDynamicList.prototype.InitializeQuickSearch = function(aInitialSort) {
  var zOutput = new Array();
  zOutput[zOutput.length] = '<div id="'+ this.Name +'_QuickSearch" style="text-align:right;width:95%;">';
  zOutput[zOutput.length] = '<input type="text" id="'+ this.Name +'_QuickSearchEntry" onkeydown="TLsDynamicList.ClearQuickSearchTimeout('+this.Name+');" onkeyup="TLsDynamicList.SetQuickSearchTimeout('+this.Name+',this.value);" onblur="TLsDynamicList.SetQuickSearchTimeout('+this.Name+',this.value);">';
  zOutput[zOutput.length] = '<a href="javascript:void(TLsDynamicList.SetQuickSearchTimeout('+ this.Name +',document.getElementById(\''+ this.Name +'_QuickSearchEntry\').value));" target="_self"><img src="/l.c.bin/I/2803427/search_12.gif" width="12" height="12" border="0"></a>';
  zOutput[zOutput.length] = '</div>';
  document.write(zOutput.join('\n'));
}
TLsDynamicList.prototype.ApplyAllFilters = function(aRedraw) {
  var x,zElement;
  for(x=0;x<this.ColumnList.length;x++){
    if(this.ColumnList[x].FilterElementId){
      zElement = document.getElementById(this.ColumnList[x].FilterElementId);
      if(zElement.type=='text'){
        this.ColumnList[x].FilterCriteria = zElement.value;
      }else{
        this.ColumnList[x].FilterCriteria = zElement.options[zElement.selectedIndex].value;
      }
    }
  }
  this.ApplyColumnFilters(aRedraw);
}
TLsDynamicList.prototype.ResetAllFilters = function() {
  var x,zElement;
  for(x=0;x<this.ColumnList.length;x++){
    if(this.ColumnList[x].FilterElementId){
      zElement = document.getElementById(this.ColumnList[x].FilterElementId);
      this.ColumnList[x].FilterCriteria = '';
      if(zElement.type=='text'){
        zElement.value = '';
      }else{
        zElement.selectedIndex = 0;
      }
    }
  }
  this.ApplyColumnFilters();
}
TLsDynamicList.prototype.Initialize = function(aInitialSort) {
  if (this.Initialized) {return};
  if(this.QuickSearchTitles){
    this.InitializeQuickSearch();
  }
  if(this.DisplayFilterButtons){
    document.write('<div id="'+ this.Name +'_FilterButtons" style="text-align:right;width:95%;"><input type="button" value="Apply Filters" class="SubmitButton" onclick="'+ this.Name +'.ApplyAllFilters();"> <input type="button" class="SubmitButton" value="Remove Filters" onclick="'+ this.Name +'.ResetAllFilters();"></div>');
  }
  document.write('<div class="'+this.Name+'" style="width:100%" id="dvAllContent_'+this.Name+'"></div>');
  document.write('<div id="'+ this.Name +'_Customize"></div>');
  if(this.DisplayNavigation){
    document.write('<div id="dvButtonContainer_'+this.Name+'"></div>');
  }
  document.write('<div id="dvCheckboxes_'+this.Name+'"></div>');
  this.InitializeCheckboxes();
  if(this.DisplayNavigation){
    this.InitializeButtons();
  }
  this.InitialSort(aInitialSort);
  this.InitialColumnDisplay();
  this.Initialized = true;
}
TLsDynamicList.prototype.InitialColumnDisplay = function() {
  var zValues,x,zCol;
  if(this.CookieName&&!this.DisableCustView){
    zValues = GetCookieValue(this.CookieName+'DISPLAY').split(',');
    for(x=0;x<zValues.length;x++){
      zCol = this.FindColumn(zValues[x]);
      if(zCol&&zCol.Visible){
        zCol.HideColumn = true;
      }
    }
  }
  return;
}
TLsDynamicList.prototype.InitialSort = function(aInitialSort) {
  var zValue,zParts,zCol,zDir,zSortColumn;
  if(this.CookieName){
    zValue = GetCookieValue(this.CookieName+'SORT');
    zParts = zValue.split('|'); // ColumnID|Direction
    zCol   = this.FindColumn(zParts[0]);
    zDir   = zParts[1];
  }
  if(!zCol){
    if (aInitialSort && this.SortColumn){
      this.FindColumn(this.SortColumn).SortDirection = this.SortDirection;
      zSortColumn = this.SortColumn;
      this.SortColumn = '';
      this.SortOrder(zSortColumn,this.SortColumnDataType,false);
    }
  }else if(zCol&&zDir){
    zCol.SortDirection       = zDir;
    this.SortDirection       = zCol.SortDirection;
    this.SortColumn          = '';
    this.SortColumnDataType  = zCol.SortType;
    this.SortOrder(zCol.ColumnId,zCol.SortType,false,zDir);
  }
  return;
}
TLsDynamicList.prototype.InitializeCheckboxes = function() {
  var zCheckboxesDiv = document.getElementById('dvCheckboxes_'+this.Name);
  if(zCheckboxesDiv){
    var zHiddenInputArray = new Array();
    var zCol, zItem, zCurrentValue, zCurrentDisabled;
    for(var i = 0; i < this.ColumnList.length; i++) {
      if(this.ColumnList[i].DataType == 'CHECKBOX') {
        zCol = this.ColumnList[i];
        for(var j = 0; j < this.ItemList.length; j++) {
          zItem = this.ItemList[j];
          zCurrentValue = "";
          if(zCol.SelectedColumn && zItem.Values[zCol.SelectedColumn] && zItem.Values[zCol.SelectedColumn] == 'Y') {
            zCurrentValue = zItem.Values[zCol.ValueColumn];
            zCurrentDisabled = '';
          }
          else {
            zCurrentDisabled = 'disabled';
          }
          zHiddenInputArray[zHiddenInputArray.length] = '<input type="hidden" name="inp_Checkbox_'+zCol.ColumnId+'" id="inp_Checkbox_'+zCol.ColumnId+'_'+zItem.ItemId+'" value="'+zCurrentValue+'" '+zCurrentDisabled+' />';
        }
      }
    }
    zCheckboxesDiv.innerHTML = zHiddenInputArray.join('');
  }
  return true;
}
function toggleCustomizeView(aList) {
  var zCustomizeView = document.getElementById(aList.Name +'CustomizeDiv');
  if (zCustomizeView.style.display == 'none'){
    zCustomizeView.style.display = 'block';
  }else{
    zCustomizeView.style.display = 'none';
  }
}
TLsDynamicList.prototype.DrawTable = function(aInitialSort) {
  if(!this.OriginalList){
    this.OriginalList = new Array();
    for(var x=0;x<this.ItemList.length;x++){
      this.OriginalList[this.OriginalList.length] = this.ItemList[x];
    }
  }
  var zStartRow,zEndRow, zArrow,zI,zValue;
  this.Initialize(aInitialSort);
  var zColList = this.ColumnList;
  var zItemList = this.ItemList;
  var zCol;
  var zItem,zTemp;
  var zHeadingHtml = '';
  var zVisibleCount = 0;
  var zUseFilterHtml = false;
  var zFilterHtml = '';
  var zFilterHtmlArray = new Array();
  var zTempFilterArray;
  var zTempFilterObject;
  var zTempSelectOptions;
  var zHeadingHtmlArray = new Array();
  var zCustomizeHtml = '';
  var zCustomizeHtmlArray = new Array();
  var zItemHtmlArray = new Array();
  var zAllItemsHtmlArray = new Array();
  var zColHeadDisplayText = '';
  var zDisplayColumnID = '';
  var zCellContent = '';
  var zAllContentDiv = document.getElementById('dvAllContent_'+this.Name);
  var zChecked = '';
  var zFooterHtml = '';
  var zFooterHtmlArray = new Array();
  var zTempArray;
  var zSortedClass;
  var zArrowUpImgHTML = ' <img class="DynListUpArrow" border=0 src="'+this.UpArrowSrc+'" width="'+this.ArrowWidth+'" height="'+this.ArrowHeight+'" />';
  var zArrowDownImgHTML = ' <img class="DynListDownArrow" border=0 src="'+this.DownArrowSrc+'" width="'+this.ArrowWidth+'" height="'+this.ArrowHeight+'" />';
  var zLeftPlaceHolderArrowHTML = ' <img class="DynListPlaceHolderImageLeft" border=0 src="'+this.PlaceHolderArrowSrc+'" width="'+this.ArrowWidth+'" height="'+this.ArrowHeight+'" />';
  var zRightPlaceHolderArrowHTML = ' <img class="DynListPlaceHolderImageRight" border=0 src="'+this.PlaceHolderArrowSrc+'" width="'+this.ArrowWidth+'" height="'+this.ArrowHeight+'" />';
  for (zI = 0; zI < zColList.length; zI++) {
    zCol = zColList[zI];
    if (zCol.Visible) {
      zVisibleCount++;
      if(zCol.Visible && !zCol.DisableCustView) {
        zCustomizeHtmlArray[zCustomizeHtmlArray.length] = '<div><input type="checkbox" id="'+ this.Name +'_Cust'+ zCol.ColumnId +'" onClick="'+this.Name+'.ToggleColumnVisibility(\''+zCol.ColumnId+'\');"'+ (!zCol.HideColumn ? ' checked' : '') +'><label for="'+ this.Name +'_Cust'+ zCol.ColumnId +'" class="DynListCustomizeLabel">'+ (zCol.DisplayText!='' ? zCol.DisplayText:'Column '+ zVisibleCount)+'</label></div>';
      }
      if(!zCol.HideColumn){
        zSortedClass = (this.SortColumn==zCol.ColumnId ? ' Sorted '+ (zCol.SortDirection=='DESC' ? 'Desc':'Asc'):'');
        zArrow = (this.SortColumn==zCol.ColumnId ? (zCol.SortDirection=='DESC' ? zArrowUpImgHTML:zArrowDownImgHTML) : zRightPlaceHolderArrowHTML);
        if(zCol.DataType == 'CHECKBOX') {
          zColHeadDisplayText = zCol.DisplayText+'<input type="checkbox" name="checkbox_'+zCol.ColumnId+'" id="checkbox_'+zCol.ColumnId+'" value="ALL" onClick="'+this.Name+'.SelectAllItems(\''+zCol.ColumnId+'\',this.checked);" />';
        }
        else {
          zColHeadDisplayText = zCol.DisplayText;
        }
        if (zCol.Sortable && !this.DisableSorting){
          zHeadingHtmlArray[zHeadingHtmlArray.length] = '<th id="th_'+zCol.ColumnId+'" class="th_'+zCol.ColumnId + zSortedClass +'" onClick="'+this.Name+'.SortOrder(\''+zCol.ColumnId+'\',\''+zCol.SortType+'\',\'true\')">'+zLeftPlaceHolderArrowHTML+zColHeadDisplayText+zArrow+'</th>';
        }
        else{
          zHeadingHtmlArray[zHeadingHtmlArray.length] = '<th id="th_'+zCol.ColumnId+'" class="th_'+zCol.ColumnId+'">'+zColHeadDisplayText+'</th>';
        }
      }
    }
  }
  if(aInitialSort){
    if(this.ShowCustomizeView) {
      zCustomizeHtml = '<span onClick="toggleCustomizeView('+ this.Name +');" class="'+this.ActiveButtonClass+' DynListCustomizeButton">Customize View</span><br>'
                     + '<div id="'+ this.Name +'CustomizeDiv" class="DynListCustomizeDiv" style="display: none">'
                     +   '<table cellpadding="2" cellspacing="0" width="100%">'
                     +     '<tr>'
                     +       '<td class="Title" style="font-size: 9pt">Customize View</td>'
                     +       '<td align="right" class="Title"><span onClick="toggleCustomizeView('+ this.Name +');" class="DynListCusomizeClose">x</span></td>'
                     +     '</tr>'
                     +   '</table>'
                     +   zCustomizeHtmlArray.join('\n')
                     + '</div>';
    }
    document.getElementById(this.Name+'_Customize').innerHTML = zCustomizeHtml;
    this.ApplyAllFilters(!this.ShowAllOnLoad);
    if(this.ShowAllOnLoad){
      this.navigateItems('ViewAll',true);
    }
    return;
  }
  if(this.DisplayFilterRow){
    for (zI = 0; zI < zColList.length; zI++) {
      zCol = zColList[zI];
      if (zCol.Visible&&!zCol.HideColumn) {
        switch(zCol.FilterType){
          case 'TEXT':
            zFilterHtmlArray[zFilterHtmlArray.length] = '<td nowrap><input ColumnId="'+ zCol.ColumnId +'" type="text" id="'+ this.Name +'_'+ zCol.ColumnId +'_Filter" value="'+ zCol.FilterCriteria +'"'+ ((this.FilterOnChange&&!fGlobalPointer.Browser.isSafari) ? ' onBlur="setTimeout(\'TLsDynamicList.FilterColumn('+ this.Name +',\\\''+ zCol.ColumnId +'\\\',document.getElementById(\\\''+this.Name +'_'+ zCol.ColumnId +'_Filter\\\').value)\',10);"':'') +'><a href="javascript:void(setTimeout(\'TLsDynamicList.FilterColumn('+ this.Name +',\\\''+ zCol.ColumnId +'\\\',document.getElementById(\\\''+this.Name +'_'+ zCol.ColumnId +'_Filter\\\').value)\',10));" target="_self">'+ (this.FilterOnChange ? '<img src="/l.c.bin/I/2803427/search_12.gif" width="12" height="12" border="0">':'') +'</a></td>'
            zCol.FilterElementId = this.Name +'_'+ zCol.ColumnId +'_Filter';
            zCol.FilterMatchType = 'PARTIAL';
            break;
          case 'AUTODROPDOWN':
            zTempFilterArray = new Array();
            zTempFilterObject = new Object();
            zTempFilterArray[zTempFilterArray.length] = '<select ColumnId="'+ zCol.ColumnId +'" id="'+ this.Name +'_'+ zCol.ColumnId +'_Filter"'+ (this.FilterOnChange ? ' onChange="setTimeout(\'TLsDynamicList.FilterColumn('+ this.Name +',\\\''+ zCol.ColumnId +'\\\',document.getElementById(\\\''+this.Name +'_'+ zCol.ColumnId +'_Filter\\\').value)\',10);"':'') +'>';
            zTempFilterArray[zTempFilterArray.length] = '<option value=""'+ (zCol.FilterCriteria=='' ? ' selected':'') +'>'+ this.AutoDropDownShowAllText +'</option>';
            zTempSelectOptions = new Array();
            if(zCol.AutoDropDownSplitDelimiter){
              for(var zG=0;zG<this.OriginalList.length;zG++){
                zItem   = this.OriginalList[zG];
                zTemp   = {
                  Value   : zItem.Values[zCol.ColumnId].split(zCol.AutoDropDownSplitDelimiter),
                  Display : zItem.Values[(zCol.DisplayColumn!=''? zCol.DisplayColumn:zCol.ColumnId)].split(zCol.AutoDropDownSplitDelimiter)
                };
                for(var zH=0;zH<zTemp.Value.length;zH++){
                  zValue = (zCol.DataType=='DATE' ? parseInt(zTemp.Value[zH])+'.':zTemp.Value[zH]);
                  if(!zTempFilterObject[zValue+'']){
                    zTempFilterObject[zValue+''] = true;
                    zTempSelectOptions[zTempSelectOptions.length] = [zValue,(zCol.FilterCriteria==zValue ? ' selected':''),zTemp.Display[zH]];
                  }
                }
              }
            }else{
              for(var zL=0;zL<this.OriginalList.length;zL++){
                zItem = this.OriginalList[zL];
                zValue = (zCol.DataType=='DATE' ? parseInt(zItem.Values[zCol.ColumnId])+'.':zItem.Values[zCol.ColumnId]);
                if(!zTempFilterObject[zValue+'']){
                  zTempFilterObject[zValue+''] = true;
                  zTempSelectOptions[zTempSelectOptions.length] = [zValue,(zCol.FilterCriteria==zValue ? ' selected':''),zItem.Values[(zCol.DisplayColumn!=''? zCol.DisplayColumn:zCol.ColumnId)]];
                }
              }
            }
            if(zCol.DataType=='NUMBER'||zCol.DataType=='DATE'){
              zTempSelectOptions.sort(function(a,b){return a[0]-b[0];});
            }else{
              zTempSelectOptions.sort(function(a,b){
                var value1 = a[2].toLowerCase();
                var value2 = b[2].toLowerCase();
                if (value1 > value2) return(1);
                if (value1 < value2) return(-1);
                return(0);
              });
            }
            for(x=0;x<zTempSelectOptions.length;x++){
              zTempFilterArray[zTempFilterArray.length] = '<option value="'+ zTempSelectOptions[x][0] +'"'+ zTempSelectOptions[x][1] +'>'+ zTempSelectOptions[x][2] +'</option>';
            }
            zTempFilterArray[zTempFilterArray.length] = '</select>';
            zFilterHtmlArray[zFilterHtmlArray.length] = '<td nowrap>'+ zTempFilterArray.join('\n') +'</td>'
            zCol.FilterElementId = this.Name +'_'+ zCol.ColumnId +'_Filter';
            zCol.FilterMatchType = (zCol.DataType=='DATE'||zCol.AutoDropDownSplitDelimiter ? 'PARTIAL':'EQUALTO');
            break;
          default:
            zFilterHtmlArray[zFilterHtmlArray.length] = '<td>&nbsp;</td>'
            break;
        }
      }
    }
    zFilterHtml = '<tr class="DynListFilterRow">'+ zFilterHtmlArray.join('\n') +'</tr>';
  }
  if(this.DisplayFooterRow){
    for (zI = 0; zI < zColList.length; zI++) {
      zCol = zColList[zI];
      if (zCol.Visible&&!zCol.HideColumn) {
        if(zCol.DataType=='NUMBER'){
          switch(zCol.FooterFormula){
            case 'SUM':
              zValue = 0;
              for(var zT=0;zT<this.ItemList.length;zT++){
                zItem = this.ItemList[zT];
                zValue += (isNaN(parseInt(zItem.Values[zCol.ColumnId])) ? 0:parseInt(zItem.Values[zCol.ColumnId]));
              }
              zFooterHtmlArray[zFooterHtmlArray.length] = '<th class="th_'+zCol.ColumnId+'"><span class="FooterLabel Sum">Sum: </span>'+ zCol.FooterFormatFunction(zValue) +'</th>';
              break;
            case 'AVERAGE':
              zValue = 0;
              for(var zS=0;zS<this.ItemList.length;zS++){
                zItem = this.ItemList[zS];
                zValue += (isNaN(parseInt(zItem.Values[zCol.ColumnId])) ? 0:parseInt(zItem.Values[zCol.ColumnId]));
              }
              zFooterHtmlArray[zFooterHtmlArray.length] = '<th class="th_'+zCol.ColumnId+'"><span class="FooterLabel Average">Average: </span>'+ zCol.FooterFormatFunction((zValue/this.ItemList.length)) +'</th>';
              break;
            case 'MEDIAN':
              zTempArray = [];
              for(var zM=0;zM<this.ItemList.length;zM++){
                zItem = this.ItemList[zM];
                zTempArray[zTempArray.length] = (isNaN(parseInt(zItem.Values[zCol.ColumnId])) ? 0:parseInt(zItem.Values[zCol.ColumnId]));
              }
              zTempArray.sort(function(a,b){return a-b;});
              if(zTempArray.length%2==1){
                zValue = zTempArray[Math.floor(zTempArray.length/2)];
              }else{
                zValue = (zTempArray[(zTempArray.length/2)-1]+zTempArray[(zTempArray.length/2)])/2
              }
              zFooterHtmlArray[zFooterHtmlArray.length] = '<th class="th_'+zCol.ColumnId+'"><span class="FooterLabel Median">Median: </span>'+ zCol.FooterFormatFunction(zValue) +'</th>';
              break;
            default:
              zFooterHtmlArray[zFooterHtmlArray.length] = '<th class="th_'+zCol.ColumnId+'">&nbsp;</th>';
              break;
          }
        }else{
          zFooterHtmlArray[zFooterHtmlArray.length] = '<th class="th_'+zCol.ColumnId+'">&nbsp;</th>';
        }
      }
    }
    zFooterHtml = '<tr class="DynListFooterRow">'+ zFooterHtmlArray.join('\n') +'</tr>';
  }
  if(this.ShowHeaderRow) {
    zHeadingHtml = '<tr class="DynListHeaderRow">'+zHeadingHtmlArray.join('\n')+'</tr>';
  }
  if(this.ViewAll){
    zStartRow = 0;
    zEndRow = zItemList.length;
  }
  else {
    zStartRow = this.StartRow;
    zEndRow = ((zItemList.length < this.RowCount) ? zItemList.length : this.EndRow);
  }
  for (var zJ =  zStartRow; zJ < zEndRow; zJ++) {
    zItem = zItemList[zJ];
    for (var zK = 0; zK < zColList.length; zK++) {
      zCol = zColList[zK];
      if (zCol.Visible&&!zCol.HideColumn) {
        zSortedClass = (this.SortColumn==zCol.ColumnId ? ' Sorted '+ (zCol.SortDirection=='DESC' ? 'Desc':'Asc'):'');
        switch (zCol.DataType) {
          case 'CHECKBOX':
            if(zCol.SelectedColumn && zItem.Values[zCol.SelectedColumn] && zItem.Values[zCol.SelectedColumn] == 'Y') {
              zChecked = 'checked';
            }
            else {
              zChecked = '';
            }
            zCellContent = '<div style="text-align: center;"><input type="checkbox" name="inp_TemporaryCheck_'+zCol.ColumnId+'_'+zItem.ItemId+'" id="inp_TemporaryCheck_'+zCol.ColumnId+'_'+zItem.ItemId+'" value="'+zItem.Values[zCol.ValueColumn]+'" '+zChecked+' onClick="'+this.Name+'.SelectItem(\''+zItem.ItemId+'\',\''+zCol.ColumnId+'\',this.checked);" /></div>';
            break;
          case 'ACTIVITYOPTION':
            zCellContent = '<span class="ActivityOptionTriggerContainer"><a href="javascript: void(0);" onclick="'+zCol.ActivityOptionType+'.DisplayOptions(event,this,unescape(\''+zItem.Values[zCol.ValueColumn]+'\'));" class="ActivityOptionTrigger" target="_self" title="Options">'+zItem.Values[zCol.DisplayColumn]+'</a></span>';
            break;
          default:
            if (zCol.DisplayColumn != '') {
              zDisplayColumnID = zCol.DisplayColumn;
            }
            else {
              zDisplayColumnID = zCol.ColumnId;
            }
            zCellContent = zCol.RowFormatFunction(zItem.Values[zDisplayColumnID]);
        }
        if(zCellContent==''){
          zCellContent = '&nbsp;';
        }
        zItemHtmlArray[zItemHtmlArray.length] = '<td class="td_'+zCol.ColumnId + zSortedClass + '">'+zCellContent+'</td>';
      }
    }
    zAllItemsHtmlArray[zAllItemsHtmlArray.length] = '<tr id="'+ this.Name +'_'+ zItem.ItemId +'_Row" class="DynListRow '+this.Name+((zJ%2 == 0) ? '_even Even' : '_odd Odd')+((zItem.Values['AdditionalClasses'] != null) ? ' ' + zItem.Values['AdditionalClasses'] : '')+'"'+ (this.RowOnClickFunction ? ' style="cursor:pointer;cursor:hand;" onclick="'+ this.Name +'.RowClick(\''+ zItem.ItemId +'\',this);"':'') +'>'
                                                  +   zItemHtmlArray.join('\n')
                                                  + '</tr>';
    zItemHtmlArray = new Array();
  }
  zAllContentDiv.innerHTML = '<table class="DynList zBodyTextTable" id="'+ this.Name +'_MainTable">'
                           +   zHeadingHtml
                           +   zFilterHtml
                           +   zAllItemsHtmlArray.join('\n')
                           +   zFooterHtml
                           + '</table>';
  if(document.getElementById('dvButtonContainer_'+this.Name)){
    document.getElementById('dvButtonContainer_'+this.Name).style.display = (this.ItemList.length <= this.RowCount ? 'none':'block');
  }
  (this.PostDrawFunction ? eval(this.PostDrawFunction) : '');
  if(this.OnDrawFunction){
    this.OnDrawFunction();
  }
  return;
}
TLsDynamicList.prototype.ToggleColumnVisibility = function(aColumnId, aVisible) {
  var zColumn = this.FindColumn(aColumnId);
  if (!zColumn) {return};
  var aNewHidden = (typeof(aVisible)!='undefined') ? !aVisible : (!zColumn.HideColumn);
  var aCurrentHidden = zColumn.HideColumn;
  if (aNewHidden == aCurrentHidden) {return};
  var zVisibilityStr = (aNewHidden) ? 'none' : 'block';
  zColumn.HideColumn = aNewHidden;
  if(this.CookieName){
    var zCookieVal = new Array();
    for(var x=0;x<this.ColumnList.length;x++){
      if(this.ColumnList[x].HideColumn&&this.ColumnList[x].Visible){
        zCookieVal[zCookieVal.length] = this.ColumnList[x].ColumnId
      }
    }
    SetCookie(this.CookieName+'DISPLAY',zCookieVal.join(','),'Never');
  }
  this.DrawTable(false);
  return;
}
TLsDynamicList.prototype.navigateItems = function(aDirection,aRedraw) {
  aRedraw = isTrue(aRedraw,true);
  var zItemList = this.ItemList;
  if(this.DisplayNavigation){
    switch(aDirection) {
      case 'Previous':
        this.EndRow = this.StartRow;
        this.StartRow = (Number(this.StartRow) - Number(this.RowCount));
        break;
      case 'Next':
        this.StartRow = this.EndRow;
        this.EndRow = (Number(this.EndRow) + Number(this.RowCount));
        break;
      case 'ViewAll':
        this.StartRow = 0;
        this.EndRow = zItemList.length;
        document.getElementById('FirstButton_'+this.Name).style.display = 'block';
        break;
      case 'First':
        this.StartRow = 0;
        this.EndRow = this.RowCount;
        if(zItemList.length>this.RowCount){
          document.getElementById('FirstButton_'+this.Name).style.display = 'none';
          document.getElementById('ShowAllButton_'+this.Name).style.display = 'block';
        }
    }
    document.getElementById('ShowAllButton_'+this.Name).innerHTML = (this.ShowAllButtonText ? this.ShowAllButtonText:'View All ('+ this.ItemList.length +')');
    if(zItemList.length<=this.RowCount){
      document.getElementById('ShowAllButton_'+this.Name).style.display = 'none';
    }
    if (zItemList.length <= this.EndRow||zItemList.length <= this.RowCount) {
      this.EndRow=zItemList.length;
      document.getElementById('NextButton_A_'+this.Name).style.display = 'none';
      document.getElementById('NextButton_I_'+this.Name).style.display = 'block';
    }else{
      document.getElementById('NextButton_A_'+this.Name).style.display = 'block';
      document.getElementById('NextButton_I_'+this.Name).style.display = 'none';
    }
    if (this.StartRow <= 0) {
      this.StartRow = 0;
      document.getElementById('PreviousButton_A_'+this.Name).style.display = 'none';
      document.getElementById('PreviousButton_I_'+this.Name).style.display = 'block';
    }else{
      document.getElementById('PreviousButton_A_'+this.Name).style.display = 'block';
      document.getElementById('PreviousButton_I_'+this.Name).style.display = 'none';
    }
    this.ViewAll = false;
    if (aDirection == 'ViewAll'){
      this.ViewAll = true;
      document.getElementById('NextButton_A_'+this.Name).style.display = 'none';
      document.getElementById('NextButton_I_'+this.Name).style.display = 'none';
      document.getElementById('PreviousButton_A_'+this.Name).style.display = 'none';
      document.getElementById('PreviousButton_I_'+this.Name).style.display = 'none';
      document.getElementById('ShowAllButton_'+this.Name).style.display = 'none';
    }
  }else{
    switch(aDirection) {
      case 'Previous':
        this.EndRow = this.StartRow;
        this.StartRow = (Number(this.StartRow) - Number(this.RowCount));
        break;
      case 'Next':
        this.StartRow = this.EndRow;
        this.EndRow = (Number(this.EndRow) + Number(this.RowCount));
        break;
      case 'ViewAll':
        this.StartRow = 0;
        this.EndRow = zItemList.length;
        break;
      case 'First':
        this.StartRow = 0;
        this.EndRow = this.RowCount;
    }
  }
  if(aRedraw){
    this.DrawTable();
  }
}
function toggleView(aColumn){
  (aColumn.style.display == 'block' ? aColumn.style.display='none' : aColumn.style.display='block');
}
TLsDynamicList.prototype.SelectItem = function(aItemId,aColumnId,aSelected) {
  var zCol = this.FindColumn(aColumnId);
  var zItem = this.FindItem(aItemId);
  if(zCol && zItem) {
    var zInput = document.getElementById("inp_Checkbox_"+zCol.ColumnId+"_"+zItem.ItemId);
    var zTempCheckbox = document.getElementById("inp_TemporaryCheck_"+zCol.ColumnId+"_"+zItem.ItemId);
    if(zTempCheckbox) {
      zTempCheckbox.checked = aSelected;
    }
    if(aSelected) {
      zItem.Values[zCol.SelectedColumn] = 'Y';
      if(zInput) {
        zInput.value = zItem.Values[zCol.ValueColumn];
        zInput.disabled = false;
      }
    }
    else {
      zItem.Values[zCol.SelectedColumn] = 'N';
      if(zInput) {
        zInput.value = '';
        zInput.disabled = true;
      }
    }
  }
  return true;
}
TLsDynamicList.prototype.SelectAllItems = function(aColumnId,aSelected) {
  for(var i = 0; i < this.ItemList.length; i++) {
    this.SelectItem(this.ItemList[i].ItemId,aColumnId,aSelected);
  }
  return true;
}
TLsDynamicList.prototype.RowClick = function(aItemId,aRow) {
  this.RowOnClickFunction(this.FindItem(aItemId),aRow);
}
/* This script and many more are available free online at
The JavaScript Source!! http://javascript.internet.com
Created by: Mr J | http://www.huntingground.net/ */

fCZU_ScrollDivscrollStep=1

fCZU_ScrollDivtimerLeft=""
fCZU_ScrollDivtimerRight=""

function fCZU_toLeft(id){
  document.getElementById(id).scrollLeft=0
}

function fCZU_scrollDivLeft(id,galleryid){
  clearTimeout(fCZU_ScrollDivtimerRight) 
  document.getElementById(id+'_'+galleryid).scrollLeft+=fCZU_ScrollDivscrollStep
  fCZU_ScrollDivtimerRight=setTimeout("fCZU_scrollDivLeft('"+id+"','"+galleryid+"')",5)
}

function fCZU_scrollDivRight(id,galleryid){
  clearTimeout(fCZU_ScrollDivtimerLeft)
  document.getElementById(id+'_'+galleryid).scrollLeft-=fCZU_ScrollDivscrollStep
  fCZU_ScrollDivtimerLeft=setTimeout("fCZU_scrollDivRight('"+id+"','"+galleryid+"')",5)
}

function fCZU_toRight(id){
  document.getElementById(id).scrollLeft=document.getElementById(id).scrollWidth
}

function fCZU_stopMe(galleryid){
  clearTimeout(fCZU_ScrollDivtimerRight) 
  clearTimeout(fCZU_ScrollDivtimerLeft)
}
var offsetfromcursorX=-7; //Customize x offset of tooltip
var offsetfromcursorY=15; //Customize y offset of tooltip
var offsetdivfrompointerX=0; //Customize x offset of tooltip DIV relative to pointer image
var offsetdivfrompointerY=0; //Customize y offset of tooltip DIV relative to pointer image. Tip: Set it to (height_of_pointer_image-1).
var ie=document.all;
var ns6=document.getElementById && !document.all;
var enabletip=false;

function fCZU_addwarning(){


 var pointerobj=document.all? document.all["ToolTipPointer"] : document.getElementById? document.getElementById("ToolTipPointer") : "";

var thealinks = document.getElementsByTagName("a");
if (!thealinks) { return; }
for(var x=0;x!=thealinks.length;x++){
if(thealinks[x].className == "addToolTip"){
thealinks[x].setAttribute("tooltiptext",thealinks[x].title);
thealinks[x].removeAttribute("title");
thealinks[x].setAttribute("toolposition",thealinks[x].rel);
thealinks[x].removeAttribute("rel");
thealinks[x].setAttribute("tipimagesrc",thealinks[x].name);
thealinks[x].onmouseover=function gomouseover(){ddrivetip(this.getAttribute("tooltiptext"),this.getAttribute("toolposition"),this.getAttribute("tipimagesrc"))};
thealinks[x].onmouseout=function gomouseout(){hideddrivetip();};
}
}
}

      var tooltipimgblank =  new Image(); tooltipimgblank.src = "../../czusys_images/x.gif";
      var tooltipimgload =  new Image(); tooltipimgload.src = "../../czusys_images/tooltiploadingmessage.gif";

function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body;
}
function ddrivetip(thetext, theposition, theimgsrc, thewidth, thecolor){
if (ie||ns6) {
	var tipobj=document.all? document.all["theToolTip"] : document.getElementById? document.getElementById("theToolTip") : "";
}
if (ns6||ie){
if (typeof thewidth!=="undefined") {tipobj.style.width=thewidth+"px";}
if (typeof thecolor!=="undefined" && thecolor!=="") {tipobj.style.backgroundColor=thecolor;}
if (ie||ns6) {
	var tipobjectText=document.all? document.all["theToolTipText"] : document.getElementById? document.getElementById("theToolTipText") : "";
	var tipobjectImage=document.all? document.all["theToolTipImg"] : document.getElementById? document.getElementById("theToolTipImg") : "";
}
tipobjectText.innerHTML=thetext;

if (theimgsrc!="") {
//  if (ie||ns6) {
//	 zToolNewImageObj=document.all? document.all[theimgsrc] : document.getElementById? document.getElementById(theimgsrc) : "";
//  }
	 zToolNewImageObj=document.getElementById(theimgsrc);
  if (tipobjectImage.src!=zToolNewImageObj.src) {
// alert(zToolNewImageObj.id);
//    alert(zToolNewImageObj.src);
    tipobjectImage.src=tooltipimgload.src;
    tipobjectImage.src=zToolNewImageObj.src;
  }
}
else {
  tipobjectImage.src=tooltipimgblank.src;
}
// tipobj.innerHTML=thetext;
tipobj.title=theposition;
enabletip=true;
return false;
}
}
function positiontip(e){
if (ie||ns6) {
	var tipobj=document.all? document.all["theToolTip"] : document.getElementById? document.getElementById("theToolTip") : "";
}
if (enabletip){
var nondefaultpos=false;
var curX=(ns6)?e.pageX : event.clientX+ietruebody().scrollLeft;
var curY=(ns6)?e.pageY : event.clientY+ietruebody().scrollTop;
var winwidth=ie&&!window.opera? ietruebody().clientWidth : window.innerWidth-20;
var winheight=ie&&!window.opera? ietruebody().clientHeight : window.innerHeight-20;
var rightedge=ie&&!window.opera? winwidth-event.clientX-offsetfromcursorX : winwidth-e.clientX-offsetfromcursorX;
var bottomedge=ie&&!window.opera? winheight-event.clientY-offsetfromcursorY : winheight-e.clientY-offsetfromcursorY;
var topedge=ie&&!window.opera? event.clientY-offsetfromcursorY : e.clientY-offsetfromcursorY;
var leftedge=(offsetfromcursorX<0)? offsetfromcursorX*(-1) : -1000;
if (rightedge<tipobj.offsetWidth){
tipobj.style.left=curX-tipobj.offsetWidth+"px";
nondefaultpos=true;
}
else if (curX<leftedge)
{tipobj.style.left="5px";}
else{
tipobj.style.left=curX+offsetfromcursorX-offsetdivfrompointerX+"px";
}
// if (bottomedge<tipobj.offsetHeight || document.getElementById('inpToolTipAboveBelow').value==bottomedge){
/*
if (bottomedge<tipobj.offsetHeight){
tipobj.style.top=curY-tipobj.offsetHeight-offsetfromcursorY+"px";
nondefaultpos=true;
}
else{
tipobj.style.top=curY+offsetfromcursorY+offsetdivfrompointerY+"px";
}
*/
zBrowser=(navigator.userAgent).toUpperCase();
if (zBrowser.indexOf('MAC') != -1) {
  zThisTestHeight=tipobj.offsetHeight-30;
}
else {
  zThisTestHeight=tipobj.offsetHeight;
}
// alert(topedge+'---'+zThisTestHeight+'---'+tipobj.title);
if (tipobj.title=="above" && topedge>zThisTestHeight){
 tipobj.style.top=curY-tipobj.offsetHeight-offsetfromcursorY+"px";
nondefaultpos=true;
}
else{
tipobj.style.top=curY+offsetfromcursorY+offsetdivfrompointerY+"px";
}

tipobj.style.visibility="visible";  
}
}
function hideddrivetip(){
if (ie||ns6) {
	var tipobj=document.all? document.all["theToolTip"] : document.getElementById? document.getElementById("theToolTip") : "";
}
if (ns6||ie){
enabletip=false;
tipobj.style.visibility="hidden";
tipobj.style.left="-1000px";
tipobj.style.backgroundColor='';
tipobj.style.width='';
}
}
 document.onmousemove=positiontip;
/******************************************************************************
Name:    Highslide JS
Version: 4.0.10 (November 25 2008)
Config:  default +events +unobtrusive +imagemap +slideshow +positioning +transitions +inline +ajax +iframe +flash +packed
Author:  Torstein Hønsi
Support: http://highslide.com/support

Licence:
Highslide JS is licensed under a Creative Commons Attribution-NonCommercial 2.5
License (http://creativecommons.org/licenses/by-nc/2.5/).

You are free:
	* to copy, distribute, display, and perform the work
	* to make derivative works

Under the following conditions:
	* Attribution. You must attribute the work in the manner  specified by  the
	  author or licensor.
	* Noncommercial. You may not use this work for commercial purposes.

* For  any  reuse  or  distribution, you  must make clear to others the license
  terms of this work.
* Any  of  these  conditions  can  be  waived  if  you  get permission from the 
  copyright holder.

Your fair use and other rights are in no way affected by the above.
******************************************************************************/
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('q k={U:{8t:\'9E\',9M:\'ch...\',9L:\'7t K ci\',bb:\'7t K cg K cf\',8x:\'cd K ce C (f)\',aF:\'cj by <i>9e 9j</i>\',aE:\'ck K cp 9e 9j co\',7Q:\'9s\',7I:\'9V\',7R:\'9Q\',77:\'9h\',71:\'9h (cn)\',93:\'cl\',9N:\'9f\',9Z:\'9f 1A (9a)\',9C:\'98\',9B:\'98 1A (9a)\',7N:\'9s (7v 1h)\',7J:\'9V (7v 3x)\',7B:\'9Q\',9K:\'cm C\',3m:\'cc %1 ca %2\',8U:\'7t K 1Y 2w, c1 a3 c2 K 3e. c0 7v bX Q 1x a3 2P.\'},4S:\'N/bY/\',aq:\'c3.4T\',6n:\'c4.4T\',7o:56,ar:56,4r:15,8w:15,4N:15,6I:15,4j:c9,9F:0.75,7X:J,8b:5,3s:2,8c:3,ak:\'43 3x\',an:1,7q:1j,b4:J,aM:\'c8://N.c7\',8X:J,3C:[],6k:aL,3E:0,8g:50,6b:1j,7c:J,4l:J,3t:\'5L\',8B:J,4h:\'1U\',8P:\'1U\',9n:H,9d:H,8i:J,3Y:a2,5x:a2,5N:J,1P:\'c6-cq\',6g:\'N-W\',73:{2H:\'<1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{k.U.93}"><1u></1u></1u>\'+\'</1f></1f>\'},54:[],7a:J,V:[],72:[\'5N\',\'4h\',\'8P\',\'9n\',\'9d\',\'1P\',\'3s\',\'cR\',\'cQ\',\'cO\',\'96\',\'cP\',\'bW\',\'cF\',\'94\',\'8i\',\'3I\',\'5t\',\'3C\',\'3E\',\'7M\',\'L\',\'R\',\'6b\',\'7c\',\'4l\',\'cw\',\'cx\',\'cv\',\'2t\',\'8B\',\'3N\',\'4x\',\'3t\',\'7m\',\'6g\',\'3Y\',\'5x\',\'9I\',\'cu\',\'2N\',\'3K\',\'be\',\'br\',\'1e\'],1L:[],8v:0,7h:{x:[\'aZ\',\'1h\',\'4o\',\'3x\',\'aR\'],y:[\'5u\',\'1c\',\'8z\',\'43\',\'6t\']},6G:{},94:{},96:{},7m:{9m:{},2b:{},9q:{}},6c:[],5r:[],4p:{},42:[],6P:[],4X:[],69:{},8y:{},1p:(1b.4L&&!1F.3P),4W:/am/.Y(3M.68),53:/ct.+bl:1\\.[0-8].+bk/.Y(3M.68),$:B(1v){D 1b.8N(1v)},2k:B(1T,4q){1T[1T.14]=4q},1a:B(9U,3V,3R,58,9R){q el=1b.1a(9U);m(3V)k.8r(el,3V);m(9R)k.O(el,{7w:0,7y:\'1E\',8V:0});m(3R)k.O(el,3R);m(58)58.1K(el);D el},8r:B(el,3V){Q(q x 2X 3V)el[x]=3V[x]},O:B(el,3R){Q(q x 2X 3R){m(k.1p&&x==\'20\'){m(3R[x]>0.99)el.F.cz(\'7S\');I el.F.7S=\'cE(20=\'+(3R[x]*2U)+\')\'}I el.F[x]=3R[x]}},3S:B(){q 1T=3M.9H.6Q("cD");D 1T[1]?9D(1T[1]):H},6R:B(){q d=1b,w=1F,3U=d.8n&&d.8n!=\'bv\'?d.4V:d.19;q b=d.19;q 9G=(w.6m&&w.9X)?w.6m+w.9X:16.2M(b.9O,b.2u),9J=(w.5X&&1F.a0)?w.5X+w.a0:16.2M(b.9A,b.1V),6A=k.1p?3U.9O:(d.4V.8R||5W.6m),6M=k.1p?16.2M(3U.9A,3U.8M):(d.4V.8M||5W.5X);q L=k.1p?3U.8R:(d.4V.8R||5W.6m),R=k.1p?3U.8M:5W.5X;D{6A:16.2M(6A,9G),6M:16.2M(6M,9J),L:L,R:R,5T:k.1p?3U.5T:bx,5Y:k.1p?3U.5Y:bA}},6a:B(el){m(/5M/i.Y(el.3w)){q 6s=1b.2E(\'1B\');Q(q i=0;i<6s.14;i++){q u=6s[i].bz;m(u&&u.23(/^.*?#/,\'\')==el.3h.4e){el=6s[i];5n}}}q p={x:el.9w,y:el.6Y};4B(el.9x){el=el.9x;p.x+=el.9w;p.y+=el.6Y;m(el!=1b.19&&el!=1b.4V){p.x-=el.5T;p.y-=el.5Y}}D p},2v:B(a,2b,3Q,S){m(!a)a=k.1a(\'a\',H,{1w:\'1E\'},k.26);m(1z a.5P==\'B\')D 2b;m(S==\'3G\'){Q(q i=0;i<k.42.14;i++){m(k.42[i]&&k.42[i].a==a){k.42[i].al();k.42[i]=H;D 1j}}k.9o=J}1t{1N k.5i(a,2b,3Q,S);D 1j}1s(e){D J}},8A:B(a,2b,3Q){D k.2v(a,2b,3Q,\'3G\')},7z:B(){D k.1a(\'1f\',{18:\'N-3G-T\',2s:k.8d(k.73.9v)})},4f:B(el,3w,18){q 11=el.2E(3w);Q(q i=0;i<11.14;i++){m((1N 4k(18)).Y(11[i].18)){D 11[i]}}D H},8d:B(s){s=s.23(/\\s/g,\' \');q 29=/{k\\.U\\.([^}]+)\\}/g,55=s.24(29),U;m(55)Q(q i=0;i<55.14;i++){U=55[i].23(29,"$1");m(1z k.U[U]!=\'2g\')s=s.23(55[i],k.U[U])}D s},78:B(){q 11=1b.2E(\'a\');Q(q i=0;i<11.14;i++){q S=k.9z(11[i]);m(S&&!11[i].9y){(B(){q t=S;m(k.1r(k,\'bN\',{6w:11[i],S:t})){11[i].2y=(S==\'2w\')?B(){D k.2v(j)}:B(){D k.8A(j,{2t:t})}}})();11[i].9y=J}}m(!k.aT)21(k.78,50);I k.5m()},9z:B(el){m(el.6N==\'N\')D\'2w\';I m(el.6N==\'N-2T\')D\'2T\';I m(el.6N==\'N-1d\')D\'1d\';I m(el.6N==\'N-3i\')D\'3i\'},7n:B(a){Q(q i=0;i<k.4X.14;i++){m(k.4X[i][0]==a){q c=k.4X[i][1];k.4X[i][1]=c.4u(1);D c}}D H},aS:B(e){q 1T=k.8T();Q(q i=0;i<1T.4K.14;i++){q a=1T.4K[i];m(k.3F(a,\'2t\')==\'2T\'&&k.3F(a,\'8B\'))k.2k(k.6P,a)}k.7W(0)},7W:B(i){m(!k.6P[i])D;q a=k.6P[i];q 57=k.5d(k.3F(a,\'7M\'));m(!57)57=k.7z();q 2T=1N k.6L(a,57,1);2T.8a=B(){};2T.36=B(){k.2k(k.4X,[a,57]);k.7W(i+1)};2T.84()},97:B(){q 7V=0,6C=-1;Q(q i=0;i<k.V.14;i++){m(k.V[i]){m(k.V[i].W.F.1H&&k.V[i].W.F.1H>7V){7V=k.V[i].W.F.1H;6C=i}}}m(6C==-1)k.2R=-1;I k.V[6C].3J()},3F:B(a,5H){a.5P=a.2y;q p=a.5P?a.5P():H;a.5P=H;D(p&&1z p[5H]!=\'2g\')?p[5H]:(1z k[5H]!=\'2g\'?k[5H]:H)},6U:B(a){q 1e=k.3F(a,\'1e\');m(1e)D 1e;D a.1Q},5d:B(1v){q 1W=k.$(1v),4g=k.8y[1v],a={};m(!1W&&!4g)D H;m(!4g){4g=1W.4u(J);4g.1v=\'\';k.8y[1v]=4g;D 1W}I{D 4g.4u(J)}},51:B(d){k.88.1K(d);k.88.2s=\'\'},1y:B(A){m(!k.2p){k.2p=k.1a(\'1f\',{18:\'N-bS\',5I:\'\',2y:B(){m(k.1r(k,\'bM\'))k.1Y()}},{1l:\'2c\',1h:0},k.26,J);k.2I(1F,\'3T\',k.5c)}k.2p.F.1w=\'\';k.5c();k.2p.5I+=\'|\'+A.P;m(k.53&&k.9l)k.2p.F.5y=\'6r(\'+k.4S+\'bL.9u)\';I k.2d(k.2p,0,A.3E,k.8g)},7U:B(P){m(!k.2p)D;m(1z P!=\'2g\')k.2p.5I=k.2p.5I.23(\'|\'+P,\'\');m((1z P!=\'2g\'&&k.2p.5I!=\'\')||(k.2O&&k.3F(k.2O,\'3E\')))D;m(k.53&&k.9l)k.O(k.2p,{5y:\'1E\',L:0,R:0});I k.2d(k.2p,k.3E,0,k.8g,B(){k.O(k.2p,{1w:\'1E\',L:0,R:0})})},5c:B(A){m(!k.2p)D;q 3r=k.6R();q h=(k.1p&&A&&A.W)?2A(A.W.F.1c)+2A(A.W.F.R)+(A.Z?A.Z.1S:0):0;k.O(k.2p,{L:3r.6A+\'E\',R:16.2M(3r.6M,h)+\'E\'})},6v:B(el,1G){k.5m();q A=k.M=k.3D(el);1t{q 92=k.2O=A.76(1G);92.2y()}1s(e){k.M=k.2O=H}1t{A.1Y()}1s(e){}D 1j},2P:B(el){D k.6v(el,-1)},1x:B(el){D k.6v(el,1)},64:B(e){m(!e)e=1F.2G;m(!e.2B)e.2B=e.8e;m(1z e.2B.9p!=\'2g\')D J;m(!k.1r(k,\'bE\',e))D J;q A=k.3D();q 1G=H;8Y(e.bD){22 70:m(A)A.6j();D J;22 32:1G=2;5n;22 34:22 39:22 40:1G=1;5n;22 8:22 33:22 37:22 38:1G=-1;5n;22 27:22 13:1G=0}m(1G!==H){m(1G!=2)k.4C(1b,1F.3P?\'86\':\'85\',k.64);m(!k.8X)D J;m(e.5R)e.5R();I e.bC=1j;m(A){m(1G==0){A.1Y()}I m(1G==2){m(A.1A)A.1A.aJ()}I{m(A.1A)A.1A.30();k.6v(A.P,1G)}D 1j}}D J},bG:B(1o){k.2k(k.1L,1o)},bH:B(3W){q 2S=3W.2N;m(1z 2S==\'7s\'){Q(q i=0;i<2S.14;i++){q o={};Q(q x 2X 3W)o[x]=3W[x];o.2N=2S[i];k.2k(k.5r,o)}}I{k.2k(k.5r,3W)}},8D:B(6w,6K){q el,29=/^N-W-([0-9]+)$/;el=6w;4B(el.3h){m(el.1v&&29.Y(el.1v))D el.1v.23(29,"$1");el=el.3h}m(!6K){el=6w;4B(el.3h){m(el.3w&&k.63(el)){Q(q P=0;P<k.V.14;P++){q A=k.V[P];m(A&&A.a==el)D P}}el=el.3h}}D H},3D:B(el,6K){m(1z el==\'2g\')D k.V[k.2R]||H;m(1z el==\'3m\')D k.V[el]||H;m(1z el==\'81\')el=k.$(el);D k.V[k.8D(el,6K)]||H},63:B(a){D(a.2y&&a.2y.au().23(/\\s/g,\' \').24(/k.(bK|e)bJ/))},ad:B(){Q(q i=0;i<k.V.14;i++)m(k.V[i]&&k.V[i].5j)k.97()},1r:B(5K,8l,9k){D 5K&&5K[8l]?(5K[8l](5K,9k)!==1j):J},74:B(e){m(!e)e=1F.2G;m(e.cG>1)D J;m(!e.2B)e.2B=e.8e;q el=e.2B;4B(el.3h&&!(/N-(2w|3e|3G|3T)/.Y(el.18))){el=el.3h}q A=k.3D(el);m(A&&(A.5g||!A.5j))D J;m(A&&e.S==\'7C\'){m(e.2B.9p)D J;q 24=el.18.24(/N-(2w|3e|3T)/);m(24){k.2n={A:A,S:24[1],1h:A.x.G,L:A.x.C,1c:A.y.G,R:A.y.C,9b:e.6F,95:e.6J};k.2I(1b,\'6B\',k.62);m(e.5R)e.5R();m(/N-(2w|3G)-8H/.Y(A.T.18)){A.3J();k.8q=J}D 1j}I m(/N-3G/.Y(el.18)&&k.2R!=A.P){A.3J();A.4R(\'1n\')}}I m(e.S==\'aY\'){k.4C(1b,\'6B\',k.62);m(k.2n){m(k.2n.S==\'2w\')k.2n.A.T.F.3Z=k.5w;q 3a=k.2n.3a;m(!3a&&!k.8q&&!/(3e|3T)/.Y(k.2n.S)){m(k.1r(A,\'es\'))A.1Y()}I m(3a||(!3a&&k.9o)){k.2n.A.4R(\'1n\')}m(k.2n.A.3q)k.2n.A.3q.F.1w=\'1E\';m(3a)k.1r(k.2n.A,\'ej\',k.2n);m(3a)k.5c(A);k.8q=1j;k.2n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1B.1e=k.54[i]}},aV:B(3m){m(3m&&1z 3m!=\'7s\')k.8b=3m;q 1T=k.8T();Q(q i=0;i<1T.4E.14&&i<k.8b;i++){k.2k(k.54,k.6U(1T.4E[i]))}m(k.1P)1N k.5l(k.1P,B(){k.6V(0)});I k.6V(0);q 4T=k.1a(\'1B\',{1e:k.4S+k.6n})},66:B(){m(!k.26){k.26=k.1a(\'1f\',{18:\'N-26\'},{1l:\'2c\',1h:0,1c:0,L:\'2U%\',1H:k.4j,8u:\'9E\'},1b.19,J);k.2j=k.1a(\'a\',{18:\'N-2j\',1Z:k.U.9L,2s:k.U.9M,1Q:\'bi:;\'},{1l:\'2c\',1c:\'-41\',20:k.9F,1H:1},k.26);k.88=k.1a(\'1f\',H,{1w:\'1E\'},k.26);k.3b=k.1a(\'1f\',H,{90:\'8Z\',e3:\'e4\'},H,J);16.e7=B(t,b,c,d){D c*t/d+b};16.bm=B(t,b,c,d){D c*(t/=d)*t+b};16.bd=B(t,b,c,d){m((t/=d/2)<1)D c/2*t*t+b;D-c/2*((--t)*(t-2)-1)+b};Q(q x 2X k.5Z){m(1z k[x]!=\'2g\')k.U[x]=k[x];I m(1z k.U[x]==\'2g\'&&1z k.5Z[x]!=\'2g\')k.U[x]=k.5Z[x]}k.ai=(k.1p&&k.3S()<=6&&5a.e6==\'e5:\');k.aQ=(k.1p&&k.3S()<7);k.bj=((1F.3P&&3M.9H<9)||3M.b2==\'b6\'||(k.1p&&k.3S()<5.5));k.1r(j,\'ew\')}},aa:B(){k.9t=J;m(k.79)k.79()},5m:B(){q 11=1b.4L||1b.2E(\'*\'),4L=[],4E=[],4K=[],3j={},29;Q(q i=0;i<11.14;i++){29=k.63(11[i]);m(29){k.2k(4L,11[i]);m(29[0]==\'k.2v\')k.2k(4E,11[i]);I m(29[0]==\'k.8A\')k.2k(4K,11[i]);q g=k.3F(11[i],\'2N\')||\'1E\';m(!3j[g])3j[g]=[];k.2k(3j[g],11[i])}}k.46={4L:4L,3j:3j,4E:4E,4K:4K};D k.46},8T:B(){D k.46||k.5m()},2d:B(el,o,45,3l,4G,i,3y){m(1z i==\'2g\'){m(1z 3l!=\'3m\')3l=56;m(3l<25){k.O(el,{20:45});m(4G)4G();D}i=k.6c.14;3y=45>o?1:-1;q 5C=(25/(3l-3l%25))*16.aC(o-45)}o=9D(o);q 8G=(el.2d===0||el.2d===1j||(el.2d==2&&k.1p));el.F.1m=((8G?45:o)<=0)?\'1n\':\'2i\';m(8G||o<0||(3y==1&&o>45)){m(4G)4G();D}m(el.4c&&el.4c.i!=i){af(k.6c[el.4c.i]);o=el.4c.o}el.4c={i:i,o:o,5C:(5C||el.4c.5C)};el.F.1m=(o<=0)?\'1n\':\'2i\';k.O(el,{20:o});k.6c[i]=21(B(){k.2d(el,o+el.4c.5C*3y,45,H,4G,i,3y)},25)},1Y:B(el){q A=k.3D(el);m(A)A.1Y();D 1j}};k.5l=B(1P,36){j.36=36;j.1P=1P;q v=k.3S(),6q;j.8K=k.1p&&v>=5.5&&v<7;m(!1P){m(36)36();D}k.66();j.2K=k.1a(\'2K\',{eq:0},{1m:\'1n\',1l:\'2c\',en:\'em\',L:0},k.26,J);q 8O=k.1a(\'8O\',H,H,j.2K,1);j.2F=[];Q(q i=0;i<=8;i++){m(i%3==0)6q=k.1a(\'6q\',H,{R:\'1U\'},8O,J);j.2F[i]=k.1a(\'2F\',H,H,6q,J);q F=i!=4?{dh:0,df:0}:{1l:\'44\'};k.O(j.2F[i],F)}j.2F[4].18=1P+\' N-Z\';j.9P()};k.5l.5s={9P:B(){q 1e=k.4S+(k.dc||"dd/")+j.1P+".9u";q 9S=k.4W?k.26:H;j.3u=k.1a(\'1B\',H,{1l:\'2c\',1c:\'-41\'},9S,J);q 31=j;j.3u.4b=B(){31.9T()};j.3u.1e=1e},9T:B(){q o=j.1S=j.3u.L/4,G=[[0,0],[0,-4],[-2,0],[0,-8],0,[-2,-8],[0,-2],[0,-6],[-2,-2]],1y={R:(2*o)+\'E\',L:(2*o)+\'E\'};Q(q i=0;i<=8;i++){m(G[i]){m(j.8K){q w=(i==1||i==7)?\'2U%\':j.3u.L+\'E\';q 1f=k.1a(\'1f\',H,{L:\'2U%\',R:\'2U%\',1l:\'44\',2L:\'1n\'},j.2F[i],J);k.1a(\'1f\',H,{7S:"dZ:do.ax.dp(dn=dm, 1e=\'"+j.3u.1e+"\')",1l:\'2c\',L:w,R:j.3u.R+\'E\',1h:(G[i][0]*o)+\'E\',1c:(G[i][1]*o)+\'E\'},1f,J)}I{k.O(j.2F[i],{5y:\'6r(\'+j.3u.1e+\') \'+(G[i][0]*o)+\'E \'+(G[i][1]*o)+\'E\'})}m(1F.3P&&(i==3||i==5))k.1a(\'1f\',H,1y,j.2F[i],J);k.O(j.2F[i],1y)}}j.3u=H;m(k.4p[j.1P])k.4p[j.1P].52();k.4p[j.1P]=j;m(j.36)j.36()},4n:B(A,G,9W){G=G||{x:A.x.G,y:A.y.G,w:A.x.C+A.x.1i+A.x.1R,h:A.y.C+A.y.1i+A.y.1R};m(9W)j.2K.F.1m=(G.h>=4*j.1S)?\'2i\':\'1n\';k.O(j.2K,{1h:(G.x-j.1S)+\'E\',1c:(G.y-j.1S)+\'E\',L:(G.w+2*(A.x.cb+j.1S))+\'E\'});G.w+=2*(A.x.cb-j.1S);G.h+=+2*(A.y.cb-j.1S);k.O(j.2F[4],{L:G.w>=0?G.w+\'E\':0,R:G.h>=0?G.h+\'E\':0});m(j.8K)j.2F[3].F.R=j.2F[5].F.R=j.2F[4].F.R},52:B(91){m(91)j.2K.F.1m=\'1n\';I k.51(j.2K)}};k.6d=B(A,1y){j.A=A;j.1y=1y;j.2Y=1y==\'x\'?\'dl\':\'db\';j.3k=j.2Y.61();j.5q=1y==\'x\'?\'da\':\'d0\';j.6W=j.5q.61();j.8Q=1y==\'x\'?\'d1\':\'cZ\';j.9g=j.8Q.61()};k.6d.5s={1k:B(P){8Y(P){22\'7f\':D j.1I+j.3n+(j.t-k.2j[\'1S\'+j.2Y])/2;22\'7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U\'}m(j.1y==\'x\'&&j.A.1J)j.A.4v(J);m(j.1y==\'x\'&&j.A.1A&&j.A.2V){m(i==j.1g)j.A.1A.4U(\'1g-2v\');I j.A.1A.4d(\'1g-2v\')}},8S:B(i){j.G=i;j.A.W.F[j.6W]=i+\'E\';m(j.A.Z)j.A.Z.4n(j.A)}};k.5i=B(a,2b,3Q,2W){m(1b.7A&&k.1p&&!k.9t){k.79=B(){1N k.5i(a,2b,3Q,2W)};D}j.a=a;j.3Q=3Q;j.2W=2W||\'2w\';j.2x=(2W==\'3G\');j.2V=!j.2x;k.7a=1j;j.1L=[];j.M=k.M;k.M=H;k.66();q P=j.P=k.V.14;Q(q i=0;i<k.72.14;i++){q 4e=k.72[i];j[4e]=2b&&1z 2b[4e]!=\'2g\'?2b[4e]:k[4e]}m(!j.1e)j.1e=a.1Q;q el=(2b&&2b.8h)?k.$(2b.8h):a;el=j.a5=el.2E(\'1B\')[0]||el;j.5Q=el.1v||a.1v;m(!k.1r(j,\'d8\'))D J;Q(q i=0;i<k.V.14;i++){m(k.V[i]&&k.V[i].a==a&&!(j.M&&j.3C[1]==\'4i\')){k.V[i].3J();D 1j}}Q(q i=0;i<k.V.14;i++){m(k.V[i]&&k.V[i].a5!=el&&!k.V[i].6T){k.V[i].8W()}}k.V[j.P]=j;m(!k.7X){m(k.V[P-1])k.V[P-1].1Y();m(1z k.2R!=\'2g\'&&k.V[k.2R])k.V[k.2R].1Y()}j.el=el;j.1I=k.6a(el);k.3r=k.6R();q x=j.x=1N k.6d(j,\'x\');x.7G();q y=j.y=1N k.6d(j,\'y\');y.7G();m(/5M/i.Y(el.3w))j.b7(el);j.W=k.1a(\'1f\',{1v:\'N-W-\'+j.P,18:j.6g},{1m:\'1n\',1l:\'2c\',1H:k.4j++},H,J);j.W.d7=j.W.d6=k.a1;m(j.2W==\'2w\'&&j.3s==2)j.3s=0;m(!j.1P||(j.M&&j.2V&&j.3C[1]==\'4i\')){j[j.2W+\'7H\']()}I m(k.4p[j.1P]){j.7E();j[j.2W+\'7H\']()}I{j.59();q A=j;1N k.5l(j.1P,B(){A.7E();A[A.2W+\'7H\']()})}D J};k.5i.5s={7E:B(){q o=j.Z=k.4p[j.1P];o.2K.F.1H=j.W.F.1H;k.4p[j.1P]=H},59:B(){m(j.6T||j.2j)D;j.2j=k.2j;q A=j;j.2j.2y=B(){A.8W()};m(!k.1r(j,\'dq\'))D;q A=j,l=j.x.1k(\'7f\')+\'E\',t=j.y.1k(\'7f\')+\'E\';m(!2C&&j.M&&j.3C[1]==\'4i\')q 2C=j.M;m(2C){l=2C.x.1k(\'7K\')+\'E\';t=2C.y.1k(\'7K\')+\'E\';j.2j.F.1H=k.4j++}21(B(){m(A.2j)k.O(A.2j,{1h:l,1c:t,1H:k.4j++})},2U)},dM:B(){q A=j;q 1B=1b.1a(\'1B\');j.T=1B;1B.4b=B(){m(k.V[A.P])A.5D()};m(k.dN)1B.dL=B(){D 1j};1B.18=\'N-2w\';k.O(1B,{1m:\'1n\',1w:\'5b\',1l:\'2c\',9I:\'41\',1H:3});1B.1Z=k.U.8U;m(k.4W)k.26.1K(1B);m(k.1p&&k.dK)1B.1e=H;1B.1e=j.1e;j.59()},dI:B(){m(!k.1r(j,\'dJ\'))D;j.T=k.7n(j.a);m(!j.T)j.T=k.5d(j.7M);m(!j.T)j.T=k.7z();j.8p([\'67\']);m(j.67){q 19=k.4f(j.T,\'1f\',\'N-19\');m(19)19.1K(j.67);j.67.F.1w=\'5b\'}k.1r(j,\'dO\');j.1q=j.T;m(/(3i|1d)/.Y(j.2t))j.7d(j.1q);k.26.1K(j.W);k.O(j.W,{1l:\'dP\',7w:\'0 \'+k.8w+\'E 0 \'+k.4r+\'E\'});j.T=k.1a(\'1f\',{18:\'N-3G\'},{1l:\'44\',1H:3,2L:\'1n\'},j.W);j.4H=k.1a(\'1f\',H,H,j.T,1);j.4H.1K(j.1q);k.O(j.1q,{1l:\'44\',1w:\'5b\',8u:k.U.8t||\'\'});m(j.L)j.1q.F.L=j.L+\'E\';m(j.R)j.1q.F.R=j.R+\'E\';m(j.1q.2u<j.3Y)j.1q.F.L=j.3Y+\'E\';m(j.2t==\'2T\'&&!k.7n(j.a)){j.59();q 2T=1N k.6L(j.a,j.1q);q A=j;2T.36=B(){m(k.V[A.P])A.5D()};2T.8a=B(){5a.1Q=A.1e};2T.84()}I m(j.2t==\'1d\'&&j.3t==\'5L\'){j.6p()}I j.5D()},5D:B(){1t{m(!j.T)D;j.T.4b=H;m(j.6T)D;I j.6T=J;q x=j.x,y=j.y;m(j.2j){k.O(j.2j,{1c:\'-41\'});j.2j=H;k.1r(j,\'aO\')}m(j.2V){x.1g=j.T.L;y.1g=j.T.R;k.O(j.T,{L:j.x.t+\'E\',R:j.y.t+\'E\'})}I m(j.7e)j.7e();j.W.1K(j.T);k.O(j.W,{1h:j.x.1I+\'E\',1c:j.y.1I+\'E\'});k.26.1K(j.W);x.7j();y.7j();j.aI();j.b8();q 2Q=x.1g/y.1g;x.7g();j.2J(x);y.7g();j.2J(y);m(j.2x)j.b5();m(j.1J)j.4v(0,1);m(j.5N){m(j.2V)j.bg(2Q);I j.7u();q 1M=j.1A;m(1M&&j.M&&1M.2H&&1M.a4){q G=1M.aH.1l||\'\',p;Q(q 1y 2X k.7h)Q(q i=0;i<5;i++){p=j[1y];m(G.24(k.7h[1y][i])){p.G=j.M[1y].G+(j.M[1y].1i-p.1i)+(j.M[1y].C-p.C)*[0,0,.5,1,1][i];m(1M.a4==\'dS\'){m(p.G+p.C+p.1i+p.1R>p.2z+p.49-p.48)p.G=p.2z+p.49-p.C-p.3d-p.48-p.1i-p.1R;m(p.G<p.2z+p.3d)p.G=p.2z+p.3d}}}}m(j.2V&&j.x.1g>j.x.C){j.bf();m(j.1L.14==1)j.4v()}}j.82()}1s(e){1F.5a.1Q=j.1e}},7d:B(58,1U){q c=k.4f(58,\'5S\',\'N-19\');m(/(1d|3i)/.Y(j.2t)){m(j.3N)c.F.L=j.3N+\'E\';m(j.4x)c.F.R=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.2O&&k.2O==j.a)k.2O=H;j.at();q p=k.3r,7b=k.6G.x+p.5T,6Z=k.6G.y+p.5Y;j.8k=j.x.G<7b&&7b<j.x.G+j.x.1k(\'2Z\')&&j.y.G<6Z&&6Z<j.y.G+j.y.1k(\'2Z\');m(j.1J)j.bn();k.1r(j,\'d2\')},at:B(){q P=j.P;q 1P=j.1P;1N k.5l(1P,B(){1t{k.V[P].a7()}1s(e){}})},a7:B(){q 1x=j.76(1);m(1x&&1x.2y.au().24(/k\\.2v/))q 1B=k.1a(\'1B\',{1e:k.6U(1x)})},76:B(1G){q 6X=j.6E(),as=k.46.3j[j.2N||\'1E\'];m(!as[6X+1G]&&j.1A&&j.1A.aN){m(1G==1)D as[0];I m(1G==-1)D as[as.14-1]}D as[6X+1G]||H},6E:B(){q 1T=k.46.3j[j.2N||\'1E\'];Q(q i=0;i<1T.14;i++){m(1T[i]==j.a)D i}D H},ba:B(){m(j[j.5t]){q 1T=k.46.3j[j.2N||\'1E\'];q s=k.U.3m.23(\'%1\',j.6E()+1).23(\'%2\',1T.14);j[j.5t].2s=\'<1f 2a="N-3m">\'+s+\'</1f>\'+j[j.5t].2s}},aI:B(){m(j.1A)D;m(!j.M){Q(q i=0;i<k.5r.14;i++){q 1M=k.5r[i],2S=1M.2N;m(1z 2S==\'2g\'||2S===H||2S===j.2N)j.1A=1N k.8I(1M)}}I{j.1A=j.M.1A}q 1M=j.1A;m(!1M)D;q A=1M.A=j;1M.ay();1M.4U(\'1g-2v\');m(1M.2H){q o=1M.aH||{};o.4P=1M.2H;o.2h=\'2H\';j.4Q(o)}m(!j.M&&j.3I)1M.3v(J);m(1M.3I){1M.3I=21(B(){k.1x(A.P)},(1M.cX||aL))}},8W:B(){k.V[j.P]=H;m(k.2O==j.a)k.2O=H;k.7U(j.P);m(j.2j)k.2j.F.1h=\'-41\';k.1r(j,\'aO\')},b3:B(){m(j.5o)D;j.5o=k.1a(\'a\',{1Q:k.aM,18:\'N-5o\',2s:k.U.aF,1Z:k.U.aE});j.4Q({4P:j.5o,1l:\'1c 1h\',2h:\'5o\'})},8p:B(8E,aD){Q(q i=0;i<8E.14;i++){q S=8E[i],s=H;m(S==\'8j\'&&!k.1r(j,\'cV\'))D;I m(S==\'4D\'&&!k.1r(j,\'cY\'))D;m(!j[S+\'6y\']&&j.5Q)j[S+\'6y\']=S+\'-Q-\'+j.5Q;m(j[S+\'6y\'])j[S]=k.5d(j[S+\'6y\']);m(!j[S]&&!j[S+\'8L\']&&j[S+\'aB\'])1t{s=dk(j[S+\'aB\'])}1s(e){}m(!j[S]&&j[S+\'8L\']){s=j[S+\'8L\']}m(!j[S]&&!s){q 1x=j.a.aP;4B(1x&&!k.63(1x)){m((1N 4k(\'N-\'+S)).Y(1x.18||H)){j[S]=1x.4u(1);5n}1x=1x.aP}}m(!j[S]&&!s&&j.5t==S)s=\'\\n\';m(!j[S]&&s)j[S]=k.1a(\'1f\',{18:\'N-\'+S,2s:s});m(aD&&j[S]){q o={1l:(S==\'4D\')?\'5u\':\'6t\'};Q(q x 2X j[S+\'a9\'])o[x]=j[S+\'a9\'][x];o.4P=j[S];j.4Q(o)}}},4R:B(1m){m(k.aQ)j.6l(\'di\',1m);m(k.bj)j.6l(\'de\',1m);m(k.53)j.6l(\'*\',1m)},6l:B(3w,1m){q 11=1b.2E(3w);q 4F=3w==\'*\'?\'2L\':\'1m\';Q(q i=0;i<11.14;i++){m(4F==\'1m\'||(1b.dg.dW(11[i],"").eu(\'2L\')==\'1U\'||11[i].b0(\'1n-by\')!=H)){q 2D=11[i].b0(\'1n-by\');m(1m==\'2i\'&&2D){2D=2D.23(\'[\'+j.P+\']\',\'\');11[i].5v(\'1n-by\',2D);m(!2D)11[i].F[4F]=11[i].8F}I m(1m==\'1n\'){q 3B=k.6a(11[i]);3B.w=11[i].2u;3B.h=11[i].1V;m(!j.3E){q bo=(3B.x+3B.w<j.x.1k(\'5B\')||3B.x>j.x.1k(\'5B\')+j.x.1k(\'8J\'));q bu=(3B.y+3B.h<j.y.1k(\'5B\')||3B.y>j.y.1k(\'5B\')+j.y.1k(\'8J\'))}q 6h=k.8D(11[i]);m(!bo&&!bu&&6h!=j.P){m(!2D){11[i].5v(\'1n-by\',\'[\'+j.P+\']\');11[i].8F=11[i].F[4F];11[i].F[4F]=\'1n\'}I m(!2D.24(\'[\'+j.P+\']\')){11[i].5v(\'1n-by\',2D+\'[\'+j.P+\']\')}}I m((2D==\'[\'+j.P+\']\'||k.2R==6h)&&6h!=j.P){11[i].5v(\'1n-by\',\'\');11[i].F[4F]=11[i].8F||\'\'}I m(2D&&2D.24(\'[\'+j.P+\']\')){11[i].5v(\'1n-by\',2D.23(\'[\'+j.P+\']\',\'\'))}}}}},3J:B(){j.W.F.1H=k.4j++;Q(q i=0;i<k.V.14;i++){m(k.V[i]&&i==k.2R){q 4y=k.V[i];4y.T.18+=\' N-\'+4y.2W+\'-8H\';m(4y.2V){4y.T.F.3Z=k.1p?\'av\':\'6O\';4y.T.1Z=k.U.bb}k.1r(j,\'ep\')}}m(j.Z)j.Z.2K.F.1H=j.W.F.1H;j.T.18=\'N-\'+j.2W;m(j.2V){j.T.1Z=k.U.8U;m(k.6n){k.5w=1F.3P?\'6O\':\'6r(\'+k.4S+k.6n+\'), 6O\';m(k.1p&&k.3S()<6)k.5w=\'av\';j.T.F.3Z=k.5w}}k.2R=j.P;k.2I(1b,1F.3P?\'86\':\'85\',k.64);k.1r(j,\'ek\')},8f:B(x,y){j.x.8S(x);j.y.8S(y)},3T:B(e){q w,h,r=e.L/e.R;w=16.2M(e.L+e.dX,16.3O(j.3Y,j.x.1g));m(j.2V&&16.aC(w-j.x.1g)<12)w=j.x.1g;h=j.2x?e.R+e.dY:w/r;m(h<16.3O(j.5x,j.y.1g)){h=16.3O(j.5x,j.y.1g);m(j.2V)w=h*r}j.80(w,h)},80:B(w,h){j.y.4s(h);j.x.4s(w)},1Y:B(){m(j.5g||!j.5j||(k.2O&&j.3C[1]==\'4i\'))D;m(!k.1r(j,\'e2\'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+\'].6j();\',1Z:k.U.8x,18:\'N-1g-2v\'});m(!k.1r(j,\'bF\'))D;j.4Q({4P:j.6H,1l:k.ak,4O:J,20:k.an})},6j:B(){1t{m(!k.1r(j,\'bB\'))D;m(j.6H)k.51(j.6H);j.3J();q 1X=j.x.G-(j.x.1g-j.x.C)/2;m(1X<k.4r)1X=k.4r;j.8f(1X,j.y.G);j.80(j.x.1g,j.y.1g);j.4R(\'1n\');k.5c(j)}1s(e){1F.5a.1Q=j.T.1e}},5h:B(){j.a.18=j.a.18.23(\'N-7Y-4h\',\'\');j.4R(\'2i\');m(j.2x&&j.4l)j.ah();I{m(j.Z&&j.3s)j.Z.52();k.51(j.W)}m(k.4Z)k.4Z.F.1w=\'1E\';m(j.3E)k.7U(j.P);k.1r(j,\'bT\');k.V[j.P]=H;k.ad()}};k.6L=B(a,T,65){j.a=a;j.T=T;j.65=65};k.6L.5s={84:B(){m(!j.1e)j.1e=k.6U(j.a);m(j.1e.24(\'#\')){q 1T=j.1e.6Q(\'#\');j.1e=1T[0];j.1v=1T[1]}m(k.69[j.1e]){j.b1=k.69[j.1e];m(j.1v)j.87();I j.5A();D}1t{j.3z=1N aA()}1s(e){1t{j.3z=1N aG("bU.aw")}1s(e){1t{j.3z=1N aG("ax.aw")}1s(e){j.8a()}}}q 31=j;j.3z.bR=B(){m(31.3z.7A==4){m(31.1v)31.87();I 31.5A()}};j.3z.bt("bQ",j.1e,J);j.3z.bO(\'X-bP-bV\',\'aA\');j.3z.bw(H)},87:B(){k.66();q 3V=1F.3P||k.ai?{1e:\'cT:cB\'}:H;j.1d=k.1a(\'1d\',3V,{1l:\'2c\',1c:\'-41\'},k.26);j.5A()},5A:B(){q s=j.b1||j.3z.cA;m(j.65)k.69[j.1e]=s;m(!k.1p||k.3S()>=5.5){s=s.23(/\\s/g,\' \').23(1N 4k(\'<cC[^>]*>\',\'bp\'),\'\').23(1N 4k(\'<bq[^>]*>.*?</bq>\',\'bp\'),\'\');m(j.1d){q 2m=j.1d.8C;m(!2m&&j.1d.5z)2m=j.1d.5z.1b;m(!2m){q 31=j;21(B(){31.5A()},25);D}2m.bt();2m.cy(s);2m.1Y();1t{s=2m.8N(j.1v).2s}1s(e){1t{s=j.1d.1b.8N(j.1v).2s}1s(e){}}}I{s=s.23(1N 4k(\'^.*?<19[^>]*>(.*?)</19>.*?$\',\'i\'),\'$1\')}}k.4f(j.T,\'5S\',\'N-19\').2s=s;j.36();Q(q x 2X j)j[x]=H}};k.8I=B(3W){k.5m();Q(q x 2X 3W)j[x]=3W[x];m(j.cs)j.az()};k.8I.5s={az:B(){j.2H=k.1a(\'1f\',{2s:k.8d(k.73.2H)},H,k.26);q 5p=[\'3v\',\'30\',\'2P\',\'1x\',\'3e\',\'1g-2v\',\'1Y\'];j.1C={};q 31=j;Q(q i=0;i<5p.14;i++){j.1C[5p[i]]=k.4f(j.2H,\'1D\',\'N-\'+5p[i]);j.4d(5p[i])}j.1C.30.F.1w=\'1E\'},ay:B(){m(j.aN||!j.2H)D;q 4T=j.A.6E(),29=/5V$/;m(4T==0)j.4U(\'2P\');I m(29.Y(j.1C.2P.2E(\'a\')[0].18))j.4d(\'2P\');m(4T+1==k.46.3j[j.A.2N||\'1E\'].14){j.4U(\'1x\');j.4U(\'3v\')}I m(29.Y(j.1C.1x.2E(\'a\')[0].18)){j.4d(\'1x\');j.4d(\'3v\')}},4d:B(1C){m(!j.1C)D;q aK=j,a=j.1C[1C].2E(\'a\')[0],29=/5V$/;a.2y=B(){aK[1C]();D 1j};m(29.Y(a.18))a.18=a.18.23(29,\'\')},4U:B(1C){m(!j.1C)D;q a=j.1C[1C].2E(\'a\')[0];a.2y=B(){D 1j};m(!/5V$/.Y(a.18))a.18+=\' 5V\'},aJ:B(){m(j.3I)j.30();I j.3v()},3v:B(ae){m(j.1C){j.1C.3v.F.1w=\'1E\';j.1C.30.F.1w=\'\'}j.3I=J;m(!ae)k.1x(j.A.P)},30:B(){m(j.1C){j.1C.30.F.1w=\'1E\';j.1C.3v.F.1w=\'\'}af(j.3I);j.3I=H},2P:B(){j.30();k.2P(j.1C.2P)},1x:B(){j.30();k.1x(j.1C.1x)},3e:B(){},\'1g-2v\':B(){k.3D().6j()},1Y:B(){k.1Y(j.1C.1Y)}};m(1b.7A&&k.1p){(B(){1t{1b.4V.cN(\'1h\')}1s(e){21(cM.cI,50);D}k.aa()})()}k.5Z=k.U;q cJ=k.5i;k.2I(1F,\'6z\',B(){q 7O=\'.N 1B\',7r=\'3Z: 6r(\'+k.4S+k.aq+\'), 6O !cK;\';q F=k.1a(\'F\',{S:\'cL/cr\'},H,1b.2E(\'c5\')[0]);m(!k.1p){F.1K(1b.bZ(7O+" {"+7r+"}"))}I{q M=1b.bs[1b.bs.14-1];m(1z(M.aX)=="7s")M.aX(7O,7r)}});k.2I(1b,\'6B\',B(e){k.6G={x:e.6F,y:e.6J}});k.2I(1b,\'7C\',k.74);k.2I(1b,\'aY\',k.74);k.2I(1F,\'6z\',k.aV);k.2I(1F,\'6z\',k.aS);k.2I(1F,\'6z\',B(){k.aT=J});k.78();',62,901,'|||||||||||||||||||this|hs||if||||var||||||||||exp|function|size|return|px|style|pos|null|else|true|to|width|last|highslide|setStyles|key|for|height|type|content|lang|expanders|wrapper||test|outline||els|||length||Math||className|body|createElement|document|top|iframe|src|div|full|left|p1|false|get|position|visibility|hidden|overlay|ie|innerContent|fireEvent|catch|try|span|id|display|next|dim|typeof|slideshow|img|btn|li|none|window|op|zIndex|tpos|overlayBox|appendChild|overlays|ss|new|up|outlineType|href|p2|offset|arr|auto|offsetHeight|node|xpos|close|title|opacity|setTimeout|case|replace|match||container||yp1|re|class|params|absolute|fade|xp1|from|undefined|hsId|visible|loading|push|ypos|doc|dragArgs|xsize|dimmer|ysize|scrollerDiv|innerHTML|objectType|offsetWidth|expand|image|isHtml|onclick|scroll|parseInt|target|tgt|hiddenBy|getElementsByTagName|td|event|controls|addEventListener|justify|table|overflow|max|slideshowGroup|upcoming|previous|ratio|focusKey|sg|ajax|100|isImage|contentType|in|ucwh|wsize|pause|pThis||||xp2|onLoad||||hasDragged|clearing|minSize|marginMin|move|ximgSize|yp2|parentNode|swf|groups|wh|dur|number|tb|oDiv|ximgPad|releaseMask|page|outlineWhileAnimating|objectLoadTime|graphic|play|tagName|right|dir|xmlHttp|round|elPos|transitions|getExpander|dimmingOpacity|getParam|html|steps|autoplay|focus|easing|func|navigator|objectWidth|min|opera|custom|styles|ieVersion|resize|iebody|attribs|options|imgSize|minWidth|cursor||9999px|sleeping|bottom|relative|oFinal|anchors|trans|marginMax|clientSize|tgtArr|onload|fading|enable|name|getElementByClass|clone|anchor|crossfade|zIndexCounter|RegExp|preserveContent|imgPad|setPosition|center|pendingOutlines|val|marginLeft|setSize|fadeBox|cloneNode|sizeOverlayBox|wDiff|objectHeight|blurExp|hDiff|cNode|while|removeEventListener|heading|images|prop|fn|mediumContent|scrollingContent|moveOnly|htmls|all|allowReduce|marginTop|hideOnMouseOut|overlayId|createOverlay|doShowHide|graphicsDir|cur|disable|documentElement|safari|cacheBindings|on|mask||discardElement|destroy|geckoMac|preloadTheseImages|matches|250|cache|parent|showLoading|location|block|setDimmerSize|getNode|fitsize|over|isClosing|afterClose|Expander|isExpanded|hsPos|Outline|updateAnchors|break|credits|buttons|uclt|slideshows|prototype|numberPosition|above|setAttribute|styleRestoreCursor|minHeight|background|contentWindow|loadHTML|opos|step|contentLoaded|ruler|maxY|minY|param|owner|minX|obj|before|area|allowSizeReduction|maxX|getParams|thumbsUserSetId|preventDefault|DIV|scrollLeft|ul|disabled|self|innerHeight|scrollTop|langDefaults|os|toLowerCase|dragHandler|isHsAnchor|keyHandler|pre|init|maincontent|userAgent|cachedGets|getPosition|allowWidthReduction|faders|Dimension|tId|kdeBugCorr|wrapperClassName|wrapperKey|afterExpand|doFullExpand|transitionDuration|showHideElements|innerWidth|restoreCursor|currentStyle|writeExtendedContent|tr|url|imgs|below|positionOverlay|previousOrNext|element|other|Id|load|pageWidth|mousemove|topmostKey|stl|getAnchorIndex|clientX|mouse|fullExpandLabel|marginBottom|clientY|expOnly|Ajax|pageHeight|rel|pointer|preloadTheseAjax|split|getPageSize|changed|onLoadStarted|getSrc|preloadFullImage|lt|current|offsetTop|mY||closeTitle|overrides|skin|mouseClickHandler||getAdjacentAnchor|closeText|setClickEvents|onDomReady|continuePreloading|mX|allowHeightReduction|setObjContainerSize|htmlGetSize|loadingPos|calcExpanded|oPos|removeChild|calcBorders|sizeDiff|names|swfOptions|getCacheBinding|expandDuration|getIframePageHeight|padToMinWidth|dec|object|Click|fitOverlayBox|arrow|padding|hasMovedMin|border|getSelfRendered|readyState|moveTitle|mousedown|crossfadeStep|connectOutline|correctIframeSize|calcThumb|Create|nextText|nextTitle|loadingPosXfade|prep|contentId|previousTitle|sel|pI|previousText|moveText|filter|swfobject|undim|topZ|preloadAjaxElement|allowMultipleInstances|active|relatedTarget|resizeTo|string|show|after|run|keydown|keypress|getElementContent|garbageBin|changeSize|onError|numberOfImagesToPreload|outlineStartOffset|replaceLang|srcElement|moveTo|dimmingDuration|thumbnailId|dragByHeading|caption|mouseIsOver|evt|doWrapper|compatMode|genOverlayBox|getInline|hasFocused|setAttribs|distance|cssDirection|direction|idCounter|marginRight|fullExpandTitle|clones|middle|htmlExpand|cacheAjax|contentDocument|getWrapperKey|types|origProp|skip|blur|Slideshow|osize|hasAlphaImageLoader|Text|clientHeight|getElementById|tbody|align|ucrb|clientWidth|setPos|getAnchors|restoreTitle|margin|cancelLoading|enableKeyListener|switch|both|clear|hide|adj|resizeTitle|headingOverlay|clickY|captionOverlay|focusTopmost|Pause||spacebar|clickX|wmode|targetY|Highslide|Play|rb|Close|hasExtendedContent|JS|args|dimmingGeckoFix|flashvars|targetX|hasHtmlExpanders|form|attributes|newHeight|Previous|isDomReady|png|contentWrapper|offsetLeft|offsetParent|hsHasSetClick|isUnobtrusiveAnchor|scrollHeight|pauseTitle|pauseText|parseFloat|ltr|loadingOpacity|xScroll|appVersion|maxWidth|yScroll|fullExpandText|loadingTitle|loadingText|playText|scrollWidth|preloadGraphic|Move|nopad|appendTo|onGraphicLoad|tag|Next|vis|scrollMaxX|detachEvent|playTitle|scrollMaxY|wrapperMouseHandler|200|and|fixedControls|thumb|pow|preloadNext|newImg|Overlay|domReady|oldImg|crossfadeEnd|reOrder|wait|clearTimeout|reuse|sleep|ie6SSL|destroyObject|fullExpandPosition|awake|Safari|fullExpandOpacity|htmlPrepareClose|isNaN|expandCursor|restoreDuration||prepareNextOutline|toString|hand|XMLHTTP|Microsoft|checkFirstAndLast|getControls|XMLHttpRequest|Eval|abs|addOverlay|creditsTitle|creditsText|ActiveXObject|overlayOptions|initSlideshow|hitSpace|sls|500|creditsHref|repeat|onHideLoading|nextSibling|hideSelects|rightpanel|preloadAjax|pageLoaded|gotOverlays|preloadImages|doPanels|addRule|mouseup|leftpanel|getAttribute|cachedGet|vendor|writeCredits|showCredits|htmlSizeOperations|KDE|getImageMapAreaCorrection|getOverlays|panel|getNumber|focusTitle|tmpMin|easeInOutQuad|easingClose|createFullExpand|correctRatio|reuseOverlay|javascript|hideIframes|Gecko|rv|easeInQuad|showOverlays|clearsX|gi|script|fadeInOut|styleSheets|open|clearsY|BackCompat|send|pageXOffset||useMap|pageYOffset|onDoFullExpand|returnValue|keyCode|onKeyDown|onCreateFullExpand|registerOverlay|addSlideshow|useOnHtml|xpand|htmlE|geckodimmer|onDimmerClick|onSetClickEvent|setRequestHeader|Requested|GET|onreadystatechange|dimming|onAfterClose|Msxml2|With|headingText|keys|graphics|createTextNode|Use|click|drag|zoomin|zoomout|HEAD|drop|com|http|1001|of||Image|Expand|actual|front|bring|Loading|cancel|Powered|Go|Resize|Full|esc|homepage|the|shadow|css|useControls|Macintosh|maxHeight|maincontentEval|maincontentId|maincontentText|write|removeAttribute|responseText|blank|link|MSIE|alpha|headingEval|button|header|callee|HsExpander|important|text|arguments|doScroll|captionEval|headingId|captionText|captionId|footer|about|01|onBeforeGetCaption|toUpperCase|interval|onBeforeGetHeading|Bottom|Top|Right|onAfterExpand|boolean|rect|clip|onmouseout|onmouseover|onInit|wrapperBG|Left|Height|outlinesDir|outlines|IFRAME|fontSize|defaultView|lineHeight|SELECT|onAfterGetHeading|eval|Width|scale|sizingMethod|DXImageTransform|AlphaImageLoader|onShowLoading|525|flash|circle|floor|allowtransparency|getTime|frameborder|shape|transparent|insertBefore|nodeName|coords|expressInstallSwfurl|embedSWF|version|Date|tmpHeight|htmlCreate|onBeforeGetContent|flushImgSize|oncontextmenu|imageCreate|blockRightClick|onAfterGetContent|static|reflow|newWidth|fit|onBeforeExpand|restoreSteps|expandSteps|getComputedStyle|||progid|200px|mouseover|onBeforeClose|paddingTop|1px|https|protocol|linearTween|default|StopPlay|onCreateOverlay|toElement|fromElement|onMouseOver|onMouseOut|removeSWF|attachEvent|dragSensitivity|onDrag|onDrop|onFocus||collapse|borderCollapse|white|onBlur|cellSpacing|sqrt|onImageClick|onAfterGetCaption|getPropertyValue|300|onActivate'.split('|'),0,{}))

