/* This script is not freeware!
//
// Multi-Level Drop-Down Menu 2.82
// You can find and buy latest version of the script 
// at the http://spicebrains.com/multi-level-drop-down-menu/
//
// Copyright 2010 SpiceBrains.com
//////////////////////////////////////////////////////////////////////////////////////////////////*/
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('b 2K=0;c(!31){b 48=0;b 47=0;b 46=4C;b 31=\'2y\';b 45=4B;b 44=\'h\';b 43=S;b 42=0;b 41=S;b 40=X;b 3X=3W}b Y=\'4A\';b Q=N O();g 4z(4y){b 1U=U.R(\'1N\');b p=0;B(b i=0;i<1U.q;i++){c(1U[i].1s==Y){1U[i].o.1c=\'21\';b u=1U[i];b 1O=u.4x(\'2i\');Q[p]=N O();Q[p][0]=u;Q[p][1]=1O;p++}}32()}g 32(){B(b i=0;i<Q.q;i++){b u=Q[i][0];b 1O=Q[i][1];c(u.27)Q[i]=N 4a(u,i,1O);I T.1d("32()",10)}}g l(f){e.f=f;e.1x=X;e.G=0;e.x=0;e.y=0;e.1F=0;e.1E=0;e.1H=0;e.2w=0;e.26=0;e.3p=0;e.2G=0;e.1G=0;e.2E=0;e.2F=0;e.1j=X;e.14=N O();e.M=0;e.W=P;e.1v=N O();}g 4a(u,49,2i){b 1M=u;b 1t=49;b C=e;b 1P=P;b 1Q=P;b 1o=S;b 2N=P;b 1u=X;b 25=48;b 2D=47;b 2X=46;b 1y=31;b 1a=45;b 1I=44;b 1L=43;b 2Q=42;b 2g=41;b 2I=40;b D;c(2i){D=2i.4w(",");c(D[0])25=D[0]*1;c(D[1])2D=D[1]*1;c(D[2])2X=D[2]*1;c(D[3])1y=D[3];c(D[4])1a=D[4]*1;c(D[5])1I=D[5];c(D[6])1L=D[6]*1;c(D[7])2Q=D[7]*1;c(D[8])2g=D[8]*1;c(D[8])2I=D[9]*1;c(!1a)1a=30}e.m=N O();g J(p,4v,1T,Z){b F=C.m[p];B(b z=0;z<F.14.q;z++)2f(F.14[z]);b M=F.M;b Z=3Z.3Y(30/Z);b K=0;c(M<1T){B(b i=M;i<=1T;i=i+4){F.14[K]=1d("2z("+1t+","+p+","+i+")",(K*Z));K++}}I c(M>1T){B(b i=M;i>=1T;i=i-4){F.14[K]=1d("2z("+1t+","+p+","+i+")",(K*Z));K++}}}g 1R(p,2Z,Z){b F=C.m[p];B(b z=0;z<F.14.q;z++)2f(F.14[z]);b M=F.M;b Z=3Z.3Y(30/Z);b K=0;c(1I==\'h\')2h=0;I 2h=1;c(2Z==\'3V\'){B(i=M;i<=11;i=i+2){F.14[K]=1d("2x("+1t+","+p+","+i+","+2h+")",(K*Z));K++}}I c(2Z==\'3T\'){B(i=M;i>=0;i=i-2){F.14[K]=1d("2x("+1t+","+p+","+i+","+2h+")",(K*Z));K++}}}g 3s(l){b G=0;b 1S=l;15(1S.1s!=Y){c(1S.17==\'2O\')G++;1S=1S.1q}E G}g 3S(){1u=X;B(b i=0;i<C.m.q;i++)c(C.m[i].1x){1u=S;2q}}g 3I(p){c(!C.m[p].1x&&(3X==3W)){c(1y==\'3U\')J(p,0,11,1a);I c(1y==\'1R\')1R(p,\'3V\',1a);I C.m[p].f.o.1c=\'21\';2Y(p,S);C.m[p].1x=S;1u=S;}}g 2L(p){c(C.m[p].1x){c(1y==\'3U\')J(p,11,0,1a);I c(1y==\'1R\')1R(p,\'3T\',1a);I C.m[p].f.o.1c=\'2s\';2Y(p,X);C.m[p].1x=X;}c(C.m[p].G==1)3S()}g 2Y(p,3R){b d=C.m[p];c(3R&&2g&&d.W)d.W.o.16=d.1v[1];I c(2g&&d.W)d.W.o.16=d.1v[0]}g 2b(u){B(i=0;i<C.m.q;i++){c(C.m[i].f==u)E i}E-1}g 3r(l){15(l.1s!=Y){l=l.1q;c(l.17==\'2O\')E 2b(l)}E-1}g 3o(u){b 2B=u.1z;u.o.2u=\'4u\';b 1D=2B-u.1z;u.o.2u=1D+\'L\';E 1D}g 3n(u){15(u.1s!=Y){u=u.1q;c(u.17==\'3Q\')2q}E u.R("a")[0].3q;}g 3m(u){c(u.1s==Y)E P;15(u.17!=\'3Q\')u=u.1q;E 1Z(u,\'A\')}g 3G(){c(1P){T.2f(1P);1P=P}}g 3H(){1Q=T.1d(C.2a,2X)}g 2M(){c(1Q){T.2f(1Q);1Q=P}}g 3l(){b 3P=\'.\'+Y+\' > 1J > a:2W\'.1w();b 3O=\'.\'+Y+\' 1J a:2W\'.1w();b 3N=\'.\'+Y+\' 1N 1J a:2W\'.1w();b 2U=\'\';b 2d=\'\';b 2T=\'\';b 1e=N O();B(b i=0;i<U.2V.q;i++){3b{1e[1e.q]=U.2V[i].4t||U.2V[i].4s}39(38){}}B(b j=0;j<1e.q;j++){c(1e[j]){B(b k=0;k<1e[j].q;k++){b 19=1e[j][k];c(!19.2e)4r;c(19.2e.1w()==3P)2U=19.o.16;I c(19.2e.1w()==3O)2d=19.o.16;I c(19.2e.1w()==3N)2T=19.o.16}}}b d=C.m;B(b z=0;z<d.q;z++){c(d[z].W)d[z].1v[0]=d[z].W.o.16;c(d[z].W&&d[z].G==1)d[z].1v[1]=2d+\';\'+2U;c(d[z].W&&d[z].G>1)d[z].1v[1]=2d+\';\'+2T;}}g 24(3M,3L){b 3J=3M+3L;B(b i=0;i<C.m.q;i++){c(C.m[i].G>1){C.m[i].f.o.2C=C.m[i].x+\'L\';C.m[i].1j=X}}B(b i=0;i<C.m.q;i++){b F=C.m[i];c(F.G>1){b 2R=F.1H;b 2S=F.2G;b 3K=1X(F.f)[0];c((3K+2R+2S*F.G-2S)>3J&&1L){F.f.o.2C=-2R-25+\'L\';F.1j=S}}}}e.2A=g(p){c(!1u){1u=p;1P=1d("3k("+1t+","+p+")",2Q)}I 3I(p)};e.3D=g(){c(1o){1o=X;2M();b 2c=e;b l=2c.R("1N")[0];b 2P=2b(l);c(2P>=0)C.2A(2P);b 13=N O();13[0]=2c.R("1N")[0];c(!13[0])13[0]=0;b 1r=2c.1q;b H=0;15(1r.1s!=Y){c(1r.17==\'2O\'){H++;13[H]=1r}1r=1r.1q}b 1p=N O(C.m.q);B(b i=0;i<1p.q;i++)1p[i]=X;B(b i=0;i<13.q;i++)1p[2b(13[i])]=S;B(b i=0;i<1p.q;i++)c(!1p[i]&&(2N!=13[0]))2L(i);2N=13[1]}};e.3B=g(){c(1Z(e,P).17==\'A\'){1o=S;C.2a()}};e.3C=g(){1o=S};e.3z=g(){3H();3G()};e.3x=g(){2M()};e.3w=g(){24(1A(),1Y())};e.3v=g(){24(1A(),1Y())};e.2a=g(){B(b i=0;i<C.m.q;i++){c(1o)2L(i)}};c(U.3F(\'3E\'))2K=U.3F(\'3E\');2K.1O=\'\';b 1n=1M.R("1J");e.m[0]=N l(1M);B(b z=0;z<1n.q;z++){b 2J=1n[z].R("1N")[0];c(2J)e.m[e.m.q]=N l(2J);1n[z].3y=e.3D;1n[z].3A=e.3C;c(2I)1n[z].3u=e.3B}1M.3A=e.3z;1M.3y=e.3x;c(1L)T.4q=e.3w;c(1L)T.4p=e.3v;U.3u=e.2a;B(b H=1;H<e.m.q;H++){b 29=e.m[H].f.3c;b 12=N O();b 1K=N O();b 28=0;B(b x=0;x<29.q;x++){c(!1B(29[x]))12[12.q]=29[x]}B(b y=0;y<12.q;y++){c(12[y].R){b 1m=12[y].R("*");c(1m.q&&!1B(1m[0])&&1m[0].17!=\'A\'){1m[0].o.3t=\'2y\';1K[1K.q]=1m[0]}}}B(b z=0;z<12.q;z++){c(12[z].R){b 2H=12[z].R("a");c(2H[0]){b V=2H[0].27;c(V>28)28=V}}}B(b s=0;s<1K.q;s++)1K[s].o.3t=\'4o\';e.m[H].f.o.V=28+\'L\'}B(b H=0;H<e.m.q;H++){b d=e.m[H];d.G=3s(d.f);d.2F=3r(d.f);d.1H=d.f.27;d.2w=d.f.3q;d.26=1Z(d.f.R("1J")[0],P).27;d.3p=0;d.2G=(d.1H-d.26)/2;d.1G=3o(d.f);d.2E=3n(d.f);d.W=3m(d.f)};B(b H=0;H<e.m.q;H++){b G=e.m[H].G;b d=e.m[H];c((1I==\'h\'&&G>1)||(1I==\'v\'&&G>0)){d.x=e.m[d.2F].26+25;d.y=d.f.1z-d.1G-d.2E+2D;d.f.o.2C=d.x+\'L\';d.f.o.2B=d.y+\'L\'}I{d.x=d.f.34;d.y=d.f.1z-d.1G}d.1F=1X(d.f)[0];d.1E=1X(d.f)[1]}3l();24(1A(),1Y())}g 3k(1l,1k){Q[1l].2A(1k)}g 2z(1l,1k,J){b 23=Q[1l];b l=23.m[1k];l.M=J;l.f.o.J=(J/11);l.f.o.4n=(J/11);l.f.o.4m=(J/11);l.f.o.3j="4l(J="+J+")";c(J>3g)l.f.o.3j=\'2y\';c(J>0)l.f.o.1c=\'21\';c(J<=0)l.f.o.1c=\'2s\'}g 2x(1l,1k,18,3i){b 23=Q[1l];b l=23.m[1k];b G=l.G;b 1F=l.1F;b 1E=l.1E;b V=l.1H;b 2v=l.2w;b 1D=l.1G;b 1j=l.1j;l.M=18;b 2t=1A()-1F;b 22=35()-1E;c(!1j){c(G==1&&3i==0){b h=2v-18*2v/11;1g(l.f,h,2t,22,0);l.f.o.2u=-h+1D+\'L\'}I{b w=V-18*V/11;1g(l.f,0,2t,22,w);l.f.o.20=-w+\'L\'}}I{b w=V-18*V/11;b 3h=V-w;1g(l.f,0,3h,22,0);l.f.o.20=w+\'L\'}c(18<=0){l.f.o.1c=\'2s\';1g(l.f,0,0,0,0);l.f.o.20=\'3f\';}c(18>0){l.f.o.1c=\'21\';}c(18>3g){1g(l.f,0,0,0,0);l.f.o.20=\'3f\';}}g 3d(1i){E!(/[^\\t\\n\\r ]/.4k(1i.4j))}g 1B(1i){E(1i.3e==8)||((1i.3e==3)&&3d(1i))}g 3a(1C){15((1C=1C.4i)){c(!1B(1C))E 1C}E P}g 1Z(f,2r){b 1h=f.3c[0];3b{15(1h.17!=2r){c(!1B(1h)&&!2r)2q;1h=3a(1h)}E 1h}39(38){E P}}g 1g(f,2p,2o,2n,2m){c((2p==0)&&(2o==0)&&(2n==0)&&(2m==0)){b 37=f.o.16;f.o.16=37.4h(/36: {0,2}.*\\);{0,1}/i,\'\');E}f.o.36=\'4g(\'+2p+\'L, \'+2o+\'L, \'+2n+\'L, \'+2m+\'L)\'}g 1A(){E U.2l.4f}g 35(){E U.2l.4e}g 1Y(){E U.2l.4d}g 1X(u){b 2k=2j=0;c(u.33){4c{2k+=u.34;2j+=u.1z}15(u=u.33)}E[2k,2j]}1b=O();g 1V(){b i,1f;B(i=0;i<1b.q;i++){1f=1b[i];c(1f!=1V)1f()}}g 4b(1f){c(T.1W&&T.1W!=1V)1b[1b.q]=T.1W;T.1W=1V;1b[1b.q]=1f}',62,287,'|||||||||||var|if|cl|this|handler|function|||||layer|_0||style|index|length||||obj|||||||for|_1|params_array|return|current_layer|level|num|else|opacity|timer|px|degree|new|Array|null|obj_menu|getElementsByTagName|true|window|document|width|button|false|MLDDM_CLASS|speed||100|nodes|open_layers|timeouts|while|cssText|nodeName|pos|rule|_2|_3|visibility|setTimeout|cssrules|loaderFunc|uniclip|node|nod|reverse|layer_num|obj_num|dnodes|all_li|_4|layers_to_hide|parentNode|currobj|className|_5|_6|buttoncss|toLowerCase|showed|_7|offsetTop|getClientWidth|is_ignorable|sib|margintop|ya|xa|topmargin|outerwidth|_8|li|specific_nodes|_9|_10|ul|value|_11|_12|slide|currentobj|opac_end|candidates|callAllLoaders|onload|findPos|getScrollLeft|getchildnode|marginLeft|visible|maxclip_h|object|setpositions|_13|innerwidth|offsetWidth|maxwidth|nodesww|pcloseall|getlayerindex|currentli|root_style|selectorText|clearTimeout|_14|_15|params|curtop|curleft|documentElement|y2|x2|y1|x1|break|nodename|hidden|maxclip_w|marginTop|height|outerheight|changePOS|none|changeOpac|pmopentime|top|left|_16|shifter|parentindex|border|anodes|_17|layer_handler|_18|mclose|mcancelclosetime|_19|UL|ind|_20|layer_width|border_width|next_style|noin_style|styleSheets|hover|_21|highlight_button|direction|1000|mlddm_effect|createmenuobjects|offsetParent|offsetLeft|getClientHeight|clip|csstext|err|catch|node_after|try|childNodes|is_all_ws|nodeType|auto|98|mw|ori|filter|openLayer|storebuttoncss|getparentbutton|getparentheight|gettopmargin|innerheight|offsetHeight|getparentindex|getlevel|display|onclick|eventscroll|eventresize|allover|onmouseover|allout|onmouseout|eventclick|eventout|eventover|debug|getElementById|canceldelay|mclosetime|mopen|max_right|layer_absx|scroll_left|client_width|next_selector|root_selector|noin_selector|LI|activate|updateglobalstate|hide|fade|show|375|mlddm_md|round|Math|mlddm_closeonclick|mlddm_highlight|mlddm_delay|mlddm_direction|mlddm_orientation|mlddm_effect_speed|mlddm_timeout|mlddm_shifty|mlddm_shiftx|obj_n|mlddmenu|appendLoader|do|scrollLeft|clientHeight|clientWidth|rect|replace|nextSibling|data|test|alpha|KhtmlOpacity|MozOpacity|block|onscroll|onresize|continue|rules|cssRules|0px|opac_start|split|getAttribute|md7|mlddminit|mlddm|300|500'.split('|')))
appendLoader(mlddminit);

