var pgArr = new Array;
//these are all of the potential pages:
pgArr[0] = new Array ("http://www.portlandpersonalinjuryaccidentlawyer.com/blog/car-accidents/",
					  "http://www.portlandpersonalinjuryaccidentlawyer.com/library/#catPA1505",
					  "http://www.portlandpersonalinjuryaccidentlawyer.com/faqs/#catPA1505",
					  "http://www.portlandpersonalinjuryaccidentlawyer.com/video/#Car%20Accidents",
					  "http://www.portlandpersonalinjuryaccidentlawyer.com/resources.html#catPA1505",
					  "http://www.portlandpersonalinjuryaccidentlawyer.com/rc-portland-animalattack.html",
					  "http://www.portlandpersonalinjuryaccidentlawyer.com/rc-portland-bikeaccident.html",
					  "http://www.portlandpersonalinjuryaccidentlawyer.com/rc-portland-caraccident.html",
					  "http://www.portlandpersonalinjuryaccidentlawyer.com/rc-portland-childinjury.html",
					  "http://www.portlandpersonalinjuryaccidentlawyer.com/rc-portland-dogbite.html",
					  "http://www.portlandpersonalinjuryaccidentlawyer.com/rc-portland-pedestrianaccident.html",
					  "http://www.portlandpersonalinjuryaccidentlawyer.com/rc-portland-personalinjury.html",
					  "http://www.portlandpersonalinjuryaccidentlawyer.com/rc-portland-productliability.html",
					  "http://www.portlandpersonalinjuryaccidentlawyer.com/rc-portland-truckaccident.html");

pgArr[1] = new Array ("http://www.portlandpersonalinjuryaccidentlawyer.com/blog/pedestrian-accidents/",
					  "http://www.portlandpersonalinjuryaccidentlawyer.com/library/#catPA2005",
					  "http://www.portlandpersonalinjuryaccidentlawyer.com/faqs/#catPA2005",
					  "http://www.portlandpersonalinjuryaccidentlawyer.com/video/#Pedestrian",
					  "http://www.portlandpersonalinjuryaccidentlawyer.com/resources.html#Pedestrian");

pgArr[2] = new Array ("http://www.portlandpersonalinjuryaccidentlawyer.com/library/#catPA1991",
					  "http://www.portlandpersonalinjuryaccidentlawyer.com/faqs/#catPA1991",
					  "http://www.portlandpersonalinjuryaccidentlawyer.com/video/#Bike",
					  "http://www.portlandpersonalinjuryaccidentlawyer.com/resources.html#catPA1991",
					  "http://www.portlandpersonalinjuryaccidentlawyer.com/blog/bike-accidents/");

foundMatch = 0;
startPoint = "1";

//loop through all of the pages; stop if you find a match
for(i=0; i < pgArr.length; i++ ) {
	if(foundMatch)
		break;
	for( j=0; j < pgArr[i].length; j++ ) {		
		if(foundMatch)
			break;
		if(window.location == pgArr[i][j]) {
			startPoint = i + 2;
			startPoint = String(startPoint);
			foundMatch = 1;
		}//end if
	}//end for j
}//end for i

//no match was found- so current page isnt one of those from the header;
//so, check the referring page (will only work for pages that don't need named anchors)
if(!foundMatch) {
	//loop through all of the pages; stop if you find a match
	for(i=0; i < pgArr.length; i++ ) {
		if(foundMatch)
			break;
		for( j=0; j < pgArr[i].length; j++ ) {
			if(foundMatch)
				break;
			if(document.referrer == pgArr[i][j]) {
				startPoint = i + 2;
				startPoint = String(startPoint);
				foundMatch = 1;
			}//end if
		}//end for j
	}//end for i
}//end outer if

function bookmark(){
    var title="Portland Personal Injury Attorneys - Shulman DuBois LLC"
    var url="http://www.portlandpersonalinjuryaccidentlawyer.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 prntPage(){
	window.print();
}

function countryControl(country)
	{ 
		if (country=='CA') {
			var stateField = document.getElementById('state-display');
			var provinceField = document.getElementById('province-display');
			var stateText = document.getElementById('state-text');
			stateField.style.display = 'none';
			provinceField.style.display = 'block';	
			stateText.innerHTML = 'Canadian Provinces:<font color=#FF0000> *</font>';
		}
		else {
			var stateField = document.getElementById('state-display');
			var provinceField = document.getElementById('province-display');
			var stateText = document.getElementById('state-text');
			stateField.style.display = 'block';
			provinceField.style.display = 'none';
			stateText.innerHTML = 'State:<font color=#FF0000> *</font>';
		}
	}
	
