var Contacts = {

    clearField : function (item)
    {
        $(item).attr('value', '');
    },

    sendM : function (thisFom)
    {
        Contacts.actualForm = thisFom;

        $.post("/",
            'Func=contacts.sendMessage&'+$(thisFom).serialize(),
            function(data) {

                if (data.error)
                {
                    jQuery.each(data.items, function(i, val) {
                        $('#'+i).val(val);
                    });
                }
                else
                {

                    Contacts.actualForm.reset();
                    alert(data.message);
                }
            },
		"json"
		);
    }
};

var Across = {

    back : function ()
    {
        history.go(-1);
    },

    reload : function (to)
    {
        if (to == false)
        {
            window.location = window.location.href;
        }
        else
        {
            window.location = to;
        }
    },

    clearField : function (item)
    {
        $(item).attr('value', '');
    },

	equalCols : function()
	{
		var maxH = 0;

		$('.collumn').each(function() {
	
			h = $(this).height();

			if ( h > maxH)
			{
				maxH = h;
			}
		});
  
		$('.collumn').each(function() {
			$(this).css('paddingBottom', ( maxH - $(this).height() )+'px');
		});
	}
};

$(document).ready(function(){

	Across.equalCols();
	
	$('.main-search .string').focus(function () {
		$('.main-search .string').val('');
		$('.main-search .search-submit').show();
	});
});