/*Houseofnames scripts below*/

var shopCartOkToHide = false;  
var curSize="";
var transition;
var transCtr=0; 
var transition_A;
var transCtr_A=0; 

var tmrCartStartDate = new Date(); //for comparing shop cart preview start time with end time for showing/hiding the shop cart preview
var tmrCartEndDate = new Date(); //for comparing shop cart preview start time with end time for showing/hiding the shop cart preview
var cartTimeOut;
var cartTimer_is_on=0;


var mlddm_shiftx       = 3;       // horizontal submenu shifting (in pixels)
var mlddm_shifty       = -3;      // vertical submenu shifting (in pixels)	
var mlddm_timeout      = 500;     // delay before closing (in milliseconds)
var mlddm_effect       = 'slide'; // specifies the visual effect for submenus (can be 'none', fade', 'slide')
var mlddm_effect_speed = 150;     // specifies the visual effect speed
var mlddm_orientation  = 'h';     // specifies the horizontal or vertical orientation (can be 'h' or 'v')
var mlddm_direction    = 1;       // on/off automatic submenus direction (submenus on left side when not enough right space) (can be 1 or 0)
var mlddm_delay        = 50;      // delay before first menu opening (in milliseconds). Useful to prevent accidental hovers
var mlddm_highlight    = 1;       // keep 'hover' pseudo class style on the parent active items. (can be 1 or 0)
var mlddm_closeonclick = 1;       // closing menu when onclick event happens. (can be 1 or 0)



