// JavaScript Document

function init(){
	//Enlaces externos
	$('a[href^="http://"], a[href$=".pdf"]').click(function(){
		window.open(this.href, '_blank');
		return false;
	});
	
	//Portal transaccional
	$('#nav_transaccion').click(function(){
		var width = 1024;
		var height = 768;
		var pt = window.open(this.href, '01', 'directories=no,status=yes,scrollbars=yes,resizable=yes,width='+width+',height='+height+',top=0,left=0');
		pt.focus();
		return false;
	});
}

//Agentes de cobranza
function agentes(){
	$('#cobranza').wrap('<div style="display:none" />');
	$('a#inline').fancybox({
		'padding': 1,
		'autoDimensions': false,
		'width': 780,
		'height': 500,
		'hideOnContentClick': false
	});
}

//Informacion corporativa
function infocorp(){
	//$('#infocorp .pag:gt(0)').hide();
	$('#navint1 a:eq(0)').addClass('on');
	//$('#infocorp .pag:gt(1)').hide();
	$('#navint2 a:eq(0)').addClass('on');
	//$('#infocorp .pag:gt(2)').hide();
	$('#navint3 a:eq(0)').addClass('on');
    //$('#infocorp .pag:gt(3)').hide();
	$('#navint4 a:eq(0)').addClass('on');
    //$('#infocorp .pag:gt(4)').hide();
	$('#navint5 a:eq(0)').addClass('on');
    //$('#infocorp .pag:gt(5)').hide();
	$('#navint6 a:eq(0)').addClass('on');
	//$('#infocorp .pag')
	//$('#navint a').click(function(){
	//	$('#infocorp .pag').hide();
	//	var pag = ($(this).attr('href'));
	//	$(pag).fadeIn();
	//	$('#navint a').removeClass('on');
	//	$(this).addClass('on');
	//	return false;
	//});
}

$(document).ready(function(){
	init();
	if($('#pagos').length > 0) agentes();
	if($('#infocorp').length > 0) infocorp();
});