$(document).ready(function() {
//alert("onload");

  $('.chat-create-link').hide();
  $('.chat-home-button').hide();
  $('.chat-settings-button').hide();						   
  $('.linklove').hide();						   
						   
						   
 // hides the slickbox as soon as the DOM is ready
 // (a little sooner than page load)
  $('#slickbox').hide();
 // shows the slickbox on clicking the noted link
  $('a#slick-show').click(function() {
	$('#slickbox').slideDown(400);
	return false;
  });
 // hides the slickbox on clicking the noted link
  $('a#slick-hide').click(function() {
	$('#slickbox').slideUp(300);
	return false;
  });
 // toggles the slickbox on clicking the noted link
  $('a#slick-toggle').click(function() {
	$('#slickbox').slideToggle(400);
	return false;
  });	
  
  $('#ewclink').hide();

		var loader = jQuery('<div id="loader"><img src="images/loading.gif" alt="loading..." /></div>')
			.css({position: "relative", top: "1em", left: "25em"})
			.appendTo("body")
			.hide();
		jQuery().ajaxStart(function() {
			loader.show();
		}).ajaxStop(function() {
			loader.hide();
		}).ajaxError(function(a, b, e) {
			throw e;
		});
		
		var v = jQuery("#emailform").validate({
		rules: {
					fname: {
						required: true,
						minlength: 2
					},
					lname: {
						required: true,
						minlength: 2
					},
					email: {
						required: true,
						email: true
					},
					security: {
						required: true,
						equalTo: "#securityanswer"
					}
			},
		messages: {
			firstname: "Please enter your First Name",
			lastname: "Please enter your Last Name",
			company: {
				required: "Please enter your Company Name",
				minlength: "Your Company Name must consist of at least 2 characters"
			},
			security: {
				required: "Please answer the math problem",
				minlength: "Must be 1 Character long",
				equalTo: "Incorrect, please answer math problem."
			},
			email: "Please enter a valid email address"
			},

			submitHandler: function(form) {
				jQuery(form).ajaxSubmit({
					target: "#result"
				});
				$('#form').fadeOut(500);
				$('div#success').fadeIn();
				
			}
		});



});//This is the end.

