<!-- // begin hiding
 
var value = null;
defaultStatus = "Tiffany Stone";

function OpenWin(value,wval,hval) 
{
	window.open(value,'popup','resizable=yes,width=' + wval + ',height=' + hval + ',status=no,location=no,toolbar=no,menubar=no,scrollbars=yes');
}		

function OpenNewWin(value,wval,hval) 
{
	window.open(value,'_blank','resizable=yes,width=' + wval + ',height=' + hval + ',status=no,location=no,toolbar=no,menubar=no,scrollbars=yes');
}

function confirmSubmit()
{
	var agree=confirm("Are you sure you wish to continue?");
	if (agree)
		return true ;
	else
		return false ;
}

function ResizeToFit()
{
	var imgWidth
	var imgHeight

	imgWidth = document.imgAlt.width + 100
	imgHeight = document.imgAlt.height + 80

	window.resizeTo(imgWidth, imgHeight)
}

function imgswap(primary, imgname1, secondary, imgname2)
{
	 eval("document." + primary + ".src = '" + imgname1 + "'");
	 eval("document." + secondary + ".src = '" + imgname2 + "'");	
}

function swapClass(el, class1, class2) {
	if (el.className) 
	el.className = (el.className == class1) ? class2 : class1;
}

/*
function changeColors(subcatcell)
{
	subcatcell.style.backgroundColor="#CFCBC2"
}
*/

/*
function restoreColors(subcatcell)
{
	subcatcell.style.backgroundColor=""
}
*/

/*
//disable right click
function click()
{
	if (event.button==2)
	{
		alert(' sorry the right button has been blocked !');
	}
}
document.onmousedown=click
*/


// function to place focus on a form field in Body onload.
// use: <BODY onLoad="putFocus(0,1);">
function putFocus(formInst, elementInst) {
  if (document.forms.length > 0) {
   document.forms[formInst].elements[elementInst].focus();
  }
 }
// The second number in the "onLoad" command in the body
// tag determines the form's focus. Counting starts with '0'



// cookie management

/*function putCookie() {
	cookie_name = "tiff_mepage_Cookie";
	var YouEntered;

	if(document.cookie != document.cookie) 
		{index = document.cookie.indexOf(cookie_name);}
	else 
		{ index = -1;}

	if (index == -1)
	{
		YouEntered=document.cf.cfd.value;
		document.cookie=cookie_name+"="+YouEntered+"; expires=Monday, 04-Apr-2010 05:00:00 GMT";
	}
}*/

function setDocCookie(aCookieName, aCookieValue){
	document.cookie = aCookieName + "=" + aCookieValue;
}

function clearDocCookie(){
	setDocCookie("bio1", "");
	setDocCookie("bio2", "");
	setDocCookie("bio3", "");
	setDocCookie("bio4", "");
	setDocCookie("bio5", "");
	setDocCookie("bio6", "");
	setDocCookie("bio7", "");
	setDocCookie("bio8", "");
	setDocCookie("bio9", "");
	setDocCookie("bio10", "");
}


/*function setDocCookie(aCookieName, aCookieValue) {
	if(document.cookie != document.cookie) 
		{index = document.cookie.indexOf(aCookieName);}
	else 
		{ index = -1;}

	if (index == -1)
	{
		aCookieValue=document.cf.cfd.value;
		document.cookie=aCookieValue+"="+aCookieValue+"; expires=Monday, 04-Apr-2010 05:00:00 GMT";
	}
}*/

//Get cookie routine by Shelley Powers 
function getDocCookie(aCookieName) {
  var search = aCookieName + "="
  var returnvalue = "";
  if (document.cookie.length > 0) {
    offset = document.cookie.indexOf(search)
    // if cookie exists
    if (offset != -1) { 
      offset += search.length
      // set index of beginning of value
      end = document.cookie.indexOf(";", offset);
      // set index of end of cookie value
      if (end == -1) end = document.cookie.length;
      returnvalue=unescape(document.cookie.substring(offset, end))
      }
   }
  return returnvalue;
}

