/*<script language=javascript>*/
var WhiteSpaceRegExpBegin = /^\s+/;
var WhiteSpaceRegExpEnd = /\s+$/;

function show()
{


	var temp="<H6>Please provide details on how you heard about us:&nbsp;</H6>";
	var temp2="<INPUT size=30 name=other>";
	var temp3="<H6>Please list coach's name: &nbsp;</H6>";
	var temp4="<INPUT size=30 name=coach_name>";

	 
	 var tbl=document.getElementById('dash').rows;
	 var tblcell=tbl[0].cells;

	 tblcell[0].innerHTML="";
		   tblcell[1].innerHTML="";
	if(document.form.how_hear.options[document.form.how_hear.selectedIndex].text!=="Other"|| document.form.how_hear.options[document.form.how_hear.selectedIndex].value!=="Coach")
	{
		tblcell[0].innerHTML="";
		tblcell[1].innerHTML="";
	}
	if(document.form.how_hear.options[document.form.how_hear.selectedIndex].text=="Other")
	{
		tblcell[0].innerHTML=temp;
		tblcell[1].innerHTML=temp2;
	}
	if(document.form.how_hear.options[document.form.how_hear.selectedIndex].text=="Coach"){
		tblcell[0].innerHTML=temp3;
		tblcell[1].innerHTML=temp4;

		}
	//alert("Hi Done");
	/*
//alert(document.form.how_hear.options[document.form.how_hear.selectedIndex].text);
if(document.form.how_hear.options[document.form.how_hear.selectedIndex].text!=="Other"|| document.form.how_hear.options[document.form.how_hear.selectedIndex].value!=="Coach"){
document.tb.style.visibility='hidden';
document.tab1.style.visibility='hidden';
}
if(document.form.how_hear.options[document.form.how_hear.selectedIndex].text=="Other"){
document.tb.style.visibility='visible';
document.tab1.style.visibility='hidden';
}

if(document.form.how_hear.options[document.form.how_hear.selectedIndex].text=="Coach"){
document.tab1.style.visibility='visible';
document.tb.style.visibility='hidden';
}
*/
}

function isBlank (WhichField) {
	
	var TestVal;
	
	if (WhichField.type == "select-one" ) {	 
		if (WhichField.selectedIndex == -1 || WhichField.options[WhichField.selectedIndex].value == 0) {
			TestVal = '';
		} else {	
			TestVal = WhichField.options[WhichField.selectedIndex].text;
		}
	} else {
		if (WhichField.type == "checkbox") {
			if (WhichField.checked == false) {
				TestVal = '';
			} else {
				TestVal = 'on';
			}
		} else {
			TestVal = WhichField.value;
		}
	}
	
	//Replace any whitespace at beginning and end of string with nothing	
	TestVal = TestVal.replace(WhiteSpaceRegExpBegin,'');
	TestVal = TestVal.replace(WhiteSpaceRegExpEnd,'');

	if (TestVal == '') {
		return(true);
	} else {
		return(false);	
	} 
}
	
function formatDecimal(NbrIn) {
	var NbrString = NbrIn.toString();
	var DecPos;
	
	//Get out if not a number
	if (isNaN(NbrIn)) {
		return('');
	}
	
	//Format number with 2 decimals
	DecPos = NbrString.indexOf('.');
			
	if (DecPos == -1) {
		//No decimals found so append .00
		NbrString = NbrString + '.00';
	} else {
		//One decimal found so append 1 extra zero
		if (NbrString.length - 2 == DecPos) {
			NbrString = NbrString + '0';	
		}
	}
	return(NbrString);	
}


