$(document).ready(function() {
								


$(".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"] });




$('#toggle-list').hide();

$('.toggle-link').click(function(){

$(this).parents("h2").next('#toggle-list').animate({ height: 'toggle', opacity: 'toggle' }, 'fast' );
			//toggle + and -
		 if ($(this).parents('h2').find('span.toggle-link').text() == "+"){
			 $(this).parents('h2').find('span.toggle-link').text("-")
		 }
		 else if ($(this).parents('h2').find('span.toggle-link').text() == "-"){
			 $(this).parents('h2').find('span.toggle-link').text("+")
		 }
	
	
	return false;
});


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

$('.playlist,#tabs').show();
$('.tile,.playlist,.tv_search').corner();

$('.video_details').corner({
						   tr:false,
						   tl:false,
						   br:{radius:6},
						   br:{radius:6}
						   });

	
	$('.playlist ul').each(
								 
	function(intIndex){
	
		var lisize=$(this).children('li').size();
		var lilast=$(this).children('li:last').size();

			if (lisize < 3) {
			   $(this).parent('div').addClass('pl-med');
			}
			if (lisize < 2) {
			      $(this).parent('div').removeClass('pl-med').addClass('pl-sm');
			} 
			if (lisize > 2) {
			      $(this).parent('div').removeClass('pl-sm').removeClass('pl-med').addClass('pl-lg');
			} 
				
	}
								 
);			

$('.scroll-pane').jScrollPane({scrollbarMargin:0,showArrows:true});

$('.nyroModal').nyroModal();

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

var profiles =
{

	window1000:
	{
		height:1000,
		width:1000,
		status:1,
		center:1
	}
};


	$(".popupwindow").popupwindow(profiles);



});