// JavaScript Document

$(document).ready(function(){
	// main tabs
	$("#MainTabs ul li a").focus(function(){
		$(this).blur();
	});
	$("#MainTabs ul li a").click(function(){
		var c = $(this).attr("href");
		var l = $("#MainTabs ul li a").length;
		if ( c != "#" ) {
			$("#MainTabs ul li").removeClass("active");
			for ( i = 0; i < l; i++ ) {
				$($("#MainTabs ul li a").eq(i).attr("href")).hide();
			}
			$(this).parent().addClass("active");
			$($(this).attr("href")).show();
		}
		return false;
	});
	// end main tabs
	
	// report
	$("#PublicReport ul li a").focus(function(){
		$(this).blur();
	});
	$("#PublicReport ul li a").click(function(){
		var c = $(this).attr("href");
		if ( $(this).hasClass("no-link") && c != "#" ) {
			$(this).parent().toggleClass("open");
			$($(this).attr("href")).toggle();
		} else if ( ! $(this).hasClass("no-link") ) {
			return true;
		}
		return false;
	});
	// end report
});


function ChangeFoto(id,NewSrc,OrigScr,NewTxt)
{
	Foto = document.getElementById('DynFoto');
	Foto.src = NewSrc;
	FotoHref = document.getElementById('DynFotoHref');
	FotoHref.href = OrigScr;
	FotoText = document.getElementById('DynFotoDesc');
	FotoText.innerHTML = NewTxt;
	i=0;
	while(document.getElementById('DynFotoNum'+i)) {
		Preview = document.getElementById('DynFotoNumImg'+i);
  	  Preview.style.opacity = 1;
    	Preview.style.filter = 'alpha(opacity=100);';
		i++;
	}
	Preview = document.getElementById('DynFotoNumImg'+id);
    Preview.style.opacity = 0.5;
    Preview.style.filter = 'alpha(opacity=50);';
	return false;
}

function DefaultFoto(id)
{
	if(Preview = document.getElementById('DynFotoNumImg'+id)) {
    Preview.style.opacity = 0.5;
    Preview.style.filter = 'alpha(opacity=50);';
	}
	return false;
}
