//<script>
function DoCalculation(form){
	
	var Labeling_Price = new Array();
	
	Labeling_Price[1] = 0.0;  	// None
	Labeling_Price[2] = 0.50;	// InkJet BW
	Labeling_Price[3] = 0.50;	// Inkjet Color
	Labeling_Price[4] = 0.15;	// Thermal BW
	Labeling_Price[5] = 0.70;	// Thermal Color
	
	var Packaging_Price = new Array();
	
	Packaging_Price[1] = 0.0;  	// None
	Packaging_Price[2] = 0.20;	// Paper Window Sleev
	Packaging_Price[3] = 0.35;	// Jewel Case
	Packaging_Price[4] = 0.50;	// Jewel Case


        var Source_Type_Price = new Array();
	
	Source_Type_Price[1] = 45; // VHS/SVHS
	Source_Type_Price[2] = 60; // 3/4"
	Source_Type_Price[3] = 60; //DV
	Source_Type_Price[4] = 60; // BetaSP
	Source_Type_Price[5] =250; // Digibeta
	
	var   Source_Type_value = form.Source_Type.options[form.Source_Type.selectedIndex].value;
	var	Packaging_value = form.Packaging.options[form.Packaging.selectedIndex].value;
	var	Labeling_value = form.Labeling.options[form.Labeling.selectedIndex].value;
	
       Quantity=eval(form.Quantity_input.value);
       Tapes=eval(form.Quantity_tapes.value);
       Length=eval(form.Length.value);
       
       var Label_price
       if (Labeling_Price[Labeling_value] != 0){
   alert ("Entered Labeling Option is not available for this service. To select another Labeling Option for additional DVD copies, please visit our DVD-R/CD-R Replication Page. ")     
       form.Labeling.selectedIndex =0;
       Label_price=0;
       }
       
       var Duration
       if ((Length >29)&&( Length<121)) {
       Duration=Length;
       }
       else if (Length <30) {
 alert ("Entered length of Video is less then 30 mins. Calculation will be done for the 30 mins. DVD.")
       form.Length.value = 30;
       Duration=30;
       }
       else if (Length>120) {
 alert ("Entered length of Video is exceed 2 hours. Calculation will be done for the first (120 mins.) DVD. Please make additional calculation for the rest.")
             form.Length.value = 120;
              Duration=120;
       }

	Media_Type_Price=0;
	
	
	if  (Quantity >0) {
	var Unit_Price_value = 	        (Source_Type_Price[Source_Type_value]*Duration/60)*Tapes+Media_Type_Price+Packaging_Price[Packaging_value];
	//var Multicopy_Price_value = 	  1.00*(0.75+Media_Type_Price+ Packaging_Price[Packaging_value]);		
	}
	
	else {
	var Unit_Price_value =  0;
	}
	
		
	Unit_Price_value = Math.round(Unit_Price_value*100)/100;
	
       if  (Quantity <2) {
       var Total_Price_value = (Source_Type_Price[Source_Type_value]*Duration/60)*Tapes+Media_Type_Price+Packaging_Price[Packaging_value];
       }
       else{
        alert ("Entered DVD quantity is not available for Video Tape to DVD Transfer service. To order an additional DVD copyes please visit DVD-R/CD-R Replication page")
       form.Quantity_input.value=1;
       var Total_Price_value = (Source_Type_Price[Source_Type_value]*Duration/60)*Tapes;
       }
	
	Total_Price_value = 	Math.round(Total_Price_value*100)/100;
	
	form.Unit_Price.value = "$"+ Unit_Price_value;
	form.Total_Price.value = "$"+ Total_Price_value;
}