function dynamicCmsItem(n){$.get("/Records/DynamicCmsItem",{id:n.id},function(t){var i=$(n.container);$(t).each(function(){var n=document.createElement("div"),r=document.createElement("h1"),t=document.createElement("a"),u=document.createElement("p");n.setAttribute("class","related-record"),t.setAttribute("href","/Records/Article/"+this.Id),t.innerHTML=this.Title,r.appendChild(t),u.innerHTML=this.MetaDescription,n.appendChild(r),n.appendChild(u),i.append(n)})})}function dynamicCmsList(n){$.get("/Records/DynamicCmsItem",{id:n.id},function(t){var i=$(n.container);$(t).each(function(){var t=document.createElement("li"),r=document.createElement("a"),u=document.createElement("p");r.setAttribute("href","/Records/Article/"+this.Id),r.innerHTML=this.Title,t.appendChild(r),n.linksonly!="true"&&(u.innerHTML=this.MetaDescription,t.appendChild(u)),i.append(t)})})}function dynamicArticles(n){$.get("/Records/DynamicItems",{id:n.id,rows:n.rows},function(t){var i=$(n.container);$(t).each(function(){var n=document.createElement("div"),f=document.createElement("h1"),r=document.createElement("a"),e=document.createElement("p"),o=document.createElement("p"),t,u;this.PrimaryImage&&(t=document.createElement("a"),u=document.createElement("img"),t.setAttribute("href",this.Links),u.setAttribute("src",this.PrimaryImage),t.appendChild(u),n.appendChild(t)),n.setAttribute("class","related-record"),r.setAttribute("href","/Records/Article/"+this.Id),r.innerHTML=this.Title||"",f.appendChild(r),e.innerHTML=this.SubTitle||"",o.innerHTML=this.MetaDescription||"",n.appendChild(f),n.appendChild(e),n.appendChild(o),i.append(n)})})}function dynamicListItems(n){$.get("/Records/DynamicItems",{id:n.id,rows:n.rows,sortAscending:n.sortAscending=="true"},function(t){var i=$(n.container);$(t).each(function(){var n=document.createElement("li"),t=document.createElement("a"),r=document.createElement("p");t.setAttribute("href","/Records/Article/"+this.Id),t.innerHTML=this.Title||"",r.innerHTML=this.MetaDescription||"",n.appendChild(t),n.appendChild(r),i.append(n)})})}function dynamicImages(n){$.get("/Records/DynamicItems",{id:'CATEGORIES:"Wisconsin Historical Images"',rows:n.rows},function(t){var i=$(n.container);$(t).each(function(){var n=document.createElement("div"),t=document.createElement("a"),u=document.createElement("img"),f=document.createElement("h1"),r=document.createElement("a"),e=document.createElement("p");n.setAttribute("class","related-record"),t.setAttribute("href","/Records/Image/"+this.Id),u.setAttribute("src",this.ImageThumbFileLocation),t.appendChild(u),r.setAttribute("href","/Records/Image/"+this.Id),r.innerHTML=this.Title,f.appendChild(r),e.innerHTML=this.MetaDescription,n.appendChild(t),n.appendChild(f),n.appendChild(e),i.append(n)})})}function dynamicBooks(n){$.get("/Records/DynamicItems",{id:n.id,rows:n.rows,sort:"OTHER_ID"},function(t){var i=$(n.container);$(t).each(function(){var n=document.createElement("div"),t=document.createElement("a"),u=document.createElement("img"),f=document.createElement("h2"),r=document.createElement("a"),e=document.createElement("p");n.setAttribute("class","related-record"),t.setAttribute("href","//"+this.Id),u.setAttribute("src","//"+this.PrimaryImage),t.appendChild(u),r.setAttribute("href","//"+this.Id),r.innerHTML=this.Title,f.appendChild(r),e.innerHTML=this.Author,n.appendChild(t),n.appendChild(f),n.appendChild(e),i.append(n)})})}function dynamicEvents(n){$.get("/Records/DynamicItems",{id:n.id,rows:n.rows,sortAscending:n.sortAscending=="true"},function(t){var i=$(n.container);$(t).each(function(){var t=document.createElement("li"),r=document.createElement("a"),u=document.createElement("p"),n,f;r.setAttribute("href","/Records/Event/"+this.Id),r.innerHTML=this.Title||"",n=new Date(Number(this.StartDate.replace("/Date(","").replace(")/",""))+216e5).toDateString().substring(4,10).replace(/0(\d)/,function(n,t){return t}),f=new Date(Number(this.EndDate.replace("/Date(","").replace(")/",""))+216e5).toDateString().substring(4,10).replace(/0(\d)/,function(n,t){return t}),u.innerHTML=n==f?n:n+" - "+f,t.appendChild(r),t.appendChild(u),i.append(t)})})}function emailForms(n){if($("#form1").valid()){var t=$("#form1").serializeArray();$.ajax({url:"//www.wisconsinhistory.org/Home/Send",type:"POST",dataType:"json",data:{token:n,formVars:JSON.stringify(t)},success:function(){alert("Your data was successfully submitted!"),location.href=location.href},error:function(n,t,i){alert("request failed : "+t+" - "+i)}})}}function emailTaxCredits(n){if($("#form1").validate(),$("#form1").valid()){var t=$("#form1").serializeArray();$.ajax({url:"//www.wisconsinhistory.org/Home/Send",type:"POST",dataType:"json",data:{token:n,formVars:JSON.stringify(t)},success:function(){$("#form1").empty(),$("#form1").append("<fieldset><legend>Success!<\/legend><p>Your request was successfully submitted. Please allow staff X days to respond.<\/p><\/fieldset>")},error:function(n,t,i){alert("request failed : "+t+" - "+i)}})}else alert("There are missing form fields. Please fill out ALL fields before submitting.")}