function minCompare(arrSelect, limit) {
	var count = 0;
	for(var i = 0; i < arrSelect.length; i++) {
		if(arrSelect[i].checked == true)
			count++;
	}
	if(count >= limit)
		return true;
	else
		return false;
}

function showTextIS(arrOpc) {

	var opc = "";

	for(var i = 0; i < arrOpc.length; i++) {
		if(!arrOpc[i][1])
			continue;
		
		opc += getOpcional(arrOpc[i][0]) +", ";
		
	}
	
	return opc.substring(0, (opc.length - 2));
	
}

function getOpcional(t) {
	var text = '';
	switch(t) {
		case 'abs' : text = 'ABS'; break;
		case 'alarme' : text = 'Alarme'; break;
		case 'airBag' : text = 'Airbag'; break;
		case 'airBagDuplo' : text = 'Airbag Duplo'; break;
		case 'arCond' : text = 'Ar Condicionado'; break;
		case 'arQuente' : text = 'Ar Quente'; break;
		case 'bcoCou' : text = 'Banco de Couro'; break;
		case 'blindado' : text = 'Blindado'; break;
		case 'capotaMari' : text = 'Capota Marítima'; break;
		case 'cdPlayer' : text = 'CD Player'; break;
		case 'cdPlayerMp3' : text = 'CP Player MP3'; break;
		case 'compBordo' : text = 'Computador de Bordo'; break;
		case 'controlTracao' : text = 'Controle de Tração'; break;
		case 'controlVeloc' : text = 'Controle de Velocidade'; break;
		case 'desembTraseiro' : text = 'Desembaçador Traseiro'; break;
		case 'dirHid' : text = 'Direção Hidráulica'; break;
		case 'encostoTraseiro' : text = 'Encosto Traseiro'; break;
		case 'farolNeblina' : text = 'Farol de Neblina'; break;
		case 'limpTraseiro' : text = 'Limpador Traseiro'; break;
		case 'retroEle' : text = 'Retrovisor Elétrico'; break;
		case 'rodaLigaLeve' : text = 'Roda de Liga Leve'; break;
		case 'sensorEstacio' : text = 'Sensor de Estacionamento'; break;
		case 'tetoSolar' : text = 'Teto Solar'; break;
		case 'tracao4x4' : text = 'Tração 4x4'; break;
		case 'travaEle' : text = 'Trava Elétrica'; break;
		case 'vidroEle' : text = 'Vidro Elétrico'; break;
		case 'volanteRegula' : text = 'Volante com Regulagem'; break;
	}
	
	return text;
}

function zeroLeft(n) {
	var s = new String(n);
	if(s.length == 1) {
		return "0"+n
	}
	return n;
}