<!--
    /*********************************************************************
	 2010-03-08 Loutjie - Added function win_popup_quicklink()		
	 *********************************************************************/
	var Sys = navigator.platForm;
	//var DomainName = 'eccentrix/qp';
	var DomainName = 'www.quickpic.co.za';
	//var DomainName = 'localhost/quickpic/';
	var I = 0;
	var bShowWait = false;
	//var Iarray = new Array("'","~","!","@","#","$","%","^","&","*","(",")","-","+","=","|","\\","{","}","[","]",":",";","\"","<",">","\,","?","/");
	//var Sarray = new Array("'","~","!","@","#","$","%","^","&","*","(",")","-","+","=","|","\\","{","}","[","]",";","\"","<",">","?","/");
	var Iarray = new Array("'");
	var Sarray = new Array("'");
	var Parray = new Array("'"," ","!","$","^","&","*","(",")","+","=","|","\\","{","}","[","]",";","\"","<",">","?","/");
	var Sheet;
	var Browser;
	var ix3 = (document.all) ? 1 : 0;
	var ix4 = (document.all) ? 1 : 0;
	var ix5 = (ix4 && navigator.appVersion.indexOf('5.0') >= 0) ? 1 : 0;
	var ix55 = (ix4 && navigator.appVersion.indexOf('5.5') >= 0) ? 1 : 0;
	var ix6 = (navigator.appName.indexOf('Mozilla/4.0') >= 0 && navigator.appVersion.indexOf('MSIE 6.0') >= 0) ? 1 : 0;
	var nc4 = (navigator.appName.indexOf('Netscape') >= 0 && parseFloat(navigator.appVersion) <= 4) ? 1 : 0;
	var nc6 = (navigator.appName.indexOf('Netscape') >= 0 && parseFloat(navigator.appVersion) >= 5) ? 1 : 0;
	var nc7 = (navigator.appName.indexOf('Netscape') >= 0 && parseFloat(navigator.appVersion) >= 5) ? 1 : 0;
	var opr = (navigator.appName.indexOf('Opera') >= 0 && parseFloat(navigator.appVersion) >= 5) ? 1 : 0;
	var oprix5 = (ix4 && navigator.userAgent.indexOf('Opera') >= 0 && navigator.appVersion.indexOf('5.') >= 0) ? 1 : 0;
	var oprnc4 = (navigator.appName.indexOf('Netscape') >= 0 && navigator.userAgent.indexOf('Opera') >= 0 && parseFloat(navigator.appVersion) >= 4) ? 1 : 0;
	var oprnc5 = (navigator.appName.indexOf('Netscape') >= 0 && navigator.userAgent.indexOf('Opera') >= 0 && parseFloat(navigator.appVersion) >= 5) ? 1 : 0;
	var knqr5 = (navigator.appName.indexOf('Konqueror') >= 0 && parseFloat(navigator.appVersion.indexOf('2.1.1')) >= 1) ? 1 : 0;
	if (nc4) {
		Sheet = "<link href='http://"+DomainName+"/Stylesheet/Netscape.css' rel='stylesheet' type='text/css'>";
		document.writeln(Sheet);
		Browser = document.layers;
	} else if ((nc6) || (nc7)) {
		Sheet = "<link href='http://"+DomainName+"/Stylesheet/Netscape.css' rel='stylesheet' type='text/css'>";	
		document.writeln(Sheet);
		Browser = document.getElementById;
	} else if ((ix3) || (ix4) || (ix5) || (ix55) || (ix6)) {
		Sheet = "<link href='http://"+DomainName+"/Stylesheet/Microsoft.css' rel='stylesheet' type='text/css'>";
		document.writeln(Sheet);
		Browser = document.all;
	}
	// Elbie Louw: for validation
	var iNrErr = 0;
	var sErr = "";
	var blnProcessing = false;
//------------------------------------------------
// Elbie Louw
// Functions to manipulate multiple select options
//------------------------------------------------
function MultiSelectValues(Obj) {
	var selectedArray = new Array();
	var selObj = document.getElementById(Obj);
	var i;
	var count = 0;
	for (i=0; i<selObj.options.length; i++) {
  		if (selObj.options[i].selected) {
   			selectedArray[count] = selObj.options[i].value;
    		count++;
  		}
  	}
	return selectedArray;
}

