
jQuery.fn.randomChild = function(settings) {
	return this.each(function(){
		var c = $(this).children().length;
		var r = Math.ceil(Math.random() * c);
		$(this).children().hide().parent().children(':nth-child(' + r + ')').show();
	});
};

$(function() {
$(".external").attr("target","_blank");
	$('div.navigation-column > ul > li:last-child').addClass('last');
	$('blockquote').randomChild();
	$('label.overlabel').overlabel();
$('#freeform').ajaxForm(
	{
	target:"#hiddenDIV",     //set response to go into hidden div   
	resetForm: true,
	beforeSubmit:function()  //before sending submit, give user notification...
  {
     $("#msg").html("<h2>Contacting the server....</h2>");
  },
   success:function(rtn) 
   { 
    if(rtn=="success")
    {
	$("#msg").load("site/thanks");
	$(".input-field").hide();
		}else{
	$("#msg").html($("#hiddenDIV #second ul").html());
		$("#hiddenDIV").empty();
		}
	} 
  }
);   	
	
	
});

