function MM_validateForm() 
{ 
	var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments,r,a,b,c,d,e,f,s,g,h;
	j=0;
	//	/^([-a-zA-Z0-9._]+@[-a-zA-Z0-9.]+(\.[-a-zA-Z0-9]+)+)$/;
	var regEmail = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
	var regBlank = /[^\s]/;
	var regAlphaNum = /^([a-zA-Z0-9-+/_& :?;\n\r.,\']+)$/;
	//var regAlphaNum = /^([a-zA-Z0-9_]+)$/;
	var regDate = /^([0-9_]+-[0-9][0-9]+-[0-9][0-9]+)$/;

		//var regcontact = /^([0-9-]+)$/;

		var regcontact = /^([0-9-()+ ]+)$/;

			var alphnum = /^([0-9a-zA-Z]+)$/;

	
	//alert (MM_validateForm.arguments[1].name);
	//alert("sss--->"+document.forms[""+args[0]].elements[""+args[0]].value);
	for (i=1; i<(args.length-2); i+=3) 
	{	
		mesg=args[i+1];
		test=args[i+2]; 
		val=document.forms[""+args[0]].elements[""+args[i]];
	
	    if (val) 
		{	nm=mesg; 
			
			val = val.value;
			//if ((val=val.value)!="") 
			if(regBlank.test(val))
			{
				if(test.indexOf('isEqual')!=-1)
				{
					result = trim(val);
				if(result.length==0){
				errors += '- '+nm+' is required.\n'; 
				}else{
					equal_obj_val = test.substring(8,test.indexOf(":"));
					mesg_string =test.substring((test.indexOf(":")+1));
					if(val != document.forms[""+args[0]].elements[""+equal_obj_val].value)
					{
						errors+='- '+nm+' must be same to '+mesg_string+'.\n';
					}
				}
				}
				else if(test.indexOf('isAlphaNum')!=-1)
				{
				var first_char;
					first_char= val.charAt(0);
					if(first_char==0||first_char==1||first_char==2||first_char==3||first_char==4||first_char==5||first_char==6||first_char==7||first_char==8||first_char==9){
					 errors+='- '+nm+' must starts with  a char.\n';
					}
				result = trim(val);
				if(result.length==0){
				errors += '- '+nm+' is required.\n'; 
				}else{
					if(!regAlphaNum.test(val))
					{
						errors+='- '+nm+': Only Alpha Numeric and "_" Chars Allowed.\n';
					}
				}
				}






	 else if (test.indexOf('isalphaNum')!=-1) 
				{ 
					var minLength =5;
					result = trim(val);
					
					if(!alphnum.test(val))
					{
						//errors+='- '+nm+' can contain numbers and "_" character.\n';
					errors+='- '+nm+': Only Alpha Numeric Allowed.\n';
					}

				}


				else if (test.indexOf('isDate')!=-1) 
				{ 
					p=val.indexOf('-');
			        
					if (p != 4 )
					{
						errors+='- '+nm+' must contain Valid Date YYYY-MM-DD.\n';
		
					}
					else if(!regDate.test(val))
					{
						errors+='- '+nm+' must contain Valid Date YYYY-MM-DD.\n';
					}
			     }

				 else if (test.indexOf('isPhone')!=-1) 
				{ 
					//p=val.indexOf('-');
			        
					 if(!regPhone.test(val))
					{
						errors+='- '+nm+' must contain Valid Phone Number xxx-xxx-xxxx\n';
					}
			     }
				  else if (test.indexOf('isPassword')!=-1) 
				{ 
					//p=val.indexOf('-');
					result = trim(val);
  					 if(result.length<6)
					{
						errors+='- '+nm+' must contain must contain at least 6 characters\n';
					}
			     }
				 
				 else if (test.indexOf('isContactNo')!=-1) 
				{ 
					var minLength =5;
					result = trim(val);
					
					if(!regcontact.test(val))
					{
						//errors+='- '+nm+' can contain numbers and "_" character.\n';
					errors+='- The Phone number must contain a number, + or () sign.\n';
					}


					

					 else if(result.length<minLength)
					{
						errors+='- '+nm+' must contain minimum 6 digits\n';
					}
			     }


				 else if (test.indexOf('isCountry')!=-1) 
				{ 
					var minLength =5;
					result = trim(val);
					
					if(!regcontact.test(val))
					{
						//errors+='- '+nm+' can contain numbers and "_" character.\n';
					errors+='- The Country Code must contain a number, + or () please.\n';
					}
					
				}

				else if (test.indexOf('isArea')!=-1) 
				{ 
					var minLength =5;
					result = trim(val);
					
					if(!regcontact.test(val))
					{
						//errors+='- '+nm+' can contain numbers and "_" character.\n';
					errors+='- The Area Code must contain a number, + or () please.\n';
					}
					
				}

	else if (test.indexOf('islandlineNo1')!=-1) 
				{ 
					var minLength1 =7;
					result = trim(val);
					
					if(!regcontact.test(val))
					{
						//errors+='- '+nm+' can contain numbers and "_" character.\n';
					errors+='- '+nm+' can contain "-" & numeric value.\n';
					}


					

					 else if(result.length<minLength1)
					{
						errors+='- '+nm+' must contain minimum 7 digits\n';
					}
			     }

		 else if (test.indexOf('isExt')!=-1) 
				{	
					a=val.indexOf('.jpg');
					b=val.indexOf('.JPG');

					c=val.indexOf('.gif');
					d=val.indexOf('.GIF');

					e=val.indexOf('.jpeg');
					f=val.indexOf('.JPEG');

					r=val.indexOf('.png');
					g=val.indexOf('.PNG');
		
					y=val.indexOf('.swf');
					z=val.indexOf('.SWF');              

					

			        if ((a<1 || a==(val.length-1)) && (b<1 || b==(val.length-1))&& (c<1 || c==(val.length-1)) && (d<1 || d==(val.length-1))  && (e<1 || e==(val.length-1)) && (f<1 || f==(val.length-1)) && (g<1 || g==(val.length-1)) && (r<1 || r==(val.length-1)) && (y<1 || y==(val.length-1)) && (z<1 || z==(val.length-1)))
					{
						errors+='- '+nm+' should be in .gif, .jpg, .jpeg, .png, .swf format!.\n';
		
					}
				}



 else if (test.indexOf('isPdfExt')!=-1) 
				{	
//	 alert("asdjhasfjsdh");

					r=val.indexOf('.pdf');
					d=val.indexOf('.PDF');

			        if ((d<1 || d==(val.length-1)) && (r<1 || r==(val.length-1)))
					{
						errors+='- '+nm+' should have a valid format!.\n';
		
					}
	
				}


else if (test.indexOf('isDocPdfExt')!=-1) 
				{	
//	 alert("asdjhasfjsdh");

					a=val.indexOf('.txt');
					b=val.indexOf('.TXT');

					c=val.indexOf('.doc');
					d=val.indexOf('.DOC');

					e=val.indexOf('.rtf');
					f=val.indexOf('RTF');

					r=val.indexOf('.pdf');
					g=val.indexOf('.PDF');


			        if ((a<1 || a==(val.length-1)) && (b<1 || b==(val.length-1)) && (c<1 || c==(val.length-1)) && (d<1 || d==(val.length-1)) && (e<1 || e==(val.length-1)) && (f<1 || f==(val.length-1)) && (g<1 || g==(val.length-1)) && (r<1 || r==(val.length-1)))
					{
						errors+='- '+nm+' File should be in .txt, .doc, .rtf, .pdf format!.\n';
		
					}
	
				}
				//for doc and pdf
//doc pdf jpeg validation for email
else if (test.indexOf('isDocPdfJpegExt')!=-1) 
{	
//	 alert("asdjhasfjsdh");

					a=val.indexOf('.txt');
					b=val.indexOf('.TXT');

					c=val.indexOf('.doc');
					d=val.indexOf('.DOC');


					e=val.indexOf('.jpeg');
					f=val.indexOf('.JPEG');

					
					r=val.indexOf('.pdf');
					g=val.indexOf('.PDF');


			        if ((a<1 || a==(val.length-1)) && (b<1 || b==(val.length-1)) && (c<1 || c==(val.length-1)) && (d<1 || d==(val.length-1)) && (e<1 || e==(val.length-1)) && (f<1 || f==(val.length-1)) && (g<1 || g==(val.length-1)) && (r<1 || r==(val.length-1)))
					{
						errors+='- '+nm+' File should be in .txt, .doc, .jpeg, .pdf format!.\n';
		
					}
	
				}


else if (test.indexOf('isDocExt')!=-1) 
				{	
//	 alert("asdjhasfjsdh");

					a=val.indexOf('.txt');
					b=val.indexOf('.TXT');

					c=val.indexOf('.doc');
					d=val.indexOf('.DOC');

					e=val.indexOf('.rtf');
					f=val.indexOf('RTF');

			        if ((a<1 || a==(val.length-1)) && (b<1 || b==(val.length-1)) && (c<1 || c==(val.length-1)) && (d<1 || d==(val.length-1)) && (e<1 || e==(val.length-1)) && (f<1 || f==(val.length-1)))
					{
						errors+='- '+nm+' File should be in .txt, .doc, .rtf format!.\n';
		
					}
	
				}




//----------------

				else if (test.indexOf('isEmail')!=-1) 
				{ 
					
					var first_char;
					first_char= val.charAt(0);
					//if(first_char==0||first_char==1||first_char==2||first_char==3||first_char==4||first_char==5||first_char==6||first_char==7||first_char==8||first_char==9){
					 //errors+='- '+nm+'  can start only with characters.\n';
					//}
					p=val.indexOf('@');
					s=val.indexOf('.');
			        if (p<1 || p==(val.length-1))
					{
						errors+='- '+nm+' should be a valid e-mail Address.\n';
		
					}
					//else if(s<p || s==(val.length-1))
					else if(!regEmail.test(val))
					{
						errors+='- '+nm+' should be a valid e-mail Address.\n';
					}
			     }
				else if (test.indexOf('isUrl')!=-1) 
				{ 
					p=val.indexOf('http://');
					s=val.indexOf('.');
			        if (p<0 || p==(val.length-1))
					{
						errors+='- '+nm+' must be valid URL e.g. http://www.yourcompany.com\n';
		
					}
					else if(s<p || s==(val.length-1))
					{
						errors+='- '+nm+' must be valid URL e.g. http://www.abc.com\n';
					}
			     }
				 else if (test.indexOf('isChar')!=-1) 
				 { 
					var first_char;
					first_char= val.charAt(0);
					if(first_char==0||first_char==1||first_char==2||first_char==3||first_char==4||first_char==5||first_char==6||first_char==7||first_char==8||first_char==9){
					 errors+='- '+nm+' must starts with  a char.\n';
					}
			     }
	   			 else if (test!='R') 
				 {
				 result = trim(val);
					if(result.length==0){
					errors += '- '+nm+' is required.\n'; 
					}
				    if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';

					if (test.indexOf('inRange') != -1) 
					{ num = parseFloat(val);
						p=test.indexOf(':');
						min=test.substring(10,p); 
						max=test.substring(p+1);
						if (num<min || max<num) 
						errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
					} 
					if (val.indexOf('-') != -1) 
					{ 
						errors+='- '+nm+' must contain a number without dashes sign.\n';
					} 
					if (val.indexOf('+') != -1) 
					{ 
						errors+='- '+nm+' must contain a number without plus sign.\n';
					}
					
				}else if (test.charAt(0)=='R')
				{
				result = trim(val);
				if(result.length==0){
				errors += '- '+nm+' is required.\n'; 
				}
				} 
			}
			else if (test.charAt(0) == 'R'){
				errors += '- '+nm+' is required.\n'; 
			}
		}
		if(errors !="")
		{	if(j<=0)
			{
				
				focusitem = document.forms[""+args[0]].elements[""+args[i]];
				j++;
			}	
			
		}
	} 
	
//return errors;
  
  if (errors)
  {
	alert('The following error(s) occurred:\n\n'+errors);
	
	focusitem.focus();
	return false;
   }
   else
	return true;

//  document.MM_returnValue = (errors == '');
	
}

function trim(inputString) {
   // Removes leading and trailing spaces from the passed string. Also removes
   // consecutive spaces and replaces it with one space. If something besides
   // a string is passed in (null, custom object, etc.) then return the input.
   if (typeof inputString != "string") { return inputString; }
   var retValue = inputString;
   var ch = retValue.substring(0, 1);
   while (ch == " ") { // Check for spaces at the beginning of the string
      retValue = retValue.substring(1, retValue.length);
      ch = retValue.substring(0, 1);
   }
   ch = retValue.substring(retValue.length-1, retValue.length);
   while (ch == " ") { // Check for spaces at the end of the string
      retValue = retValue.substring(0, retValue.length-1);
      ch = retValue.substring(retValue.length-1, retValue.length);
   }
   while (retValue.indexOf("  ") != -1) { // Note that there are two spaces in the string - look for multiple spaces within the string
      retValue = retValue.substring(0, retValue.indexOf("  ")) + retValue.substring(retValue.indexOf("  ")+1, retValue.length); // Again, there are two spaces in each of the strings
   }
   return retValue; // Return the trimmed string back to the user
} // Ends the "trim" function


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}



/***
function isDate(val,format) {
	var date=getDateFromFormat(val,format);
	if (date==0) { return false; }
	return true;
	}
****/



// code for mm/dd/yyyy validate

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 valButton(btn) {
	
    var cnt = -1;
    for (var i=btn.length-1; i > -1; i--) {
        if (btn[i].checked) {cnt = i; i = -1;}
    }
    if (cnt > -1) return btn[cnt].value;
    else return null;
}




//end code for mm/dd/yyyy format

function compareDates(date1,dateformat1,date2,dateformat2) {
	var d1=getDateFromFormat(date1,dateformat1);
	var d2=getDateFromFormat(date2,dateformat2);
	alert(d1);
	if (d1==0 || d2==0) {
		return -1;
		}
	else if (d1 > d2) {
		return 1;
		}
	return 0;
	}
	
// ------------------------------------------------------------------
// 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;
	}
	

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();
	}



	//=====code for validate start date and end date================================
	
	
	//code for validate mm/dd/yyyy formnat

