	var paper_length_default = 1000;
	var PRICE = 60;
	
	function feesCalculator(){
		
		lt				= document.getElementById("LevelType");
		pl				= document.getElementById("PaperLength");
		dt				= document.getElementById("DeliveryTime");
		st				= document.getElementById("ddlStandard");
		disc_per		= document.getElementById("dis").value;

			
		
		
		pl_price = paperLengthPrices(pl);
		dt_price = deliveryTimePrices(pl_price, pl, dt);
		st_price = standardPrices(dt_price, st, lt);
		lt_price = levelTypePrices(st_price, lt, st);
		
		//document.getElementById("total").value =pl_price;
		//document.getElementById("total").value = dt_price;
		//document.getElementById("total").value = st_price;
		document.getElementById("total").value = lt_price - ((lt_price*disc_per)/100);
		//document.getElementById("total_old").value = lt_price;
	}
	
	function paperLengthPrices(pl){
		plvalue = pl[pl.selectedIndex].value;
		
		pl_hundred = 	plvalue % paper_length_default;
		pl_thousand = 	parseInt(plvalue / paper_length_default);
		
		pl_hundred_price  = (pl_hundred / paper_length_default) * PRICE;
		pl_thousand_price = pl_thousand * PRICE; 
		
		pl_price = pl_thousand_price  + pl_hundred_price;		
		return pl_price;
	}
	
	function deliveryTimePrices(price, pl, dt){
		document.getElementById("DeliveryTime1").style.display='block';
		dtnew	 = document.getElementById("DeliveryTime1");
		dt_price = "";
		
		if (pl.options[pl.selectedIndex].value > 5000 ){
				dt.style.display = 'none';	
				dtnew.style.display = 'block';
							
				dt_price = price;												
		}else {				
				dt.style.display = 'block';
				dtnew.style.display = 'none';								
				
				if (dt.options[dt.selectedIndex].value == 1)
					dt_price = price * 2.5;	
				else if (dt.options[dt.selectedIndex].value == 2 || dt.options[dt.selectedIndex].value == -2)
					dt_price = price * 2;	
				else if (dt.options[dt.selectedIndex].value == 3)
					dt_price = price * 1.5;	
				else
					dt_price = price;								
		}
		
		
		return dt_price;
	}	
	
	function standardPrices(price, st,lt){		
		
		st2   = document.getElementById("ddlStandard2");	
		
		lt_value = lt.options[lt.selectedIndex].value;
				
	if (lt_value == 'A1' || lt_value == 'A2' || lt_value == 'G1' || lt_value == 'G2'  ){			
			st2.style.display = 'block';
			st.style.display  = 'none';
			st_value = st2.options[st2.selectedIndex].value;
		}
		else{
			st2.style.display = 'none';
			st.style.display  = 'block';
			st_value = st.options[st.selectedIndex].value;
		}		
		
		if (st_value == 'A'){			
			standard_price = price * 1.5;			
		}
		else if (st_value == 'B'){
			standard_price = price * 0.75;
		}
		else if (st_value == '1'){
			standard_price = price * 2;
		}
		else if (st_value == '21'){
			//standard_price = price - 50.00;
			standard_price = price;
		}
		else if (st_value == '22'){
			standard_price = price - (price * 0.25);
		}
			
		return standard_price;		
	}	
	
	function levelTypePrices(dt_price, lt, st){
	
		st_value = st.options[st.selectedIndex].value;
		lt_value = lt.options[lt.selectedIndex].value;
		
		if (lt_value == 'D10' || lt_value == 'D20' || lt_value == 'D30'){
			levelType_price = dt_price + 10;
		}
		else if (lt_value == 'M30'){
			levelType_price = dt_price + (dt_price * 0.30);
		}
		else if (lt_value == 'M40' || lt_value == 'M50' || lt_value == 'M60'){
			levelType_price = dt_price + (dt_price * 0.40);
		}
		else if (lt_value == 'PHD'){
			levelType_price = dt_price * 3.6;
		}
		else
			levelType_price = dt_price;
		
		return levelType_price;
	}
