var arr_cabos = new Array();

function go_page(mylink){
		 mframe = document.getElementById('myframe');
		 mframe.src = mylink; 	 
}

function change_diametro_antigo(mselect){
	var valor = mselect.options[mselect.selectedIndex].text;
	lyr = document.getElementById('form_diametro_outro');
	if( valor == 'outro' ){
		 lyr.style.display = '';
	}else{
		 lyr.style.display = 'none'; 
	}
}

function change_diametro(mselect){
	var index =mselect.selectedIndex;
	var lyr = document.getElementById('lyr_preco');
	var str = "";
	var preco = "";
	if( index > 0 ){
		preco = arr_cabos[index-1];
		str = "Preço:&nbsp;&nbsp;" + preco;
	}
	lyr.innerHTML = str;
	
	mselect.form.preco.value = preco; 
}

function go_order(btn){
	var mform = btn.form;
	//var index1 = mform.cor.selectedIndex;
	//var index2 = mform.diametro.selectedIndex;

	//if( index1 > 0 && index2 > 0 ){
		mform.submit();
	//}else{
	//	alert('Select a Colour and a Diameter');  
	//}	 
}

function go_info(btn){
	var mform = btn.form;
	//var index1 = mform.cor.selectedIndex;
	//var index2 = mform.diametro.selectedIndex;
	
	mform.action = '../info.asp';
	mform.submit();
		 
}


function set_page_products(){
	var btn = document.getElementById('btn_order');
	var select_diametro = document.getElementById('select_diametro');
	
	var len = select_diametro.length;
	if( len <= 1 ){
		btn.style.display = 'none';
	}
}


function write_cabos(){
	//document.location.href
	document.write('<input id="btn_order" name="Submit" type="button" class="form_btn" value="Order" onclick="go_order(this)">');
	document.write('&nbsp;&nbsp;&nbsp;&nbsp;');
	document.write('<input name="Submit" type="button" class="form_btn" value="Information" onclick="go_info(this)">');
		 
}