//if ie9 use fade
var userAgt=navigator.userAgent.toLowerCase();
if (userAgt.indexOf("msie 9") != -1){
	mlddm_effect       = 'fade';
	mlddm_effect_speed = 40;
}

//prevent page from being loaded within a frame
try{
if (self != top)
{
   if (document.images)
      top.location.replace(window.location.href);
   else
      top.location.href = window.location.href;
}
}catch(er){}

addLoadEvent(initPage);   
 
addLoadEvent(function() {   
     document.onmousemove =showMousePos;  	 
}) 

function checkFirstNameSubmit(){
	var submitPage = true;						
	//if a valid forename was not entered
	if(document.forms.firstNameSearch.fSearchTerm.value == "First Name Search" || document.forms.firstNameSearch.fSearchTerm.value == ""){
		alert("Please enter a valid First Name to search for.")
		submitPage = false;
	}
	return submitPage;
}							
function checkLastNameSubmit(){
	var submitPage = true;							
	//if a valid surname was not entered
	if(document.forms.searchNow.searchTerm.value == "Last Name Search" || document.forms.searchNow.searchTerm.value == ""){
		alert("Please enter a valid Last Name to search for.")
		submitPage = false;
	}
	return submitPage;
}	
  
function doTransition(theId){ 
	//performs the transition by changing the css class using setTimeout for a timer
	//NOTE: width and height seem to be requirements for the div in IE sometimes.  position:relative is also required when a nested position:absolute is used
	transCtr++;
	
	document.getElementById(theId).className = "start" + transCtr;
	if(document.getElementById("fontTransition")!=null)
		document.getElementById("fontTransition").className = "fontStart" + transCtr;
	if(document.getElementById("fontTransition2")!=null)
		document.getElementById("fontTransition2").className = "fontStart" + transCtr;

	for (var n = 1; n <= 8; n++){
		if(document.getElementById("transition" + n)!=null){	
			document.getElementById("transition" + n).style.display="";
			document.getElementById("transition" + n).className = "start" + transCtr;	
		}	
	}	
	
	if(transCtr > 9){
		clearTimeout(transition); 
	}else{
		transition=setTimeout("doTransition('" + theId + "')",100);
	}
}  

