$(function(){
	$('.module-tabbed').tabs();
	$('.imagetabs').tabs({ fx: { opacity: 'toggle', duration: 100 } });
	$('#mmbox').tabs({ event: 'mouseover' });
	$('#mmbox-list a').click(function(){
		window.location = $(this).attr('rel');
	});
	
	$('#closebox').click(function(){
		$('#footer-ad').hide();
	});

	/* Clearing Forms
	*******************************/
	
	$(".cleartext").focus(function() {
		if( this.value == this.defaultValue ) {
			this.value = "";
			$(this).addClass('focus');
		}
	}).blur(function() {
		if( !this.value.length ) {
			this.value = this.defaultValue;
			$(this).removeClass('focus');
		}
	});
	
	$("input#search_field, input#comment_name, input#comment_email, input#comment_turing, textarea#comment_body, input#subscribe").focus(function() {
		if( this.value == this.defaultValue ) {
			this.value = "";
		}
	}).blur(function() {
		if( !this.value.length ) {
			this.value = this.defaultValue;
		}
	});
	
	// init slideshows
	$('#hr-promo').cycle({ 
	    fx:      'scrollDown', 
	    speed:    300, 
	    timeout:  6000 ,
		random: 1,
		pause: 1
	});
});