/**
 * DHTML date validation script. Courtesy of SmartWebby.com (http://www.smartwebby.com/dhtml/)
 */
// Declaring valid date character, minimum year and maximum year
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 checkall(objForm){

	alert(a);
	
	len = objForm.elements.length;

	

	var i=0;
	for( i=0 ; i<len ; i++) {
		if (objForm.elements[i].type=='checkbox') {
			objForm.elements[i].checked=objForm.check_all.checked;
		}
	}
}


//end code for mm/dd/yyyy format



function __is_any_check_box_checked(fObj)
{
	found=false;

	//alert(fObj.length);


	for(i=0;i<fObj.length;i++)
	{
		if(fObj[i].type=="checkbox" && fObj[i].checked && fObj[i].disabled==false && i!=1) 
		{

			
			found=true;
			break	
		}		
	}
	return found;
}




/*function checkCheckboxes(fObj)
{		
	if(is_any_check_box_checked(fObj)==true)
	{


		if(confirm("Are you sure?"))
		{
			return true;  
		}
		else 
		{
			return false;  
		}
	}
	else if(is_any_check_box_checked(fObj)==false)
	{
		alert("Select at least one check box.");		
		return false;
	}
}


*/




function __checkCheckboxes(fObj)
{
	//alert("Select1");	
	
	if(is_any_check_box_checked(fObj)==true)
	{

//alert("Select2");	
		if(confirm("Are you sure?"))
		{
			return true;  
		}
		else 
		{
			return false;  
		}
	}
	else if(is_any_check_box_checked(fObj)==false)
	{
		alert("Select at least one check box.");		
		return false;
	}
}

function __checkCheckboxes(fObj)
{		
	////////alert("aaaaaa");

//alert(is_any_check_box_checked(fObj));

	if(is_any_check_box_checked(fObj)==true)
	{
		if(confirm("Are you sure?"))
		{
			return true;  
		}
		else 
		{
			return false;  
		}
	}
	else if(is_any_check_box_checked(fObj)==false)
	{
		alert("Please select at least one check box.");		
		return false;
	}
}






function conformme(id)
{		
	

	if(is_any_check_box_checked(id)==true)
	{
		
		
			if(confirm("Are you sure?"))
		{
			return true;  
		}
		else 
		{
			return false;  
		}
	}
	else if(is_any_check_box_checked(id)==false)
	{
		alert("Select at least one check box.");		
		return false;
	}
}



function conformme_active(id)
{		
	

	if(is_any_check_box_checked(id)==true)
	{
		
		
			if(confirm("Are you sure,you want to Deactivate ?"))
		{
			return true;  
		}
		else 
		{
			return false;  
		}
	}
	else if(is_any_check_box_checked(id)==false)
	{
		alert("Select at least one check box.");		
		return false;
	}
}


function conformme_inactive(id)
{		
	
	if(is_any_check_box_checked(id)==true)
	{
		
		
			if(confirm("Are you sure,you want to Activate ?"))
		{
			return true;  
		}
		else 
		{
			return false;  
		}
	}
	else if(is_any_check_box_checked(id)==false)
	{
		alert("Select at least one check box.");		
		return false;
	}
}

function conformme_repost(id)
{		
	
	if(is_any_check_box_checked(id)==true)
	{
		
		
			if(confirm("Are you sure?"))
		{
			return true;  
		}
		else 
		{
			return false;  
		}
	}
	else if(is_any_check_box_checked(id)==false)
	{
		alert("Select at least one check box.");		
		return false;
	}
}






function conformch(id)
{		
	
	

	if(is_any_check_box_checked(id)==false)
	{
		alert("Select at least one check box.");		
		return false;
	}
}


function delete_normal_product()
{
if(confirm("The deletion of the product will delete it from the Normal Product list. Are you sure you want to delete this Product?"))
		{
			return true;  
		}
		else 
		{
			return false;  
		}

}

function conform_delete()
{
if(confirm("Are you sure want to delete?"))
		{
			return true;  
		}
		else 
		{
			return false;  
		}

}


function confirm_active_prod_del()
{
if(confirm("Sorry! This product can not be deleted as it is Active?"))
		{
			return true;  
		}
		else 
		{
			return false;  
		}

}


function conform_delete_inactive_job()
{
    alert("This job can not be deleted as it is Active");
		
			return false; 

}




	
function is_any_check_box_checked(id)
{

	found=false;


	for(i=0;i<id.length;i++)
	
	{


		if(id[i].type=="checkbox" && id[i].checked) 
		{

							//alert("aaaaaa");
			found=true;
			break	
		}		
	}

	return found;
}

	



//==============function for convert how to convert date format in dd/mm/yy to javascript format in month date,year=====


function convert_date(date)
{

if(date!='')
	{
var date_arr = date.split("/",3);
var get_day = date_arr[0];
var get_month = date_arr[1];
//alert(get_day);

if(get_day<=9)
{
//get_day=
get_day=get_day.split("0");
day_string=get_day[1];
}

else
{
day_string=get_day;
}

if(get_month=="01"){
			month_string="Jan";
		}else if(get_month=="02"){
			month_string="Feb";
		}else if(get_month=="03"){
			month_string="Mar";
		}else if(get_month=="04"){
			month_string="Apr";
		}else if(get_month=="05"){
			month_string="May";
		}else if(get_month=="06"){
			month_string="Jun";
		}else if(get_month=="07"){
			month_string="July";
		}else if(get_month=="08"){
			month_string="Aug";
		}else if(get_month=="09"){
			month_string="Sep";
		}else if(get_month=="10"){
			month_string="Oct";
		}else if(get_month=="11"){
			month_string="Nov";
		}else if(get_month=="12"){
			month_string="Dec";
		}


var conv_date = month_string+" "+day_string+", "+date_arr[2];
//alert(conv_date);
//return false;

return conv_date;
	}
}

