/* 
    This is the source code for the validation function. 
    Add the following code just after the </HEAD> in the files where the 
    generalised validation functionality is required. 
    <SCRIPT language="JavaScript1.2" src="validation.js"></SCRIPT> 
*/ 

    /* 
    *   File : validation.js 
    *     
    *   Author : Prasanth M J 
    *   
    *   CreativeProgrammers.com - 
	*	Turn your Programming Expertise into Achievements!
    *   Visit http://www.creativeprogrammers.com 
    *     
    *   Email : prasanth@creativeprogrammers.com
    */ 
//---------------------------------EMail Check ------------------------------------ 

/*  checks the validity of an email address entered 
*   returns true or false 
*   
*/ 

function validateEmail(email)
{
// a very simple email validation checking. 
// you can add more complex email checking if it helps 
    var splitted = email.match("^(.+)@(.+)$");
    if(splitted == null) return false;
    if(splitted[1] != null )
    {
      var regexp_user=/^\"?[\w-_\.]*\"?$/;
      if(splitted[1].match(regexp_user) == null) return false;
    }
    if(splitted[2] != null)
    {
      var regexp_domain=/^[\w-\.]*\.[A-Za-z]{2,4}$/;
      if(splitted[2].match(regexp_domain) == null) 
      {
	    var regexp_ip =/^\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\]$/;
	    if(splitted[2].match(regexp_ip) == null) return false;
      }// if
      return true;
    }
return false;
}

/*****isFloat************************/
function isFloat(inputValue)
{
	var reFloat = /^((\d+(\.\d*)?)|((\d*\.)?\d+))$/;
	
	if (reFloat.test(inputValue) == false)
	{
		return false;
	}
	else
	{
		return true;
	}	
	
}
/*********************************************************************/
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 greaterThanEqualToDate(strDate1,strDate2) // by akash 23 jan 07
{	
	var firstIndex = 0 + strDate1.indexOf ('-');	
	var lastIndex = 0 + strDate1.lastIndexOf ('-');	
	var date1 = strDate1.substring (0, firstIndex);
	var month1 = strDate1.substring (firstIndex+1, lastIndex);
	var year1 = strDate1.substring (lastIndex+1, strDate1.length);

	var date2 = strDate2.substring (0, firstIndex);
	var month2 = strDate2.substring (firstIndex+1, lastIndex);
	var year2 = strDate2.substring (lastIndex+1, strDate2.length);
	
	var enteredDate1 = new Date(year1,month1,date1); // 
	var enteredDate2 = new Date(year2,month2,date2); // 	
	//alert("date-->"+enteredDate+"-->"+enteredDate.getTime()+"----CurrentDate--->"+currentDate+"--->"+currentDate.getTime());
	if (enteredDate1.getTime() >= enteredDate2.getTime())
	{	
		return true;
	}
	else
	{
		return false;
	}
}
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 lessThanEqualTodayDate(strDate)
{	
	var firstIndex = 0 + strDate.indexOf ('-');	
	var lastIndex = 0 + strDate.lastIndexOf ('-');	
	var date1 = strDate.substring (0, firstIndex);
	var month1 = strDate.substring (firstIndex+1, lastIndex);
	var year1 = strDate.substring (lastIndex+1, strDate.length);

	var currentDate = new Date();
	var enteredDate = new Date(year1,month1-1,date1); // sub one from month because in javascript months are indexed as 0-11	
	//alert("date-->"+enteredDate+"-->"+enteredDate.getTime()+"----CurrentDate--->"+currentDate+"--->"+currentDate.getTime());
	if (enteredDate.getTime() <= currentDate.getTime())
	{	
		return true;
	}
	else
	{
		return false;
	}
}
function isGreaterThanTodayDate(strDate)
{	
	var firstIndex = 0 + strDate.indexOf ('/');	
	var lastIndex = 0 + strDate.lastIndexOf ('/');	

	var date1 = strDate.substring (0, firstIndex);
	var month1 = strDate.substring (firstIndex+1, lastIndex);
	var year1 = strDate.substring (lastIndex+1, strDate.length);

	var currentDate = new Date();
	
	var enteredDate = new Date(year1,month1-1,date1); // sub one from month because in javascript months are indexed as 0-11	
	
	if (enteredDate.getTime() > currentDate.getTime())
	{	
		return true;
	}
	else
	{
		return false;
	}
}

