$(document).ready(function() {

//===========================

	//$('a').address();  
    //
	//function menuHovOn(){
	//	$("#dropper").slideDown('fast', function(){$('#b').addClass('hover')});
	//}
    //
	//function menuHovOff(){
	//	$("#dropper").slideUp('fast', function(){$('#b').removeClass('hover')});
	//}

//===========================
	
	//var cpos = $(document).width();
	//var cheight = $(document).height();
	//var cheight = cheight - 53;
	//var cwidth = $(document).width();
	//var cwidth = cwidth - 400;
	//
	//$('#content').css('left', cpos);
	//$('#content').css('height', cheight);
	//$('#content').css('width', cwidth);
	//$('#trueContenti').css('height', cheight-10);
	//
	//$('#trueContenti').hide();

//===========================
	
	$('a.loader').click(function() {
		var urlload = $(this).attr("id")+".php";

		$('#trueContenti').html('');

		$.ajax({
			url: urlload,
			cache: false,
			success: function(html){
			$("#trueContenti").append(html);
			},
			complete: function(){
			$("#trueContenti").fadeIn('slow');
			}
		});
	
	});

//===========================

	var page = $.address.pathNames()[0];

	if (page != undefined) {

		var urlload = page+".php";

		$('#content').css({left: 400}, 500);

		$('#trueContenti').html('');

		$.ajax({
			url: urlload,
			cache: false,
			success: function(html){
			$("#trueContenti").append(html);
			},
			complete: function(){
			$("#trueContenti").show();
			}
		});

	};

//===========================	


	$('#submit').click(function() {

		var data = $('#sendmail').serialize();

		$.ajax({

			url: "/sendmail.php",
			type: "POST",
			data: data,
		
			complete: function() {
				$.getScript('/js/site.js');
			},
			success: function(data) {
				$('#sendmail').html(data);
			},
			error: function() {
			}

		});

		return false;

	});


});