//==============end code for convert date in javascirpt format in month day,year=====================








	










	function submitValidDate_date()
		{

			


if(((document.form_search.alm_event_start_date.value=="")&&(document.form_search.alm_end_date.value!=""))||((document.form_search.alm_event_start_date.value!="")&&(document.form_search.alm_end_date.value=="")))
{
		alert("Please Enter Start date and end date!");
			return false;
			exit;
			}

if(document.form_search.alm_event_start_date.value!="")
			{


if(isDate(document.form_search.alm_event_start_date.value,"dd/MM/yyyy")==false)
{
	alert("Check the Format for Start Date It should be in dd/mm/yyyy");
	return false;
	exit;
	
}
	
			}


if(document.form_search.alm_end_date.value!="")
			{
		


		
if(isDate(document.form_search.alm_end_date.value,"dd/MM/yyyy")==false)
{
	alert("Check the Format for End Date It should be in dd/mm/yyyy");
	return false;
	exit;
}

			}




if (compareDates(document.form_search.alm_event_start_date.value,"dd/MM/yyyy",document.form_search.alm_end_date.value,"dd/MM/yyyy")==1)
		{
			alert("Start date should not be greater then end date");
			return false;
			exit;
			
		}



if((document.form_search.alm_event_start_date.value==false)&&((document.form_search.alm_end_date.value==false)||
	(document.form_search.event_name.value==false)))
			{
	return true;
			}


  return true;
		}





//============================end code for validate start date and end date for view event============================






//===================check validate start date and end date for admin/view article==============================

function submitvalidate_article()
		{

			


if(((document.form_search.start_date.value=="")&&(document.form_search.end_date.value!=""))||((document.form_search.start_date.value!="")&&(document.form_search.end_date.value=="")))
{
		alert("Please Enter Start date and end date!");
			return false;
			exit;
			}



if(document.form_search.start_date.value!="")
			{


if(isDate(document.form_search.start_date.value,"dd/MM/yyyy")==false)
{
	alert("Check the Format for Start Date It should be in dd/mm/yyyy");
	return false;
	exit;
	
}

	}
			

if(document.form_search.start_date.value!="")
			{

		
if(isDate(document.form_search.end_date.value,"dd/MM/yyyy")==false)
{
	alert("Check the Format for End Date It should be in dd/mm/yyyy");
	return false;
	exit;
}

			}




if(compareDates(document.form_search.start_date.value,"dd/MM/yyyy",document.form_search.end_date.value,"dd/MM/yyyy")==1)
		{
			alert("Start date should not be greater then end date");
			return false;
			exit;
			
		}



if((document.form_search.start_date.value==false)&&((document.form_search.end_date.value==false)||
	(document.form_search.article_title.value==false)))
			{
	return true;
			}


  return true;
		}



//-----end code for valid date check view article====================================================









function IsNumeric()
{

sText=document.form1.vfsl_adultguest.value;

   var ValidChars = "0123456789.";
   var IsNumber=true;
   var Char;
	var testChars = "123456789";

					



if(sText==0) {
	IsNumber = false;
alert("Please enter Number of guests.");

}

 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 

	  decimal = sText.indexOf(".");


	  
	  if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
		 alert("Please enter Number of guests.");
         }



if (decimal != -1) {
IsNumber = false;
alert("Please enter Number of guests.");
}

      }
   return IsNumber;
   
   }



function CisNumeric()
{

sText=document.form1.vfsl_childguest.value;

   var ValidChars = "0123456789.";
   var CisNumeric=true;
   var Char;
	var testChars = "123456789";

					

   for (i = 0; i < sText.length && CisNumeric == true; i++) 
      { 
      Char = sText.charAt(i); 

	  decimal = sText.indexOf(".");


	  
	  if (ValidChars.indexOf(Char) == -1) 
         {
         CisNumeric = false;
		 alert("Please enter Number of children.");
         }



if (decimal != -1) {
CisNumeric = false;
alert("Please enter Number of children.");
}

      }
   return CisNumeric;
   
   }

function submitValid_job()
{

if(((document.form_search.start_date.value=="")&&(document.form_search.end_date.value!=""))||((document.form_search.start_date.value!="")&&(document.form_search.end_date.value=="")))
{
		alert("Please Enter Start date and end date!");
			return false;
			exit;
			}


if(document.form_search.start_date.value!="")
			{


if(isDate(document.form_search.start_date.value,"dd/MM/yyyy")==false)
{
	alert("Check the Format for Start Date It should be in dd/mm/yyyy");
	return false;
	exit;
	
}

			}



			
if(document.form_search.start_date.value!="")
	{

		
if(isDate(document.form_search.end_date.value,"dd/MM/yyyy")==false)
{
	alert("Check the Format for End Date It should be in dd/mm/yyyy");
	return false;
	exit;
}
			}




if (compareDates(document.form_search.start_date.value,"dd/MM/yyyy",document.form_search.end_date.value,"dd/MM/yyyy")==1)
		{
			alert("Start date Should not be greater then end date");
			return false;
			exit;
			
		}



if((document.form_search.start_date.value==false)&&((document.form_search.end_date.value==false)||
	(document.form_search.article_title.value==false)))
			{
	return true;
			}


  return true;
		}


//========end code for check valid date admin/view jobs======================



















function valid_edit_admin_profile(formname)
{
	

	if(MM_validateForm(formname,'user_first_name','First Name','R','user_last_name','Last Name','RisAlphaNum','user_email_id','Email','RisEmail','user_pass','Password','RisPassword'))
	{

		return true;
	} 
	else{
		return false;
	}
	
}







function valid_login_form(formname)
{
	
if(MM_validateForm(formname,'user_name','User Name','R','user_password','Password','RisPassword'))
	{

		return true;
	} else{
		return false;
	}
}

function valid_forgot_pass(formname)
{

if(MM_validateForm(formname,'forgot_email','User email','RisEmail'))
	{
		
		return true;
	} else{
		return false;
	}
}


//----------------validate registartion form ----------------------------




function valid_add_new_user(formname)
{
 


	var re = /^\d{1,2}\/\d{1,2}\/\d{4}$/;
	var a=document.form2.dateofbirth.value;

	var combo_batch=document.form2.combo_batch.value;
	//alert(combo_batch);
	
	var d=document.form2.current_date1.value;
	
	
	

	var paydate=new Date(a);
	
   var yearpaydate=parseInt(paydate.getFullYear());



 
if(a!="")
	{
if(isDate(a,"dd/MM/yyyy")==false)
{
	alert("Check the Format for Date of Birth It should be in dd/mm/yyyy");
	return false;
	exit;
	
}

	}


		

		for (var i=0; i < document.form2.checkal.length; i++)
		{
			
				if (document.form2.checkal[i].checked)
				{
						  var rad_val = document.form2.checkal[i].value;
				}
					
		}


	
		
 
if(rad_val=='Alumni')
{
	
	 
	 if((combo_batch < yearpaydate)&& (combo_batch!=""))
	{
	  alert("Batch must be greater than date of birth");
	  return false;
	}
 

	
if(MM_validateForm(formname,'alm_mem_username','User Id','RisAlphaNum',
	'alm_password','Password','RisPassword',
	'alm_mem_repassword','Confirm Password','RisEqualalm_password:Password',

	'alm_mem_firstname','First Name','RisAlphaNum',
	'alm_mem_lastname','Last Name','RisAlphaNum',
	'dateofbirth','Date of Birth','R',
	'combo_batch','Batch','R','alm_mem_contact_No1','Contact No 1','RisNaN','alm_mem_contact_no2','Contact NO 2','isNaN',
	'alm_mem_email','Email','RisEmail',
	'alm_address','Residence Address','R',
	'alm_mem_res_city','City','isAlphaNum','alm_desi','Designation ','isAlphaNum',
	
'alm_memcomapny','Company','isAlphaNum','alm_mem_officecity','Office City','isAlphaNum','alm_mem_phone','Telephone','isNaN'))
	{
		return true;
	} 
	
	else
		{
		return false;
	}	
}





if(rad_val=='Teacher')
{
	
if(MM_validateForm(formname,'alm_mem_username','User Id','RisAlphaNum',
	'alm_password','Password','RisPassword',
	'alm_mem_repassword','Confirm Password','RisEqualalm_password:Password',

	'alm_mem_firstname','First Name','RisAlphaNum',
	'alm_mem_lastname','Last Name','RisAlphaNum',
	'dateofbirth','Date of Birth','R',
	'alm_mem_contact_no1','Contact No 1','RisNaN','alm_mem_contact_no2','Contact NO 2','isNaN',
	'alm_mem_email','Email','RisEmail',
	'alm_address','Residence Address','R',
	'alm_mem_res_city','City','isAlphaNum','alm_desi','Designation ','isAlphaNum',
	
'alm_memcomapny','Company','isAlphaNum','alm_mem_officecity','Office City','isAlphaNum','alm_mem_phone','Telephone','isNaN'))
	{
		return true;
	} 
	
	else
		{
		return false;
	}	
}







if(rad_val=='Student')
	{
	 if((combo_batch < yearpaydate)&& (combo_batch!=""))
	{
	  alert("Batch must be greater than date of birth");
	  return false;
	}
 


if(MM_validateForm(formname,'alm_mem_username','User Id','RisAlphaNum',
	'alm_password','Password','RisPassword','alm_mem_repassword',
	'Confirm Password','RisEqualalm_password:Password',

	'alm_mem_firstname','First Name','RisAlphaNum',
	'alm_mem_lastname','Last Name','RisAlphaNum',
	'dateofbirth','Date of Birth','R',
	'combo_batch','Batch','R','alm_mem_contact_no1','Contact No 1','RisNaN','alm_mem_contact_no2','Contact NO 2','isNaN',
	'alm_mem_email','Email','RisEmail',
	'alm_address','Residence Address','R',
	'alm_mem_res_city','City','isAlphaNum'))
{
	

		return true;
	} 
	else{
		return false;
	}


	}





}

//--------------end code for registration form-----------------------------






//--------code for edit registration form