/*************************************************************************/

/* function validateData 
*  Checks each field in a form 
*  Called from validateForm function 
*/ 
function validateData(strValidateStr,objValue,strError) 
{    
	 var epos = strValidateStr.search("="); 
    var  command  = ""; 
    var  cmdvalue = ""; 
    if(epos >= 0) 
    { 
     command  = strValidateStr.substring(0,epos); 
     cmdvalue = strValidateStr.substr(epos+1); 
    } 
    else 
    { 
     command = strValidateStr; 
    } 

    switch(command) 
    { 		
        case "req": 
        case "required": 
         { 
           if(eval(objValue.value.length) == 0 || trim(objValue.value) == "") 
           { 
              if(!strError || strError.length ==0) 
              { 
                strError = objValue.id + " : Required Field"; 
              }//if 
              alert(strError); 
              return false; 
           }//if 
           break;             
         }//case required 
        case "maxlength": 
        case "maxlen": 
          { 
             if(eval(objValue.value.length) >  eval(cmdvalue)) 
             { 
               if(!strError || strError.length ==0) 
               { 
                 strError = objValue.id + " : "+cmdvalue+" characters maximum "; 
               }//if 
               alert(strError + "\n[Current length = " + objValue.value.length + " ]"); 
               return false; 
             }//if 
             break; 
          }//case maxlen 
        case "minlength": 
        case "minlen": 
           { 
             if(eval(objValue.value.length) <  eval(cmdvalue)) 
             { 
               if(!strError || strError.length ==0) 
               { 
                 strError = objValue.id + " : " + cmdvalue + " characters minimum  "; 
               }//if               
               alert(strError + "\n[Current length = " + objValue.value.length + " ]"); 
               return false;                 
             }//if 
             break; 
            }//case minlen  
		 
		case "IsNotEmpty":
		{			
		
			 if(objValue.value.length > 0) 
			 { 			
				if(trim(objValue.value) == "") 
			 	  { 
					  if(!strError || strError.length ==0) 
					  { 
						strError = objValue.id + " : No Empty Space Allowed , Please enter valid data!"; 
					  }//if 
				  alert(strError); 
				  return false; 
			   }//if 
			 }
           break;  
		}//  end :  IsNotEmpty
        case "alnum": 
        case "alphanumeric": 
           { 
              var charpos = objValue.value.search("[^A-Za-z0-9]"); 
              if(objValue.value.length > 0 &&  charpos >= 0) 
              { 
               if(!strError || strError.length ==0) 
                { 
                  strError = objValue.id+": Only alpha-numeric characters allowed "; 
                }//if 
                alert(strError + "\n [Error character position " + eval(charpos+1)+"]"); 
                return false; 
              }//if 
              break; 
           }//case alphanumeric
        case "applicantName": 
           { 
               var charpos = objValue.value.search("[^A-Za-z.()&_ -]");
					//var charpos = objValue.value.search("[^A-Za-z\/.,()&_ -]"); 
              if(objValue.value.length > 0 &&  charpos >= 0) 
              { 
                  if(!strError || strError.length ==0) 
                { 
                  strError = objValue.id+": Only 'a-z,A-Z , . ( ) & _ - space' are allowed"; 
                }//if                             
                alert(strError + "\n [Error character position " + eval(charpos+1)+"]"); 
                return false; 
              }//if 
              break; 
           }//applicantName
		    case "industryName": 
           { 
             
				  var charpos = objValue.value.search("[^A-Za-z0-9.,()&_ -]"); 
              if(objValue.value.length > 0 &&  charpos >= 0) 
              { 
               if(!strError || strError.length ==0) 
                { 
                  strError = objValue.id+": Only 'a-z,A-Z,0-9 , . ( ) & _ - space' allowed"; 
                }//if 
                alert(strError + "\n [Error character position " + eval(charpos+1)+"]"); 
                return false; 
              }//if 
              break; 
           }//case industryName  
		case "num": 
        case "numeric": 
           { 
              var charpos = objValue.value.search("[^0-9]"); 
              if(objValue.value.length > 0 &&  charpos >= 0) 
              { 
                if(!strError || strError.length ==0) 
                { 
                  strError = objValue.id+": Only digits allowed "; 
                }//if               
                alert(strError + "\n [Error character position " + eval(charpos+1)+"]"); 
                return false; 
              }//if 
              break;               
           }//numeric 
        case "float": 
          { 
               if(!isFloat(objValue.value)) 
               { 
                 if(!strError || strError.length ==0) 
                 { 
                    strError = objValue.id+": Please enter a valid integer/decimal value"; 
                 }//if                                               
                 alert(strError); 
                 return false; 
               }//if 
           break; 
          }//case float 		   		   
        case "alphabetic": 
        case "alpha": 
           { 
              var charpos = objValue.value.search("[^A-Za-z]"); 
              if(objValue.value.length > 0 &&  charpos >= 0) 
              { 
                  if(!strError || strError.length ==0) 
                { 
                  strError = objValue.id+": Only alphabetic characters allowed "; 
                }//if                             
                alert(strError + "\n [Error character position " + eval(charpos+1)+"]"); 
                return false; 
              }//if 
              break; 
           }//alpha 		   
        case "alphaspace": 
           { 
              var charpos = objValue.value.search("[^A-Za-z ]"); 
              if(objValue.value.length > 0 &&  charpos >= 0) 
              { 
                  if(!strError || strError.length ==0) 
                { 
                  strError = objValue.id+": Only alphabetic characters allowed "; 
                }//if                             
                alert(strError + "\n [Error character position " + eval(charpos+1)+"]"); 
                return false; 
              }//if 
              break; 
           }//alphaspace		   
        case "alphaspacecomma": 
           { 
              var charpos = objValue.value.search("[^A-Za-z ,]"); 
              if(objValue.value.length > 0 &&  charpos >= 0) 
              { 
                  if(!strError || strError.length ==0) 
                { 
                  strError = objValue.id+": Only alphabetic characters allowed "; 
                }//if                             
                alert(strError + "\n [Error character position " + eval(charpos+1)+"]"); 
                return false; 
              }//if 
              break; 
           }//alphaspacecomma		   		   
        case "alnumspacecomma": 
           { 
              var charpos = objValue.value.search("[^A-Za-z0-9 ,]"); 
              if(objValue.value.length > 0 &&  charpos >= 0) 
              { 
                  if(!strError || strError.length ==0) 
                { 
                  strError = objValue.id+": Only alphabetic characters allowed "; 
                }//if                             
                alert(strError + "\n [Error character position " + eval(charpos+1)+"]"); 
                return false; 
              }//if 
              break; 
           }//alnumspacecomma	   		   
        case "numspacecomma": 
           { 
              var charpos = objValue.value.search("[^0-9 ,]"); 
              if(objValue.value.length > 0 &&  charpos >= 0) 
              { 
                  if(!strError || strError.length ==0) 
                { 
                  strError = objValue.id+": Only Numeric characters(0-9) & , are allowed "; 
                }//if                             
                alert(strError + "\n [Error character position " + eval(charpos+1)+"]"); 
                return false; 
              }//if 
              break; 
           }//numspacecomma   		   
        case "numHypen": 
           { 
              var charpos = objValue.value.search("[^0-9 -]"); 
              if(objValue.value.length > 0 &&  charpos >= 0) 
              { 
                  if(!strError || strError.length ==0) 
                { 
                  strError = objValue.id+": Only Numeric characters(0-9) and Hypen(-) are allowed "; 
                }//if                             
                alert(strError + "\n [Error character position " + eval(charpos+1)+"]"); 
                return false; 
              }//if 
              break; 
           }//numHypen		   		   
        case "address": 
           { 
              var charpos = objValue.value.search("[^A-Za-z0-9#,-.()_?=&% \\s]"); 
				  //var charpos = objValue.value.search("[^\n/A-Za-z0-9,-. ]"); 
              if(objValue.value.length > 0 &&  charpos >= 0) 
              { 
                  if(!strError || strError.length ==0) 
                { 
                  strError = objValue.id+": Special Characters Are Not Allowed "; 
                }//if                             
                alert(strError + "\n [Error character position " + eval(charpos+1)+"]"); 
                return false; 
              }//if 
              break; 
           }//address		
        case "alnumspace": 
           { 
              var charpos = objValue.value.search("[^A-Za-z0-9 ]"); 
              if(objValue.value.length > 0 &&  charpos >= 0) 
              { 
                  if(!strError || strError.length ==0) 
                { 
                  strError = objValue.id+": Only alphabetic characters allowed "; 
                }//if                             
                alert(strError + "\n [Error character position " + eval(charpos+1)+"]"); 
                return false; 
              }//if 
              break; 
           }//alnumspace				
		 case "email": 
          { 
			 
			if(objValue.value!="") {
               if(!validateEmail(objValue.value)) 
               { 
                 if(!strError || strError.length ==0) 
                 { 
                    strError = objValue.id+": Enter a valid Email address "; 
                 }//if                                               
                 alert(strError); 
                 return false; 
               }//if 
			}
           break; 
          }//case email 
        case "lt": 
        case "lessthan": 
         { 
            if(isNaN(objValue.value)) 
            { 
              alert(objValue.id+": Should be a number "); 
              return false; 
            }//if 
            if(eval(objValue.value) >=  eval(cmdvalue)) 
            { 
              if(!strError || strError.length ==0) 
              { 
                strError = objValue.id + " : value should be less than "+ cmdvalue; 
              }//if               
              alert(strError); 
              return false;                 
             }//if             
            break; 
         }//case lessthan 
        case "gt": 
        case "greaterthan": 
         { 
            if(isNaN(objValue.value)) 
            { 
              alert(objValue.id+": Should be a number "); 
              return false; 
            }//if 
             if(eval(objValue.value) <=  eval(cmdvalue)) 
             { 
               if(!strError || strError.length ==0) 
               { 
                 strError = objValue.id + " : value should be greater than "+ cmdvalue; 
               }//if               
               alert(strError); 
               return false;                 
             }//if             
            break; 
         }//case greaterthan 
        case "regexp":   // ["regexp=[A-Za-z0-9/,-. \n]$","Please Ensure No Special Characters Are Used In Address"]
         { 
            if(!objValue.value.match(cmdvalue)) 
            { 
              if(!strError || strError.length ==0) 
              { 
                strError = objValue.id+": Invalid characters found "; 
              }//if                                                               
              alert(strError); 
              return false;                   
            }//if 
           break; 
         }//case regexp 
        case "dontselect": 
         { 
            if(objValue.selectedIndex == null) 
            { 
              alert("BUG: dontselect command for non-select Item"); 
              return false; 
            } 
            if(objValue.selectedIndex == eval(cmdvalue)) 
            { 
             if(!strError || strError.length ==0) 
              { 
              strError = objValue.id+": Please Select one option "; 
              }//if                                                               
              alert(strError); 
              return false;                                   
             } 
             break; 
         }//case dontselect 
	   case "date": 
         { 
            if(!isDate(objValue.value)) 
            { 
              if(!strError || strError.length ==0) 
              { 
                strError = objValue.id+": Please enter date in format mm/dd/yyyy"; 
              }//if                                                               
              alert(strError); 
              return false;                   
            }//if 
           break; 
         }//case date 	
		 case "lessthanequaltodaydate": 
         { 
            if(!lessThanEqualTodayDate(objValue.value)) 
            { 
              if(!strError || strError.length ==0) 
              { 
                strError = objValue.id+": Date must be less than or equal to today's date"; 
              }//if                                                               
              alert(strError); 
              return false;                   
            }//if 
           break; 
         }//case lessthanequaltodaydate 	
        case "greaterthantodaydate": 
         { 
            if(!isGreaterThanTodayDate(objValue.value)) 
            { 
              if(!strError || strError.length ==0) 
              { 
                strError = objValue.id+": Date must be greater than todays date"; 
              }//if                                                               
              alert(strError); 
              return false;                   
            }//if 
           break; 
         }//case greaterthantodaydate 	
    }//switch 
    return true; 
} 



