/* ************************************************************************
 * Functions written by Nathan DeJong for the Telegraph Herald unless otherwise noted.
 **************************************************************************/
function expand(a){if(document.getElementById("i"+a).alt=="Open"){if(document.getElementById("i"+a).src.indexOf("sign_plus_lt.gif")!=-1){document.getElementById("i"+a).src="/shared/images/sign_minus_lt.gif"}else{document.getElementById("i"+a).src="/shared/images/sign_minus_dk.gif"}document.getElementById("i"+a).alt="Close";document.getElementById("b"+a).style.display="block"}else{if(document.getElementById("i"+a).src.indexOf("sign_minus_lt.gif")!=-1){document.getElementById("i"+a).src="/shared/images/sign_plus_lt.gif"}else{document.getElementById("i"+a).src="/shared/images/sign_plus_dk.gif"}document.getElementById("i"+a).alt="Open";document.getElementById("b"+a).style.display="none"}}function ajax(b,a,g,e){var d="";for(var c=0;c<a.length;c=c+2){d+=a[c]+"="+escape(a[c+1])+"&"}var f=null;if(window.XMLHttpRequest){f=new XMLHttpRequest()}else{if(window.ActiveXObject){f=new ActiveXObject("Microsoft.XMLHTTP")}else{return}}if(g=="POST"){f.open("POST",b,true);f.setRequestHeader("Content-Type","application/x-www-form-urlencoded");f.onreadystatechange=function(){if(f.readyState==4&&e!=""){document.getElementById(e).innerHTML=f.responseText}};f.send(d)}else{f.onreadystatechange=function(){if(f.readyState==4&&e!=""){document.getElementById(e).innerHTML=f.responseXML.getElementsByTagName("data")[0].firstChild.data}};f.open("GET",b+"?"+d,true);f.send(null)}}function getSize(){var b=0,a=0;if(typeof(window.innerWidth)=="number"){b=window.innerWidth;a=window.innerHeight}else{if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){b=document.documentElement.clientWidth;a=document.documentElement.clientHeight}else{if(document.body&&(document.body.clientWidth||document.body.clientHeight)){b=document.body.clientWidth;a=document.body.clientHeight}}}return[b,a]}function openPDF(b,a){open(b,a,"resizable=yes,width=750,height=500,scrollbars=1")}function showRetailAd(){var a=document.getElementById("sRetailAds");if(a.selectedIndex!=0){openPDF("http://www.thonline.com/ads/pdf/"+a.value+".pdf","RetailAds")}}function openDbqVideo(){open("http://jobs.accessdubuque.com/checkoutdbq.html","Multimedia","resizable=yes,width=540,height=470,scrollbars=no")}function openjobsVideo(){open("http://jobs.accessdubuque.com/whydubuque.html","Multimedia","resizable=yes,width=520,height=435,scrollbars=no")}function MassageEmail(b){var a=b.indexOf(",",0);while(a>-1){b=b.substring(0,a)+"."+b.substring(a+1,b.length);a=b.indexOf(",",0)}a=b.indexOf(" ",0);while(a>-1){b=b.substring(0,a)+""+b.substring(a+1,b.length);a=b.indexOf(" ",0)}return b}function ValidEmail(a){if(a.length>5){if(a.indexOf("@",0)>-1){if(a.indexOf("@",a.indexOf("@",0)+1)==-1){if(a.indexOf(".",a.indexOf("@",0))>-1){return true}}}}return false}function IsNumeric(b){var d="0123456789.";var c=true;var a;if(b.length!=0){for(i=0;i<b.length&&c==true;i++){a=b.charAt(i);if(d.indexOf(a)==-1){c=false}}}else{c=false}return c}function WordCount(b,f,a,c){if(f.keyCode!=13){var d=CountWords(b,false);if(d==c+1){alert("You already have reached 40 words")}else{if(b.value.length==a){alert("You have reached the max number of characters allowed.")}else{if(d>c+1){alert("You have more than 40 words")}}}}}function CountWords(l,a,g){if(a==null){a=true}if(g==null){g=false}var h=l.value.length;var d=l.value+" ";var e=/^[^A-Za-z0-9]+/gi;var j=d.replace(e,"");var k=rExp=/[^A-Za-z0-9]+/gi;var f=j.replace(k," ");var c=f.split(" ");var b=c.length-1;if(d.length<2){b=0}if(b==1){wordOrWords=" word"}else{wordOrWords=" words"}if(h==1){charOrChars=" character"}else{charOrChars=" characters"}if(a&g){alert("Word Count:\n    "+b+wordOrWords+"\n    "+h+charOrChars)}else{if(a){alert("Word Count:  "+b+wordOrWords)}else{if(g){alert("Character Count:  "+h+charOrChars)}}}return b}function MaxLength(b,a){a+=1;if(b.value.length>a){b.value=b.value.substring(0,a)}}
/* ************************************************************************
 * AnyLink CSS Menu script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
 * This notice MUST stay intact for legal use
 * Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
 **************************************************************************/