function doTransition_A(theId){ 
	//performs the transition by changing the css class using setTimeout for a timer
	//NOTE: width and height seem to be requirements for the div in IE sometimes.  position:relative is also required when a nested position:absolute is used
	transCtr_A++;
	document.getElementById(theId).className = "start" + transCtr_A;

	if(transCtr_A > 9){
		clearTimeout(transition_A); 
	}else{
		transition_A=setTimeout("doTransition_A('" + theId + "')",100);
	}
}


function startTransition(theId){
	//starts the transition effect  
	//NOTE: width and height seem to be requirements for the div in IE sometimes.  position:relative is also required when a nested position:absolute is used
	transCtr = 0;  
	doTransition(theId);
}

function startTransition_A(theId){
	//starts the transition effect  
	//NOTE: width and height seem to be requirements for the div in IE sometimes.  position:relative is also required when a nested position:absolute is used
	transCtr_A = 0;  
	doTransition_A(theId);
}

function addLoadEvent(func) {   
   var oldonload = window.onload;   
   if (typeof window.onload != 'function') {   
     window.onload = func;   
   } else {   
     window.onload = function() {   
       if (oldonload) {   
         oldonload();   
       }   
       func();   
     }   
   }   
}  

function hideDiv(){
	//hides the div that is shown and hide the transparent background
	document.getElementById('transBlack').style.display = "none";
	document.getElementById('divShowHide').style.display="none";
}

