$(function () {
    
    /*if($('.columns .column.second').height()>$('.columns .column.first').height()){
		$('.columns .column.first').height($('.columns .column.second').height()+20);
	}
	
	
	$('#customform-subscribe #Field1').val('First');
	$('#customform-subscribe #Field1').focus(function() {
		if($('#customform-subscribe #Field1').val()=='E-MAIL ADDRESS'){
			$('#customform-subscribe #Field1').val('');
		};
	});
	$('#customform-subscribe #Field1').blur(function() {
		if($('#customform-subscribe #Field1').val()== ''){
			$('#customform-subscribe #Field1').val('E-MAIL ADDRESS');
		};
	});
	
	
	$('.column.first .pagecontent img').each(function(index){
		var caption = $(this).attr('alt');
		var detail = $(this).attr('title');
		var side = $(this).attr('class');
		var width = $(this).attr('width') + 2;
		$(this).wrap('<div class="image-wrap ' + side + '" style="width:' + width + 'px" />');
		if($(this).attr('title') != ""){
			$(this).after('<span class="detail">' + detail + '</span>');
		}
		$(this).after('<span class="caption">' + caption + '</span>');
		$(this).removeClass();
	});
	*/
	$('.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
    });
    
});
    
Cufon.replace('#primary-menu a, h1, #banner .box h3, .module h3, .slide-detail .additional-info', {
	fontFamily: 'Avenir'
});
Cufon.replace('.slide-detail h2', {
	fontFamily: 'Avenir',
	textShadow: '2px 2px #999'
});
			
function validate_email(field,alerttxt) {
	with (field) { 
		apos=value.indexOf("@");
		dotpos=value.lastIndexOf(".");
		if (apos<1||dotpos-apos<2) {
			alert(alerttxt);
			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;
		  } 
	  });
}

function popUp1(message) {



var x = 20;

var y = 20;



	var windowparam = "width=" + 663 + ",height=" + 700 + ",scrollbars=yes,menubar=no,left="+x+",top="+y+",screenX="+x+",screenY="+y;

	popwin = window.open(message, "popwin", windowparam)

	popwin.opener = self;

	popwin.focus()

}

