$(function(){

//jquery tablesorter
var myTextExtraction = function(node) {  
  var value = node.getAttribute("akesta:value");
  return value ? value : node.innerHTML;
}

//$.tablesorter.defaults.widgets = ['zebra'];

$("table.tb").tablesorter( {textExtraction: myTextExtraction} );

$("table.tb tr").hover(
function(){$(this).addClass("hover");$(this).css("cursor","pointer");},
function(){$(this).removeClass("hover");}
);

$("table.tb tbody tr").click(
function(){location.href = $("a", this).attr("href");}
);



$("#maintable").tablesorter( {textExtraction: myTextExtraction} );

$("#maintable tr").hover(
function(){$(this).addClass("hover");$(this).css("cursor","pointer");},
function(){$(this).removeClass("hover");}
);

$("#maintable tbody tr").click(
function(){location.href = $("a", this).attr("href");}
);



//for page TOP blog area

$("#blogtable").tablesorter( {textExtraction: myTextExtraction} );

$("#blogtable tr").hover(
function(){$(this).addClass("hover");$(this).css("cursor","pointer");},
function(){$(this).removeClass("hover");}
);

$("#blogtable tbody tr").click(
function(){location.href = $("a", this).attr("href");}
);



//for page TOP table area

$("#toptable").tablesorter( {textExtraction: myTextExtraction} );

$("#toptable tr").hover(
function(){$(this).addClass("hover");$(this).css("cursor","pointer");},
function(){$(this).removeClass("hover");}
);

$("#toptable tbody tr").click(
function(){location.href = $("a", this).attr("href");}
);



//jquery tablesorter for shout
var myTextExtraction = function(node) {  
  var value = node.getAttribute("akesta:value");
  return value ? value : node.innerHTML;
}

$("#maintable2").tablesorter( {textExtraction: myTextExtraction} );

$("#maintable2 tr").hover(
function(){$(this).addClass("hover");},
function(){$(this).removeClass("hover");}
);








//jquery.datepicker
if($("#datepicker").html() != null){
$.datepicker.setDefaults({showOn: 'both', buttonImageOnly: true,buttonImage: '', buttonText: ''});
$("#datepicker").datepicker({dateFormat: 'yy/mm/dd'});
}





//jquery.lightbox
/*
if($("a[@rel*=lightbox]").html() != null){

$('a[@rel*=lightbox]').lightBox({
	overlayBgColor: '#000',
	overlayOpacity: 0.6,
	imageLoading: '../common/script/lightbox_img/lightbox-ico-loading.gif',
	imageBtnClose: '../common/script/lightbox_img/lightbox-btn-close.gif',
	imageBtnPrev: '../common/script/lightbox_img/lightbox-btn-prev.gif',
	imageBtnNext: '../common/script/lightbox_img/lightbox-btn-next.gif',
	containerResizeSpeed: 350,
	txtImage: 'Imagem',
	txtOf: 'de'
   });

}
*/


$("a[@href^=http://www.youtube.com/watch], a[@href^=http://jp.youtube.com/watch]").lightpop();

});




