// Bookmarker java load
function bookmark(){
    var title="Bisnar | Chase - California Personal Injury Attorneys"
    var url="http://www.bestattorney.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);

}

// begin google analytics
  var _gaq = _gaq || []; 
  _gaq.push(['_setAccount', 'UA-7865393-1']); 
  _gaq.push(['_trackPageview']); 
  (function() { 
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; 
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; 
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); 
  })(); 
// end google analytics

function load(form, win) {
	  // form loader
	  // menu - a reference to the select object
	  // win - a reference to the window object
	  win.location.href = form.menu.options[form.menu.selectedIndex].value
	}
							
// video carousel java load
function mycarousel_initCallback(carousel) {
    jQuery('.jcarousel-control a').bind('click', function() {
        carousel.scroll(jQuery.jcarousel.intval(jQuery(this).text()));
        return false;
    });
 
    jQuery('.jcarousel-scroll select').bind('change', function() {
        carousel.options.scroll = jQuery.jcarousel.intval(this.options[this.selectedIndex].value);
        return false;
    });
 
    jQuery('#mycarousel-next').bind('click', function() {
        carousel.next();
		carousel.startAuto(0);
        return false;
    });
 
    jQuery('#mycarousel-prev').bind('click', function() {
        carousel.prev();
		carousel.startAuto(0);
        return false;
    });
	
    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });
};

// video carousel java initialization
jQuery(document).ready(function() {
								
    jQuery("#mycarousel").jcarousel({
        scroll: 1,
        auto: 2,
		wrap: 'circular',
        initCallback: mycarousel_initCallback,
        // This tells jCarousel NOT to autobuild prev/next buttons
        buttonNextHTML: null,
        buttonPrevHTML: null
    });
	
});


//onmouseover quick quote below movie
function loadTxt(clientName) {
	var txtDisplay = document.getElementById('quick-quote');
	if (clientName=='penny') { txtDisplay.innerHTML = '<strong>Penny Colonna</strong> - &ldquo;...You can’t afford to not at least call them. they’re very good.&rdquo;'; }
	if (clientName=='barbara') { txtDisplay.innerHTML = '<strong>Barbara</strong> - &ldquo;I found them on the internet&rdquo;'; }
	if (clientName=='ed') { txtDisplay.innerHTML = '<strong>Ed Solomon</strong>- &ldquo;I did not have to go to court. ...they did everything, everything&rdquo;'; }
	if (clientName=='jason') { txtDisplay.innerHTML = '<strong>Jason</strong> - &ldquo;My settlement was amazing.&rdquo;'; }
	if (clientName=='gloria') { txtDisplay.innerHTML = '<strong>Gloria</strong> - &ldquo;...I really felt they cared about me. They made me feel special.&rdquo;'; }
	if (clientName=='alexis') { txtDisplay.innerHTML = '<strong>Alexis</strong> - &ldquo;I couldn’t have asked for a better experience than with bisnar | Chase.&rdquo;'; }
	if (clientName=='spanish') { txtDisplay.innerHTML = '<strong>Name Withheld</strong> - &ldquo;Me recomendaria Bisnar y Chase.&rdquo;'; }
	if (clientName=='maria') { txtDisplay.innerHTML = '<strong>Maria</strong> - &ldquo;John Bisnar is like family...he really took care of us.&rdquo;'; }
}

//onmouseout close quick quote below movie
function closeTxt() {
	var txtDisplay = document.getElementById('quick-quote');
	txtDisplay.innerHTML = '';
}

function loadVideo(clName){
	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('video-box');
			ajaxDisplay.innerHTML = ajaxRequest.responseText;
		}
	}
	var queryString = "?clname=" + clName;
	ajaxRequest.open("GET", "video-loader.php" + queryString, true);
	ajaxRequest.send(null); 
}


// awards/menberships carousel java load
function mycarousel_initCallback2(carousel) {
    jQuery('.jcarousel-control a').bind('click', function() {
        carousel.scroll(jQuery.jcarousel.intval(jQuery(this).text()));
        return false;
    });
 
    jQuery('.jcarousel-scroll select').bind('change', function() {
        carousel.options.scroll = jQuery.jcarousel.intval(this.options[this.selectedIndex].value);
        return false;
    });
 
    jQuery('#mycarousel-next2').bind('click', function() {
        carousel.next();
		carousel.startAuto(0);
        return false;
    });
 
    jQuery('#mycarousel-prev2').bind('click', function() {
        carousel.prev();
		carousel.startAuto(0);
        return false;
    });
	
    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });
};

// awards/menberships carousel java initialization
jQuery(document).ready(function() {
								
    jQuery("#mycarousel2").jcarousel({
        scroll: 1,
        auto: 2,
		wrap: 'circular',
        initCallback: mycarousel_initCallback2,
        // This tells jCarousel NOT to autobuild prev/next buttons
        buttonNextHTML: null,
        buttonPrevHTML: null
    });
	
});

	$(document).ready(function(){
		$("#featured").tabs({fx:{opacity: "toggle"}}).tabs("rotate", 5000, true);
		$("#featured").hover(
			 function() {
			 $("#featured").tabs("rotate",0,true);
			 },
			 function() {
			 $("#featured").tabs("rotate",5000,true);
			 }
		);
	});

// open contact form added fields script

function opform() {
	$('#formbottom').show('slow', function() {
    // Animation complete.
    });
	$('#moreform').hide('fast', function() {
    // Animation complete.
    });

}
