var firstLabelsetLeft;var columnWidth;var firstLabelWidth;function fixFirefoxLabels(){$("form.edunetForm").hide();$("form.edunetForm fieldset").find("label.firstLabel").each(function(A){$(this).width(firstLabelWidth)});if(columnWidth!=undefined){$("form.edunetForm").find(".column").each(function(A){$(this).width(columnWidth)})}$("form.edunetForm").find("div.note").each(function(A){$(this).css("marginLeft",firstLabelWidth+8+"px")});$("form.edunetForm").find("li label.firstLabel, .column").each(function(C){var D=this.innerHTML;var A=document.defaultView.getComputedStyle(this,"").getPropertyValue("width");var B=$("<span></span>");B.css("display","block");B.width(A);$(this).wrapInner(B);this.style.display="-moz-inline-box"});$("form.edunetForm").show()}function initEdunetForm(){$("form.edunetForm").hide();if($("input[name='fSessionID']").val()!=""){$("form.edunetForm div[name!='']").each(function(B){var A=$("<label></label>");A.html($(this).html());$(this).replaceWith(A)})}$("form.edunetForm li label:first-child").each(function(A){if($(this).attr("class")==undefined){$(this).addClass("firstLabel")}});$("form.edunetForm li label").attr("for"," ");if(firstLabelWidth!=undefined){$("form.edunetForm").find("fieldset fieldset").each(function(A){$(this).css("paddingLeft",firstLabelsetLeft+5+"px");$(this).find("legend").each(function(B){if($.browser.msie){$(this).css("marginLeft",(firstLabelsetLeft+12)*-1+"px")}else{$(this).css("marginLeft",(firstLabelsetLeft+6)*-1+"px")}})});$("form.edunetForm").find("div.note").each(function(A){$(this).css("marginLeft",firstLabelWidth+8+"px")})}if(!$.browser.mozilla){$("form.edunetForm fieldset").find("label.firstLabel").each(function(A){$(this).width(firstLabelWidth)})}if(columnWidth!=undefined){$("form.edunetForm").find(".column").each(function(A){if($(this).css("width")=="auto"){}$(this).width(columnWidth)})}$("form.edunetForm :input[type='text']").each(function(A){if($(this).attr("class")==undefined&&$(this).css("width").indexOf("px")==-1){$(this).width(textfieldWidth)}else{if($(this).hasClass("extended")){$(this).width(extendedTextfieldWidth)}}});$("form.edunetForm textarea").each(function(A){if($(this).attr("class")==undefined&&$(this).css("width").indexOf("px")==-1){$(this).width(textareaWidth)}else{if($(this).hasClass("extended")){$(this).width(extendedTextareaWidth)}}});$("form.edunetForm").find(":input[type='radio'], :input[type='checkbox']").each(function(A){$(this).css("border","none")});$("form.edunetForm :not(label)").find("> :input[type='text'], > select").each(function(A){$(this).css("marginRight","10px")});$("form.edunetForm :input:not(#submit)").each(function(A){$(this).focus(function(B){$(this).attr("backgroundColor",$(this).css("backgroundColor"));$(this).css("backgroundColor","#FFC");$(this).css("borderColor","#FC6")});$(this).blur(function(B){$(this).css("backgroundColor",$(this).attr("backgroundColor"));$(this).css("borderColor","#DDD")})});$("form.edunetForm").show()}var tempObj;function focusField(B){tempObj=B;try{tempObj.focus()}catch(A){}}function validate(D){var B="";var A=new Object();var F="";$("form.edunetForm :input").each(function(K){var L=this;var I=false;var H;if(L.getAttribute("req")!=undefined){if(L.getAttribute("alt")==undefined||L.getAttribute("alt")==""){H=L.name.substr(L.name.indexOf("_")+1)}else{H=L.getAttribute("alt")}if(L.getAttribute("type")!="radio"&&(L.value==""||L.value.indexOf("-- ")!=-1)){I=true}else{if(L.getAttribute("type")=="radio"){var J=document.getElementsByName(L.name);if(A[H]==undefined){for(var G=0;G<J.length;G++){if(!J[G].checked&&A[H]!="checked"){A[H]="notChecked"}else{A[H]="checked"}}if(A[H]=="notChecked"){I=true}}}else{if(L.getAttribute("type")=="checkbox"&&!L.checked){I=true}}}if(I){if(F==""){F=L}B+=" - "+H+"\n"}}});$("form.edunetForm [name='attachFrame']").each(function(I){try{var K=this;var G=K.contentWindow||K.contentDocument;if(G.document){G=G.document}var H=G.variables.numItems.value;if(K.getAttribute("req")!=undefined&&H==0){if(F==""){F=K}if(K.getAttribute("alt")!=undefined){B+=" - "+K.getAttribute("alt")+"\n"}}}catch(J){}});if(B==""){return true}else{focusField(F);var C=B.split("\n");if(C.length>10){B=C.splice(0,9).join("\n")+"\n\t...\n\t...\n\t...\n"}alert("Please fill in required fields:\n"+B);try{tempObj.select()}catch(E){}return false}}function reqAttachment(A,B){if(B!=0&&$("[name='attachFrame']").get(B-1)!=undefined){$("[name='attachFrame']").eq(B-1).attr("req","true");$("[name='"+A.name+"']").one("change",function(){if(this!=A&&$("[name='attachFrame']").eq(B).attr("req")!=""){$("[name='attachFrame']").eq(B-1).removeAttr("req")}})}}function debugForm(){$("form.edunetForm :input:not([type='hidden'])").each(function(A){if(this.type.toLowerCase()=="text"||this.tagName.toLowerCase()=="textarea"){$(this).val($(this).attr("name"))}if(this.type.toLowerCase()=="radio"||this.type.toLowerCase()=="checkbox"){$(this).attr("checked","true")}if(this.options){this.options[1].selected=true}})}$(document).ready(function(){initEdunetForm();if($.browser.mozilla){fixFirefoxLabels()}})