// functia schimba la mouseover, titlul si descrierea din pagina cu lista de proiecte
function afiseazaDetaliiProiect (titlu, descriere) {
	// schimba titlul
	$('#TitluProiect').html('<img src="dyn_images/portofoliu/' + titlu + '" border="0" />');
	
	// schimba descrierea
	$('#InfoProiect').html(descriere);

	// fac vizibile cele 2 layere
	showHide('#TitluProiect', 'afiseaza');
	showHide('#InfoProiect', 'afiseaza');
}

// functia afiseaza sau ascunde un camp de formular
function showHide (id, stare) {
	if (stare == 'ascunde') {
		$(id).css({'display' : 'none'});
		$(id).css({'visibility' : 'hidden'});
	} else {
		$(id).css({'display' : 'block'});
		$(id).css({'visibility' : 'visible'});
	}
}

// functie antispam pentru afisarea email-urilor
function email_antispam(b){
	var a,b,c,d,e,f,g,h,i
	a='<a href=\"mai'
	c='\">'
	a+='lto:'
	b+='@'
	e='</a>'
	f=''
	b+='directdesign.ro'
	document.write(a+b+c+b+e)
}


function cauta (str) {
	showHide('#ContainerExpresiiCautate', 'ascunde');
	$('#cauta').val(str);
	$('#frm_cautare').submit();
}


function ascundeLista () {
	if (isAfaraDinLista && isAfaraDinCamp)
		$('#ContainerExpresiiCautate').hide();

}



/**
 * This is the callback function which receives notification
 * about the state of the prev button.
 */
function mycarousel_buttonPrevCallback(carousel, button, enabled) {
    if (enabled) {
    	var src = 'images/home-nav-back.png';
		var cursor = 'pointer';
    } else {
    	var src = 'images/home-nav-back-off.png';
		var cursor = 'default';
    }
	$('#btn-nav-prev').attr("src", src);
	$('#mycarousel-prev').css({'cursor' : cursor});
};

/**
 * This is the callback function which receives notification
 * about the state of the next button.
 */
function mycarousel_buttonNextCallback(carousel, button, enabled) {
    if (enabled) {
    	var src = 'images/home-nav-next.png';
		var cursor = 'pointer';
    } else {
    	var src = 'images/home-nav-next-off.png';
		var cursor = 'default';
    }
	$('#btn-nav-next').attr("src", src);
	$('#mycarousel-next').css({'cursor' : cursor});
};

/**
 * We use the initCallback callback
 * to assign functionality to the controls
 */
function mycarousel_initCallback(carousel) {
    jQuery('#mycarousel-next').bind('click', function() {
        carousel.next();
        return false;
    });

    jQuery('#mycarousel-prev').bind('click', function() {
        carousel.prev();
        return false;
    });
	
	// Pause autoscrolling if the user moves with the cursor over the clip.
	carousel.clip.hover(function() {
		carousel.stopAuto();
	}, function() {
		carousel.startAuto();
	});
};