function showDiv(divName,divWidth,divHeight){
	//displays an element such as a div centered in the screen	
	var outerWidth = divWidth + 30; //30 is the left and right border width
	var outerHeight = divHeight + 30; //30 is the top and bottom border width 
	if (window.innerHeight && window.scrollMaxY) {// Firefox		
		yWithScroll = window.innerHeight + window.scrollMaxY;		
		xWithScroll = window.innerWidth + window.scrollMaxX;	
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac		
		yWithScroll = document.body.scrollHeight;		
		xWithScroll = document.body.scrollWidth;	
	} else { // works in Explorer 6 Strict, Mozilla (not FF) and Safari		
		yWithScroll = document.body.offsetHeight;		
		xWithScroll = document.body.offsetWidth;  	
	}		
	document.getElementById("transBlack").style.height = yWithScroll + "px";
	document.getElementById('transBlack').style.display = "";
	document.getElementById("divShowHide").style.width = outerWidth + 'px';
	document.getElementById("divShowHide").style.height = outerHeight + 'px';			
	document.getElementById("divShowHide").innerHTML = "<div style='width:" + outerWidth + "px;'> <div class='boxTopLeft'></div><div class='boxTop' style='width:" + divWidth + "px;'></div><div class='boxTopRight'></div><div style='clear:both'></div><div class='boxLeft' style='height:" + divHeight + "px'></div><div style='float:left;background:#F4F4F4;width:" + divWidth + "px;height:" + divHeight + "px'><div id='transDivMain' style='background:#F4F4F4;height:" + divHeight + "px'>" + document.getElementById(divName).innerHTML + "</div></div><div class='boxRight' style='height:" + divHeight + "px'></div><div style='clear:both'></div><div class='boxBotLeft'></div><div class='boxBottom' style='width:" + divWidth + "px;'></div><div class='boxBotRight'></div><div style='clear:both'></div> </div>"
	if(parseInt((screen.width/2)-(divWidth/2)) < 1){
		document.getElementById("divShowHide").style.left = '75px';	
	}else{
		document.getElementById("divShowHide").style.left = (screen.width/2)-(divWidth/2) + 'px';
	}	
	//document.getElementById("divShowHide").style.top = (screen.height/2) - (divHeight)  + document.documentElement.scrollTop + document.body.scrollTop + 'px'; //
	if (parseInt(screen.width) < 1152 && divHeight > 350){//check for a small screen
		document.getElementById("divShowHide").style.top = 50 + document.documentElement.scrollTop + document.body.scrollTop + 'px'; //
	}else{
		document.getElementById("divShowHide").style.top = (screen.height/2) - (divHeight)  + document.documentElement.scrollTop + document.body.scrollTop + 'px'; //
	}	
	document.getElementById("divShowHide").innerHTML = document.getElementById("divShowHide").innerHTML;
	document.getElementById("divShowHide").style.display  = '';
	startTransition("transDivMain");
}


function setBackgroundImage (id, imageURL) {
	try{
	  if (document.layers)
	    document[id].background.src = imageURL == 'none' ? null : imageURL;
	  else if (document.all)
	    document.all[id].style.backgroundImage = imageURL == 'none' ? 'none' : 'url(' + imageURL + ')';
	  else if (document.getElementById)
	    document.getElementById(id).style.backgroundImage = imageURL == 'none' ? 'none' : 'url(' + imageURL + ')';
	}catch(er){}
}	 

function showTab(tabName){
	//show the tab passed
	//try{ 
		document.getElementById("divSpDetails").style.display = "none";
		if(document.getElementById("divSpTestimonials")!=null)
			document.getElementById("divSpTestimonials").style.display = "none";		
		document.getElementById("divSpMore").style.display = "none";

		document.getElementById("tabDetails").className = "regTab";
		if (document.getElementById("tabTestimonials")!=null)
			document.getElementById("tabTestimonials").className = "regTab";
		document.getElementById("tabMore").className = "regTab";
		document.getElementById("tab" + tabName).className = "focusTab";
		document.getElementById("divSp" + tabName).style.display = "";		
		//document.forms.frmChors.hidCurTab.value = tabName;	
	//}catch(er){}	
}

function getMousePosition(e) 
{
 try{	 
   return !isNaN(e.pageX) ? {'x':e.pageX, 'y':e.pageY} : 
      {'x':e.clientX + document.documentElement.scrollLeft + document.body.scrollLeft, 
 'y':e.clientY + document.documentElement.scrollTop + document.body.scrollTop};
 }catch(er){} 
};

//note already know where the products box is going to be displayed  



function hideBtn() {
	//for hiding the divs and images related to button bar that was just hovered off of by the user
	try{
		if(shopCartOkToHide==true)
			document.getElementById("divShoppingCart").style.display = 'none';
	}catch(er){}
}