function CheckValidDate(WhichDate) {
	
	var SplitStr;
	var SplitDate;
	var NumSplits;
	
	//Check for date separator either / or -
	SplitStr = WhichDate.indexOf("/");
	if (SplitStr == -1) {
		SplitStr = "-";
	} else {
		SplitStr = "/";
	}
	
	//Split by separator into mm dd yy
	SplitDate = WhichDate.split(SplitStr);
	NumSplits = SplitDate.length;
	if (NumSplits != 3) {
		return('Error');
	} else {
		mm = SplitDate[0];
		dd = SplitDate[1];
		yy = SplitDate[2];
	}
	
	if (yy.length != 2 ) {
		if(yy.length!=4 ){
			return('Error');
		}else{
			if (isNaN(yy) || yy<0  || yy>2100) return('Error');
		}
	}else{
		if (isNaN(yy) || yy<0  || yy>99) return('Error');
	}
			
	//basic error checking - check for number and proper range
	
	if (isNaN(mm) || mm<1  || mm>12) return('Error');
	if (isNaN(dd) || dd<1  || dd>31) return('Error');
	

	
	//advanced error checking

	// months with 30 days
	if (mm==4 || mm==6 || mm==9 || mm==11) {
		if (dd==31) return('Error');

	}

	// february, leap year
	if (mm==2) {
		if (dd>29) 	return('Error');

		if (dd==29) {
			if ((yy % 4 == 0 && yy % 100 != 0) || yy % 400 == 0) {
				return('OK');
			} else {
				return('Error');
			}
		}
	}
	return('OK');
}

function getMMDDCCYY(DateMMDDYY) {
	var Date1;
	var dd;
	var mm;
	var yr;
	Date1 = new Date(DateMMDDYY);
	dd = Date1.getDate();
	mm = Date1.getMonth();
	yr = Date1.getYear();
	if (yr < 50) {
		yr = yr + 2000;
	}
	return (new Date(yr,mm,dd));
}

function calcNewDate(originalDate, DayInc) {
	//Arguments:
	//originalDate - date passed to this function to be incremented or decremented	
	//DayInc - number of days to adjust. Can be positive or negative
	
	var CheckValidDate = new Date(originalDate);
	
	//Increment day portion of date 
	NewDay = CheckValidDate.getDate() + DayInc;
	
	//Set return date to original date, then increment days
	var ReturnDate = CheckValidDate;
	ReturnDate.setDate(NewDay);
	return ReturnDate;
}

function dateFormat(dateIn, yrDigits, addMthDayZeros, showDayName, showMonthName) {
	//Arguments:
	//dateIn - date passed to this function to be formatted
	//yrDigits - 2 or 4,  i.e. 03 or 2003. Default is to return a 4 digit year.
	//addMthDayZeros - '0' to add leading zeros to month or day < 10, i.e. '07/05/2003'. Default is no leading zeros.
	//showDayName - 'A' (for abbrev) or 'F' (full name). Default is no day name.
	//showMonthName - 'A' (for abbrev) or 'F' (full name). Default is no month name.

	var DayNames = new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');
	var MthNames = new Array("January", "February", "March", "April", "May", "June","July","August","September","October","November","December");
	var WeekdayName = '';
	var dateOut = '';
	

	//Get out if not a valid date
	if (CheckValidDate(dateIn) == 'Error') {
		return('');
	}


	var WorkDate = getMMDDCCYY(dateIn);

	//Get basics - mm/dd/yyyy
	var mm = WorkDate.getMonth() + 1;
	var dd = WorkDate.getDate();
	var yy = WorkDate.getFullYear();

	//Add leading zeros to month and day < 10 if requested
	if (addMthDayZeros == '0') {
		if (mm < 10) {
			mm = "0" + mm;
		}
		if (dd < 10) {
			dd = "0" + dd;
		}
	}

	//Change 4 digit year to 2 digits if requested
	if (yrDigits == '2') {
		yy = yy.toString();
		yy = yy.substr(2,2);
	}

	//Get the day name based on the day number. Return 3 letter abbrev if requested
	if (showDayName == 'A' || showDayName == 'F') {
		var weekdayNbr = WorkDate.getDay();

		WeekdayName = DayNames[weekdayNbr];
		if (showDayName == 'A') {
			WeekdayName = WeekdayName.substr(0,3);
		}
		WeekdayName = WeekdayName + ' ';
	}

	//Get the month name based on the month number. Return 3 letter abbrev if requested
	if (showMonthName == 'A' || showMonthName == 'F') {
		var mthNbr = WorkDate.getMonth();
		
		MonthName = MthNames[mthNbr];
		if (showMonthName == 'A') {
			MonthName = MonthName.substr(0,3);
		}
		//Always return long format if month was requested
		dateOut = WeekdayName + MonthName + ' ' + dd + ', ' + yy;
	} else {
		dateOut = WeekdayName + mm + '/' + dd + '/' + yy;
	}
	return(dateOut);
}

