

function onchangeof_pricetype1(){
  
if(document.getElementById('sale-let').value=='Sale'){
	document.getElementById('sale_price_dropdowN1').style.display='inline';
	document.getElementById('let_price_dropdowN1').style.display='none';
	document.getElementById('leT').name='price2-min';
	document.getElementById('leT1').name='price2-max';
	document.getElementById('salE').name='price1-min';
	document.getElementById('salE1').name='price1-max'

	
}else if(document.getElementById('sale-let').value=='Let'){
	document.getElementById('sale_price_dropdowN1').style.display='none';
	document.getElementById('let_price_dropdowN1').style.display='inline';
	document.getElementById('salE').name='price2-min';
	document.getElementById('salE1').name='price2-max';
	document.getElementById('leT').name='price1-min';
	document.getElementById('leT1').name='price1-max'
}
}
function onchangeof_pricetype(){

	if(document.getElementById('saleRlet').value=='Sale'){
		document.getElementById('sale_price_dropdown').style.display='inline';
		document.getElementById('let_price_dropdown').style.display='none';
		document.getElementById('let').name='price2-min';
		document.getElementById('let1').name='price2-max';
		document.getElementById('sale').name='price1-min';
		document.getElementById('sale1').name='price1-max'

		//alert(document.getElementById('let1').name);
	}else if(document.getElementById('saleRlet').value=='Let'){
		document.getElementById('sale_price_dropdown').style.display='none';
		document.getElementById('let_price_dropdown').style.display='inline';
		document.getElementById('sale').name='price2-min';
		document.getElementById('sale1').name='price2-max';
		document.getElementById('let').name='price1-min';
		document.getElementById('let1').name='price1-max'
	}


	}


function load1(){
	
if(document.getElementById('salE'))
	document.getElementById('salE').name='price1-min';
if(document.getElementById('salE1'))
document.getElementById('salE1').name='price1-max'

	if(document.getElementById('sale'))
		document.getElementById('sale').name='price1-min';

	if(document.getElementById('sale1'))
		document.getElementById('sale1').name='price1-max'

		
			
	if(document.getElementById('let'))		
    	document.getElementById('let').name='price2-min';
    
	if(document.getElementById('let1'))
		document.getElementById('let1').name='price2-max';
if(document.getElementById('leT'))
	document.getElementById('leT').name='price2-min';
if(document.getElementById('leT1'))
	document.getElementById('leT1').name='price2-max';

	
	
	
}

//-------------confirm delete box for admin view sign up---------//

