function links(){
    $("#content a").hover(function(){
        $(this).stop().animate({color:"#f403ec"},300);  
    },function(){
        $(this).stop().animate({color:"#C62005"},300);  
    });
    $("#footer a").hover(function(){
        $(this).stop().animate({color:"#cccccc"},300);  
    },function(){
        $(this).stop().animate({color:"#ffffff"},300);  
    });
}



function landingImages() {
	$(".post-6 .img-fl").prependTo("#container").addClass("img-position");
	$(".post-10 .img-fl").prependTo("#container").addClass("img-position");
}



function homeImages() {
	bgImageTotal=7;
	randomNumber = Math.round(Math.random()*(bgImageTotal-1))+1;
	imgPath=('/wp-content/themes/sps/images/home-intro/home-intro-0'+randomNumber+'.jpg');
	$('#home-intro').css('background-image', ('url("'+imgPath+'")'));
}



function images() {
	$(".separator").unwrap().unwrap();
	$("#content img.nolink").unwrap();
}



function smoothScroll() {
    $('a.link-scroll[href*=#]').click(function() {
    if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
        && location.hostname == this.hostname) {
            var $target = $(this.hash);
            $target = $target.length && $target || $('[name=' + this.hash.slice(1) +']');
            if ($target.length) {
                var targetOffset = $target.offset().top;
                $('html,body').animate({scrollTop: targetOffset},800);
                return false;
            }
        }
    });
}



function tables() {
	$(".wptable").each(function(){
		$(this).find("tr:first").addClass("alt");
	});
}



$(document).ready(function(){
	landingImages();
	homeImages();
	images();
	smoothScroll();
	tables();
	links();
});