function cartTimedCount() //do cart timer intervals to check if should hide cart preview
 {
	var cartTimeDif = 0;
	tmrCartEndDate = new Date(); //for comparing shop cart preview start time with end time for showing/hiding the shop cart preview
	cartTimeDif = tmrCartEndDate.valueOf() - tmrCartStartDate.valueOf(); //substract end date from startdate of when cart was supposed to be visible.
	if(cartTimeDif > 3000){
		stopCartCount();
		hideBtn();	
	}else{
		cartTimeOut=setTimeout("cartTimedCount()",1000);
	}
 }
 
function doCartTimer()// start the cart timer if it's not on
 {
 if (!cartTimer_is_on) 
   {
   cartTimer_is_on=1;
   cartTimedCount();
   }
 }
 
 function stopCartCount()//turns off the shopping cart timer
 {
 clearTimeout(cartTimeOut);
 cartTimer_is_on=0;
 }
 

function showMousePos(e)
{
	try{
		var cartTimeDif = 0;	
		
		var yOffset = 0;
		var yOffBtns=document.getElementById('divShoppingCart').offsetTop;//btn_Bar
		var xOffBtns=document.getElementById('divShoppingCart').offsetLeft;//btn_Bar
		var btnBarBot=document.getElementById('divShopCartBot').offsetTop;//btnBarBot
		var xOffBtnRight=xOffBtns + 400; //document.getElementById('btnBarRightGif').offsetLeft;
		yOffset = document.getElementById('mainArea').offsetTop;
		var xOffset = document.getElementById('mainArea').offsetLeft;		
		btnBarBot = btnBarBot + yOffBtns; 
		xOffBtnRight = xOffBtnRight + 400;//add 54 to account for width
	
		if (!e) e = event;  // make sure we have a reference to the event
		var mp = getMousePosition(e);	
		
		//input.value = 'x : ' + mp.x + ', y : ' + mp.y;
		//if(mp.x > 66 && mp.x < 938 && mp.y > 77 + yOffset && mp.y < 110 + yOffset){ 
		if(mp.x > xOffBtns + xOffset && mp.x < xOffBtnRight + xOffset && mp.y > yOffBtns + yOffset && mp.y < btnBarBot + yOffset){
			//mouse is in the button area so do nothing
			shopCartOkToHide = true;
			tmrCartStartDate = new Date(); //for comparing shop cart preview start time with end time for showing/hiding the shop cart preview
			if(cartTimer_is_on=1) //check if cart timer should be turned off
				stopCartCount();
		}else{	
			tmrCartEndDate = new Date(); //for comparing shop cart preview start time with end time for showing/hiding the shop cart preview
			doCartTimer(); //start a timer to check if mouse position is not over the cart area
		}			
	}catch(er){}
};


function initPage(){
	var startPos=0;
	var gr=""; //groupname
	var pr="";//productname
	var ctr=1;		
	var halfBg=0;
	
	try{
		var pgURL = location.href.toLowerCase();		
		//if ((parseInt(screen.width) > 1152 || pgURL.indexOf("/sample_symbolism") > 0) && (userAgt.indexOf("msie 6") == -1 && userAgt.indexOf("msie 5") == -1)){ //if the screen width is > than 1152 then widen the page			
		if (parseInt(screen.width) > 1152 || pgURL.indexOf("/sample_symbolism") > 0){ //if the screen width is > than 1152 then widen the page			
			if (userAgt.indexOf("msie 6") != -1 || userAgt.indexOf("msie 5") != -1){
				document.getElementById('mainArea').style.width = "1152px";
				document.getElementById('btnBar').style.width = "1086px";
				document.getElementById('nameSearches').className = "nameSearchesIE6";
				setBackgroundImage('hdrBanner',"/i/tophonIE6.gif");
			}else{
				document.getElementById('mainArea').style.width = "1152px";				
			}
			halfBg = parseInt((parseInt(screen.width) - 1152) / 2)-10; //get half of total background area (for a side)					
		}else{
			document.getElementById('tdMain').style.width = "922px";
			document.getElementById('mainArea').style.width = "949px";
			if (userAgt.indexOf("msie 6") != -1 || userAgt.indexOf("msie 5") != -1){
				document.getElementById('btnBar').style.width = "880px";
				document.getElementById('nameSearches').className = "nameSearchesIE6";
			}else{			
				document.getElementById('btnBar').style.width = "903px";
			}
			if (userAgt.indexOf("iphone") != -1)
				document.getElementById('nameSearches').className = "";
				
			document.getElementById('btnHome').style.width = "75px";
			document.getElementById('btnDownloads').style.width = "75px";
			document.getElementById('btnPrints').style.width = "75px";
			document.getElementById('btnApparel').style.width = "75px";
			document.getElementById('btnCeramics').style.width = "75px";
			document.getElementById('btnOther').style.width = "75px";
			if(document.getElementById('btnSignIn')!=null)
				document.getElementById('btnSignIn').style.width = "75px";
			
			if (userAgt.indexOf("msie 6") != -1 || userAgt.indexOf("msie 5") != -1){
				setBackgroundImage('hdrBanner',"/i/tophon949Width.gif");
			}else{			
				setBackgroundImage('hdrBanner',"/i/tophon949Width.png");
			}
			//normal size, nothing changed
			halfBg = parseInt((parseInt(screen.width) - 949) / 2); //get half of total background area (for a side)
		}
		
		if(document.getElementById('leftBg')!=null){
			document.getElementById('leftBg').style.width = halfBg + "px";
			document.getElementById('rightBg').style.width = halfBg + "px";		
			if(halfBg<60){
				//could use smaller images if desired
			}			
		}	
	}catch(er){}	

	
	curSize=getCookie("textSize");	
	
	//if size in cookie then use it to set the size 
	if (curSize!="")
		changeSize(0); 	

				
}
//only replaces values 1 character in length
function replace(argvalue, replaceFrom, replaceTo) {
  argvalue = argvalue.toString();
  var newValue = "";
  for (var n = 0; n < argvalue.length; n++){
    if (argvalue.substring(n, n+1) == replaceFrom){
    newValue = newValue + replaceTo;
    } else {
          newValue = newValue + argvalue.substring(n, n+1);      
    }
  } 
    return newValue;
}
function changeSize(addSizeVal){
	var originalSize;	
	if (curSize=="")//if never used
		curSize=0;
	originalSize=curSize;	
	curSize = parseInt(curSize)+parseInt(addSizeVal);	
	if (parseInt(curSize)>4||parseInt(curSize)<-2) 	
		curSize = originalSize;	
	setCookie("textSize",curSize,90,"/");	
	var ctr=1;	
	while(document.getElementById("sizeTxt" + ctr) != null){
		sizeT = document.getElementById("sizeTxt" + ctr);
		sizeT.className="fSize" + curSize;		
		ctr++;
	}	
}	

