//var $J = jQuery.noConflict();
jQuery(document).ready(function(){
});

var SendForm=function(url, form)
{
    $('*[rel="form"]').css({'border':'','background-color': ''});
    $('*[rel="form"]').parent().css({'background-color': ''});
    $('div[class="dtError"]').remove();
    $.ajax({
    type: "POST",
        url: url,
        data: form,
        success: function(html)
        {
            $('#submit').html(html);
        }
    });
}



$(window).resize(function(){
	
});

$.fn.alignCenter = function() {
  var marginLeft = Math.max(40, parseInt($(window).width()/2 - $(this).width()/2)) + 'px';
  var marginTop = Math.max(40, parseInt($(window).height()/2 - $(this).height()/2)) + 'px';
  return $(this).css({'margin-left':marginLeft, 'margin-top':marginTop});
};

function closePopup(){
$('#opaco').toggleClass('hidden').removeAttr('style');
$('#popup').toggleClass('hidden');
return false;
}
function showPopup(popup_type){
	if($.browser.msie){
		$('#opaco').height($(document).height()).toggleClass('hidden');
	} else {
		$('#opaco').height($(document).height()).toggleClass('hidden').fadeTo('slow', 0.7);
	}
	$('#popup')
		.alignCenter()
		.toggleClass('hidden');
	return false;
}