var disappeardelay=200;var enableanchorlink=1;var hidemenu_onclick=1;var ie5=document.all;var ns6=document.getElementById&&!document.all;function getposOffset(d,c){var b=(c=="left")?d.offsetLeft:d.offsetTop;var a=d.offsetParent;while(a!=null){b=(c=="left")?b+a.offsetLeft:b+a.offsetTop;a=a.offsetParent}return b}function showhide(c,b,d,a){if(ie5||ns6){dropmenuobj.style.left=dropmenuobj.style.top=-500+"px"}if(b.type=="click"&&c.visibility==a||b.type=="mouseover"){c.visibility=d}else{if(b.type=="click"){c.visibility=a}}}function iecompattest(){return(document.compatMode&&document.compatMode!="BackCompat")?document.documentElement:document.body}function clearbrowseredge(e,c){var b=0;if(c=="rightedge"){var d=ie5&&!window.opera?iecompattest().scrollLeft+iecompattest().clientWidth-15:window.pageXOffset+window.innerWidth-15;dropmenuobj.contentmeasure=dropmenuobj.offsetWidth;if(d-dropmenuobj.x<dropmenuobj.contentmeasure){b=dropmenuobj.contentmeasure-e.offsetWidth}}else{var a=ie5&&!window.opera?iecompattest().scrollTop:window.pageYOffset;var d=ie5&&!window.opera?iecompattest().scrollTop+iecompattest().clientHeight-15:window.pageYOffset+window.innerHeight-18;dropmenuobj.contentmeasure=dropmenuobj.offsetHeight;if(d-dropmenuobj.y<dropmenuobj.contentmeasure){b=dropmenuobj.contentmeasure+e.offsetHeight;if((dropmenuobj.y-a)<dropmenuobj.contentmeasure){b=dropmenuobj.y+e.offsetHeight-a}}}return b}function dropdownmenu(c,b,a){if(window.event){event.cancelBubble=true}else{if(b.stopPropagation){b.stopPropagation()}}if(typeof dropmenuobj!="undefined"){dropmenuobj.style.visibility="hidden"}clearhidemenu();if(ie5||ns6){c.onmouseout=delayhidemenu;dropmenuobj=document.getElementById(a);if(hidemenu_onclick){dropmenuobj.onclick=function(){dropmenuobj.style.visibility="hidden"}}dropmenuobj.onmouseover=clearhidemenu;dropmenuobj.onmouseout=ie5?function(){dynamichide(event)}:function(d){dynamichide(d)};showhide(dropmenuobj.style,b,"visible","hidden");dropmenuobj.x=getposOffset(c,"left");dropmenuobj.y=getposOffset(c,"top");dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(c,"rightedge")-15+"px";dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(c,"bottomedge")+c.offsetHeight+"px"}return clickreturnvalue()}function clickreturnvalue(){if((ie5||ns6)&&!enableanchorlink){return false}else{return true}}function contains_ns6(d,c){while(c.parentNode){if((c=c.parentNode)==d){return true}}return false}function dynamichide(a){if(ie5&&!dropmenuobj.contains(a.toElement)){delayhidemenu()}else{if(ns6&&a.currentTarget!=a.relatedTarget&&!contains_ns6(a.currentTarget,a.relatedTarget)){delayhidemenu()}}}function delayhidemenu(){delayhide=setTimeout("dropmenuobj.style.visibility='hidden'",disappeardelay)}function clearhidemenu(){if(typeof delayhide!="undefined"){clearTimeout(delayhide)}}
/* ************************************************************************
 * Original:  Cyanide_7 (leo7278@hotmail.com)
 * Web Site:  http://members.xoom.com/cyanide_7
 * This script and many more are available free online at
 * The JavaScript Source!! http://javascript.internet.com
 **************************************************************************/
function autoTab(c,a,g){var f=g.keyCode;var d=[0,8,9,16,17,18,35,36,37,38,39,40,46];if(c.value.length>=a&&!b(d,f)){c.value=c.value.slice(0,a);c.form[(h(c)+1)%c.form.length].focus()}function b(e,l){var k=false,j=0;while(!k&&j<e.length){if(e[j]==l){k=true}else{j++}}return k}function h(e){var j=-1,k=0,l=false;while(k<e.form.length&&j==-1){if(e.form[k]==e){j=k}else{k++}}return j}return true}
/* ************************************************************************
 * Popup Calendar - By Nathan DeJong for AccessDubuqe.com/THonline.com
 *    The basic drawing of calendar based off of Basic Calendar
 * Basic Calendar - By Brian Gosselin at http://scriptasylum.com/bgaudiodr/
 *    Script featured on Dynamic Drive (http://www.dynamicdrive.com)
 *    This notice must stay intact for use
 *    Visit http://www.dynamicdrive.com/ for full source code
 **************************************************************************/