//-------------confirm delete box for admin view sign up---------//
	var xmlHttp
	function checkForm(str, id)
	{
		
	   xmlHttp=GetXmlHttpObject()
	   if (xmlHttp==null)
	   {
	       alert ("Browser does not support HTTP Request")
	       return
	    }
	    
	   var url="urlajax.php?q="+Trim(str)+"&id="+id;
	   xmlHttp.onreadystatechange = function()
	    {
	       if(xmlHttp.readyState==4){
	  	     
	         text = xmlHttp.responseText
	          document.getElementById(id).style.borderColor = text.substring(0,7);
	         document.getElementById(id+"v").innerHTML = text.substring(8)
	       }
	   }
	   xmlHttp.open("GET",url,true)
	   xmlHttp.send(null)
	}
	

	function GetXmlHttpObject()
	{
	   var xmlHttp=null;
	   try
	    {
	      xmlHttp=new XMLHttpRequest();
	    }
	   catch (e)
	    {
	       try
	        {
	           xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
	        }
	       catch (e)
	        {
	           xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
	        }
	    }
	   return xmlHttp;
	}
	function ids(id,value){
		if(value==true){
		 return document.getElementById(id).value;
		}
		else{
			return document.getElementById(id);
		}
		}

	function validateform()
	{

		var error=0;		
	if (ids('fname',true)=='')  {
//	  	 ids('fname',false).style.border="1px solid #FF0000";
			ids('fnamev',false).innerHTML="<span class=\"system negative\">Please Enter the Firstname.</span>";
			error=1;
		}
	if (ids('fname',true)!='') {
		if(document.getElementById('fname_valid')==undefined){
//			ids('fname',false).style.border="1px solid #FF0000";
			ids('fnamev',false).innerHTML="<span class=\"system negative\">Please Enter the Firstname.</span>";
			error=1;
			}
		else{
		if (document.getElementById('fname_valid').value == 'no'){
//		ids('fname',false).style.border="1px solid #FF0000";
		ids('fnamev',false).innerHTML="<span class=\"system negative\">Please Enter the Firstname.</span>";
		error=1;
				}
		}
	}
	
//	if (ids('sname',true)=='')  {
//	  	 ids('sname',false).style.border="1px solid #FF0000";
//			ids('snamev',false).innerHTML="<img src=\"admin/img/false.png\" />Please Enter the Secondname.";
//			error=1;
//		}
//	if (ids('sname',true)!='') {
//		if(document.getElementById('sname_valid')==undefined){
//			ids('sname',false).style.border="1px solid #FF0000";
//			ids('snamev',false).innerHTML="<img src=\"admin/img/false.png\" />Please Enter the Secondname.";
//			error=1;
//			}
//		else{
//		if (document.getElementById('sname_valid').value == 'no'){
//		ids('sname',false).style.border="1px solid #FF0000";
//		ids('snamev',false).innerHTML="<img src=\"admin/img/false.png\" />Please Enter the Secondname.";
//		error=1;
//				}
//		}
//	}

	if (ids('phno',true)=='')  {
//	  	 ids('phno',false).style.border="1px solid #FF0000";
			ids('phnov',false).innerHTML="<span class=\"system negative\">Please Enter the Phone number.</span>";
			error=1;
		}
	if (ids('phno',true)!='') {
		if(document.getElementById('phno_valid')==undefined){
//			ids('phno',false).style.border="1px solid #FF0000";
			ids('phnov',false).innerHTML="<span class=\"system negative\">Please Enter the Phone number.</span>";
			error=1;
			}
		else{
		if (document.getElementById('phno_valid').value == 'no'){
//		ids('phno',false).style.border="1px solid #FF0000";
		ids('phnov',false).innerHTML="<span class=\"system negative\">Please Enter the Phone number.</span>";
		error=1;
				}
		}
	}


	
	if (ids('email',true)=='')  {
//	  	 ids('email',false).style.border="1px solid #FF0000";
			ids('emailv',false).innerHTML="<span class=\"system negative\">Please Enter the Email.</span>";
			error=1;
		}
	if (ids('email',true)!='') {
		if(document.getElementById('email_valid')==undefined){
//			ids('email',false).style.border="1px solid #FF0000";
			ids('emailv',false).innerHTML="<span class=\"system negative\">Please Enter the Email.</span>";
			error=1;
			}
		else{
		if (document.getElementById('email_valid').value == 'no'){
//		ids('email',false).style.border="1px solid #FF0000";
		ids('emailv',false).innerHTML="<span class=\"system negative\">Please Enter the Email.</span>";
		error=1;
				}
		}
	}

	
	
	if(error == 0){
        return true;
	}else{
		return false;
	}
	}
	function validatephone(xxxxx) {
		var maintainplus = '';
		var numval = xxxxx.value
		if ( numval.charAt(0)=='+' ){ var maintainplus = '+';}
		curphonevar = numval.replace(/[\\A-Za-z!"£$%^&*+_={};:'@#~,.¦\/<>?|`¬\]\[]/g,'');
		xxxxx.value = maintainplus + curphonevar;
		var maintainplus = '';
		xxxxx.focus;
		}
	function validatename(xxxxx) {
		 var maintainplus = '';
		var numval = xxxxx.value
		if ( numval.charAt(0)=='+' ){ var maintainplus = '+';}
		curphonevar = numval.replace(/[\\0-9!"£$%^&*+_={};:'@#~,.¦\/<>?|`¬\]\[]/g,'');
		xxxxx.value = maintainplus + curphonevar;
		var maintainplus = '';
		xxxxx.focus;
	}
	
	function Trim(str){  
		while(str.charAt(0) == (" ") ){ 
			str = str.substring(1);
	  	}
	  	while(str.charAt(str.length-1) == " " ){ 
	  	  	str = str.substring(0,str.length-1);
	  	}
	  	return str;
	}

	

	function Check(chk)
	{
	
	if(document.myform.Check_All.value=="Check All"){

		if(document.myform.count.value==1){
			
		document.myform.check_list.checked=true;
		document.myform.Check_All.value="Check All";
//		document.myform.Check_All.className="uncheckall_button";
		}else{
		for (i = 0; i < chk.length; i++)
		chk[i].checked = true ;
		document.myform.Check_All.value="Check All";
//		document.myform.Check_All.className="uncheckall_button";
		

		}
	}
	}
	function unchk(chk){
	if(document.myform.Uncheck_All.value=="Uncheck All"){
	
		if(document.myform.count.value==1){
		document.myform.check_list.checked=false;
		document.myform.Uncheck_All.value="Uncheck All";
//		document.myform.Check_All.className="checkall_button";
		}else{
		for (i = 0; i < chk.length; i++)
		chk[i].checked = false ;
		document.myform.Uncheck_All.value="Uncheck All";
//		document.myform.Check_All.className="checkall_button";
	
	}
	}
	
	}
		function chkChecks(){
		isChecked=false
//		alert(document.forms["myform"]["check_list"].length);
		if(document.myform.count.value==1){
			if(document.forms["myform"]["check_list"].checked)
			isChecked=true	
			}else{

			
			for(var i=0;i<document.forms["myform"]["check_list[]"].length;i++){
			if(document.forms["myform"]["check_list[]"][i].checked){
			isChecked=true
			}
			}
		}
		if(isChecked==true){
		document.forms["myform"].submit()
		return(true);
		}
		else{
		alert('Please select a checkbox')
		return(false);
		}
		}

	var xmlHttp
	function checkForm1(str, id)
	{
		
	   xmlHttp=GetXmlHttpObject()
	   if (xmlHttp==null)
	   {
	       alert ("Browser does not support HTTP Request")
	       return
	    }
	    
	   var url="urlajax.php?q="+Trim1(str)+"&id="+id;
	   xmlHttp.onreadystatechange = function()
	    {
	       if(xmlHttp.readyState==4){
	  	     
	         text = xmlHttp.responseText
	          document.getElementById(id).style.borderColor = text.substring(0,7);
	         document.getElementById(id+"v").innerHTML = text.substring(8)
	       }
	   }
	   xmlHttp.open("GET",url,true)
	   xmlHttp.send(null)
	}
	

	function GetXmlHttpObject()
	{
	   var xmlHttp=null;
	   try
	    {
	      xmlHttp=new XMLHttpRequest();
	    }
	   catch (e)
	    {
	       try
	        {
	           xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
	        }
	       catch (e)
	        {
	           xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
	        }
	    }
	   return xmlHttp;
	}
	function ids1(id,value){
		if(value==true){
		 return document.getElementById(id).value;
		}
		else{
			return document.getElementById(id);
		}
		}

	function validateform1()
	{

		var error=0;		
	if (ids1('name',true)=='')  {
//	  	 ids('name',false).style.border="1px solid #FF0000";
			ids1('namev',false).innerHTML="<span class=\"system negative\">Please Enter the Name.</span>";
			error=1;
		}
	if (ids1('name',true)!='') {
		if(document.getElementById('name_valid')==undefined){
//			ids('name',false).style.border="1px solid #FF0000";
			ids1('namev',false).innerHTML="<span class=\"system negative\">Please Enter the Name.</span>";
			error=1;
			}
		else{
		if (document.getElementById('name_valid').value == 'no'){
//		ids('name',false).style.border="1px solid #FF0000";
		ids1('namev',false).innerHTML="<span class=\"system negative\">Please Enter the Name.</span>";
		error=1;
				}
		}
	}
	
	if (ids1('address1',true)=='')  {
//	  	 ids('address1',false).style.border="1px solid #FF0000";
			ids1('address1v',false).innerHTML="<span class=\"system negative\">Please Enter the Address1 field.</span>";
			error=1;
		}
	if (ids1('address1',true)!='') {
		if(document.getElementById('address1_valid')==undefined){
//			ids('address1',false).style.border="1px solid #FF0000";
			ids1('address1v',false).innerHTML="<span class=\"system negative\">Please Enter the Address1 field.</span>";
			error=1;
			}
		else{
		if (document.getElementById('address1_valid').value == 'no'){
//		ids('address1',false).style.border="1px solid #FF0000";
		ids1('address1v',false).innerHTML="<span class=\"system negative\">Please Enter the Address1 field.</span>";
		error=1;
				}
		}
	}

	if (ids1('phno',true)=='')  {
//	  	 ids('phno',false).style.border="1px solid #FF0000";
			ids1('phnov',false).innerHTML="<span class=\"system negative\">Please Enter the Phone number.</span>";
			error=1;
		}
	if (ids1('phno',true)!='') {
		if(document.getElementById('phno_valid')==undefined){
//			ids('phno',false).style.border="1px solid #FF0000";
			ids1('phnov',false).innerHTML="<span class=\"system negative\">Please Enter the Phone number.</span>";
			error=1;
			}
		else{
		if (document.getElementById('phno_valid').value == 'no'){
//		ids('phno',false).style.border="1px solid #FF0000";
		ids1('phnov',false).innerHTML="<span class=\"system negative\">Please Enter the Phone number.</span>";
		error=1;
				}
		}
	}

	if (ids1('postalcode',true)=='')  {
//	  	 ids('postalcode',false).style.border="1px solid #FF0000";
			ids1('postalcodev',false).innerHTML="<span class=\"system negative\">Please Enter the PostalCode.</span>";
			error=1;
		}
	if (ids1('postalcode',true)!='') {
		if(document.getElementById('postalcode_valid')==undefined){
//			ids('postalcode',false).style.border="1px solid #FF0000";
			ids1('postalcodev',false).innerHTML="<span class=\"system negative\">Please Enter the PostalCode.</span>";
			error=1;
			}
		else{
		if (document.getElementById('postalcode_valid').value == 'no'){
//		ids('postalcode',false).style.border="1px solid #FF0000";
		ids1('postalcodev',false).innerHTML="<span class=\"system negative\">Please Enter the PostalCode.</span>";
		error=1;
				}
		}
	}

	
	if (ids1('email',true)=='')  {
//	  	 ids('email',false).style.border="1px solid #FF0000";
			ids1('emailv',false).innerHTML="<span class=\"system negative\">Please Enter the Email.</span>";
			error=1;
		}
	if (ids1('email',true)!='') {
		if(document.getElementById('email_valid')==undefined){
//			ids('email',false).style.border="1px solid #FF0000";
			ids1('emailv',false).innerHTML="<span class=\"system negative\">Please Enter the Email.</span>";
			error=1;
			}
		else{
		if (document.getElementById('email_valid').value == 'no'){
//		ids('email',false).style.border="1px solid #FF0000";
		ids1('emailv',false).innerHTML="<span class=\"system negative\">Please Enter the Email.</span>";
		error=1;
				}
		}
	}

	if (ids1('sell_look',true)=='')  {
//	  	 ids('sell_look',false).style.border="1px solid #FF0000";
			ids1('sell_lookv',false).innerHTML="<span class=\"system negative\">Please Enter When you looking to sell?.</span>";
			error=1;
		}
	if (ids1('sell_look',true)!='') {
		if(document.getElementById('sell_look_valid')==undefined){
//			ids('sell_look',false).style.border="1px solid #FF0000";
			ids1('sell_lookv',false).innerHTML="<span class=\"system negative\">Please Enter When you looking to sell?.</span>";
			error=1;
			}
		else{
		if (document.getElementById('sell_look_valid').value == 'no'){
//		ids('sell_look',false).style.border="1px solid #FF0000";
		ids1('sell_lookv',false).innerHTML="<span class=\"system negative\">Please Enter  When you looking to sell?.</span>";
		error=1;
				}
		}
	}
	
	
	if(error == 0){
        return true;
	}else{
		return false;
	}
	}
	function validatephone1(xxxxx) {
		var maintainplus = '';
		var numval = xxxxx.value
		if ( numval.charAt(0)=='+' ){ var maintainplus = '+';}
		curphonevar = numval.replace(/[\\A-Za-z!"£$%^&*+_={};:'@#~,.¦\/<>?|`¬\]\[]/g,'');
		xxxxx.value = maintainplus + curphonevar;
		var maintainplus = '';
		xxxxx.focus;
		}
	function validatename1(xxxxx) {
		 var maintainplus = '';
		var numval = xxxxx.value
		if ( numval.charAt(0)=='+' ){ var maintainplus = '+';}
		curphonevar = numval.replace(/[\\0-9!"£$%^&*+_={};:'@#~,.¦\/<>?|`¬\]\[]/g,'');
		xxxxx.value = maintainplus + curphonevar;
		var maintainplus = '';
		xxxxx.focus;
	}
//	function validateaddress(xxxxx) {
//		 var maintainplus = '';
//		var numval = xxxxx.value
//		if ( numval.charAt(0)=='+' ){ var maintainplus = '+';}
//		curphonevar = numval.replace(/[\\!"£$%^&*+_={};:'@#~.¦\/<>?|`¬\]\[]/g,'');
//		xxxxx.value = maintainplus + curphonevar;
//		var maintainplus = '';
//		xxxxx.focus;
//	}
	
	function Trim1(str){  
		while(str.charAt(0) == (" ") ){ 
			str = str.substring(1);
	  	}
	  	while(str.charAt(str.length-1) == " " ){ 
	  	  	str = str.substring(0,str.length-1);
	  	}
	  	return str;
	}

	
		
	 	function validate(){
         
            if(document.getElementById('nam').value==""){
		 	alert("User name Cannot Be Blank");		
    		return false;
    		}else if(document.getElementById('pass').value==""){
    			alert("Password Cannot Be Blank");		
        		return false;

        		}      else if(document.getElementById('pass1').value==""){
        			alert("Retype password");		
            		return false;

            		}else if(document.getElementById('pass').value!="" && (document.getElementById('pass').value!=document.getElementById('pass1').value)){
                       alert("Need Identical Passwords")
                       return false;
                		}
        		       else if(document.getElementById('fname').value==""){
        			alert("First name Cannot Be Blank");		
            		return false;

            		}else if(document.getElementById('lname').value==""){
            			alert("Second name Cannot Be Blank");		
                		return false;

                		}
            		    else if(document.getElementById('email').value==""){
            			alert("Emial-id cannot be blank");		
                		return false;

                		}
            			else if(echeck(document.getElementById('email').value)==false){
//               			                				               				alert("3");
                				return false

                    	}else{
//    			alert("31");     
    			document.myform1.submit();
        	}
			
	 	}
		

function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("Invalid E-mail ID")
		   return false

			}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid E-mail ID")
		   return false
		  
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid E-mail ID")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid E-mail ID")
		    return false
		 }
//
		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid E-mail ID")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }
		 if (str.substring(ldot,ldot+2)=="."){
			    alert("Invalid E-mail ID")
			    return false
			 }
		// alert("dd");
 		 return true					
	}




var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos){
if(pos=="random"){
	LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;
	}
if(pos=="center"){
	LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;
	}
else if((pos!="center" && pos!="random") || pos==null){
	LeftPosition=0;TopPosition=20
	}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=yes';
win=window.open(mypage,myname,settings);
}

//----------------contact page validation started--------------------

var xmlHttp
function check_cForm(str, id)
{
	
   xmlHttp=GetXmlHttpObject()
   if (xmlHttp==null)
   {
       alert ("Browser does not support HTTP Request")
       return
    }
    
   var url="urlajax.php?q="+Trim2(str)+"&id="+id;
   xmlHttp.onreadystatechange = function()
    {
       if(xmlHttp.readyState==4){
  	     
         text = xmlHttp.responseText
          document.getElementById(id).style.borderColor = text.substring(0,7);
         document.getElementById(id+"v").innerHTML = text.substring(8)
       }
   }
   xmlHttp.open("GET",url,true)
   xmlHttp.send(null)
}


function GetXmlHttpObject()
{
   var xmlHttp=null;
   try
    {
      xmlHttp=new XMLHttpRequest();
    }
   catch (e)
    {
       try
        {
           xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
        }
       catch (e)
        {
           xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
    }
   return xmlHttp;
}
function ids2(id,value){
	if(value==true){
	 return document.getElementById(id).value;
	}
	else{
		return document.getElementById(id);
	}
	}

function validate_contactform()
{

	var error=0;		
if (ids2('cname',true)=='')  {
//  	 ids('name',false).style.border="1px solid #FF0000";
		ids2('cnamev',false).innerHTML="<span class=\"system negative\">Please Enter the Name.</span>";
		error=1;
	}
if (ids2('cname',true)!='') {
	if(document.getElementById('cname_valid')==undefined){
//		ids('name',false).style.border="1px solid #FF0000";
		ids2('cnamev',false).innerHTML="<span class=\"system negative\">Please Enter the Name.</span>";
		error=1;
		}
	else{
	if (document.getElementById('cname_valid').value == 'no'){
//	ids('name',false).style.border="1px solid #FF0000";
	ids2('cnamev',false).innerHTML="<span class=\"system negative\">Please Enter the Name.</span>";
	error=1;
			}
	}
}



if (ids2('cphno',true)=='')  {
//  	 ids('phno',false).style.border="1px solid #FF0000";
		ids2('cphnov',false).innerHTML="<span class=\"system negative\">Please Enter the Phone number.</span>";
		error=1;
	}
if (ids2('cphno',true)!='') {
	if(document.getElementById('cphno_valid')==undefined){
//		ids('phno',false).style.border="1px solid #FF0000";
		ids2('cphnov',false).innerHTML="<span class=\"system negative\">Please Enter the Phone number.</span>";
		error=1;
		}
	else{
	if (document.getElementById('cphno_valid').value == 'no'){
//	ids('phno',false).style.border="1px solid #FF0000";
	ids2('cphnov',false).innerHTML="<span class=\"system negative\">Please Enter the Phone number.</span>";
	error=1;
			}
	}
}




if (ids2('cemail',true)=='')  {
//  	 ids('email',false).style.border="1px solid #FF0000";
		ids2('cemailv',false).innerHTML="<span class=\"system negative\">Please Enter the Email.</span>";
		error=1;
	}
if (ids2('cemail',true)!='') {
	if(document.getElementById('cemail_valid')==undefined){
//		ids('email',false).style.border="1px solid #FF0000";
		ids2('cemailv',false).innerHTML="<span class=\"system negative\">Please Enter the Email.</span>";
		error=1;
		}
	else{
	if (document.getElementById('cemail_valid').value == 'no'){
//	ids('email',false).style.border="1px solid #FF0000";
	ids2('cemailv',false).innerHTML="<span class=\"system negative\">Please Enter the Email.</span>";
	error=1;
			}
	}
}


if (ids2('msg',true)=='')  {
//	 ids('address1',false).style.border="1px solid #FF0000";
	ids2('msgv',false).innerHTML="<span class=\"system negative\">Please Enter the Message.</span>";
	error=1;
}
if (ids2('msg',true)!='') {
if(document.getElementById('msg_valid')==undefined){
//	ids('address1',false).style.border="1px solid #FF0000";
	ids2('msgv',false).innerHTML="<span class=\"system negative\">Please Enter the Message field.</span>";
	error=1;
	}
else{
if (document.getElementById('msg_valid').value == 'no'){
//ids('address1',false).style.border="1px solid #FF0000";
ids2('msgv',false).innerHTML="<span class=\"system negative\">Please Enter the Message field.</span>";
error=1;
		}
}
}

if(error == 0){
    return true;
}else{
	return false;
}
}
function Trim2(str){  
	while(str.charAt(0) == (" ") ){ 
		str = str.substring(1);
  	}
  	while(str.charAt(str.length-1) == " " ){ 
  	  	str = str.substring(0,str.length-1);
  	}
  	return str;
}
