// JavaScript Document

function ValorizzaMem() {
	document.getElementById('rMarca').value = document.getElementById('idMarca').options[document.getElementById('idMarca').selectedIndex].text ;
	document.getElementById('rModello').value = document.getElementById('idModello').options[document.getElementById('idModello').selectedIndex].text ;
	document.getElementById('rDesc').value = document.getElementById('idTipologia').options[document.getElementById('idTipologia').selectedIndex].text ;
		
}

function MouseOver(myId) {
	document.getElementById(myId).style.backgroundColor='#00C';
	document.getElementById(myId).style.color='#FFFFFF';
	document.getElementById(myId).style.fontWeight='Bold';
	document.getElementById(myId).style.fontSize='14px';
	}
	
function MouseOut(myId) {
	document.getElementById(myId).style.backgroundColor='#FF9';
	document.getElementById(myId).style.color='#666666';
	document.getElementById(myId).style.fontWeight='';	
	document.getElementById(myId).style.fontSize='11px';	
	}
function controllo() {

	if (document.frm_sRic.soggetto.value == "") 
	{
		alert('Inserire indirizzo email o recapito telefonico');
		return ;
	}
	if (document.frm_sRic.r_marca.value == "")
	{
		alert('Inserire marca'); 
		return;
		
	}
	if (document.frm_sRic.r_modello.value == "")
	{
		alert('Inserire modello');
		return;
	}
	if (document.frm_sRic.desc.value == "")
	{
		alert('Inserire descrizione');
		return;
	}
	document.frm_sRic.method = "post";
	document.frm_sRic.action = "invio_richiesta.php";
	document.frm_sRic.submit();	
}

function ricercaricambio() {
	var iMarca = document.getElementById('idMarca');
	var iModello = document.getElementById('idModello');
	var iTipologia = document.getElementById('idTipologia');	
	if (iMarca.value == "")
	{
		alert('Attenzione occorre selezionare la Marca!');
		iMarca.focus();
		return;
	}
	if (iModello.value == "")
	{
		alert('Attenzione occorre selezionare il Modello!');
		iModello.focus();
		return;
	}
	if (iTipologia.value == "")
	{
		alert('Attenzione occorre selezionare la Tipologia!');
		iTipologia.focus();
		return;
	}
	var myUrl ='ricambi_usati.php?marca=' + iMarca.value;
	myUrl=myUrl + '&&modello=' + iModello.value + '&&tipologia=' + iTipologia.value ;
	location.href=myUrl;
	
}
