
/*--------------------*/
/* Slide Show         */
/*--------------------*/

jQuery(function($) {
var timer;
var first=1;

function button1_click(event)
{

		$('.bn').animate({'left':'0px','top':'-10px'},300);
		$('#b1').animate({'left':'0px','top':'0px'},500);
		
	$(".slide").css("visibility","hidden");
		$("#image1").css("visibility","visible");
		$("#image1").css("opacity","0");
		$("ul.buttons li").removeClass("active");
		$("#button1").addClass("active");

		$("#image1").animate({"opacity":1},1000, "linear", null);

		if (first==1)
		{
			clearTimeout(timer);
			timer = setTimeout(eval("button2_click"),"10000");
		}
		else
		{
			clearTimeout(timer);
			timer = setTimeout(eval("button2_click"),"3500");
		}
}

function button2_click(event)
{
		$('.bn').animate({'left':'0px','top':'-10px'},300);
		$('#b2').animate({'left':'0px','top':'0px'},500);

	$(".slide").css("visibility","hidden");
		$("#image2").css("visibility","visible");
		$("#image2").css("opacity","0");
		$("ul.buttons li").removeClass("active");
		$("#button2").addClass("active");

		$("#image2").animate({"opacity":1},1000, "linear", null);

		clearTimeout(timer);
		timer = setTimeout(eval("button3_click"),"3500");
}

function button3_click(event)
{
		$('.bn').animate({'left':'0px','top':'-10px'},300);
		$('#b3').animate({'left':'0px','top':'0px'},500);
		
	$(".slide").css("visibility","hidden");
		$("#image3").css("visibility","visible");
		$("#image3").css("opacity","0");
		$("ul.buttons li").removeClass("active");
		$("#button3").addClass("active");

		$("#image3").animate({"opacity":1},1000, "linear", null);

		clearTimeout(timer);
		timer = setTimeout(eval("button4_click"),"3500");
}

function button4_click(event)
{
		$('.bn').animate({'left':'0px','top':'-10px'},300);
		$('#b4').animate({'left':'0px','top':'0px'},500);
		
	$(".slide").css("visibility","hidden");
		$("#image4").css("visibility","visible");
		$("#image4").css("opacity","0");
		$("ul.buttons li").removeClass("active");
		$("#button4").addClass("active");

		$("#image4").animate({"opacity":1},1000, "linear", null);

		clearTimeout(timer);
		timer = setTimeout(eval("button1_click"),"3500");
}

$('#button1').bind('mouseenter', button1_click);
$('#button2').bind('mouseenter', button2_click);
$('#button3').bind('mouseenter', button3_click);
$('#button4').bind('mouseenter', button4_click);

button1_click(event,first);
var first=0;

});

/*--------------------*/
/* Escolha de Idiomas */
/*--------------------*/

	var lang_actual = document.getElementById('lang').value;

function funcLang(){
	var select_list_field = document.getElementById('lang');
	var select_list_selected_index = select_list_field.selectedIndex;

	var text = select_list_field.options[select_list_selected_index].text;
	var value = select_list_field.value;
	var url = window.location.href;
	var ind = url.indexOf(".php");
	if (ind != -1) {
		var url = url.substring(0,ind+4);
	}
	if (value!= '' && value!=lang_actual){
	window.location.href = 'language.php?language=' + value +'&pagina='+ url;
	}
}


/*--------------------*/
/* Select all         */
/*--------------------*/
	function select_all(obj){
		obj.focus();
		obj.select();
	}
	
	
/*--------------------*/
/* show/hide boxText  */
/*--------------------*/
	
	function f_show(obj) {
            $(obj).click(function() {
                $(this).parent().find('.boxText').show(100);
                $(this).parent().find('.boxText').css("opacity",0);
                $(this).parent().find('.boxText').animate({"opacity":1},300, "linear", null);
                $(this).css("display","none");
				$(this).parent().find('.hide').css("display","block");
        });
    }
/*	<div href="#" class="show right" onclick="javascript:f_show(this);"></div>	*/

	function f_hide(obj) {
            $(obj).click(function() {
                $(this).parent().find('.boxText').animate({"opacity":0},300, "linear", null);
                $(this).parent().find('.boxText').hide(100);
                $(this).css("display","none");
				$(this).parent().find('.show').css("display","block");
        });
    }
/*	<div href="#" class="hide right" onclick="javascript:f_hide(this);"></div>	*/


/*----------------------*/
/* C2C MSN WebX Sidebar */
/*----------------------*/

	function C2CSBar(id) {
		var url='http://www.nxtsolution.net/webapps/c2c/index.php?hash='+id+'';
		var args = 'width=300,height=100,scrollbars=no,fullscreen=no,toolbar=no,location=no,status=no,menubar=no,resizable=no';
		var title = 'NEXT | C2C';
	window.open(url, "Contact", args);}

	document.getElementById("divMSNLoad").style.display="none";
	document.getElementById("divMSN").style.display="block";

	function WebXSBar(id) {
		var url='http://www.nxtsolution.net/webapps/webx/index.php?hash='+id+'';
		var args = 'width=250,height=400,scrollbars=no,fullscreen=no,toolbar=no,location=no,status=no,menubar=no,resizable=no';
		var title = 'NEXT | WebX';
	window.open(url, "WebX", args);}

	
	
/* Nao sei pq serve   

	function sndReqMSNStatus() { 
		document.getElementById("divMSN").innerhtml=document.getElementById("msnStatusLoad").innerHTML;
		alert('done');
	} 
*/


/*--------------------*/
/* WebX WEBX-view.php */
/*--------------------*/
	function openClickWebX(id){
		var url='http://www.nxtsolution.net/webapps/webx/index.php?hash='+id+'';
		var args = 'width=250,height=400,scrollbars=no,fullscreen=no,toolbar=no,location=no,status=no,menubar=no,resizable=no';
		var title = 'NEXT | WebX';
		window.open(url, "WebX", args);
	}

/*--------------------*/
/* C2C C2C-view.php   */
/*--------------------*/
	function openClickC2C(id){
		var url='http://www.nxtsolution.net/webapps/c2c/index.php?hash='+id+'';
		var args = 'width=300,height=100,scrollbars=no,fullscreen=no,toolbar=no,location=no,status=no,menubar=no,resizable=no';
		var title = 'NEXT | C2C';
		window.open(url, "C2C", args);
	}