function setCookie(name,value,duration,path,domain,secure){
cookiestring=name+"="+escape(value)+";EXPIRES="+getexpirydate(duration) + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + ((secure) ? "; secure" : "");
document.cookie=cookiestring;
} 
function getexpirydate( nodays){
var UTCstring;
Today = new Date();
nomilli=Date.parse(Today);
Today.setTime(nomilli+nodays*24*60*60*1000);
UTCstring = Today.toUTCString();
return UTCstring;
}	
function getCookie(cookiename) {
 var cookiestring=""+document.cookie;
 var index1=cookiestring.indexOf(cookiename);
 if (index1==-1 || cookiename=="") return ""; 
 var index2=cookiestring.indexOf(';',index1);
 if (index2==-1) index2=cookiestring.length; 
 return unescape(cookiestring.substring(index1+cookiename.length+1,index2));
}
function Rcertify() { 
  popupWin = window.open('http://www.bbb.org/ottawa/business-reviews/personal-services/swyrich-corporation-in-kingston-on-2229#sealclick', 'Participant', 'location=yes,scrollbars=yes,width=550,height=300');
  window.name = 'opener'; 
}
function popUp(url) {
	sealWin=window.open(url,"win",'toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=500,height=550');
	self.name = "mainWin"; 
}
function new_window(url)  {
	links = window.open(url, 'Link', 'toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=0, resizable=1, width=325, height=370, left=330, top=160');
}
function newWindow(url,width,height){
	options = 'toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=0, resizable=1, width=' + width + ', height=' + height + ', left=330, top=160';
	tourWin = window.open(url, "win", options);
	self.name = "mainWin";
}
 
function navigateTo(prod,sId,surname,origin){	
	if(prod=="JPG-CLAN"||prod=="CLAN-PRINT"||prod=="TIL-1005"||prod=="TIL-1006"){
		location.href = "/clanresults.asp?item=" + prod + "&surname=" + surname;
	}else{	
		location.href = "/nameresults.asp?item=" + prod + "&surname=" + surname + "&origin=" + origin;
	}
	return false;
}

function newWindow(url) { 
	popupWin = window.open
	(url, 'Participant', 'location=no,scrollbars=yes,width=600,height=400');
}

function email_friend()
{
	var e_add= "";//prompt('Enter your friend\'s email address:',' ');
	var subj= "HouseOfNames Web Page"; //prompt('Enter the subject of your message:',' ');
	var e_body = ""
	if (location.href.indexOf("?") > 0){ //tried to append source=emailFriendReferrel 
		e_body = "You may be interested in this HouseOfNames.com web page " + location.href.replace("&","%26") + "%26source=emailFriendReferrel";
	}else{
		e_body = "You may be interested in this HouseOfNames.com web page " + location.href.replace("&","%26") + "?source=emailFriendReferrel" ;
	}
	if ((subj==" ") || (subj==null))
	 	subj="Hi!";
	if (e_add==null)
		e_add=""; 
	window.location="mailto:"+e_add+"?subject="+subj+"&body="+e_body;
}	
function switchDesc(id) {
	var button = document.getElementById("switch_"+id);
	if(button==null)
		return true;	
	var part2 = document.getElementById("fullDesc_"+id);		
	if(button.className=='plusDesc') { //expand
		button.className='minusDesc';
		if(part2!=null) part2.style.display='inline';	
	} else if(button.className=='minusDesc') { // contract
		button.className='plusDesc';
		if(part2!=null) part2.style.display='none';	
	}
	if( navigator != null && navigator.userAgent != null && navigator.userAgent.indexOf("Firefox") != -1 )
		document.body.innerHTML = document.body.innerHTML; // force firefox to re-compute the layout
	return false;
}


