function MM_validateForm() 
{ 
	var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
	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 regString = /^([a-zA-Z][^\b]+)$/;
	var regPhone = /^([0-9][0-9][0-9]+-[0-9][0-9][0-9]+-[0-9][0-9][0-9][0-9])$/;
	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]+)$/;

	//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('isString')!=-1)
				{
				result = trim(val);
				if(result.length==0){
				errors += '- '+nm+' is required.\n'; 
				}else{
					if(!regString.test(val))
					{
						errors+='- '+nm+': Only Chars Allowed.\n';
					}
				}
				}
				else if(test.indexOf('isAlphaNum')!=-1)
				{
				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('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<5)
					{
						errors+='- '+nm+' must contain must contain at least 5 characters\n';
					}
			     }


				 else if (test.indexOf('isExte')!=-1) 
				{	
					
					
					p=val.indexOf('.doc');
					s=val.indexOf('.xls');
					q=val.indexOf('.ppt');
					r=val.indexOf('.txt');
					t=val.indexOf('.pdf');
					
					
					a=val.indexOf('.DOC');
					b=val.indexOf('.XLS');
					c=val.indexOf('.PPT');
					d=val.indexOf('.TXT');
					e=val.indexOf('.PDF');
					

			        if ((p<1 || p==(val.length-1)) && (s<1 || s==(val.length-1))&&(q<1 || q==(val.length-1)) && (r<1 || r==(val.length-1))  && (t<1 || t==(val.length-1))  
					&& (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))	
					)
					{
						errors+='- '+nm+' File should be in .doc, .xls, .ppt, .txt, .pdf format!.\n';
		
					}
				}
				
				 else if (test.indexOf('isExt')!=-1) 
				{	
					p=val.indexOf('.jpg');
					s=val.indexOf('.gif');
					q=val.indexOf('.jpeg');

					a=val.indexOf('.JPG');
					b=val.indexOf('.GIF');
					c=val.indexOf('.JPEG');
					

			        if ((p<1 || p==(val.length-1)) && (s<1 || s==(val.length-1)) && (q<1 || q==(val.length-1)) 
					&& (a<1 || a==(val.length-1)) && (b<1 || b==(val.length-1)) && (c<1 || c==(val.length-1))	
					)
					{
						errors+='- '+nm+' File should be in .jpg, .jpeg, .gif format!.\n';
		
					}
				}


				else if (test.indexOf('isEmail')!=-1) 
				{ 
					p=val.indexOf('@');
					s=val.indexOf('.');
			        if (p<1 || p==(val.length-1))
					{
						errors+='- '+nm+' must contain an e-mail Address.\n';
		
					}
					//else if(s<p || s==(val.length-1))
					else if(!regEmail.test(val))
					{
						errors+='- '+nm+' must contain 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.abc.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(8,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

//CODE FOR RECURRENCE STUFF


//
function subscribe_news(formname)
{
	if(MM_validateForm(formname,  'email','Subscribe Email','RisEmail'))
	{
		return true;
	} else{
		return false;
	}
}



function delete_confirm(form)
{
	if(form.delete1.value == "Delete")
	{	
		if(confirm("Are you sure you want to Delete? "))
		{
			form.submit;
		}
		else
		{
			return false;
		}
	}
}


function delete_confirm1(form)
{
	if(form.delete1.value == "Delete")
	{	
		if(confirm("Are you sure you want to Create Zip File? "))
		{
			form.submit;
		}
		else
		{
			return false;
		}
	}
}
function checkall(objForm){

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

function check_news1(objForm){

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

function check_email1(objForm){

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



function is_any_check_box_checked(fObj)
{
	found=false;
	for(i=0;i<fObj.length;i++)
	{
		if(fObj[i].type=="checkbox" && fObj[i].checked) 
		{
			found=true;
			break	
		}		
	}
	return found;
}



function checkCheckboxes1(fObj)
{		
	if(is_any_check_box_checked(fObj)!=true)
	{
		if(confirm("Are you sure?"))
		{
			return true;  
		}
		else 
		{
			return false;  
		}
	}
}

function checkCheckboxes(fObj)
{		
	////////alert("aaaaaa");
	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 checkCheckboxes2(fObj)
{		
	////////alert("aaaaaa");
	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. and  at least one news tempplate name.");		
		return false;
	}
}

function Delconfirm(a)
 {
  if(confirm("Are you sure you want to delete this Record?"))
   {
    window.location.href=a;
    return true;
   }
 }

function add_password(form1)
{
if(MM_validateForm(form1, 'user_log_name','Admin User Login Name','RisString'))
	{ 
		return true;
	} else{
		return false;
	}
}

function addedit_user(newuser)
{
	if(MM_validateForm(newuser, 'user_id','User ID','R','user_pwd','Passwd','R','re_user_pwd','Re-Type-Passwd','R', 'user_type_auto_id','User Type','R', 'user_name','User Name','R', 'user_emailadd','Email ID','RisEmail', 'user_phoneno','Phone','RisNan', 'user_mobileno','Mobile','RisNan', 'user_website','Web Site','RisUrl', 'user_photo','User Photo','R','user_description','Description','R', 'user_country_id','Country','R', 'user_state_id','State','R', 'user_district_id','District','R', 'user_post_code','Post Code','RisNan'))
	{
		return true;
	} else{
		return false;
	}
}




function add_forget(newuser)
{
	if(MM_validateForm(newuser,  'user_name','User Name','R'))
	{
		return true;
	} else{
		return false;
	}
}


function addedit_user1(newuser)
{
	if(MM_validateForm(newuser, 'user_id','User ID','R','user_pwd','Passwd','R','re_user_pwd','Re-Type-Passwd','R', 'user_type_auto_id','User Type','R', 'user_name','User Name','R', 'user_emailadd','Email ID','RisEmail', 'user_phoneno','Phone','RisNan', 'user_mobileno','Mobile','RisNan', 'user_website','Web Site','RisUrl', 'user_description','Description','R', 'user_country_id','Country','R', 'user_state_id','State','R', 'user_district_id','prop_pincode','Pin code','RisNan','District','R', 'user_post_code','Post Code','RisNan'))
	{
		return true;
	} else{
		return false;
	}
}

function new_property(property)
{
	if(MM_validateForm(property, 'prop_title','Title','R', 'prop_introduction','Description','R', 'prop_user_name','User Name','R', 'prop_address','Address','R','prop_country_id','Country','R','prop_state_id','State','R','prop_district_id','District','R','prop_pincode','Pin code','RisNan','prop_price','Price','RisNan','prop_buildup_area','Build Up Area','R','prop_cat','Property Category','R', 'prop_type_id','Property Type','R', 'prop_floor_plan','Floor Plan Image','R','prop_lcation_map','Property Location Image','R','prop_layout_plan','Property Layout','R','prop_payment_plan','Payment Image','R','prop_brochure','Brochure Image','R','prop_image','Property Image','R'))
	{
		return true;
	} else{
		return false;
	}
}
function new_property1(property)
{
	if(MM_validateForm(property, 'prop_title','Title','R', 'prop_introduction','Description','R', 'prop_user_name','User Name','R', 'prop_address','Address','R','prop_country_id','Country','R','prop_state_id','State','R','prop_district_id','District','R','prop_price','Price','RisNan','prop_buildup_area','Build Up Area','R','prop_cat','Property Category','R', 'prop_type_id','Property Type','R'))
	{
		return true;
	} else{
		return false;
	}
}


function check_propname(propname)
{
if(MM_validateForm(propname, 'prop_name','Property Name','RisAlphaNum'))
	{
		return true;
	} else{
		return false;
	}
}
function check_proptype(proptype)
{
if(MM_validateForm(proptype, 'prop_type_name','Property Type','RisAlphaNum'))
	{
		return true;
	} else{
		return false;
	}
}
function check_projtype(projtype)
{
if(MM_validateForm(projtype, 'project_type','Project Type','RisAlphaNum'))
	{
		return true;
	} else{
		return false;
	}
}

function check_project(project)
{
	if(MM_validateForm(project, 'project_title','Project Title','R', 'project_location','Project Location','R', 'project_type_of_project','Type of Project','R', 'project_flat','Number of Flat','R', 'project_type_of_ownership','Ownership','R', 'project_area','Area','R','project_description','Description','R'))
	{
		return true;
	} else{
		return false;
	}
}

function valid_floorplan(floorplan)
{
	if(MM_validateForm(floorplan, 'floor_project_id','Project Title Name','R', 'floor_number','Floor Number','R', 'floor_unit_number','Unit Number','R'))
	{
		return true;
	} else{
		return false;
	}
}
function check_content(content)
{
	if(MM_validateForm(content, 'content_title','Content Title','R', 'content_title_alias','Content Title Alias','R', 'content','Introduction','R','content_desc','Description','R','content_keyword','Keyword','R'))
	{
		return true;
	} else{
		return false;
	}
}

function check_gallery(gallery)
{
	if(MM_validateForm(gallery, 'gallery_img_name','Gallery Name','R', 'gallery_image1','Upload Gallery Image','R'))
	{
		return true;
	} else{
		return false;
	}
}



function check_edit_gallery(gallery)
{
	if(MM_validateForm(gallery, 'gallery_img_name','Image Name','R'))
	{
		return true;
	} else{
		return false;
	}
}

function check_news(news)
{
	if(MM_validateForm(news, 'news_title','New Title','R', 'news_desc','New Description','R'))
	{
		return true;
	} else{
		return false;
	}
}

function check_logo(logo)
{
	if(MM_validateForm(logo, 'logo_name','Logo Name','R','logo_img','Logo Image','R','logo_url','Logo URL','RisUrl'))
	{
		return true;
	} else{
		return false;
	}
}
function check_logo1(logo)
{
	if(MM_validateForm(banner, 'logo_name','Logo Name','R','logo_url','Logo URL','RisUrl'))
	{
		return true;
	} else{
		return false;
	}
}

function validation_Paswd(newuser)
{
	var pwd=document.newuser.user_pwd.value;
	var re_pwd=document.newuser.re_user_pwd.value;
if(pwd!=re_pwd)
{
	alert("Error:Varify Password does not match!");
	document.newuser.re_user_pwd.value='';
	document.newuser.user_pwd.focus();
	}
}
function getfloor(floorplan)
{
floor_project_id=document.floorplan.floor_project_id.value;
document.location.href="addedit_floorplan.php?floor_project_id="+floor_project_id;
}

function getunit(floorplan)
{
floor_project_id=document.floorplan.floor_project_id.value;
floor_number=document.floorplan.floor_number.value;

document.location.href="addedit_floorplan.php?floor_project_id="+floor_project_id+"&floor_number="+floor_number;

}


var http_request = false;
var tempTxt;
function makeRequest(url,txt,strVariables) 
	{
	
	http_request = false;
	tempTxt=txt;
	if (window.XMLHttpRequest)
		{ // Mozilla, Safari,...
			http_request = new XMLHttpRequest();
			if (http_request.overrideMimeType)
			{
			http_request.overrideMimeType('text/xml');
			// See note below about this line
			}
		}
	else if (window.ActiveXObject)
		{ // IE
		try
			{
			http_request = new ActiveXObject("Msxml2.XMLHTTP");
			}
		catch (e)
			{
			try
				{
				http_request = new ActiveXObject("Microsoft.XMLHTTP");
				}
			catch (e)
				{
				}
			}
		}
	if (!http_request)
		{
		alert('Giving up :( Cannot create an XMLHTTP instance');
		return false;
		}
	http_request.open('POST', url, true);
	http_request.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"); 
	http_request.send(strVariables);
	http_request.onreadystatechange = alertContents;
	}

function alertContents()
	{
	
	if (http_request.readyState == 4)
		{
		if (http_request.status == 200)
			{		
				var resul= http_request.responseText;
				document.getElementById(tempTxt).innerHTML=http_request.responseText;
				if(tempTxt=="img")
				{
					var resul= http_request.responseText;
					
					document.getElementById('img').innerHTML=resul;
					
					//document.getElementById('shippingArea').innerHTML=b;
					
					if(resul=='$0.00')
					{
						document.getElementById('img').innerHTML='121';
						//document.getElementById('display').style.display = 'none';
					}
				}
			}
			else
				{
				alert('There was a problem with the request.');
				}
		   }
		else if (http_request.readyState == 1 )
			{
			
			document.getElementById(tempTxt).innerHTML = "sorry";
			
			}
		}
function gallery_img(gal_id)
{
	//var gal_id;
	//alert("gal_id");
	//var property_name=document.form1.property_name.value;
//var categ=document.datashow.categ.value;
	var strVariables = 'action=getimg&gal_id='+gal_id;
	
	//&city='+city+'&categ='+categ+'&fr_id='+fr_id
	makeRequest('prop_gallery.php',"img",strVariables);

}
function gallery_img1(prop_id)
{
	//var gal_id;
	//alert("gal_id");
	//var property_name=document.form1.property_name.value;
//var categ=document.datashow.categ.value;
	var strVariables = 'action=propimg&prop_id='+prop_id;
	
	//&city='+city+'&categ='+categ+'&fr_id='+fr_id
	makeRequest('prop_gallery.php',"img",strVariables);

}

	function showimage(path)
   {
	 window.open("image.show.php?path="+path,"","status=1,width=500,height=500,scrollbars=1,resizable=1,menubar=1"); 
	 }
	
	function check_contactus(contactus)
{
	if(MM_validateForm(contactus, 'contact_company','Company Name','R','contact_address','Address','R','contact_phone','Phone Number','RisNan', 'contact_web','Website','RisUrl','contact_email_id','Email ID','RisEmail'))
	{
		return true;
	} else{
		return false;
	}
}
	
function check_buyer(buyer)
{
	if(MM_validateForm(buyer, 'buyer_name','Buyer Name','R','by_rq_emailid','Email ID','RisEmail','buyer_country','Country','R', 'by_rq_state','State','R','by_rq_district','District','R','by_rq_phone','Phone','RisNan','by_rq_requirement','Requirement','R'))
	{
		return true;
	} else{
		return false;
	}
}
	
function feedbak_user(feedbak)
{
	if(MM_validateForm(feedbak, 'feed_name','Name','R','feed_phone','Phone','RisNan','feed_country','Country','R', 'feed_state','State','R','feed_city','District','R','feed_email_id','Email ID','RisEmail'))
	{
		return true;
	} else{
		return false;
	}
}
	
function check_asktheexp(asktheexp)
{
	if(MM_validateForm(asktheexp, 'ask_name','Name','R','ask_add','Address','R','ask_country_id','Country','R','ask_state_id','State','R','ask_city_id','City','R','ask_emailid','Email ID','RisEmail','ask_phno','Phone','RisNan','ask_mobile','Mobile','RisNan','ask_sub','Subject','R','ask_relation','Related Question','R','ask_que_comm','Comment','R'))
	{
		return true;
	} else{
		return false;
	}
}
	
var http_request = false;
var tempTxt;
function makeRequest(url,txt,strVariables) 
	{
	
	http_request = false;
	tempTxt=txt;
	if (window.XMLHttpRequest)
		{ // Mozilla, Safari,...
			http_request = new XMLHttpRequest();
			if (http_request.overrideMimeType)
			{
			http_request.overrideMimeType('text/xml');
			// See note below about this line
			}
		}
	else if (window.ActiveXObject)
		{ // IE
		try
			{
			http_request = new ActiveXObject("Msxml2.XMLHTTP");
			}
		catch (e)
			{
			try
				{
				http_request = new ActiveXObject("Microsoft.XMLHTTP");
				}
			catch (e)
				{
				}
			}
		}
	if (!http_request)
		{
		alert('Giving up :( Cannot create an XMLHTTP instance');
		return false;
		}
	http_request.open('POST', url, true);
	http_request.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"); 
	http_request.send(strVariables);
	http_request.onreadystatechange = alertContents;
	}

function alertContents()
	{
	
	if (http_request.readyState == 4)
		{
		if (http_request.status == 200)
			{		
				var resul= http_request.responseText;
				document.getElementById(tempTxt).innerHTML=http_request.responseText;
				if(tempTxt=="img")
				{
					var resul= http_request.responseText;
					
					document.getElementById('img').innerHTML=resul;
					
					//document.getElementById('shippingArea').innerHTML=b;
					
					if(resul=='$0.00')
					{
						document.getElementById('img').innerHTML='121';
						//document.getElementById('display').style.display = 'none';
					}
				}
			}
			else
				{
				alert('There was a problem with the request.');
				}
		   }
		else if (http_request.readyState == 1 )
			{
			
			document.getElementById(tempTxt).innerHTML = "sorry";
			
			}
		}
function gallery_img(gal_id)
{
	//var gal_id;
	//alert("gal_id");
	//var property_name=document.form1.property_name.value;
//var categ=document.datashow.categ.value;
	var strVariables = 'action=getimg&gal_id='+gal_id;
	
	//&city='+city+'&categ='+categ+'&fr_id='+fr_id
	makeRequest('prop_gallery.php',"img",strVariables);

}
	
	
function update_events(formname)
{
if(MM_validateForm(formname, 'employee', 'Employee name', 'R','eve_title', 'Event Title', 'R', 'eve_details', 'Event Details', 'R', 'eve_start_date', 'Event Start Date', 'R', 'eve_end_date', 'Event End Date', 'R'))
	{
		return true;
	} else{
		return false;
	}
}


function add_edit_events(formname)
{
if(MM_validateForm(formname, 'employee', 'Employee name', 'R','eve_title', 'Event Title', 'R', 'eve_details', 'Event Details', 'R',  'eve_start_date', 'Event Start Date', 'R', 'eve_end_date', 'Event End Date','R'))
	{
		return true;
	} else{
		return false;
	}
}
	
function update_gala_cat(formname)
{
if(MM_validateForm(formname, 'cat_name','Gallery Category Name','RisAlphaNum'))
	{
		return true;
	} else{
		return false;
	}
}


function add_edit_gala_cat(formname)
{
if(MM_validateForm(formname, 'cat_name','Gallery Category Name','RisAlphaNum', 'txtFile','Gallery Category Image','RisExt'))
	{
		return true;
	} else{
		return false;
	}
}
	function update_gala_sub_cat(formname)
{
if(MM_validateForm(formname, 'cat_parent_id','Gallery Category Name','RisAlphaNum','cat_name','Gallery Sub Category Name','RisAlphaNum'
				   ))
	{
		return true;
	} else{
		return false;
	}
}



	function add_edit_gala_sub_cat(formname)
{
if(MM_validateForm(formname, 'cat_parent_id','Gallery Category Name','RisAlphaNum','cat_name','Gallery Sub Category Name','RisAlphaNum'
				   ,'txtFile','Gallery Sub Category Image','RisExt'))
	{
		return true;
	} else{
		return false;
	}
}

function update_edit_gala(formname)
{
if(MM_validateForm(formname, 'cat_parent_id','Category Name','RisAlphaNum','sub_cat_parent_id','Sub Category Name','RisAlphaNum','gallery_name','Gallery Name','RisAlphaNum'))
	{
		return true;
	} else{
		return false;
	}
}


function add_edit_gala(formname)
{
if(MM_validateForm(formname, 'cat_parent_id','Category Name','RisAlphaNum','sub_cat_parent_id','Sub Category Name','RisAlphaNum','gallery_name','Gallery Name','RisAlphaNum','txtFile','Gallery Image','RisExt'))
	{
		return true;
	} else{
		return false;
	}
}






function update_prod_cat(formname)
{
if(MM_validateForm(formname, 'cat_name','Product Category Name','RisAlphaNum'))
	{
		return true;
	} else{
		return false;
	}
}


function add_edit_prod_cat(formname)
{
if(MM_validateForm(formname, 'cat_name','Product Category Name','RisAlphaNum', 'txtFile','Product Category Image','RisExt'))
	{
		return true;
	} else{
		return false;
	}
}


	function update_prod_sub_cat(formname)
{
if(MM_validateForm(formname, 'cat_parent_id','Product Category Name','RisAlphaNum','cat_name','Product Sub Category Name','RisAlphaNum'
				   ))
	{
		return true;
	} else{
		return false;
	}
}



	function add_edit_prod_sub_cat(formname)
{
if(MM_validateForm(formname, 'cat_parent_id','Product Category Name','RisAlphaNum','cat_name','Product Sub Category Name','RisAlphaNum'
				   ,'txtFile','Product Sub Category Image','RisExt'))
	{
		return true;
	} else{
		return false;
	}
}



function update_edit_prod(formname)
{
if(MM_validateForm(formname, 'cat_parent_id', 'Category Name', 'RisAlphaNum', 'sub_cat_parent_id', 'Sub Category Name','RisAlphaNum', 'product_code', 'Product Code', 'RisAlphaNum', 'product_name', 'Product Name', 'RisAlphaNum', 'product_disc_price','Product Discount Price', 'RisNan', 'product_org_price', 'Product price', 'RisNan'))
	{
		return true;
	} else{
		return false;
	}
}


function add_edit_prod(formname)
{
if(MM_validateForm(formname, 'cat_parent_id','Category Name','RisAlphaNum','sub_cat_parent_id','Sub Category Name','RisAlphaNum', 'client_name','Client','RisAlphaNum','product_code', 'Product Code', 'RisAlphaNum', 'product_name', 'Product Name', 'RisAlphaNum', 'product_disc_price','Product Discount Price', 'RisNan', 'product_org_price', 'Product price', 'RisNan', 'txtFile','Product Image','RisExt'))
	{
		return true;
	} else{
		return false;
	}
}


function add_user(formname)
{
if(MM_validateForm(formname, 'user_first_name','First Name','RisAlphaNum','user_last_name','Last Name','RisAlphaNum','user_login_name','User Login Name','RisAlphaNum','user_password','Password','RisAlphaNum','user_company_name','Company Name','isAlphaNum','user_email_address','Email Address','RisEmail','user_address','Address','RisAlphaNum','procountry','Country','R','state','State','R','district', 'District', 'R', 'user_postcode', 'Postcode', 'isNan', 'user_contact_number', 'Phone Number', 'RisNan','user_mobile_number','Mobile Number','isNan'))
	{
		return true;
	} else{
		return false;
	}
}

function add_user1(formname)
{
if(MM_validateForm(formname, 'user_login_name','User Login Name','RisAlphaNum','user_password','Password','RisAlphaNum','user_first_name','First Name','RisAlphaNum','user_last_name','Last Name','RisAlphaNum','user_company_name','Company Name','isAlphaNum','user_email_address','Email Address','RisEmail','user_contact_number1','Phone Number','RisNan','user_mobile_number1','Mobile Number','isNan','user_address','Street Address','RisAlphaNum','procountry','Country','R','state','State','R','district','District','R','user_postcode','Postcode', 'isNan'))
	{
		return true;
	} else{
		return false;
	}
}

function donate_val(formname)
{
if(MM_validateForm(formname, 'donation_amount','Donate Amount','RisAlphaNum','donate_first_name','First Name','RisAlphaNum','donate_last_name','Last Name','RisAlphaNum','donate_address1','Address1','RisAlphaNum','donate_address2','Address2','isAlphaNum','procountry','Country','R','state','State','R','district','District','R','donate_zipcode','Zipcode(Postcode)','RisNan','donate_phone_number','Phone Number','RisNan','donate_email_id','Email Address','RisEmail'))
	{
		return true;
	} else{
		return false;
	}
}


function edit_use(formname)
{
if(MM_validateForm(formname, 'user_login_name1','User Login Name','RisAlphaNum','user_password1','Password','RisAlphaNum','user_first_name1','First Name','RisAlphaNum','user_last_name1','Last Name','RisAlphaNum','user_company_name1','Company Name','isAlphaNum','user_email_address1','Email Address','RisEmail','user_contact_number1','Phone Number','RisNan','user_mobile_number1',' Mobile Number','isNan','user_address1','Street Address','RisAlphaNum','procountry','Country','R','state','State','R','district','District','R','user_postcode1','Postcode', 'isNan'))
	{
		return true;
	} else{
		return false;
	}
}

function add_employee(formname)
{	
if(MM_validateForm(formname, 'emp_first_name', 'First Name', 'RisAlphaNum', 'emp_last_name', 'Last Name', 'RisAlphaNum','emp_login_name', 'Employee Login Name', 'RisAlphaNum', 'emp_password', 'Password', 'R',  'emp_email_address', 'Email Address', 'RisEmail', 'emp_address', 'Address', 'RisAlphaNum', 'procountry', 'Country', 'R', 'state', 'State', 'R','district','District', 'R','emp_postcode','Postcode', 'isNan', 'emp_contact_number', 'Phone Number', 'RisNan', 'emp_mobile_number', 'Mobile Number','isNan'))
	{	
		return true;
	} else{
		return false;
	}
}

function add_emp(formname)
{	
if(MM_validateForm(formname, 'emp_email_address1', 'Email Address', 'RisEmail', 'emp_contact_number1', 'Phone Number', 'RisNan', 'emp_mobile_number1', 'Mobile Number','isNan','emp_address1', 'Street Address', 'RisAlphaNum', 'procountry', 'Country', 'R', 'state', 'State', 'R','district',' District', 'R','emp_postcode1','Postcode', 'RisNan'  ))
	{	
		return true;
	} else{
		return false; 
	}
}

function add_client(formname)
{
if(MM_validateForm(formname, 'client_name','Client Name','RisAlphaNum','client_login_name','Client Login Name','RisAlphaNum','client_password','Password','RisAlphaNum','client_email_address','Email Address','RisEmail', 'phone_number','Phone Number','RisNan','mobile_number','Mobile Number', 'isNan','client_address','Address','RisAlphaNum','procountry', 'Country', 'R', 'state', 'State', 'R','district','District', 'R','client_postcode','Postcode', 'isNan'))
	{
		return true;
	} else{
		return false;
	}
}

function edit_clien(edit_client)
{ 
if(MM_validateForm(edit_client, 'client_email_address1','Email Address','RisEmail', 'phone_number1','Phone Number','RisNan','mobile_number1', 'Mobile Number', 'isNan', 'client_address1', 'Street Address', 'RisAlphaNum', 'procountry', 'Country', 'R', 'state', 'State', 'R','district','District', 'R','client_postcode1','Postcode', 'isNan'))
	{
		return true;
	} else{
		return false;
	}
}
function add_content(formname)
{
if(MM_validateForm(formname, 'content_title','Title','R','content_title_alias','Title Alias','R','content_description','Description','R','content_keyword','Keyword','R'))
	{
		return true;
	} else{
		return false;
	}
}
function update_publication(formname)
{
if(MM_validateForm(formname, 'book_name','Book Title','RisAlphaNum','book_desc','Description','R','book_upload', 'Upload Book File','isExte','txtFile','Upload Book Cover','isExt'))
	{
		return true;
	} else{
		return false;
	}
}
function add_publication(formname)
{
if(MM_validateForm(formname, 'book_name','Book Title','R','book_desc','Description','R','book_upload', 'Upload Book File','RisExte','txtFile','Upload Book Cover','RisExt'))
	{
		return true;
	} else{
		return false;
	}
}


function add_news(formname)
{
if(MM_validateForm(formname, 'news_template_name','Template Name','R','news_description','Description','R','news_from_name','From Name','R','content_t','Body Text','R'))
	{
		return true;
	} else{
		return false;
	}
}

function valid_edit_user_profile(formname)
{
		if(MM_validateForm(formname, 'user_login_name1','Login Id','R','user_password1','Password','R','user_first_name1','User first name','R', 'user_last_name1','User Last Name','R','user_address1','User Address','R','user_phone_no1','User Phone No','RisNan','user_email_id1','User Email ID','RisEmail'))
	{
		return true;
	} 
	else
	{
		return false;
	}
 }
 
 function valid_link(formname)
{
		if(MM_validateForm(formname, 'link_name','Link Name','R','employee','Employee name','R','page_desc','Page Description','R'))
	{
		return true;
	} 
	else
	{
		return false;
	}
 }
  function valid_link1(formname)
{
	if(MM_validateForm(formname, 'page_description','Page Description','R','short_description','Short Description','R'))
	{
		return true;
	} 
	else
	{
		return false;
	}
 }
 
 function valid_registration(formname)
{
		if(MM_validateForm(formname, 'user_name','User Name','R','user_pass','Password','R','user_first_name','User first name','R', 'user_last_name','User Last Name','R','user_email_id','User Email ID','RisEmail','user_phone','User Phone No','RisNan','user_street','User Address','R','procountry','Country','R','procountry','Country','R','state','State','R','district','District','R','user_post_code','Post Code','isNan'))
	{
		return true;
	} 
	else
	{
		return false;
	}
 }
 
  function valid_login(formname)
{
		if(MM_validateForm(formname, 'sel_user','User Type','R','user','User Name','R', 'Password','Password','R'))
	{
		return true;
	} 
	else
	{
		return false;
	}
 }

  function valid_log(formname)
{
		if(MM_validateForm(formname, 'sel_user','User Type','R','user','User Name','R', 'Password','Password','R'))
	{
		return true;
	} 
	else
	{
		return false;
	}
 }


function forgot_password(formname)
{
		if(MM_validateForm(formname, 'sel_user','Select User','R','email','Email','RisEmail'))
	{
		return true;
	} 
	else
	{
		return false;
	}
 }
 
 function add_edit_news(formname)
{
if(MM_validateForm(formname, 'employee', 'Employee name', 'R','news_title', 'News Title', 'R', 'news_desc', 'News Details', 'R',  'news_date', 'News  Date', 'R'))
	{
		return true;
	} else{
		return false;
	}
}
	
	function valid_add_qty(formname)
{
	if(MM_validateForm(formname, 'qty','Quantity','RisNaN'))
	{
		return true;
	} else{
		return false;
	}
}
 function valid_list(email)
{
if(MM_validateForm(email, 'news_ids', 'News Template name', 'R'))
	{
		return true;
	} else{
		return false;
	}
}
function valid_check_out(formname)
{
	if(MM_validateForm(formname, 'first_name','First Name','RisAlphaNum', 'last_name', 'Last Name' ,'RisAlphaNum', 'email_id', 'Email Address', 'RisEmail', 'phone', 'Phone', 'RisNaN', 'mobile_no', 'Mobile', 'isNaN', 'user_address', 'Address1', 'RisAlphaNum'))
	{
		return true;
	} else{
		return false;
	}
}
function update_file(formname)
{
	if(MM_validateForm(formname, 'client_auto_id','Client Name','R','client_file_name','File Name','R','file_desc','File Description','R'))
	{
		return true;
	} else{
		return false;
	}
}

function addedit_file(formname)
{
	if(MM_validateForm(formname,  'client_auto_id','Client Name','R','client_file_name','File Name','R','txtFile','Upload File','R','file_desc','File Description','R'))
	{
		return true;
	} else{
		return false;
	}
}

function valid_search(formname)
{
		if(MM_validateForm(formname,  'search_type','Search','R'))
	{
		return true;
	} 
	else
	{
		return false;
	}
 }
 
 function valid_file(formname)
{
	if(MM_validateForm(formname, 'client_file_name','Name','R','file_desc','Description','R','txtFile','Upload File','R'))
	{
		return true;
	} else{
		return false;
	}
}


function add_request(formname)
{
if(MM_validateForm(formname, 'name1','Name','R','subject','Subject','RisAlphaNum','email','Email Address','RisEmail','address','Address','R','messages','Message','R'))
	{
		return true;
	} else{
		return false;
	}
}
