<!--
function toggle(div_id) {
	var el = document.getElementById(div_id);
	if ( el.style.display == 'none' ) {	el.style.display = 'block';}
	else {el.style.display = 'none';}
}
function blanket_size(popUpDivVar) {
	if (typeof window.innerWidth != 'undefined') {
		viewportheight = window.innerHeight;
	} else {
		viewportheight = document.documentElement.clientHeight;
	}
	if ((viewportheight > document.body.parentNode.scrollHeight) && (viewportheight > document.body.parentNode.clientHeight)) {
		blanket_height = viewportheight;
	} else {
		if (document.body.parentNode.clientHeight > document.body.parentNode.scrollHeight) {
			blanket_height = document.body.parentNode.clientHeight;
		} else {
			blanket_height = document.body.parentNode.scrollHeight;
		}
	}
	var blanket = document.getElementById('blanket');
	blanket.style.height = blanket_height + 'px';
	var popUpDiv = document.getElementById(popUpDivVar);
	popUpDiv_height=blanket_height/2-250;//150 is half popup's height
	popUpDiv.style.top = popUpDiv_height + 'px';
}
function window_pos(popUpDivVar) {
	if (typeof window.innerWidth != 'undefined') {
		viewportwidth = window.innerHeight;
	} else {
		viewportwidth = document.documentElement.clientHeight;
	}
	if ((viewportwidth > document.body.parentNode.scrollWidth) && (viewportwidth > document.body.parentNode.clientWidth)) {
		window_width = viewportwidth;
	} else {
		if (document.body.parentNode.clientWidth > document.body.parentNode.scrollWidth) {
			window_width = document.body.parentNode.clientWidth;
		} else {
			window_width = document.body.parentNode.scrollWidth;
		}
	}
	var popUpDiv = document.getElementById(popUpDivVar);
	window_width=window_width/2-250;//150 is half popup's width
	popUpDiv.style.left = window_width + 'px';
}
function popup(windowname) {
	blanket_size(windowname);
	window_pos(windowname);
	toggle('blanket');
	toggle(windowname);		
}


<!---   zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz -->


function calcula() {
	var basico=new Array(45,70,100,140,250,320);
	var avancado=new Array(60,90,120,165,320,420);
	var video=new Array(80,100,120,180,250,290); 	
	var valor_copia = 10;
	var v_valor = 0; var total = 0; var valor = 0;
	
	var msg1 = "";
	var msg2 = "";
	var msg3 = "";
	
	idx = document.quote.fotos.value;
	nr_copias = document.getElementById("copias").value
	
	if (document.quote.pacote[0].checked) {valor = basico[idx]; document.getElementById("row_video").style.display = "none"; document.getElementById("row_tempo").style.display = "none"; }
	
	else if (document.quote.pacote[1].checked) {
		document.getElementById("row_video").style.display = "";
		valor = avancado[idx];
		
		if (document.quote.video[0].checked) { <!-- Com Video -->
			v_idx = document.quote.tempo.value;
			v_valor = video[v_idx];
			document.getElementById("row_tempo").style.display = "";
		} else if (document.quote.video[1].checked) {
			v_valor = 0;
			document.getElementById("row_tempo").style.display = "none";
		}
	} 
 c_valor = nr_copias * valor_copia;
 total = valor + v_valor + c_valor;	
 document.getElementById("precoid").innerHTML = '$' + total + '.00'; 

	if (total <= 100) {document.getElementById("msg").innerHTML = msg1; }
	else if (total > 101 && total <= 300) {document.getElementById("msg").innerHTML = msg2;}
	else {document.getElementById("msg").innerHTML = msg3;} 

}
//-->
