Code:
var cost;
	var type = document.getElementById('type');
	var year = document.getElementById('year');
	if (year && year.value)
		{
		year = parseInt(year.value, 10);
		} // 1st if statement
	if (type && type.value && year && (year>0)){
		switch (type.value){
			case 'basic':
			cost = 1000;
			break;
			case 'premium':
			cost = 2000;
			break;
			case 'gold':
			cost = 5000;
			break;
						} // end switch

		cost *= year;

		if (year > 1){
			cost*=.80;
			}

		document.getElementById('cost').value = '$'+ cost.toFixed(2);

				}else 
				{
	document.getElementById('cost').value = 'Please Enter Valid Value.';
					}
					};
when i am using it in browser its not working and in dreamweaver its working but on the Premium its giving value of NaN ... why ? i cant find the issue please help.