/* 
* function validateForm 
* the function that can be used to validate any form 
* returns false if the validation fails; true if success 
* arguments : 
*   objFrm     : the form object 
*   arrObjDesc : an array of objects describing the validations to conduct on each 
*        input item. 
*          The array should consist of one object per input item in the order the input 
*          elements are present in the form. Each object consist of zero or more validation 
*          objects. Each of these validation object is a pair consisting of the validation 
*          descriptor string and an optional Error message. 
*/ 

function validateForm(objFrm,arrObjDesc) 
{ 
	var errorFlag = false;
 for(var itrobj=0; itrobj < arrObjDesc.length; itrobj++) 
 { 
 	//alert(objFrm.name);
   if(objFrm.elements.length <= itrobj) 
   { 
        alert("BUG: Obj descriptor for a non existent form element"); 
			errorFlag = false;
        return false; 
   }//if 
   for(var itrdesc=0; itrdesc < arrObjDesc[itrobj].length ;itrdesc++) 
   { 
      if(validateData(arrObjDesc[itrobj][itrdesc][0], 
                 objFrm[itrobj],arrObjDesc[itrobj][itrdesc][1]) == false) 
       { 
	     objFrm[itrobj].focus();
			errorFlag = false;
         return false; 
       }//if 
		 else
		 {
			 errorFlag = true;
		 }
   }//for 
 }//for 
	if(errorFlag == true)
	{
		//objFrm.submit();
		//document.AppraisalsForm1.submit();
	} else {
		return false; 
	}

} 
	
