$(document).ready(function() {
	$.ajaxSetup({
		beforeSend: function(xhr) {xhr.setRequestHeader("Accept", "text/javascript")} 
	});
	
	$('a.not_parent').click(function(){
		var link = $(this);
		$.ajax({
			url : link.attr('href'),
			success: function(response) {
				$(document).html(response);
			}
		});
		
	});
	
	$('li.parent').accordion({
				active: true,
				navigation: true,
				// header: "a.parent > ul",
				alwaysOpen: false,
				clearStyle: true,
				autoHeight: false
			});
		// 
		// 
		// $("a.top_nav").click(function() {
		// 	$.ajax({
		// 		url : link.attr('href'),
		// 		success : function(response) {
		// 			$("document").html(response);
		// 		}
		// 	});
		// });
	// 
	// function external_links() {
	// 	$("a[@rel$='external']").click(function(){
	// 		this.target = "_blank";
	// 	});	
	// }
	// 
	// $("a.top_nav").click(function() {
	// 	var link = $(this);
	// 
	// 	$.ajax({
	//         url : link.attr('href'),
	//         success: function(response) {
	//         	$("#content").html(response);
	// 					external_links();
	//         }
	// 	});
	// 
	// 	$("ul.add_info").slideUp();
	// 	return false;
	// });
	// 
	// $("a.secondary_remote").click(function() {
	// 	var link = $(this);
	// 	
	// 	$.ajax({
	//         url : link.attr('href'),
	//         success: function(response) {
	//         	$("#content").html(response);
	// 			external_links();
	//         }
	// 	});
	// 	
	// 	return false;
	// });
	// 
	// 	
	// 	$("a.expand").click(function() {
	// 		if ( $(this).next("ul.add_info") == $("ul.add_info.active")) {
	// 			$("ul.add_info.active").slideUp().removeClass("active");
	// 		}
	// 		else {
	// 			$(this).next("ul.add_info").slideToggle();
	// 			$("ul.add_info.active").slideUp().removeClass("active");
	// 			$(this).next("ul.add_info").addClass("active");
	// 		}
	// 	});
	// 	
	// 	
	// 	$('form.remote_form').submit(function() {
	// 	    var form = $(this);
	// 	    var data = form.serializeArray();
	// 	    // data.push({authenticity_token: AUTH_TOKEN});
	// 	
	// 	    $.ajax({
	// 	        url : form.attr('action'),
	// 	        type : form.attr('method') || 'GET',
	// 	        data : data,
	// 	        success: function(response) {
	// 	        	$("#content").html(response);
	// 	        }
	// 	    });
	// 	    return false;
	// 	});
	// 	
	// 	$("img").pngfix();
});