
function createRequestObject() 
	{
		var ro;
		var browser = navigator.appName;
		if(browser == "Microsoft Internet Explorer")
			{
				ro = new ActiveXObject("Microsoft.XMLHTTP");
			}
		else
			{
				ro = new XMLHttpRequest();
			}
		return ro;
	}


//-----------------------------------------------------FUNCTION FOR IMAGE VALIDATION------------------------------

function countChars(oObject,$char,$mozChar)
{
      var i=0;
//      var oObject = document.getElementById("txtPropertyDescription");
      
      var len=oObject.value.length;
	  //alert(len);
      if (len > 1000)
      {
		 if($mozChar != null)
		 	{
			  if( $mozChar == 0 || $char == 8 || $mozChar == 13)
				 return true;
              else
           		 return false;
			}
		else
			{
				if($char == 13) 
					return true; 
				else  
				 return false; 
			}
      }
      else            
            window.document.getElementById("charcount").value=1000-len
}

function deletepropimage(propid)
	{
		document.getElementById("deleteimgid").value=propid;
		window.document.frmDelete.submit();
	}

function funputResponseEmail(email)
	{
	document.getElementById("txtResponseEmailId").value=email.value;
	}


function deletepropimage(propid)
	{
		document.getElementById("deleteimgid").value=propid;
		window.document.frmDelete.submit();
	}

function funCalSubcat(category,subcat)
	{
	var catId=category.value;	
	var subcatid = subcat.value;
	httpfd = createRequestObject();
	document.getElementById("subcat").innerHTML='';
	var url =surl+"ajaxcode.php?catid="+catId+"&ajaxfor=subcategory"+"&subcatid="+subcatid;
	httpfd.open('get', url);
	httpfd.onreadystatechange = handleResponsefindir;
	httpfd.send(null);
	}

function handleResponsefindir()
	{
	if(httpfd.readyState==4)
		{
		if(httpfd.status==200)
			{ 
			document.getElementById("divsubcat").style.display="block";
			SResponse1=httpfd.responseText;
			document.getElementById("subcat").innerHTML=SResponse1;
			}
		}
	}
	
function selectCategory(subcateory)
	{
	var subcatId=subcateory.value;		
	document.getElementById("hidecategoryid").value=subcatId;
	}
	
