$(document).ready(function(){ $("input[type=checkbox]").click(function(){ divID = $(this).attr("id"); type = $(this).attr("name"); term = $(this).attr("class"); english = $("#" + term + " input.originalterm").val(); phonetic = $("#" + term + " span.phoneticterm input").val(); if ($(this).is(":checked")) { $("#" + divID + "form").show(); if (type == "verb") { $("#" + divID + "form input.everbs").val(english +"s"); $("#" + divID + "form input.everbed").val(english +"d"); $("#" + divID + "form input.everbing").val(english +"ing"); $("#" + divID + "form input.pverbs").val(phonetic +"s"); $("#" + divID + "form input.pverbed").val(phonetic +"d"); $("#" + divID + "form input.pverbing").val(phonetic +"iN"); } if (type == "noun") { $("#" + divID + "form input.eplural").val(english +"s"); $("#" + divID + "form input.eposs").val(english +"'s"); $("#" + divID + "form input.pplural").val(phonetic +"s"); $("#" + divID + "form input.pposs").val(phonetic +"s"); } if (type == "adj") { $("#" + divID + "form input.eadjer").val(english +"er"); $("#" + divID + "form input.eadjest").val(english +"est"); $("#" + divID + "form input.eadjly").val(english +"ly"); $("#" + divID + "form input.padjer").val(phonetic +"Q"); $("#" + divID + "form input.padjest").val(phonetic +"ist"); $("#" + divID + "form input.padjly").val(phonetic +"lE"); } } else if($(this).not(":checked")) { $("#" + divID + "form input").val(""); $("#" + divID + "form").hide(); } }); }); function confirmfinish(tid,func,clk) { var path = document.location.pathname; var tid = tid; var gdir = path.substring(-1, path.lastIndexOf('/')); gurl="/functions.php"; gurl=gurl+"?tid="+tid+"&func="+func; gurl = gdir+gurl; if (confirm("Are you sure you wish to mark this task as 'closed'...?")) { //if (!clk) //{ //return false; //exit; //} //else //{ xmlhttp=GetXmlHttpObject(gurl); if (xmlhttp==null) { alert ("Your browser does not support XMLHTTP!"); return; } else { //alert(document.getElementById("id_"+tid).visibility); xmlhttp.onreadystatechange=stateChanged; xmlhttp.open("GET",gurl,true); xmlhttp.send(null); return true; } } }