// JavaScript Document

	
	
function MM_preloadImages() { //v3.0
  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];}}
}

startList=function(){
if(document.all&&document.getElementById){
navRoot=document.getElementById("navlist");
for(i=0;i<navRoot.childNodes.length;i++){
node=navRoot.childNodes[i];
if(node.nodeName=="LI"){
node.onmouseover=function(){
this.className+="over";
}
node.onmouseout=function(){
this.className=this.className.replace("over","");
}
}
}
}
}


if (document.layers){ 
self.location.href="detect.html";
}


<!--//--><![CDATA[//><!--
sfHover = function() {
	
	
		if( document.getElementById("navlist") ){
	
	var sfEls = document.getElementById("navlist").getElementsByTagName("li");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
	
		}
	
	
}
if (window.attachEvent) window.attachEvent("onload", sfHover);
//--><!]]>



//v1.0
//Copyright 2006 Adobe Systems, Inc. All rights reserved.
function AC_AddExtension(src, ext)
{
  if (src.indexOf('?') != -1)
    return src.replace(/\?/, ext+'?'); 
  else
    return src + ext;
}

function AC_Generateobj(objAttrs, params, embedAttrs) 
{ 
  var str = '<object ';
  for (var i in objAttrs)
    str += i + '="' + objAttrs[i] + '" ';
  str += '>';
  for (var i in params)
    str += '<param name="' + i + '" value="' + params[i] + '" /> ';
  str += '<embed ';
  for (var i in embedAttrs)
    str += i + '="' + embedAttrs[i] + '" ';
  str += ' ></embed></object>';

  document.write(str);
}

function AC_FL_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
     , "application/x-shockwave-flash"
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_SW_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".dcr", "src", "clsid:166B1BCA-3F9C-11CF-8075-444553540000"
     , null
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
  var ret = new Object();
  ret.embedAttrs = new Object();
  ret.params = new Object();
  ret.objAttrs = new Object();
  for (var i=0; i < args.length; i=i+2){
    var currArg = args[i].toLowerCase();    

    switch (currArg){	
      case "classid":
        break;
      case "pluginspage":
        ret.embedAttrs[args[i]] = args[i+1];
        break;
      case "src":
      case "movie":	
        args[i+1] = AC_AddExtension(args[i+1], ext);
        ret.embedAttrs["src"] = args[i+1];
        ret.params[srcParamName] = args[i+1];
        break;
      case "onafterupdate":
      case "onbeforeupdate":
      case "onblur":
      case "oncellchange":
      case "onclick":
      case "ondblClick":
      case "ondrag":
      case "ondragend":
      case "ondragenter":
      case "ondragleave":
      case "ondragover":
      case "ondrop":
      case "onfinish":
      case "onfocus":
      case "onhelp":
      case "onmousedown":
      case "onmouseup":
      case "onmouseover":
      case "onmousemove":
      case "onmouseout":
      case "onkeypress":
      case "onkeydown":
      case "onkeyup":
      case "onload":
      case "onlosecapture":
      case "onpropertychange":
      case "onreadystatechange":
      case "onrowsdelete":
      case "onrowenter":
      case "onrowexit":
      case "onrowsinserted":
      case "onstart":
      case "onscroll":
      case "onbeforeeditfocus":
      case "onactivate":
      case "onbeforedeactivate":
      case "ondeactivate":
      case "type":
      case "codebase":
        ret.objAttrs[args[i]] = args[i+1];
        break;
      case "width":
      case "height":
      case "align":
      case "vspace": 
      case "hspace":
      case "class":
      case "title":
      case "accesskey":
      case "name":
      case "id":
      case "tabindex":
        ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
        break;
      default:
        ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
    }
  }
  ret.objAttrs["classid"] = classid;
  if (mimeType) ret.embedAttrs["type"] = mimeType;
  return ret;
}


