
var $j = jQuery.noConflict();

$j(document).ready(function(){

	setInterval( "slideSwitch1()", 6000 );
	
	$j("#about").hover(function(){
		$j("#the_drop").css('visibility','visible');
	},function(){
		$j("#about").css('border','none');
		$j("#the_drop").css('visibility','hidden');
	});
	
	$j("#the_drop").hover(function(){
		$j("#the_drop").css('visibility','visible');
	},function(){
		$j("#about").css('border','none');
		$j("#the_drop").css('visibility','hidden');
	});
	
	$j('input[type="file"][multiple]').change(
    function(e){
        var numFiles = e.currentTarget.files.length;
        if (numFiles == 0){
            // no files
        }
        else {
            // files chosen
            console.log(numFiles);
        }
        return false;
    });
	
});

function slideSwitch1() {
    var $activeone = $j('#slideshow1 IMG.activeone');

    if ( $activeone.length == 0 ) $activeone = $j('#slideshow1 IMG:last');

    // use this to pull the images in the order they appear in the markup
    var $next =  $activeone.next().length ? $activeone.next(): $j('#slideshow1 IMG:first');
	
    $activeone.addClass('last-activeone');

    $next.css({opacity: 0.0})
        .addClass('activeone')
        .animate({opacity: 1.0}, 2000, function() {
            $activeone.removeClass('activeone last-activeone');
        });
	} 
	
function create_album_validate(){
	
	var msg = 'You Forgot to enter the following:\n';
	var i=0;

	if(create_album_form.album_name.value == '')
	{
		msg += " - Album Name\n";
		i=1;
	}
	
	if(create_album_form.uploadedfile.value == '')
	{
		msg += " - Album Cover Image";
		i=1;
	}
	
	if(i == 1)
	{
		alert(msg);
		return false;
	}
	else{
		return true;
	}
}

function upload_image_validate(){
//alert("You Forgot to select an image is "+document.getElementById("uploadfile").files.length);
	if(document.getElementById("uploadedfile").files.length < 1)
	{
	   alert("You Forgot to select an image");
	   return false;
	}
	else{
		return true;
	}
}