function validateEstimateForm(objForm)
{	
		
	var arrValidationDesc = new Array();	
		
					
	arrValidationDesc = 
							[ //Feedfack Form
								[	//HiddenField 1
								],
								[	//HiddenField 2
								],
								[	//HiddenField 3
								],
								[	//HiddenField 4
								],
								[	//HiddenField 5
								],
								[	//HiddenField 6
								],
								[	//Name
								 	["required"],
									["applicantName"]
								],	
								[	//Address
									["address"]
								],	
								[	//Phone
								 	["required"],
									["numHypen"]
								], 
								[  // E-Mail Address
								 	["required"],
									["email"]
								],
								[	//How did you hear about us?
									["address"]
								], 
								[ 	//What kind of cleaning are you inquiring about?
								 	["address"]
								],	
								[  // How often do you want service? (ex. once, daily, weekly...) 
									["address"]
								],	
								[  // On which day(s) would you prefer to receive service?
									["address"]
								],	
								[  // In what type of dwelling do you want service? (ex. apartment, house, loft, office...) 
									["address"]
								],	
								[  // How many floors?
									["address"]
								],	
								[  // How many flights of stairs?
									["address"]
								],	
								[  // How many bedrooms?
									["address"]
								],	
								[  // How many bathrooms?
									["address"]
								],	
								[  // What type of kitchen do you have? (ex. galley, kitchenette, island...)
									["address"]
								],	
								[  // Please list the types of rooms you have. (ex. den, parlor, play room, family room...)
									["address"]
								],	
								[  // Please list any pets you may have. 
									["address"]
								],	
								[  // When is the best time to contact you? 
									["address"]
								]
							];	
		
	 
	var y = validateForm(objForm,arrValidationDesc);
		
		if(y==false)
		{
			return y;
		}
		if(y!=false)
		{
			window.open('estimate_sub.htm','sub','width=550,height=250');
		}
	
}


