// jQuery ready stuff ------------------------------------------------------------------------------------------------------------------------------

$(document).ready(function () {
		// tips
	
		// rounded corners
		$('.roundme').corner("5px");
		$('ul.css-tabs a').corner("top keep 5px");
		$('ul.nav-tabs a').corner("keep 5px");
		$('.tabset').corner("bottom right keep 5px");
		
		// Lighboxes
		$(".sup_message").colorbox({iframe:true, innerWidth:625, innerHeight:650});
		$(".channel_info").colorbox({iframe:true, innerWidth:425, innerHeight:344});
        $(".swfPop").colorbox({iframe:true, innerWidth:650, innerHeight:500});
        $(".jplayerPop").colorbox({iframe:true, innerWidth:718, innerHeight:560});
        $(".swfPoppy").colorbox({iframe:true, innerWidth:700, innerHeight:450});
		
		$(".lb1").colorbox({innerWidth:650, innerHeight:600, inline:true, href:"#IDonTV"});
		$(".newsletterinput").colorbox({iframe:true, innerWidth:700, innerHeight:500});
		
		$(".chatwithme").colorbox({width:"500px", title:"", height:"550px", iframe:true}); 
		
		$(".singleLink").colorbox({width:"400px", title:"", height:"150px", iframe:true, href: function(){
				     var service = $(this).attr('id');	
					 var url = "/bundleZip.cfm?switch=single&service=";
					 var gourl = url + service;
					 return gourl;
					 
																							  }
																							  });

		
		// customer center accordion
		$('#custCenter').accordion({
			active: false,
			header: 'div.acctitle',
			alwaysOpen: false
		});
		$('.accord1').accordion({active: false,header: 'div.acctitle',alwaysOpen: false, autoheight: false});
		$('.accord2').accordion({active: false,header: 'div.acctitle',alwaysOpen: false, autoheight: false});
		// homeslider
		$("#homeFlow").jFlow({
			slides: ".mySlides",
			controller: ".jFlowControl", // must be class, use . sign
			slideWrapper : ".jFlowSlide", // must be id, use # sign
			selectedWrapper: "jFlowSelected",  // just pure text, no sign
			width: "671px",
			height: "339px",
			duration: 400
		});
		
		// Tabsets
		$('#pagenav .nav-tabs a').each(function(index) {
				$(this).click(function() {
					$(this).parents('ul').find('a').removeClass('current'); $(this).addClass('current');
					$('#pagenav .navtabset .pane:eq('+index+')').siblings().hide().end().show();
					return false;
				});
			});
		$('#pagenav .nav-tabs a:first').click();	
		//Whats playing...
			
			$('#playing .css-tabs a').each(function(index) {
				$(this).click(function() {
					$(this).parents('ul').find('a').removeClass('current'); $(this).addClass('current');
					$('#playing .tabset .pane:eq('+index+')').siblings().hide().end().show();
					return false;
				});
			});
			$('#playing .css-tabs a:first').click();		
			
			$('#movies').cycle({fx:'fade',
							   speed:'fast',
							   timeout:0,
							   next:'#nextmovie',
							   prev:'#prevmovie',
							   cleartype:false
							   });
			
			$('#hd').cycle({fx:'fade',speed: 'fast',timeout: 0,next:'#nexthd',prev:'#prevhd', cleartype: false});
			$('#vod').cycle({fx:'fade',speed: 'fast',timeout: 0,next:'#nextvod',prev:'#prevvod', cleartype: false});
			
		   
			$('.digExtras') 
				.cycle({ 
					speed:  600,  
					pager:  '.extra_nav',
					next:'.next',
					prev:'.prev',
					cleartype: false,
					timeout: 5000,
					pause: 1 
			});
				
			
			$('.digExtras_1') 
				.cycle({ 
					speed:  600,  
					pager:  '.extra_nav_1',
					next:'.next',
					prev:'.prev',
					cleartype: false,
					timeout: 5000,
					pause: 1 
			});
				
			$('.digExtras_2') 
				.cycle({ 
					speed:  600,  
					pager:  '.extra_nav_2',
					next:'.next',
					prev:'.prev',
					cleartype: false,
					timeout: 5000,
					pause: 1 
			});
				
			$('.scroller').jScrollPane({showArrows:true, scrollbarWidth: 33, scrollbarMargin:10,reinitialiseOnImageLoad: true});
    });

// Form Functions ------------------------------------------------------------------------------------------------------------------------------
function clear_focus(e,o){
if(o.firstTime){return}
o.firstTime=true
o.value=""
}

function pleasewait(){
	$('#maincontent').hide();
	$('#loading').show();
}