function stateControl() {
		var stateText = document.getElementById('state-text');
		stateText.style.color = '#FF0000';
}

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('http://www.portlandpersonalinjuryaccidentlawyer.com/images/read-blog-ex.jpg','http://www.portlandpersonalinjuryaccidentlawyer.com/images/injury-news-ex.jpg','http://www.portlandpersonalinjuryaccidentlawyer.com/images/video-library-ex.jpg','http://www.portlandpersonalinjuryaccidentlawyer.com/images/research-library-ex.jpg','http://www.portlandpersonalinjuryaccidentlawyer.com/images/injury-faqs-ex.jpg')
}

if (window.attachEvent) window.attachEvent("onload", preload);

$(document).ready(function() {
	
	$(".attorney").hrzAccordion({handlePosition     	: "right",
							  containerClass     	: "container",
							  listItemClass      	: "listItem",					
							  contentWrapper     	: "contentWrapper",
							  contentInnerWrapper	: "contentInnerWrapper",
						      handleClass        	: "handle",
							  handleClassOver    	: "handleOver",
							  openOnLoad			: startPoint,
							  handleClassSelected	: "handleSelected"
							 });
});

var tog1 = 0;
var tog2 = 0;
var tog3 = 0;
var tog4 = 0;
var tog5 = 0;

$(document).ready(function(){
	//hide the all of the element with class msg_body
	$(".exp-txt").hide();
	//toggle the componenet with class msg_body
	$(".exp").click(function(){
		if (tog1 == 0) {
				var blgBG = document.getElementById('blog');
				blgBG.style.background = 'url("http://www.portlandpersonalinjuryaccidentlawyer.com/images/read-blog-ex.jpg") no-repeat left top';
				tog1 = 1;
			} else {
				setTimeout("var blgBG = document.getElementById('blog'); blgBG.style.background = 'url(\"http://www.portlandpersonalinjuryaccidentlawyer.com/images/read-blog.jpg\") no-repeat left top';",1000);
				tog1 = 0;
			}
						 
		$(this).next(".exp-txt").slideToggle(1000);
	});
});

$(document).ready(function(){
	//hide the all of the element with class msg_body
	$(".exp-txt2").hide();
	//toggle the componenet with class msg_body
	$(".exp2").click(function(){
		if (tog2 == 0) {
				var blgBG = document.getElementById('news');
				blgBG.style.background = 'url("http://www.portlandpersonalinjuryaccidentlawyer.com/images/injury-news-ex.jpg") no-repeat left top';
				tog2 = 1;
			} else {
				setTimeout("var blgBG = document.getElementById('news'); blgBG.style.background = 'url(\"http://www.portlandpersonalinjuryaccidentlawyer.com/images/injury-news.jpg\") no-repeat left top';",250);
				tog2 = 0;
			}
						 
		$(this).next(".exp-txt2").slideToggle(250);
	});
});

$(document).ready(function(){
	//hide the all of the element with class msg_body
	$(".exp-txt3").hide();
	//toggle the componenet with class msg_body
	$(".exp3").click(function(){
		if (tog3 == 0) {
				var blgBG = document.getElementById('videos');
				blgBG.style.background = 'url("http://www.portlandpersonalinjuryaccidentlawyer.com/images/video-library-ex.jpg") no-repeat left top';
				tog3 = 1;
			} else {
				setTimeout("var blgBG = document.getElementById('videos'); blgBG.style.background = 'url(\"http://www.portlandpersonalinjuryaccidentlawyer.com/images/video-library.jpg\") no-repeat left top';",500);
				tog3 = 0;
			}
						 
		$(this).next(".exp-txt3").slideToggle(500);
	});
});