function Set_Cookie( name, value, expires, path, domain, secure ){
	// set time, it's in milliseconds
	var today = new Date();
	today.setTime( today.getTime() );
	
	/*
	if the expires variable is set, make the correct
	expires time, the current script below will set
	it for x number of days, to make it for hours,
	delete * 24, for minutes, delete * 60 * 24
	*/
	//if (expires){
	//	expires = expires * 1000 * 60 * 60 * 24;
	//}
	//var expires_date = new Date( today.getTime() + (expires) );
	
	document.cookie = name + "=" +escape( value ) +
	//( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) +
	( ( path ) ? ";path=" + path : "" ) +
	( ( domain ) ? ";domain=" + domain : "" ) +
	( ( secure ) ? ";secure" : "" );
}


function get_cookie(Name) {
  var search = Name + "="
  var returnvalue = "";
  if (document.cookie.length > 0) {
    offset = document.cookie.indexOf(search)
    // if cookie exists
    if (offset != -1) { 
      offset += search.length
      // set index of beginning of value
      end = document.cookie.indexOf(";", offset);
      // set index of end of cookie value
      if (end == -1) end = document.cookie.length;
      returnvalue=unescape(document.cookie.substring(offset, end))
      }
   }
  return returnvalue;
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_findObj(n, d) { //v4.01
  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_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'block':(v=='hide')?'none':v; }
    obj.display=v; }
}

function validate() {
//alert('go');

	var required_fields = new Array();
	
	required_fields[0]=document.contact_form.elements[0].value;
	required_fields[1]=document.contact_form.elements[2].value;
	required_fields[2]=document.contact_form.elements[3].value;
	//alert(document.contact_form.required_fields[0].value);
	//alert(required_fields[0]);
	var x=0;
	for(var i=0; i<required_fields.length; i++){
	if(required_fields[i]==''){
		MM_showHideLayers('infoform','','show','commentform','','hide');
		x++;
		}
	
	}
	if(x>0){
		alert('Please fill in required fields.');
		
		//document.contact_form.proceed.value = 0;
	}else{
	//warning=false;
		MM_showHideLayers('infoform','','hide','commentform','','show');
		document.contact_form.proceed.value = 1;
		//alert(document.contact_form.proceed.value);
	}
}



function change(id, newClass) {
	if ( document.getElementById(id) != null ) {
		document.getElementById(id).className=newClass;
	}
}



//** Scrolling HTML Bookmarks script- (c) Dynamic Drive DHTML code library: http://www.dynamicdrive.com.
//** Available/ usage terms at http://www.dynamicdrive.com/ (April 11th, 09')

