function params(qp) { try{r=unescape(location.search.match(new RegExp(qp+"=+([^&]*)"))[1]);}catch(e){r='';} return r; }		
$(document).ready(function()
{
	

	/*-------------------------------------------    
		Open external links in a new window
	-------------------------------------------*/
	$("a[rel='external'],a.external").click(function() 
	{ 
		window.open($(this).attr('href'));
		return false; 
	});
	

	/*-------------------------------------------    
		Homepage Tabset
	-------------------------------------------*/
	$('div#main').wrapInner('<div id="main-js-wrap"></div>')
	$('.roll li:eq(0)').addClass('on');
	$('.roll li a').each(function(n)
	{
		var $anchor = $(this);
		$anchor.click(function ()
		{
			$anchor.parents('ul').find('.on').removeClass('on');
			$anchor.parents('li').addClass('on');
			
			var $main = $('#main');
			var $main_js_wrap = $('div#main-js-wrap');
			
			$('div#main').css({height: $main_js_wrap.height(), position:'relative'});
			$('div#main').append('<img id="ajax-loader" src="./img/widgets/circle-loader.gif" style="position:absolute; top:190px; left:49%;" />');
			$('div#main-js-wrap').fadeOut();
			$('div#main-js-wrap').load('./incluir/tabs/'+n+'.html', function()
			{
				$('img#ajax-loader').remove();
				$('div#main').css({height: 'auto'});
				$('div#main-js-wrap').fadeIn();
			});
			
			return false;
		});
	});
	
	/*------------------------------------------- 
	      JavaScript MENU
     -------------------------------------------*/

            $(function() {
				/**
				* for each menu element, on mouseenter, 
				* we enlarge the image, and show both sdt_active span and 
				* sdt_wrap span. If the element has a sub menu (sdt_box),
				* then we slide it - if the element is the last one in the menu
				* we slide it to the left, otherwise to the right
				*/
                $('#sdt_menu > li').bind('mouseenter',function(){
					var $elem = $(this);
					$elem.find('img')
						 .stop(true)
						 .animate({
							'width':'104px',
							'height':'104px',
							'left':'8px',
							'top':'8px'
						 },400)
						 .andSelf()
						 .find('.sdt_wrap')
					     .stop(true)
						 .animate({'top':'112px'},400)
						 .andSelf()
						 .find('.sdt_active')
					     .stop(true)
						 .animate({'height':'200px'},400,function(){
							var $sdt_descr = $elem.find('.sdt_descr');
							$sdt_descr.show();
							
						/*var $sub_menu = $elem.find('.sdt_box');
						if($sub_menu.length){
							var left = '155px';
							if($elem.parent().children().length == $elem.index()+1)
								left = '-155px';
							$sub_menu.show().animate({'left':left},200);
						}*/	
					});
				}).bind('mouseleave',function(){
					var $elem = $(this);
					var $sdt_descr = $elem.find('.sdt_descr');
							$sdt_descr.hide();
					
					/*var $sub_menu = $elem.find('.sdt_box');
					if($sub_menu.length)
						$sub_menu.hide().css('left','0px');*/
					
					$elem.find('.sdt_active')
						 .stop(true)
						 .animate({'height':'25px'},400)
						 .andSelf().find('img')
						 .stop(true)
						 .animate({
							'width':'0px',
							'height':'0px',
							'left':'85px'},400)
						 .andSelf()
						 .find('.sdt_wrap')
						 .stop(true)
						 .animate({'top':'0px'},400);
				});
            });
	});	


// Console Logging with Firebug
if(typeof(console) != "object") {var console = new Object(); console.log = function() {} };
var msie = navigator.userAgent.toLowerCase().indexOf('msie') > 0;
$D = function (str) { 
	if (!msie) console.log(str + '\n');
}
	

/* Begin JQuery link tracking */
// allows for link tracking to include a defined prefix for any given page
if (typeof(trackingPrefix) != "string") {trackingPrefix = "";}	else {	trackingPrefix = "/" + trackingPrefix;	}	


