function mmLoadMenus() {
  if (window.mm_menu_0115151358_0) return;
        window.mm_menu_0115151358_0_1 = new Menu("Our&nbsp;Experience",155,19,"Arial, Helvetica, sans-serif",13,"#FFFFFF","#F3E8AC","#0055A5","#002A7A","left","middle",3,0,1000,-5,7,true,false,true,0,true,true);
    mm_menu_0115151358_0_1.addMenuItem("Firm&nbsp;Profile","location='http://www.mdbd.ca/chartered-accountants-victoria.php#firm'");
    mm_menu_0115151358_0_1.addMenuItem("Mission&nbsp;Statement","location='http://www.mdbd.ca/chartered-accountants-victoria.php#mission'");
    mm_menu_0115151358_0_1.addMenuItem("Our&nbsp;Philosophy","location='http://www.mdbd.ca/chartered-accountants-victoria.php#philosophy'");
     mm_menu_0115151358_0_1.hideOnMouseOut=true;
     mm_menu_0115151358_0_1.bgColor='#555555';
     mm_menu_0115151358_0_1.menuBorder=2;
     mm_menu_0115151358_0_1.menuLiteBgColor='';
     mm_menu_0115151358_0_1.menuBorderBgColor='#0055A5';
  window.mm_menu_0115151358_0 = new Menu("root",145,19,"Arial, Helvetica, sans-serif",13,"#FFFFFF","#F3E8AC","#0055A5","#002A7A","left","middle",3,0,1000,-5,7,true,false,true,0,true,true);
  mm_menu_0115151358_0.addMenuItem("Firm&nbsp;Profile","location='http://www.mdbd.ca/accounting-firm-profile.php'");
  mm_menu_0115151358_0.addMenuItem("Mission&nbsp;Statement","location='http://www.mdbd.ca/mission-statement.php'");
  mm_menu_0115151358_0.addMenuItem("Our&nbsp;Team","location='http://www.mdbd.ca/accounting-team.php'");
  mm_menu_0115151358_0.addMenuItem("Our&nbsp;Experience","location='http://www.mdbd.ca/experienced-chartered-accountants.php'");  
  mm_menu_0115151358_0.addMenuItem("Our&nbsp;Philosophy","location='http://www.mdbd.ca/accounting-philosophy.php'");
   mm_menu_0115151358_0.hideOnMouseOut=true;
   mm_menu_0115151358_0.childMenuIcon="https://www.mdbd.ca/images/arrows.gif";
   mm_menu_0115151358_0.bgColor='#555555';
   mm_menu_0115151358_0.menuBorder=2;
   mm_menu_0115151358_0.menuLiteBgColor='';
   mm_menu_0115151358_0.menuBorderBgColor='#0055A5';
      window.mm_menu_0115155924_0 = new Menu("root",285,19,"Arial, Helvetica, sans-serif",13,"#FFFFFF","#F3E8AC","#0055A5","#002A7A","left","middle",3,0,1000,-5,7,true,false,true,0,true,true);
  mm_menu_0115155924_0.addMenuItem("Accounting&nbsp;&&nbsp;Bookkeeping","location='http://www.mdbd.ca/accounting-bookkeeping.php'");
  mm_menu_0115155924_0.addMenuItem("Financial&nbsp;Statement&nbsp;Preparation","location='http://www.mdbd.ca/financial-statement-prep.php'");
  mm_menu_0115155924_0.addMenuItem("Tax&nbsp;Preparation&nbsp;and&nbsp;Taxation","location='http://www.mdbd.ca/tax-preparation-victoria.php'");
  mm_menu_0115155924_0.addMenuItem("Auditing","location='http://www.mdbd.ca/auditing.php'");
 <!-- mm_menu_0115155924_0.addMenuItem("Forensic&nbsp;Auditing,&nbsp;Accounting&nbsp;and&nbsp;Analysis","location='http://www.mdbd.ca/forensic-auditing.php'");-->
  <!-- mm_menu_0115155924_0.addMenuItem("Litigation&nbsp;Support","location='http://www.mdbd.ca/litigation-support.php'"); -->
  mm_menu_0115155924_0.addMenuItem("Business&nbsp;Valuations","location='http://www.mdbd.ca/business-valuations.php'");
  mm_menu_0115155924_0.addMenuItem("Review&nbsp;of&nbsp;Internal&nbsp;Controls","location='http://www.mdbd.ca/internal-controls.php'");
  mm_menu_0115155924_0.addMenuItem("Services&nbsp;for&nbsp;Not-for-Profit&nbsp;Organizations","location='http://www.mdbd.ca/not-for-prof.php'");
  mm_menu_0115155924_0.addMenuItem("Consulting/Advisory&nbsp;Services","location='http://www.mdbd.ca/accounting-consulting.php'");
   mm_menu_0115155924_0.hideOnMouseOut=true;
   mm_menu_0115155924_0.bgColor='#555555';
   mm_menu_0115155924_0.menuBorder=2;
   mm_menu_0115155924_0.menuLiteBgColor='#FFFFFF';
   mm_menu_0115155924_0.menuBorderBgColor='#0055A5';

mm_menu_0115155924_0.writeMenus();
} // mmLoadMenus()

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

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_swapImage() { //v3.0
  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 checkrequired(which) {
	
	var pass = true;
	var num_chars = 9;
	
	if (document.images) {
	
		for (i = 0; i < which.length; i ++) {
		var tempobj = which.elements[i];
			
			
			if (tempobj.name.substring(0,num_chars) == "required_") {
				//generic check
				if (((tempobj.type == "text" || tempobj.type == "textarea"|| tempobj.type == "password") &&
					tempobj.value == '') || (tempobj.type.toString().charAt(0) == "s" &&
					tempobj.selectedIndex == 0)) {
					pass=false;
					break;
	      		}
	      		// email validation check
	      		if(tempobj.name == "required_email"){
			    	if(!is_email_valid(tempobj.value)){
			    		alert("Invalid Email Address '" + tempobj.value + "'\n\nEmail should be in the format yourname@domain.com");
			    		return false;
			    	}
	    		}
	      		// directory name check
	      		if(tempobj.name == "required_directory_name"){
			    	if(!is_valid_dir(tempobj.value)){
			    		alert("Invalid Directory Name '" + tempobj.value + "'\n\nSpecial characters and spaces are not permitted. Letters and Numbers only.");
			    		return false;
			    	}
	    		}			    	
	    	}//end requred check
	  }//end for loop
	}//object check
	
	if (!pass) {
		shortFieldName = tempobj.name.substring(num_chars,30).toUpperCase();
		alert("Please enter a value in the " + shortFieldName + " field.");
		return false;
	}
	else
		return true;
}

function is_valid_dir(strString){
   //  check for valid numeric strings	
   var strValidChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_";
   var strChar;
   var blnResult = true;

   if (strString.length == 0) return false;

   //  test strString consists of valid characters listed above
   for (i = 0; i < strString.length && blnResult == true; i++)
      {
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1)
         {
         blnResult = false;
         }
      }
   return blnResult;

}


