function sendImageToConsultant(theUrl) {
	
	var theUrl = "https://art4orm.wufoo.com/forms/z7x3r9/def/field15=" + theUrl;
	window.open(theUrl, null, 'height=688, width=680, toolbar=0, location=0, status=1, scrollbars=1'); 
	
}

// ===================
// = On Load Script =
// ===================

$(document).ready(function() {
	
	// ==============================
	// = Load in the favorites_peek =
	// ==============================
	
	if ($("#ajax-favorites")) {
		
		$.ajax({
		 type: "GET",
		 url: "/favorites_peek.php",
		 success: function(html){
			 $("#ajax-favorites").empty().append(html);
		 }
		});
		
	};
	
});

function addToFavorites (theFavorite) {
	
	// ====================
	// = Add to Favorites =
	// ====================
	
	$.ajax({
	 type: "GET",
	 url: "/favorites_peek.php?fav=" + theFavorite,
	 success: function(html){
		 $("#ajax-favorites").empty().append(html);
			
			// if ($('#favorite-count')) {
			// 	
			// 	$('#favorite-count').effect("highlight", {color: '#EEB74B'}, 1000);
			// 	
			// };
		
		 
		
	 }
 });
	
}

function deleteFavorite (theFavorite_id) {
	
	// ====================
	// = Delete Favorite =
	// ====================
	
	$.ajax({
	 type: "GET",
	 url: "/favorites_delete.php?fav_id=" + theFavorite_id,
	 success: function(){
		 viewFavorites();
		$('.view').effect("highlight", {color: '#000000'}, 1000);
	 }
 });
	
}

function viewFavorites () {
	
	// ==================
	// = View Favorites =
	// ==================
	
	$.ajax({
	 type: "GET",
	 url: "/favorites_view.php",
	 success: function(html){
		 $("#ajax-favorites").empty().append(html);
	 }
 });
	
}

// ====================
// = Favorites Log In =
// ====================

function logIn (theFavorite) { 
	
	$.ajax({
	 type: "GET",
	 url: "/login.php?fav=" + theFavorite,
	 success: function(html){
		 $("#ajax-favorites").empty().append(html);
	 }
 });
	
}


// ================================
// = Favorites Log In Submit Form =
// ================================

function logIn_formSubmit (theFavorite) { 
	
	$.ajax({
	 type: "POST",
	 url: "/login.php?fav=" + theFavorite,
	 data: $("#form_fav-login").serialize(),
	 success: function(html){
		 $("#ajax-favorites").empty().append(html);
	 }
 });

}


// =====================
// = Favorites Sign-up =
// =====================

function signUp (theFavorite) { 
	
	$.ajax({
	 type: "GET",
	 url: "/signup.php?fav=" + theFavorite,
	 success: function(html){
		 $("#ajax-favorites").empty().append(html);
	 }
 });
	
}


// =================================
// = Favorites Sign-up Submit Form =
// =================================

function signUp_formSubmit (theFavorite) { 
	
	$.ajax({
	 type: "POST",
	 url: "/signup.php?fav=" + theFavorite,
	 data: $("#form_fav-signup").serialize(),
	 success: function(html){
		 $("#ajax-favorites").empty().append(html);
	 }
 });

}