$(document).ready(function(){
	
	// custom scrollbars
	
	
	$('.videolink a').click(function() {
		$('#media_banner_23').cycle('pause');
		$('#video1').css('top',$(document).scrollTop()).animate({opacity:'1'},500,function() {
			//player_6.play();
			$('#video_player1').html('<iframe width="640" height="510" src="http://www.youtube.com/embed/6edYkV0fSLk" frameborder="0" allowfullscreen></iframe>');
		});
		return false;
	});
	
	$('#video_close1').click(function() {
		//player_6.pause();
		$('#video1').animate({opacity:'0'},500,function() {
			$('#video1').css('top','-100%');
			$('#video_player1').html('');
			$('#media_banner_23').cycle('play');
		});
		return false;
	});
	
	$('#endorse_vid').click(function() {
		$('#media_banner_23').cycle('pause');	
		$('#video2').css('top',$(document).scrollTop()).animate({opacity:'1'},500,function() {
			//player_7.play();
			$('#video_player2').html('<iframe width="640" height="390" src="http://www.youtube.com/embed/XLKbtmi6r7U" frameborder="0" allowfullscreen></iframe>');
		});
		return false;
	});
	
	$('#video_close2').click(function() {
		//player_7.pause();
		$('#video1').animate({opacity:'0'},500,function() {
			$('#video2').css('top','-100%');
			$('#video_player2').html('');
			$('#media_banner_23').cycle('play');
		});
		return false;
	});


	/*
$('#modalvideo').jqm({toTop:true, overlay:70});

	$('#modalvideo2').jqm({toTop:true, overlay:70});

	$('.videolink a,.interior_videolink a').click(function(event){
		$('#modalvideo').jqmShow();
		event.preventDefault();
	});
	
	$('#endorse_vid').click(function(event){
		$('#modalvideo2').jqmShow();
		event.preventDefault();
	});
		
	$('#modalvideoclose').click(function(event){
		$('#modalvideo').jqmHide();
		event.preventDefault();
	});
	$('#modalvideoclose2').click(function(event){
		$('#modalvideo2').jqmHide();
		event.preventDefault();
	});
*/
	setTimeout(function() {
		$('#maincontent').jScrollPane({showArrows:true})
		},100);

	
});


function obscureAddMid() {
  document.write('&#64;');
}
function obscureAddEnd() {
  document.write('&#46;');
}