//============================================================================//
//  Gavin Brock's CSS/JavaScript Animated Odometer
//  Version 1.0 - April 7th 2008
//============================================================================//
//  Copyright (C) 2008 Gavin Brock
//
//  This program is free software: you can redistribute it and/or modify
//  it under the terms of the GNU General Public License as published by
//  the Free Software Foundation, either version 3 of the License, or
//  (at your option) any later version.
//
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//
//  You should have received a copy of the GNU General Public License
//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
//============================================================================//

function Odometer (parentDiv,opts) {
    if (!parentDiv) throw "ERROR: Odometer object must be past a document element.";

    this.digits       = 6;
    this.tenths       = 0;
    this.digitHeight  = 40;
    this.digitPadding = 0;
    this.digitWidth   = 30;
    this.bustedness   = 2;
    this.fontStyle    = "font-family: Courier New, Courier, monospace; font-weight: 900;";
    this.value        = -1;

    for (var key in opts) { this[key] = opts[key]; }

    var style = {
        digits:        "position:absolute; height:"+this.digitHeight+"px; width:"+(this.digitWidth-(2*this.digitPadding))+"px; "+
                       "padding:"+this.digitPadding+"px; font-size:"+(this.digitHeight-(2*this.digitPadding))+"px; "+
                       "background:black; color:white; text-align:center; "+this.fontStyle,
        columns:       "position:relative; float:left; overflow:hidden;"+
                       "height:"+this.digitHeight+"px; width:"+this.digitWidth+"px;",
        highlight:     "position:absolute; background:white; opacity:0.25; filter:alpha(opacity=25); width:100%; left:0px;",
        lowlight:      "position:absolute; background:black; opacity:0.25; filter:alpha(opacity=25); width:100%; left:0px;",
        sidehighlight: "position:absolute; background:white; opacity:0.50; filter:alpha(opacity=50); height:100%; top:0px;",
        sidelowlight:  "position:absolute; background:black; opacity:0.50; filter:alpha(opacity=50); height:100%; top:0px;"
    };

    var highlights = [
        "top:20%;   height:32%;" + style.highlight,
        "top:27.5%; height:16%;" + style.highlight,
        "top:32.5%; height:6%;"  + style.highlight,
        "right:0%;  width:6%;"   + style.sidelowlight,
        "left:0%;   width:4%;"   + style.sidehighlight,
        "top:0%;    height:14%;" + style.lowlight,
        "bottom:0%; height:25%;" + style.lowlight,
        "bottom:0%; height:8%;"  + style.lowlight
    ];

    this.setDigitValue = function (digit, val, frac) {
	var di = digitInfo[digit];
       	var px = Math.floor(this.digitHeight * frac);
	px = px + di.offset;
	if (val != di.last_val) {
		var tmp = di.digitA;
		di.digitA = di.digitB;
		di.digitB = tmp;
        	di.digitA.innerHTML = val;
        	di.digitB.innerHTML = (1+Number(val)) % 10;
		di.last_val = val;
	}
	if (px != di.last_px) {
        	di.digitA.style.top = (0-px)+"px";
        	di.digitB.style.top = (0-px+this.digitHeight)+"px";
		di.last_px = px;
	}
    };


    this.set = function (inVal) {
        if (inVal < 0) throw "ERROR: Odometer value cannot be negative.";
	this.value = inVal;
	if (this.tenths) inVal = inVal * 10;
        var numb = Math.floor(inVal);
        var frac = inVal - numb;
	numb = String(numb);
        for (var i=0; i < this.digits; i++) {
            var num = numb.substring(numb.length-i-1, numb.length-i) || 0;
            this.setDigitValue(this.digits-i-1, num, frac);
            if (num != 9) frac = 0;
        }
    };

    this.get = function () {
        return(this.value);
    };


    var odometerDiv = document.createElement("div")
    odometerDiv.setAttribute("id","odometer");
    odometerDiv.style.cssText="text-align: left";
    parentDiv.appendChild(odometerDiv);

    var digitInfo = new Array();
    for (var i=0; i < this.digits; i++) {
        var digitDivA = document.createElement("div");
        digitDivA.setAttribute("id","odometer_digit_"+i+"a");
        digitDivA.style.cssText=style.digits;

        var digitDivB = document.createElement("div");
        digitDivB.setAttribute("id","odometer_digit_"+i+"b");
        digitDivB.style.cssText = style.digits;

        var digitColDiv = document.createElement("div");
        digitColDiv.style.cssText = style.columns;

        digitColDiv.appendChild(digitDivB);
        digitColDiv.appendChild(digitDivA);

        for (var j in highlights) {
            var hdiv = document.createElement("div");
            hdiv.innerHTML="<p></p>"; // For Dumb IE
            hdiv.style.cssText = highlights[j];
            digitColDiv.appendChild(hdiv);
        }
        odometerDiv.appendChild(digitColDiv);
	var offset = Math.floor(Math.random()*this.bustedness);
	digitInfo.push({digitA:digitDivA, digitB:digitDivB, last_val:-1, last_px: -1, offset:offset});
    };


    if (this.tenths) {
	digitInfo[this.digits - 1].digitA.style.background = "#cccccc";
	digitInfo[this.digits - 1].digitB.style.background = "#cccccc";
	digitInfo[this.digits - 1].digitA.style.color = "#000000";
	digitInfo[this.digits - 1].digitB.style.color = "#000000";
    }

    if (this.value >= 0) this.set(this.value);
}

