$(function () {
        
    $('.anythingSlider').anythingSlider({
        easing: "easeInOutExpo",        // Anything other than "linear" or "swing" requires the easing plugin
        autoPlay: true,                 // This turns off the entire FUNCTIONALY, not just if it starts running or not.
        delay: 13000,                   // How long between slide transitions in AutoPlay mode
        startStopped: false,            // If autoPlay is on, this can force it to start stopped
        animationTime: 600,             // How long the slide transition takes
        buildNavigation: true,          // If true, builds and list of anchor links to link to each slide
		pauseOnHover: true,             // If true, and autoPlay is enabled, the show will pause on hover
		startText: "Go",             	// Start text
        stopText: "Stop"               	// Stop text
    });
    
    $('#allresources').masonry({ singleMode: true });
    
});

Cufon.replace('h1, #primary-menu', {
						hover: true,
						fontFamily: 'Californian'
			});

function validate_email(field,alerttxt) {
	with (field) { 
		apos=value.indexOf("@");
		dotpos=value.lastIndexOf(".");
		if (apos<1||dotpos-apos<2) {
			$("input#Field3").parent().addClass("error-line");
			$("input#Field3").after("<span class='error'>Not a valid e-mail address!</span>").focus();
			$("input#Field3").blur(function() {
				$(".error-line .error").empty();
				$(this).parent().removeClass("error-line");
			});
			return false;
		}
		else { return true; }
	}
}
function validate_form(thisform,fieldtovalidate)
{
	with (thisform)
	{
	if (validate_email(fieldtovalidate,"Not a valid e-mail address!")==false)
	  { return false;}
	}
}


function getPassword(thisTable,thisId){ 
	  var retVal = "" 
	  retVal = prompt("A password is required to view this video.", ""); 
	  thisURL="/video.cfm";
	  $.post(thisURL, { variable: thisTable, variable2: thisId, variable3: retVal }, function(data){
	    newAnswer=data.replace(/^\s*/, "").replace(/\s*$/, "");
		if (newAnswer == "No") {
	 	 	alert("Incorrect Password!");
		  	window.location.reload();
		  	return false;
		  }
		  else {
		  	return true;
		  } 
	  });
}