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 Alphabets 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('isExtNew')!=-1) 
				{	
					pp=val.indexOf('.pdf');
					ss=val.indexOf('.doc');

					aa=val.indexOf('.PDF');
					bb=val.indexOf('.DOC');

			        if ((pp<1 || pp==(val.length-1)) && (ss<1 || ss==(val.length-1))
					&& (aa<1 || aa==(val.length-1)) && (bb<1 || bb==(val.length-1))	
					)
					{
						errors+='- '+nm+' File should be in .doc, .pdf format!.\n';
		
					}
				}

 				else if (test.indexOf('isExt')!=-1) 
				{	
					p=val.indexOf('.jpg');
					s=val.indexOf('.gif');
					q=val.indexOf('.jpeg');
					z=val.indexOf('.png');

					a=val.indexOf('.JPG');
					b=val.indexOf('.GIF');
					c=val.indexOf('.JPEG');
					d=val.indexOf('.PNG');

			        if ((p<1 || p==(val.length-1)) && (s<1 || s==(val.length-1)) && (q<1 || q==(val.length-1)) && (z<1 || z==(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))
					)
					{
						errors+='- '+nm+' File should be in .jpg, .jpeg, .gif, .png 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 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 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 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 Delconfirm(a)
 {
  if(confirm("Are you sure you want to delete this Record?"))
   {
    window.location.href=a;
    return true;
   }
 }

function valid_user_type(usertype)
{
if(MM_validateForm(usertype, 'usertype_name','User Type','RisString'))
	{
		return true;
	} else{
		return false;
	}
}

function valid_emp_type(emptype)
{
if(MM_validateForm(emptype, 'employeetype_name','Employee Type','RisString'))
	{
		return true;
	} else{
		return false;
	}
}

function new_property(property)
{
	if(MM_validateForm(property, 'prop_title','Title','R', 'prop_location','Property Location','R', 'prop_introduction','Description','R', 'prop_address','Address','R'))
	{
		return true;
	} else{
		return false;
	}
}

function chkstate(country) {
	if(MM_validateForm(country, 'pid','Country','R')) {
		return true;
	} else{
		return false;
	}
}

function chkcity(country) {
	if(MM_validateForm(country, 'cpid','Country','R', 'pid','State','R')) {
		return true;
	} else{
		return false;
	}
}

function chklocation(country) {
	if(MM_validateForm(country, 'lpid','Country','R', 'spid','State','R', 'pid','City','R')) {
		return true;
	} else{
		return false;
	}
}

function new_property1(property)
{
	if(MM_validateForm(property, 'prop_title','Title','R', 'prop_location','Property Location','R', 'prop_introduction','Description','R', 'prop_state_id','Satate','R', 'prop_district_id','District','R','prop_address','Address','R'))
	{
		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_testimonial(frm)
{
	if(MM_validateForm(frm, 'testimonial_title','Name','R', 'testimonial_desc','Testimonial','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 valid_user_login(gallery)
{
	if(MM_validateForm(gallery, 'user_login_name','User Id','R', 'user_password','User Password','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 chkadminfields(formname) {
	if(MM_validateForm(formname, 'user_login_name','User Id','R', 'user_password', 'Password', 'RisEqualre_user_password:Confirm Retype Password','user_email_id','Email Id','RisEmail')) {
		return true;
	} else {
		return false;
	}
}

function check_logo(logo)
{
	if(MM_validateForm(logo, 'logo_name','Logo Name','R', 'logo_url', 'Logo Url', 'isUrl','logo_img1','Logo Image','R'))
	{
		return true;
	} else{
		return false;
	}
}

function check_logo1(logo)
{
	if(MM_validateForm(logo, 'logo_name','Logo Name','R','logo_url', 'Logo Url', 'isUrl'))
	{
		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, 'name','Name','R', 'contact_phone','Phone Number','RisNan', 'contact_email_id','Email ID','RisEmail', 'query', 'Query', '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 subscribe_news(formname)
{
	if(MM_validateForm(formname,  'email','Subscribe Email','RisEmail'))
	{
		return true;
	} else{
		return false;
	}
}




	
function chkcontact(formname)
{
	if(MM_validateForm(formname, 'feet_cname', 'Name','RisAlphaNum', 'feed_cemail_id','Email ID','RisEmail','senderTelephone', 'Telephone No.','RisNan', 'feed_cmobile', 'Mobile', 'RisNan', 'feed_desc', 'Massage', 'RisAlphaNum'))
	{
		return true;
	} else{
		return false;
	}
}	

function check_enquiry(formname)
{
	if(MM_validateForm(formname, 'name', 'Name','R', 'contact_phone','Phone No','RisNan','contact_email_id', 'Email Address','RisEmail', 'query', 'Query', 'R'))
	{
		return true;
	} else{
		return false;
	}
}	

function check_sendtofriend(sendurl)
{
	if(MM_validateForm(formname, 'name', 'Name','R', 'contact_phone','Phone No','RisNan','contact_email_id', 'Email Address','RisEmail', 'query', 'Query', 'R'))
	{
		return true;
	} else{
		return false;
	}
}

function chkimportprop(formname) {
	if(MM_validateForm(formname, 'country_auto_id', 'Country','R', 'state_auto_id','State','R','city_auto_id', 'City','R', 'location_auto_id', 'Location', 'R', 'prop_type_auto_id', 'Property Type', 'R', 'csvfile', 'Select File', 'R')) {
		return true;
	} else{
		return false;
	}
}

function chkbuilder(formname) {
	if(MM_validateForm(formname, 'country_auto_id', 'Country','R', 'state_auto_id','State','R','city_auto_id', 'City','R', 'location_auto_id', 'Location', 'R', 'csvfile', 'Select File', 'R')) {
		return true;
	} else{
		return false;
	}
}

function chksearch(formname) {
	if(MM_validateForm(formname, 'country_auto_id', 'Country','R', 'state_auto_id','State','R','city_auto_id', 'City','R', 'location_auto_id', 'Location', 'R'))
	{
		return true;
	} else{
		return false;
	}
}

function validate_download(formname)
{
	if(MM_validateForm(formname, 'title', 'Title','R', 'file_name', 'Down Load File','R'))
	{
		return true;
	} else{
		return false;
	}
}	

function check_edit_floor(formname)
{
	if(MM_validateForm(formname, 'floor_img_name', 'Image Name','R', 'floor_image1', 'Uploaded Image','R'))
	{
		return true;
	} else{
		return false;
	}
}	
function check_edit_floor1(formname)
{
	if(MM_validateForm(formname, 'floor_img_name', 'Image Name','R'))
	{
		return true;
	} else{
		return false;
	}
}	


function addedit_user(newuser)
{
	if(MM_validateForm(newuser, 'first_name','User First Name','R', 'last_name','User Last Name','R','user_id','User ID','R','usr_pass','Password','R','area_code','Area Code','RisNan','mobile_no','Mobile No.','RisNan','country_code','Country Code','RisNan','comp_area_code','Area Code','RisNan','residance_phone','Residance Phone','RisNan','usr_email','Email ID','RisEmail', 'usr_address', 'Adress', 'R', 'st_phone', 'State Code in Phone', 'RisNan', 'user_phoneno','Phone','RisNan', 'con_mobile', 'Country Code in Mobile No.', 'RisNan', 'user_mobileno','Mobile','RisNan', 'user_website','Web Site','isUrl', 'user_photo','User Photo','isExt','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 addedit_user1(newuser)
{
	if(MM_validateForm(newuser, 'user_id','User ID','R', 'user_pwd', 'Password', 'RisEqualre_user_pwd:Confirm Retype Password', 'user_type_auto_id','User Type','R', 'user_name','User Name','R', 'user_emailadd','Email ID','RisEmail', 'con_phone', 'Country Code in Phone', 'RisNan', 'st_phone', 'State Code in Phone', 'RisNan', 'user_phoneno','Phone','RisNan', 'con_mobile', 'Country Code in Mobile No.', 'RisNan', 'user_mobileno','Mobile','RisNan', 'user_website','Web Site','isUrl', 'user_photo','User Photo','isExt', '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 user_registration(newuser)
{
	
	if(MM_validateForm(newuser, 'user_type_auto_id','Employee Type','R','first_name','Employee First Name','R', 'last_name','Employee Last Name','R','user_id','Employee ID','R', 'usr_pass', 'Password', 'RisEqualreusr_pass:Confirm Retype Password','area_code','Area Code','RisNan','mobile_no','Mobile No.','RisNan','usr_email','Email ID','RisEmail', 'usr_address', 'Adress', 'R', 'st_phone', 'State Code in Phone', 'RisNan', 'user_phoneno','Phone','RisNan', 'con_mobile', 'Country Code in Mobile No.', 'RisNan', 'user_mobileno','Mobile','RisNan', 'company_website','Company Web Site','isUrl','country_auto_id','Country','R','state_auto_id','State','R','city_auto_id','City','R','location_auto_id','Location','R'))
	{
		return true;
	} else{
		return false;
	}
}

function user_manage(form2)
{
	
	if(MM_validateForm(form2, 'user_type_id','User Type','R','user_name','User Name','R','user_mobile','Mobile No.','RisNan', 'user_phone', 'Land Line No.', 'RisNan','user_email','Email ID','RisEmail','user_email1','Alternate Email ID','RisEmail', 'user_add', 'Adress', 'R'))
	{
		return true;
	} else{
		return false;
	}
}
function user_admin_registration(newuser)
{
	
	if(MM_validateForm(newuser, 'user_type_auto_id','User Type','R','first_name','User First Name','R', 'last_name','User Last Name','R','user_id','User ID','R','usr_pass','Password','R','area_code','Area Code','RisNan','mobile_no','Mobile No.','RisNan','usr_email','Email ID','RisEmail', 'usr_address', 'Adress', 'R', 'st_phone', 'State Code in Phone', 'RisNan', 'user_phoneno','Phone','RisNan', 'con_mobile', 'Country Code in Mobile No.', 'RisNan', 'user_mobileno','Mobile','RisNan', 'company_website','Company Web Site','isUrl','country_auto_id','Country','R','state_auto_id','State','R','city_auto_id','City','R','location_auto_id','Location','R'))
	{
		return true;
	} else{
		return false;
	}
}
function user_list_prop(newuser) {
	if(MM_validateForm(newuser, 'country_auto_id','Country','R','state_auto_id','State','R','city_auto_id','City','R','location_auto_id','Location','R','builder_auto_id','Builder','R','bldr_project_id','Project','R','prop_type_auto_id','Property Type','R','prop_budget','Asking Price','R','prop_brief_desc','Brief Description','R')) {
		return true;
	} else{
		return false;
	}
}

function admin_list_prop(newuser) {
	if(MM_validateForm(newuser, 'usertype_auto_id','User Type','R','user_auto_id','User','R','country_auto_id','Country','R','state_auto_id','State','R','city_auto_id','State','R','location_auto_id','Location','R','builder_auto_id','Builder Name','R','bldr_project_id','Project','R','prop_type_auto_id','Property Type','R','prop_budget','Asking Price','R')) {
		return true;
	} else{
		return false;
	}
}

function post_requirment(newuser) {
	if(MM_validateForm(newuser, 'usertype_auto_id','User Type','R','user_auto_id','User','R')) {
		return true;
	} else{
		return false;
	}
}

function user_post_requirment(newuser) {
	if(MM_validateForm(newuser, 'country_auto_id','Country','R','state_auto_id','State','R','city_auto_id','City','R','location_auto_id','Location','R','builder_auto_id','Builder','R','prop_floor_no','Floor Type','R','prop_budget','Budget','R')) {
		return true;
	} else{
		return false;
	}
}

function chkassignval(newuser) {
	if(MM_validateForm(newuser, 'user_auto_id','User','R')) {
		return true;
	} else{
		return false;
	}
}
function user_list_other_prop(newuser) {
	if(MM_validateForm(newuser, 'country_auto_id','Country','R','state_auto_id','State','R','city_auto_id','State','R','location_auto_id','Location','R','prop_type_auto_id','Property Type','R','area','Area','R','area_unit','Area Unit','R','prop_price','Property Price','R','prop_per_unit_price','Property per unit','R','transaction_auto_id','Transaction Type','R')) {
		return true;
	} else{
		return false;
	}
}


function sub_newslater_email(newuser)
{
	if(MM_validateForm(newuser, 'user_type_auto_id','User Type','R','full_name','Full Name','R','email','Email','RisEmail'))
	{
		return true;
	} else{
		return false;
	}
}

function valid_newsl(newuser)
{
	if(MM_validateForm(newuser, 'email_ids','Email Id','R','subject','Subject','R','from','From','R','temp_id','Templates','R','mess','Message','R'))
	{
		return true;
	} else{
		return false;
	}
}

function user_prop_sub(newuser)
{
	if(MM_validateForm(newuser, 'usertype_auto_id','User Type','R','user_auto_id','User','R','prop_type_auto_id','Property Type','R','country_auto_id','Country','R','state_auto_id','State','R','city_auto_id','State','R','location_auto_id','Location','R','area','Area','RisNan','area_unit','Area Unit','R','prop_price','property price','R','prop_per_unit_price','Property per unit price','R','transaction_auto_id','Transaction type','R'))
	{
		return true;
	} else{
		return false;
	}
}

function builder_prop_sub(newuser)
{
	//'owner_prop','Select Property For','R',  
	if(MM_validateForm(newuser, 'country_auto_id','Country','R','state_auto_id','State','R','city_auto_id','State','R','location_auto_id','Location','R','prop_type_auto_id','Property type','R','builder_prop_name','Builder Property Name','R','builder_auto_id','Builder Name','R','manage_amenities','Short Description','R'))
	{
		return true;
	} else{
		return false;
	}
}



function valid_apply_form(formname) {
	 
		if(MM_validateForm(formname, 'txtname','Name','R','txtMobile','Mobile','RinRange','txtEmail','Email','RisEmail')){
			return true;
		} else {
			return false;
		}
}
function valid_requirement_form(formname) {
	 
		if(MM_validateForm(formname, 'prop_district_id','District','R','txtArea','Menimum Area','R','txtArea3','Name','R','txtEmail','Email','RisEmail','txtMobile','Mobile','RinRange')){
			return true;
		} else {
			return false;
		}
}
function valid_property_form(formname) {
	 
		if(MM_validateForm(formname, 'prop_title','Property Name','R','prop_district_id','District','R','prop_image','Property Image ','isExt','prop_logo','Property Logo ','isExt','prop_location','Property Location','R','ownername','Owner Name','R','ownermobile','Owner Mobile','RinRange','owneremail','Owner Email','RisEmail')){
			return true;
		} else {
			return false;
		}
}
function check_banner1(formname) {
	 
		if(MM_validateForm(formname, 'banner_title','Banner Title','R','banner_url','Banner Url','RisUrl')){
			return true;
		} else {
			return false;
		}
}
function check_banner(formname) {
	 
		if(MM_validateForm(formname, 'banner_title','Banner Title','R','banner_url','Banner Url','RisUrl','banner_img1','Banner Image','RisExt')){
			return true;
		} else {
			return false;
		}
}

function check_asktheexp(asktheexp)
{
	if(MM_validateForm(asktheexp, 'ask_name','Name','R','ask_add','Address','R','ask_city_id','City','R','ask_emailid','Email ID','RisEmail','ask_mobile','Mobile','RisNan','ask_sub','Subject','R','ask_que_comm','Query','R'))
	{
		return true;
	} else{
		return false;
	}
}



function valid_contactus(formname)
{
	if(MM_validateForm(formname,  'name','Name','RisAlphaNum', 'address','Address','RisAlphaNum', 'city','City','RisAlphaNum', 'state','State','RisAlphaNum', 'zip','Zip','RisAlphaNum', 'country','Country','RisAlphaNum', 'phone','Phone','RisAlphaNum', 'email','Email','RisEmail', 'comments','Comments','RisAlphaNum'))
	{
		return true;
	} else{
		return false;
	}
}





function check_addCountry(formname)
{
	if(MM_validateForm(formname,  'cname','Country Name','RisString'))
	{
		return true;
	} else{
		return false;
	}
}



function check_proptype(formname)
{
	if(MM_validateForm(formname, 'prop_main_type_auto_id','Property Type Categories','R', 'prop_type_name','Property Type','RisString'))
	{
		return true;
	} else{
		return false;
	}
}

function check_proptypeCat(formname)
{
	if(MM_validateForm(formname, 'prop_main_type_name','Name of Society','RisString' ))
	{
		return true;
	} else{
		return false;
	}
}



function check_builder(formname)
{
	if(MM_validateForm(formname,  'country_auto_id','Country','R' ,'state_auto_id','State','R', 'city_auto_id', 'City', 'R', 'district', 'Location', 'R' ,'user_id','Builder Name','RisAlphaNum', 'builder_logo', 'Builder Logo', 'R'))
	{
		return true;
	} else{
		return false;
	}
}
function check_builder1(formname)
{
	if(MM_validateForm(formname,  'country_auto_id','Country','R' ,'state_auto_id','State','R', 'city_auto_id', 'City', 'R', 'district', 'Location', 'R' ,'user_id','Builder Name','RisAlphaNum'))
	{
		return true;
	} else{
		return false;
	}
}

function formchange()
{
		
	var drd=document.post_req.looking_for.value;
	

	if(drd==2)
	{
	window.location.href="post_kothi_rent_management.php?"+"b="+"Yes&nv="+5+"&mode="+2;
	}else if(drd==1)
	{
	window.location.href="rent_management.php?"+"b="+"Yes&nv="+5+"&mode="+1;
	}else if(drd==3)
	{
	window.location.href="post_comm_rent_management.php?"+"b="+"Yes&nv="+5+"&mode="+3;
	}else if(drd==4)
	{
	window.location.href="post_indus_rent_management.php?"+"b="+"Yes&nv="+5+"&mode="+4;
	}

}

function formchange1()
{
	
	var drd=document.post_req.looking_for.value;
	

	if(drd==2)
	{
	window.location.href="require_kothi_rent_management.php?"+"b="+"Yes&nv="+5+"&mode="+2;
	}else if(drd==1)
	{
	window.location.href="require_flat_rent_management.php?"+"b="+"Yes&nv="+5+"&mode="+1;
	}else if(drd==3)
	{
	window.location.href="require_comm_rent_management.php?"+"b="+"Yes&nv="+5+"&mode="+3;
	}else if(drd==4)
	{
	window.location.href="require_indus_rent_management.php?"+"b="+"Yes&nv="+5+"&mode="+4;
	}

}
function formchange2()
{
		
	var drd=document.user_reg.plot_flat.value;
	

	if(drd==1)
	{
	window.location.href="sale_management.php?"+"buy_rent_type="+"Yes&nv="+4+"&mode="+1;
	}else if(drd==2)
	{
	window.location.href="post_plot_sale_management.php?"+"buy_rent_type="+"Yes&nv="+4+"&mode="+2;
	}else if(drd==3)
	{
	window.location.href="post_plot_comm_sale_management.php?"+"buy_rent_type="+"Yes&nv="+4+"&mode="+3;
	}else if(drd==4)
	{
	window.location.href="post_plot_indus_sale_management.php?"+"buy_rent_type="+"Yes&nv="+4+"&mode="+4;
	}else if(drd==5)
	{
	window.location.href="post_plot_comm1_sale_management.php?"+"buy_rent_type="+"Yes&nv="+4+"&mode="+5;
	}else if(drd==6)
	{
	window.location.href="post_kothi_sale_management.php?"+"buy_rent_type="+"Yes&nv="+4+"&mode="+6;
	}

}
function formchange3()
{
	
		
	var drd=document.user_reg.plot_flat.value;
	
	if(drd==1)
	{
	window.location.href="require_flat_sale_management.php?"+"buy_rent_type="+"Yes&nv="+4+"&mode="+1;
	}else if(drd==2)
	{
	window.location.href="require_plot_sale_management.php?"+"buy_rent_type="+"Yes&nv="+4+"&mode="+2;
	}else if(drd==3)
	{
	window.location.href="require_plot_comm_sale_management.php?"+"buy_rent_type="+"Yes&nv="+4+"&mode="+3;
	}else if(drd==4)
	{
	window.location.href="require_plot_indus_sale_management.php?"+"buy_rent_type="+"Yes&nv="+4+"&mode="+4;
	}else if(drd==5)
	{
	window.location.href="require_plot_comm1_sale_management.php?"+"buy_rent_type="+"Yes&nv="+4+"&mode="+5;
	}else if(drd==6)
	{
	window.location.href="require_kothi_sale_management.php?"+"buy_rent_type="+"Yes&nv="+4+"&mode="+6;
	}

}


function hideunhide_tower(elementId_first,elementId_second,elementId_third,elementId_four,elementId_five)
{
var drp=document.proptype.bedrooms.value;

	if(drp==1)
	{
	hideElement_tower (elementId_five);
	hideElement_tower (elementId_four);
	hideElement_tower (elementId_third);
	hideElement_tower (elementId_second);
	showElement_tower (elementId_first);
	}else if(drp==2)
	{
	hideElement_tower (elementId_five);
	hideElement_tower (elementId_four);
	hideElement_tower (elementId_third);
	hideElement_tower (elementId_first);
	showElement_tower (elementId_second);
	}else if(drp==3)
	{
	hideElement_tower (elementId_five);
	hideElement_tower (elementId_four);
	hideElement_tower (elementId_first);
	hideElement_tower (elementId_second);
	showElement_tower (elementId_third);
	}else if(drp==4)
	{
	hideElement_tower (elementId_five);
	hideElement_tower (elementId_third);
	hideElement_tower (elementId_first);
	hideElement_tower (elementId_second);
	showElement_tower (elementId_four);
	}else if(drp==5)
	{
	hideElement_tower (elementId_four);
	hideElement_tower (elementId_third);
	hideElement_tower (elementId_first);
	hideElement_tower (elementId_second);
	showElement_tower (elementId_five);
	}
	else if(drp=="")
	{
	hideElement_tower (elementId_four);
	hideElement_tower (elementId_third);
	hideElement_tower (elementId_first);
	hideElement_tower (elementId_second);
	hideElement_tower (elementId_five);
	
	}


}

function hideElement_tower (elementId2) {

	var element;
	if (document.all)
	element = document.all[elementId2];
	else if (document.getElementById)
	element = document.getElementById(elementId2);
	if (element && element.style)
	element.style.display = 'none';
	
}

function showElement_tower (elementId) {
	
	var element;
	if (document.all)
	element = document.all[elementId];
	else if (document.getElementById)
	element = document.getElementById(elementId);
	if (element && element.style)
	element.style.display = '';
	
	
}


function valid_news(formname)
{
	if(MM_validateForm(formname,  'newslatter','Email','RisEmail'))
	{
		return true;
	} else{
		return false;
	}
}

function usr_valid(formname)
{
	if(MM_validateForm(formname,  'user_email_id','Email','RisEmail'))
	{
		return true;
	} else{
		return false;
	}
}

function usr_valid(formname)
{
	if(MM_validateForm(formname,  'user_email_id','Email','R'))
	{
		return true;
	} else{
		return false;
	}
}


function regisr_usre_valid(formname)
{
	
	if(MM_validateForm(formname,  'userty','User Type','R','user_name','User Name','R','contact_person','Contact Person','R' ,'mob_no','Mobile No.','RisAlphaNum', 'country_auto_id', 'Country', 'R' ,'state_auto_id','State','R', 'city_auto_id', 'City', 'R', 'location_auto_id', 'Location', 'RisAlphaNum' ))
	{
		return true;
	} else{
		return false;
	}
}


function hideunhide_post(elementId_login,elementId_register,val)
{
	if(val=='log')
	{
	hideElement_post (elementId_register);
	showElement_post (elementId_login);
	}else {
		
	hideElement_post (elementId_login);
	showElement_post (elementId_register);		
		
		}


}

function hideElement_post (elementId_login) {

	var element;
	if (document.all)
	element = document.all[elementId_login];
	else if (document.getElementById)
	element = document.getElementById(elementId_login);
	if (element && element.style)
	element.style.display = 'none';
	
}

function showElement_post (elementId_register) {
	
	var element;
	if (document.all)
	element = document.all[elementId_register];
	else if (document.getElementById)
	element = document.getElementById(elementId_register);
	if (element && element.style)
	element.style.display = '';
	
	
}
	
function formchange_required_required(uid)
{
	var drd=document.post_req.prop_type_auto_id.value;
	
	if(drd==1)
	{
	window.location.href="buying_request.php?mode=1&uid="+uid;
	}else if(drd==2) {
	window.location.href="buying_request.php?mode=2&uid="+uid;
	}else if(drd==3) {
	window.location.href="buying_request.php?mode=3&uid="+uid;
	}else if(drd==4) {
	window.location.href="buying_request.php?mode=4&uid="+uid;
	}
}



function valid_contact(frm_contact)
{
	if(MM_validateForm(frm_contact,  'contact_name','Name','R' ,'contact_mobile','Mobile No','RisAlphaNum', 'contact_email','Email','RisEmail', 'contact_message', 'Message','R' ))
	{
		return true;
	} else{
		return false;
	}
}


function hideunhide_blog(blgid,oc,id)
{
	if(oc=='open')
	{
	showElement_blog (blgid);
	}else if(oc=='close'){
	hideElement_blog (blgid);
		}else{
			hideElement_blog (blgid);
			}


}

function hideElement_blog (blgid) {



	var element;
	if (document.all)
	element = document.all[blgid];
	else if (document.getElementById)
	element = document.getElementById(blgid);
	if (element && element.style)
	element.style.display = 'none';
	
}

function showElement_blog (blgid) {
	
	var element;
	if (document.all)
	element = document.all[blgid];
	else if (document.getElementById)
	element = document.getElementById(blgid);
	if (element && element.style)
	element.style.display = '';
	
	
}
function post_comment(frm_contact)
{
	if(MM_validateForm(frm_contact,  'comment','Comment','R'))
	{
		return true;
	} else{
		return false;
	}
}
function post_blog(frm_contact)
{
	if(MM_validateForm(frm_contact,  'blg_title','Title','R', 'blg_desc','Description','R'))
	{
		return true;
	} else{
		return false;
	}
}

function add_topic_valid(frm_contact,uid)
{
	if(uid!="")
	{
		if(MM_validateForm(frm_contact,  'subject','Topic Name','R'))
		{
			return true;
		} else{
			return false;
		}
	}else {
		
		alert("Please login then comment here! ");
		return false;
		}
}



function formchange_post(uid)
{

	var drd=document.post_req.prop_type_auto_id.value;
	

	
	if(drd==1)
	{
	window.location.href="property_posting.php?mode=1&uid="+uid;
	}else if(drd==2) {
	window.location.href="property_posting.php?mode=2&uid="+uid;
	}else if(drd==3) {
	window.location.href="property_posting.php?mode=3&uid="+uid;
	}else if(drd==4) {
	window.location.href="property_posting.php?mode=4&uid="+uid;
	}
	else if(drd==18) {
	window.location.href="property_posting.php?mode=18&uid="+uid;
	}else if(drd==19) {
	window.location.href="property_posting.php?mode=19&uid="+uid;
	}
	
	else if(drd==5 || drd==6 || drd==7 || drd==8 || drd==9 || drd==10 || drd==11 || drd==12 || drd==13 || drd==14 || drd==15 || drd==16 || drd==17 || drd==20) 
	{
	window.location.href="property_posting.php?mode="+drd+"&uid="+uid;
	}
}



function popup_blog_login()
   {
   
   myRef = window.open('popup_login.php','mywin',
'left=20,top=20,width=500,height=150,toolbar=0,resizable=0');

   }
   
   function popup_blog_register()
   {
   
   myRef = window.open('popup_login_register.php','mywin',
'left=20,top=20,width=550,height=350,toolbar=0,resizable=0');

   }
   
   function popup_blog_login_forum(fcid)
   {
   
   
   myRef = window.open('popup_login_forum.php?fcid='+fcid,'mywin',
'left=20,top=20,width=500,height=150,toolbar=0,resizable=0');

   }
   
    function popup_login_forum_reply(fcid,tid)
   {
   
   
   myRef = window.open('popup_login_forum_reply.php?mode=reply&fcid='+fcid+'&tid='+tid,'mywin',
'left=20,top=20,width=500,height=150,toolbar=0,resizable=0');

   }
   
   
   function popup_blog_register_forum()
   {
   
   myRef = window.open('popup_login_register_forum.php','mywin',
'left=20,top=20,width=550,height=350,toolbar=0,resizable=0');

   }
   
   
   
   
   
   
   function post_comment_check(id)
   {
	   if(id=="")
	   {
	   alert("Please login then comment here!");
	   return false;
	   }
	   
 }

function valid_send_friend(frm_contact)
{
	if(MM_validateForm(frm_contact, 'to','To','R', 'from','From','RisEmail', 'message', 'Message','R' ))
	{
		return true;
	} else{
		return false;
		}	
}
	
	
function valid_sms(frm_sms)
{
	if(MM_validateForm(frm_sms, 'mobileno','Mobile','R', 'message','Message','R'))
	{
		return true;
	} else{
		return false;
	}
}	
	
function check_testi(tst)
{

	if(MM_validateForm(tst, 'subject','Name','R', 'address','Company name','R','desc','Description','R'))
	{
		return true;
	} else{
		return false;
	}
}	
	
