$(document).ready(function() {
	// Nivo Slider
	$('#slider').nivoSlider({
		effect:'sliceDownLeft',
		slices:8,
		animSpeed:2000,
		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
	});
	Cufon.replace('#header h1,#footer', {
	color: '-linear-gradient(#6a6a6a,#4a4a4a)',
	textShadow: '1px 1px #fff'
	});
	Cufon.replace('#topnav a', {
	hover: true,
	textShadow: '1px 1px #e0e0e0'
	});
	Cufon.replace('.text h1, .text h2, .text h3, .text h4, .text h5, .text h6', {
	textShadow: '1px 1px #fff'
	});
	//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);
	});
});
