<!--



function calculate(obj,cleartext) {
	if (((document.form['min'].value != "") &&
	  (document.form['min'].value != "min")) ||
	  ((document.form['sec'].value != "") &&
	  (document.form['sec'].value != "sec"))) {
	    
	    //x x or x x
	    
	    
	  // calculate
	  

	  
	  var minutes = eval(document.form['min'].value * 60);
	  var seconds = parseInt(document.form['sec'].value);
	  
	  
	  var selectedquality = document.form.quality.options[document.form.quality.selectedIndex].value;
	  var selectedviewers = document.form.viewers.options[document.form.viewers.selectedIndex].value;
	  
	  
	  if (isNaN(minutes)) { minutes = 0; }
	  if (isNaN(seconds)) { seconds = 0; }
	  //alert (minutes + ', ' + seconds);
	  var totaltime = eval(minutes + seconds);
	  //alert (totaltime);
	  

	  MbSize = eval((totaltime * selectedquality) / 8);
	  
	  
	  // update
	  //if (MbSize <= 1024) {
	  //  document.form['total'].value = Math.round(MbSize * selectedviewers) + " k";
		//} 
		//else if (MbSize > 1024) {
	   	MbSize = MbSize/1024;
	   	var MbSize2 = Math.floor(MbSize);
	   	var tool = Math.round((MbSize*100+.5)%100);
	   	var MbSize3 = tool / 100;
	   	withviewers = Math.round(selectedviewers * (MbSize2 + MbSize3));
	   	document.form['total'].value =  withviewers + " MB";
		//convert to GB
		
		//}
	  

	  
	  
	  //clear all ids
	  for (i = 1; i < 13; i++) {
	  	//document.images['i' + i].src = "images/reddot_blank.gif";
	  	document.getElementById(i + "a").style.background = '';
	  	document.getElementById(i + "b").style.background = '';
	  	document.getElementById(i + "c").style.background = '';
	  	document.getElementById(i + "d").style.background = '';
	    document.getElementById(i + "a").style.color = '';
	    document.getElementById(i + "c").style.color = '';
	    document.getElementById(i + "d").style.color = '';
	  }
	  
	  //highlight one set
	  if (withviewers > 45000) { coloron(12); }
		else if (withviewers > 22000) { coloron(11); }
		else if (withviewers > 20000) { coloron(10); }
		else if (withviewers > 18000) { coloron(9); }
		else if (withviewers > 15000) { coloron(8); }
		else if (withviewers > 13000) { coloron(7); }
		else if (withviewers > 11000) { coloron(6); }
		else if (withviewers > 9000) { coloron(5); }
		else if (withviewers > 6000) { coloron(4); }
		else if (withviewers > 3000) { coloron(3); }
		else if (withviewers > 1200) { coloron(2); }
		else if (withviewers <= 1200) { coloron(1); }
	  
	  //
	  // highlight _ add
	  show_div('uno');
	  
	}
}


function coloron(whatid) {
  document.getElementById(whatid + "a").style.background = '#D8141D';
	document.getElementById(whatid + "b").style.background = '#D8141D';
	document.getElementById(whatid + "c").style.background = '#D8141D';
	document.getElementById(whatid + "d").style.background = '#D8141D';
	document.getElementById(whatid + "a").style.color = '#ffffff';
	document.getElementById(whatid + "c").style.color = '#ffffff';
	document.getElementById(whatid + "d").style.color = '#ffffff'; 
}





olddiv = "";
function show_div(div_id) {
    // hide old divs
    //if (olddiv != "") {
    //document.getElementById(olddiv).style.visibility = 'hidden';
    //}

    // show the requested div
    document.getElementById(div_id).style.visibility = 'visible';
    
    // backup as old
    olddiv = div_id;
}


// -->
