	    function PopUp(sURL, lWidth, lHeight) {
	      dt = new Date();
	      id = dt.getTime();
	      window.open(sURL, id, 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=' + lWidth + ',height=' + lHeight + ',left=80,top=80');
	    }
		///////////////////////////////////////////////////////////////////////////////////
		// JQuery script for dynamically assigning events/styles/functions and loading data
		///////////////////////////////////////////////////////////////////////////////////

		$(document).ready(function() {
			//$("a[href$='.pdf']").removeAttr('onclick').attr("target","_blank");
			
            //associate events and css styles
			if (window.location.href.indexOf('circuit-civil-court.aspx') > -1) {
				$('#circuit-civil-redirect').change(function() { if (this.options[this.selectedIndex].value != 'none') if (this.options[this.selectedIndex].value.indexOf('http') == 0) window.location.href=this.options[this.selectedIndex].value; else window.location.href='/enu/' + this.options[this.selectedIndex].value } );
			}
			if (window.location.href.indexOf('county-civil-court.aspx') > -1) {
				$('#county-civil-redirect').change(function() { if (this.options[this.selectedIndex].value != 'none') if (this.options[this.selectedIndex].value.indexOf('http') == 0) window.location.href=this.options[this.selectedIndex].value; else window.location.href='/enu/' + this.options[this.selectedIndex].value } );
			}
			if (window.location.href.indexOf('criminal-court.aspx') > -1) {
				$('#criminal-redirect').change(function() { if (this.options[this.selectedIndex].value != 'none') if (this.options[this.selectedIndex].value.indexOf('http') == 0) window.location.href=this.options[this.selectedIndex].value; else window.location.href='/enu/' + this.options[this.selectedIndex].value } );
			}
			if (window.location.href.indexOf('family-court.aspx') > -1) {
				$('#family-redirect').change(function() { if (this.options[this.selectedIndex].value != 'none') if (this.options[this.selectedIndex].value.indexOf('http') == 0) window.location.href=this.options[this.selectedIndex].value; else window.location.href='/enu/' + this.options[this.selectedIndex].value } );
			}
			if (window.location.href.indexOf('traffic-court.aspx') > -1) {
				$('#traffic-redirect').change(function() { if (this.options[this.selectedIndex].value != 'none') if (this.options[this.selectedIndex].value.indexOf('http') == 0) window.location.href=this.options[this.selectedIndex].value; else window.location.href='/enu/' + this.options[this.selectedIndex].value } );
			}
			if (window.location.href.indexOf('traffic-ticket-payment-disclaimer.aspx') > -1) {
				$('#accept-traffic-disclaimer').click(function() { if (confirm("By Accepting The Disclaimer You Are Acknowledging That You Have Read And Agree To The Terms and Conditions.  Click 'Ok' To Continue To Traffic Payment.")) window.location.href='http://myclerk.myorangeclerk.com/default.aspx'; } );
				$('#accept-traffic-disclaimer').attr('value', 'Accept');
			}
			if (window.location.href.indexOf('unclaimed-checks.aspx') > -1) {
				$('#accept-unclaimedCheck-disclaimer').click(function() { if (confirm("By Accepting The Disclaimer You Are Acknowledging That You Have Read And Agree To The Terms and Conditions.  Click 'Ok' To Review Unclaimed Checks.")) PopUp('/enu/Sunshine/unclaimed_checks.pdf', 800, 600); } );
				$('#accept-unclaimedCheck-disclaimer').attr('value', 'Accept');
			}
			if (window.location.href.indexOf('Lists/Newsletter%20Email%20Addresses') > -1) {
				var email = $('#ctl00_ctl19_g_7bec13d5_0bbb_4d70_a680_7453d267cef1_ctl00_ctl05_ctl00_ctl00_ctl00_ctl04_ctl00_ctl00_TextField').val();
				$('ctl00_ctl19_g_7bec13d5_0bbb_4d70_a680_7453d267cef1_ctl00_toolBarTbltop_RightRptControls_ctl01_ctl00_diidIOSaveItem').click(function() { if ((email == '') || (email.indexOf('@') == -1) || (email.indexOf('.') == -1)) alert('Invalid email address.'); } );
			}
			if (window.location.href.indexOf('Pages/about-us/search-available-positions.aspx') > -1) {
				var img = $("img[src$='/enu/PublishingImages/apply_now_button.gif']");
				//alert(i.length);
				for (i = 0; i < img.length; i++) {
					img.attr('title', 'apply now >');
					img.attr('alt', 'apply now >');
				}
			}

			$("ul.thumb li").hover(function() {
				$(this).css({'z-index' : '10'}); /*Add a higher z-index value so this image stays on top*/ 
				$(this).find('img').addClass("hover").stop() /* Add class of "hover", then stop animation queue buildup*/
					.animate({
						width: '272px', /* Set new width */
						height: '204px', /* Set new height */
						padding: '20px'
					}, 200); /* this value of "200" is the speed of how fast/slow this hover animates */
			
				} , function() {
				$(this).css({'z-index' : '0'}); /* Set z-index back to 0 */
				$(this).find('img').removeClass("hover").stop()  /* Remove the "hover" class , then stop animation queue buildup*/
					.animate({
						width: '240px', /* Set width back to default */
						height: '180px', /* Set height back to default */
						padding: '5px'
					}, 400);
			});
		
			//now call web services to populate several drop-down controls based on values in Lists
			wsURL = GetWSURL();
        });

		function GetWSURL() {
            // Build the URL of the Lists.asmx web service.
 			wsURL = '';
            if (window.location.href.indexOf('internet-staging') > -1)
				wsURL = 'http://internet-staging.myorangeclerk.net/enu/';
			else if (window.location.href.indexOf('http://www.myorangeclerk') > -1)
				wsURL = 'http://www.myorangeclerk.com/enu/';
			else if (window.location.href.indexOf('http://myorangeclerk') > -1)
				wsURL = 'http://myorangeclerk.com/enu/';
			else if (window.location.href.indexOf('http://new.myorangeclerk') > -1)
				wsURL = 'http://new.myorangeclerk.com/enu/';

            return  wsURL + '_vti_bin/lists.asmx';
		}

		///////////////////////////////////////////////////////////////////////////////////
		// Newsletter Block
		///////////////////////////////////////////////////////////////////////////////////
        function AddEmailAddress(email, wsURL) {
            // The CAML to create a new item and set the 'Email Address' field.
            var batch =
                "<Batch OnError=\"Continue\"> \
                    <Method ID=\"1\" Cmd=\"New\"> \
                        <Field Name=\"Title\">" + email + "</Field> \
                    </Method> \
                </Batch>";

            // The SOAP Envelope
            var soapEnv =
                "<?xml version=\"1.0\" encoding=\"utf-8\"?> \
                <soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" \
                    xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" \
                    xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\"> \
                  <soap:Body> \
                    <UpdateListItems xmlns=\"http://schemas.microsoft.com/sharepoint/soap/\"> \
                      <listName>Newsletter Email Addresses</listName> \
                      <updates> \
                        " + batch + "</updates> \
                    </UpdateListItems> \
                  </soap:Body> \
                </soap:Envelope>";

            // Make the call by posting the SOAP Envelope.
            $.ajax({
                url: wsURL,
                beforeSend: function(xhr) {
                    xhr.setRequestHeader("SOAPAction",
                    "http://schemas.microsoft.com/sharepoint/soap/UpdateListItems");
                },
                type: "POST",
                dataType: "xml",
                data: soapEnv,
                complete: displaySignUpResult,
                contentType: "text/xml; charset=utf-8"
            });
        }

        function displaySignUpResult(xData, status) {
        	if (status == 'success') $('#signup .success').css('display', 'block');
            //alert(status +  '\n' + xData.responseXML.xml);
        }
        
		///////////////////////////////////////////////////////////////////////////////////
		// Home page Announcements/News link re-style script
		///////////////////////////////////////////////////////////////////////////////////
		var headID = document.getElementsByTagName("head")[0];
        if (window.location.href.indexOf('orange-county-clerk-of-court-home.aspx') > -1) {
			var cssNode = document.createElement('link');
			cssNode.type = 'text/css';
			cssNode.rel = 'stylesheet';
			cssNode.href = '/enu/Styles/styles_home.css';
			headID.appendChild(cssNode);

			_spBodyOnLoadFunctionNames.push('Announcement_Styles');
		}
		//make sure the following style only renders on the Announcment display page
        if (window.location.href.indexOf('Announcements/DispForm.aspx') > -1) {
			var cssNode = document.createElement('link');
			cssNode.type = 'text/css';
			cssNode.rel = 'stylesheet';
			cssNode.href = '/enu/Styles/styles_hide_button.css';
			headID.appendChild(cssNode);
       	}
		
		function Announcement_Styles() {
			//reset Announcement style
			var elem = document.getElementsByTagName('a');
			var size = elem.length;
		
			//loop through tr elements to reset Announcements formatting, and remove MouseOver styles
			for (var i = 0; i < size; i++) {
				if (elem[i].href.indexOf('CopyUtil') > -1) {	
					elem[i].setAttribute('style', 'font-family:Verdana,Helvetica,sans-serif !important; font-weight:normal !important; font-size:8pt !important; color:#0072BC !important; text-decoration:none !important; ');				
					elem[i].setAttribute('onmouseover', "this.style.textDecoration='underline';");
					elem[i].setAttribute('onmouseout', "this.style.textDecoration='none';");
				}
			}
		}
		
		///////////////////////////////////////////////////////////////////////////////////
		// Utility functions
		///////////////////////////////////////////////////////////////////////////////////
		function getParameterByName(name) {
			name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
			var regexS = "[\\?&]"+name+"=([^&#]*)";
			var regex = new RegExp( regexS );
			var results = regex.exec(window.location.href);
			
			if (results == null)
				return '';
			else
				return decodeURIComponent(results[1].replace(/\+/g, " "));
		}
		
		/*
			Developed by Robert Nyman, http://www.robertnyman.com
			Code/licensing: http://code.google.com/p/getelementsbyclassname/
		*/
		var getElementsByClassName = function (className, tag, elm){
			if (document.getElementsByClassName) {
				getElementsByClassName = function (className, tag, elm) {
					elm = elm || document;
					var elements = elm.getElementsByClassName(className),
						nodeName = (tag)? new RegExp("\\b" + tag + "\\b", "i") : null,
						returnElements = [],
						current;
					for(var i=0, il=elements.length; i<il; i+=1){
						current = elements[i];
						if(!nodeName || nodeName.test(current.nodeName)) {
							returnElements.push(current);
						}
					}
					return returnElements;
				};
			}
			else if (document.evaluate) {
				getElementsByClassName = function (className, tag, elm) {
					tag = tag || "*";
					elm = elm || document;
					var classes = className.split(" "),
						classesToCheck = "",
						xhtmlNamespace = "http://www.w3.org/1999/xhtml",
						namespaceResolver = (document.documentElement.namespaceURI === xhtmlNamespace)? xhtmlNamespace : null,
						returnElements = [],
						elements,
						node;
					for(var j=0, jl=classes.length; j<jl; j+=1){
						classesToCheck += "[contains(concat(' ', @class, ' '), ' " + classes[j] + " ')]";
					}
					try	{
						elements = document.evaluate(".//" + tag + classesToCheck, elm, namespaceResolver, 0, null);
					}
					catch (e) {
						elements = document.evaluate(".//" + tag + classesToCheck, elm, null, 0, null);
					}
					while ((node = elements.iterateNext())) {
						returnElements.push(node);
					}
					return returnElements;
				};
			}
			else {
				getElementsByClassName = function (className, tag, elm) {
					tag = tag || "*";
					elm = elm || document;
					var classes = className.split(" "),
						classesToCheck = [],
						elements = (tag === "*" && elm.all)? elm.all : elm.getElementsByTagName(tag),
						current,
						returnElements = [],
						match;
					for(var k=0, kl=classes.length; k<kl; k+=1){
						classesToCheck.push(new RegExp("(^|\\s)" + classes[k] + "(\\s|$)"));
					}
					for(var l=0, ll=elements.length; l<ll; l+=1){
						current = elements[l];
						match = false;
						for(var m=0, ml=classesToCheck.length; m<ml; m+=1){
							match = classesToCheck[m].test(current.className);
							if (!match) {
								break;
							}
						}
						if (match) {
							returnElements.push(current);
						}
					}
					return returnElements;
				};
			}
			return getElementsByClassName(className, tag, elm);
		};


