var SlideTotal;var SlideUnit = 851;var Counnter = 0;var tempo = 8000;var tempo2 = 14000;var Tarja;var QuotLen;var GoneTime = 500;var RandonQuote;var ThisQuot;var DIE = false;$(document).ready(function () {    QuotLen = $('.NQuot').length;    RandonQuote = 0+Math.floor(Math.random() * QuotLen);    ThisQuot = RandonQuote;    var Menulast;    $('#Menu ul li a').mouseout(function (event) {        if (Menulast != undefined) {            Menulast.hide();        }    });    $('#Menu ul li a').mouseover(function (event) {        if (Menulast != undefined) {            Menulast.hide();        }        var Leg = $('#leg-' + Number($(this).parent().attr('id').substring(2)));        $(Leg).show();        Menulast = $(Leg);    });    var Currect = 0;    var unit = 763;    var Total = $("#showcase_scrl div img").length;    $(".SCBT_L").click(function (E) {        Currect--;        if (Currect < 0) {            Currect = Total - 1;        }        $("#showcase_scrl").animate({            marginLeft: -(unit * Currect) + "px"        }, 600);    });    $(".SCBT_R").click(function (E) {        Currect++;        if (Currect > (Total - 1)) {            Currect = 0;        }        $("#showcase_scrl").animate({            marginLeft: -(unit * Currect) + "px"        }, 600);    });    var S_2 = 595;    var S_1 = -178;    var S_3 = 520;    var LastServ;    var S_Total = $(".Servicos .Grab .servitem").length;	var ExtraMAr =19;	$(".servitem .dark").each(function(){		 var margin = Number($(this).attr('id').substring(4));		if(margin>5){			ExtraMAr =72;		}else{			ExtraMAr=19		}		$(this).attr('style','margin-top:'+(ExtraMAr+(35*margin))+'px;');	})    $(".Lista2 li a").click(function (event) {        event.preventDefault();        var Este = Number($(this).attr('class').substring(4));	$(".Lista2 li").each(function(){				$(this).removeClass('on');			})        LastServ = $(this).parent();        $(this).parent().addClass('on');        $('.Servicos .Grab').animate({            width: '0px'        }, 200, function () {            $(".Servicos .Grab").css('marginTop', -(S_3 * (Este)) + 'px');            $('.Servicos .Grab').animate({                width: 595 + 'px'            });        });    });    SlideTotal = $('.Slide').length;    SlideUnit = 851;    Counnter = 0;    Tarja = $('#tarja' + (Counnter + 1));	var LastInput;    $('#slide' + (Counnter + 1)).delay(tempo*2).fadeIn(tempo, ToNext);        $(".ContatoArea").find('input').focus(function (event) {				LastInput= $(this);        switch ($(this).val()) {        case "*Seu nome completo":            $(this).val('');			            break;        case "*Seu e-mail":            $(this).val('');			            break;        case "Telefone":            $(this).val('');			            break;        };		    });	    $(".ContatoArea").find('textarea').focus(function (event) {       CheckInput(LastInput);	   if ($(this).val() == "*Sua Mensagem...") {			            $(this).val('');        }		LastInput= $(this);    });	 $(".ContatoArea").find('textarea').focusout(CheckInput);	 $(".ContatoArea").find('input').focusout(CheckInput);    $('#Quot-' + (ThisQuot + 1)).fadeIn(GoneTime).delay(tempo2).fadeOut(GoneTime, nextquote);	$('#ToRoll').hover(function(E){		$('.Bazul_r').fadeIn(100);		$('.Bazul_l').fadeIn(100);			},function(E){		$('.Bazul_l').fadeIn(200).fadeOut(100);				$('.Bazul_r').fadeIn(200).fadeOut(100);	});			$('.Bazul_r').click(ToNext2);	$('.Bazul_l').click(function(E){		Counnter=Counnter-2;		ToNext2(E);	});	});function CheckInput(input){	if ($(this) != undefined) {		if ($(this).val() == "") {			switch ($(this).attr('name')) {				case "nome":					$(this).val('*Seu nome completo');										break;				case "email":					$(this).val('*Seu e-mail');										break;				case "tel":					$(this).val('Telefone');										break;				case "msg":					$(this).val('*Sua Mensagem...');										break;			};					}	}}function nextquote() {    ThisQuot++;    if ((ThisQuot + 1) > QuotLen) {        ThisQuot = 0;    }	    $('#Quot-' + (ThisQuot + 1)).fadeIn(GoneTime).delay(tempo2).fadeOut(GoneTime, nextquote);}function ToNext(event) {	if (DIE == false) {		Counnter++;		$('.Grab2').stop();		if ((Counnter >= (SlideTotal))) {			Counnter = 0;		}		if ((Counnter < 0)) {			Counnter = SlideTotal - 1;		}		if (Tarja != undefined) {			Tarja.hide();		}				$('.Grab2').animate({			marginLeft: -(SlideUnit * Counnter) + 'px'		}, 600).delay(tempo).fadeIn(tempo, ToNext);		Tarja = $('#tarja' + (Counnter + 1));		Tarja.show();	}else{		$('.Grab2').stop();	}}function ToNext2(event) {    Counnter++;	$('.Grab2').stop();    if (Counnter >= (SlideTotal)) {        Counnter = 0;    }	if((Counnter<0)){		Counnter = SlideTotal-1;	}    if (Tarja != undefined) {        Tarja.hide();    }	DIE=true;    $('.Grab2').animate({        marginLeft: -(SlideUnit * Counnter) + 'px'    }, 600);    Tarja = $('#tarja' + (Counnter + 1));    Tarja.show();}
