// JavaScript Document

jQuery(document).ready(function() {
 // hides the slickbox as soon as the DOM is ready
  jQuery('#top-block').hide();
 // shows the slickbox on clicking the noted link
  jQuery('#slick-show').click(function() {
 jQuery('#top-block').slideDown('slow');
 return false;
  });
  jQuery('#slick-show-two').click(function() {
 jQuery('#top-block').slideDown('slow');
 return false;
  });
 // hides the slickbox on clicking the noted link
  jQuery('#slick-hide').click(function() {
 jQuery('#top-block').slideUp('slow');
 return false;
  });
  // hides the slickbox on clicking the noted link
  jQuery('.slick-hide').click(function() {
 jQuery('#top-block').slideUp('slow');
 return false;
  });
 // toggles the slickbox on clicking the noted link
  jQuery('#slick-toggle').click(function() {
 jQuery('#top-block').slideToggle('slow');
 return false;
  });
  // toggles the slickbox on clicking the noted link
  jQuery('#slick-toggle-two').click(function() {
 jQuery('#top-block').slideToggle('slow');
 return false;
  });
});


jQuery(document).ready(function(){
	jQuery(".scroll").click(function(event){
		//prevent the default action for the click event
		event.preventDefault();
		
		//get the full url - like mysitecom/index.htm#home
		var full_url = this.href;
		
		//split the url by # and get the anchor target name - home in mysitecom/index.htm#home
		var parts = full_url.split("#");
		var trgt = parts[1];
		
		//get the top offset of the target anchor
		var target_offset = $("#"+trgt).offset();
		var target_top = target_offset.top;
		
		//goto that anchor by setting the body scroll top to anchor top
		$('html, body').animate({scrollTop:target_top}, 500);
	});
});