var bookmarkscroll={
	setting: {duration:1000, yoffset:0}, //{duration_of_scroll_milliseconds, offset_from_target_element_to_rest}
	topkeyword: '#top', //keyword used in your anchors and scrollTo() to cause script to scroll page to very top

	scrollTo:function(dest, options, hash){
		var $=jQuery, options=options || {}
		var $dest=(typeof dest=="string" && dest.length>0)? (dest==this.topkeyword? 0 : $('#'+dest)) : (dest)? $(dest) : [] //get element based on id, topkeyword, or dom ref		
		
		if ($dest===0 || $dest.length==1 && (!options.autorun || options.autorun && Math.abs($dest.offset().top+(options.yoffset||this.setting.yoffset)-$(window).scrollTop())>5)){
			this.$body.animate({scrollTop: ($dest===0)? 0 : $dest.offset().top+(options.yoffset||this.setting.yoffset)}, (options.duration||this.setting.duration), function(){
				if ($dest!==0 && hash)
					location.hash=hash
			})
		}
	},

	urlparamselect:function(){
		var param=window.location.search.match(/scrollto=[\w\-_,]+/i) //search for scrollto=divid
		return (param)? param[0].split('=')[1] : null
	},
	
	init:function(){
		jQuery(document).ready(function($){
			// for the accordion on VOC practice areas
			$(".show_more a").toggle(function(event){												 
				
				event.preventDefault();				
		
				$(this).find("span").html(' less <img src="../images/arr_up_more.gif">');
				$(this).parent().next('div').slideDown("fast");
				}, function() {		
					$(this).find("span").html(' more <img src="../images/arr_down_more.gif">');
					$(this).parent().next('div').slideUp("fast");
				});
				$(".show_more").next('div').hide();		
				$(".show_more").next('div').css({
					  'background-color' : '#efefef',
					  'padding' : '5px 10px 2px 20px'
				});
				
				
			var mainobj=bookmarkscroll
			mainobj.$body=(window.opera)? (document.compatMode=="CSS1Compat"? $('html') : $('body')) : $('html,body')
			var urlselectid=mainobj.urlparamselect() //get div of page.htm?scrollto=divid
			if (urlselectid) //if id defined
				setTimeout(function(){mainobj.scrollTo(document.getElementById(urlselectid) || $('a[name='+urlselectid+']:eq(0)').get(0), {autorun:true})}, 100)
			$('a[href^="#"]').each(function(){ //loop through links with "#" prefix
				var hashvalue=this.getAttribute('href').match(/#\w+$/i) //filter links at least 1 character following "#" prefix
				hashvalue=(hashvalue)? hashvalue[0].substring(1) : null //strip "#" from hashvalue
				if (this.hash.length>1){ //if hash value is more than just "#"
					var $bookmark=$('a[name='+this.hash.substr(1)+']:eq(0)')
					if ($bookmark.length==1 || this.hash==mainobj.topkeyword){ //if HTML anchor with given ID exists or href==topkeyword
						if ($bookmark.length==1 && !document.all || document.all && window.XMLHttpRequest) //non IE, or IE7+
							$bookmark.html('.').css({position:'absolute', fontSize:1, visibility:'hidden'})
						$(this).click(function(e){
							mainobj.scrollTo((this.hash==mainobj.topkeyword)? mainobj.topkeyword : $bookmark.get(0), {}, this.hash)
							e.preventDefault()
						})
					}
				}
			})
		})
	}
}

bookmarkscroll.init();











/// BEGIN MAILCHIMP ACCORDION
jQuery(document).ready(function() {
								
	// initialize this variable, which will tell you if the accordions are opened or closed
	var globalState="hide";
	var globalState2="hide";
	var globalState3="hide";
	// get cookie for the service area methods sub-nav
	var cookieval = get_cookie('vbtest');
							
   //close items
	jQuery("#accordion-menu > div.wrap").find("div.accordion-items").hide();
	jQuery("#accordion-menu2 > div.wrap").find("div.accordion-items").hide();


	if(chimp_opened==1){
		jQuery("#accordion-menu3 > div.wrap").find("div.accordion-items").show();
	}else{
		jQuery("#accordion-menu3 > div.wrap").find("div.accordion-items").hide();
	}
	
	// rewritten b/c it stopped working when we switched JQUERY versions
	jQuery("#acc_tab", jQuery("#accordion-menu")).addClass("closed");
	jQuery("#acc_tab", jQuery("#accordion-menu2")).addClass("closed");	
	
	jQuery("#acc_tab", jQuery("#accordion-menu")).click(function() {				
	
		// toggle the open or closed state on every click
		if(globalState=="hide"){
			globalState="show";
		}else{
			globalState="hide";
		}	
			
		jQuery("#accordion-menu > div.wrap").find("div.accordion-items").slideToggle("normal");
		//jQuery("#accordion-menu > div.wrap").find("div.accordion-items").removeClass("closed");	
		
		if (globalState=="show") {
			// add minus-sign graphic
			jQuery("#acc_tab", jQuery("#accordion-menu")).addClass("open");
		}else{ 
			// remove minus-sign graphic
			jQuery("#acc_tab", jQuery("#accordion-menu")).removeClass("open");
			// add plus-sign graphic
			jQuery("#acc_tab", jQuery("#accordion-menu")).addClass("closed");
		}		
	});



	jQuery("#acc_tab", jQuery("#accordion-menu2")).click(function() {
	
		// toggle the open or closed state on every click
		if(globalState2=="hide"){
			globalState2="show";
		}else{
			globalState2="hide";
		}		
			
		jQuery("div.accordion-items", jQuery("#accordion-menu2")).slideToggle("normal");
		//jQuery("#acc_tab", jQuery("#accordion-menu2")).removeClass("open");
		
		if (globalState2=="show") {
				// add minus-sign graphic
				jQuery("#acc_tab", jQuery("#accordion-menu2")).addClass("open");
			}else{ 
				// remove minus-sign graphic
				jQuery("#acc_tab", jQuery("#accordion-menu2")).removeClass("open");
				// add plus-sign graphic
				jQuery("#acc_tab", jQuery("#accordion-menu2")).addClass("closed");
			}
	});


	jQuery("#acc_tab", jQuery("#accordion-menu3")).click(function() {
	
		jQuery("div.accordion-items", jQuery("#accordion-menu3")).slideToggle("normal");
		
	});
	
	



	
	///// rotating logos		
	jQuery('#pics').removeClass("hidden");
	
	jQuery('#pics').cycle({
		fx: 'fade',
		speed:  1200,
		random: 0
	})
	////end rotator
		
	// if cookie for the service area methods sub-nav  doesn't exist, slide menu down and set cookie
	if(cookieval!='1'){	
		jQuery("#methods_subnav").hide();
		setTimeout( function() {			
			jQuery("#methods_subnav").slideDown("slow");		
			Set_Cookie('vbtest', '1');
		}, 750);	
	}

	//// HIDE VOC MAILCHIMP FORM
	jQuery(".hidden_mailchimp").hide();
	
	
	
	function IsValidEmail(email)	{
		var filter = /^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
		return filter.test(email);
	}



	
	if( jQuery('.email_field') ){
		if(jQuery( "input[name=email_address]" ).val()==''){
			jQuery( "input[name=email_address]" ).val(	jQuery( "input[name=email_address]" ).attr('default_val') );
		}
	
	}
	
	
	
	//// CLEAR OUT DEFAULT FORM VAL
	jQuery( "input[name=email_address]" ).focus( function(){
				
			if( jQuery(this).val()==jQuery(this).attr('default_val') ||   jQuery(this).val()=='Please enter your email.' ||   jQuery(this).val()=='Invalid email format.'){
				jQuery(this).val( '' );
				jQuery( "input[name=email_address]" ).css('color', '#666');			
			}
														  
	  });
	
	
	//// CLEAR OUT DEFAULT FORM VAL
	jQuery( "input[name=email_address]" ).blur( function(){
				
			if( jQuery(this).val()==''){
				jQuery(this).val( jQuery(this).attr('default_val') );
			}
														  
	  });

	
	//// OPEN START TALKING FORM
	jQuery('.go_btn').click( function(){
								  
		//////// MAKE SURE THE VALUE IS NOT EMPTY, NOT DEFAULT TEXT, NOT ERROR TEXT							  
	  if( jQuery( "input[name=email_address]" ).val()!='' &&
			jQuery( "input[name=email_address]" ).val()!='Please enter your email.' &&
			jQuery( "input[name=email_address]" ).val()!='Invalid email format.' &&
			jQuery( "input[name=email_address]" ).val()!=jQuery( "input[name=email_address]" ).attr('default_val')			
			){
		  
			  /// MAKE SURE THE EMAIL ADDRESS IS A VALID FORMAT
			  if( !IsValidEmail( jQuery( "input[name=email_address]" ).val() )  ){	
					jQuery( "input[name=email_address]" ).val( 'Invalid email format.' );
					jQuery( "input[name=email_address]" ).css('color', '#FF0000');		
			  }else{
				  /// THIS IS VALID....SO WE'RE GOING TO SHOW THE ENTIRE FORM
					jQuery('.email_field').fadeOut("fast");
					jQuery('#EMAIL').val( jQuery( "input[name=email_address]" ).val() );				
					jQuery('.hidden_mailchimp').fadeIn(); 
					jQuery( "input[name=email_address]" ).css('color', '#666');	
			  }
			
		  }else{
			  jQuery( "input[name=email_address]" ).val( 'Please enter your email.' );
			   jQuery( "input[name=email_address]" ).css('color', '#FF0000');			  
		  }		
		   
	});////END GO BTN CLICK
	
	/// HIDE START TALKING FORM
	jQuery('.start_talking_inner').hide();
	
	//// OPEN START TALKING FORM
	jQuery('.start_talking').click( function(){
		jQuery('.start_talking_inner').slideToggle("fast");		   
	});
	



});/////END DOCUMENT READY
