// JavaScript Document



	

function ChangeProductOptionDisplays(itemValue){
	
	// check radio status
	
	// display divs accordingly
	if(itemValue!=''){
	var value = getCheckedValue(itemValue);
	} else {
	var value = 'PrescriptionGlasses';	
	}
	
	switch (value) {
		
		case 'PrescriptionGlasses':
		jQuery('.Lens_Colours').show();
		jQuery('.Lens_Coating').show();
		jQuery('.Lens_Thickness_').show();
		jQuery('.Magnification').hide();
		jQuery('#select_26841').hide(); // magnification id
		jQuery('#OptionTitle').show();
		jQuery('#OptionTitle').html( 'Lenses and extras' ) ;
		jQuery('#TableLabel').show();
		jQuery('.Sphere_Distance_Left_Eye').show();
		jQuery('.Sphere_Distance_Right_Eye').show();
		jQuery('.Cylinder_Distance_Left_Eye').show();
		jQuery('.Cylinder_Distance_Right_Eye').show();
		jQuery('.Right_Near_Addition').show();
		jQuery('.Axis_Distance_Right_Eye').show();
		jQuery('.Axis_Distance_Left_Eye').show();
		jQuery('.Left_Near_Addition').show();
		jQuery('.Extra_Info').show();
		jQuery('#enter_presc').show();
		jQuery('#prod_login').show();
		jQuery('#optionTitlePres').show();
		jQuery('#NameOfPersciption').show();
		jQuery('#tab2').height(650); 
		jQuery('#options4').height(500); 
		
		// Free - Standard CR39
		jQuery("#options_26827_2").click(function(){
				
				// disable other additional options	
				

				jQuery("#options_26828_2").attr("disabled", false); 	 	
				jQuery("#options_26828_3").attr("disabled", false); 	
		
		});
		
		//+£55.00 1.6 Thin Lens (scratch resistant included free)
		jQuery("#options_26827_3").click(function(){
				
				// disable other additional options
				jQuery("#options_26828_2").click(); // need to check if it is checked and click if it is
				jQuery("#options_26828_3").attr("checked", false); 	
				jQuery("#options_26828_3").attr("disabled", true); 
				jQuery("#options_26828_4").attr("disabled", false); 

		});
		
		//+£65.00 1.67 Thinner Lens (scratch resistant & anti-reflection included free)
		jQuery("#options_26827_4").click(function(){
				
				// disable other additional options
				jQuery("#options_26828_2").click(); // need to check if it is checked and click if it is
				jQuery("#options_26828_3").attr("checked", false); 	
				jQuery("#options_26828_3").attr("disabled", true); 	
				jQuery("#options_26828_4").attr("checked", false); 	
				jQuery("#options_26828_4").attr("disabled", true); 	

		});
		
		//+£65.00 1.67 Thinner Lens (scratch resistant & anti-reflection included free)
		jQuery("#options_26827_5").click(function(){
				
				// disable other additional options
				jQuery("#options_26828_2").click(); // need to check if it is checked and click if it is

				jQuery("#options_26828_4").attr("checked", false); 	
				jQuery("#options_26828_4").attr("disabled", true); 	
				jQuery("#options_26828_3").attr("disabled", false); 

		});
		
	//	 document.getElementById('#select_26841').style.display = 'none';
		break;
		
		case 'ReadyReaders':
		jQuery('.Lens_Colours').hide();
		jQuery('.Lens_Coating').hide(); 
		jQuery('.Lens_Thickness_').hide(); 
		jQuery('.Magnification').show();
		jQuery('#OptionTitle').show();
		jQuery('#OptionTitle').html( 'Magnification' ) ;
		jQuery('#TableLabel').hide();
		jQuery('#select_26841').show(); // magnification id
		jQuery('#prod_login').hide();
		jQuery('.Sphere_Distance_Left_Eye').hide();
		jQuery('.Sphere_Distance_Right_Eye').hide();
		jQuery('.Cylinder_Distance_Left_Eye').hide();
		jQuery('.Cylinder_Distance_Right_Eye').hide();
		jQuery('.Right_Near_Addition').hide();
		jQuery('.Axis_Distance_Right_Eye').hide();
		jQuery('.Axis_Distance_Left_Eye').hide();
		jQuery('.Left_Near_Addition').hide();
		
		jQuery('.Extra_Info').hide();
		jQuery('#enter_presc').hide();
		jQuery('#optionTitlePres').hide();
		jQuery('#NameOfPersciption').hide();
		jQuery('#tab2').height(350);
		jQuery('#options4').height(200); 
	//	 document.getElementById('#select_26841').style.display = '';    
			


		break;
		
		case 'NoPrescription':
		jQuery('.Lens_Colours').hide();
		jQuery('.Lens_Coating').hide(); 
		jQuery('.Lens_Thickness_').hide(); 
		jQuery('.Magnification').hide();
		jQuery('#select_26841').hide();
		jQuery('#OptionTitle').hide();
		jQuery('#TableLabel').hide();
		jQuery('.Sphere_Distance_Left_Eye').hide();
		jQuery('.Sphere_Distance_Right_Eye').hide();
		jQuery('.Cylinder_Distance_Left_Eye').hide();
		jQuery('.Cylinder_Distance_Right_Eye').hide();
		jQuery('.Right_Near_Addition').hide();
		jQuery('.Axis_Distance_Right_Eye').hide();
		jQuery('.Axis_Distance_Left_Eye').hide();
		jQuery('.Left_Near_Addition').hide();
		jQuery('.Extra_Info').hide();
		jQuery('#enter_presc').hide();
		jQuery('#optionTitlePres').hide();
		jQuery('#prod_login').hide();
		jQuery('#NameOfPersciption').hide();
		jQuery('#tab2').height(300);
		jQuery('#options4').height(150); 
		break;
		
		default:
		jQuery('.Lens_Colours').show();
		jQuery('.Lens_Coating').show();
		jQuery('.Lens_Thickness_').show();
		jQuery('.Magnification').hide();
		jQuery('#select_26841').hide();
		jQuery('#OptionTitle').show();
		jQuery('#OptionTitle').html( 'Lenses and extras' ) ;
		jQuery('#TableLabel').show();
		jQuery('.Sphere_Distance_Left_Eye').show();
		jQuery('.Sphere_Distance_Right_Eye').show();
		jQuery('.Cylinder_Distance_Left_Eye').show();
		jQuery('.Cylinder_Distance_Right_Eye').show();
		jQuery('.Right_Near_Addition').show();
		jQuery('.Axis_Distance_Right_Eye').show();
		jQuery('.Axis_Distance_Left_Eye').show();
		jQuery('.Left_Near_Addition').show();
		jQuery('.Prescription_Name').show();
		jQuery('.Extra_Info').show();
		jQuery('#enter_presc').show();
		jQuery('#prod_login').show();
		jQuery('#optionTitlePres').show();
		jQuery('#NameOfPersciption').show();
		jQuery('#tab2').height(650); 
		jQuery('#options4').height(500); 
		break;
			
		
	}

// 	document.getElementByName('UsedFor').
	
	
	
	
	
}






// function to retrieve the checked value

function getCheckedValue(radioObj) {
	if(!radioObj)
		return "";
	var radioLength = radioObj.length;
	if(radioLength == undefined)
		if(radioObj.checked)
			return radioObj.value;
		else
			return "";
	for(var i = 0; i < radioLength; i++) {
		if(radioObj[i].checked) {
			return radioObj[i].value;
		}
	}
	return "";
}






