$(document).ready(function(){

	// BRIDGE login pt WHMCS	
	$.get("http://www.despregazduire.ro/suport/bridge.php", function (data){
		$('div#login').append (data);
	});
	
	// Zebra Stripes la table rows 
   $("tbody tr").mouseover(function(){$(this).addClass("over");}).mouseout(function(){$(this).removeClass("over");});
   $("tr:even").addClass("alt");
	
	// Toggle-ul de la tabelele de la gazduire si reseller
    $(".detalii_tabel_123").hide();
	$('.show_hide_123').click(function(){
		$(".detalii_tabel_123").slideToggle('slow', function() {
			if($('.detalii_tabel_123').is(':hidden')){
				$('.show_hide_123 span').text('Detalii');
				$('.pricing-table-button a.show_hide_123').removeClass('buttonblue').addClass('buttongreen');				
			} else {
				$('.show_hide_123 span').text('Inchide');
				$('a.show_hide_123').css("margin", "0 0 5px 0");
				$('.pricing-table-button a.show_hide_123').removeClass('buttongreen').addClass('buttonblue');
				}
		});
	});	

    $(".detalii_tabel_456").hide();
	$('.show_hide_456').click(function(){
		$(".detalii_tabel_456").slideToggle('slow', function() {
			if($('.detalii_tabel_456').is(':hidden')){
				$('.show_hide_456 span').text('Detalii');
				$('.pricing-table-button a.show_hide_456').removeClass('buttonblue').addClass('buttongreen');				
			} else {
				$('.show_hide_456 span').text('Inchide');
				$('a.show_hide_456').css("margin", "0 0 5px 0");
				$('.pricing-table-button a.show_hide_456').removeClass('buttongreen').addClass('buttonblue');
				}
		});
	});	
	
	// Rollover la toggleul de pe prima pagina
	$(".home-opening").mouseover(function(){
		$(this).stop().animate({height:'650px'},{queue:false, duration:600, easing: 'easeOutBounce'})
	});
	//When mouse is removed
	$(".home-opening").mouseout(function(){
		$(this).stop().animate({height:'79px'},{queue:false, duration:600, easing: 'easeOutBounce'})
	});	
	
	// SHOW / HIDE dropdown la tabelele de gazduire si reseller
    $(".selecteaza_server").hide();
	$('.show_hide_selecteaza_server').click(function(){
		$(".selecteaza_server").toggle();
	});		
    $(".selecteaza_server2").hide();
	$('.show_hide_selecteaza_server2').click(function(){
		$(".selecteaza_server2").toggle();
	});			
	
	// Formularul de quick quote de la design
    $(".cere_oferta").hide();
	$('.button-contact').click(function(){
		$(".cere_oferta").slideToggle('slow');
	});		

	// Live Chat - imi trebuie latimea ferestrei browserului	
	var winW = 630;
	if (document.body && document.body.offsetWidth) {
	 winW = document.body.offsetWidth;
	}
	if (document.compatMode=='CSS1Compat' &&
		document.documentElement &&
		document.documentElement.offsetWidth ) {
	 winW = document.documentElement.offsetWidth;
	}
	if (window.innerWidth && window.innerHeight) {
	 winW = window.innerWidth;
	}
	// diff = spatiu liber din dreapta intre div-ul mare al site-ului si si scrollbar
	// left = pozitionarea chat-ului in left: px
	var diff = (winW - 960)/2;
	var left = (winW - diff) + 3;
	// Daca diferenta e mai mare ca 100px - latimea imaginii atunci trec pe current
	// ca sa poata sa faca overflow
	if (diff < 100) {
		left = "current";	
	} 
	
	$("#live_chat").makeFloat({x:left,y:"current"});	

 });	
 
 
/*Doc Ready Functions*/
jQuery(function (a) {
    a(document).ready(function () {
        a("a[href=#top]").click(function () {
            a("html, body").animate({
                scrollTop: 0
            }, "slow");
            return false
        });
        a(".entry a img").hover(function () {
            a(this).stop().animate({
                opacity: "0.6"
            }, 300)
        }, function () {
            a(this).stop().animate({
                opacity: "1"
            }, 300)
        });
 	
 		$('.portfolio-item').hover(function(){  
       	 $(".thumb", this).stop().animate({top:'-45px'},{queue:false,duration:160});  
    			}, function() {  
        $(".thumb", this).stop().animate({top:'0px'},{queue:false,duration:160});  
   		 });
			
		
        a(".toggle_container").hide();
        a("h3.trigger").click(function () {
            a(this).toggleClass("active").next().slideToggle("normal");
            return false
        });
        a(".tab_content").hide();
        a("ul.tabs li:first").addClass("active").show();
        a(".tab_content:first").show();
        a("ul.tabs li").click(function () {
            a("ul.tabs li").removeClass("active");
            a(this).addClass("active");
            a(".tab_content").hide();
            var b = a(this).find("a").attr("href");
            a(b).fadeIn();
            return false
        })
    })
})

 
