	function realClearClick()
	{
		realCheckKey = document.getElementById("fromAddress").value;
		if (realCheckKey == 'e.g 123 Main st')
		{
			document.getElementById("fromAddress").value = '';
		}
	}
  function rpSubmitForm(id)
  {
  	rp_check_submit = '';
  	rp_check_contactname =jQuery("#rp_contactform"+id).find("#rp_text_contactname").val();
    if (rp_check_contactname == '')
    {
  		document.getElementById("rp_contactInfo"+id).innerHTML ='<i style="color:red;">Sorry, You must input "Your Name" First!</i>' ;
  		document.getElementById("rp_contactInfo"+id).style.display='block';
  		document.getElementById("rp_text_contactname").focus();
  		return;	
    }
    else
    {
		  rp_check_submit = 'name='+rp_check_contactname;
    }
	
    rp_check_contactemail =jQuery("#rp_contactform"+id).find("#rp_text_contactemail").val();
    if (rp_check_contactemail == '')
    {
		  document.getElementById("rp_contactInfo"+id).innerHTML ='<i style="color:red;">Sorry, You must input "Your Email" First!</i>' ;
		  document.getElementById("rp_contactInfo"+id).style.display='block';
		  document.getElementById("rp_text_contactemail").focus();
		  return;	
    }
    else
    {
		  if (rp_check_submit != '')
		  {
			 rp_check_submit = rp_check_submit+'&email='+rp_check_contactemail;
		  }
		  else
		  {
        rp_check_submit = 'email='+rp_check_contactemail;
      }
    }

    rp_check_contactphone =jQuery("#rp_contactform"+id).find("#rp_text_contactphone").val();
    if (rp_check_contactphone == '')
    {
		  document.getElementById("rp_contactInfo"+id).innerHTML ='<i style="color:red;">Sorry, You must input "Telephone Number" First!</i>' ;
		  document.getElementById("rp_contactInfo"+id).style.display='block';
		  document.getElementById("rp_text_contactphone").focus();
		  return;	
	 }
	 else
	 {
		if (rp_check_submit != '')
		{
			rp_check_submit = rp_check_submit+'&phone='+rp_check_contactphone;
		}
		else
		{
			rp_check_submit = 'phone='+rp_check_contactphone;
		}		
	}

	rp_check_contactsubject =jQuery("#rp_contactform"+id).find("#rp_text_contactsubject").val();
	if (rp_check_contactsubject != '')
	{
		if (rp_check_submit != '')
		{
			rp_check_submit = rp_check_submit+'&subject='+rp_check_contactsubject;
		}
		else
		{
			rp_check_submit = 'subject='+rp_check_contactsubject;
		}				
	}

	rp_check_contactmessage =jQuery("#rp_contactform"+id).find("#rp_text_contactmessage").val();
	if (rp_check_contactmessage != '')
	{
		if (rp_check_submit != '')
		{
			rp_check_submit = rp_check_submit+'&message='+rp_check_contactmessage;
		}
		else
		{
			rp_check_submit = 'message='+rp_check_contactmessage;
		}				
	}
	
	//rp_check_spaminput = document.getElementById("rp_text_spaminput").value;
/*	rp_check_spaminput =jQuery("#rp_contactform"+id).find("#rp_text_spaminput").val();
	if (rp_check_contactname == '')
	{
		document.getElementById("rp_contactInfo"+id).innerHTML ='<i>Sorry, You must input "Verification Code" First!</i>' ;
		document.getElementById("rp_contactInfo"+id).style.display='block';
		document.getElementById("rp_text_spaminput").focus();
		return;	
	}
	else
	{
		if (rp_check_submit != '')
		{
			rp_check_submit = rp_check_submit+'&spam='+rp_check_spaminput;
		}
		else
		{
			rp_check_submit = 'spam='+rp_check_spaminput;
		}						
		
	}
*/
	
	rp_check_submit = rp_check_submit+ '&sessioni='+rp_sessionId+'&id='+id;
	jQuery.ajax
	({
		type: "post",
		url: REALPRESS_URL+"/realajax.php",
		data: rp_check_submit,
		success: function(ajax_result)
		{
			if ('100' == ajax_result)
			{
				jQuery("#rp_contactInfo"+id).html('<span style="color:green;">We will contact you soon,Thank you.</span>');
				document.getElementById("rp_contactInfo"+id).style.display='block' ;				
			}
			else
			{
				jQuery("#rp_contactInfo"+id).html('<span style="color:red;">'+ajax_result+'</span>');
				document.getElementById("rp_contactInfo"+id).style.display='block' ;
			}
		}
	});
}	
//sets for each gallery
function rpp_ngggalleryView(id)
{


}

var css_state="";
var css_city="";

// change select
function rpp_load_states_by_country()
{
	var str="action=rpp_load_states_by_country&country="+jQuery("#country").val();
	if (css_state=="") css_state=jQuery("#state").css();
	jQuery.ajax
	({
	  type: "post",
  	  url: REALPRESS_URL+"/realajax.php",
  	  data: str,
  	  success: function(res)
  	{
    	  jQuery("#state").parent().html(res);
	  jQuery("#state").css(css_state);
  	}
 	});
}
// change select
function rpp_load_cities_by_state()
{
	var str="action=rpp_load_cities_by_state&state="+jQuery("#state").val();
	if (css_city=="") css_city=jQuery("#city").css();
	jQuery.ajax
	({
	  type: "post",
  	  url: REALPRESS_URL+"/realajax.php",
  	  data: str,
  	  success: function(res)
  	{
    	  jQuery("#city").parent().html(res);
	  jQuery("#city").css(css_city);
  	}
 	});
}
(function($){
    $.fn.getStyleObject = function(){
        var dom = this.get(0);
        var style;
        var returns = {};
        if(window.getComputedStyle){
            var camelize = function(a,b){
                return b.toUpperCase();
            };
            style = window.getComputedStyle(dom, null);
            for(var i = 0, l = style.length; i < l; i++){
                var prop = style[i];
                var camel = prop.replace(/\-([a-z])/g, camelize);
                var val = style.getPropertyValue(prop);
                returns[camel] = val;
            };
            return returns;
        };
        if(style = dom.currentStyle){
            for(var prop in style){
                returns[prop] = style[prop];
            };
            return returns;
        };
        return this.css();
    }
})(jQuery);

jQuery.fn.css2 = jQuery.fn.css;
jQuery.fn.css = function() {
    if (arguments.length) return jQuery.fn.css2.apply(this, arguments);
/*    var attr = ['font-family','font-size','font-weight','font-style','color',
        'text-transform','text-decoration','letter-spacing','word-spacing',
        'line-height','text-align','vertical-align','direction','background-color',
        'background-image','background-repeat','background-position',
        'background-attachment','opacity','width','height','top','right','bottom',
        'left','margin-top','margin-right','margin-bottom','margin-left',
        'padding-top','padding-right','padding-bottom','padding-left',
        'border-top-width','border-right-width','border-bottom-width',
        'border-left-width','border-top-color','border-right-color',
        'border-bottom-color','border-left-color','border-top-style',
        'border-right-style','border-bottom-style','border-left-style','position',
        'display','visibility','z-index','overflow-x','overflow-y','white-space',
        'clip','float','clear','cursor','list-style-image','list-style-position',
        'list-style-type','marker-offset'];*/
//custom changes for http://fb.portugalprop.com/
    var attr = ['top','position','width'];
    var len = attr.length, obj = {};
    for (var i = 0; i < len; i++) 
        obj[attr[i]] = jQuery.fn.css2.call(this, attr[i]);
    return obj;
}