function is_email_valid(strEmail){
	arr = strEmail.split("@");
			
	if( arr.length != 2 ){
		return false;
	}else if( !valid_domain( arr[1] )){
		return false;
	}else if( !valid_email_name(arr[0]) ){
		return false;
	}
		
	return true;
}

function valid_domain(strDomain){
	// These the only valid characters allowed in a domain name...
	// besides periods...
	var i = 0;
	//strDomain = strDomaun.toLowerCase();
	var arr = strDomain.split(".");
	
	if( arr.length < 2 ){
		return false;
	}
	
	for( i = 0; i < arr.length; i++ ) {
		if( !valid_domain_field( arr[i] ) ) {
			return false;
		}	
	}

	return true;
}

function valid_domain_field(strField){
	var valid = "abcdefghijklmnopqrstuvwxyx0124567890-";
	var i = 0, m = 0;
	var isValid = false;
	
	strField = strField.toLowerCase();
	
	if( strField == "" )
		return false; // if period get are together to at end or beginning, there will be blanks
		
	for( i = 0; i < strField.length; i++ ){
		isValid = false;
		for( m = 0; m < valid.length; m++ ){
			if( strField.charAt(i) == valid.charAt(m) ){
				isValid = true;
				break;
			}
		}
		if( !isValid )
			return false;
	}
	
	return true;
}

