<!--

/*

Company: Smart Marketing
Author:  D. Meehan (dave@smartmarketingnow.com) 2007

*/

function jumpTo() {
	var optionValue = document.getElementById('menu').options[document.getElementById('menu').selectedIndex].value;
	if(optionValue != "false") {
	 	window.location = optionValue;
		return false;
	}
	return false;
}

function submitContact() {
	var bSubmit = false;
	if($('strName').value != 'Name' && $('strEmailAddress').value != 'Email Address') {
		bSubmit = true;
	}
	
	if(bSubmit == false) {
		alert('Please fill out your name and email address.');
		return false;
	}
	
	var xmlhttp = null;
	if (window.XMLHttpRequest) {
	  xmlhttp = new XMLHttpRequest();
	  if ( typeof xmlhttp.overrideMimeType != 'undefined') {
		xmlhttp.overrideMimeType('text/xml');
	  }
	} else if (window.ActiveXObject) {
	  xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	} else {
	  alert('It appears your browser is very old and doesn\'t support XMLHTTP.\n\nPlease consider upgrading your browser to either Internet Explorer 6/7 OR FireFox 1.5+\n\nWe apologize for the inconvenience.\n\n Please call our office at: 562-592-5001 to contact us directly.');
	}
	
	xmlhttp.onreadystatechange = function() {
	  if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { //
		$('btnSubmit').disabled = false;

		if(xmlhttp.responseText == 'true') {
			document.getElementById('contactfrm').innerHTML = 'Thank you for contacting us.<p/> We will respond quickly.';
		} else {
			alert('There was a server error processing your contact form. We apologize for the inconvenience.\n\n Please call our office at: 562-592-5001 to contact us directly.');
		}
	  } else if(xmlhttp.readyState == 4 && xmlhttp.status != 200) {
	  		$('btnSubmit').disabled = false;
			alert('There was a server error processing your contact form. We apologize for the inconvenience.\n\n Please call our office at: 562-592-5001 to contact us directly.');
	  } else {
		// wait for the call to complete
	  }
	};
	
	$('btnSubmit').disabled = true;
	
	xmlhttp.open('GET', 'http://www.lanutilaw.com/contact.php?'+$('contactform').toQueryString(), true);
	xmlhttp.send(null);
}

var scrollWin  = new Fx.Scroll(window);

if (document.images) {
 brochure_on  = new Image();  brochure_on.src ="images/brochure_icon_over.jpg"; 
 brochure_off = new Image();  brochure_off.src="images/brochure_icon.jpg"; 
}

function brochureOver() { 
 if (document.images) document.broc_icon.src=brochure_on.src;
}

function brochureOut() {
 if (document.images) document.broc_icon.src=brochure_off.src;
}

function closeDiv(box) {

	var fireOn = document.getElementById(box);
	
	if( document.createEvent ) {
	    var evObj = document.createEvent('MouseEvents');
		evObj.initMouseEvent('click', true, true, window, 1, 12, 345, 7, 220, false, false, true, false, 0, null ); 
		fireOn.dispatchEvent(evObj); 

	} else if( document.createEventObject ) {
		fireOn.fireEvent("onClick");
	}
	
}

function doFocusField(id) {

	var field = document.getElementById(id);

	switch(field.type) {
	
		case 'text':
			if(field.value == 'Name' || field.value == 'Email Address' || field.value == 'Phone Number') {
				field.value = '';
			}
		break;
		
		default:
			if(field.value == 'Comments') {
				field.innerHTML = '';
				field.value = '';
			}
		break;
	
	}

}

function doBlurField(id) {

	var field = document.getElementById(id);

	if(field.value == '') {
		switch(field.id) {
			case 'strName':
				field.value = 'Name';
			break;
			
			case 'strEmailAddress':
				field.value = 'Email Address';
			break;
			
			case 'strPhone':
				field.value = 'Phone Number';
			break;
		}
	}
	
	if(field.id == 'strComments') {
		if(field.value == '') {
			field.innerHTML = 'Comments';
			field.value = 'Comments';
		}
	}

}