var popup_calendar_inputbox;var popup_calendar_todaydate=new Date();var popup_calendar_curmonth=popup_calendar_todaydate.getMonth()+1;var popup_calendar_curyear=popup_calendar_todaydate.getFullYear();function openCal(b){popup_calendar_inputbox=b;if(popup_calendar_inputbox.size==0){xOffset=(7*6)+25}else{xOffset=(popup_calendar_inputbox.size*6)+25}document.getElementById("popup_calendar").style.left=(findPosX(popup_calendar_inputbox)+xOffset)+"px";document.getElementById("popup_calendar").style.top=findPosY(popup_calendar_inputbox)+"px";if(popup_calendar_inputbox.value!=""){var a=new Date(popup_calendar_inputbox.value);if(a.getMonth()+1>0){popup_calendar_curmonth=a.getMonth()+1;popup_calendar_curyear=a.getFullYear()}}document.getElementById("popup_calendar").innerHTML=popup_buildCal();document.getElementById("popup_calendar").style.display="block"}function popup_closeCal(){document.getElementById("popup_calendar").style.display="none"}function popup_fillInDate(a){popup_closeCal();popup_calendar_inputbox.value=popup_calendar_curmonth+"/"+a+"/"+popup_calendar_curyear;popup_resetCal();try{popup_additional()}finally{}}function popup_today(){popup_closeCal();popup_calendar_inputbox.value=popup_calendar_todaydate.getMonth()+1+"/"+popup_calendar_todaydate.getDate()+"/"+popup_calendar_todaydate.getFullYear();popup_resetCal();try{popup_additional()}finally{}}function popup_resetCal(){popup_calendar_curmonth=popup_calendar_todaydate.getMonth()+1;popup_calendar_curyear=popup_calendar_todaydate.getFullYear();document.getElementById("popup_calendar").innerHTML=popup_buildCal()}function popup_prevMonth(){if(popup_calendar_curmonth==1){popup_calendar_curmonth=12;popup_calendar_curyear-=1}else{popup_calendar_curmonth-=1}document.getElementById("popup_calendar").innerHTML=popup_buildCal()}function popup_nextMonth(){if(popup_calendar_curmonth==12){popup_calendar_curmonth=1;popup_calendar_curyear+=1}else{popup_calendar_curmonth+=1}document.getElementById("popup_calendar").innerHTML=popup_buildCal()}function popup_prevYear(){popup_calendar_curyear-=1;document.getElementById("popup_calendar").innerHTML=popup_buildCal()}function popup_nextYear(){popup_calendar_curyear+=1;document.getElementById("popup_calendar").innerHTML=popup_buildCal()}function popup_buildCal(){var f=["January","February","March","April","May","June","July","August","September","October","November","December"];var e=[31,0,31,30,31,30,31,31,30,31,30,31];var g=new Date(popup_calendar_curyear,popup_calendar_curmonth-1,1);g.od=g.getDay()+1;var d=new Date();var c=(popup_calendar_curyear==d.getFullYear()&&popup_calendar_curmonth==d.getMonth()+1)?d.getDate():0;e[1]=(((g.getFullYear()%100!=0)&&(g.getFullYear()%4==0))||(g.getFullYear()%400==0))?29:28;var b='<table class="main" cellpadding="0" cellspacing="0"><tr>';b+='<td align="left" width="14" class="move"><a href="javascript:popup_prevYear();" title="Previous Year">&lt;&lt;</a></td>';b+='<td align="left" width="8" class="move"><a href="javascript:popup_prevMonth();" title="Previous Month">&lt;</a></td>';b+='<td align="center" class="month">'+f[popup_calendar_curmonth-1]+" - "+popup_calendar_curyear+"</td>";b+='<td align="right" width="8" class="move" on><a href="javascript:popup_nextMonth();" title="Next Month">&gt;</a></td>';b+='<td align="right" width="14" class="move"><a href="javascript:popup_nextYear();" title="Next Year">&gt;&gt;</a></td>';b+="</tr><tr>";b+='<td colspan="5"><table class="inner" border="0" cols="7" cellpadding="0" cellspacing="0">';for(s=0;s<7;s++){b+='<td class="daysofweek">'+"SMTWTFS".substr(s,1)+"</td>"}b+='</tr><tr align="center">';for(i=1;i<=42;i++){var a=((i-g.od>=0)&&(i-g.od<e[popup_calendar_curmonth-1]))?i-g.od+1:"|";if(a!="|"){if(a==c){a='<a href="javascript:popup_fillInDate('+a+');" id="today">'+a+"</a>"}else{a='<a href="javascript:popup_fillInDate('+a+');">'+a+"</a>"}b+='<td class="days">'+a+"</td>"}else{b+='<td class="blank">'+a+"</td>"}if(((i)%7==0)&&(i<36)){b+='</tr><tr align="center">'}}b+='</tr><tr><td colspan="4" align="left" class="daysofweek"><a href="javascript:popup_today();">today</a></td>';b+='<td colspan="3" align="right" class="daysofweek"><a href="javascript:popup_closeCal();popup_resetCal();">close</a></td></tr>';b+="</table></td>";return b+="</tr></table>"}function findPosX(a){var b=0;if(a.offsetParent){while(a.offsetParent){b+=a.offsetLeft;a=a.offsetParent}}else{if(a.x){b+=a.x}}return b}function findPosY(b){var a=0;if(b.offsetParent){while(b.offsetParent){a+=b.offsetTop;b=b.offsetParent}}else{if(b.y){a+=b.y}}return a};