$(document).ready(function() {
	

$.localScroll();
$('.quicklinkshelp').parent().localScroll();
$(".morefields").hide();  //hides extrafields onload on the feedback form

$(".pm_box").corner("11px"); //adds rounded corner to private message box
$(".profileBoxBlue").corner("11px"); //adds rounded corner to private message box
$(".profileBoxGray").corner({
				tl: false,
				tr:false,
			bl: { radius: 7 },
			  br: { radius: 7 }
							   }); //adds rounded corner to quicklinks box
$(".helpBoxGray").corner({
				tl: false,
				tr:false,
			bl: { radius: 7 },
			  br: { radius: 7 }
							   }); //adds rounded corner to quicklinks box

$(".helpQuickLinks tr:not(:last-child)").find("td").removeClass("qlbtm").addClass("qltop");

$(".toggleTomo").corner({
			  tl: false,
			  tr: false,
			  bl: { radius: 5 },
			  br: { radius: 5 },
			  antiAlias: true,
			  autoPad: true,
			  validTags: ["span"] });
$(".toggleTE").corner({
			  tl: false,
			  tr: false,
			  bl: { radius: 5 },
			  br: { radius: 5 },
			  antiAlias: true,
			  autoPad: true,
			  validTags: ["span"] });

$(".tablink").parent().find(".sub").hide(); //hides submenus on pageload

$(".tabonlink").parent().find(".sub").show(); //show active submenus on pageload

//on page load hide all 'inactive' subnav
$(".tabonlink").parent().siblings().find(".sub").hide();


// tab hover function
$(".tablink").hover(function(){
		$(this).parent().addClass("tabhover");				//show the tab bkg on hover	
		$(this).parent().siblings().find(".sub").hide();	//hide all other tabs subnav
		$(this).parent().find(".sub").show();				//show this tab's subnav
	},function(){
		$(this).parent().removeClass("tabhover");				//remove the tab bkg 
		$(this).parent().find(".sub").hide();					//hide this tab's subnav
		$(".tabonlink").parent().find(".sub").show();			//show this page's subnav by default
	});	


$(".tab .sub").hover(function(){							
		$(this).show();										//shows the subnav when hovered
		$(this).parent().addClass("tabhover");				//preserves tab bkg on subnav hover
		$(".tabonlink").parent().find(".sub").hide();		//hides this pages default subnav
	},function(){
		$(this).hide();									//hides the subnav
		$(this).parent().removeClass("tabhover");		//removes the tab bkg
		$(".tabonlink").parent().find(".sub").show();	//shows this pages default subnav

	});

// toggle help Q/A
//controls view via the question link
$(".togglethis").click(function(){
		
			
		$(this).parent().next(".answer").animate({ height: 'toggle', opacity: 'toggle' }, 'fast');
	    $(this).parent("div").toggleClass("toggleminus");
	
		return false;
  });

	// Tabs
				$('#tabs').tabs();
				
				$('.video_details').corner();
			
				$('.ui-tabs-panel').corner({
							  tr: { radius: 6 },
							  tl:false,
							  bl: { radius: 6 },
							  br: { radius: 6 }}
							  );
				
					$('.tile,.playlist').corner();
				
			
					
	



//external links to open in new window
$('a[@rel*="external"]').click( function() {
window.open( $(this).attr("href") );
return false;
});



});