// JavaScript Document
//Mypod Pod page init

$(document).ready(function() {
			
  	//accordion
			$('#accordion').accordion({
				header: ".ui-accordion-header"
				,clearStyle: true
			});

	//  Ajax
	//ID
	/* $('.chk_uid').ajaxContent({
	  loaderType:'img',   
          loadingMsg:'/images/ajax-mypod.gif',
	      target:'#username',
		  bind:'#username',
		  type:'POST',
		  success:function(target){   
          		$(target).css({color: 'red',border:'1px dotted #FF0000'});
		  		alert ('success');},
		  error: function(target){   
          		$(target).css({color: 'red',border:'1px dotted #FF0000'});
		  		alert ('ID is in use');}
          });
	*/
	// Video Modal
	//$('a[href="#modal"]').click(function(){
	//		$("#Video").dialog({ 
	//			modal: true, 
	//			height: 455,width: 540,title: 'My Pod  Video',
	//			overlay: { 
	//				opacity: 0.5, 
	//				background: "#990000" } }) 
	//});
	
	$("#listing").tablesorter( 
			  {headers :{1:{sorter: false},2:{sorter: false},3:{sorter: false}} ,widgets: ['zebra']
    }); 
	$("#userlist").tablesorter( 
			  {headers :{7:{sorter: false}} ,widgets: ['zebra'] })
	              .tablesorterPager({container: $("#pager"),size: 40,positionFixed: false}); 
	$("#revlist").tablesorter( 
			  {widgets: ['zebra']
    }); 
	$("#podlist").tablesorter( 
			  {widgets: ['zebra']
    }); 

//	$("#tablist").tablesorter( 
//			  {headers :{1:{sorter: false},2:{sorter: false}} }); 

	$("#catlist").tablesorter( 
			  {headers :{4:{sorter: false},5:{sorter: false},6:{sorter: false}} ,widgets: ['zebra']
    }); 
	$("#preslist").tablesorter( 
			  {headers :{8:{sorter: false}} ,widgets: ['zebra']})
                             .tablesorterPager({container: $("#pager"),positionFixed: false}); 
    $("#newslist").tablesorter( 
			  {headers :{5:{sorter: false}} ,widgets: ['zebra']})
                             .tablesorterPager({container: $("#pager"),positionFixed: false}); 
	 $("#prereglist").tablesorter( 
			  {headers :{8:{sorter: false}} ,widgets: ['zebra']})
                             .tablesorterPager({container: $("#pager"), size:20 ,positionFixed: false}); 
	
	// video modal Ajax
	$('.modi').ajaxContent({
	       loaderType:'img',   
       loadingMsg:'/images/ajax-barloader.gif',
	   	       target:'#modal',
		   success: function(target){
			$("#Video").dialog({ 
				modal: false, 
				height: 455,width: 540,title: 'My Pod Video',
				overlay: { 
					opacity: 0.5, 
					background: "#000000" }} )}
          });

        // Address Tool Tip
       $('a.addr').cluetip();

	//Update Pod Access
	var options = { 
		success:    function() { 
        alert("Update Successful!"); 
    } 	,failure:    function() { 
        alert("Issue with update!"); 
    } 	}; 	
	$('#podupd').ajaxForm(options); 

// Presentaion working message
$("#submit").hide();
$("#admin").submit(function () {
$("#submit").show()	,					
$("#submit").dialog({ 
				modal: false, 
				height: 80,width: 280,title: 'Working...',
				overlay: { 
					opacity: 0.5, 
					background: "#000000" }} )}
);
// end
});
