$(document).ready(function() {
	// Nivo Slider
	$('#slider').nivoSlider({
		effect:'sliceDownLeft',
		slices:8,
		animSpeed:1000,
		pauseTime:5000,
		startSlide:0, //Set starting Slide (0 index)
		directionNav:true, //Next & Prev
		directionNavHide:false, //Only show on hover
		pauseOnHover:false, //Stop animation while hovering
		manualAdvance:false //Force manual transitions
	});
	
	// Cycle between Different Pages
	//$('#cycle').cycle({
    //    fx:     'fade',
    //    speed:  'slow',
    //    timeout: 0,
    //    pager:  '#topnav',
    //    pagerAnchorBuilder: function(idx, slide) {
    //        // return sel string for existing anchor
    //        return '#topnav li:eq(' + (idx) + ') a';
    //    }
    //	});
	
	// Testimonials
	$('#testimonial').cycle({
        fx:     'scrollVert',
        speed:  'slow',
        timeout: 0,
        prev:    '#prev',
        next:    '#next'
    	});
	// Gallery page
	$('div.navigation').css({'width' : '185px', 'float' : 'left'});
	$('div.content').css('display', 'block');		
	// Initialize Minimal Galleriffic Gallery
	$('#thumbs').galleriffic({
		imageContainerSel:'#slideshow',
		controlsContainerSel:'#controls',
		loadingContainerSel:'#loading',
		renderSSControls:true,
		renderNavControls:true,
		enableHistory:false,
		numThumbs:                 8,
		enableTopPager:false,
		enableBottomPager:true
	});
	//Search
	var newsauthor = $("#newsauthor");
	var newsauthorD = "Name";
	
	newsauthor.focus(function(){
		if($(this).attr("value") == newsauthorD) $(this).attr("value", "");
	});
	newsauthor.blur(function(){
		if($(this).attr("value") == "") $(this).attr("value", newsauthorD);
	});
	var newsemail = $("#newsemail");
	var newsemailD = "Email";
	
	newsemail.focus(function(){
		if($(this).attr("value") == newsemailD) $(this).attr("value", "");
	});
	newsemail.blur(function(){
		if($(this).attr("value") == "") $(this).attr("value", newsemailD);
	});
});
