
function bookmark(){
    var title="Husband and Wife Law Team Blog - Breyer Law Offices, P.C."
    var url="http://www.husbandandwifelawteamblog.com/"
    if (window.sidebar) window.sidebar.addPanel(title, url,"");
    else if( window.opera && window.print )
    {
    var mbm = document.createElement('a');
    mbm.setAttribute('rel','sidebar');
    mbm.setAttribute('href',url);
    mbm.setAttribute('title',title);
    mbm.click();
    }
    else if( document.all ) window.external.AddFavorite( url, title);

}

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];}}
}

preload = function() {
	MM_preloadImages('','')
}
// if (window.attachEvent) window.attachEvent("onload", preload);

// Client/Lawyer Testimonial Switcher

	// update testimonial text here - all text on one line for js to work properly
	// preview live text for proper paragraph height after changing
	var clientTestimonial = 'I was in a car accident. My children<br>found Breyer Law while I was in the<br>hospital. Everything was handled well.<br>Alexis was almost like a family<br>member. It was a great experience.<br><span class="ital">- Steven F. - Peoria, Arizona</span>';
	var lawyerTestimonial = 'Attorneys Alexis and Mark Breyer are the preeminent attorneys to consult in Arizona if you or a family member has suffered a catastrophic injury as the result of another&rsquo;s negligence.<br><span class="ital">- Vaugn De K, San Francisco (CA)</span>';

function testimonialLoad() {
			var testimonialField = document.getElementById('testimonial-text');
			testimonialField.innerHTML = clientTestimonial;
}

function testimonial(testType) {
	
	if  (testType == 'client') {
			var testimonialField = document.getElementById('testimonial-text');
			testimonialField.innerHTML = clientTestimonial;
			var testimonialLink = document.getElementById('read-more');
			testimonialLink.innerHTML = '<a href="http://www.breyerlaw.com/testimonials.html">READ MORE</a>';
			var testimonialBG = document.getElementById('testimonials');
			testimonialBG.style.background = 'url("http://www.husbandandwifelawteamblog.com/wp-content/themes/attorney/images/testimonials.jpg") no-repeat left top';
		} else {
			var testimonialField = document.getElementById('testimonial-text');
			testimonialField.innerHTML = lawyerTestimonial;
			var testimonialLink = document.getElementById('read-more');
			testimonialLink.innerHTML = '<a href="http://www.breyerlaw.com/testimonials-attorneys.html">READ MORE</a>';
			var testimonialBG = document.getElementById('testimonials');
			testimonialBG.style.background = 'url("http://www.husbandandwifelawteamblog.com/wp-content/themes/attorney/images/testimonials.jpg") no-repeat left bottom';

		}
	
}
// End Client/Lawyer Testimonial Switcher


// Contact Form submit/reset button image rollover script
var submitRolls = new Object();
var resetRolls = new Object();
function submitroll(src, oversrc, name)
{
this.src=src;
this.oversrc=oversrc;
this.name=name;
this.alt="Submit";
this.write=submitroll_write;
}

function resetroll(src, oversrc, name)
{
this.src=src;
this.oversrc=oversrc;
this.name=name;
this.alt="Reset";
this.write=resetroll_write;
}

function submitroll_write()
{
var thisform = 'document.forms[' + (document.forms.length - 1) + ']';
submitRolls[this.name] = new Object();
submitRolls[this.name].over = new Image();
submitRolls[this.name].over.src = this.oversrc;
submitRolls[this.name].out = new Image();
submitRolls[this.name].out.src = this.src;

document.write
	(
	'<A onMouseOver="if (document.images)document.images[\'' + this.name + "'].src=submitRolls['" + this.name + '\'].over.src"' + 
	' onMouseOut="if (document.images)document.images[\'' + this.name + "'].src=submitRolls['" + this.name + '\'].out.src"' + 
	' HREF="javascript:'
	);

if (this.sendfield)
	{
	if (! this.sendvalue)
		this.sendvalue = 1;
	document.write(thisform, ".elements['", this.sendfield, "'].value='", this.sendvalue, "';");
	}

document.write(thisform + '.submit();void(0);"');
if (this.msg)document.write(' onClick="return confirm(\'' , this.msg, '\')"');
document.write('>');

document.write('<IMG SRC="' + this.src + '" ALT="' + this.alt + '" BORDER=0 NAME="' + this.name + '"');
if (this.height)document.write(' HEIGHT=' + this.height);
if (this.width)document.write(' WIDTH='  + this.width);
if (this.otheratts)document.write(' ' + this.otheratts);
document.write('></A>');
if (this.sendfield)
	{
	document.write('<INPUT TYPE=HIDDEN NAME="' + this.sendfield + '">');
	document.forms[document.forms.length - 1].elements[this.sendfield].value='';
	}
}

function resetroll_write()
{
var thisform = 'document.forms[' + (document.forms.length - 1) + ']';
resetRolls[this.name] = new Object();
resetRolls[this.name].over = new Image();
resetRolls[this.name].over.src = this.oversrc;
resetRolls[this.name].out = new Image();
resetRolls[this.name].out.src = this.src;

document.write
	(
	'<A onMouseOver="if (document.images)document.images[\'' + this.name + "'].src=resetRolls['" + this.name + '\'].over.src"' + 
	' onMouseOut="if (document.images)document.images[\'' + this.name + "'].src=resetRolls['" + this.name + '\'].out.src"' + 
	' HREF="javascript:'
	);

if (this.sendfield)
	{
	if (! this.sendvalue)
		this.sendvalue = 1;
	document.write(thisform, ".elements['", this.sendfield, "'].value='", this.sendvalue, "';");
	}

document.write(thisform + '.reset();void(0);"');
if (this.msg)document.write(' onClick="return confirm(\'' , this.msg, '\')"');
document.write('>');

document.write('<IMG SRC="' + this.src + '" ALT="' + this.alt + '" BORDER=0 NAME="' + this.name + '"');
if (this.height)document.write(' HEIGHT=' + this.height);
if (this.width)document.write(' WIDTH='  + this.width);
if (this.otheratts)document.write(' ' + this.otheratts);
document.write('></A>');
if (this.sendfield)
	{
	document.write('<INPUT TYPE=HIDDEN NAME="' + this.sendfield + '">');
	document.forms[document.forms.length - 1].elements[this.sendfield].value='';
	}
}
// End Contact Form submit/reset button image rollover script


// Start Regional Practice Area Loader

var regionPrev = 'scottsdale';

function loadPractice(regionName){
	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4){
			var ajaxDisplay = document.getElementById('local-practice-areas');
			ajaxDisplay.innerHTML = ajaxRequest.responseText;
			
		}
	}
	var queryString = "?region=" + regionName;
	ajaxRequest.open("GET", "http://www.husbandandwifelawteamblog.com/wp-content/themes/attorney/regional-practice-areas.php" + queryString, true);
	ajaxRequest.send(null); 
			var linkDisplay = document.getElementById(regionPrev);
			linkDisplay.style.color = '#fdc689';
			var linkDisplay = document.getElementById(regionName);
			linkDisplay.style.color = '#ffff00';
			regionPrev = regionName;
}
// End Regional Practice Area Loader