function isEmail(emailStr) {
/* The following pattern is used to check if the entered e-mail address
   fits the user@domain format.  It also is used to separate the username
   from the domain. */
var emailPat=/^(.+)@(.+)$/
/* The following string represents the pattern for matching all special
   characters.  We don't want to allow special characters in the address. 
   These characters include ( ) < > @ , ; : \ " . [ ]    */
var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]"
/* The following string represents the range of characters allowed in a 
   username or domainname.  It really states which chars aren't allowed. */
var validChars="\[^\\s" + specialChars + "\]"
/* The following pattern applies if the "user" is a quoted string (in
   which case, there are no rules about which characters are allowed
   and which aren't; anything goes).  E.g. "jiminy cricket"@disney.com
   is a legal e-mail address. */
var quotedUser="(\"[^\"]*\")"
/* The following pattern applies for domains that are IP addresses,
   rather than symbolic names.  E.g. joe@[123.124.233.4] is a legal
   e-mail address. NOTE: The square brackets are required. */
var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/
/* The following string represents an atom (basically a series of
   non-special characters.) */
var atom=validChars + '+'
/* The following string represents one word in the typical username.
   For example, in john.doe@somewhere.com, john and doe are words.
   Basically, a word is either an atom or quoted string. */
var word="(" + atom + "|" + quotedUser + ")"
// The following pattern describes the structure of the user
var userPat=new RegExp("^" + word + "(\\." + word + ")*$")
/* The following pattern describes the structure of a normal symbolic
   domain, as opp sed to ipDomainPat, shown above. */
var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$")
/* Finally, let's start trying to figure out if the supplied address is
   valid. */

/* Begin with the coarse pattern to simply break up user@domain into
   different pieces that are easy to analyze. */
var matchArray=emailStr.match(emailPat)

// Check for the Email start with number.
if ('0123456789'.indexOf(emailStr.charAt(0)) >= 0) 
{
   return false;    
}
if ('!%&\\(\\)<>@,;:\\\\\\\"\\.\\[\\]'.indexOf(emailStr.charAt(0)) >= 0) 
{
   return false;    
}

if (matchArray==null) {
  /* Too many/few @'s or something; basically, this address doesn't
     even fit the general mould of a valid e-mail address. */
   //alert("Email address seems incorrect (check @ and .'s)")
   return false
}
var user=matchArray[1]
var domain=matchArray[2]

// See if "user" is valid 
if (user.match(userPat)==null) {
    // user is not valid
    //alert("The username doesn't seem to be valid.")
    return false
}

/* if the e-mail address is at an IP address (as opposed to a symbolic
   host name) make sure the IP address is valid. */
var IPArray=domain.match(ipDomainPat)
if (IPArray!=null) {
    // this is an IP address
     for (var i=1;i<=4;i++) {
       if (IPArray[i]>255) {
     //      alert("Destination IP address is invalid!")
      return false
       }
    }
    return true
}

// Domain is symbolic name
var domainArray=domain.match(domainPat)
if (domainArray==null) {
   //alert("The domain name doesn't seem to be valid.")
    return false
}

/* domain name seems valid, but now make sure that it ends in a
   three-letter word (like com, edu, gov) or a two-letter word,
   representing country (uk, nl), and that there's a hostname preceding 
   the domain or country. */

/* Now we need to break up the domain to get a count of how many atoms
   it consists of. */
var atomPat=new RegExp(atom,"g")
var domArr=domain.match(atomPat)
var len=domArr.length
if (domArr[domArr.length-1].length<2 || 
    domArr[domArr.length-1].length>3) {
   // the address must end in a two letter or three letter word.
   //alert("The address must end in a three-letter domain, or two letter country.")
   return false
}

// Make sure there's a host name preceding the domain.
if (len<2) {
   //var errStr="This address is missing a hostname!"
   //alert(errStr)
   return false
}

// If we've gotten this far, everything's valid!
return true;
}


function LTrim(str){
    for(var i=0;str.charAt(i)==" ";i++);
    return str.substring(i,str.length);
    }
function RTrim(str){
    for(var i=str.length-1;str.charAt(i)==" ";i--);
    return str.substring(0,i+1);
    }
function Trim(str){return LTrim(RTrim(str));}

function isNull(val){return(val==null);}

//-------------------------------------------------------------------
// isInteger(value)
//   Returns true if value contains all digits
//-------------------------------------------------------------------
function isInteger(val){
    for(var i=0;i<val.length;i++){
        if(!isDigit(val.charAt(i))){return false;}
        }
    return true;
    }

