
function eloquaSubmit() {
	var wrapper = "div.form-wrap";
	var thankyou = "div.thankyou";
	var formHeight = $(wrapper).height();
	if ( $('input[name="redirect"]').val() ) {
		var redirect = $('input[name="redirect"]').attr("value");
		$("div.message").addClass("redirect");
		var thankyouHeightRedirect = $(thankyou).height();
		$(wrapper).css({"height":formHeight}).children("form").fadeOut(300, function() {
			$(wrapper).animate({
				height: thankyouHeightRedirect
			}, 400, function() {
				$(thankyou).fadeIn(200).delay(3000).queue(function() {
					window.location.href = redirect;
				});
			});
		});
	} else {
		var thankyouHeight = $(thankyou).height();
		$(wrapper).css({"height":formHeight}).children("form").fadeOut(300, function() {
			$(wrapper).animate({
				height: thankyouHeight
			}, 400, function() {
				$(thankyou).fadeIn(200).delay(3000).queue(function() {
				});
			});
		});
	}
};


function submitlink(linktype, url) {
var linkurl = window.location;
var title = document.title;
var wintitle = title.substr(title.indexOf(": ") + 2);

switch (linktype)
{
case "delicious":
  window.location = "http://del.icio.us/login/?url=" + linkurl + "&title=" + wintitle;
  break;
case "stumbleupon":
 window.location = "http://www.stumbleupon.com/submit?url=" + linkurl + "&title=" + wintitle;
   break;
case "sendtofriend":
 <!--   break; -->
case "forum":
	var gd = gdomain(linkurl);
  document.location.href = gd + url;
  break;
case "newsfeed":
  document.location.href = url;
  break;
case "twitter incontext":
  document.location.href = "http://twitter.com/home/?status=Read this on InContext " + linkurl;
  break;
default:
  window.location = url;
}
}
 $(document).ready(function() {
if($(".register").length)
 {
	$(".register").validate({
		errorElement: "div",
		submitHandler: function(form) {
			$(form).ajaxSubmit();
			eloquaSubmit();
		}
	});
 }
if($("#contactv2").length)
 {
	$("#contactv2").validate();
 }
 });
