$(document).ready(function(){
	if($('#sm').length) {
		var activeLi = $("#sm li").length-1;
		slideMenu.build('sm',355,10,10,activeLi);
	}

	var content_wrap_height = $('#content_wrap').height();
/* 	$('#sub_nav_wrap').css({
		'height': content_wrap_height + 'px'
	}); */

	// Seminar list height
/* 	var seminarHeight = content_wrap_height - (20 + 10 + 105 + 10 + 170); // seminar padding (2 10px) + seminar bottom margin + image scroller height + image scroller bottom margin + dCloud banner height
	$('#seminars').css({
		'height': seminarHeight + 'px'
	});

	var seminarListHeight = seminarHeight - 60;
	//console.log('seminarListHeight: ' + seminarListHeight);
	$('#seminars ol').css({
		'height': seminarListHeight + 'px'
	}); */


	// Scrollable menu
/* 	window.onscroll = function () {
		var d = document;
		var scrollOffset = 0;
		if(typeof(window.pageYOffset ) == 'number') { // Netscape
			scrollOffset = window.pageYOffset;
		} else if(d.body && (d.body.scrollLeft || d.body.scrollTop) ) {
			scrollOffset = d.body.scrollTop;
		} else if(d.documentElement && (d.documentElement.scrollLeft || d.documentElement.scrollTop)) {
			scrollOffset = d.documentElement.scrollTop;
		}
		//console.log('scrollOffset: ' + scrollOffset);
		if(scrollOffset == 0) {
 			$('#sub_nav').css({
				'margin-top': '5px'
			});
		}

		if(scrollOffset >= 163) {
			var tmp = (scrollOffset - 163) + 10;
			//console.log('tmp: ' + tmp);
			$('#sub_nav').css({
				'margin-top': tmp + 'px'
			});
		}
	} */

	if($('#banner_scroller').length) {
		$('#banner_scroller').innerfade({
			speed: 'slow',
			timeout: 4000,
			type: 'sequence'
		});
	}

	$('#sub_nav li.inactive').hover(function() {
		jQuery(this).addClass('hover');
	}, function(){
		jQuery(this).removeClass('hover');
	});

	$('input.prefilled, textarea.prefilled').each(function(){
	  return function() {
	   el = $(this);
	   el.attr('prefilled', el.val());
	   el.focus(function(){
		if (this.value == $(this).attr('prefilled')) {
		 this.value = '';
		}
	   });
	   el.blur(function(){
		if (!this.value) {
		 this.value = $(this).attr('prefilled');
		}
	   });
	  }
	 }());
});