window.onload = function() {

   var bgOut  = '#002049';
   var bgOut2 = '#9C7854';
   var bgIn   = '#fff';
   var fgIn   = '#0A246A';
   var fgOut  = '#fff';
	
	
   var homefx 	  = new Fx.Styles('home', 	  {'duration': 200, 'wait': false});
   var aboutfx    = new Fx.Styles('about',    {'duration': 200, 'wait': false});
   var estatefx   = new Fx.Styles('estate',   {'duration': 200, 'wait': false});
   var businessfx = new Fx.Styles('business', {'duration': 200, 'wait': false});
   var trustsfx   = new Fx.Styles('trusts',   {'duration': 200, 'wait': false});
   var probatefx  = new Fx.Styles('probate',  {'duration': 200, 'wait': false});
   var seminarsfx = new Fx.Styles('seminars', {'duration': 200, 'wait': false});
   var contactfx  = new Fx.Styles('contact',  {'duration': 200, 'wait': false});
	
   var termsfx 	  = new Fx.Styles('terms',    {'duration': 200, 'wait': false});
   var privacyfx  = new Fx.Styles('privacy',  {'duration': 200, 'wait': false});
	
   var news1fx 	  = new Fx.Styles('news1',    {'duration': 200, 'wait': false});
   var news2fx    = new Fx.Styles('news2',    {'duration': 200, 'wait': false});
	
   var emailfx    = new Fx.Slide('emailbox',  {'duration':300,'wait':false});
   var addrfx     = new Fx.Slide('contactbox',{'duration':300,'wait':false});
   var docfx      = new Fx.Slide('docbox',    {'duration':300,'wait':false});   
   
   

   emailfx.hide();
   addrfx.hide();
   docfx.hide();

   $('showaddr').onclick = function() {
		addrfx.toggle().addEvent('onComplete', function() {
					scrollWin.toBottom(); //throw this method once the box is displayed
				});
		addrfx.toggle();
   }
   
   $('showemail').onclick = function() {
		emailfx.toggle().addEvent('onComplete', function() {
					scrollWin.toBottom(); //throw this method once the box is displayed
				});
		emailfx.toggle();
   }
   
   $('showdocs').onclick = function() {
		docfx.toggle().addEvent('onComplete', function() {
					scrollWin.toBottom(); //throw this method once the box is displayed
				});
		docfx.toggle();
   }
   	
   $('home').onmouseover = function() {
	   homefx.start({
				'color': fgIn,
				'background-color': bgIn,
				'margin-left': 10
			});
	};
	
   $('home').onmouseout = function() {
	  homefx.start({
				'color': fgOut,
				'background-color': bgOut,
				'margin-left': 0
			});
   };
   
   $('about').onmouseover = function() {
	   aboutfx.start({
				'color': fgIn,
				'background-color': bgIn,
				'margin-left': 10
			});
	};
	
   $('about').onmouseout = function() {
	  aboutfx.start({
				'color': fgOut,
				'background-color': bgOut,
				'margin-left': 0
			});
   };
   
   $('estate').onmouseover = function() {
	   estatefx.start({
				'color': fgIn,
				'background-color': bgIn,
				'margin-left': 10
			});
	};
	
   $('estate').onmouseout = function() {
	  estatefx.start({
				'color': fgOut,
				'background-color': bgOut,
				'margin-left': 0
			});
   };
   
    $('business').onmouseover = function() {
	   businessfx.start({
				'color': fgIn,
				'background-color': bgIn,
				'margin-left': 10
			});
	};
	
   $('business').onmouseout = function() {
	  businessfx.start({
				'color': fgOut,
				'background-color': bgOut,
				'margin-left': 0
			});
   };
   
   $('trusts').onmouseover = function() {
	   trustsfx.start({
				'color': fgIn,
				'background-color': bgIn,
				'margin-left': 10
			});
	};
	
   $('trusts').onmouseout = function() {
	  trustsfx.start({
				'color': fgOut,
				'background-color': bgOut,
				'margin-left': 0
			});
   };
   
   $('probate').onmouseover = function() {
	   probatefx.start({
				'color': fgIn,
				'background-color': bgIn,
				'margin-left': 10
			});
	};
	
   $('probate').onmouseout = function() {
	  probatefx.start({
				'color': fgOut,
				'background-color': bgOut,
				'margin-left': 0
			});
   };
   
   
   $('seminars').onmouseover = function() {
	   seminarsfx.start({
				'color': fgIn,
				'background-color': bgIn,
				'margin-left': 10
			});
	};
	
   $('seminars').onmouseout = function() {
	  seminarsfx.start({
				'color': fgOut,
				'background-color': bgOut,
				'margin-left': 0
			});
   };
   
   $('contact').onmouseover = function() {
	   contactfx.start({
				'color': fgIn,
				'background-color': bgIn,
				'margin-left': 10
			});
	};
	
   $('contact').onmouseout = function() {
	  contactfx.start({
				'color': fgOut,
				'background-color': bgOut,
				'margin-left': 0
			});
   };
   
   $('terms').onmouseover = function() {
	   termsfx.start({
				'color': fgIn,
				'background-color': bgIn,
				'margin-left': 10
			});
	};
	
   $('terms').onmouseout = function() {
	  termsfx.start({
				'color': fgOut,
				'background-color': bgOut2,
				'margin-left': 0
			});
   };
   
   $('privacy').onmouseover = function() {
	   privacyfx.start({
				'color': fgIn,
				'background-color': bgIn,
				'margin-left': 10
			});
	};
	
   $('privacy').onmouseout = function() {
	  privacyfx.start({
				'color': fgOut,
				'background-color': bgOut2,
				'margin-left': 0
			});
   };
   
   $('news1').onmouseover = function() {
	   news1fx.start({
				'color': fgIn,
				'background-color': bgIn,
				'margin-left': 10
			});
	};
	
   $('news1').onmouseout = function() {
	  news1fx.start({
				'color': fgOut,
				'background-color': bgOut2,
				'margin-left': 0
			});
   };
   
   $('news2').onmouseover = function() {
	   news2fx.start({
				'color': fgIn,
				'background-color': bgIn,
				'margin-left': 10
			});
	};
	
   $('news2').onmouseout = function() {
	  news2fx.start({
				'color': fgOut,
				'background-color': bgOut2,
				'margin-left': 0
			});
   };
   
   
};

-->
