/* EXPOSE THE VERBOSE BOOKMARKS */
	function bookmarks_verbose() {
		$.get(
			"_includes/ajax_module_bookmarks_verbose.php",
			function(data) {
				document.getElementById("div_bookmarks_bottom_margin").innerHTML=data;
			}
		);
	}

/* HIDE BROKEN IMAGES */
	$(document).ready(function() {  
		$("img").fixBroken();  
	});
	$.fn.fixBroken = function(){  
		return this.each(function(){  
			var tag = $(this);  
			var alt_img = "_images/spacer.gif";  
			tag.error(function() {
				tag.attr("src",alt_img);
				tag.css("border","0px");
				return true;
			});
		});
	};

/* THE LATEST BLOG POST ON THE INDEX PAGE */
	$(document).ready(
		function() {  
			if(document.getElementById("ajax_latest_blog_post")) {
				$.get(
					"ajax_latest_blog_post.php",
					function(data) {
						document.getElementById("ajax_latest_blog_post").innerHTML=data;
					}
				);
			}
		}
	);

/* THE WORDPRESS LOGIN/LOGOUT LINKS */
	$(document).ready(
		function() {  
			if(document.getElementById("span_wp_login")) {
				$.get(
					"http://www.swbrinc.com/ajax_login_out_links.php",
					function(data) {
						document.getElementById("span_wp_login").innerHTML=data;
					}
				);
			}
		}
	);

/* THE TOP CONTACT FORM */
	function val_frm_con_top() {
		user_ok=true;
		if(
			document.forms["frm_con_top"].elements["txt_email"].value.length<6
			||
			document.forms["frm_con_top"].elements["txt_name"].value.length<3
			||
			document.forms["frm_con_top"].elements["txt_telephone"].value.length<7
		) {
			user_ok=false;
			Sexy.error("Please complete the form with a valid Name, E-mail and Telephone.");
		}
		/* SEND THE DATA */
			if(user_ok==true) {
				$.post(
					"_scripts/xt_contact.php",
					{
						txt_comments: document.forms["frm_con_top"].elements["txt_comments"].value,
						txt_company: document.forms["frm_con_top"].elements["txt_company"].value,
						txt_email: document.forms["frm_con_top"].elements["txt_email"].value,
						txt_name: document.forms["frm_con_top"].elements["txt_name"].value,
						txt_telephone: document.forms["frm_con_top"].elements["txt_telephone"].value,
						txt_title: document.forms["frm_con_top"].elements["txt_title"].value,
						form_location: "TOP CONTACT FORM"
					},
					function(data) {
						if(data=="ok") {
							document.forms["frm_con_top"].reset();
							Sexy.alert("Thank you, your information has been submitted.");
						}
					}
				);
			}
	}

/* THE BOTTOM CONTACT FORM */
	function val_frm_con_bot() {
		user_ok=true;
		if(
			document.forms["frm_con_bot"].elements["txt_email"].value.length<6
			||
			document.forms["frm_con_bot"].elements["txt_name"].value.length<3
			||
			document.forms["frm_con_bot"].elements["txt_telephone"].value.length<7
			||
			document.forms["frm_con_bot"].elements["txt_email"].value=="E-mail"
			||
			document.forms["frm_con_bot"].elements["txt_telephone"].value=="Telephone"
		) {
			user_ok=false;
			Sexy.error("Please complete the form with a valid Name, E-mail and Telephone.");
		}
		if(user_ok==true) {
			$.post(
				"_scripts/xt_contact.php",
				{
					txt_comments: document.forms["frm_con_bot"].elements["txt_comments"].value,
					txt_company: "",
					txt_email: document.forms["frm_con_bot"].elements["txt_email"].value,
					txt_name: document.forms["frm_con_bot"].elements["txt_name"].value,
					txt_title: "",
					txt_telephone: document.forms["frm_con_bot"].elements["txt_telephone"].value,
					form_location: "BOTTOM CONTACT FORM"
				},
				function(data) {
					if(data=="ok") {
						document.forms["frm_con_bot"].reset();
						Sexy.alert("Thank you, your information has been submitted.");
					}
				}
			);
		}
	}
