$(document).ready(function(){
/*============================================================================*/
/*============================= Variaveis ====================================*/
/*============================================================================*/
	value_option = new Array();
	id_option = new Array();
	text_option = new Array();
	total = $('#select option').length;
/*============================================================================*/

/*============================================================================*/
/*========================== Popula os Arrays ================================*/
/*============================================================================*/
	$('#select').find('option').each(function(){
		value_option.push($(this).attr('value'));
		id_option.push($(this).attr('id'));
		text_option.push($(this).attr('text'));
	});
	$('#select').hide();
/*============================================================================*/

/*============================================================================*/
/*============================ Cria ===========================================*/
/*============================================================================*/
	box= '<div id="selec_false">';
	box += '<div id="bt_sele"><div id="texto_sele">Teste</div></div>';
	box += '</div>';
	$('#select').parent().append(box);
	for(i=1;i<total;i++){
		$('#selec_false').append('<div class="option" style="margin-top:'+eval(28*(i-1))+'px"><div class="texto" name="'+value_option[i]+'">'+text_option[i]+'</div></div>');
	}
	
	$('#selec_false').find('.option').each(function(){$(this).hide()});
	
	$('#selec_false').toggle(function(){
		$('#selec_false').find('.option').each(function(){$(this).show()});
	},function(){
		$('#selec_false').find('.option').each(function(){$(this).hide()});
	})
	$('#texto_sele').html(text_option[0]);

	$('.texto').click(function(){
		urlx = $(this).attr('name');
		$('#texto_sele').html($(this).text());
		if(urlx != ""){
		urls = 'http://tiooscar.com.br/'
		location = urls+urlx;
		}
	});	
/*============================================================================*/
	

});