$(document).ready(function(){
	//hide the all of the element with class msg_body
	$(".exp-txt4").hide();
	//toggle the componenet with class msg_body
	$(".exp4").click(function(){
		if (tog4 == 0) {
				var blgBG = document.getElementById('library');
				blgBG.style.background = 'url("http://www.portlandpersonalinjuryaccidentlawyer.com/images/research-library-ex.jpg") no-repeat left top';
				tog4 = 1;
			} else {
				setTimeout("var blgBG = document.getElementById('library'); blgBG.style.background = 'url(\"http://www.portlandpersonalinjuryaccidentlawyer.com/images/research-library.jpg\") no-repeat left top';",1000);
				tog4 = 0;
			}
						 
		$(this).next(".exp-txt4").slideToggle(1000);
	});
});

$(document).ready(function(){
	//hide the all of the element with class msg_body
	$(".exp-txt5").hide();
	//toggle the componenet with class msg_body
	$(".exp5").click(function(){
		if (tog5 == 0) {
				var blgBG = document.getElementById('faqs');
				blgBG.style.background = 'url("http://www.portlandpersonalinjuryaccidentlawyer.com/images/injury-faqs-ex.jpg") no-repeat left top';
				tog5 = 1;
			} else {
				setTimeout("var blgBG = document.getElementById('faqs'); blgBG.style.background = 'url(\"http://www.portlandpersonalinjuryaccidentlawyer.com/images/injury-faqs.jpg\") no-repeat left top';",1000);
				tog5 = 0;
			}
						 
		$(this).next(".exp-txt5").slideToggle(1000);
	});
});

function loadVid(vidType){
	var ldDisplay = document.getElementById('video');
	ldDisplay.innerHTML = '<div id="loader"><img src="http://www.portlandpersonalinjuryaccidentlawyer.com/images/ajax-loader2.gif" width="64" height="64"></div>';
	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');
			ajaxDisplay.innerHTML = ajaxRequest.responseText;
		}
	}
	var queryString = "?vidID=" + vidType;
	ajaxRequest.open("GET", "http://www.portlandpersonalinjuryaccidentlawyer.com/video.php" + queryString, true);
	ajaxRequest.send(null); 
}

  /*************************************/
 /***	FONT INCREASE FUNCTIONS 	***/
/*************************************/

function defaultSize() {
	document.body.style.fontSize='12px';
	
	topMenu = document.getElementById('top-menu').firstChild.childNodes;
	for(i = 0; i < topMenu.length; i++) {
		topMenu.item(i).firstChild.style.fontSize = '12px';
	}//end for
	
	theDisclaimer = document.getElementById('disc-txt').childNodes;	
	for(i = 0; i < theDisclaimer.length; i++) {
		if(theDisclaimer.item(i).nodeType == 1)
			theDisclaimer.item(i).style.fontSize = '12px';
	}//end for
	
	return 1;
}//end function

function mediumSize() {
	document.body.style.fontSize='14px';
	
	topMenu = document.getElementById('top-menu').firstChild.childNodes;
	for(i = 0; i < topMenu.length; i++) {
		topMenu.item(i).firstChild.style.fontSize = '14px';
	}//end for
	
	theDisclaimer = document.getElementById('disc-txt').childNodes;	
	for(i = 0; i < theDisclaimer.length; i++) {
		if(theDisclaimer.item(i).nodeType == 1)
			theDisclaimer.item(i).style.fontSize = '14px';
	}//end for
	
	return 1;
}//end function

function largeSize() {	
	document.body.style.fontSize='16px';
	
	topMenu = document.getElementById('top-menu').firstChild.childNodes;
	for(i = 0; i < topMenu.length; i++) {
		topMenu.item(i).firstChild.style.fontSize = '16px';
	}//end for
	
	theDisclaimer = document.getElementById('disc-txt').childNodes;	
	for(i = 0; i < theDisclaimer.length; i++) {
		if(theDisclaimer.item(i).nodeType == 1)
			theDisclaimer.item(i).style.fontSize = '16px';
	}//end for
	
	return 1;
}//end function

function getCookie(c_name) {
	if (document.cookie.length>0) {
	  c_start=document.cookie.indexOf(c_name + "=");
	  if (c_start!=-1) { 
		c_start=c_start + c_name.length+1; 
		c_end=document.cookie.indexOf(";",c_start);
		if (c_end==-1) c_end=document.cookie.length;
		return unescape(document.cookie.substring(c_start,c_end));
	  } 
    }
	return "";
}