function valid_edit_user(formname)
{
 
	var a=document.form2.dateofbirth.value;


if(a!="")
	{
if(isDate(a,"dd/MM/yyyy")==false)
{
	alert("Check the Format for Date of Birth It should be in dd/mm/yyyy");
	return false;
	exit;
	
}
	}
	

	
		var rad_val = document.form2.user_identity.value;
			
				
		

 
if(rad_val=='Alumni')
{
	
	
if(MM_validateForm(formname,'alm_mem_username','User Id','RisAlphaNum',
	'alm_mem_firstname','First Name','RisAlphaNum',
	'alm_mem_lastname','Last Name','RisAlphaNum',
	'dateofbirth','Date of Birth','R',
	'combo_batch','Batch','R','alm_mem_contact_no1','Contact No 1','RisNaN','alm_mem_contact_no2','Contact NO 2','isNaN',
	'alm_mem_email','Email','RisEmail',
	'alm_address','Residence Address','R',
	'alm_mem_res_city','City','isAlphaNum','alm_desi','Designation ','isAlphaNum',
	
'alm_memcomapny','Company','isAlphaNum','alm_mem_officecity','Office City','isAlphaNum','alm_mem_phone','Telephone','isNaN'))
	{
		return true;
	} 
	
	else
		{
		return false;
	}	
}

if(rad_val=='Student')
	{

if(MM_validateForm(formname,'alm_mem_username','User Id','RisAlphaNum',
	'alm_mem_firstname','First Name','RisAlphaNum',
	'alm_mem_lastname','Last Name','RisAlphaNum',
	'dateofbirth','Date of Birth','R',
	'combo_batch','Batch','R','alm_mem_contact_no1','Contact No 1','RisNaN','alm_mem_contact_no2','Contact NO 2','isNaN',
	'alm_mem_email','Email','RisEmail',
	'alm_address','Residence Address','R',
	'alm_mem_res_city','City','isAlphaNum'))
		{
	

		return true;
			} 
	else
		{
		return false;
			}


	}





if(rad_val=='Teacher')
{
	
if(MM_validateForm(formname,'alm_mem_username','User Id','RisAlphaNum',
	'alm_mem_firstname','First Name','RisAlphaNum',
	'alm_mem_lastname','Last Name','RisAlphaNum',
	'dateofbirth','Date of Birth','R','alm_mem_contact_no1','Contact No 1','RisNaN','alm_mem_contact_no2','Contact NO 2','isNaN',
	'alm_mem_email','Email','RisEmail',
	'alm_address','Residence Address','R',
	'alm_mem_res_city','City','isAlphaNum','alm_desi','Designation ','isAlphaNum',
	
'alm_memcomapny','Company','isAlphaNum','alm_mem_officecity','Office City','isAlphaNum','alm_mem_phone','Telephone','isNaN'))
	{
		return true;
	} 
	
	else
		{
		return false;
	}	
}




}








function valid_front_forgot_pass(formname)
{
if(MM_validateForm(formname,'forgot_email','User email','RisEmail'))
	{
		
		return true;
	} else{
		return false;
	}
}

function valid_front_registration(formname)
{

if(MM_validateForm(formname,'alm_mem_username','User Name','RisAlphaNum',
'alm_mem_password','Password','RisPassword','alm_mem_repassword','Confirm Password','RisEqualalm_mem_password: Retype Password','alm_mem_firstname','First Name','RisAlphaNum','alm_mem_lastname','Last Name','RisAlphaNum','dateofbirth','Date of Birth','R','combo_batch','Batch','R','alm_mem_rphone','Phone No','RisNaN','alm_mem_mobile','Mobile No','RisNaN','alm_mem_email','Email id','RisEmail','alm_mem_address','Residential Address','R','alm_mem_org','Organisation','RisAlphaNum','alm_mem_designation','Desigantion','RisAlphaNum','alm_mem_office_add','Office Address','R','alm_mem_office_phone','Office Telephone no','RisNaN'))
	{
		return true;
	} 
	else{
		return false;
	}
}




function valid_front_post_a_job(formname)
{

	

	var offer_expiry=document.form2.alm_offer_expiry.value;
	
	var current=document.form2.currentdate.value;

if(offer_expiry!="")
	{
if(isDate(offer_expiry,"dd/MM/yyyy")==false)
{
	alert("Check the Format for Offer Expiry It should be in dd/mm/yyyy");
	return false;
	exit;
	
}


if (compareDates(current,"dd/MM/yyyy",offer_expiry,"dd/MM/yyyy")==1)
		{
			
			
			alert("Offer Expiry Date should  be greater then Current Date");
			return false;
			exit;
			
		}
	}





if(MM_validateForm(formname,'alm_jobs_title',
'Job Title','RisAlphaNum',
'alm_jobs_company','Company','isAlphaNum','alm_mem_industry','Industry',
'isAlphaNum','job_posting','Posting','RisAlphaNum',

'alm_job_requirement','Job Requirement','RisAlphaNum',
	'alm_job_nature_of_work','Nature of Work','isAlphaNum',
	'alm_job_posted_by','Posted By','RisAlphaNum',
	'alm_job_contact_name','Contact Name','RisAlphaNum',
	'alm_contact_email_add','Contact Email id','RisEmail','alm_contact_phone','Contact Phone Number','RisNaN',
	'alm_offer_expiry','Offer Expiry','R'))
	{
		
		return true;
	} else{
		return false;
	}



}

//***************************************************  taxi *******************************//

function valid_add_driver(formname){

//alert("hello");


if(MM_validateForm(formname,'tx_drvr_nme','Driver Name','R','tx_drvr_ln','License Number','RisNaN',
		'tx_drvr_addr','Address','R','tx_drvr_cty','City','R',
		'tx_drvr_ste','State','R','tx_drvr_zip','Zip Code','R','tx_drvr_pno','Phone Number','isNaN',
		'tx_drvr_mbo','Mobile No','RisNaN','tx_drvr_eml','Email','isEmail'))
	{

		return true;
	} 
	else{
		return false;
	}

}

function valid_edit_driver(formname){

//alert("hello");


if(MM_validateForm(formname,'tx_drvr_nme_1','Driver Name','R','tx_drvr_ln_1','License Number','RisNaN',
		'tx_drvr_addr_1','Address','R','tx_drvr_cty_1','City','R',
		'tx_drvr_ste_1','State','R','tx_drvr_zip_1','Zip Code','R','tx_drvr_pno_1','Phone Number','isNaN',
		'tx_drvr_mbo_1','Mobile No','RisNaN','tx_drvr_eml_1','Email','isEmail'))
	{

		return true;
	} 
	else{
		return false;
	}

}


function valid_add_tour(formname)
{
	//alert("hello");
var editor=document.form1.rte1.value;

if(MM_validateForm(formname,'tx_route_hours','No Of Hours','RisNaN'))
	{
		
if(editor=="") 
{
alert("Tour Details is Required");
return false;
}

		return true;
	} 
	else
	{
		return false;
	}
}



function valid_edit_tour_desti(formname)
{
	//alert("hello");
	
if(MM_validateForm(formname,'tx_desi_name_1','Destination Location','R'))
	{
		
		return true;
	} else{
		return false;
	}
}


function valid_tour_desti(formname)
{
	//alert("hello");
	
if(MM_validateForm(formname,'tx_tour_desi_state','Destination State','R','tx_desi_name','Destination Location','R'))
	{
		
		return true;
	} else{
		return false;
	}
}




function valid_edit_tour_sour(formname)
{
	//alert("hello");
	
if(MM_validateForm(formname,'tx_tour_loca_name_1','Source Location','R'))
	{
		
		return true;
	} else{
		return false;
	}
}


function valid_tour_sour(formname)
{
	//alert("hello");
	
if(MM_validateForm(formname,'tx_tour_loca_state','Source State','R','tx_tour_loca_name','Source Location','R'))
	{
		
		return true;
	} else{
		return false;
	}
}




function valid_edit_route(formname)
{

//alert("hello"); 

if(MM_validateForm(formname,'tx_suff_route_ch_perpson_1','Charges/Person','RisNaN'))
	{
		return true;
	} 
	else{
		return false;
	}

}


function valid_add_route(formname)
{

//alert("hello"); 

if(MM_validateForm(formname,'tx_suff_route_sutate_1','Source State','R',
	'tx_suff_route_surloc','Source Location','R',
	'tx_stuff_route_desate_1','Destination State','R',
	'tx_suff_route_desloc','Destionation Location ','R',
	'tx_suff_route_ch_perpson','Charges/Person','RisNAN'))
	{
		return true;
	} 
	else{
		return false;
	}

}


function reserve_tour_sales_op(formname){
//alert("hellooooooooooooooooooooooo");,'tx_resv_time_2','Min','R','tx_usr_det_lnme_1','Last Name','R','tx_usr_det_cell_1','Cell No','RisNaN'
if(MM_validateForm(formname,'tx_usr_det_fnme_1','First Name','R',
		'tx_usr_det_eml_1','Email','RisEmail','tx_usr_det_st_addr_1','User Address','R',
		'tx_usr_det_cty_1','City','R','tx_usr_det_ste_1','State','R','tx_usr_det_zip_1','Zip Code','R',
		'tx_usr_det_pno_1','Phone No','RisNaN',
		'tx_source_desti_1','Source And Destination','R','tx_car_id_1','Car Nam','R',
		'tx_resv_pick_add_1','Pick Up /Drop Address','R','tx_resv_no_hour_1','Hours','R',
		'tx_resv_pick_date_1','Pick Up Date','R','tx_resv_time_1','Time','R'))
	{

		return true;
	} 
	else{
		return false;
	}

}