//-------------------------------------------------------------------
// isNumeric(value)
//   Returns true if value contains a positive float value
//-------------------------------------------------------------------
function isNumeric(val)
{
	return (parseFloat(val,10)==(val*1));
}

//-------------------------------------------------------------------
// isDigit(value)
//   Returns true if value is a 1-character digit
//-------------------------------------------------------------------
function isDigit(num) {
    if (num.length>1){return false;}
    var string="1234567890";
    if (string.indexOf(num)!=-1){return true;}
    return false;
    }

//Get the file extension of a file
//getExtension ("D:\\Projects\\market leads\\UploadedSite\\images\\top_right.jpg");
function getExtension (filename)
{
	//alert(filename);
	filename = filename.toLowerCase();
	
	fileArr = filename.split("\\");
	
	//alert("length " + fileArr.length);
	
	fname = fileArr[fileArr.length-1];
	
	fnameArr = fname.split(".");
	
	ext = fnameArr[fnameArr.length-1];
	
	//alert(ext);
	
	return ext;
}

//Function to create thumbnail of images
function view_thumbnail(objImage,minHeight,minWidth)
{
	var fHProportion,fWProportion,fScaleFactor

	if(objImage.height < minHeight) 
	{
		minHeight= objImage.height;
	}
	if(objImage.width < minWidth) 
	{
		minWidth= objImage.width;
	}

	fHProportion=objImage.height/minHeight
	fWProportion=objImage.width/minWidth
	if (fHProportion > fWProportion )
	{
		fScaleFactor = 1/fHProportion
		minWidth = objImage.width * fScaleFactor
	}
	else if (fWProportion > fHProportion)
	{
		fScaleFactor = 1/fWProportion
		minHeight = objImage.height * fScaleFactor
	}

	objImage.height=minHeight;	
	objImage.width=minWidth;
	
}

function redirect_page (strUrl)
{
	window.location.href = strUrl;
}

//This function will make the field readonly
function make_readonly(strMsg)
{
	alert(strMsg);
	return false;
}

//function to check URLs
function checkURLNew(sUrl)
	{
		var url = false ;
		var isNot = "`!@$^*()[{]}\|;'',<> " ;
		if (sUrl.length != 0 )
		{
			if (sUrl.indexOf('://') != -1 || sUrl.indexOf(':') != -1)
			{
				if (sUrl.indexOf('"') == -1)
				{
					url = true ;
					if (sUrl.length <= 7 )
					{
						url = false ;	
					}
					for (i=0;i!=sUrl.length;++i)
					{
						if (isNot.indexOf(sUrl.substring(i,i+1)) != -1)
						{
							url = false ;	
						}
					}
					//Checking for .com, .co, .net, .org	in the URL				
					if (sUrl.indexOf('.com') != -1)
					{
						url = true ;						
					}
					else
					{
						if (sUrl.indexOf('.co') != -1)
						{
							url = true ;						
						}
						else
						{	
							if (sUrl.indexOf('.net') != -1)
							{
								url = true ;
							}
							else
							{
								if(sUrl.indexOf('.org') != -1)
								{
									url = true ;
								}
								else
								{
									url = false ;
								}
							}
						}
					}
					//
				}
			}
		}
		else{
			url=true;
		}	
		if (url == false )
		{
			//alert('In valid URL') ;
			return false;
		}
		else
		{
			//checkURLNew = true ;
			return true ;
		}	
	}

