function HideContent(d) {
document.getElementById(d).style.display = "none";
return true;
}
function ShowContent(d) {
document.getElementById(d).style.display = "block";
return true;
}
function menu1(n){
	document.getElementById(n).src = "img/bolita2.png";
}
function menu2(n){
	document.getElementById(n).src = "img/bolita1.png";
}
function empresa(n){
	document.fotoo.src = n;
}
/*pedido carteles*/
function borde(d){
	document.getElementById(d).style.border = "1px solid #FF0000";
	document.getElementById(d).style.color = "#000000";
}
function gris(d){
	document.getElementById(d).style.border = "1px solid #cccccc";
	document.getElementById(d).style.color = "#999999";
}
function comprobar() {
	ok = true;
	if (document.form1.empresa.value == "" || document.form1.empresa.value.replace(/ /g, '') == '') {
		alert ("ATENCION, es necesario que indique 'Empresa' ");
		ok = false
	}
	if (document.form1.telefono.value == "" || document.form1.telefono.value.replace(/ /g, '') == '') {
		alert ("ATENCION, es necesario que indique un 'Telefono' ");
		ok = false
	}
	if (document.form1.email.value == "" || document.form1.email.value.replace(/ /g, '') == '') {
		alert ("ATENCION, es necesario que indique un 'Email' ");
		ok = false
	}
	document.form1.empresa.focus();
	return ok
}	

function precio(){
	document.form1.cantidad.value = 0
	document.form1.importe.value = 0
	document.form1.variantes.value = 0
}
function unidades(){
	if (document.form1.cantidad.value.replace(/ /g, '') == '' || document.form1.variantes.value.replace(/ /g, '') == ''){
		alert ("No ha indicado Cantidad o número de Variantes");
		document.form1.cantidad.value = 0
		document.form1.importe.value = 0
		document.form1.variantes.value = 0		
		document.form1.cantidad.focus();
	} else if (isNaN(document.form1.cantidad.value)){
		document.form1.cantidad.value = 0		
		document.form1.cantidad.focus();
		alert("Indique datos numericos");
	} else if (isNaN(document.form1.variantes.value)){
		document.form1.variantes.value = 0		
		document.form1.variantes.focus();
		alert("Indique datos numericos");
	} else {	
		var unid = document.form1.cantidad.value
		var total = 0
		if (document.form1.tipoPoryecto[0].checked) {//50x70
			if (unid>12){
				var val = unid-12
				val = 106+(val*6)
				//document.form1.importe.value = val
				total = val
			} else {
				switch (unid) {
				case "1":
					//document.form1.importe.value = 12
					total = 12
					break;
				case "2":
					//document.form1.importe.value = 23
					total = 23
					break;
				case "3":
					//document.form1.importe.value = 33
					total = 33
					break;			
				case "4":
					//document.form1.importe.value = 43
					total = 43
					break;
				case "5":
					//document.form1.importe.value = 52
					total = 52
					break;
				case "6":
					//document.form1.importe.value = 61
					total = 61
					break;
				case "7":
					//document.form1.importe.value = 70
					total = 70
					break;			
				case "8":
					//document.form1.importe.value = 78
					total = 78
					break;
				case "9":
					//document.form1.importe.value = 86
					total = 86
					break;
				case "10":
					//document.form1.importe.value = 93
					total = 93
					break;
				case "11":
					//document.form1.importe.value = 100
					total = 100
					break;			
				case "12":
					//document.form1.importe.value = 106
					total = 106
					break;								
				}//switch			
			}//if (unid>12){
		} else {//if (document.form1.tipoPoryecto[0].checked)
			if (unid>12){
				var val = unid-12
				val = 128+(val*7)
				//document.form1.importe.value = val
				total = val
			} else {
				switch (unid) {
				case "1":
					//document.form1.importe.value = 15
					total = 15
					break;
				case "2":
					//document.form1.importe.value = 29
					total = 29
					break;
				case "3":
					//document.form1.importe.value = 42
					total = 42
					break;			
				case "4":
					//document.form1.importe.value = 54
					total = 54
					break;
				case "5":
					//document.form1.importe.value = 65
					total = 65
					break;
				case "6":
					//document.form1.importe.value = 75.50
					total = 75.50
					break;
				case "7":
					//document.form1.importe.value = 85.50
					total = 85.50
					break;			
				case "8":
					//document.form1.importe.value = 95
					total = 95
					break;
				case "9":
					//document.form1.importe.value = 104
					total = 104
					break;
				case "10":
					//document.form1.importe.value = 112.50
					total = 112.50
					break;
				case "11":
					//document.form1.importe.value = 120.50
					total = 120.50
					break;			
				case "12":
					//document.form1.importe.value = 128
					total = 128
					break;								
				}//switch			
			}//if (unid>12){	
		}//if chequed 1/2
		var v = parseInt(document.form1.variantes.value)
		if (v>0) {
			total = total+(v*5)
		}
		document.form1.importe.value = total
	}//no es campo vacio
}