
function CheckEnter(e){var characterCode;if(e&&e.which){e=e;characterCode=e.which;}else{e=event;characterCode=e.keyCode;}if(characterCode==13){return true;}else{return false;}}
function getViewPortHeight(){var viewportheight;if(typeof window.innerWidth!='undefined'){viewportheight=window.innerHeight}
else if(typeof document.documentElement!='undefined'&&typeof document.documentElement.clientWidth!='undefined'&&document.documentElement.clientWidth!=0){viewportheight=document.documentElement.clientHeight}
else{viewportheight=document.getElementsByTagName('body')[0].clientHeight}
return viewportheight;}
function getViewPortWidth(){var viewportwidth;if(typeof window.innerWidth!='undefined'){viewportwidth=window.innerWidth}
else if(typeof document.documentElement!='undefined'&&typeof document.documentElement.clientWidth!='undefined'&&document.documentElement.clientWidth!=0){viewportwidth=document.documentElement.clientWidth}
else{viewportwidth=document.getElementsByTagName('body')[0].clientWidth}
return viewportwidth;}
function resizeFrame(f){f.style.height=f.contentWindow.document.body.scrollHeight+"px";}
function daysInMonth(month,year){return new Date(year,month,0).getDate();}
function CapTextBox(textBox){var varkeycode=window.event.keyCode;if(varkeycode==9||varkeycode==16||varkeycode==37||varkeycode==38||varkeycode==39||varkeycode==40||varkeycode==27||varkeycode==8)return;textBox.value=textBox.value.toUpperCase();}
function SetCookie(cookieName,cookieValue,nDays){var today=new Date();var expire=new Date();if(nDays==null||nDays==0)nDays=1;expire.setTime(today.getTime()+3600000*24*nDays);document.cookie=cookieName+"="+escape(cookieValue)
+";expires="+expire.toGMTString();}
function CloseWindow(){return window.close();}
function DeletePrompt(){return window.confirm("Are you sure you want to delete?");}
function NavBack(){window.history.back(1);}
function CkDate(strDate){var strDatestyle="US";var strDate;var strDateArray;var strDay;var strMonth;var strYear;var intday;var intMonth;var intYear;var booFound=false;var strSeparatorArray=new Array("-"," ","/",".");var intElementNr;var err=0;var strMonthArray=new Array(12);strMonthArray[0]="Jan";strMonthArray[1]="Feb";strMonthArray[2]="Mar";strMonthArray[3]="Apr";strMonthArray[4]="May";strMonthArray[5]="Jun";strMonthArray[6]="Jul";strMonthArray[7]="Aug";strMonthArray[8]="Sep";strMonthArray[9]="Oct";strMonthArray[10]="Nov";strMonthArray[11]="Dec";if(strDate.length<1){return true;}
for(intElementNr=0;intElementNr<strSeparatorArray.length;intElementNr++){if(strDate.indexOf(strSeparatorArray[intElementNr])!=-1){strDateArray=strDate.split(strSeparatorArray[intElementNr]);if(strDateArray.length!=3){err=1;return false;}
else{strDay=strDateArray[0];strMonth=strDateArray[1];strYear=strDateArray[2];}
booFound=true;}}
if(booFound==false){err=1;return false;}
if(strYear.length==2){strYear='20'+strYear;}
if(strDatestyle=="US"){strTemp=strDay;strDay=strMonth;strMonth=strTemp;}
intday=parseInt(strDay,10);if(isNaN(intday)){err=2;return false;}
intMonth=parseInt(strMonth,10);if(isNaN(intMonth)){for(i=0;i<12;i++){if(strMonth.toUpperCase()==strMonthArray[i].toUpperCase()){intMonth=i+1;strMonth=strMonthArray[i];i=12;}}
if(isNaN(intMonth)){err=3;return false;}}
intYear=parseInt(strYear,10);if(isNaN(intYear)){err=4;return false;}
if(intMonth>12||intMonth<1){err=5;return false;}
if((intMonth==1||intMonth==3||intMonth==5||intMonth==7||intMonth==8||intMonth==10||intMonth==12)&&(intday>31||intday<1)){err=6;return false;}
if((intMonth==4||intMonth==6||intMonth==9||intMonth==11)&&(intday>30||intday<1)){err=7;return false;}
if(intMonth==2){if(intday<1){err=8;return false;}
if(LeapYear(intYear)==true){if(intday>29){err=9;return false;}}
else{if(intday>28){err=10;return false;}}}
return true;}
function LeapYear(intYear){if(intYear%100==0){if(intYear%400==0){return true;}}
else{if((intYear%4)==0){return true;}}
return false;}
function doDateCheck(from,to){if(Date.parse(from.value)<=Date.parse(to.value)){alert("The dates are valid.");}
else{if(from.value==""||to.value=="")
alert("Both dates must be entered.");else
alert("To date must occur after the from date.");}}
function IsNumber(strNumber){if(strNumber.length<1){return true;}
if(isNaN(strNumber)){return false;}
return true;}
function ReplaceStr(strSource,strFind,strReplace){var i=strSource.indexOf(strFind);do{if(i>-1){strSource=strSource.substring(0,i)+strReplace+strSource.substring(i+strFind.length,strSource.length);i=strSource.indexOf(strFind);}}while(i>-1);return strSource;}
var arraySelObj=new Array()
function ShowTags(sTag){var objTags=document.all.tags(sTag);if(objTags!=null){for(var x=0;x<objTags.length;x++){if(arraySelObj[x]!=objTags[x].sourceIndex){objTags[x].style.display="";objTags[x].style.visibility="";}}}}
function HideTags(sTag,bAdjustSpace){var objTags=document.all.tags(sTag);if(objTags!=null){for(var x=0;x<objTags.length;x++){if(objTags[x].style.display=="none"||objTags[x].style.visibility=="hidden"){arraySelObj[x]=objTags[x].sourceIndex}
if(bAdjustSpace){objTags[x].style.display="none";}else{objTags[x].style.visibility="hidden";}}}}
function CheckAllCheckBoxes(cbxAll){var container;if(document.getElementById&&(container=document.getElementById('cBoxes'))&&container.getElementsByTagName){var controls=container.getElementsByTagName('input');for(var i=0,n=controls.length;i<n;++i)
if(controls[i].type=='checkbox')controls[i].checked=cbxAll.checked;}}
function CheckAllGrpCheckBoxes(cbxAnm,sChkBoxType){var container;if(document.getElementById&&(container=document.getElementById(sChkBoxType))&&container.getElementsByTagName){var controls=container.getElementsByTagName('input');for(var i=0,n=controls.length;i<n;++i)
if(controls[i].type=='checkbox')controls[i].checked=cbxAnm.checked;}}
function AngusCalendarAbbrev(msg){var msg='<b>To make this listing concise we have used the following abbreviations:</b>'
+'<br>'+'<br>'
+'associates = assoc.<br />'
+'association = assn.<br />'
+'beef cattle improvement<br />'
+'association = BCIA<br />'
+'beef cattle improvement<br />'
+'program = BCIP<br />'
+'brothers = bros.<br />'
+'company = co<br />'
+'international = int\'l<br />'
+'junior = jr.<br />'
+'mountain = mtn.<br />'
+'national = nat\'l<br />'
+'northeast = NE<br />'
+'northwest = NW<br />'
+'performance-tested = PT<br />'
+'senior = sr.<br />'
+'southeast = SE<br />'
+'southwest = SW<br />'
+'university = Un.'
newwin=window.open('','','top=150,left=150,width=325,height=500,status=no,menubar=no,scrollbars=no,resizable=yes,location=no');newwin.moveTo(0,0);if(!newwin.opener)newwin.opener=self;with(newwin.document){open();write('<html>');write('<head><link href="../StyleSheet.css" rel="stylesheet" type="text/css" /></head>');write('<body style="background-color:white"><form name=form>'+msg+'<br>');write('<p><center><input type="button" value="Close Window" class="AAAButton" onClick="window.close();">');write('</center></form></body></html>');close();}}