function setCookie(c_name,value,expiredays) {
	var exdate=new Date();
	exdate.setDate(exdate.getDate()+expiredays);
	document.cookie=c_name+ "=" + escape(value) + ((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}

function setStyleByTag(e, p, v, g) {
	if(g) {
		var elements = document.getElementsByTagName(e);
		for(var i = 0; i < elements.length; i++) {
			elements.item(i).style[p] = v;
		}
	} else {
		var sheets = document.styleSheets;
		if(sheets.length > 0) {
			for(var i = 0; i < sheets.length; i++) {
				var rules = sheets[i].cssRules;
				if(rules.length > 0) {
					for(var j = 0; j < rules.length; j++) {
						var s = rules[j].style;
						// selectorText broken in NS 6/Mozilla: see
						// http://bugzilla.mozilla.org/show_bug.cgi?id=51944
						ugly_selectorText_workaround();
						if(allStyleRules) {
							if(allStyleRules[j] == e) {
								s[p] = v;
							}			
						} else {
							// use the native selectorText and style stuff
							if(((s[p] != "") && (s[p] != null)) &&
							   (rules[j].selectorText == e)) {
								s[p] = v;
							}
						}

					}
				}
			}
		}
	}
}

	

function smtxt() { 
	var contTxt = document.getElementById("personal-injury");
	contTxt.style.fontSize = "13px";
	contTxt.style.lineHeight = "15px";
	var topNav = document.getElementById("firm-information");
	topNav.style.fontSize = "12px";
	topNav.style.lineHeight = "16px";
	var botNav = document.getElementById("sitemap");
	botNav.style.fontSize = "10px";
	botNav.style.lineHeight = "14px";
	var sideForm = document.getElementById("contact");
	sideForm.style.fontSize = "12px";
	sideForm.style.lineHeight = "16px";
	var h1Txt = document.getElementsByTagName("H1");
	var myH1 = h1Txt.item(0);
	myH1.style.fontSize = "16px";
	setStyleByTag("H2", "fontSize", "12px", 1);
	setStyleByTag("H3", "fontSize", "12px", 1);
	setStyleByTag("H4", "fontSize", "12px", 1);
	var toggle = "sm";
	setCookie('toggle',toggle,1);
}

function mdtxt() { 
	var contTxt = document.getElementById("personal-injury");
	contTxt.style.fontSize = "16px";
	contTxt.style.lineHeight = "20px";
	var topNav = document.getElementById("firm-information");
	topNav.style.fontSize = "14px";
	topNav.style.lineHeight = "18px";
	var botNav = document.getElementById("sitemap");
	botNav.style.fontSize = "12px";
	botNav.style.lineHeight = "16px";
	var sideForm = document.getElementById("contact");
	sideForm.style.fontSize = "14px";
	sideForm.style.lineHeight = "18px";
	var h1Txt = document.getElementsByTagName("H1");
	var myH1 = h1Txt.item(0);
	myH1.style.fontSize = "18px";
	setStyleByTag("H2", "fontSize", "14px", 1);
	setStyleByTag("H3", "fontSize", "14px", 1);
	setStyleByTag("H4", "fontSize", "14px", 1);
	var toggle = "md";
	setCookie('toggle',toggle,1);
}

function lgtxt() { 
	var contTxt = document.getElementById("personal-injury");
	contTxt.style.fontSize = "18px";
	contTxt.style.lineHeight = "22px";
	var topNav = document.getElementById("firm-information");
	topNav.style.fontSize = "17px";
	topNav.style.lineHeight = "21px";
	var botNav = document.getElementById("sitemap");
	botNav.style.fontSize = "14px";	
	botNav.style.lineHeight = "18px";
	var sideForm = document.getElementById("contact");
	sideForm.style.fontSize = "16px";
	sideForm.style.lineHeight = "20px";
	var h1Txt = document.getElementsByTagName("H1");
	var myH1 = h1Txt.item(0);
	myH1.style.fontSize = "20px";
	setStyleByTag("H2", "fontSize", "16px", 1);
	setStyleByTag("H3", "fontSize", "16px", 1);
	setStyleByTag("H4", "fontSize", "16px", 1);
	var toggle = "lg";
	setCookie('toggle',toggle,1);
}

function chngFnt() {
	var toggle=getCookie('toggle');
	if (toggle=='sm') { smtxt(); }
	if (toggle=='md') { mdtxt(); }
	if (toggle=='lg') { lgtxt(); }
}
setTimeout("chngFnt();",500);