// returns a comma-seperated list of selected values
function GetSelectedValues(Obj) {
	var selectedArray = new Array();
	var selObj = document.getElementById(Obj);
	var i;
	var count = 0;
	for (i=0; i<selObj.options.length; i++) {
   		selectedArray[count] = selObj.options[i].value;
    	count++;
  	}
	return selectedArray;
}
// move the selected options up one location in the select list
function moveOptionsUp(selectId) { 
	var selectList = document.getElementById(selectId); 
	var selectOptions = selectList.getElementsByTagName('option'); 
	for (var i = 1; i < selectOptions.length; i++) {  
		var opt = selectOptions[i];  
		if (opt.selected) {   
			selectList.removeChild(opt);   
			selectList.insertBefore(opt, selectOptions[i - 1]);     
		}    
	}
}
// move the selected options down one location in the select list
function moveOptionsDown(selectId) { 
	var selectList = document.getElementById(selectId); 
	var selectOptions = selectList.getElementsByTagName('option'); 
	for (var i = selectOptions.length - 2; i >= 0; i--) {  
		var opt = selectOptions[i];  
		if (opt.selected) {   
			var nextOpt = selectOptions[i + 1];   
			opt = selectList.removeChild(opt);   
			nextOpt = selectList.replaceChild(opt, nextOpt);   
			selectList.insertBefore(nextOpt, opt);     
		}    
	}
}
// usage: onclick="javascript:SwopOption('ItemsAvailable','ItemsSelected');"
function SwopOption(fromName,toName){
    var i=0;
	var oSel = eObject(fromName);
	var oSel2 = eObject(toName);
	var newOpt;
	var selLength = oSel.length;
	for (i=selLength-1; i>=0; i--)  {
	    if (oSel.options[i].selected)  {
			addOption(oSel2, oSel.options[i].text, oSel.options[i].value);
			deleteOption(oSel, i);
	    }
	}
}
function addOption(theSel, theText, theValue) {
  var newOpt = new Option(theText, theValue);
  var selLength = theSel.length;
  theSel.options[selLength] = newOpt;
}

function deleteOption(theSel, theIndex) { 
  var selLength = theSel.length;
  if(selLength>0)  {theSel.options[theIndex] = null;}
}