function getBioCookie(aCookieName) {
	var returnvalue = "";
	if (getDocCookie(aCookieName)=="")
	{
		returnvalue="__________"
	}
	else
	{
		returnvalue=getDocCookie(aCookieName)
	}
	return returnvalue;
}



// begin photo album scripts -->
function jumppage(sel) 
{
  var i = sel.selectedIndex
  self.location.href = sel.options[i].value
}

function openGalleryWindow(url) {
	if (document.all)
		var xMax = screen.width, yMax = screen.height;
	else
		if (document.layers)
			var xMax = window.outerWidth, yMax = window.outerHeight;
		else
			var xMax = 800, yMax=600;
	var xOffset = (xMax - 200)/2, yOffset = (yMax - 200)/2;
	var xOffset = 100, yOffset = 100;

	popupWin = window.open(url,'new_page','width=700,height=535,screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset+',scrollbars=auto,toolbars=no,menubar=no,resizable=yes')
}
// end photo album scripts -->


//For showing checks and X's on answers
/*
function markAnswers(){
	var sCookieValue
	
	// 1
	sCookieValue = getDocCookie("bio1")
	if (sCookieValue=="") //no answer yet
	{
		document.getElementById("check1").style.display="none";
		document.getElementById("x1").style.display="none";
	}
	else if (sCookieValue=="in St-Jean, Quebec, Canada, on August 31, 1967") //right !!
	{
		document.getElementById("check1").style.display="block";
		document.getElementById("x1").style.display="none";
	}
	else //wrong :(
	{
		document.getElementById("check1").style.display="none";
		document.getElementById("x1").style.display="block";
	}

	// 2
	sCookieValue = getDocCookie("bio2")
	if (sCookieValue=="") //no answer yet
	{
		document.getElementById("check2").style.display="none";
		document.getElementById("x2").style.display="none";
	}
	else if (sCookieValue=="one of James Bond's girlfriends") //right !!
	{
		document.getElementById("check2").style.display="block";
		document.getElementById("x2").style.display="none";
	}
	else //wrong :(
	{
		document.getElementById("check2").style.display="none";
		document.getElementById("x2").style.display="block";
	}


}*/

function markQuiz(){
	var sCookieValue
	var sCorrectAnswer = new Array(10)
		sCorrectAnswer[0]="in St-Jean, Quebec, Canada, on August 31, 1967";
		sCorrectAnswer[1]="one of James Bond's girlfriends";
		sCorrectAnswer[2]="Jane";
		sCorrectAnswer[3]="a younger brother named Alexander";
		sCorrectAnswer[4]="in Ladner, BC, Canada";
		sCorrectAnswer[5]="her husband Carman, sons Emory and Kaslo, and daughter Jewell";
		sCorrectAnswer[6]="a BFA from UBC (a Bachelor of Fine Arts degree in Creative Writing from the University of British Columbia)";
		sCorrectAnswer[7]="a vegetarian";
		sCorrectAnswer[8]="a music school, a bakery and an animal hospital";
		sCorrectAnswer[9]="used to have sixteen cats, played the tuba in high school AND she once shaved off all her hair";
	
	for (i=1;i<11;i++)
	{

		sCookieValue = getDocCookie("bio"+i);
		if (sCookieValue=="") //no answer yet
		{
			document.getElementById("check"+i).style.display="none";
			document.getElementById("x"+i).style.display="none";
		}
		else if (sCookieValue==sCorrectAnswer[i-1]) //right !!
		{
			document.getElementById("check"+i).style.display="block";
			document.getElementById("x"+i).style.display="none";
		}
		else //wrong :(
		{
			document.getElementById("check"+i).style.display="none";
			document.getElementById("x"+i).style.display="block";
		}

	}

}


// end hiding -->