function valid_email_name(strName){
	var valid = "abcdefghijklmnopqrstuvwxyz0123456789-_.";
	var isValid = false;
	var i = 0;
	var m = 0;
	var c;
	
	strName = strName.toLowerCase();
	
	if( strName == "" )
		return false; // Bad @ placement...
	
	for( i = 0; i < strName.length; i++ ){
		
		c = strName.charAt(i);
		isValid = false
		for( m = 0; m < valid.length; m++ ){
			if( c == valid.charAt(m) ){
				isValid = true;
				break;
			}
		}
	
		if( !isValid )
			return false;
		
	}
	return true;
}


// global storage object for type-ahead info, including reset() method
var typeAheadInfo = {last:0, 
                     accumString:"", 
                     delay:3000,
                     timeout:null, 
                     reset:function() {this.last=0; this.accumString=""}
                    };
// function invoked by select element's onkeydown event handler
function typeAhead() {
   // limit processing to IE event model supporter; don't trap Ctrl+keys
   if (window.event && !window.event.ctrlKey) {
      // timer for current event
      var now = new Date();
      // process for an empty accumString or an event within [delay] ms of last
      if (typeAheadInfo.accumString == "" || now - typeAheadInfo.last < typeAheadInfo.delay) {
         // make shortcut event object reference
         var evt = window.event;
         // get reference to the select element
         var selectElem = evt.srcElement;
         // get typed character ASCII value
         var charCode = evt.keyCode;
         // get the actual character, converted to uppercase
         var newChar =  String.fromCharCode(charCode).toUpperCase();
         // append new character to accumString storage
         typeAheadInfo.accumString += newChar;
         // grab all select element option objects as an array
         var selectOptions = selectElem.options;
         // prepare local variables for use inside loop
         var txt, nearest;
         // look through all options for a match starting with accumString
         for (var i = 0; i < selectOptions.length; i++) {
            // convert each item's text to uppercase to facilitate comparison
            // (use value property if you want match to be for hidden option value)
            txt = selectOptions[i].text.toUpperCase();
            // record nearest lowest index, if applicable
            nearest = (typeAheadInfo.accumString > 
                       txt.substr(0, typeAheadInfo.accumString.length)) ? i : nearest;
            // process if accumString is at start of option text
            if (txt.indexOf(typeAheadInfo.accumString) == 0) {
               // stop any previous timeout timer
               clearTimeout(typeAheadInfo.timeout);
               // store current event's time in object 
               typeAheadInfo.last = now;
               // reset typeAhead properties in [delay] ms unless cleared beforehand
               typeAheadInfo.timeout = setTimeout("typeAheadInfo.reset()", typeAheadInfo.delay);
               // visibly select the matching item
               selectElem.selectedIndex = i;
               // prevent default event actions and propagation
               evt.cancelBubble = true;
               evt.returnValue = false;
               // exit function
               return false;   
            }            
         }
         // if a next lowest match exists, select it
         if (nearest != null) {
            selectElem.selectedIndex = nearest;
         }
      } else {
         // not a desired event, so clear timeout
         clearTimeout(typeAheadInfo.timeout);
      }
      // reset global object
      typeAheadInfo.reset();
   }
   return true;
}


function CRAenable(status){
status=!status; 
document.form.CRA_auth.value = "";
}

function ENGAGEMENTenable(status){
status=!status; 
document.form.engagement_auth.value = "";
}

function RESOLUTIONSenable(status){
status=!status; 
document.form.resolutions_auth.value = "";
}

function T183_auth_enable(status){
status=!status; 
document.form.T183_auth.value = "";
}

function T183_picked_up_enable(status){
	status=!status; 
	document.form.T183_picked_up.value = "";
}

function T183_received_enable(status){
	status=!status; 
	document.form.T183_received.value = "";
	}
function CRAACK_received_enable(status){
	status=!status; 
	document.form.CRAACK_received.value = "";
	}
function efiled_enable(status){
	status=!status; 
	document.form.efiled.value = "";
	}

