var subjects={"standard":["Accounting","Advanced Immunology","Advertising","Aerospace Engineering","African Studies","Agriculture","Animation","Anthropology","Arabic","Archaeology","Architecture","Art","Art History","Artificial Intelligence","Audiology","Automotive Design","Banking","Beauty Therapy","Bioinformatics","Biology","Biotechnology","Botany","Building Surveying","Business","Cantonese","Chemistry","Childcare","Chinese","Civil Engineering","Classics","Classics Communications","Computer Science","Construction","Creative Writing","Criminology","Cultural Studies","Customer Service","Cybernetics","Dentistry","Design","Development for Sustainability","Disaster Studies","Drama","Earth System Science","Ecommerce","Economics","Education","Engineering","English Language","English Literature","Entrepreneurship and Management","Environmental Studies","Estate Management","Ethnic Studies","European Studies","Fashion","Film Studies","Finance","Forensic Biology","Forensic Chemistry","French","Gaelic","Genealogy","General Studies","Geography","Geology","German","Governmental Studies","Graphic Design","Health","Health and Medical Sciences","Hebrew","Hindi","History","Horticulture","Hospitality","Housing","Human Geography","Human Resources","Human Rights","IT","Information Systems","Internal Relations","International Relations","International Studies","Italian","Japanese","Jewish Studies","Journalism","Languages","Latin American Studies","Law","Leadership Studies","Leisure Management","Linguistics","Logistics","Management","Marine Biology","Marketing","Mathematics","Mechanics","Media","Meteorology","Micro Biology","Middle Eastern Studies","Midwifery","Military","Motor Engineering","Music","Nursing","Nutrition","Operations Management","Paramedic Biology","Pharmaceutical Science","Philosophy","Photography","Physical Education","Physical Geography","Physical Therapy","Physics","Physiology","Plant and Soil Sciences","Poetry","Politics","Product Design","Project Management","Property","Psychology","Public Policy","Quantity Surveying","Real Estate Management","Religion","Risk Management","Rural Studies","Sciences","Social Policy","Social Work","Sociology","Software Engineering","Spanish","Sports","Statistics","Teaching","Theatre","Theology","Tourism","Translation","Transport","Typography","Web Development","Zoology"],"law":["Accounts","Admiralty Law","ADR and Mediation","Advanced Crime","Advanced Civil","Advocacy","Banking Law","Business Law","Child Law","Civil Evidence","Civil Procedure","Civil Liberties","Commercial","Commercial Litigation","Competition Law","Conferencing","Company Law","Constitutional and Administrative","Contract Law","Comparative Law","Copyright, Trademark and Patent Law","Criminal Law","Criminal Evidence","Criminal Litigation","Criminology","Cyberlaw","Data Protection and Freedom of Information","Debt Finance","Drafting","Equity and Finance","Equity &amp; Trusts","Employment Law","English Legal System","English Legal History","Environmental Law","EU Law","Family Law","Forensic","Gender and the Law","Human Rights Law","Immigration Law","Insolvency Law","International Law","International Shipping Law","IP Law","International Trade Law","Islamic Law","Judicial Review","Jurisprudence","Land Law","Landlord and Tenant Law","Law in the City","Legal Anthropology","Legal Ethics","Licensing Law","Media Law","Opinion Writing","Penology","PI and Clinical Negligence","Private Acquisitions","Private Client","Professional Ethics","Professional Conduct","Property &amp; Chancery","Probate","Public International Law","Restitution","Shariah Law","Tax Law","Tort Law","Roman Law","Social Security Law","Wills"]}
var deliveryPrices=[1,1.25];$(document).ready(function(){calculatePrice();});$("#sheets").keyup(function(){calculatePrice();});$("#delivery").change(function(){calculatePrice();});function calculatePrice(){var sheets=$("#sheets").val();var total=0;if(!isNaN(sheets)&&(Math.round(sheets)==sheets)){var sheetPrice=(sheets>5?35:37.5);var delivery=deliveryPrices[$("#delivery").val()];total=(sheets*sheetPrice*delivery);}
var decimal=Math.round((total-parseInt(total))*10);var midway=((parseInt(total)+0.5)+"0");total=((decimal<3)||(decimal>7)?(Math.round(total)+".00"):midway);if(isNaN(total))total=0;$("#price").html("Price: &pound;"+total);$("#pr").val(total);}
$("#level").change(function(){var selected=$("#level option:selected");var selectedVal=selected.val();if(selectedVal!=""){var subjList=(selected.parent().attr("label").toLowerCase().indexOf("law")>-1?subjects.law:subjects.standard);disableSubject(false);addSubjects(subjList);}else{$("#subject").html("");disableSubject(true);}});function addSubjects(subjList){$("#subject").html(option("","- Please Select -"));for(var i=0;i<subjList.length;i++){var subj=subjList[i];$("#subject").append(option(subj,subj));}}
function disableSubject(disable){if(disable){$("#subject").attr("disabled","disabled");}else{$("#subject").removeAttr("disabled");}}
function option(value,text){return('<option value="'+value+'">'+text+'</option>');}