//------------------------------------------------
// Elbie Louw
// Select All checkboxes for a group
// On Checkbox wilt all : CheckAllGroup(this, group1);
//------------------------------------------------
function CheckAllGroup(GrpState, _Group) {
// Check if group has more than one element
	if(_Group.length > 0)	{
		for (i = 0; i < _Group.length; i++)
			{ _Group[i].checked = GrpState.checked;	}
	} 
	else	
       { _Group.checked = GrpState.checked; } // Single element , is not array group
}
//------------------------------------------------
//  Elbie Louw
//	Include Ajax_Sack.js in pages that uses AJAX
//------------------------------------------------
var enableCache = false;
var jsCache = new Array();
var AjaxObjects = new Array();
function ShowContent(divId,ajaxIndex,url)   {
      document.getElementById(divId).innerHTML = AjaxObjects[ajaxIndex].response;
      if(enableCache){
       jsCache[url] = 	AjaxObjects[ajaxIndex].response;
      }
      AjaxObjects[ajaxIndex] = false;
}
function Ajax(divId,url)   {
      if(enableCache && jsCache[url]){
       document.getElementById(divId).innerHTML = jsCache[url];
       return;
      }	
      var ajaxIndex = AjaxObjects.length;
      if (bShowWait) {document.getElementById(divId).innerHTML = '<img src=http://' + DomainName + '/images/movewait.gif width=16 height=16 hspace=10 vspace=10 />';}
      AjaxObjects[ajaxIndex] = new sack();
      AjaxObjects[ajaxIndex].requestFile = url;
      AjaxObjects[ajaxIndex].onCompletion = function(){ ShowContent(divId,ajaxIndex,url); };
      AjaxObjects[ajaxIndex].runAJAX();
}
//------------------------------------
//	Elbie Louw
//  generic popup window with center
//	open popup window
//------------------------------------
function win_popup(inURL, inName, inW, inH) {
	if (inName=="") {inName="QuickPic"}
	var windowW=800;
	var windowH=600;
	var mywins = window.open (inURL, inName, "height=600,width=800,toolbar=no,scrollbars=yes,status=no,copyhistory=no,resizable=yes,alwaysRaised");
	  	if (!mywins.closed) {
	            // still open
	            mywins.focus();
	     }
		mywins.name = inName;
		windowX = (screen.width) ? (screen.width-windowW)/2 : 0;
		windowY = (screen.height) ? (screen.height-windowH)/2 : 0;
		mywins.focus();
		if (inW!="" && inW > 0) {windowW=inW;}
		if (inH!="" && inH > 0) {windowH=inH;}
		mywins.resizeTo(windowW,windowH);
		mywins.moveTo(windowX,windowY);
		if (mywins.opener==null) {mywindows.opener = self;}
}
function win_popup_quicklink(inURL, inName, inW, inH) {
	if (inName=="") {inName="QuickPic2"}
	var windowW=0;
	var windowH=0;
	var mywins = window.open (inURL, inName, "height=0,width=0,toolbar=no,scrollbars=no,status=no,copyhistory=no,resizable=no,alwaysRaised");
	  	if (!mywins.closed) {
	            // still open
	           // mywins.focus();
	     }
		mywins.name = inName;
		windowX = (screen.width) ? (screen.width-windowW)/2 : 0;
		windowY = (screen.height) ? (screen.height-windowH)/2 : 0;
		mywins.focus();
		if (inW!="" && inW > 0) {windowW=inW;}
		if (inH!="" && inH > 0) {windowH=inH;}
		mywins.resizeTo(windowW,windowH);
		mywins.moveTo(windowX,windowY);
		if (mywins.opener==null) {mywindows.opener = self;}
}
function win_popup_nm(inURL, inName, inW, inH) {
	if (inName=="") {inName="QuickPic"}
	var windowW=800;
	var windowH=600;
	var mywins = window.open (inURL, inName, "height=600,width=800,toolbar=no,scrollbars=yes,status=no,copyhistory=no,resizable=no,alwaysRaised");
	  	if (!mywins.closed) {
	            // still open
	            mywins.focus();
	     }
		mywins.name = inName;
		windowX = (screen.width) ? (screen.width-windowW)/2 : 0;
		windowY = (screen.height) ? (screen.height-windowH)/2 : 0;
		mywins.focus();
		if (inW!="" && inW > 0) {windowW=inW;}
		if (inH!="" && inH > 0) {windowH=inH;}
		mywins.resizeTo(windowW,windowH);
		mywins.moveTo(windowX,windowY);
		if (mywins.opener==null) {mywindows.opener = self;}
}
function NewWindow(mypage, myname, w, h, scroll) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}
//------------------------------------
// Validate if User entered numbers
//------------------------------------
function IsNumeric(strString) {
   //  check for valid numeric strings 

   var strValidChars = "0123456789.-";
   var strChar;
   var blnResult = true;

   if (strString.length == 0) return false;

   //  test strString consists of valid characters listed above
   for (i = 0; i < strString.length && blnResult == true; i++)   {
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1) {blnResult = false;}
   }
   return blnResult;
}
//------------------------------------
// Elbie Louw
//	validate key input
//------------------------------------
function ValidateKey(f1,f2,f3,f4,f5){
   var key=window.event.keyCode;
   if (f3=='a')   {
     var allowed='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ :;,.?!£$%^&*()_+-*{}@~<>&"\'';
   }
   else if (f3=='n')   {
     var allowed='0123456789.-';
   }
   else if (f3=='i')   {
     var allowed='0123456789-';
   }
   if (f3=='f')   {
     var allowed='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ._-';
   }
   else if (f3=='s')   {
     //var allowed=f4;
	 if (f4 == "Numeric Only") {var allowed = '0123456789'; }
	 else 
	 	if (f4 == "Numeric TelNr") {var allowed = '0123456789/- '; }
	 	else if (f4 == "Numeric DialC") {var allowed = '0123456789+ ()'; }
		else if (f4 == "Email") {var allowed = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@.'; }
		else if (f4 == "Email Body") {var allowed = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@.\/)(&#*_-+=;:,.?! 	'; }
		else if (f4 == "CellNr") {var allowed = '0123456789 -+'; }
		else if (f4 == "Currency") {var allowed = '0123456789,.'; }
		else
	 		{var allowed=f4;}
   }
   if (f3!='')   {
      if (key!=13)      {
         if (allowed.indexOf(String.fromCharCode(key))==-1)     {
            key=0;
         }
      }
   }
   if (f3=='n'||f3=='i')   {
      if (key==46)      {
         if (f1.value.indexOf('.')>-1)     {
            key=0;
         }
      }
   }

   if (f5=='u')   {
      var newkey=String.fromCharCode(key).toUpperCase();
      key=newkey.charCodeAt(0);
   }
   else if (f5=='l')   {
      var newkey=String.fromCharCode(key).toLowerCase();
      key=newkey.charCodeAt(0);
   }
   window.event.keyCode=key;
}
	function eField(Obj) {
		if (Browser == document.all) {
			return document.all(Obj).value;
		} else if (Browser == document.layers) {
			return document.layers[Obj].value;		
		} else if (Browser == document.getElementById) {
			return document.getElementById(Obj).value;
		}
	}
	function eChecked(Obj) {
		if (Browser == document.all) {
			return document.all(Obj).checked;
		} else if (Browser == document.layers) {
			return document.layers[Obj].checked;		
		} else if (Browser == document.getElementById) {
			return document.getElementById(Obj).checked;
		}
	}
	function eTField(Obj,Tval) {
		if (Browser == document.all) {
			document.all(Obj).value = Tval;
		} else if (Browser == document.layers) {
			document.layers[Obj].value = Tval;		
		} else if (Browser == document.getElementById) {
			document.getElementById(Obj).value = Tval;
		}
	}
	function eCmbIText(Obj) {
		if (Browser == document.all) {
			return document.all(Obj)(document.all(Obj).selectedIndex).innerText;
		} else if (Browser == document.layers) {
			return document.layers[Obj][document.layers[Obj].selectedIndex].innerText;
		} else if (Browser == document.getElementById) {
			return document.getElementById(Obj)(document.getElementById(Obj).selectedIndex).innerText;
		}
	}
	function eCmbIValue(Obj) {
		if (Browser == document.getElementById) {
			return document.getElementById(Obj)(document.getElementById(Obj).selectedIndex).value;
		} else if (Browser == document.all) {
			return document.all(Obj)(document.all(Obj).selectedIndex).value;
		} else if (Browser == document.layers) {
			return document.layers[Obj][document.layers[Obj].selectedIndex].value;
		}
	}
	function eFocus(Obj) {
		if (Browser == document.all) {
			return document.all(Obj).focus();
		} else if (Browser == document.layers) {
			return document.layers[Obj].focus();		
		} else if (Browser == document.getElementById) {
			return document.getElementById(Obj).focus();
		}
	}
	function eIndex(Obj,Inp) {
		if (Browser == document.all) {
			return document.all(Obj).value.indexOf(Inp);
		} else if (Browser == document.layers) {
			return document.layers[Obj].value.indexOf(Inp);
		} else if (Browser == document.getElementById) {
			return document.getElementById(Obj).value.indexOf(Inp);
		}
	}
	function eEmail(Obj) {
		var Crit, User, DomainName, Domain, Pos;
		if (Browser == document.all) {
			Crit = document.all(Obj).value;
		} else if (Browser == document.layers) {
			Crit = document.layers[Obj].value;
		} else if (Browser == document.getElementById) {
			Crit = document.getElementById(Obj).value;
		}
		if (eEmailParse(Crit) == false) {
			return false;
		} else {
			return true;
		}
	}
	function eEmailParse(Crit) {
		if (Crit.length > 0) {
			Pos = parseInt(Crit.indexOf("@"));
			if (Pos > 0) {
				User = Crit.substring(0,Pos);
				if (User.length > 0) {
					DomainName = Crit.substring(Pos+1,Crit.length);
					if ((DomainName.length > 0) && (DomainName.indexOf(".")>0)) {
						Domain = Crit.substring(Crit.indexOf(".")+1,Crit.length);
						if (Domain.length > 0) {
							return true;
						} else {
							alert("Email Evaluated to Incorrect input: Domain [.com] missing from the Email address, Please correct?");
							return false;
						}
					} else {
						alert("Email Evaluated to Incorrect input: Domain Name [DomainName.] missing from the Email address, Please correct?");
						return false;
					}
				}
			} else {
				alert("Email Evaluated to Incorrect input: [@] missing from the Email address, Please correct?");
				return false;
			}
		}	
	}
	function eCold(Previous) {
		if (Browser == document.all) {
			document.all(Previous).children[0].children[0].src = "../Images/Cold.gif";
		} else if (Browser == document.layers) {
			document.layers[Previous].children[0].children[0].src = "../Images/Cold.gif";
		} else if (Browser == document.getElementById) {
//			document.getElementById(Previous).children[0].children[0].src = "../Images/Cold.gif";
		}
	}
	function eHot(Obj) {
		if (Browser == document.all) {
			document.all(Obj).children[0].children[0].src = "../Images/Hot.gif";
		} else if (Browser == document.layers) {
			document.layers[Obj].children[0].children[0].src = "../Images/Hot.gif";
		} else if (Browser == document.getElementById) {
//			document.getElementById(Obj).children[0].children[0].src = "../Images/Hot.gif";
		}
	}
	function eTDPLength() {
		if (Browser == document.all) {
			return parseInt(document.all('TD~Pages').children.length);
		} else if (Browser == document.layers) {
			return parseInt(document.layers['TD~Pages'].children.length);
		} else if (Browser == document.getElementById) {
			return parseInt(document.getElementById('TD~Pages').children.length);
		}
	}
	function eTDPclick(TPage) {
		if (Browser == document.all) {
			document.all('TD~Pages').children[TPage].click();
		} else if (Browser == document.layers) {
			document.layers['TD~Pages'].children[TPage].click();
		} else if (Browser == document.getElementById) {
			document.getElementById('TD~Pages').children[TPage].click();
		}
	}
	function eMMenu(Obj,Previous) {
		if (Browser == document.all) {
			if (Previous != '') {
				document.all(Previous).children[0].src = "../Images/Cold.gif";
			}
			document.all(Obj).children[0].src = "../Images/Hot.gif";
		} else if (Browser == document.layers) {
			if (Previous != '') {
				document.layers[Previous].children[0].src = "../Images/Cold.gif";
			}
			document.layers[Obj].children[0].src = "../Images/Hot.gif";
		} else if (Browser == document.getElementById) {
			if (Previous != '') {
				document.getElementById(Previous).children[0].src = "../Images/Cold.gif";
			}
			document.getElementById(Obj).children[0].src = "../Images/Hot.gif";
		}
	}
	function eForm(Obj,M,T,P) {
		if (Browser == document.all) {
			document.all(Obj).method = M;
			document.all(Obj).target = T;
			document.all(Obj).action = P;
			document.all(Obj).submit();
		} else if (Browser == document.layers) {
			document.layers(Obj).method = M;
			document.layers(Obj).target = T;
			document.layers(Obj).action = P;
			document.layers(Obj).submit();
		} else if (Browser == document.getElementById) {
			document.getElementById(Obj).method = M;
			document.getElementById(Obj).target = T;
			document.getElementById(Obj).action = P;
			document.getElementById(Obj).submit();
		}
	}
	function eUForm(Obj,M,T,P) {
		if (Browser == document.all) {
			document.all(Obj).method = M;
			document.all(Obj).encoding = 'multipart/form-data';
			document.all(Obj).target = T;
			document.all(Obj).action = P;
			document.all(Obj).submit();
		} else if (Browser == document.layers) {
			document.layers(Obj).method = M;
			document.layers(Obj).encoding = 'multipart/form-data';
			document.layers(Obj).target = T;
			document.layers(Obj).action = P;
			document.layers(Obj).submit();
		} else if (Browser == document.getElementById) {
			document.getElementById(Obj).method = M;
			document.getElementById(Obj).encoding = 'multipart/form-data';
			document.getElementById(Obj).target = T;
			document.getElementById(Obj).action = P;
			document.getElementById(Obj).submit();
		}
	}
	function ePrint(Info) {
		if (Browser == document.all) {
			if (Info == 0) {
				window.parent.frames('FrInfo').innerHTML = "";
			} else {
				window.parent.frames('FrInfo').innerHTML = Info;
			}
		} else if (Browser == document.layers) {
			if (Info == 0) {
				window.parent.frames['FrInfo'].innerHTML = "";
			} else {
				window.parent.frames['FrInfo'].innerHTML = Info;
			}
		} else if (Browser == document.getElementById) {
			if (Info == 0) {
				window.parent.frames['FrInfo'].innerHTML = "";
				//window.txtInfo.innerHTML = "No information.";
			} else {
				window.parent.frames['FrInfo'].innerHTML = Info;
			}
		}
	}
	function eObject(Obj) {
		if (Browser == document.all) {
			return document.all(Obj);
		} else if (Browser == document.layers) {
			return document.layers[Obj];
		} else if (Browser == document.getElementById) {
			return document.getElementById(Obj);
		}
	}
	function eFrame(Fr) {
		if (Browser == document.all) {
			return window.parent.frames(Fr);
		} else if (Browser == document.layers) {
			return window.parent.frames[Fr];
		} else if (Browser == document.getElementById) {
			return window.parent.frames[Fr];
		}
	}
//------------------------------------
// Elbie Louw
//	Show and Hide Latest News Menu
//------------------------------------
	function toggleDiv(divid,imgid){
		if (Browser == document.all) {
			 if(document.all(divid).style.display == 'none'){
			      document.all(divid).style.display = 'block';
				 // document.all(divid).style.overflow='visible';
				  document.all(imgid).src = "../images/arrow_hide.gif"
			 }
			 else{
			      document.all(divid).style.display = 'none';
				 // document.all(divid).style.overflow='hidden';
				  document.all(imgid).src = "../images/arrow_show.gif"
			 }
		} else if (Browser == document.layers) {
			return document.layers[Obj].value;
			 if(document.layers[Obj].style.display == 'none'){
			      document.layers[Obj].style.display = 'block';
				 // document.layers[Obj].style.overflow='visible';
				  document.layers[Obj].src = "../images/arrow_hide.gif"
			 }
			 else{
			      document.layers[Obj].style.display = 'none';
				//   document.layers[Obj].style.overflow='hidden';
				  document.layers[Obj].src = "../images/arrow_show.gif"
			 }
		} else if (Browser == document.getElementById) {
			if(document.getElementById(divid).style.display == 'none'){
		      document.getElementById(divid).style.display = 'block';
			 // document.getElementById(divid).style.overflow='visible';
			  document.getElementById(imgid).src = "../images/arrow_hide.gif"
		    }else{
		      document.getElementById(divid).style.display = 'none';
			 // document.getElementById(divid).style.overflow='hidden';
			  document.getElementById(imgid).src = "../images/arrow_show.gif"
		    }
		}
  	} //toggleDiv
//---------------------------------
// Elbie Louw: Validate Email Address
//---------------------------------
function validEmail(str) {	
	var emailexp = /^[a-z][a-z_0-9\-\.]+@[a-z_0-9\.\-]+\.[a-z]{2,3}$/i;
	return emailexp.test(str)
}
//------------------------------------------------------
//	Elbie Louw: Makes String Blank if noting but spaces
//------------------------------------------------------
function AllSpace(str) { 
	for (i=0; i < str.length; i++) {
		if (str.charAt(i) != " ") {
			return str;
		}
	}
	return "";
}
//-----------------------------------------------------------------------------------
// Elbie Louw : Validate Date DDMMCCYYY
//-----------------------------------------------------------------------------------
function IsValidDate(strDate) 
{
	var ValidDate="0123456789"
	
	if (strDate.length<8){return false;}
	for (var i = 0; i < strDate.length; i++) {
			var ch =strDate.substr(i, 1)
			var a = ValidDate.indexOf(ch, 0)
			if (a == -1){return false;}
	}
	todayDate = new Date();
	var strDay=strDate.substr(0,2)
	var strMonth=strDate.substr(2,2)
	var strYear=strDate.substr(4,4)
	var intDay=parseInt(strDay,10)
	var intMonth=parseInt(strMonth,10)
	var intYear=parseInt(strYear,10)
	var intNowYear = todayDate.getFullYear() + 1;
	var intNowDay = todayDate.getDate();
	var intNowMonth = todayDate.getMonth(); // 0 based therefor add 1
	
	intNowMonth = intNowMonth + 1
	if (intMonth < 1 || intMonth > 12) {return false;}
	if (intYear < 1 || intYear > intNowYear) {return false;}
	if ((intMonth == 1 || intMonth == 3 || intMonth == 5 || intMonth == 7 || intMonth == 8 || intMonth == 10 || intMonth == 12) && (intDay > 31 || intDay < 1)) 
	{ return false;}
	if ((intMonth == 4 || intMonth == 6 || intMonth == 9 || intMonth == 11) && (intDay > 30 || intDay < 1)) 
	{ return false;}
	if (intMonth == 2) 
	{
		if (intDay < 1) {return false;}
		if (isLeapYear(intYear) == true) {
			if (intDay > 29) {return false;}
		}
		else {
		if (intDay > 28) {return false;}
		}
	}
	return true;
}
//------------------------------------------------------
//	Elbie Louw: Validate all errors and show all at once
//------------------------------------------------------
function formatError(strErr) {
	iNrErr++;
	sErr += "\n" + iNrErr +") "  + strErr
}
//------------------------------------
// Don't show javascript errors!
//------------------------------------
//function blockError(){return true;}
//window.onerror = blockError;
//------------------------------------------------------
//	Elbie Louw: Calendar Events
//------------------------------------------------------
function printDocument() {
	  self.focus();
	  self.print();
}
function showOnBar(Str) {
		window.status=Str;
		return true;
}
//-->