function validateScoreBoardForm(objForm)
{	
		
	var arrValidationDesc = new Array();	
		

	arrValidationDesc1 = 
							[ //Feedfack Form
								[	//HiddenField 1
								],
								[	//HiddenField 2
								],
								[	//HiddenField 3
								],
								[	//HiddenField 4
								],
								[	//HiddenField 5
								],
								[	//HiddenField 6
								],
								[	//Your Name
								 	["required"],
									["applicantName"]
								],	
								[  // E-Mail Address
								 	["required"],
									["email"]
								],
								[  // Name of House Cleaner
									["address"]
								],
								[  // Service Date
									["date"]
								]
							];	
		
	
	arrValidationDesc2 = 
							[ //
								[  // 1. Courtesy/Professionalism							
								],
								[  // 1. Courtesy/Professionalism						
								],
								[  // 1. Courtesy/Professionalism							
								],
								[  // 1. Courtesy/Professionalism						
								],
								[  // 1. Courtesy/Professionalism							
								],
								[  // 2. Living Areas			
								],
								[  // 2. Living Areas			
								],
								[  // 2. Living Areas			
								],
								[  // 2. Living Areas			
								],
								[  // 2. Living Areas			
								],
								[  // 3. Kitchen		
								],
								[  // 3. Kitchen		
								],
								[  // 3. Kitchen		
								],
								[  // 3. Kitchen		
								],
								[  // 3. Kitchen		
								],
								[  // 4. Bathrooms	
								],
								[  // 4. Bathrooms	
								],
								[  // 4. Bathrooms	
								],
								[  // 4. Bathrooms	
								],
								[  // 4. Bathrooms	
								],
								[  // 5. Bedrooms	
								],
								[  // 5. Bedrooms	
								],
								[  // 5. Bedrooms	
								],
								[  // 5. Bedrooms	
								],
								[  // 5. Bedrooms	
								],
								[  // 6. Overall Cleaning Quality
								],
								[  // 6. Overall Cleaning Quality
								],
								[  // 6. Overall Cleaning Quality
								],
								[  // 6. Overall Cleaning Quality
								],
								[  // 6. Overall Cleaning Quality
								],
								[  // 7. Contact With Office
								],
								[  // 7. Contact With Office
								],
								[  // 7. Contact With Office
								],
								[  // 7. Contact With Office
								],
								[  // 7. Contact With Office
								]
							];	
							
	arrValidationDesc3 = 
							[ //
								[  // We welcome your comments and compliments
									["address"]
								],
								[  // provide us with a daytime phone number
									["numHypen"]
								]
							];	
		
	arrValidationDesc = arrValidationDesc.concat(arrValidationDesc1,arrValidationDesc2,arrValidationDesc3);
	var y = validateForm(objForm,arrValidationDesc);
		
		if(y==false)
		{
			return y;
		}
		if(y!=false)
		{
			window.open('scoreboard_sub.htm','sub','width=550,height=250');
		}
}


function validateContactForm(objForm)
{	
		
	var arrValidationDesc = new Array();	
		
					
	arrValidationDesc = 
							[ //Feedfack Form
								[	//HiddenField 1
								],
								[	//HiddenField 2
								],
								[	//Your Name
								 	["required"],
									["applicantName"]
								],	
								[	//Contact Number
								 	["required"],
									["numHypen"]
								],	
								[  // E-Mail Address
								 	["required"],
									["email"]
								],
								[  // Subject
								 	["required"],
									["address"]
								],
								[  // Comments
									["address"]
								]
							];	
		
	
	return validateForm(objForm,arrValidationDesc);
	
}