function reserve_shuttle_sales_op(formname){
//alert("hellooooooooooooooooooooooo"),'tx_resv_time_1','Time','R','tx_resv_time_2','Min','R','tx_resv_time_2','Min','R','tx_resv_suff_flight_1','Flight Name','R','tx_resv_suff_flight_date_1','Flight Date','R','tx_usr_det_cell_1','Cell No','RisNaN';
/**/if(MM_validateForm(formname,'tx_usr_det_fnme_1','First Name','R','tx_usr_det_lnme_1','Last Name','R',
		'tx_usr_det_eml_1','Email','RisEmail','tx_usr_det_st_addr_1','User Address','R',
		'tx_usr_det_cty_1','City','R','tx_usr_det_ste_1','State','R','tx_usr_det_zip_1','Zip Code','R',
		'tx_usr_det_pno_1','Phone No','RisNaN',

		'tx_source_desti_1','Source And Destination','R','tx_resr_no_pasenger_1','Pasenger','R',
		'tx_resv_suff_pickdd_1','Pick Up Address','R','tx_resv_suff_dropadd_1','Drop Address','R',
		'tx_resv_suff_pickdate_1','Pick Up Date','R','tx_resv_time_1','Time','R'
		))
	{

		return true;
	} 
	else{
		return false;
	}
	
if(document.form1.tx_resv_rndtrip_1.checked)
			{
//alert("helloooooooooooooooo");

if(MM_validateForm(formname,'tx_resv_suff_pickdd_2','Pick Up Address','R','tx_resv_suff_dropadd_2','Drop Up Address','R',
		'tx_resv_drop_date_1','Drop Up Date','R','tx_resv_dtime_1','Hr','R',
		'tx_resv_dtime_1','Min','R'))
	{

		return true;
	} 
	else{
		return false;
	}

			}
}




function reserve_taxi_sales_op(formname){
/*alert("hellooooooooooooooooooooooo"),'tx_taxi_time_2','Pick min','R';*/
if(MM_validateForm(formname,'tx_usr_det_fnme_1','First Name','R','tx_usr_det_lnme_1','Last Name','R',
		'tx_usr_det_eml_1','Email','RisEmail','tx_usr_det_st_addr_1','User Address','R',
		'tx_usr_det_cty_1','City','R','tx_usr_det_ste_1','State','R','tx_usr_det_zip_1','Zip Code','isNaN',
		'tx_usr_det_pno_1','Phone No','RisNaN',
		'tx_loca_sour_id_1','Source State ','R','fc_category_prntid1','Destination State','R',
		'tx_car_id_1','Car','R','tx_car_capcity1','Passengers','R',		
		'tx_resv_pick_date_1','Pick Up Date','R','tx_taxi_time_1','Pick Hr','R'))
	{

		return true;
	} 
	else{
		return false;
	}

}

function reserve_taxi_sales_op_add(formname){
/*alert("hellooooooooooooooooooooooo");*/
if(MM_validateForm(formname,'tx_res_taxi_picup_add_1','Pick Up Address','R','tx_res_taxi_initial_stop_1','Intermediate Stoppage','R',
		'tx_res_taxi_drop_add_1','Drop Up Address','R','tx_res_taxi_no_hour_1','Hours','isNaN'))
	{

		return true;
	} 
	else{
		return false;
	}

}




function valid_profile_admin(formname)
{

//alert("hello"); 

if(MM_validateForm(formname,'tx_adm_pwd_1','Password','RisPassword','tx_adm_nme_1','Name','R','tx_adm_eml_1','Email','RisEmail','tx_adm_cntct_1','Contact No','RisContactNo'))
	{
		return true;
	} 
	else{
		return false;
	}
}


function valid_add_car(formname)
{

//alert("hello"); 

var editor1=document.form1.tx_car_img1.value;
var editor2=document.form1.tx_car_img2.value;
var editor3=document.form1.tx_car_img3.value;
var editor4=document.form1.tx_car_img4.value;

if(MM_validateForm(formname,'tx_ctype_name_1','Car Type','R',
	'tx_car_name','Car Name','R',
	'tx_car_model','Car Model','R',
	'tx_car_capcity','Car Capacity','RisNaN',
	'tx_car_detail','Description','R','tx_car_hours','Charges(Hourly)','RisNAN','tx_car_img1','Upload Image','isExt','tx_car_img2','Upload Image','isExt','tx_car_img3','Upload Image','isExt','tx_car_img3','Upload Image','isExt'))
	{

if((editor1=="") && (editor2=="") && (editor3=="") && (editor4==""))
{
alert("One Image is Required.");
return false;
}

	return true;
	} 
	else{
		return false;
	}

}


function valid_edit_car(formname)
{

//alert("hello"); 

if(MM_validateForm(formname,'tx_car_name1','Car Name','R',
	'tx_car_model1','Car Model','R',
	'tx_car_capcity1','Car Capacity','RisNaN',
	'tx_car_detail1','Description','R','tx_car_hours1','Charges(Hourly)','RisNAN','tx_car_img1','Upload Image','isExt','tx_car_img2','Upload Image','isExt','tx_car_img3','Upload Image','isExt','tx_car_img3','Upload Image','isExt'))
	{

/*if((tx_car_img1=="") && (tx_car_img2=="") && (tx_car_img3=="") && (tx_car_img4==""))
{
alert("One Image is Required");
return false;
}
*/

		return true;
	} 
	else{
		return false;
	}

}






function valid_for_password(formname)
{
	
if(MM_validateForm(formname,'tx_adm_eml_1','Email','RisEmail'))
	{
		
		return true;
	} else{
		return false;
	}
}



// VALIDATION FOR CONTECTPAGE IN USER PANEL

function contect_valid(formname)
{

//alert("hello"); 

if(MM_validateForm(formname,'user_name','Name','R',
	'user_email','Email','RisEmail',
	'user_phone','Phone','isNaN',
	'user_subject','Subject','R','user_message','Message','R'))
	{

		return true;
	} 
	else{
		return false;
	}

}
//validation for find car for quote
function find_car_for_quote(formname)
{

//alert("hello"); 

if(MM_validateForm(formname,'source_loc','Enter Source Location','R',
	'desti_loc','Enter Destination','R',
	'user_name','Name','R',
	'user_email','Enter Email','RisEmail'))
	{

		return true;
	} 
	else{
		return false;
	}

}
function reserve_tour_user(formname){
//alert("hellooooooooooooooooooooooo");
if(MM_validateForm(formname,'tx_usr_det_fnme_1','First Name','R','tx_usr_det_lnme_1','Last Name','R',
		'tx_usr_det_eml_1','Email','RisEmail','tx_usr_det_st_addr_1','User Address','R',
		'tx_usr_det_cty_1','City','R','tx_usr_det_ste_1','State','R','tx_usr_det_zip_1','Zip Code','R',
		'tx_usr_det_pno_1','Phone No','RisNaN','tx_usr_det_cell_1','Cell No','RisNaN',
		'tx_source_desti_1','Source And Destination','R','tx_car_id_1','Car Nam','R',
		'tx_resv_pick_add_1','Pick Up /Drop Address','R',
		'tx_resv_pick_date_1','Pick Up Date','R','tx_resv_no_hour_1','Select No Of Hours','R','tx_resr_no_pasenger_1','Number Of Passengers','R'))
	{

		return true;
	} 
	else{
		return false;
	}

}



// function for service type is required
function check_date_for_booking_history_type(formname){

if(MM_validateForm(formname,'tx_service_type','Service Type','R'))
	{

		start_date=document.form1.tx_start_date.value;
		end_date=document.form1.tx_end_date.value
	    if(((document.form1.tx_start_date.value=="")&&(document.form1.tx_end_date.value!=""))||((document.form1.tx_start_date.value!="")&&(document.form1.tx_end_date.value=="")))
		{
		alert("Please Enter Start date and end date!");
			return false;
			exit;
		}	

     else if(Date.parse(start_date)>Date.parse(end_date))
		{
			alert("Start date Should not be greater then end date");
			return false;
			exit;
			
		}
		else
		{
		return true;
		}
	} 
	else{
		return false;
	}

}

function driver_report(formname){
//alert("hellooooooooooooooooooooooo");
//alert(document.form1.tx_service_type.value);
if(MM_validateForm(formname,'tx_service_type','Service Type','R','tx_drvr_id_1','Select Driver','R'))
	{

		return true;
	} 
	else{
		return false;
	}

}




function associate_driver(formname){
//alert("hellooooooooooooooooooooooo");
//alert(document.form1.tx_service_type.value);
if(MM_validateForm(formname,'tx_drvr_id_1','Driver','R'))
	{

		return true;
	} 
	else{
		return false;
	}

}


function sales_operator_creation(formname){
/*alert("hellooooooooo");
return false;*/
if(MM_validateForm(formname,'tx_oprtr_lg_id_1','Login Id ','R','tx_oprtr_pwd_1','Password','RisPassword','tx_oprtr_nme_1','Name','R','tx_oprtr_cntct_1','Contact No','RisNaN','tx_oprtr_eml_1','Email ','RisEmail','tx_oprtr_addr_1','Address ','R')) 
	{

		return true;
	} 
	else{
		return false;
	}

}


function sales_operator_edit(formname){
/*alert("hellooooooooo");
return false;*/
if(MM_validateForm(formname,'tx_oprtr_pwd_1','Password','RisPassword','tx_oprtr_nme_1','Name','R','tx_oprtr_cntct_1','Contact No','RisNaN','tx_oprtr_eml_1','Email ','RisEmail','tx_oprtr_addr_1','Address ','R')) 
	{

		return true;
	} 
	else{
		return false;
	}

}



function valid_on_cms_content(formname)
{
	//alert("hello");
var editor=document.form1.rte1.value;
		
		if(editor=="") 
		{
			alert("Tour Details is Required");
			return false;
		}
		else
		{
			return true;
		}
} 
	

function reserve_shuttle_user(formname){
//alert("hellooooooooooooooooooooooo"),'tx_resv_time_1','Time','R','tx_resv_time_2','Min','R';
/**/if(MM_validateForm(formname,'tx_usr_det_fnme_1','First Name','R',
		'tx_usr_det_eml_1','Email','RisEmail','tx_usr_det_st_addr_1','User Address','R',
		'tx_usr_det_cty_1','City','R','tx_usr_det_ste_1','State','R','tx_usr_det_zip_1','Zip Code','R',
		'tx_usr_det_pno_1','Phone No','RisContactNo','tx_usr_det_cell_1','Cell No','isContactNo',

		'tx_source_desti_1','Source And Destination','R','tx_resr_no_pasenger_1','Pasenger','RisNaN',
		'tx_resv_suff_pickdd_1','Pick Up Address','R','tx_resv_suff_dropadd_1','Drop Address','R',
		'tx_resv_suff_pickdate_1','Pick Up Date','R'))
	{

		if(document.form1.checkbox1.checked)
			{
		//alert("helloooooooooooooooo");

		if(MM_validateForm(formname,'tx_resv_suff_pickdd_2','Pick Up Address','R','tx_resv_suff_dropadd_2','Drop Up Address','R',
		'tx_resv_drop_date_1','Drop Up Date','R','tx_resv_dtime_1','Hr','R',
		'tx_resv_dtime_1','Min','R'))
			{

				return true;
			} 
		else{
				return false;
			}

	}
    else{
         return true;
	}



	} 
	else{
		return false;
	}
	

}







