 //survey settings
 var showSurvey=true;
 var surveyURL = "http://www.surveymonkey.com/s.aspx?sm=MbBuvX4TPYLSo0W2nOxu3g_3d_3d%22%3EClick%3Chttp://www.surveymonkey.com/s.aspx?sm=MbBuvX4TPYLSo0W2nOxu3g_3d_3d%22%3EClick";
 
 
 $(document).ready(function(){
	
	
	// adds survey link to all pages based on 
	if(showSurvey){
		
		//for home page
		var home = $('#home-nav');
		if (home.size()>0) {
			var homeSurveyHtml = '<a id="home-survey" target="_blank" href="' + surveyURL + '">';
			homeSurveyHtml += '<span class="survey-begin">PLEASE <br/> TAKE OUR SURVEY</span>'
			homeSurveyHtml += "This site is a work in progress. We'd love <br/> to get your feedback on the info and videos you find here.  After you've had a chance to explore the site, click on this button - which you'll find on every page - to go to the Inside ITEST website feedback survey.";
			homeSurveyHtml += '<span class="survey-end">Thanks!</span>';
			homeSurveyHtml += '</a>';
			
			home.prepend(homeSurveyHtml);
			if (jQuery.browser.msie) {
				$('#home-nav').find('ul').css('padding-top', '14px');
			}
		}
		
		//for other pages
		var common = $('#common-top');
		if (common.size()>0) {
			var commonSurveyHtml ='<a id="survey" target="_blank" href="' + surveyURL + '">';
			commonSurveyHtml += 'Please take our survey.';
			commonSurveyHtml += '</a>';
			
			common.after(commonSurveyHtml);
			
			if (jQuery.browser.msie) {
				$('h1').css('background-position', '0 14px');
				$('h1').css('height', '105px');
			}
		}
	}
	
	
 	// rollover actions for common pages navigation
 	$(".slink").hover(
 		function () {		// when you hover over a selection in the sidebar
			$(this).parent().addClass("tempover");	// change the border color
			$(this).parent().animate({ width: "321px", backgroundPosition: "198px"}, 250 );

		},
 		function () {			// when you leave the area
			$(this).parent().removeClass("tempover");	
			$(this).parent().animate({ width: "239px", backgroundPosition: "116px"}, 250 );
		}

	);
	
 	// rollover actions for home page navigation
 	$(".hlink").hover(
 		function () {		// when you hover over a selection in the sidebar
			$(this).parent().addClass("tempover");	// change the border color
			$(this).parent().animate({ height: "181px"}, 250 );

		},
 		function () {			// when you leave the area
			$(this).parent().removeClass("tempover");	
			$(this).parent().animate({ height: "130px"}, 250 );
		}

	);

	// rollover for voices icon on home page
 	$("#home-voiceslink").hover(
 		function () {		// when you hover over the link to the voices page
			$(this).parent().css("background-image","url(i/voicese_icon_over.gif)");	// change the clip image
		},
 		function () {			// when you leave the area
			$(this).parent().css("background-image","url(i/voicese_icon.gif)");	// change the clip image back
		}

	);
	
	// rollover for voices icon on common pages
 	$("#voiceslink").hover(
 		function () {		// when you hover over the link to the voices page
			$(this).parent().css("background-image","url(i/voicese_icon_over.gif)");	// change the clip image
		},
 		function () {			// when you leave the area
			$(this).parent().css("background-image","url(i/voicese_icon.gif)");	// change the clip image back
		}

	);

	// create video iframe with no captions
	$("#mbt-nocapt").click(function(event){
		event.preventDefault();
		$("#mbt-nocapt").addClass("mbtHidden");
		$("#mbt-capt").addClass("mbtHidden");
		var ncurl="v/itestframe_main.html?name="+nocapt+"&type=nocaption";
		var vidarea=document.getElementById("videoframe");
		vidarea.src=ncurl;
	});
	
	// create video iframe with captions
	$("#mbt-capt").click(function(event){
		event.preventDefault();
		$("#mbt-nocapt").addClass("mbtHidden");
		$("#mbt-capt").addClass("mbtHidden");
		$(this).parent().addClass("captHeight");
		var curl="v/itestframe_main.html?name="+capt+"&type=caption";
		var vidarea=document.getElementById("videoframe");
		vidarea.height=283;
		vidarea.src=curl;
	});

	// create video iframe with no captions
	$("#bt-nocapt").click(function(event){
		event.preventDefault();
		$("#bt-nocapt").addClass("btHidden");
		$("#bt-capt").addClass("btHidden");
		var ncurl="v/itestframe_prof.html?name="+nocapt+"&type=nocaption";
		var vidarea=document.getElementById("videoframe");
		vidarea.src=ncurl;
	});
	
	// create video iframe with captions
	$("#bt-capt").click(function(event){
		event.preventDefault();
		$("#bt-nocapt").addClass("btHidden");
		$("#bt-capt").addClass("btHidden");
		$(this).parent().addClass("captHeight");
		var curl="v/itestframe_prof.html?name="+capt+"&type=caption";
		var vidarea=document.getElementById("videoframe");
		vidarea.height=283;
		vidarea.src=curl;
	});

	// create video iframe with no captions, video clip version
	$("#vbt-nocapt").click(function(event){
		event.preventDefault();
		$("#vbt-nocapt").addClass("btHidden");
		$("#vbt-capt").addClass("btHidden");
		var ncurl="v/itestframe_voices.html?name="+nocapt+"&type=vnocaption";
		var vidarea=document.getElementById("videoframe");
		vidarea.src=ncurl;
	});
	
	// create video iframe with captions, video clip version
	$("#vbt-capt").click(function(event){
		event.preventDefault();
		$("#vbt-nocapt").addClass("btHidden");
		$("#vbt-capt").addClass("btHidden");
		$(this).parent().addClass("vcaptHeight");
		var curl="v/itestframe_voices.html?name="+capt+"&type=vcaption";
		var vidarea=document.getElementById("videoframe");
		vidarea.height=306;
		vidarea.src=curl;
	});

 });

