/* =============== Script by Decio Benicio: http://deciotgr.org =============== */

$(document).ready(function(){
        
        $('#slider').nivoSlider({
			effect:'fade', //Specify sets like: 'random,fold,fade,sliceDown'
			animSpeed:1000, //Slide transition speed
			pauseTime:8000,
			startSlide:0, //Set starting Slide (0 index)
			directionNav:false, //Next & Prev
			directionNavHide:true, //Only show on hover
			controlNav:true, //1,2,3...
			controlNavThumbs:false, //Use thumbnails for Control Nav
			controlNavThumbsFromRel:false, //Use image rel for thumbs
			controlNavThumbsSearch: '.jpg', //Replace this with...
			controlNavThumbsReplace: '_thumb.jpg', //...this in thumb Image src
			keyboardNav:true, //Use left & right arrows
			pauseOnHover:true, //Stop animation while hovering
			manualAdvance:false, //Force manual transitions
			captionOpacity:1, //Universal caption opacity
			beforeChange: function(){},
			afterChange: function(){},
			slideshowEnd: function(){} //Triggers after all slides have been shown
		});
        
    var textDefault0 = $('#header #searchform label').text();
        
        $('#header  #searchform label').hide();
        
        $('#header  #s').val(textDefault0)
        .focus(function() {
	if ($(this).val() == textDefault0) {
		$(this).val("");
	}
	}).blur(function() {
	if ($(this).val() =="") {
		$(this).val(textDefault0);	
	}
	});
	
	var textDefault1 = $('#content.error #searchform label').text();
        
        $('#content.error #searchform label').hide();
        
        $('#content.error #s').val(textDefault0)
        .focus(function() {
	if ($(this).val() == textDefault0) {
		$(this).val("");
	}
	}).blur(function() {
	if ($(this).val() =="") {
		$(this).val(textDefault0);	
	}
	});
	
	$('ul.sub-menu')
	.hide()
	.css('opacity','0.95')
	.parent()
	.addClass('last')
	.hover(
	       function(){
		
		$(this).find('ul.sub-menu').fadeIn(400);
		$(this).find('a[href=#]').addClass('hover');
		
		},
		function(){
		
		$(this).find('ul.sub-menu').hide();
		$(this).find('a[href=#]').removeClass('hover');
		
		});
	$('ul.sub-menu li, ul.sub-menu li a')
	.css('opacity','1');
	
	$('#social-channel a').click( function() {
	    window.open(this.href);
	    return false;
	});
	
	$('#youTube').click( function() {
	    window.open(this.href);
	    return false;
	});
	
	
	$('#authors-credits li h4 a').click( function() {
	    window.open(this.href);
	    return false;
	});

	$('div.vcard cite.fn a').click( function() {
	    window.open(this.href);
	    return false;
	});
    });













