// JavaScript Document
var subNavShown = 0;
//Quote Rotation
var quote=new Array();

  quote[0]='It is good to hear things like this to remind me how important this time is with my children, as it does go by quickly.';
  quote[1]='After reading Little House on the Freeway, I have slowed down our life. We reduced the number of activities we all do now and focus on family times together and family times with friends.';
  quote[2]='I really appreciate the words the Lord gave you in Little House on the Freeway.';
  quote[3]='I just wanted to say a big “Thank You” for writing the book.';
  quote[4]='I’ve always been a busy and active young person and somehow got the misconceived idea your book was for married/middle aged people.';
  quote[5]='This has really helped me to see my life in a new perspective and to realize that family, friends and spiritual growth is far more important.';
  quote[6]='Thanks for the breath of fresh air in the mad rush of modern life!';

var speed=8250;    /*this is the time in milliseconds adjust to suit*/
var q=0;

function showQuote() {
	var objQuotes = document.getElementById("quotes");
	if (objQuotes) {
    	objQuotes.innerHTML=quote[q];
     	q++;
		if(q==quote.length) {
			q=0;
	  	}
	}
}

setInterval('showQuote()',speed);

//END QUOTE CODE

function overLink(obj) {
	if (obj.className == "linkBarLink") {
		obj.className = "linkBarLinkOver";
	} else {
		obj.className = "linkBarLink";
	}
}

function getPrice(obj) {
	var objList = document.getElementById('DDListPriceDisp');
	var objFM = document.getElementById('DDFMPriceDisp');
	if (obj.selectedIndex == 1) {
		//Hardback
		objList.innerHTML = "$19.99";
		objFM.innerHTML = "$16.99";
	} else if (obj.selectedIndex == 0) {
		//Paperback
		objList.innerHTML = "$14.99";
		objFM.innerHTML = "$11.99";
	} else {
		//En Español
		objList.innerHTML = "13.99";
		objFM.innerHTML = "$11.19";
	}
}

function breadcrumbs(pageName){
  sURL = new String;
  bits = new Object;
  var x = 0;
  var stop = 0;
  var output = "<a style=\"color:#fff;text-decoration:none;font-weight:bold;\" href=\"http://www.familymatters.net\">FamilyMatters.net</a>";
  sURL = location.href;
  sURL = sURL.slice(8,sURL.length);
  chunkStart = sURL.indexOf("/");
  sURL = sURL.slice(chunkStart+1,sURL.length)
  while(!stop){
    chunkStart = sURL.indexOf("/");
    if (chunkStart != -1){
      bits[x] = sURL.slice(0,chunkStart)
      sURL = sURL.slice(chunkStart+1,sURL.length);
    }else{
      stop = 1;
    }
    x++;
  }
  var sPath = window.location.pathname;
  var sPage = sPath.substring(sPath.lastIndexOf('/') + 1);
  var isIndex = false;
  if (sPage == "" || sPage == "index.asp") {
	  isIndex = true;
  }
  var bitCount = 0;
  for(var z in bits) {
	  bitCount++;
  }
  var tempbit = "";
  for(var i in bits){
	  if (i == bitCount-1 && isIndex) {
		tempbit = bits[i].replace(/_/g, " ");
		tempbit = tempbit.replace(/%20/g, " ");
		tempbit = tempbit.replace(/%2D/g, "-");
		tempbit = tempbit.replace(/%5F/g, " ");
		output += "&nbsp;>&nbsp;<strong>" + tempbit + "</strong>";
	  } else {
		output += "&nbsp;>&nbsp;<a style=\"color:#fff;font-weight:bold;text-decoration:none;\" href=\"";
		for(y=1;y<x-i;y++){
		  output += "../";
		}
		tempbit = bits[i].replace(/_/g, " ");
		tempbit = tempbit.replace(/%20/g, " ");
		tempbit = tempbit.replace(/%2D/g, "-");
		tempbit = tempbit.replace(/%5F/g, " ");
		output += bits[i] + "/\">" + tempbit + "</a>";
	  }
	
//	tempbit = bits[i].replace(/_/g, " ");
//	tempbit = tempbit.replace(/%20/g, " ");
//	tempbit = tempbit.replace(/%2D/g, " ");
//	tempbit = tempbit.replace(/%5F/g, "-");
//  output += bits[i] + "/\">" + tempbit + "</a>";
  }
  if (!isIndex) {
	  if (pageName == undefined) {
		pageName = "&nbsp;&gt;&nbsp;<strong>" + document.title + "</strong>";
	  } else {
		pageName = "&nbsp;&gt;&nbsp;<strong>" + pageName + "</strong>";  
	  }
	  output += pageName;
  }
  document.write(output);
}

function gotoLink(page) {
	window.location = page + ".asp";
}


function submitToShoppingCart(id,feature) {
	document.getElementById('feature').value = feature;
	document.getElementById('product').value = id;
	document.getElementById('BG_submit').submit();
}

function getDDValue(obj) {
	var objDD = document.getElementById(obj);
	return objDD.options[objDD.options.selectedIndex].value;
}