function reserve_tour_for_user_panel(formname){
//alert("hellooooooooooooooooooooooo");
if(MM_validateForm(formname,'tx_usr_det_fnme_1','First Name','R',
		'tx_usr_det_eml_1','Email','RisEmail','tx_usr_det_st_addr_1','User Address','R',
		'tx_usr_det_cty_1','City','R','tx_usr_det_ste_1','State','R','tx_usr_det_zip_1','Zip Code','R',
		'tx_usr_det_pno_1','Phone No','RisContactNo','tx_usr_det_cell_1','Cell No','isContactNo',
		'tx_source_desti_1','Source And Destination','R','tx_car_id_1','Car Nam','R',
		'tx_resv_pick_add_1','Pick Up /Drop Address','R',
		'tx_resv_pick_date_1','Pick Up Date','R','tx_resv_no_hour_1','Select No Of Hours','R','tx_resr_no_pasenger_1','Number Of Passengers','R'))
	{

		return true;
	} 
	else{
		return false;
	}

}

function reserve_taxi_for_user(formname){
/*alert("hellooooooooooooooooooooooo");*/
if(MM_validateForm(formname,'tx_usr_det_fnme_1','First Name','R',
		'tx_usr_det_eml_1','Email','RisEmail','tx_usr_det_st_addr_1','User Address','R',
		'tx_usr_det_cty_1','City','R','tx_usr_det_ste_1','State','R','tx_usr_det_zip_1','Zip Code','R',
		'tx_usr_det_pno_1','Phone No','RisContactNo','tx_usr_det_cell_1','Cell No','isContactNo',
		'tx_loca_sour_id_1','Source State ','R','fc_category_prntid1','Destination State','R',
		'tx_car_id_1','Car','R','tx_car_capcity1','Passengers','R',		
		'tx_resv_pick_date_1','Pick Up Date','R','tx_taxi_time_1','Pick Hr','R','tx_taxi_time_2','Pick min','R'))
	{

		return true;
	} 
	else{
		return false;
	}

}



function add_source_function(formname){
/*alert("hellooooooooooooooooooooooo");*/
if(MM_validateForm(formname,'tx_sour_ste_1','Source State','R','tx_taxi_sour_location_1','Location','R'))
	{

		return true;
	} 
	else{
		return false;
	}

}

function add_dasti_function(formname){
/*alert("hellooooooooooooooooooooooo");*/
if(MM_validateForm(formname,'tx_sour_ste_1','Destination State','R','tx_taxi_desi_location_1','Location','R'))
	{

		return true;
	} 
	else{
		return false;
	}

}

function add_distance_function(formname){
/*alert("hellooooooooooooooooooooooo");*/
if(MM_validateForm(formname,'tx_loca_sour_id_1','Source State ','R','tx_loca_desi_id_1','Destination State ','R','tx_aad_distance_1','Destination','RisNaN'))
	{

		return true;
	} 
	else{
		return false;
	}

}
function edit_distance_function(formname){
/*alert("hellooooooooooooooooooooooo");*/
if(MM_validateForm(formname,'tx_aad_distance_1','Destination','RisNaN'))
	{

		return true;
	} 
	else{
		return false;
	}

}

function valid_car_admin(formname){
/*alert("hellooooooooooooooooooooooo");*/
if(MM_validateForm(formname,'car_admin_pass_1','Password','RisPassword','car_admin_name_1','Admin Name','R','car_admin_c_no_1','Phone Number','RisContactNo','car_admin_email_1','Email Id','RisEmail'))
	{

		return true;
	} 
	else{
		return false;
	}

}

function valid_car_manufacturer(formname){
/*alert("hellooooooooooooooooooooooo");*/
if(MM_validateForm(formname,'car_manufacture_name_1','Manufacturer Name','R','car_manufacture_logo_1','Logo','RisExt'))
	{

		return true;
	} 
	else{
		return false;
	}

}

function valid_car_model(formname){
if(MM_validateForm(formname,'car_model_name_1','Model Name','R','car_model_image_1','Upload Main Image','RisExt','car_model_f_h_img_1','Upload Front head-on','isExt','car_model_r_h_img_1','Upload Rear Head-on','isExt','car_model_f_r_img_1','Upload Front 3/4th Right','isExt','car_model_f_l_img_1','Upload Front 3/4th left','isExt','car_model_s_img_1','Upload Side Perspective','isExt'))
	{

		return true;
	} 
	else{
		return false;
	}

}

/*function valid_car_model(formname){

if(MM_validateForm(formname,'car_model_name_1','Model Name','R','car_model_image_1','Upload Main Image','RisExt','car_model_f_h_img_1','Upload Front head-on','RisExt','car_model_r_h_img_1','Upload Rear Head-on','RisExt','car_model_f_r_img_1','Upload Front 3/4th Right','RisExt','car_model_f_l_img_1','Upload Front 3/4th left','RisExt','car_model_s_img_1','Upload Side Perspective','RisExt'))
	{

		return true;
	} 
	else{
		return false;
	}

}*/
function valid_car_emodel(formname){
/*alert("hellooooooooooooooooooooooo");*/
if(MM_validateForm(formname,'car_model_name_1','Model Name','R','car_model_image_1','Upload Main Image','isExt','car_model_f_h_img_1','Upload Front head-on','isExt','car_model_r_h_img_1','Upload Rear Head-on','isExt','car_model_f_r_img_1','Upload Front 3/4th Right','isExt','car_model_f_l_img_1','Upload Front 3/4th left','isExt','car_model_s_img_1','Upload Side Perspective','isExt'))
	{

		return true;
	} 
	else{
		return false;
	}

}

function valid_car_variant(formname){
/*alert("hellooooooooooooooooooooooo");*/
if(MM_validateForm(formname,'car_variant_name_1','Variant Name','R','car_variant_desc_1','Description','R','car_variant_img1_1','	Upload Image','R'))
	{

		return true;
	} 
	else{
		return false;
	}

}

function valid_car_city(formname){
/*alert("hellooooooooooooooooooooooo");*/
if(MM_validateForm(formname,'car_city_name_1','City Name','R','car_city_factor_3','Enter City Factor < 1000 cc','R','car_city_factor_1','Enter City Factor 1000 to 1499 cc','R','car_city_factor_2','City Factor >= 1500 CC','R'))
	{

		return true;
	} 
	else{
		return false;
	}

}

function valid_car_price(formname){
/*alert("hellooooooooooooooooooooooo");*/
if(MM_validateForm(formname,'car_price_exprice_1','Enter Ex-showroom price','R','car_price_inprice_1','Enter Insurance price','R','car_price_logistic_1','Enter Logistics','R','car_price_thirdparty_1','Enter Third Year Warranty price','R','car_price_road_tax_1','Enter Registration/Road Tax','R'))
	{

		return true;
	} 
	else{
		return false;
	}

}

function valid_car_offer(formname){
/*alert("hellooooooooooooooooooooooo");*/
if(MM_validateForm(formname,'car_market_offer_1','Market offer','RisNan','car_offer_price_1','Introductory Carpardeals Offer','RisNan','car_offer_startdate_1','Start Date','R','car_offer_enddate_1','Expiry Date','R'))
	{

		return true;
	} 
	else{
		return false;
	}

}
function valid_car_color(formname){
var status_price=document.form1.car_s_status_1.checked;
if(status_price==true){

if(MM_validateForm(formname,'car_color_nme_1','Color name','R','car_color_image_1','Color image','RisExt','car_s_price_1','Special Price','RisNan'))
	{
	

		return true;
	} 
	else{
		return false;
	}

}else{
/*alert("hellooooooooooooooooooooooo");*/
if(MM_validateForm(formname,'car_color_nme_1','Color name','R','car_color_image_1','Color image','RisExt'))
	{
	

		return true;
	} 
	else{
		return false;
	}

}
}

function valid_car_color_edit(formname){
/*alert("hellooooooooooooooooooooooo");*/
var status_price=document.form1.car_s_status_1.checked;
if(status_price==true){
if(MM_validateForm(formname,'car_color_nme_1','Color name','R','car_color_image_1','Color image','isExt','car_s_price_1','Special Price','RisNan'))
	{
	

		return true;
	} 
	else{
		return false;
	}

}else{

if(MM_validateForm(formname,'car_color_nme_1','Color name','R','car_color_image_1','Color image','isExt'))
	{
	

		return true;
	} 
	else{
		return false;
	}
}
}
function conform_delete()
{
if(confirm("Are you sure want to delete?"))
		{
			return true;  
		}
		else 
		{
			return false;  
		}

}



function manufeturar_val_add(formname)
{

if(MM_validateForm(formname,'car_manufacture_name_1','Manufacturer Name','R','txtfile','Logo','RisExt','car_model_prod_url_1','Product Url Name','R'))
	{

		return true;
	} 
	else{
		return false;
	}

}


function manufeturar_val_edit(formname)
{

if(MM_validateForm(formname,'car_manufacture_name_1','Manufacturer Name','R','txtfile','Logo','isExt','car_model_prod_url_1','Product Url Name','R'))
	{

		return true;
	} 
	else{
		return false;
	}

}




function category_val_add(formname)
{

if(MM_validateForm(formname,'car_cat_name_1','Category Name','R'))
	{

		return true;
	} 
	else{
		return false;
	}

}


function category_val_edit(formname)
{

if(MM_validateForm(formname,'car_cat_name_1','Category Name','R'))
	{

		return true;
	} 
	else{
		return false;
	}

}