function checkURL(sUrl)
{
	var url = false ;
	var isNot = "`!@$^*()[{]}\|;'',<> " ;
	if (sUrl.length != 0 )
	{
		if (sUrl.indexOf('://') != -1)
		{
			if (sUrl.indexOf('"') == -1)
			{
				url = true ;
				if (sUrl.length <= 7 )
				{
					url = false ;	
				}
				for (i=0;i!=sUrl.length;++i)
				{
					if (isNot.indexOf(sUrl.substring(i,i+1)) != -1)
					{
						url = false ;	
					}
				}
			}
		}
	}	
	if (url == false )
	{
		//alert('In valid URL') ;
		return false;
	}
}
function htmlize(str)
{
        str = str.replace(/\&/g,"&amp;");
        str = str.replace(/\</g,"&lt;");
        str = str.replace(/\>/g,"&gt;");
        str = str.replace(/\"/g,"&quot;");
        str = str.replace(/\n/g,"<br/>\n");
        return str;
}

//for pagination 
function setdata(pageno)
    {
    	//alert("here");
    	//alert(document.forms[0].name);
        //var frmname=document.getElementById("offset").getAttribute("form").name;
        //var frmname=document.forms[0].name;
        //alert (frmname);
        frmname="frm_page";
        document.forms[frmname].page.value=pageno;
        //document.forms[frmname].mode.value=act;
        document.forms[frmname].action="";
        document.forms[frmname].submit();
    }

    function setoffset(blockno, iBlockNos)
    {
        //var frmname=document.getElementById("offset").getAttribute("form").name;
        var frmname=document.forms[0].name;
        //alert(frmname);
        document.forms[frmname].offset.value=blockno;
        document.forms[frmname].mode.value="";
        document.forms[frmname].page.value=blockno * iBlockNos +1;
        document.forms[frmname].submit();
    }
/*</script> */
function order_list (strOrderBy)
{
	//Get the original sequence of ordering (Asc/Desc)
	state = document.frm_page.order_seq.value

	//If the "order by" field is empty or the sequence is "Desc" then make the sequence "Asc"
	//If "order by" clause is not the same as the one selected now then make the sequence "Asc"
	//Else make the sequence "Desc"
	if (document.frm_page.order_by.value == "" || state == "Desc")
		sequence = "Asc";
	else if (document.frm_page.order_by.value != strOrderBy)
		sequence = "Asc";
	else
		sequence = "Desc";

	document.frm_page.order_by.value = strOrderBy;
	document.frm_page.order_seq.value = sequence;
	document.frm_page.submit();

}

//////////////////// FUNCTION FOR DATE COMP//////////////
function DateComp(sdt1,sdt2) {

	if (isDate(sdt1) && isDate(sdt2))
	{
	}
	else
	{
		return false; 
	}
	//changed month to day
	var month1 = sdt1.charAt(0) == "0" ? parseInt(sdt1.substring(1,2)) : parseInt(sdt1.substring(0,2));
	var day1 = sdt1.charAt(3) == "0" ? parseInt(sdt1.substring(4,5)) : parseInt(sdt1.substring(3,5));
	var begin1 = sdt1.charAt(6) == "0" ? (sdt1.charAt(7) == "0" ? (sdt1.charAt(8) == "0" ? 9 : 8) : 7) : 6;
	var year1 = parseInt(sdt1.substring(begin1, 10));
	var dt1 = new Date(year1,month1,day1)
	
	var month2  = sdt2.charAt(0) == "0" ? parseInt(sdt2.substring(1,2)) : parseInt(sdt2.substring(0,2));
	var day2 = sdt2.charAt(3) == "0" ? parseInt(sdt2.substring(4,5)) : parseInt(sdt2.substring(3,5));
	var begin2 = sdt2.charAt(6) == "0" ? (sdt2.charAt(7) == "0" ? (sdt2.charAt(8) == "0" ? 9 : 8) : 7) : 6;
	var year2 = parseInt(sdt2.substring(begin2, 10));
	var dt2 = new Date(year2,month2,day2)

	if (year1 > year2 ) 
	   return true;
	else
	{
	  if (year1==year2)
	  {
			if (month1 > month2)
			{
				return true;
			}
			else
			{
				if  (month1 == month2)
				{		//changed by rahul here > to <
					if (day1 < day2)
					{	//false to true
						return false;}
					else
					{	//true to false
						return true ;}
				}
				else
				{
					return false;
				}	
			}			
	  }
	  else
	  {
		return false ;
	   }	
	}	   
}
//////////////////// FUNCTION FOR DATE FORMAT/////////////////// 
/*function isDat(str) 
{
			   if ((str.length) > 10 || (str.length) < 10) 
				{ 
				   return false; 
				}


 // for (j=0; j<str.length; j++) {
  // if ((j == 2) || (j == 5)) {
      if (str.charAt(j) != "/") { return false }
    } 
    else 
   // {
      if ((str.charAt(j) < "0") || (str.charAt(j) > "9")) { return false }
   // }
//  }




			var first, second;
			first = str.indexOf("-");
			second = str.indexOf("-", first+1);
    //alert(first);
    //alert(second);
	//var month = parseInt(str.substring(0, first));
			//var month = (str.substring(first + 1, second));
			
			//var day = 0;
			//day = str.substring(second + 1);
			
			//var year = parseInt(str.substring(0, first));
			var month = parseInt(str.substring(0, first));
			//var day = 0;
			var day = str.substring(first + 1, second);
			var year = str.substring(second + 1);
	
  //var day = str.charAt(0) == "0" ? parseInt(str.substring(1,2)) : parseInt(str.substring(0,2));
//  var day = str.charAt(3) == "0" ? parseInt(str.substring(4,5)) : parseInt(str.substring(3,5));
 // var month = str.charAt(0) == "0" ? parseInt(str.substring(1,2)) : parseInt(str.substring(0,2));
 // var begin = str.charAt(6) == "0" ? (str.charAt(7) == "0" ? (str.charAt(8) == "0" ? 9 : 8) : 7) : 6;
 // var year = parseInt(str.substring(begin, 10));

  
		 // alert (month);
		  //alert (day);
		  //alert (year);
		
		
	//if((month.length) < 2)
	//{return false;}

	
	  if (day == 0) 
		  {
		  return false;
		  }
	  if (month == 0 || month > 12) 
			  {
			  return false;
			  }
		  if (str.substring(second + 1).length < 4) 
			  {
			  return false; 
			  }

			 
  //I chnaged this function according to my need
  //For reservation i needed current year and above 
  //This condition checkes 1900 and current year
  //if (!(year >= 1900 && year <= dt.getFullYear())) { return false; }
  ///
    // if (!(year >=dt.getFullYear())) 
			  
	//	 {
	//		  return false; 
	//		  }
       
   if (month == 1 || month == 3 || month == 5 || month == 7 || month == 8 || month == 10 || month == 12) 
    {
		if (day > 31) 
		{ 
		 return false; 
		}
      }
      else 
     {
         if (month == 4 || month == 6 || month == 9 || month == 11)
		  {
			  if (day > 30) 
				  {
				  return false; 
				  }
           } 
		 else 
		  {
					   if (year%4 != 0)
							  {
							if (day > 28) {return false; }
							  } 
					  else
						 
					  {
						if (day > 29) {return false; }
					  }
			}
   }
   return true;
  
}*/
/*function isDate(dtStr){

	var dtCh= "-";
var minYear=1900;
var maxYear=2100;

function isInteger(s){
	var i;
    for (i = 0; i < s.length; i++){   
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}

function stripCharsInBag(s, bag){
	var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < s.length; i++){   
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}

function daysInFebruary (year){
	// February has 29 days in any year evenly divisible by four,
    // EXCEPT for centurial years which are not also divisible by 400.
    return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );
}
function DaysArray(n) {
	for (var i = 1; i <= n; i++) {
		this[i] = 31
		if (i==4 || i==6 || i==9 || i==11) {this[i] = 30}
		if (i==2) {this[i] = 29}
   } 
   return this
}

function isDate(dtStr){
	var daysInMonth = DaysArray(12)
	var pos1=dtStr.indexOf(dtCh)
	var pos2=dtStr.indexOf(dtCh,pos1+1)
	var strMonth=dtStr.substring(0,pos1)
	var strDay=dtStr.substring(pos1+1,pos2)
	var strYear=dtStr.substring(pos2+1)
	strYr=strYear
	if (strDay.charAt(0)=="0" && strDay.length>1) strDay=strDay.substring(1)
	if (strMonth.charAt(0)=="0" && strMonth.length>1) strMonth=strMonth.substring(1)
	for (var i = 1; i <= 3; i++) {
		if (strYr.charAt(0)=="0" && strYr.length>1) strYr=strYr.substring(1)
	}
	month=parseInt(strMonth)
	day=parseInt(strDay)
	year=parseInt(strYr)
	if (pos1==-1 || pos2==-1){
		alert("The date format should be : mm/dd/yyyy")
		return false
	}
	if (strMonth.length<1 || month<1 || month>12){
		alert("Please enter a valid month")
		return false
	}
	if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month]){
		alert("Please enter a valid day")
		return false
	}
	if (strYear.length != 4 || year==0 || year<minYear || year>maxYear){
		alert("Please enter a valid 4 digit year between "+minYear+" and "+maxYear)
		return false
	}
	if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false){
		alert("Please enter a valid date")
		return false
	}
return true
}

function ValidateForm(){
	var dt=document.frm_Page.txtDate
	if (isDate(dt.value)==false){
		dt.focus()
		return false
	}
    return true
 }

*/