// base url para chamar todos os scripts
var baseurl = $( 'base' ).attr( 'href' );

// funcao para mostrar as dicas via json
function show_tip( id_tip ) {
	$( '.tit_dica' ).find( 'a' ).css( 'cursor' , 'pointer' );
	$( '#dicas_complete' ).show();
	$( '#dicas_collapsed' ).hide();
	$.getJSON( 'index.php/json/tips/' + id_tip , function( e ) {
		if( e ) {
			$( '#tip_title' ).html( e.title );
			$( '#tip_content' ).html( e.text2 );
			if( e.text3 != null ){
				$( '#tip_image' ).html( e.text3 );
				$( '#tip_content' ).html( e.text1 + '<br />' + e.text2 )
			}else{
				$( '#tip_image' ).html( '&nbsp;' );
				$( '#tip_content' ).html( e.text1 + '<br />' + e.text2 );
			}
			$( '#tip_' + id_tip ).css( 'cursor' , 'default' )
		}
	} );
}

// funcao para fazer a troca do src
function show_variation( e ) {
//alert( 'a' );
	var $src = $( e ).val().toString();

	$( '#img_atual' ).hide();
	$( '#load_variation' ).show();

	$.get( $( 'base' ).attr( 'href' ) + 'index.php/json/image/' + $src , function( data ) {
//		alert( 'b' );
		$( '#img_atual' ).html( data );
		$( '#load_variation' ).hide();
		$( '#img_atual' ).show();
	} );
	
}