function varient_val_add(formname)
{

if(MM_validateForm(formname,'car_m_id_1','Manufacturer Name','R','car_mo_id_1','Model Name','R','car_variant_name_1','Variant Name','R','car_engine_cc_type_1','Variant CC Type','R','car_variant_image_1','Variant Image','RisExt','car_variant_title1_1','Title','R','car_variant_img1_1','Upload Image','RisExt','car_variant_img2_1','Upload Image','isExt','car_variant_img3_1','Upload Image','isExt','car_variant_img4_1','Upload Image','isExt','car_variant_img5_1','Upload Image','isExt'))
	{
	
	if(document.form1.car_fuel_type_petrol_1.checked){
		return true;
	}
	else if(document.form1.car_fuel_type_diesel_1.checked){
	return true;}
	else if(document.form1.car_fuel_type_lpg_1.checked){
	return true;}
	else if(document.form1.car_fuel_type_cng_1.checked){
	return true;}
	else {
		alert('Please select at least one fuel type');
	return false;
	}
	}
	else{
		return false;
	}

}
function varient_val_edit(formname)
{
//alert("hi");
if(MM_validateForm(formname,'car_m_id_1','Manufacturer Name','R','car_variant_name_1','Variant Name','R','car_engine_cc_type_1','Variant CC Type','R','car_variant_image_1','Variant Image','isExt','car_variant_title1_1','Title','R','car_variant_img1_1','Upload Image','isExt','car_variant_img2_1','Upload Image','isExt','car_variant_img3_1','Upload Image','isExt','car_variant_img4_1','Upload Image','isExt','car_variant_img5_1','Upload Image','isExt'))
	{
if(document.form1.car_fuel_type_petrol_1.checked){
		return true;
	}
	else if(document.form1.car_fuel_type_diesel_1.checked){
	return true;}
	else if(document.form1.car_fuel_type_lpg_1.checked){
	return true;}
	else if(document.form1.car_fuel_type_cng_1.checked){
	return true;}
	else {
		alert('Please select at least one fuel type');
	return false;
	}
	} 
	else{
		return false;
	}

}




function price_val_add(formname)
{

if(MM_validateForm(formname,'car_m_id_1','Manufacturer Name','R','car_v_id_1','Variant Name','R','car_mo_id_1','Variant Model','R','car_c_id_1','City','R','car_price_exprice_metalic_1','Ex-showroom Price Metallic','RisNaN','car_price_exprice_nmetalic_1','Ex-showroom Price Non-Metallic','RisNaN','car_price_inprice_metallic_1','Insurance Price Metallic','RisNaN','car_price_inprice_nonmetallic_1','Insurance Price Non-Metallic','RisNaN','car_price_logistic_1','Logistics','RisNaN','car_price_thirdparty_1','Third Year Warranty Price','RisNaN','car_price_road_tax_metallic_1','Registration/Road Tax Metallic','RisNaN','car_price_road_tax_nonmetallic_1','Registration/Road Tax Non-Metallic','RisNaN'))
	{
//,'car_price_road_tax_corpo_metallic_1','Corporate Registration/Road Tax Metallic','RisNaN','car_price_road_tax_corpo_nonmetallic_1','Corporate Registration/Road Tax Non - Metallic','RisNaN'
		return true;
	} 
	else{
		return false;
	}

}

function price_val_cal(formname)
{

if(MM_validateForm(formname,'car_m_id_1','Manufacturer Name','R','car_v_id_1','Variant Name','R','car_mo_id_1','Variant Model','R','car_c_id_1','City','R','car_price_exprice_metalic_1','Ex-showroom Price Metallic','RisNaN','car_price_exprice_nmetalic_1','Ex-showroom Price Non-Metallic','RisNaN','car_price_logistic_1','Logistics','RisNaN','car_price_thirdparty_1','Third Year Warranty Price','RisNaN','car_fixed_value_1','Fixed value','RisNaN'))
	{

		return true;
	} 
	else{
		return false;
	}

}
function price_val_edit(formname)
{

if(MM_validateForm(formname,'car_price_exprice_metalic_1','Ex-showroom Price Metallic','RisNaN','car_price_exprice_nmetalic_1','Ex-showroom Price Non-Metallic','RisNaN','car_price_inprice_metallic_1','Insurance Price Metallic','RisNaN','car_price_inprice_nonmetallic_1','Insurance Price Non-Metallic','RisNaN','car_price_logistic_1','Logistics','RisNaN','car_price_thirdparty_1','Third Year Warranty Price','RisNaN','car_price_road_tax_metallic_1','Registration/Road Tax Metallic','RisNaN','car_price_road_tax_nonmetallic_1','Registration/Road Tax Non-Metallic','RisNaN'))
	//,'car_price_road_tax_corpo_metallic_1','Corporate Registration/Road Tax Metallic','RisNaN','car_price_road_tax_corpo_nonmetallic_1','Corporate Registration/Road Tax Non - Metallic','RisNaN'
	{

		return true;
	} 
	else{
		return false;
	}

}


function feedback_valid(formname)
{
//	alert("hi");

if(MM_validateForm(formname,'car_f_name_1','Name','R','car_f_email_1','E-mail','RisEmail','car_wishlist_1','Expectations','R'))
	{
	
	return true;
	}
	else{
		return false;
	}

}

function valid_contact(formname)
{
//	alert("hi");

if(MM_validateForm(formname,'car_contact_name','Name','R','car_contact_email','E-mail','RisEmail','car_contact_sub','Subject','R','car_contact_message','Message','R'))
	{
	
	return true;
	}
	else{
		return false;
	}

}

function registration_validation(formname)
{
//alert("hi");
if(MM_validateForm(formname,'car_reg_name_1','Name','R','car_reg_l_add_1','Resi Address','R','car_reg_post_code_1','Pin code','RisNan','car_reg_email_1','Email ID','RisEmail','car_reg_phno_landline_1','Landline Number','isContactNo','car_reg_phno_mobile_1','Mobile Number','RisContactNo','car_reg_pan_no_1','PAN Number','RisalphaNum','car_reg_office_add_1','Office Address','R','car_reg_office_no_1','Office Number','RisContactNo','car_reg_laandline_no_1','Landline Number','RisContactNo','car_reg_contact_d','Contact Date','R','car_reg_contact_day_1','Contact Day','R'))
	{
		
		return true;
		
	} 
	else{
		return false;
	}

}


function enqistration_validation(formname)
{
//alert("hi");manufacturer_name_1 model_name_1 variant_name_1
if(MM_validateForm(formname,'manufacturer_name_1','Manufacturer','R','model_name_1','Model','R','variant_name_1','Variant','R' ,'car_enq_name_1','Name','R','car_enq_l_add_1','Resi Address','R','car_enq_post_code_1','Pin code','RisNan','car_enq_email_1','Email ID','RisEmail','car_enq_phno_landline_1','Landline Number','isContactNo','car_enq_phno_mobile_1','Mobile Number','RisContactNo','car_enq_pan_no_1','PAN Number','RisalphaNum','car_enq_office_add_1','Office Address','R','car_enq_office_no_1','Office Number','RisContactNo','car_enq_laandline_no_1','Landline Number','RisContactNo','car_enq_contact_d','Contact Date','R','car_enq_contact_day_1','Contact Day','R'))
	{
		
		return true;
		
	} 
	else{
		return false;
	}

}


function loan_validation(formname)
{
//alert("hi");
if(MM_validateForm(formname,'car_reg_name_1','Name','R','car_reg_l_add_1','Residential Address','R','car_reg_post_code_1','Pin code','RisNan','car_reg_email_1','Email ID','RisEmail','car_reg_phno_landline_1','Landline Number','isContactNo','car_reg_phno_mobile_1','Mobile Number','RisContactNo','car_reg_pan_no_1','PAN Number','RisalphaNum','car_reg_office_add_1','Office Address','R','car_reg_office_no_1','Office Number','RisContactNo','car_reg_laandline_no_1','Landline Number','RisContactNo','car_reg_contact_d','Contact Date','R','car_reg_contact_day_1','Contact Day','R','car_loan_amount_1','Loan Amount','RisNan','car_tenure_1','Tenure','R','car_pan_number_1','Pan number','RisAlphaNum','car_salary_month_1','Salary per month','R','car_industry_1','Industry','R','car_company_1','Comapany name','R','car_company_address_1','Company Address','R','car_company_mobile_1','Company telephone number','R','car_company_landline_1','Landline no','RisContactNo'))
	{
		
		return true;
		
	} 
	else{
		return false;
	}

}




function nanoreg_validation(formname)
{
//alert("hi");manufacturer_name_1 model_name_1 variant_name_1
if(MM_validateForm(formname,'city_day_1','City','R',
	'var_1','Variant','R',
	'ex_show_room','Exshowroom Price','R',
'amt_fin','Amount Financed','R',
'book_amt','Booking Amount','R',
'form_cost','Form Cost','R',
'stamp_duty','Documentation Charges','R',
'tot_bkn_amt','Total Booking Amount','R'
,'car_enq_name_1','Name','R',
	'car_enq_l_add_1','Resi Address','R'
,'car_enq_post_code_1','Pin code','RisNan',
	'car_enq_pan_1','PAN Number','RisalphaNum',
	'car_enq_email_1','Email ID','RisEmail',
	'car_enq_phno_landline_1','Landline Number','isContactNo',
	'car_enq_phno_mobile_1','Mobile Number','RisContactNo',
		'car_enq_contact_d','Contact Date','R',
	'car_enq_contact_day_1','Contact Day','R',
	'car_enq_contact_time_1','Contact Time','R'))
	{
		
		return true;
		
	} 
	else{
		return false;
	}

}

function fg_reg(formname)
{
//alert("hi");
if(MM_validateForm(formname,'car_login_id_1','Email id','RisEmail'))
	{
		
		return true;
		
	} 
	else{
		return false;
	}

}



function accessories_validation(formname)
{
//alert("hi");
if(MM_validateForm(formname,'car_reg_name_1','Name','R','car_reg_email_1','Email ID','RisEmail','car_reg_phno_landline_1','Landline Number','isContactNo','car_reg_phno_mobile_1','Mobile Number','RisContactNo','car_acceessories_1','Details of accessories','R'))
	{
		
		return true;
		
	} 
	else{
		return false;
	}

}

