
function myOpenWindow(sHref,sHeight,sWidth){window.open(sHref,"mywindow","location=1,status=1,scrollbars=1,width="+sWidth+",height="+sHeight);}
function doFramesBuster()
{var args=location.search.substr(1).split("?");if(top.location!=self.location&&args!="f")
top.location=self.location;}
function MM_jumpMenu(selObj,restore,strUrl){window.open(strUrl+selObj.options[selObj.selectedIndex].value);if(restore)selObj.selectedIndex=0;}
function MM_preloadImages(){var d=document;if(d.images){if(!d.MM_p)d.MM_p=new Array();var i,j=d.MM_p.length,a=MM_preloadImages.arguments;for(i=0;i<a.length;i++)
if(a[i].indexOf("#")!=0){d.MM_p[j]=new Image;d.MM_p[j++].src=a[i];}}}
function MM_swapImgRestore(){var i,x,a=document.MM_sr;for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++)x.src=x.oSrc;}
function MM_findObj(n,d){var p,i,x;if(!d)d=document;if((p=n.indexOf("?"))>0&&parent.frames.length){d=parent.frames[n.substring(p+1)].document;n=n.substring(0,p);}
if(!(x=d[n])&&d.all)x=d.all[n];for(i=0;!x&&i<d.forms.length;i++)x=d.forms[i][n];for(i=0;!x&&d.layers&&i<d.layers.length;i++)x=MM_findObj(n,d.layers[i].document);if(!x&&d.getElementById)x=d.getElementById(n);return x;}
function MM_swapImage(){var i,j=0,x,a=MM_swapImage.arguments;document.MM_sr=new Array;for(i=0;i<(a.length-2);i+=3)
if((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x;if(!x.oSrc)x.oSrc=x.src;x.src=a[i+2];}}
function loadFrames(strParam){var urlString="http://www.ocgov.com/cob";if(strParam=="ethics"){urlString="http://www.ocgov.com/cob/"+URLform.pagename.value+"_1234.asp";}else if(strParam=="appeals"){urlString="http://www.ocgov.com/cob/Appeals/"+URLform.pagename.value+"_1.asp";}
window.location=urlString;}
function setHLight(nBullet){var bullets=document.getElementsByTagName("li");var li=document.getElementById("featured"+nBullet);var spans=document.getElementsByTagName("span");var span=document.getElementById("featured"+nBullet+"ct");for(var i=0;i<bullets.length;i++){if(bullets[i].className.match("on")){bullets[i].className="";}}
li.className="on";for(var i=0;i<spans.length;i++){if((spans[i].id.match(RegExp("^featured")))&&(spans[i].className.match("current"))){spans[i].className="";}}
span.className="current";}
function trimFormValue(s)
{return s.replace(/^\s+|\s+$/g,'');}
function validateScriptTag(form){var len=form.length;for(var i=0;i<len;i++){var strValue=trimFormValue(form.elements[i].value);if(strValue.indexOf("<")!=-1){alert("HTML tags are not allowed in fields!");return false;}}
return true;}
function validateSheriffForm(form)
{if(!validateScriptTag(form))return false;if(trimFormValue(form.FORMAIL_Name.value)=="")
{alert("Please enter a Name!");return false;}
if(trimFormValue(form.FORMAIL_Residence.value)=="")
{alert("Please enter a City of Residence!");return false;}
var trimEmail=trimFormValue(form.FORMAIL_Email.value);var emailExp=/^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;if(trimEmail!=null&&trimEmail!="")
{if(!(trimEmail.match(emailExp)))
{alert("Please enter a valid email!");return false;}}
var trimPhoneNum=trimFormValue(form.FORMAIL_PhoneNumber.value);var phoneExp=/^((\+\d{1,3}(-| )?\(?\d\)?(-| )?\d{1,5})|(\(?\d{2,6}\)?))(-| )?(\d{3,4})(-| )?(\d{4})(( x| ext)\d{1,5}){0,1}$/;if(trimPhoneNum!=null&&trimPhoneNum!="")
{if(!(trimPhoneNum.match(phoneExp)))
{alert("Please enter a valid phone number with area code!");return false;}}
if(trimFormValue(form.FORMAIL_InterviewQuestions.value)==null||trimFormValue(form.FORMAIL_InterviewQuestions.value)=="")
{alert("Please enter Interview Questions!");return false;}
if(trimFormValue(form.FORMAIL_EvaluationCriteria.value)==null||trimFormValue(form.FORMAIL_EvaluationCriteria.value)=="")
{alert("Please enter Evaluation Criteria!");return false;}
return true;}
function validateContactForm(form)
{if(!validateScriptTag(form))return false;if(trimFormValue(form.FORMAIL_Subject.value)=="")
{alert("Please enter a Subject!");return false;}
var trimEmail=trimFormValue(form.FORMAIL_Email.value);var emailExp=/^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;if(!(trimEmail.match(emailExp)))
{alert("Please enter a valid email!");return false;}
var trimPhoneNum=trimFormValue(form.FORMAIL_PhoneNumber.value);var phoneExp=/^((\+\d{1,3}(-| )?\(?\d\)?(-| )?\d{1,5})|(\(?\d{2,6}\)?))(-| )?(\d{3,4})(-| )?(\d{4})(( x| ext)\d{1,5}){0,1}$/;if(trimPhoneNum==null||trimPhoneNum==""||!(trimPhoneNum.match(phoneExp)))
{alert("Please enter a valid phone number with area code!");return false;}
if(trimFormValue(form.FORMAIL_Comment.value)==null||trimFormValue(form.FORMAIL_Comment.value)=="")
{alert("Please enter a Comment!");return false;}
return true;}
function validateCobForm(form)
{if(!validateScriptTag(form))return false;if(trimFormValue(form.cobform.value)=="")
{alert("Please enter the Code!");return false;}
if(trimFormValue(form.cobform.value)!="ethics"&&trimFormValue(form.cobform.value)!="AABCal"){alert("Invalid Code!");return false;}
return true;}
function validatePasswordForm(form)
{if(!validateScriptTag(form))return false;if(trimFormValue(form.passwordform.value)=="")
{alert("Please enter the code!");return false;}
if(trimFormValue(form.passwordform.value)!="password"){alert("Invalid Code!");return false;}
return true;}
function overwriteCookiePath(bForceOverwrite){var c_start=document.cookie.indexOf("SESSIONCOOKIE_FORCLIP=");if(c_start!=-1&&!bForceOverwrite){return;}
var cookies=document.cookie.split(";");for(var i=0;i<cookies.length;i++){var cookieArr=cookies[i].split("=");var cName=cookieArr[0];var cValue=cookieArr[1];if(cName=="JSESSIONID"){document.cookie=cName+"="+cValue+";path=/DynamicClipPortlet;";document.cookie="SESSIONCOOKIE_FORCLIP=true;path=/;";}}}
function validateBOS2MailListForm(form)
{if(!validateScriptTag(form))return false;var invalidValueFound="";var trimEmail=trimFormValue(form.FORMAIL_email.value);var emailExp=/^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;if(!(trimEmail.match(emailExp)))
{invalidValueFound+="Please enter a valid email address!\r\n";}
if(trimFormValue(form.FORMAIL_firstname.value)=="")
{invalidValueFound+="Please enter your first name!\r\n";}
if(trimFormValue(form.FORMAIL_lastname.value)=="")
{invalidValueFound+="Please enter your last name!\r\n";}
if(invalidValueFound!=null&&invalidValueFound!="")
{alert(invalidValueFound);return false;}
return true;}
function validateBOS3SchMeetingForm(form)
{if(!validateScriptTag(form))return false;var invalidValueFound="";var trimPhoneNum=trimFormValue(form.FORMAIL_phone.value);var phoneExp=/^((\+\d{1,3}(-| )?\(?\d\)?(-| )?\d{1,5})|(\(?\d{2,6}\)?))(-| )?(\d{3,4})(-| )?(\d{4})(( x| ext)\d{1,5}){0,1}$/;if(trimPhoneNum==null||trimPhoneNum==""||!(trimPhoneNum.match(phoneExp)))
{invalidValueFound+="Please enter a valid phone number including area code!";}
if(invalidValueFound!=null&&invalidValueFound!="")
{alert(invalidValueFound);return false;}
return true;}
function validateBOS5SchAppointmentForm(form)
{if(!validateScriptTag(form))return false;var invalidValueFound="";var trimPhoneNum=trimFormValue(form.FORMAIL_phone.value);var phoneExp=/^((\+\d{1,3}(-| )?\(?\d\)?(-| )?\d{1,5})|(\(?\d{2,6}\)?))(-| )?(\d{3,4})(-| )?(\d{4})(( x| ext)\d{1,5}){0,1}$/;if(trimPhoneNum==null||trimPhoneNum==""||!(trimPhoneNum.match(phoneExp)))
{invalidValueFound+="Please enter a valid phone number including area code!";}
if(invalidValueFound!=null&&invalidValueFound!="")
{alert(invalidValueFound);return false;}
return true;}
function textareaCharsValidate(objFormtext,maxLimits)
{if(objFormtext.value.length>maxLimits)
showError=true;objFormtext.value=objFormtext.value.substring(0,maxLimits);}
function validateInternshipInterestform()
{alertMessage="YOU HAVE FORGOTTEN TO: \n";showAlert=false;if(document.mainform.FORMAIL_firstname.value==""){alertMessage+="- Enter your First Name #1\n";showAlert=true;document.mainform.FORMAIL_firstname.focus();}
if(document.mainform.FORMAIL_lastname.value==""){alertMessage+="- Enter your Last Name #3\n";showAlert=true;document.mainform.FORMAIL_lastname.focus();}
if(document.mainform.FORMAIL_city.value==""){alertMessage+="- Enter your City #4\n";showAlert=true;document.mainform.FORMAIL_city.focus();}
if(document.mainform.FORMAIL_state.value==""){alertMessage+="- Select a State #5\n";showAlert=true;document.mainform.FORMAIL_state.focus();}
var emailExp=/^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;var trimEmail=trimFormValue(document.mainform.FORMAIL_email.value);if(!(trimEmail.match(emailExp))){alertMessage+="- Enter a valid E-mail #6\n";showAlert=true;document.mainform.FORMAIL_email.focus();}
var count=0;var ckbox;var foiName;for(var i=1;i<=36;i++){foiName='FORMAIL_fields_of_interest[]'+i;ckbox=document.mainform.elements[foiName];if(ckbox!=null){if(ckbox.checked==true){count++}}}
if(count>4){alertMessage+="- You can only choose up to 4 fields-of-interest #8\n";showAlert=true;}
var pass=false;for(var i=1;i<=36;i++){foiName='FORMAIL_fields_of_interest[]'+i;ckbox=document.mainform.elements[foiName];if(ckbox!=null&&ckbox.checked){pass=true;break;}}
if(!pass){alertMessage+="- Check at least one Fields Of Interest box #8\n";showAlert=true;}
if(document.mainform.FORMAIL_academic_level.value==""){alertMessage+="- Select an Academic Level #11\n";showAlert=true;document.mainform.FORMAIL_academic_level.focus();}
if(document.mainform.FORMAIL_degree.value==""){alertMessage+="- Enter your Degree #12\n";showAlert=true;document.mainform.FORMAIL_degree.focus();}
if(document.mainform.FORMAIL_academic_goals.value==""){alertMessage+="- Enter your Academic Goal #13\n";showAlert=true;document.mainform.FORMAIL_academic_goals.focus();}
if(document.mainform.FORMAIL_classes_completed.value==""){alertMessage+="- Enter your Classes Completed #14\n";showAlert=true;document.mainform.FORMAIL_classes_completed.focus();}
if(document.mainform.FORMAIL_classes_completed.value.length>500){alertMessage+="- Enter 500 characters or less in the classes completed field #14\n";showAlert=true;textareaCharsValidate(document.mainform.FORMAIL_classes_completed,500);document.mainform.FORMAIL_classes_completed.focus();}
if(document.mainform.FORMAIL_employment.value.length>500){alertMessage+="- Enter 500 characters or less in the Employment and dates of employment...  field #17\n";showAlert=true;textareaCharsValidate(document.mainform.FORMAIL_employment,500);document.mainform.FORMAIL_employment.focus();}
if(document.mainform.FORMAIL_volunteered_works.value.length>500){alertMessage+="- Enter 500 characters or less in the Community, campus, professional...  field #18\n";showAlert=true;textareaCharsValidate(document.mainform.FORMAIL_volunteered_works,500);document.mainform.FORMAIL_volunteered_works.focus();}
if(document.mainform.FORMAIL_computer_skills.value.length>500){alertMessage+="- Enter 500 characters or less in the Specific computer skills field #19\n";showAlert=true;textareaCharsValidate(document.mainform.FORMAIL_computer_skills,500);document.mainform.FORMAIL_computer_skills.focus();}
if(document.mainform.FORMAIL_hope_to_gain.value.length>300){alertMessage+="- Enter 300 characters or less in the What do you hope to gain... field #26\n";showAlert=true;textareaCharsValidate(document.mainform.FORMAIL_hope_to_gain,300);document.mainform.FORMAIL_hope_to_gain.focus();}
var gpaExp=/^[0-9\.]+$/;var trimGpa=trimFormValue(document.mainform.FORMAIL_gpa.value);if(!(trimGpa.match(gpaExp))){alertMessage+="- Enter a valid GPA #15\n";showAlert=true;document.mainform.FORMAIL_gpa.focus();}
if(document.mainform.FORMAIL_career_goals.value==""){alertMessage+="- Enter your Career Goals #16\n";showAlert=true;document.mainform.FORMAIL_career_goals.focus();}
if(document.mainform.FORMAIL_employment.value==""){alertMessage+="- Enter your employment history #17\n";showAlert=true;document.mainform.FORMAIL_employment.focus();}
if(document.mainform.FORMAIL_volunteered_works.value==""){alertMessage+="- Enter your involvements #18\n";showAlert=true;document.mainform.FORMAIL_volunteered_works.focus();}
if(document.mainform.FORMAIL_computer_skills.value==""){alertMessage+="- Enter your computer skills #19\n";showAlert=true;document.mainform.FORMAIL_computer_skills.focus();}
if(document.mainform.FORMAIL_receive_credit.value==""){alertMessage+="- Select if you will get academic credit #21\n";showAlert=true;document.mainform.FORMAIL_receive_credit.focus();}
var dateExp=/(0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])[-/.](19|20)\d\d/;var trimStartDate=trimFormValue(document.mainform.FORMAIL_start_date.value);if(!(trimStartDate.match(dateExp)))
{alertMessage+="- Enter a valid available start date format of mm/dd/yyyy #22\n";showAlert=true;document.mainform.FORMAIL_start_date.focus();}
if(document.mainform.FORMAIL_hours_available.value==""){alertMessage+="- Select the number of hours available #24\n";showAlert=true;document.mainform.FORMAIL_hours_available.focus();}
if(document.mainform.FORMAIL_day_time.value==""){alertMessage+="- List the day and time you are available to intern #25\n";showAlert=true;document.mainform.FORMAIL_day_time.focus();}
if(document.mainform.FORMAIL_hope_to_gain.value==""){alertMessage+="- Enter what you hope to gain #26\n";showAlert=true;document.mainform.FORMAIL_hope_to_gain.focus();}
if(showAlert)
{alert(alertMessage);return false;}
return true;}
function ToLinks(){var yRow=0;var mRow=0;var baseUrl="http://www.ttc.ocgov.com/tcweb/";yRow=document.Rptlinks.Year.selectedIndex;mRow=document.Rptlinks.Month.selectedIndex;var m=document.getElementById("Month");var y=document.getElementById("Year");var mMonthText=m.options[mRow].text;var mMonthValue=m.options[mRow].value;var yYearText=parseInt(y.options[yRow].text);var yYearValue=y.options[yRow].value;var fullYear=new Date().getFullYear();if(yYearText==fullYear){var defaultMonthOptionValue="";var xSelect=document.getElementById("monthId");for(i=0;i<xSelect.length;i++){if(xSelect.options[i].defaultSelected){defaultMonthOptionValue=xSelect.options[i].value;break;}}
if(parseInt(mMonthValue)>parseInt(defaultMonthOptionValue)){baseUrl+="ReportMsg.htm";}else{baseUrl+=String.format('{0}{1}{2}{3}{4}{5}','Reports','/cover-',mMonthValue,'-',yYearValue,'.htm');}}else{if((yYearText<fullYear&&yYearText>=2006)||(yYearText==2005&&parseInt(mMonthValue)>=10)){baseUrl+=String.format('{0}{1}{2}{3}{4}{5}','Reports','/cover-',mMonthValue,'-',yYearValue,'.htm');}else if((yYearText<=2005&&yYearText>=2001)||(yYearText==2000&&parseInt(mMonthValue)>=06)){baseUrl+=String.format('{0}{1}{2}{3}{4}{5}{6}','Reports',"/"+mMonthText+" "+yYearText.toString(),'/cover-',mMonthValue,'-',yYearValue,'.htm');}else{baseUrl+="ReportMsg.htm";}}
if(baseUrl.indexOf("ReportMsg.htm",0)==-1){open(baseUrl,'openwindow','scrollbars=yes,resizable=yes,toolbar=yes,menubar=no,status=yes');}else{open(baseUrl,'Msgwindow','scrollbars=no,resizable=no,toolbar=no,menubar=no,width=500,height=250,left='+300+',top='+400+',status=no');}}
String.format=function(){if(arguments.length==0){return null;}
var str=arguments[0];for(var i=1;i<arguments.length;i++){var re=new RegExp('\\{'+(i-1)+'\\}','gm');str=str.replace(re,arguments[i]);}
return str;}