
function searchSite (){

var searchText = 'SEARCH SITE';

	$('.sisea-search-form label').hide();


$("#search").attr('value' , searchText).focus(function(){		
			
			if( $(this).attr('value') == searchText)
					$("#search").attr('value' , '')	})	
			
			.blur(function(){		
			if (($(this).attr('value') == '')){
				$("#search").attr('value' , searchText)		
			}	
});


}

function videoControl (){
	hideVideos ();
	
	$(".section7").show();
	
	$("#7").addClass('active');
	
	$("#video_nav li").click(function(){
		var clickedSection = $(this).attr("id");
		hideVideos ();
		removeActive ();
		$(this).addClass('active');
		$(".section" + clickedSection).show(500);
	
	});
}

function hideVideos (){
	var sections = $("#video_wrap > div").size();
	var i=0;
	for (i=0;i<=sections-1;i++)
		{
			$(".section"+i).hide();
		}
}

function removeActive (){
	$("#video_nav li").removeClass('active');

}

function col2width (){

 var content = $.trim($("#inside_column2_wrapper").html()).length;
    
  if(content > 0) {
  	$('#inside_column1').addClass('marginRight');
  }else {
  	$('#inside_column2').hide();
  }
}


function footerLine (){
 var content = $.trim($("#footnotes_wrapper").html()).length;
 var footnotecss = {'border-top':'1px solid #000','padding-top':'20px', 'clear':'both'}
  if(content > 0) {
  		$('#footnotes').css(footnotecss);
  }
}

function implantToggle (){

	$("#cutaway").hide();
	
	$("#implantToggle").mouseenter(function(){
		$("#overlay").hide();
		$("#cutaway").show();	
	});
	
	$("#implantToggle").mouseleave(function(){
		$("#cutaway").hide();
		$("#overlay").show();	
	});
}


function insideMoviePlayer (){

	var sections = $("#video_inside_wrap > div").size();
	var i=0;
	
	for (i=1;i<sections;i++)
		{
			$(".inside"+i).hide();
		}
}



function videoThumbs (){
	
	$(".thumb0").addClass('active');
	
	$("#videoPics_bg div").click(function(){
		removeActiveVideoThumbs ();
		$(this).addClass('active');
	});
}

function removeActiveVideoThumbs (){
	$("#videoPics_bg div").removeClass('active');

}



//Media links functionality

function printPage () {
	$(".print").click(function(){
		print();
	});


}

function fontSizes () {

var main = "#mainContent"

	$(".fontIncrease").toggle(
		function() {
			$(main).addClass('increase1');
		},
		function() {
			$(main).removeClass('increase1').addClass('increase2');
		},
		function() {
			$(main).removeClass('increase2');
		}		
	);
}


function emailURL () {

var subject = "A shared link from ED Cure"
var linkText = '<img src="assets/images/email_icon.png" title="Email Page" alt="Email Page" />	'

	$(".email").html(
		'<a href="mailto:?Subject=' + subject +'&body=' + document.URL + '">' + linkText + '</a>'	
	);
}