function login_validation(formname)
{
//alert("hi");
if(MM_validateForm(formname,'car_login_id_1','Login Id','RisEmail','car_password_1','Password','R'))
	{
		
		return true;
		
	} 
	else{
		return false;
	}

}
function forgot_p_valid(formname)
{
//alert("hi");
if(MM_validateForm(formname,'car_login_id_1','Email Id','RisEmail'))
	{
		
		return true;
		
	} 
	else{
		return false;
	}

}
function valid_car_ad(formname)
{
//alert("hi");
if(MM_validateForm(formname,'car_ban_title_1','Title','R','car_model_image_1','Upload Ad','RisExt','car_ban_url_1','Destination URL','isUrl','car_ban_edate_1','Expiry date','R'))
	{	
		return true;
		
	} 
	else{
		return false;
	}

}
function valid_car_ad_def(formname)
{
//alert("hi");
if(MM_validateForm(formname,'car_model_image_1','Upload Ad','RisExt'))
	{	
		return true;
		
	} 
	else{
		return false;
	}

}
function valid_car_ad_edit_def(formname)
{
//alert("hi");
if(MM_validateForm(formname,'car_model_image_1','Upload Ad','isExt'))
	{	
		return true;
		
	} 
	else{
		return false;
	}

}

function checkURL(value) {

var urlregex = new RegExp("^(http:\/\/www.|https:\/\/www.|ftp:\/\/www.|www.){1}([0-9A-Za-z]+\.)");
alert(urlregex.test(value));
if(urlregex.test(value))
{
alert("true");
return(true);
}

alert("false");
return(false);
}

function isUrl(value) {
	var regexp = /(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/
	if(regexp.test(value)){
	return(true);
	}
	else{
	return(false);
	}
}




function valid_car_edit_ad(formname)
{
//alert("hi");
if(MM_validateForm(formname,'car_ban_title_1','Title','R','car_model_image_1','Upload Ad','isExt','isUrl','car_ban_edate_1','Expiry date','R'))
	{	
		
		if(isUrl(document.form1.car_ban_url_1.value)){
		return true;
		}
		else{
			alert("Must be valid URL e.g. http or https://www.abc.com\n");
		return(false);
		}
		
		return true;
		
	} 
	else{
		return false;
	}

}





 function validate_var_features(){
       var email=document.forms[0].ids;
       if(email.checked!=true){
          alert("Email is not checked!");
          return false;
       }
       return true;
 }







function valid_edit_profile_form(formname)
{

if(MM_validateForm(formname,'mycats_admin_password_1','Password','R','mycats_admin_name_1','Name','R','mycats_admin_email_1','Email Address','RisEmail'))
	{

		return true;
	} 
	else{
		return false;
	}

}

function valid_revenue_form(formname)
{

if(MM_validateForm(formname,'start_date','Start Date','R','end_date','End Date','R'))
	{

		return true;
	} 
	else{
		return false;
	}

}


//'terms','Terms and Conditions','R'

function valid_add_member_form(formname)
{
if(MM_validateForm(formname,
'mycats_member_usrname','User Name','R',
'mycats_member_pwd','Password','R',
'mycats_member_pwd_retype','Retype - Password','R',
'mycats_member_fname', 'First Name','R',
'mycats_member_lname', 'Last Name','R',
'mycats_member_email', 'Email','RisEmail',
'mycats_member_cnt_ph1', 'Contact no','RisNum',
'mycats_member_addr', 'Address','R',
'mycats_member_town', 'City ','R',
'mycats_member_pin_code', 'Pin Code','RisNum'
))
	{
		if(document.mem_add_form.checkbox.checked)
		{
			return true;
		}
		else
		{
			alert('Terms & Conditions is required.');
			return false;
		}


	} 


	else
	{
		return false;
	}

}

function valid_edit_member_form(formname)
{
	//alert("Hello");
	
if(MM_validateForm(formname,
'mycats_member_pwd1','Password','R',
'mycats_member_fname1', 'First Name','R',
'mycats_member_lname1', 'Last Name','R',
'mycats_member_email1', 'Email','RisEmail',
'mycats_member_cnt_ph1', 'Contact no','RisContactNo',
'mycats_member_addr1', 'Address','R',
'mycats_member_town1', 'City ','R',
'mycats_member_pin_code1', 'Pin Code','RisNum'

))
	{
		return true;
		
	} 
	else{
		return false;
	}

}


function valid_shipping_form(formname)
{

if(MM_validateForm(formname,
'mycats_member_usrname','User Name','R',
'mycats_member_pwd','Password','R',
'mycats_member_pwd_retype','Retype - Password','R',
'mycats_member_fname', 'First Name','R',
'mycats_member_lname', 'Last Name','R',
'mycats_member_email', 'Email','RisEmail',
'mycats_member_cnt_ph', 'Contact no','RisNum',
'mycats_member_addr', 'Address','R',
'mycats_member_town', 'City ','R',
'mycats_member_pin_code', 'Pin Code','RisNum',
'terms','Terms and Conditions','R'
))
	{
		if(document.mem_add_form.checkbox.checked)
		{
			return true;
		}
		else
		{
			alert('Terms & Conditions is required');
			return false;
		}


	} 
	else{
		return false;
	}

}




function valid_edit_member_form_admin(formname)
{
	

if(MM_validateForm(formname,
'mycats_member_usrname_1','User Name','R',
'mycats_admin_password_1','Password','R',
'mycats_member_pwd_retype_1','Retype - Password','R',
'mycats_member_fname_1', 'First Name','R',
'mycats_member_lname_1', 'Last Name','R',
'mycats_member_email_1', 'Email','RisEmail',
'mycats_member_cnt_ph_1', 'Contact no','RisNum',
'mycats_member_addr_1', 'Address','R',
'mycats_member_town_1', 'City ','R',
'mycats_member_pin_code_1', 'Pin Code','RisNum'

))
	{

		return true;
	} 
	else{
		return false;
	}

}

function valid_add_coupon(formname)
{
//alert(formname)	;


if(MM_validateForm(formname,
'coupon_no_1','Coupon Code','R',
'mycats_dis_cup_cr_dt_1','Date of Creation','R',
'mycats_dis_cup_dis_dis_1','Discount','RisNum',
'mycats_dis_cup_min_amt_1', 'Minimum Order Amount','RisNum',
'mycats_dis_exp_dt_1', 'Expiry date','R'
))
	{
		return true;
		
		
		/*if(){
			return true;
		}else{
			return false;
		}*/
	} 
	else{
		return false;
	}

}

function valid_add_size(formname)
{

if(MM_validateForm(formname,'mycats_size_name','Size','R'))
	{

		return true;
	} 
	else{
		return false;
	}

}


function valid_edit_size(formname)
{

if(MM_validateForm(formname,'mycats_size_name1','Size','R'))
	{

		return true;
	} 
	else{
		return false;
	}

}


function valid_model(formname)
{

if(MM_validateForm(formname,'mycats_model_name','Model Name','R','mycats_model_price','Price','RisNum','mycats_model_wt','Weight','RisNum','mycats_model_img','Image','RisExt'))
	{

		return true;
	} 
	else{
		return false;
	}

}

function valid_edit_model(formname)
{

if(MM_validateForm(formname,'mycats_model_name1','Model Name','R','mycats_model_price1','Price','RisNum','mycats_model_wt1','Weight','RisNum','mycats_model_img1','Image','isExt'))
	{

		return true;
	} 
	else{
		return false;
	}

}

function valid_edit_model(formname)
{

if(MM_validateForm(formname,'mycats_model_name1','Model Name','R','mycats_model_price1','Price','RisNum','mycats_model_wt1','Weight','RisNum','mycats_model_img1','Image','isExt'))
	{

		return true;
	} 
	else{
		return false;
	}

}


function valid_color_img(formname)
{

var test_img=document.form1.mycats_clr_map_name.value;

if(MM_validateForm(formname,'gender','For','R','model_1','Model','R','mycats_color_title','Color Title','R','mycats_color_img','Main Image','isExt','mycats_clr_map_name','Image','isExt'))
{

	
	return true;
	} 
	else{
		return false;
	}

}

function valid_main_color_img(formname)
{

if(MM_validateForm(formname,'mycats_color_img','Main Image','RisExt'))
{

	
	return true;
	} 
	else{
		return false;
	}

}



function valid_edit_color(formname)
{

if(MM_validateForm(formname,'mycats_color_title','Color Title','R','mycats_color_img','Main Color Image','isExt','mycats_clr_map_name','Color Image','isExt'))
{

	
	return true;
	} 
	else{
		return false;
	}

}

function valid_join_image(formname)
{

if(MM_validateForm(formname,'mycats_up_join_img','Join Image','isExt'))
	{

		return true;
	} 
	else{
		return false;
	}

}

function valid_site_fes(formname)
{

if(MM_validateForm(formname,'mycats_up_sal_tax1','Sales Tax','isNum'))
	{

		return true;
	} 
	else{
		return false;
	}

}




function valid_shipping(formname)
{
if(MM_validateForm(formname,
'mycats_order_company','Shipping - Company','R',
'mycats_order_address1','Shipping - Address Line1','R',
'mycats_order_address2','Shipping - Address Line2 - Password','R',
'mycats_order_state', 'Shipping - State','R',
'mycats_order_postcde', 'Shipping - Post Code','R',
'mycats_order_b_address1','Billing - Address Line1','R',
'mycats_order_b_address2','Billing - Address Line2 - Password','R',
'mycats_order_b_state', 'Billing - State','R',
'mycats_order_b_postcde', 'Billing - Post Code','R'
))
	{
			return true;
	
	} 
	else{
		return false;
	}

}

//'company_name','Company Name','R',
function valid_contact_form(formname)
{
if(MM_validateForm(formname,
'fullname','Full Name','R',
'email','Email','RisEmail',
'companyname','Company Name','R',
'phone', 'Phone Number','isNum',
'website', 'Website','isUrl',
'message','Message','R'
))
	{
			return true;
	
	} 
	else{
		return false;
	}

}


function validate_request_quote_form(formname)
{
if(MM_validateForm(formname,
'name','Name','R',
'website', 'Website','R',
'email','Email','RisEmail',
'phone', 'Phone Number','R',
'expectations','Expectations','R'
))
	{
			return true;
	
	} 
	else{
		return false;
	}

}


