/* 
 *
 * Jovi common functions
 *
 * Requires: jQuery 1.2+, dimensions plugin
 *
 */

function adjustFooter(){
	
	var windowHeight	= jQuery(window).height();
	var posTopFooter	= jQuery('.cont_footer').offset().top;
	
	jQuery('.cont_footer').height(windowHeight-(posTopFooter));
	
}

function contador(base, currentUrl, lang) {

		jQuery('.link_descarga a').click(function(){
			
			var l = jQuery(this).attr('href'),
			title = jQuery(this).parent().parent().parent().parent().find('h5').text();
		
			jQuery.ajax({
				type: 'GET',
				url: base+'/contadordescargas/index/',
				data: 'url='+l + '&lang='+lang + '&currentUrl=' + currentUrl +'&title='+title,
				success: function(){
				  window.location.href = 'http://www.jovi.es'+l;
				}

			});

			return false;

		});
		
		//data: 'url='+l + '&lang='+lang + '&currentUrl=' + currentUrl + '&titulo=' + titulo,			
		
}

function contadorTalleresMaestros (base, currentUrl, lang) {
	
	jQuery('.link_descarga a').click(function(){
		
		var l = jQuery(this).attr('href'),
		title = jQuery(this).attr('title');
	
		jQuery.ajax({
			type: 'GET',
			url: base+'/contadordescargas/index/',
			data: 'url='+l + '&lang='+lang + '&currentUrl=' + currentUrl +'&title='+title,
			success: function(){
			  window.location.href = l;
			}

		});

		return false;

	});
	
}

